@astryxdesign/core 0.1.8 → 0.1.9-canary.09e9ddd
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 +100 -0
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +6 -2
- package/dist/AppShell/AppShellMobileContext.d.ts +8 -0
- package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
- package/dist/Avatar/Avatar.d.ts +53 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +203 -49
- package/dist/Avatar/AvatarStatusDot.d.ts +33 -5
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusDot.js +144 -19
- package/dist/AvatarGroup/AvatarGroup.d.ts +7 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +58 -6
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -0
- package/dist/Banner/Banner.d.ts +9 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +33 -4
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +31 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +208 -6
- package/dist/Breadcrumbs/index.d.ts +5 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +9 -1
- package/dist/Button/Button.d.ts +8 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +33 -4
- package/dist/ButtonGroup/ButtonGroup.d.ts +9 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +30 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +30 -2
- package/dist/Calendar/dayCellUtils.js +1 -1
- package/dist/Card/Card.d.ts +8 -2
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +28 -2
- package/dist/Carousel/Carousel.d.ts +4 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +24 -4
- package/dist/Chat/ChatComposer.d.ts +8 -0
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +46 -7
- package/dist/Chat/ChatComposerDrawer.d.ts +2 -0
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +11 -1
- package/dist/Chat/ChatComposerInput.d.ts +20 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +36 -4
- package/dist/Chat/ChatContext.d.ts +33 -0
- package/dist/Chat/ChatContext.d.ts.map +1 -1
- package/dist/Chat/ChatContext.js +16 -2
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +1 -1
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +4 -4
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +4 -4
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +7 -1
- package/dist/Chat/ChatToolCalls.d.ts +5 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +18 -9
- package/dist/Chat/index.d.ts +2 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +2 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +22 -8
- package/dist/Chat/useSpeechRecognition.d.ts +0 -1
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +1 -1
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.js +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts +20 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +11 -1
- package/dist/Citation/Citation.d.ts +22 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -6
- package/dist/ClickableCard/ClickableCard.d.ts +9 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +9 -2
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +3 -1
- package/dist/CommandPalette/CommandPaletteGroup.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteGroup.js +9 -2
- package/dist/CommandPalette/CommandPaletteInput.d.ts +7 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +6 -1
- package/dist/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/DateInput/DateInput.d.ts +55 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +28 -2
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts +9 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +3 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +18 -3
- package/dist/Dialog/Dialog.d.ts +3 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +57 -6
- package/dist/Dialog/DialogContext.d.ts +7 -0
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogContext.js +2 -2
- package/dist/Dialog/DialogHeader.d.ts +5 -2
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +6 -1
- package/dist/Divider/Divider.js +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +1 -2
- package/dist/DropdownMenu/DropdownMenuItem.js +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +1 -2
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +2 -3
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +43 -16
- package/dist/FieldStatus/FieldStatus.d.ts +15 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +58 -6
- package/dist/FileInput/FileInput.d.ts +9 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +42 -20
- package/dist/HoverCard/HoverCard.d.ts +9 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -0
- package/dist/HoverCard/useHoverCard.d.ts +8 -0
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +7 -2
- package/dist/Icon/Icon.d.ts +7 -2
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Item/Item.d.ts +6 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +22 -1
- package/dist/Layer/useLayer.d.ts +6 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +2 -0
- package/dist/Lightbox/Lightbox.js +4 -4
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +6 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -0
- package/dist/MultiSelector/MultiSelector.d.ts +9 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +41 -12
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +16 -0
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts +9 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +8 -1
- package/dist/Outline/Outline.d.ts +0 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +0 -1
- package/dist/OverflowList/OverflowList.d.ts +20 -3
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +29 -4
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -3
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +3 -2
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +3 -9
- package/dist/PowerSearch/PowerSearch.d.ts +9 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +2 -0
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts +9 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +16 -13
- package/dist/Selector/Selector.d.ts +8 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +7 -3
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +16 -0
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +21 -8
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +19 -2
- package/dist/Stack/stack.stylex.d.ts +9 -9
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +3 -2
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/index.d.ts +3 -0
- package/dist/Table/plugins/rowStatus/index.d.ts.map +1 -0
- package/dist/Table/plugins/rowStatus/index.js +3 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts +60 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +145 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts +13 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +4 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +16 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +87 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +6 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeState.js +22 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -3
- package/dist/TextArea/TextArea.d.ts +9 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +2 -0
- package/dist/TextInput/TextInput.d.ts +9 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +6 -1
- package/dist/Thumbnail/Thumbnail.d.ts +26 -5
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +97 -54
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts +9 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts.map +1 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.js +14 -0
- package/dist/TimeInput/TimeInput.d.ts +9 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +17 -4
- package/dist/Timestamp/Timestamp.d.ts +3 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +8 -6
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +2 -5
- package/dist/ToggleButton/ToggleButtonGroup.d.ts +0 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts +10 -3
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +18 -4
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +18 -8
- package/dist/TopNav/TopNavMegaMenu.js +10 -4
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts +9 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +8 -1
- package/dist/TopNav/TopNavMenu.d.ts +2 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +68 -6
- package/dist/TreeList/TreeList.d.ts +12 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +2 -0
- package/dist/TreeList/TreeListBranches.d.ts +5 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +10 -4
- package/dist/TreeList/TreeListItem.d.ts +8 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +28 -8
- package/dist/TreeList/TreeListTypes.d.ts +25 -1
- package/dist/TreeList/TreeListTypes.d.ts.map +1 -1
- package/dist/TreeList/index.d.ts +2 -2
- package/dist/TreeList/index.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +20 -11
- package/dist/Typeahead/Typeahead.d.ts +9 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +2 -0
- package/dist/astryx.css +41 -31
- package/dist/astryx.umd.js +51 -51
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts.map +1 -1
- package/dist/docs-types.d.ts +8 -0
- package/dist/docs-types.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.d.ts +47 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -0
- package/dist/hooks/computeOverflow.js +213 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/isRtlElement.d.ts +18 -0
- package/dist/hooks/isRtlElement.d.ts.map +1 -0
- package/dist/hooks/isRtlElement.js +27 -0
- package/dist/hooks/useDevWarning.d.ts +18 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -0
- package/dist/hooks/useDevWarning.js +49 -0
- package/dist/hooks/useGridFocus.d.ts +6 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +12 -9
- package/dist/hooks/useListFocus.d.ts +6 -1
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +12 -4
- package/dist/hooks/useOverflow.d.ts +19 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +36 -25
- package/dist/i18n/InternationalizationContext.d.ts +1 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -0
- package/dist/i18n/InternationalizationProvider.d.ts +8 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +5 -1
- package/dist/i18n/getLocaleDirection.d.ts +18 -0
- package/dist/i18n/getLocaleDirection.d.ts.map +1 -0
- package/dist/i18n/getLocaleDirection.js +29 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -1
- package/dist/i18n/resolve.d.ts.map +1 -1
- package/dist/i18n/resolve.js +7 -18
- package/dist/i18n/useDirection.d.ts +2 -0
- package/dist/i18n/useDirection.d.ts.map +1 -0
- package/dist/i18n/useDirection.js +27 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +2 -7
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +13 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +51 -0
- package/dist/theme/hct.d.ts +0 -1
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +2 -1
- package/dist/utils/devWarning.d.ts +42 -0
- package/dist/utils/devWarning.d.ts.map +1 -0
- package/dist/utils/devWarning.js +88 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -2
- package/dist/utils/plainDate.d.ts +30 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +53 -0
- package/dist/utils/types.d.ts +13 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/locales/en.json +32 -0
- package/locales/fr-FR.json +14 -0
- package/locales/pseudo.json +24 -0
- package/package.json +1 -1
- package/src/AppShell/AppShell.tsx +6 -0
- package/src/AppShell/AppShellMobileContext.tsx +8 -0
- package/src/AppShell/useAppShellMobile.doc.mjs +8 -0
- package/src/Avatar/Avatar.doc.mjs +60 -3
- package/src/Avatar/Avatar.test.tsx +281 -1
- package/src/Avatar/Avatar.tsx +324 -64
- package/src/Avatar/AvatarStatusDot.doc.mjs +23 -12
- package/src/Avatar/AvatarStatusDot.test.tsx +284 -0
- package/src/Avatar/AvatarStatusDot.tsx +178 -21
- package/src/AvatarGroup/AvatarGroup.doc.mjs +2 -0
- package/src/AvatarGroup/AvatarGroup.test.tsx +125 -0
- package/src/AvatarGroup/AvatarGroup.tsx +58 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -0
- package/src/Banner/Banner.doc.mjs +9 -0
- package/src/Banner/Banner.test.tsx +30 -0
- package/src/Banner/Banner.tsx +53 -9
- package/src/Breadcrumbs/BreadcrumbItem.doc.mjs +26 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +333 -14
- package/src/Breadcrumbs/Breadcrumbs.doc.mjs +2 -0
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +284 -2
- package/src/Breadcrumbs/index.ts +27 -0
- package/src/Button/Button.doc.mjs +9 -4
- package/src/Button/Button.test.tsx +49 -0
- package/src/Button/Button.tsx +27 -3
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -0
- package/src/ButtonGroup/ButtonGroup.test.tsx +37 -0
- package/src/ButtonGroup/ButtonGroup.tsx +32 -0
- package/src/Calendar/Calendar.doc.mjs +12 -1
- package/src/Calendar/Calendar.test.tsx +193 -0
- package/src/Calendar/Calendar.tsx +38 -16
- package/src/Calendar/dayCellUtils.test.ts +5 -0
- package/src/Calendar/dayCellUtils.ts +1 -1
- package/src/Card/Card.doc.mjs +9 -0
- package/src/Card/Card.test.tsx +21 -3
- package/src/Card/Card.tsx +35 -2
- package/src/Carousel/Carousel.doc.mjs +1 -0
- package/src/Carousel/Carousel.test.tsx +53 -0
- package/src/Carousel/Carousel.tsx +34 -4
- package/src/Chat/ChatComposer.doc.mjs +12 -3
- package/src/Chat/ChatComposer.test.tsx +115 -0
- package/src/Chat/ChatComposer.tsx +73 -9
- package/src/Chat/ChatComposerDrawer.test.tsx +61 -0
- package/src/Chat/ChatComposerDrawer.tsx +11 -1
- package/src/Chat/ChatComposerInput.doc.mjs +7 -0
- package/src/Chat/ChatComposerInput.test.tsx +103 -0
- package/src/Chat/ChatComposerInput.tsx +51 -5
- package/src/Chat/ChatContext.tsx +37 -10
- package/src/Chat/ChatDictationButton.tsx +4 -1
- package/src/Chat/ChatLayout.tsx +7 -5
- package/src/Chat/ChatLayoutScrollButton.tsx +7 -2
- package/src/Chat/ChatMessageMetadata.tsx +1 -2
- package/src/Chat/ChatSendButton.tsx +11 -1
- package/src/Chat/ChatToolCalls.test.tsx +64 -0
- package/src/Chat/ChatToolCalls.tsx +25 -4
- package/src/Chat/index.ts +5 -1
- package/src/Chat/useChatStreamScroll.test.tsx +49 -0
- package/src/Chat/useChatStreamScroll.ts +27 -10
- package/src/Chat/useSpeechRecognition.ts +1 -1
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.test.tsx +32 -1
- package/src/CheckboxInput/CheckboxInput.tsx +1 -1
- package/src/CheckboxList/CheckboxList.test.tsx +81 -3
- package/src/CheckboxList/CheckboxListItem.doc.mjs +33 -5
- package/src/CheckboxList/CheckboxListItem.tsx +41 -5
- package/src/Citation/Citation.doc.mjs +4 -3
- package/src/Citation/Citation.test.tsx +97 -0
- package/src/Citation/Citation.tsx +43 -11
- package/src/ClickableCard/ClickableCard.doc.mjs +2 -0
- package/src/ClickableCard/ClickableCard.test.tsx +34 -0
- package/src/ClickableCard/ClickableCard.tsx +13 -3
- package/src/CodeBlock/CodeBlock.test.tsx +56 -0
- package/src/CodeBlock/CodeBlock.tsx +10 -2
- package/src/CommandPalette/CommandPalette.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.tsx +3 -1
- package/src/CommandPalette/CommandPaletteGroup.test.tsx +71 -0
- package/src/CommandPalette/CommandPaletteGroup.tsx +12 -1
- package/src/CommandPalette/CommandPaletteInput.doc.mjs +26 -9
- package/src/CommandPalette/CommandPaletteInput.test.tsx +34 -0
- package/src/CommandPalette/CommandPaletteInput.tsx +11 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +193 -0
- package/src/DateInput/DateInput.doc.mjs +31 -0
- package/src/DateInput/DateInput.test.tsx +131 -0
- package/src/DateInput/DateInput.tsx +78 -3
- package/src/DateInput/index.ts +1 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +8 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +23 -0
- package/src/DateRangeInput/DateRangeInput.tsx +13 -3
- package/src/DateTimeInput/DateTimeInput.doc.mjs +16 -1
- package/src/DateTimeInput/DateTimeInput.test.tsx +147 -0
- package/src/DateTimeInput/DateTimeInput.tsx +42 -18
- package/src/Dialog/Dialog.doc.mjs +2 -2
- package/src/Dialog/Dialog.test.tsx +77 -4
- package/src/Dialog/Dialog.tsx +89 -5
- package/src/Dialog/DialogContext.ts +9 -2
- package/src/Dialog/DialogHeader.doc.mjs +2 -2
- package/src/Dialog/DialogHeader.tsx +9 -2
- package/src/Divider/Divider.tsx +2 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +169 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -2
- package/src/DropdownMenu/DropdownMenuItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +1 -2
- package/src/Field/Field.test.tsx +57 -12
- package/src/Field/Field.tsx +6 -5
- package/src/Field/FieldLabel.tsx +9 -1
- package/src/FieldStatus/FieldStatus.doc.mjs +17 -5
- package/src/FieldStatus/FieldStatus.test.tsx +150 -40
- package/src/FieldStatus/FieldStatus.tsx +63 -5
- package/src/FileInput/FileInput.doc.mjs +17 -2
- package/src/FileInput/FileInput.test.tsx +135 -12
- package/src/FileInput/FileInput.tsx +53 -28
- package/src/HoverCard/HoverCard.doc.mjs +13 -0
- package/src/HoverCard/HoverCard.test.tsx +21 -2
- package/src/HoverCard/HoverCard.tsx +11 -0
- package/src/HoverCard/useHoverCard.doc.mjs +2 -0
- package/src/HoverCard/useHoverCard.tsx +24 -2
- package/src/Icon/Icon.doc.mjs +3 -2
- package/src/Icon/Icon.tsx +7 -2
- package/src/IconButton/IconButton.doc.mjs +8 -0
- package/src/IconButton/IconButton.test.tsx +15 -18
- package/src/Item/Item.test.tsx +40 -18
- package/src/Item/Item.tsx +38 -2
- package/src/Layer/useLayer.tsx +8 -0
- package/src/Lightbox/Lightbox.tsx +4 -4
- package/src/List/List.test.tsx +9 -8
- package/src/MobileNav/MobileNav.tsx +12 -1
- package/src/MobileNav/MobileNavToggle.test.tsx +116 -0
- package/src/MobileNav/MobileNavToggle.tsx +9 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +13 -2
- package/src/MultiSelector/MultiSelector.test.tsx +195 -3
- package/src/MultiSelector/MultiSelector.tsx +65 -12
- package/src/MultiSelector/hooks.ts +17 -0
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +15 -0
- package/src/NumberInput/NumberInput.test.tsx +82 -7
- package/src/NumberInput/NumberInput.tsx +21 -4
- package/src/Outline/Outline.tsx +0 -1
- package/src/OverflowList/OverflowList.doc.mjs +39 -6
- package/src/OverflowList/OverflowList.test.tsx +111 -0
- package/src/OverflowList/OverflowList.tsx +48 -8
- package/src/Pagination/Pagination.tsx +11 -3
- package/src/Popover/Popover.tsx +7 -4
- package/src/Popover/usePopover.tsx +9 -13
- package/src/PowerSearch/PowerSearch.doc.mjs +29 -0
- package/src/PowerSearch/PowerSearch.test.tsx +43 -0
- package/src/PowerSearch/PowerSearch.tsx +10 -1
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +67 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
- package/src/PowerSearch/usePowerSearchSource.ts +1 -2
- package/src/SelectableCard/SelectableCard.doc.mjs +2 -0
- package/src/SelectableCard/SelectableCard.test.tsx +46 -4
- package/src/SelectableCard/SelectableCard.tsx +29 -16
- package/src/Selector/Selector.doc.mjs +7 -0
- package/src/Selector/Selector.test.tsx +92 -0
- package/src/Selector/Selector.tsx +16 -2
- package/src/Selector/hooks.ts +17 -0
- package/src/SideNav/SideNav.test.tsx +119 -3
- package/src/SideNav/SideNavCollapseButton.tsx +6 -1
- package/src/SideNav/SideNavHeading.tsx +24 -8
- package/src/SideNav/SideNavItem.tsx +5 -1
- package/src/Slider/Slider.test.tsx +75 -2
- package/src/Slider/Slider.tsx +21 -5
- package/src/Switch/Switch.test.tsx +32 -1
- package/src/TabList/Tab.tsx +2 -2
- package/src/TabList/TabMenu.tsx +2 -2
- package/src/Table/BaseTable.tsx +3 -5
- package/src/Table/TableCell.tsx +3 -3
- package/src/Table/TableHeaderCell.tsx +3 -3
- package/src/Table/index.ts +5 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +6 -2
- package/src/Table/plugins/rowStatus/index.ts +7 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +138 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +189 -0
- package/src/Table/plugins/selection/useTableSelection.test.tsx +16 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +19 -1
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -1
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +135 -3
- package/src/Table/plugins/tree/useTableTreeData.tsx +128 -1
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +104 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +46 -2
- package/src/Table/useBaseTablePlugins.ts +10 -6
- package/src/Table/useTableRowStatus.doc.mjs +30 -0
- package/src/Table/useTableSelection.doc.mjs +65 -14
- package/src/Table/useTableTreeData.doc.mjs +29 -0
- package/src/Table/useTableTreeState.doc.mjs +2 -2
- package/src/TextArea/TextArea.doc.mjs +15 -0
- package/src/TextArea/TextArea.test.tsx +32 -1
- package/src/TextArea/TextArea.tsx +10 -0
- package/src/TextInput/TextInput.doc.mjs +15 -0
- package/src/TextInput/TextInput.test.tsx +44 -0
- package/src/TextInput/TextInput.tsx +13 -1
- package/src/Thumbnail/Thumbnail.doc.mjs +19 -10
- package/src/Thumbnail/Thumbnail.test.tsx +98 -7
- package/src/Thumbnail/Thumbnail.tsx +142 -42
- package/src/Thumbnail/thumbnail.markers.stylex.ts +12 -0
- package/src/TimeInput/TimeInput.doc.mjs +15 -0
- package/src/TimeInput/TimeInput.test.tsx +99 -1
- package/src/TimeInput/TimeInput.tsx +29 -6
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +32 -0
- package/src/Timestamp/Timestamp.tsx +28 -8
- package/src/Toast/useToast.tsx +7 -8
- package/src/ToggleButton/ToggleButtonGroup.tsx +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +30 -1
- package/src/Tokenizer/Tokenizer.test.tsx +206 -2
- package/src/Tokenizer/Tokenizer.tsx +26 -4
- package/src/TopNav/TopNav.test.tsx +125 -1
- package/src/TopNav/TopNavHeading.tsx +24 -8
- package/src/TopNav/TopNavMegaMenu.test.tsx +149 -1
- package/src/TopNav/TopNavMegaMenu.tsx +10 -4
- package/src/TopNav/TopNavMegaMenuFeaturedCard.doc.mjs +3 -3
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +19 -2
- package/src/TopNav/TopNavMenu.test.tsx +118 -4
- package/src/TopNav/TopNavMenu.tsx +83 -5
- package/src/TreeList/TreeList.doc.mjs +22 -0
- package/src/TreeList/TreeList.test.tsx +232 -0
- package/src/TreeList/TreeList.tsx +18 -2
- package/src/TreeList/TreeListBranches.tsx +16 -2
- package/src/TreeList/TreeListItem.tsx +52 -12
- package/src/TreeList/TreeListTypes.ts +27 -1
- package/src/TreeList/index.ts +2 -2
- package/src/Typeahead/BaseTypeahead.tsx +30 -15
- package/src/Typeahead/Typeahead.doc.mjs +7 -0
- package/src/Typeahead/Typeahead.test.tsx +50 -0
- package/src/Typeahead/Typeahead.tsx +10 -0
- package/src/authoring/doc.ts +1 -3
- package/src/docs-types.ts +5 -0
- package/src/hooks/computeOverflow.test.ts +422 -0
- package/src/hooks/computeOverflow.ts +290 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/isRtlElement.ts +27 -0
- package/src/hooks/useDevWarning.test.tsx +45 -0
- package/src/hooks/useDevWarning.ts +54 -0
- package/src/hooks/useGridFocus.doc.mjs +3 -3
- package/src/hooks/useGridFocus.test.tsx +41 -0
- package/src/hooks/useGridFocus.ts +21 -10
- package/src/hooks/useListFocus.doc.mjs +3 -3
- package/src/hooks/useListFocus.test.tsx +67 -1
- package/src/hooks/useListFocus.ts +21 -5
- package/src/hooks/useOverflow.test.ts +96 -4
- package/src/hooks/useOverflow.ts +74 -33
- package/src/i18n/InternationalizationContext.ts +4 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +99 -2
- package/src/i18n/InternationalizationProvider.tsx +12 -2
- package/src/i18n/__tests__/getLocaleDirection.test.ts +40 -0
- package/src/i18n/__tests__/useDirection.test.tsx +66 -0
- package/src/i18n/getLocaleDirection.ts +29 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/resolve.ts +9 -21
- package/src/i18n/useDirection.ts +29 -0
- package/src/reset.css +0 -26
- package/src/reset.test.ts +60 -0
- package/src/theme/Theme.tsx +11 -14
- package/src/theme/derivedVarRegistry.test.ts +1 -0
- package/src/theme/derivedVarRegistry.ts +6 -0
- package/src/theme/generateThemeRules.test.ts +107 -0
- package/src/theme/generateThemeRules.ts +56 -0
- package/src/theme/hct.ts +1 -1
- package/src/theme/syntax/defineSyntaxTheme.ts +5 -6
- package/src/utils/devWarning.test.ts +56 -0
- package/src/utils/devWarning.ts +102 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/plainDate.test.ts +22 -0
- package/src/utils/plainDate.ts +61 -0
- package/src/utils/types.ts +14 -0
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export interface DialogContextValue {
|
|
2
2
|
/** Whether the dialog is rendered inline for docs/showcases. */
|
|
3
3
|
isInline: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Id the DialogHeader title should render with so the dialog can name
|
|
6
|
+
* itself via aria-labelledby. The dialog detects the title element's
|
|
7
|
+
* presence directly (via a callback ref), so it only emits aria-labelledby
|
|
8
|
+
* when the title actually rendered — never pointing at a nonexistent id.
|
|
9
|
+
*/
|
|
10
|
+
titleId?: string;
|
|
4
11
|
}
|
|
5
12
|
export declare const DialogContext: import("react").Context<DialogContextValue | null>;
|
|
6
13
|
export declare function useDialogContext(): DialogContextValue | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContext.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogContext.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,QAAQ,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DialogContext.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogContext.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAG5E,wBAAgB,gBAAgB,IAAI,kBAAkB,GAAG,IAAI,CAE5D"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DialogContext.ts
|
|
7
7
|
* @input React context
|
|
8
|
-
* @output Internal dialog context for child focus behavior
|
|
9
|
-
* @position Dialog internals; consumed by focus-managing children
|
|
8
|
+
* @output Internal dialog context for child focus behavior and default labelling
|
|
9
|
+
* @position Dialog internals; consumed by focus-managing children and DialogHeader
|
|
10
10
|
*/
|
|
11
11
|
import { createContext, use } from 'react';
|
|
12
12
|
export const DialogContext = /*#__PURE__*/createContext(null);
|
|
@@ -18,7 +18,9 @@ export interface DialogHeaderProps extends BaseProps<HTMLDivElement> {
|
|
|
18
18
|
ref?: React.Ref<HTMLDivElement>;
|
|
19
19
|
/**
|
|
20
20
|
* The title of the dialog.
|
|
21
|
-
* This title receives focus when the dialog opens for screen reader
|
|
21
|
+
* This title receives focus when the dialog opens for screen reader
|
|
22
|
+
* accessibility, and names the parent Dialog via aria-labelledby unless the
|
|
23
|
+
* consumer passes an explicit aria-label/aria-labelledby to the Dialog.
|
|
22
24
|
*/
|
|
23
25
|
title: string;
|
|
24
26
|
/**
|
|
@@ -52,7 +54,8 @@ export interface DialogHeaderProps extends BaseProps<HTMLDivElement> {
|
|
|
52
54
|
* Renders a title that receives focus when a modal dialog opens (for screen reader accessibility)
|
|
53
55
|
* and an optional close button. Inline documentation previews suppress this autofocus.
|
|
54
56
|
* The title is an h2 element with tabIndex={-1} so it can be programmatically focused but
|
|
55
|
-
* doesn't appear in the tab order.
|
|
57
|
+
* doesn't appear in the tab order. The title also names the parent Dialog via
|
|
58
|
+
* aria-labelledby (unless the Dialog receives an explicit aria-label/aria-labelledby).
|
|
56
59
|
*
|
|
57
60
|
* Uses LayoutHeader internally for consistent styling with other layout headers.
|
|
58
61
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAoC5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC
|
|
1
|
+
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAoC5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE5C;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAqEnB;yBAjFe,YAAY"}
|
|
@@ -39,7 +39,8 @@ const styles = {
|
|
|
39
39
|
* Renders a title that receives focus when a modal dialog opens (for screen reader accessibility)
|
|
40
40
|
* and an optional close button. Inline documentation previews suppress this autofocus.
|
|
41
41
|
* The title is an h2 element with tabIndex={-1} so it can be programmatically focused but
|
|
42
|
-
* doesn't appear in the tab order.
|
|
42
|
+
* doesn't appear in the tab order. The title also names the parent Dialog via
|
|
43
|
+
* aria-labelledby (unless the Dialog receives an explicit aria-label/aria-labelledby).
|
|
43
44
|
*
|
|
44
45
|
* Uses LayoutHeader internally for consistent styling with other layout headers.
|
|
45
46
|
*
|
|
@@ -71,10 +72,13 @@ export function DialogHeader({
|
|
|
71
72
|
const titleRef = useRef(null);
|
|
72
73
|
const dialogContext = useDialogContext();
|
|
73
74
|
const shouldAutoFocus = dialogContext?.isInline !== true;
|
|
75
|
+
const titleId = dialogContext?.titleId;
|
|
74
76
|
|
|
75
77
|
// Auto-focus the title when mounted for screen reader accessibility.
|
|
76
78
|
// Inline dialogs are documentation/showcase previews, so suppress focus to
|
|
77
79
|
// avoid stealing scroll position from the surrounding page.
|
|
80
|
+
// The parent Dialog detects this title (by `titleId`) via a callback ref to
|
|
81
|
+
// set its default aria-labelledby — no registration handshake needed here.
|
|
78
82
|
useEffect(() => {
|
|
79
83
|
if (shouldAutoFocus && titleRef.current) {
|
|
80
84
|
titleRef.current.focus();
|
|
@@ -102,6 +106,7 @@ export function DialogHeader({
|
|
|
102
106
|
},
|
|
103
107
|
children: [/*#__PURE__*/_jsx(Heading, {
|
|
104
108
|
ref: titleRef,
|
|
109
|
+
id: titleId,
|
|
105
110
|
level: 2,
|
|
106
111
|
tabIndex: -1,
|
|
107
112
|
xstyle: styles.titleFocusable,
|
package/dist/Divider/Divider.js
CHANGED
|
@@ -115,13 +115,13 @@ export function Divider({
|
|
|
115
115
|
const isHorizontal = orientation === 'horizontal';
|
|
116
116
|
return /*#__PURE__*/_jsxs("div", {
|
|
117
117
|
ref: ref,
|
|
118
|
+
...props,
|
|
118
119
|
role: "separator",
|
|
119
120
|
"aria-orientation": orientation,
|
|
120
121
|
...mergeProps(themeProps('divider', {
|
|
121
122
|
variant,
|
|
122
123
|
orientation
|
|
123
124
|
}), stylex.props(isHorizontal ? baseStyles.horizontal : baseStyles.vertical, isFullBleed && (isHorizontal ? fullBleedStyles.horizontal : fullBleedStyles.vertical), xstyle), className, style),
|
|
124
|
-
...props,
|
|
125
125
|
children: [/*#__PURE__*/_jsx("div", {
|
|
126
126
|
...stylex.props(isHorizontal ? lineStyles.horizontalLine : lineStyles.verticalLine, lineStyles[variant])
|
|
127
127
|
}), label && /*#__PURE__*/_jsx("div", {
|
|
@@ -71,8 +71,7 @@ export interface DropdownMenuCheckboxItemProps extends Omit<BaseProps, 'onChange
|
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
73
|
* ```
|
|
74
|
-
*
|
|
75
|
-
*
|
|
74
|
+
* import {DropdownMenuCheckboxItem} from '@astryxdesign/core/DropdownMenu';
|
|
76
75
|
* <DropdownMenu button={{label: 'View'}}>
|
|
77
76
|
* <DropdownMenuCheckboxItem
|
|
78
77
|
* label="Show archived"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAElD,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAY5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6D5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED
|
|
1
|
+
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAElD,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAY5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6D5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,6BAA6B,+BAwD/B;yBArEe,wBAAwB"}
|
|
@@ -94,8 +94,7 @@ const boxSizeStyles = {
|
|
|
94
94
|
*
|
|
95
95
|
* @example
|
|
96
96
|
* ```
|
|
97
|
-
*
|
|
98
|
-
*
|
|
97
|
+
* import {DropdownMenuCheckboxItem} from '@astryxdesign/core/DropdownMenu';
|
|
99
98
|
* <DropdownMenu button={{label: 'View'}}>
|
|
100
99
|
* <DropdownMenuCheckboxItem
|
|
101
100
|
* label="Show archived"
|
|
@@ -49,11 +49,10 @@ export interface DropdownMenuRadioGroupProps extends Omit<BaseProps, 'onChange'>
|
|
|
49
49
|
*
|
|
50
50
|
* @example
|
|
51
51
|
* ```
|
|
52
|
-
*
|
|
52
|
+
* import {
|
|
53
53
|
* DropdownMenuRadioGroup,
|
|
54
54
|
* DropdownMenuRadioItem,
|
|
55
55
|
* } from '@astryxdesign/core/DropdownMenu';
|
|
56
|
-
*
|
|
57
56
|
* <DropdownMenu button={{label: 'Sort'}}>
|
|
58
57
|
* <DropdownMenuRadioGroup value={sort} onChange={setSort} aria-label="Sort by">
|
|
59
58
|
* <DropdownMenuRadioItem value="newest" label="Newest" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuRadioGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiB5C,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CACvD,SAAS,EACT,UAAU,CACX;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"DropdownMenuRadioGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAI9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAiB5C,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CACvD,SAAS,EACT,UAAU,CACX;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,QAAQ,EACR,gBAAuB,EACvB,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,+BAgB7B;yBAxBe,sBAAsB"}
|
|
@@ -25,11 +25,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```
|
|
28
|
-
*
|
|
28
|
+
* import {
|
|
29
29
|
* DropdownMenuRadioGroup,
|
|
30
30
|
* DropdownMenuRadioItem,
|
|
31
31
|
* } from '@astryxdesign/core/DropdownMenu';
|
|
32
|
-
*
|
|
33
32
|
* <DropdownMenu button={{label: 'Sort'}}>
|
|
34
33
|
* <DropdownMenuRadioGroup value={sort} onChange={setSort} aria-label="Sort by">
|
|
35
34
|
* <DropdownMenuRadioItem value="newest" label="Newest" />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAM,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAM,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAqCtC,YAAY,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;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;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACxC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,OAAO,EACP,OAAO,EACP,YAAoB,EACpB,aAAa,EACb,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAA0B,EAC1B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,+BAqGZ;yBA3He,KAAK"}
|
package/dist/Field/Field.js
CHANGED
|
@@ -22,6 +22,7 @@ import { FieldStatus } from "../FieldStatus/FieldStatus.js";
|
|
|
22
22
|
import "../theme/tokens.stylex.js";
|
|
23
23
|
import { spacingVars, borderVars } from "../theme/tokens.stylex.js";
|
|
24
24
|
import { mergeProps } from "../utils/index.js";
|
|
25
|
+
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
25
26
|
import { FormLayoutContext } from "../FormLayout/FormLayoutContext.js";
|
|
26
27
|
import { Text } from "../Text/index.js";
|
|
27
28
|
import { themeProps } from "../utils/themeProps.js";
|
|
@@ -93,9 +94,7 @@ export function Field({
|
|
|
93
94
|
const isHorizontalLabels = direction === 'horizontal-labels';
|
|
94
95
|
const resolvedDescriptionID = descriptionID ?? (description ? `${inputID}-desc` : undefined);
|
|
95
96
|
const resolvedMessageID = status?.messageID ?? (status?.message ? `${inputID}-status` : undefined);
|
|
96
|
-
|
|
97
|
-
console.warn('Field: isOptional and isRequired are mutually exclusive. isOptional takes precedence.');
|
|
98
|
-
}
|
|
97
|
+
useDevWarning('Field', 'isOptional and isRequired are mutually exclusive. isOptional takes precedence.', isOptional && isRequired);
|
|
99
98
|
const labelNode = /*#__PURE__*/_jsx(FieldLabel, {
|
|
100
99
|
label: label,
|
|
101
100
|
inputID: inputID,
|
|
@@ -95,7 +95,7 @@ export interface FieldLabelProps extends BaseProps<HTMLLabelElement> {
|
|
|
95
95
|
* <FieldLabel label="Search" inputID={inputId} isLabelHidden />
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
|
-
export declare function FieldLabel({ label, inputID, labelID, isGroupLabel, 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, className, style, xstyle, ref, ...rest }: FieldLabelProps): import("react").JSX.Element;
|
|
99
99
|
export declare namespace FieldLabel {
|
|
100
100
|
var displayName: string;
|
|
101
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;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,
|
|
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,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+BA0DjB;yBA5Ee,UAAU"}
|
package/dist/Field/FieldLabel.js
CHANGED
|
@@ -20,6 +20,41 @@ import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
|
20
20
|
import { Tooltip } from "../Tooltip/index.js";
|
|
21
21
|
import { themeProps } from "../utils/themeProps.js";
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
23
|
+
const styles = {
|
|
24
|
+
label: {
|
|
25
|
+
k1xSpc: "x78zum5",
|
|
26
|
+
kGNEyG: "x6s0dn4",
|
|
27
|
+
kOIVth: "xzye2dw",
|
|
28
|
+
kMv6JI: "x9ynric",
|
|
29
|
+
kGuDYH: "xcr08ib",
|
|
30
|
+
kLWn49: "x1kq96og",
|
|
31
|
+
k63SB2: "x1e4wzip",
|
|
32
|
+
kMwMTN: "xv1l7n4",
|
|
33
|
+
kkrTdU: "x1ypdohk",
|
|
34
|
+
$$css: true
|
|
35
|
+
},
|
|
36
|
+
labelDisabled: {
|
|
37
|
+
kMwMTN: "xnbbluu",
|
|
38
|
+
kkrTdU: "x1h6gzvc",
|
|
39
|
+
$$css: true
|
|
40
|
+
},
|
|
41
|
+
srOnly: {
|
|
42
|
+
ksu8eU: "xng3xce",
|
|
43
|
+
kMcinP: "xzpqnlu",
|
|
44
|
+
kZKoxP: "xjm9jq1",
|
|
45
|
+
kLqNvP: "x1o0tod",
|
|
46
|
+
kogj98: "xkdpibf",
|
|
47
|
+
kVQacm: "xb3r6kr",
|
|
48
|
+
kmVPX3: "x1717udv",
|
|
49
|
+
kfzvcC: "x47corl",
|
|
50
|
+
kVAEAm: "x10l6tqk",
|
|
51
|
+
k87sOh: "x13vifvy",
|
|
52
|
+
kfSwDN: "x87ps6o",
|
|
53
|
+
khDVqt: "xuxw1ft",
|
|
54
|
+
kzqmXN: "x1i1rx1s",
|
|
55
|
+
$$css: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
23
58
|
/**
|
|
24
59
|
* Label + description group for form fields. Handles sr-only hiding,
|
|
25
60
|
* disabled styling, optional/required indicators, icons, and tooltips.
|
|
@@ -46,7 +81,11 @@ export function FieldLabel({
|
|
|
46
81
|
labelTooltip,
|
|
47
82
|
description,
|
|
48
83
|
descriptionID,
|
|
49
|
-
|
|
84
|
+
className,
|
|
85
|
+
style,
|
|
86
|
+
xstyle,
|
|
87
|
+
ref,
|
|
88
|
+
...rest
|
|
50
89
|
}) {
|
|
51
90
|
const statusText = isOptional ? 'Optional' : isRequired ? 'Required' : null;
|
|
52
91
|
|
|
@@ -85,20 +124,8 @@ export function FieldLabel({
|
|
|
85
124
|
// control; a group label (span) has no `htmlFor`.
|
|
86
125
|
,
|
|
87
126
|
htmlFor: isGroupLabel ? undefined : inputID,
|
|
88
|
-
...
|
|
89
|
-
|
|
90
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xv1l7n4 x1ypdohk"
|
|
91
|
-
},
|
|
92
|
-
2: {
|
|
93
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xnbbluu x1h6gzvc"
|
|
94
|
-
},
|
|
95
|
-
1: {
|
|
96
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xv1l7n4 x1ypdohk xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
97
|
-
},
|
|
98
|
-
3: {
|
|
99
|
-
className: "x78zum5 x6s0dn4 xzye2dw x9ynric xcr08ib x1kq96og x1e4wzip xnbbluu x1h6gzvc xng3xce xzpqnlu xjm9jq1 xu96u03 xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
100
|
-
}
|
|
101
|
-
}[!!isDisabled << 1 | !!isLabelHidden << 0]),
|
|
127
|
+
...rest,
|
|
128
|
+
...mergeProps(themeProps('field-label'), stylex.props(styles.label, isDisabled && styles.labelDisabled, isLabelHidden && styles.srOnly, xstyle), className, style),
|
|
102
129
|
children: labelContent
|
|
103
130
|
}), description && /*#__PURE__*/_jsx("span", {
|
|
104
131
|
id: descriptionID,
|
|
@@ -107,7 +134,7 @@ export function FieldLabel({
|
|
|
107
134
|
className: "x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4"
|
|
108
135
|
},
|
|
109
136
|
1: {
|
|
110
|
-
className: "x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 xng3xce xzpqnlu xjm9jq1
|
|
137
|
+
className: "x9ynric x141an7d x1ltkj2j x1sodnla xv1l7n4 xng3xce xzpqnlu xjm9jq1 x1o0tod xkdpibf xb3r6kr x1717udv x47corl x10l6tqk x13vifvy x87ps6o xuxw1ft x1i1rx1s"
|
|
111
138
|
}
|
|
112
139
|
}[!!isLabelHidden << 0],
|
|
113
140
|
children: description
|
|
@@ -43,6 +43,21 @@ export interface FieldStatusProps extends BaseProps<HTMLDivElement> {
|
|
|
43
43
|
/**
|
|
44
44
|
* A status message component for form fields.
|
|
45
45
|
*
|
|
46
|
+
* The `detached` variant renders a leading status icon before the message so
|
|
47
|
+
* status is not conveyed by color or position alone (WCAG 1.4.1). The icon is
|
|
48
|
+
* decorative for assistive tech (`aria-hidden`): the message text already names
|
|
49
|
+
* the status in words and is announced through the live region. The `attached`
|
|
50
|
+
* variant keeps its status affordance on the bordered input, so it renders no
|
|
51
|
+
* icon here to avoid a duplicate.
|
|
52
|
+
*
|
|
53
|
+
* Screen-reader announcements go through the persistent `useAnnounce` live
|
|
54
|
+
* regions (assertive for errors, polite otherwise) rather than `role`/
|
|
55
|
+
* `aria-live` on the rendered element. Live regions that mount together with
|
|
56
|
+
* their content are not reliably announced by assistive technology, and
|
|
57
|
+
* FieldStatus is almost always conditionally rendered by its callers. The
|
|
58
|
+
* message is announced whenever it appears — including on first mount — and
|
|
59
|
+
* whenever it changes.
|
|
60
|
+
*
|
|
46
61
|
* @example
|
|
47
62
|
* ```
|
|
48
63
|
* <FieldStatus
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldStatus.d.ts","sourceRoot":"","sources":["../../src/FieldStatus/FieldStatus.tsx"],"names":[],"mappings":"AAkBA,OAAO,
|
|
1
|
+
{"version":3,"file":"FieldStatus.d.ts","sourceRoot":"","sources":["../../src/FieldStatus/FieldStatus.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAiEpD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,IAAI,EACJ,OAAO,EACP,EAAE,EACF,OAAoB,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,gBAAgB,qBA2ClB;yBArDe,WAAW"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file FieldStatus.tsx
|
|
5
|
-
* @input Uses React, stylex, theme tokens
|
|
5
|
+
* @input Uses React, stylex, theme tokens, useAnnounce, Icon
|
|
6
6
|
* @output Exports FieldStatus component, FieldStatusProps
|
|
7
7
|
* @position Core implementation; consumed by Field, Switch, CheckboxInput, and the FieldStatus entrypoint
|
|
8
8
|
*
|
|
@@ -16,14 +16,26 @@
|
|
|
16
16
|
|
|
17
17
|
'use client';
|
|
18
18
|
|
|
19
|
-
import React from 'react';
|
|
19
|
+
import React, { useEffect } from 'react';
|
|
20
20
|
import * as stylex from '@stylexjs/stylex';
|
|
21
|
+
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
21
22
|
import { mergeProps } from "../utils/index.js";
|
|
22
23
|
import "../theme/tokens.stylex.js";
|
|
23
24
|
import { colorVars, radiusVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
24
25
|
import { useEntryAnimation } from "../hooks/useEntryAnimation.js";
|
|
25
26
|
import { themeProps } from "../utils/themeProps.js";
|
|
26
|
-
import {
|
|
27
|
+
import { Icon } from "../Icon/index.js";
|
|
28
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
/**
|
|
30
|
+
* Maps each status type to its status glyph. Mirrors the mapping the input
|
|
31
|
+
* controls already use for the on-field status affordance, so the detached
|
|
32
|
+
* message shows the same icon a consumer sees elsewhere for that status.
|
|
33
|
+
*/
|
|
34
|
+
const statusIconMap = {
|
|
35
|
+
warning: 'warning',
|
|
36
|
+
error: 'error',
|
|
37
|
+
success: 'success'
|
|
38
|
+
};
|
|
27
39
|
const styles = {
|
|
28
40
|
base: {
|
|
29
41
|
kMv6JI: "x9ynric",
|
|
@@ -87,6 +99,21 @@ const colorStyles = {
|
|
|
87
99
|
/**
|
|
88
100
|
* A status message component for form fields.
|
|
89
101
|
*
|
|
102
|
+
* The `detached` variant renders a leading status icon before the message so
|
|
103
|
+
* status is not conveyed by color or position alone (WCAG 1.4.1). The icon is
|
|
104
|
+
* decorative for assistive tech (`aria-hidden`): the message text already names
|
|
105
|
+
* the status in words and is announced through the live region. The `attached`
|
|
106
|
+
* variant keeps its status affordance on the bordered input, so it renders no
|
|
107
|
+
* icon here to avoid a duplicate.
|
|
108
|
+
*
|
|
109
|
+
* Screen-reader announcements go through the persistent `useAnnounce` live
|
|
110
|
+
* regions (assertive for errors, polite otherwise) rather than `role`/
|
|
111
|
+
* `aria-live` on the rendered element. Live regions that mount together with
|
|
112
|
+
* their content are not reliably announced by assistive technology, and
|
|
113
|
+
* FieldStatus is almost always conditionally rendered by its callers. The
|
|
114
|
+
* message is announced whenever it appears — including on first mount — and
|
|
115
|
+
* whenever it changes.
|
|
116
|
+
*
|
|
90
117
|
* @example
|
|
91
118
|
* ```
|
|
92
119
|
* <FieldStatus
|
|
@@ -112,17 +139,42 @@ export function FieldStatus({
|
|
|
112
139
|
...rest
|
|
113
140
|
}) {
|
|
114
141
|
const entryStyle = useEntryAnimation('slideDown');
|
|
142
|
+
const announce = useAnnounce();
|
|
143
|
+
|
|
144
|
+
// Announce the message through the persistently-mounted live regions.
|
|
145
|
+
// Announce-on-mount is intentional: callers conditionally mount FieldStatus
|
|
146
|
+
// when a status appears (and whole forms can mount with a server-side
|
|
147
|
+
// validation error already present), and both cases must be heard.
|
|
148
|
+
useEffect(() => {
|
|
149
|
+
if (message) {
|
|
150
|
+
announce(message, type === 'error' ? 'assertive' : 'polite');
|
|
151
|
+
}
|
|
152
|
+
}, [announce, message, type]);
|
|
115
153
|
return /*#__PURE__*/_jsx("div", {
|
|
116
154
|
ref: ref,
|
|
117
155
|
id: id,
|
|
118
|
-
role: type === 'error' ? 'alert' : 'status',
|
|
119
|
-
"aria-live": type === 'error' ? 'assertive' : 'polite',
|
|
120
156
|
...rest,
|
|
121
157
|
...mergeProps(themeProps('field-status', {
|
|
122
158
|
type,
|
|
123
159
|
variant
|
|
124
160
|
}), stylex.props(styles.base, entryStyle, variant === 'attached' ? styles.attached : styles.detached, colorStyles[type], xstyle), className, style),
|
|
125
|
-
children:
|
|
161
|
+
children: variant === 'detached' ? /*#__PURE__*/_jsxs("span", {
|
|
162
|
+
...{
|
|
163
|
+
className: "x78zum5 x1cy8zhl xzye2dw"
|
|
164
|
+
},
|
|
165
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
166
|
+
...{
|
|
167
|
+
className: "x1ltkj2j x2lah0s"
|
|
168
|
+
},
|
|
169
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
170
|
+
icon: statusIconMap[type],
|
|
171
|
+
size: "sm",
|
|
172
|
+
color: "inherit"
|
|
173
|
+
})
|
|
174
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
175
|
+
children: message
|
|
176
|
+
})]
|
|
177
|
+
}) : message
|
|
126
178
|
});
|
|
127
179
|
}
|
|
128
180
|
FieldStatus.displayName = 'FieldStatus';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InputStatus } from '../Field';
|
|
1
|
+
import { type InputStatus, type FieldStatusVariant } from '../Field';
|
|
2
2
|
export type { InputStatus as FileInputStatus, InputStatusType as FileInputStatusType, } from '../Field';
|
|
3
3
|
import type { BaseProps } from '../BaseProps';
|
|
4
4
|
import type { SizeValue } from '../utils/types';
|
|
@@ -86,6 +86,13 @@ export interface FileInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
86
86
|
* Validation status for the input.
|
|
87
87
|
*/
|
|
88
88
|
status?: InputStatus;
|
|
89
|
+
/**
|
|
90
|
+
* How the status message is placed relative to the input.
|
|
91
|
+
* - 'attached': message overlaps directly below the input (bordered treatment)
|
|
92
|
+
* - 'detached': message floats below as a separate element with spacing
|
|
93
|
+
* @default 'attached'
|
|
94
|
+
*/
|
|
95
|
+
statusVariant?: FieldStatusVariant;
|
|
89
96
|
/**
|
|
90
97
|
* Description text displayed below the label.
|
|
91
98
|
*/
|
|
@@ -126,7 +133,7 @@ export interface FileInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
126
133
|
* <FileInput label="Resume" value={file} onChange={setFile} accept=".pdf" />
|
|
127
134
|
* ```
|
|
128
135
|
*/
|
|
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;
|
|
136
|
+
export declare function FileInput({ label, isLabelHidden, value, onChange, changeAction, accept, isMultiple, maxSize, maxFiles, isDisabled, disabledMessage, isRequired, isLoading, status: statusProp, statusVariant, description, placeholder, mode, isOptional, labelTooltip, width, xstyle, className, style, ref, ...rest }: FileInputProps): import("react").JSX.Element;
|
|
130
137
|
export declare namespace FileInput {
|
|
131
138
|
var displayName: string;
|
|
132
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAEhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,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;AA+M9C,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;;;;;OAKG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;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,aAA0B,EAC1B,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,+BAgZhB;yBA3ae,SAAS"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file FileInput.tsx
|
|
7
|
-
* @input Uses React, useId, Field, Icon, Spinner
|
|
7
|
+
* @input Uses React, useId, Field, Icon, Spinner, VisuallyHidden
|
|
8
8
|
* @output Exports FileInput component, FileInputProps, FileInputStatus
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by FileInput.test.tsx
|
|
10
10
|
*
|
|
@@ -22,6 +22,7 @@ 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 { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
25
26
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
26
27
|
import { useTooltip } from "../Tooltip/index.js";
|
|
27
28
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
@@ -182,6 +183,7 @@ export function FileInput({
|
|
|
182
183
|
isRequired = false,
|
|
183
184
|
isLoading = false,
|
|
184
185
|
status: statusProp,
|
|
186
|
+
statusVariant = 'attached',
|
|
185
187
|
description,
|
|
186
188
|
placeholder,
|
|
187
189
|
mode = 'input',
|
|
@@ -198,15 +200,16 @@ export function FileInput({
|
|
|
198
200
|
const id = useId();
|
|
199
201
|
const descriptionID = useId();
|
|
200
202
|
const statusMessageID = useId();
|
|
201
|
-
const
|
|
203
|
+
const requiredID = useId();
|
|
202
204
|
const inputRef = useRef(null);
|
|
203
205
|
const [isDragOver, setIsDragOver] = useState(false);
|
|
204
206
|
const [validationError, setValidationError] = useState(null);
|
|
205
207
|
const [, startTransition] = useTransition();
|
|
206
208
|
|
|
207
209
|
// Announce successful file selection to screen readers via a persistent
|
|
208
|
-
// live region (forms-17).
|
|
209
|
-
//
|
|
210
|
+
// live region (forms-17). Validation errors are announced (assertively) by
|
|
211
|
+
// the FieldStatus that the derived error status mounts, so only the
|
|
212
|
+
// successful attach needs an explicit announcement here.
|
|
210
213
|
const announce = useAnnounce();
|
|
211
214
|
|
|
212
215
|
// Disabled-reason tooltip. Disabled controls swallow pointer events, so the
|
|
@@ -234,7 +237,14 @@ export function FileInput({
|
|
|
234
237
|
error: 'error',
|
|
235
238
|
success: 'success'
|
|
236
239
|
};
|
|
237
|
-
|
|
240
|
+
|
|
241
|
+
// Required state. `aria-required` is not a supported property of
|
|
242
|
+
// role="button" in WAI-ARIA 1.2 (AT does not announce it there), so the
|
|
243
|
+
// trigger instead points its aria-describedby at a visually hidden
|
|
244
|
+
// "Required" span — mirroring the Field label's visible indicator (where
|
|
245
|
+
// isOptional takes precedence) and the pattern Slider uses for its thumbs.
|
|
246
|
+
const conveysRequired = isRequired && !isOptional;
|
|
247
|
+
const ariaDescribedBy = [description ? descriptionID : null, status?.message ? statusMessageID : null, conveysRequired ? requiredID : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined;
|
|
238
248
|
const defaultPlaceholder = isMultiple ? 'Choose files' : 'Choose file';
|
|
239
249
|
const displayPlaceholder = placeholder ?? defaultPlaceholder;
|
|
240
250
|
const handleFiles = useCallback(fileList => {
|
|
@@ -258,8 +268,9 @@ export function FileInput({
|
|
|
258
268
|
onChange(result);
|
|
259
269
|
|
|
260
270
|
// Announce the successful selection politely. Validation errors are
|
|
261
|
-
//
|
|
262
|
-
// attach here (do not
|
|
271
|
+
// announced assertively by the FieldStatus that the derived error
|
|
272
|
+
// status mounts, so only announce the attach here (do not
|
|
273
|
+
// double-announce errors).
|
|
263
274
|
if (errors.length === 0) {
|
|
264
275
|
announce(valid.length === 1 ? `1 file selected: ${valid[0].name}` : `${valid.length} files selected`);
|
|
265
276
|
}
|
|
@@ -424,6 +435,7 @@ export function FileInput({
|
|
|
424
435
|
message: status.message,
|
|
425
436
|
messageID: status.message ? statusMessageID : undefined
|
|
426
437
|
} : undefined,
|
|
438
|
+
statusVariant: statusVariant,
|
|
427
439
|
labelTooltip: labelTooltip,
|
|
428
440
|
width: width,
|
|
429
441
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -441,15 +453,30 @@ export function FileInput({
|
|
|
441
453
|
tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
|
|
442
454
|
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
443
455
|
onClick: handleClick,
|
|
444
|
-
onKeyDown: handleKeyDown
|
|
445
|
-
|
|
456
|
+
onKeyDown: handleKeyDown
|
|
457
|
+
// aria-label suppresses child content from the accessible name, so
|
|
458
|
+
// compose the selected filenames into it — otherwise a screen-reader
|
|
459
|
+
// user refocusing the control hears only the field label and cannot
|
|
460
|
+
// tell what (if anything) is attached.
|
|
461
|
+
,
|
|
462
|
+
"aria-label": hasFiles && fileNames ? t('@astryx.fileInput.triggerWithFiles', {
|
|
463
|
+
label,
|
|
464
|
+
fileNames
|
|
465
|
+
}) : label,
|
|
446
466
|
"aria-busy": isLoading || undefined
|
|
447
467
|
// These describe the operable control, so they belong on the focusable
|
|
448
468
|
// role="button" wrapper — not the hidden tabIndex={-1} file input the
|
|
449
|
-
// user never focuses (forms-6).
|
|
469
|
+
// user never focuses (forms-6). Required state is conveyed through
|
|
470
|
+
// the visually hidden "Required" node in aria-describedby, not
|
|
471
|
+
// aria-required, which role="button" does not support in ARIA 1.2.
|
|
472
|
+
,
|
|
473
|
+
"aria-describedby": ariaDescribedBy
|
|
474
|
+
// aria-invalid is likewise unsupported on role="button", but it stays:
|
|
475
|
+
// a message-less error status (`status={{type: 'error'}}`) has no
|
|
476
|
+
// described-by replacement, and some AT still honor the attribute, so
|
|
477
|
+
// removing it would not be strictly better. Errors *with* a message
|
|
478
|
+
// are described via statusMessageID above.
|
|
450
479
|
,
|
|
451
|
-
"aria-describedby": ariaDescribedBy,
|
|
452
|
-
"aria-required": isRequired ? 'true' : undefined,
|
|
453
480
|
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
454
481
|
...dragDropProps,
|
|
455
482
|
...mergeProps(themeProps('file-input', {
|
|
@@ -479,14 +506,9 @@ export function FileInput({
|
|
|
479
506
|
}),
|
|
480
507
|
onClick: handleClear
|
|
481
508
|
})]
|
|
482
|
-
}), /*#__PURE__*/_jsx(
|
|
483
|
-
id:
|
|
484
|
-
|
|
485
|
-
"aria-live": "polite",
|
|
486
|
-
...{
|
|
487
|
-
className: "x10l6tqk x1i1rx1s xjm9jq1 x1717udv xkdpibf xb3r6kr xzpqnlu xuxw1ft xc342km"
|
|
488
|
-
},
|
|
489
|
-
children: validationError
|
|
509
|
+
}), conveysRequired && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
510
|
+
id: requiredID,
|
|
511
|
+
children: t('@astryx.fileInput.required')
|
|
490
512
|
}), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
491
513
|
});
|
|
492
514
|
}
|