@dbcdk/react-components 0.0.102 → 0.0.104
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/assets/logo.cjs +87 -0
- package/dist/assets/logo.js +85 -0
- package/dist/client.cjs +587 -0
- package/dist/client.d.ts +83 -0
- package/dist/client.js +84 -0
- package/dist/components/accordion/Accordion.cjs +103 -0
- package/dist/components/accordion/Accordion.js +97 -0
- package/dist/components/accordion/Accordion.module.css +41 -0
- package/dist/components/accordion/components/AccordionRow.cjs +115 -0
- package/dist/components/accordion/components/AccordionRow.js +109 -0
- package/dist/components/accordion/components/AccordionRow.module.css +99 -0
- package/dist/components/alert/Alert.cjs +52 -0
- package/dist/components/alert/Alert.d.ts +2 -1
- package/dist/components/alert/Alert.js +46 -0
- package/dist/components/alert/Alert.module.css +97 -0
- package/dist/components/app-header/AppHeader.cjs +14 -0
- package/dist/components/app-header/AppHeader.js +8 -0
- package/dist/components/app-header/AppHeader.module.css +74 -0
- package/dist/components/attribute-chip/AttributeChip.cjs +22 -0
- package/dist/components/attribute-chip/AttributeChip.js +16 -0
- package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
- package/dist/components/avatar/Avatar.cjs +111 -0
- package/dist/components/avatar/Avatar.js +86 -0
- package/dist/components/avatar/Avatar.module.css +91 -0
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +24 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +80 -0
- package/dist/components/button/Button.cjs +149 -0
- package/dist/components/button/Button.js +124 -0
- package/dist/components/button/Button.module.css +260 -0
- package/dist/components/button-select/ButtonSelect.cjs +35 -0
- package/dist/components/button-select/ButtonSelect.js +29 -0
- package/dist/components/button-select/ButtonSelect.module.css +40 -0
- package/dist/components/card/Card.cjs +112 -0
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +106 -0
- package/dist/components/card/Card.module.css +187 -0
- package/dist/components/card/components/CardMeta.cjs +62 -0
- package/dist/components/card/components/CardMeta.js +55 -0
- package/dist/components/card/components/CardMeta.module.css +55 -0
- package/dist/components/card-container/CardContainer.cjs +34 -0
- package/dist/components/card-container/CardContainer.js +28 -0
- package/dist/components/card-container/CardContainer.module.css +63 -0
- package/dist/components/chip/Chip.cjs +65 -0
- package/dist/components/chip/Chip.js +59 -0
- package/dist/components/chip/Chip.module.css +236 -0
- package/dist/components/circle/Circle.cjs +33 -0
- package/dist/components/circle/Circle.js +27 -0
- package/dist/components/circle/Circle.module.css +128 -0
- package/dist/components/clear-button/ClearButton.cjs +33 -0
- package/dist/components/clear-button/ClearButton.d.ts +2 -1
- package/dist/components/clear-button/ClearButton.js +27 -0
- package/dist/components/clear-button/ClearButton.module.css +26 -0
- package/dist/components/code-block/CodeBlock.cjs +97 -0
- package/dist/components/code-block/CodeBlock.js +91 -0
- package/dist/components/code-block/CodeBlock.module.css +124 -0
- package/dist/components/copy-button/CopyButton.cjs +139 -0
- package/dist/components/copy-button/CopyButton.js +133 -0
- package/dist/components/copy-button/CopyButton.module.css +22 -0
- package/dist/components/datetime-picker/DateTimePicker.cjs +559 -0
- package/dist/components/datetime-picker/DateTimePicker.js +553 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +155 -0
- package/dist/components/datetime-picker/dateTimeHelpers.cjs +179 -0
- package/dist/components/datetime-picker/dateTimeHelpers.js +160 -0
- package/dist/components/divider/Divider.cjs +22 -0
- package/dist/components/divider/Divider.js +20 -0
- package/dist/components/filter-field/FilterField.cjs +296 -0
- package/dist/components/filter-field/FilterField.js +289 -0
- package/dist/components/filter-field/FilterField.module.css +379 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +115 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +108 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +59 -0
- package/dist/components/forms/checkbox/Checkbox.cjs +88 -0
- package/dist/components/forms/checkbox/Checkbox.js +82 -0
- package/dist/components/forms/checkbox/Checkbox.module.css +104 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +121 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +115 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
- package/dist/components/forms/form-select/FormSelect.cjs +191 -0
- package/dist/components/forms/form-select/FormSelect.js +166 -0
- package/dist/components/forms/form-select/FormSelect.module.css +236 -0
- package/dist/components/forms/input/Input.cjs +188 -0
- package/dist/components/forms/input/Input.d.ts +1 -0
- package/dist/components/forms/input/Input.js +182 -0
- package/dist/components/forms/input/Input.module.css +468 -0
- package/dist/components/forms/input-container/InputContainer.cjs +72 -0
- package/dist/components/forms/input-container/InputContainer.js +66 -0
- package/dist/components/forms/input-container/InputContainer.module.css +59 -0
- package/dist/components/forms/multi-select/MultiSelect.cjs +227 -0
- package/dist/components/forms/multi-select/MultiSelect.js +225 -0
- package/dist/components/forms/radio-buttons/RadioButton.cjs +91 -0
- package/dist/components/forms/radio-buttons/RadioButton.js +85 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +74 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +72 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +118 -0
- package/dist/components/forms/select/Select.cjs +286 -0
- package/dist/components/forms/select/Select.js +280 -0
- package/dist/components/forms/select/Select.module.css +32 -0
- package/dist/components/forms/text-area/Textarea.cjs +116 -0
- package/dist/components/forms/text-area/Textarea.js +110 -0
- package/dist/components/forms/text-area/Textarea.module.css +70 -0
- package/dist/components/forms/typeahead/Typeahead.cjs +792 -0
- package/dist/components/forms/typeahead/Typeahead.js +768 -0
- package/dist/components/forms/typeahead/Typeahead.module.css +38 -0
- package/dist/components/grid/Grid.cjs +45 -0
- package/dist/components/grid/Grid.js +38 -0
- package/dist/components/grid/Grid.module.css +35 -0
- package/dist/components/headline/CollapsibleHeadline.cjs +80 -0
- package/dist/components/headline/CollapsibleHeadline.js +74 -0
- package/dist/components/headline/Headline.cjs +59 -0
- package/dist/components/headline/Headline.js +53 -0
- package/dist/components/headline/Headline.module.css +185 -0
- package/dist/components/hyperlink/Hyperlink.cjs +107 -0
- package/dist/components/hyperlink/Hyperlink.d.ts +1 -0
- package/dist/components/hyperlink/Hyperlink.js +82 -0
- package/dist/components/hyperlink/Hyperlink.module.css +121 -0
- package/dist/components/icon/Icon.cjs +27 -0
- package/dist/components/icon/Icon.js +20 -0
- package/dist/components/icon/Icon.module.css +36 -0
- package/dist/components/inline-status/InlineStatus.cjs +39 -0
- package/dist/components/inline-status/InlineStatus.js +33 -0
- package/dist/components/inline-status/InlineStatus.module.css +92 -0
- package/dist/components/interval-select/IntervalSelect.cjs +203 -0
- package/dist/components/interval-select/IntervalSelect.js +201 -0
- package/dist/components/json-viewer/HighlightedText.cjs +13 -0
- package/dist/components/json-viewer/HighlightedText.js +11 -0
- package/dist/components/json-viewer/JsonNode.cjs +124 -0
- package/dist/components/json-viewer/JsonNode.js +118 -0
- package/dist/components/json-viewer/JsonViewer.cjs +164 -0
- package/dist/components/json-viewer/JsonViewer.js +158 -0
- package/dist/components/json-viewer/JsonViewer.module.css +346 -0
- package/dist/components/json-viewer/types.cjs +2 -0
- package/dist/components/json-viewer/types.js +1 -0
- package/dist/components/json-viewer/useClipboardStatus.cjs +15 -0
- package/dist/components/json-viewer/useClipboardStatus.js +13 -0
- package/dist/components/json-viewer/utils.cjs +126 -0
- package/dist/components/json-viewer/utils.js +111 -0
- package/dist/components/media-card/MediaCard.cjs +60 -0
- package/dist/components/media-card/MediaCard.d.ts +19 -0
- package/dist/components/media-card/MediaCard.js +54 -0
- package/dist/components/media-card/MediaCard.module.css +92 -0
- package/dist/components/menu/Menu.cjs +287 -0
- package/dist/components/menu/Menu.js +262 -0
- package/dist/components/menu/Menu.module.css +220 -0
- package/dist/components/meta-bar/MetaBar.cjs +28 -0
- package/dist/components/meta-bar/MetaBar.js +22 -0
- package/dist/components/meta-bar/MetaBar.module.css +27 -0
- package/dist/components/nav-bar/NavBar.cjs +95 -0
- package/dist/components/nav-bar/NavBar.d.ts +1 -1
- package/dist/components/nav-bar/NavBar.js +89 -0
- package/dist/components/nav-bar/NavBar.module.css +225 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +30 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +24 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +54 -0
- package/dist/components/overlay/modal/Modal.cjs +189 -0
- package/dist/components/overlay/modal/Modal.d.ts +2 -1
- package/dist/components/overlay/modal/Modal.js +183 -0
- package/dist/components/overlay/modal/Modal.module.css +112 -0
- package/dist/components/overlay/modal/provider/ModalProvider.cjs +98 -0
- package/dist/components/overlay/modal/provider/ModalProvider.js +95 -0
- package/dist/components/overlay/side-panel/SidePanel.cjs +173 -0
- package/dist/components/overlay/side-panel/SidePanel.js +167 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +177 -0
- package/dist/components/overlay/side-panel/useSidePanel.cjs +16 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +14 -0
- package/dist/components/overlay/tooltip/Tooltip.cjs +34 -0
- package/dist/components/overlay/tooltip/Tooltip.js +32 -0
- package/dist/components/overlay/tooltip/Tooltip.module.css +104 -0
- package/dist/components/overlay/tooltip/TooltipProvider.cjs +238 -0
- package/dist/components/overlay/tooltip/TooltipProvider.js +231 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +117 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +115 -0
- package/dist/components/page/Page.cjs +63 -0
- package/dist/components/page/Page.js +57 -0
- package/dist/components/page/Page.module.css +95 -0
- package/dist/components/page-layout/PageLayout.cjs +97 -0
- package/dist/components/page-layout/PageLayout.d.ts +0 -5
- package/dist/components/page-layout/PageLayout.js +91 -0
- package/dist/components/page-layout/PageLayout.module.css +236 -0
- package/dist/components/page-layout/components/footer/Footer.cjs +53 -0
- package/dist/components/page-layout/components/footer/Footer.js +47 -0
- package/dist/components/page-layout/components/footer/Footer.module.css +89 -0
- package/dist/components/pagination/Pagination.cjs +160 -0
- package/dist/components/pagination/Pagination.js +154 -0
- package/dist/components/pagination/Pagination.module.css +25 -0
- package/dist/components/panel/Panel.cjs +38 -0
- package/dist/components/panel/Panel.js +32 -0
- package/dist/components/panel/Panel.module.css +30 -0
- package/dist/components/popover/Popover.cjs +331 -0
- package/dist/components/popover/Popover.js +307 -0
- package/dist/components/popover/Popover.module.css +52 -0
- package/dist/components/search-box/SearchBox.cjs +274 -0
- package/dist/components/search-box/SearchBox.js +268 -0
- package/dist/components/search-box/SearchBox.module.css +27 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +127 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +121 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +174 -0
- package/dist/components/sidebar/Sidebar.cjs +39 -0
- package/dist/components/sidebar/Sidebar.js +37 -0
- package/dist/components/sidebar/components/SidebarItem.cjs +29 -0
- package/dist/components/sidebar/components/SidebarItem.js +27 -0
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +133 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +127 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +29 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +214 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +207 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +260 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +54 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +47 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +106 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +61 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +55 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +20 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +97 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +91 -0
- package/dist/components/sidebar/providers/SidebarProvider.cjs +223 -0
- package/dist/components/sidebar/providers/SidebarProvider.js +220 -0
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +442 -0
- package/dist/components/skeleton-loader/SkeletonLoader.js +440 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +42 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +51 -0
- package/dist/components/split-button/SplitButton.cjs +46 -0
- package/dist/components/split-button/SplitButton.js +40 -0
- package/dist/components/split-button/SplitButton.module.css +32 -0
- package/dist/components/split-pane/SplitPane.cjs +177 -0
- package/dist/components/split-pane/SplitPane.js +168 -0
- package/dist/components/split-pane/SplitPane.module.css +111 -0
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +129 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +121 -0
- package/dist/components/stack/Stack.cjs +47 -0
- package/dist/components/stack/Stack.d.ts +1 -1
- package/dist/components/stack/Stack.js +41 -0
- package/dist/components/stack/Stack.module.css +61 -0
- package/dist/components/state-page/StatePage.cjs +48 -0
- package/dist/components/state-page/StatePage.js +42 -0
- package/dist/components/state-page/StatePage.module.css +9 -0
- package/dist/components/state-page/empty.cjs +664 -0
- package/dist/components/state-page/empty.js +662 -0
- package/dist/components/state-page/error.cjs +310 -0
- package/dist/components/state-page/error.js +308 -0
- package/dist/components/state-page/notFound.cjs +243 -0
- package/dist/components/state-page/notFound.js +241 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.cjs +98 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +96 -0
- package/dist/components/table/Table.cjs +216 -0
- package/dist/components/table/Table.js +210 -0
- package/dist/components/table/Table.module.css +534 -0
- package/dist/components/table/Table.types.cjs +2 -0
- package/dist/components/table/Table.types.js +1 -0
- package/dist/components/table/TanstackTable.cjs +172 -0
- package/dist/components/table/TanstackTable.js +147 -0
- package/dist/components/table/components/TableBody.cjs +50 -0
- package/dist/components/table/components/TableBody.js +44 -0
- package/dist/components/table/components/TableHeader.cjs +56 -0
- package/dist/components/table/components/TableHeader.js +50 -0
- package/dist/components/table/components/TableHeaderCell.cjs +69 -0
- package/dist/components/table/components/TableHeaderCell.js +63 -0
- package/dist/components/table/components/TableLoadingBody.cjs +35 -0
- package/dist/components/table/components/TableLoadingBody.js +29 -0
- package/dist/components/table/components/TablePagination.cjs +2 -0
- package/dist/components/table/components/TablePagination.js +1 -0
- package/dist/components/table/components/TableRow.cjs +151 -0
- package/dist/components/table/components/TableRow.js +145 -0
- package/dist/components/table/components/TableSelectionCell.cjs +41 -0
- package/dist/components/table/components/TableSelectionCell.js +35 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +25 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.js +19 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +22 -0
- package/dist/components/table/components/empty-state/EmptyState.cjs +33 -0
- package/dist/components/table/components/empty-state/EmptyState.js +31 -0
- package/dist/components/table/components/empty-state/EmptyState.module.css +4 -0
- package/dist/components/table/components/table-settings/TableSettings.cjs +139 -0
- package/dist/components/table/components/table-settings/TableSettings.js +137 -0
- package/dist/components/table/hooks/useTableRowInteractions.cjs +46 -0
- package/dist/components/table/hooks/useTableRowInteractions.js +44 -0
- package/dist/components/table/table.classes.cjs +49 -0
- package/dist/components/table/table.classes.js +40 -0
- package/dist/components/table/table.utils.cjs +57 -0
- package/dist/components/table/table.utils.js +45 -0
- package/dist/components/table/tanstackTable.utils.cjs +166 -0
- package/dist/components/table/tanstackTable.utils.js +159 -0
- package/dist/components/tabs/Tabs.cjs +172 -0
- package/dist/components/tabs/Tabs.js +166 -0
- package/dist/components/tabs/Tabs.module.css +261 -0
- package/dist/components/theme-button/ThemeButton.cjs +78 -0
- package/dist/components/theme-button/ThemeButton.js +75 -0
- package/dist/components/toast/Toast.cjs +68 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/toast/Toast.module.css +161 -0
- package/dist/components/toast/provider/ToastProvider.cjs +105 -0
- package/dist/components/toast/provider/ToastProvider.js +97 -0
- package/dist/components/user-display/UserDisplay.cjs +22 -0
- package/dist/components/user-display/UserDisplay.js +16 -0
- package/dist/components/user-display/UserDisplay.module.css +25 -0
- package/dist/constants/chart-colors.cjs +10 -0
- package/dist/constants/chart-colors.js +8 -0
- package/dist/constants/chart-colors.types.cjs +2 -0
- package/dist/constants/chart-colors.types.js +1 -0
- package/dist/constants/severity.cjs +30 -0
- package/dist/constants/severity.js +26 -0
- package/dist/constants/severity.types.cjs +2 -0
- package/dist/constants/severity.types.js +1 -0
- package/dist/constants/sizes.cjs +11 -0
- package/dist/constants/sizes.js +9 -0
- package/dist/hooks/useDeviceSize.cjs +35 -0
- package/dist/hooks/useDeviceSize.js +33 -0
- package/dist/hooks/useListNavigation.cjs +237 -0
- package/dist/hooks/useListNavigation.js +235 -0
- package/dist/hooks/usePagination.cjs +144 -0
- package/dist/hooks/usePagination.js +142 -0
- package/dist/hooks/useSorting.cjs +119 -0
- package/dist/hooks/useSorting.js +117 -0
- package/dist/hooks/useTableData.cjs +53 -0
- package/dist/hooks/useTableData.js +51 -0
- package/dist/hooks/useTableSelection.cjs +172 -0
- package/dist/hooks/useTableSelection.js +170 -0
- package/dist/hooks/useTableSettings.cjs +90 -0
- package/dist/hooks/useTableSettings.js +87 -0
- package/dist/hooks/useTheme.cjs +64 -0
- package/dist/hooks/useTheme.js +62 -0
- package/dist/hooks/useTimeDuration.cjs +72 -0
- package/dist/hooks/useTimeDuration.js +70 -0
- package/dist/hooks/useViewportFill.cjs +82 -0
- package/dist/hooks/useViewportFill.js +80 -0
- package/dist/index.cjs +161 -12901
- package/dist/index.css +67 -7228
- package/dist/index.d.ts +0 -58
- package/dist/index.js +24 -12802
- package/dist/styles/animation.cjs +9 -0
- package/dist/styles/animation.js +7 -0
- package/dist/styles/themes/dbc/colors.css +5 -0
- package/dist/styles/themes/types.cjs +2 -0
- package/dist/styles/themes/types.js +1 -0
- package/dist/tanstack.cjs +18 -2652
- package/dist/tanstack.js +3 -2636
- package/dist/types/a11y-props.types.cjs +2 -0
- package/dist/types/a11y-props.types.js +1 -0
- package/dist/types/assets.d.cjs +2 -0
- package/dist/types/assets.d.js +1 -0
- package/dist/types/css.d.cjs +2 -0
- package/dist/types/css.d.js +1 -0
- package/dist/types/sizes.types.cjs +2 -0
- package/dist/types/sizes.types.js +1 -0
- package/dist/utils/arrays/nested-filtering.cjs +40 -0
- package/dist/utils/arrays/nested-filtering.js +38 -0
- package/dist/utils/date/formatDate.cjs +35 -0
- package/dist/utils/date/formatDate.js +33 -0
- package/dist/utils/localStorage.utils.cjs +53 -0
- package/dist/utils/localStorage.utils.js +49 -0
- package/dist/utils/text/get-highlighted-segments.cjs +49 -0
- package/dist/utils/text/get-highlighted-segments.js +47 -0
- package/package.json +8 -3
- package/dist/tanstack.css +0 -1271
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/* FormSelect.module.css */
|
|
2
|
+
|
|
3
|
+
/* =========================================
|
|
4
|
+
Root container (select + optional clear)
|
|
5
|
+
========================================= */
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: stretch;
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
gap: 0;
|
|
12
|
+
|
|
13
|
+
inline-size: var(--input-width, auto);
|
|
14
|
+
min-inline-size: var(--input-min-width, 0);
|
|
15
|
+
max-inline-size: var(--input-max-width, none);
|
|
16
|
+
|
|
17
|
+
position: relative;
|
|
18
|
+
border-radius: var(--border-radius-default);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Full width variant */
|
|
22
|
+
.fullWidth {
|
|
23
|
+
display: flex;
|
|
24
|
+
inline-size: 100%;
|
|
25
|
+
min-inline-size: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* =========================================
|
|
29
|
+
Focus ring (GROUP LEVEL)
|
|
30
|
+
========================================= */
|
|
31
|
+
|
|
32
|
+
.container:focus-within {
|
|
33
|
+
box-shadow: 0 0 0 2px var(--color-border-selected);
|
|
34
|
+
z-index: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* IMPORTANT:
|
|
38
|
+
When focused, do NOT also turn the select's border blue,
|
|
39
|
+
otherwise you get the vertical seam line next to the button. */
|
|
40
|
+
.container:focus-within .input {
|
|
41
|
+
border-color: var(--color-border-default);
|
|
42
|
+
}
|
|
43
|
+
.container:focus-within .trailingButton {
|
|
44
|
+
border-color: var(--color-border-default);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* =========================================
|
|
48
|
+
Field wrapper (native select + chevron)
|
|
49
|
+
========================================= */
|
|
50
|
+
|
|
51
|
+
.field {
|
|
52
|
+
position: relative;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
flex: 1 1 auto;
|
|
56
|
+
min-inline-size: 0;
|
|
57
|
+
color: var(--color-fg-default);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* =========================================
|
|
61
|
+
Native select styling
|
|
62
|
+
========================================= */
|
|
63
|
+
|
|
64
|
+
.input {
|
|
65
|
+
appearance: none;
|
|
66
|
+
-webkit-appearance: none;
|
|
67
|
+
-moz-appearance: none;
|
|
68
|
+
|
|
69
|
+
flex: 1 1 auto;
|
|
70
|
+
min-inline-size: 0;
|
|
71
|
+
inline-size: 100%;
|
|
72
|
+
max-inline-size: 100%;
|
|
73
|
+
|
|
74
|
+
background: var(--color-bg-surface);
|
|
75
|
+
font-family: var(--font-family);
|
|
76
|
+
font-size: var(--font-size-sm);
|
|
77
|
+
line-height: var(--line-height-normal);
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
|
|
81
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
82
|
+
border-radius: var(--border-radius-default);
|
|
83
|
+
|
|
84
|
+
padding-inline: var(--spacing-sm);
|
|
85
|
+
padding-block: var(--spacing-xs);
|
|
86
|
+
|
|
87
|
+
/* Reserve space for chevron */
|
|
88
|
+
padding-inline-end: calc(var(--spacing-lg) + 28px);
|
|
89
|
+
|
|
90
|
+
transition:
|
|
91
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
92
|
+
border-color var(--transition-fast) var(--ease-standard),
|
|
93
|
+
box-shadow var(--transition-fast) var(--ease-standard);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Disabled select */
|
|
97
|
+
.input:disabled {
|
|
98
|
+
background-color: var(--color-disabled-bg);
|
|
99
|
+
color: var(--color-disabled-fg);
|
|
100
|
+
cursor: not-allowed;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Hover state */
|
|
104
|
+
.input:hover:not(:disabled) {
|
|
105
|
+
border-color: var(--color-border-strong);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Remove default focus ring (we use group-level ring) */
|
|
109
|
+
.input:focus-visible {
|
|
110
|
+
outline: none;
|
|
111
|
+
/* DO NOT set border-color here */
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* =========================================
|
|
115
|
+
Variants
|
|
116
|
+
========================================= */
|
|
117
|
+
|
|
118
|
+
.filled {
|
|
119
|
+
background-color: var(--color-bg-surface);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.standalone {
|
|
123
|
+
border-radius: var(--border-radius-rounded);
|
|
124
|
+
background-color: var(--color-bg-surface);
|
|
125
|
+
box-shadow: var(--shadow-xs), var(--shadow-md);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.outlined {
|
|
129
|
+
background-color: transparent;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* =========================================
|
|
133
|
+
Sizes
|
|
134
|
+
========================================= */
|
|
135
|
+
|
|
136
|
+
.sm {
|
|
137
|
+
block-size: var(--component-size-sm);
|
|
138
|
+
font-size: var(--font-size-sm);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.md {
|
|
142
|
+
block-size: var(--component-size-md);
|
|
143
|
+
font-size: var(--font-size-sm);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.lg {
|
|
147
|
+
block-size: var(--component-size-lg);
|
|
148
|
+
font-size: var(--font-size-lg);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* =========================================
|
|
152
|
+
Chevron (decorative only)
|
|
153
|
+
========================================= */
|
|
154
|
+
|
|
155
|
+
.chevron {
|
|
156
|
+
position: absolute;
|
|
157
|
+
inset-inline-end: var(--spacing-sm);
|
|
158
|
+
top: 50%;
|
|
159
|
+
transform: translateY(-50%);
|
|
160
|
+
display: inline-flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
justify-content: center;
|
|
163
|
+
pointer-events: none;
|
|
164
|
+
color: var(--color-fg-subtle);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.chevron svg {
|
|
168
|
+
inline-size: 20px;
|
|
169
|
+
block-size: 20px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* =========================================
|
|
173
|
+
Clear button integration
|
|
174
|
+
========================================= */
|
|
175
|
+
|
|
176
|
+
/* Remove right radius from select when button exists */
|
|
177
|
+
.withButton .input {
|
|
178
|
+
border-top-right-radius: 0;
|
|
179
|
+
border-bottom-right-radius: 0;
|
|
180
|
+
|
|
181
|
+
/* Prevent double border seam; the button provides the right side */
|
|
182
|
+
border-right-color: transparent;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Trailing clear button */
|
|
186
|
+
.trailingButton {
|
|
187
|
+
position: relative;
|
|
188
|
+
z-index: 2;
|
|
189
|
+
flex: 0 0 auto;
|
|
190
|
+
|
|
191
|
+
display: inline-flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
justify-content: center;
|
|
194
|
+
|
|
195
|
+
padding-inline: var(--spacing-sm);
|
|
196
|
+
|
|
197
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
198
|
+
|
|
199
|
+
/* Seam join: don't draw left border; select covers it */
|
|
200
|
+
border-left-color: transparent;
|
|
201
|
+
margin-left: calc(-1 * var(--border-width-thin));
|
|
202
|
+
|
|
203
|
+
border-top-right-radius: var(--border-radius-default);
|
|
204
|
+
border-bottom-right-radius: var(--border-radius-default);
|
|
205
|
+
|
|
206
|
+
background: var(--color-bg-surface);
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
|
|
209
|
+
transition:
|
|
210
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
211
|
+
border-color var(--transition-fast) var(--ease-standard),
|
|
212
|
+
box-shadow var(--transition-fast) var(--ease-standard);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Hover state */
|
|
216
|
+
.trailingButton:hover:not(:disabled) {
|
|
217
|
+
border-color: var(--color-border-strong);
|
|
218
|
+
background-color: var(--color-bg-surface-hover, var(--color-bg-surface));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* Remove individual focus ring (group handles it) */
|
|
222
|
+
.trailingButton:focus-visible {
|
|
223
|
+
outline: none;
|
|
224
|
+
box-shadow: none;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Disabled clear button:
|
|
228
|
+
keep border/background stable; dim only icon */
|
|
229
|
+
.trailingButton:disabled {
|
|
230
|
+
cursor: default;
|
|
231
|
+
background: var(--color-bg-surface);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.trailingButton:disabled svg {
|
|
235
|
+
opacity: 0.4;
|
|
236
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var Button = require('../../../components/button/Button');
|
|
7
|
+
var ClearButton = require('../../../components/clear-button/ClearButton');
|
|
8
|
+
var useTooltipTrigger = require('../../../components/overlay/tooltip/useTooltipTrigger');
|
|
9
|
+
var styles = require('../input/Input.module.css');
|
|
10
|
+
var InputContainer = require('../input-container/InputContainer');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
15
|
+
|
|
16
|
+
function mergeRefs(...refs) {
|
|
17
|
+
return (node) => {
|
|
18
|
+
for (const ref of refs) {
|
|
19
|
+
if (!ref) continue;
|
|
20
|
+
if (typeof ref === "function") ref(node);
|
|
21
|
+
else ref.current = node;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const Input = react.forwardRef(function Input2({
|
|
26
|
+
label,
|
|
27
|
+
error,
|
|
28
|
+
helpText,
|
|
29
|
+
orientation = "vertical",
|
|
30
|
+
labelWidth = "160px",
|
|
31
|
+
fullWidth = false,
|
|
32
|
+
required,
|
|
33
|
+
tooltip,
|
|
34
|
+
tooltipPlacement = "right",
|
|
35
|
+
modified = false,
|
|
36
|
+
icon,
|
|
37
|
+
autoFocus,
|
|
38
|
+
minWidth,
|
|
39
|
+
width,
|
|
40
|
+
maxWidth,
|
|
41
|
+
inputSize = "md",
|
|
42
|
+
variant = "outlined",
|
|
43
|
+
onClear,
|
|
44
|
+
clearAriaLabel,
|
|
45
|
+
onButtonClick,
|
|
46
|
+
buttonDisabled = false,
|
|
47
|
+
buttonLabel,
|
|
48
|
+
buttonIcon,
|
|
49
|
+
trailingLabel,
|
|
50
|
+
id,
|
|
51
|
+
tooltipOpenOnFocus = true,
|
|
52
|
+
style,
|
|
53
|
+
className,
|
|
54
|
+
fieldClassName,
|
|
55
|
+
inputClassName,
|
|
56
|
+
startAdornment,
|
|
57
|
+
endAdornment,
|
|
58
|
+
...inputProps
|
|
59
|
+
}, ref) {
|
|
60
|
+
const inputRef = react.useRef(null);
|
|
61
|
+
const reactId = react.useId();
|
|
62
|
+
const inputId = id != null ? id : `input-${reactId}`;
|
|
63
|
+
react.useEffect(() => {
|
|
64
|
+
var _a;
|
|
65
|
+
if (autoFocus) (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
66
|
+
}, [autoFocus]);
|
|
67
|
+
const hasButton = Boolean(onButtonClick || buttonLabel || buttonIcon);
|
|
68
|
+
const hasTrailingLabel = Boolean(trailingLabel);
|
|
69
|
+
const hasValue = Boolean(inputProps.value);
|
|
70
|
+
const hasVisibleClear = Boolean(onClear && hasValue);
|
|
71
|
+
const hasEndAdornment = Boolean(endAdornment);
|
|
72
|
+
const reservesInlineClearSlot = Boolean(onClear);
|
|
73
|
+
const hasInlineClear = Boolean(hasVisibleClear && hasEndAdornment);
|
|
74
|
+
const rootStyle = {
|
|
75
|
+
...style != null ? style : {},
|
|
76
|
+
...minWidth ? { ["--input-min-width"]: minWidth } : null,
|
|
77
|
+
...width ? { ["--input-width"]: width } : null,
|
|
78
|
+
...maxWidth ? { ["--input-max-width"]: maxWidth } : null
|
|
79
|
+
};
|
|
80
|
+
const { triggerProps } = useTooltipTrigger.useTooltipTrigger({
|
|
81
|
+
content: tooltip,
|
|
82
|
+
placement: tooltipPlacement,
|
|
83
|
+
offset: 8,
|
|
84
|
+
delayOpenMs: 0,
|
|
85
|
+
focusOpenMode: tooltipOpenOnFocus ? "any" : "focus-visible",
|
|
86
|
+
closeOnPointerDown: false
|
|
87
|
+
});
|
|
88
|
+
const trailingButtonVariant = variant === "outlined" || variant === "standalone" ? "outlined" : "default";
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
InputContainer.InputContainer,
|
|
91
|
+
{
|
|
92
|
+
label,
|
|
93
|
+
labelAction: inputProps.labelAction,
|
|
94
|
+
htmlFor: inputId,
|
|
95
|
+
fullWidth,
|
|
96
|
+
error,
|
|
97
|
+
helpText,
|
|
98
|
+
orientation,
|
|
99
|
+
labelWidth,
|
|
100
|
+
required,
|
|
101
|
+
modified,
|
|
102
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
style: rootStyle,
|
|
106
|
+
className: [
|
|
107
|
+
styles__default.default.container,
|
|
108
|
+
fullWidth ? styles__default.default.fullWidth : "",
|
|
109
|
+
onClear ? styles__default.default.withClear : "",
|
|
110
|
+
hasInlineClear ? styles__default.default.withInlineClear : "",
|
|
111
|
+
hasButton ? styles__default.default.withButton : "",
|
|
112
|
+
hasTrailingLabel ? styles__default.default.withTrailingLabel : "",
|
|
113
|
+
className != null ? className : ""
|
|
114
|
+
].filter(Boolean).join(" "),
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: [
|
|
120
|
+
styles__default.default.field,
|
|
121
|
+
styles__default.default[variant],
|
|
122
|
+
icon ? styles__default.default.fieldWithIcon : "",
|
|
123
|
+
inputSize ? styles__default.default[inputSize] : "",
|
|
124
|
+
modified ? styles__default.default.modified : "",
|
|
125
|
+
fieldClassName != null ? fieldClassName : ""
|
|
126
|
+
].filter(Boolean).join(" "),
|
|
127
|
+
"data-forminput": "field",
|
|
128
|
+
"data-modified": modified ? "true" : void 0,
|
|
129
|
+
"aria-disabled": inputProps.disabled ? "true" : void 0,
|
|
130
|
+
...tooltip ? triggerProps : {},
|
|
131
|
+
children: [
|
|
132
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.icon, "data-input-role": "icon", children: icon }),
|
|
133
|
+
startAdornment && /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.startAdornment, "data-input-role": "start-adornment", children: startAdornment }),
|
|
134
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
135
|
+
"input",
|
|
136
|
+
{
|
|
137
|
+
...inputProps,
|
|
138
|
+
id: inputId,
|
|
139
|
+
ref: mergeRefs(inputRef, ref),
|
|
140
|
+
className: [styles__default.default.input, inputSize ? styles__default.default[inputSize] : "", inputClassName != null ? inputClassName : ""].filter(Boolean).join(" ")
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
(reservesInlineClearSlot || hasEndAdornment) && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.endAdornment, "data-input-role": "end-adornment", children: [
|
|
144
|
+
reservesInlineClearSlot ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
className: styles__default.default.clearSlot,
|
|
148
|
+
"aria-hidden": hasVisibleClear ? void 0 : "true",
|
|
149
|
+
children: hasVisibleClear && onClear ? /* @__PURE__ */ jsxRuntime.jsx(ClearButton.ClearButton, { onClick: onClear, ariaLabel: clearAriaLabel }) : null
|
|
150
|
+
}
|
|
151
|
+
) : null,
|
|
152
|
+
endAdornment
|
|
153
|
+
] }),
|
|
154
|
+
hasVisibleClear && !hasEndAdornment && onClear ? /* @__PURE__ */ jsxRuntime.jsx(ClearButton.ClearButton, { onClick: onClear, ariaLabel: clearAriaLabel, absolute: true }) : null
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
hasTrailingLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
|
+
"span",
|
|
160
|
+
{
|
|
161
|
+
className: [styles__default.default.trailingLabel, inputSize ? styles__default.default[inputSize] : ""].filter(Boolean).join(" "),
|
|
162
|
+
children: trailingLabel
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
hasButton && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
166
|
+
Button.Button,
|
|
167
|
+
{
|
|
168
|
+
onClick: onButtonClick,
|
|
169
|
+
disabled: buttonDisabled,
|
|
170
|
+
className: styles__default.default.trailingButton,
|
|
171
|
+
type: "button",
|
|
172
|
+
variant: trailingButtonVariant,
|
|
173
|
+
size: inputSize,
|
|
174
|
+
children: [
|
|
175
|
+
buttonIcon != null ? buttonIcon : null,
|
|
176
|
+
buttonLabel != null ? buttonLabel : null
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
});
|
|
186
|
+
Input.displayName = "Input";
|
|
187
|
+
|
|
188
|
+
exports.Input = Input;
|
|
@@ -11,6 +11,7 @@ export type InputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size
|
|
|
11
11
|
inputSize?: Exclude<Size, 'xl'>;
|
|
12
12
|
variant?: InputVariant;
|
|
13
13
|
onClear?: (event?: React.MouseEvent | React.KeyboardEvent) => void;
|
|
14
|
+
clearAriaLabel?: string;
|
|
14
15
|
onButtonClick?: () => void;
|
|
15
16
|
buttonDisabled?: boolean;
|
|
16
17
|
buttonLabel?: string;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useRef, useId, useEffect } from 'react';
|
|
4
|
+
import { Button } from '../../../components/button/Button';
|
|
5
|
+
import { ClearButton } from '../../../components/clear-button/ClearButton';
|
|
6
|
+
import { useTooltipTrigger } from '../../../components/overlay/tooltip/useTooltipTrigger';
|
|
7
|
+
import styles from '../input/Input.module.css';
|
|
8
|
+
import { InputContainer } from '../input-container/InputContainer';
|
|
9
|
+
|
|
10
|
+
function mergeRefs(...refs) {
|
|
11
|
+
return (node) => {
|
|
12
|
+
for (const ref of refs) {
|
|
13
|
+
if (!ref) continue;
|
|
14
|
+
if (typeof ref === "function") ref(node);
|
|
15
|
+
else ref.current = node;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const Input = forwardRef(function Input2({
|
|
20
|
+
label,
|
|
21
|
+
error,
|
|
22
|
+
helpText,
|
|
23
|
+
orientation = "vertical",
|
|
24
|
+
labelWidth = "160px",
|
|
25
|
+
fullWidth = false,
|
|
26
|
+
required,
|
|
27
|
+
tooltip,
|
|
28
|
+
tooltipPlacement = "right",
|
|
29
|
+
modified = false,
|
|
30
|
+
icon,
|
|
31
|
+
autoFocus,
|
|
32
|
+
minWidth,
|
|
33
|
+
width,
|
|
34
|
+
maxWidth,
|
|
35
|
+
inputSize = "md",
|
|
36
|
+
variant = "outlined",
|
|
37
|
+
onClear,
|
|
38
|
+
clearAriaLabel,
|
|
39
|
+
onButtonClick,
|
|
40
|
+
buttonDisabled = false,
|
|
41
|
+
buttonLabel,
|
|
42
|
+
buttonIcon,
|
|
43
|
+
trailingLabel,
|
|
44
|
+
id,
|
|
45
|
+
tooltipOpenOnFocus = true,
|
|
46
|
+
style,
|
|
47
|
+
className,
|
|
48
|
+
fieldClassName,
|
|
49
|
+
inputClassName,
|
|
50
|
+
startAdornment,
|
|
51
|
+
endAdornment,
|
|
52
|
+
...inputProps
|
|
53
|
+
}, ref) {
|
|
54
|
+
const inputRef = useRef(null);
|
|
55
|
+
const reactId = useId();
|
|
56
|
+
const inputId = id != null ? id : `input-${reactId}`;
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
if (autoFocus) (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
60
|
+
}, [autoFocus]);
|
|
61
|
+
const hasButton = Boolean(onButtonClick || buttonLabel || buttonIcon);
|
|
62
|
+
const hasTrailingLabel = Boolean(trailingLabel);
|
|
63
|
+
const hasValue = Boolean(inputProps.value);
|
|
64
|
+
const hasVisibleClear = Boolean(onClear && hasValue);
|
|
65
|
+
const hasEndAdornment = Boolean(endAdornment);
|
|
66
|
+
const reservesInlineClearSlot = Boolean(onClear);
|
|
67
|
+
const hasInlineClear = Boolean(hasVisibleClear && hasEndAdornment);
|
|
68
|
+
const rootStyle = {
|
|
69
|
+
...style != null ? style : {},
|
|
70
|
+
...minWidth ? { ["--input-min-width"]: minWidth } : null,
|
|
71
|
+
...width ? { ["--input-width"]: width } : null,
|
|
72
|
+
...maxWidth ? { ["--input-max-width"]: maxWidth } : null
|
|
73
|
+
};
|
|
74
|
+
const { triggerProps } = useTooltipTrigger({
|
|
75
|
+
content: tooltip,
|
|
76
|
+
placement: tooltipPlacement,
|
|
77
|
+
offset: 8,
|
|
78
|
+
delayOpenMs: 0,
|
|
79
|
+
focusOpenMode: tooltipOpenOnFocus ? "any" : "focus-visible",
|
|
80
|
+
closeOnPointerDown: false
|
|
81
|
+
});
|
|
82
|
+
const trailingButtonVariant = variant === "outlined" || variant === "standalone" ? "outlined" : "default";
|
|
83
|
+
return /* @__PURE__ */ jsx(
|
|
84
|
+
InputContainer,
|
|
85
|
+
{
|
|
86
|
+
label,
|
|
87
|
+
labelAction: inputProps.labelAction,
|
|
88
|
+
htmlFor: inputId,
|
|
89
|
+
fullWidth,
|
|
90
|
+
error,
|
|
91
|
+
helpText,
|
|
92
|
+
orientation,
|
|
93
|
+
labelWidth,
|
|
94
|
+
required,
|
|
95
|
+
modified,
|
|
96
|
+
children: /* @__PURE__ */ jsxs(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
style: rootStyle,
|
|
100
|
+
className: [
|
|
101
|
+
styles.container,
|
|
102
|
+
fullWidth ? styles.fullWidth : "",
|
|
103
|
+
onClear ? styles.withClear : "",
|
|
104
|
+
hasInlineClear ? styles.withInlineClear : "",
|
|
105
|
+
hasButton ? styles.withButton : "",
|
|
106
|
+
hasTrailingLabel ? styles.withTrailingLabel : "",
|
|
107
|
+
className != null ? className : ""
|
|
108
|
+
].filter(Boolean).join(" "),
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsxs(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: [
|
|
114
|
+
styles.field,
|
|
115
|
+
styles[variant],
|
|
116
|
+
icon ? styles.fieldWithIcon : "",
|
|
117
|
+
inputSize ? styles[inputSize] : "",
|
|
118
|
+
modified ? styles.modified : "",
|
|
119
|
+
fieldClassName != null ? fieldClassName : ""
|
|
120
|
+
].filter(Boolean).join(" "),
|
|
121
|
+
"data-forminput": "field",
|
|
122
|
+
"data-modified": modified ? "true" : void 0,
|
|
123
|
+
"aria-disabled": inputProps.disabled ? "true" : void 0,
|
|
124
|
+
...tooltip ? triggerProps : {},
|
|
125
|
+
children: [
|
|
126
|
+
icon && /* @__PURE__ */ jsx("span", { className: styles.icon, "data-input-role": "icon", children: icon }),
|
|
127
|
+
startAdornment && /* @__PURE__ */ jsx("span", { className: styles.startAdornment, "data-input-role": "start-adornment", children: startAdornment }),
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
"input",
|
|
130
|
+
{
|
|
131
|
+
...inputProps,
|
|
132
|
+
id: inputId,
|
|
133
|
+
ref: mergeRefs(inputRef, ref),
|
|
134
|
+
className: [styles.input, inputSize ? styles[inputSize] : "", inputClassName != null ? inputClassName : ""].filter(Boolean).join(" ")
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
(reservesInlineClearSlot || hasEndAdornment) && /* @__PURE__ */ jsxs("span", { className: styles.endAdornment, "data-input-role": "end-adornment", children: [
|
|
138
|
+
reservesInlineClearSlot ? /* @__PURE__ */ jsx(
|
|
139
|
+
"span",
|
|
140
|
+
{
|
|
141
|
+
className: styles.clearSlot,
|
|
142
|
+
"aria-hidden": hasVisibleClear ? void 0 : "true",
|
|
143
|
+
children: hasVisibleClear && onClear ? /* @__PURE__ */ jsx(ClearButton, { onClick: onClear, ariaLabel: clearAriaLabel }) : null
|
|
144
|
+
}
|
|
145
|
+
) : null,
|
|
146
|
+
endAdornment
|
|
147
|
+
] }),
|
|
148
|
+
hasVisibleClear && !hasEndAdornment && onClear ? /* @__PURE__ */ jsx(ClearButton, { onClick: onClear, ariaLabel: clearAriaLabel, absolute: true }) : null
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
hasTrailingLabel && /* @__PURE__ */ jsx(
|
|
153
|
+
"span",
|
|
154
|
+
{
|
|
155
|
+
className: [styles.trailingLabel, inputSize ? styles[inputSize] : ""].filter(Boolean).join(" "),
|
|
156
|
+
children: trailingLabel
|
|
157
|
+
}
|
|
158
|
+
),
|
|
159
|
+
hasButton && /* @__PURE__ */ jsxs(
|
|
160
|
+
Button,
|
|
161
|
+
{
|
|
162
|
+
onClick: onButtonClick,
|
|
163
|
+
disabled: buttonDisabled,
|
|
164
|
+
className: styles.trailingButton,
|
|
165
|
+
type: "button",
|
|
166
|
+
variant: trailingButtonVariant,
|
|
167
|
+
size: inputSize,
|
|
168
|
+
children: [
|
|
169
|
+
buttonIcon != null ? buttonIcon : null,
|
|
170
|
+
buttonLabel != null ? buttonLabel : null
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
});
|
|
180
|
+
Input.displayName = "Input";
|
|
181
|
+
|
|
182
|
+
export { Input };
|