@cube-dev/ui-kit 0.0.0-canary-6be6cbe → 0.0.0-canary-7ec55ba
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/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +3 -4
- package/dist/components/Root.js.map +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +2 -4
- package/dist/components/actions/Banner/Banner.js.map +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +2 -4
- package/dist/components/actions/CommandMenu/CommandMenu.js.map +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +3 -6
- package/dist/components/actions/use-anchored-menu.js.map +1 -1
- package/dist/components/actions/use-context-menu.js +3 -6
- package/dist/components/actions/use-context-menu.js.map +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +6 -7
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js.map +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +9 -9
- package/dist/components/content/CopySnippet/CopySnippet.js.map +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +2 -4
- package/dist/components/content/Layout/LayoutHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +6 -9
- package/dist/components/content/Layout/LayoutPanelHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +2 -4
- package/dist/components/content/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +2 -4
- package/dist/components/content/Tag/Tag.js.map +1 -1
- package/dist/components/content/Text.d.ts +7 -7
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +2 -4
- package/dist/components/content/Tree/TreeNode.js.map +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +3 -5
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +3 -4
- package/dist/components/fields/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +4 -5
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +5 -6
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/intl.js +11 -0
- package/dist/components/fields/DatePicker/intl.js.map +1 -0
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +3 -5
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +6 -9
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +3 -5
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +5 -9
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +2 -4
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +2 -5
- package/dist/components/fields/NumberInput/StepButton.js.map +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +2 -4
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
- package/dist/components/fields/Picker/Picker.js +3 -5
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +5 -7
- package/dist/components/fields/TextInputMapper/TextInputMapper.js.map +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/extract-field-wrapper-props.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +2 -4
- package/dist/components/form/Form/SubmitError.js.map +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +8 -6
- package/dist/components/form/Label.js.map +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.d.ts +24 -5
- package/dist/components/layout/Board/Board.js +84 -61
- package/dist/components/layout/Board/Board.js.map +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.d.ts +23 -3
- package/dist/components/layout/Board/Widget.js +28 -2
- package/dist/components/layout/Board/Widget.js.map +1 -1
- package/dist/components/layout/Board/WidgetHost.js +22 -13
- package/dist/components/layout/Board/WidgetHost.js.map +1 -1
- package/dist/components/layout/Board/board-context.js +12 -2
- package/dist/components/layout/Board/board-context.js.map +1 -1
- package/dist/components/layout/Board/board-store.js +2 -2
- package/dist/components/layout/Board/board-store.js.map +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +2 -2
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.d.ts +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +3 -2
- package/dist/components/layout/Board/use-board-registry.js.map +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +4 -7
- package/dist/components/navigation/Tabs/TabButton.js.map +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +3 -5
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/FileTabs/FileTabs.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CloudLogo/CloudLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +6 -8
- package/dist/components/overlays/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +8 -5
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +3 -5
- package/dist/components/overlays/Dialog/DialogForm.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +2 -4
- package/dist/components/overlays/Notifications/NotificationCard.js.map +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +8 -17
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js.map +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.d.ts +3 -9
- package/dist/components/overlays/Notifications/format-relative-time.js +12 -20
- package/dist/components/overlays/Notifications/format-relative-time.js.map +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +3 -6
- package/dist/components/overlays/Toast/useProgressToast.js.map +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +2 -4
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js.map +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.d.ts +2 -12
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/layout/Board.md +35 -12
- package/package.json +1 -3
- package/dist/i18n/I18nProvider.d.ts +0 -39
- package/dist/i18n/I18nProvider.js +0 -43
- package/dist/i18n/I18nProvider.js.map +0 -1
- package/dist/i18n/createFormatter.d.ts +0 -59
- package/dist/i18n/createFormatter.js +0 -148
- package/dist/i18n/createFormatter.js.map +0 -1
- package/dist/i18n/formatting-locale.d.ts +0 -9
- package/dist/i18n/formatting-locale.js +0 -29
- package/dist/i18n/formatting-locale.js.map +0 -1
- package/dist/i18n/index.d.ts +0 -19
- package/dist/i18n/index.js +0 -22
- package/dist/i18n/index.js.map +0 -1
- package/dist/i18n/instance.d.ts +0 -14
- package/dist/i18n/instance.js +0 -64
- package/dist/i18n/instance.js.map +0 -1
- package/dist/i18n/locales/de-DE/uikit.js +0 -112
- package/dist/i18n/locales/de-DE/uikit.js.map +0 -1
- package/dist/i18n/locales/en-US/uikit.js +0 -112
- package/dist/i18n/locales/en-US/uikit.js.map +0 -1
- package/dist/i18n/locales/en-US/uikit.json.d.ts +0 -140
- package/dist/i18n/locales/es-ES/uikit.js +0 -112
- package/dist/i18n/locales/es-ES/uikit.js.map +0 -1
- package/dist/i18n/locales/es-MX/uikit.js +0 -112
- package/dist/i18n/locales/es-MX/uikit.js.map +0 -1
- package/dist/i18n/locales/fr-FR/uikit.js +0 -112
- package/dist/i18n/locales/fr-FR/uikit.js.map +0 -1
- package/dist/i18n/locales/it-IT/uikit.js +0 -112
- package/dist/i18n/locales/it-IT/uikit.js.map +0 -1
- package/dist/i18n/locales/ja-JP/uikit.js +0 -112
- package/dist/i18n/locales/ja-JP/uikit.js.map +0 -1
- package/dist/i18n/locales/nb-NO/uikit.js +0 -112
- package/dist/i18n/locales/nb-NO/uikit.js.map +0 -1
- package/dist/i18n/locales/pt-BR/uikit.js +0 -112
- package/dist/i18n/locales/pt-BR/uikit.js.map +0 -1
- package/dist/i18n/locales/pt-PT/uikit.js +0 -112
- package/dist/i18n/locales/pt-PT/uikit.js.map +0 -1
- package/dist/i18n/locales/sv-SE/uikit.js +0 -112
- package/dist/i18n/locales/sv-SE/uikit.js.map +0 -1
- package/dist/i18n/locales/vi-VN/uikit.js +0 -112
- package/dist/i18n/locales/vi-VN/uikit.js.map +0 -1
- package/dist/i18n/locales.d.ts +0 -17
- package/dist/i18n/locales.js +0 -45
- package/dist/i18n/locales.js.map +0 -1
- package/dist/i18n/useFormatter.d.ts +0 -33
- package/dist/i18n/useFormatter.js +0 -59
- package/dist/i18n/useFormatter.js.map +0 -1
- package/dist/i18n/useI18n.d.ts +0 -2
- package/dist/i18n/useI18n.js +0 -19
- package/dist/i18n/useI18n.js.map +0 -1
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-6be6cbe | Cube Dev Team */
|
|
2
|
-
//#region src/i18n/createFormatter.ts
|
|
3
|
-
const cache = /* @__PURE__ */ new Map();
|
|
4
|
-
function getIntl(kind, Ctor, locale, options) {
|
|
5
|
-
const key = `${locale}|${kind}|${options ? JSON.stringify(options) : ""}`;
|
|
6
|
-
let instance = cache.get(key);
|
|
7
|
-
if (!instance) {
|
|
8
|
-
instance = new Ctor(locale, options);
|
|
9
|
-
cache.set(key, instance);
|
|
10
|
-
}
|
|
11
|
-
return instance;
|
|
12
|
-
}
|
|
13
|
-
function toDate(value) {
|
|
14
|
-
const date = value instanceof Date ? value : new Date(value);
|
|
15
|
-
return Number.isNaN(date.getTime()) ? null : date;
|
|
16
|
-
}
|
|
17
|
-
const BYTE_UNITS = [
|
|
18
|
-
"byte",
|
|
19
|
-
"kilobyte",
|
|
20
|
-
"megabyte",
|
|
21
|
-
"gigabyte",
|
|
22
|
-
"terabyte",
|
|
23
|
-
"petabyte"
|
|
24
|
-
];
|
|
25
|
-
const RELATIVE_DIVISIONS = [
|
|
26
|
-
{
|
|
27
|
-
amount: 60,
|
|
28
|
-
unit: "second"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
amount: 60,
|
|
32
|
-
unit: "minute"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
amount: 24,
|
|
36
|
-
unit: "hour"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
amount: 7,
|
|
40
|
-
unit: "day"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
amount: 4.34524,
|
|
44
|
-
unit: "week"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
amount: 12,
|
|
48
|
-
unit: "month"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
amount: Number.POSITIVE_INFINITY,
|
|
52
|
-
unit: "year"
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
/**
|
|
56
|
-
* Builds a bundle of formatting helpers bound to `locale`. Used by both
|
|
57
|
-
* `useFormatter()` (locale from React Aria context) and the pure top-level
|
|
58
|
-
* helpers (locale from the module mirror). All `Intl.*` instances are memoized.
|
|
59
|
-
*/
|
|
60
|
-
function createFormatter(locale) {
|
|
61
|
-
const formatDate = (value, options) => {
|
|
62
|
-
const date = toDate(value);
|
|
63
|
-
if (!date) return "";
|
|
64
|
-
return getIntl("date", Intl.DateTimeFormat, locale, {
|
|
65
|
-
dateStyle: "medium",
|
|
66
|
-
...options
|
|
67
|
-
}).format(date);
|
|
68
|
-
};
|
|
69
|
-
const formatTime = (value, options) => {
|
|
70
|
-
const date = toDate(value);
|
|
71
|
-
if (!date) return "";
|
|
72
|
-
return getIntl("date", Intl.DateTimeFormat, locale, {
|
|
73
|
-
timeStyle: "short",
|
|
74
|
-
...options
|
|
75
|
-
}).format(date);
|
|
76
|
-
};
|
|
77
|
-
const formatDateTime = (value, options) => {
|
|
78
|
-
const date = toDate(value);
|
|
79
|
-
if (!date) return "";
|
|
80
|
-
return getIntl("date", Intl.DateTimeFormat, locale, {
|
|
81
|
-
dateStyle: "medium",
|
|
82
|
-
timeStyle: "short",
|
|
83
|
-
...options
|
|
84
|
-
}).format(date);
|
|
85
|
-
};
|
|
86
|
-
const formatRelativeTime = (value, options) => {
|
|
87
|
-
const date = toDate(value);
|
|
88
|
-
if (!date) return "";
|
|
89
|
-
const now = options?.now != null ? toDate(options.now) : /* @__PURE__ */ new Date();
|
|
90
|
-
if (!now) return "";
|
|
91
|
-
const rtf = getIntl("relative", Intl.RelativeTimeFormat, locale, {
|
|
92
|
-
numeric: options?.numeric ?? "auto",
|
|
93
|
-
style: options?.style ?? "long"
|
|
94
|
-
});
|
|
95
|
-
let duration = (date.getTime() - now.getTime()) / 1e3;
|
|
96
|
-
for (const division of RELATIVE_DIVISIONS) {
|
|
97
|
-
if (Math.abs(duration) < division.amount) return rtf.format(Math.round(duration), division.unit);
|
|
98
|
-
duration /= division.amount;
|
|
99
|
-
}
|
|
100
|
-
return rtf.format(Math.round(duration), "year");
|
|
101
|
-
};
|
|
102
|
-
const formatNumber = (value, options) => getIntl("number", Intl.NumberFormat, locale, options).format(value);
|
|
103
|
-
const formatCurrency = (value, options) => {
|
|
104
|
-
const { currency = "USD", ...rest } = options ?? {};
|
|
105
|
-
return getIntl("number", Intl.NumberFormat, locale, {
|
|
106
|
-
style: "currency",
|
|
107
|
-
currency,
|
|
108
|
-
...rest
|
|
109
|
-
}).format(value);
|
|
110
|
-
};
|
|
111
|
-
const formatPercent = (value, options) => getIntl("number", Intl.NumberFormat, locale, {
|
|
112
|
-
style: "percent",
|
|
113
|
-
...options
|
|
114
|
-
}).format(value);
|
|
115
|
-
const formatBytes = (value, options) => {
|
|
116
|
-
const sign = value < 0 ? -1 : 1;
|
|
117
|
-
let bytes = Math.abs(value);
|
|
118
|
-
let unitIndex = 0;
|
|
119
|
-
while (bytes >= 1e3 && unitIndex < BYTE_UNITS.length - 1) {
|
|
120
|
-
bytes /= 1e3;
|
|
121
|
-
unitIndex++;
|
|
122
|
-
}
|
|
123
|
-
return getIntl("number", Intl.NumberFormat, locale, {
|
|
124
|
-
style: "unit",
|
|
125
|
-
unit: BYTE_UNITS[unitIndex],
|
|
126
|
-
unitDisplay: options?.unitDisplay ?? "short",
|
|
127
|
-
minimumFractionDigits: options?.minimumFractionDigits ?? 0,
|
|
128
|
-
maximumFractionDigits: options?.maximumFractionDigits ?? (unitIndex === 0 ? 0 : 1)
|
|
129
|
-
}).format(sign * bytes);
|
|
130
|
-
};
|
|
131
|
-
const formatList = (items, options) => getIntl("list", Intl.ListFormat, locale, options).format(items);
|
|
132
|
-
return {
|
|
133
|
-
locale,
|
|
134
|
-
formatDate,
|
|
135
|
-
formatTime,
|
|
136
|
-
formatDateTime,
|
|
137
|
-
formatRelativeTime,
|
|
138
|
-
formatNumber,
|
|
139
|
-
formatCurrency,
|
|
140
|
-
formatPercent,
|
|
141
|
-
formatBytes,
|
|
142
|
-
formatList
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
//#endregion
|
|
147
|
-
export { createFormatter };
|
|
148
|
-
//# sourceMappingURL=createFormatter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createFormatter.js","names":[],"sources":["../../src/i18n/createFormatter.ts"],"sourcesContent":["/**\n * A value acceptable to the date/time formatters. Named `FormatDateInput` (not\n * `DateInput`) to avoid clashing with the exported `DateInput` DatePicker field.\n */\nexport type FormatDateInput = Date | number | string;\n\nexport interface RelativeTimeOptions {\n /** Reference point the value is compared against. Defaults to `Date.now()`. */\n now?: FormatDateInput;\n /** Passed to `Intl.RelativeTimeFormat`. Defaults to `'auto'` (\"yesterday\"). */\n numeric?: Intl.RelativeTimeFormatNumeric;\n /** Passed to `Intl.RelativeTimeFormat`. Defaults to `'long'`. */\n style?: Intl.RelativeTimeFormatStyle;\n}\n\nexport interface CurrencyOptions extends Intl.NumberFormatOptions {\n /** ISO 4217 currency code. Defaults to `'USD'`. */\n currency?: string;\n}\n\nexport interface BytesOptions {\n /** How the unit label is displayed. Defaults to `'short'` (\"MB\"). */\n unitDisplay?: Intl.NumberFormatOptions['unitDisplay'];\n /** Max fraction digits. Defaults to `1`. */\n maximumFractionDigits?: number;\n /** Min fraction digits. Defaults to `0`. */\n minimumFractionDigits?: number;\n}\n\n/** The bundle of locale-bound formatting helpers. */\nexport interface Formatter {\n /** The BCP-47 locale every helper below formats for. */\n locale: string;\n /** Date only, defaults to `{ dateStyle: 'medium' }` (\"Jan 15, 2024\"). */\n formatDate: (\n value: FormatDateInput,\n options?: Intl.DateTimeFormatOptions,\n ) => string;\n /** Time only, defaults to `{ timeStyle: 'short' }` (\"2:30 PM\"). */\n formatTime: (\n value: FormatDateInput,\n options?: Intl.DateTimeFormatOptions,\n ) => string;\n /** Date + time, defaults to `{ dateStyle: 'medium', timeStyle: 'short' }`. */\n formatDateTime: (\n value: FormatDateInput,\n options?: Intl.DateTimeFormatOptions,\n ) => string;\n /** Relative time via `Intl.RelativeTimeFormat` (\"5 minutes ago\"). */\n formatRelativeTime: (\n value: FormatDateInput,\n options?: RelativeTimeOptions,\n ) => string;\n /** A number via `Intl.NumberFormat`. */\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n /** A currency amount, defaults to USD. */\n formatCurrency: (value: number, options?: CurrencyOptions) => string;\n /** A percentage. Input is a fraction: `0.5` → \"50%\". */\n formatPercent: (value: number, options?: Intl.NumberFormatOptions) => string;\n /** A byte count with a localized, auto-scaled unit (\"1.5 MB\"). Decimal (1000-based). */\n formatBytes: (value: number, options?: BytesOptions) => string;\n /** A list via `Intl.ListFormat` (\"A, B, and C\"). */\n formatList: (\n items: Iterable<string>,\n options?: Intl.ListFormatOptions,\n ) => string;\n}\n\ntype IntlCtor =\n | typeof Intl.DateTimeFormat\n | typeof Intl.NumberFormat\n | typeof Intl.RelativeTimeFormat\n | typeof Intl.ListFormat;\n\n// `Intl.*` constructors are expensive, so instances are memoized by\n// locale + kind + options. Shared by both the hook and the pure helpers.\nconst cache = new Map<string, unknown>();\n\nfunction getIntl<T>(\n kind: string,\n Ctor: IntlCtor,\n locale: string,\n options: object | undefined,\n): T {\n const key = `${locale}|${kind}|${options ? JSON.stringify(options) : ''}`;\n let instance = cache.get(key);\n\n if (!instance) {\n instance = new (Ctor as new (locale: string, options?: object) => unknown)(\n locale,\n options,\n );\n cache.set(key, instance);\n }\n\n return instance as T;\n}\n\nfunction toDate(value: FormatDateInput): Date | null {\n const date =\n value instanceof Date ? value : new Date(value as string | number);\n\n return Number.isNaN(date.getTime()) ? null : date;\n}\n\n// Decimal (1000-based) byte units. `Intl` localizes the unit label itself, so we\n// only pick which one fits the magnitude.\nconst BYTE_UNITS = [\n 'byte',\n 'kilobyte',\n 'megabyte',\n 'gigabyte',\n 'terabyte',\n 'petabyte',\n] as const;\n\n// Largest-fitting-unit thresholds for relative time. Each `amount` is how many\n// of the current unit make up the next one.\nconst RELATIVE_DIVISIONS: {\n amount: number;\n unit: Intl.RelativeTimeFormatUnit;\n}[] = [\n { amount: 60, unit: 'second' },\n { amount: 60, unit: 'minute' },\n { amount: 24, unit: 'hour' },\n { amount: 7, unit: 'day' },\n { amount: 4.34524, unit: 'week' },\n { amount: 12, unit: 'month' },\n { amount: Number.POSITIVE_INFINITY, unit: 'year' },\n];\n\n/**\n * Builds a bundle of formatting helpers bound to `locale`. Used by both\n * `useFormatter()` (locale from React Aria context) and the pure top-level\n * helpers (locale from the module mirror). All `Intl.*` instances are memoized.\n */\nexport function createFormatter(locale: string): Formatter {\n const formatDate: Formatter['formatDate'] = (value, options) => {\n const date = toDate(value);\n if (!date) return '';\n\n return getIntl<Intl.DateTimeFormat>('date', Intl.DateTimeFormat, locale, {\n dateStyle: 'medium',\n ...options,\n }).format(date);\n };\n\n const formatTime: Formatter['formatTime'] = (value, options) => {\n const date = toDate(value);\n if (!date) return '';\n\n return getIntl<Intl.DateTimeFormat>('date', Intl.DateTimeFormat, locale, {\n timeStyle: 'short',\n ...options,\n }).format(date);\n };\n\n const formatDateTime: Formatter['formatDateTime'] = (value, options) => {\n const date = toDate(value);\n if (!date) return '';\n\n return getIntl<Intl.DateTimeFormat>('date', Intl.DateTimeFormat, locale, {\n dateStyle: 'medium',\n timeStyle: 'short',\n ...options,\n }).format(date);\n };\n\n const formatRelativeTime: Formatter['formatRelativeTime'] = (\n value,\n options,\n ) => {\n const date = toDate(value);\n if (!date) return '';\n\n const now = options?.now != null ? toDate(options.now) : new Date();\n if (!now) return '';\n\n const rtf = getIntl<Intl.RelativeTimeFormat>(\n 'relative',\n Intl.RelativeTimeFormat,\n locale,\n {\n numeric: options?.numeric ?? 'auto',\n style: options?.style ?? 'long',\n },\n );\n\n let duration = (date.getTime() - now.getTime()) / 1000;\n\n for (const division of RELATIVE_DIVISIONS) {\n if (Math.abs(duration) < division.amount) {\n return rtf.format(Math.round(duration), division.unit);\n }\n duration /= division.amount;\n }\n\n return rtf.format(Math.round(duration), 'year');\n };\n\n const formatNumber: Formatter['formatNumber'] = (value, options) =>\n getIntl<Intl.NumberFormat>(\n 'number',\n Intl.NumberFormat,\n locale,\n options,\n ).format(value);\n\n const formatCurrency: Formatter['formatCurrency'] = (value, options) => {\n const { currency = 'USD', ...rest } = options ?? {};\n\n return getIntl<Intl.NumberFormat>('number', Intl.NumberFormat, locale, {\n style: 'currency',\n currency,\n ...rest,\n }).format(value);\n };\n\n const formatPercent: Formatter['formatPercent'] = (value, options) =>\n getIntl<Intl.NumberFormat>('number', Intl.NumberFormat, locale, {\n style: 'percent',\n ...options,\n }).format(value);\n\n const formatBytes: Formatter['formatBytes'] = (value, options) => {\n const sign = value < 0 ? -1 : 1;\n let bytes = Math.abs(value);\n let unitIndex = 0;\n\n while (bytes >= 1000 && unitIndex < BYTE_UNITS.length - 1) {\n bytes /= 1000;\n unitIndex++;\n }\n\n return getIntl<Intl.NumberFormat>('number', Intl.NumberFormat, locale, {\n style: 'unit',\n unit: BYTE_UNITS[unitIndex],\n unitDisplay: options?.unitDisplay ?? 'short',\n // Bytes (the base unit) are integers; scaled units get 1 fraction digit.\n minimumFractionDigits: options?.minimumFractionDigits ?? 0,\n maximumFractionDigits:\n options?.maximumFractionDigits ?? (unitIndex === 0 ? 0 : 1),\n }).format(sign * bytes);\n };\n\n const formatList: Formatter['formatList'] = (items, options) =>\n getIntl<Intl.ListFormat>('list', Intl.ListFormat, locale, options).format(\n items,\n );\n\n return {\n locale,\n formatDate,\n formatTime,\n formatDateTime,\n formatRelativeTime,\n formatNumber,\n formatCurrency,\n formatPercent,\n formatBytes,\n formatList,\n };\n}\n"],"mappings":";;AA4EA,MAAM,wBAAQ,IAAI,KAAsB;AAExC,SAAS,QACP,MACA,MACA,QACA,SACG;CACH,MAAM,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,KAAK,UAAU,QAAQ,GAAG;CACrE,IAAI,WAAW,MAAM,IAAI,IAAI;AAE7B,KAAI,CAAC,UAAU;AACb,aAAW,IAAK,KACd,QACA,QACD;AACD,QAAM,IAAI,KAAK,SAAS;;AAG1B,QAAO;;AAGT,SAAS,OAAO,OAAqC;CACnD,MAAM,OACJ,iBAAiB,OAAO,QAAQ,IAAI,KAAK,MAAyB;AAEpE,QAAO,OAAO,MAAM,KAAK,SAAS,CAAC,GAAG,OAAO;;AAK/C,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACD;AAID,MAAM,qBAGA;CACJ;EAAE,QAAQ;EAAI,MAAM;EAAU;CAC9B;EAAE,QAAQ;EAAI,MAAM;EAAU;CAC9B;EAAE,QAAQ;EAAI,MAAM;EAAQ;CAC5B;EAAE,QAAQ;EAAG,MAAM;EAAO;CAC1B;EAAE,QAAQ;EAAS,MAAM;EAAQ;CACjC;EAAE,QAAQ;EAAI,MAAM;EAAS;CAC7B;EAAE,QAAQ,OAAO;EAAmB,MAAM;EAAQ;CACnD;;;;;;AAOD,SAAgB,gBAAgB,QAA2B;CACzD,MAAM,cAAuC,OAAO,YAAY;EAC9D,MAAM,OAAO,OAAO,MAAM;AAC1B,MAAI,CAAC,KAAM,QAAO;AAElB,SAAO,QAA6B,QAAQ,KAAK,gBAAgB,QAAQ;GACvE,WAAW;GACX,GAAG;GACJ,CAAC,CAAC,OAAO,KAAK;;CAGjB,MAAM,cAAuC,OAAO,YAAY;EAC9D,MAAM,OAAO,OAAO,MAAM;AAC1B,MAAI,CAAC,KAAM,QAAO;AAElB,SAAO,QAA6B,QAAQ,KAAK,gBAAgB,QAAQ;GACvE,WAAW;GACX,GAAG;GACJ,CAAC,CAAC,OAAO,KAAK;;CAGjB,MAAM,kBAA+C,OAAO,YAAY;EACtE,MAAM,OAAO,OAAO,MAAM;AAC1B,MAAI,CAAC,KAAM,QAAO;AAElB,SAAO,QAA6B,QAAQ,KAAK,gBAAgB,QAAQ;GACvE,WAAW;GACX,WAAW;GACX,GAAG;GACJ,CAAC,CAAC,OAAO,KAAK;;CAGjB,MAAM,sBACJ,OACA,YACG;EACH,MAAM,OAAO,OAAO,MAAM;AAC1B,MAAI,CAAC,KAAM,QAAO;EAElB,MAAM,MAAM,SAAS,OAAO,OAAO,OAAO,QAAQ,IAAI,mBAAG,IAAI,MAAM;AACnE,MAAI,CAAC,IAAK,QAAO;EAEjB,MAAM,MAAM,QACV,YACA,KAAK,oBACL,QACA;GACE,SAAS,SAAS,WAAW;GAC7B,OAAO,SAAS,SAAS;GAC1B,CACF;EAED,IAAI,YAAY,KAAK,SAAS,GAAG,IAAI,SAAS,IAAI;AAElD,OAAK,MAAM,YAAY,oBAAoB;AACzC,OAAI,KAAK,IAAI,SAAS,GAAG,SAAS,OAChC,QAAO,IAAI,OAAO,KAAK,MAAM,SAAS,EAAE,SAAS,KAAK;AAExD,eAAY,SAAS;;AAGvB,SAAO,IAAI,OAAO,KAAK,MAAM,SAAS,EAAE,OAAO;;CAGjD,MAAM,gBAA2C,OAAO,YACtD,QACE,UACA,KAAK,cACL,QACA,QACD,CAAC,OAAO,MAAM;CAEjB,MAAM,kBAA+C,OAAO,YAAY;EACtE,MAAM,EAAE,WAAW,OAAO,GAAG,SAAS,WAAW,EAAE;AAEnD,SAAO,QAA2B,UAAU,KAAK,cAAc,QAAQ;GACrE,OAAO;GACP;GACA,GAAG;GACJ,CAAC,CAAC,OAAO,MAAM;;CAGlB,MAAM,iBAA6C,OAAO,YACxD,QAA2B,UAAU,KAAK,cAAc,QAAQ;EAC9D,OAAO;EACP,GAAG;EACJ,CAAC,CAAC,OAAO,MAAM;CAElB,MAAM,eAAyC,OAAO,YAAY;EAChE,MAAM,OAAO,QAAQ,IAAI,KAAK;EAC9B,IAAI,QAAQ,KAAK,IAAI,MAAM;EAC3B,IAAI,YAAY;AAEhB,SAAO,SAAS,OAAQ,YAAY,WAAW,SAAS,GAAG;AACzD,YAAS;AACT;;AAGF,SAAO,QAA2B,UAAU,KAAK,cAAc,QAAQ;GACrE,OAAO;GACP,MAAM,WAAW;GACjB,aAAa,SAAS,eAAe;GAErC,uBAAuB,SAAS,yBAAyB;GACzD,uBACE,SAAS,0BAA0B,cAAc,IAAI,IAAI;GAC5D,CAAC,CAAC,OAAO,OAAO,MAAM;;CAGzB,MAAM,cAAuC,OAAO,YAClD,QAAyB,QAAQ,KAAK,YAAY,QAAQ,QAAQ,CAAC,OACjE,MACD;AAEH,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/i18n/formatting-locale.d.ts
|
|
3
|
-
/** Sets the locale the pure (non-hook) formatting helpers read. */
|
|
4
|
-
declare function setActiveFormattingLocale(locale: string): void;
|
|
5
|
-
/** Returns the locale the pure (non-hook) formatting helpers read. */
|
|
6
|
-
declare function getActiveFormattingLocale(): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { getActiveFormattingLocale, setActiveFormattingLocale };
|
|
9
|
-
//# sourceMappingURL=formatting-locale.d.ts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-6be6cbe | Cube Dev Team */
|
|
2
|
-
//#region src/i18n/formatting-locale.ts
|
|
3
|
-
/**
|
|
4
|
-
* Module-level mirror of the active formatting locale.
|
|
5
|
-
*
|
|
6
|
-
* The primary formatting API is the `useFormatter()` hook, which reads the
|
|
7
|
-
* locale from React Aria's context. But a lot of code that needs to format a
|
|
8
|
-
* value isn't in a component render — table column definitions, event handlers,
|
|
9
|
-
* plain utilities — so it can't call a hook. Rather than thread a locale through
|
|
10
|
-
* every such call site, the pure helpers (`formatDate`, `formatNumber`, ...) read
|
|
11
|
-
* the current locale from here, and `I18nProvider` keeps it in sync whenever
|
|
12
|
-
* the UI language changes.
|
|
13
|
-
*
|
|
14
|
-
* Defaults to `en-US` until a provider mounts (Storybook, unit tests, or a host
|
|
15
|
-
* that hasn't wrapped the tree in `<Root>` / `<I18nProvider>`).
|
|
16
|
-
*/
|
|
17
|
-
let activeLocale = "en-US";
|
|
18
|
-
/** Sets the locale the pure (non-hook) formatting helpers read. */
|
|
19
|
-
function setActiveFormattingLocale(locale) {
|
|
20
|
-
activeLocale = locale;
|
|
21
|
-
}
|
|
22
|
-
/** Returns the locale the pure (non-hook) formatting helpers read. */
|
|
23
|
-
function getActiveFormattingLocale() {
|
|
24
|
-
return activeLocale;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { getActiveFormattingLocale, setActiveFormattingLocale };
|
|
29
|
-
//# sourceMappingURL=formatting-locale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatting-locale.js","names":[],"sources":["../../src/i18n/formatting-locale.ts"],"sourcesContent":["/**\n * Module-level mirror of the active formatting locale.\n *\n * The primary formatting API is the `useFormatter()` hook, which reads the\n * locale from React Aria's context. But a lot of code that needs to format a\n * value isn't in a component render — table column definitions, event handlers,\n * plain utilities — so it can't call a hook. Rather than thread a locale through\n * every such call site, the pure helpers (`formatDate`, `formatNumber`, ...) read\n * the current locale from here, and `I18nProvider` keeps it in sync whenever\n * the UI language changes.\n *\n * Defaults to `en-US` until a provider mounts (Storybook, unit tests, or a host\n * that hasn't wrapped the tree in `<Root>` / `<I18nProvider>`).\n */\nlet activeLocale = 'en-US';\n\n/** Sets the locale the pure (non-hook) formatting helpers read. */\nexport function setActiveFormattingLocale(locale: string): void {\n activeLocale = locale;\n}\n\n/** Returns the locale the pure (non-hook) formatting helpers read. */\nexport function getActiveFormattingLocale(): string {\n return activeLocale;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAcA,IAAI,eAAe;;AAGnB,SAAgB,0BAA0B,QAAsB;AAC9D,gBAAe;;;AAIjB,SAAgB,4BAAoC;AAClD,QAAO"}
|
package/dist/i18n/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { UIKIT_I18N_NAMESPACE, UIKitResources, getI18n } from "./instance.js";
|
|
3
|
-
import "./useI18n.js";
|
|
4
|
-
import { I18nProvider, I18nProviderProps } from "./I18nProvider.js";
|
|
5
|
-
import { BytesOptions, CurrencyOptions, FormatDateInput, Formatter, RelativeTimeOptions, createFormatter } from "./createFormatter.js";
|
|
6
|
-
import { getActiveFormattingLocale, setActiveFormattingLocale } from "./formatting-locale.js";
|
|
7
|
-
import { formatBytes, formatCurrency, formatDate, formatDateTime, formatList, formatNumber, formatPercent, formatTime, useFormatter } from "./useFormatter.js";
|
|
8
|
-
import { LOCALE_LABELS, SUPPORTED_LOCALES, SupportedLocale, isSupportedLocale } from "./locales.js";
|
|
9
|
-
|
|
10
|
-
//#region src/i18n/index.d.ts
|
|
11
|
-
/**
|
|
12
|
-
* Register (or override) the UI Kit translation bundle for a locale. Use this
|
|
13
|
-
* to add languages beyond the ones the UI Kit ships, or to override individual
|
|
14
|
-
* strings. Applied to the shared instance so it takes effect immediately.
|
|
15
|
-
*/
|
|
16
|
-
declare function addUIKitLocale(locale: string, resources: Partial<UIKitResources>): void;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { addUIKitLocale };
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/i18n/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-6be6cbe | Cube Dev Team */
|
|
2
|
-
import { LOCALE_LABELS, SUPPORTED_LOCALES, isSupportedLocale } from "./locales.js";
|
|
3
|
-
import { UIKIT_I18N_NAMESPACE, getI18n } from "./instance.js";
|
|
4
|
-
import { useI18n } from "./useI18n.js";
|
|
5
|
-
import { getActiveFormattingLocale, setActiveFormattingLocale } from "./formatting-locale.js";
|
|
6
|
-
import { I18nProvider } from "./I18nProvider.js";
|
|
7
|
-
import { createFormatter } from "./createFormatter.js";
|
|
8
|
-
import { formatBytes, formatCurrency, formatDate, formatDateTime, formatList, formatNumber, formatPercent, formatTime, useFormatter } from "./useFormatter.js";
|
|
9
|
-
|
|
10
|
-
//#region src/i18n/index.ts
|
|
11
|
-
/**
|
|
12
|
-
* Register (or override) the UI Kit translation bundle for a locale. Use this
|
|
13
|
-
* to add languages beyond the ones the UI Kit ships, or to override individual
|
|
14
|
-
* strings. Applied to the shared instance so it takes effect immediately.
|
|
15
|
-
*/
|
|
16
|
-
function addUIKitLocale(locale, resources) {
|
|
17
|
-
getI18n().addResourceBundle(locale, UIKIT_I18N_NAMESPACE, resources, true, true);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { addUIKitLocale };
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
package/dist/i18n/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/i18n/index.ts"],"sourcesContent":["import { getI18n, UIKIT_I18N_NAMESPACE } from './instance';\n\nimport type { UIKitResources } from './instance';\n\nexport { getI18n, UIKIT_I18N_NAMESPACE } from './instance';\nexport type { UIKitResources } from './instance';\n// Internal hook — used by UI Kit components to read their own strings. Not part\n// of the public barrel (`src/index.ts`); hosts use the re-exported\n// `useTranslation` for their own strings.\nexport { useI18n } from './useI18n';\nexport { I18nProvider } from './I18nProvider';\nexport type { I18nProviderProps } from './I18nProvider';\nexport { createFormatter } from './createFormatter';\nexport type {\n Formatter,\n FormatDateInput,\n RelativeTimeOptions,\n CurrencyOptions,\n BytesOptions,\n} from './createFormatter';\nexport {\n getActiveFormattingLocale,\n setActiveFormattingLocale,\n} from './formatting-locale';\nexport {\n useFormatter,\n formatDate,\n formatTime,\n formatDateTime,\n formatNumber,\n formatCurrency,\n formatPercent,\n formatBytes,\n formatList,\n} from './useFormatter';\nexport { SUPPORTED_LOCALES, LOCALE_LABELS, isSupportedLocale } from './locales';\nexport type { SupportedLocale } from './locales';\n\n/**\n * Register (or override) the UI Kit translation bundle for a locale. Use this\n * to add languages beyond the ones the UI Kit ships, or to override individual\n * strings. Applied to the shared instance so it takes effect immediately.\n */\nexport function addUIKitLocale(\n locale: string,\n resources: Partial<UIKitResources>,\n): void {\n getI18n().addResourceBundle(\n locale,\n UIKIT_I18N_NAMESPACE,\n resources,\n true,\n true,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2CA,SAAgB,eACd,QACA,WACM;AACN,UAAS,CAAC,kBACR,QACA,sBACA,WACA,MACA,KACD"}
|
package/dist/i18n/instance.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __json_default_export } from "./locales/en-US/uikit.json.js";
|
|
3
|
-
import { i18n } from "i18next";
|
|
4
|
-
|
|
5
|
-
//#region src/i18n/instance.d.ts
|
|
6
|
-
/** The dedicated namespace all UI Kit strings live under. */
|
|
7
|
-
declare const UIKIT_I18N_NAMESPACE = "uikit";
|
|
8
|
-
/** Shape of the UI Kit translation bundle (the `en-US` source of truth). */
|
|
9
|
-
type UIKitResources = typeof __json_default_export;
|
|
10
|
-
/** Returns the shared UI Kit i18next instance. */
|
|
11
|
-
declare function getI18n(): i18n;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { UIKIT_I18N_NAMESPACE, UIKitResources, getI18n };
|
|
14
|
-
//# sourceMappingURL=instance.d.ts.map
|
package/dist/i18n/instance.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-6be6cbe | Cube Dev Team */
|
|
2
|
-
import { SUPPORTED_LOCALES } from "./locales.js";
|
|
3
|
-
import uikit_default from "./locales/de-DE/uikit.js";
|
|
4
|
-
import uikit_default$1 from "./locales/en-US/uikit.js";
|
|
5
|
-
import uikit_default$2 from "./locales/es-ES/uikit.js";
|
|
6
|
-
import uikit_default$3 from "./locales/es-MX/uikit.js";
|
|
7
|
-
import uikit_default$4 from "./locales/fr-FR/uikit.js";
|
|
8
|
-
import uikit_default$5 from "./locales/it-IT/uikit.js";
|
|
9
|
-
import uikit_default$6 from "./locales/ja-JP/uikit.js";
|
|
10
|
-
import uikit_default$7 from "./locales/nb-NO/uikit.js";
|
|
11
|
-
import uikit_default$8 from "./locales/pt-BR/uikit.js";
|
|
12
|
-
import uikit_default$9 from "./locales/pt-PT/uikit.js";
|
|
13
|
-
import uikit_default$10 from "./locales/sv-SE/uikit.js";
|
|
14
|
-
import uikit_default$11 from "./locales/vi-VN/uikit.js";
|
|
15
|
-
import i18next from "i18next";
|
|
16
|
-
import { initReactI18next } from "react-i18next";
|
|
17
|
-
|
|
18
|
-
//#region src/i18n/instance.ts
|
|
19
|
-
/** The dedicated namespace all UI Kit strings live under. */
|
|
20
|
-
const UIKIT_I18N_NAMESPACE = "uikit";
|
|
21
|
-
const BUNDLES = {
|
|
22
|
-
"en-US": uikit_default$1,
|
|
23
|
-
"de-DE": uikit_default,
|
|
24
|
-
"es-ES": uikit_default$2,
|
|
25
|
-
"es-MX": uikit_default$3,
|
|
26
|
-
"fr-FR": uikit_default$4,
|
|
27
|
-
"it-IT": uikit_default$5,
|
|
28
|
-
"ja-JP": uikit_default$6,
|
|
29
|
-
"nb-NO": uikit_default$7,
|
|
30
|
-
"pt-BR": uikit_default$8,
|
|
31
|
-
"pt-PT": uikit_default$9,
|
|
32
|
-
"sv-SE": uikit_default$10,
|
|
33
|
-
"vi-VN": uikit_default$11
|
|
34
|
-
};
|
|
35
|
-
const resources = Object.fromEntries(SUPPORTED_LOCALES.map((locale) => [locale, { [UIKIT_I18N_NAMESPACE]: BUNDLES[locale] }]));
|
|
36
|
-
/**
|
|
37
|
-
* The single i18next instance the UI Kit owns. `useTranslation` (re-exported
|
|
38
|
-
* from the UI Kit) and `<I18nextProvider>` both reference this object, so a host
|
|
39
|
-
* app that drives it (e.g. Cube Cloud registering its own namespaces onto it and
|
|
40
|
-
* calling `changeLanguage`) shares one instance — switching language in the host
|
|
41
|
-
* switches UI Kit strings for free. Read it via `getI18n()`.
|
|
42
|
-
*/
|
|
43
|
-
const instance = i18next.createInstance();
|
|
44
|
-
instance.use(initReactI18next).init({
|
|
45
|
-
resources,
|
|
46
|
-
lng: "en-US",
|
|
47
|
-
fallbackLng: "en-US",
|
|
48
|
-
load: "currentOnly",
|
|
49
|
-
defaultNS: UIKIT_I18N_NAMESPACE,
|
|
50
|
-
ns: [UIKIT_I18N_NAMESPACE],
|
|
51
|
-
interpolation: { escapeValue: false },
|
|
52
|
-
returnNull: false,
|
|
53
|
-
returnEmptyString: true,
|
|
54
|
-
react: { useSuspense: false },
|
|
55
|
-
enableSelector: true
|
|
56
|
-
});
|
|
57
|
-
/** Returns the shared UI Kit i18next instance. */
|
|
58
|
-
function getI18n() {
|
|
59
|
-
return instance;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
export { UIKIT_I18N_NAMESPACE, getI18n };
|
|
64
|
-
//# sourceMappingURL=instance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","names":["enUS","deDE","esES","esMX","frFR","itIT","jaJP","nbNO","ptBR","ptPT","svSE","viVN"],"sources":["../../src/i18n/instance.ts"],"sourcesContent":["import i18next from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport { SUPPORTED_LOCALES } from './locales';\nimport deDE from './locales/de-DE/uikit.json';\nimport enUS from './locales/en-US/uikit.json';\nimport esES from './locales/es-ES/uikit.json';\nimport esMX from './locales/es-MX/uikit.json';\nimport frFR from './locales/fr-FR/uikit.json';\nimport itIT from './locales/it-IT/uikit.json';\nimport jaJP from './locales/ja-JP/uikit.json';\nimport nbNO from './locales/nb-NO/uikit.json';\nimport ptBR from './locales/pt-BR/uikit.json';\nimport ptPT from './locales/pt-PT/uikit.json';\nimport svSE from './locales/sv-SE/uikit.json';\nimport viVN from './locales/vi-VN/uikit.json';\n\nimport type { i18n as I18nInstance } from 'i18next';\n\n/** The dedicated namespace all UI Kit strings live under. */\nexport const UIKIT_I18N_NAMESPACE = 'uikit';\n\n/** Shape of the UI Kit translation bundle (the `en-US` source of truth). */\nexport type UIKitResources = typeof enUS;\n\nconst BUNDLES: Record<(typeof SUPPORTED_LOCALES)[number], UIKitResources> = {\n 'en-US': enUS,\n 'de-DE': deDE,\n 'es-ES': esES,\n 'es-MX': esMX,\n 'fr-FR': frFR,\n 'it-IT': itIT,\n 'ja-JP': jaJP,\n 'nb-NO': nbNO,\n 'pt-BR': ptBR,\n 'pt-PT': ptPT,\n 'sv-SE': svSE,\n 'vi-VN': viVN,\n};\n\n// Every locale is tiny (~40 keys), so all are registered eagerly at init —\n// no code-splitting/loader machinery is needed.\nconst resources = Object.fromEntries(\n SUPPORTED_LOCALES.map((locale) => [\n locale,\n { [UIKIT_I18N_NAMESPACE]: BUNDLES[locale] },\n ]),\n);\n\n/**\n * The single i18next instance the UI Kit owns. `useTranslation` (re-exported\n * from the UI Kit) and `<I18nextProvider>` both reference this object, so a host\n * app that drives it (e.g. Cube Cloud registering its own namespaces onto it and\n * calling `changeLanguage`) shares one instance — switching language in the host\n * switches UI Kit strings for free. Read it via `getI18n()`.\n */\nconst instance: I18nInstance = i18next.createInstance();\n\nvoid instance.use(initReactI18next).init({\n resources,\n lng: 'en-US',\n fallbackLng: 'en-US',\n // Full BCP-47 codes only — don't let i18next strip `es-ES` to a bare `es`\n // bundle (which we don't ship); an unmatched code falls back to `en-US`.\n load: 'currentOnly',\n defaultNS: UIKIT_I18N_NAMESPACE,\n ns: [UIKIT_I18N_NAMESPACE],\n interpolation: { escapeValue: false },\n returnNull: false,\n returnEmptyString: true,\n // All resources are bundled synchronously at init, so the instance is ready\n // immediately — disable Suspense so components (and unit tests / SSR) render\n // translated text on the first pass without a Suspense boundary.\n react: { useSuspense: false },\n // Proxy-based selector API (`t($ => $.a.b)`). UI Kit components use plain\n // string keys, but Cube Cloud drives this same instance with the selector\n // form, so enabling it here preserves that contract once Cloud consumes the\n // exported instance.\n enableSelector: true,\n});\n\n/** Returns the shared UI Kit i18next instance. */\nexport function getI18n(): I18nInstance {\n return instance;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,MAAa,uBAAuB;AAKpC,MAAM,UAAsE;CAC1E,SAASA;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACT,SAASC;CACV;AAID,MAAM,YAAY,OAAO,YACvB,kBAAkB,KAAK,WAAW,CAChC,QACA,GAAG,uBAAuB,QAAQ,SAAS,CAC5C,CAAC,CACH;;;;;;;;AASD,MAAM,WAAyB,QAAQ,gBAAgB;AAElD,SAAS,IAAI,iBAAiB,CAAC,KAAK;CACvC;CACA,KAAK;CACL,aAAa;CAGb,MAAM;CACN,WAAW;CACX,IAAI,CAAC,qBAAqB;CAC1B,eAAe,EAAE,aAAa,OAAO;CACrC,YAAY;CACZ,mBAAmB;CAInB,OAAO,EAAE,aAAa,OAAO;CAK7B,gBAAgB;CACjB,CAAC;;AAGF,SAAgB,UAAwB;AACtC,QAAO"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-6be6cbe | Cube Dev Team */
|
|
2
|
-
//#region src/i18n/locales/de-DE/uikit.json
|
|
3
|
-
var uikit_default = {
|
|
4
|
-
alertDialog: {
|
|
5
|
-
"confirm": "OK",
|
|
6
|
-
"cancel": "Abbrechen"
|
|
7
|
-
},
|
|
8
|
-
dialog: { "dismiss": "Schließen" },
|
|
9
|
-
dialogForm: {
|
|
10
|
-
"submit": "Absenden",
|
|
11
|
-
"cancel": "Abbrechen"
|
|
12
|
-
},
|
|
13
|
-
form: {
|
|
14
|
-
"required": "(erforderlich)",
|
|
15
|
-
"optional": "(optional)",
|
|
16
|
-
"internalError": "Interner Fehler"
|
|
17
|
-
},
|
|
18
|
-
notifications: {
|
|
19
|
-
"dismiss": "Schließen",
|
|
20
|
-
"ariaLabel": "Benachrichtigungen",
|
|
21
|
-
"empty": "Keine Benachrichtigungen"
|
|
22
|
-
},
|
|
23
|
-
relativeTime: {
|
|
24
|
-
"justNow": "gerade eben",
|
|
25
|
-
"minAgo": "vor {{count}} Min.",
|
|
26
|
-
"hoursAgo": "vor {{count}} Std.",
|
|
27
|
-
"daysAgo": "vor {{count}} T.",
|
|
28
|
-
"weeksAgo": "vor {{count}} Wo.",
|
|
29
|
-
"monthsAgo": "vor {{count}} Mon.",
|
|
30
|
-
"yearsAgo": "vor {{count}} J."
|
|
31
|
-
},
|
|
32
|
-
toast: { "hide": "Ausblenden" },
|
|
33
|
-
listBox: {
|
|
34
|
-
"selectAll": "Alle auswählen",
|
|
35
|
-
"noItems": "Keine Einträge"
|
|
36
|
-
},
|
|
37
|
-
filterListBox: {
|
|
38
|
-
"searchPlaceholder": "Suchen...",
|
|
39
|
-
"noResults": "Keine Ergebnisse gefunden",
|
|
40
|
-
"noItems": "Keine Einträge",
|
|
41
|
-
"customValue": "Benutzerdefinierter Wert",
|
|
42
|
-
"filteredItems": "Gefilterte Einträge"
|
|
43
|
-
},
|
|
44
|
-
picker: {
|
|
45
|
-
"all": "Alle",
|
|
46
|
-
"pickerAriaLabel": "Auswahl"
|
|
47
|
-
},
|
|
48
|
-
comboBox: {
|
|
49
|
-
"clearValue": "Wert löschen",
|
|
50
|
-
"showOptions": "Optionen anzeigen"
|
|
51
|
-
},
|
|
52
|
-
commandMenu: {
|
|
53
|
-
"searchPlaceholder": "Befehle suchen...",
|
|
54
|
-
"empty": "Keine Befehle gefunden"
|
|
55
|
-
},
|
|
56
|
-
listBoxPopover: { "options": "Optionen" },
|
|
57
|
-
datePicker: {
|
|
58
|
-
"time": "Uhrzeit",
|
|
59
|
-
"startTime": "Startzeit",
|
|
60
|
-
"endTime": "Endzeit",
|
|
61
|
-
"showEndCalendar": "Kalender für das Enddatum anzeigen"
|
|
62
|
-
},
|
|
63
|
-
fileInput: {
|
|
64
|
-
"chooseFile": "Datei auswählen",
|
|
65
|
-
"noFileSelected": "Keine Datei ausgewählt"
|
|
66
|
-
},
|
|
67
|
-
passwordInput: { "toggleMasking": "Maskierung umschalten" },
|
|
68
|
-
numberInput: {
|
|
69
|
-
"stepUp": "Erhöhen",
|
|
70
|
-
"stepDown": "Verringern"
|
|
71
|
-
},
|
|
72
|
-
textInputMapper: {
|
|
73
|
-
"key": "Schlüssel",
|
|
74
|
-
"value": "Wert",
|
|
75
|
-
"removeMapping": "Zuordnung entfernen"
|
|
76
|
-
},
|
|
77
|
-
copySnippet: {
|
|
78
|
-
"title": "Codebeispiel",
|
|
79
|
-
"copyToClipboard": "In die Zwischenablage kopieren",
|
|
80
|
-
"showHiddenParts": "Ausgeblendete Teile anzeigen",
|
|
81
|
-
"copied": "{{title}} kopiert"
|
|
82
|
-
},
|
|
83
|
-
copyPasteBlock: {
|
|
84
|
-
"copyToClipboard": "In die Zwischenablage kopieren",
|
|
85
|
-
"selectAndPaste": "Auswählen und einfügen",
|
|
86
|
-
"invalidData": "Ungültige Daten",
|
|
87
|
-
"copied": "{{title}} kopiert",
|
|
88
|
-
"defaultTitle": "Text"
|
|
89
|
-
},
|
|
90
|
-
tag: { "close": "Schließen" },
|
|
91
|
-
placeholder: { "contentIsLoading": "Inhalt wird geladen" },
|
|
92
|
-
loadingAnimation: { "ariaLabel": "Ladeanimation" },
|
|
93
|
-
layout: {
|
|
94
|
-
"closePanel": "Panel schließen",
|
|
95
|
-
"goBack": "Zurück"
|
|
96
|
-
},
|
|
97
|
-
tree: { "actions": "Aktionen" },
|
|
98
|
-
banner: { "hideBanner": "Banner ausblenden" },
|
|
99
|
-
tabs: {
|
|
100
|
-
"close": "Schließen",
|
|
101
|
-
"editTabTitle": "Tab-Titel bearbeiten",
|
|
102
|
-
"selectTab": "Tab auswählen"
|
|
103
|
-
},
|
|
104
|
-
contextMenu: {
|
|
105
|
-
"openContextMenu": "Kontextmenü öffnen",
|
|
106
|
-
"contextMenu": "context-menu"
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
//#endregion
|
|
111
|
-
export { uikit_default as default };
|
|
112
|
-
//# sourceMappingURL=uikit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uikit.js","names":[],"sources":["../../../../src/i18n/locales/de-DE/uikit.json"],"sourcesContent":[""],"mappings":""}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-6be6cbe | Cube Dev Team */
|
|
2
|
-
//#region src/i18n/locales/en-US/uikit.json
|
|
3
|
-
var uikit_default = {
|
|
4
|
-
alertDialog: {
|
|
5
|
-
"confirm": "Ok",
|
|
6
|
-
"cancel": "Cancel"
|
|
7
|
-
},
|
|
8
|
-
dialog: { "dismiss": "Dismiss" },
|
|
9
|
-
dialogForm: {
|
|
10
|
-
"submit": "Submit",
|
|
11
|
-
"cancel": "Cancel"
|
|
12
|
-
},
|
|
13
|
-
form: {
|
|
14
|
-
"required": "(required)",
|
|
15
|
-
"optional": "(optional)",
|
|
16
|
-
"internalError": "Internal error"
|
|
17
|
-
},
|
|
18
|
-
notifications: {
|
|
19
|
-
"dismiss": "Dismiss",
|
|
20
|
-
"ariaLabel": "Notifications",
|
|
21
|
-
"empty": "No notifications"
|
|
22
|
-
},
|
|
23
|
-
relativeTime: {
|
|
24
|
-
"justNow": "just now",
|
|
25
|
-
"minAgo": "{{count}} min ago",
|
|
26
|
-
"hoursAgo": "{{count}} h ago",
|
|
27
|
-
"daysAgo": "{{count}} d ago",
|
|
28
|
-
"weeksAgo": "{{count}} w ago",
|
|
29
|
-
"monthsAgo": "{{count}} mo ago",
|
|
30
|
-
"yearsAgo": "{{count}} y ago"
|
|
31
|
-
},
|
|
32
|
-
toast: { "hide": "Hide" },
|
|
33
|
-
listBox: {
|
|
34
|
-
"selectAll": "Select All",
|
|
35
|
-
"noItems": "No items"
|
|
36
|
-
},
|
|
37
|
-
filterListBox: {
|
|
38
|
-
"searchPlaceholder": "Search...",
|
|
39
|
-
"noResults": "No results found",
|
|
40
|
-
"noItems": "No items",
|
|
41
|
-
"customValue": "Custom value",
|
|
42
|
-
"filteredItems": "Filtered items"
|
|
43
|
-
},
|
|
44
|
-
picker: {
|
|
45
|
-
"all": "All",
|
|
46
|
-
"pickerAriaLabel": "Picker"
|
|
47
|
-
},
|
|
48
|
-
comboBox: {
|
|
49
|
-
"clearValue": "Clear value",
|
|
50
|
-
"showOptions": "Show options"
|
|
51
|
-
},
|
|
52
|
-
commandMenu: {
|
|
53
|
-
"searchPlaceholder": "Search commands...",
|
|
54
|
-
"empty": "No commands found"
|
|
55
|
-
},
|
|
56
|
-
listBoxPopover: { "options": "Options" },
|
|
57
|
-
datePicker: {
|
|
58
|
-
"time": "Time",
|
|
59
|
-
"startTime": "Start time",
|
|
60
|
-
"endTime": "End time",
|
|
61
|
-
"showEndCalendar": "Show calendar for the end date"
|
|
62
|
-
},
|
|
63
|
-
fileInput: {
|
|
64
|
-
"chooseFile": "Choose file",
|
|
65
|
-
"noFileSelected": "No file selected"
|
|
66
|
-
},
|
|
67
|
-
passwordInput: { "toggleMasking": "Toggle masking" },
|
|
68
|
-
numberInput: {
|
|
69
|
-
"stepUp": "Step up",
|
|
70
|
-
"stepDown": "Step down"
|
|
71
|
-
},
|
|
72
|
-
textInputMapper: {
|
|
73
|
-
"key": "Key",
|
|
74
|
-
"value": "Value",
|
|
75
|
-
"removeMapping": "Remove mapping"
|
|
76
|
-
},
|
|
77
|
-
copySnippet: {
|
|
78
|
-
"title": "Code example",
|
|
79
|
-
"copyToClipboard": "Copy to clipboard",
|
|
80
|
-
"showHiddenParts": "Show hidden parts",
|
|
81
|
-
"copied": "{{title}} copied"
|
|
82
|
-
},
|
|
83
|
-
copyPasteBlock: {
|
|
84
|
-
"copyToClipboard": "Copy to clipboard",
|
|
85
|
-
"selectAndPaste": "Select and paste",
|
|
86
|
-
"invalidData": "Invalid data",
|
|
87
|
-
"copied": "{{title}} copied",
|
|
88
|
-
"defaultTitle": "Text"
|
|
89
|
-
},
|
|
90
|
-
tag: { "close": "Close" },
|
|
91
|
-
placeholder: { "contentIsLoading": "Content is loading" },
|
|
92
|
-
loadingAnimation: { "ariaLabel": "Loading animation" },
|
|
93
|
-
layout: {
|
|
94
|
-
"closePanel": "Close panel",
|
|
95
|
-
"goBack": "Go back"
|
|
96
|
-
},
|
|
97
|
-
tree: { "actions": "Actions" },
|
|
98
|
-
banner: { "hideBanner": "Hide banner" },
|
|
99
|
-
tabs: {
|
|
100
|
-
"close": "Close",
|
|
101
|
-
"editTabTitle": "Edit tab title",
|
|
102
|
-
"selectTab": "Select tab"
|
|
103
|
-
},
|
|
104
|
-
contextMenu: {
|
|
105
|
-
"openContextMenu": "Open context menu",
|
|
106
|
-
"contextMenu": "context-menu"
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
//#endregion
|
|
111
|
-
export { uikit_default as default };
|
|
112
|
-
//# sourceMappingURL=uikit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uikit.js","names":[],"sources":["../../../../src/i18n/locales/en-US/uikit.json"],"sourcesContent":[""],"mappings":""}
|