@astryxdesign/core 0.1.2 → 0.1.3-canary.6d57c8d
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/CHANGELOG.md +165 -0
- package/README.md +12 -12
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +11 -5
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +24 -5
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +2 -4
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +0 -1
- package/dist/Calendar/Calendar.d.ts +5 -4
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +82 -43
- package/dist/Calendar/hooks/index.d.ts +0 -2
- package/dist/Calendar/hooks/index.d.ts.map +1 -1
- package/dist/Calendar/hooks/index.js +1 -2
- package/dist/Calendar/index.d.ts +3 -3
- package/dist/Calendar/index.d.ts.map +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/Calendar/styles.d.ts +3 -9
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +3 -11
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +17 -3
- package/dist/Center/Center.d.ts +11 -1
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +9 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +0 -1
- package/dist/Chat/ChatMessageList.d.ts +14 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +2 -0
- package/dist/Chat/useTriggerMenu.d.ts +8 -1
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +15 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts +23 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +51 -9
- package/dist/CheckboxList/CheckboxList.d.ts +13 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +39 -9
- package/dist/CheckboxList/CheckboxListContext.d.ts +7 -0
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +0 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +9 -5
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +51 -37
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +5 -5
- package/dist/ContextMenu/ContextMenu.d.ts +4 -5
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +93 -11
- package/dist/DateInput/DateInput.d.ts +23 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +167 -99
- package/dist/DateRangeInput/DateRangeInput.d.ts +23 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +42 -9
- package/dist/DateTimeInput/DateTimeInput.d.ts +35 -2
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +78 -15
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +12 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +42 -14
- package/dist/Field/Field.d.ts +19 -2
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +4 -0
- package/dist/Field/FieldLabel.d.ts +21 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +41 -26
- package/dist/FileInput/FileInput.d.ts +22 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +56 -10
- package/dist/Grid/Grid.d.ts +11 -1
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +32 -6
- package/dist/InputGroup/InputGroup.d.ts +4 -3
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +16 -6
- package/dist/InputGroup/InputGroupContext.d.ts +4 -0
- package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupContext.js +2 -2
- package/dist/InputGroup/groupStyles.d.ts +1 -1
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +3 -3
- package/dist/InputGroup/index.d.ts +1 -0
- package/dist/InputGroup/index.d.ts.map +1 -1
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +33 -1
- package/dist/Layer/layerAnimations.stylex.d.ts +4 -0
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +8 -4
- package/dist/Layer/useLayer.d.ts +10 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +64 -9
- package/dist/Layout/Layout.d.ts +4 -11
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +10 -11
- package/dist/Layout/LayoutFooter.d.ts +2 -2
- package/dist/Layout/LayoutFooter.d.ts.map +1 -1
- package/dist/Layout/LayoutHeader.d.ts +2 -2
- package/dist/Layout/LayoutHeader.d.ts.map +1 -1
- package/dist/Layout/LayoutPanel.d.ts +2 -2
- package/dist/Layout/LayoutPanel.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.d.ts +51 -0
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +63 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -2
- package/dist/Link/Link.d.ts +16 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +18 -7
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -0
- package/dist/MoreMenu/MoreMenu.d.ts +1 -7
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +0 -2
- package/dist/MultiSelector/MultiSelector.d.ts +27 -2
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +141 -42
- package/dist/MultiSelector/hooks.d.ts +12 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +14 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +34 -3
- package/dist/NumberInput/NumberInput.d.ts +23 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +62 -12
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +15 -1
- package/dist/Popover/Popover.d.ts +18 -2
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +5 -2
- package/dist/Popover/usePopover.d.ts +38 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +24 -9
- package/dist/PowerSearch/PowerSearch.d.ts +11 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +6 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +3 -5
- package/dist/RadioList/RadioList.d.ts +20 -2
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +105 -9
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +13 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts +13 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +78 -44
- package/dist/SegmentedControl/SegmentedControlContext.d.ts +7 -0
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +13 -2
- package/dist/Selector/Selector.d.ts +24 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +122 -43
- package/dist/Selector/hooks.d.ts +8 -1
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +14 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +2 -0
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +1 -1
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +8 -2
- package/dist/Slider/Slider.d.ts +21 -0
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +36 -9
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +1 -1
- package/dist/Stack/Stack.d.ts +38 -23
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +25 -1
- package/dist/Stack/StackItem.d.ts +12 -23
- package/dist/Stack/StackItem.d.ts.map +1 -1
- package/dist/Stack/StackItem.js +8 -1
- package/dist/Switch/Switch.d.ts +23 -2
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +41 -11
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +6 -0
- package/dist/TabList/TabList.d.ts +16 -4
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +87 -10
- package/dist/TabList/TabListContext.d.ts +5 -0
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +5 -0
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +6 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +11 -8
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +10 -1
- package/dist/Table/TableCell.d.ts +8 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +10 -10
- package/dist/Table/TableHeaderCell.d.ts +8 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +16 -16
- package/dist/Table/index.d.ts +2 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +2 -2
- package/dist/Table/plugins/pagination/paginateData.d.ts +2 -1
- package/dist/Table/plugins/pagination/paginateData.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/paginateData.js +8 -3
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +6 -1
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +59 -3
- package/dist/Table/tableContextMenu.d.ts +33 -0
- package/dist/Table/tableContextMenu.d.ts.map +1 -0
- package/dist/Table/tableContextMenu.js +133 -0
- package/dist/Table/types.d.ts +66 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/TextArea/TextArea.d.ts +22 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +41 -9
- package/dist/TextInput/TextInput.d.ts +23 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +55 -10
- package/dist/TimeInput/TimeInput.d.ts +23 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +147 -76
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +14 -0
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +131 -3
- package/dist/Tokenizer/Tokenizer.d.ts +12 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +26 -4
- package/dist/Toolbar/Toolbar.d.ts +3 -3
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +51 -7
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +56 -9
- package/dist/TopNav/TopNavHeading.d.ts +7 -1
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +8 -0
- package/dist/TreeList/TreeList.d.ts +1 -1
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +72 -2
- package/dist/TreeList/TreeListItem.d.ts +11 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +51 -12
- package/dist/TreeList/treeListItem.markers.stylex.d.ts +16 -0
- package/dist/TreeList/treeListItem.markers.stylex.d.ts.map +1 -0
- package/dist/TreeList/treeListItem.markers.stylex.js +22 -0
- package/dist/Typeahead/BaseTypeahead.d.ts +13 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +69 -6
- package/dist/Typeahead/Typeahead.d.ts +26 -3
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +65 -29
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +61 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.js +65 -0
- package/dist/VisuallyHidden/index.d.ts +11 -0
- package/dist/VisuallyHidden/index.d.ts.map +1 -0
- package/dist/VisuallyHidden/index.js +13 -0
- package/dist/astryx.css +18 -0
- package/dist/astryx.umd.js +55 -55
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/focusableSelector.d.ts +22 -0
- package/dist/hooks/focusableSelector.d.ts.map +1 -0
- package/dist/hooks/focusableSelector.js +24 -0
- package/dist/hooks/index.d.ts +12 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +7 -2
- package/dist/hooks/useAnnounce.d.ts +40 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -0
- package/dist/hooks/useAnnounce.js +142 -0
- package/dist/hooks/useClickableContainer.d.ts +16 -1
- package/dist/hooks/useClickableContainer.d.ts.map +1 -1
- package/dist/hooks/useClickableContainer.js +16 -4
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +4 -4
- package/dist/hooks/useFocusTrap.d.ts +18 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +87 -3
- package/dist/hooks/useGridFocus.d.ts +88 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +261 -62
- package/dist/hooks/useKeyboardHint.d.ts +82 -0
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -0
- package/dist/hooks/useKeyboardHint.js +220 -0
- package/dist/hooks/useListFocus.d.ts +78 -7
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +305 -52
- package/dist/hooks/useLongPress.d.ts +21 -0
- package/dist/hooks/useLongPress.d.ts.map +1 -0
- package/dist/hooks/useLongPress.js +89 -0
- package/dist/hooks/useTreeFocus.d.ts +157 -0
- package/dist/hooks/useTreeFocus.d.ts.map +1 -0
- package/dist/hooks/useTreeFocus.js +337 -0
- package/dist/hooks/useTypeahead.d.ts +63 -0
- package/dist/hooks/useTypeahead.d.ts.map +1 -0
- package/dist/hooks/useTypeahead.js +117 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/dateTypes.d.ts +12 -0
- package/dist/utils/dateTypes.d.ts.map +1 -1
- package/dist/utils/dateTypes.js +41 -1
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/inputAria.d.ts +29 -0
- package/dist/utils/inputAria.d.ts.map +1 -0
- package/dist/utils/inputAria.js +30 -0
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +5 -2
- package/docs.mjs +2 -2
- package/package.json +12 -8
- package/src/Avatar/Avatar.test.tsx +37 -0
- package/src/Avatar/Avatar.tsx +10 -5
- package/src/Breadcrumbs/BreadcrumbItem.tsx +25 -7
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +31 -10
- package/src/Button/Button.tsx +3 -16
- package/src/ButtonGroup/ButtonGroup.test.tsx +9 -9
- package/src/ButtonGroup/ButtonGroup.tsx +0 -1
- package/src/Calendar/Calendar.doc.mjs +4 -4
- package/src/Calendar/Calendar.test.tsx +168 -30
- package/src/Calendar/Calendar.tsx +121 -66
- package/src/Calendar/hooks/index.ts +0 -6
- package/src/Calendar/index.ts +1 -3
- package/src/Calendar/styles.ts +4 -9
- package/src/Carousel/Carousel.doc.mjs +7 -1
- package/src/Carousel/Carousel.test.tsx +20 -0
- package/src/Carousel/Carousel.tsx +16 -1
- package/src/Center/Center.doc.mjs +12 -2
- package/src/Center/Center.tsx +28 -3
- package/src/Chat/ChatComposerInput.test.tsx +26 -7
- package/src/Chat/ChatComposerInput.tsx +0 -1
- package/src/Chat/ChatDictationButton.doc.mjs +1 -1
- package/src/Chat/ChatMessageList.doc.mjs +8 -0
- package/src/Chat/ChatMessageList.test.tsx +18 -0
- package/src/Chat/ChatMessageList.tsx +16 -0
- package/src/Chat/useTriggerMenu.tsx +22 -4
- package/src/CheckboxInput/CheckboxInput.doc.mjs +10 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +172 -27
- package/src/CheckboxInput/CheckboxInput.tsx +78 -6
- package/src/CheckboxList/CheckboxList.doc.mjs +9 -0
- package/src/CheckboxList/CheckboxList.test.tsx +192 -26
- package/src/CheckboxList/CheckboxList.tsx +56 -3
- package/src/CheckboxList/CheckboxListContext.tsx +7 -0
- package/src/CheckboxList/CheckboxListItem.tsx +0 -3
- package/src/Citation/Citation.doc.mjs +10 -0
- package/src/Citation/Citation.test.tsx +121 -0
- package/src/Citation/Citation.tsx +15 -3
- package/src/CodeBlock/CodeBlock.test.tsx +115 -0
- package/src/CodeBlock/CodeBlock.tsx +63 -33
- package/src/CommandPalette/CommandPalette.test.tsx +47 -1
- package/src/CommandPalette/CommandPalette.tsx +9 -21
- package/src/ContextMenu/ContextMenu.doc.mjs +4 -4
- package/src/ContextMenu/ContextMenu.test.tsx +155 -1
- package/src/ContextMenu/ContextMenu.tsx +113 -16
- package/src/DateInput/DateInput.doc.mjs +286 -56
- package/src/DateInput/DateInput.test.tsx +248 -2
- package/src/DateInput/DateInput.tsx +196 -100
- package/src/DateRangeInput/DateRangeInput.doc.mjs +251 -46
- package/src/DateRangeInput/DateRangeInput.test.tsx +182 -20
- package/src/DateRangeInput/DateRangeInput.tsx +63 -5
- package/src/DateTimeInput/DateTimeInput.doc.mjs +368 -67
- package/src/DateTimeInput/DateTimeInput.test.tsx +279 -11
- package/src/DateTimeInput/DateTimeInput.tsx +125 -17
- package/src/Dialog/Dialog.doc.mjs +2 -2
- package/src/Dialog/Dialog.tsx +12 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -8
- package/src/DropdownMenu/DropdownMenu.test.tsx +56 -42
- package/src/DropdownMenu/DropdownMenu.tsx +52 -18
- package/src/Field/Field.doc.mjs +59 -18
- package/src/Field/Field.test.tsx +32 -0
- package/src/Field/Field.tsx +23 -5
- package/src/Field/FieldLabel.tsx +55 -17
- package/src/FileInput/FileInput.doc.mjs +17 -0
- package/src/FileInput/FileInput.test.tsx +283 -49
- package/src/FileInput/FileInput.tsx +76 -4
- package/src/Grid/Grid.doc.mjs +17 -4
- package/src/Grid/Grid.test.tsx +43 -30
- package/src/Grid/Grid.tsx +38 -3
- package/src/Icon/Icon.doc.mjs +3 -3
- package/src/InputGroup/InputGroup.doc.mjs +111 -23
- package/src/InputGroup/InputGroup.test.tsx +257 -60
- package/src/InputGroup/InputGroup.tsx +23 -5
- package/src/InputGroup/InputGroupContext.ts +9 -4
- package/src/InputGroup/groupStyles.ts +7 -1
- package/src/InputGroup/index.ts +1 -0
- package/src/Kbd/Kbd.test.tsx +22 -4
- package/src/Kbd/Kbd.tsx +35 -3
- package/src/Layer/layerAnimations.stylex.ts +20 -4
- package/src/Layer/useLayer.doc.mjs +5 -0
- package/src/Layer/useLayer.test.tsx +111 -0
- package/src/Layer/useLayer.tsx +90 -9
- package/src/Layout/Layout.tsx +8 -16
- package/src/Layout/LayoutFooter.doc.mjs +4 -4
- package/src/Layout/LayoutFooter.tsx +3 -3
- package/src/Layout/LayoutHeader.doc.mjs +4 -4
- package/src/Layout/LayoutHeader.tsx +3 -3
- package/src/Layout/LayoutPanel.tsx +3 -3
- package/src/Layout/padding.stylex.ts +52 -0
- package/src/Lightbox/Lightbox.doc.mjs +9 -0
- package/src/Lightbox/Lightbox.test.tsx +53 -5
- package/src/Lightbox/Lightbox.tsx +9 -4
- package/src/Link/Link.doc.mjs +14 -0
- package/src/Link/Link.test.tsx +50 -0
- package/src/Link/Link.tsx +39 -4
- package/src/Markdown/Markdown.test.tsx +11 -0
- package/src/Markdown/Markdown.tsx +7 -0
- package/src/MetadataList/MetadataListItem.doc.mjs +4 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -17
- package/src/MoreMenu/MoreMenu.tsx +0 -9
- package/src/MultiSelector/MultiSelector.doc.mjs +30 -0
- package/src/MultiSelector/MultiSelector.test.tsx +375 -8
- package/src/MultiSelector/MultiSelector.tsx +194 -48
- package/src/MultiSelector/hooks.ts +27 -0
- package/src/NavMenu/NavHeadingMenu.test.tsx +77 -1
- package/src/NavMenu/NavHeadingMenu.tsx +50 -3
- package/src/NumberInput/NumberInput.doc.mjs +17 -0
- package/src/NumberInput/NumberInput.test.tsx +242 -40
- package/src/NumberInput/NumberInput.tsx +89 -11
- package/src/Pagination/Pagination.doc.mjs +3 -3
- package/src/Pagination/Pagination.test.tsx +117 -5
- package/src/Pagination/Pagination.tsx +21 -1
- package/src/Popover/Popover.doc.mjs +26 -0
- package/src/Popover/Popover.test.tsx +121 -0
- package/src/Popover/Popover.tsx +23 -2
- package/src/Popover/usePopover.doc.mjs +9 -3
- package/src/Popover/usePopover.tsx +70 -12
- package/src/PowerSearch/PowerSearch.doc.mjs +15 -0
- package/src/PowerSearch/PowerSearch.test.tsx +97 -1
- package/src/PowerSearch/PowerSearch.tsx +16 -3
- package/src/ProgressBar/ProgressBar.test.tsx +34 -26
- package/src/ProgressBar/ProgressBar.tsx +3 -4
- package/src/RadioList/RadioList.doc.mjs +9 -0
- package/src/RadioList/RadioList.test.tsx +252 -16
- package/src/RadioList/RadioList.tsx +166 -10
- package/src/RadioList/RadioListItem.tsx +14 -2
- package/src/SegmentedControl/SegmentedControl.doc.mjs +9 -0
- package/src/SegmentedControl/SegmentedControl.test.tsx +214 -42
- package/src/SegmentedControl/SegmentedControl.tsx +102 -54
- package/src/SegmentedControl/SegmentedControlContext.ts +7 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +14 -1
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.doc.mjs +26 -0
- package/src/Selector/Selector.test.tsx +387 -15
- package/src/Selector/Selector.tsx +175 -67
- package/src/Selector/hooks.ts +23 -0
- package/src/SideNav/SideNav.test.tsx +48 -0
- package/src/SideNav/SideNavHeading.tsx +8 -2
- package/src/SideNav/SideNavItem.tsx +2 -4
- package/src/Skeleton/Skeleton.test.tsx +25 -0
- package/src/Skeleton/Skeleton.tsx +11 -1
- package/src/Slider/Slider.doc.mjs +15 -0
- package/src/Slider/Slider.test.tsx +155 -2
- package/src/Slider/Slider.tsx +53 -5
- package/src/Spinner/Spinner.tsx +7 -1
- package/src/Stack/Stack.doc.mjs +77 -0
- package/src/Stack/Stack.test.tsx +55 -5
- package/src/Stack/Stack.tsx +73 -24
- package/src/Stack/StackItem.test.tsx +23 -0
- package/src/Stack/StackItem.tsx +20 -23
- package/src/Switch/Switch.doc.mjs +15 -0
- package/src/Switch/Switch.test.tsx +162 -27
- package/src/Switch/Switch.tsx +61 -21
- package/src/TabList/Tab.tsx +6 -0
- package/src/TabList/TabList.doc.mjs +6 -0
- package/src/TabList/TabList.test.tsx +251 -0
- package/src/TabList/TabList.tsx +103 -12
- package/src/TabList/TabListContext.ts +7 -3
- package/src/TabList/TabMenu.tsx +6 -3
- package/src/Table/BaseTable.tsx +21 -17
- package/src/Table/Table.doc.mjs +2 -0
- package/src/Table/Table.test.tsx +10 -0
- package/src/Table/Table.tsx +8 -0
- package/src/Table/TableCell.tsx +25 -23
- package/src/Table/TableHeaderCell.tsx +28 -29
- package/src/Table/index.ts +3 -2
- package/src/Table/plugins/pagination/paginateData.ts +10 -3
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +16 -0
- package/src/Table/plugins/pagination/useTablePagination.tsx +8 -1
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +91 -2
- package/src/Table/plugins/sortable/useTableSortable.tsx +53 -1
- package/src/Table/tableContextMenu.test.tsx +157 -0
- package/src/Table/tableContextMenu.tsx +142 -0
- package/src/Table/types.ts +74 -0
- package/src/Table/useTableColumnResize.doc.mjs +3 -3
- package/src/Table/useTableStickyColumns.doc.mjs +2 -2
- package/src/Text/Text.doc.mjs +18 -18
- package/src/TextArea/TextArea.doc.mjs +17 -0
- package/src/TextArea/TextArea.test.tsx +167 -35
- package/src/TextArea/TextArea.tsx +62 -15
- package/src/TextInput/TextInput.doc.mjs +17 -0
- package/src/TextInput/TextInput.test.tsx +168 -34
- package/src/TextInput/TextInput.tsx +77 -9
- package/src/Thumbnail/Thumbnail.doc.mjs +4 -4
- package/src/TimeInput/TimeInput.doc.mjs +340 -60
- package/src/TimeInput/TimeInput.test.tsx +255 -7
- package/src/TimeInput/TimeInput.tsx +176 -70
- package/src/Timestamp/Timestamp.doc.mjs +19 -19
- package/src/Toast/Toast.tsx +14 -0
- package/src/Toast/ToastViewport.test.tsx +214 -0
- package/src/Toast/ToastViewport.tsx +167 -21
- package/src/Tokenizer/Tokenizer.doc.mjs +29 -14
- package/src/Tokenizer/Tokenizer.test.tsx +105 -1
- package/src/Tokenizer/Tokenizer.tsx +37 -1
- package/src/Toolbar/Toolbar.test.tsx +109 -6
- package/src/Toolbar/Toolbar.tsx +59 -5
- package/src/Tooltip/Tooltip.test.tsx +68 -0
- package/src/Tooltip/useTooltip.tsx +55 -8
- package/src/TopNav/TopNav.test.tsx +50 -0
- package/src/TopNav/TopNavHeading.tsx +17 -1
- package/src/TreeList/TreeList.test.tsx +295 -6
- package/src/TreeList/TreeList.tsx +73 -1
- package/src/TreeList/TreeListItem.tsx +51 -5
- package/src/TreeList/treeListItem.markers.stylex.ts +20 -0
- package/src/Typeahead/BaseTypeahead.tsx +93 -9
- package/src/Typeahead/Typeahead.doc.mjs +141 -30
- package/src/Typeahead/Typeahead.test.tsx +331 -1
- package/src/Typeahead/Typeahead.tsx +105 -33
- package/src/VisuallyHidden/VisuallyHidden.doc.mjs +80 -0
- package/src/VisuallyHidden/VisuallyHidden.test.tsx +76 -0
- package/src/VisuallyHidden/VisuallyHidden.tsx +113 -0
- package/src/VisuallyHidden/index.ts +15 -0
- package/src/docs-script.test.mjs +50 -0
- package/src/hooks/focusableSelector.ts +25 -0
- package/src/hooks/index.ts +28 -2
- package/src/hooks/useAnnounce.test.tsx +101 -0
- package/src/hooks/useAnnounce.ts +168 -0
- package/src/hooks/useClickableContainer.ts +16 -4
- package/src/hooks/useEntryAnimation.ts +16 -4
- package/src/hooks/useFocusTrap.test.tsx +132 -0
- package/src/hooks/useFocusTrap.ts +98 -4
- package/src/hooks/useGridFocus.doc.mjs +40 -2
- package/src/hooks/useGridFocus.test.tsx +132 -0
- package/src/hooks/useGridFocus.ts +343 -67
- package/src/hooks/useKeyboardHint.doc.mjs +101 -0
- package/src/hooks/useKeyboardHint.test.tsx +70 -0
- package/src/hooks/useKeyboardHint.tsx +332 -0
- package/src/hooks/useListFocus.doc.mjs +50 -10
- package/src/hooks/useListFocus.test.tsx +375 -0
- package/src/hooks/useListFocus.ts +395 -57
- package/src/hooks/useLongPress.test.tsx +134 -0
- package/src/hooks/useLongPress.ts +119 -0
- package/src/hooks/useTreeFocus.doc.mjs +140 -0
- package/src/hooks/useTreeFocus.test.tsx +214 -0
- package/src/hooks/useTreeFocus.ts +559 -0
- package/src/hooks/useTypeahead.test.tsx +109 -0
- package/src/hooks/useTypeahead.ts +183 -0
- package/src/index.ts +1 -0
- package/src/theme/derivedVarRegistry.test.ts +10 -5
- package/src/utils/dateTypes.test.ts +40 -0
- package/src/utils/dateTypes.ts +40 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/inputAria.test.ts +39 -0
- package/src/utils/inputAria.ts +58 -0
- package/src/utils/timeParser.test.ts +10 -0
- package/src/utils/timeParser.ts +5 -2
- package/dist/Calendar/hooks/useCalendarRovingTabindex.d.ts +0 -57
- package/dist/Calendar/hooks/useCalendarRovingTabindex.d.ts.map +0 -1
- package/dist/Calendar/hooks/useCalendarRovingTabindex.js +0 -96
- package/src/Calendar/hooks/useCalendarRovingTabindex.ts +0 -118
|
@@ -20,9 +20,28 @@ export interface FieldLabelProps extends BaseProps<HTMLLabelElement> {
|
|
|
20
20
|
*/
|
|
21
21
|
label: string;
|
|
22
22
|
/**
|
|
23
|
-
* ID of the input element this label
|
|
23
|
+
* ID of the input element this label points AT (rendered as `htmlFor` on the
|
|
24
|
+
* label). This is *not* the id of the label element itself — see
|
|
25
|
+
* `labelID` for that.
|
|
24
26
|
*/
|
|
25
27
|
inputID: string;
|
|
28
|
+
/**
|
|
29
|
+
* The `id` applied TO the label element itself (not the element it points
|
|
30
|
+
* at — that's `inputID`). A grouping control (e.g. `role="radiogroup"`) can
|
|
31
|
+
* reference this via `aria-labelledby` to take the label as its accessible
|
|
32
|
+
* name.
|
|
33
|
+
*/
|
|
34
|
+
labelID?: string;
|
|
35
|
+
/**
|
|
36
|
+
* When true, the field wraps a *group* of controls (e.g. a radiogroup)
|
|
37
|
+
* rather than a single input. In that case the label is rendered as a
|
|
38
|
+
* `<span>` instead of a `<label>` — a `<label>` semantically names one form
|
|
39
|
+
* control and can't be associated with a group, so it must not be a literal
|
|
40
|
+
* label element. The group takes the label as its name via
|
|
41
|
+
* `labelID` + `aria-labelledby`.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
isGroupLabel?: boolean;
|
|
26
45
|
/**
|
|
27
46
|
* Whether to visually hide the label and description (still accessible
|
|
28
47
|
* to screen readers). When hidden, the entire label group is rendered
|
|
@@ -76,7 +95,7 @@ export interface FieldLabelProps extends BaseProps<HTMLLabelElement> {
|
|
|
76
95
|
* <FieldLabel label="Search" inputID={inputId} isLabelHidden />
|
|
77
96
|
* ```
|
|
78
97
|
*/
|
|
79
|
-
export declare function FieldLabel({ label, inputID, isLabelHidden, isDisabled, isOptional, isRequired, labelIcon, labelTooltip, description, descriptionID, ref, }: FieldLabelProps): import("react").JSX.Element;
|
|
98
|
+
export declare function FieldLabel({ label, inputID, labelID, isGroupLabel, isLabelHidden, isDisabled, isOptional, isRequired, labelIcon, labelTooltip, description, descriptionID, ref, }: FieldLabelProps): import("react").JSX.Element;
|
|
80
99
|
export declare namespace FieldLabel {
|
|
81
100
|
var displayName: string;
|
|
82
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../src/Field/FieldLabel.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../src/Field/FieldLabel.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAkD5D,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAoB,EACpB,aAAqB,EACrB,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,GAAG,GACJ,EAAE,eAAe,+BAsDjB;yBApEe,UAAU"}
|
package/dist/Field/FieldLabel.js
CHANGED
|
@@ -36,6 +36,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
36
36
|
export function FieldLabel({
|
|
37
37
|
label,
|
|
38
38
|
inputID,
|
|
39
|
+
labelID,
|
|
40
|
+
isGroupLabel = false,
|
|
39
41
|
isLabelHidden = false,
|
|
40
42
|
isDisabled = false,
|
|
41
43
|
isOptional = false,
|
|
@@ -47,44 +49,57 @@ export function FieldLabel({
|
|
|
47
49
|
ref
|
|
48
50
|
}) {
|
|
49
51
|
const statusText = isOptional ? 'Optional' : isRequired ? 'Required' : null;
|
|
52
|
+
|
|
53
|
+
// A group label (e.g. for a radiogroup) must not be a literal `<label>`
|
|
54
|
+
// element: a `<label>` semantically names a single form control and can't be
|
|
55
|
+
// associated with a group. Render it as a `<span>` instead, keeping all the
|
|
56
|
+
// label styling and slots. The group references it via `aria-labelledby`.
|
|
57
|
+
const LabelElement = isGroupLabel ? 'span' : 'label';
|
|
58
|
+
const labelContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
59
|
+
children: [labelIcon && renderIconSlot(labelIcon, {
|
|
60
|
+
size: 'sm',
|
|
61
|
+
color: 'inherit'
|
|
62
|
+
}), label, statusText && /*#__PURE__*/_jsxs("span", {
|
|
63
|
+
...{
|
|
64
|
+
className: "x1sodnla x141an7d x1ltkj2j xv1l7n4"
|
|
65
|
+
},
|
|
66
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
children: " \u2219 "
|
|
69
|
+
}), statusText]
|
|
70
|
+
}), labelTooltip && /*#__PURE__*/_jsx(Tooltip, {
|
|
71
|
+
content: labelTooltip,
|
|
72
|
+
placement: "above",
|
|
73
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
74
|
+
icon: "info",
|
|
75
|
+
size: "sm",
|
|
76
|
+
color: "inherit"
|
|
77
|
+
})
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
50
80
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
51
|
-
children: [/*#__PURE__*/
|
|
81
|
+
children: [/*#__PURE__*/_jsx(LabelElement, {
|
|
52
82
|
ref: ref,
|
|
53
|
-
|
|
83
|
+
id: labelID
|
|
84
|
+
// `htmlFor` only applies to a real `<label>` associating with a single
|
|
85
|
+
// control; a group label (span) has no `htmlFor`.
|
|
86
|
+
,
|
|
87
|
+
htmlFor: isGroupLabel ? undefined : inputID,
|
|
54
88
|
...mergeProps(themeProps('field-label'), {
|
|
55
89
|
0: {
|
|
56
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1e4wzip xv1l7n4 x1ypdohk"
|
|
90
|
+
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xv1l7n4 x1ypdohk"
|
|
57
91
|
},
|
|
58
92
|
2: {
|
|
59
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1e4wzip xnbbluu x1h6gzvc"
|
|
93
|
+
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xnbbluu x1h6gzvc"
|
|
60
94
|
},
|
|
61
95
|
1: {
|
|
62
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1e4wzip xv1l7n4 x1ypdohk xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
96
|
+
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xv1l7n4 x1ypdohk xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
63
97
|
},
|
|
64
98
|
3: {
|
|
65
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1e4wzip xnbbluu x1h6gzvc xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
99
|
+
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xnbbluu x1h6gzvc xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
66
100
|
}
|
|
67
101
|
}[!!isDisabled << 1 | !!isLabelHidden << 0]),
|
|
68
|
-
children:
|
|
69
|
-
size: 'sm',
|
|
70
|
-
color: 'inherit'
|
|
71
|
-
}), label, statusText && /*#__PURE__*/_jsxs("span", {
|
|
72
|
-
...{
|
|
73
|
-
className: "x1sodnla x141an7d xv1l7n4"
|
|
74
|
-
},
|
|
75
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
76
|
-
"aria-hidden": "true",
|
|
77
|
-
children: " \u2219 "
|
|
78
|
-
}), statusText]
|
|
79
|
-
}), labelTooltip && /*#__PURE__*/_jsx(Tooltip, {
|
|
80
|
-
content: labelTooltip,
|
|
81
|
-
placement: "above",
|
|
82
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
83
|
-
icon: "info",
|
|
84
|
-
size: "sm",
|
|
85
|
-
color: "inherit"
|
|
86
|
-
})
|
|
87
|
-
})]
|
|
102
|
+
children: labelContent
|
|
88
103
|
}), description && /*#__PURE__*/_jsx("span", {
|
|
89
104
|
id: descriptionID,
|
|
90
105
|
...{
|
|
@@ -51,6 +51,27 @@ export interface FileInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
51
51
|
* @default false
|
|
52
52
|
*/
|
|
53
53
|
isDisabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Explains why the input is disabled. When set together with `isDisabled`,
|
|
56
|
+
* the file input shows a tooltip with this text on hover and keyboard focus,
|
|
57
|
+
* and its trigger stays focusable (via `aria-disabled`) so the reason is
|
|
58
|
+
* discoverable by keyboard and assistive technology. Opening the file picker
|
|
59
|
+
* stays blocked.
|
|
60
|
+
*
|
|
61
|
+
* Use this instead of wrapping a disabled input in `Tooltip` — disabled
|
|
62
|
+
* controls don't emit the pointer events an external tooltip needs.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```
|
|
66
|
+
* <FileInput
|
|
67
|
+
* label="Resume"
|
|
68
|
+
* value={file}
|
|
69
|
+
* isDisabled
|
|
70
|
+
* disabledMessage="Uploads are locked until your profile is verified"
|
|
71
|
+
* />
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
disabledMessage?: string;
|
|
54
75
|
/**
|
|
55
76
|
* Whether the input is required.
|
|
56
77
|
* @default false
|
|
@@ -105,7 +126,7 @@ export interface FileInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
105
126
|
* <FileInput label="Resume" value={file} onChange={setFile} accept=".pdf" />
|
|
106
127
|
* ```
|
|
107
128
|
*/
|
|
108
|
-
export declare function FileInput({ label, isLabelHidden, value, onChange, changeAction, accept, isMultiple, maxSize, maxFiles, isDisabled, isRequired, isLoading, status: statusProp, description, placeholder, mode, isOptional, labelTooltip, width, xstyle, className, style, ref, ...rest }: FileInputProps): import("react").JSX.Element;
|
|
129
|
+
export declare function FileInput({ label, isLabelHidden, value, onChange, changeAction, accept, isMultiple, maxSize, maxFiles, isDisabled, disabledMessage, isRequired, isLoading, status: statusProp, description, placeholder, mode, isOptional, labelTooltip, width, xstyle, className, style, ref, ...rest }: FileInputProps): import("react").JSX.Element;
|
|
109
130
|
export declare namespace FileInput {
|
|
110
131
|
var displayName: string;
|
|
111
132
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,UAAU,CAAC;AAMlB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAyN9C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,UAAU,GAAG,cAAc,GAAG,OAAO,CACtC;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BA4WhB;yBAtYe,SAAS"}
|
|
@@ -22,6 +22,8 @@ import { colorVars, sizeVars, spacingVars, radiusVars, typographyVars, typeScale
|
|
|
22
22
|
import { Field, InputClearButton } from "../Field/index.js";
|
|
23
23
|
import { Icon } from "../Icon/index.js";
|
|
24
24
|
import { Spinner } from "../Spinner/index.js";
|
|
25
|
+
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
26
|
+
import { useTooltip } from "../Tooltip/index.js";
|
|
25
27
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
26
28
|
import { themeProps } from "../utils/themeProps.js";
|
|
27
29
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -175,6 +177,7 @@ export function FileInput({
|
|
|
175
177
|
maxSize,
|
|
176
178
|
maxFiles,
|
|
177
179
|
isDisabled = false,
|
|
180
|
+
disabledMessage,
|
|
178
181
|
isRequired = false,
|
|
179
182
|
isLoading = false,
|
|
180
183
|
status: statusProp,
|
|
@@ -198,6 +201,23 @@ export function FileInput({
|
|
|
198
201
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
199
202
|
const [validationError, setValidationError] = useState(null);
|
|
200
203
|
const [, startTransition] = useTransition();
|
|
204
|
+
|
|
205
|
+
// Announce successful file selection to screen readers via a persistent
|
|
206
|
+
// live region (forms-17). The component's own role="status" region only
|
|
207
|
+
// carries validation errors, so a successful attach was previously silent.
|
|
208
|
+
const announce = useAnnounce();
|
|
209
|
+
|
|
210
|
+
// Disabled-reason tooltip. Disabled controls swallow pointer events, so the
|
|
211
|
+
// tooltip listeners attach to the role="button" trigger (which already
|
|
212
|
+
// exists) and the trigger stays perceivable via aria-disabled instead of the
|
|
213
|
+
// native disabled attribute. Opening the picker is blocked by the isDisabled
|
|
214
|
+
// guards in handleClick / handleKeyDown / handleFiles.
|
|
215
|
+
const showsDisabledMessage = isDisabled && !!disabledMessage;
|
|
216
|
+
const disabledMessageTooltip = useTooltip({
|
|
217
|
+
placement: 'above',
|
|
218
|
+
focusTrigger: 'always',
|
|
219
|
+
isEnabled: showsDisabledMessage
|
|
220
|
+
});
|
|
201
221
|
const status = statusProp ?? (validationError ? {
|
|
202
222
|
type: 'error',
|
|
203
223
|
message: validationError
|
|
@@ -212,7 +232,7 @@ export function FileInput({
|
|
|
212
232
|
error: 'error',
|
|
213
233
|
success: 'success'
|
|
214
234
|
};
|
|
215
|
-
const ariaDescribedBy = [description ? descriptionID : null, status?.message ? statusMessageID : null].filter(Boolean).join(' ') || undefined;
|
|
235
|
+
const ariaDescribedBy = [description ? descriptionID : null, status?.message ? statusMessageID : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined;
|
|
216
236
|
const defaultPlaceholder = isMultiple ? 'Choose files' : 'Choose file';
|
|
217
237
|
const displayPlaceholder = placeholder ?? defaultPlaceholder;
|
|
218
238
|
const handleFiles = useCallback(fileList => {
|
|
@@ -234,12 +254,19 @@ export function FileInput({
|
|
|
234
254
|
}
|
|
235
255
|
const result = isMultiple ? valid : valid[0];
|
|
236
256
|
onChange(result);
|
|
257
|
+
|
|
258
|
+
// Announce the successful selection politely. Validation errors are
|
|
259
|
+
// handled by the role="status" region below, so only announce the
|
|
260
|
+
// attach here (do not double-announce errors).
|
|
261
|
+
if (errors.length === 0) {
|
|
262
|
+
announce(valid.length === 1 ? `1 file selected: ${valid[0].name}` : `${valid.length} files selected`);
|
|
263
|
+
}
|
|
237
264
|
if (changeAction) {
|
|
238
265
|
startTransition(async () => {
|
|
239
266
|
await changeAction(result);
|
|
240
267
|
});
|
|
241
268
|
}
|
|
242
|
-
}, [accept, isDisabled, isMultiple, maxFiles, maxSize, onChange, changeAction, startTransition]);
|
|
269
|
+
}, [accept, isDisabled, isMultiple, maxFiles, maxSize, onChange, changeAction, startTransition, announce]);
|
|
243
270
|
const handleInputChange = useCallback(e => {
|
|
244
271
|
const fileList = Array.from(e.target.files ?? []);
|
|
245
272
|
handleFiles(fileList);
|
|
@@ -392,12 +419,30 @@ export function FileInput({
|
|
|
392
419
|
labelTooltip: labelTooltip,
|
|
393
420
|
width: width,
|
|
394
421
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
395
|
-
|
|
396
|
-
|
|
422
|
+
ref: el => {
|
|
423
|
+
// Anchor + hover/focus listeners for the disabled-message tooltip.
|
|
424
|
+
// Handlers are gated internally by isEnabled, and anchor names
|
|
425
|
+
// compose, so attaching unconditionally is safe.
|
|
426
|
+
disabledMessageTooltip.ref(el);
|
|
427
|
+
},
|
|
428
|
+
role: "button"
|
|
429
|
+
// With a disabledMessage the trigger keeps focusability via
|
|
430
|
+
// aria-disabled so the reason is focus-discoverable; opening the picker
|
|
431
|
+
// is still blocked by the isDisabled guards in the handlers.
|
|
432
|
+
,
|
|
433
|
+
tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
|
|
434
|
+
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
397
435
|
onClick: handleClick,
|
|
398
436
|
onKeyDown: handleKeyDown,
|
|
399
437
|
"aria-label": label,
|
|
400
|
-
"aria-busy": isLoading || undefined
|
|
438
|
+
"aria-busy": isLoading || undefined
|
|
439
|
+
// These describe the operable control, so they belong on the focusable
|
|
440
|
+
// role="button" wrapper — not the hidden tabIndex={-1} file input the
|
|
441
|
+
// user never focuses (forms-6).
|
|
442
|
+
,
|
|
443
|
+
"aria-describedby": ariaDescribedBy,
|
|
444
|
+
"aria-required": isRequired ? 'true' : undefined,
|
|
445
|
+
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
401
446
|
...dragDropProps,
|
|
402
447
|
...mergeProps(themeProps('file-input', {
|
|
403
448
|
mode,
|
|
@@ -411,10 +456,11 @@ export function FileInput({
|
|
|
411
456
|
accept: accept,
|
|
412
457
|
multiple: isMultiple,
|
|
413
458
|
disabled: isDisabled,
|
|
414
|
-
onChange: handleInputChange
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
459
|
+
onChange: handleInputChange
|
|
460
|
+
// The visually-hidden native input is never focused (tabIndex={-1});
|
|
461
|
+
// its describedby/required/invalid live on the role="button" wrapper.
|
|
462
|
+
,
|
|
463
|
+
"aria-hidden": "true",
|
|
418
464
|
tabIndex: -1,
|
|
419
465
|
...{
|
|
420
466
|
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km"
|
|
@@ -431,7 +477,7 @@ export function FileInput({
|
|
|
431
477
|
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km"
|
|
432
478
|
},
|
|
433
479
|
children: validationError
|
|
434
|
-
})]
|
|
480
|
+
}), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
435
481
|
});
|
|
436
482
|
}
|
|
437
483
|
FileInput.displayName = 'FileInput';
|
package/dist/Grid/Grid.d.ts
CHANGED
|
@@ -64,6 +64,16 @@ export interface GridProps extends BaseProps<HTMLDivElement> {
|
|
|
64
64
|
* Numbers are treated as pixels, strings are used as-is (e.g., '100%').
|
|
65
65
|
*/
|
|
66
66
|
height?: SizeValue;
|
|
67
|
+
/**
|
|
68
|
+
* Maximum width of the grid container.
|
|
69
|
+
* Numbers are treated as pixels, strings are used as-is (e.g., '100%').
|
|
70
|
+
*/
|
|
71
|
+
maxWidth?: SizeValue;
|
|
72
|
+
/**
|
|
73
|
+
* Minimum height of the grid container.
|
|
74
|
+
* Numbers are treated as pixels, strings are used as-is (e.g., '100%').
|
|
75
|
+
*/
|
|
76
|
+
minHeight?: SizeValue;
|
|
67
77
|
/**
|
|
68
78
|
* Spacing between all grid items (both row and column).
|
|
69
79
|
* Accepts numeric spacing steps: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.
|
|
@@ -126,7 +136,7 @@ export interface GridProps extends BaseProps<HTMLDivElement> {
|
|
|
126
136
|
* </Grid>
|
|
127
137
|
* ```
|
|
128
138
|
*/
|
|
129
|
-
export declare function Grid({ columns, minChildWidth, rowHeight, width, height, gap, rowGap, columnGap, align, justify, xstyle, className, style, children, ref, ...props }: GridProps): import("react").JSX.Element;
|
|
139
|
+
export declare function Grid({ columns, minChildWidth, rowHeight, width, height, maxWidth, minHeight, gap, rowGap, columnGap, align, justify, xstyle, className, style, children, ref, ...props }: GridProps): import("react").JSX.Element;
|
|
130
140
|
export declare namespace Grid {
|
|
131
141
|
var displayName: string;
|
|
132
142
|
}
|
package/dist/Grid/Grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/Grid/Grid.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C;;GAEG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACzB,CAAC;AAEN,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/Grid/Grid.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C;;GAEG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CACzB,CAAC;AAEN,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,GAAG,CAAC,EAAE,WAAW,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAExB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA2MD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,EACnB,OAAO,EACP,aAAiB,EACjB,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BA2FX;yBA9Ge,IAAI"}
|
package/dist/Grid/Grid.js
CHANGED
|
@@ -43,6 +43,26 @@ const baseStyles = {
|
|
|
43
43
|
$$css: true
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
+
|
|
47
|
+
// Dynamic track values compile to CSS variables + a class-level declaration
|
|
48
|
+
// (grid-template-columns: var(--x)) instead of a raw inline style, so
|
|
49
|
+
// consumer `xstyle` overrides — including ones inside @media queries — can
|
|
50
|
+
// still win. A raw inline `grid-template-columns` would beat any class.
|
|
51
|
+
const _temp = {
|
|
52
|
+
kJBjZk: "xhij9v2",
|
|
53
|
+
"$$css": true
|
|
54
|
+
};
|
|
55
|
+
const dynamicStyles = {
|
|
56
|
+
templateColumns: value => [{
|
|
57
|
+
kumcoG: value != null ? "xqketvx" : value,
|
|
58
|
+
$$css: true
|
|
59
|
+
}, {
|
|
60
|
+
"--x-gridTemplateColumns": value != null ? value : undefined
|
|
61
|
+
}],
|
|
62
|
+
autoRows: value => [_temp, {
|
|
63
|
+
"--x-gridAutoRows": `${value}px` != null ? `${value}px` : undefined
|
|
64
|
+
}]
|
|
65
|
+
};
|
|
46
66
|
const alignStyles = {
|
|
47
67
|
start: {
|
|
48
68
|
kGNEyG: "x7a106z",
|
|
@@ -272,6 +292,8 @@ export function Grid({
|
|
|
272
292
|
rowHeight,
|
|
273
293
|
width,
|
|
274
294
|
height,
|
|
295
|
+
maxWidth,
|
|
296
|
+
minHeight,
|
|
275
297
|
gap,
|
|
276
298
|
rowGap,
|
|
277
299
|
columnGap,
|
|
@@ -311,17 +333,21 @@ export function Grid({
|
|
|
311
333
|
gridTemplateColumns = '1fr';
|
|
312
334
|
}
|
|
313
335
|
|
|
314
|
-
// Build inline style for dynamic values
|
|
336
|
+
// Build inline style for dynamic values. Track templates go through
|
|
337
|
+
// dynamicStyles (CSS-var indirection) so xstyle/@media overrides work;
|
|
338
|
+
// width/height stay inline as explicit caller-set dimensions.
|
|
315
339
|
const inlineStyle = {
|
|
316
|
-
gridTemplateColumns,
|
|
317
|
-
...(rowHeight != null && {
|
|
318
|
-
gridAutoRows: `${rowHeight}px`
|
|
319
|
-
}),
|
|
320
340
|
...(width != null && {
|
|
321
341
|
width: typeof width === 'number' ? `${width}px` : width
|
|
322
342
|
}),
|
|
323
343
|
...(height != null && {
|
|
324
344
|
height: typeof height === 'number' ? `${height}px` : height
|
|
345
|
+
}),
|
|
346
|
+
...(maxWidth != null && {
|
|
347
|
+
maxWidth: typeof maxWidth === 'number' ? `${maxWidth}px` : maxWidth
|
|
348
|
+
}),
|
|
349
|
+
...(minHeight != null && {
|
|
350
|
+
minHeight: typeof minHeight === 'number' ? `${minHeight}px` : minHeight
|
|
325
351
|
})
|
|
326
352
|
};
|
|
327
353
|
|
|
@@ -334,7 +360,7 @@ export function Grid({
|
|
|
334
360
|
gap,
|
|
335
361
|
align,
|
|
336
362
|
justify
|
|
337
|
-
}), stylex.props(baseStyles.grid, gap != null && gapStyles[gap], rowGap != null && rowGapStyles[rowGap], columnGap != null && columnGapStyles[columnGap], align != null && alignStyles[align], justify != null && justifyStyles[justify], xstyle), className, {
|
|
363
|
+
}), stylex.props(baseStyles.grid, dynamicStyles.templateColumns(gridTemplateColumns), rowHeight != null && dynamicStyles.autoRows(rowHeight), gap != null && gapStyles[gap], rowGap != null && rowGapStyles[rowGap], columnGap != null && columnGapStyles[columnGap], align != null && alignStyles[align], justify != null && justifyStyles[justify], xstyle), className, {
|
|
338
364
|
...style,
|
|
339
365
|
...inlineStyle
|
|
340
366
|
}),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file InputGroup.tsx
|
|
3
|
-
* @input Uses React, StyleX, theme tokens, InputGroupContext
|
|
4
|
-
* @output Exports InputGroup component
|
|
3
|
+
* @input Uses React, StyleX, theme tokens, InputGroupContext, Field
|
|
4
|
+
* @output Exports InputGroup component with group label/description ARIA wiring
|
|
5
5
|
* @position Groups input with prefix/suffix addons; consumed by index.ts
|
|
6
6
|
*
|
|
7
|
-
* Children (TextInput, NumberInput
|
|
7
|
+
* Children (TextInput, NumberInput, TimeInput, DateInput, Typeahead,
|
|
8
|
+
* Selector, MultiSelector) consume the InputGroup context
|
|
8
9
|
* to remove their own border/radius so the group container provides
|
|
9
10
|
* the unified border treatment.
|
|
10
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../src/InputGroup/InputGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAQ,KAAK,WAAW,EAAC,MAAM,UAAU,CAAC;AAGjD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AA0BhD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAC3C,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,mDAAmD;IACnD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,eAAe,+BAwEjB;yBAzFe,UAAU"}
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InputGroup.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens, InputGroupContext
|
|
8
|
-
* @output Exports InputGroup component
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, InputGroupContext, Field
|
|
8
|
+
* @output Exports InputGroup component with group label/description ARIA wiring
|
|
9
9
|
* @position Groups input with prefix/suffix addons; consumed by index.ts
|
|
10
10
|
*
|
|
11
|
-
* Children (TextInput, NumberInput
|
|
11
|
+
* Children (TextInput, NumberInput, TimeInput, DateInput, Typeahead,
|
|
12
|
+
* Selector, MultiSelector) consume the InputGroup context
|
|
12
13
|
* to remove their own border/radius so the group container provides
|
|
13
14
|
* the unified border treatment.
|
|
14
15
|
*
|
|
@@ -88,10 +89,15 @@ export function InputGroup({
|
|
|
88
89
|
}) {
|
|
89
90
|
const size = useSize(sizeProp, 'md');
|
|
90
91
|
const inputId = useId();
|
|
92
|
+
const labelID = useId();
|
|
93
|
+
const descriptionID = useId();
|
|
91
94
|
const statusMessageId = useId();
|
|
95
|
+
const describedByIDs = [description ? descriptionID : null, status?.message ? statusMessageId : null].filter(Boolean).join(' ') || undefined;
|
|
92
96
|
const contextValue = useMemo(() => ({
|
|
93
|
-
isInGroup: true
|
|
94
|
-
|
|
97
|
+
isInGroup: true,
|
|
98
|
+
labelID,
|
|
99
|
+
describedByIDs
|
|
100
|
+
}), [labelID, describedByIDs]);
|
|
95
101
|
return /*#__PURE__*/_jsx(InputGroupContext, {
|
|
96
102
|
value: contextValue,
|
|
97
103
|
children: /*#__PURE__*/_jsx(SizeProvider, {
|
|
@@ -101,6 +107,9 @@ export function InputGroup({
|
|
|
101
107
|
isLabelHidden: isLabelHidden,
|
|
102
108
|
description: description,
|
|
103
109
|
inputID: inputId,
|
|
110
|
+
labelID: labelID,
|
|
111
|
+
descriptionID: description ? descriptionID : undefined,
|
|
112
|
+
isGroupLabel: true,
|
|
104
113
|
isOptional: isOptional,
|
|
105
114
|
isRequired: isRequired,
|
|
106
115
|
isDisabled: isDisabled,
|
|
@@ -114,7 +123,8 @@ export function InputGroup({
|
|
|
114
123
|
children: /*#__PURE__*/_jsx("div", {
|
|
115
124
|
ref: ref,
|
|
116
125
|
role: "group",
|
|
117
|
-
"aria-
|
|
126
|
+
"aria-labelledby": labelID,
|
|
127
|
+
"aria-describedby": describedByIDs,
|
|
118
128
|
"data-testid": testId,
|
|
119
129
|
...rest,
|
|
120
130
|
...mergeProps(themeProps('input-group', {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export interface InputGroupContextValue {
|
|
2
2
|
isInGroup: true;
|
|
3
|
+
/** ID of the group label element, for aria-labelledby composition. */
|
|
4
|
+
labelID: string;
|
|
5
|
+
/** IDs of helper/status text owned by the group, for aria-describedby composition. */
|
|
6
|
+
describedByIDs?: string;
|
|
3
7
|
}
|
|
4
8
|
export declare const InputGroupContext: import("react").Context<InputGroupContextValue | null>;
|
|
5
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroupContext.d.ts","sourceRoot":"","sources":["../../src/InputGroup/InputGroupContext.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"InputGroupContext.d.ts","sourceRoot":"","sources":["../../src/InputGroup/InputGroupContext.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,IAAI,CAAC;IAChB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,wDAE7B,CAAC;AAGF;;;GAGG;AACH,wBAAgB,aAAa,IAAI,sBAAsB,GAAG,IAAI,CAE7D"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InputGroupContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input React createContext/use
|
|
8
8
|
* @output Exports InputGroup context and useInputGroup hook
|
|
9
|
-
* @position Shared context; consumed by input components for group-aware styling
|
|
9
|
+
* @position Shared context; consumed by input components for group-aware styling and ARIA associations
|
|
10
10
|
*/
|
|
11
11
|
import { createContext, use } from 'react';
|
|
12
12
|
export const InputGroupContext = /*#__PURE__*/createContext(null);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @file groupStyles.ts
|
|
3
3
|
* @input Uses StyleX, theme tokens
|
|
4
4
|
* @output Exports shared group-aware styles for input components
|
|
5
|
-
* @position Shared styles consumed by
|
|
5
|
+
* @position Shared styles consumed by InputGroup-compatible controls
|
|
6
6
|
*/
|
|
7
7
|
import * as stylex from '@stylexjs/stylex';
|
|
8
8
|
export declare const groupStyles: Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupStyles.d.ts","sourceRoot":"","sources":["../../src/InputGroup/groupStyles.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"groupStyles.d.ts","sourceRoot":"","sources":["../../src/InputGroup/groupStyles.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;EAmCtB,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @file groupStyles.ts
|
|
5
5
|
* @input Uses StyleX, theme tokens
|
|
6
6
|
* @output Exports shared group-aware styles for input components
|
|
7
|
-
* @position Shared styles consumed by
|
|
7
|
+
* @position Shared styles consumed by InputGroup-compatible controls
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import * as stylex from '@stylexjs/stylex';
|
|
@@ -18,8 +18,8 @@ export const groupStyles = {
|
|
|
18
18
|
keTefX: "xd10s4z x1pwwqoy",
|
|
19
19
|
krdFHd: "x15mokao x8eehn2",
|
|
20
20
|
kVL7Gh: "xbiv7yw x1xrp5p4",
|
|
21
|
-
kfmiAY: "x1ga7v0g x11xp8u1",
|
|
22
|
-
kT0f0o: "x16uus16 x747jw7",
|
|
21
|
+
kfmiAY: "x1ga7v0g x11xp8u1 xpufgd0 x1ir7nn6",
|
|
22
|
+
kT0f0o: "x16uus16 x747jw7 xxd14kb x1vej5at",
|
|
23
23
|
kXnDq0: "x1rm9qnc",
|
|
24
24
|
$$css: true
|
|
25
25
|
}
|
|
@@ -9,4 +9,5 @@ export type { InputGroupProps, InputGroupSize } from './InputGroup';
|
|
|
9
9
|
export { InputGroupText } from './InputGroupText';
|
|
10
10
|
export type { InputGroupTextProps } from './InputGroupText';
|
|
11
11
|
export { useInputGroup } from './InputGroupContext';
|
|
12
|
+
export type { InputGroupContextValue } from './InputGroupContext';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InputGroup/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InputGroup/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,YAAY,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAElE,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,YAAY,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC"}
|
package/dist/Kbd/Kbd.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/Kbd/Kbd.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Kbd.d.ts","sourceRoot":"","sources":["../../src/Kbd/Kbd.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4H5C,MAAM,WAAW,QAAS,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,EAAE,QAAQ,qBAgC3E;yBAhCe,GAAG"}
|
package/dist/Kbd/Kbd.js
CHANGED
|
@@ -66,6 +66,32 @@ function getKeyDisplay(key, isMac) {
|
|
|
66
66
|
}
|
|
67
67
|
return KEY_DISPLAY[key] ?? key.toUpperCase();
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Spoken-word labels for screen readers. The visual `KEY_DISPLAY` uses glyphs
|
|
72
|
+
* (⌘, ⇧, ↵, …) that assistive tech cannot announce meaningfully, so the
|
|
73
|
+
* accessible name for the shortcut is built from these words instead.
|
|
74
|
+
*/
|
|
75
|
+
const KEY_LABEL = {
|
|
76
|
+
ctrl: 'Control',
|
|
77
|
+
alt: 'Alt',
|
|
78
|
+
shift: 'Shift',
|
|
79
|
+
enter: 'Enter',
|
|
80
|
+
backspace: 'Backspace',
|
|
81
|
+
escape: 'Escape',
|
|
82
|
+
tab: 'Tab',
|
|
83
|
+
up: 'Up arrow',
|
|
84
|
+
down: 'Down arrow',
|
|
85
|
+
left: 'Left arrow',
|
|
86
|
+
right: 'Right arrow',
|
|
87
|
+
plus: 'Plus'
|
|
88
|
+
};
|
|
89
|
+
function getKeyLabel(key, isMac) {
|
|
90
|
+
if (key === 'mod') {
|
|
91
|
+
return isMac ? 'Command' : 'Control';
|
|
92
|
+
}
|
|
93
|
+
return KEY_LABEL[key] ?? key.toUpperCase();
|
|
94
|
+
}
|
|
69
95
|
function subscribeToPlatformChanges() {
|
|
70
96
|
return () => {};
|
|
71
97
|
}
|
|
@@ -115,12 +141,18 @@ export function Kbd({
|
|
|
115
141
|
}) {
|
|
116
142
|
const isMac = useSyncExternalStore(subscribeToPlatformChanges, detectMac, getServerPlatformSnapshot);
|
|
117
143
|
const parts = keys.split('+').map(key => key.trim().toLowerCase());
|
|
144
|
+
|
|
145
|
+
// Screen-reader name: the joined spoken labels (e.g. "Command + K"), since
|
|
146
|
+
// the visual glyphs below are announced meaninglessly by assistive tech.
|
|
147
|
+
const accessibleName = parts.map(key => getKeyLabel(key, isMac)).join(' + ');
|
|
118
148
|
return /*#__PURE__*/_jsx("span", {
|
|
119
149
|
ref: ref,
|
|
150
|
+
role: "img",
|
|
151
|
+
"aria-label": accessibleName,
|
|
120
152
|
...rest,
|
|
121
153
|
...mergeProps(themeProps('kbd'), stylex.props(styles.wrapper, xstyle), className, style),
|
|
122
|
-
"aria-hidden": "true",
|
|
123
154
|
children: parts.map(key => /*#__PURE__*/_jsx("kbd", {
|
|
155
|
+
"aria-hidden": "true",
|
|
124
156
|
...{
|
|
125
157
|
className: "x3nfvp2 x6s0dn4 xl56j7k x16asifk x1grt7ep x7a5moj xx3sua9 x17x4s8c xlxy82 x1q0q8m5 xib2hle xv1l7n4 x9ynric x141an7d x1e4wzip x1ltkj2j x87ps6o"
|
|
126
158
|
},
|