uikit-react-public 0.14.21 → 0.17.4
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/README.md +4 -2
- package/dist/components/Accordion/Accordion.Heading.d.ts +4 -4
- package/dist/components/Accordion/Accordion.Panel.d.ts +2 -2
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +57 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +107 -1
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.d.ts +1 -1
- package/dist/components/Datepicker/Datepicker.stories.d.ts +4 -3
- package/dist/components/Datepicker/Datepicker.types.d.ts +4 -5
- package/dist/components/Datepicker/subcomponents/CustomDatepicker.d.ts +4 -1
- package/dist/components/Datepicker/subcomponents/DatepickerInput.d.ts +15 -2
- package/dist/components/Datepicker/subcomponents/Panel.d.ts +1 -1
- package/dist/components/Datepicker/subcomponents/VisibleField.d.ts +6 -1
- package/dist/components/Datepicker/subcomponents/index.d.ts +0 -1
- package/dist/components/Datepicker/utils/index.d.ts +0 -1
- package/dist/components/Dialog/BaseDialog.d.ts +2 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -0
- package/dist/components/Header/Header.d.ts +4 -1
- package/dist/components/Header/Header.stories.d.ts +40 -0
- package/dist/components/Main/Main.d.ts +21 -0
- package/dist/components/Main/Main.stories.d.ts +15 -0
- package/dist/components/Main/index.d.ts +2 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.d.ts +3 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.stories.d.ts +36 -0
- package/dist/components/NativeDatepicker/NativeDatepicker.types.d.ts +10 -0
- package/dist/components/NativeDatepicker/index.d.ts +2 -0
- package/dist/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.d.ts +1 -1
- package/dist/components/NativeDatepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts +1 -0
- package/dist/components/NativeDatepicker/utils/index.d.ts +1 -0
- package/dist/components/Select/Select.stories.d.ts +154 -2
- package/dist/components/Select/Select.types.d.ts +51 -22
- package/dist/components/Select/subcomponents/CustomOption.d.ts +1 -1
- package/dist/components/Select/subcomponents/CustomSelect.d.ts +3 -2
- package/dist/components/Select/subcomponents/FilterInput.d.ts +14 -0
- package/dist/components/Select/subcomponents/NativeSelect.d.ts +5 -1
- package/dist/components/Select/subcomponents/VisibleField.d.ts +3 -1
- package/dist/components/Select/subcomponents/index.d.ts +1 -0
- package/dist/components/WeekPicker/WeekPicker.d.ts +2 -2
- package/dist/components/WeekPicker/WeekPicker.stories.d.ts +41 -0
- package/dist/components/WeekPicker/WeekPicker.types.d.ts +16 -0
- package/dist/components/WeekPicker/index.d.ts +1 -0
- package/dist/components/WeekPicker/subcomponents/CustomDatepicker.d.ts +1 -1
- package/dist/components/index.d.ts +8 -0
- package/dist/hooks/useFocusTrap.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4366 -3768
- package/dist/utils/__tests__/announce.test.d.ts +1 -0
- package/dist/utils/announce.d.ts +6 -0
- package/dist/utils/index.d.ts +1 -0
- package/lib/components/Accordion/Accordion.Heading.tsx +27 -8
- package/lib/components/Accordion/Accordion.Panel.tsx +11 -3
- package/lib/components/Accordion/Accordion.stories.tsx +139 -0
- package/lib/components/Accordion/Accordion.tsx +10 -8
- package/lib/components/Accordion/__tests__/__snapshots__/Accordion.test.tsx.snap +7 -7
- package/lib/components/Accordion/index.ts +2 -0
- package/lib/components/Alert/Alert.stories.tsx +1 -1
- package/lib/components/Avatar/Avatar.mdx +117 -0
- package/lib/components/Avatar/Avatar.stories.tsx +110 -2
- package/lib/components/Blanket/Blanket.stories.tsx +1 -1
- package/lib/components/Button/Button.stories.tsx +1 -1
- package/lib/components/Button/Button.tsx +1 -0
- package/lib/components/Calendar/Calendar.stories.tsx +12 -32
- package/lib/components/Calendar/__tests__/Calendar.test.tsx +23 -15
- package/lib/components/Calendar/index.ts +1 -5
- package/lib/components/Calendar/subcomponents/AcademicWeeks.tsx +2 -1
- package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +5 -1
- package/lib/components/Calendar/subcomponents/EventDot.tsx +2 -1
- package/lib/components/Calendar/subcomponents/index.ts +1 -1
- package/lib/components/Calendar/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.ts +43 -11
- package/lib/components/Calendar/utils/normaliseMonth/normaliseMonth.test.ts +5 -5
- package/lib/components/Datepicker/Datepicker.lld.md +108 -0
- package/lib/components/Datepicker/Datepicker.stories.tsx +44 -5
- package/lib/components/Datepicker/Datepicker.tsx +14 -36
- package/lib/components/Datepicker/Datepicker.types.ts +5 -14
- package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +150 -8
- package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +10 -4
- package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +39 -5
- package/lib/components/Datepicker/subcomponents/DatepickerInput.tsx +30 -17
- package/lib/components/Datepicker/subcomponents/Panel.tsx +6 -2
- package/lib/components/Datepicker/subcomponents/VisibleField.tsx +40 -3
- package/lib/components/Datepicker/subcomponents/index.ts +0 -1
- package/lib/components/Datepicker/utils/index.ts +0 -1
- package/lib/components/Dialog/BaseDialog.tsx +11 -0
- package/lib/components/Dialog/Dialog.tsx +8 -1
- package/lib/components/Dialog/DialogBody.tsx +5 -1
- package/lib/components/Dialog/DialogHeader.tsx +2 -1
- package/lib/components/Divider/Divider.stories.tsx +1 -1
- package/lib/components/Field/ErrorText.tsx +1 -0
- package/lib/components/Field/Field.stories.tsx +1 -1
- package/lib/components/Field/__tests__/Field.test.tsx +13 -0
- package/lib/components/FileInput/FileInput.stories.tsx +1 -1
- package/lib/components/Footer/Footer.stories.tsx +1 -1
- package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +3 -3
- package/lib/components/Header/Header.mdx +52 -0
- package/lib/components/Header/Header.stories.tsx +98 -0
- package/lib/components/Header/Header.tsx +51 -6
- package/lib/components/Header/__tests__/Header.test.tsx +17 -1
- package/lib/components/Heading/Heading.stories.tsx +1 -1
- package/lib/components/Icon/Icon.stories.tsx +1 -1
- package/lib/components/IconButton/IconButton.stories.tsx +1 -1
- package/lib/components/Input/Input.stories.tsx +1 -1
- package/lib/components/Label/Label.stories.tsx +1 -1
- package/lib/components/Main/Main.stories.tsx +36 -0
- package/lib/components/Main/Main.tsx +46 -0
- package/lib/components/Main/__tests__/Main.test.tsx +80 -0
- package/lib/components/Main/__tests__/__snapshots__/Main.test.tsx.snap +33 -0
- package/lib/components/Main/index.ts +2 -0
- package/lib/components/NativeDatepicker/NativeDatepicker.stories.tsx +100 -0
- package/lib/components/{Datepicker/subcomponents → NativeDatepicker}/NativeDatepicker.tsx +14 -15
- package/lib/components/NativeDatepicker/NativeDatepicker.types.ts +19 -0
- package/lib/components/NativeDatepicker/index.ts +2 -0
- package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.ts +1 -1
- package/lib/components/NativeDatepicker/utils/index.ts +1 -0
- package/lib/components/Pagination/PaginationControls.tsx +55 -12
- package/lib/components/Pagination/PaginationInfo.tsx +5 -1
- package/lib/components/Paragraph/Paragraph.stories.tsx +1 -1
- package/lib/components/Search/Search.stories.tsx +1 -1
- package/lib/components/Search/Search.tsx +4 -1
- package/lib/components/Search/__tests__/Search.test.tsx +19 -1
- package/lib/components/Select/Select.mdx +169 -0
- package/lib/components/Select/Select.stories.tsx +191 -43
- package/lib/components/Select/Select.tsx +36 -12
- package/lib/components/Select/Select.types.ts +66 -48
- package/lib/components/Select/__tests__/Select.test.tsx +448 -7
- package/lib/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +1 -1
- package/lib/components/Select/subcomponents/CustomOption.tsx +2 -1
- package/lib/components/Select/subcomponents/CustomSelect.tsx +303 -33
- package/lib/components/Select/subcomponents/FilterInput.tsx +80 -0
- package/lib/components/Select/subcomponents/NativeSelect.tsx +13 -1
- package/lib/components/Select/subcomponents/VisibleField.tsx +11 -3
- package/lib/components/Select/subcomponents/index.tsx +1 -0
- package/lib/components/Snackbar/Snackbar.stories.tsx +1 -1
- package/lib/components/Spinner/Spinner.stories.tsx +1 -1
- package/lib/components/Textarea/Textarea.stories.tsx +1 -1
- package/lib/components/Timepicker/Timepicker.tsx +4 -0
- package/lib/components/Timepicker/__tests__/__snapshots__/Timepicker.test.tsx.snap +2 -2
- package/lib/components/Toggle/Toggle.stories.tsx +1 -1
- package/lib/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/lib/components/WeekPicker/WeekPicker.stories.tsx +147 -0
- package/lib/components/WeekPicker/WeekPicker.tsx +2 -2
- package/lib/components/WeekPicker/WeekPicker.types.ts +21 -0
- package/lib/components/WeekPicker/index.ts +1 -0
- package/lib/components/WeekPicker/subcomponents/CustomDatepicker.tsx +1 -1
- package/lib/components/common/Common.mdx +1 -1
- package/lib/components/index.ts +11 -2
- package/lib/hooks/useFocusTrap.ts +40 -4
- package/lib/index.ts +1 -0
- package/lib/utils/__tests__/announce.test.ts +121 -0
- package/lib/utils/announce.ts +134 -0
- package/lib/utils/index.ts +1 -0
- package/package.json +3 -6
- package/dist/components/Datepicker/subcomponents/NativeDatepicker.d.ts +0 -6
- package/lib/components/Accordion/Accordion.stories.tsx.NOT_READY +0 -93
- /package/dist/components/{Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts → Main/__tests__/Main.test.d.ts} +0 -0
- /package/lib/components/{Datepicker → NativeDatepicker}/utils/dateToLocaleISOString/dateToLocaleISOString.test.ts +0 -0
|
@@ -3,45 +3,195 @@ declare const meta: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
component: <T extends string | number = string>(props: import('./Select.types').SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
argTypes: {
|
|
6
|
+
selectionBehaviour: {
|
|
7
|
+
description: string;
|
|
8
|
+
control: {
|
|
9
|
+
type: "radio";
|
|
10
|
+
};
|
|
11
|
+
options: string[];
|
|
12
|
+
table: {
|
|
13
|
+
type: {
|
|
14
|
+
summary: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
options: {
|
|
19
|
+
description: string;
|
|
20
|
+
control: {
|
|
21
|
+
type: "object";
|
|
22
|
+
};
|
|
23
|
+
table: {
|
|
24
|
+
type: {
|
|
25
|
+
summary: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
6
29
|
value: {
|
|
30
|
+
description: string;
|
|
7
31
|
control: {
|
|
8
32
|
type: "text";
|
|
9
33
|
};
|
|
34
|
+
table: {
|
|
35
|
+
type: {
|
|
36
|
+
summary: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
onValueChange: {
|
|
41
|
+
description: string;
|
|
42
|
+
control: false;
|
|
43
|
+
table: {
|
|
44
|
+
type: {
|
|
45
|
+
summary: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
10
48
|
};
|
|
11
49
|
native: {
|
|
50
|
+
description: string;
|
|
12
51
|
control: {
|
|
13
52
|
type: "boolean";
|
|
14
53
|
};
|
|
54
|
+
table: {
|
|
55
|
+
type: {
|
|
56
|
+
summary: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
nativeHtmlAttributes: {
|
|
61
|
+
description: string;
|
|
62
|
+
control: false;
|
|
63
|
+
table: {
|
|
64
|
+
type: {
|
|
65
|
+
summary: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
15
68
|
};
|
|
16
69
|
disabled: {
|
|
70
|
+
description: string;
|
|
17
71
|
control: {
|
|
18
72
|
type: "boolean";
|
|
19
73
|
};
|
|
74
|
+
table: {
|
|
75
|
+
type: {
|
|
76
|
+
summary: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
20
79
|
};
|
|
21
80
|
placeholder: {
|
|
81
|
+
description: string;
|
|
22
82
|
control: {
|
|
23
83
|
type: "text";
|
|
24
84
|
};
|
|
85
|
+
table: {
|
|
86
|
+
type: {
|
|
87
|
+
summary: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
25
90
|
};
|
|
26
|
-
|
|
91
|
+
filterable: {
|
|
92
|
+
description: string;
|
|
93
|
+
control: {
|
|
94
|
+
type: "boolean";
|
|
95
|
+
};
|
|
96
|
+
table: {
|
|
97
|
+
type: {
|
|
98
|
+
summary: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
filterInputProps: {
|
|
103
|
+
description: string;
|
|
104
|
+
control: {
|
|
105
|
+
type: "object";
|
|
106
|
+
};
|
|
107
|
+
table: {
|
|
108
|
+
type: {
|
|
109
|
+
summary: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
id: {
|
|
114
|
+
description: string;
|
|
27
115
|
control: {
|
|
28
116
|
type: "text";
|
|
29
117
|
};
|
|
118
|
+
table: {
|
|
119
|
+
type: {
|
|
120
|
+
summary: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
title: {
|
|
125
|
+
description: string;
|
|
126
|
+
control: {
|
|
127
|
+
type: "text";
|
|
128
|
+
};
|
|
129
|
+
table: {
|
|
130
|
+
type: {
|
|
131
|
+
summary: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
30
134
|
};
|
|
31
135
|
lineBreak: {
|
|
136
|
+
description: string;
|
|
32
137
|
control: {
|
|
33
138
|
type: "boolean";
|
|
34
139
|
};
|
|
140
|
+
table: {
|
|
141
|
+
type: {
|
|
142
|
+
summary: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
panelClassName: {
|
|
147
|
+
description: string;
|
|
148
|
+
control: {
|
|
149
|
+
type: "text";
|
|
150
|
+
};
|
|
151
|
+
table: {
|
|
152
|
+
type: {
|
|
153
|
+
summary: string;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
className: {
|
|
158
|
+
description: string;
|
|
159
|
+
control: {
|
|
160
|
+
type: "text";
|
|
161
|
+
};
|
|
162
|
+
table: {
|
|
163
|
+
type: {
|
|
164
|
+
summary: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
testId: {
|
|
169
|
+
description: string;
|
|
170
|
+
control: {
|
|
171
|
+
type: "text";
|
|
172
|
+
};
|
|
173
|
+
table: {
|
|
174
|
+
type: {
|
|
175
|
+
summary: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
35
178
|
};
|
|
36
179
|
};
|
|
37
180
|
args: {
|
|
181
|
+
selectionBehaviour: "focus";
|
|
38
182
|
value: undefined;
|
|
39
|
-
onChange: () => void;
|
|
40
183
|
options: {
|
|
41
184
|
label: string;
|
|
42
185
|
value: string;
|
|
43
186
|
}[];
|
|
44
187
|
};
|
|
188
|
+
parameters: {
|
|
189
|
+
docs: {
|
|
190
|
+
story: {
|
|
191
|
+
inline: boolean;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
45
195
|
};
|
|
46
196
|
export default meta;
|
|
47
197
|
type Story = StoryObj<typeof meta>;
|
|
@@ -51,3 +201,5 @@ export declare const Disabled: Story;
|
|
|
51
201
|
export declare const WithPlaceholder: Story;
|
|
52
202
|
export declare const SingleLongOption: Story;
|
|
53
203
|
export declare const ManyOptions: Story;
|
|
204
|
+
export declare const filterable: Story;
|
|
205
|
+
export declare const SelectionBehaviourCommit: Story;
|
|
@@ -23,9 +23,19 @@ export type OptionData<T> = {
|
|
|
23
23
|
icon?: React.ReactNode;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Additional props forwarded to the filter input when `filterable` is true
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
export type FilterInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'disabled' | 'ref' | 'role' | 'aria-autocomplete' | 'aria-label'>;
|
|
29
|
+
/**
|
|
30
|
+
* Public props for <Select>, used by both custom and native render paths.
|
|
31
|
+
*/
|
|
32
|
+
export interface SelectProps<T = string | number> extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
33
|
+
/**
|
|
34
|
+
* Controls keyboard selection behaviour in the custom select variant.
|
|
35
|
+
* - `focus` (default): arrow keys move focus and commit value immediately.
|
|
36
|
+
* - `commit`: arrow keys only move focus; Enter or click commits value.
|
|
37
|
+
*/
|
|
38
|
+
selectionBehaviour?: 'focus' | 'commit';
|
|
29
39
|
/**
|
|
30
40
|
* An array of option data, to be rendered either natively or custom
|
|
31
41
|
*/
|
|
@@ -50,38 +60,57 @@ interface BaseSelectProps<T = string> {
|
|
|
50
60
|
* Native flag determines which implementation to use
|
|
51
61
|
*/
|
|
52
62
|
native?: boolean;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Adds a text input to filter options in the custom variant; ignored for native
|
|
65
|
+
*/
|
|
66
|
+
filterable?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Extra props to apply to the filter input when `filterable` is true
|
|
69
|
+
*/
|
|
70
|
+
filterInputProps?: FilterInputProps;
|
|
71
|
+
/**
|
|
72
|
+
* Extra attributes forwarded to the native <select> when `native` is true
|
|
73
|
+
*/
|
|
74
|
+
nativeHtmlAttributes?: React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
75
|
+
/**
|
|
76
|
+
* Current value (controlled)
|
|
77
|
+
*/
|
|
60
78
|
value?: T;
|
|
79
|
+
/**
|
|
80
|
+
* Disable interaction
|
|
81
|
+
*/
|
|
61
82
|
disabled?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Allow long option labels to wrap instead of truncating
|
|
85
|
+
*/
|
|
62
86
|
lineBreak?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Custom className for the root element
|
|
89
|
+
*/
|
|
90
|
+
className?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Custom className for the options panel
|
|
93
|
+
*/
|
|
63
94
|
panelClassName?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Change handler for the custom variant
|
|
97
|
+
*/
|
|
64
98
|
onValueChange?: (value: T, ev: React.UIEvent) => void;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export type NativeSelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & BaseSelectProps & {
|
|
72
|
-
native: true;
|
|
73
|
-
ref?: React.RefObject<HTMLSelectElement | null>;
|
|
74
|
-
};
|
|
75
|
-
export type SelectProps<T> = NativeSelectProps | CustomSelectProps<T>;
|
|
99
|
+
/**
|
|
100
|
+
* Ref forwarded to the rendered element
|
|
101
|
+
* (div for custom, select for native)
|
|
102
|
+
*/
|
|
103
|
+
ref?: React.Ref<HTMLDivElement | HTMLSelectElement | null>;
|
|
104
|
+
}
|
|
76
105
|
/**
|
|
77
106
|
* Each option as displayed in the Panel of <CustomSelect>
|
|
78
107
|
* Roughly equivalent to a custom version of <option>
|
|
79
108
|
*/
|
|
80
109
|
export interface CustomOptionProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
81
110
|
value: T;
|
|
111
|
+
optionIndex?: number;
|
|
82
112
|
testId?: string;
|
|
83
113
|
isSelected?: boolean;
|
|
84
|
-
onSelect: (event: React.MouseEvent, value: T) => void;
|
|
114
|
+
onSelect: (event: React.MouseEvent, value: T, optionIndex?: number) => void;
|
|
85
115
|
lineBreak?: boolean;
|
|
86
116
|
}
|
|
87
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CustomOptionProps } from '../Select.types';
|
|
2
|
-
declare const CustomOption: <T extends string | number>({ value, isSelected, onSelect, lineBreak, testId, className, children, ...props }: CustomOptionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const CustomOption: <T extends string | number>({ value, optionIndex, isSelected, onSelect, lineBreak, testId, className, children, ...props }: CustomOptionProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default CustomOption;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SelectProps } from '../Select.types';
|
|
2
|
+
type CustomSelectProps<T> = Omit<SelectProps<T>, 'native' | 'nativeHtmlAttributes'>;
|
|
3
|
+
declare const CustomSelect: <T extends string | number>({ selectionBehaviour, value, options, onValueChange, disabled, placeholder, lineBreak, filterInputProps, width, testId, className, panelClassName, filterable, ref, ...props }: CustomSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export default CustomSelect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterInputProps } from '../Select.types';
|
|
2
|
+
type FilterInputComponentProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
inputRef?: React.RefObject<HTMLInputElement | null>;
|
|
8
|
+
className?: string;
|
|
9
|
+
ariaControls?: string;
|
|
10
|
+
ariaExpanded?: boolean;
|
|
11
|
+
ariaActiveDescendant?: string;
|
|
12
|
+
} & FilterInputProps;
|
|
13
|
+
declare const FilterInput: ({ value, onChange, placeholder, disabled, inputRef, className, ariaControls, ariaExpanded, ariaActiveDescendant, ...rest }: FilterInputComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FilterInput;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectProps } from '../Select.types';
|
|
2
|
+
type NativeSelectProps = Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'defaultValue'> & Omit<SelectProps, 'native' | 'filterable' | 'nativeHtmlAttributes' | 'onValueChange' | 'ref'> & {
|
|
3
|
+
value?: string | number;
|
|
4
|
+
ref?: React.Ref<HTMLSelectElement>;
|
|
5
|
+
};
|
|
2
6
|
declare const NativeSelect: ({ options, width, disabled, placeholder, testId, className, ...props }: NativeSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
7
|
export default NativeSelect;
|
|
@@ -4,6 +4,8 @@ interface VisibleFieldProps<T> {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
selectedOption: OptionData<T> | null | undefined;
|
|
6
6
|
placeholder?: string;
|
|
7
|
+
filterable?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
7
9
|
}
|
|
8
|
-
declare const VisibleField: <T extends string | number>({ selectedOption, isOpen, placeholder, disabled, }: VisibleFieldProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const VisibleField: <T extends string | number>({ selectedOption, isOpen, placeholder, disabled, filterable, children, }: VisibleFieldProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export default VisibleField;
|
|
@@ -3,3 +3,4 @@ export { default as NativeSelect } from './NativeSelect';
|
|
|
3
3
|
export { default as CustomOption } from './CustomOption';
|
|
4
4
|
export { default as Panel } from './Panel';
|
|
5
5
|
export { default as VisibleField } from './VisibleField';
|
|
6
|
+
export { default as FilterInput } from './FilterInput';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const WeekPicker: ({ value, onValueChange, minDate, maxDate, disabled, className, ...props }:
|
|
1
|
+
import { WeekPickerProps } from './WeekPicker.types';
|
|
2
|
+
declare const WeekPicker: ({ value, onValueChange, minDate, maxDate, disabled, className, ...props }: WeekPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default WeekPicker;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ value, onValueChange, minDate, maxDate, disabled, className, ...props }: import('./WeekPicker.types').WeekPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
argTypes: {
|
|
9
|
+
value: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "date";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
minDate: {
|
|
15
|
+
control: {
|
|
16
|
+
type: "date";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
maxDate: {
|
|
20
|
+
control: {
|
|
21
|
+
type: "date";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
disabled: {
|
|
25
|
+
control: {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
showAcademicWeeks: {
|
|
30
|
+
control: {
|
|
31
|
+
type: "boolean";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
tags: string[];
|
|
36
|
+
};
|
|
37
|
+
export default meta;
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
39
|
+
export declare const Default: Story;
|
|
40
|
+
export declare const WithAcademicWeeks: Story;
|
|
41
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes, RefObject } from 'react';
|
|
2
|
+
import { CalendarEvent, AcademicWeek } from '../Calendar';
|
|
3
|
+
export type DatepickerValue = Date | null;
|
|
4
|
+
export interface WeekPickerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
value?: DatepickerValue;
|
|
6
|
+
onValueChange?: (value: DatepickerValue, event?: React.SyntheticEvent) => void;
|
|
7
|
+
minDate?: string | null;
|
|
8
|
+
maxDate?: string | null;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
events?: CalendarEvent[];
|
|
11
|
+
showAcademicWeeks?: boolean;
|
|
12
|
+
academicWeeks?: AcademicWeek[];
|
|
13
|
+
testId?: string;
|
|
14
|
+
ref?: RefObject<HTMLDivElement>;
|
|
15
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
16
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DatepickerValue } from '
|
|
1
|
+
import { DatepickerValue } from '../WeekPicker.types';
|
|
2
2
|
import { CalendarEvent, AcademicWeek } from '../../Calendar';
|
|
3
3
|
interface CustomDatepickerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
value?: DatepickerValue;
|
|
@@ -67,6 +67,8 @@ export type { AlertProps } from './Alert';
|
|
|
67
67
|
export { default as Tabs } from './Tabs';
|
|
68
68
|
export type { TabsProps } from './Tabs';
|
|
69
69
|
export type { TabProps } from './Tabs/Tab';
|
|
70
|
+
export { default as Accordion } from './Accordion';
|
|
71
|
+
export type { AccordionProps } from './Accordion';
|
|
70
72
|
export { default as Field } from './Field';
|
|
71
73
|
export type { FieldProps } from './Field';
|
|
72
74
|
export { default as Pagination } from './Pagination';
|
|
@@ -79,6 +81,8 @@ export { default as Radio, LabelledRadio } from './Radio';
|
|
|
79
81
|
export type { RadioProps, LabelledRadioProps } from './Radio';
|
|
80
82
|
export { default as Datepicker } from './Datepicker';
|
|
81
83
|
export type { DatepickerProps } from './Datepicker';
|
|
84
|
+
export { default as NativeDatepicker } from './NativeDatepicker';
|
|
85
|
+
export type { NativeDatepickerProps } from './NativeDatepicker';
|
|
82
86
|
export { default as Calendar } from './Calendar';
|
|
83
87
|
export type { CalendarProps } from './Calendar';
|
|
84
88
|
export { default as WeekPicker } from './WeekPicker';
|
|
@@ -90,3 +94,7 @@ export { default as CookieNotice } from './CookieNotice';
|
|
|
90
94
|
export type { CookieNoticeProps } from './CookieNotice';
|
|
91
95
|
export { default as Search } from './Search';
|
|
92
96
|
export type { SearchProps } from './Search';
|
|
97
|
+
export { default as Layout } from './Layout';
|
|
98
|
+
export type { LayoutProps } from './Layout';
|
|
99
|
+
export { default as Main } from './Main';
|
|
100
|
+
export type { MainProps } from './Main';
|
|
@@ -4,6 +4,7 @@ interface UseFocusTrapOptions {
|
|
|
4
4
|
initialFocusRef?: React.RefObject<HTMLElement>;
|
|
5
5
|
finalFocusRef?: React.RefObject<HTMLElement>;
|
|
6
6
|
restoreFocus?: boolean;
|
|
7
|
+
skipFirstFocusable?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const useFocusTrap: ({ isActive, containerRef, initialFocusRef, finalFocusRef, restoreFocus, }: UseFocusTrapOptions) => void;
|
|
9
|
+
export declare const useFocusTrap: ({ isActive, containerRef, initialFocusRef, finalFocusRef, restoreFocus, skipFirstFocusable, }: UseFocusTrapOptions) => void;
|
|
9
10
|
export {};
|
package/dist/index.d.ts
CHANGED