Skip to content

refactor: ♻️ exported TS types back #632

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/hooks/use-multi-select.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";

import { ISelectProps, Option } from "../lib/interfaces";
import { Option, SelectProps } from "../lib/interfaces";

const defaultStrings = {
allItemsAreSelected: "All items are selected.",
Expand All @@ -14,21 +14,21 @@ const defaultStrings = {
create: "Create",
};

const defaultProps: Partial<ISelectProps> = {
const defaultProps: Partial<SelectProps> = {
value: [],
hasSelectAll: true,
className: "multi-select",
debounceDuration: 200,
options: [] as Option[],
};

interface MultiSelectContextProps extends ISelectProps {
interface MultiSelectContextProps extends SelectProps {
t: (key: string) => string;
setOptions?;
}

interface MultiSelectProviderProps {
props: ISelectProps;
props: SelectProps;
children;
}

Expand Down
3 changes: 3 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { Option, SelectProps } from "./lib/interfaces";
import MultiSelect from "./multi-select";
import Dropdown from "./multi-select/dropdown";
import SelectPanel from "./select-panel";
import SelectItem from "./select-panel/select-item";

export { Dropdown, MultiSelect, SelectItem, SelectPanel };

export type { Option, SelectProps };
2 changes: 1 addition & 1 deletion src/lib/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface Option {
disabled?: boolean;
}

export interface ISelectProps {
export interface SelectProps {
options: Option[];
value: Option[];
onChange?;
Expand Down
4 changes: 2 additions & 2 deletions src/multi-select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import "../style.css";
import React from "react";

import { MultiSelectProvider } from "../hooks/use-multi-select";
import { ISelectProps } from "../lib/interfaces";
import { SelectProps } from "../lib/interfaces";
import Dropdown from "./dropdown";

const MultiSelect = (props: ISelectProps) => (
const MultiSelect = (props: SelectProps) => (
<MultiSelectProvider props={props}>
<div className={`rmsc ${props.className || "multi-select"}`}>
<Dropdown />
Expand Down