ddingdong-design-system 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ddingdong-design-system.es.js +387 -378
- package/dist/ddingdong-design-system.es.js.map +1 -1
- package/dist/ddingdong-design-system.umd.js +1 -1
- package/dist/ddingdong-design-system.umd.js.map +1 -1
- package/dist/shared/ui/Select/Option.d.ts +8 -2
- package/dist/shared/ui/Select/Select.context.d.ts +13 -8
- package/dist/shared/ui/Select/SelectButton.d.ts +13 -0
- package/dist/shared/ui/Select/SelectMain.d.ts +8 -8
- package/dist/shared/ui/assets/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -3,8 +3,14 @@ declare const optionVariants: (props?: ({
|
|
|
3
3
|
size?: "md" | "lg" | null | undefined;
|
|
4
4
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
5
|
type Props = {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The display name for the option.
|
|
8
|
+
*/
|
|
7
9
|
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Additional classes to apply to the option.
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
8
14
|
} & VariantProps<typeof optionVariants>;
|
|
9
|
-
export declare function Option({
|
|
15
|
+
export declare function Option({ name, size, className }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
16
|
export {};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
type OptionProps = {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
1
|
export type SelectContextType = {
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The currently selected option.
|
|
4
|
+
*/
|
|
5
|
+
selected: string;
|
|
6
|
+
/**
|
|
7
|
+
* Callback function called when the selected option changes.
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
onSelect: (option: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* The size of the select component.
|
|
13
|
+
*/
|
|
8
14
|
size: 'md' | 'lg';
|
|
9
15
|
};
|
|
10
|
-
export declare const SelectContext: import('react').Context<SelectContextType |
|
|
16
|
+
export declare const SelectContext: import('react').Context<SelectContextType | null>;
|
|
11
17
|
export declare const useSelectContext: () => SelectContextType;
|
|
12
|
-
export {};
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* The currently selected option.
|
|
4
|
+
*/
|
|
2
5
|
selected: string;
|
|
6
|
+
/**
|
|
7
|
+
* Callback function to be called when the button is clicked.
|
|
8
|
+
* @returns void
|
|
9
|
+
*/
|
|
3
10
|
onClick: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the dropdown is open or closed.
|
|
13
|
+
*/
|
|
4
14
|
isOpen: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The size of the button.
|
|
17
|
+
*/
|
|
5
18
|
size?: 'md' | 'lg';
|
|
6
19
|
};
|
|
7
20
|
export declare function SelectButton({ selected, onClick, isOpen, size }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
type OptionProps = {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
6
2
|
type Props = {
|
|
7
3
|
/**
|
|
8
4
|
* The size of the select component.
|
|
9
5
|
* @default 'lg'
|
|
10
6
|
*/
|
|
11
7
|
size?: 'md' | 'lg';
|
|
8
|
+
/**
|
|
9
|
+
* The currently selected option.
|
|
10
|
+
*/
|
|
11
|
+
value: string;
|
|
12
12
|
/**
|
|
13
13
|
* Callback function called when the selected option changes.
|
|
14
14
|
*/
|
|
15
|
-
onChange?: (option:
|
|
15
|
+
onChange?: (option: string) => void;
|
|
16
16
|
/**
|
|
17
17
|
* The default value of the select component.
|
|
18
18
|
*/
|
|
@@ -21,6 +21,6 @@ type Props = {
|
|
|
21
21
|
* The content to be displayed inside the select component.
|
|
22
22
|
*/
|
|
23
23
|
children: ReactNode;
|
|
24
|
-
}
|
|
25
|
-
export declare function SelectMain({
|
|
24
|
+
} & Omit<ComponentProps<'select'>, 'value' | 'onChange' | 'size'>;
|
|
25
|
+
export declare function SelectMain({ value, onChange, size, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export {};
|