@coinbase/cds-mcp-server 8.53.1 → 8.55.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.
@@ -30,8 +30,9 @@
30
30
  - [DotSymbol](mobile/components/DotSymbol.txt): Dots are component adornments, typically used to communicate a numerical value or indicate the status or identity of a component to the end-user.
31
31
  - [DotStatusColor](mobile/components/DotStatusColor.txt): Dots are component adornments, typically used to communicate a numerical value or indicate the status or identity of a component to the end-user.
32
32
  - [DotCount](mobile/components/DotCount.txt): Dots are component adornments, typically used to communicate a numerical value or indicate the status or identity of a component to the end-user.
33
- - [DatePicker](mobile/components/DatePicker.txt): Date Picker allows our global users to input past, present, future and important dates into our interface in a simple and intuitive manner. Date Picker offers both manual and calendar entry options - accommodating both internationalization and accessibility needs while being adaptable across screen platforms.
33
+ - [DatePicker](mobile/components/DatePicker.txt): Date Picker allows our global users to input past, present, future and important dates into our interface in a simple and intuitive manner. Date Picker offers both manual and calendar entry options - accommodating both internationalization and accessibility needs.
34
34
  - [DateInput](mobile/components/DateInput.txt): DateInput is a text input field for entering dates by typing. The input automatically formats dates based on the user's locale.
35
+ - [Calendar](mobile/components/Calendar.txt): Calendar is a flexible, accessible date grid component for selecting dates, supporting keyboard navigation, disabled/highlighted dates, and custom rendering.
35
36
  - [RollingNumber](mobile/components/RollingNumber.txt): A numeric display that animates value changes with rolling digits.
36
37
  - [Tour](mobile/components/Tour.txt): Creates guided tours of a user interface.
37
38
  - [TopNavBar](mobile/components/TopNavBar.txt): A customizable top navigation bar that can contain start, middle, and end content, as well as a bottom section for elements like tabs. It remains sticky at the top of the screen.
@@ -148,3 +149,7 @@
148
149
  - [useMergeRefs](mobile/hooks/useMergeRefs.txt): Combines multiple refs into a single ref callback, allowing a component to work with multiple ref instances simultaneously. Useful when you need to combine refs from different sources, such as forwarded refs and internal component state.
149
150
  - [useEventHandler](mobile/hooks/useEventHandler.txt): Creates event handlers for components based on the EventHandlerProvider configuration. It enables centralized event handling and analytics tracking by mapping component actions to configured handlers.
150
151
  - [useDimensions](mobile/hooks/useDimensions.txt): Measures the screen dimensions and status bar height.
152
+
153
+ ## Guides
154
+
155
+ - [v8-migration-guide](mobile/guides/v8-migration-guide.txt)
@@ -10,7 +10,11 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
10
10
 
11
11
  ## Examples
12
12
 
13
- ### Basic usage
13
+ Calendar is a date grid for selecting dates and powers the picker in [DatePicker](/components/other/DatePicker). Control the visible month with `selectedDate` or `seedDate`, and use `onPressDate` to handle selection. It supports keyboard navigation, disabled and highlighted dates, and custom styling via `classNames` and `styles`.
14
+
15
+ ### Basics
16
+
17
+ #### Basic usage
14
18
 
15
19
  ```tsx live
16
20
  () => {
@@ -19,7 +23,7 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
19
23
  };
20
24
  ```
21
25
 
22
- ### Disabled Dates
26
+ ### Disabled dates
23
27
 
24
28
  ```tsx live
25
29
  () => {
@@ -39,7 +43,7 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
39
43
  };
40
44
  ```
41
45
 
42
- ### Highlighted Dates
46
+ ### Highlighted dates
43
47
 
44
48
  ```tsx live
45
49
  () => {
@@ -63,6 +67,116 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
63
67
  };
64
68
  ```
65
69
 
