@carbon/react 1.44.0-rc.0 → 1.45.0-rc.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1009 -1050
- package/es/components/Accordion/AccordionItem.d.ts +1 -1
- package/es/components/Accordion/AccordionItem.js +19 -15
- package/es/components/Checkbox/Checkbox.d.ts +4 -0
- package/es/components/Checkbox/Checkbox.js +15 -2
- package/es/components/CheckboxGroup/CheckboxGroup.js +17 -2
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboButton/index.js +1 -1
- package/es/components/ComposedModal/ModalFooter.d.ts +2 -1
- package/es/components/DataTable/DataTable.d.ts +2 -0
- package/es/components/DataTable/DataTable.js +3 -0
- package/es/components/DataTable/TableExpandRow.js +20 -3
- package/es/components/DataTable/TableHeader.d.ts +5 -0
- package/es/components/DataTable/TableHeader.js +30 -6
- package/es/components/DataTable/TableSlugRow.d.ts +31 -0
- package/es/components/DataTable/TableSlugRow.js +49 -0
- package/es/components/DataTable/index.d.ts +2 -1
- package/es/components/DataTable/index.js +3 -0
- package/es/components/DataTable/tools/sorting.js +1 -1
- package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.js +1 -1
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +1 -1
- package/es/components/FileUploader/FileUploader.js +5 -3
- package/es/components/Grid/Column.js +11 -1
- package/es/components/InlineLoading/InlineLoading.d.ts +68 -0
- package/es/components/InlineLoading/InlineLoading.js +4 -4
- package/es/components/InlineLoading/index.d.ts +9 -0
- package/es/components/Layer/LayerContext.d.ts +8 -0
- package/es/components/Layer/LayerLevel.d.ts +5 -0
- package/es/components/Layer/LayerLevel.js +12 -0
- package/es/components/Layer/index.d.ts +38 -0
- package/es/components/Layer/index.js +9 -8
- package/es/components/Menu/MenuItem.js +2 -1
- package/es/components/MenuButton/index.js +8 -2
- package/es/components/Modal/Modal.d.ts +3 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/MultiSelect.js +1 -1
- package/es/components/Notification/Notification.js +1 -0
- package/es/components/NumberInput/NumberInput.d.ts +1 -1
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/RadioButton/RadioButton.d.ts +4 -0
- package/es/components/RadioButton/RadioButton.js +15 -2
- package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +4 -0
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +17 -2
- package/es/components/Select/Select.d.ts +2 -2
- package/es/components/Select/Select.js +1 -1
- package/es/components/Slider/Slider.Skeleton.js +17 -3
- package/es/components/Slider/Slider.js +132 -93
- package/es/components/Slider/SliderHandles.d.ts +4 -0
- package/es/components/Slider/SliderHandles.js +65 -0
- package/es/components/Slug/index.js +1 -1
- package/es/components/Tabs/Tabs.js +1 -1
- package/es/components/TextArea/TextArea.d.ts +7 -3
- package/es/components/TextArea/TextArea.js +84 -17
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +1 -1
- package/es/components/Tile/Tile.d.ts +37 -0
- package/es/components/Tile/Tile.js +114 -13
- package/es/components/Tooltip/Tooltip.js +48 -2
- package/es/components/UIShell/Content.d.ts +296 -0
- package/es/components/UIShell/Content.js +1 -2
- package/es/components/UIShell/HeaderPanel.d.ts +36 -0
- package/es/components/UIShell/HeaderPanel.js +6 -6
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/index.js +2 -1
- package/es/internal/useAnnouncer.js +2 -1
- package/es/internal/useNoInteractiveChildren.js +2 -6
- package/lib/components/Accordion/AccordionItem.d.ts +1 -1
- package/lib/components/Accordion/AccordionItem.js +18 -14
- package/lib/components/Checkbox/Checkbox.d.ts +4 -0
- package/lib/components/Checkbox/Checkbox.js +15 -2
- package/lib/components/CheckboxGroup/CheckboxGroup.js +17 -2
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ComboButton/index.js +1 -1
- package/lib/components/ComposedModal/ModalFooter.d.ts +2 -1
- package/lib/components/DataTable/DataTable.d.ts +2 -0
- package/lib/components/DataTable/DataTable.js +3 -0
- package/lib/components/DataTable/TableExpandRow.js +20 -3
- package/lib/components/DataTable/TableHeader.d.ts +5 -0
- package/lib/components/DataTable/TableHeader.js +29 -5
- package/lib/components/DataTable/TableSlugRow.d.ts +31 -0
- package/lib/components/DataTable/TableSlugRow.js +59 -0
- package/lib/components/DataTable/index.d.ts +2 -1
- package/lib/components/DataTable/index.js +3 -0
- package/lib/components/DataTable/tools/sorting.js +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -1
- package/lib/components/FileUploader/FileUploader.js +5 -3
- package/lib/components/Grid/Column.js +11 -1
- package/lib/components/InlineLoading/InlineLoading.d.ts +68 -0
- package/lib/components/InlineLoading/InlineLoading.js +4 -4
- package/lib/components/InlineLoading/index.d.ts +9 -0
- package/lib/components/Layer/LayerContext.d.ts +8 -0
- package/lib/components/Layer/LayerLevel.d.ts +5 -0
- package/lib/components/Layer/LayerLevel.js +18 -0
- package/lib/components/Layer/index.d.ts +38 -0
- package/lib/components/Layer/index.js +10 -9
- package/lib/components/Menu/MenuItem.js +2 -1
- package/lib/components/MenuButton/index.js +8 -2
- package/lib/components/Modal/Modal.d.ts +3 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +1 -1
- package/lib/components/Notification/Notification.js +1 -0
- package/lib/components/NumberInput/NumberInput.d.ts +1 -1
- package/lib/components/NumberInput/NumberInput.js +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +4 -0
- package/lib/components/RadioButton/RadioButton.js +15 -2
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +4 -0
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +17 -2
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.js +1 -1
- package/lib/components/Slider/Slider.Skeleton.js +17 -3
- package/lib/components/Slider/Slider.js +132 -93
- package/lib/components/Slider/SliderHandles.d.ts +4 -0
- package/lib/components/Slider/SliderHandles.js +76 -0
- package/lib/components/Slug/index.js +1 -1
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/TextArea/TextArea.d.ts +7 -3
- package/lib/components/TextArea/TextArea.js +83 -16
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/components/Tile/Tile.d.ts +37 -0
- package/lib/components/Tile/Tile.js +114 -13
- package/lib/components/Tooltip/Tooltip.js +47 -1
- package/lib/components/UIShell/Content.d.ts +296 -0
- package/lib/components/UIShell/Content.js +1 -2
- package/lib/components/UIShell/HeaderPanel.d.ts +36 -0
- package/lib/components/UIShell/HeaderPanel.js +7 -7
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/index.js +4 -2
- package/lib/internal/useAnnouncer.js +2 -1
- package/lib/internal/useNoInteractiveChildren.js +2 -6
- package/package.json +5 -8
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
9
|
+
export type ContentProps = HTMLAttributes<HTMLElement> & {
|
|
10
|
+
/**
|
|
11
|
+
* Provide children nodes to be rendered in the content container
|
|
12
|
+
*/
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Optionally provide a custom class name that is applied to the container
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optionally specify the tag of the content node. Defaults to `main`
|
|
20
|
+
*/
|
|
21
|
+
tagName?: string;
|
|
22
|
+
};
|
|
23
|
+
declare const Content: {
|
|
24
|
+
({ className: customClassName, children, tagName, ...rest }: ContentProps): React.DOMElement<{
|
|
25
|
+
className: string;
|
|
26
|
+
defaultChecked?: boolean | undefined;
|
|
27
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
28
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
29
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
30
|
+
accessKey?: string | undefined;
|
|
31
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
32
|
+
contextMenu?: string | undefined;
|
|
33
|
+
dir?: string | undefined;
|
|
34
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
35
|
+
hidden?: boolean | undefined;
|
|
36
|
+
id?: string | undefined;
|
|
37
|
+
lang?: string | undefined;
|
|
38
|
+
placeholder?: string | undefined;
|
|
39
|
+
slot?: string | undefined;
|
|
40
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
41
|
+
style?: React.CSSProperties | undefined;
|
|
42
|
+
tabIndex?: number | undefined;
|
|
43
|
+
title?: string | undefined;
|
|
44
|
+
translate?: "no" | "yes" | undefined;
|
|
45
|
+
radioGroup?: string | undefined;
|
|
46
|
+
role?: React.AriaRole | undefined;
|
|
47
|
+
about?: string | undefined;
|
|
48
|
+
datatype?: string | undefined;
|
|
49
|
+
inlist?: any;
|
|
50
|
+
prefix?: string | undefined;
|
|
51
|
+
property?: string | undefined;
|
|
52
|
+
resource?: string | undefined;
|
|
53
|
+
typeof?: string | undefined;
|
|
54
|
+
vocab?: string | undefined;
|
|
55
|
+
autoCapitalize?: string | undefined;
|
|
56
|
+
autoCorrect?: string | undefined;
|
|
57
|
+
autoSave?: string | undefined;
|
|
58
|
+
color?: string | undefined;
|
|
59
|
+
itemProp?: string | undefined;
|
|
60
|
+
itemScope?: boolean | undefined;
|
|
61
|
+
itemType?: string | undefined;
|
|
62
|
+
itemID?: string | undefined;
|
|
63
|
+
itemRef?: string | undefined;
|
|
64
|
+
results?: number | undefined;
|
|
65
|
+
security?: string | undefined;
|
|
66
|
+
unselectable?: "on" | "off" | undefined;
|
|
67
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
68
|
+
is?: string | undefined;
|
|
69
|
+
'aria-activedescendant'?: string | undefined;
|
|
70
|
+
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
71
|
+
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
72
|
+
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
73
|
+
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
74
|
+
'aria-colcount'?: number | undefined;
|
|
75
|
+
'aria-colindex'?: number | undefined;
|
|
76
|
+
'aria-colspan'?: number | undefined;
|
|
77
|
+
'aria-controls'?: string | undefined;
|
|
78
|
+
'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
79
|
+
'aria-describedby'?: string | undefined;
|
|
80
|
+
'aria-details'?: string | undefined;
|
|
81
|
+
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
82
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
83
|
+
'aria-errormessage'?: string | undefined;
|
|
84
|
+
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
85
|
+
'aria-flowto'?: string | undefined;
|
|
86
|
+
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
|
|
88
|
+
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
89
|
+
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
90
|
+
'aria-keyshortcuts'?: string | undefined;
|
|
91
|
+
'aria-label'?: string | undefined;
|
|
92
|
+
'aria-labelledby'?: string | undefined;
|
|
93
|
+
'aria-level'?: number | undefined;
|
|
94
|
+
'aria-live'?: "off" | "assertive" | "polite" | undefined;
|
|
95
|
+
'aria-modal'?: (boolean | "true" | "false") | undefined;
|
|
96
|
+
'aria-multiline'?: (boolean | "true" | "false") | undefined;
|
|
97
|
+
'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
|
|
98
|
+
'aria-orientation'?: "horizontal" | "vertical" | undefined;
|
|
99
|
+
'aria-owns'?: string | undefined;
|
|
100
|
+
'aria-placeholder'?: string | undefined;
|
|
101
|
+
'aria-posinset'?: number | undefined;
|
|
102
|
+
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
103
|
+
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
104
|
+
'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
105
|
+
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
106
|
+
'aria-roledescription'?: string | undefined;
|
|
107
|
+
'aria-rowcount'?: number | undefined;
|
|
108
|
+
'aria-rowindex'?: number | undefined;
|
|
109
|
+
'aria-rowspan'?: number | undefined;
|
|
110
|
+
'aria-selected'?: (boolean | "true" | "false") | undefined;
|
|
111
|
+
'aria-setsize'?: number | undefined;
|
|
112
|
+
'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
113
|
+
'aria-valuemax'?: number | undefined;
|
|
114
|
+
'aria-valuemin'?: number | undefined;
|
|
115
|
+
'aria-valuenow'?: number | undefined;
|
|
116
|
+
'aria-valuetext'?: string | undefined;
|
|
117
|
+
dangerouslySetInnerHTML?: {
|
|
118
|
+
__html: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
onCopy?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
121
|
+
onCopyCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
122
|
+
onCut?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
123
|
+
onCutCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
124
|
+
onPaste?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
125
|
+
onPasteCapture?: React.ClipboardEventHandler<HTMLElement> | undefined;
|
|
126
|
+
onCompositionEnd?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
127
|
+
onCompositionEndCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
128
|
+
onCompositionStart?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
129
|
+
onCompositionStartCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
130
|
+
onCompositionUpdate?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
131
|
+
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLElement> | undefined;
|
|
132
|
+
onFocus?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
133
|
+
onFocusCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
134
|
+
onBlur?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
135
|
+
onBlurCapture?: React.FocusEventHandler<HTMLElement> | undefined;
|
|
136
|
+
onChange?: React.FormEventHandler<HTMLElement> | undefined;
|
|
137
|
+
onChangeCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
138
|
+
onBeforeInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
139
|
+
onBeforeInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
140
|
+
onInput?: React.FormEventHandler<HTMLElement> | undefined;
|
|
141
|
+
onInputCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
142
|
+
onReset?: React.FormEventHandler<HTMLElement> | undefined;
|
|
143
|
+
onResetCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
144
|
+
onSubmit?: React.FormEventHandler<HTMLElement> | undefined;
|
|
145
|
+
onSubmitCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
146
|
+
onInvalid?: React.FormEventHandler<HTMLElement> | undefined;
|
|
147
|
+
onInvalidCapture?: React.FormEventHandler<HTMLElement> | undefined;
|
|
148
|
+
onLoad?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
149
|
+
onLoadCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
150
|
+
onError?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
151
|
+
onErrorCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
152
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
153
|
+
onKeyDownCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
154
|
+
onKeyPress?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
155
|
+
onKeyPressCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
156
|
+
onKeyUp?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
157
|
+
onKeyUpCapture?: React.KeyboardEventHandler<HTMLElement> | undefined;
|
|
158
|
+
onAbort?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
159
|
+
onAbortCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
160
|
+
onCanPlay?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
161
|
+
onCanPlayCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
162
|
+
onCanPlayThrough?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
163
|
+
onCanPlayThroughCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
164
|
+
onDurationChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
165
|
+
onDurationChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
166
|
+
onEmptied?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
167
|
+
onEmptiedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
168
|
+
onEncrypted?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
169
|
+
onEncryptedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
170
|
+
onEnded?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
171
|
+
onEndedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
172
|
+
onLoadedData?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
173
|
+
onLoadedDataCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
174
|
+
onLoadedMetadata?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
175
|
+
onLoadedMetadataCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
176
|
+
onLoadStart?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
177
|
+
onLoadStartCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
178
|
+
onPause?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
179
|
+
onPauseCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
180
|
+
onPlay?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
181
|
+
onPlayCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
182
|
+
onPlaying?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
183
|
+
onPlayingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
184
|
+
onProgress?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
185
|
+
onProgressCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
186
|
+
onRateChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
187
|
+
onRateChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
188
|
+
onSeeked?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
189
|
+
onSeekedCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
190
|
+
onSeeking?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
191
|
+
onSeekingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
192
|
+
onStalled?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
193
|
+
onStalledCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
194
|
+
onSuspend?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
195
|
+
onSuspendCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
196
|
+
onTimeUpdate?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
197
|
+
onTimeUpdateCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
198
|
+
onVolumeChange?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
199
|
+
onVolumeChangeCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
200
|
+
onWaiting?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
201
|
+
onWaitingCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
202
|
+
onAuxClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
203
|
+
onAuxClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
204
|
+
onClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
205
|
+
onClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
206
|
+
onContextMenu?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
207
|
+
onContextMenuCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
208
|
+
onDoubleClick?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
209
|
+
onDoubleClickCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
210
|
+
onDrag?: React.DragEventHandler<HTMLElement> | undefined;
|
|
211
|
+
onDragCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
212
|
+
onDragEnd?: React.DragEventHandler<HTMLElement> | undefined;
|
|
213
|
+
onDragEndCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
214
|
+
onDragEnter?: React.DragEventHandler<HTMLElement> | undefined;
|
|
215
|
+
onDragEnterCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
216
|
+
onDragExit?: React.DragEventHandler<HTMLElement> | undefined;
|
|
217
|
+
onDragExitCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
218
|
+
onDragLeave?: React.DragEventHandler<HTMLElement> | undefined;
|
|
219
|
+
onDragLeaveCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
220
|
+
onDragOver?: React.DragEventHandler<HTMLElement> | undefined;
|
|
221
|
+
onDragOverCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
222
|
+
onDragStart?: React.DragEventHandler<HTMLElement> | undefined;
|
|
223
|
+
onDragStartCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
224
|
+
onDrop?: React.DragEventHandler<HTMLElement> | undefined;
|
|
225
|
+
onDropCapture?: React.DragEventHandler<HTMLElement> | undefined;
|
|
226
|
+
onMouseDown?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
227
|
+
onMouseDownCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
228
|
+
onMouseEnter?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
229
|
+
onMouseLeave?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
230
|
+
onMouseMove?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
231
|
+
onMouseMoveCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
232
|
+
onMouseOut?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
233
|
+
onMouseOutCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
234
|
+
onMouseOver?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
235
|
+
onMouseOverCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
236
|
+
onMouseUp?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
237
|
+
onMouseUpCapture?: React.MouseEventHandler<HTMLElement> | undefined;
|
|
238
|
+
onSelect?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
239
|
+
onSelectCapture?: React.ReactEventHandler<HTMLElement> | undefined;
|
|
240
|
+
onTouchCancel?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
241
|
+
onTouchCancelCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
242
|
+
onTouchEnd?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
243
|
+
onTouchEndCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
244
|
+
onTouchMove?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
245
|
+
onTouchMoveCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
246
|
+
onTouchStart?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
247
|
+
onTouchStartCapture?: React.TouchEventHandler<HTMLElement> | undefined;
|
|
248
|
+
onPointerDown?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
249
|
+
onPointerDownCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
250
|
+
onPointerMove?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
251
|
+
onPointerMoveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
252
|
+
onPointerUp?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
253
|
+
onPointerUpCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
254
|
+
onPointerCancel?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
255
|
+
onPointerCancelCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
256
|
+
onPointerEnter?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
257
|
+
onPointerEnterCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
258
|
+
onPointerLeave?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
259
|
+
onPointerLeaveCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
260
|
+
onPointerOver?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
261
|
+
onPointerOverCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
262
|
+
onPointerOut?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
263
|
+
onPointerOutCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
264
|
+
onGotPointerCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
265
|
+
onGotPointerCaptureCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
266
|
+
onLostPointerCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
267
|
+
onLostPointerCaptureCapture?: React.PointerEventHandler<HTMLElement> | undefined;
|
|
268
|
+
onScroll?: React.UIEventHandler<HTMLElement> | undefined;
|
|
269
|
+
onScrollCapture?: React.UIEventHandler<HTMLElement> | undefined;
|
|
270
|
+
onWheel?: React.WheelEventHandler<HTMLElement> | undefined;
|
|
271
|
+
onWheelCapture?: React.WheelEventHandler<HTMLElement> | undefined;
|
|
272
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
273
|
+
onAnimationStartCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
274
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
275
|
+
onAnimationEndCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
276
|
+
onAnimationIteration?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
277
|
+
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLElement> | undefined;
|
|
278
|
+
onTransitionEnd?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
279
|
+
onTransitionEndCapture?: React.TransitionEventHandler<HTMLElement> | undefined;
|
|
280
|
+
}, Element>;
|
|
281
|
+
propTypes: {
|
|
282
|
+
/**
|
|
283
|
+
* Provide children nodes to be rendered in the content container
|
|
284
|
+
*/
|
|
285
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
286
|
+
/**
|
|
287
|
+
* Optionally provide a custom class name that is applied to the container
|
|
288
|
+
*/
|
|
289
|
+
className: PropTypes.Requireable<string>;
|
|
290
|
+
/**
|
|
291
|
+
* Optionally specify the tag of the content node. Defaults to `main`
|
|
292
|
+
*/
|
|
293
|
+
tagName: PropTypes.Requireable<string>;
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
export default Content;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React, { ReactNode } from 'react';
|
|
8
|
+
interface HeaderPanelProps {
|
|
9
|
+
/**
|
|
10
|
+
* Specify whether focus and blur listeners are added. They are by default.
|
|
11
|
+
*/
|
|
12
|
+
addFocusListeners?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The content that will render inside of the `HeaderPanel`
|
|
15
|
+
*/
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Optionally provide a custom class to apply to the underlying `<li>` node
|
|
19
|
+
*/
|
|
20
|
+
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Specify whether the panel is expanded
|
|
23
|
+
*/
|
|
24
|
+
expanded?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Provide the `href` to the id of the element on your package that could
|
|
27
|
+
* be target.
|
|
28
|
+
*/
|
|
29
|
+
href?: string;
|
|
30
|
+
/**
|
|
31
|
+
* An optional listener that is called a callback to collapse the HeaderPanel
|
|
32
|
+
*/
|
|
33
|
+
onHeaderPanelFocus?: () => void;
|
|
34
|
+
}
|
|
35
|
+
declare const HeaderPanel: React.FC<HeaderPanelProps>;
|
|
36
|
+
export default HeaderPanel;
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default, { useRef, useState } from 'react';
|
|
10
9
|
import cx from 'classnames';
|
|
11
10
|
import PropTypes from 'prop-types';
|
|
11
|
+
import React__default, { useRef, useState } from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import { useWindowEvent } from '../../internal/useEvent.js';
|
|
14
14
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
@@ -24,7 +24,7 @@ const HeaderPanel = /*#__PURE__*/React__default.forwardRef(function HeaderPanel(
|
|
|
24
24
|
addFocusListeners = true,
|
|
25
25
|
onHeaderPanelFocus = noopFn,
|
|
26
26
|
href,
|
|
27
|
-
...
|
|
27
|
+
...rest
|
|
28
28
|
} = _ref;
|
|
29
29
|
const prefix = usePrefix();
|
|
30
30
|
const headerPanelReference = useRef(null);
|
|
@@ -61,12 +61,13 @@ const HeaderPanel = /*#__PURE__*/React__default.forwardRef(function HeaderPanel(
|
|
|
61
61
|
useWindowEvent('click', () => {
|
|
62
62
|
const focusedElement = document.activeElement;
|
|
63
63
|
setLastClickedElement(focusedElement);
|
|
64
|
-
|
|
64
|
+
const childJsxElement = children;
|
|
65
|
+
if (childJsxElement.type?.displayName === 'Switcher' && !focusedElement?.closest(`.${prefix}--header-panel--expanded`) && !focusedElement?.closest(`.${prefix}--header__action`) && !headerPanelReference?.current?.classList.contains(`${prefix}--switcher`) && expanded) {
|
|
65
66
|
setExpandedState(false);
|
|
66
67
|
onHeaderPanelFocus();
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({},
|
|
70
|
+
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
70
71
|
className: className,
|
|
71
72
|
ref: headerPanelRef
|
|
72
73
|
}, eventHandlers), children);
|
|
@@ -99,6 +100,5 @@ HeaderPanel.propTypes = {
|
|
|
99
100
|
onHeaderPanelFocus: PropTypes.func
|
|
100
101
|
};
|
|
101
102
|
HeaderPanel.displayName = 'HeaderPanel';
|
|
102
|
-
var HeaderPanel$1 = HeaderPanel;
|
|
103
103
|
|
|
104
|
-
export { HeaderPanel
|
|
104
|
+
export { HeaderPanel as default };
|
|
@@ -25,5 +25,5 @@ interface SideNavContextData {
|
|
|
25
25
|
isRail?: boolean | undefined;
|
|
26
26
|
}
|
|
27
27
|
export declare const SideNavContext: React.Context<SideNavContextData>;
|
|
28
|
-
declare const SideNav: React.ForwardRefExoticComponent<Pick<SideNavProps, "children" | "slot" | "style" | "title" | "className" | "dir" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "onToggle" | "key" | "id" | "aria-controls" | "aria-expanded" | "onClick" | "
|
|
28
|
+
declare const SideNav: React.ForwardRefExoticComponent<Pick<SideNavProps, "children" | "slot" | "style" | "title" | "className" | "dir" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "onToggle" | "key" | "id" | "aria-controls" | "aria-expanded" | "onClick" | "onKeyDown" | "onTransitionEnd" | "tabIndex" | "color" | "lang" | "role" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEndCapture" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "expanded" | "enterDelayMs" | "defaultExpanded" | "inert" | "addFocusListeners" | "isChildOfHeader" | "isFixedNav" | "isRail" | "isPersistent" | "addMouseListeners" | "onOverlayClick" | "onSideNavBlur"> & React.RefAttributes<HTMLElement>>;
|
|
29
29
|
export default SideNav;
|
package/es/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export { ColumnHang } from './components/Grid/ColumnHang.js';
|
|
|
54
54
|
export { GridSettings } from './components/Grid/GridContext.js';
|
|
55
55
|
export { default as IconSkeleton } from './components/Icon/Icon.Skeleton.js';
|
|
56
56
|
export { IdPrefix } from './components/IdPrefix/index.js';
|
|
57
|
+
export { default as InlineLoading } from './components/InlineLoading/InlineLoading.js';
|
|
57
58
|
export { default as Link } from './components/Link/Link.js';
|
|
58
59
|
export { default as ListItem } from './components/ListItem/ListItem.js';
|
|
59
60
|
export { default as Loading } from './components/Loading/Loading.js';
|
|
@@ -157,7 +158,6 @@ export { default as useContextMenu } from './components/ContextMenu/useContextMe
|
|
|
157
158
|
export { default as Copy } from './components/Copy/Copy.js';
|
|
158
159
|
export { default as CopyButton } from './components/CopyButton/CopyButton.js';
|
|
159
160
|
export { default as ErrorBoundary } from './components/ErrorBoundary/ErrorBoundary.js';
|
|
160
|
-
export { default as InlineLoading } from './components/InlineLoading/InlineLoading.js';
|
|
161
161
|
export { default as ModalWrapper } from './components/ModalWrapper/ModalWrapper.js';
|
|
162
162
|
export { default as ProgressIndicatorSkeleton } from './components/ProgressIndicator/ProgressIndicator.Skeleton.js';
|
|
163
163
|
export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
|
|
@@ -197,6 +197,7 @@ export { default as TableHeader } from './components/DataTable/TableHeader.js';
|
|
|
197
197
|
export { default as TableRow } from './components/DataTable/TableRow.js';
|
|
198
198
|
export { default as TableSelectAll } from './components/DataTable/TableSelectAll.js';
|
|
199
199
|
export { default as TableSelectRow } from './components/DataTable/TableSelectRow.js';
|
|
200
|
+
export { default as TableSlugRow } from './components/DataTable/TableSlugRow.js';
|
|
200
201
|
export { default as TableToolbar } from './components/DataTable/TableToolbar.js';
|
|
201
202
|
export { default as TableToolbarAction } from './components/DataTable/TableToolbarAction.js';
|
|
202
203
|
export { default as TableToolbarContent } from './components/DataTable/TableToolbarContent.js';
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
function useAnnouncer(textCount, maxCount) {
|
|
9
|
+
let entityName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'characters';
|
|
9
10
|
const lastTen = maxCount - 10;
|
|
10
11
|
if (textCount >= lastTen) {
|
|
11
|
-
return `${maxCount - textCount}
|
|
12
|
+
return `${maxCount - textCount} ${entityName} left.`;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -74,7 +74,7 @@ function getRoleContent(node) {
|
|
|
74
74
|
* @see https://github.com/w3c/aria-practices/blob/0553bb51588ffa517506e2a1b2ca1422ed438c5f/examples/js/utils.js#L68
|
|
75
75
|
*/
|
|
76
76
|
function isFocusable(element) {
|
|
77
|
-
if (element.tabIndex < 0) {
|
|
77
|
+
if (element.tabIndex === undefined || element.tabIndex < 0) {
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
if (element.disabled) {
|
|
@@ -85,12 +85,8 @@ function isFocusable(element) {
|
|
|
85
85
|
return !!element.href && element.rel !== 'ignore';
|
|
86
86
|
case 'INPUT':
|
|
87
87
|
return element.type !== 'hidden';
|
|
88
|
-
case 'BUTTON':
|
|
89
|
-
case 'SELECT':
|
|
90
|
-
case 'TEXTAREA':
|
|
91
|
-
return true;
|
|
92
88
|
default:
|
|
93
|
-
return
|
|
89
|
+
return true;
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
92
|
|
|
@@ -47,7 +47,7 @@ interface AccordionItemProps {
|
|
|
47
47
|
* The callback function to run on the `onAnimationEnd`
|
|
48
48
|
* event for the list item.
|
|
49
49
|
*/
|
|
50
|
-
handleAnimationEnd?: AnimationEventHandler<
|
|
50
|
+
handleAnimationEnd?: AnimationEventHandler<HTMLElement>;
|
|
51
51
|
}
|
|
52
52
|
interface AccordionToggleProps {
|
|
53
53
|
'aria-controls'?: AriaAttributes['aria-controls'];
|
|
@@ -47,8 +47,6 @@ function AccordionItem(_ref) {
|
|
|
47
47
|
...rest
|
|
48
48
|
} = _ref;
|
|
49
49
|
const [isOpen, setIsOpen] = React.useState(open);
|
|
50
|
-
const [prevIsOpen, setPrevIsOpen] = React.useState(open);
|
|
51
|
-
const [animation, setAnimation] = React.useState('');
|
|
52
50
|
const accordionState = React.useContext(AccordionProvider.AccordionContext);
|
|
53
51
|
const disabledIsControlled = typeof controlledDisabled === 'boolean';
|
|
54
52
|
const disabled = disabledIsControlled ? controlledDisabled : accordionState.disabled;
|
|
@@ -57,23 +55,28 @@ function AccordionItem(_ref) {
|
|
|
57
55
|
const className = cx__default["default"]({
|
|
58
56
|
[`${prefix}--accordion__item`]: true,
|
|
59
57
|
[`${prefix}--accordion__item--active`]: isOpen,
|
|
60
|
-
[`${prefix}--accordion__item--${animation}`]: animation,
|
|
61
58
|
[`${prefix}--accordion__item--disabled`]: disabled,
|
|
62
59
|
[customClassName]: !!customClassName
|
|
63
60
|
});
|
|
64
61
|
const Toggle = renderToggle || renderExpando; // remove renderExpando in next major release
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
setAnimation(isOpen ? 'collapsing' : 'expanding');
|
|
68
|
-
setIsOpen(open);
|
|
69
|
-
setPrevIsOpen(open);
|
|
70
|
-
}
|
|
63
|
+
const content = React.useRef(null);
|
|
71
64
|
|
|
72
65
|
// When the AccordionItem heading is clicked, toggle the open state of the
|
|
73
66
|
// panel
|
|
74
67
|
function onClick(event) {
|
|
68
|
+
// type guard for ref
|
|
69
|
+
if (!content.current) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (isOpen) {
|
|
73
|
+
// accordion closes
|
|
74
|
+
content.current.style.maxBlockSize = '';
|
|
75
|
+
} else {
|
|
76
|
+
// accordion opens
|
|
77
|
+
content.current.style.maxBlockSize = content.current.scrollHeight + 15 + 'px';
|
|
78
|
+
}
|
|
75
79
|
const nextValue = !isOpen;
|
|
76
|
-
setAnimation(isOpen ? 'collapsing' : 'expanding');
|
|
77
80
|
setIsOpen(nextValue);
|
|
78
81
|
if (onHeadingClick) {
|
|
79
82
|
// TODO: normalize signature, potentially:
|
|
@@ -95,13 +98,10 @@ function AccordionItem(_ref) {
|
|
|
95
98
|
if (handleAnimationEnd) {
|
|
96
99
|
handleAnimationEnd(event);
|
|
97
100
|
}
|
|
98
|
-
setAnimation('');
|
|
99
101
|
}
|
|
100
102
|
return /*#__PURE__*/React__default["default"].createElement("li", _rollupPluginBabelHelpers["extends"]({
|
|
101
103
|
className: className
|
|
102
|
-
}, rest, {
|
|
103
|
-
onAnimationEnd: onAnimationEnd
|
|
104
|
-
}), /*#__PURE__*/React__default["default"].createElement(Toggle, {
|
|
104
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement(Toggle, {
|
|
105
105
|
disabled: disabled,
|
|
106
106
|
"aria-controls": id,
|
|
107
107
|
"aria-expanded": isOpen,
|
|
@@ -115,9 +115,13 @@ function AccordionItem(_ref) {
|
|
|
115
115
|
as: "div",
|
|
116
116
|
className: `${prefix}--accordion__title`
|
|
117
117
|
}, title)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
118
|
+
ref: content,
|
|
119
|
+
className: `${prefix}--accordion__wrapper`,
|
|
120
|
+
onTransitionEnd: onAnimationEnd
|
|
121
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
118
122
|
id: id,
|
|
119
123
|
className: `${prefix}--accordion__content`
|
|
120
|
-
}, children));
|
|
124
|
+
}, children)));
|
|
121
125
|
}
|
|
122
126
|
AccordionItem.propTypes = {
|
|
123
127
|
/**
|
|
@@ -45,6 +45,10 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
45
45
|
* Provide the text that is displayed when the Checkbox is in an invalid state
|
|
46
46
|
*/
|
|
47
47
|
invalidText?: React.ReactNode;
|
|
48
|
+
/**
|
|
49
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
50
|
+
*/
|
|
51
|
+
slug?: ReactNodeLike;
|
|
48
52
|
/**
|
|
49
53
|
* Specify whether the Checkbox is currently invalid
|
|
50
54
|
*/
|
|
@@ -43,6 +43,7 @@ const Checkbox = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
43
43
|
title = '',
|
|
44
44
|
warn,
|
|
45
45
|
warnText,
|
|
46
|
+
slug,
|
|
46
47
|
...other
|
|
47
48
|
} = _ref;
|
|
48
49
|
const prefix = usePrefix.usePrefix();
|
|
@@ -57,11 +58,19 @@ const Checkbox = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
57
58
|
const wrapperClasses = cx__default["default"](`${prefix}--form-item`, `${prefix}--checkbox-wrapper`, className, {
|
|
58
59
|
[`${prefix}--checkbox-wrapper--readonly`]: readOnly,
|
|
59
60
|
[`${prefix}--checkbox-wrapper--invalid`]: !readOnly && invalid,
|
|
60
|
-
[`${prefix}--checkbox-wrapper--warning`]: showWarning
|
|
61
|
+
[`${prefix}--checkbox-wrapper--warning`]: showWarning,
|
|
62
|
+
[`${prefix}--checkbox-wrapper--slug`]: slug
|
|
61
63
|
});
|
|
62
64
|
const innerLabelClasses = cx__default["default"](`${prefix}--checkbox-label-text`, {
|
|
63
65
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
64
66
|
});
|
|
67
|
+
let normalizedSlug;
|
|
68
|
+
if (slug && /*#__PURE__*/React__default["default"].isValidElement(slug)) {
|
|
69
|
+
const size = slug.props?.['kind'] === 'inline' ? 'md' : 'mini';
|
|
70
|
+
normalizedSlug = /*#__PURE__*/React__default["default"].cloneElement(slug, {
|
|
71
|
+
size
|
|
72
|
+
});
|
|
73
|
+
}
|
|
65
74
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
66
75
|
className: wrapperClasses
|
|
67
76
|
}, /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({}, other, {
|
|
@@ -107,7 +116,7 @@ const Checkbox = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
107
116
|
title: title
|
|
108
117
|
}, /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
109
118
|
className: innerLabelClasses
|
|
110
|
-
}, labelText)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
119
|
+
}, labelText, normalizedSlug)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
111
120
|
className: `${prefix}--checkbox__validation-msg`
|
|
112
121
|
}, !readOnly && invalid && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(iconsReact.WarningFilled, {
|
|
113
122
|
className: `${prefix}--checkbox__invalid-icon`
|
|
@@ -175,6 +184,10 @@ Checkbox.propTypes = {
|
|
|
175
184
|
* Specify whether the Checkbox is read-only
|
|
176
185
|
*/
|
|
177
186
|
readOnly: PropTypes__default["default"].bool,
|
|
187
|
+
/**
|
|
188
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
189
|
+
*/
|
|
190
|
+
slug: PropTypes__default["default"].node,
|
|
178
191
|
/**
|
|
179
192
|
* Specify a title for the <label> node for the Checkbox
|
|
180
193
|
*/
|