@indico-data/design-system 3.0.10 → 3.2.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 +10 -0
- package/lib/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.d.ts +16 -0
- package/lib/components/forms/date/inputDatePicker/SingleInputDatePicker.d.ts +8 -0
- package/lib/components/forms/date/inputDateRangePicker/InputDateRangePicker.d.ts +9 -0
- package/lib/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.d.ts +9 -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/Pill.d.ts +1 -1
- package/lib/components/pill/Pill.stories.d.ts +2 -1
- package/lib/components/pill/types.d.ts +8 -2
- 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 +4977 -5020
- package/lib/index.d.ts +268 -5
- package/lib/index.esm.css +4977 -5020
- package/lib/index.esm.js +3 -2
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +3 -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/types.ts +10 -0
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.stories.tsx +5 -22
- package/src/components/forms/date/iconTriggerDatePicker/IconTriggerDatePicker.tsx +16 -0
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.stories.tsx +0 -25
- package/src/components/forms/date/inputDatePicker/SingleInputDatePicker.tsx +8 -0
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.stories.tsx +0 -32
- package/src/components/forms/date/inputDateRangePicker/InputDateRangePicker.tsx +9 -0
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.stories.tsx +0 -28
- package/src/components/forms/date/inputDateTimePicker/SingleInputDateTimePicker.tsx +9 -0
- 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 +5 -0
- 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.mdx +6 -2
- package/src/components/pill/Pill.stories.tsx +50 -61
- package/src/components/pill/Pill.tsx +4 -2
- package/src/components/pill/__tests__/Pill.test.tsx +28 -10
- package/src/components/pill/styles/Pill.scss +12 -129
- package/src/components/pill/types.ts +8 -2
- 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
- package/src/styles/_colors.scss +9 -0
- package/src/styles/globals.scss +22 -0
- package/src/styles/index.scss +11 -10
- package/src/styles/variables/_colors.scss +269 -2
- package/src/types.ts +12 -8
- package/src/styles/variables/themes/dark.scss +0 -267
- package/src/styles/variables/themes/light.scss +0 -266
|
@@ -11,16 +11,23 @@ import {
|
|
|
11
11
|
|
|
12
12
|
export interface DatePickerProps {
|
|
13
13
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
14
|
+
/** The selected day(s). */
|
|
14
15
|
selected?: Date | DateRange | undefined;
|
|
16
|
+
/** Event handler when a day is selected. */
|
|
15
17
|
onSelect?: OnSelectHandler<Date> | OnSelectHandler<DateRange>;
|
|
18
|
+
/** Allows you to select a single day, a range of days, or multiple days. */
|
|
16
19
|
mode?: Mode;
|
|
20
|
+
/** Accepts a CSS class name */
|
|
17
21
|
className?: string;
|
|
22
|
+
/** The layout of the caption. Enables you to add or remove the dropdown navigation for months/years */
|
|
18
23
|
captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
|
|
19
24
|
id?: string;
|
|
20
25
|
month?: Date;
|
|
21
26
|
defaultMonth?: Date;
|
|
22
27
|
startMonth?: Date | undefined;
|
|
28
|
+
/** Whether to show the time picker. */
|
|
23
29
|
hasTimePicker?: boolean;
|
|
30
|
+
/** The time value to display in the date picker. */
|
|
24
31
|
timeValue?: string;
|
|
25
32
|
endMonth?: Date;
|
|
26
33
|
components?: Partial<CustomComponents>;
|
|
@@ -31,8 +38,11 @@ export interface DatePickerProps {
|
|
|
31
38
|
firstWeekContainsDate?: 1 | 4;
|
|
32
39
|
today?: Date;
|
|
33
40
|
isRequired?: any;
|
|
41
|
+
/** The minimum date that can be selected. */
|
|
34
42
|
min?: number;
|
|
43
|
+
/** The maximum date that can be selected. */
|
|
35
44
|
max?: number;
|
|
45
|
+
/** Callback when the time changes. */
|
|
36
46
|
onTimeChange?: (time: string) => void;
|
|
37
47
|
onMonthChange?: MonthChangeEventHandler;
|
|
38
48
|
onNextClick?: MonthChangeEventHandler;
|
|
@@ -16,7 +16,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
16
16
|
argTypes: {
|
|
17
17
|
isPortal: {
|
|
18
18
|
control: 'boolean',
|
|
19
|
-
description: 'Whether the date picker is a portal.',
|
|
20
19
|
table: {
|
|
21
20
|
category: 'Props',
|
|
22
21
|
type: {
|
|
@@ -26,7 +25,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
26
25
|
},
|
|
27
26
|
portalOptions: {
|
|
28
27
|
control: false,
|
|
29
|
-
description: 'The portal options for the date picker. Follows floating-ui options.',
|
|
30
28
|
table: {
|
|
31
29
|
category: 'Props',
|
|
32
30
|
type: {
|
|
@@ -36,7 +34,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
36
34
|
},
|
|
37
35
|
floatingOptions: {
|
|
38
36
|
control: false,
|
|
39
|
-
description: 'The floating options for the date picker. Follows floating-ui options.',
|
|
40
37
|
table: {
|
|
41
38
|
category: 'Props',
|
|
42
39
|
type: {
|
|
@@ -46,7 +43,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
46
43
|
},
|
|
47
44
|
ariaLabel: {
|
|
48
45
|
control: 'text',
|
|
49
|
-
description: 'A label for assistive technologies.',
|
|
50
46
|
table: {
|
|
51
47
|
category: 'Props',
|
|
52
48
|
type: {
|
|
@@ -56,7 +52,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
56
52
|
},
|
|
57
53
|
className: {
|
|
58
54
|
control: false,
|
|
59
|
-
description: 'Accepts a CSS class name',
|
|
60
55
|
table: {
|
|
61
56
|
category: 'Props',
|
|
62
57
|
type: {
|
|
@@ -66,7 +61,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
66
61
|
},
|
|
67
62
|
id: {
|
|
68
63
|
control: 'text',
|
|
69
|
-
description: 'The id of the input field.',
|
|
70
64
|
table: {
|
|
71
65
|
category: 'Props',
|
|
72
66
|
type: {
|
|
@@ -76,7 +70,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
76
70
|
},
|
|
77
71
|
label: {
|
|
78
72
|
control: 'text',
|
|
79
|
-
description: 'The label for the input field.',
|
|
80
73
|
table: {
|
|
81
74
|
category: 'Props',
|
|
82
75
|
type: {
|
|
@@ -86,7 +79,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
86
79
|
},
|
|
87
80
|
triggerIcon: {
|
|
88
81
|
control: 'text',
|
|
89
|
-
description: 'The icon to use as a trigger.',
|
|
90
82
|
table: {
|
|
91
83
|
category: 'Props',
|
|
92
84
|
type: {
|
|
@@ -97,17 +89,15 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
97
89
|
triggerIconSize: {
|
|
98
90
|
control: 'select',
|
|
99
91
|
options: ['sm', 'md', 'lg'],
|
|
100
|
-
description: 'The size of the trigger icon.',
|
|
101
92
|
table: {
|
|
102
93
|
category: 'Props',
|
|
103
94
|
type: {
|
|
104
|
-
summary: '
|
|
95
|
+
summary: 'sm | md | lg',
|
|
105
96
|
},
|
|
106
97
|
},
|
|
107
98
|
},
|
|
108
99
|
isOpen: {
|
|
109
|
-
control:
|
|
110
|
-
description: 'Whether the date picker is open.',
|
|
100
|
+
control: 'boolean',
|
|
111
101
|
table: {
|
|
112
102
|
category: 'Props',
|
|
113
103
|
type: {
|
|
@@ -117,18 +107,16 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
117
107
|
},
|
|
118
108
|
selected: {
|
|
119
109
|
control: 'date',
|
|
120
|
-
description: 'The selected day(s).',
|
|
121
110
|
table: {
|
|
122
111
|
category: 'Props',
|
|
123
112
|
type: {
|
|
124
|
-
summary: 'Date |
|
|
113
|
+
summary: 'Date | DateRange | undefined',
|
|
125
114
|
},
|
|
126
115
|
},
|
|
127
116
|
},
|
|
128
117
|
mode: {
|
|
129
118
|
control: 'select',
|
|
130
119
|
options: ['single', 'range', 'multiple'],
|
|
131
|
-
description: 'Allows you to select a single day, a range of days, or multiple days.',
|
|
132
120
|
table: {
|
|
133
121
|
category: 'Props',
|
|
134
122
|
type: {
|
|
@@ -138,7 +126,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
138
126
|
},
|
|
139
127
|
clearOnClose: {
|
|
140
128
|
control: 'boolean',
|
|
141
|
-
description: 'Clear the selected date(s) when the date picker closes.',
|
|
142
129
|
table: {
|
|
143
130
|
category: 'Props',
|
|
144
131
|
type: {
|
|
@@ -148,7 +135,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
148
135
|
},
|
|
149
136
|
disableAfterDate: {
|
|
150
137
|
control: 'date',
|
|
151
|
-
description: 'Disable dates after this date.',
|
|
152
138
|
table: {
|
|
153
139
|
category: 'Props',
|
|
154
140
|
type: {
|
|
@@ -158,7 +144,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
158
144
|
},
|
|
159
145
|
disableBeforeDate: {
|
|
160
146
|
control: 'date',
|
|
161
|
-
description: 'Disable dates before this date.',
|
|
162
147
|
table: {
|
|
163
148
|
category: 'Props',
|
|
164
149
|
type: {
|
|
@@ -168,7 +153,6 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
168
153
|
},
|
|
169
154
|
isDisabled: {
|
|
170
155
|
control: 'boolean',
|
|
171
|
-
description: 'Disable the date picker.',
|
|
172
156
|
table: {
|
|
173
157
|
category: 'Props',
|
|
174
158
|
type: {
|
|
@@ -183,11 +167,10 @@ const meta: Meta<typeof IconTriggerDatePicker> = {
|
|
|
183
167
|
},
|
|
184
168
|
onSelect: {
|
|
185
169
|
control: false,
|
|
186
|
-
description: 'Event handler when a day is selected.',
|
|
187
170
|
table: {
|
|
188
|
-
category: '
|
|
171
|
+
category: 'Events',
|
|
189
172
|
type: {
|
|
190
|
-
summary: '
|
|
173
|
+
summary: '(selected: Date | DateRange | undefined) => void',
|
|
191
174
|
},
|
|
192
175
|
},
|
|
193
176
|
action: 'onSelect',
|
|
@@ -7,24 +7,40 @@ import { Icon } from '../../../icons/Icon';
|
|
|
7
7
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
8
8
|
import { PortalOptions } from '../datePicker/types';
|
|
9
9
|
interface Props {
|
|
10
|
+
/** Allows you to select a single day, a range of days, or multiple days. */
|
|
10
11
|
mode?: Mode;
|
|
12
|
+
/** A label for assistive technologies. */
|
|
11
13
|
ariaLabel: string;
|
|
14
|
+
/** Disable dates before this date. */
|
|
12
15
|
disableBeforeDate?: Date;
|
|
16
|
+
/** Disable dates after this date. */
|
|
13
17
|
disableAfterDate?: Date;
|
|
18
|
+
/** Disable the date picker. */
|
|
14
19
|
isDisabled?: boolean;
|
|
20
|
+
/** The id of the input field. */
|
|
15
21
|
id: string;
|
|
22
|
+
/** The label for the input field. */
|
|
16
23
|
label?: string;
|
|
24
|
+
/** Event handler when a day is selected. */
|
|
17
25
|
onSelect?: (selected: Date | DateRange | undefined) => void;
|
|
18
26
|
selected?: Date | DateRange | undefined;
|
|
27
|
+
/** The icon to use as a trigger. */
|
|
19
28
|
triggerIcon: IconName;
|
|
29
|
+
/** The size of the trigger icon. */
|
|
20
30
|
triggerIconSize: IconSizes;
|
|
31
|
+
/** Whether the date picker is open. */
|
|
21
32
|
isOpen?: boolean;
|
|
33
|
+
/** Clear the selected date(s) when the date picker closes. */
|
|
22
34
|
clearOnClose?: boolean;
|
|
35
|
+
/** Accepts a CSS class name */
|
|
23
36
|
className?: string;
|
|
24
37
|
initialMonth?: Date;
|
|
25
38
|
'data-testid'?: string;
|
|
39
|
+
/** The portal options for the date picker. Follows floating-ui options. */
|
|
26
40
|
portalOptions?: PortalOptions;
|
|
41
|
+
/** Whether the date picker is a portal. */
|
|
27
42
|
isPortal?: boolean;
|
|
43
|
+
/** The floating options for the date picker. Follows floating-ui options. */
|
|
28
44
|
floatingOptions?: UseFloatingOptions;
|
|
29
45
|
}
|
|
30
46
|
|
|
@@ -15,7 +15,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
15
15
|
argTypes: {
|
|
16
16
|
isPortal: {
|
|
17
17
|
control: 'boolean',
|
|
18
|
-
description: 'Whether the date picker is a portal.',
|
|
19
18
|
table: {
|
|
20
19
|
category: 'Props',
|
|
21
20
|
type: {
|
|
@@ -25,7 +24,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
25
24
|
},
|
|
26
25
|
portalOptions: {
|
|
27
26
|
control: false,
|
|
28
|
-
description: 'The portal options for the date picker. Follows floating-ui options.',
|
|
29
27
|
table: {
|
|
30
28
|
category: 'Props',
|
|
31
29
|
type: {
|
|
@@ -35,7 +33,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
35
33
|
},
|
|
36
34
|
floatingOptions: {
|
|
37
35
|
control: false,
|
|
38
|
-
description: 'The floating options for the date picker. Follows floating-ui options.',
|
|
39
36
|
table: {
|
|
40
37
|
category: 'Props',
|
|
41
38
|
type: {
|
|
@@ -45,35 +42,30 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
45
42
|
},
|
|
46
43
|
tabIndex: {
|
|
47
44
|
control: 'number',
|
|
48
|
-
description: 'The tab index of the input field.',
|
|
49
45
|
table: {
|
|
50
46
|
category: 'Props',
|
|
51
47
|
},
|
|
52
48
|
},
|
|
53
49
|
ref: {
|
|
54
50
|
control: false,
|
|
55
|
-
description: 'The ref of the input field.',
|
|
56
51
|
table: {
|
|
57
52
|
category: 'Props',
|
|
58
53
|
},
|
|
59
54
|
},
|
|
60
55
|
isReadOnly: {
|
|
61
56
|
control: 'boolean',
|
|
62
|
-
description: 'Whether the date picker is read only.',
|
|
63
57
|
table: {
|
|
64
58
|
category: 'Props',
|
|
65
59
|
},
|
|
66
60
|
},
|
|
67
61
|
hasHiddenLabel: {
|
|
68
62
|
control: 'boolean',
|
|
69
|
-
description: 'Whether the label is hidden.',
|
|
70
63
|
table: {
|
|
71
64
|
category: 'Props',
|
|
72
65
|
},
|
|
73
66
|
},
|
|
74
67
|
ariaLabel: {
|
|
75
68
|
control: 'text',
|
|
76
|
-
description: 'A label for assistive technologies.',
|
|
77
69
|
table: {
|
|
78
70
|
category: 'Props',
|
|
79
71
|
type: {
|
|
@@ -84,8 +76,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
84
76
|
captionLayout: {
|
|
85
77
|
control: 'select',
|
|
86
78
|
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
79
|
table: {
|
|
90
80
|
category: 'Props',
|
|
91
81
|
type: {
|
|
@@ -95,7 +85,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
95
85
|
},
|
|
96
86
|
className: {
|
|
97
87
|
control: false,
|
|
98
|
-
description: 'Accepts a CSS class name',
|
|
99
88
|
table: {
|
|
100
89
|
category: 'Props',
|
|
101
90
|
type: {
|
|
@@ -105,7 +94,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
105
94
|
},
|
|
106
95
|
id: {
|
|
107
96
|
control: 'text',
|
|
108
|
-
description: 'The id of the input field.',
|
|
109
97
|
table: {
|
|
110
98
|
category: 'Props',
|
|
111
99
|
type: {
|
|
@@ -115,7 +103,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
115
103
|
},
|
|
116
104
|
label: {
|
|
117
105
|
control: 'text',
|
|
118
|
-
description: 'The label for the input field.',
|
|
119
106
|
table: {
|
|
120
107
|
category: 'Props',
|
|
121
108
|
type: {
|
|
@@ -125,7 +112,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
125
112
|
},
|
|
126
113
|
onSelect: {
|
|
127
114
|
action: 'selected',
|
|
128
|
-
description: 'Callback function that is called when a date is selected.',
|
|
129
115
|
table: {
|
|
130
116
|
category: 'Events',
|
|
131
117
|
type: {
|
|
@@ -135,7 +121,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
135
121
|
},
|
|
136
122
|
selected: {
|
|
137
123
|
control: 'date',
|
|
138
|
-
description: 'The selected date.',
|
|
139
124
|
table: {
|
|
140
125
|
category: 'Props',
|
|
141
126
|
type: {
|
|
@@ -145,7 +130,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
145
130
|
},
|
|
146
131
|
inputPlaceholder: {
|
|
147
132
|
control: 'text',
|
|
148
|
-
description: 'The placeholder text for the input field.',
|
|
149
133
|
table: {
|
|
150
134
|
category: 'Props',
|
|
151
135
|
type: {
|
|
@@ -155,7 +139,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
155
139
|
},
|
|
156
140
|
inputIconName: {
|
|
157
141
|
control: 'text',
|
|
158
|
-
description: 'The icon to display in the input field.',
|
|
159
142
|
table: {
|
|
160
143
|
category: 'Props',
|
|
161
144
|
type: {
|
|
@@ -165,7 +148,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
165
148
|
},
|
|
166
149
|
isClearable: {
|
|
167
150
|
control: 'boolean',
|
|
168
|
-
description: 'Whether the input field should be clearable.',
|
|
169
151
|
table: {
|
|
170
152
|
category: 'Props',
|
|
171
153
|
type: {
|
|
@@ -175,7 +157,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
175
157
|
},
|
|
176
158
|
isOpen: {
|
|
177
159
|
control: false,
|
|
178
|
-
description: 'Whether the date picker is open.',
|
|
179
160
|
table: {
|
|
180
161
|
category: 'Props',
|
|
181
162
|
type: {
|
|
@@ -185,7 +166,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
185
166
|
},
|
|
186
167
|
clearOnClose: {
|
|
187
168
|
control: 'boolean',
|
|
188
|
-
description: 'Whether the input field should be cleared when the date picker is closed.',
|
|
189
169
|
table: {
|
|
190
170
|
category: 'Props',
|
|
191
171
|
type: {
|
|
@@ -195,7 +175,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
195
175
|
},
|
|
196
176
|
errorMessage: {
|
|
197
177
|
control: 'text',
|
|
198
|
-
description: 'An error message to display.',
|
|
199
178
|
table: {
|
|
200
179
|
category: 'Props',
|
|
201
180
|
type: {
|
|
@@ -205,7 +184,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
205
184
|
},
|
|
206
185
|
disableAfterDate: {
|
|
207
186
|
control: 'date',
|
|
208
|
-
description: 'Disable dates after this date.',
|
|
209
187
|
table: {
|
|
210
188
|
category: 'Props',
|
|
211
189
|
type: {
|
|
@@ -215,7 +193,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
215
193
|
},
|
|
216
194
|
disableBeforeDate: {
|
|
217
195
|
control: 'date',
|
|
218
|
-
description: 'Disable dates before this date.',
|
|
219
196
|
table: {
|
|
220
197
|
category: 'Props',
|
|
221
198
|
type: {
|
|
@@ -225,7 +202,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
225
202
|
},
|
|
226
203
|
isDisabled: {
|
|
227
204
|
control: 'boolean',
|
|
228
|
-
description: 'Disable the date picker.',
|
|
229
205
|
table: {
|
|
230
206
|
category: 'Props',
|
|
231
207
|
type: {
|
|
@@ -235,7 +211,6 @@ const meta: Meta<typeof SingleInputDatePicker> = {
|
|
|
235
211
|
},
|
|
236
212
|
initialMonth: {
|
|
237
213
|
control: 'date',
|
|
238
|
-
description: 'The month to display.',
|
|
239
214
|
table: {
|
|
240
215
|
category: 'Props',
|
|
241
216
|
type: {
|
|
@@ -8,10 +8,12 @@ import { formatDateAsString } from './helpers';
|
|
|
8
8
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
9
9
|
import { PortalOptions } from '../datePicker/types';
|
|
10
10
|
export interface SingleInputDatePickerProps {
|
|
11
|
+
/** A label for assistive technologies. */
|
|
11
12
|
ariaLabel: string;
|
|
12
13
|
disableBeforeDate?: Date;
|
|
13
14
|
disableAfterDate?: Date;
|
|
14
15
|
isDisabled?: boolean;
|
|
16
|
+
/** The layout of the caption. Enables you to add or remove the dropdown navigation for months/years */
|
|
15
17
|
captionLayout?: 'dropdown' | 'dropdown-months' | 'dropdown-years' | 'label';
|
|
16
18
|
id?: string;
|
|
17
19
|
label?: string;
|
|
@@ -20,18 +22,24 @@ export interface SingleInputDatePickerProps {
|
|
|
20
22
|
selected?: Date;
|
|
21
23
|
isOpen?: boolean;
|
|
22
24
|
clearOnClose?: boolean;
|
|
25
|
+
/** Accepts a CSS class name */
|
|
23
26
|
className?: string;
|
|
24
27
|
inputIconName?: IconName;
|
|
25
28
|
isClearable?: boolean;
|
|
26
29
|
inputPlaceholder?: string;
|
|
27
30
|
errorMessage?: string | undefined;
|
|
31
|
+
/** Whether the label is hidden. */
|
|
28
32
|
hasHiddenLabel?: boolean;
|
|
29
33
|
'data-testid'?: string;
|
|
34
|
+
/** The ref of the input field. */
|
|
30
35
|
ref?: React.LegacyRef<HTMLInputElement>;
|
|
36
|
+
/** Whether the date picker is read only. */
|
|
31
37
|
isReadOnly?: boolean;
|
|
38
|
+
/** The tab index of the input field. */
|
|
32
39
|
tabIndex?: number;
|
|
33
40
|
portalOptions?: PortalOptions;
|
|
34
41
|
floatingOptions?: UseFloatingOptions;
|
|
42
|
+
/** Whether the date picker is a portal. */
|
|
35
43
|
isPortal?: boolean;
|
|
36
44
|
}
|
|
37
45
|
|
|
@@ -17,7 +17,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
17
17
|
argTypes: {
|
|
18
18
|
isPortal: {
|
|
19
19
|
control: 'boolean',
|
|
20
|
-
description: 'Whether the date picker is a portal.',
|
|
21
20
|
table: {
|
|
22
21
|
category: 'Props',
|
|
23
22
|
type: {
|
|
@@ -27,7 +26,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
27
26
|
},
|
|
28
27
|
portalOptions: {
|
|
29
28
|
control: false,
|
|
30
|
-
description: 'The portal options for the date picker. Follows floating-ui options.',
|
|
31
29
|
table: {
|
|
32
30
|
category: 'Props',
|
|
33
31
|
type: {
|
|
@@ -37,7 +35,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
37
35
|
},
|
|
38
36
|
floatingOptions: {
|
|
39
37
|
control: false,
|
|
40
|
-
description: 'The floating options for the date picker. Follows floating-ui options.',
|
|
41
38
|
table: {
|
|
42
39
|
category: 'Props',
|
|
43
40
|
type: {
|
|
@@ -47,56 +44,48 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
47
44
|
},
|
|
48
45
|
fromTabIndex: {
|
|
49
46
|
control: 'number',
|
|
50
|
-
description: 'The tab index of the from input field.',
|
|
51
47
|
table: {
|
|
52
48
|
category: 'Props',
|
|
53
49
|
},
|
|
54
50
|
},
|
|
55
51
|
ref: {
|
|
56
52
|
control: false,
|
|
57
|
-
description: 'The ref of the input field.',
|
|
58
53
|
table: {
|
|
59
54
|
category: 'Props',
|
|
60
55
|
},
|
|
61
56
|
},
|
|
62
57
|
isFromReadOnly: {
|
|
63
58
|
control: 'boolean',
|
|
64
|
-
description: 'Whether the from input is read only.',
|
|
65
59
|
table: {
|
|
66
60
|
category: 'Props',
|
|
67
61
|
},
|
|
68
62
|
},
|
|
69
63
|
isToReadOnly: {
|
|
70
64
|
control: 'boolean',
|
|
71
|
-
description: 'Whether the to input is read only.',
|
|
72
65
|
table: {
|
|
73
66
|
category: 'Props',
|
|
74
67
|
},
|
|
75
68
|
},
|
|
76
69
|
hasHiddenLabel: {
|
|
77
70
|
control: 'boolean',
|
|
78
|
-
description: 'Whether the label is hidden.',
|
|
79
71
|
table: {
|
|
80
72
|
category: 'Props',
|
|
81
73
|
},
|
|
82
74
|
},
|
|
83
75
|
gutterWidth: {
|
|
84
76
|
control: 'number',
|
|
85
|
-
description: 'The gutter width for the date picker.',
|
|
86
77
|
table: {
|
|
87
78
|
category: 'Props',
|
|
88
79
|
},
|
|
89
80
|
},
|
|
90
81
|
setIsOpen: {
|
|
91
82
|
control: 'boolean',
|
|
92
|
-
description: 'Whether the date picker is open.',
|
|
93
83
|
table: {
|
|
94
84
|
category: 'Props',
|
|
95
85
|
},
|
|
96
86
|
},
|
|
97
87
|
ariaLabel: {
|
|
98
88
|
control: 'text',
|
|
99
|
-
description: 'A label for assistive technologies.',
|
|
100
89
|
table: {
|
|
101
90
|
category: 'Props',
|
|
102
91
|
type: {
|
|
@@ -107,8 +96,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
107
96
|
captionLayout: {
|
|
108
97
|
control: 'select',
|
|
109
98
|
options: ['dropdown', 'dropdown-months', 'dropdown-years', 'label'],
|
|
110
|
-
description:
|
|
111
|
-
'The layout of the caption. Enables you to add or remove the dropdown navigation for months/years',
|
|
112
99
|
table: {
|
|
113
100
|
category: 'Props',
|
|
114
101
|
type: {
|
|
@@ -118,7 +105,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
118
105
|
},
|
|
119
106
|
className: {
|
|
120
107
|
control: false,
|
|
121
|
-
description: 'Accepts a CSS class name',
|
|
122
108
|
table: {
|
|
123
109
|
category: 'Props',
|
|
124
110
|
type: {
|
|
@@ -128,8 +114,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
128
114
|
},
|
|
129
115
|
id: {
|
|
130
116
|
control: 'text',
|
|
131
|
-
description:
|
|
132
|
-
'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`',
|
|
133
117
|
table: {
|
|
134
118
|
category: 'Props',
|
|
135
119
|
type: {
|
|
@@ -139,7 +123,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
139
123
|
},
|
|
140
124
|
onSelect: {
|
|
141
125
|
action: 'selected',
|
|
142
|
-
description: 'Callback function that is called when a date is selected.',
|
|
143
126
|
table: {
|
|
144
127
|
category: 'Events',
|
|
145
128
|
type: {
|
|
@@ -149,7 +132,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
149
132
|
},
|
|
150
133
|
selected: {
|
|
151
134
|
control: false,
|
|
152
|
-
description: 'The selected date range.',
|
|
153
135
|
table: {
|
|
154
136
|
category: 'Props',
|
|
155
137
|
type: {
|
|
@@ -159,7 +141,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
159
141
|
},
|
|
160
142
|
inputPlaceholder: {
|
|
161
143
|
control: 'text',
|
|
162
|
-
description: 'The placeholder text for the input fields.',
|
|
163
144
|
table: {
|
|
164
145
|
category: 'Props',
|
|
165
146
|
type: {
|
|
@@ -169,8 +150,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
169
150
|
},
|
|
170
151
|
isOpen: {
|
|
171
152
|
control: 'boolean',
|
|
172
|
-
description:
|
|
173
|
-
'Whether the floatingUI component wrapped around the date picker is opened or closed.',
|
|
174
153
|
table: {
|
|
175
154
|
category: 'Props',
|
|
176
155
|
type: {
|
|
@@ -180,7 +159,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
180
159
|
},
|
|
181
160
|
inputIconName: {
|
|
182
161
|
control: 'text',
|
|
183
|
-
description: 'The icon to display in the input fields.',
|
|
184
162
|
table: {
|
|
185
163
|
category: 'Props',
|
|
186
164
|
type: {
|
|
@@ -190,7 +168,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
190
168
|
},
|
|
191
169
|
toErrorMessage: {
|
|
192
170
|
control: 'text',
|
|
193
|
-
description: 'An error message to display on the `to` input.',
|
|
194
171
|
table: {
|
|
195
172
|
category: 'Props',
|
|
196
173
|
type: {
|
|
@@ -200,7 +177,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
200
177
|
},
|
|
201
178
|
fromErrorMessage: {
|
|
202
179
|
control: 'text',
|
|
203
|
-
description: 'An error message to display on the `from` input.',
|
|
204
180
|
table: {
|
|
205
181
|
category: 'Props',
|
|
206
182
|
type: {
|
|
@@ -210,7 +186,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
210
186
|
},
|
|
211
187
|
disableAfterDate: {
|
|
212
188
|
control: 'date',
|
|
213
|
-
description: 'Disable dates after this date.',
|
|
214
189
|
table: {
|
|
215
190
|
category: 'Props',
|
|
216
191
|
type: {
|
|
@@ -220,7 +195,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
220
195
|
},
|
|
221
196
|
disableBeforeDate: {
|
|
222
197
|
control: 'date',
|
|
223
|
-
description: 'Disable dates before this date.',
|
|
224
198
|
table: {
|
|
225
199
|
category: 'Props',
|
|
226
200
|
type: {
|
|
@@ -230,7 +204,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
230
204
|
},
|
|
231
205
|
isDisabled: {
|
|
232
206
|
control: 'boolean',
|
|
233
|
-
description: 'Disable the date picker and input fields.',
|
|
234
207
|
table: {
|
|
235
208
|
category: 'Props',
|
|
236
209
|
type: {
|
|
@@ -240,7 +213,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
240
213
|
},
|
|
241
214
|
fromLabel: {
|
|
242
215
|
control: 'text',
|
|
243
|
-
description: 'The label for the `from` input.',
|
|
244
216
|
table: {
|
|
245
217
|
category: 'Props',
|
|
246
218
|
type: {
|
|
@@ -250,7 +222,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
250
222
|
},
|
|
251
223
|
toLabel: {
|
|
252
224
|
control: 'text',
|
|
253
|
-
description: 'The label for the `to` input.',
|
|
254
225
|
table: {
|
|
255
226
|
category: 'Props',
|
|
256
227
|
type: {
|
|
@@ -260,7 +231,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
260
231
|
},
|
|
261
232
|
month: {
|
|
262
233
|
control: 'date',
|
|
263
|
-
description: 'The currently displayed month.',
|
|
264
234
|
table: {
|
|
265
235
|
category: 'Props',
|
|
266
236
|
type: {
|
|
@@ -270,7 +240,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
270
240
|
},
|
|
271
241
|
closeOnSelect: {
|
|
272
242
|
control: 'boolean',
|
|
273
|
-
description: 'Whether to close the date picker when a complete range is selected.',
|
|
274
243
|
table: {
|
|
275
244
|
category: 'Props',
|
|
276
245
|
type: {
|
|
@@ -280,7 +249,6 @@ const meta: Meta<typeof InputDateRangePicker> = {
|
|
|
280
249
|
},
|
|
281
250
|
clearOnClose: {
|
|
282
251
|
control: 'boolean',
|
|
283
|
-
description: 'Whether to clear the selected dates when the picker is closed.',
|
|
284
252
|
table: {
|
|
285
253
|
category: 'Props',
|
|
286
254
|
type: {
|