@keboola/design 11.9.0 → 12.0.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/AGENTS.md +34 -8
- package/CHANGELOG.md +155 -0
- package/COMPONENT-API.md +337 -289
- package/README.md +11 -1
- package/dist/{AIKit-ELIsegJz.js → AIKit-BD4r7ff-.js} +404 -243
- package/dist/AIKit-BD4r7ff-.js.map +1 -0
- package/dist/{Alert-BsIM_oFK.js → Alert-UI-CIs-1.js} +16 -16
- package/dist/Alert-UI-CIs-1.js.map +1 -0
- package/dist/{AlertModal-BGJdaRRj.js → AlertModal-Th2khjPi.js} +5 -5
- package/dist/AlertModal-Th2khjPi.js.map +1 -0
- package/dist/{AppShell-DRgJxpXW.js → AppShell-WSQabK8r.js} +15 -52
- package/dist/AppShell-WSQabK8r.js.map +1 -0
- package/dist/{AutoSaveTextarea-BeuWuszr.js → AutoSaveTextarea-C5iIr2Ts.js} +2 -2
- package/dist/{AutoSaveTextarea-BeuWuszr.js.map → AutoSaveTextarea-C5iIr2Ts.js.map} +1 -1
- package/dist/{Badge-o5jURtpB.js → Badge-DIjhwPvh.js} +4 -9
- package/dist/Badge-DIjhwPvh.js.map +1 -0
- package/dist/{BrandEditor-BsTBM3s6.js → BrandEditor-BU23Vl8V.js} +7 -7
- package/dist/{BrandEditor-BsTBM3s6.js.map → BrandEditor-BU23Vl8V.js.map} +1 -1
- package/dist/{BrandLogo-CoKBk4MI.js → BrandLogo-CKpVSZb6.js} +4 -4
- package/dist/BrandLogo-CKpVSZb6.js.map +1 -0
- package/dist/{Breadcrumb-xqEUxfwn.js → Breadcrumb-p9HtMLCc.js} +8 -14
- package/dist/Breadcrumb-p9HtMLCc.js.map +1 -0
- package/dist/{Button-DsRrU5F1.js → Button-Ca4Q3VJU.js} +31 -13
- package/dist/Button-Ca4Q3VJU.js.map +1 -0
- package/dist/{Calendar-cG5NIJ4O.js → Calendar-DFtmZzbF.js} +99 -99
- package/dist/Calendar-DFtmZzbF.js.map +1 -0
- package/dist/{Card-Dyo7055Q.js → Card-Cr9MBNHu.js} +4 -4
- package/dist/Card-Cr9MBNHu.js.map +1 -0
- package/dist/{Checkbox-Dq5fPNrO.js → Checkbox-8yIIgY7g.js} +4 -4
- package/dist/Checkbox-8yIIgY7g.js.map +1 -0
- package/dist/{Clipboard-BZitKiSA.js → Clipboard-_xf6hMDD.js} +2 -2
- package/dist/{Clipboard-BZitKiSA.js.map → Clipboard-_xf6hMDD.js.map} +1 -1
- package/dist/{ClipboardButton-KHQnPEh_.js → ClipboardButton-DHa1trtI.js} +4 -4
- package/dist/{ClipboardButton-KHQnPEh_.js.map → ClipboardButton-DHa1trtI.js.map} +1 -1
- package/dist/{CodeEditor-BJKJXA0c.js → CodeEditor-BSo-oLFG.js} +55 -165
- package/dist/CodeEditor-BSo-oLFG.js.map +1 -0
- package/dist/{ColorInput-Bj3dfPFA.js → ColorInput-DSMqrs2-.js} +12 -27
- package/dist/ColorInput-DSMqrs2-.js.map +1 -0
- package/dist/{ColorModeSwitch-CWt-DZGC.js → ColorModeSwitch-D7EuWyJz.js} +7 -17
- package/dist/ColorModeSwitch-D7EuWyJz.js.map +1 -0
- package/dist/Combobox-CxRAYOBt.js +1069 -0
- package/dist/Combobox-CxRAYOBt.js.map +1 -0
- package/dist/{Command-BDU3C1gg.js → Command-BU_cVurn.js} +4 -4
- package/dist/{Command-BDU3C1gg.js.map → Command-BU_cVurn.js.map} +1 -1
- package/dist/{CopyField-BHRQUyuF.js → CopyField-6_c-NdLO.js} +17 -53
- package/dist/{CopyField-BHRQUyuF.js.map → CopyField-6_c-NdLO.js.map} +1 -1
- package/dist/{DateInput-B6N8g0ra.js → DateInput-DyEErfJf.js} +6 -6
- package/dist/{DateInput-B6N8g0ra.js.map → DateInput-DyEErfJf.js.map} +1 -1
- package/dist/{DatePicker-nA8YdE84.js → DatePicker-CtSa9b3V.js} +3 -3
- package/dist/{DatePicker-nA8YdE84.js.map → DatePicker-CtSa9b3V.js.map} +1 -1
- package/dist/{DateRangeInput-7M9Z4cVO.js → DateRangeInput-Dg7-VUd9.js} +10 -14
- package/dist/DateRangeInput-Dg7-VUd9.js.map +1 -0
- package/dist/{DateRangePicker-DjSUFjh4.js → DateRangePicker-BoPnh4aH.js} +9 -13
- package/dist/DateRangePicker-BoPnh4aH.js.map +1 -0
- package/dist/DiffView-ppTIzh2h.js.map +1 -1
- package/dist/{DropdownMenu-CgVwhDvl.js → DropdownMenu-gRM-A8qU.js} +3 -3
- package/dist/DropdownMenu-gRM-A8qU.js.map +1 -0
- package/dist/{FieldItem-DZGIdiXE.js → FieldItem-2wMXQ0Qw.js} +12 -25
- package/dist/FieldItem-2wMXQ0Qw.js.map +1 -0
- package/dist/{FieldItem-vhIJW4pj.d.ts → FieldItem-CPN1xjN5.d.ts} +11 -25
- package/dist/{FileUpload-DYQCTGjU.js → FileUpload-C83tXuE2.js} +11 -16
- package/dist/{FileUpload-DYQCTGjU.js.map → FileUpload-C83tXuE2.js.map} +1 -1
- package/dist/{Form-CcK7dRrC.js → Form-95rVLfX8.js} +15 -23
- package/dist/{Form-CcK7dRrC.js.map → Form-95rVLfX8.js.map} +1 -1
- package/dist/{FormGroup-DR_gZ25-.js → FormGroup-CmNiAtU6.js} +11 -17
- package/dist/FormGroup-CmNiAtU6.js.map +1 -0
- package/dist/{FullScreenModal-CN9nAs72.js → FullScreenModal-CD7mYeTz.js} +15 -29
- package/dist/FullScreenModal-CD7mYeTz.js.map +1 -0
- package/dist/{HoverCard-B9ZMJxjn.js → HoverCard-B8OKu9XZ.js} +2 -2
- package/dist/{HoverCard-B9ZMJxjn.js.map → HoverCard-B8OKu9XZ.js.map} +1 -1
- package/dist/{InputGroup-Do8K2hvD.js → InputGroup-B4QOPxHl.js} +11 -13
- package/dist/InputGroup-B4QOPxHl.js.map +1 -0
- package/dist/{Kbd-LCFMumoq.js → Kbd-J4n1J6i4.js} +23 -13
- package/dist/Kbd-J4n1J6i4.js.map +1 -0
- package/dist/{MarkedText-DNGEUVWc.js → MarkedText-DlmlJO0u.js} +2 -2
- package/dist/{MarkedText-DNGEUVWc.js.map → MarkedText-DlmlJO0u.js.map} +1 -1
- package/dist/{MermaidDiagram-ZG0iiDV_.js → MermaidDiagram-BQvz6bhv.js} +16 -34
- package/dist/MermaidDiagram-BQvz6bhv.js.map +1 -0
- package/dist/{Modal-I3VWk2oo.js → Modal-Driyqs_N.js} +17 -34
- package/dist/Modal-Driyqs_N.js.map +1 -0
- package/dist/{ModalTitle-CeLM_mX9.js → ModalTitle-BxopkIoQ.js} +3 -3
- package/dist/ModalTitle-BxopkIoQ.js.map +1 -0
- package/dist/{MultiActionButtonGroup-CYZ8IgSf.js → MultiActionButtonGroup-BPnmzBtw.js} +3 -3
- package/dist/{MultiActionButtonGroup-CYZ8IgSf.js.map → MultiActionButtonGroup-BPnmzBtw.js.map} +1 -1
- package/dist/{Navbar-Liy1TPI7.js → Navbar-B_DNpv5s.js} +9 -13
- package/dist/{Navbar-Liy1TPI7.js.map → Navbar-B_DNpv5s.js.map} +1 -1
- package/dist/{OtpInput-CbbymqYs.js → OtpInput-I8B8Vjdl.js} +2 -2
- package/dist/{OtpInput-CbbymqYs.js.map → OtpInput-I8B8Vjdl.js.map} +1 -1
- package/dist/{PageHeader-Q3IpCnQd.js → PageHeader-CgfyXpf1.js} +13 -26
- package/dist/PageHeader-CgfyXpf1.js.map +1 -0
- package/dist/{PageLayout-DSVM-ASz.js → PageLayout-DiAAILuS.js} +12 -20
- package/dist/PageLayout-DiAAILuS.js.map +1 -0
- package/dist/{PageToolbar-BKVJiDAL.js → PageToolbar-DOAtAnfL.js} +12 -42
- package/dist/PageToolbar-DOAtAnfL.js.map +1 -0
- package/dist/{Pagination-C_b7Xhey.js → Pagination-LaSg-5cl.js} +3 -3
- package/dist/{Pagination-C_b7Xhey.js.map → Pagination-LaSg-5cl.js.map} +1 -1
- package/dist/{Popconfirm-5pBzT_HQ.js → Popconfirm-SLz0zodk.js} +3 -3
- package/dist/{Popconfirm-5pBzT_HQ.js.map → Popconfirm-SLz0zodk.js.map} +1 -1
- package/dist/{Popover-BEbQrC_P.js → Popover-CEk915I1.js} +4 -3
- package/dist/Popover-CEk915I1.js.map +1 -0
- package/dist/{RadioGroup-Byc2mym4.js → RadioGroup-CBPRLRN0.js} +4 -4
- package/dist/{RadioGroup-Byc2mym4.js.map → RadioGroup-CBPRLRN0.js.map} +1 -1
- package/dist/{Search-Dhig_hPD.js → Search-DmkQo716.js} +3 -3
- package/dist/{Search-Dhig_hPD.js.map → Search-DmkQo716.js.map} +1 -1
- package/dist/{SearchInput-92r2bkA7.js → SearchInput-CEfQDNl3.js} +8 -13
- package/dist/SearchInput-CEfQDNl3.js.map +1 -0
- package/dist/{SectionNav-CNLJsiVG.js → SectionNav-B_qf0AXi.js} +10 -42
- package/dist/SectionNav-B_qf0AXi.js.map +1 -0
- package/dist/{Select-DV3Hak_l.js → Select-ByRvkZ3D.js} +8 -11
- package/dist/{Select-DV3Hak_l.js.map → Select-ByRvkZ3D.js.map} +1 -1
- package/dist/{Sheet-OparjIi-.js → Sheet-C-yXk5Da.js} +5 -9
- package/dist/Sheet-C-yXk5Da.js.map +1 -0
- package/dist/{Sidebar-CLEbBtNY.js → Sidebar-Ds0E6PbR.js} +16 -33
- package/dist/Sidebar-Ds0E6PbR.js.map +1 -0
- package/dist/{Slider-DLclvRws.js → Slider-DWdu9NuM.js} +3 -3
- package/dist/{Slider-DLclvRws.js.map → Slider-DWdu9NuM.js.map} +1 -1
- package/dist/{Stepper-C8sm9ZFM.js → Stepper-BLkLhfnd.js} +6 -9
- package/dist/{Stepper-C8sm9ZFM.js.map → Stepper-BLkLhfnd.js.map} +1 -1
- package/dist/{Switch-B0WdGSjz.js → Switch-DZvNePOm.js} +2 -2
- package/dist/{Switch-B0WdGSjz.js.map → Switch-DZvNePOm.js.map} +1 -1
- package/dist/{Table-CvYuTuNU.js → Table-BaVT5Tkn.js} +6 -11
- package/dist/{Table-CvYuTuNU.js.map → Table-BaVT5Tkn.js.map} +1 -1
- package/dist/{Tabs-eB974xJf.js → Tabs-Dt9oLYHC.js} +3 -3
- package/dist/{Tabs-eB974xJf.js.map → Tabs-Dt9oLYHC.js.map} +1 -1
- package/dist/{TextInput-CFTf4Cz1.js → TextInput-CDG2XpBl.js} +10 -14
- package/dist/TextInput-CDG2XpBl.js.map +1 -0
- package/dist/{ThemeProvider-DAmNn9Sd.js → ThemeProvider-DXsxFg1U.js} +13 -31
- package/dist/ThemeProvider-DXsxFg1U.js.map +1 -0
- package/dist/{TimePicker-BGeqc-Ed.js → TimePicker-CDGYrRxi.js} +2 -2
- package/dist/{TimePicker-BGeqc-Ed.js.map → TimePicker-CDGYrRxi.js.map} +1 -1
- package/dist/{Timeline-C8-wnRRr.js → Timeline-B-I6sb0M.js} +2 -2
- package/dist/{Timeline-C8-wnRRr.js.map → Timeline-B-I6sb0M.js.map} +1 -1
- package/dist/{Toast-Dr6Uw7ao.js → Toast-PfQf3vj-.js} +2 -2
- package/dist/{Toast-Dr6Uw7ao.js.map → Toast-PfQf3vj-.js.map} +1 -1
- package/dist/{Workbench-UR2FBC7I.js → Workbench-DmZzpkj7.js} +2 -2
- package/dist/{Workbench-UR2FBC7I.js.map → Workbench-DmZzpkj7.js.map} +1 -1
- package/dist/{ZoomableSvg-BZlk3PFJ.js → ZoomableSvg-BzXVfgnI.js} +5 -19
- package/dist/ZoomableSvg-BzXVfgnI.js.map +1 -0
- package/dist/charts.d.ts +21 -52
- package/dist/charts.js +13 -39
- package/dist/charts.js.map +1 -1
- package/dist/{context-D7X470dy.js → context-U293r3v-.js} +5 -9
- package/dist/context-U293r3v-.js.map +1 -0
- package/dist/editors.d.ts +27 -124
- package/dist/editors.js +29 -71
- package/dist/editors.js.map +1 -1
- package/dist/{findLiteralMatches-BGBw8Vbl.js → findLiteralMatches-DgGLzyG0.js} +8 -20
- package/dist/findLiteralMatches-DgGLzyG0.js.map +1 -0
- package/dist/flint.d.ts +3 -6
- package/dist/flint.js +31 -80
- package/dist/flint.js.map +1 -1
- package/dist/{icons-Cek151jC.js → icons-wcA70iQx.js} +105 -2
- package/dist/icons-wcA70iQx.js.map +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +2 -2
- package/dist/{index-m-kQEWiY.d.ts → index-B7k-09i1.d.ts} +14 -2
- package/dist/index.d.ts +1151 -1838
- package/dist/index.js +68 -67
- package/dist/internal/blocks/AIKit.js +2 -2
- package/dist/internal/blocks/AppShell.js +1 -1
- package/dist/internal/blocks/AuthLayout.js +7 -27
- package/dist/internal/blocks/AuthLayout.js.map +1 -1
- package/dist/internal/blocks/AutoSaveTextarea.js +1 -1
- package/dist/internal/blocks/BrandEditor.js +1 -1
- package/dist/internal/blocks/ChartPanel.js +4 -8
- package/dist/internal/blocks/ChartPanel.js.map +1 -1
- package/dist/internal/blocks/ChipEditor.js +13 -21
- package/dist/internal/blocks/ChipEditor.js.map +1 -1
- package/dist/internal/blocks/ClipboardButton.js +1 -1
- package/dist/internal/blocks/ColorInput.js +1 -1
- package/dist/internal/blocks/ColorModeSwitch.js +1 -1
- package/dist/internal/blocks/Command.js +1 -1
- package/dist/internal/blocks/CopyField.js +1 -1
- package/dist/internal/blocks/DashboardHero.js +4 -7
- package/dist/internal/blocks/DashboardHero.js.map +1 -1
- package/dist/internal/blocks/DateInput.js +1 -1
- package/dist/internal/blocks/DateRangeInput.js +1 -1
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
- package/dist/internal/blocks/EmptyState.js +5 -9
- package/dist/internal/blocks/EmptyState.js.map +1 -1
- package/dist/internal/blocks/ErrorState.js +5 -9
- package/dist/internal/blocks/ErrorState.js.map +1 -1
- package/dist/internal/blocks/ExportMenu.js +6 -10
- package/dist/internal/blocks/ExportMenu.js.map +1 -1
- package/dist/internal/blocks/Form/connectors/ComboboxField.js +40 -0
- package/dist/internal/blocks/Form/connectors/ComboboxField.js.map +1 -0
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +5 -22
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js.map +1 -1
- package/dist/internal/blocks/Form.js +1 -1
- package/dist/internal/blocks/FormGroup.js +1 -1
- package/dist/internal/blocks/GoogleButton.js +1 -1
- package/dist/internal/blocks/MicrosoftButton.js +1 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
- package/dist/internal/blocks/MultiCombobox.js +161 -154
- package/dist/internal/blocks/MultiCombobox.js.map +1 -1
- package/dist/internal/blocks/NumberInput.js +1 -1
- package/dist/internal/blocks/OtpInput.js +1 -1
- package/dist/internal/blocks/PageHeader.js +1 -1
- package/dist/internal/blocks/PageLayout.js +1 -1
- package/dist/internal/blocks/PageToolbar.js +1 -1
- package/dist/internal/blocks/PasswordInput.js +4 -4
- package/dist/internal/blocks/PasswordInput.js.map +1 -1
- package/dist/internal/blocks/SearchInput.js +1 -1
- package/dist/internal/blocks/SearchInputWithNavigation.js +4 -4
- package/dist/internal/blocks/SectionNav.js +1 -1
- package/dist/internal/blocks/SplitButton.js +3 -3
- package/dist/internal/blocks/StatCard.js +4 -8
- package/dist/internal/blocks/StatCard.js.map +1 -1
- package/dist/internal/blocks/TextInput.js +1 -1
- package/dist/internal/blocks/Textarea.js +2 -2
- package/dist/internal/blocks/TimeInput.js +5 -5
- package/dist/internal/blocks/TimeInput.js.map +1 -1
- package/dist/internal/components/Alert.js +1 -1
- package/dist/internal/components/AlertModal.js +1 -1
- package/dist/internal/components/Avatar.js +1 -1
- package/dist/internal/components/Badge.js +1 -1
- package/dist/internal/components/BrandLogo.js +1 -1
- package/dist/internal/components/Breadcrumb.js +1 -1
- package/dist/internal/components/Button.js +1 -1
- package/dist/internal/components/ButtonGroup.js.map +1 -1
- package/dist/internal/components/Calendar.js +1 -1
- package/dist/internal/components/Card.js +1 -1
- package/dist/internal/components/Checkbox.js +1 -1
- package/dist/internal/components/Clipboard.js +1 -1
- package/dist/internal/components/CollapsiblePanel.js +2 -2
- package/dist/internal/components/Combobox.js +2 -2
- package/dist/internal/components/DatePicker.js +1 -1
- package/dist/internal/components/DateRangePicker.js +1 -1
- package/dist/internal/components/DropdownMenu.js +1 -1
- package/dist/internal/components/FileUpload.js +1 -1
- package/dist/internal/components/FullScreenModal.js +1 -1
- package/dist/internal/components/HoverCard.js +1 -1
- package/dist/internal/components/InputGroup.js +1 -1
- package/dist/internal/components/Kbd.js +1 -1
- package/dist/internal/components/MarkedText.js +1 -1
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +1 -1
- package/dist/internal/components/Modal.js +1 -1
- package/dist/internal/components/Navbar.js +1 -1
- package/dist/internal/components/Pagination.js +1 -1
- package/dist/internal/components/PanelWithDetails.js +1 -1
- package/dist/internal/components/Popconfirm.js +1 -1
- package/dist/internal/components/Popover.js +1 -1
- package/dist/internal/components/RadioGroup.js +1 -1
- package/dist/internal/components/Search.js +1 -1
- package/dist/internal/components/Select.js +1 -1
- package/dist/internal/components/Separator.js.map +1 -1
- package/dist/internal/components/Sheet.js +1 -1
- package/dist/internal/components/Sidebar.js +1 -1
- package/dist/internal/components/Skeleton/Skeleton.js +5 -9
- package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/internal/components/Slider.js +1 -1
- package/dist/internal/components/SpotlightBackdrop.js +3 -8
- package/dist/internal/components/SpotlightBackdrop.js.map +1 -1
- package/dist/internal/components/StatusDot.js +8 -15
- package/dist/internal/components/StatusDot.js.map +1 -1
- package/dist/internal/components/Stepper.js +1 -1
- package/dist/internal/components/Switch.js +1 -1
- package/dist/internal/components/Table.js +1 -1
- package/dist/internal/components/Tabs.js +1 -1
- package/dist/internal/components/ThemeProvider.js +3 -3
- package/dist/internal/components/TimePicker.js +1 -1
- package/dist/internal/components/Timeline.js +1 -1
- package/dist/internal/components/Toast.js +2 -2
- package/dist/internal/components/Tooltip.js +1 -1
- package/dist/internal/components/Truncated.js +4 -8
- package/dist/internal/components/Truncated.js.map +1 -1
- package/dist/internal/components/Workbench.js +1 -1
- package/dist/internal/components/ZoomableSvg.js +1 -1
- package/dist/internal/hooks/useScrollbarPosition.js +1 -1
- package/dist/internal/hooks/useStableCallback.js +4 -13
- package/dist/internal/hooks/useStableCallback.js.map +1 -1
- package/dist/internal/utils.js +2 -2
- package/dist/markdown-editor.d.ts +15 -37
- package/dist/markdown-editor.js +17 -23
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +4 -6
- package/dist/mermaid.js +1 -1
- package/dist/rjsf.d.ts +9 -19
- package/dist/rjsf.js +44 -84
- package/dist/rjsf.js.map +1 -1
- package/dist/{styles-BAFscjSV.js → styles-gzcjOyKv.js} +6 -6
- package/dist/styles-gzcjOyKv.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/svgTransforms-Dw2hRA-i.js +51 -0
- package/dist/svgTransforms-Dw2hRA-i.js.map +1 -0
- package/dist/testing.d.ts +3 -10
- package/dist/testing.js +5 -12
- package/dist/testing.js.map +1 -1
- package/dist/themeTokens-7DEab0kp.js +31 -0
- package/dist/themeTokens-7DEab0kp.js.map +1 -0
- package/dist/{toast-DIC0iNRf.js → toast-CyXEdaCZ.js} +3 -3
- package/dist/toast-CyXEdaCZ.js.map +1 -0
- package/dist/{themeScopeContext-D7fSyb06.js → useColorSchemeState-Cw4MCXUs.js} +14 -14
- package/dist/useColorSchemeState-Cw4MCXUs.js.map +1 -0
- package/dist/{useControllableState-M6494mCT.js → useControllableState-CUYXMsfz.js} +3 -7
- package/dist/useControllableState-CUYXMsfz.js.map +1 -0
- package/dist/useElement-D-RjrGa4.js +21 -0
- package/dist/useElement-D-RjrGa4.js.map +1 -0
- package/dist/useThemeAttributes-B199Regy.js +67 -0
- package/dist/useThemeAttributes-B199Regy.js.map +1 -0
- package/dist/{utils-BW4AE8VP.js → utils-Bd28bWgm.js} +31 -26
- package/dist/utils-Bd28bWgm.js.map +1 -0
- package/dist/vega.d.ts +8 -30
- package/dist/vega.js +5 -13
- package/dist/vega.js.map +1 -1
- package/dist/{vegaTheme-CSvFEMBl.js → vegaTheme-VQMWTlBw.js} +7 -21
- package/dist/vegaTheme-VQMWTlBw.js.map +1 -0
- package/package.json +10 -9
- package/src/styles.css +120 -14
- package/src/theme.css +126 -6
- package/dist/AIKit-ELIsegJz.js.map +0 -1
- package/dist/Alert-BsIM_oFK.js.map +0 -1
- package/dist/AlertModal-BGJdaRRj.js.map +0 -1
- package/dist/AppShell-DRgJxpXW.js.map +0 -1
- package/dist/Badge-o5jURtpB.js.map +0 -1
- package/dist/BrandLogo-CoKBk4MI.js.map +0 -1
- package/dist/Breadcrumb-xqEUxfwn.js.map +0 -1
- package/dist/Button-DsRrU5F1.js.map +0 -1
- package/dist/Calendar-cG5NIJ4O.js.map +0 -1
- package/dist/Card-Dyo7055Q.js.map +0 -1
- package/dist/Checkbox-Dq5fPNrO.js.map +0 -1
- package/dist/CodeEditor-BJKJXA0c.js.map +0 -1
- package/dist/ColorInput-Bj3dfPFA.js.map +0 -1
- package/dist/ColorModeSwitch-CWt-DZGC.js.map +0 -1
- package/dist/Combobox-D8PrEqTG.js +0 -619
- package/dist/Combobox-D8PrEqTG.js.map +0 -1
- package/dist/DateRangeInput-7M9Z4cVO.js.map +0 -1
- package/dist/DateRangePicker-DjSUFjh4.js.map +0 -1
- package/dist/DropdownMenu-CgVwhDvl.js.map +0 -1
- package/dist/FieldItem-DZGIdiXE.js.map +0 -1
- package/dist/FormGroup-DR_gZ25-.js.map +0 -1
- package/dist/FullScreenModal-CN9nAs72.js.map +0 -1
- package/dist/InputGroup-Do8K2hvD.js.map +0 -1
- package/dist/Kbd-LCFMumoq.js.map +0 -1
- package/dist/MermaidDiagram-ZG0iiDV_.js.map +0 -1
- package/dist/Modal-I3VWk2oo.js.map +0 -1
- package/dist/ModalTitle-CeLM_mX9.js.map +0 -1
- package/dist/PageHeader-Q3IpCnQd.js.map +0 -1
- package/dist/PageLayout-DSVM-ASz.js.map +0 -1
- package/dist/PageToolbar-BKVJiDAL.js.map +0 -1
- package/dist/Popover-BEbQrC_P.js.map +0 -1
- package/dist/SearchInput-92r2bkA7.js.map +0 -1
- package/dist/SectionNav-CNLJsiVG.js.map +0 -1
- package/dist/Sheet-OparjIi-.js.map +0 -1
- package/dist/Sidebar-CLEbBtNY.js.map +0 -1
- package/dist/TextInput-CFTf4Cz1.js.map +0 -1
- package/dist/ThemeProvider-DAmNn9Sd.js.map +0 -1
- package/dist/ZoomableSvg-BZlk3PFJ.js.map +0 -1
- package/dist/context-D7X470dy.js.map +0 -1
- package/dist/findLiteralMatches-BGBw8Vbl.js.map +0 -1
- package/dist/icons-Cek151jC.js.map +0 -1
- package/dist/styles-BAFscjSV.js.map +0 -1
- package/dist/svgTransforms-CJAYPk7o.js +0 -81
- package/dist/svgTransforms-CJAYPk7o.js.map +0 -1
- package/dist/themeScopeContext-D7fSyb06.js.map +0 -1
- package/dist/themeTokens-qP1-55O7.js +0 -119
- package/dist/themeTokens-qP1-55O7.js.map +0 -1
- package/dist/toast-DIC0iNRf.js.map +0 -1
- package/dist/useControllableState-M6494mCT.js.map +0 -1
- package/dist/useElement-BK3AAiIf.js +0 -24
- package/dist/useElement-BK3AAiIf.js.map +0 -1
- package/dist/utils-BW4AE8VP.js.map +0 -1
- package/dist/vegaTheme-CSvFEMBl.js.map +0 -1
|
@@ -1,619 +0,0 @@
|
|
|
1
|
-
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
-
import { noop } from "./utils-BW4AE8VP.js";
|
|
3
|
-
import { useArgoDesign } from "./context-D7X470dy.js";
|
|
4
|
-
import { Check, ChevronDown, Plus, X } from "./icons-Cek151jC.js";
|
|
5
|
-
import { useStableCallback } from "./internal/hooks/useStableCallback.js";
|
|
6
|
-
import { InputGroup } from "./InputGroup-Do8K2hvD.js";
|
|
7
|
-
import { Badge } from "./Badge-o5jURtpB.js";
|
|
8
|
-
import { useEffect, useMemo, useState } from "react";
|
|
9
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
import { Combobox } from "@base-ui/react/combobox";
|
|
11
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
12
|
-
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
13
|
-
//#region src/components/Combobox/blankValues.ts
|
|
14
|
-
/**
|
|
15
|
-
* The two blank strings a Storage filter predicates on, in list order.
|
|
16
|
-
*
|
|
17
|
-
* - Reach for {@link withBlankValues} to offer them; this is the pair itself.
|
|
18
|
-
*/
|
|
19
|
-
const BLANK_VALUES = ["", " "];
|
|
20
|
-
const BLANK_LABELS = {
|
|
21
|
-
"": "[empty string]",
|
|
22
|
-
" ": "[space character]"
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* A string as a row or a chip shows it — named when its text is blank, itself otherwise.
|
|
26
|
-
*
|
|
27
|
-
* - Exported so an `itemToLabel` / `itemToChipLabel` / `itemToSelectedLabel` / `renderChips`
|
|
28
|
-
* override can keep the default naming instead of retyping the labels.
|
|
29
|
-
* - The two blank values get their own labels; any other whitespace-only string (a tab, a run of
|
|
30
|
-
* spaces) falls back to a generic one, so two different ones read alike.
|
|
31
|
-
* - Identity is unaffected — `toLabel` keys items off the raw string.
|
|
32
|
-
*/
|
|
33
|
-
const namedLabel = (text) => text.trim() === "" ? BLANK_LABELS[text] ?? "[whitespace]" : text;
|
|
34
|
-
/**
|
|
35
|
-
* `values` with both blank values offered ahead of them, and duplicates collapsed.
|
|
36
|
-
*
|
|
37
|
-
* - The dedupe matters where the list is the distinct values of a Storage column: it can already
|
|
38
|
-
* hold a blank, and two `Object.is`-equal rows both report `aria-selected` and toggle each other.
|
|
39
|
-
* - First occurrence wins, so the order of the values is otherwise preserved.
|
|
40
|
-
* - String items only — the seven Storage filters this serves are all string-valued.
|
|
41
|
-
*/
|
|
42
|
-
const withBlankValues = (values) => [.../* @__PURE__ */ new Set([...BLANK_VALUES, ...values])];
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/components/Combobox/ComboboxChip.tsx
|
|
45
|
-
/**
|
|
46
|
-
* Keeps a chip's own keyboard handling off its content's.
|
|
47
|
-
*
|
|
48
|
-
* - Base UI's chip calls `preventDefault` on Enter and Space, which would cancel the activation of
|
|
49
|
-
* a link or button rendered inside the chip.
|
|
50
|
-
* - Capture phase, because React dispatches capture and bubble in one pass over the event path:
|
|
51
|
-
* stopping here means the chip's own bubble handler never runs.
|
|
52
|
-
* - Guarded on the target, so keys the chip itself receives while focused — Backspace, Delete, the
|
|
53
|
-
* arrows — still reach that handler.
|
|
54
|
-
*/
|
|
55
|
-
const stopNestedKeyDown = (event) => {
|
|
56
|
-
if (event.target !== event.currentTarget) event.stopPropagation();
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* One chip in a `MultiCombobox`'s chip area — Badge chrome plus the remove button.
|
|
60
|
-
*
|
|
61
|
-
* - Position is the identity: Base UI removes the chip at an index, so render one per entry of
|
|
62
|
-
* `value`, in that order. There is no value prop to pass.
|
|
63
|
-
* - `children` is the chip's content, so it can hold a link or an action of its own.
|
|
64
|
-
* - Renders inside a `MultiCombobox`'s `renderChips` slot, or `Combobox.Chips`.
|
|
65
|
-
* - A chip the user cannot remove is a plain `Badge`, not a chip — a chip would take a position
|
|
66
|
-
* that a removal counts against.
|
|
67
|
-
*/
|
|
68
|
-
const ComboboxChip = ({ children, color, variant }) => {
|
|
69
|
-
const renderArgo = useArgoDesign();
|
|
70
|
-
return /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
71
|
-
render: /* @__PURE__ */ jsx(Badge.Root, {
|
|
72
|
-
color,
|
|
73
|
-
variant: variant ?? (renderArgo ? "pill" : "default"),
|
|
74
|
-
className: "tw:max-w-40"
|
|
75
|
-
}),
|
|
76
|
-
onKeyDownCapture: stopNestedKeyDown,
|
|
77
|
-
children: [/* @__PURE__ */ jsx(Badge.Label, { children }), /* @__PURE__ */ jsx(Badge.Addon, {
|
|
78
|
-
variant: "inline",
|
|
79
|
-
align: "inline-end",
|
|
80
|
-
children: /* @__PURE__ */ jsx(Combobox.ChipRemove, { render: /* @__PURE__ */ jsx(Badge.Button, {
|
|
81
|
-
"aria-label": "Remove value",
|
|
82
|
-
children: /* @__PURE__ */ jsx(X, { className: "tw:size-3" })
|
|
83
|
-
}) })
|
|
84
|
-
})]
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/components/Combobox/utils.ts
|
|
89
|
-
const isPlainObject = (item) => item !== null && typeof item === "object";
|
|
90
|
-
const isNumber = (item) => typeof item === "number";
|
|
91
|
-
const isString = (item) => typeof item === "string";
|
|
92
|
-
const isLabeledItem = (item) => isPlainObject(item) && Reflect.has(item, "label") && Reflect.has(item, "value");
|
|
93
|
-
const isInternalItem = (item) => isLabeledItem(item) && "__marker" in item;
|
|
94
|
-
const isSelectAllItem = (item) => isInternalItem(item) && item.__marker === "selectAll";
|
|
95
|
-
const isCreatableItem = (item) => {
|
|
96
|
-
return isInternalItem(item) && item.__marker === "creatable";
|
|
97
|
-
};
|
|
98
|
-
const isGroupItem = (itemOrGroup) => itemOrGroup !== null && typeof itemOrGroup === "object" && Reflect.has(itemOrGroup, "items");
|
|
99
|
-
const isGroupItems = (items) => {
|
|
100
|
-
if (!Array.isArray(items)) return false;
|
|
101
|
-
if (items.length === 0) return false;
|
|
102
|
-
return isGroupItem(items[0]);
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Node a list row and a chip show for an item.
|
|
106
|
-
*
|
|
107
|
-
* - Names a blank string, because a row or a chip rendering as nothing is indistinguishable from
|
|
108
|
-
* an empty control. {@link toLabel} deliberately does not, so the input keeps the raw value.
|
|
109
|
-
* - A non-string `label` (a JSX node) passes through untouched.
|
|
110
|
-
*/
|
|
111
|
-
const defaultItemToLabel = (item) => {
|
|
112
|
-
if (isNumber(item)) return item;
|
|
113
|
-
if (isString(item)) return namedLabel(item);
|
|
114
|
-
if (!isLabeledItem(item)) throw new Error("Combobox: Item does not have a `label` field. Pass `itemToLabel` for custom item shapes.");
|
|
115
|
-
return isString(item.label) ? namedLabel(item.label) : item.label;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Display string for an item — mirrors base-ui's own default logic.
|
|
119
|
-
*
|
|
120
|
-
* - Also the default search text and the closed `Combobox`'s input value, so it is the item's
|
|
121
|
-
* string identity rather than its decoration.
|
|
122
|
-
* - Blank strings are deliberately **not** named here: a `''` reaching this is as likely to be an
|
|
123
|
-
* owner's "nothing selected" as a real value.
|
|
124
|
-
* - Naming one would paint text into an empty input and suppress the placeholder.
|
|
125
|
-
* - Naming lives in {@link defaultItemToLabel}, which only rows and chips read.
|
|
126
|
-
*/
|
|
127
|
-
const toLabel = (item) => {
|
|
128
|
-
if (isString(item)) return item;
|
|
129
|
-
if (isLabeledItem(item)) {
|
|
130
|
-
if (item.label) return item.label;
|
|
131
|
-
if (item.value) return item.value;
|
|
132
|
-
}
|
|
133
|
-
return String(item);
|
|
134
|
-
};
|
|
135
|
-
/** Equality key for an item — prefers .value for stable identity. */
|
|
136
|
-
const toValueKey = (item) => {
|
|
137
|
-
if (isString(item)) return item;
|
|
138
|
-
if (isLabeledItem(item)) {
|
|
139
|
-
if (item.value) return item.value;
|
|
140
|
-
if (item.label) return item.label;
|
|
141
|
-
}
|
|
142
|
-
return String(item);
|
|
143
|
-
};
|
|
144
|
-
const defaultItemToIcon = (item) => isLabeledItem(item) ? item.icon : void 0;
|
|
145
|
-
const defaultItemToDisabled = (item) => isLabeledItem(item) ? item.disabled ?? false : false;
|
|
146
|
-
const defaultGroupToLabel = () => void 0;
|
|
147
|
-
const selectAllItem = {
|
|
148
|
-
__marker: "selectAll",
|
|
149
|
-
value: "__select_all__",
|
|
150
|
-
label: "Select All"
|
|
151
|
-
};
|
|
152
|
-
const createCreatableItem = (query) => ({
|
|
153
|
-
__marker: "creatable",
|
|
154
|
-
value: query,
|
|
155
|
-
label: query
|
|
156
|
-
});
|
|
157
|
-
/**
|
|
158
|
-
* Item-equality predicate for a Base UI combobox root.
|
|
159
|
-
*
|
|
160
|
-
* - An injected sentinel row equals only a sentinel of the same marker with the same value key —
|
|
161
|
-
* the create row is rebuilt on every keystroke, so reference equality would never match it.
|
|
162
|
-
* - A sentinel never equals a real item, however the two keys read: that is what the marker is for.
|
|
163
|
-
* - Real items fall through to the caller's predicate, then to Base UI's own `Object.is`.
|
|
164
|
-
*/
|
|
165
|
-
const toItemEquality = (isItemEqualToValue) => (a, b) => {
|
|
166
|
-
if (isInternalItem(a) || isInternalItem(b)) return isInternalItem(a) && isInternalItem(b) && a.__marker === b.__marker && toValueKey(a) === toValueKey(b);
|
|
167
|
-
return isItemEqualToValue?.(a, b) ?? Object.is(a, b);
|
|
168
|
-
};
|
|
169
|
-
const defaultToCreateValue = (query, value, queryToCreateValue) => {
|
|
170
|
-
if (queryToCreateValue) return queryToCreateValue(query);
|
|
171
|
-
if (value === void 0) return query;
|
|
172
|
-
if (isString(value)) return query;
|
|
173
|
-
if (isLabeledItem(value)) return {
|
|
174
|
-
value: query,
|
|
175
|
-
label: query
|
|
176
|
-
};
|
|
177
|
-
throw new Error("Combobox: Cannot infer item shape for `allowCreate`. Pass `queryToCreateValue` for custom item shapes.");
|
|
178
|
-
};
|
|
179
|
-
const defaultQueryToCreateLabel = (query) => `Create "${query}"`;
|
|
180
|
-
//#endregion
|
|
181
|
-
//#region src/components/Combobox/ComboboxChips.tsx
|
|
182
|
-
const ComboboxChips = ({ maxVisible = 3, itemToChipLabel = defaultItemToLabel, itemToChipColor, pinnedChipLabels, variant = "pill", children }) => /* @__PURE__ */ jsx(Combobox.Value, { children: (rawValues) => {
|
|
183
|
-
const values = rawValues.filter((value) => !isInternalItem(value));
|
|
184
|
-
if (children) return children(values);
|
|
185
|
-
const visible = values.slice(0, maxVisible);
|
|
186
|
-
const overflow = values.slice(maxVisible);
|
|
187
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
188
|
-
pinnedChipLabels?.map((label, index) => /* @__PURE__ */ jsx(Badge, {
|
|
189
|
-
className: "tw:max-w-40",
|
|
190
|
-
variant,
|
|
191
|
-
children: label
|
|
192
|
-
}, index)),
|
|
193
|
-
visible.map((value, index) => /* @__PURE__ */ jsx(ComboboxChip, {
|
|
194
|
-
color: itemToChipColor?.(value),
|
|
195
|
-
variant,
|
|
196
|
-
children: itemToChipLabel(value)
|
|
197
|
-
}, index)),
|
|
198
|
-
overflow.length > 0 && /* @__PURE__ */ jsx(Badge.Root, {
|
|
199
|
-
variant: "pill",
|
|
200
|
-
children: /* @__PURE__ */ jsxs(Badge.Label, { children: ["+", overflow.length] })
|
|
201
|
-
})
|
|
202
|
-
] });
|
|
203
|
-
} });
|
|
204
|
-
//#endregion
|
|
205
|
-
//#region src/components/Combobox/ComboboxContent.tsx
|
|
206
|
-
const ComboboxContent = ({ ref, align = "start", side = "bottom", sideOffset = 4, alignOffset, anchor, container, className, children, ...popupProps }) => {
|
|
207
|
-
const effectiveVariant = useArgoDesign() ? "argo" : "default";
|
|
208
|
-
return /* @__PURE__ */ jsx(Combobox.Portal, {
|
|
209
|
-
container,
|
|
210
|
-
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
211
|
-
asChild: true,
|
|
212
|
-
children: /* @__PURE__ */ jsx(Combobox.Positioner, {
|
|
213
|
-
align,
|
|
214
|
-
side,
|
|
215
|
-
sideOffset,
|
|
216
|
-
alignOffset,
|
|
217
|
-
anchor,
|
|
218
|
-
className: "tw:isolate tw:z-[1055] tailwindcss-preflight",
|
|
219
|
-
children: /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
220
|
-
ref,
|
|
221
|
-
"data-chips": !!anchor,
|
|
222
|
-
"data-variant": effectiveVariant,
|
|
223
|
-
className: cn("tw:!pointer-events-auto", "tw:group/combobox-content", "tw:relative", "tw:flex tw:flex-col tw:overflow-hidden", "tw:max-h-[var(--available-height)]", "tw:w-[var(--anchor-width)]", "tw:max-w-[var(--available-width)]", "tw:origin-[var(--transform-origin)]", "tw:data-[chips=true]:min-w-[var(--anchor-width)]", "tw:rounded-lg", "tw:data-[variant=default]:rounded", "tw:bg-popover", "tw:text-popover-foreground", "tw:shadow-md", "tw:ring-1", "tw:ring-foreground/10", "tw:duration-100", "data-open:animate-in", "data-open:fade-in-0", "data-open:zoom-in-95", "data-closed:animate-out", "data-closed:fade-out-0", "data-closed:zoom-out-95", "tw:data-[side=bottom]:slide-in-from-top-2", "tw:data-[side=top]:slide-in-from-bottom-2", "tw:data-[side=left]:slide-in-from-right-2", "tw:data-[side=right]:slide-in-from-left-2", "tw:data-[side=inline-start]:slide-in-from-right-2", "tw:data-[side=inline-end]:slide-in-from-left-2", className),
|
|
224
|
-
...popupProps,
|
|
225
|
-
children
|
|
226
|
-
})
|
|
227
|
-
})
|
|
228
|
-
})
|
|
229
|
-
});
|
|
230
|
-
};
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/components/Combobox/ComboboxEmpty.tsx
|
|
233
|
-
const ComboboxEmpty = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Combobox.Empty, {
|
|
234
|
-
ref,
|
|
235
|
-
className: cn("tw:hidden", "tw:group-data-[empty]/combobox-content:flex", "tw:justify-center", "tw:items-center", "tw:text-center", "tw:px-2", "tw:text-muted-foreground", "tw:py-6", className),
|
|
236
|
-
...props
|
|
237
|
-
});
|
|
238
|
-
//#endregion
|
|
239
|
-
//#region src/components/Combobox/ComboboxInput.tsx
|
|
240
|
-
const ComboboxInput = ({ ref, ...props }) => /* @__PURE__ */ jsx(Combobox.Input, {
|
|
241
|
-
...props,
|
|
242
|
-
ref,
|
|
243
|
-
render: /* @__PURE__ */ jsx(InputGroup.Input, {})
|
|
244
|
-
});
|
|
245
|
-
//#endregion
|
|
246
|
-
//#region src/components/Combobox/ComboboxInputGroup.tsx
|
|
247
|
-
const ComboboxInputGroup = ({ ref, state, variant, sizing, focusVariant, className, ...props }) => /* @__PURE__ */ jsx(Combobox.InputGroup, {
|
|
248
|
-
...props,
|
|
249
|
-
ref,
|
|
250
|
-
render: /* @__PURE__ */ jsx(InputGroup, {
|
|
251
|
-
state,
|
|
252
|
-
variant,
|
|
253
|
-
focusVariant,
|
|
254
|
-
sizing,
|
|
255
|
-
className
|
|
256
|
-
})
|
|
257
|
-
});
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region src/components/Combobox/ComboboxItemIndicator.tsx
|
|
260
|
-
const ComboboxItemIndicator = ({ ref, className, variant = "check", ...props }) => {
|
|
261
|
-
if (variant === "checkbox") return /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
262
|
-
ref,
|
|
263
|
-
keepMounted: true,
|
|
264
|
-
className: cn("tw:group/combobox-item-indicator", "tw:inline-flex", "tw:items-center", "tw:justify-center", "tw:size-4", "tw:shrink-0", "tw:rounded", "tw:border", "tw:border-input", "tw:bg-background", "tw:data-[selected]:bg-primary", "tw:data-[selected]:border-primary", className),
|
|
265
|
-
...props,
|
|
266
|
-
children: /* @__PURE__ */ jsx(Check, { className: cn("tw:hidden", "tw:size-3", "tw:stroke-[4px]", "tw:!text-primary-foreground", "tw:group-data-[selected]/combobox-item-indicator:block") })
|
|
267
|
-
});
|
|
268
|
-
return /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
269
|
-
...props,
|
|
270
|
-
ref,
|
|
271
|
-
className: cn("tw:pointer-events-none", "tw:absolute", "tw:right-2", "tw:group-data-[variant=default]/combobox-content:right-4", "tw:size-4", "tw:group-data-[highlighted]/combobox-item:text-accent-foreground", "tw:group-data-[variant=default]/combobox-content:group-data-[highlighted]/combobox-item:text-secondary-foreground", className),
|
|
272
|
-
render: /* @__PURE__ */ jsx(Check, {})
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/components/Combobox/ComboboxItem.tsx
|
|
277
|
-
const ComboboxItem = ({ ref, className, children, icon, indicator: variant = "check", ...props }) => /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
278
|
-
...props,
|
|
279
|
-
ref,
|
|
280
|
-
"data-slot": "combobox-item",
|
|
281
|
-
className: cn("tw:group/combobox-item", "tw:relative", "tw:flex", "tw:flex-1", "tw:items-center", "tw:gap-2", "tw:py-2", "tw:px-2", "tw:group-data-[variant=default]/combobox-content:px-4", "tw:rounded-lg", "tw:group-data-[variant=default]/combobox-content:rounded-none", "tw:text-sm", "tw:select-none", "tw:cursor-default", "tw:outline-hidden", "tw:data-[highlighted]:bg-accent", "tw:group-data-[variant=default]/combobox-content:data-[highlighted]:bg-secondary", "tw:data-[highlighted]:text-accent-foreground", "tw:group-data-[variant=default]/combobox-content:data-[highlighted]:text-secondary-foreground", "tw:data-disabled:pointer-events-none", "tw:data-disabled:opacity-50", "tw:[&_svg]:pointer-events-none", "tw:[&_svg]:shrink-0", "tw:[&_svg]:text-muted-foreground", "tw:[&_svg:not([class*='size-'])]:size-4", className),
|
|
282
|
-
children: [
|
|
283
|
-
/* @__PURE__ */ jsx(ComboboxItemIndicator, { variant }),
|
|
284
|
-
icon,
|
|
285
|
-
/* @__PURE__ */ jsx("span", {
|
|
286
|
-
className: "tw:truncate",
|
|
287
|
-
children
|
|
288
|
-
})
|
|
289
|
-
]
|
|
290
|
-
});
|
|
291
|
-
//#endregion
|
|
292
|
-
//#region src/components/Combobox/ComboboxList.tsx
|
|
293
|
-
const ComboboxList = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Combobox.List, {
|
|
294
|
-
ref,
|
|
295
|
-
className: cn("tw:no-scrollbar", "tw:scroll-py-1", "tw:overflow-y-auto", "tw:overscroll-contain", "tw:min-h-0", "tw:flex-1", "tw:p-2", "tw:data-[empty]:p-0", "tw:group-data-[variant=default]/combobox-content:p-0", className),
|
|
296
|
-
...props
|
|
297
|
-
});
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region src/components/Combobox/ComboboxRoot.tsx
|
|
300
|
-
const ComboboxRoot = (props) => /* @__PURE__ */ jsx(Combobox.Root, { ...props });
|
|
301
|
-
//#endregion
|
|
302
|
-
//#region src/components/Combobox/ComboboxSeparator.tsx
|
|
303
|
-
const ComboboxSeparator = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Combobox.Separator, {
|
|
304
|
-
ref,
|
|
305
|
-
className: cn("tw:mx-2 tw:my-1 tw:h-px tw:bg-border", className),
|
|
306
|
-
...props
|
|
307
|
-
});
|
|
308
|
-
//#endregion
|
|
309
|
-
//#region src/components/Combobox/Group/ComboboxGroup.tsx
|
|
310
|
-
const ComboboxGroup = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsx(Combobox.Group, {
|
|
311
|
-
ref,
|
|
312
|
-
className: cn("tw:flex tw:flex-col tw:gap-0.5", className),
|
|
313
|
-
...props,
|
|
314
|
-
children
|
|
315
|
-
});
|
|
316
|
-
//#endregion
|
|
317
|
-
//#region src/components/Combobox/Group/ComboboxGroupLabel.tsx
|
|
318
|
-
const ComboboxGroupLabel = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
319
|
-
...props,
|
|
320
|
-
ref,
|
|
321
|
-
className: cn("tw:px-2", "tw:py-1.5", "tw:text-xs", "tw:font-medium", "tw:leading-none", "tw:text-muted-foreground", "tw:group-data-[variant=default]/combobox-content:uppercase", "tw:group-data-[variant=default]/combobox-content:font-semibold", "tw:group-data-[variant=default]/combobox-content:tracking-wider", "tw:group-data-[variant=default]/combobox-content:text-[11px]", "tw:group-data-[variant=default]/combobox-content:text-black", "tw:group-data-[variant=default]/combobox-content:pt-2", "tw:group-data-[variant=default]/combobox-content:px-4", className)
|
|
322
|
-
});
|
|
323
|
-
//#endregion
|
|
324
|
-
//#region src/components/Combobox/Group/ComboboxCollection.tsx
|
|
325
|
-
const ComboboxCollection = ({ ...props }) => /* @__PURE__ */ jsx(Combobox.Collection, {
|
|
326
|
-
"data-slot": "combobox-collection",
|
|
327
|
-
...props
|
|
328
|
-
});
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region src/components/Combobox/query.ts
|
|
331
|
-
/**
|
|
332
|
-
* The text a combobox's input takes, with `inputValueSanitizer` applied to what the user typed.
|
|
333
|
-
*
|
|
334
|
-
* - `input-change` is the only reason carrying typed text. Every other one carries text the
|
|
335
|
-
* control itself put there — an item's label, or the empty string a clear leaves — which a
|
|
336
|
-
* sanitizer aimed at typed characters would mangle.
|
|
337
|
-
* - A sanitizer sees the whole text on every keystroke, so it has to rewrite rather than drop:
|
|
338
|
-
* one calling `trim()` swallows the space before the next word.
|
|
339
|
-
*/
|
|
340
|
-
const sanitizeTypedInput = (next, reason, sanitizer) => reason === "input-change" ? sanitizer?.(next) ?? next : next;
|
|
341
|
-
/**
|
|
342
|
-
* Reports the query the list filters by to the control's owner.
|
|
343
|
-
*
|
|
344
|
-
* - Fires from an effect rather than the input handler because `query` is derived: in `Combobox`
|
|
345
|
-
* a selection showing its own label empties it without a keystroke, so the handler never sees
|
|
346
|
-
* every value it takes.
|
|
347
|
-
* - The mount render reports too, so an owner fetching on the query needs no first fetch of its
|
|
348
|
-
* own.
|
|
349
|
-
*/
|
|
350
|
-
const useQueryReporter = (query, onQueryChange) => {
|
|
351
|
-
const report = useStableCallback(onQueryChange ?? noop);
|
|
352
|
-
useEffect(() => {
|
|
353
|
-
report(query);
|
|
354
|
-
}, [query, report]);
|
|
355
|
-
};
|
|
356
|
-
//#endregion
|
|
357
|
-
//#region src/components/Combobox/Combobox.tsx
|
|
358
|
-
const VIRTUALIZE_THRESHOLD = 30;
|
|
359
|
-
const ESTIMATED_ROW_HEIGHT = 40;
|
|
360
|
-
const ESTIMATED_LIST_HEIGHT = 320;
|
|
361
|
-
const Combobox$1 = ({ items: _itemsProp, value, defaultValue, onValueChange, itemToStringLabel: itemToStringLabelProp, itemToStringValue, disabled, filter, inputRef, onOpenChangeComplete, isItemEqualToValue: isItemEqualToValueProp, variant, sizing, focusVariant, state, placeholder, allowClear = true, id, className, empty = "No items", indicator, prefix, virtualized = false, inputValueSanitizer, onQueryChange, allowCreate, queryToCreateValue, queryToCreateLabel = defaultQueryToCreateLabel, canCreate, itemToDisabled = defaultItemToDisabled, itemToLabel = defaultItemToLabel, itemToIcon = defaultItemToIcon, itemToSelectedLabel, groupToLabel = defaultGroupToLabel }) => {
|
|
362
|
-
/** An item's string identity: the input's text, the default search subject, and the accessible value. */
|
|
363
|
-
const labelOf = (item) => itemToStringLabelProp?.(item) ?? toLabel(item);
|
|
364
|
-
const [typedText, setTypedText] = useState(null);
|
|
365
|
-
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? null);
|
|
366
|
-
const selectedItem = value !== void 0 ? value : uncontrolledValue;
|
|
367
|
-
const selectedLabel = selectedItem == null ? null : labelOf(selectedItem);
|
|
368
|
-
const isShowingSelection = selectedLabel !== null && (typedText === null || typedText === selectedLabel);
|
|
369
|
-
const inputValue = typedText ?? selectedLabel ?? "";
|
|
370
|
-
const selectedNode = itemToSelectedLabel && selectedItem != null && isShowingSelection ? itemToSelectedLabel(selectedItem) : null;
|
|
371
|
-
const query = (isShowingSelection ? "" : typedText ?? "").trim();
|
|
372
|
-
const queryLower = query.toLowerCase();
|
|
373
|
-
useQueryReporter(query, onQueryChange);
|
|
374
|
-
const itemsProp = _itemsProp ?? [];
|
|
375
|
-
const sampleItem = itemsProp.flatMap((item) => isGroupItem(item) ? item.items : [item])[0];
|
|
376
|
-
const [createdItems, setCreatedItems] = useState([]);
|
|
377
|
-
const allItems = (() => {
|
|
378
|
-
if (createdItems.length === 0) return itemsProp;
|
|
379
|
-
if (isGroupItems(itemsProp)) return [...itemsProp, { items: createdItems }];
|
|
380
|
-
return [...itemsProp, ...createdItems];
|
|
381
|
-
})();
|
|
382
|
-
const items = (() => {
|
|
383
|
-
if (!allowCreate || disabled) return allItems;
|
|
384
|
-
if (!query) return allItems;
|
|
385
|
-
if (allItems.flatMap((item) => isGroupItem(item) ? item.items : [item]).some((item) => labelOf(item).toLowerCase() === queryLower)) return allItems;
|
|
386
|
-
if (canCreate && !canCreate(query)) return allItems;
|
|
387
|
-
const creatable = isGroupItems(itemsProp) ? [{ items: [createCreatableItem(query)] }] : [createCreatableItem(query)];
|
|
388
|
-
return [...allItems, ...creatable];
|
|
389
|
-
})();
|
|
390
|
-
const itemToStringLabel = (value) => isCreatableItem(value) ? value.value : labelOf(value);
|
|
391
|
-
const wrappedFilter = isShowingSelection ? () => true : !allowCreate || !filter ? filter : (item, ...args) => isCreatableItem(item) || filter(item, ...args);
|
|
392
|
-
const wrappedItemToStringValue = !allowCreate || !itemToStringValue ? itemToStringValue : (item) => isCreatableItem(item) ? item.value : itemToStringValue(item);
|
|
393
|
-
const isItemEqualToValue = useMemo(() => toItemEquality(isItemEqualToValueProp), [isItemEqualToValueProp]);
|
|
394
|
-
const handleInputValueChange = (next, { reason }) => {
|
|
395
|
-
if (reason !== "input-change") {
|
|
396
|
-
setTypedText(null);
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
const typed = inputValueSanitizer?.(next) ?? next;
|
|
400
|
-
setTypedText(typed === "" || typed.trim() !== "" ? typed : null);
|
|
401
|
-
};
|
|
402
|
-
const handleOpenChange = (open) => {
|
|
403
|
-
if (!open) setTypedText(null);
|
|
404
|
-
};
|
|
405
|
-
const handleOnValueChange = (next, event) => {
|
|
406
|
-
if (isCreatableItem(next)) {
|
|
407
|
-
const newValue = defaultToCreateValue(next.value, sampleItem, queryToCreateValue);
|
|
408
|
-
setCreatedItems((prev) => [...prev, newValue]);
|
|
409
|
-
setUncontrolledValue(newValue);
|
|
410
|
-
onValueChange?.(newValue, event);
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
setUncontrolledValue(next);
|
|
414
|
-
onValueChange?.(next, event);
|
|
415
|
-
};
|
|
416
|
-
const [listElement, setListElement] = useState(null);
|
|
417
|
-
const shouldVirtualize = !isGroupItems(allItems) && (virtualized === true || virtualized === "auto" && allItems.length > VIRTUALIZE_THRESHOLD);
|
|
418
|
-
const matchesQuery = (item) => {
|
|
419
|
-
if (isCreatableItem(item)) return true;
|
|
420
|
-
if (!query) return true;
|
|
421
|
-
if (filter) return !!filter(item, query, (value) => itemToStringLabel(value) ?? toLabel(value));
|
|
422
|
-
return (itemToStringLabel(item) ?? toLabel(item)).toLowerCase().includes(queryLower);
|
|
423
|
-
};
|
|
424
|
-
const virtualItems = shouldVirtualize ? items.filter(matchesQuery) : [];
|
|
425
|
-
const virtualizer = useVirtualizer({
|
|
426
|
-
count: virtualItems.length,
|
|
427
|
-
getScrollElement: () => listElement,
|
|
428
|
-
estimateSize: () => ESTIMATED_ROW_HEIGHT,
|
|
429
|
-
overscan: 12,
|
|
430
|
-
enabled: shouldVirtualize,
|
|
431
|
-
initialRect: {
|
|
432
|
-
width: 0,
|
|
433
|
-
height: ESTIMATED_LIST_HEIGHT
|
|
434
|
-
}
|
|
435
|
-
});
|
|
436
|
-
const renderItem = (item, index) => {
|
|
437
|
-
if (isCreatableItem(item)) return /* @__PURE__ */ jsx(Combobox$1.Item, {
|
|
438
|
-
index,
|
|
439
|
-
value: item,
|
|
440
|
-
icon: /* @__PURE__ */ jsx(Plus, {}),
|
|
441
|
-
children: queryToCreateLabel(item.value)
|
|
442
|
-
});
|
|
443
|
-
return /* @__PURE__ */ jsx(Combobox$1.Item, {
|
|
444
|
-
index,
|
|
445
|
-
value: item,
|
|
446
|
-
indicator,
|
|
447
|
-
icon: itemToIcon(item),
|
|
448
|
-
disabled: itemToDisabled(item),
|
|
449
|
-
children: itemToLabel(item, query)
|
|
450
|
-
});
|
|
451
|
-
};
|
|
452
|
-
const rowStyle = (offset) => ({
|
|
453
|
-
position: "absolute",
|
|
454
|
-
top: 0,
|
|
455
|
-
left: 0,
|
|
456
|
-
width: "100%",
|
|
457
|
-
transform: `translateY(${offset}px)`
|
|
458
|
-
});
|
|
459
|
-
const comboboxInput = /* @__PURE__ */ jsx(ComboboxInput, {
|
|
460
|
-
id,
|
|
461
|
-
placeholder,
|
|
462
|
-
disabled,
|
|
463
|
-
className: cn(selectedNode != null && "tw:text-transparent tw:caret-foreground tw:selection:bg-transparent")
|
|
464
|
-
});
|
|
465
|
-
return /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
466
|
-
items: shouldVirtualize ? virtualItems : items,
|
|
467
|
-
autoHighlight: true,
|
|
468
|
-
value,
|
|
469
|
-
defaultValue,
|
|
470
|
-
filter: shouldVirtualize ? null : wrappedFilter,
|
|
471
|
-
onValueChange: handleOnValueChange,
|
|
472
|
-
itemToStringLabel,
|
|
473
|
-
isItemEqualToValue,
|
|
474
|
-
itemToStringValue: wrappedItemToStringValue,
|
|
475
|
-
onOpenChange: handleOpenChange,
|
|
476
|
-
onOpenChangeComplete,
|
|
477
|
-
disabled,
|
|
478
|
-
inputRef,
|
|
479
|
-
inputValue,
|
|
480
|
-
onInputValueChange: handleInputValueChange,
|
|
481
|
-
virtualized: shouldVirtualize,
|
|
482
|
-
onItemHighlighted: (_, details) => {
|
|
483
|
-
if (shouldVirtualize && details.reason === "keyboard") virtualizer.scrollToIndex(details.index);
|
|
484
|
-
},
|
|
485
|
-
children: [/* @__PURE__ */ jsxs(ComboboxInputGroup, {
|
|
486
|
-
variant,
|
|
487
|
-
sizing,
|
|
488
|
-
state,
|
|
489
|
-
focusVariant,
|
|
490
|
-
className,
|
|
491
|
-
children: [itemToSelectedLabel != null ? /* @__PURE__ */ jsxs("div", {
|
|
492
|
-
className: "tw:relative tw:flex tw:min-w-0 tw:flex-1",
|
|
493
|
-
children: [(prefix != null || selectedNode != null) && /* @__PURE__ */ jsxs(InputGroup.Addon, {
|
|
494
|
-
align: "inline-start",
|
|
495
|
-
className: cn(selectedNode != null && "tw:pointer-events-none tw:absolute tw:inset-y-0 tw:left-0 tw:max-w-full tw:overflow-hidden"),
|
|
496
|
-
children: [prefix, selectedNode]
|
|
497
|
-
}), comboboxInput]
|
|
498
|
-
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [prefix != null && /* @__PURE__ */ jsx(InputGroup.Addon, {
|
|
499
|
-
align: "inline-start",
|
|
500
|
-
children: prefix
|
|
501
|
-
}), comboboxInput] }), /* @__PURE__ */ jsxs(InputGroup.Addon, {
|
|
502
|
-
align: "inline-end",
|
|
503
|
-
children: [allowClear && /* @__PURE__ */ jsx(InputGroup.Button, {
|
|
504
|
-
asChild: true,
|
|
505
|
-
"aria-label": "Clear",
|
|
506
|
-
disabled,
|
|
507
|
-
children: /* @__PURE__ */ jsx(Combobox.Clear, { children: /* @__PURE__ */ jsx(X, { className: "tw:size-4" }) })
|
|
508
|
-
}), /* @__PURE__ */ jsx(InputGroup.Button, {
|
|
509
|
-
disabled,
|
|
510
|
-
asChild: true,
|
|
511
|
-
"aria-label": "Open combobox",
|
|
512
|
-
children: /* @__PURE__ */ jsx(Combobox.Trigger, { children: /* @__PURE__ */ jsx(ChevronDown, { className: "tw:size-4" }) })
|
|
513
|
-
})]
|
|
514
|
-
})]
|
|
515
|
-
}), /* @__PURE__ */ jsxs(ComboboxContent, { children: [/* @__PURE__ */ jsx(ComboboxEmpty, { children: empty }), shouldVirtualize ? /* @__PURE__ */ jsx(ComboboxList, {
|
|
516
|
-
ref: setListElement,
|
|
517
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
518
|
-
style: {
|
|
519
|
-
position: "relative",
|
|
520
|
-
width: "100%",
|
|
521
|
-
height: `${virtualizer.getTotalSize()}px`
|
|
522
|
-
},
|
|
523
|
-
children: virtualizer.getVirtualItems().map((row) => {
|
|
524
|
-
const item = virtualItems[row.index];
|
|
525
|
-
if (item === void 0) return null;
|
|
526
|
-
return /* @__PURE__ */ jsx("div", {
|
|
527
|
-
"data-index": row.index,
|
|
528
|
-
ref: virtualizer.measureElement,
|
|
529
|
-
style: rowStyle(row.start),
|
|
530
|
-
children: renderItem(item, row.index)
|
|
531
|
-
}, row.key);
|
|
532
|
-
})
|
|
533
|
-
})
|
|
534
|
-
}) : /* @__PURE__ */ jsx(ComboboxList, { children: (itemOrGroup) => {
|
|
535
|
-
if (isCreatableItem(itemOrGroup)) return /* @__PURE__ */ jsx(Combobox$1.Item, {
|
|
536
|
-
value: itemOrGroup,
|
|
537
|
-
icon: /* @__PURE__ */ jsx(Plus, {}),
|
|
538
|
-
children: queryToCreateLabel(itemOrGroup.value)
|
|
539
|
-
});
|
|
540
|
-
if (isGroupItem(itemOrGroup)) {
|
|
541
|
-
const maybeCreatable = itemOrGroup.items[0];
|
|
542
|
-
if (isCreatableItem(maybeCreatable)) return /* @__PURE__ */ jsx(Combobox$1.Item, {
|
|
543
|
-
value: maybeCreatable,
|
|
544
|
-
icon: /* @__PURE__ */ jsx(Plus, {}),
|
|
545
|
-
children: queryToCreateLabel(maybeCreatable.value)
|
|
546
|
-
});
|
|
547
|
-
const groupLabel = groupToLabel(itemOrGroup);
|
|
548
|
-
return /* @__PURE__ */ jsxs(Combobox$1.Group, {
|
|
549
|
-
items: itemOrGroup.items,
|
|
550
|
-
children: [groupLabel && /* @__PURE__ */ jsx(Combobox$1.GroupLabel, { children: groupLabel }), /* @__PURE__ */ jsx(Combobox$1.GroupList, { children: (item) => renderItem(item) })]
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
return renderItem(itemOrGroup);
|
|
554
|
-
} })] })]
|
|
555
|
-
});
|
|
556
|
-
};
|
|
557
|
-
Combobox$1.Root = ComboboxRoot;
|
|
558
|
-
Combobox$1.InputGroup = ComboboxInputGroup;
|
|
559
|
-
Combobox$1.Input = ComboboxInput;
|
|
560
|
-
Combobox$1.Content = ComboboxContent;
|
|
561
|
-
Combobox$1.List = ComboboxList;
|
|
562
|
-
Combobox$1.Item = ComboboxItem;
|
|
563
|
-
Combobox$1.Empty = ComboboxEmpty;
|
|
564
|
-
Combobox$1.Value = Combobox.Value;
|
|
565
|
-
Combobox$1.Separator = ComboboxSeparator;
|
|
566
|
-
Combobox$1.Group = ComboboxGroup;
|
|
567
|
-
Combobox$1.GroupLabel = ComboboxGroupLabel;
|
|
568
|
-
Combobox$1.GroupList = ComboboxCollection;
|
|
569
|
-
Combobox$1.Chips = ComboboxChips;
|
|
570
|
-
Combobox$1.Chip = ComboboxChip;
|
|
571
|
-
//#endregion
|
|
572
|
-
//#region src/components/Combobox/matchByWords.ts
|
|
573
|
-
const toWords = (query) => query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
574
|
-
const isFilled = (text) => text !== null && text !== void 0 && text !== "";
|
|
575
|
-
const isTextList = (texts) => Array.isArray(texts);
|
|
576
|
-
/**
|
|
577
|
-
* Whether every word of `query` occurs in at least one of `texts`, ignoring case.
|
|
578
|
-
*
|
|
579
|
-
* - Words may match different texts and in any order: `prod eu` matches `['eu-central', 'production']`.
|
|
580
|
-
* - A word matches by containment, not as a whole word: `prod` matches `production`.
|
|
581
|
-
* - An empty or whitespace-only query matches every item.
|
|
582
|
-
* - Empty and absent texts are skipped, so a missing field never matches.
|
|
583
|
-
* - Comparison is a plain lowercased `includes`, not Base UI's `Intl.Collator` `contains`, so
|
|
584
|
-
* `Muller` does not find `Müller`. The wrapper this replaces matched the same way.
|
|
585
|
-
* - `apps/kbc-ui` has its own `matchByWords` of the same name over 68 mostly non-combobox call
|
|
586
|
-
* sites. It splits on a single space and keeps empty texts, so the two are not interchangeable
|
|
587
|
-
* until that one re-exports this.
|
|
588
|
-
*
|
|
589
|
-
* Reach for it as a `Combobox` / `MultiCombobox` `filter` when the searchable text is **not** the
|
|
590
|
-
* label — a user's email behind their name, a table id behind its display name:
|
|
591
|
-
*
|
|
592
|
-
* ```tsx
|
|
593
|
-
* <Combobox filter={(user, query) => matchByWords([user.name, user.email], query)} … />
|
|
594
|
-
* ```
|
|
595
|
-
*
|
|
596
|
-
* When only the label is searchable, pass {@link filterByWords} instead of closing over this.
|
|
597
|
-
*/
|
|
598
|
-
const matchByWords = (texts, query) => {
|
|
599
|
-
const words = toWords(query);
|
|
600
|
-
if (words.length === 0) return true;
|
|
601
|
-
const haystacks = (isTextList(texts) ? texts : [texts]).filter(isFilled).map((text) => String(text).toLowerCase());
|
|
602
|
-
return words.every((word) => haystacks.some((haystack) => haystack.includes(word)));
|
|
603
|
-
};
|
|
604
|
-
/**
|
|
605
|
-
* `filter` that matches the item's displayed label word by word.
|
|
606
|
-
*
|
|
607
|
-
* - Drop-in for the built-in match, which takes the query as one substring: `filter={filterByWords}`.
|
|
608
|
-
* - Generic, so passing it leaves the combobox's own item type inference untouched.
|
|
609
|
-
* - The label is what the combobox itself displays — `itemToStringLabel` where the call site passes
|
|
610
|
-
* one, otherwise the item's own `label`, `value`, or string form.
|
|
611
|
-
* - **Only the label is searched.** Nothing walks the rest of the item, so a field the label omits
|
|
612
|
-
* stays unsearchable by design — a filter that quietly matched an id the user cannot see is
|
|
613
|
-
* worse than one that does not match. Close over {@link matchByWords} to name those fields.
|
|
614
|
-
*/
|
|
615
|
-
const filterByWords = (item, query, itemToString) => matchByWords(itemToString?.(item) ?? toLabel(item), query);
|
|
616
|
-
//#endregion
|
|
617
|
-
export { Combobox$1 as Combobox, createCreatableItem, defaultGroupToLabel, defaultItemToDisabled, defaultItemToIcon, defaultItemToLabel, defaultQueryToCreateLabel, defaultToCreateValue, filterByWords, isCreatableItem, isGroupItem, isGroupItems, isSelectAllItem, matchByWords, namedLabel, sanitizeTypedInput, selectAllItem, toItemEquality, toLabel, useQueryReporter, withBlankValues };
|
|
618
|
-
|
|
619
|
-
//# sourceMappingURL=Combobox-D8PrEqTG.js.map
|