@cube-dev/ui-kit 0.202.0 → 0.204.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +24 -0
- 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 +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 +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.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/MenuCollectionItem.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/actions-run.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 +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 +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 +1 -1
- package/dist/components/content/Divider/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/InfoBadge/InfoBadge.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/Item/ItemWithNativeLinks.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/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.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.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/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.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/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +233 -178
- package/dist/components/data/ItemTable/ItemTable.js.map +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/index.d.ts +2 -2
- package/dist/components/data/ItemTable/item-table-sections.js +68 -0
- package/dist/components/data/ItemTable/item-table-sections.js.map +1 -0
- package/dist/components/data/ItemTable/types.d.ts +12 -0
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +31 -27
- package/dist/components/data/ItemTable/use-item-table-selection.js.map +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.d.ts +1 -0
- package/dist/components/data/TableBase/TableView.js +86 -21
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +25 -1
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-body-sections.d.ts +3 -0
- package/dist/components/data/TableBase/table-body-sections.js +30 -0
- package/dist/components/data/TableBase/table-body-sections.js.map +1 -0
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/data/index.d.ts +2 -2
- 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/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +382 -344
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +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 +3 -4
- package/dist/components/fields/DatePicker/DateInput.js.map +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 +3 -4
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +3 -4
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +3 -3
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +4 -5
- package/dist/components/fields/DatePicker/TimeInput.js.map +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.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 +77 -79
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.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/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +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 +36 -19
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +52 -37
- package/dist/components/fields/NumberInput/StepButton.js.map +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 +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.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/SliderBase.js.map +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/Slider/types.d.ts +0 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.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.d.ts +10 -0
- package/dist/components/fields/TextInput/TextInputBase.js +67 -55
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.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/ModernFormRoot.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/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +18 -2
- package/dist/components/form/Form/modern/store.js.map +1 -1
- package/dist/components/form/Form/modern/types.d.ts +5 -0
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.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/field-chrome.js +1 -1
- package/dist/components/form/field-layout.d.ts +12 -2
- package/dist/components/form/field-layout.js +29 -11
- package/dist/components/form/field-layout.js.map +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.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/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.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 +7 -3
- package/dist/components/navigation/Tabs/Tabs.js.map +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 +18 -18
- package/dist/components/navigation/Tabs/styled.js.map +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/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/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.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 +2 -2
- package/dist/components/overlays/AlertDialog/types.d.ts +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +9 -4
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.d.ts +7 -0
- package/dist/components/overlays/Dialog/DialogContainer.js +61 -32
- package/dist/components/overlays/Dialog/DialogContainer.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogForm.d.ts +7 -0
- package/dist/components/overlays/Dialog/DialogForm.js +10 -3
- package/dist/components/overlays/Dialog/DialogForm.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.d.ts +8 -0
- package/dist/components/overlays/Dialog/DialogTrigger.js +24 -11
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +213 -185
- package/dist/components/overlays/Dialog/ModernDialogForm.js.map +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/context.js.map +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +211 -0
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js.map +1 -0
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.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/Modal/modal-containment.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 +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/overlays/Tooltip/split-trigger-props.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 +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +25 -1
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +10 -2
- package/dist/i18n/locales/en-US/uikit.js +10 -2
- package/dist/i18n/locales/en-US/uikit.json.d.ts +11 -4
- package/dist/i18n/locales/es-ES/uikit.js +10 -2
- package/dist/i18n/locales/es-MX/uikit.js +10 -2
- package/dist/i18n/locales/fr-FR/uikit.js +10 -2
- package/dist/i18n/locales/it-IT/uikit.js +10 -2
- package/dist/i18n/locales/ja-JP/uikit.js +10 -2
- package/dist/i18n/locales/nb-NO/uikit.js +10 -2
- package/dist/i18n/locales/pt-BR/uikit.js +10 -2
- package/dist/i18n/locales/pt-PT/uikit.js +10 -2
- package/dist/i18n/locales/sv-SE/uikit.js +10 -2
- package/dist/i18n/locales/vi-VN/uikit.js +10 -2
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.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/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.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/PipetteIcon.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 -2
- package/dist/index.js +2 -2
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.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/colors.js +1 -1
- package/dist/utils/dotize.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/disabledProps.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/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.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/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.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/FieldProperties.md +16 -4
- package/docs/Usage.md +1 -1
- package/docs/components/data/ItemTable.md +25 -0
- package/docs/components/fields/ComboBox.md +8 -4
- package/docs/components/fields/CommandTextArea.md +1 -0
- package/docs/components/fields/HueSlider.md +0 -1
- package/docs/components/fields/NumberInput.md +4 -0
- package/docs/components/fields/PasswordInput.md +2 -0
- package/docs/components/fields/SearchInput.md +13 -0
- package/docs/components/fields/Slider.md +0 -1
- package/docs/components/fields/TextArea.md +1 -0
- package/docs/components/fields/TextInput.md +14 -1
- package/docs/components/navigation/Tabs.md +47 -0
- package/docs/components/overlays/Dialog.md +2 -2
- package/docs/components/overlays/DialogContainer.md +1 -0
- package/docs/components/overlays/DialogForm.md +3 -1
- package/docs/components/overlays/DialogTrigger.md +31 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { getDisabledElementProps, getInertInputProps } from "../../../utils/react/disabledProps.js";
|
|
4
4
|
import { mergeRefs as mergeRefs$1, useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -31,6 +31,10 @@ const ADD_STYLES = {
|
|
|
31
31
|
disabled: "$disabled-opacity"
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
+
const INPUT_RADIUS = {
|
|
35
|
+
"": true,
|
|
36
|
+
"shape=plain": 0
|
|
37
|
+
};
|
|
34
38
|
const INPUT_WRAPPER_STYLES = {
|
|
35
39
|
display: "grid",
|
|
36
40
|
flow: "row",
|
|
@@ -52,16 +56,20 @@ const INPUT_WRAPPER_STYLES = {
|
|
|
52
56
|
"": true,
|
|
53
57
|
readonly: "#border.5",
|
|
54
58
|
"readonly & @hc": true,
|
|
59
|
+
"shape=plain": "#clear",
|
|
60
|
+
"shape=plain & @hc": true,
|
|
55
61
|
valid: "#success-text.50",
|
|
56
62
|
invalid: "#danger-text.50",
|
|
57
63
|
focused: "#primary-text",
|
|
58
64
|
"valid & focused": "#success-text",
|
|
59
65
|
"invalid & focused": "#danger-text",
|
|
60
66
|
disabled: true,
|
|
67
|
+
"disabled & shape=plain": "#clear",
|
|
68
|
+
"disabled & shape=plain & @hc": true,
|
|
61
69
|
"disabled & focused": "#primary-text"
|
|
62
70
|
},
|
|
63
71
|
preset: "t3",
|
|
64
|
-
radius:
|
|
72
|
+
radius: INPUT_RADIUS,
|
|
65
73
|
cursor: "text",
|
|
66
74
|
color: {
|
|
67
75
|
"": "#dark-02",
|
|
@@ -119,7 +127,7 @@ const DEFAULT_INPUT_STYLES = {
|
|
|
119
127
|
placeSelf: "stretch",
|
|
120
128
|
width: "initial 100% 100%",
|
|
121
129
|
transition: "theme",
|
|
122
|
-
radius:
|
|
130
|
+
radius: INPUT_RADIUS,
|
|
123
131
|
padding: "$vertical-padding $right-padding $vertical-padding $left-padding",
|
|
124
132
|
textAlign: "left",
|
|
125
133
|
preset: "t3",
|
|
@@ -189,39 +197,40 @@ function preventPointerFocus(event) {
|
|
|
189
197
|
* `PasswordInput`, `NumberInput`, `SearchInput`, `CommandTextArea`).
|
|
190
198
|
*/
|
|
191
199
|
function TextInputBase(props, ref) {
|
|
192
|
-
const $ = c(
|
|
193
|
-
let { qa, mods, isInvalid, isValid, prefix: t0, isDisabled, isReadOnly, multiLine, autoFocus, inputProps: t1, wrapperProps, inputRef: t2, isLoading, loadingIndicator, value, inputStyles: t3, suffix, suffixPosition: t4, actions, wrapperRef, rows, size: t5, autoComplete, autocomplete, icon, maxLength, minLength, form, resize, tooltip, ...otherProps } = props;
|
|
200
|
+
const $ = c(28);
|
|
201
|
+
let { qa, mods, isInvalid, isValid, prefix: t0, isDisabled, isReadOnly, multiLine, autoFocus, inputProps: t1, wrapperProps, inputRef: t2, isLoading, loadingIndicator, value, inputStyles: t3, suffix, suffixPosition: t4, actions, wrapperRef, rows, size: t5, shape: t6, autoComplete, autocomplete, icon, maxLength, minLength, form, resize, tooltip, children, ...otherProps } = props;
|
|
194
202
|
let prefix = t0;
|
|
195
203
|
let inputProps = t1;
|
|
196
204
|
let inputRef = t2;
|
|
197
205
|
let inputStyles = t3 === void 0 ? {} : t3;
|
|
198
206
|
const suffixPosition = t4 === void 0 ? "before" : t4;
|
|
199
207
|
const size = t5 === void 0 ? "medium" : t5;
|
|
208
|
+
const shape = t6 === void 0 ? "default" : t6;
|
|
200
209
|
const { styles, field } = splitFieldLayout(props, { fillHeightOnFlex: !!multiLine });
|
|
201
210
|
const type = otherProps.type;
|
|
202
211
|
if (resize) inputStyles = mergeStyles(inputStyles, { resize });
|
|
203
212
|
const ElementType = multiLine ? "textarea" : "input";
|
|
204
213
|
const { isFocused, focusProps } = useFocus$1();
|
|
205
|
-
const
|
|
206
|
-
let
|
|
207
|
-
if ($[0] !==
|
|
208
|
-
|
|
209
|
-
$[0] =
|
|
210
|
-
$[1] =
|
|
211
|
-
} else
|
|
212
|
-
const { hoverProps, isHovered } = useHover(
|
|
214
|
+
const t7 = isDisabled || isReadOnly;
|
|
215
|
+
let t8;
|
|
216
|
+
if ($[0] !== t7) {
|
|
217
|
+
t8 = { isDisabled: t7 };
|
|
218
|
+
$[0] = t7;
|
|
219
|
+
$[1] = t8;
|
|
220
|
+
} else t8 = $[1];
|
|
221
|
+
const { hoverProps, isHovered } = useHover(t8);
|
|
213
222
|
const domRef = useObjectRef(wrapperRef);
|
|
214
223
|
inputRef = useCombinedRefs(inputRef);
|
|
215
|
-
let
|
|
224
|
+
let t9;
|
|
216
225
|
if ($[2] !== tooltip) {
|
|
217
|
-
|
|
226
|
+
t9 = {
|
|
218
227
|
tooltip,
|
|
219
228
|
children: null
|
|
220
229
|
};
|
|
221
230
|
$[2] = tooltip;
|
|
222
|
-
$[3] =
|
|
223
|
-
} else
|
|
224
|
-
const { renderWithTooltip, isTooltipActive } = useAutoTooltip(
|
|
231
|
+
$[3] = t9;
|
|
232
|
+
} else t9 = $[3];
|
|
233
|
+
const { renderWithTooltip, isTooltipActive } = useAutoTooltip(t9);
|
|
225
234
|
useImperativeHandle(ref, () => ({
|
|
226
235
|
...createFocusableRef(domRef, inputRef),
|
|
227
236
|
select() {
|
|
@@ -231,9 +240,9 @@ function TextInputBase(props, ref) {
|
|
|
231
240
|
return inputRef?.current;
|
|
232
241
|
}
|
|
233
242
|
}));
|
|
234
|
-
let
|
|
243
|
+
let t10;
|
|
235
244
|
if ($[4] !== isInvalid || $[5] !== isLoading || $[6] !== isValid) {
|
|
236
|
-
|
|
245
|
+
t10 = hasValidationIndicator({
|
|
237
246
|
isInvalid,
|
|
238
247
|
isValid,
|
|
239
248
|
isLoading
|
|
@@ -241,53 +250,54 @@ function TextInputBase(props, ref) {
|
|
|
241
250
|
$[4] = isInvalid;
|
|
242
251
|
$[5] = isLoading;
|
|
243
252
|
$[6] = isValid;
|
|
244
|
-
$[7] =
|
|
245
|
-
} else
|
|
246
|
-
const showValidationIndicator =
|
|
253
|
+
$[7] = t10;
|
|
254
|
+
} else t10 = $[7];
|
|
255
|
+
const showValidationIndicator = t10;
|
|
247
256
|
if (!inputProps?.placeholder) {
|
|
248
257
|
if (!inputProps) inputProps = {};
|
|
249
258
|
inputProps.placeholder = " ";
|
|
250
259
|
}
|
|
251
260
|
if (icon) {
|
|
252
|
-
let
|
|
261
|
+
let t11;
|
|
253
262
|
if ($[8] !== icon) {
|
|
254
|
-
|
|
263
|
+
t11 = /* @__PURE__ */ jsx("div", {
|
|
255
264
|
"data-element": "InputIcon",
|
|
256
265
|
children: icon
|
|
257
266
|
});
|
|
258
267
|
$[8] = icon;
|
|
259
|
-
$[9] =
|
|
260
|
-
} else
|
|
261
|
-
icon =
|
|
268
|
+
$[9] = t11;
|
|
269
|
+
} else t11 = $[9];
|
|
270
|
+
icon = t11;
|
|
262
271
|
if (prefix) prefix = /* @__PURE__ */ jsxs(Fragment$1, { children: [icon, prefix] });
|
|
263
272
|
else prefix = icon;
|
|
264
273
|
}
|
|
265
|
-
let
|
|
274
|
+
let t11;
|
|
266
275
|
if ($[10] !== isInvalid || $[11] !== isValid) {
|
|
267
|
-
|
|
276
|
+
t11 = getValidationMods({
|
|
268
277
|
isInvalid,
|
|
269
278
|
isValid
|
|
270
279
|
});
|
|
271
280
|
$[10] = isInvalid;
|
|
272
281
|
$[11] = isValid;
|
|
273
|
-
$[12] =
|
|
274
|
-
} else
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
let
|
|
280
|
-
if ($[13] !== isDisabled || $[14] !== isFocused || $[15] !== isHovered || $[16] !== mods || $[17] !== multiLine || $[18] !==
|
|
281
|
-
|
|
282
|
-
...
|
|
283
|
-
loadable:
|
|
282
|
+
$[12] = t11;
|
|
283
|
+
} else t11 = $[12];
|
|
284
|
+
const t12 = !!loadingIndicator;
|
|
285
|
+
const t13 = !!isReadOnly;
|
|
286
|
+
const t14 = !!prefix;
|
|
287
|
+
const t15 = showValidationIndicator || !!suffix || !!actions;
|
|
288
|
+
let t16;
|
|
289
|
+
if ($[13] !== isDisabled || $[14] !== isFocused || $[15] !== isHovered || $[16] !== mods || $[17] !== multiLine || $[18] !== shape || $[19] !== t11 || $[20] !== t12 || $[21] !== t13 || $[22] !== t14 || $[23] !== t15) {
|
|
290
|
+
t16 = {
|
|
291
|
+
...t11,
|
|
292
|
+
loadable: t12,
|
|
284
293
|
focused: isFocused,
|
|
285
294
|
hovered: isHovered,
|
|
286
295
|
disabled: isDisabled,
|
|
287
|
-
readonly:
|
|
296
|
+
readonly: t13,
|
|
288
297
|
multiline: multiLine,
|
|
289
|
-
prefix:
|
|
290
|
-
suffix:
|
|
298
|
+
prefix: t14,
|
|
299
|
+
suffix: t15,
|
|
300
|
+
shape,
|
|
291
301
|
...mods
|
|
292
302
|
};
|
|
293
303
|
$[13] = isDisabled;
|
|
@@ -295,30 +305,31 @@ function TextInputBase(props, ref) {
|
|
|
295
305
|
$[15] = isHovered;
|
|
296
306
|
$[16] = mods;
|
|
297
307
|
$[17] = multiLine;
|
|
298
|
-
$[18] =
|
|
308
|
+
$[18] = shape;
|
|
299
309
|
$[19] = t11;
|
|
300
310
|
$[20] = t12;
|
|
301
311
|
$[21] = t13;
|
|
302
312
|
$[22] = t14;
|
|
303
313
|
$[23] = t15;
|
|
304
|
-
|
|
305
|
-
|
|
314
|
+
$[24] = t16;
|
|
315
|
+
} else t16 = $[24];
|
|
316
|
+
const modifiers = t16;
|
|
306
317
|
const resolvedAutoComplete = autoComplete ?? autocomplete ?? inputProps.autoComplete;
|
|
307
318
|
const resolvedAutoFocus = autoFocus ?? inputProps.autoFocus;
|
|
308
319
|
const textSecurityStyles = multiLine && type === "password" && inputProps.value?.length ? { fontFamily: "text-security-disc" } : {};
|
|
309
320
|
const isInputDisabled = !!(isDisabled ?? inputProps.disabled);
|
|
310
|
-
let
|
|
311
|
-
if ($[
|
|
312
|
-
|
|
321
|
+
let t17;
|
|
322
|
+
if ($[25] !== isInputDisabled || $[26] !== isTooltipActive) {
|
|
323
|
+
t17 = getDisabledElementProps({
|
|
313
324
|
isDisabled: isInputDisabled,
|
|
314
325
|
keepEvents: isTooltipActive,
|
|
315
326
|
as: "input"
|
|
316
327
|
});
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
} else
|
|
321
|
-
const { isInert } =
|
|
328
|
+
$[25] = isInputDisabled;
|
|
329
|
+
$[26] = isTooltipActive;
|
|
330
|
+
$[27] = t17;
|
|
331
|
+
} else t17 = $[27];
|
|
332
|
+
const { isInert } = t17;
|
|
322
333
|
let ownInputProps = mergeProps$1(inputProps, focusProps, hoverProps);
|
|
323
334
|
if (isInert) ownInputProps = mergeProps$1(getInertInputProps(mergeProps$1({
|
|
324
335
|
...inputProps,
|
|
@@ -359,6 +370,7 @@ function TextInputBase(props, ref) {
|
|
|
359
370
|
maxLength: maxLength ?? inputProps.maxLength,
|
|
360
371
|
minLength: minLength ?? inputProps.minLength
|
|
361
372
|
}),
|
|
373
|
+
children,
|
|
362
374
|
showValidationIndicator || suffix || actions ? /* @__PURE__ */ jsxs("div", {
|
|
363
375
|
"data-element": "Suffix",
|
|
364
376
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInputBase.js","names":["useObjectRef","createFocusableRef","BaseProps","mergeStyles","Styles","tasty","FocusEventHandler","forwardRef","MouseEvent","ReactElement","ReactNode","RefObject","useImperativeHandle","AriaNumberFieldProps","AriaTextFieldProps","useHover","FieldBaseProps","TextFieldKeyboardProps","mergeProps","mergeRefs","useCombinedRefs","getDisabledElementProps","getInertInputProps","useFocus","useAutoTooltip","getValidationMods","hasValidationIndicator","ValidationIndicator","wrapWithField","FieldLayoutStyleProps","splitFieldLayout","mergeTooltipFocusProps","splitTooltipTriggerProps","Props","CubeTooltipProviderProps","ADD_STYLES","$","display","placeContent","placeItems","gridRows","flow","gap","cursor","opacity","disabled","INPUT_WRAPPER_STYLES","position","gridColumns","prefix","suffix","fill","readonly","border","valid","invalid","focused","preset","radius","color","zIndex","boxSizing","transition","backgroundClip","height","multiline","$size","Prefix","Suffix","State","InputIcon","width","fontSize","ValidationIcon","InputWrapperElement","qa","styles","DEFAULT_INPUT_STYLES","recipe","placeSelf","padding","textAlign","flexGrow","margin","resize","userSelect","Placeholder","InputElement","INTERACTIVE_ELEMENTS","focusInputOnBoxPress","event","HTMLElement","input","HTMLInputElement","HTMLTextAreaElement","button","defaultPrevented","getAttribute","box","currentTarget","target","Element","contains","interactive","closest","preventDefault","focus","preventPointerFocus","CubeTextInputBaseProps","Omit","validate","onFocus","onBlur","icon","suffixPosition","actions","multiLine","autoFocus","inputProps","wrapperProps","inputRef","wrapperRef","HTMLDivElement","isLoading","loadingIndicator","inputStyles","rows","size","autoComplete","autocomplete","tooltip","CubeBufferedValueProps","isBuffered","TextInputBase","props","ref","_c","mods","isInvalid","isValid","t0","isDisabled","isReadOnly","t1","t2","value","t3","t4","t5","maxLength","minLength","form","otherProps","undefined","field","fillHeightOnFlex","type","ElementType","isFocused","focusProps","t6","t7","hoverProps","isHovered","domRef","t8","children","renderWithTooltip","isTooltipActive","select","current","getInputElement","t9","showValidationIndicator","placeholder","t10","t11","t12","t13","t14","t15","loadable","hovered","modifiers","resolvedAutoComplete","resolvedAutoFocus","hasTextSecurity","textSecurityStyles","length","fontFamily","isInputDisabled","t16","keepEvents","as","isInert","ownInputProps","excludeFromTabOrder","readOnly","onMouseDown","textField","tooltipTriggerProps","tooltipRef","pointerProps","tooltipFocusProps","labelProps","htmlFor","for","_TextInputBase","_c","useFocus","mergeProps","mergeRefs"],"sources":["../../../../src/components/fields/TextInput/TextInputBase.tsx"],"sourcesContent":["import { useObjectRef } from '@react-aria/utils';\nimport { createFocusableRef } from '@react-spectrum/utils';\nimport { BaseProps, mergeStyles, Styles, tasty } from '@tenphi/tasty';\nimport {\n FocusEventHandler,\n forwardRef,\n MouseEvent,\n ReactElement,\n ReactNode,\n RefObject,\n useImperativeHandle,\n} from 'react';\nimport { AriaNumberFieldProps, AriaTextFieldProps, useHover } from 'react-aria';\n\nimport { FieldBaseProps, TextFieldKeyboardProps } from '../../../shared';\nimport { mergeProps, mergeRefs, useCombinedRefs } from '../../../utils/react';\nimport {\n getDisabledElementProps,\n getInertInputProps,\n} from '../../../utils/react/disabledProps';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { useAutoTooltip } from '../../content/use-auto-tooltip';\nimport {\n getValidationMods,\n hasValidationIndicator,\n ValidationIndicator,\n wrapWithField,\n} from '../../form';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport {\n mergeTooltipFocusProps,\n splitTooltipTriggerProps,\n} from '../../overlays/Tooltip/split-trigger-props';\n\nimport type { Props } from '../../../props';\nimport type { CubeTooltipProviderProps } from '../../overlays/Tooltip/TooltipProvider';\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 readonly: '#surface-2',\n disabled: '#disabled-surface',\n },\n border: {\n '': true,\n readonly: '#border.5',\n // High contrast keeps the full outline it raises for every field.\n 'readonly & @hc': 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 // Only an input kept focusable for its tooltip is focused while disabled,\n // and only from the keyboard: the pointer can't focus it.\n 'disabled & focused': '#primary-text',\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\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 // The browser's own for a disabled input, which an input kept focusable for\n // its tooltip doesn't get: it is read-only, not natively disabled.\n cursor: {\n '': 'text',\n disabled: 'default',\n },\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\nconst INTERACTIVE_ELEMENTS =\n 'a[href], button, input, select, textarea, [tabindex], [contenteditable]';\n\n/**\n * A press inside the field box but outside the input — the prefix or suffix area, an icon, a\n * textarea's margins — focuses the input, as a press anywhere in a native field does. Presses on\n * the input itself and on interactive children, such as a clear button or the steppers, stay\n * theirs.\n */\nfunction focusInputOnBoxPress(\n event: MouseEvent<HTMLElement>,\n input: HTMLInputElement | HTMLTextAreaElement | null | undefined,\n) {\n if (event.button !== 0 || event.defaultPrevented) return;\n // An input kept focusable for its tooltip is still disabled to the pointer.\n if (\n !input ||\n input.disabled ||\n input.getAttribute('aria-disabled') === 'true'\n ) {\n return;\n }\n\n const box = event.currentTarget;\n const target = event.target as Element;\n\n // React bubbles presses from a portal (a popover opened from a field action)\n // through the box; those belong to the portal.\n if (!box.contains(target)) return;\n\n const interactive = target.closest(INTERACTIVE_ELEMENTS);\n\n if (interactive && box.contains(interactive)) return;\n\n // The default action would move focus to the press target first, blurring the input.\n event.preventDefault();\n input.focus();\n}\n\n/** A press doesn't focus a natively disabled input, so it doesn't focus an inert one either. */\nfunction preventPointerFocus(event: MouseEvent<HTMLElement>) {\n event.preventDefault();\n}\n\nexport interface CubeTextInputBaseProps\n extends\n BaseProps,\n FieldLayoutStyleProps,\n Omit<\n AriaTextFieldProps<HTMLInputElement | HTMLTextAreaElement>,\n | 'validate'\n | 'form'\n | 'name'\n | 'errorMessage'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onFocus'\n | 'onBlur'\n >,\n TextFieldKeyboardProps,\n FieldBaseProps {\n validate?: AriaTextFieldProps['validate'] | AriaNumberFieldProps['validate'];\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\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 /**\n * Controls placed last in the suffix, after the validation and loading\n * statuses and after `suffix` whatever its position, such as a popover\n * trigger.\n */\n actions?: ReactNode;\n /** Whether the input is multiline */\n multiLine?: boolean;\n /** Whether the input should have autofocus */\n autoFocus?: boolean;\n /**\n * Direct input props. The explicit props above (`isDisabled`, `maxLength`, `minLength`,\n * `autoFocus`, `rows`, `autoComplete`) win over the same attributes here when they are set; an\n * unset one leaves the value given here in place.\n */\n inputProps?: Props;\n /** Direct input wrapper props */\n wrapperProps?: Props;\n /** The input ref */\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>;\n /** The wrapper ref */\n wrapperRef?: RefObject<HTMLDivElement | null>;\n /** Whether the input has the loading status */\n isLoading?: boolean;\n /** Rendered in place of the default loading icon while `isLoading` is set */\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 /**\n * What kind of autofill the browser may offer for the input, as the HTML `autocomplete` token\n * (`email`, `current-password`, `off`, …). See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete).\n */\n autoComplete?: string;\n /**\n * @deprecated Use `autoComplete` instead. Kept as an alias so existing callers keep working;\n * `autoComplete` wins when both are set.\n */\n autocomplete?: string;\n /**\n * The input's own tooltip: a short hint, such as what the value means or defaults to, or why the\n * field is disabled. It opens on hover over the field box and on keyboard focus, and describes\n * the input. A disabled input with a tooltip stays focusable, so the keyboard reaches it too. A\n * string, or `TooltipProvider` props (`title`, `placement`, …). Never the field's name, an error\n * or anything needed to fill the field in: touch users don't see it. The info badge next to a\n * field label is `labelTooltip`.\n */\n tooltip?: string | Omit<CubeTooltipProviderProps, 'children'>;\n}\n\n/**\n * Mixed into the fields that actually buffer their value — `TextInput`, `TextArea`,\n * `PasswordInput`, `SearchInput` — rather than declared on `CubeTextInputBaseProps`. Every field\n * built on that base would otherwise inherit the prop, including `NumberInput` and\n * `CommandTextArea`, which keep their own text and ignore it: a public API that accepts a flag and\n * does nothing with it.\n */\nexport interface CubeBufferedValueProps {\n /**\n * Whether the typed text is held locally until the controlled `value` catches up. On by default,\n * which is what keeps the caret in place when the value round-trips through a store that\n * re-renders a pass late. Set to `false` for a caller that must see the value snap back to its\n * own `value` prop the instant it declines a keystroke. See `useBufferedValue`.\n */\n isBuffered?: boolean;\n}\n\n/**\n * The presentational base for text-like inputs. It renders the input chrome and the field wrapper, but\n * never wires form state — that is the job of the component rendering it (`TextInput`, `TextArea`,\n * `PasswordInput`, `NumberInput`, `SearchInput`, `CommandTextArea`).\n */\nfunction TextInputBase(props: CubeTextInputBaseProps, ref) {\n let {\n qa,\n mods,\n isInvalid,\n isValid,\n prefix,\n isDisabled,\n isReadOnly,\n multiLine,\n autoFocus,\n inputProps,\n wrapperProps,\n inputRef,\n isLoading,\n loadingIndicator,\n value,\n inputStyles = {},\n suffix,\n suffixPosition = 'before',\n actions,\n wrapperRef,\n rows,\n size = 'medium',\n autoComplete,\n autocomplete,\n icon,\n maxLength,\n minLength,\n form,\n resize,\n tooltip,\n ...otherProps\n } = props;\n\n // A text area grows with its flex line when bare, so it fills a field\n // sized by flex props too.\n const { styles, field } = splitFieldLayout(props, {\n fillHeightOnFlex: !!multiLine,\n });\n let type = otherProps.type;\n\n if (resize) {\n // oxlint-disable-next-line tasty/no-runtime-styles-mutation -- forwards the consumer's `resize` prop\n inputStyles = mergeStyles(inputStyles, { resize });\n }\n\n let ElementType: 'textarea' | 'input' = multiLine ? 'textarea' : 'input';\n let { isFocused, focusProps } = useFocus();\n // A read-only field takes no hover state: nothing it could change would follow.\n let { hoverProps, isHovered } = useHover({\n isDisabled: isDisabled || isReadOnly,\n });\n // The input box, with or without the field chrome, so the field's ref never\n // resolves to `null`; `wrapperRef` reaches the same element.\n let domRef = useObjectRef(wrapperRef);\n\n inputRef = useCombinedRefs(inputRef);\n\n let { renderWithTooltip, isTooltipActive } = useAutoTooltip({\n tooltip,\n children: null,\n });\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 const showValidationIndicator = hasValidationIndicator({\n isInvalid,\n isValid,\n isLoading,\n });\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 = {\n ...getValidationMods({ isInvalid, isValid }),\n loadable: !!loadingIndicator,\n focused: isFocused,\n hovered: isHovered,\n disabled: isDisabled,\n readonly: !!isReadOnly,\n multiline: multiLine,\n prefix: !!prefix,\n suffix: showValidationIndicator || !!suffix || !!actions,\n ...mods,\n };\n\n // The explicit props win when they are set; an unset one falls back to the merged `inputProps`\n // instead of overwriting it with `undefined`. For `autoComplete` that keeps both a caller's\n // `inputProps={{ autoComplete }}` and `useNumberField`'s own `off`. `autocomplete` is the\n // deprecated alias.\n const resolvedAutoComplete =\n autoComplete ?? autocomplete ?? inputProps.autoComplete;\n const resolvedAutoFocus = autoFocus ?? inputProps.autoFocus;\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 isInputDisabled = !!(isDisabled ?? inputProps.disabled);\n\n // A disabled input with a tooltip keeps its focus, as `Checkbox` and `Switch` do: the tooltip is\n // usually the reason it is disabled, and focus is how the keyboard opens it. It is\n // `aria-disabled` and read-only instead, and the pointer still can't focus it.\n const { isInert } = getDisabledElementProps({\n isDisabled: isInputDisabled,\n keepEvents: isTooltipActive,\n as: 'input',\n });\n\n let ownInputProps = mergeProps(inputProps, focusProps, hoverProps);\n\n if (isInert) {\n ownInputProps = mergeProps(\n getInertInputProps(\n mergeProps(\n // The field's own focus handlers never run on a natively disabled input, and\n // `useNumberField` commits on blur: it would round a value the user can't edit.\n { ...inputProps, onFocus: undefined, onBlur: undefined },\n focusProps,\n hoverProps,\n ),\n { excludeFromTabOrder: props.excludeFromTabOrder },\n ),\n { readOnly: true, onMouseDown: preventPointerFocus },\n );\n }\n\n // The field box takes the tooltip's hover side and positions it, so it\n // covers the prefix, suffix and steppers and never the text being typed. The\n // input, where keyboard focus lands, takes the focus side. The box keeps the\n // field's ref, which `wrapperRef` also reaches.\n const textField = renderWithTooltip((tooltipTriggerProps, tooltipRef) => {\n const { pointerProps, focusProps: tooltipFocusProps } =\n splitTooltipTriggerProps(tooltipTriggerProps);\n\n return (\n <InputWrapperElement\n ref={tooltipRef ? mergeRefs(domRef, tooltipRef) : domRef}\n mods={modifiers}\n data-size={size}\n styles={styles}\n {...mergeProps(wrapperProps, pointerProps, {\n onMouseDown: (event: MouseEvent<HTMLElement>) =>\n focusInputOnBoxPress(event, inputRef?.current),\n })}\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 {...mergeTooltipFocusProps(ownInputProps, tooltipFocusProps)}\n ref={inputRef}\n rows={multiLine ? (rows ?? inputProps.rows ?? 1) : inputProps.rows}\n mods={modifiers}\n // oxlint-disable-next-line tasty/no-style-prop -- `preset` owns font-family, and a `fontFamily` state map would replace the preset's in every state\n style={textSecurityStyles}\n {...(resolvedAutoFocus ? { 'data-autofocus': '' } : undefined)}\n autoFocus={resolvedAutoFocus}\n data-size={size}\n autoComplete={resolvedAutoComplete}\n styles={inputStyles}\n disabled={isInputDisabled && !isInert}\n maxLength={maxLength ?? inputProps.maxLength}\n minLength={minLength ?? inputProps.minLength}\n />\n {showValidationIndicator || suffix || actions ? (\n <div data-element=\"Suffix\">\n {suffixPosition === 'before' ? suffix : null}\n {isLoading && loadingIndicator ? (\n <div data-element=\"State\">{loadingIndicator}</div>\n ) : (\n <ValidationIndicator\n isInvalid={isInvalid}\n isValid={isValid}\n isLoading={isLoading}\n />\n )}\n {suffixPosition === 'after' ? suffix : null}\n {actions}\n </div>\n ) : null}\n </InputWrapperElement>\n );\n }, 'top');\n\n // `renderWithTooltip` is typed for any node; here it returns an element.\n // `tooltip` is the input's own, not the legacy spelling of `labelTooltip`.\n return wrapWithField(textField as ReactElement, {\n ...props,\n ...field,\n tooltip: undefined,\n // A click on its label doesn't focus a natively disabled input either. The input keeps its\n // name through `aria-labelledby`.\n ...(isInert\n ? {\n labelProps: {\n ...props.labelProps,\n htmlFor: undefined,\n for: undefined,\n },\n }\n : null),\n });\n}\n\nconst _TextInputBase = forwardRef(TextInputBase);\n\nexport { _TextInputBase as TextInputBase };\nexport type { AriaTextFieldProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,MAAMmC,aAAa;CACjBC,GAAG;CACHC,SAAS;CACTC,cAAc;CACdC,YAAY;CACZC,UAAU;CACVC,MAAM;CACNC,KAAK;CACLC,QAAQ;CACRC,SAAS;EACP,IAAI;EACJC,UAAU;CACZ;AACF;AAEA,MAAaC,uBAA+B;CAC1CT,SAAS;CACTI,MAAM;CACNM,UAAU;CACVC,aAAa;EACX,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACR,mBAAmB;CACrB;CACAV,UAAU;CACVD,YAAY;CACZY,MAAM;EACJ,IAAI;EACJC,UAAU;EACVP,UAAU;CACZ;CACAQ,QAAQ;EACN,IAAI;EACJD,UAAU;EAEV,kBAAkB;EAClBE,OAAO;EACPC,SAAS;EACTC,SAAS;EACT,mBAAmB;EACnB,qBAAqB;EACrBX,UAAU;EAGV,sBAAsB;CACxB;CACAY,QAAQ;CACRC,QAAQ;CACRf,QAAQ;CACRgB,OAAO;EACL,IAAI;EACJH,SAAS;EACTD,SAAS;EACTV,UAAU;CACZ;CACAe,QAAQ;EACN,IAAI;EACJJ,SAAS;CACX;CACAK,WAAW;CACXC,YAAY;CACZC,gBAAgB;CAChBC,QAAQ;EACN,IAAI;EACJC,WAAW;CACb;CAEAC,OAAO;EACL,IAAI;EACJ,cAAc;EACd,eAAe;EACf,cAAc;CAChB;CAEAC,QAAQhC;CAERiC,QAAQjC;CAERkC,OAAO;EACLjC,GAAG;EACHC,SAAS;CACX;CAEAiC,WAAW;EACTjC,SAAS;EACTE,YAAY;EACZgC,OAAO;EACPZ,OAAO;EACPa,UAAU;CACZ;CAEAC,gBAAgB;EACdrC,GAAG;EACHC,SAAS;EACTE,YAAY;EACZgC,OAAO;GACL,IAAI;GACJrB,QAAQ;EACV;EACAsB,UAAU;CACZ;AACF;AAEA,MAAME,sBAAsBrE,MAAM;CAChC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KACN3D,QAAAA;KACE,UAAAiE,mBAAA,CAAoBI;KACnB,WAAA7C,aAAa/B,WAAU+B;KACvB,WAAAC,aAAahC,WAAUgC;IAAU,CAAA;IAE7CuB,2BAAA3H,UAAAiE,UACC,qBAAA,OAAA;KAAkB,gBAAA;KAAlB,UAAA;MACGD,mBAAmB,WAAnBhE,SAAA;MACAyE,aAAAC,mBACC,oBAAA,OAAA;OAAkB,gBAAA;OAASA,UAAAA;MAAuB,CAAA,IAElD,oBAAC,qBAAD;OACac;OACFC;OACEhB;MAAS,CAAA;MAGvBT,mBAAmB,UAAnBhE,SAAA;MACAiE;KACG;IAdP,CAAA,IAAA;GA9BiB;;CA8CE,GAEvB,KAAK;CAAE,OAIHvF,cAAc2K,WAA2B;EAAA,GAC3CjE;EAAK,GACLoB;EAAKxB,SACCuB,KAAAA;EAAS,GAGdyC,UAAA,EAAAU,YAEc;GAAA,GACPtE,MAAKsE;GAAWC,SACVpD,KAAAA;GAASqD,KACbrD,KAAAA;EACP,EAEC,IARH;CASN,CAAC;AAAC;AAGJ,MAAMsD,iBAAiBxM,WAAW8H,aAAa"}
|
|
1
|
+
{"version":3,"file":"TextInputBase.js","names":["useObjectRef","createFocusableRef","BaseProps","mergeStyles","Styles","tasty","FocusEventHandler","forwardRef","MouseEvent","ReactElement","ReactNode","RefObject","useImperativeHandle","AriaNumberFieldProps","AriaTextFieldProps","useHover","FieldBaseProps","TextFieldKeyboardProps","mergeProps","mergeRefs","useCombinedRefs","getDisabledElementProps","getInertInputProps","useFocus","useAutoTooltip","getValidationMods","hasValidationIndicator","ValidationIndicator","wrapWithField","FieldLayoutStyleProps","splitFieldLayout","mergeTooltipFocusProps","splitTooltipTriggerProps","Props","CubeTooltipProviderProps","ADD_STYLES","$","display","placeContent","placeItems","gridRows","flow","gap","cursor","opacity","disabled","INPUT_RADIUS","INPUT_WRAPPER_STYLES","position","gridColumns","prefix","suffix","fill","readonly","border","valid","invalid","focused","preset","radius","color","zIndex","boxSizing","transition","backgroundClip","height","multiline","$size","Prefix","Suffix","State","InputIcon","width","fontSize","ValidationIcon","InputWrapperElement","qa","styles","DEFAULT_INPUT_STYLES","recipe","placeSelf","padding","textAlign","flexGrow","margin","resize","userSelect","Placeholder","InputElement","INTERACTIVE_ELEMENTS","focusInputOnBoxPress","event","HTMLElement","input","HTMLInputElement","HTMLTextAreaElement","button","defaultPrevented","getAttribute","box","currentTarget","target","Element","contains","interactive","closest","preventDefault","focus","preventPointerFocus","CubeTextInputBaseProps","Omit","validate","onFocus","onBlur","icon","suffixPosition","actions","multiLine","autoFocus","inputProps","wrapperProps","inputRef","wrapperRef","HTMLDivElement","isLoading","loadingIndicator","inputStyles","rows","size","shape","autoComplete","autocomplete","tooltip","CubeBufferedValueProps","isBuffered","TextInputBase","props","ref","_c","mods","isInvalid","isValid","t0","isDisabled","isReadOnly","t1","t2","value","t3","t4","t5","t6","maxLength","minLength","form","children","otherProps","undefined","field","fillHeightOnFlex","type","ElementType","isFocused","focusProps","t7","t8","hoverProps","isHovered","domRef","t9","renderWithTooltip","isTooltipActive","select","current","getInputElement","t10","showValidationIndicator","placeholder","t11","t12","t13","t14","t15","t16","loadable","hovered","modifiers","resolvedAutoComplete","resolvedAutoFocus","hasTextSecurity","textSecurityStyles","length","fontFamily","isInputDisabled","t17","keepEvents","as","isInert","ownInputProps","excludeFromTabOrder","readOnly","onMouseDown","textField","tooltipTriggerProps","tooltipRef","pointerProps","tooltipFocusProps","labelProps","htmlFor","for","_TextInputBase","_c","useFocus","mergeProps","mergeRefs"],"sources":["../../../../src/components/fields/TextInput/TextInputBase.tsx"],"sourcesContent":["import { useObjectRef } from '@react-aria/utils';\nimport { createFocusableRef } from '@react-spectrum/utils';\nimport { BaseProps, mergeStyles, Styles, tasty } from '@tenphi/tasty';\nimport {\n FocusEventHandler,\n forwardRef,\n MouseEvent,\n ReactElement,\n ReactNode,\n RefObject,\n useImperativeHandle,\n} from 'react';\nimport { AriaNumberFieldProps, AriaTextFieldProps, useHover } from 'react-aria';\n\nimport { FieldBaseProps, TextFieldKeyboardProps } from '../../../shared';\nimport { mergeProps, mergeRefs, useCombinedRefs } from '../../../utils/react';\nimport {\n getDisabledElementProps,\n getInertInputProps,\n} from '../../../utils/react/disabledProps';\nimport { useFocus } from '../../../utils/react/interactions';\nimport { useAutoTooltip } from '../../content/use-auto-tooltip';\nimport {\n getValidationMods,\n hasValidationIndicator,\n ValidationIndicator,\n wrapWithField,\n} from '../../form';\nimport {\n FieldLayoutStyleProps,\n splitFieldLayout,\n} from '../../form/field-layout';\nimport {\n mergeTooltipFocusProps,\n splitTooltipTriggerProps,\n} from '../../overlays/Tooltip/split-trigger-props';\n\nimport type { Props } from '../../../props';\nimport type { CubeTooltipProviderProps } from '../../overlays/Tooltip/TooltipProvider';\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\n// The field box and its input share the corners: a plain box is square.\nconst INPUT_RADIUS = {\n '': true,\n 'shape=plain': 0,\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 readonly: '#surface-2',\n disabled: '#disabled-surface',\n },\n border: {\n '': true,\n readonly: '#border.5',\n // High contrast keeps the full outline it raises for every field.\n 'readonly & @hc': true,\n // A plain field sits flush in a container that draws its edges. Its border\n // keeps its width, so nothing shifts, and shows only to mark focus or\n // validity, and in high contrast.\n 'shape=plain': '#clear',\n 'shape=plain & @hc': 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 'disabled & shape=plain': '#clear',\n 'disabled & shape=plain & @hc': true,\n // Only an input kept focusable for its tooltip is focused while disabled,\n // and only from the keyboard: the pointer can't focus it.\n 'disabled & focused': '#primary-text',\n },\n preset: 't3',\n radius: INPUT_RADIUS,\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\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: INPUT_RADIUS,\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 // The browser's own for a disabled input, which an input kept focusable for\n // its tooltip doesn't get: it is read-only, not natively disabled.\n cursor: {\n '': 'text',\n disabled: 'default',\n },\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\nconst INTERACTIVE_ELEMENTS =\n 'a[href], button, input, select, textarea, [tabindex], [contenteditable]';\n\n/**\n * A press inside the field box but outside the input — the prefix or suffix area, an icon, a\n * textarea's margins — focuses the input, as a press anywhere in a native field does. Presses on\n * the input itself and on interactive children, such as a clear button or the steppers, stay\n * theirs.\n */\nfunction focusInputOnBoxPress(\n event: MouseEvent<HTMLElement>,\n input: HTMLInputElement | HTMLTextAreaElement | null | undefined,\n) {\n if (event.button !== 0 || event.defaultPrevented) return;\n // An input kept focusable for its tooltip is still disabled to the pointer.\n if (\n !input ||\n input.disabled ||\n input.getAttribute('aria-disabled') === 'true'\n ) {\n return;\n }\n\n const box = event.currentTarget;\n const target = event.target as Element;\n\n // React bubbles presses from a portal (a popover opened from a field action)\n // through the box; those belong to the portal.\n if (!box.contains(target)) return;\n\n const interactive = target.closest(INTERACTIVE_ELEMENTS);\n\n if (interactive && box.contains(interactive)) return;\n\n // The default action would move focus to the press target first, blurring the input.\n event.preventDefault();\n input.focus();\n}\n\n/** A press doesn't focus a natively disabled input, so it doesn't focus an inert one either. */\nfunction preventPointerFocus(event: MouseEvent<HTMLElement>) {\n event.preventDefault();\n}\n\nexport interface CubeTextInputBaseProps\n extends\n BaseProps,\n FieldLayoutStyleProps,\n Omit<\n AriaTextFieldProps<HTMLInputElement | HTMLTextAreaElement>,\n | 'validate'\n | 'form'\n | 'name'\n | 'errorMessage'\n | 'onKeyDown'\n | 'onKeyUp'\n | 'onFocus'\n | 'onBlur'\n >,\n TextFieldKeyboardProps,\n FieldBaseProps {\n validate?: AriaTextFieldProps['validate'] | AriaNumberFieldProps['validate'];\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\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 /**\n * Controls placed last in the suffix, after the validation and loading\n * statuses and after `suffix` whatever its position, such as a popover\n * trigger.\n */\n actions?: ReactNode;\n /** Whether the input is multiline */\n multiLine?: boolean;\n /** Whether the input should have autofocus */\n autoFocus?: boolean;\n /**\n * Direct input props. The explicit props above (`isDisabled`, `maxLength`, `minLength`,\n * `autoFocus`, `rows`, `autoComplete`) win over the same attributes here when they are set; an\n * unset one leaves the value given here in place.\n */\n inputProps?: Props;\n /** Direct input wrapper props */\n wrapperProps?: Props;\n /** The input ref */\n inputRef?: RefObject<HTMLInputElement | HTMLTextAreaElement | null>;\n /** The wrapper ref */\n wrapperRef?: RefObject<HTMLDivElement | null>;\n /** Whether the input has the loading status */\n isLoading?: boolean;\n /** Rendered in place of the default loading icon while `isLoading` is set */\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 /**\n * The shape of the field box.\n * - `default` - rounded, with a border.\n * - `plain` - square, with no border at rest, for a field set flush in a\n * container that draws its edges, such as a toolbar or a panel header. The\n * border keeps its width, and shows on focus and in a valid or invalid\n * state.\n * @default \"default\"\n */\n shape?: 'default' | 'plain';\n /**\n * What kind of autofill the browser may offer for the input, as the HTML `autocomplete` token\n * (`email`, `current-password`, `off`, …). See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete).\n */\n autoComplete?: string;\n /**\n * @deprecated Use `autoComplete` instead. Kept as an alias so existing callers keep working;\n * `autoComplete` wins when both are set.\n */\n autocomplete?: string;\n /**\n * The input's own tooltip: a short hint, such as what the value means or defaults to, or why the\n * field is disabled. It opens on hover over the field box and on keyboard focus, and describes\n * the input. A disabled input with a tooltip stays focusable, so the keyboard reaches it too. A\n * string, or `TooltipProvider` props (`title`, `placement`, …). Never the field's name, an error\n * or anything needed to fill the field in: touch users don't see it. The info badge next to a\n * field label is `labelTooltip`.\n */\n tooltip?: string | Omit<CubeTooltipProviderProps, 'children'>;\n}\n\n/**\n * Mixed into the fields that actually buffer their value — `TextInput`, `TextArea`,\n * `PasswordInput`, `SearchInput` — rather than declared on `CubeTextInputBaseProps`. Every field\n * built on that base would otherwise inherit the prop, including `NumberInput` and\n * `CommandTextArea`, which keep their own text and ignore it: a public API that accepts a flag and\n * does nothing with it.\n */\nexport interface CubeBufferedValueProps {\n /**\n * Whether the typed text is held locally until the controlled `value` catches up. On by default,\n * which is what keeps the caret in place when the value round-trips through a store that\n * re-renders a pass late. Set to `false` for a caller that must see the value snap back to its\n * own `value` prop the instant it declines a keystroke. See `useBufferedValue`.\n */\n isBuffered?: boolean;\n}\n\n/**\n * The presentational base for text-like inputs. It renders the input chrome and the field wrapper, but\n * never wires form state — that is the job of the component rendering it (`TextInput`, `TextArea`,\n * `PasswordInput`, `NumberInput`, `SearchInput`, `CommandTextArea`).\n */\nfunction TextInputBase(props: CubeTextInputBaseProps, ref) {\n let {\n qa,\n mods,\n isInvalid,\n isValid,\n prefix,\n isDisabled,\n isReadOnly,\n multiLine,\n autoFocus,\n inputProps,\n wrapperProps,\n inputRef,\n isLoading,\n loadingIndicator,\n value,\n inputStyles = {},\n suffix,\n suffixPosition = 'before',\n actions,\n wrapperRef,\n rows,\n size = 'medium',\n shape = 'default',\n autoComplete,\n autocomplete,\n icon,\n maxLength,\n minLength,\n form,\n resize,\n tooltip,\n children,\n ...otherProps\n } = props;\n\n // A text area grows with its flex line when bare, so it fills a field\n // sized by flex props too.\n const { styles, field } = splitFieldLayout(props, {\n fillHeightOnFlex: !!multiLine,\n });\n let type = otherProps.type;\n\n if (resize) {\n // oxlint-disable-next-line tasty/no-runtime-styles-mutation -- forwards the consumer's `resize` prop\n inputStyles = mergeStyles(inputStyles, { resize });\n }\n\n let ElementType: 'textarea' | 'input' = multiLine ? 'textarea' : 'input';\n let { isFocused, focusProps } = useFocus();\n // A read-only field takes no hover state: nothing it could change would follow.\n let { hoverProps, isHovered } = useHover({\n isDisabled: isDisabled || isReadOnly,\n });\n // The input box, with or without the field chrome, so the field's ref never\n // resolves to `null`; `wrapperRef` reaches the same element.\n let domRef = useObjectRef(wrapperRef);\n\n inputRef = useCombinedRefs(inputRef);\n\n let { renderWithTooltip, isTooltipActive } = useAutoTooltip({\n tooltip,\n children: null,\n });\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 const showValidationIndicator = hasValidationIndicator({\n isInvalid,\n isValid,\n isLoading,\n });\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 = {\n ...getValidationMods({ isInvalid, isValid }),\n loadable: !!loadingIndicator,\n focused: isFocused,\n hovered: isHovered,\n disabled: isDisabled,\n readonly: !!isReadOnly,\n multiline: multiLine,\n prefix: !!prefix,\n suffix: showValidationIndicator || !!suffix || !!actions,\n shape,\n ...mods,\n };\n\n // The explicit props win when they are set; an unset one falls back to the merged `inputProps`\n // instead of overwriting it with `undefined`. For `autoComplete` that keeps both a caller's\n // `inputProps={{ autoComplete }}` and `useNumberField`'s own `off`. `autocomplete` is the\n // deprecated alias.\n const resolvedAutoComplete =\n autoComplete ?? autocomplete ?? inputProps.autoComplete;\n const resolvedAutoFocus = autoFocus ?? inputProps.autoFocus;\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 isInputDisabled = !!(isDisabled ?? inputProps.disabled);\n\n // A disabled input with a tooltip keeps its focus, as `Checkbox` and `Switch` do: the tooltip is\n // usually the reason it is disabled, and focus is how the keyboard opens it. It is\n // `aria-disabled` and read-only instead, and the pointer still can't focus it.\n const { isInert } = getDisabledElementProps({\n isDisabled: isInputDisabled,\n keepEvents: isTooltipActive,\n as: 'input',\n });\n\n let ownInputProps = mergeProps(inputProps, focusProps, hoverProps);\n\n if (isInert) {\n ownInputProps = mergeProps(\n getInertInputProps(\n mergeProps(\n // The field's own focus handlers never run on a natively disabled input, and\n // `useNumberField` commits on blur: it would round a value the user can't edit.\n { ...inputProps, onFocus: undefined, onBlur: undefined },\n focusProps,\n hoverProps,\n ),\n { excludeFromTabOrder: props.excludeFromTabOrder },\n ),\n { readOnly: true, onMouseDown: preventPointerFocus },\n );\n }\n\n // The field box takes the tooltip's hover side and positions it, so it\n // covers the prefix, suffix and steppers and never the text being typed. The\n // input, where keyboard focus lands, takes the focus side. The box keeps the\n // field's ref, which `wrapperRef` also reaches.\n const textField = renderWithTooltip((tooltipTriggerProps, tooltipRef) => {\n const { pointerProps, focusProps: tooltipFocusProps } =\n splitTooltipTriggerProps(tooltipTriggerProps);\n\n return (\n <InputWrapperElement\n ref={tooltipRef ? mergeRefs(domRef, tooltipRef) : domRef}\n mods={modifiers}\n data-size={size}\n styles={styles}\n {...mergeProps(wrapperProps, pointerProps, {\n onMouseDown: (event: MouseEvent<HTMLElement>) =>\n focusInputOnBoxPress(event, inputRef?.current),\n })}\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 {...mergeTooltipFocusProps(ownInputProps, tooltipFocusProps)}\n ref={inputRef}\n rows={multiLine ? (rows ?? inputProps.rows ?? 1) : inputProps.rows}\n mods={modifiers}\n // oxlint-disable-next-line tasty/no-style-prop -- `preset` owns font-family, and a `fontFamily` state map would replace the preset's in every state\n style={textSecurityStyles}\n {...(resolvedAutoFocus ? { 'data-autofocus': '' } : undefined)}\n autoFocus={resolvedAutoFocus}\n data-size={size}\n autoComplete={resolvedAutoComplete}\n styles={inputStyles}\n disabled={isInputDisabled && !isInert}\n maxLength={maxLength ?? inputProps.maxLength}\n minLength={minLength ?? inputProps.minLength}\n />\n {/* Inside the box, so a parent's `:last-child` rules still see the field: `NumberInput`'s hidden form value goes here. */}\n {children}\n {showValidationIndicator || suffix || actions ? (\n <div data-element=\"Suffix\">\n {suffixPosition === 'before' ? suffix : null}\n {isLoading && loadingIndicator ? (\n <div data-element=\"State\">{loadingIndicator}</div>\n ) : (\n <ValidationIndicator\n isInvalid={isInvalid}\n isValid={isValid}\n isLoading={isLoading}\n />\n )}\n {suffixPosition === 'after' ? suffix : null}\n {actions}\n </div>\n ) : null}\n </InputWrapperElement>\n );\n }, 'top');\n\n // `renderWithTooltip` is typed for any node; here it returns an element.\n // `tooltip` is the input's own, not the legacy spelling of `labelTooltip`.\n return wrapWithField(textField as ReactElement, {\n ...props,\n ...field,\n tooltip: undefined,\n // A click on its label doesn't focus a natively disabled input either. The input keeps its\n // name through `aria-labelledby`.\n ...(isInert\n ? {\n labelProps: {\n ...props.labelProps,\n htmlFor: undefined,\n for: undefined,\n },\n }\n : null),\n });\n}\n\nconst _TextInputBase = forwardRef(TextInputBase);\n\nexport { _TextInputBase as TextInputBase };\nexport type { AriaTextFieldProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,MAAMmC,aAAa;CACjBC,GAAG;CACHC,SAAS;CACTC,cAAc;CACdC,YAAY;CACZC,UAAU;CACVC,MAAM;CACNC,KAAK;CACLC,QAAQ;CACRC,SAAS;EACP,IAAI;EACJC,UAAU;CACZ;AACF;AAGA,MAAMC,eAAe;CACnB,IAAI;CACJ,eAAe;AACjB;AAEA,MAAaC,uBAA+B;CAC1CV,SAAS;CACTI,MAAM;CACNO,UAAU;CACVC,aAAa;EACX,IAAI;EACJC,QAAQ;EACRC,QAAQ;EACR,mBAAmB;CACrB;CACAX,UAAU;CACVD,YAAY;CACZa,MAAM;EACJ,IAAI;EACJC,UAAU;EACVR,UAAU;CACZ;CACAS,QAAQ;EACN,IAAI;EACJD,UAAU;EAEV,kBAAkB;EAIlB,eAAe;EACf,qBAAqB;EACrBE,OAAO;EACPC,SAAS;EACTC,SAAS;EACT,mBAAmB;EACnB,qBAAqB;EACrBZ,UAAU;EACV,0BAA0B;EAC1B,gCAAgC;EAGhC,sBAAsB;CACxB;CACAa,QAAQ;CACRC,QAAQb;CACRH,QAAQ;CACRiB,OAAO;EACL,IAAI;EACJH,SAAS;EACTD,SAAS;EACTX,UAAU;CACZ;CACAgB,QAAQ;EACN,IAAI;EACJJ,SAAS;CACX;CACAK,WAAW;CACXC,YAAY;CACZC,gBAAgB;CAChBC,QAAQ;EACN,IAAI;EACJC,WAAW;CACb;CAEAC,OAAO;EACL,IAAI;EACJ,cAAc;EACd,eAAe;EACf,cAAc;CAChB;CAEAC,QAAQjC;CAERkC,QAAQlC;CAERmC,OAAO;EACLlC,GAAG;EACHC,SAAS;CACX;CAEAkC,WAAW;EACTlC,SAAS;EACTE,YAAY;EACZiC,OAAO;EACPZ,OAAO;EACPa,UAAU;CACZ;C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M,IAAA0B,MAAA;KACAqF,IAAAA;KACY,mBAAA;KAAW,GACvBlI,uBAAuBuK,eAAeQ,iBAAiB;KACtDrF,KAAAA;KACC,MAAAJ,YAAaU,QAAQR,WAAUQ,QAAlB,IAAgCR,WAAUQ;KACvD2D,MAAAA;KAECI,OAAAA;KAAkB,GACpBF,oBAAA,EAAA,kBAAwC,GAAe,IAAvD/B,KAAAA;KACM+B,WAAAA;KACA5D,aAAAA;KACG2D,cAAAA;KACN7D,QAAAA;KACE,UAAAmE,mBAAA,CAAoBI;KACnB,WAAA7C,aAAajC,WAAUiC;KACvB,WAAAC,aAAalC,WAAUkC;IAAU,CAAA;IAG7CE;IACAqB,2BAAA7H,UAAAiE,UACC,qBAAA,OAAA;KAAkB,gBAAA;KAAlB,UAAA;MACGD,mBAAmB,WAAnBhE,SAAA;MACAyE,aAAAC,mBACC,oBAAA,OAAA;OAAkB,gBAAA;OAASA,UAAAA;MAAuB,CAAA,IAElD,oBAAC,qBAAD;OACae;OACFC;OACEjB;MAAS,CAAA;MAGvBT,mBAAmB,UAAnBhE,SAAA;MACAiE;KACG;IAdP,CAAA,IAAA;GAhCiB;;CAgDE,GAEvB,KAAK;CAAE,OAIHxF,cAAc8K,WAA2B;EAAA,GAC3ClE;EAAK,GACLsB;EAAK1B,SACCyB,KAAAA;EAAS,GAGdwC,UAAA,EAAAU,YAEc;GAAA,GACPvE,MAAKuE;GAAWC,SACVnD,KAAAA;GAASoD,KACbpD,KAAAA;EACP,EAEC,IARH;CASN,CAAC;AAAC;AAGJ,MAAMqD,iBAAiB3M,WAAWgI,aAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { useEffect, useLayoutEffect, useRef } from "react";
|
|
4
4
|
//#region src/components/fields/TextInput/useAutoSizeTextArea.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | 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 { Block } from "../../Block.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { ItemActionIcon } from "../actions/ItemActionsWrapper.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { Fragment, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { formatColor, getContrastingColor, toHex } from "./color.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { maxChroma, normalizeHue, oklchToOkhsl } from "../../../utils/colors.js";
|
|
3
3
|
import { fromOkhst, fromRgb, isAchromatic, toHex, toOkhst, toOklch, toRgb } from "./color.js";
|
|
4
4
|
//#region src/components/fields/color/channels.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { anyNaN, clamp, maxChroma, normalizeHue, oklchToOkhsl, parseColorFunction, readComponent, readHue, rgbFromSrgb } from "../../../utils/colors.js";
|
|
3
3
|
import { contrastRatioFromLuminance, formatHsl, formatOkhsl, formatOkhst, formatOklch, formatRgb, hslToSrgb, okhslToLinearSrgb, okhslToOkhst, okhslToOklch, okhslToSrgb, okhstToOkhsl, parseHexAlpha, relativeLuminanceFromLinearRgb, srgbToHex, srgbToOkhsl } from "@tenphi/glaze";
|
|
4
4
|
//#region src/components/fields/color/color.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { Text as _Text } from "../../content/Text.js";
|
|
4
4
|
import { wrapNodeIfPlain } from "../../../utils/react/wrapNodeIfPlain.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useSyncExternalStore } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { warn } from "../../../utils/warnings.js";
|
|
4
4
|
import { useValidationProps } from "../validation/use-validation-props.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.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.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | 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 { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | 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.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useProviderProps } from "../../../../provider.js";
|
|
3
3
|
import { Button } from "../../../actions/Button/Button.js";
|
|
4
4
|
import { isModernFormController } from "../backend.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
3
3
|
import { ModernControllerContext } from "./modern/context.js";
|
|
4
4
|
import { FormContext } from "./Form.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useFormControllerContext } from "./modern/context.js";
|
|
3
3
|
import { useForm } from "./use-form.js";
|
|
4
4
|
import { Form as _Form, FormContext, FormScopeMask, useFormProps } from "./Form.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { useProviderProps } from "../../../../provider.js";
|
|
4
4
|
import { Button } from "../../../actions/Button/Button.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { createContext, useContext } from "react";
|
|
3
3
|
//#region src/components/form/Form/modern/context.ts
|
|
4
4
|
const ModernControllerContext = createContext(null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { FORM_BACKEND, isModernFormController } from "../backend.js";
|
|
3
3
|
import { createFormField } from "./field.js";
|
|
4
4
|
import { createFormStore } from "./store.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { getFieldKey, hasPath, normalizePath, readPath } from "./values.js";
|
|
3
3
|
import { getControllerInternals } from "./controller.js";
|
|
4
4
|
//#region src/components/form/Form/modern/field-binding.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { normalizePath } from "./values.js";
|
|
3
3
|
//#region src/components/form/Form/modern/field.ts
|
|
4
4
|
function createFormField(form, path, options = {}) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.204.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { ModernControllerContext } from "./context.js";
|
|
4
4
|
import { getFieldKey, normalizePath, readPath } from "./values.js";
|