@zj-dynamics/components 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/NOTICE.react-is +21 -0
- package/NOTICE.tabbable +22 -0
- package/README.md +23 -2
- package/compatibility.css +2 -0
- package/dist/Button.d.ts +90 -0
- package/dist/Button.js +58 -0
- package/dist/ButtonDismiss.d.ts +6 -0
- package/dist/ButtonDismiss.js +5 -0
- package/dist/Dialog.d.ts +75 -0
- package/dist/Dialog.js +59 -0
- package/dist/Icon.d.ts +20 -0
- package/dist/Icon.js +11 -0
- package/dist/InputText.d.ts +26 -0
- package/dist/InputText.js +63 -0
- package/dist/Switch.d.ts +8 -0
- package/dist/Switch.js +19 -0
- package/dist/Toast.d.ts +21 -0
- package/dist/Toast.js +58 -0
- package/dist/browserFocus.d.ts +11 -0
- package/dist/browserFocus.js +85 -0
- package/dist/browserHooks.d.ts +5 -0
- package/dist/browserHooks.js +4 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +91 -0
- package/dist/legacyModalPortal.d.ts +1 -0
- package/dist/legacyModalPortal.js +2 -0
- package/dist/mockViewportWidth.d.ts +5 -0
- package/dist/mockViewportWidth.js +58 -0
- package/dist/slotChildren.d.ts +2 -0
- package/dist/slotChildren.js +6 -0
- package/dist/theme.d.ts +26 -0
- package/dist/theme.js +65 -0
- package/dist/unstyledPrimitives.d.ts +12 -0
- package/dist/unstyledPrimitives.js +12 -0
- package/dist/useBreakpoints.d.ts +3 -0
- package/dist/useBreakpoints.js +2 -0
- package/dist/useFocusTrap.d.ts +1 -0
- package/dist/useFocusTrap.js +1 -0
- package/dist/useInView.d.ts +1 -0
- package/dist/useInView.js +1 -0
- package/dist/useIsSmallScreen.d.ts +1 -0
- package/dist/useIsSmallScreen.js +1 -0
- package/dist/useLiveAnnounce.d.ts +1 -0
- package/dist/useLiveAnnounce.js +1 -0
- package/dist/useOnKeyDown.d.ts +1 -0
- package/dist/useOnKeyDown.js +1 -0
- package/dist/useRefocusOnActivator.d.ts +1 -0
- package/dist/useRefocusOnActivator.js +1 -0
- package/dist/useResizeObserver.d.ts +22 -0
- package/dist/useResizeObserver.js +47 -0
- package/dist/useWindowDimensions.d.ts +2 -0
- package/dist/useWindowDimensions.js +1 -0
- package/dist/viewport.d.ts +46 -0
- package/dist/viewport.js +141 -0
- package/foundation/ActivityIndicator/ActivityIndicator.d.ts +38 -0
- package/foundation/ActivityIndicator/index.d.mts +2 -0
- package/foundation/ActivityIndicator/index.mjs +6 -0
- package/foundation/ActivityIndicator-es.js +30 -0
- package/foundation/Autocomplete/Autocomplete.d.ts +8 -0
- package/foundation/Autocomplete/Autocomplete.types.d.ts +401 -0
- package/foundation/Autocomplete/hooks/useAutocompleteListNav.d.ts +30 -0
- package/foundation/Autocomplete/index.d.mts +3 -0
- package/foundation/Autocomplete/index.mjs +39 -0
- package/foundation/Autocomplete/utils/interactionUtils.d.ts +14 -0
- package/foundation/Autocomplete-es.js +1322 -0
- package/foundation/Avatar/Avatar.d.ts +77 -0
- package/foundation/Avatar/index.d.mts +1 -0
- package/foundation/Avatar/index.mjs +6 -0
- package/foundation/Avatar-es.js +80 -0
- package/foundation/Banner/Banner.d.ts +10 -0
- package/foundation/Banner/Banner.types.d.ts +165 -0
- package/foundation/Banner/index.d.mts +2 -0
- package/foundation/Banner/index.mjs +14 -0
- package/foundation/Banner-es.js +134 -0
- package/foundation/Body-es.js +45 -0
- package/foundation/BottomSheet-es.js +110 -0
- package/foundation/Box/Box.d.ts +3 -0
- package/foundation/Box/Box.types.d.ts +40 -0
- package/foundation/Box/index.d.mts +1 -0
- package/foundation/Box/index.mjs +4 -0
- package/foundation/Box-es.js +130 -0
- package/foundation/Button/Button.d.ts +17 -0
- package/foundation/Button/Button.types.d.ts +112 -0
- package/foundation/Button/ButtonInternals.d.ts +11 -0
- package/foundation/Button/ButtonProvider.d.ts +11 -0
- package/foundation/Button/index.d.mts +4 -0
- package/foundation/Button/useButtonStyles.d.ts +17 -0
- package/foundation/Button-es.js +122 -0
- package/foundation/ButtonDismiss/ButtonDismiss.d.ts +6 -0
- package/foundation/ButtonDismiss/index.d.mts +1 -0
- package/foundation/ButtonDismiss-es.js +9 -0
- package/foundation/Card/Card.d.ts +78 -0
- package/foundation/Card/cardcolors.module.d.ts +90 -0
- package/foundation/Card/index.d.mts +1 -0
- package/foundation/Card/index.mjs +37 -0
- package/foundation/Card/types.d.ts +63 -0
- package/foundation/Card-es.js +138 -0
- package/foundation/Checkbox/Checkbox.d.ts +7 -0
- package/foundation/Checkbox/Checkbox.types.d.ts +51 -0
- package/foundation/Checkbox/index.d.mts +2 -0
- package/foundation/Checkbox/index.mjs +8 -0
- package/foundation/Checkbox-es.js +57 -0
- package/foundation/Chip/Chip.d.ts +14 -0
- package/foundation/Chip/Chip.types.d.ts +70 -0
- package/foundation/Chip/components/ChipDismissible/ChipDismissible.d.ts +3 -0
- package/foundation/Chip/components/ChipPrefix/Chip.Prefix.d.ts +3 -0
- package/foundation/Chip/components/ChipSelectable/ChipSelectable.d.ts +3 -0
- package/foundation/Chip/components/ChipSuffix/Chip.Suffix.d.ts +9 -0
- package/foundation/Chip/index.d.mts +4 -0
- package/foundation/Chip/index.mjs +19 -0
- package/foundation/Chip-es.js +165 -0
- package/foundation/ChipDismissible-es.js +19 -0
- package/foundation/Chips/Chip.d.ts +9 -0
- package/foundation/Chips/ChipDismissible.d.ts +11 -0
- package/foundation/Chips/ChipTypes.d.ts +59 -0
- package/foundation/Chips/Chips.d.ts +8 -0
- package/foundation/Chips/ChipsTypes.d.ts +106 -0
- package/foundation/Chips/InternalChipButton.d.ts +11 -0
- package/foundation/Chips/index.d.mts +3 -0
- package/foundation/Chips/index.mjs +56 -0
- package/foundation/Chips-es.js +114 -0
- package/foundation/Cluster/Cluster.d.ts +3 -0
- package/foundation/Cluster/index.d.mts +2 -0
- package/foundation/Cluster/index.mjs +4 -0
- package/foundation/Cluster/types.d.ts +47 -0
- package/foundation/Cluster-es.js +12 -0
- package/foundation/Combobox/Combobox.d.ts +71 -0
- package/foundation/Combobox/Combobox.footer.d.ts +7 -0
- package/foundation/Combobox/Combobox.items.d.ts +25 -0
- package/foundation/Combobox/Combobox.selectAll.d.ts +4 -0
- package/foundation/Combobox/Combobox.slotFactory.d.ts +7 -0
- package/foundation/Combobox/Combobox.types.d.ts +168 -0
- package/foundation/Combobox/index.d.mts +2 -0
- package/foundation/Combobox/index.mjs +28 -0
- package/foundation/Combobox-es.js +782 -0
- package/foundation/ComboboxPrimitive-es.js +187 -0
- package/foundation/ComboboxSeparator-es.js +3541 -0
- package/foundation/ComponentSettingsContext/ComponentSettingsContext.d.ts +41 -0
- package/foundation/ComponentSettingsContext/index.d.mts +4 -0
- package/foundation/ComponentSettingsContext/index.mjs +5 -0
- package/foundation/ComponentSettingsContext-es.js +18 -0
- package/foundation/ConfirmationModal/ConfirmationModal.d.ts +79 -0
- package/foundation/ConfirmationModal/index.d.mts +1 -0
- package/foundation/ConfirmationModal/index.mjs +37 -0
- package/foundation/ConfirmationModal-es.js +111 -0
- package/foundation/Container/Container.d.ts +6 -0
- package/foundation/Container/index.d.mts +1 -0
- package/foundation/Container/index.mjs +3 -0
- package/foundation/Container/types.d.ts +22 -0
- package/foundation/Container-es.js +16 -0
- package/foundation/Content/Content.d.ts +22 -0
- package/foundation/Content/Spacing.module.d.ts +14 -0
- package/foundation/Content/index.d.mts +1 -0
- package/foundation/Content/index.mjs +3 -0
- package/foundation/Content-es.js +13 -0
- package/foundation/ContentBlock/ContentBlock.d.ts +3 -0
- package/foundation/ContentBlock/index.d.mts +2 -0
- package/foundation/ContentBlock/index.mjs +4 -0
- package/foundation/ContentBlock/types.d.ts +37 -0
- package/foundation/ContentBlock-es.js +29 -0
- package/foundation/Countdown/Countdown.d.ts +30 -0
- package/foundation/Countdown/index.d.mts +1 -0
- package/foundation/Countdown/index.mjs +4 -0
- package/foundation/Countdown-es.js +649 -0
- package/foundation/Cover/Cover.d.ts +6 -0
- package/foundation/Cover/index.d.mts +2 -0
- package/foundation/Cover/index.mjs +4 -0
- package/foundation/Cover/types.d.ts +34 -0
- package/foundation/Cover-es.js +14 -0
- package/foundation/DataDump/DataDump.d.ts +21 -0
- package/foundation/DataDump/index.d.mts +1 -0
- package/foundation/DataDump/index.mjs +40 -0
- package/foundation/DataDump-es.js +26 -0
- package/foundation/DataList/DataList.const.d.ts +22 -0
- package/foundation/DataList/DataList.d.ts +28 -0
- package/foundation/DataList/DataList.types.d.ts +323 -0
- package/foundation/DataList/components/DataListAction/DataListAction.d.ts +3 -0
- package/foundation/DataList/components/DataListAction/index.d.mts +1 -0
- package/foundation/DataList/components/DataListBulkActions/DataListBulkActions.d.ts +4 -0
- package/foundation/DataList/components/DataListBulkActions/index.d.mts +1 -0
- package/foundation/DataList/components/DataListEmptyState/DataListEmptyState.d.ts +4 -0
- package/foundation/DataList/components/DataListEmptyState/index.d.mts +1 -0
- package/foundation/DataList/components/DataListFilters/DataListFilters.d.ts +11 -0
- package/foundation/DataList/components/DataListFilters/index.d.mts +1 -0
- package/foundation/DataList/components/DataListItemActions/DataListItemActions.d.ts +9 -0
- package/foundation/DataList/components/DataListItemActions/index.d.mts +1 -0
- package/foundation/DataList/components/DataListLayout/DataListLayout.d.ts +3 -0
- package/foundation/DataList/components/DataListLayout/index.d.mts +1 -0
- package/foundation/DataList/components/DataListLayoutActions/DataListLayoutActions.d.ts +2 -0
- package/foundation/DataList/components/DataListLayoutActions/index.d.mts +1 -0
- package/foundation/DataList/components/DataListSearch/DataListSearch.d.ts +8 -0
- package/foundation/DataList/components/DataListSearch/index.d.mts +1 -0
- package/foundation/DataList/components/DataListStatusBar/DataListStatusBar.d.ts +11 -0
- package/foundation/DataList/components/DataListStatusBar/index.d.mts +1 -0
- package/foundation/DataList/index.d.mts +2 -0
- package/foundation/DataList/index.mjs +96 -0
- package/foundation/DataList-es.js +141 -0
- package/foundation/DataList.const-es.js +26 -0
- package/foundation/DataList.module-es.js +3 -0
- package/foundation/DataList.utils-es.js +167 -0
- package/foundation/DataListAction-es.js +43 -0
- package/foundation/DataListActions-es.js +53 -0
- package/foundation/DataListActionsMenu-es.js +52 -0
- package/foundation/DataListBulkActions-es.js +28 -0
- package/foundation/DataListContext-es.js +26 -0
- package/foundation/DataListEmptyState-es.js +54 -0
- package/foundation/DataListFilters-es.js +43 -0
- package/foundation/DataListHeader-es.js +130 -0
- package/foundation/DataListHeaderTile-es.js +86 -0
- package/foundation/DataListItem-es.js +118 -0
- package/foundation/DataListItemActions-es.js +29 -0
- package/foundation/DataListItemActionsOverflow-es.js +34 -0
- package/foundation/DataListItemClickable-es.js +45 -0
- package/foundation/DataListItems-es.js +19 -0
- package/foundation/DataListLayout-es.js +19 -0
- package/foundation/DataListLayoutActions-es.js +36 -0
- package/foundation/DataListLayoutContext-es.js +14 -0
- package/foundation/DataListLayoutContext-es2.js +8 -0
- package/foundation/DataListLoadMore-es.js +32 -0
- package/foundation/DataListLoadingState-es.js +22 -0
- package/foundation/DataListOverflowFade-es.js +22 -0
- package/foundation/DataListSearch-es.js +84 -0
- package/foundation/DataListSort-es.js +74 -0
- package/foundation/DataListSortingOptions-es.js +34 -0
- package/foundation/DataListStatusBar-es.js +22 -0
- package/foundation/DataListStickyHeader-es.js +23 -0
- package/foundation/DataListTags-es.js +62 -0
- package/foundation/DataListTotalCount-es.js +38 -0
- package/foundation/DataTable/DataTable.d.ts +74 -0
- package/foundation/DataTable/SortIcon.d.ts +11 -0
- package/foundation/DataTable/components/DataTableActions.d.ts +2 -0
- package/foundation/DataTable/components/DataTableBody.d.ts +2 -0
- package/foundation/DataTable/components/DataTableCell.d.ts +2 -0
- package/foundation/DataTable/components/DataTableContainer.d.ts +2 -0
- package/foundation/DataTable/components/DataTableFooter.d.ts +5 -0
- package/foundation/DataTable/components/DataTableHeader.d.ts +2 -0
- package/foundation/DataTable/components/DataTableHeaderCell.d.ts +5 -0
- package/foundation/DataTable/components/DataTablePagination.d.ts +5 -0
- package/foundation/DataTable/components/DataTablePaginationButton.d.ts +21 -0
- package/foundation/DataTable/components/DataTableRow.d.ts +2 -0
- package/foundation/DataTable/components/DataTableRowActions.d.ts +4 -0
- package/foundation/DataTable/components/DataTableSortableHeader.d.ts +24 -0
- package/foundation/DataTable/components/DataTableTable.d.ts +11 -0
- package/foundation/DataTable/components/index.d.mts +13 -0
- package/foundation/DataTable/index.d.mts +6 -0
- package/foundation/DataTable/index.mjs +29 -0
- package/foundation/DataTable/test-utilities/helpers.d.ts +1 -0
- package/foundation/DataTable/types.d.ts +83 -0
- package/foundation/DataTable-es.js +262 -0
- package/foundation/DataTableTable-es.js +117 -0
- package/foundation/DatePicker/DatePicker.d.ts +74 -0
- package/foundation/DatePicker/DatePickerActivator.d.ts +18 -0
- package/foundation/DatePicker/index.d.mts +1 -0
- package/foundation/DatePicker/index.mjs +26 -0
- package/foundation/DatePicker-es.js +13627 -0
- package/foundation/Dialog/dialogReturnFocus.d.ts +43 -0
- package/foundation/Disclosure/Disclosure.d.ts +68 -0
- package/foundation/Disclosure/index.d.mts +1 -0
- package/foundation/Disclosure/index.mjs +7 -0
- package/foundation/Disclosure-es.js +46 -0
- package/foundation/Divider/Divider.d.ts +39 -0
- package/foundation/Divider/DividerDirections.module.d.ts +6 -0
- package/foundation/Divider/DividerSizes.module.d.ts +8 -0
- package/foundation/Divider/index.d.mts +1 -0
- package/foundation/Divider/index.mjs +3 -0
- package/foundation/Divider-es.js +15 -0
- package/foundation/Drawer/Drawer.d.ts +14 -0
- package/foundation/Drawer/DrawerGrid.d.ts +7 -0
- package/foundation/Drawer/index.d.mts +2 -0
- package/foundation/Drawer/index.mjs +13 -0
- package/foundation/DrawerGrid-es.js +39 -0
- package/foundation/DrawerTitle-es.js +90 -0
- package/foundation/Emphasis/Emphasis.d.ts +12 -0
- package/foundation/Emphasis/index.d.mts +1 -0
- package/foundation/Emphasis/index.mjs +4 -0
- package/foundation/Emphasis-es.js +13 -0
- package/foundation/FeatureSwitch/FeatureSwitch.d.ts +52 -0
- package/foundation/FeatureSwitch/index.d.mts +1 -0
- package/foundation/FeatureSwitch/index.mjs +20 -0
- package/foundation/FeatureSwitch-es.js +66 -0
- package/foundation/FieldDescription-es.js +859 -0
- package/foundation/FilterPicker/FilterPicker.d.ts +11 -0
- package/foundation/FilterPicker/FilterPicker.types.d.ts +282 -0
- package/foundation/FilterPicker/FilterPickerProvider.d.ts +18 -0
- package/foundation/FilterPicker/components/FilterPickerAction/FilterPickerAction.d.ts +3 -0
- package/foundation/FilterPicker/components/FilterPickerAction/index.d.mts +1 -0
- package/foundation/FilterPicker/components/FilterPickerActivator/FilterPickerActivator.d.ts +3 -0
- package/foundation/FilterPicker/components/FilterPickerActivator/index.d.mts +1 -0
- package/foundation/FilterPicker/components/FilterPickerOption/FilterPickerOption.d.ts +3 -0
- package/foundation/FilterPicker/index.d.mts +3 -0
- package/foundation/FilterPicker/index.mjs +49 -0
- package/foundation/FilterPicker-es.js +110 -0
- package/foundation/FilterPicker.messages-es.js +56 -0
- package/foundation/FilterPickerAction-es.js +30 -0
- package/foundation/FilterPickerActivator-es.js +36 -0
- package/foundation/FilterPickerContent-es.js +180 -0
- package/foundation/FilterPickerContentHeader-es.js +23 -0
- package/foundation/FilterPickerContentList-es.js +74 -0
- package/foundation/FilterPickerContentSearch-es.js +35 -0
- package/foundation/FilterPickerLoadMore-es.js +14 -0
- package/foundation/FilterPickerOption-es.js +29 -0
- package/foundation/FilterPickerProvider-es.js +10 -0
- package/foundation/FilterPickerTrigger-es.js +19 -0
- package/foundation/Flex/Flex.d.ts +33 -0
- package/foundation/Flex/Flex.types.d.ts +6 -0
- package/foundation/Flex/index.d.mts +1 -0
- package/foundation/Flex/index.mjs +3 -0
- package/foundation/Flex-es.js +28 -0
- package/foundation/FormField/FormFieldAffix.d.ts +19 -0
- package/foundation/FormField/FormFieldTypes.d.ts +185 -0
- package/foundation/FormField/FormFieldWrapper.d.ts +57 -0
- package/foundation/FormField/hooks/useFormFieldName.d.ts +6 -0
- package/foundation/FormField/hooks/useFormFieldWrapperStyles.d.ts +35 -0
- package/foundation/FormField/index.d.mts +5 -0
- package/foundation/FormField/index.mjs +17 -0
- package/foundation/FormFieldPostFix-es.js +13 -0
- package/foundation/FormFieldWrapper-es.js +233 -0
- package/foundation/FormatFile/FormatFile.d.ts +42 -0
- package/foundation/FormatFile/index.d.mts +4 -0
- package/foundation/FormatFile/index.mjs +42 -0
- package/foundation/FormatFile/types.d.ts +27 -0
- package/foundation/FormatFile/useFormatFile.d.ts +5 -0
- package/foundation/FormatFile/useFormatFileStyles.d.ts +10 -0
- package/foundation/FormatFile-es.js +137 -0
- package/foundation/Frame/Frame.d.ts +3 -0
- package/foundation/Frame/index.d.mts +2 -0
- package/foundation/Frame/index.mjs +3 -0
- package/foundation/Frame/types.d.ts +24 -0
- package/foundation/Frame-es.js +10 -0
- package/foundation/Gallery/Gallery.d.ts +3 -0
- package/foundation/Gallery/GalleryTypes.d.ts +36 -0
- package/foundation/Gallery/index.d.mts +3 -0
- package/foundation/Gallery/index.mjs +64 -0
- package/foundation/Gallery-es.js +88 -0
- package/foundation/Glimmer/Glimmer.d.ts +71 -0
- package/foundation/Glimmer/index.d.mts +1 -0
- package/foundation/Glimmer/index.mjs +5 -0
- package/foundation/Glimmer/style/Shape.module.d.ts +9 -0
- package/foundation/Glimmer/style/Sizes.module.d.ts +10 -0
- package/foundation/Glimmer/style/Timing.module.d.ts +6 -0
- package/foundation/Glimmer-es.js +53 -0
- package/foundation/Grid/Grid.d.ts +32 -0
- package/foundation/Grid/GridAlign.module.d.ts +8 -0
- package/foundation/Grid/GridCell/GridCell.d.ts +23 -0
- package/foundation/Grid/GridCell/index.d.mts +1 -0
- package/foundation/Grid/index.d.mts +1 -0
- package/foundation/Grid/index.mjs +5 -0
- package/foundation/Grid-es.js +30 -0
- package/foundation/GridCell-es.js +34 -0
- package/foundation/Heading/Heading.d.ts +41 -0
- package/foundation/Heading/index.d.mts +2 -0
- package/foundation/Heading/index.mjs +4 -0
- package/foundation/Heading-es.js +55 -0
- package/foundation/HelperText-es.js +19 -0
- package/foundation/Icon/Icon.d.ts +47 -0
- package/foundation/Icon/index.d.mts +1 -0
- package/foundation/Icon-es.js +22 -0
- package/foundation/InlineLabel/InlineLabel.d.ts +18 -0
- package/foundation/InlineLabel/index.d.mts +1 -0
- package/foundation/InlineLabel/index.mjs +4 -0
- package/foundation/InlineLabel-es.js +19 -0
- package/foundation/InputAvatar/InputAvatar.d.ts +23 -0
- package/foundation/InputAvatar/index.d.mts +1 -0
- package/foundation/InputAvatar/index.mjs +22 -0
- package/foundation/InputAvatar-es.js +64 -0
- package/foundation/InputDate/InputDate.d.ts +3 -0
- package/foundation/InputDate/InputDate.types.d.ts +36 -0
- package/foundation/InputDate/index.d.mts +2 -0
- package/foundation/InputDate/index.mjs +39 -0
- package/foundation/InputDate-es.js +104 -0
- package/foundation/InputEmail/InputEmail.d.ts +3 -0
- package/foundation/InputEmail/InputEmail.types.d.ts +16 -0
- package/foundation/InputEmail/index.d.mts +2 -0
- package/foundation/InputEmail/index.mjs +22 -0
- package/foundation/InputEmail-es.js +105 -0
- package/foundation/InputFile/FileTypes.d.ts +17 -0
- package/foundation/InputFile/InputFile.d.ts +187 -0
- package/foundation/InputFile/InputFileButton.d.ts +6 -0
- package/foundation/InputFile/InputFileContentContext.d.ts +12 -0
- package/foundation/InputFile/InputFileDescription.d.ts +4 -0
- package/foundation/InputFile/InputFileDropzoneWrapper.d.ts +4 -0
- package/foundation/InputFile/InputFileHintText.d.ts +4 -0
- package/foundation/InputFile/index.d.mts +3 -0
- package/foundation/InputFile/index.mjs +16 -0
- package/foundation/InputFile-es.js +1780 -0
- package/foundation/InputGroup/InputGroup.d.ts +12 -0
- package/foundation/InputGroup/index.d.mts +1 -0
- package/foundation/InputGroup/index.mjs +3 -0
- package/foundation/InputGroup-es.js +26 -0
- package/foundation/InputNumber/InputNumber.d.ts +77 -0
- package/foundation/InputNumber/index.d.mts +2 -0
- package/foundation/InputNumber/index.mjs +33 -0
- package/foundation/InputNumber/types.d.ts +197 -0
- package/foundation/InputNumber-es.js +348 -0
- package/foundation/InputPhoneNumber/InputPhoneNumber.d.ts +3 -0
- package/foundation/InputPhoneNumber/InputPhoneNumber.types.d.ts +24 -0
- package/foundation/InputPhoneNumber/index.d.mts +2 -0
- package/foundation/InputPhoneNumber/index.mjs +22 -0
- package/foundation/InputPhoneNumber-es.js +188 -0
- package/foundation/InputText/InputText.d.ts +3 -0
- package/foundation/InputText/InputText.types.d.ts +58 -0
- package/foundation/InputText/index.d.mts +2 -0
- package/foundation/InputText/index.mjs +23 -0
- package/foundation/InputText-es.js +196 -0
- package/foundation/InputTime/InputTime.d.ts +3 -0
- package/foundation/InputTime/InputTime.types.d.ts +34 -0
- package/foundation/InputTime/index.d.mts +2 -0
- package/foundation/InputTime/index.mjs +23 -0
- package/foundation/InputTime-es.js +297 -0
- package/foundation/InputValidation/InputValidation.d.ts +10 -0
- package/foundation/InputValidation/index.d.mts +1 -0
- package/foundation/InputValidation/index.mjs +8 -0
- package/foundation/InputValidation-es.js +22 -0
- package/foundation/InternalChipDismissible-es.js +68 -0
- package/foundation/LICENSE +21 -0
- package/foundation/LegacySelect/LegacySelect.d.ts +7 -0
- package/foundation/LegacySelect/LegacySelect.types.d.ts +18 -0
- package/foundation/LegacySelect/Option.d.ts +18 -0
- package/foundation/LegacySelect/OptionGroup.d.ts +29 -0
- package/foundation/LegacySelect/index.d.mts +3 -0
- package/foundation/LegacySelect/index.mjs +23 -0
- package/foundation/LegacySelect-es.js +76 -0
- package/foundation/LegacyThemeContext/LegacyThemeContext.d.ts +5 -0
- package/foundation/LegacyThemeContext/index.d.mts +3 -0
- package/foundation/LegacyThemeContext/index.mjs +12 -0
- package/foundation/LegacyThemeContext/types.d.ts +59 -0
- package/foundation/LegacyThemeContext/updateTheme.d.ts +7 -0
- package/foundation/LegacyThemeContext-es.js +457 -0
- package/foundation/LightBox/LightBox.d.ts +165 -0
- package/foundation/LightBox/LightBox.types.d.ts +153 -0
- package/foundation/LightBox/LightBoxContext.d.ts +5 -0
- package/foundation/LightBox/index.d.mts +3 -0
- package/foundation/LightBox/index.mjs +50 -0
- package/foundation/LightBox-es.js +454 -0
- package/foundation/Link/Link.d.ts +9 -0
- package/foundation/Link/index.d.mts +2 -0
- package/foundation/Link/index.mjs +2 -0
- package/foundation/Link-es.js +12 -0
- package/foundation/List/List.d.ts +41 -0
- package/foundation/List/ListItem.d.ts +59 -0
- package/foundation/List/index.d.mts +2 -0
- package/foundation/List/index.mjs +22 -0
- package/foundation/List-es.js +199 -0
- package/foundation/Markdown/Markdown.d.ts +24 -0
- package/foundation/Markdown/index.d.mts +1 -0
- package/foundation/Markdown/index.mjs +10 -0
- package/foundation/Markdown-es.js +20558 -0
- package/foundation/Menu/Menu.d.ts +89 -0
- package/foundation/Menu/Menu.types.d.ts +105 -0
- package/foundation/Menu/index.d.mts +2 -0
- package/foundation/Menu/index.mjs +35 -0
- package/foundation/Menu/menuComposableTypes.d.ts +103 -0
- package/foundation/Menu-es.js +1033 -0
- package/foundation/MenuSubmenuTrigger-es.js +3088 -0
- package/foundation/Modal/Modal.rebuilt.d.ts +16 -0
- package/foundation/Modal/Modal.types.d.ts +138 -0
- package/foundation/Modal/ModalContext.rebuilt.d.ts +19 -0
- package/foundation/Modal/ModalSizes.module.d.ts +7 -0
- package/foundation/Modal/index.d.mts +17 -0
- package/foundation/Modal/index.mjs +302 -0
- package/foundation/Modal/useModalStyles.d.ts +12 -0
- package/foundation/MultiSelect/MultiSelect.d.ts +30 -0
- package/foundation/MultiSelect/index.d.mts +1 -0
- package/foundation/MultiSelect/index.mjs +9 -0
- package/foundation/MultiSelect/types.d.ts +13 -0
- package/foundation/MultiSelect-es.js +172 -0
- package/foundation/OverlaySeparator-es.js +13 -0
- package/foundation/Page/Page.d.ts +74 -0
- package/foundation/Page/index.d.mts +2 -0
- package/foundation/Page/index.mjs +42 -0
- package/foundation/Page/types.d.ts +123 -0
- package/foundation/Page-es.js +196 -0
- package/foundation/Popover/Popover.d.ts +9 -0
- package/foundation/Popover/Popover.types.d.ts +109 -0
- package/foundation/Popover/PopoverContext.d.ts +18 -0
- package/foundation/Popover/index.d.mts +4 -0
- package/foundation/Popover/index.mjs +27 -0
- package/foundation/Popover/usePopoverStyles.d.ts +5 -0
- package/foundation/Popover-es.js +166 -0
- package/foundation/ProgressBar/ProgressBar.d.ts +41 -0
- package/foundation/ProgressBar/ProgressBarSizes.module.d.ts +7 -0
- package/foundation/ProgressBar/index.d.mts +1 -0
- package/foundation/ProgressBar/index.mjs +5 -0
- package/foundation/ProgressBar-es.js +48 -0
- package/foundation/ProgressIndicator/ProgressIndicator.d.ts +60 -0
- package/foundation/ProgressIndicator/index.d.mts +1 -0
- package/foundation/ProgressIndicator/index.mjs +3 -0
- package/foundation/ProgressIndicator-es.js +41 -0
- package/foundation/RadioGroup/RadioGroup.d.ts +33 -0
- package/foundation/RadioGroup/RadioOption.d.ts +48 -0
- package/foundation/RadioGroup/index.d.mts +2 -0
- package/foundation/RadioGroup/index.mjs +5 -0
- package/foundation/RadioGroup-es.js +42 -0
- package/foundation/ResponsiveSwitcher/ResponsiveSwitcher.d.ts +3 -0
- package/foundation/ResponsiveSwitcher/index.d.mts +2 -0
- package/foundation/ResponsiveSwitcher/index.mjs +4 -0
- package/foundation/ResponsiveSwitcher/types.d.ts +26 -0
- package/foundation/ResponsiveSwitcher-es.js +11 -0
- package/foundation/RulnarPortalContent-es.js +1 -0
- package/foundation/ScrollAreaViewport-es.js +3959 -0
- package/foundation/SegmentedControl/SegmentedControl.d.ts +39 -0
- package/foundation/SegmentedControl/SegmentedControlBase.d.ts +7 -0
- package/foundation/SegmentedControl/SegmentedControlOption.d.ts +15 -0
- package/foundation/SegmentedControl/SegmentedControlProvider.d.ts +17 -0
- package/foundation/SegmentedControl/index.d.mts +2 -0
- package/foundation/SegmentedControl/index.mjs +3 -0
- package/foundation/SegmentedControl-es.js +64 -0
- package/foundation/Select/Select.d.ts +31 -0
- package/foundation/Select/Select.types.d.ts +145 -0
- package/foundation/Select/index.d.mts +2 -0
- package/foundation/Select/index.mjs +29 -0
- package/foundation/Select-es.js +227 -0
- package/foundation/SelectGroupLabel-es.js +1763 -0
- package/foundation/SelectPrimitive-es.js +126 -0
- package/foundation/Separator-es.js +33 -0
- package/foundation/SideDrawer/SideDrawer.d.ts +56 -0
- package/foundation/SideDrawer/SideDrawerActions.d.ts +3 -0
- package/foundation/SideDrawer/SideDrawerBackButton.d.ts +3 -0
- package/foundation/SideDrawer/SideDrawerFooter.d.ts +3 -0
- package/foundation/SideDrawer/SideDrawerTitle.d.ts +3 -0
- package/foundation/SideDrawer/SideDrawerToolbar.d.ts +2 -0
- package/foundation/SideDrawer/index.d.mts +1 -0
- package/foundation/SideDrawer/index.mjs +16 -0
- package/foundation/SideDrawer-es.js +198 -0
- package/foundation/SideKick/SideKick.d.ts +3 -0
- package/foundation/SideKick/index.d.mts +2 -0
- package/foundation/SideKick/index.mjs +4 -0
- package/foundation/SideKick/types.d.ts +35 -0
- package/foundation/SideKick-es.js +15 -0
- package/foundation/Spinner/Spinner.d.ts +22 -0
- package/foundation/Spinner/index.d.mts +1 -0
- package/foundation/Spinner/index.mjs +6 -0
- package/foundation/Spinner-es.js +21 -0
- package/foundation/Stack/Stack.d.ts +3 -0
- package/foundation/Stack/index.d.mts +2 -0
- package/foundation/Stack/index.mjs +4 -0
- package/foundation/Stack/types.d.ts +32 -0
- package/foundation/Stack-es.js +13 -0
- package/foundation/StatusIndicator/StatusIndicator.d.ts +7 -0
- package/foundation/StatusIndicator/StatusIndicator.type.d.ts +1 -0
- package/foundation/StatusIndicator/index.d.mts +2 -0
- package/foundation/StatusIndicator/index.mjs +2 -0
- package/foundation/StatusIndicator-es.js +9 -0
- package/foundation/StatusLabel/StatusLabel.d.ts +26 -0
- package/foundation/StatusLabel/index.d.mts +1 -0
- package/foundation/StatusLabel/index.mjs +5 -0
- package/foundation/StatusLabel-es.js +16 -0
- package/foundation/Table/Body.d.ts +7 -0
- package/foundation/Table/Cells/Cell.d.ts +8 -0
- package/foundation/Table/Cells/CellCurrency.d.ts +9 -0
- package/foundation/Table/Cells/CellNumeric.d.ts +5 -0
- package/foundation/Table/Footer.d.ts +7 -0
- package/foundation/Table/Header.d.ts +7 -0
- package/foundation/Table/Row.d.ts +7 -0
- package/foundation/Table/Table.d.ts +7 -0
- package/foundation/Table/index.d.mts +8 -0
- package/foundation/Table/index.mjs +4 -0
- package/foundation/Tabs/Tabs.d.ts +38 -0
- package/foundation/Tabs/index.d.mts +1 -0
- package/foundation/Tabs/index.mjs +8 -0
- package/foundation/Tabs-es.js +227 -0
- package/foundation/Text/Text.d.ts +29 -0
- package/foundation/Text/index.d.mts +2 -0
- package/foundation/Text/index.mjs +4 -0
- package/foundation/Text-es.js +25 -0
- package/foundation/Thumbnail/Thumbnail.d.ts +25 -0
- package/foundation/Thumbnail/index.d.mts +1 -0
- package/foundation/Thumbnail/index.mjs +9 -0
- package/foundation/Thumbnail-es.js +119 -0
- package/foundation/Tiles/Tiles.d.ts +3 -0
- package/foundation/Tiles/index.d.mts +2 -0
- package/foundation/Tiles/index.mjs +4 -0
- package/foundation/Tiles/types.d.ts +34 -0
- package/foundation/Tiles-es.js +11 -0
- package/foundation/Tooltip/Tooltip.d.ts +18 -0
- package/foundation/Tooltip/Tooltip.types.d.ts +1 -0
- package/foundation/Tooltip/index.d.mts +1 -0
- package/foundation/Tooltip/index.mjs +8 -0
- package/foundation/Tooltip-es.js +137 -0
- package/foundation/Typography/Typography.d.ts +64 -0
- package/foundation/Typography/css/Emphasis.module.d.ts +6 -0
- package/foundation/Typography/css/FontFamilies.module.d.ts +6 -0
- package/foundation/Typography/css/FontSizes.module.d.ts +12 -0
- package/foundation/Typography/css/FontWeights.module.d.ts +10 -0
- package/foundation/Typography/css/TextAlignment.module.d.ts +7 -0
- package/foundation/Typography/css/TextCases.module.d.ts +8 -0
- package/foundation/Typography/css/TextColors.module.d.ts +69 -0
- package/foundation/Typography/index.d.mts +1 -0
- package/foundation/Typography/index.mjs +3 -0
- package/foundation/Typography/types.d.ts +7 -0
- package/foundation/Typography-es.js +53 -0
- package/foundation/_baseAssignValue-es.js +29 -0
- package/foundation/_baseEach-es.js +1028 -0
- package/foundation/_baseFlatten-es.js +65 -0
- package/foundation/_baseFor-es.js +45 -0
- package/foundation/_commonjsHelpers-es.js +7 -0
- package/foundation/_getAllKeys-es.js +506 -0
- package/foundation/_getTag-es.js +133 -0
- package/foundation/_isIterateeCall-es.js +55 -0
- package/foundation/_setToString-es.js +168 -0
- package/foundation/buttonRenderAdapter-es.js +52 -0
- package/foundation/buttonStyles.d.mts +1 -0
- package/foundation/buttonStyles.mjs +1 -0
- package/foundation/clearable.d.ts +1 -0
- package/foundation/common.messages-es.js +18 -0
- package/foundation/compatHooks.mjs +2 -0
- package/foundation/constants-es.js +3 -0
- package/foundation/dateLocale-es.js +1142 -0
- package/foundation/debounce-es.js +329 -0
- package/foundation/dialogFocus.d.mts +1 -0
- package/foundation/dialogFocus.mjs +66 -0
- package/foundation/filterDataAttributes-es.js +24 -0
- package/foundation/floating-ui.react-es.js +6174 -0
- package/foundation/getMappedSpaceToken-es.js +18 -0
- package/foundation/helpers-es.js +15 -0
- package/foundation/identity-es.js +809 -0
- package/foundation/imageTypes.d.mts +1 -0
- package/foundation/imageTypes.mjs +1 -0
- package/foundation/index-es.js +1186 -0
- package/foundation/isObjectLike-es.js +190 -0
- package/foundation/isSymbol-es.js +33 -0
- package/foundation/isTypedArray-es.js +589 -0
- package/foundation/keysIn-es.js +385 -0
- package/foundation/linkEvents.d.mts +1 -0
- package/foundation/linkEvents.mjs +9 -0
- package/foundation/maxHeight-es.js +22 -0
- package/foundation/mergeClassName-es.js +10 -0
- package/foundation/mergeRefs-es.js +18 -0
- package/foundation/nestedEscape-es.js +91 -0
- package/foundation/noop-es.js +24 -0
- package/foundation/primitives/BottomSheet/BottomSheet.d.ts +37 -0
- package/foundation/primitives/BottomSheet/BottomSheet.types.d.ts +36 -0
- package/foundation/primitives/BottomSheet/index.d.mts +2 -0
- package/foundation/primitives/ComboboxPrimitive/ComboboxPrimitive.d.ts +32 -0
- package/foundation/primitives/ComboboxPrimitive/ComboboxPrimitive.types.d.ts +30 -0
- package/foundation/primitives/ComboboxPrimitive/index.d.mts +2 -0
- package/foundation/primitives/HelperText/HelperText.d.ts +25 -0
- package/foundation/primitives/HelperText/index.d.mts +1 -0
- package/foundation/primitives/OverlaySeparator/OverlaySeparator.d.ts +6 -0
- package/foundation/primitives/OverlaySeparator/index.d.mts +1 -0
- package/foundation/primitives/SelectPrimitive/SelectPrimitive.d.ts +74 -0
- package/foundation/primitives/SelectPrimitive/index.d.mts +2 -0
- package/foundation/primitives/SelectPrimitive/types.d.ts +31 -0
- package/foundation/primitives/index.d.mts +12 -0
- package/foundation/primitives/index.mjs +29 -0
- package/foundation/routerLink.d.mts +3 -0
- package/foundation/routerLink.mjs +1 -0
- package/foundation/scrollEdges-es.js +64 -0
- package/foundation/scrollable-es.js +54 -0
- package/foundation/sharedHelpers/getMappedBreakpointWidth.d.ts +8 -0
- package/foundation/sharedHelpers/types.d.ts +254 -0
- package/foundation/stringifyLocale-es.js +11 -0
- package/foundation/styles.css +16646 -0
- package/foundation/tslib.es6-es.js +97 -0
- package/foundation/unstyledPrimitives/index.d.mts +22 -0
- package/foundation/useActiveLayout-es.js +14 -0
- package/foundation/useBatchSelect-es.js +36 -0
- package/foundation/useChildComponent-es.js +15 -0
- package/foundation/useComponentMessages-es.js +86 -0
- package/foundation/useCompositeListItem-es.js +3955 -0
- package/foundation/useFormFieldFocus-es.js +37 -0
- package/foundation/useFormFieldName-es.js +11 -0
- package/foundation/useLabel-es.js +81 -0
- package/foundation/useRenderElement-es.js +628 -0
- package/foundation/useResponsiveSizing-es.js +8 -0
- package/foundation/useScrollLock-es.js +5746 -0
- package/foundation/useScrollToActive-es.js +581 -0
- package/foundation/utils/isNormalClick.d.ts +6 -0
- package/foundation/utils/isPreviewableImage.d.ts +1 -0
- package/foundation/utils/meta/meta.json +298 -0
- package/foundation.css +67 -0
- package/package.json +540 -4
- package/src/styles.css +181 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ZJ Dynamics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE.react-is
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Facebook, Inc. and its affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/NOTICE.tabbable
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 David Clark
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @zj-dynamics/components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React 19 web components for the first Rulnar slice. Import the package stylesheet once in your consumer. Button, InputText and Dialog also have named subpath exports.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import {Button, Dialog, InputText, ThemeProvider} from '@zj-dynamics/components';
|
|
7
|
+
import '@zj-dynamics/components/styles.css';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Use `ThemeProvider` with a brand from `@zj-dynamics/design`. `mode` controls the selected appearance and `defaultMode` initializes it. `useTheme` exposes the selected and effective modes. The provider applies the nearest brand, mode and overrides to Dialog portals.
|
|
11
|
+
|
|
12
|
+
The first slice supports labeled single-line controlled input, buttons for the editing flow, and ordinary and alert dialogs. Compose the dialog from Trigger, Content, Header, Title, Body, Footer, Close and Actions. The local Storybook stories show a fully connected example. Additional frozen capabilities and legacy adapters remain in the parity backlog.
|
|
13
|
+
|
|
14
|
+
## Foundations
|
|
15
|
+
|
|
16
|
+
Import `@zj-dynamics/components/foundation.css` alongside the Rulnar theme provider for layout, typography, loading and status primitives. This stylesheet includes the matching frozen theme rules and local Inter and Poppins assets from the locked OFL font packages. Use the root entry point or the component leaf, for example `@zj-dynamics/components/Box`.
|
|
17
|
+
|
|
18
|
+
The first-slice stylesheet remains available separately at `@zj-dynamics/components/styles.css`.
|
|
19
|
+
|
|
20
|
+
The `@zj-dynamics/components/unstyledPrimitives` entry point provides the pinned Base UI primitives. Use it for custom compositions. The root entry point retains the styled Rulnar components.
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
The MIT license in `LICENSE` applies to Rulnar-owned code. Third-party materials retain their accompanying licenses and notices.
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, CSSProperties, MouseEvent, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { IconProps } from './Icon.js';
|
|
3
|
+
import type { TypographyProps } from '../foundation/Typography/Typography.js';
|
|
4
|
+
import type { UseButtonStylesProps } from '../foundation/Button/useButtonStyles.js';
|
|
5
|
+
export type { ButtonFoundationProps, ButtonWithChildrenProps, ButtonWithoutChildrenProps, HTMLButtonType } from '../foundation/Button/Button.types.js';
|
|
6
|
+
export type { UseButtonStylesProps } from '../foundation/Button/useButtonStyles.js';
|
|
7
|
+
export type ButtonVariation = 'work' | 'learning' | 'subtle' | 'destructive';
|
|
8
|
+
export type ButtonSize = 'small' | 'base' | 'large';
|
|
9
|
+
export type ButtonType = 'primary' | 'secondary' | 'tertiary';
|
|
10
|
+
interface ButtonOptions {
|
|
11
|
+
type?: ButtonType;
|
|
12
|
+
variation?: ButtonVariation;
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
ariaControls?: string;
|
|
18
|
+
ariaExpanded?: boolean;
|
|
19
|
+
ariaHaspopup?: boolean;
|
|
20
|
+
UNSAFE_className?: {
|
|
21
|
+
container?: string;
|
|
22
|
+
buttonLabel?: TypographyProps['UNSAFE_className'];
|
|
23
|
+
buttonIcon?: IconProps['UNSAFE_className'];
|
|
24
|
+
};
|
|
25
|
+
UNSAFE_style?: {
|
|
26
|
+
container?: CSSProperties;
|
|
27
|
+
buttonLabel?: TypographyProps['UNSAFE_style'];
|
|
28
|
+
buttonIcon?: IconProps['UNSAFE_style'];
|
|
29
|
+
};
|
|
30
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
31
|
+
onMouseDown?: (event: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;
|
|
32
|
+
}
|
|
33
|
+
type ButtonContent = {
|
|
34
|
+
label: string;
|
|
35
|
+
icon?: IconProps['name'];
|
|
36
|
+
iconOnRight?: boolean;
|
|
37
|
+
children?: never;
|
|
38
|
+
} | {
|
|
39
|
+
label?: never;
|
|
40
|
+
icon: IconProps['name'];
|
|
41
|
+
iconOnRight?: boolean;
|
|
42
|
+
ariaLabel: string;
|
|
43
|
+
children?: never;
|
|
44
|
+
} | {
|
|
45
|
+
label?: never;
|
|
46
|
+
icon?: never;
|
|
47
|
+
iconOnRight?: never;
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
type RouteTarget = string | Partial<{
|
|
51
|
+
pathname: string;
|
|
52
|
+
search: string;
|
|
53
|
+
hash: string;
|
|
54
|
+
}>;
|
|
55
|
+
type NativeButton = Omit<ComponentPropsWithoutRef<'button'>, 'type' | 'children' | 'onClick' | 'onMouseDown'> & {
|
|
56
|
+
ref?: Ref<HTMLButtonElement>;
|
|
57
|
+
submit?: boolean;
|
|
58
|
+
url?: never;
|
|
59
|
+
to?: never;
|
|
60
|
+
external?: never;
|
|
61
|
+
};
|
|
62
|
+
type LinkButton = Omit<ComponentPropsWithoutRef<'a'>, 'type' | 'children' | 'onClick' | 'onMouseDown' | 'href'> & {
|
|
63
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
64
|
+
external?: boolean;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
submit?: never;
|
|
67
|
+
} & ({
|
|
68
|
+
url: string;
|
|
69
|
+
to?: never;
|
|
70
|
+
} | {
|
|
71
|
+
url?: never;
|
|
72
|
+
to: RouteTarget;
|
|
73
|
+
});
|
|
74
|
+
export type ButtonProps = ButtonContent & ButtonOptions & (NativeButton | LinkButton);
|
|
75
|
+
export declare function useButtonContext(): {
|
|
76
|
+
size: ButtonSize;
|
|
77
|
+
};
|
|
78
|
+
export declare function useButtonStyles(props: UseButtonStylesProps): {
|
|
79
|
+
wrapper: string;
|
|
80
|
+
children: string;
|
|
81
|
+
combined: string;
|
|
82
|
+
};
|
|
83
|
+
declare function ButtonRoot({ label, children, icon, iconOnRight, type, variation, size, fullWidth, loading, disabled, ariaLabel, ariaControls, ariaExpanded, ariaHaspopup, className, style, onClick, onMouseDown, UNSAFE_className, UNSAFE_style, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
84
|
+
type ButtonLabelProps = Omit<TypographyProps, 'textColor' | 'children'> & ComponentPropsWithoutRef<'span'>;
|
|
85
|
+
declare function Label({ className, style, children, id, size, element, fontWeight, fontFamily, align, textCase, emphasisType, numberOfLines, underline, UNSAFE_className, UNSAFE_style, ...props }: ButtonLabelProps): import("react").JSX.Element;
|
|
86
|
+
declare function ButtonIcon(props: IconProps | ComponentPropsWithoutRef<'span'>): import("react").JSX.Element;
|
|
87
|
+
export declare const Button: typeof ButtonRoot & {
|
|
88
|
+
Label: typeof Label;
|
|
89
|
+
Icon: typeof ButtonIcon;
|
|
90
|
+
};
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button as BaseButton } from '@base-ui/react/button';
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
import { RouterLink } from '../foundation/routerLink.mjs';
|
|
5
|
+
import { Icon as Artwork } from './Icon.js';
|
|
6
|
+
import { Typography } from '../foundation/Typography/index.mjs';
|
|
7
|
+
import { useButtonStyles as useFrozenButtonStyles } from '../foundation/buttonStyles.mjs';
|
|
8
|
+
const ButtonSizeContext = createContext('base');
|
|
9
|
+
export function useButtonContext() {
|
|
10
|
+
return { size: useContext(ButtonSizeContext) };
|
|
11
|
+
}
|
|
12
|
+
export function useButtonStyles(props) {
|
|
13
|
+
const { size } = useButtonContext();
|
|
14
|
+
return useFrozenButtonStyles({ ...props, size: props.size ?? size });
|
|
15
|
+
}
|
|
16
|
+
function ButtonRoot({ label, children, icon, iconOnRight, type = 'primary', variation = 'work', size = 'base', fullWidth, loading, disabled, ariaLabel, ariaControls, ariaExpanded, ariaHaspopup, className, style, onClick, onMouseDown, UNSAFE_className, UNSAFE_style, ...rest }) {
|
|
17
|
+
const common = {
|
|
18
|
+
'aria-label': ariaLabel ?? rest['aria-label'],
|
|
19
|
+
'aria-controls': ariaControls ?? rest['aria-controls'],
|
|
20
|
+
'aria-expanded': ariaExpanded ?? rest['aria-expanded'],
|
|
21
|
+
'aria-haspopup': ariaHaspopup ?? rest['aria-haspopup'],
|
|
22
|
+
'aria-busy': loading || undefined,
|
|
23
|
+
'data-variation': variation, 'data-kind': type, 'data-size': size, 'data-wide': fullWidth || undefined,
|
|
24
|
+
className: ['rulnar-button', UNSAFE_className?.container, className].filter(Boolean).join(' '),
|
|
25
|
+
style: UNSAFE_style?.container ? { ...style, ...UNSAFE_style.container } : style,
|
|
26
|
+
};
|
|
27
|
+
const glyph = icon && _jsx(ButtonIcon, { name: icon, size: size === 'large' ? 'base' : size, ...(UNSAFE_className?.buttonIcon && { UNSAFE_className: UNSAFE_className.buttonIcon }), ...(UNSAFE_style?.buttonIcon && { UNSAFE_style: UNSAFE_style.buttonIcon }) });
|
|
28
|
+
const text = label && _jsx(Label, { ...(UNSAFE_className?.buttonLabel && { UNSAFE_className: UNSAFE_className.buttonLabel }), ...(UNSAFE_style?.buttonLabel && { UNSAFE_style: UNSAFE_style.buttonLabel }), children: label });
|
|
29
|
+
const content = _jsx(ButtonSizeContext.Provider, { value: size, children: children ?? _jsxs(_Fragment, { children: [!iconOnRight && glyph, text, iconOnRight && glyph] }) });
|
|
30
|
+
if (rest.url !== undefined || rest.to !== undefined) {
|
|
31
|
+
const { url, to, external, submit: _submit, tabIndex, ...anchor } = rest;
|
|
32
|
+
const anchorProps = { ...anchor, ...common, 'aria-disabled': disabled || undefined,
|
|
33
|
+
tabIndex: disabled ? -1 : tabIndex,
|
|
34
|
+
target: external ? '_blank' : anchor.target, rel: external ? 'noopener noreferrer' : anchor.rel,
|
|
35
|
+
onClick: disabled ? undefined : onClick, onMouseDown: disabled ? undefined : onMouseDown };
|
|
36
|
+
if (to !== undefined && !disabled)
|
|
37
|
+
return _jsx(RouterLink, { ...anchorProps, to: to, children: content });
|
|
38
|
+
return _jsx("a", { ...anchorProps, href: disabled ? undefined : url, children: content });
|
|
39
|
+
}
|
|
40
|
+
const { url: _url, to: _to, external: _external, submit, ...button } = rest;
|
|
41
|
+
return _jsx(BaseButton, { ...button, ...common, disabled: disabled, type: submit ? 'submit' : 'button', onClick: onClick, onMouseDown: disabled ? undefined : onMouseDown, children: content });
|
|
42
|
+
}
|
|
43
|
+
function Label({ className, style, children, id, size, element, fontWeight, fontFamily, align, textCase, emphasisType, numberOfLines, underline, UNSAFE_className, UNSAFE_style, ...props }) {
|
|
44
|
+
const contextSize = useContext(ButtonSizeContext);
|
|
45
|
+
const classes = ['rulnar-button-label', className, UNSAFE_className?.textStyle].filter(Boolean).join(' ');
|
|
46
|
+
const textStyle = { ...style, ...UNSAFE_style?.textStyle };
|
|
47
|
+
if (size === undefined && element === undefined && fontWeight === undefined && fontFamily === undefined &&
|
|
48
|
+
align === undefined && textCase === undefined && emphasisType === undefined && numberOfLines === undefined && underline === undefined) {
|
|
49
|
+
return _jsx("span", { ...props, id: id, className: classes, style: textStyle, children: children });
|
|
50
|
+
}
|
|
51
|
+
return _jsx(Typography, { element: element ?? 'span', fontWeight: fontWeight ?? 'semiBold', fontFamily: fontFamily ?? 'base', size: size === 'small' ? 'base' : (size ?? (contextSize === 'large' ? 'large' : 'base')), ...(id !== undefined && { id }), ...(align !== undefined && { align }), ...(textCase !== undefined && { textCase }), ...(emphasisType !== undefined && { emphasisType }), ...(numberOfLines !== undefined && { numberOfLines }), ...(underline !== undefined && { underline }), UNSAFE_className: { textStyle: classes }, UNSAFE_style: { textStyle }, children: children });
|
|
52
|
+
}
|
|
53
|
+
function ButtonIcon(props) {
|
|
54
|
+
const size = useContext(ButtonSizeContext);
|
|
55
|
+
return 'name' in props ? _jsx("span", { "aria-hidden": "true", children: _jsx(Artwork, { ...props, size: props.size ?? size }) }) :
|
|
56
|
+
_jsx("span", { ...props, "aria-hidden": "true" });
|
|
57
|
+
}
|
|
58
|
+
export const Button = Object.assign(ButtonRoot, { Label, Icon: ButtonIcon });
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ButtonProps } from './Button.js';
|
|
2
|
+
export interface ButtonDismissProps {
|
|
3
|
+
readonly ariaLabel: string;
|
|
4
|
+
onClick?: ButtonProps['onClick'];
|
|
5
|
+
}
|
|
6
|
+
export declare function ButtonDismiss({ ariaLabel, onClick }: ButtonDismissProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from './Button.js';
|
|
3
|
+
export function ButtonDismiss({ ariaLabel, onClick }) {
|
|
4
|
+
return _jsx(Button, { ariaLabel: ariaLabel, icon: "cross", type: "tertiary", variation: "subtle", ...(onClick && { onClick }) });
|
|
5
|
+
}
|
package/dist/Dialog.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
2
|
+
import type { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactElement } from 'react';
|
|
3
|
+
import type { ButtonProps } from './Button.js';
|
|
4
|
+
export { getDialogReturnFocus, getFirstFocusableWithin } from '../foundation/dialogFocus.mjs';
|
|
5
|
+
export type { DialogReturnFocusOptions } from '../foundation/dialogFocus.mjs';
|
|
6
|
+
export type DialogSize = 'small' | 'base' | 'large' | 'fullScreen';
|
|
7
|
+
export type DialogType = 'dialog' | 'alertdialog';
|
|
8
|
+
export type DialogHandle<Payload = unknown> = BaseDialog.Handle<Payload>;
|
|
9
|
+
export type DialogChangeDetails = BaseDialog.Root.ChangeEventDetails;
|
|
10
|
+
interface DialogPresentation {
|
|
11
|
+
size?: DialogSize;
|
|
12
|
+
type?: DialogType;
|
|
13
|
+
finalFocus?: BaseDialog.Popup.Props['finalFocus'];
|
|
14
|
+
}
|
|
15
|
+
export interface DialogRootProps<Payload = unknown> extends DialogPresentation, Pick<BaseDialog.Root.Props<Payload>, 'open' | 'handle' | 'triggerId' | 'defaultTriggerId' | 'onOpenChange' | 'onOpenChangeComplete' | 'children'> {
|
|
16
|
+
onRequestClose?: (details: DialogChangeDetails) => void;
|
|
17
|
+
}
|
|
18
|
+
declare function Root<Payload>({ size, type, finalFocus, onRequestClose, onOpenChange, ...props }: DialogRootProps<Payload>): import("react").JSX.Element;
|
|
19
|
+
export type DialogTriggerProps<Payload = unknown> = Omit<BaseDialog.Trigger.Props<Payload>, 'className'> & {
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export type DialogTriggerRender = ReactElement | ((props: ComponentPropsWithRef<'button'>) => ReactElement);
|
|
23
|
+
declare function Trigger<Payload>({ className, children, render, ...props }: DialogTriggerProps<Payload>): import("react").JSX.Element;
|
|
24
|
+
export type DialogContentProps = Omit<BaseDialog.Popup.Props, 'role' | 'finalFocus' | 'className'> & {
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
declare function Content({ children, className, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
28
|
+
type PartProps = ComponentPropsWithoutRef<'div'>;
|
|
29
|
+
export type DialogHeaderProps = PartProps;
|
|
30
|
+
export type DialogFooterProps = PartProps;
|
|
31
|
+
export type DialogTitleProps = Omit<BaseDialog.Title.Props, 'className'> & {
|
|
32
|
+
className?: string;
|
|
33
|
+
};
|
|
34
|
+
export type DialogBodyProps = Omit<BaseDialog.Description.Props, 'className'> & {
|
|
35
|
+
className?: string;
|
|
36
|
+
fullBleed?: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type DialogCloseProps = Omit<BaseDialog.Close.Props, 'className'> & {
|
|
39
|
+
className?: string;
|
|
40
|
+
};
|
|
41
|
+
export type DialogCloseRender = ReactElement | ((props: ComponentPropsWithRef<'button'>) => ReactElement);
|
|
42
|
+
declare function Header({ className, ...props }: PartProps): import("react").JSX.Element;
|
|
43
|
+
declare function Footer({ className, ...props }: PartProps): import("react").JSX.Element;
|
|
44
|
+
declare function ScrollArea({ className, ...props }: PartProps): import("react").JSX.Element;
|
|
45
|
+
declare function Title({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
|
|
46
|
+
declare function Body({ className, fullBleed, ...props }: DialogBodyProps): import("react").JSX.Element;
|
|
47
|
+
declare function Close({ className, children, render, ...props }: DialogCloseProps): import("react").JSX.Element;
|
|
48
|
+
type Action = ButtonProps | ReactElement;
|
|
49
|
+
interface ActionSlots {
|
|
50
|
+
primary?: Action;
|
|
51
|
+
secondary?: Action;
|
|
52
|
+
tertiary?: Action;
|
|
53
|
+
}
|
|
54
|
+
export type DialogActionsProps = Omit<PartProps, 'children'> & ActionSlots & ({
|
|
55
|
+
primary: Action;
|
|
56
|
+
} | {
|
|
57
|
+
secondary: Action;
|
|
58
|
+
} | {
|
|
59
|
+
tertiary: Action;
|
|
60
|
+
}) & {
|
|
61
|
+
align?: 'left' | 'right' | 'fullWidth';
|
|
62
|
+
};
|
|
63
|
+
declare function Actions({ primary, secondary, tertiary, align, className, ...props }: DialogActionsProps): import("react").JSX.Element;
|
|
64
|
+
export declare const Dialog: typeof Root & {
|
|
65
|
+
Trigger: typeof Trigger;
|
|
66
|
+
Content: typeof Content;
|
|
67
|
+
Header: typeof Header;
|
|
68
|
+
Title: typeof Title;
|
|
69
|
+
Body: typeof Body;
|
|
70
|
+
Footer: typeof Footer;
|
|
71
|
+
Close: typeof Close;
|
|
72
|
+
Actions: typeof Actions;
|
|
73
|
+
ScrollArea: typeof ScrollArea;
|
|
74
|
+
createHandle: typeof BaseDialog.createHandle;
|
|
75
|
+
};
|
package/dist/Dialog.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as BaseDialog } from '@base-ui/react/dialog';
|
|
3
|
+
import { createContext, isValidElement, useContext, useState } from 'react';
|
|
4
|
+
import { Button } from './Button.js';
|
|
5
|
+
import { ThemeBoundary } from './theme.js';
|
|
6
|
+
import { LegacyModalPortal } from './legacyModalPortal.js';
|
|
7
|
+
export { getDialogReturnFocus, getFirstFocusableWithin } from '../foundation/dialogFocus.mjs';
|
|
8
|
+
const Presentation = createContext({});
|
|
9
|
+
const dismissReasons = new Set(['escape-key', 'outside-press', 'close-press']);
|
|
10
|
+
function Root({ size = 'base', type = 'dialog', finalFocus, onRequestClose, onOpenChange, ...props }) {
|
|
11
|
+
return _jsx(Presentation.Provider, { value: { size, type, finalFocus }, children: _jsx(BaseDialog.Root, { ...props, disablePointerDismissal: type === 'alertdialog', onOpenChange: (open, details) => {
|
|
12
|
+
if (!open && details.reason === 'escape-key' &&
|
|
13
|
+
Reflect.get(details.event, 'rulnarHandledByNestedModal')) {
|
|
14
|
+
details.cancel();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (!open && dismissReasons.has(details.reason))
|
|
18
|
+
onRequestClose?.(details);
|
|
19
|
+
onOpenChange?.(open, details);
|
|
20
|
+
} }) });
|
|
21
|
+
}
|
|
22
|
+
function Trigger({ className, children, render, ...props }) {
|
|
23
|
+
return _jsx(BaseDialog.Trigger, { ...props, className: [render ? '' : 'rulnar-button', className].filter(Boolean).join(' '), render: render ?? (isValidElement(children) && children.type === Button ? children : undefined), children: isValidElement(children) && children.type === Button ? undefined : children });
|
|
24
|
+
}
|
|
25
|
+
function Content({ children, className, ...props }) {
|
|
26
|
+
const { size, type, finalFocus } = useContext(Presentation);
|
|
27
|
+
const [legacyModalHost, setLegacyModalHost] = useState(null);
|
|
28
|
+
return _jsx(BaseDialog.Portal, { children: _jsxs(ThemeBoundary, { children: [_jsx(BaseDialog.Backdrop, { className: "rulnar-dialog-backdrop" }), _jsx(BaseDialog.Viewport, { className: "rulnar-dialog-viewport", render: (viewportProps, { nestedDialogOpen }) => _jsx("div", { ...viewportProps, inert: nestedDialogOpen }), children: _jsx(BaseDialog.Popup, { ...props, role: type ?? 'dialog', finalFocus: finalFocus, "data-size": size, className: ['rulnar-dialog', className].filter(Boolean).join(' '), children: _jsxs(LegacyModalPortal.Provider, { value: legacyModalHost, children: [children, _jsx("div", { ref: setLegacyModalHost, style: { display: 'contents' } })] }) }) })] }) });
|
|
29
|
+
}
|
|
30
|
+
function Header({ className, ...props }) {
|
|
31
|
+
return _jsx("div", { ...props, className: ['rulnar-dialog-header', className].filter(Boolean).join(' ') });
|
|
32
|
+
}
|
|
33
|
+
function Footer({ className, ...props }) {
|
|
34
|
+
return _jsx("div", { ...props, className: ['rulnar-dialog-footer', className].filter(Boolean).join(' ') });
|
|
35
|
+
}
|
|
36
|
+
function ScrollArea({ className, ...props }) {
|
|
37
|
+
return _jsx("div", { ...props, className: ['rulnar-dialog-scroll', className].filter(Boolean).join(' ') });
|
|
38
|
+
}
|
|
39
|
+
function Title({ className, ...props }) {
|
|
40
|
+
return _jsx(BaseDialog.Title, { ...props, className: ['rulnar-dialog-title', className].filter(Boolean).join(' ') });
|
|
41
|
+
}
|
|
42
|
+
function Body({ className, fullBleed, ...props }) {
|
|
43
|
+
return _jsx(BaseDialog.Description, { render: _jsx("div", {}), ...props, "data-full-bleed": fullBleed || undefined, className: ['rulnar-dialog-body', className].filter(Boolean).join(' ') });
|
|
44
|
+
}
|
|
45
|
+
function Close({ className, children, render, ...props }) {
|
|
46
|
+
const custom = render ?? (isValidElement(children) ? children : undefined);
|
|
47
|
+
return _jsx(BaseDialog.Close, { ...props, render: custom, className: [custom ? '' : 'rulnar-button', className].filter(Boolean).join(' '), "data-kind": "tertiary", children: isValidElement(children) ? undefined : children ?? (custom ? undefined : 'Close') });
|
|
48
|
+
}
|
|
49
|
+
function renderAction(value) {
|
|
50
|
+
if (!value || isValidElement(value))
|
|
51
|
+
return value;
|
|
52
|
+
return _jsx(Button, { ...value });
|
|
53
|
+
}
|
|
54
|
+
function Actions({ primary, secondary, tertiary, align = 'right', className, ...props }) {
|
|
55
|
+
return _jsxs("div", { ...props, "data-align": align, className: ['rulnar-dialog-actions', className].filter(Boolean).join(' '), children: [tertiary && _jsx("div", { className: "rulnar-dialog-tertiary", children: renderAction(tertiary) }), renderAction(secondary), renderAction(primary)] });
|
|
56
|
+
}
|
|
57
|
+
export const Dialog = Object.assign(Root, {
|
|
58
|
+
Trigger, Content, Header, Title, Body, Footer, Close, Actions, ScrollArea, createHandle: BaseDialog.createHandle,
|
|
59
|
+
});
|
package/dist/Icon.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { IconColorNames, IconNames, IconSizes } from '@zj-dynamics/design/foundation';
|
|
3
|
+
export type { IconColorNames, IconNames, IconSizes } from '@zj-dynamics/design/foundation';
|
|
4
|
+
export { iconNames, isIconName } from '@zj-dynamics/design/foundation';
|
|
5
|
+
export interface IconProps {
|
|
6
|
+
readonly name: IconNames;
|
|
7
|
+
readonly color?: IconColorNames;
|
|
8
|
+
readonly size?: IconSizes;
|
|
9
|
+
readonly customColor?: string;
|
|
10
|
+
readonly testID?: string;
|
|
11
|
+
readonly UNSAFE_className?: {
|
|
12
|
+
svg?: string;
|
|
13
|
+
path?: string;
|
|
14
|
+
};
|
|
15
|
+
readonly UNSAFE_style?: {
|
|
16
|
+
svg?: CSSProperties;
|
|
17
|
+
path?: CSSProperties;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function Icon({ name, color, customColor, size, testID, UNSAFE_className, UNSAFE_style }: IconProps): import("react").JSX.Element;
|
package/dist/Icon.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getIcon } from '@zj-dynamics/design/foundation';
|
|
3
|
+
export { iconNames, isIconName } from '@zj-dynamics/design/foundation';
|
|
4
|
+
export function Icon({ name, color, customColor, size = 'base', testID, UNSAFE_className, UNSAFE_style }) {
|
|
5
|
+
const { svgStyle, pathStyle, paths, viewBox } = getIcon({
|
|
6
|
+
name, size, platform: 'web',
|
|
7
|
+
...(color !== undefined && { color }),
|
|
8
|
+
...(customColor !== undefined && { customColor }),
|
|
9
|
+
});
|
|
10
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: viewBox, style: { ...svgStyle, ...UNSAFE_style?.svg }, className: UNSAFE_className?.svg, "data-testid": testID || name, children: paths?.map((path, index) => (_jsx("path", { d: path.d, fill: path.fill ?? customColor, fillOpacity: path.fillOpacity, opacity: path.opacity, style: { ...(!path.fill && pathStyle), ...UNSAFE_style?.path }, className: UNSAFE_className?.path }, index))) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ChangeEvent, ComponentPropsWithRef, KeyboardEvent, ReactNode, Ref } from 'react';
|
|
2
|
+
import type { InputTextProps as CompatibilityInputProps } from '../foundation/InputText/index.mjs';
|
|
3
|
+
type FieldOptions = Pick<CompatibilityInputProps, 'showMiniLabel' | 'rows' | 'toolbar' | 'toolbarVisibility' | 'loading' | 'inline' | 'align' | 'suffix'>;
|
|
4
|
+
interface InputTextSingleLineProps extends Omit<ComponentPropsWithRef<'input'>, 'onChange' | 'value' | 'defaultValue' | 'prefix' | 'size'>, FieldOptions {
|
|
5
|
+
value: string;
|
|
6
|
+
multiline?: false;
|
|
7
|
+
label?: string;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
error?: string;
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
clearable?: 'never' | 'always' | 'while-editing';
|
|
12
|
+
prefix?: string | CompatibilityInputProps['prefix'];
|
|
13
|
+
size?: number | CompatibilityInputProps['size'];
|
|
14
|
+
onChange?: (value: string, event?: ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
onEnter?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
16
|
+
}
|
|
17
|
+
interface InputTextVariableProps extends CompatibilityInputProps {
|
|
18
|
+
ref?: Ref<HTMLInputElement | HTMLTextAreaElement>;
|
|
19
|
+
label?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export type InputTextProps = InputTextSingleLineProps | InputTextVariableProps;
|
|
23
|
+
export declare function InputText(props: InputTextSingleLineProps): React.JSX.Element;
|
|
24
|
+
export declare function InputText(props: InputTextVariableProps): React.JSX.Element;
|
|
25
|
+
export declare function InputText(props: InputTextProps): React.JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input as BaseInput } from '@base-ui/react/input';
|
|
3
|
+
import { useCallback, useId, useRef, useState } from 'react';
|
|
4
|
+
import { InputText as CompatibilityInput } from '../foundation/InputText/index.mjs';
|
|
5
|
+
import { Button } from './Button.js';
|
|
6
|
+
export function InputText(props) {
|
|
7
|
+
const generated = useId();
|
|
8
|
+
const id = props.id ?? generated;
|
|
9
|
+
const { label, className, multiline, prefix, size, ...field } = props;
|
|
10
|
+
const useCompatibility = multiline || ['showMiniLabel', 'rows', 'toolbar', 'toolbarVisibility',
|
|
11
|
+
'loading', 'inline', 'align', 'suffix'].some(option => Object.hasOwn(props, option)) ||
|
|
12
|
+
typeof prefix === 'object' || typeof size === 'string' || (!label && props.placeholder !== undefined);
|
|
13
|
+
if (useCompatibility) {
|
|
14
|
+
const compatible = {
|
|
15
|
+
...field, id, ...(multiline !== undefined && { multiline }),
|
|
16
|
+
...(typeof prefix === 'object' && { prefix }),
|
|
17
|
+
...(typeof size === 'string' && { size }),
|
|
18
|
+
...(!field['aria-label'] && label && { 'aria-label': label }),
|
|
19
|
+
};
|
|
20
|
+
return _jsxs("div", { className: className, children: [label && _jsx("label", { className: "rulnar-field-label rulnar-field-label--external", htmlFor: id, children: label }), _jsx(CompatibilityInput, { ...compatible })] });
|
|
21
|
+
}
|
|
22
|
+
// The multiline branch above guarantees an input element for this renderer.
|
|
23
|
+
return _jsx(SingleLineInput, { ...props, id: id });
|
|
24
|
+
}
|
|
25
|
+
function SingleLineInput({ ref, id, value, label, description, error, invalid, clearable = 'never', disabled, readOnly, onChange, onKeyDown, onEnter, className, multiline: _multiline, prefix, size, 'aria-describedby': describedBy, ...props }) {
|
|
26
|
+
const inputId = id;
|
|
27
|
+
const inputRef = useRef(null);
|
|
28
|
+
const [focused, setFocused] = useState(false);
|
|
29
|
+
const setRef = useCallback((element) => {
|
|
30
|
+
const node = element;
|
|
31
|
+
inputRef.current = node;
|
|
32
|
+
if (typeof ref === 'function') {
|
|
33
|
+
const cleanup = ref(node);
|
|
34
|
+
if (cleanup)
|
|
35
|
+
return () => {
|
|
36
|
+
inputRef.current = null;
|
|
37
|
+
cleanup();
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
else if (ref) {
|
|
41
|
+
ref.current = node;
|
|
42
|
+
}
|
|
43
|
+
}, [ref]);
|
|
44
|
+
const descriptionId = description ? `${inputId}-description` : undefined;
|
|
45
|
+
const errorId = error ? `${inputId}-error` : undefined;
|
|
46
|
+
const messageIds = [describedBy, descriptionId, errorId].filter(Boolean).join(' ');
|
|
47
|
+
const showClear = !disabled && !readOnly && value &&
|
|
48
|
+
(clearable === 'always' || (clearable === 'while-editing' && focused));
|
|
49
|
+
return _jsxs("div", { className: ['rulnar-field', className].filter(Boolean).join(' '), "data-clearable": clearable, "data-invalid": Boolean(error || invalid) || undefined, children: [label && _jsx("label", { className: "rulnar-field-label", htmlFor: inputId, children: label }), _jsxs("div", { className: "rulnar-field-control", onFocus: () => setFocused(true), onBlur: event => {
|
|
50
|
+
if (!event.currentTarget.contains(event.relatedTarget))
|
|
51
|
+
setFocused(false);
|
|
52
|
+
}, children: [_jsx(BaseInput, { ...props, ref: setRef, id: inputId, value: value, disabled: disabled, readOnly: readOnly, ...(typeof size === 'number' && { size }), ...(typeof prefix === 'string' && { prefix }), "aria-invalid": Boolean(error || invalid) || props['aria-invalid'], "aria-describedby": messageIds || undefined, onChange: event => onChange?.(event.currentTarget.value, event), onKeyDown: event => {
|
|
53
|
+
onKeyDown?.(event);
|
|
54
|
+
if (event.key === 'Enter' && onEnter && !event.shiftKey && !event.ctrlKey) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
onEnter(event);
|
|
57
|
+
}
|
|
58
|
+
} }), showClear &&
|
|
59
|
+
_jsx(Button, { type: "tertiary", size: "small", label: "Clear", ariaLabel: label ? `Clear ${label}` : 'Clear input', onClick: () => {
|
|
60
|
+
onChange?.('');
|
|
61
|
+
inputRef.current?.focus();
|
|
62
|
+
} })] }), description && _jsx("div", { id: descriptionId, className: "rulnar-field-description", children: description }), error && _jsx("div", { id: errorId, className: "rulnar-field-error", children: error })] });
|
|
63
|
+
}
|
package/dist/Switch.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface SwitchProps {
|
|
2
|
+
readonly value?: boolean;
|
|
3
|
+
readonly name?: string;
|
|
4
|
+
readonly ariaLabel?: string;
|
|
5
|
+
readonly disabled?: boolean;
|
|
6
|
+
onChange?(checked: boolean): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function Switch({ value, name, ariaLabel, disabled, onChange }: SwitchProps): import("react").JSX.Element;
|
package/dist/Switch.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as BaseSwitch } from '@base-ui/react/switch';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { Icon } from './Icon.js';
|
|
5
|
+
// These classes keep the frozen appearance in foundation.css.
|
|
6
|
+
const styles = {
|
|
7
|
+
root: 'rVg6dYYBFN4- yyISARGmmJo-', checked: '_40c6OIH33p8-', disabled: 'e-cSZjkHGw8-',
|
|
8
|
+
thumb: 'zA0Fmn8IIZI-', icon: 'JS-CLzHa9-I-',
|
|
9
|
+
};
|
|
10
|
+
export function Switch({ value, name, ariaLabel, disabled = false, onChange }) {
|
|
11
|
+
const [internal, setInternal] = useState(false);
|
|
12
|
+
const checked = value ?? internal;
|
|
13
|
+
const className = [styles.root, checked && styles.checked, disabled && styles.disabled].filter(Boolean).join(' ');
|
|
14
|
+
return _jsxs(_Fragment, { children: [_jsxs(BaseSwitch.Root, { nativeButton: true, render: _jsx("button", { type: "button" }), ...(name && { id: name }), "aria-label": ariaLabel, checked: checked, disabled: disabled, className: className, onCheckedChange: next => {
|
|
15
|
+
onChange?.(next);
|
|
16
|
+
if (value == null)
|
|
17
|
+
setInternal(next);
|
|
18
|
+
}, children: [_jsx("span", { className: styles.icon, "aria-hidden": "true", children: checked ? _jsx(Icon, { size: "small", name: "checkmark", color: "surface" }) : _jsx(Icon, { size: "small", name: "cross", customColor: disabled ? 'var(--color-disabled)' : 'var(--color-inactive--onSurface)' }) }), _jsx(BaseSwitch.Thumb, { className: styles.thumb })] }), _jsx("input", { name: name, type: "hidden", value: String(checked) })] });
|
|
19
|
+
}
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ThemeProviderProps } from './theme.js';
|
|
2
|
+
export type ToastProps = {
|
|
3
|
+
readonly message: string;
|
|
4
|
+
readonly variation?: 'info' | 'success' | 'error';
|
|
5
|
+
readonly id?: number;
|
|
6
|
+
} & ({
|
|
7
|
+
readonly action?: never;
|
|
8
|
+
readonly actionLabel?: never;
|
|
9
|
+
} | {
|
|
10
|
+
/** @deprecated Keep persistent actions in the page. */
|
|
11
|
+
readonly action: () => void;
|
|
12
|
+
/** @deprecated Keep persistent actions in the page. */
|
|
13
|
+
readonly actionLabel: string;
|
|
14
|
+
});
|
|
15
|
+
interface ShowToastOptions {
|
|
16
|
+
readonly locale?: string;
|
|
17
|
+
readonly theme?: Pick<ThemeProviderProps, 'brand' | 'mode' | 'overrides' | 'forcedMode'>;
|
|
18
|
+
}
|
|
19
|
+
export declare function Toast(props: Omit<ToastProps, 'id'>): import("react").JSX.Element;
|
|
20
|
+
export declare function showToast(props: ToastProps, options?: ShowToastOptions): void;
|
|
21
|
+
export {};
|