70
+ ### Styling
71
+
72
+ #### Slot styling
73
+
74
+ Use the `classNames` and `styles` props to target specific elements: `root`, `header`, `monthLabel`, `navArrows` (container), `navArrow` (each button), `dayHeader`, `content` (day header + date grid), `calendarGrid` (date cells container), and `dayCell`.
75
+
76
+ ```tsx live
77
+ () => {
78
+ const [selectedDate, setSelectedDate] = useState(new Date());
79
+ const highlightedDates = useMemo(() => {
80
+ const d = new Date();
81
+ d.setDate(d.getDate() - 1);
82
+ return [d];
83
+ }, []);
84
+ const disabledDates = useMemo(() => {
85
+ const d = new Date();
86
+ d.setDate(d.getDate() - 2);
87
+ return [d];
88
+ }, []);
89
+ return (
90
+ <>
91
+ <style>{`
92
+ .calendar-slot-demo-nav-arrow [data-icon-name] {
93
+ color: var(--color-bgNegative);
94
+ }
95
+ .calendar-slot-day-header span {
96
+ color: var(--color-bgNegative);
97
+ }
98
+ .calendar-slot-day-cell[aria-pressed="true"] {
99
+ background-color: var(--color-bgWarning);
100
+ border-color: var(--color-bgWarning);
101
+ }
102
+ .calendar-slot-day-cell[aria-current="date"] {
103
+ border-color: var(--color-accentBoldYellow);
104
+ }
105
+ .calendar-slot-day-cell[aria-disabled="true"] {
106
+ background-color: var(--color-bgDisabled);
107
+ border-color: var(--color-bgDisabled);
108
+ }
109
+ .calendar-slot-day-cell[aria-disabled="true"] span {
110
+ color: var(--color-bgPositive);
111
+ }
112
+ .calendar-slot-day-cell[data-highlight="true"] {
113
+ background-color: var(--color-bgPositiveWash);
114
+ border-color: var(--color-bgPositive);
115
+ }
116
+ .calendar-slot-day-cell[data-highlight="true"] span {
117
+ color: var(--color-fg);
118
+ }
119
+ `}</style>
120
+ <Calendar
121
+ selectedDate={selectedDate}
122
+ onPressDate={setSelectedDate}
123
+ disabledDates={disabledDates}
124
+ highlightedDates={highlightedDates}
125
+ classNames={{
126
+ navArrow: 'calendar-slot-demo-nav-arrow',
127
+ dayHeader: 'calendar-slot-day-header',
128
+ dayCell: 'calendar-slot-day-cell',
129
+ }}
130
+ styles={{
131
+ root: {
132
+ backgroundColor: 'var(--color-bgAlternate)',
133
+ borderRadius: 16,
134
+ borderColor: 'var(--color-bgLinePrimary)',
135
+ borderWidth: 'medium',
136
+ },
137
+ header: {
138
+ paddingBottom: 0,
139
+ backgroundColor: 'var(--color-bgPositiveWash)',
140
+ borderRadius: 16,
141
+ },
142
+ monthLabel: { color: 'var(--color-fgPrimary)' },
143
+ navArrows: { border: 'medium dashed var(--color-bgLine)', borderRadius: 8 },
144
+ navArrow: { backgroundColor: 'transparent', borderColor: 'transparent' },
145
+ calendarGrid: { paddingBottom: 8, paddingTop: 8 },
146
+ dayCell: { borderRadius: 8 },
147
+ }}
148
+ />
149
+ </>
150
+ );
151
+ };
152
+ ```
153
+
154
+ ### Accessibility
155
+
156
+ Use `nextArrowAccessibilityLabel` and `previousArrowAccessibilityLabel` so screen reader users can navigate months. When using `disabledDates`, `minDate`, or `maxDate`, provide `disabledDateError` so users understand why a date cannot be selected.
157
+
158
+ ```tsx live
159
+ () => {
160
+ const [selectedDate, setSelectedDate] = useState(new Date());
161
+ const nextMonth = useMemo(() => {
162
+ const d = new Date();
163
+ d.setMonth(d.getMonth() + 1);
164
+ return d;
165
+ }, []);
166
+ return (
167
+ <Calendar
168
+ selectedDate={selectedDate}
169
+ onPressDate={setSelectedDate}
170
+ maxDate={nextMonth}
171
+ disabledDateError="Date is not available for selection"
172
+ nextArrowAccessibilityLabel="Go to next month"
173
+ previousArrowAccessibilityLabel="Go to previous month"
174
+ highlightedDateAccessibilityHint="Highlighted"
175
+ />
176
+ );
177
+ };
178
+ ```
179
+
66
180
  ## Props
67
181
 
68
182
  | Prop | Type | Required | Default | Description |
@@ -92,7 +206,7 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
92
206
  | `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
93
207
  | `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
94
208
  | `bottom` | `ResponsiveProp<Bottom<string \| number>>` | No | `-` | - |
