@croquiscom/pds 0.12.0 → 0.13.0
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/CHANGELOG.md +8 -0
- package/dist/dropdown/Dropdown.d.ts +18 -0
- package/dist/dropdown/Dropdown.stories.d.ts +10 -0
- package/dist/dropdown/DropdownItem.d.ts +10 -0
- package/dist/dropdown/DropdownLabel.d.ts +17 -0
- package/dist/dropdown/index.d.ts +1 -0
- package/dist/dropdown/styles.d.ts +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CSSValueWithLength } from '../styles/buildCSSWithLength';
|
|
3
|
+
export interface DropdownOption<OptionValue> {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: OptionValue;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DropdownProps<OptionValue> {
|
|
9
|
+
className?: string;
|
|
10
|
+
width?: CSSValueWithLength;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
options: Array<DropdownOption<OptionValue>>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
value?: OptionValue;
|
|
15
|
+
keyExtractor?: (item: DropdownOption<OptionValue>, index: number) => string | number;
|
|
16
|
+
onChange?: (value: OptionValue) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const Dropdown: <OptionValue extends string | number>({ className, width, disabled, options, placeholder, value, keyExtractor, onChange, }: DropdownProps<OptionValue>) => JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { Dropdown } from './Dropdown';
|
|
4
|
+
declare const _default: ComponentMeta<(<OptionValue extends string | number>({ className, width, disabled, options, placeholder, value, keyExtractor, onChange, }: import("./Dropdown").DropdownProps<OptionValue>) => JSX.Element)>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Base: any;
|
|
7
|
+
export declare const Disabled: any;
|
|
8
|
+
export declare const DisabledOptionItem: any;
|
|
9
|
+
export declare const WithIcon: ComponentStory<typeof Dropdown>;
|
|
10
|
+
export declare const Controlled: ComponentStory<typeof Dropdown>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { LiHTMLAttributes } from 'react';
|
|
2
|
+
export interface DropdownItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* @default false
|
|
6
|
+
* Option 선택 여부
|
|
7
|
+
*/
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const DropdownItem: React.ForwardRefExoticComponent<DropdownItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { AllHTMLAttributes } from 'react';
|
|
2
|
+
import { CSSValueWithLength } from '../styles/buildCSSWithLength';
|
|
3
|
+
export interface DropdownLabelProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
4
|
+
width?: CSSValueWithLength;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* @default false
|
|
8
|
+
* Option listbox 오픈 여부
|
|
9
|
+
*/
|
|
10
|
+
expanded?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @default false
|
|
13
|
+
* Option 선택 여부
|
|
14
|
+
*/
|
|
15
|
+
selected?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare const DropdownLabel: React.ForwardRefExoticComponent<DropdownLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Dropdown';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const dropdown_label_base_css: import("@emotion/utils").SerializedStyles;
|
|
2
|
+
export declare const dropdown_label_expanded_style: {
|
|
3
|
+
border: string;
|
|
4
|
+
'&:hover': {
|
|
5
|
+
border: string;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const dropdown_label_selected_style: {
|
|
9
|
+
color: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const dropdown_item_group_css: import("@emotion/utils").SerializedStyles;
|
|
12
|
+
export declare const dropdown_item_base_css: import("@emotion/utils").SerializedStyles;
|
|
13
|
+
export declare const dropdown_item_disabled_style: {
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
color: string;
|
|
16
|
+
cursor: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const dropdown_item_selected_style: {
|
|
19
|
+
backgroundColor: string;
|
|
20
|
+
color: string;
|
|
21
|
+
'&:hover, &:focus': {
|
|
22
|
+
backgroundColor: string;
|
|
23
|
+
};
|
|
24
|
+
};
|