@cube-dev/ui-kit 0.0.0-canary-3d936da → 0.0.0-canary-88ada42
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/CHANGELOG.md +9 -0
- 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 +53 -42
- package/dist/components/GlobalStyles.js.map +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +9 -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 +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 +1 -1
- package/dist/components/actions/CommandMenu/styled.js +2 -2
- package/dist/components/actions/CommandMenu/styled.js.map +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 +3 -3
- package/dist/components/actions/Menu/styled.js.map +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 +1 -1
- package/dist/components/actions/use-context-menu.js +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 +2 -2
- package/dist/components/content/Card/Card.js.map +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +2 -2
- package/dist/components/content/Disclosure/Disclosure.js.map +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/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 +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +2 -2
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +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 +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 +1 -1
- package/dist/components/content/Text.d.ts +28 -28
- 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 +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 +3 -3
- package/dist/components/fields/Checkbox/Checkbox.js.map +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 +2 -2
- package/dist/components/fields/ComboBox/ComboBox.js.map +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 +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 +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/intl.js +1 -1
- 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 +2 -2
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +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 +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +3 -3
- package/dist/components/fields/RadioGroup/Radio.js.map +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 +3 -3
- package/dist/components/fields/Select/Select.js.map +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 +2 -2
- package/dist/components/fields/Switch/Switch.js.map +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 +2 -2
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +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 +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 +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/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/EditableTitle.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +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 +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/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 +2 -2
- package/dist/components/organisms/FileTabs/FileTabs.js.map +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 +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 +2 -2
- 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 +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 +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 +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +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 +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +5 -5
- package/dist/components/overlays/Tooltip/Tooltip.js.map +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 +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 +64 -64
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.d.ts +17 -17
- package/dist/data/themes.js +18 -18
- package/dist/data/themes.js.map +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.js +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.d.ts +4 -3
- package/dist/tokens/colors.js +87 -83
- package/dist/tokens/colors.js.map +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/palette.js +313 -0
- package/dist/tokens/palette.js.map +1 -0
- package/dist/tokens/shadows.d.ts +4 -1
- package/dist/tokens/shadows.js +9 -6
- package/dist/tokens/shadows.js.map +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/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.d.ts +3 -0
- package/dist/version.js +13 -5
- package/dist/version.js.map +1 -1
- package/docs/Usage.md +97 -29
- package/docs/components/content/Card.md +1 -1
- package/docs/components/content/PrismCode.md +21 -0
- package/docs/components/form/Field.md +1 -1
- package/docs/components/layout/ResizablePanel.md +1 -1
- package/docs/components/organisms/FileTabs.md +1 -1
- package/docs/tasty/configuration.md +44 -0
- package/docs/tasty/dsl.md +14 -13
- package/docs/tasty/ssr.md +5 -3
- package/docs/tasty/tasty-static.md +15 -0
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputBase.js","names":["useFocus","mergeProps"],"sources":["../../../../src/components/fields/TextInput/TextInputBase.tsx"],"sourcesContent":["import { createFocusableRef } from '@react-spectrum/utils';\nimport {\n BASE_STYLES,\n BaseProps,\n BaseStyleProps,\n BLOCK_STYLES,\n BlockStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n OUTER_STYLES,\n OuterStyleProps,\n Props,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n cloneElement,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\nimport { AriaNumberFieldProps, AriaTextFieldProps, useHover } from 'react-aria';\n\nimport { LoadingIcon } from '../../../icons';\nimport { useProviderProps } from '../../../provider';\nimport { FieldBaseProps } from '../../../shared';\nimport { mergeProps, useCombinedRefs } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { extractStyles } from '../../../utils/styles';\nimport { useFieldProps, useFormProps, wrapWithField } from '../../form';\nimport { InvalidIcon } from '../../shared/InvalidIcon';\nimport { ValidIcon } from '../../shared/ValidIcon';\n\nconst ADD_STYLES = {\n $: '>',\n display: 'grid',\n placeContent: 'stretch',\n placeItems: 'center',\n gridRows: '1sf',\n flow: 'column',\n gap: 0,\n cursor: 'inherit',\n opacity: {\n '': 1,\n disabled: '$disabled-opacity',\n },\n};\n\nexport const INPUT_WRAPPER_STYLES: Styles = {\n display: 'grid',\n flow: 'row',\n position: 'relative',\n gridColumns: {\n '': '1sf',\n prefix: 'max-content 1sf',\n suffix: '1sf max-content',\n 'prefix & suffix': 'max-content 1sf max-content',\n },\n gridRows: '1sf',\n placeItems: 'stretch',\n fill: {\n '': '#white',\n disabled: '#dark.04',\n },\n border: {\n '': true,\n valid: '#success-text.50',\n invalid: '#danger-text.50',\n focused: '#primary-text',\n 'valid & focused': '#success-text',\n 'invalid & focused': '#danger-text',\n disabled: true,\n },\n preset: 't3',\n radius: true,\n cursor: 'text',\n color: {\n '': '#dark-02',\n focused: '#dark-02',\n invalid: '#danger-text',\n disabled: '#dark.30',\n },\n zIndex: {\n '': 'initial',\n focused: 1,\n },\n boxSizing: 'border-box',\n transition: 'theme',\n backgroundClip: 'content-box',\n height: {\n '': '$size $size',\n multiline: 'min $size',\n },\n\n $size: {\n '': '$size-md',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n },\n\n Prefix: ADD_STYLES,\n\n Suffix: ADD_STYLES,\n\n State: {\n $: '> Suffix >',\n display: 'flex',\n },\n\n InputIcon: {\n display: 'grid',\n placeItems: 'center',\n width: 'min $size-sm',\n color: 'inherit',\n fontSize: '$icon-size',\n },\n\n ValidationIcon: {\n $: '> Suffix > State >',\n display: 'grid',\n placeItems: 'center',\n width: {\n '': 'min $size-sm',\n suffix: 'min $size-xs',\n },\n fontSize: '$icon-size',\n },\n};\n\nconst InputWrapperElement = tasty({\n qa: 'InputWrapper',\n styles: INPUT_WRAPPER_STYLES,\n});\n\nconst PROP_STYLES = [\n ...BASE_STYLES,\n ...OUTER_STYLES,\n ...BLOCK_STYLES,\n ...COLOR_STYLES,\n];\n\nexport const DEFAULT_INPUT_STYLES: Styles = {\n recipe: 'reset input / input-autofill',\n placeSelf: 'stretch',\n width: 'initial 100% 100%',\n transition: 'theme',\n radius: true,\n padding: '$vertical-padding $right-padding $vertical-padding $left-padding',\n textAlign: 'left',\n preset: 't3',\n flexGrow: 1,\n margin: {\n '': 0,\n multiline: '((($size-md - 1lh) / 2) - 1bw) 0',\n 'multiline & size=small': '((($size-sm - 1lh) / 2) - 1bw) 0',\n 'multiline & size=large': '((($size-lg - 1lh) / 2) - 1bw) 0',\n },\n resize: 'none',\n userSelect: 'auto',\n\n Placeholder: {\n $: '::placeholder',\n recipe: 'input-placeholder',\n },\n '&::-webkit-search-cancel-button': {\n recipe: 'input-search-cancel-button',\n },\n\n '$vertical-padding': 0,\n '$left-padding': {\n '': '(1x - 1bw)',\n 'size=small': '(1x - 1bw)',\n 'size=large': '(1.25x - 1bw)',\n 'size=xlarge': '(1.5x - 1bw)',\n prefix: '0',\n },\n '$right-padding': {\n '': '(1x - 1bw)',\n 'size=small': '(1x - 1bw)',\n 'size=large': '(1.25x - 1bw)',\n 'size=xlarge': '(1.5x - 1bw)',\n suffix: '0',\n },\n};\n\nconst InputElement = tasty({ qa: 'Input', styles: DEFAULT_INPUT_STYLES });\n\nexport interface CubeTextInputBaseProps\n extends BaseProps,\n OuterStyleProps,\n BlockStyleProps,\n BaseStyleProps,\n ColorStyleProps,\n Omit<AriaTextFieldProps, 'validate'>,\n FieldBaseProps {\n validate?: AriaTextFieldProps['validate'] | AriaNumberFieldProps['validate'];\n /** Left input icon */\n icon?: ReactElement | null;\n /** Input decoration before the main input */\n prefix?: ReactNode;\n /** Input decoration after the main input */\n suffix?: ReactNode;\n /** Suffix position goes before or after the validation and loading statuses */\n suffixPosition?: 'before' | 'after';\n /** Whether the input is multiline */\n multiLine?: boolean;\n /** Whether the input should have autofocus */\n autoFocus?: boolean;\n /** Direct input props */\n inputProps?: Props;\n /** Direct input wrapper props */\n wrapperProps?: Props;\n /** The input ref */\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>;\n /** The wrapper ref */\n wrapperRef?: RefObject<HTMLDivElement>;\n /** Whether the input has the loading status */\n isLoading?: boolean;\n /** The loading status indicator */\n loadingIndicator?: ReactNode;\n /** Style map for the input */\n inputStyles?: Styles;\n /** The number of rows for the input. Only applies to textarea. */\n rows?: number;\n /** The resize CSS property sets whether an element is resizable, and if so, in which directions. */\n resize?: Styles['resize'];\n /** The size of the input */\n size?: 'small' | 'medium' | 'large' | (string & {});\n autocomplete?: string;\n}\n\nfunction _TextInputBase(props: CubeTextInputBaseProps, ref) {\n props = useProviderProps(props);\n props = useFormProps(props);\n props = useFieldProps(props, {\n defaultValidationTrigger: 'onBlur',\n valuePropsMapper: ({ value, onChange }) => ({\n value:\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '',\n onChange,\n }),\n });\n\n let {\n qa,\n mods,\n validationState,\n prefix,\n isDisabled,\n multiLine,\n autoFocus,\n inputProps,\n wrapperProps,\n inputRef,\n isLoading,\n loadingIndicator,\n value,\n inputStyles = {},\n suffix,\n suffixPosition = 'before',\n wrapperRef,\n tooltip,\n rows = 1,\n size = 'medium',\n autocomplete,\n icon,\n maxLength,\n minLength,\n form,\n resize,\n ...otherProps\n } = props;\n\n let styles = extractStyles(otherProps, PROP_STYLES);\n let type = otherProps.type;\n\n if (resize) {\n inputStyles = { ...inputStyles, resize };\n }\n\n let ElementType: 'textarea' | 'input' = multiLine ? 'textarea' : 'input';\n let { isFocused, focusProps } = useFocus({ isDisabled });\n let { hoverProps, isHovered } = useHover({ isDisabled });\n let domRef = useRef(null);\n\n inputRef = useCombinedRefs(inputRef);\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef?.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef?.current;\n },\n }));\n\n let isInvalid = validationState === 'invalid';\n let validationIcon = isInvalid ? InvalidIcon : ValidIcon;\n let validation = cloneElement(validationIcon);\n\n // Fix safari bug: https://github.com/philipwalton/flexbugs/issues/270\n if (!inputProps?.placeholder) {\n if (!inputProps) {\n inputProps = {};\n }\n\n inputProps.placeholder = ' ';\n }\n\n if (icon) {\n icon = <div data-element=\"InputIcon\">{icon}</div>;\n\n if (prefix) {\n prefix = (\n <>\n {icon}\n {prefix}\n </>\n );\n } else {\n prefix = icon;\n }\n }\n\n const modifiers = useMemo(\n () => ({\n invalid: isInvalid,\n valid: validationState === 'valid',\n loadable: !!loadingIndicator,\n focused: isFocused,\n hovered: isHovered,\n disabled: isDisabled,\n multiline: multiLine,\n prefix: !!prefix,\n suffix: (validationState && !isLoading) || isLoading || !!suffix,\n ...mods,\n }),\n [\n mods,\n isInvalid,\n validationState,\n loadingIndicator,\n isFocused,\n isDisabled,\n isHovered,\n multiLine,\n prefix,\n suffix,\n ],\n );\n\n const hasTextSecurity = multiLine && type === 'password';\n const textSecurityStyles =\n hasTextSecurity && inputProps.value?.length\n ? {\n fontFamily: 'text-security-disc',\n }\n : {};\n\n const textField = (\n <InputWrapperElement\n ref={wrapperRef}\n mods={modifiers}\n data-size={size}\n styles={styles}\n {...wrapperProps}\n >\n {prefix ? <div data-element=\"Prefix\">{prefix}</div> : null}\n <InputElement\n qa={qa || 'Input'}\n as={ElementType}\n data-input-type=\"textinput\"\n {...mergeProps(inputProps, focusProps, hoverProps)}\n ref={inputRef}\n rows={multiLine ? rows : undefined}\n mods={modifiers}\n style={textSecurityStyles}\n data-autofocus={autoFocus ? '' : undefined}\n autoFocus={autoFocus}\n data-size={size}\n autoComplete={autocomplete}\n styles={inputStyles}\n disabled={!!isDisabled}\n maxLength={maxLength}\n minLength={minLength}\n />\n {(validationState && !isLoading) || isLoading || suffix ? (\n <div data-element=\"Suffix\">\n {suffixPosition === 'before' ? suffix : null}\n {(validationState && !isLoading) || isLoading ? (\n <div data-element=\"State\">\n {validationState && !isLoading ? validation : null}\n {isLoading && <LoadingIcon data-element=\"InputIcon\" />}\n </div>\n ) : null}\n {suffixPosition === 'after' ? suffix : null}\n </div>\n ) : null}\n </InputWrapperElement>\n );\n\n return wrapWithField(textField, domRef, {\n ...props,\n form: undefined,\n });\n}\n\nconst TextInputBase = forwardRef(_TextInputBase);\n\nexport { TextInputBase };\nexport type { AriaTextFieldProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAM,aAAa;CACjB,GAAG;CACH,SAAS;CACT,cAAc;CACd,YAAY;CACZ,UAAU;CACV,MAAM;CACN,KAAK;CACL,QAAQ;CACR,SAAS;EACP,IAAI;EACJ,UAAU;EACX;CACF;AAED,MAAa,uBAA+B;CAC1C,SAAS;CACT,MAAM;CACN,UAAU;CACV,aAAa;EACX,IAAI;EACJ,QAAQ;EACR,QAAQ;EACR,mBAAmB;EACpB;CACD,UAAU;CACV,YAAY;CACZ,MAAM;EACJ,IAAI;EACJ,UAAU;EACX;CACD,QAAQ;EACN,IAAI;EACJ,OAAO;EACP,SAAS;EACT,SAAS;EACT,mBAAmB;EACnB,qBAAqB;EACrB,UAAU;EACX;CACD,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,OAAO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BAAmB,CAAC,aAAc,aAAa,CAAC,CAAC;EAC1D,GAAG;EACJ,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAGD,MAAM,qBADkB,aAAa,SAAS,cAEzB,WAAW,OAAO,SACjC,EACE,YAAY,sBACb,GACD,EAAE;AA4CR,QAAO,cAzCL,qBAAC;EACC,KAAK;EACL,MAAM;EACN,aAAW;EACH;EACR,GAAI;;GAEH,SAAS,oBAAC;IAAI,gBAAa;cAAU;KAAa,GAAG;GACtD,oBAAC;IACC,IAAI,MAAM;IACV,IAAI;IACJ,mBAAgB;IAChB,GAAIC,aAAW,YAAY,YAAY,WAAW;IAClD,KAAK;IACL,MAAM,YAAY,OAAO;IACzB,MAAM;IACN,OAAO;IACP,kBAAgB,YAAY,KAAK;IACtB;IACX,aAAW;IACX,cAAc;IACd,QAAQ;IACR,UAAU,CAAC,CAAC;IACD;IACA;KACX;GACA,mBAAmB,CAAC,aAAc,aAAa,SAC/C,qBAAC;IAAI,gBAAa;;KACf,mBAAmB,WAAW,SAAS;KACtC,mBAAmB,CAAC,aAAc,YAClC,qBAAC;MAAI,gBAAa;iBACf,mBAAmB,CAAC,YAAY,aAAa,MAC7C,aAAa,oBAAC,eAAY,gBAAa,cAAc;OAClD,GACJ;KACH,mBAAmB,UAAU,SAAS;;KACnC,GACJ;;GACgB,EAGQ,QAAQ;EACtC,GAAG;EACH,MAAM;EACP,CAAC;;AAGJ,MAAM,gBAAgB,WAAW,eAAe"}
|
|
1
|
+
{"version":3,"file":"TextInputBase.js","names":["useFocus","mergeProps"],"sources":["../../../../src/components/fields/TextInput/TextInputBase.tsx"],"sourcesContent":["import { createFocusableRef } from '@react-spectrum/utils';\nimport {\n BASE_STYLES,\n BaseProps,\n BaseStyleProps,\n BLOCK_STYLES,\n BlockStyleProps,\n COLOR_STYLES,\n ColorStyleProps,\n OUTER_STYLES,\n OuterStyleProps,\n Props,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n cloneElement,\n forwardRef,\n ReactElement,\n ReactNode,\n RefObject,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\nimport { AriaNumberFieldProps, AriaTextFieldProps, useHover } from 'react-aria';\n\nimport { LoadingIcon } from '../../../icons';\nimport { useProviderProps } from '../../../provider';\nimport { FieldBaseProps } from '../../../shared';\nimport { mergeProps, useCombinedRefs } from '../../../utils/react';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { extractStyles } from '../../../utils/styles';\nimport { useFieldProps, useFormProps, wrapWithField } from '../../form';\nimport { InvalidIcon } from '../../shared/InvalidIcon';\nimport { ValidIcon } from '../../shared/ValidIcon';\n\nconst ADD_STYLES = {\n $: '>',\n display: 'grid',\n placeContent: 'stretch',\n placeItems: 'center',\n gridRows: '1sf',\n flow: 'column',\n gap: 0,\n cursor: 'inherit',\n opacity: {\n '': 1,\n disabled: '$disabled-opacity',\n },\n};\n\nexport const INPUT_WRAPPER_STYLES: Styles = {\n display: 'grid',\n flow: 'row',\n position: 'relative',\n gridColumns: {\n '': '1sf',\n prefix: 'max-content 1sf',\n suffix: '1sf max-content',\n 'prefix & suffix': 'max-content 1sf max-content',\n },\n gridRows: '1sf',\n placeItems: 'stretch',\n fill: {\n '': '#surface',\n disabled: '#dark.04',\n },\n border: {\n '': true,\n valid: '#success-text.50',\n invalid: '#danger-text.50',\n focused: '#primary-text',\n 'valid & focused': '#success-text',\n 'invalid & focused': '#danger-text',\n disabled: true,\n },\n preset: 't3',\n radius: true,\n cursor: 'text',\n color: {\n '': '#dark-02',\n focused: '#dark-02',\n invalid: '#danger-text',\n disabled: '#dark.30',\n },\n zIndex: {\n '': 'initial',\n focused: 1,\n },\n boxSizing: 'border-box',\n transition: 'theme',\n backgroundClip: 'content-box',\n height: {\n '': '$size $size',\n multiline: 'min $size',\n },\n\n $size: {\n '': '$size-md',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n },\n\n Prefix: ADD_STYLES,\n\n Suffix: ADD_STYLES,\n\n State: {\n $: '> Suffix >',\n display: 'flex',\n },\n\n InputIcon: {\n display: 'grid',\n placeItems: 'center',\n width: 'min $size-sm',\n color: 'inherit',\n fontSize: '$icon-size',\n },\n\n ValidationIcon: {\n $: '> Suffix > State >',\n display: 'grid',\n placeItems: 'center',\n width: {\n '': 'min $size-sm',\n suffix: 'min $size-xs',\n },\n fontSize: '$icon-size',\n },\n};\n\nconst InputWrapperElement = tasty({\n qa: 'InputWrapper',\n styles: INPUT_WRAPPER_STYLES,\n});\n\nconst PROP_STYLES = [\n ...BASE_STYLES,\n ...OUTER_STYLES,\n ...BLOCK_STYLES,\n ...COLOR_STYLES,\n];\n\nexport const DEFAULT_INPUT_STYLES: Styles = {\n recipe: 'reset input / input-autofill',\n placeSelf: 'stretch',\n width: 'initial 100% 100%',\n transition: 'theme',\n radius: true,\n padding: '$vertical-padding $right-padding $vertical-padding $left-padding',\n textAlign: 'left',\n preset: 't3',\n flexGrow: 1,\n margin: {\n '': 0,\n multiline: '((($size-md - 1lh) / 2) - 1bw) 0',\n 'multiline & size=small': '((($size-sm - 1lh) / 2) - 1bw) 0',\n 'multiline & size=large': '((($size-lg - 1lh) / 2) - 1bw) 0',\n },\n resize: 'none',\n userSelect: 'auto',\n\n Placeholder: {\n $: '::placeholder',\n recipe: 'input-placeholder',\n },\n '&::-webkit-search-cancel-button': {\n recipe: 'input-search-cancel-button',\n },\n\n '$vertical-padding': 0,\n '$left-padding': {\n '': '(1x - 1bw)',\n 'size=small': '(1x - 1bw)',\n 'size=large': '(1.25x - 1bw)',\n 'size=xlarge': '(1.5x - 1bw)',\n prefix: '0',\n },\n '$right-padding': {\n '': '(1x - 1bw)',\n 'size=small': '(1x - 1bw)',\n 'size=large': '(1.25x - 1bw)',\n 'size=xlarge': '(1.5x - 1bw)',\n suffix: '0',\n },\n};\n\nconst InputElement = tasty({ qa: 'Input', styles: DEFAULT_INPUT_STYLES });\n\nexport interface CubeTextInputBaseProps\n extends BaseProps,\n OuterStyleProps,\n BlockStyleProps,\n BaseStyleProps,\n ColorStyleProps,\n Omit<AriaTextFieldProps, 'validate'>,\n FieldBaseProps {\n validate?: AriaTextFieldProps['validate'] | AriaNumberFieldProps['validate'];\n /** Left input icon */\n icon?: ReactElement | null;\n /** Input decoration before the main input */\n prefix?: ReactNode;\n /** Input decoration after the main input */\n suffix?: ReactNode;\n /** Suffix position goes before or after the validation and loading statuses */\n suffixPosition?: 'before' | 'after';\n /** Whether the input is multiline */\n multiLine?: boolean;\n /** Whether the input should have autofocus */\n autoFocus?: boolean;\n /** Direct input props */\n inputProps?: Props;\n /** Direct input wrapper props */\n wrapperProps?: Props;\n /** The input ref */\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement>;\n /** The wrapper ref */\n wrapperRef?: RefObject<HTMLDivElement>;\n /** Whether the input has the loading status */\n isLoading?: boolean;\n /** The loading status indicator */\n loadingIndicator?: ReactNode;\n /** Style map for the input */\n inputStyles?: Styles;\n /** The number of rows for the input. Only applies to textarea. */\n rows?: number;\n /** The resize CSS property sets whether an element is resizable, and if so, in which directions. */\n resize?: Styles['resize'];\n /** The size of the input */\n size?: 'small' | 'medium' | 'large' | (string & {});\n autocomplete?: string;\n}\n\nfunction _TextInputBase(props: CubeTextInputBaseProps, ref) {\n props = useProviderProps(props);\n props = useFormProps(props);\n props = useFieldProps(props, {\n defaultValidationTrigger: 'onBlur',\n valuePropsMapper: ({ value, onChange }) => ({\n value:\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '',\n onChange,\n }),\n });\n\n let {\n qa,\n mods,\n validationState,\n prefix,\n isDisabled,\n multiLine,\n autoFocus,\n inputProps,\n wrapperProps,\n inputRef,\n isLoading,\n loadingIndicator,\n value,\n inputStyles = {},\n suffix,\n suffixPosition = 'before',\n wrapperRef,\n tooltip,\n rows = 1,\n size = 'medium',\n autocomplete,\n icon,\n maxLength,\n minLength,\n form,\n resize,\n ...otherProps\n } = props;\n\n let styles = extractStyles(otherProps, PROP_STYLES);\n let type = otherProps.type;\n\n if (resize) {\n inputStyles = { ...inputStyles, resize };\n }\n\n let ElementType: 'textarea' | 'input' = multiLine ? 'textarea' : 'input';\n let { isFocused, focusProps } = useFocus({ isDisabled });\n let { hoverProps, isHovered } = useHover({ isDisabled });\n let domRef = useRef(null);\n\n inputRef = useCombinedRefs(inputRef);\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef?.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef?.current;\n },\n }));\n\n let isInvalid = validationState === 'invalid';\n let validationIcon = isInvalid ? InvalidIcon : ValidIcon;\n let validation = cloneElement(validationIcon);\n\n // Fix safari bug: https://github.com/philipwalton/flexbugs/issues/270\n if (!inputProps?.placeholder) {\n if (!inputProps) {\n inputProps = {};\n }\n\n inputProps.placeholder = ' ';\n }\n\n if (icon) {\n icon = <div data-element=\"InputIcon\">{icon}</div>;\n\n if (prefix) {\n prefix = (\n <>\n {icon}\n {prefix}\n </>\n );\n } else {\n prefix = icon;\n }\n }\n\n const modifiers = useMemo(\n () => ({\n invalid: isInvalid,\n valid: validationState === 'valid',\n loadable: !!loadingIndicator,\n focused: isFocused,\n hovered: isHovered,\n disabled: isDisabled,\n multiline: multiLine,\n prefix: !!prefix,\n suffix: (validationState && !isLoading) || isLoading || !!suffix,\n ...mods,\n }),\n [\n mods,\n isInvalid,\n validationState,\n loadingIndicator,\n isFocused,\n isDisabled,\n isHovered,\n multiLine,\n prefix,\n suffix,\n ],\n );\n\n const hasTextSecurity = multiLine && type === 'password';\n const textSecurityStyles =\n hasTextSecurity && inputProps.value?.length\n ? {\n fontFamily: 'text-security-disc',\n }\n : {};\n\n const textField = (\n <InputWrapperElement\n ref={wrapperRef}\n mods={modifiers}\n data-size={size}\n styles={styles}\n {...wrapperProps}\n >\n {prefix ? <div data-element=\"Prefix\">{prefix}</div> : null}\n <InputElement\n qa={qa || 'Input'}\n as={ElementType}\n data-input-type=\"textinput\"\n {...mergeProps(inputProps, focusProps, hoverProps)}\n ref={inputRef}\n rows={multiLine ? rows : undefined}\n mods={modifiers}\n style={textSecurityStyles}\n data-autofocus={autoFocus ? '' : undefined}\n autoFocus={autoFocus}\n data-size={size}\n autoComplete={autocomplete}\n styles={inputStyles}\n disabled={!!isDisabled}\n maxLength={maxLength}\n minLength={minLength}\n />\n {(validationState && !isLoading) || isLoading || suffix ? (\n <div data-element=\"Suffix\">\n {suffixPosition === 'before' ? suffix : null}\n {(validationState && !isLoading) || isLoading ? (\n <div data-element=\"State\">\n {validationState && !isLoading ? validation : null}\n {isLoading && <LoadingIcon data-element=\"InputIcon\" />}\n </div>\n ) : null}\n {suffixPosition === 'after' ? suffix : null}\n </div>\n ) : null}\n </InputWrapperElement>\n );\n\n return wrapWithField(textField, domRef, {\n ...props,\n form: undefined,\n });\n}\n\nconst TextInputBase = forwardRef(_TextInputBase);\n\nexport { TextInputBase };\nexport type { AriaTextFieldProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,MAAM,aAAa;CACjB,GAAG;CACH,SAAS;CACT,cAAc;CACd,YAAY;CACZ,UAAU;CACV,MAAM;CACN,KAAK;CACL,QAAQ;CACR,SAAS;EACP,IAAI;EACJ,UAAU;EACX;CACF;AAED,MAAa,uBAA+B;CAC1C,SAAS;CACT,MAAM;CACN,UAAU;CACV,aAAa;EACX,IAAI;EACJ,QAAQ;EACR,QAAQ;EACR,mBAAmB;EACpB;CACD,UAAU;CACV,YAAY;CACZ,MAAM;EACJ,IAAI;EACJ,UAAU;EACX;CACD,QAAQ;EACN,IAAI;EACJ,OAAO;EACP,SAAS;EACT,SAAS;EACT,mBAAmB;EACnB,qBAAqB;EACrB,UAAU;EACX;CACD,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,OAAO;EACL,IAAI;EACJ,SAAS;EACT,SAAS;EACT,UAAU;EACX;CACD,QAAQ;EACN,IAAI;EACJ,SAAS;EACV;CACD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;EACA;EACA;EACA;EACD,CACF;CAGD,MAAM,qBADkB,aAAa,SAAS,cAEzB,WAAW,OAAO,SACjC,EACE,YAAY,sBACb,GACD,EAAE;AA4CR,QAAO,cAzCL,qBAAC;EACC,KAAK;EACL,MAAM;EACN,aAAW;EACH;EACR,GAAI;;GAEH,SAAS,oBAAC;IAAI,gBAAa;cAAU;KAAa,GAAG;GACtD,oBAAC;IACC,IAAI,MAAM;IACV,IAAI;IACJ,mBAAgB;IAChB,GAAIC,aAAW,YAAY,YAAY,WAAW;IAClD,KAAK;IACL,MAAM,YAAY,OAAO;IACzB,MAAM;IACN,OAAO;IACP,kBAAgB,YAAY,KAAK;IACtB;IACX,aAAW;IACX,cAAc;IACd,QAAQ;IACR,UAAU,CAAC,CAAC;IACD;IACA;KACX;GACA,mBAAmB,CAAC,aAAc,aAAa,SAC/C,qBAAC;IAAI,gBAAa;;KACf,mBAAmB,WAAW,SAAS;KACtC,mBAAmB,CAAC,aAAc,YAClC,qBAAC;MAAI,gBAAa;iBACf,mBAAmB,CAAC,YAAY,aAAa,MAC7C,aAAa,oBAAC,eAAY,gBAAa,cAAc;OAClD,GACJ;KACH,mBAAmB,UAAU,SAAS;;KACnC,GACJ;;GACgB,EAGQ,QAAQ;EACtC,GAAG;EACH,MAAM;EACP,CAAC;;AAGJ,MAAM,gBAAgB,WAAW,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { wrapNodeIfPlain } from "../../../utils/react/wrapNodeIfPlain.js";
|
|
4
4
|
import { _Text } from "../../content/Text.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
//#region src/components/form/FieldWrapper/extract-field-wrapper-props.ts
|
|
3
3
|
const createFieldWrapperPropsKeys = (arr) => new Set(arr);
|
|
4
4
|
const fieldWrapperPropsKeys = createFieldWrapperPropsKeys([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { warn } from "../../../utils/warnings.js";
|
|
4
4
|
import { FieldWrapper } from "../FieldWrapper/FieldWrapper.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { Provider, useProviderProps } from "../../../provider.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { useProviderProps } from "../../../../provider.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { useProviderProps } from "../../../../provider.js";
|
|
3
3
|
import { Button } from "../../../actions/Button/Button.js";
|
|
4
4
|
import { useFormProps } from "../Form.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { FormContext } from "./Form.js";
|
|
3
3
|
import { Alert } from "../../content/Alert/Alert.js";
|
|
4
4
|
import { forwardRef, isValidElement, useContext } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { useForm } from "./use-form.js";
|
|
3
3
|
import { FormContext, _Form, useFormProps } from "./Form.js";
|
|
4
4
|
import { useField } from "./use-field/use-field.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { warn } from "../../../../utils/warnings.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { useIsFirstRender } from "../../../../_internal/hooks/use-is-first-render.js";
|
|
4
4
|
import { delayValidationRule } from "../validation.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { applyRules } from "./validation.js";
|
|
3
3
|
import { dotize } from "@tenphi/tasty";
|
|
4
4
|
import { useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useProviderProps } from "../../provider.js";
|
|
4
4
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { FieldWrapper } from "./FieldWrapper/FieldWrapper.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/helpers/DisplayTransition/DisplayTransition.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { DisplayTransition } from "../DisplayTransition/DisplayTransition.js";
|
|
3
3
|
import { tasty } from "@tenphi/tasty";
|
|
4
4
|
import { isValidElement, useCallback, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { BASE_STYLES, BLOCK_STYLES, COLOR_STYLES, DIMENSION_STYLES, OUTER_STYLES, tasty } from "@tenphi/tasty";
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../utils/react/useLayoutEffect.js";
|
|
4
4
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { CONTAINER_STYLES, filterBaseProps, parseStyle, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { DraggableCollection } from "../../shared/DraggableCollection.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { EditableTitleInputElement, HiddenMeasure } from "./styled.js";
|
|
4
4
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { ItemActionProvider } from "../../actions/ItemActionContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { DropIndicatorElement } from "./styled.js";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { TabPanelElement } from "./styled.js";
|
|
3
3
|
import { useEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
3
3
|
import { CloseIcon } from "../../../icons/CloseIcon.js";
|
|
4
4
|
import { MoreIcon } from "../../../icons/MoreIcon.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { _ItemButton } from "../../actions/ItemButton/ItemButton.js";
|
|
3
3
|
import { useOptionalTabsContext } from "./TabsContext.js";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { chainRaf } from "../../../utils/raf.js";
|
|
3
3
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { Block } from "../../Block.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -72,7 +72,7 @@ const TabElement = tasty(Action, { styles: {
|
|
|
72
72
|
fill: {
|
|
73
73
|
"": "#dark.04",
|
|
74
74
|
hovered: "#dark.08",
|
|
75
|
-
"disabled, disabled & hover": "#
|
|
75
|
+
"disabled, disabled & hover": "#surface"
|
|
76
76
|
},
|
|
77
77
|
color: {
|
|
78
78
|
"": "#dark-02",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTabs.js","names":[],"sources":["../../../../src/components/organisms/FileTabs/FileTabs.tsx"],"sourcesContent":["import { Styles, tasty } from '@tenphi/tasty';\nimport {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { CloseIcon } from '../../../icons';\nimport { useLayoutEffect } from '../../../utils/react';\nimport { Action, Button, CubeActionProps } from '../../actions';\nimport { Block } from '../../Block';\nimport { CubeFlexProps, Flex } from '../../layout/Flex';\nimport { Space } from '../../layout/Space';\n\ninterface TabData {\n id: string | number;\n title?: string;\n isDirty?: boolean;\n}\n\ninterface FileTabContextValue {\n addTab: (tab: TabData) => void;\n setTab: (id: string | number) => void;\n removeTab: (tab: TabData) => void;\n currentTab?: string | number;\n setDirtyTab: (id: string | number, isDirty: boolean) => void;\n}\n\nconst FileTabsContext = createContext<FileTabContextValue>({\n addTab() {},\n removeTab() {},\n setTab() {},\n setDirtyTab() {},\n});\n\nconst TabsPanelElement = tasty(Space, {\n qa: 'TabsPanel',\n styles: {\n position: 'relative',\n overflow: 'auto hidden',\n top: '1bw',\n gap: '.5x',\n flexShrink: 0,\n whiteSpace: 'nowrap',\n scrollbar: 'styled',\n padding: '1ow 1ow 0 1ow',\n fade: {\n '': false,\n 'left-fade': '3x left',\n 'right-fade': '3x right',\n 'right-fade & left-fade': '3x left right',\n },\n transition: 'fade',\n '--scrollbar-radius': '1ow',\n '--scrollbar-width': '.75x',\n '--scrollbar-outline-width': '1px',\n },\n});\n\nconst TabsContainerElement = tasty(Flex, {\n qa: 'TabsContainer',\n styles: {\n flow: 'column',\n height: 'max 100%',\n width: 'max 100%',\n position: 'relative',\n },\n});\n\nconst DirtyBadge = tasty({\n element: 'DirtyBadge',\n styles: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '1x',\n height: '1x',\n fill: '#dark.30',\n radius: 'round',\n },\n});\n\nconst TabElement = tasty(Action, {\n styles: {\n radius: '1r 1r 0 0',\n padding: '1x 1.5x',\n border: {\n '': 'left top right #clear',\n disabled: 'left top right #border',\n },\n fill: {\n '': '#dark.04',\n hovered: '#dark.08',\n 'disabled, disabled & hover': '#white',\n },\n color: {\n '': '#dark-02',\n 'disabled, hovered, hovered & disabled': '#dark',\n },\n cursor: {\n '': '$pointer',\n disabled: 'default',\n },\n fontWeight: 500,\n opacity: 1,\n preset: 'default',\n transform: {\n '': 'translate(0, 0)',\n disabled: 'translate(0, 1bw)',\n },\n transition: 'theme 0.2s',\n margin: '1bw bottom',\n\n DirtyBadge: {\n opacity: {\n '': 1,\n 'dirty & :hover': 0,\n },\n pointerEvents: {\n '': 'auto',\n 'dirty & :hover': 'none',\n },\n },\n\n CloseButton: {\n opacity: {\n '': 0,\n '!dirty | :hover': 1,\n },\n },\n },\n});\n\nconst CloseButton = tasty(Button, {\n element: 'CloseButton',\n type: 'neutral',\n icon: <CloseIcon />,\n label: 'Close Tab',\n styles: {\n width: '3x',\n height: '3x',\n padding: 0,\n },\n});\n\n/**\n * @deprecated consider using <Tabs /> instead\n */\nexport interface FileTabProps extends Omit<CubeActionProps, 'id'> {\n isDirty?: boolean;\n isDisabled?: boolean;\n children?: ReactNode;\n isClosable?: boolean;\n onClose?: () => void;\n}\n\nfunction Tab({\n isDirty,\n isDisabled,\n children,\n isClosable,\n onClose,\n ...props\n}: FileTabProps) {\n return (\n <TabElement\n mods={{\n dirty: isDirty,\n }}\n isDisabled={isDisabled}\n {...props}\n >\n <Space gap=\".75x\">\n <Block>{children}</Block>\n {(isClosable || isDirty) && (\n <Flex placeItems=\"center\" style={{ position: 'relative' }}>\n {isClosable ? <CloseButton onPress={onClose} /> : <div></div>}\n {isDirty ? <DirtyBadge /> : null}\n </Flex>\n )}\n </Space>\n </TabElement>\n );\n}\n\nexport interface CubeFileTabsProps extends CubeFlexProps {\n /** The initial active key in the tabs (uncontrolled). */\n defaultActiveKey?: string;\n /** The currently active key in the tabs (controlled). */\n activeKey?: string | number;\n /** Handler that is called when the tab is clicked. */\n onTabClick?: (string) => void;\n /** Handler that is called when the tab is closed. */\n onTabClose?: (string) => void;\n /** Styles for each tab pane */\n paneStyles?: Styles;\n /** Whether the tabs are closable */\n isClosable?: boolean;\n children?: ReactNode;\n}\n\nexport function FileTabs({\n defaultActiveKey,\n activeKey: activeKeyProp,\n onTabClick,\n onTabClose,\n paneStyles,\n isClosable = true,\n children,\n ...props\n}: CubeFileTabsProps) {\n const tabsRef = useRef<HTMLButtonElement>(null);\n const [tabs, setTabs] = useState<TabData[]>([]);\n const [activeKey, setActiveKey] = useState<string | number | undefined>(\n activeKeyProp || defaultActiveKey,\n );\n\n const [leftFade, setLeftFade] = useState(false);\n const [rightFade, setRightFade] = useState(false);\n\n function updateScroll() {\n const el = tabsRef && tabsRef.current;\n\n if (!el) return;\n\n setLeftFade(!!el.scrollLeft);\n setRightFade(\n el.scrollWidth !== el.offsetWidth &&\n !!(el.scrollWidth - el.offsetWidth - el.scrollLeft),\n );\n }\n\n useLayoutEffect(updateScroll, [tabs]);\n\n function scrollCurrentIntoView() {\n const el = tabsRef && tabsRef.current;\n\n if (!el) return;\n\n const current = el.querySelector('button[disabled]');\n\n if (!current) return;\n\n current.scrollIntoView({ behavior: 'smooth', inline: 'end', block: 'end' });\n }\n\n useEffect(() => {\n function update() {\n updateScroll();\n }\n\n if (tabsRef && tabsRef.current) {\n tabsRef.current.addEventListener('scroll', update);\n tabsRef.current.addEventListener('mousewheel', update);\n window.addEventListener('resize', update);\n }\n\n return () => {\n if (tabsRef && tabsRef.current) {\n tabsRef.current.removeEventListener('scroll', update);\n tabsRef.current.removeEventListener('mousewheel', update);\n }\n\n window.removeEventListener('resize', update);\n };\n }, [tabsRef]);\n\n useEffect(scrollCurrentIntoView, [activeKey]);\n\n useEffect(() => {\n setActiveKey(activeKeyProp);\n }, [activeKeyProp]);\n\n function getTab(tabs: TabData[], key: string | number): TabData | undefined {\n return tabs.find((tab) => tab.id === key);\n }\n\n function setTab(key: string | number) {\n if (getTab(tabs, key)) {\n setActiveKey(key);\n }\n }\n\n function addTab(tab: TabData) {\n setTabs((tabs) => {\n if (!getTab(tabs, tab.id)) {\n return [...tabs, tab];\n }\n\n return tabs;\n });\n }\n\n function setDirtyTab(id: string | number, isDirty: boolean) {\n setTabs((tabs) => {\n const tab = getTab(tabs, id);\n\n if (tab) {\n tab.isDirty = isDirty;\n\n return [...tabs];\n }\n\n return tabs;\n });\n }\n\n function handleClose(tab) {\n if (getTab(tabs, tab.id)) {\n onTabClose && onTabClose(tab.id);\n }\n }\n\n function removeTab(tab) {\n setTabs((tabs) => {\n const _tabs = tabs.filter((_tab) => _tab.id !== tab.id);\n\n setActiveKey((prevActiveKey) => {\n if (prevActiveKey === tab.id) {\n return _tabs[0] && _tabs[0].id;\n }\n\n return prevActiveKey;\n });\n\n return _tabs;\n });\n }\n\n function onPress(tab) {\n setTab(tab.id);\n onTabClick && onTabClick(tab.id);\n }\n\n return (\n <TabsContainerElement {...props}>\n <FileTabsContext.Provider\n value={{\n addTab,\n setTab,\n removeTab,\n setDirtyTab,\n currentTab: activeKey,\n }}\n >\n <TabsPanelElement\n ref={tabsRef}\n data-left-fade={leftFade || null}\n data-right-fade={rightFade || null}\n >\n {tabs.map((tab) => {\n return (\n <Tab\n key={tab.id}\n isClosable={isClosable}\n isDisabled={tab.id === activeKey || false}\n isDirty={tab.isDirty}\n onPress={() => onPress(tab)}\n onClose={() => isClosable && handleClose(tab)}\n >\n {tab.title}\n </Tab>\n );\n })}\n </TabsPanelElement>\n <Flex flexGrow={1} border=\"top\" {...(paneStyles || {})}>\n {children}\n </Flex>\n </FileTabsContext.Provider>\n </TabsContainerElement>\n );\n}\n\nexport interface CubeFileTabProps extends FileTabProps {\n id: string | number;\n title: string;\n}\n\nFileTabs.TabPane = function FileTabPane(allProps: CubeFileTabProps) {\n let { id, title, isDirty, children, ...props } = allProps;\n const { addTab, removeTab, currentTab, setDirtyTab } =\n useContext(FileTabsContext);\n\n useEffect(() => {\n const tabData = {\n id,\n title,\n isDirty,\n };\n\n addTab(tabData);\n\n return () => {\n removeTab(tabData);\n };\n }, [id, title]);\n\n useEffect(() => {\n setDirtyTab(id, isDirty || false);\n }, [isDirty]);\n\n const isCurrent = id === currentTab;\n\n return (\n <Block\n style={{ display: isCurrent ? 'block' : 'none', maxWidth: '100%' }}\n flexGrow={1}\n {...props}\n >\n {children}\n </Block>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,kBAAkB,cAAmC;CACzD,SAAS;CACT,YAAY;CACZ,SAAS;CACT,cAAc;CACf,CAAC;AAEF,MAAM,mBAAmB,MAAM,OAAO;CACpC,IAAI;CACJ,QAAQ;EACN,UAAU;EACV,UAAU;EACV,KAAK;EACL,KAAK;EACL,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,SAAS;EACT,MAAM;GACJ,IAAI;GACJ,aAAa;GACb,cAAc;GACd,0BAA0B;GAC3B;EACD,YAAY;EACZ,sBAAsB;EACtB,qBAAqB;EACrB,6BAA6B;EAC9B;CACF,CAAC;AAEF,MAAM,uBAAuB,MAAM,MAAM;CACvC,IAAI;CACJ,QAAQ;EACN,MAAM;EACN,QAAQ;EACR,OAAO;EACP,U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AG,QAAO;IAAM,GAAK,cAAc,EAAE;IAClD;KACI;IACkB;GACN;;AAS3B,SAAS,UAAU,SAAS,YAAY,UAA4B;CAClE,IAAI,EAAE,IAAI,OAAO,SAAS,UAAU,GAAG,UAAU;CACjD,MAAM,EAAE,QAAQ,WAAW,YAAY,gBACrC,WAAW,gBAAgB;AAE7B,iBAAgB;EACd,MAAM,UAAU;GACd;GACA;GACA;GACD;AAED,SAAO,QAAQ;AAEf,eAAa;AACX,aAAU,QAAQ;;IAEnB,CAAC,IAAI,MAAM,CAAC;AAEf,iBAAgB;AACd,cAAY,IAAI,WAAW,MAAM;IAChC,CAAC,QAAQ,CAAC;AAIb,QACE,oBAAC;EACC,OAAO;GAAE,SAJK,OAAO,aAIS,UAAU;GAAQ,UAAU;GAAQ;EAClE,UAAU;EACV,GAAI;EAEH;GACK"}
|
|
1
|
+
{"version":3,"file":"FileTabs.js","names":[],"sources":["../../../../src/components/organisms/FileTabs/FileTabs.tsx"],"sourcesContent":["import { Styles, tasty } from '@tenphi/tasty';\nimport {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { CloseIcon } from '../../../icons';\nimport { useLayoutEffect } from '../../../utils/react';\nimport { Action, Button, CubeActionProps } from '../../actions';\nimport { Block } from '../../Block';\nimport { CubeFlexProps, Flex } from '../../layout/Flex';\nimport { Space } from '../../layout/Space';\n\ninterface TabData {\n id: string | number;\n title?: string;\n isDirty?: boolean;\n}\n\ninterface FileTabContextValue {\n addTab: (tab: TabData) => void;\n setTab: (id: string | number) => void;\n removeTab: (tab: TabData) => void;\n currentTab?: string | number;\n setDirtyTab: (id: string | number, isDirty: boolean) => void;\n}\n\nconst FileTabsContext = createContext<FileTabContextValue>({\n addTab() {},\n removeTab() {},\n setTab() {},\n setDirtyTab() {},\n});\n\nconst TabsPanelElement = tasty(Space, {\n qa: 'TabsPanel',\n styles: {\n position: 'relative',\n overflow: 'auto hidden',\n top: '1bw',\n gap: '.5x',\n flexShrink: 0,\n whiteSpace: 'nowrap',\n scrollbar: 'styled',\n padding: '1ow 1ow 0 1ow',\n fade: {\n '': false,\n 'left-fade': '3x left',\n 'right-fade': '3x right',\n 'right-fade & left-fade': '3x left right',\n },\n transition: 'fade',\n '--scrollbar-radius': '1ow',\n '--scrollbar-width': '.75x',\n '--scrollbar-outline-width': '1px',\n },\n});\n\nconst TabsContainerElement = tasty(Flex, {\n qa: 'TabsContainer',\n styles: {\n flow: 'column',\n height: 'max 100%',\n width: 'max 100%',\n position: 'relative',\n },\n});\n\nconst DirtyBadge = tasty({\n element: 'DirtyBadge',\n styles: {\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n width: '1x',\n height: '1x',\n fill: '#dark.30',\n radius: 'round',\n },\n});\n\nconst TabElement = tasty(Action, {\n styles: {\n radius: '1r 1r 0 0',\n padding: '1x 1.5x',\n border: {\n '': 'left top right #clear',\n disabled: 'left top right #border',\n },\n fill: {\n '': '#dark.04',\n hovered: '#dark.08',\n 'disabled, disabled & hover': '#surface',\n },\n color: {\n '': '#dark-02',\n 'disabled, hovered, hovered & disabled': '#dark',\n },\n cursor: {\n '': '$pointer',\n disabled: 'default',\n },\n fontWeight: 500,\n opacity: 1,\n preset: 'default',\n transform: {\n '': 'translate(0, 0)',\n disabled: 'translate(0, 1bw)',\n },\n transition: 'theme 0.2s',\n margin: '1bw bottom',\n\n DirtyBadge: {\n opacity: {\n '': 1,\n 'dirty & :hover': 0,\n },\n pointerEvents: {\n '': 'auto',\n 'dirty & :hover': 'none',\n },\n },\n\n CloseButton: {\n opacity: {\n '': 0,\n '!dirty | :hover': 1,\n },\n },\n },\n});\n\nconst CloseButton = tasty(Button, {\n element: 'CloseButton',\n type: 'neutral',\n icon: <CloseIcon />,\n label: 'Close Tab',\n styles: {\n width: '3x',\n height: '3x',\n padding: 0,\n },\n});\n\n/**\n * @deprecated consider using <Tabs /> instead\n */\nexport interface FileTabProps extends Omit<CubeActionProps, 'id'> {\n isDirty?: boolean;\n isDisabled?: boolean;\n children?: ReactNode;\n isClosable?: boolean;\n onClose?: () => void;\n}\n\nfunction Tab({\n isDirty,\n isDisabled,\n children,\n isClosable,\n onClose,\n ...props\n}: FileTabProps) {\n return (\n <TabElement\n mods={{\n dirty: isDirty,\n }}\n isDisabled={isDisabled}\n {...props}\n >\n <Space gap=\".75x\">\n <Block>{children}</Block>\n {(isClosable || isDirty) && (\n <Flex placeItems=\"center\" style={{ position: 'relative' }}>\n {isClosable ? <CloseButton onPress={onClose} /> : <div></div>}\n {isDirty ? <DirtyBadge /> : null}\n </Flex>\n )}\n </Space>\n </TabElement>\n );\n}\n\nexport interface CubeFileTabsProps extends CubeFlexProps {\n /** The initial active key in the tabs (uncontrolled). */\n defaultActiveKey?: string;\n /** The currently active key in the tabs (controlled). */\n activeKey?: string | number;\n /** Handler that is called when the tab is clicked. */\n onTabClick?: (string) => void;\n /** Handler that is called when the tab is closed. */\n onTabClose?: (string) => void;\n /** Styles for each tab pane */\n paneStyles?: Styles;\n /** Whether the tabs are closable */\n isClosable?: boolean;\n children?: ReactNode;\n}\n\nexport function FileTabs({\n defaultActiveKey,\n activeKey: activeKeyProp,\n onTabClick,\n onTabClose,\n paneStyles,\n isClosable = true,\n children,\n ...props\n}: CubeFileTabsProps) {\n const tabsRef = useRef<HTMLButtonElement>(null);\n const [tabs, setTabs] = useState<TabData[]>([]);\n const [activeKey, setActiveKey] = useState<string | number | undefined>(\n activeKeyProp || defaultActiveKey,\n );\n\n const [leftFade, setLeftFade] = useState(false);\n const [rightFade, setRightFade] = useState(false);\n\n function updateScroll() {\n const el = tabsRef && tabsRef.current;\n\n if (!el) return;\n\n setLeftFade(!!el.scrollLeft);\n setRightFade(\n el.scrollWidth !== el.offsetWidth &&\n !!(el.scrollWidth - el.offsetWidth - el.scrollLeft),\n );\n }\n\n useLayoutEffect(updateScroll, [tabs]);\n\n function scrollCurrentIntoView() {\n const el = tabsRef && tabsRef.current;\n\n if (!el) return;\n\n const current = el.querySelector('button[disabled]');\n\n if (!current) return;\n\n current.scrollIntoView({ behavior: 'smooth', inline: 'end', block: 'end' });\n }\n\n useEffect(() => {\n function update() {\n updateScroll();\n }\n\n if (tabsRef && tabsRef.current) {\n tabsRef.current.addEventListener('scroll', update);\n tabsRef.current.addEventListener('mousewheel', update);\n window.addEventListener('resize', update);\n }\n\n return () => {\n if (tabsRef && tabsRef.current) {\n tabsRef.current.removeEventListener('scroll', update);\n tabsRef.current.removeEventListener('mousewheel', update);\n }\n\n window.removeEventListener('resize', update);\n };\n }, [tabsRef]);\n\n useEffect(scrollCurrentIntoView, [activeKey]);\n\n useEffect(() => {\n setActiveKey(activeKeyProp);\n }, [activeKeyProp]);\n\n function getTab(tabs: TabData[], key: string | number): TabData | undefined {\n return tabs.find((tab) => tab.id === key);\n }\n\n function setTab(key: string | number) {\n if (getTab(tabs, key)) {\n setActiveKey(key);\n }\n }\n\n function addTab(tab: TabData) {\n setTabs((tabs) => {\n if (!getTab(tabs, tab.id)) {\n return [...tabs, tab];\n }\n\n return tabs;\n });\n }\n\n function setDirtyTab(id: string | number, isDirty: boolean) {\n setTabs((tabs) => {\n const tab = getTab(tabs, id);\n\n if (tab) {\n tab.isDirty = isDirty;\n\n return [...tabs];\n }\n\n return tabs;\n });\n }\n\n function handleClose(tab) {\n if (getTab(tabs, tab.id)) {\n onTabClose && onTabClose(tab.id);\n }\n }\n\n function removeTab(tab) {\n setTabs((tabs) => {\n const _tabs = tabs.filter((_tab) => _tab.id !== tab.id);\n\n setActiveKey((prevActiveKey) => {\n if (prevActiveKey === tab.id) {\n return _tabs[0] && _tabs[0].id;\n }\n\n return prevActiveKey;\n });\n\n return _tabs;\n });\n }\n\n function onPress(tab) {\n setTab(tab.id);\n onTabClick && onTabClick(tab.id);\n }\n\n return (\n <TabsContainerElement {...props}>\n <FileTabsContext.Provider\n value={{\n addTab,\n setTab,\n removeTab,\n setDirtyTab,\n currentTab: activeKey,\n }}\n >\n <TabsPanelElement\n ref={tabsRef}\n data-left-fade={leftFade || null}\n data-right-fade={rightFade || null}\n >\n {tabs.map((tab) => {\n return (\n <Tab\n key={tab.id}\n isClosable={isClosable}\n isDisabled={tab.id === activeKey || false}\n isDirty={tab.isDirty}\n onPress={() => onPress(tab)}\n onClose={() => isClosable && handleClose(tab)}\n >\n {tab.title}\n </Tab>\n );\n })}\n </TabsPanelElement>\n <Flex flexGrow={1} border=\"top\" {...(paneStyles || {})}>\n {children}\n </Flex>\n </FileTabsContext.Provider>\n </TabsContainerElement>\n );\n}\n\nexport interface CubeFileTabProps extends FileTabProps {\n id: string | number;\n title: string;\n}\n\nFileTabs.TabPane = function FileTabPane(allProps: CubeFileTabProps) {\n let { id, title, isDirty, children, ...props } = allProps;\n const { addTab, removeTab, currentTab, setDirtyTab } =\n useContext(FileTabsContext);\n\n useEffect(() => {\n const tabData = {\n id,\n title,\n isDirty,\n };\n\n addTab(tabData);\n\n return () => {\n removeTab(tabData);\n };\n }, [id, title]);\n\n useEffect(() => {\n setDirtyTab(id, isDirty || false);\n }, [isDirty]);\n\n const isCurrent = id === currentTab;\n\n return (\n <Block\n style={{ display: isCurrent ? 'block' : 'none', maxWidth: '100%' }}\n flexGrow={1}\n {...props}\n >\n {children}\n </Block>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,kBAAkB,cAAmC;CACzD,SAAS;CACT,YAAY;CACZ,SAAS;CACT,cAAc;CACf,CAAC;AAEF,MAAM,mBAAmB,MAAM,OAAO;CACpC,IAAI;CACJ,QAAQ;EACN,UAAU;EACV,UAAU;EACV,KAAK;EACL,KAAK;EACL,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,SAAS;EACT,MAAM;GACJ,IAAI;GACJ,aAAa;GACb,cAAc;GACd,0BAA0B;GAC3B;EACD,YAAY;EACZ,sBAAsB;EACtB,qBAAqB;EACrB,6BAA6B;EAC9B;CACF,CAAC;AAEF,MAAM,uBAAuB,MAAM,MAAM;CACvC,IAAI;CACJ,QA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,GAQL;MAER;KACe,EACnB,oBAAC;IAAK,UAAU;IAAG,QAAO;IAAM,GAAK,cAAc,EAAE;IAClD;KACI;IACkB;GACN;;AAS3B,SAAS,UAAU,SAAS,YAAY,UAA4B;CAClE,IAAI,EAAE,IAAI,OAAO,SAAS,UAAU,GAAG,UAAU;CACjD,MAAM,EAAE,QAAQ,WAAW,YAAY,gBACrC,WAAW,gBAAgB;AAE7B,iBAAgB;EACd,MAAM,UAAU;GACd;GACA;GACA;GACD;AAED,SAAO,QAAQ;AAEf,eAAa;AACX,aAAU,QAAQ;;IAEnB,CAAC,IAAI,MAAM,CAAC;AAEf,iBAAgB;AACd,cAAY,IAAI,WAAW,MAAM;IAChC,CAAC,QAAQ,CAAC;AAIb,QACE,oBAAC;EACC,OAAO;GAAE,SAJK,OAAO,aAIS,UAAU;GAAQ,UAAU;GAAQ;EAClE,UAAU;EACV,GAAI;EAEH;GACK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { _Text } from "../../content/Text.js";
|
|
3
3
|
import { _Title } from "../../content/Title.js";
|
|
4
4
|
import { Card } from "../../content/Card/Card.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useProviderProps } from "../../../provider.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { tasty } from "@tenphi/tasty";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { CalendarCell } from "./CalendarCell.js";
|
|
3
3
|
import { tasty } from "@tenphi/tasty";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useProviderProps } from "../../../provider.js";
|
|
4
4
|
import { Space } from "../../layout/Space.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { Button } from "../../actions/index.js";
|
|
3
3
|
import { tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { chain } from "../../../utils/react/chain.js";
|
|
3
3
|
import { Paragraph } from "../../content/Paragraph.js";
|
|
4
4
|
import { _Title } from "../../content/Title.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { AlertDialogZone } from "./AlertDialogZone.js";
|
|
3
3
|
import { createContext, useContext, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { Portal } from "../../portal/Portal.js";
|
|
3
3
|
import { DialogContainer } from "../Dialog/DialogContainer.js";
|
|
4
4
|
import { _AlertDialog } from "./AlertDialog.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-88ada42 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { SlotProvider } from "../../../utils/react/Slots.js";
|
|
@@ -25,7 +25,7 @@ const DialogElement = tasty({
|
|
|
25
25
|
styles: {
|
|
26
26
|
display: "flex",
|
|
27
27
|
flow: "column",
|
|
28
|
-
fill: "#
|
|
28
|
+
fill: "#surface",
|
|
29
29
|
pointerEvents: "auto",
|
|
30
30
|
outline: 0,
|
|
31
31
|
position: {
|