95
- | `className` | `string` | No | `-` | - |
209
+ | `classNames` | `{ readonly root?: string; readonly header?: string \| undefined; readonly title?: string \| undefined; readonly navigation?: string \| undefined; readonly content?: string \| undefined; readonly day?: string \| undefined; } \| undefined` | No | `-` | - |
96
210
  | `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
97
211
  | `columnGap` | `0 \| 1 \| 2 \| 0.25 \| 0.5 \| 0.75 \| 1.5 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10` | No | `-` | - |
98
212
  | `dangerouslySetBackground` | `string` | No | `-` | - |
@@ -128,6 +242,7 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
128
242
  | `gridTemplateRows` | `ResponsiveProp<GridTemplateRows<string \| number>>` | No | `-` | - |
129
243
  | `height` | `ResponsiveProp<Height<string \| number>>` | No | `-` | - |
130
244
  | `hideControls` | `boolean` | No | `-` | Hides the Calendar next and previous month arrows, but does not prevent navigating to the next or previous months via keyboard. This probably only makes sense to be used when minDate and maxDate are set to the first and last days of the same month. |
245
+ | `highlightedDateAccessibilityHint` | `string` | No | `'Highlighted'` | Accessibility hint announced for highlighted dates. Applied to all highlighted dates. |
131
246
  | `highlightedDates` | `(Date \| [Date, Date])[]` | No | `-` | Array of highlighted dates, and date tuples for date ranges. A number is created for every individual date within a tuple range, so do not abuse this with massive ranges. |
132
247
  | `justifyContent` | `ResponsiveProp<left \| right \| center \| normal \| start \| end \| flex-start \| flex-end \| stretch \| space-between \| space-around \| space-evenly>` | No | `-` | - |
133
248
  | `key` | `Key \| null` | No | `-` | - |
@@ -167,6 +282,7 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
167
282
  | `seedDate` | `Date` | No | `-` | Date used to generate the Calendar month when there is no value for the selectedDate prop, defaults to today. |
168
283
  | `selectedDate` | `Date \| null` | No | `-` | Currently selected Calendar date. Date used to generate the Calendar month. Will be rendered with active styles. |
169
284
  | `style` | `CSSProperties` | No | `-` | - |
285
+ | `styles` | `{ readonly root?: CSSProperties; readonly header?: CSSProperties \| undefined; readonly title?: CSSProperties \| undefined; readonly navigation?: CSSProperties \| undefined; readonly content?: CSSProperties \| undefined; readonly day?: CSSProperties \| undefined; } \| undefined` | No | `-` | - |
170
286
  | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
171
287
  | `textAlign` | `ResponsiveProp<center \| start \| end \| justify>` | No | `-` | - |
172
288
  | `textDecoration` | `ResponsiveProp<none \| underline \| overline \| line-through \| underline overline \| underline double>` | No | `-` | - |
@@ -179,3 +295,15 @@ import { Calendar } from '@coinbase/cds-web/dates/Calendar'
179
295
  | `zIndex` | `inherit \| auto \| revert \| -moz-initial \| initial \| revert-layer \| unset` | No | `-` | - |
180
296
 
181
297
 
298
+ ## Styles
299
+
300
+ | Selector | Static class name | Description |
301
+ | --- | --- | --- |
302
+ | `root` | `cds-Calendar` | Root element |
303
+ | `header` | `cds-Calendar-header` | Header section |
304
+ | `title` | `cds-Calendar-title` | Month and year title text element |
305
+ | `navigation` | `cds-Calendar-navigation` | Navigation controls element |
306
+ | `content` | `cds-Calendar-content` | Main content area |
307
+ | `day` | `cds-Calendar-day` | Individual date cell in a calendar grid |
308
+
309
+
@@ -28,7 +28,8 @@ function Example() {
28
28
  onChangeDate={setDate}
29
29
  onErrorDate={setError}
30
30
  label="Birthdate"
31
- calendarIconButtonAccessibilityLabel="Birthdate calendar"
31
+ openCalendarAccessibilityLabel="Open calendar"
32
+ closeCalendarAccessibilityLabel="Close calendar"
32
33
  nextArrowAccessibilityLabel="Next month"
33
34
  previousArrowAccessibilityLabel="Previous month"
34
35
  helperTextErrorIconAccessibilityLabel="Error"
@@ -95,8 +96,6 @@ function Example() {
95
96
 
96
97
  The `disabledDates` prop is an array of Dates and Date tuples for date ranges. A number is created for every individual date within a tuple range, so do not abuse this with massive ranges.
97
98
 
98
- The `disabledDates` prop is only available on web because the mobile DatePicker uses react-native-date-picker instead of a Calendar component.
99
-
100
99
  Make sure to provide the `disabledDateError` prop when providing `minDate`, `maxDate`, or `disabledDates` props.
101
100
 
102
101
  ```jsx live
