@lablup/ui-common 0.1.0-alpha.9 → 0.2.0-alpha.15
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 +490 -68
- 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/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/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 +64 -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 +125 -0
- package/dist/forks/ComplexSelector/ComplexSelector.styles.js +129 -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 +98 -0
- package/dist/forks/Drawer/Drawer.js +94 -0
- package/dist/forks/Drawer/Drawer.js.map +1 -0
- package/dist/forks/Drawer/Drawer.styles.d.ts +99 -0
- package/dist/forks/Drawer/Drawer.styles.js +94 -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 +19 -0
- package/dist/forks/Drawer/useDrawerDialogPresence.js +62 -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.json +954 -0
- package/dist/locales/ar-SA.json +994 -0
- package/dist/locales/ca-ES.json +970 -0
- package/dist/locales/cs-CZ.json +986 -0
- package/dist/locales/da-DK.json +962 -0
- package/dist/locales/de-DE.json +962 -0
- package/dist/locales/el-GR.json +986 -0
- package/dist/locales/en.json +1482 -0
- package/dist/locales/es-ES.json +974 -0
- package/dist/locales/fi-FI.json +986 -0
- package/dist/locales/fr-FR.json +950 -0
- package/dist/locales/he-IL.json +986 -0
- package/dist/locales/hu-HU.json +986 -0
- package/dist/locales/it-IT.json +974 -0
- package/dist/locales/ja-JP.json +994 -0
- package/dist/locales/ko-KR.json +986 -0
- package/dist/locales/nl-NL.json +950 -0
- package/dist/locales/no-NO.json +974 -0
- package/dist/locales/pl-PL.json +978 -0
- package/dist/locales/pseudo.json +1112 -0
- package/dist/locales/pt-BR.json +978 -0
- package/dist/locales/pt-PT.json +978 -0
- package/dist/locales/ro-RO.json +978 -0
- package/dist/locales/ru-RU.json +986 -0
- package/dist/locales/sr-SP.json +986 -0
- package/dist/locales/sv-SE.json +982 -0
- package/dist/locales/tr-TR.json +986 -0
- package/dist/locales/uk-UA.json +986 -0
- package/dist/locales/vi-VN.json +982 -0
- package/dist/locales/zh-CN.json +994 -0
- package/dist/locales/zh-TW.json +994 -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 +716 -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 +565 -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
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useUicTranslator as e } from "../../i18n/useUicTranslator.js";
|
|
2
|
+
import { SkeletonShape as t } from "./SkeletonShape2.js";
|
|
2
3
|
/* empty css */
|
|
3
|
-
import { jsx as
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/Skeleton/SkeletonText.tsx
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
function r(e, t) {
|
|
7
|
+
return e === t - 1 ? "60%" : e % 2 == 0 ? "100%" : "95%";
|
|
8
|
+
}
|
|
9
|
+
function i({ lines: i = 3, spacing: a = "normal", className: o = "", testId: s, loadingLabel: c }) {
|
|
10
|
+
let l = e(), u = [
|
|
11
|
+
"uic-skeleton-text",
|
|
12
|
+
`uic-skeleton-text--${a}`,
|
|
13
|
+
o
|
|
14
|
+
].filter(Boolean).join(" ");
|
|
15
|
+
return /* @__PURE__ */ n("div", {
|
|
16
|
+
className: u,
|
|
17
|
+
"data-testid": s,
|
|
14
18
|
role: "status",
|
|
15
19
|
"aria-busy": "true",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
width:
|
|
20
|
+
"aria-label": c ?? l("uic.SkeletonText.loading"),
|
|
21
|
+
children: Array.from({ length: Math.max(0, i) }, (e, a) => /* @__PURE__ */ n(t, {
|
|
22
|
+
width: r(a, i),
|
|
19
23
|
height: "1em",
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
shape: "text",
|
|
25
|
+
index: a
|
|
26
|
+
}, a))
|
|
22
27
|
});
|
|
23
28
|
}
|
|
24
29
|
//#endregion
|
|
25
|
-
export {
|
|
30
|
+
export { i as SkeletonText, i as default };
|
|
26
31
|
|
|
27
32
|
//# sourceMappingURL=SkeletonText2.js.map
|
|
28
33
|
import "../../assets/components/Skeleton/SkeletonText.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonText2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonText.tsx"],"sourcesContent":["/**\n * SkeletonText
|
|
1
|
+
{"version":3,"file":"SkeletonText2.js","names":[],"sources":["../../../src/components/Skeleton/SkeletonText.tsx"],"sourcesContent":["/**\n * SkeletonText\n *\n * Loading placeholder for a block of text: `lines` lines, alternating full and\n * slightly short, with a shorter last line.\n *\n * @example\n * <SkeletonText />\n * <SkeletonText lines={5} spacing=\"compact\" />\n */\nimport { useUicTranslator } from \"../../i18n/useUicTranslator\";\nimport { SkeletonShape } from \"./SkeletonShape\";\nimport \"./SkeletonText.css\";\n\nexport interface SkeletonTextProps {\n /** Number of text lines to display */\n lines?: number;\n /** Spacing between lines */\n spacing?: \"compact\" | \"normal\" | \"relaxed\";\n /** Additional CSS class names */\n className?: string;\n /** Test ID for testing */\n testId?: string;\n /**\n * Accessible name announced for the placeholder as a whole. Defaults to the\n * catalog's `uic.SkeletonText.loading` (\"Loading\").\n */\n loadingLabel?: string;\n}\n\n/** The width of line `i` of `lines`: the last is short, the rest alternate. */\nfunction lineWidth(i: number, lines: number): string {\n if (i === lines - 1) return \"60%\";\n return i % 2 === 0 ? \"100%\" : \"95%\";\n}\n\nexport function SkeletonText({\n lines = 3,\n spacing = \"normal\",\n className = \"\",\n testId,\n loadingLabel,\n}: SkeletonTextProps) {\n const t = useUicTranslator();\n const classNames = [\"uic-skeleton-text\", `uic-skeleton-text--${spacing}`, className]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n className={classNames}\n data-testid={testId}\n role=\"status\"\n aria-busy=\"true\"\n aria-label={loadingLabel ?? t(\"uic.SkeletonText.loading\")}\n >\n {Array.from({ length: Math.max(0, lines) }, (_, index) => (\n <SkeletonShape\n key={index}\n width={lineWidth(index, lines)}\n height=\"1em\"\n shape=\"text\"\n index={index}\n />\n ))}\n </div>\n );\n}\n\nexport default SkeletonText;\n"],"mappings":";;;;;AA+BA,SAAS,EAAU,GAAW,GAAuB;CAEnD,OADI,MAAM,IAAQ,IAAU,QACrB,IAAI,KAAM,IAAI,SAAS;AAChC;AAEA,SAAgB,EAAa,EAC3B,WAAQ,GACR,aAAU,UACV,eAAY,IACZ,WACA,mBACoB;CACpB,IAAM,IAAI,EAAiB,GACrB,IAAa;EAAC;EAAqB,sBAAsB;EAAW;CAAS,CAAC,CACjF,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;CAEX,OACE,kBAAC,OAAD;EACE,WAAW;EACX,eAAa;EACb,MAAK;EACL,aAAU;EACV,cAAY,KAAgB,EAAE,0BAA0B;EAEvD,UAAA,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,CAAK,EAAE,IAAI,GAAG,MAC9C,kBAAC,GAAD;GAEE,OAAO,EAAU,GAAO,CAAK;GAC7B,QAAO;GACP,OAAM;GACC;EACR,GALM,CAKN,CACF;CACE,CAAA;AAET"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Skeleton
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Skeleton composites: loading placeholders for a card, a text block, a list
|
|
3
|
+
* row and a chart, each drawn with Astryx `Skeleton`. The base shape is
|
|
4
|
+
* Astryx's own `Skeleton` (`@lablup/ui-common/Skeleton`).
|
|
5
5
|
*/
|
|
6
|
-
export { Skeleton } from './Skeleton';
|
|
7
|
-
export type { SkeletonProps } from './Skeleton';
|
|
8
6
|
export { SkeletonCard } from './SkeletonCard';
|
|
9
7
|
export type { SkeletonCardProps } from './SkeletonCard';
|
|
10
8
|
export { SkeletonText } from './SkeletonText';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SkeletonText as e } from "./SkeletonText2.js";
|
|
2
2
|
import { SkeletonCard as t } from "./SkeletonCard2.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export { e as Skeleton, t as SkeletonCard, r as SkeletonChart, i as SkeletonRow, n as SkeletonText };
|
|
3
|
+
import { SkeletonChart as n } from "./SkeletonChart2.js";
|
|
4
|
+
import { SkeletonRow as r } from "./SkeletonRow2.js";
|
|
5
|
+
export { t as SkeletonCard, n as SkeletonChart, r as SkeletonRow, e as SkeletonText };
|
|
@@ -24,10 +24,10 @@ function i({ active: i, children: a, className: o }) {
|
|
|
24
24
|
};
|
|
25
25
|
}, [i]), /* @__PURE__ */ n("div", {
|
|
26
26
|
ref: s,
|
|
27
|
-
className: `smooth-height${i ? " smooth-height--active" : ""}${o ? ` ${o}` : ""}`,
|
|
27
|
+
className: `uic-smooth-height${i ? " uic-smooth-height--active" : ""}${o ? ` ${o}` : ""}`,
|
|
28
28
|
children: /* @__PURE__ */ n("div", {
|
|
29
29
|
ref: c,
|
|
30
|
-
className: "smooth-height__content",
|
|
30
|
+
className: "uic-smooth-height__content",
|
|
31
31
|
children: a
|
|
32
32
|
})
|
|
33
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmoothHeight2.js","names":[],"sources":["../../../src/components/SmoothHeight/SmoothHeight.tsx"],"sourcesContent":["/**\n * SmoothHeight Component\n *\n * Animates a container's height toward its content's natural height, so\n * content that grows in discrete jumps (streaming text wrapping onto new\n * lines) expands smoothly instead of snapping one line at a time.\n *\n * While `active`, the inner content is measured with a ResizeObserver and\n * the outer wrapper gets an explicit pixel height with a CSS height\n * transition. CSS cannot transition to `height: auto` (and the\n * `interpolate-size` opt-in is not available in WebKit), so the explicit\n * measurement is what makes the animation possible cross-platform.\n *\n * The very first activation does not animate: the wrapper goes from\n * `auto` to a pixel height, which CSS treats as non-interpolable and\n * applies instantly. Only subsequent pixel-to-pixel growth animates.\n *\n * When `active` turns off, the pixel height is kept just long enough for\n * the in-flight transition to settle, then released back to `auto` so\n * later reflows (window resizing, images loading) are unaffected.\n *\n * Degrades gracefully: without ResizeObserver (test environments), it\n * renders plain pass-through wrappers with auto height.\n */\n\nimport { useLayoutEffect, useRef, type ReactNode } from \"react\";\nimport \"./SmoothHeight.css\";\n\nexport interface SmoothHeightProps {\n /** Whether height changes should currently be animated */\n active: boolean;\n children: ReactNode;\n /** Additional class for the outer wrapper */\n className?: string;\n}\n\n/**\n * Delay before releasing the explicit height after deactivation, covering\n * the height transition
|
|
1
|
+
{"version":3,"file":"SmoothHeight2.js","names":[],"sources":["../../../src/components/SmoothHeight/SmoothHeight.tsx"],"sourcesContent":["/**\n * SmoothHeight Component\n *\n * Animates a container's height toward its content's natural height, so\n * content that grows in discrete jumps (streaming text wrapping onto new\n * lines) expands smoothly instead of snapping one line at a time.\n *\n * While `active`, the inner content is measured with a ResizeObserver and\n * the outer wrapper gets an explicit pixel height with a CSS height\n * transition. CSS cannot transition to `height: auto` (and the\n * `interpolate-size` opt-in is not available in WebKit), so the explicit\n * measurement is what makes the animation possible cross-platform.\n *\n * The very first activation does not animate: the wrapper goes from\n * `auto` to a pixel height, which CSS treats as non-interpolable and\n * applies instantly. Only subsequent pixel-to-pixel growth animates.\n *\n * When `active` turns off, the pixel height is kept just long enough for\n * the in-flight transition to settle, then released back to `auto` so\n * later reflows (window resizing, images loading) are unaffected.\n *\n * Degrades gracefully: without ResizeObserver (test environments), it\n * renders plain pass-through wrappers with auto height.\n */\n\nimport { useLayoutEffect, useRef, type ReactNode } from \"react\";\nimport \"./SmoothHeight.css\";\n\nexport interface SmoothHeightProps {\n /** Whether height changes should currently be animated */\n active: boolean;\n children: ReactNode;\n /** Additional class for the outer wrapper */\n className?: string;\n}\n\n/**\n * Delay before releasing the explicit height after deactivation, covering\n * the height transition (--duration-fast-max, 230ms by default).\n */\nconst RELEASE_DELAY_MS = 250;\n\nexport function SmoothHeight({ active, children, className }: SmoothHeightProps) {\n const outerRef = useRef<HTMLDivElement>(null);\n const innerRef = useRef<HTMLDivElement>(null);\n const releaseTimerRef = useRef<number | null>(null);\n\n useLayoutEffect(() => {\n const outer = outerRef.current;\n const inner = innerRef.current;\n if (!outer || !inner) return;\n if (typeof ResizeObserver === \"undefined\") return;\n\n if (!active) {\n // Keep the last pixel height while the in-flight transition\n // settles, then release to auto.\n releaseTimerRef.current = window.setTimeout(() => {\n outer.style.height = \"\";\n releaseTimerRef.current = null;\n }, RELEASE_DELAY_MS);\n return () => {\n if (releaseTimerRef.current !== null) {\n window.clearTimeout(releaseTimerRef.current);\n releaseTimerRef.current = null;\n }\n };\n }\n\n // (Re)activated: cancel any pending release and track the content.\n if (releaseTimerRef.current !== null) {\n window.clearTimeout(releaseTimerRef.current);\n releaseTimerRef.current = null;\n }\n\n const measure = () => {\n outer.style.height = `${inner.offsetHeight.toFixed(0)}px`;\n };\n measure();\n\n const observer = new ResizeObserver(measure);\n observer.observe(inner);\n return () => {\n observer.disconnect();\n };\n }, [active]);\n\n return (\n <div\n ref={outerRef}\n className={`uic-smooth-height${active ? \" uic-smooth-height--active\" : \"\"}${className ? ` ${className}` : \"\"}`}\n >\n <div ref={innerRef} className=\"uic-smooth-height__content\">\n {children}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAwCA,IAAM,IAAmB;AAEzB,SAAgB,EAAa,EAAE,WAAQ,aAAU,gBAAgC;CAC/E,IAAM,IAAW,EAAuB,IAAI,GACtC,IAAW,EAAuB,IAAI,GACtC,IAAkB,EAAsB,IAAI;CAyClD,OAvCA,QAAsB;EACpB,IAAM,IAAQ,EAAS,SACjB,IAAQ,EAAS;EAEvB,IADI,CAAC,KAAS,CAAC,KACX,OAAO,iBAAmB,KAAa;EAE3C,IAAI,CAAC,GAOH,OAJA,EAAgB,UAAU,OAAO,iBAAiB;GAEhD,AADA,EAAM,MAAM,SAAS,IACrB,EAAgB,UAAU;EAC5B,GAAG,CAAgB,SACN;GACX,AAAI,EAAgB,YAAY,SAC9B,OAAO,aAAa,EAAgB,OAAO,GAC3C,EAAgB,UAAU;EAE9B;EAIF,AAAI,EAAgB,YAAY,SAC9B,OAAO,aAAa,EAAgB,OAAO,GAC3C,EAAgB,UAAU;EAG5B,IAAM,UAAgB;GACpB,EAAM,MAAM,SAAS,GAAG,EAAM,aAAa,QAAQ,CAAC,EAAE;EACxD;EACA,EAAQ;EAER,IAAM,IAAW,IAAI,eAAe,CAAO;EAE3C,OADA,EAAS,QAAQ,CAAK,SACT;GACX,EAAS,WAAW;EACtB;CACF,GAAG,CAAC,CAAM,CAAC,GAGT,kBAAC,OAAD;EACE,KAAK;EACL,WAAW,oBAAoB,IAAS,+BAA+B,KAAK,IAAY,IAAI,MAAc;EAE1G,UAAA,kBAAC,OAAD;GAAK,KAAK;GAAU,WAAU;GAC3B;EACE,CAAA;CACF,CAAA;AAET"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JSX, ReactNode } from 'react';
|
|
2
2
|
export type StatCardEmphasis = "compact" | "default" | "prominent";
|
|
3
3
|
export type StatCardTone = "default" | "success" | "warning" | "danger" | "info";
|
|
4
4
|
export type StatCardTrendDirection = "up" | "down" | "flat";
|
|
5
|
+
/**
|
|
6
|
+
* How a numeric value arrives. `count` counts up from the previous value;
|
|
7
|
+
* `digits` pops each character of the formatted value in, staggered, and
|
|
8
|
+
* replays when the value changes.
|
|
9
|
+
*/
|
|
10
|
+
export type StatCardAnimation = "count" | "digits";
|
|
5
11
|
export interface StatCardTrend {
|
|
6
12
|
/** Direction indicator (up / down / flat) */
|
|
7
13
|
direction: StatCardTrendDirection;
|
|
@@ -11,23 +17,31 @@ export interface StatCardTrend {
|
|
|
11
17
|
ariaLabel?: string;
|
|
12
18
|
}
|
|
13
19
|
export interface StatCardProps {
|
|
14
|
-
/** Short label rendered above the value (
|
|
20
|
+
/** Short label rendered above the value (uppercase) */
|
|
15
21
|
label: string;
|
|
16
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Rendered in place of `label` when the label is not plain text: a glossary
|
|
24
|
+
* term carrying its definition, a unit badge, an info affordance.
|
|
25
|
+
*
|
|
26
|
+
* `label` stays required and stays the accessible name. Pass the same words
|
|
27
|
+
* in both.
|
|
28
|
+
*/
|
|
29
|
+
labelNode?: ReactNode;
|
|
30
|
+
/** Primary metric value (a number is formatted with `toLocaleString`) */
|
|
17
31
|
value: string | number;
|
|
18
32
|
/** Optional suffix appended to the value (e.g. "/ 4", "GB") */
|
|
19
33
|
valueSuffix?: string;
|
|
20
|
-
/** Optional helper line under the value
|
|
34
|
+
/** Optional helper line under the value */
|
|
21
35
|
hint?: ReactNode;
|
|
22
36
|
/** Optional leading icon node, rendered inside an accent badge */
|
|
23
37
|
icon?: ReactNode;
|
|
24
|
-
/** Visual tone
|
|
38
|
+
/** Visual tone. Default: "default" */
|
|
25
39
|
tone?: StatCardTone;
|
|
26
40
|
/** Optional trend indicator under the value */
|
|
27
41
|
trend?: StatCardTrend;
|
|
28
|
-
/** Click handler. Renders the card as
|
|
42
|
+
/** Click handler. Renders the card as Astryx `ClickableCard`. */
|
|
29
43
|
onClick?: () => void;
|
|
30
|
-
/** Render skeletons instead of value
|
|
44
|
+
/** Render skeletons instead of the value while loading */
|
|
31
45
|
loading?: boolean;
|
|
32
46
|
/** Optional aria label override (defaults to label + value) */
|
|
33
47
|
ariaLabel?: string;
|
|
@@ -41,19 +55,17 @@ export interface StatCardProps {
|
|
|
41
55
|
*/
|
|
42
56
|
format?: (value: number) => string;
|
|
43
57
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
animate?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Optional trailing visual on the value line (e.g. a sparkline). Kept as a
|
|
51
|
-
* slot so the card does not depend on any particular chart component.
|
|
58
|
+
* Animate a numeric value on mount and on change. `true` or `"count"`
|
|
59
|
+
* counts up to it; `"digits"` pops each character of the formatted value
|
|
60
|
+
* in. Suppressed under `prefers-reduced-motion`, and ignored for string
|
|
61
|
+
* values and while loading.
|
|
52
62
|
*/
|
|
63
|
+
animate?: boolean | StatCardAnimation;
|
|
64
|
+
/** Optional trailing visual on the value line (e.g. a sparkline) */
|
|
53
65
|
sparkline?: ReactNode;
|
|
54
66
|
/** Visual weight. Default: "default" */
|
|
55
67
|
emphasis?: StatCardEmphasis;
|
|
56
68
|
}
|
|
57
|
-
declare function StatCardComponent({ label, value, valueSuffix, hint, icon, tone, trend, onClick, loading, ariaLabel, className, testId, format, animate, sparkline, emphasis, }: StatCardProps): JSX.Element;
|
|
69
|
+
declare function StatCardComponent({ label, labelNode, value, valueSuffix, hint, icon, tone, trend, onClick, loading, ariaLabel, className, testId, format, animate, sparkline, emphasis, }: StatCardProps): JSX.Element;
|
|
58
70
|
export declare const StatCard: import('react').MemoExoticComponent<typeof StatCardComponent>;
|
|
59
71
|
export {};
|
|
@@ -1,112 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { usePrefersReducedMotion as n } from "../../hooks/usePrefersReducedMotion.js";
|
|
1
|
+
import { usePrefersReducedMotion as e } from "../../hooks/usePrefersReducedMotion.js";
|
|
2
|
+
import { DigitPopIn as t } from "../DigitPopIn/DigitPopIn2.js";
|
|
4
3
|
/* empty css */
|
|
5
|
-
import { memo as
|
|
6
|
-
import {
|
|
4
|
+
import { memo as n, useEffect as r, useRef as i, useState as a } from "react";
|
|
5
|
+
import { Text as o } from "@astryxdesign/core/Text";
|
|
6
|
+
import { Skeleton as s } from "@astryxdesign/core/Skeleton";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
import { Card as d } from "@astryxdesign/core/Card";
|
|
9
|
+
import { ClickableCard as f } from "@astryxdesign/core/ClickableCard";
|
|
7
10
|
//#region src/components/StatCard/StatCard.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
let [n,
|
|
11
|
-
return
|
|
11
|
+
var p = 800;
|
|
12
|
+
function m(e, t) {
|
|
13
|
+
let [n, o] = a(t ? 0 : e), s = i(t ? 0 : e), c = i(null);
|
|
14
|
+
return r(() => {
|
|
12
15
|
if (!t) {
|
|
13
|
-
s.current = e,
|
|
16
|
+
s.current = e, o(e);
|
|
14
17
|
return;
|
|
15
18
|
}
|
|
16
|
-
let n = s.current,
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
+
let n = s.current, r = performance.now(), i = (t) => {
|
|
20
|
+
let a = Math.min((t - r) / p, 1), l = 1 - (1 - a) ** 3;
|
|
21
|
+
o(Math.round(n + (e - n) * l)), a < 1 ? c.current = requestAnimationFrame(i) : s.current = e;
|
|
19
22
|
};
|
|
20
|
-
return c.current = requestAnimationFrame(
|
|
23
|
+
return c.current = requestAnimationFrame(i), () => {
|
|
21
24
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
22
25
|
};
|
|
23
26
|
}, [e, t]), t ? n : e;
|
|
24
27
|
}
|
|
25
|
-
var
|
|
28
|
+
var h = {
|
|
26
29
|
up: "▲",
|
|
27
30
|
down: "▼",
|
|
28
31
|
flat: "•"
|
|
32
|
+
}, g = {
|
|
33
|
+
compact: 2,
|
|
34
|
+
default: 4,
|
|
35
|
+
prominent: 6
|
|
29
36
|
};
|
|
30
|
-
function
|
|
37
|
+
function _(e, t) {
|
|
31
38
|
return typeof e == "number" ? t ? t(e) : e.toLocaleString() : e;
|
|
32
39
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
"stat-card",
|
|
36
|
-
|
|
37
|
-
`stat-card
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
className: "stat-card__value-suffix",
|
|
73
|
-
children: a
|
|
74
|
-
})]
|
|
75
|
-
}), /* @__PURE__ */ s("span", {
|
|
76
|
-
className: "stat-card__sparkline",
|
|
77
|
-
children: S
|
|
78
|
-
})]
|
|
79
|
-
}) : /* @__PURE__ */ c("span", {
|
|
80
|
-
className: "stat-card__value-row",
|
|
81
|
-
children: [/* @__PURE__ */ s("span", {
|
|
82
|
-
className: "stat-card__value",
|
|
83
|
-
children: O
|
|
84
|
-
}), a && /* @__PURE__ */ s("span", {
|
|
85
|
-
className: "stat-card__value-suffix",
|
|
86
|
-
children: a
|
|
87
|
-
})]
|
|
88
|
-
}), m && !g && /* @__PURE__ */ c("span", {
|
|
89
|
-
className: `stat-card__trend stat-card__trend--${m.direction}`,
|
|
90
|
-
"aria-label": m.ariaLabel ?? m.label,
|
|
91
|
-
children: [/* @__PURE__ */ s("span", {
|
|
92
|
-
"aria-hidden": "true",
|
|
93
|
-
children: d[m.direction]
|
|
94
|
-
}), /* @__PURE__ */ s("span", { children: m.label })]
|
|
40
|
+
function v({ label: n, labelNode: r, value: i, valueSuffix: a, hint: p, icon: v, tone: y = "default", trend: b, onClick: x, loading: S = !1, ariaLabel: C, className: w = "", testId: T, format: E, animate: D = !1, sparkline: O, emphasis: k = "default" }) {
|
|
41
|
+
let A = e(), j = typeof i == "number", M = D === !0 ? "count" : D === !1 ? null : D, N = j && !S && !A, P = M === "count" && N, F = M === "digits" && N, I = m(j ? i : 0, P), L = _(j && P ? I : i, E), R = F ? /* @__PURE__ */ l(t, { text: L }) : L, z = F ? "uic-stat-card__value uic-stat-card__value--digits" : "uic-stat-card__value", B = C ?? (S ? n : `${n}: ${_(i, E)}${a ?? ""}`), V = [
|
|
42
|
+
"uic-stat-card",
|
|
43
|
+
`uic-stat-card--tone-${y}`,
|
|
44
|
+
k === "default" ? "" : `uic-stat-card--${k}`,
|
|
45
|
+
w
|
|
46
|
+
].filter(Boolean).join(" "), H = /* @__PURE__ */ u("span", {
|
|
47
|
+
className: "uic-stat-card__value-row",
|
|
48
|
+
children: [/* @__PURE__ */ l("span", {
|
|
49
|
+
className: z,
|
|
50
|
+
children: R
|
|
51
|
+
}), a && /* @__PURE__ */ l("span", {
|
|
52
|
+
className: "uic-stat-card__value-suffix",
|
|
53
|
+
children: a
|
|
54
|
+
})]
|
|
55
|
+
}), U = /* @__PURE__ */ u(c, { children: [
|
|
56
|
+
/* @__PURE__ */ u("div", {
|
|
57
|
+
className: "uic-stat-card__header",
|
|
58
|
+
children: [/* @__PURE__ */ l(o, {
|
|
59
|
+
type: "label",
|
|
60
|
+
className: "uic-stat-card__label",
|
|
61
|
+
color: "secondary",
|
|
62
|
+
children: r ?? n
|
|
63
|
+
}), v && /* @__PURE__ */ l("span", {
|
|
64
|
+
className: "uic-stat-card__icon",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
children: v
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ u("div", {
|
|
70
|
+
className: "uic-stat-card__body",
|
|
71
|
+
children: [S ? /* @__PURE__ */ l(s, {
|
|
72
|
+
width: "60%",
|
|
73
|
+
height: "2rem"
|
|
74
|
+
}) : O ? /* @__PURE__ */ u("span", {
|
|
75
|
+
className: "uic-stat-card__value-line",
|
|
76
|
+
children: [H, /* @__PURE__ */ l("span", {
|
|
77
|
+
className: "uic-stat-card__sparkline",
|
|
78
|
+
children: O
|
|
95
79
|
})]
|
|
96
|
-
}),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
children:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}) :
|
|
103
|
-
})
|
|
104
|
-
|
|
80
|
+
}) : H, b && !S && /* @__PURE__ */ u("span", {
|
|
81
|
+
className: `uic-stat-card__trend uic-stat-card__trend--${b.direction}`,
|
|
82
|
+
"aria-label": b.ariaLabel ?? b.label,
|
|
83
|
+
children: [/* @__PURE__ */ l("span", {
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
children: h[b.direction]
|
|
86
|
+
}), /* @__PURE__ */ l("span", { children: b.label })]
|
|
87
|
+
})]
|
|
88
|
+
}),
|
|
89
|
+
p != null && /* @__PURE__ */ l("div", {
|
|
90
|
+
className: "uic-stat-card__hint",
|
|
91
|
+
children: S ? /* @__PURE__ */ l(s, {
|
|
92
|
+
width: "80%",
|
|
93
|
+
height: "0.85rem",
|
|
94
|
+
index: 1
|
|
95
|
+
}) : p
|
|
96
|
+
})
|
|
97
|
+
] });
|
|
98
|
+
return x ? /* @__PURE__ */ l(f, {
|
|
99
|
+
label: B,
|
|
100
|
+
onClick: () => x(),
|
|
101
|
+
padding: g[k],
|
|
102
|
+
className: V,
|
|
103
|
+
"data-testid": T,
|
|
104
|
+
children: U
|
|
105
|
+
}) : /* @__PURE__ */ l(d, {
|
|
106
|
+
padding: g[k],
|
|
107
|
+
className: V,
|
|
108
|
+
role: "group",
|
|
109
|
+
"aria-label": B,
|
|
110
|
+
"data-testid": T,
|
|
111
|
+
children: U
|
|
105
112
|
});
|
|
106
113
|
}
|
|
107
|
-
var
|
|
114
|
+
var y = n(v);
|
|
108
115
|
//#endregion
|
|
109
|
-
export {
|
|
116
|
+
export { y as StatCard };
|
|
110
117
|
|
|
111
118
|
//# sourceMappingURL=StatCard2.js.map
|
|
112
119
|
import "../../assets/components/StatCard/StatCard.css";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatCard2.js","names":[],"sources":["../../../src/components/StatCard/StatCard.tsx"],"sourcesContent":["/**\n * StatCard Component\n *\n * Compact metric card for dashboards. Renders a label, a large numeric\n * value (with optional unit/suffix), and optional icon, hint, trend, or\n * accent tone. Wraps `BaseCard` so it inherits hover/focus/click affordances\n * and design tokens consistently with the rest of the common library.\n *\n * Designed for cross-page reuse: Squad dashboard, Statistics page, Cowork\n * dashboard, etc.\n */\n\nimport { memo, useEffect, useRef, useState, type ReactNode, type JSX } from \"react\";\nimport { usePrefersReducedMotion } from \"../../hooks/usePrefersReducedMotion\";\nimport { BaseCard } from \"../BaseCard\";\nimport { Skeleton } from \"../Skeleton\";\nimport \"./StatCard.css\";\n\nexport type StatCardEmphasis = \"compact\" | \"default\" | \"prominent\";\n\nexport type StatCardTone = \"default\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\nexport type StatCardTrendDirection = \"up\" | \"down\" | \"flat\";\n\nexport interface StatCardTrend {\n /** Direction indicator (up / down / flat) */\n direction: StatCardTrendDirection;\n /** Human-readable delta label (e.g. \"+12%\", \"-3\", \"0\") */\n label: string;\n /** Optional ARIA description for screen readers */\n ariaLabel?: string;\n}\n\nexport interface StatCardProps {\n /** Short label rendered above the value (UPPERCASE styled) */\n label: string;\n /** Primary metric value (number is coerced to localised string) */\n value: string | number;\n /** Optional suffix appended to the value (e.g. \"/ 4\", \"GB\") */\n valueSuffix?: string;\n /** Optional helper line under the value (e.g. context, secondary metric) */\n hint?: ReactNode;\n /** Optional leading icon node, rendered inside an accent badge */\n icon?: ReactNode;\n /** Visual tone, mirrors Badge variants. Default: \"default\" */\n tone?: StatCardTone;\n /** Optional trend indicator under the value */\n trend?: StatCardTrend;\n /** Click handler. Renders the card as keyboard-accessible button. */\n onClick?: () => void;\n /** Render skeletons instead of value/label content while loading */\n loading?: boolean;\n /** Optional aria label override (defaults to label + value) */\n ariaLabel?: string;\n /** Extra class name applied to the root */\n className?: string;\n /** Test id for unit tests */\n testId?: string;\n /**\n * Formatter for numeric values (e.g. abbreviate to \"1.2K\", append \"%\").\n * Defaults to `toLocaleString`. Ignored when `value` is a string.\n */\n format?: (value: number) => string;\n /**\n * Count up to a numeric value on mount and on change. Off by default so\n * existing consumers render the final value immediately; opt in for\n * dashboard hero metrics. Suppressed under `prefers-reduced-motion`.\n */\n animate?: boolean;\n /**\n * Optional trailing visual on the value line (e.g. a sparkline). Kept as a\n * slot so the card does not depend on any particular chart component.\n */\n sparkline?: ReactNode;\n /** Visual weight. Default: \"default\" */\n emphasis?: StatCardEmphasis;\n}\n\nconst ANIMATION_DURATION_MS = 800;\n\n/**\n * Counts from the previous value to `target` with an ease-out-cubic curve.\n * When `enabled` is false the target is returned directly and no animation\n * frame is ever scheduled.\n */\nfunction useAnimatedValue(target: number, enabled: boolean): number {\n const [displayValue, setDisplayValue] = useState(enabled ? 0 : target);\n const previousValue = useRef(enabled ? 0 : target);\n const frameRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (!enabled) {\n previousValue.current = target;\n setDisplayValue(target);\n return;\n }\n\n const startValue = previousValue.current;\n const startTime = performance.now();\n\n const step = (now: number): void => {\n const progress = Math.min((now - startTime) / ANIMATION_DURATION_MS, 1);\n const eased = 1 - Math.pow(1 - progress, 3);\n setDisplayValue(Math.round(startValue + (target - startValue) * eased));\n\n if (progress < 1) {\n frameRef.current = requestAnimationFrame(step);\n } else {\n previousValue.current = target;\n }\n };\n\n frameRef.current = requestAnimationFrame(step);\n\n return () => {\n if (frameRef.current !== null) {\n cancelAnimationFrame(frameRef.current);\n }\n };\n }, [target, enabled]);\n\n return enabled ? displayValue : target;\n}\n\nconst TREND_GLYPH: Record<StatCardTrendDirection, string> = {\n up: \"▲\",\n down: \"▼\",\n flat: \"•\",\n};\n\nfunction formatValue(\n value: string | number,\n format?: (value: number) => string,\n): string {\n if (typeof value === \"number\") {\n return format ? format(value) : value.toLocaleString();\n }\n return value;\n}\n\nfunction StatCardComponent({\n label,\n value,\n valueSuffix,\n hint,\n icon,\n tone = \"default\",\n trend,\n onClick,\n loading = false,\n ariaLabel,\n className = \"\",\n testId,\n format,\n animate = false,\n sparkline,\n emphasis = \"default\",\n}: StatCardProps): JSX.Element {\n const prefersReducedMotion = usePrefersReducedMotion();\n const isNumeric = typeof value === \"number\";\n const shouldAnimate = animate && isNumeric && !loading && !prefersReducedMotion;\n const animatedValue = useAnimatedValue(isNumeric ? value : 0, shouldAnimate);\n\n const displayValue = formatValue(\n isNumeric && shouldAnimate ? animatedValue : value,\n format,\n );\n\n // The aria-label always describes the settled value, never an in-flight\n // animation frame, so assistive tech is not read a counting-up number.\n const composedAriaLabel =\n ariaLabel ??\n (loading ? label : `${label}: ${formatValue(value, format)}${valueSuffix ?? \"\"}`);\n\n const rootClass = [\n \"stat-card\",\n \"corner-accent\",\n `stat-card--tone-${tone}`,\n emphasis !== \"default\" ? `stat-card--${emphasis}` : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <BaseCard\n className={rootClass}\n onClick={onClick}\n role={onClick ? undefined : \"group\"}\n ariaLabel={composedAriaLabel}\n testId={testId}\n >\n <div className=\"stat-card__header\">\n <span className=\"stat-card__label\">{label}</span>\n {icon && (\n <span className=\"stat-card__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n </div>\n\n <div className=\"stat-card__body\">\n {loading ? (\n <Skeleton width=\"60%\" height=\"2rem\" />\n ) : sparkline ? (\n // Only wrap when a sparkline is present, so cards without one keep\n // the exact DOM they had before the slot existed.\n <span className=\"stat-card__value-line\">\n <span className=\"stat-card__value-row\">\n <span className=\"stat-card__value\">{displayValue}</span>\n {valueSuffix && (\n <span className=\"stat-card__value-suffix\">{valueSuffix}</span>\n )}\n </span>\n <span className=\"stat-card__sparkline\">{sparkline}</span>\n </span>\n ) : (\n <span className=\"stat-card__value-row\">\n <span className=\"stat-card__value\">{displayValue}</span>\n {valueSuffix && (\n <span className=\"stat-card__value-suffix\">{valueSuffix}</span>\n )}\n </span>\n )}\n\n {trend && !loading && (\n <span\n className={`stat-card__trend stat-card__trend--${trend.direction}`}\n aria-label={trend.ariaLabel ?? trend.label}\n >\n <span aria-hidden=\"true\">{TREND_GLYPH[trend.direction]}</span>\n <span>{trend.label}</span>\n </span>\n )}\n </div>\n\n {hint !== undefined && hint !== null && (\n <div className=\"stat-card__hint\">\n {loading ? <Skeleton width=\"80%\" height=\"0.85rem\" /> : hint}\n </div>\n )}\n </BaseCard>\n );\n}\n\nexport const StatCard = memo(StatCardComponent);\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"StatCard2.js","names":[],"sources":["../../../src/components/StatCard/StatCard.tsx"],"sourcesContent":["/**\n * StatCard\n *\n * Compact metric card for dashboards: a label, a large value with an optional\n * suffix, and optional icon, hint, trend, sparkline or accent tone. Built on\n * Astryx `Card` (or `ClickableCard` when it has an `onClick`), `Text` and\n * `Skeleton`. The label can be a node (`labelNode`) while the accessible name\n * stays the plain `label` string.\n */\nimport { memo, useEffect, useRef, useState, type JSX, type ReactNode } from \"react\";\nimport { Card } from \"@astryxdesign/core/Card\";\nimport { ClickableCard } from \"@astryxdesign/core/ClickableCard\";\nimport { Skeleton } from \"@astryxdesign/core/Skeleton\";\nimport { Text } from \"@astryxdesign/core/Text\";\n\nimport { usePrefersReducedMotion } from \"../../hooks/usePrefersReducedMotion\";\nimport { DigitPopIn } from \"../DigitPopIn\";\nimport \"./StatCard.css\";\n\nexport type StatCardEmphasis = \"compact\" | \"default\" | \"prominent\";\n\nexport type StatCardTone = \"default\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\nexport type StatCardTrendDirection = \"up\" | \"down\" | \"flat\";\n\n/**\n * How a numeric value arrives. `count` counts up from the previous value;\n * `digits` pops each character of the formatted value in, staggered, and\n * replays when the value changes.\n */\nexport type StatCardAnimation = \"count\" | \"digits\";\n\nexport interface StatCardTrend {\n /** Direction indicator (up / down / flat) */\n direction: StatCardTrendDirection;\n /** Human-readable delta label (e.g. \"+12%\", \"-3\", \"0\") */\n label: string;\n /** Optional ARIA description for screen readers */\n ariaLabel?: string;\n}\n\nexport interface StatCardProps {\n /** Short label rendered above the value (uppercase) */\n label: string;\n /**\n * Rendered in place of `label` when the label is not plain text: a glossary\n * term carrying its definition, a unit badge, an info affordance.\n *\n * `label` stays required and stays the accessible name. Pass the same words\n * in both.\n */\n labelNode?: ReactNode;\n /** Primary metric value (a number is formatted with `toLocaleString`) */\n value: string | number;\n /** Optional suffix appended to the value (e.g. \"/ 4\", \"GB\") */\n valueSuffix?: string;\n /** Optional helper line under the value */\n hint?: ReactNode;\n /** Optional leading icon node, rendered inside an accent badge */\n icon?: ReactNode;\n /** Visual tone. Default: \"default\" */\n tone?: StatCardTone;\n /** Optional trend indicator under the value */\n trend?: StatCardTrend;\n /** Click handler. Renders the card as Astryx `ClickableCard`. */\n onClick?: () => void;\n /** Render skeletons instead of the value while loading */\n loading?: boolean;\n /** Optional aria label override (defaults to label + value) */\n ariaLabel?: string;\n /** Extra class name applied to the root */\n className?: string;\n /** Test id for unit tests */\n testId?: string;\n /**\n * Formatter for numeric values (e.g. abbreviate to \"1.2K\", append \"%\").\n * Defaults to `toLocaleString`. Ignored when `value` is a string.\n */\n format?: (value: number) => string;\n /**\n * Animate a numeric value on mount and on change. `true` or `\"count\"`\n * counts up to it; `\"digits\"` pops each character of the formatted value\n * in. Suppressed under `prefers-reduced-motion`, and ignored for string\n * values and while loading.\n */\n animate?: boolean | StatCardAnimation;\n /** Optional trailing visual on the value line (e.g. a sparkline) */\n sparkline?: ReactNode;\n /** Visual weight. Default: \"default\" */\n emphasis?: StatCardEmphasis;\n}\n\nconst ANIMATION_DURATION_MS = 800;\n\n/**\n * Counts from the previous value to `target` with an ease-out-cubic curve.\n * When `enabled` is false the target is returned directly and no animation\n * frame is ever scheduled.\n */\nfunction useAnimatedValue(target: number, enabled: boolean): number {\n const [displayValue, setDisplayValue] = useState(enabled ? 0 : target);\n const previousValue = useRef(enabled ? 0 : target);\n const frameRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (!enabled) {\n previousValue.current = target;\n setDisplayValue(target);\n return;\n }\n\n const startValue = previousValue.current;\n const startTime = performance.now();\n\n const step = (now: number): void => {\n const progress = Math.min((now - startTime) / ANIMATION_DURATION_MS, 1);\n const eased = 1 - Math.pow(1 - progress, 3);\n setDisplayValue(Math.round(startValue + (target - startValue) * eased));\n\n if (progress < 1) {\n frameRef.current = requestAnimationFrame(step);\n } else {\n previousValue.current = target;\n }\n };\n\n frameRef.current = requestAnimationFrame(step);\n\n return () => {\n if (frameRef.current !== null) {\n cancelAnimationFrame(frameRef.current);\n }\n };\n }, [target, enabled]);\n\n return enabled ? displayValue : target;\n}\n\nconst TREND_GLYPH: Record<StatCardTrendDirection, string> = {\n up: \"▲\",\n down: \"▼\",\n flat: \"•\",\n};\n\n/** Card padding per emphasis, on Astryx's spacing scale. */\nconst PADDING: Record<StatCardEmphasis, 2 | 4 | 6> = {\n compact: 2,\n default: 4,\n prominent: 6,\n};\n\nfunction formatValue(\n value: string | number,\n format?: (value: number) => string,\n): string {\n if (typeof value === \"number\") {\n return format ? format(value) : value.toLocaleString();\n }\n return value;\n}\n\nfunction StatCardComponent({\n label,\n labelNode,\n value,\n valueSuffix,\n hint,\n icon,\n tone = \"default\",\n trend,\n onClick,\n loading = false,\n ariaLabel,\n className = \"\",\n testId,\n format,\n animate = false,\n sparkline,\n emphasis = \"default\",\n}: StatCardProps): JSX.Element {\n const prefersReducedMotion = usePrefersReducedMotion();\n const isNumeric = typeof value === \"number\";\n const animation: StatCardAnimation | null =\n animate === true ? \"count\" : animate === false ? null : animate;\n const canAnimate = isNumeric && !loading && !prefersReducedMotion;\n const shouldCount = animation === \"count\" && canAnimate;\n const shouldPopDigits = animation === \"digits\" && canAnimate;\n const animatedValue = useAnimatedValue(isNumeric ? value : 0, shouldCount);\n\n const displayValue = formatValue(\n isNumeric && shouldCount ? animatedValue : value,\n format,\n );\n const valueContent = shouldPopDigits ? (\n <DigitPopIn text={displayValue} />\n ) : (\n displayValue\n );\n const valueClass = shouldPopDigits\n ? \"uic-stat-card__value uic-stat-card__value--digits\"\n : \"uic-stat-card__value\";\n\n // The aria-label always describes the settled value, never an in-flight\n // animation frame, so assistive tech is not read a counting-up number.\n const composedAriaLabel =\n ariaLabel ??\n (loading ? label : `${label}: ${formatValue(value, format)}${valueSuffix ?? \"\"}`);\n\n const rootClass = [\n \"uic-stat-card\",\n `uic-stat-card--tone-${tone}`,\n emphasis !== \"default\" ? `uic-stat-card--${emphasis}` : \"\",\n className,\n ]\n .filter(Boolean)\n .join(\" \");\n\n const valueRow = (\n <span className=\"uic-stat-card__value-row\">\n <span className={valueClass}>{valueContent}</span>\n {valueSuffix && (\n <span className=\"uic-stat-card__value-suffix\">{valueSuffix}</span>\n )}\n </span>\n );\n\n const body = (\n <>\n <div className=\"uic-stat-card__header\">\n <Text type=\"label\" className=\"uic-stat-card__label\" color=\"secondary\">\n {labelNode ?? label}\n </Text>\n {icon && (\n <span className=\"uic-stat-card__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n )}\n </div>\n\n <div className=\"uic-stat-card__body\">\n {loading ? (\n <Skeleton width=\"60%\" height=\"2rem\" />\n ) : sparkline ? (\n // Only wrap when a sparkline is present, so cards without one keep\n // the value row as a direct child of the body.\n <span className=\"uic-stat-card__value-line\">\n {valueRow}\n <span className=\"uic-stat-card__sparkline\">{sparkline}</span>\n </span>\n ) : (\n valueRow\n )}\n\n {trend && !loading && (\n <span\n className={`uic-stat-card__trend uic-stat-card__trend--${trend.direction}`}\n aria-label={trend.ariaLabel ?? trend.label}\n >\n <span aria-hidden=\"true\">{TREND_GLYPH[trend.direction]}</span>\n <span>{trend.label}</span>\n </span>\n )}\n </div>\n\n {hint !== undefined && hint !== null && (\n <div className=\"uic-stat-card__hint\">\n {loading ? <Skeleton width=\"80%\" height=\"0.85rem\" index={1} /> : hint}\n </div>\n )}\n </>\n );\n\n if (onClick) {\n return (\n <ClickableCard\n label={composedAriaLabel}\n onClick={() => onClick()}\n padding={PADDING[emphasis]}\n className={rootClass}\n data-testid={testId}\n >\n {body}\n </ClickableCard>\n );\n }\n\n return (\n <Card\n padding={PADDING[emphasis]}\n className={rootClass}\n role=\"group\"\n aria-label={composedAriaLabel}\n data-testid={testId}\n >\n {body}\n </Card>\n );\n}\n\nexport const StatCard = memo(StatCardComponent);\n"],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { StatCard } from './StatCard';
|
|
2
2
|
export { formatCompactNumber } from './formatters';
|
|
3
|
-
export type { StatCardProps, StatCardEmphasis, StatCardTone, StatCardTrend, StatCardTrendDirection, } from './StatCard';
|
|
3
|
+
export type { StatCardProps, StatCardAnimation, StatCardEmphasis, StatCardTone, StatCardTrend, StatCardTrendDirection, } from './StatCard';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface StatisticProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
|
|
3
|
+
/** The caption. */
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** The value. Not finite renders `unlimitedLabel`. */
|
|
6
|
+
value?: number;
|
|
7
|
+
/** What the value is measured against; the bar needs it. */
|
|
8
|
+
total?: number;
|
|
9
|
+
/** Unit after the value. */
|
|
10
|
+
unit?: string;
|
|
11
|
+
/** Decimal places, trailing zeros dropped. @default 2 */
|
|
12
|
+
precision?: number;
|
|
13
|
+
/** A non-finite value or total in the bar's tooltip. @default '∞' */
|
|
14
|
+
infinityLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The usage bar: `visible` draws it (with a `total`), `placeholder` keeps
|
|
17
|
+
* its space without painting it, `hidden` leaves it out. @default 'hidden'
|
|
18
|
+
*/
|
|
19
|
+
progressMode?: "hidden" | "placeholder" | "visible";
|
|
20
|
+
/** Notches in the bar. @default 20 */
|
|
21
|
+
progressSteps?: number;
|
|
22
|
+
/** Colour of the value and of the bar's filled notches. */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** Shown for a non-finite value. @default the catalog's uic.Statistic.unlimited ("Unlimited") */
|
|
25
|
+
unlimitedLabel?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function Statistic({ label, value, total, unit, precision, infinityLabel, progressMode, progressSteps, color, unlimitedLabel, className, ...divProps }: StatisticProps): import("react").JSX.Element;
|
|
28
|
+
export declare namespace Statistic {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages as e } from "../../i18n/catalog.js";
|
|
2
|
+
//#region src/components/Statistic/Statistic.messages.ts
|
|
3
|
+
var t = e({ "uic.Statistic.unlimited": {
|
|
4
|
+
defaultMessage: "Unlimited",
|
|
5
|
+
description: "Shown in place of a metric's value when the value has no limit"
|
|
6
|
+
} });
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as statisticMessages };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=Statistic.messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Statistic.messages.js","names":[],"sources":["../../../src/components/Statistic/Statistic.messages.ts"],"sourcesContent":["import { defineMessages } from \"../../i18n/catalog\";\n\nexport const statisticMessages = defineMessages({\n \"uic.Statistic.unlimited\": {\n defaultMessage: \"Unlimited\",\n description: \"Shown in place of a metric's value when the value has no limit\",\n },\n});\n"],"mappings":";;AAEA,IAAa,IAAoB,EAAe,EAC9C,2BAA2B;CACzB,gBAAgB;CAChB,aAAa;AACf,EACF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useUicTranslator as e } from "../../i18n/useUicTranslator.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { HStack as t, VStack as n } from "@astryxdesign/core/Stack";
|
|
4
|
+
import { Text as r } from "@astryxdesign/core/Text";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Tooltip as s } from "@astryxdesign/core/Tooltip";
|
|
7
|
+
//#region src/components/Statistic/Statistic.tsx
|
|
8
|
+
function c({ steps: e, percent: t, isPlaceholder: n, color: r, label: i }) {
|
|
9
|
+
let o = Math.round(t / 100 * e);
|
|
10
|
+
return /* @__PURE__ */ a("div", {
|
|
11
|
+
className: "uic-statistic__steps",
|
|
12
|
+
role: "progressbar",
|
|
13
|
+
"aria-label": i,
|
|
14
|
+
"aria-valuenow": t,
|
|
15
|
+
"aria-valuemin": 0,
|
|
16
|
+
"aria-valuemax": 100,
|
|
17
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ a("span", {
|
|
18
|
+
className: n ? "uic-statistic__step uic-statistic__step--placeholder" : t < o ? "uic-statistic__step uic-statistic__step--filled" : "uic-statistic__step",
|
|
19
|
+
style: n || t >= o ? void 0 : { backgroundColor: r }
|
|
20
|
+
}, t))
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function l({ label: l, value: u, total: d, unit: f = "", precision: p = 2, infinityLabel: m = "∞", progressMode: h = "hidden", progressSteps: g = 20, color: _, unlimitedLabel: v, className: y, ...b }) {
|
|
24
|
+
let x = e(), S = (e) => Number.isFinite(e) ? parseFloat(e.toFixed(p)).toString() : m, C = u === void 0 ? void 0 : S(u), w = d === void 0 ? void 0 : S(d), T = h === "hidden" || d === void 0 || d === Infinity ? 0 : d === 0 ? u === 0 ? 0 : 100 : u === void 0 || !Number.isFinite(u) || !Number.isFinite(d) ? 100 : Math.round(u / d * 100), E = typeof l == "string" ? l : "usage", D = _ ? { color: _ } : void 0;
|
|
25
|
+
return /* @__PURE__ */ o(n, {
|
|
26
|
+
align: "start",
|
|
27
|
+
className: ["uic-statistic", y].filter(Boolean).join(" "),
|
|
28
|
+
...b,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ a(r, {
|
|
31
|
+
size: "lg",
|
|
32
|
+
color: "secondary",
|
|
33
|
+
display: "block",
|
|
34
|
+
className: "uic-statistic__label",
|
|
35
|
+
children: l
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ a(t, {
|
|
38
|
+
gap: 1,
|
|
39
|
+
align: "end",
|
|
40
|
+
className: "uic-statistic__row",
|
|
41
|
+
children: u !== void 0 && !Number.isFinite(u) ? /* @__PURE__ */ a(r, {
|
|
42
|
+
className: "uic-statistic__value",
|
|
43
|
+
children: v ?? x("uic.Statistic.unlimited")
|
|
44
|
+
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(r, {
|
|
45
|
+
className: "uic-statistic__value",
|
|
46
|
+
style: D,
|
|
47
|
+
children: C
|
|
48
|
+
}), f && /* @__PURE__ */ a(r, {
|
|
49
|
+
color: "secondary",
|
|
50
|
+
children: f
|
|
51
|
+
})] })
|
|
52
|
+
}),
|
|
53
|
+
h === "visible" && d !== void 0 ? /* @__PURE__ */ a(s, {
|
|
54
|
+
content: `${C} ${f} / ${w} ${f}`,
|
|
55
|
+
children: /* @__PURE__ */ a(c, {
|
|
56
|
+
steps: g,
|
|
57
|
+
percent: T,
|
|
58
|
+
color: _,
|
|
59
|
+
label: E
|
|
60
|
+
})
|
|
61
|
+
}) : h === "placeholder" ? /* @__PURE__ */ a(c, {
|
|
62
|
+
isPlaceholder: !0,
|
|
63
|
+
steps: g,
|
|
64
|
+
percent: 0,
|
|
65
|
+
label: E
|
|
66
|
+
}) : null
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
l.displayName = "Statistic";
|
|
71
|
+
//#endregion
|
|
72
|
+
export { l as Statistic };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=Statistic2.js.map
|
|
75
|
+
import "../../assets/components/Statistic/Statistic.css";
|