@lablup/ui-common 0.1.0-alpha.9 → 0.2.0-alpha.16
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/NOTICE +62 -0
- package/README.md +521 -69
- package/astryx/components/AlertModal.doc.mjs +91 -0
- package/astryx/components/AlertModal.tsx +3 -0
- package/astryx/components/BoardItemTitle.doc.mjs +51 -0
- package/astryx/components/BoardItemTitle.tsx +3 -0
- package/astryx/components/BooleanToken.doc.mjs +57 -0
- package/astryx/components/BooleanToken.tsx +3 -0
- package/astryx/components/BulkEditFormItem.doc.mjs +68 -0
- package/astryx/components/BulkEditFormItem.tsx +3 -0
- package/astryx/components/BulkErrorModal.doc.mjs +75 -0
- package/astryx/components/BulkErrorModal.tsx +3 -0
- package/astryx/components/ColorPicker.doc.mjs +88 -0
- package/astryx/components/ColorPicker.tsx +3 -0
- package/astryx/components/ConfirmPopover.doc.mjs +99 -0
- package/astryx/components/ConfirmPopover.tsx +3 -0
- package/astryx/components/CountBadge.doc.mjs +93 -0
- package/astryx/components/CountBadge.tsx +3 -0
- package/astryx/components/CountdownBorder.doc.mjs +57 -0
- package/astryx/components/CountdownBorder.tsx +3 -0
- package/astryx/components/DataGrid.doc.mjs +166 -0
- package/astryx/components/DataGrid.tsx +3 -0
- package/astryx/components/DeleteConfirmModal.doc.mjs +163 -0
- package/astryx/components/DeleteConfirmModal.tsx +3 -0
- package/astryx/components/DividedRow.doc.mjs +85 -0
- package/astryx/components/DividedRow.tsx +3 -0
- package/astryx/components/DoubleBadge.doc.mjs +40 -0
- package/astryx/components/DoubleBadge.tsx +3 -0
- package/astryx/components/DoubleToken.doc.mjs +38 -0
- package/astryx/components/DoubleToken.tsx +3 -0
- package/astryx/components/Form.doc.mjs +113 -0
- package/astryx/components/Form.tsx +3 -0
- package/astryx/components/IconWithTooltip.doc.mjs +57 -0
- package/astryx/components/IconWithTooltip.tsx +3 -0
- package/astryx/components/ImageWithFallback.doc.mjs +47 -0
- package/astryx/components/ImageWithFallback.tsx +3 -0
- package/astryx/components/ListBanner.doc.mjs +50 -0
- package/astryx/components/ListBanner.tsx +3 -0
- package/astryx/components/Modal.doc.mjs +176 -0
- package/astryx/components/Modal.tsx +3 -0
- package/astryx/components/NotificationItem.doc.mjs +52 -0
- package/astryx/components/NotificationItem.tsx +3 -0
- package/astryx/components/NotificationStack.doc.mjs +66 -0
- package/astryx/components/NotificationStack.tsx +3 -0
- package/astryx/components/OverlayScrollbar.doc.mjs +49 -0
- package/astryx/components/OverlayScrollbar.tsx +3 -0
- package/astryx/components/PageHeader.doc.mjs +94 -0
- package/astryx/components/PageHeader.tsx +3 -0
- package/astryx/components/PagedSelector.doc.mjs +183 -0
- package/astryx/components/PagedSelector.tsx +3 -0
- package/astryx/components/ProgressWithLabel.doc.mjs +69 -0
- package/astryx/components/ProgressWithLabel.tsx +3 -0
- package/astryx/components/SelectionLabel.doc.mjs +55 -0
- package/astryx/components/SelectionLabel.tsx +3 -0
- package/astryx/components/Statistic.doc.mjs +84 -0
- package/astryx/components/Statistic.tsx +3 -0
- package/astryx/components/StepNumberInput.doc.mjs +102 -0
- package/astryx/components/StepNumberInput.tsx +3 -0
- package/astryx/components/TextHighlighter.doc.mjs +47 -0
- package/astryx/components/TextHighlighter.tsx +3 -0
- package/astryx/components/TokenList.doc.mjs +58 -0
- package/astryx/components/TokenList.tsx +3 -0
- package/astryx/components/TokenRow.doc.mjs +62 -0
- package/astryx/components/TokenRow.tsx +3 -0
- package/astryx/components/UncontrolledInput.doc.mjs +68 -0
- package/astryx/components/UncontrolledInput.tsx +3 -0
- package/astryx/components/UnitGrid.doc.mjs +107 -0
- package/astryx/components/UnitGrid.tsx +3 -0
- package/astryx/docs/ui-common.doc.mjs +112 -0
- package/astryx.integration.mjs +35 -0
- package/dist/assets/components/BoardItemTitle/BoardItemTitle.css +2 -0
- package/dist/assets/components/BulkErrorModal/BulkErrorModal.css +2 -0
- package/dist/assets/components/ColorPicker/ColorPicker.css +2 -0
- package/dist/assets/components/CountBadge/CountBadge.css +2 -0
- package/dist/assets/components/CountdownBorder/CountdownBorder.css +2 -0
- package/dist/assets/components/DataGrid/DataGrid.css +2 -0
- package/dist/assets/components/DeleteConfirmModal/DeleteConfirmModal.css +2 -0
- package/dist/assets/components/DigitPopIn/DigitPopIn.css +2 -0
- package/dist/assets/components/DividedRow/DividedRow.css +2 -0
- package/dist/assets/components/DoubleBadge/DoubleBadge.css +2 -0
- package/dist/assets/components/DoubleToken/DoubleToken.css +2 -0
- package/dist/assets/components/ErrorState/ErrorState.css +2 -1
- package/dist/assets/components/Form/FormItemVisual.css +2 -0
- package/dist/assets/components/IconWithTooltip/IconWithTooltip.css +2 -0
- package/dist/assets/components/ImageWithFallback/ImageWithFallback.css +2 -0
- package/dist/assets/components/ListBanner/ListBanner.css +2 -0
- package/dist/assets/components/Modal/Modal.css +2 -0
- package/dist/assets/components/NotificationItem/NotificationItem.css +2 -0
- package/dist/assets/components/NotificationStack/NotificationStack.css +2 -0
- package/dist/assets/components/OverlayScrollbar/OverlayScrollbar.css +2 -0
- package/dist/assets/components/PageHeader/PageHeader.css +2 -1
- package/dist/assets/components/PageLayout/PageLayout.css +2 -1
- package/dist/assets/components/PagedSelector/PagedSelector.css +2 -0
- package/dist/assets/components/ProgressWithLabel/ProgressWithLabel.css +2 -0
- package/dist/assets/components/Skeleton/SkeletonCard.css +2 -1
- package/dist/assets/components/Skeleton/SkeletonChart.css +2 -1
- package/dist/assets/components/Skeleton/SkeletonRow.css +2 -1
- package/dist/assets/components/Skeleton/SkeletonShape.css +2 -0
- package/dist/assets/components/Skeleton/SkeletonText.css +2 -1
- package/dist/assets/components/SmoothHeight/SmoothHeight.css +2 -1
- package/dist/assets/components/StatCard/StatCard.css +2 -1
- package/dist/assets/components/Statistic/Statistic.css +2 -0
- package/dist/assets/components/StepNumberInput/NumberStepper.css +2 -0
- package/dist/assets/components/TextHighlighter/TextHighlighter.css +2 -0
- package/dist/assets/components/TokenList/TokenList.css +2 -0
- package/dist/assets/components/TokenRow/TokenRow.css +2 -0
- package/dist/assets/components/UnitGrid/UnitGrid.css +2 -0
- package/dist/astryx/AppShell.d.ts +1 -0
- package/dist/astryx/AppShell.js +1 -0
- package/dist/astryx/AspectRatio.d.ts +1 -0
- package/dist/astryx/AspectRatio.js +1 -0
- package/dist/astryx/Avatar.d.ts +1 -0
- package/dist/astryx/Avatar.js +1 -0
- package/dist/astryx/AvatarGroup.d.ts +1 -0
- package/dist/astryx/AvatarGroup.js +1 -0
- package/dist/astryx/Badge.d.ts +1 -0
- package/dist/astryx/Badge.js +1 -0
- package/dist/astryx/Banner.d.ts +1 -0
- package/dist/astryx/Banner.js +1 -0
- package/dist/astryx/BaseProps.d.ts +1 -0
- package/dist/astryx/BaseProps.js +1 -0
- package/dist/astryx/Blockquote.d.ts +1 -0
- package/dist/astryx/Blockquote.js +1 -0
- package/dist/astryx/BottomSheet.d.ts +1 -0
- package/dist/astryx/BottomSheet.js +1 -0
- package/dist/astryx/Breadcrumbs.d.ts +1 -0
- package/dist/astryx/Breadcrumbs.js +1 -0
- package/dist/astryx/Button.d.ts +1 -0
- package/dist/astryx/Button.js +1 -0
- package/dist/astryx/ButtonGroup.d.ts +1 -0
- package/dist/astryx/ButtonGroup.js +1 -0
- package/dist/astryx/Calendar/utils.d.ts +1 -0
- package/dist/astryx/Calendar/utils.js +1 -0
- package/dist/astryx/Calendar.d.ts +1 -0
- package/dist/astryx/Calendar.js +1 -0
- package/dist/astryx/Card.d.ts +1 -0
- package/dist/astryx/Card.js +1 -0
- package/dist/astryx/Carousel.d.ts +1 -0
- package/dist/astryx/Carousel.js +1 -0
- package/dist/astryx/Center.d.ts +1 -0
- package/dist/astryx/Center.js +1 -0
- package/dist/astryx/Chat.d.ts +1 -0
- package/dist/astryx/Chat.js +1 -0
- package/dist/astryx/CheckboxInput.d.ts +1 -0
- package/dist/astryx/CheckboxInput.js +1 -0
- package/dist/astryx/CheckboxList.d.ts +1 -0
- package/dist/astryx/CheckboxList.js +1 -0
- package/dist/astryx/Citation.d.ts +1 -0
- package/dist/astryx/Citation.js +1 -0
- package/dist/astryx/ClickableCard.d.ts +1 -0
- package/dist/astryx/ClickableCard.js +1 -0
- package/dist/astryx/Code.d.ts +1 -0
- package/dist/astryx/Code.js +1 -0
- package/dist/astryx/CodeBlock.d.ts +1 -0
- package/dist/astryx/CodeBlock.js +1 -0
- package/dist/astryx/Collapsible.d.ts +1 -0
- package/dist/astryx/Collapsible.js +1 -0
- package/dist/astryx/CommandPalette.d.ts +1 -0
- package/dist/astryx/CommandPalette.js +1 -0
- package/dist/astryx/ContextMenu.d.ts +1 -0
- package/dist/astryx/ContextMenu.js +1 -0
- package/dist/astryx/DateInput.d.ts +1 -0
- package/dist/astryx/DateInput.js +1 -0
- package/dist/astryx/DateRangeInput.d.ts +1 -0
- package/dist/astryx/DateRangeInput.js +1 -0
- package/dist/astryx/DateTimeInput.d.ts +1 -0
- package/dist/astryx/DateTimeInput.js +1 -0
- package/dist/astryx/Divider.d.ts +1 -0
- package/dist/astryx/Divider.js +1 -0
- package/dist/astryx/DropdownMenu.d.ts +1 -0
- package/dist/astryx/DropdownMenu.js +1 -0
- package/dist/astryx/EmptyState.d.ts +1 -0
- package/dist/astryx/EmptyState.js +1 -0
- package/dist/astryx/Field.d.ts +1 -0
- package/dist/astryx/Field.js +1 -0
- package/dist/astryx/FieldStatus.d.ts +1 -0
- package/dist/astryx/FieldStatus.js +1 -0
- package/dist/astryx/FileInput.d.ts +1 -0
- package/dist/astryx/FileInput.js +1 -0
- package/dist/astryx/FormLayout.d.ts +1 -0
- package/dist/astryx/FormLayout.js +1 -0
- package/dist/astryx/Grid.d.ts +1 -0
- package/dist/astryx/Grid.js +1 -0
- package/dist/astryx/HStack.d.ts +1 -0
- package/dist/astryx/HStack.js +1 -0
- package/dist/astryx/Heading.d.ts +1 -0
- package/dist/astryx/Heading.js +1 -0
- package/dist/astryx/HoverCard.d.ts +1 -0
- package/dist/astryx/HoverCard.js +1 -0
- package/dist/astryx/Icon.d.ts +1 -0
- package/dist/astryx/Icon.js +1 -0
- package/dist/astryx/IconButton.d.ts +1 -0
- package/dist/astryx/IconButton.js +1 -0
- package/dist/astryx/Indicator.d.ts +1 -0
- package/dist/astryx/Indicator.js +1 -0
- package/dist/astryx/InputGroup.d.ts +1 -0
- package/dist/astryx/InputGroup.js +1 -0
- package/dist/astryx/InteractiveRoleContext.d.ts +1 -0
- package/dist/astryx/InteractiveRoleContext.js +1 -0
- package/dist/astryx/Item.d.ts +1 -0
- package/dist/astryx/Item.js +1 -0
- package/dist/astryx/Kbd.d.ts +1 -0
- package/dist/astryx/Kbd.js +1 -0
- package/dist/astryx/Layer.d.ts +1 -0
- package/dist/astryx/Layer.js +1 -0
- package/dist/astryx/Layout.d.ts +1 -0
- package/dist/astryx/Layout.js +1 -0
- package/dist/astryx/Lightbox.d.ts +1 -0
- package/dist/astryx/Lightbox.js +1 -0
- package/dist/astryx/Link.d.ts +1 -0
- package/dist/astryx/Link.js +1 -0
- package/dist/astryx/List.d.ts +1 -0
- package/dist/astryx/List.js +1 -0
- package/dist/astryx/Markdown/parser.d.ts +1 -0
- package/dist/astryx/Markdown/parser.js +1 -0
- package/dist/astryx/Markdown/plugins.d.ts +1 -0
- package/dist/astryx/Markdown/plugins.js +1 -0
- package/dist/astryx/Markdown/remark.d.ts +1 -0
- package/dist/astryx/Markdown/remark.js +1 -0
- package/dist/astryx/Markdown/utils.d.ts +1 -0
- package/dist/astryx/Markdown/utils.js +1 -0
- package/dist/astryx/Markdown.d.ts +1 -0
- package/dist/astryx/Markdown.js +1 -0
- package/dist/astryx/MetadataList.d.ts +1 -0
- package/dist/astryx/MetadataList.js +1 -0
- package/dist/astryx/MobileNav.d.ts +1 -0
- package/dist/astryx/MobileNav.js +1 -0
- package/dist/astryx/MoreMenu.d.ts +1 -0
- package/dist/astryx/MoreMenu.js +1 -0
- package/dist/astryx/MultiSelector.d.ts +1 -0
- package/dist/astryx/MultiSelector.js +1 -0
- package/dist/astryx/NavIcon.d.ts +1 -0
- package/dist/astryx/NavIcon.js +1 -0
- package/dist/astryx/NavMenu.d.ts +1 -0
- package/dist/astryx/NavMenu.js +1 -0
- package/dist/astryx/NumberInput.d.ts +1 -0
- package/dist/astryx/NumberInput.js +1 -0
- package/dist/astryx/Outline.d.ts +1 -0
- package/dist/astryx/Outline.js +1 -0
- package/dist/astryx/OverflowList.d.ts +1 -0
- package/dist/astryx/OverflowList.js +1 -0
- package/dist/astryx/Overlay.d.ts +1 -0
- package/dist/astryx/Overlay.js +1 -0
- package/dist/astryx/Pagination.d.ts +1 -0
- package/dist/astryx/Pagination.js +1 -0
- package/dist/astryx/Popover.d.ts +1 -0
- package/dist/astryx/Popover.js +1 -0
- package/dist/astryx/PowerSearch/utils.d.ts +1 -0
- package/dist/astryx/PowerSearch/utils.js +1 -0
- package/dist/astryx/PowerSearch.d.ts +1 -0
- package/dist/astryx/PowerSearch.js +1 -0
- package/dist/astryx/ProgressBar.d.ts +1 -0
- package/dist/astryx/ProgressBar.js +1 -0
- package/dist/astryx/RadioList.d.ts +1 -0
- package/dist/astryx/RadioList.js +1 -0
- package/dist/astryx/Resizable/utils.d.ts +1 -0
- package/dist/astryx/Resizable/utils.js +1 -0
- package/dist/astryx/Resizable.d.ts +1 -0
- package/dist/astryx/Resizable.js +1 -0
- package/dist/astryx/ScrollableArea.d.ts +1 -0
- package/dist/astryx/ScrollableArea.js +1 -0
- package/dist/astryx/Section.d.ts +1 -0
- package/dist/astryx/Section.js +1 -0
- package/dist/astryx/SegmentedControl.d.ts +1 -0
- package/dist/astryx/SegmentedControl.js +1 -0
- package/dist/astryx/SelectableCard.d.ts +1 -0
- package/dist/astryx/SelectableCard.js +1 -0
- package/dist/astryx/Selector/utils.d.ts +1 -0
- package/dist/astryx/Selector/utils.js +1 -0
- package/dist/astryx/Selector.d.ts +1 -0
- package/dist/astryx/Selector.js +1 -0
- package/dist/astryx/SideNav.d.ts +1 -0
- package/dist/astryx/SideNav.js +1 -0
- package/dist/astryx/SizeContext.d.ts +1 -0
- package/dist/astryx/SizeContext.js +1 -0
- package/dist/astryx/Skeleton.d.ts +1 -0
- package/dist/astryx/Skeleton.js +1 -0
- package/dist/astryx/Slider.d.ts +1 -0
- package/dist/astryx/Slider.js +1 -0
- package/dist/astryx/Spinner.d.ts +1 -0
- package/dist/astryx/Spinner.js +1 -0
- package/dist/astryx/Stack.d.ts +1 -0
- package/dist/astryx/Stack.js +1 -0
- package/dist/astryx/StatusDot.d.ts +1 -0
- package/dist/astryx/StatusDot.js +1 -0
- package/dist/astryx/Stepper.d.ts +1 -0
- package/dist/astryx/Stepper.js +1 -0
- package/dist/astryx/Switch.d.ts +1 -0
- package/dist/astryx/Switch.js +1 -0
- package/dist/astryx/TabList.d.ts +1 -0
- package/dist/astryx/TabList.js +1 -0
- package/dist/astryx/Table/utils.d.ts +1 -0
- package/dist/astryx/Table/utils.js +1 -0
- package/dist/astryx/Table.d.ts +1 -0
- package/dist/astryx/Table.js +1 -0
- package/dist/astryx/Text.d.ts +1 -0
- package/dist/astryx/Text.js +1 -0
- package/dist/astryx/TextArea.d.ts +1 -0
- package/dist/astryx/TextArea.js +1 -0
- package/dist/astryx/TextInput.d.ts +1 -0
- package/dist/astryx/TextInput.js +1 -0
- package/dist/astryx/Thumbnail.d.ts +1 -0
- package/dist/astryx/Thumbnail.js +1 -0
- package/dist/astryx/TimeInput.d.ts +1 -0
- package/dist/astryx/TimeInput.js +1 -0
- package/dist/astryx/Timer.d.ts +1 -0
- package/dist/astryx/Timer.js +1 -0
- package/dist/astryx/Timestamp.d.ts +1 -0
- package/dist/astryx/Timestamp.js +1 -0
- package/dist/astryx/Toast.d.ts +1 -0
- package/dist/astryx/Toast.js +1 -0
- package/dist/astryx/ToggleButton.d.ts +1 -0
- package/dist/astryx/ToggleButton.js +1 -0
- package/dist/astryx/Token.d.ts +1 -0
- package/dist/astryx/Token.js +1 -0
- package/dist/astryx/Tokenizer.d.ts +1 -0
- package/dist/astryx/Tokenizer.js +1 -0
- package/dist/astryx/Toolbar.d.ts +1 -0
- package/dist/astryx/Toolbar.js +1 -0
- package/dist/astryx/Tooltip.d.ts +1 -0
- package/dist/astryx/Tooltip.js +1 -0
- package/dist/astryx/TopNav.d.ts +1 -0
- package/dist/astryx/TopNav.js +1 -0
- package/dist/astryx/TreeList.d.ts +1 -0
- package/dist/astryx/TreeList.js +1 -0
- package/dist/astryx/Typeahead/utils.d.ts +1 -0
- package/dist/astryx/Typeahead/utils.js +1 -0
- package/dist/astryx/Typeahead.d.ts +1 -0
- package/dist/astryx/Typeahead.js +1 -0
- package/dist/astryx/VStack.d.ts +1 -0
- package/dist/astryx/VStack.js +1 -0
- package/dist/astryx/VisuallyHidden.d.ts +1 -0
- package/dist/astryx/VisuallyHidden.js +1 -0
- package/dist/astryx/astryx.css +3 -0
- package/dist/astryx/hooks.d.ts +1 -0
- package/dist/astryx/hooks.js +1 -0
- package/dist/astryx/i18n.d.ts +1 -0
- package/dist/astryx/i18n.js +1 -0
- package/dist/astryx/lab/lab.css +3 -0
- package/dist/astryx/lab.d.ts +6 -0
- package/dist/astryx/lab.js +6 -0
- package/dist/astryx/naming.d.ts +1 -0
- package/dist/astryx/naming.js +1 -0
- package/dist/astryx/reset.css +3 -0
- package/dist/astryx/tailwind-theme.css +3 -0
- package/dist/astryx/theme/neutral/built.d.ts +1 -0
- package/dist/astryx/theme/neutral/built.js +1 -0
- package/dist/astryx/theme/neutral/theme.css +3 -0
- package/dist/astryx/theme/neutral.d.ts +1 -0
- package/dist/astryx/theme/neutral.js +1 -0
- package/dist/astryx/theme/syntax.d.ts +1 -0
- package/dist/astryx/theme/syntax.js +1 -0
- package/dist/astryx/theme/tokens.d.ts +1 -0
- package/dist/astryx/theme/tokens.js +1 -0
- package/dist/astryx/theme/tokens.stylex.d.ts +1 -0
- package/dist/astryx/theme/tokens.stylex.js +1 -0
- package/dist/astryx/theme.d.ts +1 -0
- package/dist/astryx/theme.js +1 -0
- package/dist/astryx/utils.d.ts +1 -0
- package/dist/astryx/utils.js +1 -0
- package/dist/components/AlertModal/AlertModal.d.ts +14 -0
- package/dist/components/AlertModal/AlertModal.js +56 -0
- package/dist/components/AlertModal/AlertModal.js.map +1 -0
- package/dist/components/AlertModal/index.d.ts +2 -0
- package/dist/components/AlertModal/index.js +2 -0
- package/dist/components/BoardItemTitle/BoardItemTitle.d.ts +15 -0
- package/dist/components/BoardItemTitle/BoardItemTitle2.js +42 -0
- package/dist/components/BoardItemTitle/BoardItemTitle2.js.map +1 -0
- package/dist/components/BoardItemTitle/index.d.ts +2 -0
- package/dist/components/BoardItemTitle/index.js +2 -0
- package/dist/components/BooleanToken/BooleanToken.d.ts +15 -0
- package/dist/components/BooleanToken/BooleanToken.js +19 -0
- package/dist/components/BooleanToken/BooleanToken.js.map +1 -0
- package/dist/components/BooleanToken/BooleanToken.messages.d.ts +10 -0
- package/dist/components/BooleanToken/BooleanToken.messages.js +16 -0
- package/dist/components/BooleanToken/BooleanToken.messages.js.map +1 -0
- package/dist/components/BooleanToken/index.d.ts +2 -0
- package/dist/components/BooleanToken/index.js +2 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.d.ts +24 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.js +93 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.js.map +1 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.d.ts +14 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.js +20 -0
- package/dist/components/BulkEditFormItem/BulkEditFormItem.messages.js.map +1 -0
- package/dist/components/BulkEditFormItem/index.d.ts +2 -0
- package/dist/components/BulkEditFormItem/index.js +2 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.d.ts +23 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.messages.d.ts +10 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.messages.js +16 -0
- package/dist/components/BulkErrorModal/BulkErrorModal.messages.js.map +1 -0
- package/dist/components/BulkErrorModal/BulkErrorModal2.js +55 -0
- package/dist/components/BulkErrorModal/BulkErrorModal2.js.map +1 -0
- package/dist/components/BulkErrorModal/index.d.ts +2 -0
- package/dist/components/BulkErrorModal/index.js +2 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +43 -0
- package/dist/components/ColorPicker/ColorPicker.messages.d.ts +18 -0
- package/dist/components/ColorPicker/ColorPicker.messages.js +24 -0
- package/dist/components/ColorPicker/ColorPicker.messages.js.map +1 -0
- package/dist/components/ColorPicker/ColorPicker2.js +117 -0
- package/dist/components/ColorPicker/ColorPicker2.js.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +2 -0
- package/dist/components/ColorPicker/index.js +2 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.d.ts +35 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.js +75 -0
- package/dist/components/ConfirmPopover/ConfirmPopover.js.map +1 -0
- package/dist/components/ConfirmPopover/index.d.ts +2 -0
- package/dist/components/ConfirmPopover/index.js +2 -0
- package/dist/components/CountBadge/CountBadge.d.ts +24 -0
- package/dist/components/CountBadge/CountBadge2.js +35 -0
- package/dist/components/CountBadge/CountBadge2.js.map +1 -0
- package/dist/components/CountBadge/index.d.ts +2 -0
- package/dist/components/CountBadge/index.js +2 -0
- package/dist/components/CountdownBorder/CountdownBorder.d.ts +22 -0
- package/dist/components/CountdownBorder/CountdownBorder2.js +63 -0
- package/dist/components/CountdownBorder/CountdownBorder2.js.map +1 -0
- package/dist/components/CountdownBorder/index.d.ts +2 -0
- package/dist/components/CountdownBorder/index.js +2 -0
- package/dist/components/DataGrid/DataGrid.d.ts +212 -0
- package/dist/components/DataGrid/DataGrid.messages.d.ts +70 -0
- package/dist/components/DataGrid/DataGrid.messages.js +76 -0
- package/dist/components/DataGrid/DataGrid.messages.js.map +1 -0
- package/dist/components/DataGrid/DataGrid2.js +447 -0
- package/dist/components/DataGrid/DataGrid2.js.map +1 -0
- package/dist/components/DataGrid/DataGridExportModal.d.ts +30 -0
- package/dist/components/DataGrid/DataGridExportModal.js +125 -0
- package/dist/components/DataGrid/DataGridExportModal.js.map +1 -0
- package/dist/components/DataGrid/DataGridSettingsModal.d.ts +36 -0
- package/dist/components/DataGrid/DataGridSettingsModal.js +177 -0
- package/dist/components/DataGrid/DataGridSettingsModal.js.map +1 -0
- package/dist/components/DataGrid/index.d.ts +6 -0
- package/dist/components/DataGrid/index.js +4 -0
- package/dist/components/DataGrid/nodeToPlainText.d.ts +6 -0
- package/dist/components/DataGrid/nodeToPlainText.js +9 -0
- package/dist/components/DataGrid/nodeToPlainText.js.map +1 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.d.ts +78 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.d.ts +30 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.js +36 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal.messages.js.map +1 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal2.js +102 -0
- package/dist/components/DeleteConfirmModal/DeleteConfirmModal2.js.map +1 -0
- package/dist/components/DeleteConfirmModal/index.d.ts +2 -0
- package/dist/components/DeleteConfirmModal/index.js +2 -0
- package/dist/components/DigitPopIn/DigitPopIn.d.ts +8 -0
- package/dist/components/DigitPopIn/DigitPopIn2.js +30 -0
- package/dist/components/DigitPopIn/DigitPopIn2.js.map +1 -0
- package/dist/components/DigitPopIn/index.d.ts +2 -0
- package/dist/components/DigitPopIn/index.js +2 -0
- package/dist/components/DividedRow/DividedRow.d.ts +27 -0
- package/dist/components/DividedRow/DividedRow2.js +63 -0
- package/dist/components/DividedRow/DividedRow2.js.map +1 -0
- package/dist/components/DividedRow/index.d.ts +2 -0
- package/dist/components/DividedRow/index.js +2 -0
- package/dist/components/DoubleBadge/DoubleBadge.d.ts +14 -0
- package/dist/components/DoubleBadge/DoubleBadge2.js +28 -0
- package/dist/components/DoubleBadge/DoubleBadge2.js.map +1 -0
- package/dist/components/DoubleBadge/index.d.ts +2 -0
- package/dist/components/DoubleBadge/index.js +2 -0
- package/dist/components/DoubleToken/DoubleToken.d.ts +24 -0
- package/dist/components/DoubleToken/DoubleToken2.js +38 -0
- package/dist/components/DoubleToken/DoubleToken2.js.map +1 -0
- package/dist/components/DoubleToken/index.d.ts +2 -0
- package/dist/components/DoubleToken/index.js +2 -0
- package/dist/components/ErrorState/ErrorState.d.ts +7 -16
- package/dist/components/ErrorState/ErrorState2.js +33 -33
- package/dist/components/ErrorState/ErrorState2.js.map +1 -1
- package/dist/components/Form/ErrorList.d.ts +13 -0
- package/dist/components/Form/ErrorList.js +21 -0
- package/dist/components/Form/ErrorList.js.map +1 -0
- package/dist/components/Form/Field.d.ts +88 -0
- package/dist/components/Form/Field.js +212 -0
- package/dist/components/Form/Field.js.map +1 -0
- package/dist/components/Form/Form.d.ts +70 -0
- package/dist/components/Form/Form.js +130 -0
- package/dist/components/Form/Form.js.map +1 -0
- package/dist/components/Form/Form.messages.d.ts +96 -0
- package/dist/components/Form/Form.messages.js +96 -0
- package/dist/components/Form/Form.messages.js.map +1 -0
- package/dist/components/Form/FormConfigProvider.d.ts +20 -0
- package/dist/components/Form/FormConfigProvider.js +31 -0
- package/dist/components/Form/FormConfigProvider.js.map +1 -0
- package/dist/components/Form/FormItem.d.ts +56 -0
- package/dist/components/Form/FormItem.js +164 -0
- package/dist/components/Form/FormItem.js.map +1 -0
- package/dist/components/Form/FormItemVisual.d.ts +56 -0
- package/dist/components/Form/FormItemVisual2.js +117 -0
- package/dist/components/Form/FormItemVisual2.js.map +1 -0
- package/dist/components/Form/FormStore.d.ts +109 -0
- package/dist/components/Form/FormStore.js +494 -0
- package/dist/components/Form/FormStore.js.map +1 -0
- package/dist/components/Form/List.d.ts +22 -0
- package/dist/components/Form/List.js +65 -0
- package/dist/components/Form/List.js.map +1 -0
- package/dist/components/Form/context.d.ts +91 -0
- package/dist/components/Form/context.js +34 -0
- package/dist/components/Form/context.js.map +1 -0
- package/dist/components/Form/feedbackIcons.d.ts +13 -0
- package/dist/components/Form/feedbackIcons.js +45 -0
- package/dist/components/Form/feedbackIcons.js.map +1 -0
- package/dist/components/Form/index.d.ts +30 -0
- package/dist/components/Form/index.js +18 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Form/interface.d.ts +212 -0
- package/dist/components/Form/isEqual.d.ts +1 -0
- package/dist/components/Form/isEqual.js +61 -0
- package/dist/components/Form/isEqual.js.map +1 -0
- package/dist/components/Form/messages.d.ts +15 -0
- package/dist/components/Form/messages.js +52 -0
- package/dist/components/Form/messages.js.map +1 -0
- package/dist/components/Form/namePath.d.ts +78 -0
- package/dist/components/Form/namePath.js +120 -0
- package/dist/components/Form/namePath.js.map +1 -0
- package/dist/components/Form/useWatch.d.ts +11 -0
- package/dist/components/Form/useWatch.js +43 -0
- package/dist/components/Form/useWatch.js.map +1 -0
- package/dist/components/Form/validate.d.ts +16 -0
- package/dist/components/Form/validate.js +214 -0
- package/dist/components/Form/validate.js.map +1 -0
- package/dist/components/IconWithTooltip/IconWithTooltip.d.ts +19 -0
- package/dist/components/IconWithTooltip/IconWithTooltip2.js +38 -0
- package/dist/components/IconWithTooltip/IconWithTooltip2.js.map +1 -0
- package/dist/components/IconWithTooltip/accessibleLabel.d.ts +2 -0
- package/dist/components/IconWithTooltip/accessibleLabel.js +33 -0
- package/dist/components/IconWithTooltip/accessibleLabel.js.map +1 -0
- package/dist/components/IconWithTooltip/index.d.ts +2 -0
- package/dist/components/IconWithTooltip/index.js +2 -0
- package/dist/components/ImageWithFallback/ImageWithFallback.d.ts +11 -0
- package/dist/components/ImageWithFallback/ImageWithFallback2.js +28 -0
- package/dist/components/ImageWithFallback/ImageWithFallback2.js.map +1 -0
- package/dist/components/ImageWithFallback/index.d.ts +2 -0
- package/dist/components/ImageWithFallback/index.js +2 -0
- package/dist/components/ListBanner/ListBanner.d.ts +17 -0
- package/dist/components/ListBanner/ListBanner2.js +27 -0
- package/dist/components/ListBanner/ListBanner2.js.map +1 -0
- package/dist/components/ListBanner/index.d.ts +2 -0
- package/dist/components/ListBanner/index.js +2 -0
- package/dist/components/Modal/Modal.d.ts +65 -0
- package/dist/components/Modal/Modal2.js +226 -0
- package/dist/components/Modal/Modal2.js.map +1 -0
- package/dist/components/Modal/index.d.ts +15 -0
- package/dist/components/Modal/index.js +4 -0
- package/dist/components/Modal/modalStack.d.ts +65 -0
- package/dist/components/Modal/modalStack.js +81 -0
- package/dist/components/Modal/modalStack.js.map +1 -0
- package/dist/components/NotificationItem/NotificationItem.d.ts +14 -0
- package/dist/components/NotificationItem/NotificationItem2.js +40 -0
- package/dist/components/NotificationItem/NotificationItem2.js.map +1 -0
- package/dist/components/NotificationItem/index.d.ts +2 -0
- package/dist/components/NotificationItem/index.js +2 -0
- package/dist/components/NotificationStack/NotificationStack.d.ts +56 -0
- package/dist/components/NotificationStack/NotificationStack.messages.d.ts +6 -0
- package/dist/components/NotificationStack/NotificationStack.messages.js +10 -0
- package/dist/components/NotificationStack/NotificationStack.messages.js.map +1 -0
- package/dist/components/NotificationStack/NotificationStack2.js +154 -0
- package/dist/components/NotificationStack/NotificationStack2.js.map +1 -0
- package/dist/components/NotificationStack/index.d.ts +2 -0
- package/dist/components/NotificationStack/index.js +2 -0
- package/dist/components/OverlayScrollbar/OverlayScrollbar.d.ts +13 -0
- package/dist/components/OverlayScrollbar/OverlayScrollbar2.js +69 -0
- package/dist/components/OverlayScrollbar/OverlayScrollbar2.js.map +1 -0
- package/dist/components/OverlayScrollbar/index.d.ts +2 -0
- package/dist/components/OverlayScrollbar/index.js +2 -0
- package/dist/components/PageHeader/PageHeader.d.ts +24 -8
- package/dist/components/PageHeader/PageHeader.messages.d.ts +6 -0
- package/dist/components/PageHeader/PageHeader.messages.js +10 -0
- package/dist/components/PageHeader/PageHeader.messages.js.map +1 -0
- package/dist/components/PageHeader/PageHeader2.js +57 -30
- package/dist/components/PageHeader/PageHeader2.js.map +1 -1
- package/dist/components/PageLayout/PageLayout2.js +2 -2
- package/dist/components/PageLayout/PageLayout2.js.map +1 -1
- package/dist/components/PagedSelector/PagedSelector.d.ts +107 -0
- package/dist/components/PagedSelector/PagedSelector.messages.d.ts +30 -0
- package/dist/components/PagedSelector/PagedSelector.messages.js +36 -0
- package/dist/components/PagedSelector/PagedSelector.messages.js.map +1 -0
- package/dist/components/PagedSelector/PagedSelector2.js +220 -0
- package/dist/components/PagedSelector/PagedSelector2.js.map +1 -0
- package/dist/components/PagedSelector/PanelSearchInput.d.ts +22 -0
- package/dist/components/PagedSelector/PanelSearchInput.js +95 -0
- package/dist/components/PagedSelector/PanelSearchInput.js.map +1 -0
- package/dist/components/PagedSelector/index.d.ts +2 -0
- package/dist/components/PagedSelector/index.js +2 -0
- package/dist/components/ProgressWithLabel/ProgressWithLabel.d.ts +26 -0
- package/dist/components/ProgressWithLabel/ProgressWithLabel2.js +44 -0
- package/dist/components/ProgressWithLabel/ProgressWithLabel2.js.map +1 -0
- package/dist/components/ProgressWithLabel/index.d.ts +2 -0
- package/dist/components/ProgressWithLabel/index.js +2 -0
- package/dist/components/SelectionLabel/SelectionLabel.d.ts +23 -0
- package/dist/components/SelectionLabel/SelectionLabel.js +29 -0
- package/dist/components/SelectionLabel/SelectionLabel.js.map +1 -0
- package/dist/components/SelectionLabel/SelectionLabel.messages.d.ts +10 -0
- package/dist/components/SelectionLabel/SelectionLabel.messages.js +16 -0
- package/dist/components/SelectionLabel/SelectionLabel.messages.js.map +1 -0
- package/dist/components/SelectionLabel/index.d.ts +2 -0
- package/dist/components/SelectionLabel/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.messages.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.messages.js +24 -0
- package/dist/components/Skeleton/Skeleton.messages.js.map +1 -0
- package/dist/components/Skeleton/SkeletonCard.d.ts +4 -9
- package/dist/components/Skeleton/SkeletonCard2.js +53 -53
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonChart.d.ts +5 -11
- package/dist/components/Skeleton/SkeletonChart2.js +51 -45
- package/dist/components/Skeleton/SkeletonChart2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonRow.d.ts +5 -10
- package/dist/components/Skeleton/SkeletonRow2.js +35 -34
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -1
- package/dist/components/Skeleton/SkeletonShape.d.ts +10 -0
- package/dist/components/Skeleton/SkeletonShape2.js +23 -0
- package/dist/components/Skeleton/SkeletonShape2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +4 -9
- package/dist/components/Skeleton/SkeletonText2.js +22 -17
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -1
- package/dist/components/Skeleton/index.d.ts +3 -5
- package/dist/components/Skeleton/index.js +4 -5
- package/dist/components/SmoothHeight/SmoothHeight2.js +2 -2
- package/dist/components/SmoothHeight/SmoothHeight2.js.map +1 -1
- package/dist/components/StatCard/StatCard.d.ts +28 -16
- package/dist/components/StatCard/StatCard2.js +96 -89
- package/dist/components/StatCard/StatCard2.js.map +1 -1
- package/dist/components/StatCard/index.d.ts +1 -1
- package/dist/components/Statistic/Statistic.d.ts +30 -0
- package/dist/components/Statistic/Statistic.messages.d.ts +6 -0
- package/dist/components/Statistic/Statistic.messages.js +10 -0
- package/dist/components/Statistic/Statistic.messages.js.map +1 -0
- package/dist/components/Statistic/Statistic2.js +75 -0
- package/dist/components/Statistic/Statistic2.js.map +1 -0
- package/dist/components/Statistic/index.d.ts +2 -0
- package/dist/components/Statistic/index.js +2 -0
- package/dist/components/StepNumberInput/NumberStepper.d.ts +29 -0
- package/dist/components/StepNumberInput/NumberStepper.messages.d.ts +10 -0
- package/dist/components/StepNumberInput/NumberStepper.messages.js +16 -0
- package/dist/components/StepNumberInput/NumberStepper.messages.js.map +1 -0
- package/dist/components/StepNumberInput/NumberStepper2.js +50 -0
- package/dist/components/StepNumberInput/NumberStepper2.js.map +1 -0
- package/dist/components/StepNumberInput/StepNumberInput.d.ts +33 -0
- package/dist/components/StepNumberInput/StepNumberInput.js +48 -0
- package/dist/components/StepNumberInput/StepNumberInput.js.map +1 -0
- package/dist/components/StepNumberInput/index.d.ts +4 -0
- package/dist/components/StepNumberInput/index.js +3 -0
- package/dist/components/TextHighlighter/TextHighlighter.d.ts +14 -0
- package/dist/components/TextHighlighter/TextHighlighter2.js +29 -0
- package/dist/components/TextHighlighter/TextHighlighter2.js.map +1 -0
- package/dist/components/TextHighlighter/index.d.ts +2 -0
- package/dist/components/TextHighlighter/index.js +2 -0
- package/dist/components/TokenList/TokenList.d.ts +18 -0
- package/dist/components/TokenList/TokenList2.js +55 -0
- package/dist/components/TokenList/TokenList2.js.map +1 -0
- package/dist/components/TokenList/index.d.ts +2 -0
- package/dist/components/TokenList/index.js +2 -0
- package/dist/components/TokenRow/TokenRow.d.ts +27 -0
- package/dist/components/TokenRow/TokenRow.messages.d.ts +6 -0
- package/dist/components/TokenRow/TokenRow.messages.js +10 -0
- package/dist/components/TokenRow/TokenRow.messages.js.map +1 -0
- package/dist/components/TokenRow/TokenRow2.js +29 -0
- package/dist/components/TokenRow/TokenRow2.js.map +1 -0
- package/dist/components/TokenRow/index.d.ts +2 -0
- package/dist/components/TokenRow/index.js +2 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.d.ts +29 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.js +49 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.js.map +1 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.messages.d.ts +6 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.messages.js +10 -0
- package/dist/components/UncontrolledInput/UncontrolledInput.messages.js.map +1 -0
- package/dist/components/UncontrolledInput/index.d.ts +2 -0
- package/dist/components/UncontrolledInput/index.js +2 -0
- package/dist/components/UnitGrid/UnitGrid.d.ts +56 -0
- package/dist/components/UnitGrid/UnitGrid.geometry.d.ts +102 -0
- package/dist/components/UnitGrid/UnitGrid.geometry.js +172 -0
- package/dist/components/UnitGrid/UnitGrid.geometry.js.map +1 -0
- package/dist/components/UnitGrid/UnitGrid.messages.d.ts +14 -0
- package/dist/components/UnitGrid/UnitGrid.messages.js +20 -0
- package/dist/components/UnitGrid/UnitGrid.messages.js.map +1 -0
- package/dist/components/UnitGrid/UnitGrid2.js +393 -0
- package/dist/components/UnitGrid/UnitGrid2.js.map +1 -0
- package/dist/components/UnitGrid/UnitGridSkeleton.d.ts +9 -0
- package/dist/components/UnitGrid/UnitGridSkeleton.js +73 -0
- package/dist/components/UnitGrid/UnitGridSkeleton.js.map +1 -0
- package/dist/components/UnitGrid/index.d.ts +4 -0
- package/dist/components/UnitGrid/index.js +3 -0
- package/dist/forks/ComplexSelector/ComplexSelector.d.ts +144 -0
- package/dist/forks/ComplexSelector/ComplexSelector.js +157 -0
- package/dist/forks/ComplexSelector/ComplexSelector.js.map +1 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.d.ts +129 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js +133 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js.map +1 -0
- package/dist/forks/ComplexSelector/index.d.ts +7 -0
- package/dist/forks/ComplexSelector/index.js +2 -0
- package/dist/forks/Drawer/Drawer.d.ts +109 -0
- package/dist/forks/Drawer/Drawer.js +76 -0
- package/dist/forks/Drawer/Drawer.js.map +1 -0
- package/dist/forks/Drawer/Drawer.styles.d.ts +106 -0
- package/dist/forks/Drawer/Drawer.styles.js +104 -0
- package/dist/forks/Drawer/Drawer.styles.js.map +1 -0
- package/dist/forks/Drawer/index.d.ts +6 -0
- package/dist/forks/Drawer/index.js +2 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.d.ts +20 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.js +83 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.js.map +1 -0
- package/dist/forks/Tour/Tour.d.ts +58 -0
- package/dist/forks/Tour/Tour.js +55 -0
- package/dist/forks/Tour/Tour.js.map +1 -0
- package/dist/forks/Tour/TourContext.d.ts +37 -0
- package/dist/forks/Tour/TourContext.js +8 -0
- package/dist/forks/Tour/TourContext.js.map +1 -0
- package/dist/forks/Tour/TourStep.d.ts +43 -0
- package/dist/forks/Tour/TourStep.js +134 -0
- package/dist/forks/Tour/TourStep.js.map +1 -0
- package/dist/forks/Tour/TourStep.styles.d.ts +23 -0
- package/dist/forks/Tour/TourStep.styles.js +28 -0
- package/dist/forks/Tour/TourStep.styles.js.map +1 -0
- package/dist/forks/Tour/index.d.ts +11 -0
- package/dist/forks/Tour/index.js +4 -0
- package/dist/forks/Tour/useTour.d.ts +26 -0
- package/dist/forks/Tour/useTour.js +20 -0
- package/dist/forks/Tour/useTour.js.map +1 -0
- package/dist/forks/compiled.d.ts +5 -0
- package/dist/forks/compiled.js +8 -0
- package/dist/forks/compiled.js.map +1 -0
- package/dist/i18n/catalog.d.ts +12 -0
- package/dist/i18n/catalog.js +46 -0
- package/dist/i18n/catalog.js.map +1 -0
- package/dist/i18n/common.messages.d.ts +31 -0
- package/dist/i18n/common.messages.js +32 -0
- package/dist/i18n/common.messages.js.map +1 -0
- package/dist/i18n/index.d.ts +21 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/locales/de-DE.js +331 -0
- package/dist/i18n/locales/de-DE.js.map +1 -0
- package/dist/i18n/locales/el-GR.js +331 -0
- package/dist/i18n/locales/el-GR.js.map +1 -0
- package/dist/i18n/locales/es-ES.js +331 -0
- package/dist/i18n/locales/es-ES.js.map +1 -0
- package/dist/i18n/locales/fi-FI.js +331 -0
- package/dist/i18n/locales/fi-FI.js.map +1 -0
- package/dist/i18n/locales/fr-FR.js +331 -0
- package/dist/i18n/locales/fr-FR.js.map +1 -0
- package/dist/i18n/locales/id-ID.js +331 -0
- package/dist/i18n/locales/id-ID.js.map +1 -0
- package/dist/i18n/locales/it-IT.js +331 -0
- package/dist/i18n/locales/it-IT.js.map +1 -0
- package/dist/i18n/locales/ja-JP.js +351 -0
- package/dist/i18n/locales/ja-JP.js.map +1 -0
- package/dist/i18n/locales/ko-KR.js +351 -0
- package/dist/i18n/locales/ko-KR.js.map +1 -0
- package/dist/i18n/locales/mn-MN.js +327 -0
- package/dist/i18n/locales/mn-MN.js.map +1 -0
- package/dist/i18n/locales/ms-MY.js +331 -0
- package/dist/i18n/locales/ms-MY.js.map +1 -0
- package/dist/i18n/locales/pl-PL.js +331 -0
- package/dist/i18n/locales/pl-PL.js.map +1 -0
- package/dist/i18n/locales/pt-BR.js +331 -0
- package/dist/i18n/locales/pt-BR.js.map +1 -0
- package/dist/i18n/locales/pt-PT.js +331 -0
- package/dist/i18n/locales/pt-PT.js.map +1 -0
- package/dist/i18n/locales/ru-RU.js +331 -0
- package/dist/i18n/locales/ru-RU.js.map +1 -0
- package/dist/i18n/locales/th-TH.js +331 -0
- package/dist/i18n/locales/th-TH.js.map +1 -0
- package/dist/i18n/locales/tr-TR.js +331 -0
- package/dist/i18n/locales/tr-TR.js.map +1 -0
- package/dist/i18n/locales/vi-VN.js +331 -0
- package/dist/i18n/locales/vi-VN.js.map +1 -0
- package/dist/i18n/locales/zh-CN.js +331 -0
- package/dist/i18n/locales/zh-CN.js.map +1 -0
- package/dist/i18n/locales/zh-TW.js +331 -0
- package/dist/i18n/locales/zh-TW.js.map +1 -0
- package/dist/i18n/messages.d.ts +13 -0
- package/dist/i18n/messages.js +63 -0
- package/dist/i18n/messages.js.map +1 -0
- package/dist/i18n/translateWithNodes.d.ts +3 -0
- package/dist/i18n/translateWithNodes.js +14 -0
- package/dist/i18n/translateWithNodes.js.map +1 -0
- package/dist/i18n/useUicTranslator.d.ts +5 -0
- package/dist/i18n/useUicTranslator.js +38 -0
- package/dist/i18n/useUicTranslator.js.map +1 -0
- package/dist/index.d.ts +101 -27
- package/dist/index.js +63 -23
- package/dist/instance.d.ts +31 -0
- package/dist/instance.js +33 -0
- package/dist/instance.js.map +1 -0
- package/dist/legacy-tokens.css +177 -0
- package/dist/locales/af-ZA.generated.d.ts +8 -0
- package/dist/locales/af-ZA.generated.js +381 -0
- package/dist/locales/af-ZA.json +1483 -0
- package/dist/locales/ar-SA.generated.d.ts +8 -0
- package/dist/locales/ar-SA.generated.js +381 -0
- package/dist/locales/ar-SA.json +1483 -0
- package/dist/locales/ca-ES.generated.d.ts +8 -0
- package/dist/locales/ca-ES.generated.js +381 -0
- package/dist/locales/ca-ES.json +1483 -0
- package/dist/locales/cs-CZ.generated.d.ts +8 -0
- package/dist/locales/cs-CZ.generated.js +381 -0
- package/dist/locales/cs-CZ.json +1483 -0
- package/dist/locales/da-DK.generated.d.ts +8 -0
- package/dist/locales/da-DK.generated.js +381 -0
- package/dist/locales/da-DK.json +1483 -0
- package/dist/locales/de-DE.generated.d.ts +8 -0
- package/dist/locales/de-DE.generated.js +381 -0
- package/dist/locales/de-DE.json +1483 -0
- package/dist/locales/el-GR.generated.d.ts +8 -0
- package/dist/locales/el-GR.generated.js +381 -0
- package/dist/locales/el-GR.json +1483 -0
- package/dist/locales/en.generated.d.ts +8 -0
- package/dist/locales/en.generated.js +385 -0
- package/dist/locales/en.json +1498 -0
- package/dist/locales/es-ES.generated.d.ts +8 -0
- package/dist/locales/es-ES.generated.js +381 -0
- package/dist/locales/es-ES.json +1483 -0
- package/dist/locales/fi-FI.generated.d.ts +8 -0
- package/dist/locales/fi-FI.generated.js +381 -0
- package/dist/locales/fi-FI.json +1483 -0
- package/dist/locales/fr-FR.generated.d.ts +8 -0
- package/dist/locales/fr-FR.generated.js +381 -0
- package/dist/locales/fr-FR.json +1483 -0
- package/dist/locales/he-IL.generated.d.ts +8 -0
- package/dist/locales/he-IL.generated.js +381 -0
- package/dist/locales/he-IL.json +1483 -0
- package/dist/locales/hu-HU.generated.d.ts +8 -0
- package/dist/locales/hu-HU.generated.js +381 -0
- package/dist/locales/hu-HU.json +1483 -0
- package/dist/locales/it-IT.generated.d.ts +8 -0
- package/dist/locales/it-IT.generated.js +381 -0
- package/dist/locales/it-IT.json +1483 -0
- package/dist/locales/ja-JP.generated.d.ts +8 -0
- package/dist/locales/ja-JP.generated.js +381 -0
- package/dist/locales/ja-JP.json +1483 -0
- package/dist/locales/ko-KR.generated.d.ts +8 -0
- package/dist/locales/ko-KR.generated.js +381 -0
- package/dist/locales/ko-KR.json +1483 -0
- package/dist/locales/nl-NL.generated.d.ts +8 -0
- package/dist/locales/nl-NL.generated.js +381 -0
- package/dist/locales/nl-NL.json +1483 -0
- package/dist/locales/no-NO.generated.d.ts +8 -0
- package/dist/locales/no-NO.generated.js +381 -0
- package/dist/locales/no-NO.json +1483 -0
- package/dist/locales/pl-PL.generated.d.ts +8 -0
- package/dist/locales/pl-PL.generated.js +381 -0
- package/dist/locales/pl-PL.json +1483 -0
- package/dist/locales/pseudo.generated.d.ts +8 -0
- package/dist/locales/pseudo.generated.js +385 -0
- package/dist/locales/pseudo.json +1124 -0
- package/dist/locales/pt-BR.generated.d.ts +8 -0
- package/dist/locales/pt-BR.generated.js +381 -0
- package/dist/locales/pt-BR.json +1483 -0
- package/dist/locales/pt-PT.generated.d.ts +8 -0
- package/dist/locales/pt-PT.generated.js +381 -0
- package/dist/locales/pt-PT.json +1483 -0
- package/dist/locales/ro-RO.generated.d.ts +8 -0
- package/dist/locales/ro-RO.generated.js +381 -0
- package/dist/locales/ro-RO.json +1483 -0
- package/dist/locales/ru-RU.generated.d.ts +8 -0
- package/dist/locales/ru-RU.generated.js +381 -0
- package/dist/locales/ru-RU.json +1483 -0
- package/dist/locales/sr-SP.generated.d.ts +8 -0
- package/dist/locales/sr-SP.generated.js +381 -0
- package/dist/locales/sr-SP.json +1483 -0
- package/dist/locales/sv-SE.generated.d.ts +8 -0
- package/dist/locales/sv-SE.generated.js +381 -0
- package/dist/locales/sv-SE.json +1483 -0
- package/dist/locales/tr-TR.generated.d.ts +8 -0
- package/dist/locales/tr-TR.generated.js +381 -0
- package/dist/locales/tr-TR.json +1483 -0
- package/dist/locales/uk-UA.generated.d.ts +8 -0
- package/dist/locales/uk-UA.generated.js +381 -0
- package/dist/locales/uk-UA.json +1483 -0
- package/dist/locales/vi-VN.generated.d.ts +8 -0
- package/dist/locales/vi-VN.generated.js +381 -0
- package/dist/locales/vi-VN.json +1483 -0
- package/dist/locales/zh-CN.generated.d.ts +8 -0
- package/dist/locales/zh-CN.generated.js +381 -0
- package/dist/locales/zh-CN.json +1483 -0
- package/dist/locales/zh-TW.generated.d.ts +8 -0
- package/dist/locales/zh-TW.generated.js +381 -0
- package/dist/locales/zh-TW.json +1483 -0
- package/dist/styles/base.css +24 -2
- package/dist/styles/themes/orange-dark.css +4 -0
- package/dist/styles/themes/orange-light.css +4 -0
- package/dist/theme/lablup/built/lablup.d.ts +13 -0
- package/dist/theme/lablup/built/lablup.js +567 -0
- package/dist/theme/lablup/built/lablup.variants.d.ts +16 -0
- package/dist/theme/lablup/built/theme.css +720 -0
- package/dist/theme/lablup/index.d.ts +9 -0
- package/dist/theme/lablup/index.js +2 -0
- package/dist/theme/lablup/lablupTheme.d.ts +10 -0
- package/dist/theme/lablup/lablupTheme.js +21 -0
- package/dist/theme/lablup/lablupTheme.js.map +1 -0
- package/dist/ui-common-locales/de-DE.json +326 -0
- package/dist/ui-common-locales/el-GR.json +326 -0
- package/dist/ui-common-locales/en.json +346 -0
- package/dist/ui-common-locales/es-ES.json +326 -0
- package/dist/ui-common-locales/fi-FI.json +326 -0
- package/dist/ui-common-locales/fr-FR.json +326 -0
- package/dist/ui-common-locales/id-ID.json +326 -0
- package/dist/ui-common-locales/it-IT.json +326 -0
- package/dist/ui-common-locales/ja-JP.json +346 -0
- package/dist/ui-common-locales/ko-KR.json +346 -0
- package/dist/ui-common-locales/mn-MN.json +322 -0
- package/dist/ui-common-locales/ms-MY.json +326 -0
- package/dist/ui-common-locales/pl-PL.json +326 -0
- package/dist/ui-common-locales/pt-BR.json +326 -0
- package/dist/ui-common-locales/pt-PT.json +326 -0
- package/dist/ui-common-locales/ru-RU.json +326 -0
- package/dist/ui-common-locales/th-TH.json +326 -0
- package/dist/ui-common-locales/tr-TR.json +326 -0
- package/dist/ui-common-locales/vi-VN.json +326 -0
- package/dist/ui-common-locales/zh-CN.json +326 -0
- package/dist/ui-common-locales/zh-TW.json +326 -0
- package/dist/ui-common.css +51 -0
- package/exports.customs.json +62 -0
- package/exports.exclude.json +47 -0
- package/package.json +585 -21
- package/dist/assets/components/Badge/Badge.css +0 -1
- package/dist/assets/components/BaseCard/BaseCard.css +0 -1
- package/dist/assets/components/Button/Button.css +0 -1
- package/dist/assets/components/DataTable/DataTable.css +0 -1
- package/dist/assets/components/Drawer/Drawer.css +0 -1
- package/dist/assets/components/EmptyState/EmptyState.css +0 -1
- package/dist/assets/components/ProgressBar/ProgressBar.css +0 -1
- package/dist/assets/components/Skeleton/Skeleton.css +0 -1
- package/dist/assets/components/StatusTag/StatusTag.css +0 -1
- package/dist/assets/components/Tabs/Tabs.css +0 -1
- package/dist/assets/components/Tooltip/Tooltip.css +0 -1
- package/dist/components/Badge/Badge.d.ts +0 -7
- package/dist/components/Badge/Badge2.js +0 -20
- package/dist/components/Badge/Badge2.js.map +0 -1
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Badge/index.js +0 -2
- package/dist/components/BaseCard/BaseCard.d.ts +0 -57
- package/dist/components/BaseCard/BaseCard2.js +0 -37
- package/dist/components/BaseCard/BaseCard2.js.map +0 -1
- package/dist/components/BaseCard/index.d.ts +0 -2
- package/dist/components/BaseCard/index.js +0 -2
- package/dist/components/Button/Button.d.ts +0 -54
- package/dist/components/Button/Button2.js +0 -75
- package/dist/components/Button/Button2.js.map +0 -1
- package/dist/components/Button/index.d.ts +0 -5
- package/dist/components/Button/index.js +0 -2
- package/dist/components/DataTable/DataTable.d.ts +0 -144
- package/dist/components/DataTable/DataTable2.js +0 -244
- package/dist/components/DataTable/DataTable2.js.map +0 -1
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/components/DataTable/index.js +0 -2
- package/dist/components/Drawer/Drawer.d.ts +0 -25
- package/dist/components/Drawer/Drawer2.js +0 -107
- package/dist/components/Drawer/Drawer2.js.map +0 -1
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Drawer/index.js +0 -2
- package/dist/components/EmptyState/EmptyState.d.ts +0 -52
- package/dist/components/EmptyState/EmptyState.example.d.ts +0 -8
- package/dist/components/EmptyState/EmptyState2.js +0 -62
- package/dist/components/EmptyState/EmptyState2.js.map +0 -1
- package/dist/components/EmptyState/index.d.ts +0 -10
- package/dist/components/EmptyState/index.js +0 -2
- package/dist/components/ProgressBar/ProgressBar.d.ts +0 -22
- package/dist/components/ProgressBar/ProgressBar2.js +0 -37
- package/dist/components/ProgressBar/ProgressBar2.js.map +0 -1
- package/dist/components/ProgressBar/index.d.ts +0 -2
- package/dist/components/ProgressBar/index.js +0 -2
- package/dist/components/Skeleton/Skeleton.d.ts +0 -25
- package/dist/components/Skeleton/Skeleton2.js +0 -27
- package/dist/components/Skeleton/Skeleton2.js.map +0 -1
- package/dist/components/StatusTag/StatusTag.d.ts +0 -38
- package/dist/components/StatusTag/StatusTag2.js +0 -45
- package/dist/components/StatusTag/StatusTag2.js.map +0 -1
- package/dist/components/StatusTag/index.d.ts +0 -2
- package/dist/components/StatusTag/index.js +0 -2
- package/dist/components/Tabs/Tabs.d.ts +0 -94
- package/dist/components/Tabs/Tabs2.js +0 -412
- package/dist/components/Tabs/Tabs2.js.map +0 -1
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/Tabs/index.js +0 -2
- package/dist/components/Tooltip/Tooltip.d.ts +0 -16
- package/dist/components/Tooltip/Tooltip2.js +0 -68
- package/dist/components/Tooltip/Tooltip2.js.map +0 -1
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/Tooltip/index.js +0 -2
- package/dist/hooks/index.js +0 -2
- package/dist/icons/AlertCircleIcon.d.ts +0 -11
- package/dist/icons/AlertCircleIcon.js +0 -26
- package/dist/icons/AlertCircleIcon.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","names":[],"sources":["../../../src/components/Form/validate.ts"],"sourcesContent":["/**\n * Rule engine: a behavioural port of the slice of async-validator that\n * rc-field-form uses, for the rule keys `required`, `message`, `validator`,\n * `type`, `max`, `min`, `pattern`, `warningOnly` and `whitespace`, and the\n * `type` values `number`, `string`, `email`, `url` and `object`.\n *\n * Two upstream quirks are reproduced on purpose, because the messages users\n * see depend on them:\n *\n * 1. Method dispatch by key shape. async-validator picks its validator from\n * `Object.keys(rule)` minus `message`: exactly `['required']` uses the bare\n * required check, anything else falls through to `rule.type ?? 'string'`\n * (or `'pattern'` for a RegExp `pattern` without a `type`). So `{ max: 64 }`\n * on a non-string value also reports \"is not a valid string\", and\n * `{ pattern, max }` ignores `max`.\n * 2. `message` replaces, and `''` is a message. Once a rule produces an error,\n * a non-null `rule.message` replaces the generated text, so an empty-string\n * message yields an error state without an error line.\n */\nimport type { RuleObject, RuleType, StoreValue, ValidateMessages } from \"./interface\";\nimport type { InternalNamePath } from \"./namePath\";\nimport { toArray } from \"./namePath\";\nimport { isValidElement, cloneElement } from \"react\";\n\n/** Sentinel used when a validator throws synchronously. */\nconst CODE_LOGIC_ERROR = \"CODE_LOGIC_ERROR\";\n\n// ============================ Message formatting ============================\n\nconst formatRegExp = /%[sdj%]/g;\n\n/**\n * async-validator's `format`. Our templates use `${}` placeholders (resolved\n * later by `replaceMessage`), so in practice this only matters for the\n * function-template form that a locale may supply.\n */\nfunction format(template: any, ...args: any[]): any {\n let i = 0;\n const len = args.length;\n if (typeof template === \"function\") {\n return template(...args);\n }\n if (typeof template === \"string\") {\n return template.replace(formatRegExp, (x) => {\n if (x === \"%%\") return \"%\";\n if (i >= len) return x;\n switch (x) {\n case \"%s\":\n return String(args[i++]);\n case \"%d\":\n return String(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch {\n return \"[Circular]\";\n }\n default:\n return x;\n }\n });\n }\n return template;\n}\n\n/** `I'm ${name}` + `{ name: 'bamboo' }` => `I'm bamboo`. `\\${x}` escapes. */\nfunction replaceMessage(template: string, kv: Record<string, any>): string {\n return template.replace(/\\\\?\\$\\{\\w+\\}/g, (str) => {\n if (str.startsWith(\"\\\\\")) {\n return str.slice(1);\n }\n const key = str.slice(2, -1);\n return kv[key];\n });\n}\n\n// ================================ Type checks ===============================\n\n// http://emailregex.com/ — copied verbatim from async-validator so the same\n// addresses pass/fail as before the migration.\nconst EMAIL_PATTERN =\n /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+\\.)+[a-zA-Z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{2,}))$/;\n\nlet urlReg: RegExp | undefined;\n/** Lazily built URL regex (kevva/url-regex), same construction as upstream. */\nfunction getUrlRegex(): RegExp {\n if (urlReg) return urlReg;\n const v4 =\n \"(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}\";\n const v6seg = \"[a-fA-F\\\\d]{1,4}\";\n const v6List = [\n `(?:${v6seg}:){7}(?:${v6seg}|:)`,\n `(?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)`,\n `(?:${v6seg}:){5}(?::${v4}|(?::${v6seg}){1,2}|:)`,\n `(?:${v6seg}:){4}(?:(?::${v6seg}){0,1}:${v4}|(?::${v6seg}){1,3}|:)`,\n `(?:${v6seg}:){3}(?:(?::${v6seg}){0,2}:${v4}|(?::${v6seg}){1,4}|:)`,\n `(?:${v6seg}:){2}(?:(?::${v6seg}){0,3}:${v4}|(?::${v6seg}){1,5}|:)`,\n `(?:${v6seg}:){1}(?:(?::${v6seg}){0,4}:${v4}|(?::${v6seg}){1,6}|:)`,\n `(?::(?:(?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:))`,\n ];\n const v6 = `(?:${v6List.join(\"|\")})(?:%[0-9a-zA-Z]{1,})?`;\n const protocol = \"(?:(?:[a-z]+:)?//)\";\n const auth = \"(?:\\\\S+(?::\\\\S*)?@)?\";\n const host = \"(?:(?:[a-z\\\\u00a1-\\\\uffff0-9][-_]*)*[a-z\\\\u00a1-\\\\uffff0-9]+)\";\n const domain = \"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)*\";\n const tld = \"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,}))\";\n const port = \"(?::\\\\d{2,5})?\";\n const path = '(?:[/?#][^\\\\s\"]*)?';\n const regex = `(?:${protocol}|www\\\\.)${auth}(?:localhost|${v4}|${v6}|${host}${domain}${tld})${port}${path}`;\n urlReg = new RegExp(`(?:^${regex}$)`, \"i\");\n return urlReg;\n}\n\nconst TYPE_CHECKS: Partial<Record<string, (value: any) => boolean>> = {\n number: (value) => !isNaN(value) && typeof value === \"number\",\n object: (value) => typeof value === \"object\" && !Array.isArray(value),\n email: (value) =>\n typeof value === \"string\" && value.length <= 320 && EMAIL_PATTERN.test(value),\n url: (value) =>\n typeof value === \"string\" && value.length <= 2048 && getUrlRegex().test(value),\n};\n\n/** Types whose \"empty\" notion includes the empty string. */\nfunction isNativeStringType(type?: string) {\n return type === \"string\" || type === \"url\" || type === \"email\" || type === \"pattern\";\n}\n\nfunction isEmptyValue(value: any, type?: string): boolean {\n if (value === undefined || value === null) return true;\n if (type === \"array\" && Array.isArray(value) && !value.length) return true;\n if (isNativeStringType(type) && typeof value === \"string\" && !value) return true;\n return false;\n}\n\n// ============================= Declarative rules ============================\n\n/**\n * `type` widens to `string` here because the dispatcher normalises it the way\n * async-validator does: an absent type becomes `'string'` and a bare RegExp\n * `pattern` becomes `'pattern'` — neither of which is a public `RuleType`.\n */\ntype NormalizedRule = Omit<RuleObject, \"type\"> & { type?: string };\n\ninterface RuleCtx {\n rule: NormalizedRule;\n value: StoreValue;\n name: string;\n messages: ValidateMessages;\n errors: any[];\n}\n\nfunction checkRequired(\n { rule, value, name, messages, errors }: RuleCtx,\n type?: string,\n) {\n if (rule.required && isEmptyValue(value, type || rule.type)) {\n errors.push(format(messages.required, name));\n }\n}\n\nfunction checkType({ rule, value, name, messages, errors }: RuleCtx) {\n if (rule.required && value === undefined) {\n checkRequired({ rule, value, name, messages, errors });\n return;\n }\n const ruleType = rule.type;\n const custom = TYPE_CHECKS[ruleType as string];\n if (custom) {\n if (!custom(value)) {\n errors.push(format(messages.types?.[ruleType as RuleType], name, ruleType));\n }\n } else if (ruleType && typeof value !== ruleType) {\n errors.push(format(messages.types?.[ruleType as RuleType], name, ruleType));\n }\n}\n\n// Surrogate pairs count as one character, matching upstream's `range`.\nconst SP_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction checkRange({ rule, value, name, messages, errors }: RuleCtx) {\n const hasMin = typeof rule.min === \"number\";\n const hasMax = typeof rule.max === \"number\";\n let val: number;\n let key: \"number\" | \"string\" | \"array\";\n if (typeof value === \"number\") {\n key = \"number\";\n val = value;\n } else if (typeof value === \"string\") {\n key = \"string\";\n val = value.replace(SP_REGEXP, \"_\").length;\n } else if (Array.isArray(value)) {\n key = \"array\";\n val = value.length;\n } else {\n // Unsupported type for range validation — upstream bails out silently.\n return;\n }\n const section = messages[key] as Record<string, any> | undefined;\n if (hasMin && !hasMax && val < (rule.min as number)) {\n errors.push(format(section?.min, name, rule.min));\n } else if (hasMax && !hasMin && val > (rule.max as number)) {\n errors.push(format(section?.max, name, rule.max));\n } else if (\n hasMin &&\n hasMax &&\n (val < (rule.min as number) || val > (rule.max as number))\n ) {\n errors.push(format(section?.range, name, rule.min, rule.max));\n }\n}\n\nfunction checkPattern({ rule, value, name, messages, errors }: RuleCtx) {\n if (rule.pattern instanceof RegExp) {\n // Reset in case the RegExp carries the `g` flag — a stateful `lastIndex`\n // makes the same rule pass and fail alternately.\n rule.pattern.lastIndex = 0;\n if (!rule.pattern.test(value)) {\n errors.push(format(messages.pattern?.mismatch, name, value, rule.pattern));\n }\n }\n}\n\nfunction checkWhitespace({ value, name, messages, errors }: RuleCtx) {\n if (/^\\s+$/.test(value) || value === \"\") {\n errors.push(format(messages.whitespace, name));\n }\n}\n\n/**\n * Run the declarative validator async-validator would have selected.\n * `ctx.rule.type` is already normalised by the caller.\n */\nfunction runDeclarative(method: string, ctx: RuleCtx) {\n const { rule, value } = ctx;\n switch (method) {\n case \"required\": {\n checkRequired(ctx, Array.isArray(value) ? \"array\" : typeof value);\n return;\n }\n case \"number\": {\n const numeric = { ...ctx, value: value === \"\" ? undefined : value };\n if (isEmptyValue(numeric.value) && !rule.required) return;\n checkRequired(numeric);\n if (numeric.value !== undefined) {\n checkType(numeric);\n checkRange(numeric);\n }\n return;\n }\n case \"object\": {\n if (isEmptyValue(value) && !rule.required) return;\n checkRequired(ctx);\n if (value !== undefined) {\n checkType(ctx);\n }\n return;\n }\n case \"email\":\n case \"url\": {\n if (isEmptyValue(value, method) && !rule.required) return;\n checkRequired(ctx, method);\n if (!isEmptyValue(value, method)) {\n checkType(ctx);\n }\n return;\n }\n case \"pattern\": {\n if (isEmptyValue(value, \"string\") && !rule.required) return;\n checkRequired(ctx);\n if (!isEmptyValue(value, \"string\")) {\n checkPattern(ctx);\n }\n return;\n }\n // 'string' and anything else fall back to the string validator, which is\n // also async-validator's default when no `type` is declared.\n default: {\n if (isEmptyValue(value, \"string\") && !rule.required) return;\n checkRequired(ctx, \"string\");\n if (!isEmptyValue(value, \"string\")) {\n checkType(ctx);\n checkRange(ctx);\n checkPattern(ctx);\n if (rule.whitespace === true) {\n checkWhitespace(ctx);\n }\n }\n }\n }\n}\n\n// ============================= Custom validators ============================\n\n/**\n * Collapse the promise/callback bridge rc-component's `form` builds around a\n * user `validator` into a single promise for the raw \"callback argument\".\n *\n * Net semantics preserved from the two-layer upstream wrapping:\n * resolve() -> no error\n * reject('msg') / Error -> that message\n * reject() -> one error whose text is a single space, i.e.\n * an error STATE with no readable line\n * callback('msg') -> that message, one microtask later\n * synchronous throw -> the generic `default` message\n * A validator that both returns a promise and calls `callback` has its\n * callback ignored, exactly as upstream warns.\n */\nfunction runCustomValidator(rule: RuleObject, value: StoreValue): Promise<any> {\n return new Promise((resolve) => {\n let settled = false;\n let hasPromise = false;\n const finish = (arg: any) => {\n if (settled) return;\n settled = true;\n resolve(arg);\n };\n const userCallback = (...args: any[]) => {\n Promise.resolve().then(() => {\n if (!hasPromise) {\n finish(args.length ? args[0] : undefined);\n }\n });\n };\n let returned: any;\n try {\n returned = rule.validator!(rule, value, userCallback);\n } catch (error) {\n // Upstream logs and converts a thrown validator into the generic\n // `default` message; swallowing it silently would hide real bugs.\n console.error(error);\n finish(CODE_LOGIC_ERROR);\n return;\n }\n hasPromise =\n !!returned &&\n typeof returned.then === \"function\" &&\n typeof returned.catch === \"function\";\n if (hasPromise) {\n returned.then(\n () => finish(undefined),\n (err: any) => finish(err || \" \"),\n );\n }\n });\n}\n\n// ================================ Rule driver ===============================\n\n/** Which async-validator method would handle this rule? */\nfunction pickMethod(rule: RuleObject): string {\n const keys = Object.keys(rule).filter((key) => key !== \"message\");\n if (keys.length === 1 && keys[0] === \"required\") {\n return \"required\";\n }\n if (rule.type === undefined && rule.pattern instanceof RegExp) {\n return \"pattern\";\n }\n return rule.type ?? \"string\";\n}\n\nasync function validateRule(\n name: string,\n value: StoreValue,\n rule: RuleObject,\n messages: ValidateMessages,\n messageVariables?: Record<string, string>,\n): Promise<any[]> {\n let rawErrors: any[] = [];\n // Kept in sync with the declarative branch so `${type}` interpolates the\n // normalised type, not `undefined`, when the rule's type was inferred.\n let effectiveRule: NormalizedRule = rule;\n\n if (rule.validator) {\n const cbArg = await runCustomValidator(rule, value);\n rawErrors = cbArg === undefined ? [] : Array.isArray(cbArg) ? cbArg : [cbArg];\n } else {\n const method = pickMethod(rule);\n // `getType` normalises the rule's own `type` before the validators read\n // it — `undefined` becomes `'string'`, a bare RegExp becomes `'pattern'`.\n effectiveRule = {\n ...rule,\n type: method === \"required\" ? rule.type : method,\n };\n const ctx: RuleCtx = {\n rule: effectiveRule,\n value,\n name,\n messages,\n errors: [],\n };\n runDeclarative(method, ctx);\n rawErrors = ctx.errors;\n }\n\n // A declared `message` replaces the generated text — including `''`.\n if (rawErrors.length && rule.message !== undefined && rule.message !== null) {\n rawErrors = ([] as any[]).concat(rule.message);\n }\n\n const result = rawErrors.map((entry, index) => {\n // Mirrors async-validator's `isErrorObj` + `complementError`: anything\n // carrying a defined `.message` (an `Error`, a rejected object) is read\n // through it; a thunk is invoked; everything else is the message itself.\n const message =\n entry && entry.message !== undefined\n ? entry.message\n : typeof entry === \"function\"\n ? entry()\n : entry;\n const merged = message === CODE_LOGIC_ERROR ? messages.default : message;\n return isValidElement(merged)\n ? cloneElement(merged as any, { key: `error_${index}` })\n : merged;\n });\n\n // `label` falls back to the field's name, so a template never prints\n // `undefined` for a field rendered without a label.\n const kv: Record<string, any> = {\n ...effectiveRule,\n name,\n label: name,\n ...messageVariables,\n };\n return result.map((error) =>\n typeof error === \"string\" ? replaceMessage(error, kv) : error,\n );\n}\n\n/**\n * Validate one field's value against its rules.\n *\n * ALWAYS REJECTS in the default (parallel) mode — with a `RuleError[]` that\n * may well be empty. This is upstream's contract and both `Field` and\n * `FormStore` are written against it: the caller partitions the array into\n * errors and warnings by each rule's `warningOnly`, and an empty array means\n * \"valid\". `validateFirst === true` instead resolves `[]` on success.\n */\nexport function validateRules(\n namePath: InternalNamePath,\n value: StoreValue,\n rules: RuleObject[],\n messages: ValidateMessages,\n validateFirst?: boolean | \"parallel\",\n messageVariables?: Record<string, string>,\n): Promise<{ errors: any[]; rule: RuleObject }[]> {\n const name = namePath.join(\".\");\n\n // Non-warning rules first; ties keep declaration order. This is what makes\n // a hard error win over a `warningOnly` rule on the same field.\n const filledRules = rules\n .map((rule, ruleIndex) => ({ rule, ruleIndex }))\n .sort((a, b) => {\n if (!!a.rule.warningOnly === !!b.rule.warningOnly) {\n return a.ruleIndex - b.ruleIndex;\n }\n return a.rule.warningOnly ? 1 : -1;\n })\n .map(({ rule }) => rule);\n\n let summaryPromise: Promise<{ errors: any[]; rule: RuleObject }[]>;\n\n if (validateFirst === true) {\n summaryPromise = new Promise((resolve, reject) => {\n (async () => {\n for (let i = 0; i < filledRules.length; i += 1) {\n const rule = filledRules[i]!;\n // Serial ON PURPOSE: `validateFirst` means \"stop at the first\n // failing rule\", so the rules must not run in parallel.\n const errors = await validateRule(\n name,\n value,\n rule,\n messages,\n messageVariables,\n );\n if (errors.length) {\n reject([{ errors, rule }]);\n return;\n }\n }\n resolve([]);\n })();\n });\n } else {\n const rulePromises = filledRules.map((rule) =>\n validateRule(name, value, rule, messages, messageVariables).then((errors) => ({\n errors,\n rule,\n })),\n );\n summaryPromise = (\n validateFirst ? finishOnFirstFailed(rulePromises) : Promise.all(rulePromises)\n ).then((errors) => Promise.reject(errors));\n }\n\n // Keep the rejection from surfacing as an unhandled rejection; every real\n // consumer attaches its own handler.\n summaryPromise.catch((e) => e);\n return summaryPromise;\n}\n\nfunction finishOnFirstFailed(\n rulePromises: Promise<{ errors: any[]; rule: RuleObject }>[],\n): Promise<{ errors: any[]; rule: RuleObject }[]> {\n let count = 0;\n return new Promise((resolve) => {\n rulePromises.forEach((promise) => {\n promise.then((ruleError) => {\n if (ruleError.errors.length) {\n resolve([ruleError]);\n }\n count += 1;\n if (count === rulePromises.length) {\n resolve([]);\n }\n });\n });\n });\n}\n\nexport { toArray };\n"],"mappings":";;;AAyBA,IAAM,IAAmB,oBAInB,IAAe;AAOrB,SAAS,EAAO,GAAe,GAAG,GAAkB;CAClD,IAAI,IAAI,GACF,IAAM,EAAK;CAwBjB,OAvBI,OAAO,KAAa,aACf,EAAS,GAAG,CAAI,IAErB,OAAO,KAAa,WACf,EAAS,QAAQ,IAAe,MAAM;EAC3C,IAAI,MAAM,MAAM,OA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import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import { TooltipProps } from '@astryxdesign/core/Tooltip';
|
|
3
|
+
export interface IconWithTooltipProps extends Omit<TooltipProps, "children" | "anchorRef"> {
|
|
4
|
+
/** The glyph the tooltip is attached to. */
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* `false` renders the trigger as a plain `<span>` (hover only) instead of a
|
|
8
|
+
* focusable `<button>`. @default true
|
|
9
|
+
*/
|
|
10
|
+
focusable?: boolean;
|
|
11
|
+
/** Extra class names on the trigger. */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Inline styles on the trigger. */
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function IconWithTooltip({ icon, focusable, style, className, ...tooltipProps }: IconWithTooltipProps): import("react").JSX.Element;
|
|
17
|
+
export declare namespace IconWithTooltip {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { nodeToAccessibleLabel as e } from "./accessibleLabel.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { Text as t } from "@astryxdesign/core/Text";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { Tooltip as r } from "@astryxdesign/core/Tooltip";
|
|
6
|
+
//#region src/components/IconWithTooltip/IconWithTooltip.tsx
|
|
7
|
+
function i({ icon: i, focusable: a = !0, style: o, className: s, ...c }) {
|
|
8
|
+
let l = e(c.content) || void 0, u = /* @__PURE__ */ n(t, {
|
|
9
|
+
color: "placeholder",
|
|
10
|
+
className: "uic-icon-with-tooltip__icon",
|
|
11
|
+
children: i
|
|
12
|
+
}), d = (e) => [
|
|
13
|
+
"uic-icon-with-tooltip",
|
|
14
|
+
e,
|
|
15
|
+
s
|
|
16
|
+
].filter(Boolean).join(" ");
|
|
17
|
+
return /* @__PURE__ */ n(r, {
|
|
18
|
+
...c,
|
|
19
|
+
children: a ? /* @__PURE__ */ n("button", {
|
|
20
|
+
type: "button",
|
|
21
|
+
"aria-label": l,
|
|
22
|
+
className: d("uic-icon-with-tooltip--button"),
|
|
23
|
+
style: o,
|
|
24
|
+
children: u
|
|
25
|
+
}) : /* @__PURE__ */ n("span", {
|
|
26
|
+
"aria-label": l,
|
|
27
|
+
className: d(""),
|
|
28
|
+
style: o,
|
|
29
|
+
children: u
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
i.displayName = "IconWithTooltip";
|
|
34
|
+
//#endregion
|
|
35
|
+
export { i as IconWithTooltip };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=IconWithTooltip2.js.map
|
|
38
|
+
import "../../assets/components/IconWithTooltip/IconWithTooltip.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconWithTooltip2.js","names":[],"sources":["../../../src/components/IconWithTooltip/IconWithTooltip.tsx"],"sourcesContent":["/**\n * IconWithTooltip\n *\n * A glyph that explains itself on hover and focus: any icon (or a status\n * mark) wrapped in an unstyled, focusable button, so the hint is reachable\n * from the keyboard. The button's accessible name is the tooltip's text.\n *\n * `focusable={false}` renders a plain `<span>` instead (hover only), for use\n * inside another interactive element such as a link or an option, where a\n * nested button is invalid.\n *\n * @example\n * <IconWithTooltip icon={<CircleHelp />} content=\"Counts only running sessions.\" />\n */\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { Text } from \"@astryxdesign/core/Text\";\nimport { Tooltip, type TooltipProps } from \"@astryxdesign/core/Tooltip\";\n\nimport { nodeToAccessibleLabel } from \"./accessibleLabel\";\nimport \"./IconWithTooltip.css\";\n\nexport interface IconWithTooltipProps extends Omit<\n TooltipProps,\n \"children\" | \"anchorRef\"\n> {\n /** The glyph the tooltip is attached to. */\n icon: ReactNode;\n /**\n * `false` renders the trigger as a plain `<span>` (hover only) instead of a\n * focusable `<button>`. @default true\n */\n focusable?: boolean;\n /** Extra class names on the trigger. */\n className?: string;\n /** Inline styles on the trigger. */\n style?: CSSProperties;\n}\n\nexport function IconWithTooltip({\n icon,\n focusable = true,\n style,\n className,\n ...tooltipProps\n}: IconWithTooltipProps) {\n const label = nodeToAccessibleLabel(tooltipProps.content) || undefined;\n const iconNode = (\n <Text color=\"placeholder\" className=\"uic-icon-with-tooltip__icon\">\n {icon}\n </Text>\n );\n const triggerClassName = (base: string) =>\n [\"uic-icon-with-tooltip\", base, className].filter(Boolean).join(\" \");\n\n return (\n <Tooltip {...tooltipProps}>\n {focusable ? (\n <button\n type=\"button\"\n aria-label={label}\n className={triggerClassName(\"uic-icon-with-tooltip--button\")}\n style={style}\n >\n {iconNode}\n </button>\n ) : (\n <span aria-label={label} className={triggerClassName(\"\")} style={style}>\n {iconNode}\n </span>\n )}\n </Tooltip>\n );\n}\n\nIconWithTooltip.displayName = \"IconWithTooltip\";\n"],"mappings":";;;;;;AAsCA,SAAgB,EAAgB,EAC9B,SACA,eAAY,IACZ,UACA,cACA,GAAG,KACoB;CACvB,IAAM,IAAQ,EAAsB,EAAa,OAAO,KAAK,KAAA,GACvD,IACJ,kBAAC,GAAD;EAAM,OAAM;EAAc,WAAU;EACjC,UAAA;CACG,CAAA,GAEF,KAAoB,MACxB;EAAC;EAAyB;EAAM;CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAErE,OACE,kBAAC,GAAD;EAAS,GAAI;EACV,UAAA,IACC,kBAAC,UAAD;GACE,MAAK;GACL,cAAY;GACZ,WAAW,EAAiB,+BAA+B;GACpD;GAEN,UAAA;EACK,CAAA,IAER,kBAAC,QAAD;GAAM,cAAY;GAAO,WAAW,EAAiB,EAAE;GAAU;GAC9D,UAAA;EACG,CAAA;CAED,CAAA;AAEb;AAEA,EAAgB,cAAc"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isValidElement as e } from "react";
|
|
2
|
+
//#region src/components/IconWithTooltip/accessibleLabel.ts
|
|
3
|
+
var t = 6;
|
|
4
|
+
function n(r, i, a) {
|
|
5
|
+
if (r != null && typeof r != "boolean") {
|
|
6
|
+
if (typeof r == "string") {
|
|
7
|
+
r.trim() !== "" && a.push(r);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (typeof r == "number") {
|
|
11
|
+
a.push(String(r));
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!(i >= t)) {
|
|
15
|
+
if (Array.isArray(r)) {
|
|
16
|
+
for (let e of r) n(e, i + 1, a);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (e(r)) {
|
|
20
|
+
let e = r.props;
|
|
21
|
+
n(e?.children, i + 1, a);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function r(e) {
|
|
27
|
+
let t = [];
|
|
28
|
+
return n(e, 0, t), t.join(" ").replace(/\s+/g, " ").trim();
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { r as nodeToAccessibleLabel };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=accessibleLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibleLabel.js","names":[],"sources":["../../../src/components/IconWithTooltip/accessibleLabel.ts"],"sourcesContent":["/**\n * Flattens a `ReactNode` into plain text for an accessible name: string and\n * number leaves, through fragments, arrays and elements' children, joined by\n * a space. A node with no text (an icon alone) yields `\"\"`. Text carried in\n * props rather than children is invisible to the walk.\n *\n * Internal: not exported from the package.\n */\nimport { isValidElement, type ReactNode } from \"react\";\n\nconst MAX_DEPTH = 6;\n\nfunction walk(node: ReactNode, depth: number, out: string[]): void {\n if (node === null || node === undefined || typeof node === \"boolean\") return;\n if (typeof node === \"string\") {\n if (node.trim() !== \"\") out.push(node);\n return;\n }\n if (typeof node === \"number\") {\n out.push(String(node));\n return;\n }\n if (depth >= MAX_DEPTH) return;\n if (Array.isArray(node)) {\n for (const child of node) walk(child as ReactNode, depth + 1, out);\n return;\n }\n if (isValidElement(node)) {\n const props = node.props as { children?: ReactNode } | undefined;\n walk(props?.children, depth + 1, out);\n }\n}\n\nexport function nodeToAccessibleLabel(node: ReactNode): string {\n const out: string[] = [];\n walk(node, 0, out);\n return out.join(\" \").replace(/\\s+/g, \" \").trim();\n}\n"],"mappings":";;AAUA,IAAM,IAAY;AAElB,SAAS,EAAK,GAAiB,GAAe,GAAqB;CAC7D,SAAS,QAA8B,OAAO,KAAS,WAC3D;MAAI,OAAO,KAAS,UAAU;GAC5B,AAAI,EAAK,KAAK,MAAM,MAAI,EAAI,KAAK,CAAI;GACrC;EACF;EACA,IAAI,OAAO,KAAS,UAAU;GAC5B,EAAI,KAAK,OAAO,CAAI,CAAC;GACrB;EACF;EACI,WAAS,IACb;OAAI,MAAM,QAAQ,CAAI,GAAG;IACvB,KAAK,IAAM,KAAS,GAAM,EAAK,GAAoB,IAAQ,GAAG,CAAG;IACjE;GACF;GACA,IAAI,EAAe,CAAI,GAAG;IACxB,IAAM,IAAQ,EAAK;IACnB,EAAK,GAAO,UAAU,IAAQ,GAAG,CAAG;GACtC;EAJA;CATA;AAcF;AAEA,SAAgB,EAAsB,GAAyB;CAC7D,IAAM,IAAgB,CAAC;CAEvB,OADA,EAAK,GAAM,GAAG,CAAG,GACV,EAAI,KAAK,GAAG,CAAC,CAAC,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK;AACjD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImgHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ImageWithFallbackProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, "onError"> {
|
|
3
|
+
src: string;
|
|
4
|
+
/** Rendered instead of the image once it fails to load. */
|
|
5
|
+
fallbackIcon: ReactNode;
|
|
6
|
+
alt: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ImageWithFallback({ src, fallbackIcon, alt, ...props }: ImageWithFallbackProps): import("react").JSX.Element;
|
|
9
|
+
export declare namespace ImageWithFallback {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { useState as e } from "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ImageWithFallback/ImageWithFallback.tsx
|
|
5
|
+
function n({ src: n, fallbackIcon: r, alt: i, ...a }) {
|
|
6
|
+
let [o, s] = e(null);
|
|
7
|
+
return o === n ? i === "" ? /* @__PURE__ */ t("span", {
|
|
8
|
+
className: "uic-image-with-fallback",
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
children: r
|
|
11
|
+
}) : /* @__PURE__ */ t("span", {
|
|
12
|
+
className: "uic-image-with-fallback",
|
|
13
|
+
role: "img",
|
|
14
|
+
"aria-label": i,
|
|
15
|
+
children: r
|
|
16
|
+
}) : /* @__PURE__ */ t("img", {
|
|
17
|
+
...a,
|
|
18
|
+
src: n,
|
|
19
|
+
alt: i,
|
|
20
|
+
onError: () => s(n)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.displayName = "ImageWithFallback";
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as ImageWithFallback };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=ImageWithFallback2.js.map
|
|
28
|
+
import "../../assets/components/ImageWithFallback/ImageWithFallback.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageWithFallback2.js","names":[],"sources":["../../../src/components/ImageWithFallback/ImageWithFallback.tsx"],"sourcesContent":["/**\n * ImageWithFallback\n *\n * An `<img>` that renders `fallbackIcon` in its place once the image fails to\n * load. The failure is remembered per `src`, so a new `src` gets a fresh try.\n * Astryx's `Avatar` and `Thumbnail` fall back to another image; this falls\n * back to any node, typically an icon.\n *\n * The fallback keeps the image's semantics: it is an `img` named by `alt`, or\n * hidden from assistive technology when `alt` is empty (a decorative image).\n *\n * @example\n * <ImageWithFallback src={logoUrl} alt=\"Vendor\" fallbackIcon={<Cpu />} width={16} />\n */\nimport { useState, type ImgHTMLAttributes, type ReactNode } from \"react\";\n\nimport \"./ImageWithFallback.css\";\n\nexport interface ImageWithFallbackProps extends Omit<\n ImgHTMLAttributes<HTMLImageElement>,\n \"onError\"\n> {\n src: string;\n /** Rendered instead of the image once it fails to load. */\n fallbackIcon: ReactNode;\n alt: string;\n}\n\nexport function ImageWithFallback({\n src,\n fallbackIcon,\n alt,\n ...props\n}: ImageWithFallbackProps) {\n const [errorSrc, setErrorSrc] = useState<string | null>(null);\n\n if (errorSrc === src) {\n return alt === \"\" ? (\n <span className=\"uic-image-with-fallback\" aria-hidden=\"true\">\n {fallbackIcon}\n </span>\n ) : (\n <span className=\"uic-image-with-fallback\" role=\"img\" aria-label={alt}>\n {fallbackIcon}\n </span>\n );\n }\n\n return <img {...props} src={src} alt={alt} onError={() => setErrorSrc(src)} />;\n}\n\nImageWithFallback.displayName = \"ImageWithFallback\";\n"],"mappings":";;;;AA4BA,SAAgB,EAAkB,EAChC,QACA,iBACA,QACA,GAAG,KACsB;CACzB,IAAM,CAAC,GAAU,KAAe,EAAwB,IAAI;CAc5D,OAZI,MAAa,IACR,MAAQ,KACb,kBAAC,QAAD;EAAM,WAAU;EAA0B,eAAY;EACnD,UAAA;CACG,CAAA,IAEN,kBAAC,QAAD;EAAM,WAAU;EAA0B,MAAK;EAAM,cAAY;EAC9D,UAAA;CACG,CAAA,IAIH,kBAAC,OAAD;EAAK,GAAI;EAAY;EAAU;EAAK,eAAe,EAAY,CAAG;CAAI,CAAA;AAC/E;AAEA,EAAkB,cAAc"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Key, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { BannerProps } from '@astryxdesign/core/Banner';
|
|
3
|
+
export interface ListBannerItem {
|
|
4
|
+
/** Default: the item's position. */
|
|
5
|
+
key?: Key | null;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface ListBannerProps extends Omit<BannerProps, "title" | "description"> {
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
items: ReadonlyArray<ListBannerItem>;
|
|
11
|
+
/** Height at which the list scrolls. Default: 165 (about seven rows) */
|
|
12
|
+
maxHeight?: number | string;
|
|
13
|
+
}
|
|
14
|
+
export declare function ListBanner({ title, items, maxHeight, ...bannerProps }: ListBannerProps): ReactElement;
|
|
15
|
+
export declare namespace ListBanner {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { Banner as t } from "@astryxdesign/core/Banner";
|
|
4
|
+
//#region src/components/ListBanner/ListBanner.tsx
|
|
5
|
+
var n = 165;
|
|
6
|
+
function r({ title: r, items: i, maxHeight: a = n, ...o }) {
|
|
7
|
+
let s = i.length === 0 ? void 0 : /* @__PURE__ */ e("ul", {
|
|
8
|
+
tabIndex: 0,
|
|
9
|
+
className: "uic-list-banner__list",
|
|
10
|
+
style: {
|
|
11
|
+
"--list-banner-max-height": typeof a == "number" ? `${a}px` : a,
|
|
12
|
+
listStyle: "circle inside"
|
|
13
|
+
},
|
|
14
|
+
children: i.map((t, n) => /* @__PURE__ */ e("li", { children: t.content }, t.key ?? `__index-${n}`))
|
|
15
|
+
}), c = r != null;
|
|
16
|
+
return /* @__PURE__ */ e(t, {
|
|
17
|
+
...o,
|
|
18
|
+
title: c ? r : s,
|
|
19
|
+
description: c ? s : void 0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
r.displayName = "ListBanner";
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as ListBanner };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=ListBanner2.js.map
|
|
27
|
+
import "../../assets/components/ListBanner/ListBanner.css";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListBanner2.js","names":[],"sources":["../../../src/components/ListBanner/ListBanner.tsx"],"sourcesContent":["/**\n * ListBanner\n *\n * A `Banner` whose description is a list of items, for \"these N things will\n * be affected\" notices in a dialog. The list scrolls once it passes\n * `maxHeight`, so the dialog does not grow with the selection, and the\n * scrolling list is reachable by keyboard. Say how many items there are in\n * the `title`.\n *\n * Without a `title` the list takes the banner's title slot. Without items\n * there is no list.\n *\n * @example\n * <ListBanner\n * status=\"warning\"\n * title={`${users.length} users will be updated`}\n * items={users.map((user) => ({ key: user.id, content: user.email }))}\n * />\n */\nimport type { CSSProperties, Key, ReactElement, ReactNode } from \"react\";\nimport { Banner, type BannerProps } from \"@astryxdesign/core/Banner\";\n\nimport \"./ListBanner.css\";\n\nexport interface ListBannerItem {\n /** Default: the item's position. */\n key?: Key | null;\n content: ReactNode;\n}\n\nexport interface ListBannerProps extends Omit<BannerProps, \"title\" | \"description\"> {\n title?: ReactNode;\n items: ReadonlyArray<ListBannerItem>;\n /** Height at which the list scrolls. Default: 165 (about seven rows) */\n maxHeight?: number | string;\n}\n\nconst DEFAULT_MAX_HEIGHT = 165;\n\nexport function ListBanner({\n title,\n items,\n maxHeight = DEFAULT_MAX_HEIGHT,\n ...bannerProps\n}: ListBannerProps): ReactElement {\n const list =\n items.length === 0 ? undefined : (\n <ul\n // Keyboard users can scroll it.\n tabIndex={0}\n className=\"uic-list-banner__list\"\n style={\n {\n \"--list-banner-max-height\":\n typeof maxHeight === \"number\" ? `${maxHeight}px` : maxHeight,\n // Inline: product sheets reset `ul` unlayered, which beats any layer.\n listStyle: \"circle inside\",\n } as CSSProperties\n }\n >\n {items.map((item, index) => (\n <li key={item.key ?? `__index-${index}`}>{item.content}</li>\n ))}\n </ul>\n );\n const hasTitle = title !== undefined && title !== null;\n\n return (\n <Banner\n {...bannerProps}\n title={hasTitle ? title : list}\n description={hasTitle ? list : undefined}\n />\n );\n}\n\nListBanner.displayName = \"ListBanner\";\n"],"mappings":";;;;AAqCA,IAAM,IAAqB;AAE3B,SAAgB,EAAW,EACzB,UACA,UACA,eAAY,GACZ,GAAG,KAC6B;CAChC,IAAM,IACJ,EAAM,WAAW,IAAI,KAAA,IACnB,kBAAC,MAAD;EAEE,UAAU;EACV,WAAU;EACV,OACE;GACE,4BACE,OAAO,KAAc,WAAW,GAAG,EAAU,MAAM;GAErD,WAAW;EACb;EAGD,UAAA,EAAM,KAAK,GAAM,MAChB,kBAAC,MAAD,EAAA,UAA0C,EAAK,QAAY,GAAlD,EAAK,OAAO,WAAW,GAA2B,CAC5D;CACC,CAAA,GAEF,IAAW,KAAiC;CAElD,OACE,kBAAC,GAAD;EACE,GAAI;EACJ,OAAO,IAAW,IAAQ;EAC1B,aAAa,IAAW,IAAO,KAAA;CAChC,CAAA;AAEL;AAEA,EAAW,cAAc"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { ButtonProps, ButtonVariant } from '@astryxdesign/core/Button';
|
|
3
|
+
import { DialogProps } from '@astryxdesign/core/Dialog';
|
|
4
|
+
/** Props for the primary action button, beyond what `Modal` sets itself. */
|
|
5
|
+
export type ModalActionButtonProps = Partial<Omit<ButtonProps, "label" | "variant" | "clickAction" | "onClick" | "ref">>;
|
|
6
|
+
export interface ModalProps extends Omit<DialogProps, "ref" | "children"> {
|
|
7
|
+
/** Ref to the element carrying `role="dialog"`: a `div`, not a `<dialog>`. */
|
|
8
|
+
ref?: Ref<HTMLDivElement>;
|
|
9
|
+
/** The body. Without `title`, `onAction` or `footer`, the whole surface. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Asks for a z-index inside the modal band. The stack still places a modal
|
|
13
|
+
* opened later above this one, and a value outside the band is ignored.
|
|
14
|
+
*/
|
|
15
|
+
zIndex?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Called with the new visibility right after `isOpen` changes, never on
|
|
18
|
+
* mount. There is no exit animation, so a close edge is the end of the
|
|
19
|
+
* close.
|
|
20
|
+
*/
|
|
21
|
+
afterOpenChange?: (isOpen: boolean) => void;
|
|
22
|
+
/** Unmount the content, and drop its state, when the modal closes. */
|
|
23
|
+
unmountOnClose?: boolean;
|
|
24
|
+
/** Header title. Names the dialog. A node is rendered as given. */
|
|
25
|
+
title?: ReactNode;
|
|
26
|
+
/** Secondary line under the title. */
|
|
27
|
+
subtitle?: string;
|
|
28
|
+
/** Content before the title, e.g. a back button. */
|
|
29
|
+
headerStartContent?: ReactNode;
|
|
30
|
+
/** Content after the title, before the close button. */
|
|
31
|
+
headerEndContent?: ReactNode;
|
|
32
|
+
/** Whether the header shows a close button. Default: true */
|
|
33
|
+
hasCloseButton?: boolean;
|
|
34
|
+
/** Class name on the generated header, for a product's own header geometry. */
|
|
35
|
+
headerClassName?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Replaces the generated footer. `null` removes the footer. Left
|
|
38
|
+
* `undefined`, a footer is generated when `onAction` is set.
|
|
39
|
+
*/
|
|
40
|
+
footer?: ReactNode | null;
|
|
41
|
+
/** Primary action. Returning a promise shows the button pending until it settles. It does not close the modal. */
|
|
42
|
+
onAction?: () => unknown;
|
|
43
|
+
/** Primary action label. Default: the catalog's `uic.common.ok` ("OK") */
|
|
44
|
+
actionLabel?: string;
|
|
45
|
+
/** Primary action variant. Default: "primary" */
|
|
46
|
+
actionVariant?: ButtonVariant;
|
|
47
|
+
/** Shows the primary action as pending, for work the modal does not await. */
|
|
48
|
+
isActionLoading?: boolean;
|
|
49
|
+
/** Disables the primary action. */
|
|
50
|
+
isActionDisabled?: boolean;
|
|
51
|
+
/** More props for the primary action button (`type`, `form`, `icon`, ...). */
|
|
52
|
+
actionButtonProps?: ModalActionButtonProps;
|
|
53
|
+
/** Cancel label. Default: the catalog's `uic.common.cancel` ("Cancel") */
|
|
54
|
+
cancelLabel?: string;
|
|
55
|
+
/** Whether the generated footer has a Cancel button. Default: true */
|
|
56
|
+
hasCancelButton?: boolean;
|
|
57
|
+
/** Class name on the generated footer. */
|
|
58
|
+
footerClassName?: string;
|
|
59
|
+
/** Shows a text skeleton in place of the body. */
|
|
60
|
+
isLoading?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare function Modal(props: ModalProps): import("react").JSX.Element;
|
|
63
|
+
export declare namespace Modal {
|
|
64
|
+
var displayName: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { useUicTranslator as e } from "../../i18n/useUicTranslator.js";
|
|
2
|
+
import { SkeletonText as t } from "../Skeleton/SkeletonText2.js";
|
|
3
|
+
import { MODAL_OPEN_ATTRIBUTE as n, ModalPortalContext as r, useModalLevel as i } from "./modalStack.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { useContext as a, useEffect as o, useEffectEvent as ee, useId as te, useInsertionEffect as ne, useLayoutEffect as s, useRef as c, useState as re } from "react";
|
|
6
|
+
import { Button as l } from "@astryxdesign/core/Button";
|
|
7
|
+
import { Layout as ie, LayoutContent as ae, LayoutFooter as oe } from "@astryxdesign/core/Layout";
|
|
8
|
+
import { HStack as se } from "@astryxdesign/core/Stack";
|
|
9
|
+
import { createPortal as ce } from "react-dom";
|
|
10
|
+
import { Dialog as u, DialogHeader as le } from "@astryxdesign/core/Dialog";
|
|
11
|
+
import { useFocusTrap as ue, useScrollLock as de } from "@astryxdesign/core/hooks";
|
|
12
|
+
import { useLayerDismissal as fe } from "@astryxdesign/core/Layer";
|
|
13
|
+
import { dataAttr as pe } from "@astryxdesign/core/naming";
|
|
14
|
+
import { useThemeName as me } from "@astryxdesign/core/theme";
|
|
15
|
+
import { devWarn as he, isFocusDetached as d, mergeRefs as ge } from "@astryxdesign/core/utils";
|
|
16
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
17
|
+
//#region src/components/Modal/Modal.tsx
|
|
18
|
+
var m = "[role=\"heading\"], h1, h2, h3, h4, h5, h6", h = "dialog, [role=\"dialog\"], [role=\"alertdialog\"]";
|
|
19
|
+
function _e(e, t) {
|
|
20
|
+
(d() || t?.contains(document.activeElement) === !0) && e?.isConnected && e.focus();
|
|
21
|
+
}
|
|
22
|
+
function g(e) {
|
|
23
|
+
for (let t of e.querySelectorAll(m)) if (t.closest(h) === e) return t;
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function ve(e, t = 16) {
|
|
27
|
+
let n = e.getBoundingClientRect(), r = n.left + n.width / 2 - window.innerWidth / 2, i = n.top + n.height / 2 - window.innerHeight / 2, a = Math.sqrt(r * r + i * i) || 1;
|
|
28
|
+
return {
|
|
29
|
+
x: Math.round(r / a * t),
|
|
30
|
+
y: Math.round(i / a * t)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function _(e) {
|
|
34
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
35
|
+
}
|
|
36
|
+
function ye(e) {
|
|
37
|
+
let { top: t, bottom: n, start: r, end: i } = e;
|
|
38
|
+
return {
|
|
39
|
+
top: t === void 0 ? "auto" : _(t),
|
|
40
|
+
bottom: n === void 0 ? "auto" : _(n),
|
|
41
|
+
insetInlineStart: r === void 0 ? "auto" : _(r),
|
|
42
|
+
insetInlineEnd: i === void 0 ? "auto" : _(i)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
var v = /* @__PURE__ */ new WeakMap(), y = 0;
|
|
46
|
+
function b(e) {
|
|
47
|
+
if (!e) return "body";
|
|
48
|
+
let t = v.get(e);
|
|
49
|
+
return t || (y += 1, t = `dialog-${y}`, v.set(e, t)), t;
|
|
50
|
+
}
|
|
51
|
+
function x(e) {
|
|
52
|
+
let t = a(r);
|
|
53
|
+
return /* @__PURE__ */ f(S, {
|
|
54
|
+
...e,
|
|
55
|
+
dialogHost: t
|
|
56
|
+
}, b(t));
|
|
57
|
+
}
|
|
58
|
+
function S({ dialogHost: r, isOpen: a, onOpenChange: d, isInline: m = !1, width: h = 400, maxHeight: v, position: y, variant: b = "standard", purpose: x = "info", padding: S, zIndex: be, afterOpenChange: xe, unmountOnClose: Se = !1, title: C, subtitle: Ce, headerStartContent: w, headerEndContent: T, hasCloseButton: we = !0, headerClassName: Te, footer: E, onAction: D, actionLabel: O, actionVariant: Ee = "primary", isActionLoading: De, isActionDisabled: Oe, actionButtonProps: k, cancelLabel: ke, hasCancelButton: Ae = !0, footerClassName: je, isLoading: Me = !1, role: Ne, children: Pe, xstyle: A, className: j, style: M, ref: Fe, ...N }) {
|
|
59
|
+
let P = e(), [F, I] = re(a);
|
|
60
|
+
a && !F && I(!0);
|
|
61
|
+
let Ie = a || F && !Se, L = c(a), Le = ee((e) => xe?.(e));
|
|
62
|
+
o(() => {
|
|
63
|
+
L.current !== a && (L.current = a, Le(a));
|
|
64
|
+
}, [a]);
|
|
65
|
+
let Re = me(), ze = x !== "required", Be = x === "info", R = N["aria-label"] != null || N["aria-labelledby"] != null, Ve = te(), z = () => d(!1), B = c(null), V = c(null);
|
|
66
|
+
ne(() => {
|
|
67
|
+
if (!a || m) return;
|
|
68
|
+
let e = document.activeElement;
|
|
69
|
+
V.current = e instanceof HTMLElement && !B.current?.contains(e) ? e : null;
|
|
70
|
+
}, [a, m]);
|
|
71
|
+
let H = a && !m, U = i(B, H, be);
|
|
72
|
+
s(() => {
|
|
73
|
+
let e = B.current;
|
|
74
|
+
if (!(!H || !r || typeof e?.showPopover != "function")) return e.showPopover(), () => {
|
|
75
|
+
e.matches(":popover-open") && e.hidePopover();
|
|
76
|
+
};
|
|
77
|
+
}, [H, r]);
|
|
78
|
+
let { containerRef: W, focusFirst: G } = ue({ isActive: H && U });
|
|
79
|
+
fe({
|
|
80
|
+
isActive: H,
|
|
81
|
+
escapeBehavior: ze ? "close" : "block",
|
|
82
|
+
onDismiss: z,
|
|
83
|
+
getContainer: () => W.current
|
|
84
|
+
}), o(() => {
|
|
85
|
+
if (!H) return;
|
|
86
|
+
let e = B.current;
|
|
87
|
+
return () => _e(V.current, e);
|
|
88
|
+
}, [H]), de(H), o(() => {
|
|
89
|
+
let e = W.current;
|
|
90
|
+
if (!H || !e || R) return;
|
|
91
|
+
let t = g(e);
|
|
92
|
+
if (!t) {
|
|
93
|
+
e.removeAttribute("aria-labelledby");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
t.id ||= Ve, e.setAttribute("aria-labelledby", t.id);
|
|
97
|
+
}), s(() => {
|
|
98
|
+
let e = W.current;
|
|
99
|
+
if (!H || !e) return;
|
|
100
|
+
let t = V.current;
|
|
101
|
+
if (!(typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) && t instanceof HTMLElement && t !== document.body) {
|
|
102
|
+
let { x: n, y: r } = ve(t);
|
|
103
|
+
e.style.setProperty("--modal-dir-x", `${n}px`), e.style.setProperty("--modal-dir-y", `${r}px`);
|
|
104
|
+
}
|
|
105
|
+
return () => {
|
|
106
|
+
e.style.removeProperty("--modal-dir-x"), e.style.removeProperty("--modal-dir-y");
|
|
107
|
+
};
|
|
108
|
+
}, [H, W]), o(() => {
|
|
109
|
+
let e = W.current;
|
|
110
|
+
if (!H || !e) return;
|
|
111
|
+
let t = e.querySelector("[data-autofocus]") ?? g(e);
|
|
112
|
+
t?.focus(), document.activeElement !== t && G();
|
|
113
|
+
}, [
|
|
114
|
+
H,
|
|
115
|
+
W,
|
|
116
|
+
G
|
|
117
|
+
]);
|
|
118
|
+
let K = c(!1);
|
|
119
|
+
o(() => {
|
|
120
|
+
let e = W.current;
|
|
121
|
+
!H || R || K.current || !e || (g(e) ?? (K.current = !0, he("Modal", "open modal has no accessible name. Pass `title`, render a ModalHeader, or pass `aria-label`/`aria-labelledby`.")));
|
|
122
|
+
}, [
|
|
123
|
+
H,
|
|
124
|
+
R,
|
|
125
|
+
W
|
|
126
|
+
]);
|
|
127
|
+
let q = c(null), J = c(!1), He = (e) => {
|
|
128
|
+
J.current = e.target === q.current;
|
|
129
|
+
}, Ue = (e) => {
|
|
130
|
+
let t = J.current && e.target === q.current;
|
|
131
|
+
J.current = !1, t && Be && z();
|
|
132
|
+
}, We = C !== void 0 || D !== void 0 || E !== void 0, Ge = D === void 0 ? null : /* @__PURE__ */ p(se, {
|
|
133
|
+
justify: "end",
|
|
134
|
+
align: "center",
|
|
135
|
+
gap: 2,
|
|
136
|
+
children: [Ae && /* @__PURE__ */ f(l, {
|
|
137
|
+
variant: "secondary",
|
|
138
|
+
label: ke ?? P("uic.common.cancel"),
|
|
139
|
+
onClick: z
|
|
140
|
+
}), /* @__PURE__ */ f(l, {
|
|
141
|
+
...k,
|
|
142
|
+
variant: Ee,
|
|
143
|
+
label: O ?? P("uic.common.ok"),
|
|
144
|
+
isLoading: De ?? k?.isLoading,
|
|
145
|
+
isDisabled: Oe ?? k?.isDisabled,
|
|
146
|
+
clickAction: async () => {
|
|
147
|
+
await D();
|
|
148
|
+
}
|
|
149
|
+
})]
|
|
150
|
+
}), Y = E === void 0 ? Ge : E, X = Me ? /* @__PURE__ */ f(t, { lines: 4 }) : Pe, Z = We ? /* @__PURE__ */ f(ie, {
|
|
151
|
+
header: C !== void 0 || w || T ? /* @__PURE__ */ f(le, {
|
|
152
|
+
hasDivider: !0,
|
|
153
|
+
title: C ?? "",
|
|
154
|
+
subtitle: Ce,
|
|
155
|
+
startContent: w,
|
|
156
|
+
endContent: T,
|
|
157
|
+
onOpenChange: we ? (e) => !e && z() : void 0,
|
|
158
|
+
className: Te
|
|
159
|
+
}) : void 0,
|
|
160
|
+
content: /* @__PURE__ */ f(ae, { children: X }),
|
|
161
|
+
footer: Y ? /* @__PURE__ */ f(oe, {
|
|
162
|
+
hasDivider: !0,
|
|
163
|
+
className: je,
|
|
164
|
+
children: Y
|
|
165
|
+
}) : void 0
|
|
166
|
+
}) : X;
|
|
167
|
+
if (m) return /* @__PURE__ */ f(u, {
|
|
168
|
+
...N,
|
|
169
|
+
isInline: !0,
|
|
170
|
+
isOpen: a,
|
|
171
|
+
onOpenChange: d,
|
|
172
|
+
width: h,
|
|
173
|
+
maxHeight: v,
|
|
174
|
+
variant: b,
|
|
175
|
+
purpose: x,
|
|
176
|
+
padding: S,
|
|
177
|
+
xstyle: A,
|
|
178
|
+
className: j,
|
|
179
|
+
style: M,
|
|
180
|
+
children: Z
|
|
181
|
+
});
|
|
182
|
+
if (!Ie || typeof document > "u") return null;
|
|
183
|
+
let Q = b === "fullscreen", $ = y != null && !Q;
|
|
184
|
+
return ce(/* @__PURE__ */ p("div", {
|
|
185
|
+
ref: B,
|
|
186
|
+
popover: r ? "manual" : void 0,
|
|
187
|
+
className: ["uic-modal", !a && "uic-modal--closed"].filter(Boolean).join(" "),
|
|
188
|
+
onMouseDown: He,
|
|
189
|
+
onClick: Ue,
|
|
190
|
+
[n]: a ? "" : void 0,
|
|
191
|
+
[pe("theme")]: Re ?? void 0,
|
|
192
|
+
children: [/* @__PURE__ */ f("div", {
|
|
193
|
+
ref: q,
|
|
194
|
+
className: "uic-modal__mask"
|
|
195
|
+
}), /* @__PURE__ */ f("div", {
|
|
196
|
+
...N,
|
|
197
|
+
ref: ge(Fe, W),
|
|
198
|
+
className: ["uic-modal__wrap", $ && "uic-modal__wrap--positioned"].filter(Boolean).join(" "),
|
|
199
|
+
style: {
|
|
200
|
+
...$ ? ye(y) : null,
|
|
201
|
+
width: Q ? void 0 : _(h)
|
|
202
|
+
},
|
|
203
|
+
role: a ? Ne ?? (x === "required" ? "alertdialog" : "dialog") : void 0,
|
|
204
|
+
"aria-modal": a && U ? !0 : void 0,
|
|
205
|
+
children: /* @__PURE__ */ f(u, {
|
|
206
|
+
isInline: !0,
|
|
207
|
+
isOpen: !0,
|
|
208
|
+
onOpenChange: d,
|
|
209
|
+
width: "100%",
|
|
210
|
+
maxHeight: v,
|
|
211
|
+
variant: b,
|
|
212
|
+
padding: S,
|
|
213
|
+
xstyle: A,
|
|
214
|
+
className: j,
|
|
215
|
+
style: M,
|
|
216
|
+
children: Z
|
|
217
|
+
})
|
|
218
|
+
})]
|
|
219
|
+
}), r ?? document.body);
|
|
220
|
+
}
|
|
221
|
+
x.displayName = "Modal";
|
|
222
|
+
//#endregion
|
|
223
|
+
export { x as Modal };
|
|
224
|
+
|
|
225
|
+
//# sourceMappingURL=Modal2.js.map
|
|
226
|
+
import "../../assets/components/Modal/Modal.css";
|