@@ -196,9 +195,12 @@ function Example() {
196
195
  onErrorDate={setError}
197
196
  disabledDates={[new Date()]}
198
197
  label="Birthdate"
199
- calendarIconButtonAccessibilityLabel="Birthdate calendar"
198
+ accessibilityLabel="Birthdate"
199
+ openCalendarAccessibilityLabel="Open calendar to select birthdate"
200
+ closeCalendarAccessibilityLabel="Close calendar"
200
201
  nextArrowAccessibilityLabel="Next month"
201
202
  previousArrowAccessibilityLabel="Previous month"
203
+ highlightedDateAccessibilityHint="Highlighted"
202
204
  helperTextErrorIconAccessibilityLabel="Error"
203
205
  invalidDateError="Please enter a valid date"
204
206
  disabledDateError="Date unavailable"
@@ -234,7 +236,7 @@ function Example() {
234
236
 
235
237
  ### Styling
236
238
 
237
- DatePicker supports the same styling functionality as [DateInput](/components/other/DateInput/).
239
+ DatePicker supports the same styling functionality as [DateInput](/components/other/DateInput/) and [Calendar](/components/other/Calendar/).
238
240
 
239
241
  #### Compact
240
242
 
@@ -326,7 +328,8 @@ function Example() {
326
328
  <VStack gap={2}>
327
329
  <DatePicker
328
330
  accessibilityLabel="Birthdate"
329
- calendarIconButtonAccessibilityLabel="Birthdate calendar"
331
+ openCalendarAccessibilityLabel="Open birthdate calendar"
332
+ closeCalendarAccessibilityLabel="Close calendar"
330
333
  date={date}
331
334
  error={error}
332
335
  helperTextErrorIconAccessibilityLabel="Error"
@@ -438,9 +441,7 @@ function Example() {
438
441
 
439
442
  Defaults to today when undefined.
440
443
 
441
- On web the `seedDate` prop is used to generate the Calendar month when there is no selected date value.
442
-
443
- On mobile the `seedDate` prop is the default date that the react-native-date-picker keyboard control will open to when there is no selected date value.
444
+ The `seedDate` prop is used to generate the Calendar month when there is no selected date value.
444
445
 
445
446
  ```jsx live
446
447
  function Example() {
@@ -467,8 +468,6 @@ function Example() {
467
468
 
468
469
  The `highlightedDates` prop is an array of Dates and Date tuples for date ranges. A number is created for every individual date within a tuple range, so do not abuse this with massive ranges.
469
470
 
470
- The `highlightedDates` prop is only available on web because the mobile DatePicker uses react-native-date-picker instead of a Calendar component.
471
-
472
471
  ```jsx live
473
472
  function Example() {
474
473
  const [date, setDate] = useState(null);
@@ -603,11 +602,11 @@ function Example() {
603
602
 
604
603
  ### Event Lifecycle
605
604
 
606
- - Selecting a date with the native picker (mobile) or Calendar (web):
605
+ - Selecting a date with the Calendar:
607
606
 
608
607
  `onOpen -> onConfirm -> onChangeDate -> onErrorDate -> onClose`
609
608
 
610
- - Closing the native picker (mobile) or Calendar (web) without selecting a date:
609
+ - Closing the Calendar without selecting a date:
611
610
 
612
611
  `onOpen -> onCancel -> onClose`
613
612
 
@@ -663,22 +662,24 @@ function Example() {
663
662
  | `align` | `center \| start \| end \| justify` | No | `start` | Aligns text inside input and helperText |
664
663
  | `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `200` | Leverage one of the borderRadius styles we offer to round the corners of the input. |
665
664
  | `bordered` | `boolean` | No | `true` | Adds border to input |
666
- | `calendarClassName` | `string` | No | `-` | - |
667
- | `calendarIconButtonAccessibilityLabel` | `string` | No | `'Open calendar' / 'Close calendar'` | Accessibility label describing the calendar IconButton, which opens the calendar when pressed. |
668
- | `calendarStyle` | `CSSProperties` | No | `-` | - |
669
- | `className` | `string` | No | `-` | - |
665
+ | `calendarClassName` | `string` | No | `-` | Custom class name to apply to the Calendar container. |
666
+ | `calendarIconButtonAccessibilityLabel` | `string` | No | `-` | Accessibility label describing the calendar IconButton, which opens the calendar when pressed. |
667
+ | `calendarStyle` | `CSSProperties` | No | `-` | Custom style to apply to the Calendar container. |
668
+ | `classNames` | `{ dateInput?: string; calendar?: string \| undefined; calendarHeader?: string \| undefined; calendarTitle?: string \| undefined; calendarNavigation?: string \| undefined; calendarContent?: string \| undefined; calendarDay?: string \| undefined; } \| undefined` | No | `-` | Custom class names for the DateInput and Calendar subcomponents. |
669
+ | `closeCalendarAccessibilityLabel` | `string` | No | `'Close calendar'` | Accessibility label for the calendar IconButton when the popover is open (closes the calendar when pressed). |
670
670
  | `compact` | `boolean` | No | `false` | Enables compact variation |
671
- | `dateInputClassName` | `string` | No | `-` | - |
672
- | `dateInputStyle` | `CSSProperties` | No | `-` | - |
671
+ | `dateInputClassName` | `string` | No | `-` | Custom class name to apply to the DateInput. |
672
+ | `dateInputStyle` | `CSSProperties` | No | `-` | Custom style to apply to the DateInput. |
673
673
  | `defaultOpen` | `boolean` | No | `-` | Control the default open state of the Calendar popover. |
674
674
  | `disabled` | `boolean` | No | `false` | Disables user interaction. Toggles input interactability and opacity |
675
- | `disabledDateError` | `string` | No | `'Date unavailable'` | Error text to display when a disabled date is selected with the DateInput, including dates before the minDate or after the maxDate. Also used as the tooltip content shown when hovering or focusing a disabled date on the Calendar. |
675
+ | `disabledDateError` | `string` | No | `'Date unavailable'` | Tooltip content shown when hovering or focusing a disabled date, including dates before the minDate or after the maxDate. |
676
676
  | `disabledDates` | `(Date \| [Date, Date])[]` | No | `-` | Array of disabled dates, and date tuples for date ranges. Make sure to set disabledDateError as well. A number is created for every individual date within a tuple range, so do not abuse this with massive ranges. |
677
677
  | `enableColorSurge` | `boolean` | No | `-` | Enable Color Surge motion |
678
678
  | `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the end of the inner input. Refer to diagram for location of endNode in InputStack component |
679
679
  | `height` | `((Height<string \| number> \| { base?: Height<string \| number>; phone?: Height<string \| number> \| undefined; tablet?: Height<string \| number> \| undefined; desktop?: Height<string \| number> \| undefined; }) & (string \| number)) \| undefined` | No | `-` | Height of input |
680
680
  | `helperText` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | For cases where label is not enough information to describe what the text input is for. Can also be used for showing positive/negative messages |
681
681
  | `helperTextErrorIconAccessibilityLabel` | `string` | No | `'error'` | Accessibility label for helper text error icon when variant=negative |
682
+ | `highlightedDateAccessibilityHint` | `string` | No | `'Highlighted'` | Accessibility hint announced for highlighted dates. Applied to all highlighted dates. |
682
683
  | `highlightedDates` | `(Date \| [Date, Date])[]` | No | `-` | Array of highlighted dates, and date tuples for date ranges. A number is created for every individual date within a tuple range, so do not abuse this with massive ranges. |
683
684
  | `inputBackground` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `'bg'` | Background color of the input. |
684
685
  | `invalidDateError` | `string` | No | `'Please enter a valid date'` | Error text to display when an impossible date is selected, e.g. 99/99/2000. This should always be defined for accessibility. Also displays when a date is selected that is more than 100 years before the minDate, or more than 100 years after the maxDate. |
@@ -689,12 +690,13 @@ function Example() {
689
690
  | `maxDate` | `Date` | No | `-` | Maximum date allowed to be selected, inclusive. Dates after the maxDate are disabled. All navigation to months after the maxDate is disabled. |
690
691
  | `minDate` | `Date` | No | `-` | Minimum date allowed to be selected, inclusive. Dates before the minDate are disabled. All navigation to months before the minDate is disabled. |
691
692
  | `nextArrowAccessibilityLabel` | `string` | No | `'Go to next month'` | Accessibility label describing the Calendar next month arrow. |
692
- | `onCancel` | `(() => void)` | No | `-` | Callback function fired when the user closes the Calendar popover without selecting a date. Interacting with the DateInput does not fire this callback. Will always be called before onClose. |
693
- | `onChange` | `(((event: ChangeEvent<HTMLInputElement>) => void) & ChangeEventHandler<HTMLInputElement>)` | No | `-` | Callback function fired when the DateInput text value changes. Prefer to use onChangeDate instead. Will always be called before onChangeDate. This prop should only be used for edge cases, such as custom error handling. |
693
+ | `onCancel` | `(() => void)` | No | `-` | Callback function fired when the user closes the picker without selecting a date. Interacting with the DateInput does not fire this callback. Will always be called before onClose. |
694
+ | `onChange` | `FormEventHandler<HTMLDivElement>` | No | `-` | - |
694
695
  | `onClick` | `(MouseEventHandler<Element> & MouseEventHandler<HTMLInputElement>)` | No | `-` | Callback fired when pressed/clicked |
695
- | `onClose` | `(() => void)` | No | `-` | Callback function fired when the Calendar popover is closed. Will always be called after onCancel, onConfirm, and onChangeDate. |
696
- | `onConfirm` | `(() => void)` | No | `-` | Callback function fired when the user selects a date using the Calendar popover. Interacting with the DateInput does not fire this callback. Will always be called before onClose. |
697
- | `onOpen` | `(() => void)` | No | `-` | Callback function fired when the Calendar popover is opened. |
696
+ | `onClose` | `(() => void)` | No | `-` | Callback function fired when the picker is closed. Will always be called after onCancel, onConfirm, and onChangeDate. |
697
+ | `onConfirm` | `(() => void)` | No | `-` | Callback function fired when the user selects a date using the picker. Interacting with the DateInput does not fire this callback. Will always be called before onClose. |
698
+ | `onOpen` | `(() => void)` | No | `-` | Callback function fired when the picker is opened. |
699
+ | `openCalendarAccessibilityLabel` | `string` | No | `'Open calendar'` | Accessibility label for the calendar IconButton when the popover is closed (opens the calendar when pressed). |
698
700
  | `placeholder` | `string` | No | `-` | Placeholder text displayed inside of the input. Will be replaced if there is a value. |
699
701
  | `previousArrowAccessibilityLabel` | `string` | No | `'Go to previous month'` | Accessibility label describing the Calendar previous month arrow. |
700
702
  | `ref` | `RefObject<HTMLDivElement> \| ((instance: HTMLDivElement \| null) => void) \| null` | No | `-` | - |
@@ -704,7 +706,7 @@ function Example() {
704
706
  | `seedDate` | `Date` | No | `-` | Date used to generate the Calendar month when there is no value for the selectedDate prop, defaults to today. |
705
707
  | `showOverlay` | `boolean` | No | `false` | Display an overlay over all content below the Popover menu |
706
708
  | `start` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Adds content to the start of the inner input. Refer to diagram for location of startNode in InputStack component |
707
- | `style` | `CSSProperties` | No | `-` | - |
709
+ | `styles` | `{ dateInput?: CSSProperties; calendar?: CSSProperties \| undefined; calendarHeader?: CSSProperties \| undefined; calendarTitle?: CSSProperties \| undefined; calendarNavigation?: CSSProperties \| undefined; calendarContent?: CSSProperties \| undefined; calendarDay?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for the DateInput and Calendar subcomponents. |
708
710
  | `suffix` | `string` | No | `-` | Adds suffix text to the end of input |
709
711
  | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
710
712
  | `testIDMap` | `{ start?: string; end?: string \| undefined; label?: string \| undefined; helperText?: string \| undefined; } \| undefined` | No | `-` | Add ability to test individual parts of the input |
@@ -1261,6 +1261,7 @@ function ResponsiveTrayExample() {
1261
1261
  | `key` | `Key \| null` | No | `-` | - |
1262
1262
  | `onBlur` | `(() => void)` | No | `-` | Callback fired when the overlay is pressed, or swipe to close |
1263
1263
  | `onClose` | `(() => void)` | No | `-` | Action that will happen when tray is dismissed |
1264
+ | `onOpenComplete` | `(() => void)` | No | `-` | Callback fired when the open animation completes. |
1264
1265
  | `onVisibilityChange` | `((context: hidden \| visible) => void)` | No | `-` | Optional callback that, if provided, will be triggered when the Tray is toggled open/ closed If used for analytics, context (visible \| hidden) can be bundled with the event info to track whether the multiselect was toggled into or out of view |
1265
1266
  | `pin` | `top \| bottom \| left \| right \| all` | No | `'bottom'` | Pin the tray to one side of the screen |
1266
1267
  | `preventDismiss` | `boolean` | No | `-` | Prevents a user from dismissing the tray by pressing the overlay or swiping |