@indico-data/design-system 3.0.9 → 3.1.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/.storybook/main.ts +3 -0
- package/lib/components/badge/types.d.ts +4 -0
- package/lib/components/button/types.d.ts +52 -2
- package/lib/components/card/Card.d.ts +5 -0
- package/lib/components/floatUI/types.d.ts +7 -0
- package/lib/components/forms/checkbox/Checkbox.d.ts +7 -0
- package/lib/components/forms/date/datePicker/types.d.ts +13 -0
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +21 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +13 -0
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +14 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +14 -0
- package/lib/components/forms/numberInput/NumberInput.d.ts +4 -0
- package/lib/components/forms/passwordInput/PasswordInput.d.ts +1 -0
- package/lib/components/forms/radio/Radio.d.ts +6 -0
- package/lib/components/forms/select/Select.d.ts +10 -0
- package/lib/components/forms/textarea/Textarea.d.ts +7 -0
- package/lib/components/forms/timePicker/TimePicker.d.ts +5 -0
- package/lib/components/forms/toggle/Toggle.d.ts +7 -0
- package/lib/components/icons/types.d.ts +5 -0
- package/lib/components/loading-indicators/BarSpinner/BarSpinner.d.ts +4 -0
- package/lib/components/loading-indicators/CirclePulse/CirclePulse.d.ts +2 -0
- package/lib/components/menu/Menu.d.ts +1 -0
- package/lib/components/modal/types.d.ts +22 -0
- package/lib/components/pagination/types.d.ts +4 -0
- package/lib/components/pill/types.d.ts +3 -0
- package/lib/components/skeleton/Skeleton.d.ts +5 -0
- package/lib/components/stepper/types.d.ts +9 -0
- package/lib/components/table/types.d.ts +9 -0
- package/lib/components/tanstackTable/TankstackTable.types.d.ts +25 -0
- package/lib/components/tanstackTable/components/ActionBar/ActionBar.d.ts +4 -0
- package/lib/components/tooltip/Tooltip.d.ts +6 -0
- package/lib/components/truncate/types.d.ts +4 -0
- package/lib/index.css +10 -0
- package/lib/index.d.ts +277 -2
- package/lib/index.esm.css +10 -0
- package/lib/index.esm.js +124 -119
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +124 -119
- package/lib/index.js.map +1 -1
- package/package.json +2 -1
- package/src/components/badge/Badge.stories.tsx +0 -4
- package/src/components/badge/types.ts +4 -0
- package/src/components/button/Button.stories.tsx +5 -18
- package/src/components/button/types.ts +52 -2
- package/src/components/card/Card.stories.tsx +0 -5
- package/src/components/card/Card.tsx +5 -0
- package/src/components/floatUI/FloatUI.stories.tsx +0 -11
- package/src/components/floatUI/types.ts +7 -0
- package/src/components/forms/checkbox/Checkbox.stories.tsx +0 -7
- package/src/components/forms/checkbox/Checkbox.tsx +7 -0
- package/src/components/forms/date/datePicker/DatePicker.stories.tsx +0 -33
- package/src/components/forms/date/datePicker/styles/DatePicker.scss +10 -0
- package/src/components/forms/date/datePicker/types.ts +14 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +32 -19
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +31 -1
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +27 -22
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +23 -2
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +23 -32
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +24 -2
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +23 -28
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +25 -1
- package/src/components/forms/numberInput/NumberInput.stories.tsx +0 -4
- package/src/components/forms/numberInput/NumberInput.tsx +4 -0
- package/src/components/forms/passwordInput/PasswordInput.stories.tsx +0 -1
- package/src/components/forms/passwordInput/PasswordInput.tsx +1 -0
- package/src/components/forms/radio/Radio.stories.tsx +0 -6
- package/src/components/forms/radio/Radio.tsx +6 -0
- package/src/components/forms/select/Select.stories.tsx +1 -14
- package/src/components/forms/select/Select.tsx +10 -0
- package/src/components/forms/textarea/Textarea.stories.tsx +0 -7
- package/src/components/forms/textarea/Textarea.tsx +7 -0
- package/src/components/forms/timePicker/TimePicker.stories.tsx +0 -5
- package/src/components/forms/timePicker/TimePicker.tsx +26 -1
- package/src/components/forms/timePicker/__tests__/TimePicker.test.tsx +4 -2
- package/src/components/forms/toggle/Toggle.stories.tsx +0 -7
- package/src/components/forms/toggle/Toggle.tsx +7 -0
- package/src/components/icons/Icon.stories.tsx +0 -7
- package/src/components/icons/types.ts +5 -0
- package/src/components/loading-indicators/BarSpinner/BarSpinner.stories.tsx +0 -5
- package/src/components/loading-indicators/BarSpinner/BarSpinner.tsx +4 -0
- package/src/components/loading-indicators/CirclePulse/CirclePulse.stories.tsx +0 -3
- package/src/components/loading-indicators/CirclePulse/CirclePulse.tsx +2 -0
- package/src/components/menu/Menu.stories.tsx +0 -3
- package/src/components/menu/Menu.tsx +1 -0
- package/src/components/modal/Modal.stories.tsx +1 -25
- package/src/components/modal/types.ts +22 -0
- package/src/components/pagination/Pagination.stories.tsx +0 -4
- package/src/components/pagination/types.ts +4 -0
- package/src/components/pill/Pill.stories.tsx +0 -3
- package/src/components/pill/types.ts +3 -0
- package/src/components/skeleton/Skeleton.stories.tsx +0 -7
- package/src/components/skeleton/Skeleton.tsx +5 -0
- package/src/components/stepper/Stepper.stories.tsx +0 -19
- package/src/components/stepper/types.ts +9 -0
- package/src/components/table/Table.stories.tsx +0 -35
- package/src/components/table/types.ts +9 -0
- package/src/components/tanstackTable/TankstackTable.types.ts +25 -0
- package/src/components/tanstackTable/TanstackTable.stories.tsx +0 -29
- package/src/components/tanstackTable/components/ActionBar/ActionBar.stories.tsx +0 -4
- package/src/components/tanstackTable/components/ActionBar/ActionBar.tsx +4 -0
- package/src/components/tooltip/Tooltip.stories.tsx +0 -8
- package/src/components/tooltip/Tooltip.tsx +6 -0
- package/src/components/truncate/Truncate.stories.tsx +0 -8
- package/src/components/truncate/types.ts +4 -0
|
@@ -15,65 +15,77 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
15
15
|
),
|
|
16
16
|
],
|
|
17
17
|
argTypes: {
|
|
18
|
-
|
|
19
|
-
control: '
|
|
20
|
-
|
|
18
|
+
isPortal: {
|
|
19
|
+
control: 'boolean',
|
|
20
|
+
table: {
|
|
21
|
+
category: 'Props',
|
|
22
|
+
type: {
|
|
23
|
+
summary: 'boolean',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
portalOptions: {
|
|
28
|
+
control: false,
|
|
21
29
|
table: {
|
|
22
30
|
category: 'Props',
|
|
31
|
+
type: {
|
|
32
|
+
summary: '{ rootId?: string }',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
floatingOptions: {
|
|
37
|
+
control: false,
|
|
38
|
+
table: {
|
|
39
|
+
category: 'Props',
|
|
40
|
+
type: {
|
|
41
|
+
summary: '{ placement?: Placement; middleware?: Middleware[] }',
|
|
42
|
+
},
|
|
23
43
|
},
|
|
24
44
|
},
|
|
25
45
|
fromTabIndex: {
|
|
26
46
|
control: 'number',
|
|
27
|
-
description: 'The tab index of the from input field.',
|
|
28
47
|
table: {
|
|
29
48
|
category: 'Props',
|
|
30
49
|
},
|
|
31
50
|
},
|
|
32
51
|
ref: {
|
|
33
52
|
control: false,
|
|
34
|
-
description: 'The ref of the input field.',
|
|
35
53
|
table: {
|
|
36
54
|
category: 'Props',
|
|
37
55
|
},
|
|
38
56
|
},
|
|
39
57
|
isFromReadOnly: {
|
|
40
58
|
control: 'boolean',
|
|
41
|
-
description: 'Whether the from input is read only.',
|
|
42
59
|
table: {
|
|
43
60
|
category: 'Props',
|
|
44
61
|
},
|
|
45
62
|
},
|
|
46
63
|
isToReadOnly: {
|
|
47
64
|
control: 'boolean',
|
|
48
|
-
description: 'Whether the to input is read only.',
|
|
49
65
|
table: {
|
|
50
66
|
category: 'Props',
|
|
51
67
|
},
|
|
52
68
|
},
|
|
53
69
|
hasHiddenLabel: {
|
|
54
70
|
control: 'boolean',
|
|
55
|
-
description: 'Whether the label is hidden.',
|
|
56
71
|
table: {
|
|
57
72
|
category: 'Props',
|
|
58
73
|
},
|
|
59
74
|
},
|
|
60
75
|
gutterWidth: {
|
|
61
76
|
control: 'number',
|
|
62
|
-
description: 'The gutter width for the date picker.',
|
|
63
77
|
table: {
|
|
64
78
|
category: 'Props',
|
|
65
79
|
},
|
|
66
80
|
},
|
|
67
81
|
setIsOpen: {
|
|
68
82
|
control: 'boolean',
|
|
69
|
-
description: 'Whether the date picker is open.',
|
|
70
83
|
table: {
|
|
71
84
|
category: 'Props',
|
|
72
85
|
},
|
|
73
86
|
},
|
|
74
87
|
ariaLabel: {
|
|
75
88
|
control: 'text',
|
|
76
|
-
description: 'A label for assistive technologies.',
|
|
77
89
|
table: {
|
|
78
90
|
category: 'Props',
|
|
79
91
|
type: {
|
|
@@ -84,8 +96,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
84
96
|
captionLayout: {
|
|
85
97
|
control: 'select',
|
|
86
98
|
options: ['dropdown', 'dropdown-months', 'dropdown-years', 'label'],
|
|
87
|
-
description:
|
|
88
|
-
'The layout of the caption. Enables you to add or remove the dropdown navigation for months/years',
|
|
89
99
|
table: {
|
|
90
100
|
category: 'Props',
|
|
91
101
|
type: {
|
|
@@ -95,7 +105,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
95
105
|
},
|
|
96
106
|
className: {
|
|
97
107
|
control: false,
|
|
98
|
-
description: 'Accepts a CSS class name',
|
|
99
108
|
table: {
|
|
100
109
|
category: 'Props',
|
|
101
110
|
type: {
|
|
@@ -105,8 +114,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
105
114
|
},
|
|
106
115
|
id: {
|
|
107
116
|
control: 'text',
|
|
108
|
-
description:
|
|
109
|
-
'The id of the input fieldss. Each one has the id appended to it, For example an id of `holiday` would be `holiday-to` and `holiday-from`',
|
|
110
117
|
table: {
|
|
111
118
|
category: 'Props',
|
|
112
119
|
type: {
|
|
@@ -116,7 +123,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
116
123
|
},
|
|
117
124
|
onSelect: {
|
|
118
125
|
action: 'selected',
|
|
119
|
-
description: 'Callback function that is called when a date is selected.',
|
|
120
126
|
table: {
|
|
121
127
|
category: 'Events',
|
|
122
128
|
type: {
|
|
@@ -126,7 +132,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
126
132
|
},
|
|
127
133
|
selected: {
|
|
128
134
|
control: false,
|
|
129
|
-
description: 'The selected date range.',
|
|
130
135
|
table: {
|
|
131
136
|
category: 'Props',
|
|
132
137
|
type: {
|
|
@@ -136,7 +141,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
136
141
|
},
|
|
137
142
|
inputPlaceholder: {
|
|
138
143
|
control: 'text',
|
|
139
|
-
description: 'The placeholder text for the input fields.',
|
|
140
144
|
table: {
|
|
141
145
|
category: 'Props',
|
|
142
146
|
type: {
|
|
@@ -146,8 +150,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
146
150
|
},
|
|
147
151
|
isOpen: {
|
|
148
152
|
control: 'boolean',
|
|
149
|
-
description:
|
|
150
|
-
'Whether the floatingUI component wrapped around the date picker is opened or closed.',
|
|
151
153
|
table: {
|
|
152
154
|
category: 'Props',
|
|
153
155
|
type: {
|
|
@@ -157,7 +159,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
157
159
|
},
|
|
158
160
|
inputIconName: {
|
|
159
161
|
control: 'text',
|
|
160
|
-
description: 'The icon to display in the input fields.',
|
|
161
162
|
table: {
|
|
162
163
|
category: 'Props',
|
|
163
164
|
type: {
|
|
@@ -167,7 +168,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
167
168
|
},
|
|
168
169
|
toErrorMessage: {
|
|
169
170
|
control: 'text',
|
|
170
|
-
description: 'An error message to display on the `to` input.',
|
|
171
171
|
table: {
|
|
172
172
|
category: 'Props',
|
|
173
173
|
type: {
|
|
@@ -177,7 +177,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
177
177
|
},
|
|
178
178
|
fromErrorMessage: {
|
|
179
179
|
control: 'text',
|
|
180
|
-
description: 'An error message to display on the `from` input.',
|
|
181
180
|
table: {
|
|
182
181
|
category: 'Props',
|
|
183
182
|
type: {
|
|
@@ -187,7 +186,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
187
186
|
},
|
|
188
187
|
disableAfterDate: {
|
|
189
188
|
control: 'date',
|
|
190
|
-
description: 'Disable dates after this date.',
|
|
191
189
|
table: {
|
|
192
190
|
category: 'Props',
|
|
193
191
|
type: {
|
|
@@ -197,7 +195,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
197
195
|
},
|
|
198
196
|
disableBeforeDate: {
|
|
199
197
|
control: 'date',
|
|
200
|
-
description: 'Disable dates before this date.',
|
|
201
198
|
table: {
|
|
202
199
|
category: 'Props',
|
|
203
200
|
type: {
|
|
@@ -207,7 +204,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
207
204
|
},
|
|
208
205
|
isDisabled: {
|
|
209
206
|
control: 'boolean',
|
|
210
|
-
description: 'Disable the date picker and input fields.',
|
|
211
207
|
table: {
|
|
212
208
|
category: 'Props',
|
|
213
209
|
type: {
|
|
@@ -217,7 +213,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
217
213
|
},
|
|
218
214
|
fromLabel: {
|
|
219
215
|
control: 'text',
|
|
220
|
-
description: 'The label for the `from` input.',
|
|
221
216
|
table: {
|
|
222
217
|
category: 'Props',
|
|
223
218
|
type: {
|
|
@@ -227,7 +222,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
227
222
|
},
|
|
228
223
|
toLabel: {
|
|
229
224
|
control: 'text',
|
|
230
|
-
description: 'The label for the `to` input.',
|
|
231
225
|
table: {
|
|
232
226
|
category: 'Props',
|
|
233
227
|
type: {
|
|
@@ -237,7 +231,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
237
231
|
},
|
|
238
232
|
month: {
|
|
239
233
|
control: 'date',
|
|
240
|
-
description: 'The currently displayed month.',
|
|
241
234
|
table: {
|
|
242
235
|
category: 'Props',
|
|
243
236
|
type: {
|
|
@@ -247,7 +240,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
247
240
|
},
|
|
248
241
|
closeOnSelect: {
|
|
249
242
|
control: 'boolean',
|
|
250
|
-
description: 'Whether to close the date picker when a complete range is selected.',
|
|
251
243
|
table: {
|
|
252
244
|
category: 'Props',
|
|
253
245
|
type: {
|
|
@@ -257,7 +249,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
257
249
|
},
|
|
258
250
|
clearOnClose: {
|
|
259
251
|
control: 'boolean',
|
|
260
|
-
description: 'Whether to clear the selected dates when the picker is closed.',
|
|
261
252
|
table: {
|
|
262
253
|
category: 'Props',
|
|
263
254
|
type: {
|
|
@@ -8,8 +8,10 @@ import { FloatUI } from '../../../floatUI';
|
|
|
8
8
|
import { Col, Row } from '../../../grid';
|
|
9
9
|
import { formatDateAsString } from '../inputDatePicker/helpers';
|
|
10
10
|
import { Button } from '../../../button';
|
|
11
|
-
|
|
11
|
+
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
12
|
+
import { PortalOptions } from '../datePicker/types';
|
|
12
13
|
interface InputDateRangePickerProps {
|
|
14
|
+
/** A label for assistive technologies. */
|
|
13
15
|
ariaLabel: string;
|
|
14
16
|
disableBeforeDate?: Date;
|
|
15
17
|
disableAfterDate?: Date;
|
|
@@ -20,6 +22,7 @@ interface InputDateRangePickerProps {
|
|
|
20
22
|
month?: Date;
|
|
21
23
|
selected?: DateRange | undefined;
|
|
22
24
|
isOpen?: boolean;
|
|
25
|
+
/** Whether the date picker is open. */
|
|
23
26
|
setIsOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
24
27
|
className?: string;
|
|
25
28
|
inputIconName?: IconName;
|
|
@@ -27,17 +30,27 @@ interface InputDateRangePickerProps {
|
|
|
27
30
|
toErrorMessage?: string | undefined;
|
|
28
31
|
fromErrorMessage?: string | undefined;
|
|
29
32
|
'data-testid'?: string;
|
|
33
|
+
/** The gutter width for the date picker. */
|
|
30
34
|
gutterWidth?: number;
|
|
31
35
|
fromLabel?: string;
|
|
32
36
|
toLabel?: string;
|
|
33
37
|
closeOnSelect?: boolean;
|
|
34
38
|
clearOnClose?: boolean;
|
|
39
|
+
/** Whether the label is hidden. */
|
|
35
40
|
hasHiddenLabel?: boolean;
|
|
41
|
+
/** The ref of the input field. */
|
|
36
42
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
43
|
+
/** Whether the from input is read only. */
|
|
37
44
|
isFromReadOnly?: boolean;
|
|
45
|
+
/** Whether the to input is read only. */
|
|
38
46
|
isToReadOnly?: boolean;
|
|
39
47
|
toTabIndex?: number;
|
|
48
|
+
/** The tab index of the from input field. */
|
|
40
49
|
fromTabIndex?: number;
|
|
50
|
+
portalOptions?: PortalOptions;
|
|
51
|
+
floatingOptions?: UseFloatingOptions;
|
|
52
|
+
/** Whether the date picker is a portal. */
|
|
53
|
+
isPortal?: boolean;
|
|
41
54
|
}
|
|
42
55
|
|
|
43
56
|
export function InputDateRangePicker(props: InputDateRangePickerProps) {
|
|
@@ -69,6 +82,9 @@ export function InputDateRangePicker(props: InputDateRangePickerProps) {
|
|
|
69
82
|
isToReadOnly,
|
|
70
83
|
toTabIndex,
|
|
71
84
|
fromTabIndex,
|
|
85
|
+
portalOptions,
|
|
86
|
+
floatingOptions,
|
|
87
|
+
isPortal,
|
|
72
88
|
...rest
|
|
73
89
|
} = props;
|
|
74
90
|
|
|
@@ -149,7 +165,13 @@ export function InputDateRangePicker(props: InputDateRangePickerProps) {
|
|
|
149
165
|
};
|
|
150
166
|
|
|
151
167
|
return (
|
|
152
|
-
<FloatUI
|
|
168
|
+
<FloatUI
|
|
169
|
+
isOpen={isOpen}
|
|
170
|
+
setIsOpen={setIsOpen}
|
|
171
|
+
ariaLabel={ariaLabel}
|
|
172
|
+
portalOptions={portalOptions}
|
|
173
|
+
floatingOptions={floatingOptions}
|
|
174
|
+
>
|
|
153
175
|
<Row gutterWidth={gutterWidth}>
|
|
154
176
|
<Col>
|
|
155
177
|
<Input
|
|
@@ -20,37 +20,53 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
20
20
|
),
|
|
21
21
|
],
|
|
22
22
|
argTypes: {
|
|
23
|
-
|
|
24
|
-
control: '
|
|
25
|
-
|
|
23
|
+
isPortal: {
|
|
24
|
+
control: 'boolean',
|
|
25
|
+
table: {
|
|
26
|
+
category: 'Props',
|
|
27
|
+
type: {
|
|
28
|
+
summary: 'boolean',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
portalOptions: {
|
|
33
|
+
control: false,
|
|
26
34
|
table: {
|
|
27
35
|
category: 'Props',
|
|
36
|
+
type: {
|
|
37
|
+
summary: '{ rootId?: string }',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
floatingOptions: {
|
|
42
|
+
control: false,
|
|
43
|
+
table: {
|
|
44
|
+
category: 'Props',
|
|
45
|
+
type: {
|
|
46
|
+
summary: '{ placement?: Placement; middleware?: Middleware[] }',
|
|
47
|
+
},
|
|
28
48
|
},
|
|
29
49
|
},
|
|
30
50
|
timeTabIndex: {
|
|
31
51
|
control: 'number',
|
|
32
|
-
description: 'The tab index of the time input field.',
|
|
33
52
|
table: {
|
|
34
53
|
category: 'Props',
|
|
35
54
|
},
|
|
36
55
|
},
|
|
37
56
|
ref: {
|
|
38
57
|
control: false,
|
|
39
|
-
description: 'The ref of the input field.',
|
|
40
58
|
table: {
|
|
41
59
|
category: 'Props',
|
|
42
60
|
},
|
|
43
61
|
},
|
|
44
62
|
timePickerRef: {
|
|
45
63
|
control: false,
|
|
46
|
-
description: 'The ref of the time picker input field.',
|
|
47
64
|
table: {
|
|
48
65
|
category: 'Props',
|
|
49
66
|
},
|
|
50
67
|
},
|
|
51
68
|
isReadOnly: {
|
|
52
69
|
control: 'boolean',
|
|
53
|
-
description: 'Whether the date picker is read only.',
|
|
54
70
|
table: {
|
|
55
71
|
category: 'Props',
|
|
56
72
|
},
|
|
@@ -58,7 +74,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
58
74
|
|
|
59
75
|
hasHiddenLabel: {
|
|
60
76
|
control: 'boolean',
|
|
61
|
-
description: 'Whether the label is hidden.',
|
|
62
77
|
table: {
|
|
63
78
|
category: 'Props',
|
|
64
79
|
},
|
|
@@ -66,21 +81,18 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
66
81
|
|
|
67
82
|
timeValue: {
|
|
68
83
|
control: 'text',
|
|
69
|
-
description: 'The time value to display.',
|
|
70
84
|
table: {
|
|
71
85
|
category: 'Props',
|
|
72
86
|
},
|
|
73
87
|
},
|
|
74
88
|
onTimeChange: {
|
|
75
89
|
action: 'timeChanged',
|
|
76
|
-
description: 'Callback function that is called when the time is changed.',
|
|
77
90
|
table: {
|
|
78
91
|
category: 'Events',
|
|
79
92
|
},
|
|
80
93
|
},
|
|
81
94
|
ariaLabel: {
|
|
82
95
|
control: 'text',
|
|
83
|
-
description: 'A label for assistive technologies.',
|
|
84
96
|
table: {
|
|
85
97
|
category: 'Props',
|
|
86
98
|
type: {
|
|
@@ -91,8 +103,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
91
103
|
captionLayout: {
|
|
92
104
|
control: 'select',
|
|
93
105
|
options: ['dropdown', 'dropdown-months', 'dropdown-years', 'label'],
|
|
94
|
-
description:
|
|
95
|
-
'The layout of the caption. Enables you to add or remove the dropdown navigation for months/years',
|
|
96
106
|
table: {
|
|
97
107
|
category: 'Props',
|
|
98
108
|
type: {
|
|
@@ -102,7 +112,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
102
112
|
},
|
|
103
113
|
className: {
|
|
104
114
|
control: false,
|
|
105
|
-
description: 'Accepts a CSS class name',
|
|
106
115
|
table: {
|
|
107
116
|
category: 'Props',
|
|
108
117
|
type: {
|
|
@@ -112,7 +121,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
112
121
|
},
|
|
113
122
|
id: {
|
|
114
123
|
control: 'text',
|
|
115
|
-
description: 'The id of the input field.',
|
|
116
124
|
table: {
|
|
117
125
|
category: 'Props',
|
|
118
126
|
type: {
|
|
@@ -122,7 +130,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
122
130
|
},
|
|
123
131
|
label: {
|
|
124
132
|
control: 'text',
|
|
125
|
-
description: 'The label for the input field.',
|
|
126
133
|
table: {
|
|
127
134
|
category: 'Props',
|
|
128
135
|
type: {
|
|
@@ -132,7 +139,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
132
139
|
},
|
|
133
140
|
onSelect: {
|
|
134
141
|
action: 'selected',
|
|
135
|
-
description: 'Callback function that is called when a date is selected.',
|
|
136
142
|
table: {
|
|
137
143
|
category: 'Events',
|
|
138
144
|
type: {
|
|
@@ -142,7 +148,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
142
148
|
},
|
|
143
149
|
selected: {
|
|
144
150
|
control: 'date',
|
|
145
|
-
description: 'The selected date.',
|
|
146
151
|
table: {
|
|
147
152
|
category: 'Props',
|
|
148
153
|
type: {
|
|
@@ -152,7 +157,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
152
157
|
},
|
|
153
158
|
inputPlaceholder: {
|
|
154
159
|
control: 'text',
|
|
155
|
-
description: 'The placeholder text for the input field.',
|
|
156
160
|
table: {
|
|
157
161
|
category: 'Props',
|
|
158
162
|
type: {
|
|
@@ -162,7 +166,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
162
166
|
},
|
|
163
167
|
inputIconName: {
|
|
164
168
|
control: 'text',
|
|
165
|
-
description: 'The icon to display in the input field.',
|
|
166
169
|
table: {
|
|
167
170
|
category: 'Props',
|
|
168
171
|
type: {
|
|
@@ -172,7 +175,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
172
175
|
},
|
|
173
176
|
isClearable: {
|
|
174
177
|
control: 'boolean',
|
|
175
|
-
description: 'Whether the input field should be clearable.',
|
|
176
178
|
table: {
|
|
177
179
|
category: 'Props',
|
|
178
180
|
type: {
|
|
@@ -182,7 +184,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
182
184
|
},
|
|
183
185
|
isOpen: {
|
|
184
186
|
control: false,
|
|
185
|
-
description: 'Whether the date picker is open.',
|
|
186
187
|
table: {
|
|
187
188
|
category: 'Props',
|
|
188
189
|
type: {
|
|
@@ -192,7 +193,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
192
193
|
},
|
|
193
194
|
clearOnClose: {
|
|
194
195
|
control: 'boolean',
|
|
195
|
-
description: 'Whether the input field should be cleared when the date picker is closed.',
|
|
196
196
|
table: {
|
|
197
197
|
category: 'Props',
|
|
198
198
|
type: {
|
|
@@ -202,7 +202,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
202
202
|
},
|
|
203
203
|
errorMessage: {
|
|
204
204
|
control: 'text',
|
|
205
|
-
description: 'An error message to display.',
|
|
206
205
|
table: {
|
|
207
206
|
category: 'Props',
|
|
208
207
|
type: {
|
|
@@ -212,7 +211,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
212
211
|
},
|
|
213
212
|
disableAfterDate: {
|
|
214
213
|
control: 'date',
|
|
215
|
-
description: 'Disable dates after this date.',
|
|
216
214
|
table: {
|
|
217
215
|
category: 'Props',
|
|
218
216
|
type: {
|
|
@@ -222,7 +220,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
222
220
|
},
|
|
223
221
|
disableBeforeDate: {
|
|
224
222
|
control: 'date',
|
|
225
|
-
description: 'Disable dates before this date.',
|
|
226
223
|
table: {
|
|
227
224
|
category: 'Props',
|
|
228
225
|
type: {
|
|
@@ -232,7 +229,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
232
229
|
},
|
|
233
230
|
isDisabled: {
|
|
234
231
|
control: 'boolean',
|
|
235
|
-
description: 'Disable the date picker.',
|
|
236
232
|
table: {
|
|
237
233
|
category: 'Props',
|
|
238
234
|
type: {
|
|
@@ -242,7 +238,6 @@ const meta: Meta<typeof SingleInputDateTimePicker> = {
|
|
|
242
238
|
},
|
|
243
239
|
initialMonth: {
|
|
244
240
|
control: 'date',
|
|
245
|
-
description: 'The month to display.',
|
|
246
241
|
table: {
|
|
247
242
|
category: 'Props',
|
|
248
243
|
type: {
|
|
@@ -7,8 +7,11 @@ import { FloatUI } from '../../../floatUI';
|
|
|
7
7
|
import { formatDateAsString } from './helpers';
|
|
8
8
|
import { TimePicker } from '../../timePicker/TimePicker';
|
|
9
9
|
import { Row, Col } from '../../../grid';
|
|
10
|
+
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
11
|
+
import { PortalOptions } from '../datePicker/types';
|
|
10
12
|
|
|
11
13
|
export interface SingleInputDateTimePickerProps {
|
|
14
|
+
/** A label for assistive technologies. */
|
|
12
15
|
ariaLabel: string;
|
|
13
16
|
disableBeforeDate?: Date;
|
|
14
17
|
disableAfterDate?: Date;
|
|
@@ -27,14 +30,25 @@ export interface SingleInputDateTimePickerProps {
|
|
|
27
30
|
inputPlaceholder?: string;
|
|
28
31
|
errorMessage?: string | undefined;
|
|
29
32
|
'data-testid'?: string;
|
|
33
|
+
/** Whether the label is hidden. */
|
|
30
34
|
hasHiddenLabel?: boolean;
|
|
35
|
+
/** The time value to display. */
|
|
31
36
|
timeValue?: string;
|
|
37
|
+
/** Callback function that is called when the time is changed. */
|
|
32
38
|
onTimeChange?: (time: string) => void;
|
|
39
|
+
/** Whether the date picker is read only. */
|
|
33
40
|
isReadOnly?: boolean;
|
|
41
|
+
/** The ref of the input field. */
|
|
34
42
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
43
|
+
/** The ref of the time picker input field. */
|
|
35
44
|
timePickerRef?: React.LegacyRef<HTMLInputElement>;
|
|
36
45
|
dateTabIndex?: number;
|
|
46
|
+
/** The tab index of the time input field. */
|
|
37
47
|
timeTabIndex?: number;
|
|
48
|
+
portalOptions?: PortalOptions;
|
|
49
|
+
floatingOptions?: UseFloatingOptions;
|
|
50
|
+
/** Whether the date picker is a portal. */
|
|
51
|
+
isPortal?: boolean;
|
|
38
52
|
}
|
|
39
53
|
|
|
40
54
|
export function SingleInputDateTimePicker(props: SingleInputDateTimePickerProps) {
|
|
@@ -64,6 +78,9 @@ export function SingleInputDateTimePicker(props: SingleInputDateTimePickerProps)
|
|
|
64
78
|
dateTabIndex,
|
|
65
79
|
timeTabIndex,
|
|
66
80
|
ref,
|
|
81
|
+
portalOptions,
|
|
82
|
+
floatingOptions,
|
|
83
|
+
isPortal,
|
|
67
84
|
...rest
|
|
68
85
|
} = props;
|
|
69
86
|
|
|
@@ -115,7 +132,14 @@ export function SingleInputDateTimePicker(props: SingleInputDateTimePickerProps)
|
|
|
115
132
|
return (
|
|
116
133
|
<Row className="date-time-picker-row">
|
|
117
134
|
<Col className="date-picker-col">
|
|
118
|
-
<FloatUI
|
|
135
|
+
<FloatUI
|
|
136
|
+
className="date-picker-float-ui"
|
|
137
|
+
isOpen={isOpen}
|
|
138
|
+
ariaLabel={ariaLabel}
|
|
139
|
+
isPortal={isPortal}
|
|
140
|
+
portalOptions={portalOptions}
|
|
141
|
+
floatingOptions={floatingOptions}
|
|
142
|
+
>
|
|
119
143
|
<Input
|
|
120
144
|
ref={ref}
|
|
121
145
|
className={`date-picker-input`}
|
|
@@ -11,7 +11,6 @@ const meta: Meta = {
|
|
|
11
11
|
...inputArgTypes,
|
|
12
12
|
value: {
|
|
13
13
|
control: 'number',
|
|
14
|
-
description: 'The value for the input field',
|
|
15
14
|
table: {
|
|
16
15
|
category: 'Props',
|
|
17
16
|
type: {
|
|
@@ -22,7 +21,6 @@ const meta: Meta = {
|
|
|
22
21
|
},
|
|
23
22
|
min: {
|
|
24
23
|
control: 'number',
|
|
25
|
-
description: 'The minimum value for the input field',
|
|
26
24
|
table: {
|
|
27
25
|
category: 'Props',
|
|
28
26
|
type: {
|
|
@@ -33,7 +31,6 @@ const meta: Meta = {
|
|
|
33
31
|
},
|
|
34
32
|
max: {
|
|
35
33
|
control: 'number',
|
|
36
|
-
description: 'The maximum value for the input field',
|
|
37
34
|
table: {
|
|
38
35
|
category: 'Props',
|
|
39
36
|
type: {
|
|
@@ -44,7 +41,6 @@ const meta: Meta = {
|
|
|
44
41
|
},
|
|
45
42
|
step: {
|
|
46
43
|
control: 'number',
|
|
47
|
-
description: 'The step value for the input field',
|
|
48
44
|
table: {
|
|
49
45
|
category: 'Props',
|
|
50
46
|
type: {
|
|
@@ -7,9 +7,13 @@ import { DisplayFormError } from '../subcomponents/DisplayFormError';
|
|
|
7
7
|
import { BaseInputProps } from '../input/Input';
|
|
8
8
|
|
|
9
9
|
export interface NumberInputProps extends Omit<BaseInputProps, 'value'>, LabelProps {
|
|
10
|
+
/** The value for the input field */
|
|
10
11
|
value?: number | '';
|
|
12
|
+
/** The minimum value for the input field */
|
|
11
13
|
min?: number;
|
|
14
|
+
/** The maximum value for the input field */
|
|
12
15
|
max?: number;
|
|
16
|
+
/** The step value for the input field */
|
|
13
17
|
step?: number;
|
|
14
18
|
}
|
|
15
19
|
|
|
@@ -13,7 +13,6 @@ const meta: Meta = {
|
|
|
13
13
|
},
|
|
14
14
|
onChange: {
|
|
15
15
|
control: false,
|
|
16
|
-
description: 'onChange event handler',
|
|
17
16
|
table: {
|
|
18
17
|
category: 'Callbacks',
|
|
19
18
|
type: {
|
|
@@ -24,7 +23,6 @@ const meta: Meta = {
|
|
|
24
23
|
},
|
|
25
24
|
label: {
|
|
26
25
|
control: 'text',
|
|
27
|
-
description: 'The label for the Radio field',
|
|
28
26
|
table: {
|
|
29
27
|
category: 'Props',
|
|
30
28
|
type: {
|
|
@@ -35,7 +33,6 @@ const meta: Meta = {
|
|
|
35
33
|
},
|
|
36
34
|
name: {
|
|
37
35
|
control: 'text',
|
|
38
|
-
description: 'The name for the Radio field',
|
|
39
36
|
table: {
|
|
40
37
|
category: 'Props',
|
|
41
38
|
type: {
|
|
@@ -46,7 +43,6 @@ const meta: Meta = {
|
|
|
46
43
|
},
|
|
47
44
|
value: {
|
|
48
45
|
control: 'text',
|
|
49
|
-
description: 'This holds the value that will be emitted when the radio is selected',
|
|
50
46
|
table: {
|
|
51
47
|
category: 'Props',
|
|
52
48
|
type: {
|
|
@@ -57,7 +53,6 @@ const meta: Meta = {
|
|
|
57
53
|
},
|
|
58
54
|
id: {
|
|
59
55
|
control: 'text',
|
|
60
|
-
description: 'This explains what button group this radio belongs to.',
|
|
61
56
|
table: {
|
|
62
57
|
category: 'Props',
|
|
63
58
|
type: {
|
|
@@ -68,7 +63,6 @@ const meta: Meta = {
|
|
|
68
63
|
},
|
|
69
64
|
isDisabled: {
|
|
70
65
|
control: 'boolean',
|
|
71
|
-
description: 'Toggles the disabled state of the Radio field',
|
|
72
66
|
table: {
|
|
73
67
|
category: 'Props',
|
|
74
68
|
type: {
|