@keboola/design 13.2.0 → 15.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 +16 -24
- package/CHANGELOG.md +194 -0
- package/COMPONENT-API.md +109 -105
- package/dist/{AIKit-C5FbKjwa.js → AIKit-CaAW4GLx.js} +2216 -307
- package/dist/AIKit-CaAW4GLx.js.map +1 -0
- package/dist/{Alert-DuAGeYyM.js → Alert-Chz6KZ7e.js} +11 -20
- package/dist/Alert-Chz6KZ7e.js.map +1 -0
- package/dist/{AlertModal-BDle9ZVQ.js → AlertModal-D4AtpvLS.js} +15 -35
- package/dist/AlertModal-D4AtpvLS.js.map +1 -0
- package/dist/{AppShell-B03fj1j7.js → AppShell-C8V1KRr_.js} +2 -2
- package/dist/{AppShell-B03fj1j7.js.map → AppShell-C8V1KRr_.js.map} +1 -1
- package/dist/{AutoSaveTextarea-jiqNeeE4.js → AutoSaveTextarea-BbMhC5Aq.js} +3 -3
- package/dist/AutoSaveTextarea-BbMhC5Aq.js.map +1 -0
- package/dist/{Badge-Ba3epgcI.js → Badge-5GHIsgRS.js} +14 -3
- package/dist/Badge-5GHIsgRS.js.map +1 -0
- package/dist/{BrandEditor-Dq168RJc.js → BrandEditor-CTGtQUFZ.js} +8 -10
- package/dist/BrandEditor-CTGtQUFZ.js.map +1 -0
- package/dist/{BrandLogo-BfITD0im.js → BrandLogo-DkESE19K.js} +2 -2
- package/dist/{BrandLogo-BfITD0im.js.map → BrandLogo-DkESE19K.js.map} +1 -1
- package/dist/{Breadcrumb-CUyYu5Bi.js → Breadcrumb-B2YSNON4.js} +55 -13
- package/dist/Breadcrumb-B2YSNON4.js.map +1 -0
- package/dist/{Button-D2JqBAq7.js → Button-BNkyYU8u.js} +9 -185
- package/dist/Button-BNkyYU8u.js.map +1 -0
- package/dist/{Card-Bpc_ZlL4.js → Card-DxjGiqH8.js} +11 -18
- package/dist/Card-DxjGiqH8.js.map +1 -0
- package/dist/{Checkbox-D9rafoKh.js → Checkbox-CHDDJyAA.js} +20 -45
- package/dist/Checkbox-CHDDJyAA.js.map +1 -0
- package/dist/{Clipboard-BHWUodAx.js → Clipboard-DlwVZS1P.js} +2 -2
- package/dist/{Clipboard-BHWUodAx.js.map → Clipboard-DlwVZS1P.js.map} +1 -1
- package/dist/{ClipboardButton-Urg-kZbh.js → ClipboardButton-B1Hr_n_Z.js} +3 -3
- package/dist/{ClipboardButton-Urg-kZbh.js.map → ClipboardButton-B1Hr_n_Z.js.map} +1 -1
- package/dist/{CodeEditor-Y0iE-SwV.js → CodeEditor-DVSPdfdo.js} +24 -31
- package/dist/CodeEditor-DVSPdfdo.js.map +1 -0
- package/dist/{ColorInput-D1nC0X6i.js → ColorInput-B_eZIu39.js} +5 -7
- package/dist/ColorInput-B_eZIu39.js.map +1 -0
- package/dist/{ColorModeSwitch-Cxee8jnB.js → ColorModeSwitch-B6UEzG0H.js} +3 -3
- package/dist/{ColorModeSwitch-Cxee8jnB.js.map → ColorModeSwitch-B6UEzG0H.js.map} +1 -1
- package/dist/{Combobox-B1Kjoy5J.js → Combobox-CaKqgstG.js} +250 -56
- package/dist/Combobox-CaKqgstG.js.map +1 -0
- package/dist/{Command-BuOA3V18.js → Command-DhXmqFLT.js} +51 -33
- package/dist/Command-DhXmqFLT.js.map +1 -0
- package/dist/{CopyField-DsOVtV2Q.js → CopyField-D0Pg4Z0R.js} +2 -2
- package/dist/{CopyField-DsOVtV2Q.js.map → CopyField-D0Pg4Z0R.js.map} +1 -1
- package/dist/{DateInput-BlKkequE.js → DateInput-BgbMDJkm.js} +5 -7
- package/dist/DateInput-BgbMDJkm.js.map +1 -0
- package/dist/{DatePicker-CgHAu9KX.js → DatePicker-BXpDRo-R.js} +2 -2
- package/dist/{DatePicker-CgHAu9KX.js.map → DatePicker-BXpDRo-R.js.map} +1 -1
- package/dist/{DateRangeInput-DOxJHw8V.js → DateRangeInput-BW0-_jV0.js} +5 -7
- package/dist/DateRangeInput-BW0-_jV0.js.map +1 -0
- package/dist/{DateRangePicker-CXpXPMoh.js → DateRangePicker-C4-DoWac.js} +7 -12
- package/dist/DateRangePicker-C4-DoWac.js.map +1 -0
- package/dist/{DropdownMenu-DtRYcKEx.js → DropdownMenu-CcVbZ_5u.js} +35 -64
- package/dist/DropdownMenu-CcVbZ_5u.js.map +1 -0
- package/dist/{FieldItem-Cf1E3rfQ.js → FieldItem-BHUqgSO1.js} +3 -3
- package/dist/{FieldItem-Cf1E3rfQ.js.map → FieldItem-BHUqgSO1.js.map} +1 -1
- package/dist/{FileUpload-D6vPG3WB.js → FileUpload-BYFONpEl.js} +3 -3
- package/dist/FileUpload-BYFONpEl.js.map +1 -0
- package/dist/{Form-CuaAn-lR.js → Form-CAofWyMI.js} +8 -8
- package/dist/{Form-CuaAn-lR.js.map → Form-CAofWyMI.js.map} +1 -1
- package/dist/{FormGroup-D4O96YPm.js → FormGroup-V5kIgQRN.js} +3 -3
- package/dist/{FormGroup-D4O96YPm.js.map → FormGroup-V5kIgQRN.js.map} +1 -1
- package/dist/{FullScreenModal-CUuAakh3.js → FullScreenModal-DAvvlGOz.js} +2 -5
- package/dist/FullScreenModal-DAvvlGOz.js.map +1 -0
- package/dist/HoverCard-Cv5rmvJq.js +26 -0
- package/dist/HoverCard-Cv5rmvJq.js.map +1 -0
- package/dist/{InlineEdit-DSMIEUUa.js → InlineEdit-D4P0SvCB.js} +5 -9
- package/dist/InlineEdit-D4P0SvCB.js.map +1 -0
- package/dist/{InputGroup-Dm014ruw.js → InputGroup-CZv_7QlM.js} +39 -146
- package/dist/InputGroup-CZv_7QlM.js.map +1 -0
- package/dist/{Kbd-Du93F3o4.js → Kbd-CflKthfu.js} +5 -14
- package/dist/Kbd-CflKthfu.js.map +1 -0
- package/dist/MermaidDiagram-Te-5gOCU.js +199 -0
- package/dist/MermaidDiagram-Te-5gOCU.js.map +1 -0
- package/dist/{Modal-DQIauzar.js → Modal-CbUz-5YH.js} +19 -37
- package/dist/Modal-CbUz-5YH.js.map +1 -0
- package/dist/{ModalTitle-CTECVgL8.js → ModalTitle-cy0Ht9VY.js} +2 -2
- package/dist/{ModalTitle-CTECVgL8.js.map → ModalTitle-cy0Ht9VY.js.map} +1 -1
- package/dist/{MultiActionButtonGroup-xKqiucAN.js → MultiActionButtonGroup-Dzig87s1.js} +3 -3
- package/dist/{MultiActionButtonGroup-xKqiucAN.js.map → MultiActionButtonGroup-Dzig87s1.js.map} +1 -1
- package/dist/{Navbar-CtVYcRFn.js → Navbar-DHUS7XiU.js} +2 -2
- package/dist/{Navbar-CtVYcRFn.js.map → Navbar-DHUS7XiU.js.map} +1 -1
- package/dist/OtpInput-CY8yCaJk.js.map +1 -1
- package/dist/{PageToolbar-B_e7HGva.js → PageToolbar-DJ5tdYla.js} +4 -4
- package/dist/{PageToolbar-B_e7HGva.js.map → PageToolbar-DJ5tdYla.js.map} +1 -1
- package/dist/{Pagination-DDp6PRqf.js → Pagination-D27x5KmH.js} +2 -2
- package/dist/{Pagination-DDp6PRqf.js.map → Pagination-D27x5KmH.js.map} +1 -1
- package/dist/{Popconfirm-BgV6a0sl.js → Popconfirm-DwLCYNaF.js} +3 -3
- package/dist/{Popconfirm-BgV6a0sl.js.map → Popconfirm-DwLCYNaF.js.map} +1 -1
- package/dist/{Popover-BU7nGOv-.js → Popover-DtUDwUVO.js} +24 -37
- package/dist/Popover-DtUDwUVO.js.map +1 -0
- package/dist/{RadioGroup-C2vk5acr.js → RadioGroup-B0TwHjBb.js} +9 -13
- package/dist/RadioGroup-B0TwHjBb.js.map +1 -0
- package/dist/{Search-CVrv3hqf.js → Search-vyZwGKMU.js} +3 -3
- package/dist/{Search-CVrv3hqf.js.map → Search-vyZwGKMU.js.map} +1 -1
- package/dist/{SearchInput-BnU6YHgT.js → SearchInput-DyYXyw3u.js} +4 -6
- package/dist/SearchInput-DyYXyw3u.js.map +1 -0
- package/dist/{SectionNav-XlhvXXdF.js → SectionNav-tLK3iF6c.js} +5 -5
- package/dist/{SectionNav-XlhvXXdF.js.map → SectionNav-tLK3iF6c.js.map} +1 -1
- package/dist/{Select-CjQgU_6K.js → Select-B22hB_-w.js} +11 -25
- package/dist/Select-B22hB_-w.js.map +1 -0
- package/dist/{Sheet-utw4_rUa.js → Sheet-0TWKTqid.js} +12 -15
- package/dist/Sheet-0TWKTqid.js.map +1 -0
- package/dist/{Sidebar-CKaxOPwY.js → Sidebar-C5hdANBU.js} +11 -11
- package/dist/Sidebar-C5hdANBU.js.map +1 -0
- package/dist/{Slider-Rcc2qVct.js → Slider-DrcsM8_G.js} +4 -4
- package/dist/Slider-DrcsM8_G.js.map +1 -0
- package/dist/{Stepper-BBPembeK.js → Stepper-CQrUPVFL.js} +2 -2
- package/dist/Stepper-CQrUPVFL.js.map +1 -0
- package/dist/Switch-DccpSpzC.js +66 -0
- package/dist/Switch-DccpSpzC.js.map +1 -0
- package/dist/{Table-CgSC-fSo.js → Table-CilEvpMq.js} +62 -3
- package/dist/Table-CilEvpMq.js.map +1 -0
- package/dist/{Tabs-C0uvkPHc.js → Tabs-Ck4uWf8U.js} +2 -2
- package/dist/{Tabs-C0uvkPHc.js.map → Tabs-Ck4uWf8U.js.map} +1 -1
- package/dist/{TextInput-B5TDDOty.js → TextInput-CR0_USaY.js} +4 -7
- package/dist/TextInput-CR0_USaY.js.map +1 -0
- package/dist/{ThemeProvider-Dt9b67sW.js → ThemeProvider-BTK7AL-T.js} +21 -8
- package/dist/ThemeProvider-BTK7AL-T.js.map +1 -0
- package/dist/{TimePicker-DyyV3nw8.js → TimePicker-CoRpiEM3.js} +2 -2
- package/dist/{TimePicker-DyyV3nw8.js.map → TimePicker-CoRpiEM3.js.map} +1 -1
- package/dist/{Toast-BGnUL4jV.js → Toast-937n7n8i.js} +2 -2
- package/dist/{Toast-BGnUL4jV.js.map → Toast-937n7n8i.js.map} +1 -1
- package/dist/ToggleAllTooltip-DEjbWFoj.js +37 -0
- package/dist/ToggleAllTooltip-DEjbWFoj.js.map +1 -0
- package/dist/{ZoomableSvg-D8sXKpoV.js → ZoomableSvg-DnFXo2L4.js} +85 -81
- package/dist/ZoomableSvg-DnFXo2L4.js.map +1 -0
- package/dist/editors.js +4 -4
- package/dist/flint.js +10 -45
- package/dist/flint.js.map +1 -1
- package/dist/highlightCode-D354tCXO.js +81 -0
- package/dist/highlightCode-D354tCXO.js.map +1 -0
- package/dist/index.d.ts +843 -443
- package/dist/index.js +62 -63
- package/dist/internal/blocks/AIKit.js +2 -2
- package/dist/internal/blocks/AppShell.js +1 -1
- package/dist/internal/blocks/AuthLayout.js +1 -1
- package/dist/internal/blocks/AutoSaveTextarea.js +1 -1
- package/dist/internal/blocks/BrandEditor.js +1 -1
- package/dist/internal/blocks/ChartPanel.js +1 -1
- package/dist/internal/blocks/ChipEditor.js +5 -9
- 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/DateInput.js +1 -1
- package/dist/internal/blocks/DateRangeInput.js +1 -1
- package/dist/internal/blocks/DiagramShared/DiagramSkeleton.js.map +1 -1
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
- package/dist/internal/blocks/ErrorState.js +18 -29
- package/dist/internal/blocks/ErrorState.js.map +1 -1
- package/dist/internal/blocks/ExportMenu.js +3 -3
- package/dist/internal/blocks/ExportMenu.js.map +1 -1
- package/dist/internal/blocks/Form/connectors/ComboboxField.js +2 -2
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
- package/dist/internal/blocks/Form.js +1 -1
- package/dist/internal/blocks/FormGroup.js +1 -1
- package/dist/internal/blocks/InlineEdit.js +1 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
- package/dist/internal/blocks/MultiCombobox.js +202 -70
- package/dist/internal/blocks/MultiCombobox.js.map +1 -1
- package/dist/internal/blocks/NumberInput.js +2 -4
- package/dist/internal/blocks/NumberInput.js.map +1 -1
- package/dist/internal/blocks/PageToolbar.js +1 -1
- package/dist/internal/blocks/PasswordInput.js +3 -5
- package/dist/internal/blocks/PasswordInput.js.map +1 -1
- package/dist/internal/blocks/SearchInput.js +1 -1
- package/dist/internal/blocks/SearchInputWithNavigation.js +6 -7
- package/dist/internal/blocks/SearchInputWithNavigation.js.map +1 -1
- package/dist/internal/blocks/SectionNav.js +1 -1
- package/dist/internal/blocks/SplitButton.js +2 -2
- package/dist/internal/blocks/StatCard.js +1 -1
- package/dist/internal/blocks/TextInput.js +1 -1
- package/dist/internal/blocks/Textarea.js +3 -8
- package/dist/internal/blocks/Textarea.js.map +1 -1
- package/dist/internal/blocks/TimeInput.js +4 -6
- 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 +2 -2
- package/dist/internal/components/ButtonGroup.js +1 -1
- package/dist/internal/components/ButtonGroup.js.map +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 +1 -1
- package/dist/internal/components/Combobox.js +1 -1
- 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/Modal.js +1 -1
- package/dist/internal/components/Navbar.js +1 -1
- package/dist/internal/components/Pagination.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/Sheet.js +1 -1
- package/dist/internal/components/Sidebar.js +1 -1
- package/dist/internal/components/Skeleton/Skeleton.js +2 -2
- package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/internal/components/Slider.js +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 -4
- package/dist/internal/components/TimePicker.js +1 -1
- package/dist/internal/components/Toast.js +2 -2
- package/dist/internal/components/Toggle.js +13 -3
- package/dist/internal/components/Toggle.js.map +1 -1
- package/dist/internal/components/Tooltip.js +1 -1
- package/dist/internal/components/Truncated.js +1 -1
- package/dist/internal/components/ZoomableSvg.js +1 -1
- package/dist/internal/utils.js +1 -1
- package/dist/markdown-editor.js +16 -18
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +1 -2
- package/dist/mermaid.js +1 -1
- package/dist/rjsf.js +121 -43
- package/dist/rjsf.js.map +1 -1
- package/dist/styles-DxazJ8Mz.js +81 -0
- package/dist/styles-DxazJ8Mz.js.map +1 -0
- package/dist/styles-T8xwr0sR.js +73 -0
- package/dist/styles-T8xwr0sR.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/svgCache-Dhmbe-7i.js +26 -0
- package/dist/svgCache-Dhmbe-7i.js.map +1 -0
- package/dist/svgTransforms-Hnvev3Vs.js +38 -0
- package/dist/svgTransforms-Hnvev3Vs.js.map +1 -0
- package/dist/testing.d.ts +0 -2
- package/dist/testing.js +3 -10
- package/dist/testing.js.map +1 -1
- package/dist/{useColorSchemeState-Cw4MCXUs.js → themeScopeContext-CEVXbYvZ.js} +43 -15
- package/dist/themeScopeContext-CEVXbYvZ.js.map +1 -0
- package/dist/{useThemeAttributes-B199Regy.js → themeTokens-DCeb62ap.js} +22 -4
- package/dist/themeTokens-DCeb62ap.js.map +1 -0
- package/dist/{toast-D6Z6MOB5.js → toast-Y3cTMBW8.js} +7 -10
- package/dist/toast-Y3cTMBW8.js.map +1 -0
- package/dist/{utils-p6tjltbX.js → utils-DwC9u0tM.js} +39 -49
- package/dist/utils-DwC9u0tM.js.map +1 -0
- package/dist/vega.js +2 -2
- package/dist/vegaTheme-ISwGXvof.js +49 -0
- package/dist/vegaTheme-ISwGXvof.js.map +1 -0
- package/dist/{vegaTheme-VQMWTlBw.js → vegaTokens-DCkvpIVE.js} +36 -44
- package/dist/vegaTokens-DCkvpIVE.js.map +1 -0
- package/package.json +3 -4
- package/src/styles.css +4 -39
- package/src/theme.css +42 -0
- package/dist/AIKit-C5FbKjwa.js.map +0 -1
- package/dist/Alert-DuAGeYyM.js.map +0 -1
- package/dist/AlertModal-BDle9ZVQ.js.map +0 -1
- package/dist/AutoSaveTextarea-jiqNeeE4.js.map +0 -1
- package/dist/Badge-Ba3epgcI.js.map +0 -1
- package/dist/BrandEditor-Dq168RJc.js.map +0 -1
- package/dist/Breadcrumb-CUyYu5Bi.js.map +0 -1
- package/dist/Button-D2JqBAq7.js.map +0 -1
- package/dist/Card-Bpc_ZlL4.js.map +0 -1
- package/dist/Checkbox-D9rafoKh.js.map +0 -1
- package/dist/CodeEditor-Y0iE-SwV.js.map +0 -1
- package/dist/ColorInput-D1nC0X6i.js.map +0 -1
- package/dist/Combobox-B1Kjoy5J.js.map +0 -1
- package/dist/Command-BuOA3V18.js.map +0 -1
- package/dist/DateInput-BlKkequE.js.map +0 -1
- package/dist/DateRangeInput-DOxJHw8V.js.map +0 -1
- package/dist/DateRangePicker-CXpXPMoh.js.map +0 -1
- package/dist/DiagramSource-jTwmmi9g.js +0 -11
- package/dist/DiagramSource-jTwmmi9g.js.map +0 -1
- package/dist/DropdownMenu-DtRYcKEx.js.map +0 -1
- package/dist/FileUpload-D6vPG3WB.js.map +0 -1
- package/dist/FullScreenModal-CUuAakh3.js.map +0 -1
- package/dist/HoverCard-Cy6nhg4u.js +0 -31
- package/dist/HoverCard-Cy6nhg4u.js.map +0 -1
- package/dist/InlineEdit-DSMIEUUa.js.map +0 -1
- package/dist/InputGroup-Dm014ruw.js.map +0 -1
- package/dist/Kbd-Du93F3o4.js.map +0 -1
- package/dist/MermaidDiagram-D2ThT8Q-.js +0 -302
- package/dist/MermaidDiagram-D2ThT8Q-.js.map +0 -1
- package/dist/Modal-DQIauzar.js.map +0 -1
- package/dist/Popover-BU7nGOv-.js.map +0 -1
- package/dist/RadioGroup-C2vk5acr.js.map +0 -1
- package/dist/SearchInput-BnU6YHgT.js.map +0 -1
- package/dist/Select-CjQgU_6K.js.map +0 -1
- package/dist/Sheet-utw4_rUa.js.map +0 -1
- package/dist/Sidebar-CKaxOPwY.js.map +0 -1
- package/dist/Slider-Rcc2qVct.js.map +0 -1
- package/dist/Stepper-BBPembeK.js.map +0 -1
- package/dist/Switch-Dw4tvQls.js +0 -201
- package/dist/Switch-Dw4tvQls.js.map +0 -1
- package/dist/Table-CgSC-fSo.js.map +0 -1
- package/dist/TextInput-B5TDDOty.js.map +0 -1
- package/dist/ThemeProvider-Dt9b67sW.js.map +0 -1
- package/dist/ZoomableSvg-D8sXKpoV.js.map +0 -1
- package/dist/context-U293r3v-.js +0 -29
- package/dist/context-U293r3v-.js.map +0 -1
- package/dist/defaults-i_xG2F_1.js +0 -32
- package/dist/defaults-i_xG2F_1.js.map +0 -1
- package/dist/styles-BDA5rQz3.js +0 -127
- package/dist/styles-BDA5rQz3.js.map +0 -1
- package/dist/styles-YQdM7G8c.js +0 -159
- package/dist/styles-YQdM7G8c.js.map +0 -1
- package/dist/svgTransforms-Dw2hRA-i.js +0 -51
- package/dist/svgTransforms-Dw2hRA-i.js.map +0 -1
- package/dist/themeTokens-7DEab0kp.js +0 -31
- package/dist/themeTokens-7DEab0kp.js.map +0 -1
- package/dist/toast-D6Z6MOB5.js.map +0 -1
- package/dist/useColorSchemeState-Cw4MCXUs.js.map +0 -1
- package/dist/useThemeAttributes-B199Regy.js.map +0 -1
- package/dist/utils-p6tjltbX.js.map +0 -1
- package/dist/vegaTheme-VQMWTlBw.js.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cn } from "./classNames-DcGnTh2N.js";
|
|
2
|
-
import { Tooltip, TooltipProvider, noop } from "./utils-
|
|
3
|
-
import { useArgoDesign } from "./context-U293r3v-.js";
|
|
2
|
+
import { Tooltip, TooltipProvider, noop } from "./utils-DwC9u0tM.js";
|
|
4
3
|
import { Check, ChevronDown, ChevronRight, Loader2, Minus, Plus, X } from "./icons-ZIeZXXS7.js";
|
|
5
4
|
import { hasTruncationOverflow } from "./internal/components/Truncated.js";
|
|
6
5
|
import { useStableCallback } from "./internal/hooks/useStableCallback.js";
|
|
7
|
-
import { InputGroup } from "./InputGroup-
|
|
6
|
+
import { InputGroup } from "./InputGroup-CZv_7QlM.js";
|
|
8
7
|
import { forwardAccessibleName } from "./internal/utils/accessibleName.js";
|
|
9
|
-
import { Badge } from "./Badge-
|
|
8
|
+
import { Badge } from "./Badge-5GHIsgRS.js";
|
|
9
|
+
import { ToggleAllTooltip, isToggleAllClick } from "./ToggleAllTooltip-DEjbWFoj.js";
|
|
10
10
|
import { useElement } from "./useElement-D-RjrGa4.js";
|
|
11
|
-
import { Fragment, createContext, isValidElement, use, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
11
|
+
import { Fragment, createContext, isValidElement, use, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
12
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Combobox } from "@base-ui/react/combobox";
|
|
14
14
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
@@ -64,12 +64,11 @@ const stopNestedKeyDown = (event) => {
|
|
|
64
64
|
* - A label cut off by the chip's width shows in full in a tooltip on hover.
|
|
65
65
|
*/
|
|
66
66
|
const ComboboxChip = ({ children, color, variant }) => {
|
|
67
|
-
const renderArgo = useArgoDesign();
|
|
68
67
|
const [isTruncated, setIsTruncated] = useState(false);
|
|
69
68
|
return /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
70
69
|
render: /* @__PURE__ */ jsx(Badge.Root, {
|
|
71
70
|
color,
|
|
72
|
-
variant: variant ??
|
|
71
|
+
variant: variant ?? "pill",
|
|
73
72
|
className: "tw:max-w-40"
|
|
74
73
|
}),
|
|
75
74
|
onKeyDownCapture: stopNestedKeyDown,
|
|
@@ -262,7 +261,6 @@ const ComboboxClearButton = ({ disabled }) => /* @__PURE__ */ jsx(InputGroup.But
|
|
|
262
261
|
//#endregion
|
|
263
262
|
//#region src/components/Combobox/ComboboxContent.tsx
|
|
264
263
|
const ComboboxContent = ({ ref, align = "start", side = "bottom", sideOffset = 4, alignOffset, anchor, container, className, children, ...popupProps }) => {
|
|
265
|
-
const effectiveVariant = useArgoDesign() ? "argo" : "default";
|
|
266
264
|
return /* @__PURE__ */ jsx(Combobox.Portal, {
|
|
267
265
|
container,
|
|
268
266
|
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
@@ -276,9 +274,9 @@ const ComboboxContent = ({ ref, align = "start", side = "bottom", sideOffset = 4
|
|
|
276
274
|
className: "tw:isolate tw:z-[1055] tailwindcss-preflight",
|
|
277
275
|
children: /* @__PURE__ */ jsx(Combobox.Popup, {
|
|
278
276
|
ref,
|
|
277
|
+
"data-slot": "combobox-content",
|
|
279
278
|
"data-chips": !!anchor,
|
|
280
|
-
"data-
|
|
281
|
-
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),
|
|
279
|
+
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: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),
|
|
282
280
|
...popupProps,
|
|
283
281
|
children
|
|
284
282
|
})
|
|
@@ -302,14 +300,12 @@ const ComboboxInput = ({ ref, ...props }) => /* @__PURE__ */ jsx(Combobox.Input,
|
|
|
302
300
|
});
|
|
303
301
|
//#endregion
|
|
304
302
|
//#region src/components/Combobox/ComboboxInputGroup.tsx
|
|
305
|
-
const ComboboxInputGroup = ({ ref, state,
|
|
303
|
+
const ComboboxInputGroup = ({ ref, state, focusVariant, className, ...props }) => /* @__PURE__ */ jsx(Combobox.InputGroup, {
|
|
306
304
|
...props,
|
|
307
305
|
ref,
|
|
308
306
|
render: /* @__PURE__ */ jsx(InputGroup, {
|
|
309
307
|
state,
|
|
310
|
-
variant,
|
|
311
308
|
focusVariant,
|
|
312
|
-
sizing,
|
|
313
309
|
className
|
|
314
310
|
})
|
|
315
311
|
});
|
|
@@ -326,7 +322,7 @@ const ComboboxItemIndicator = ({ ref, className, variant = "check", ...props })
|
|
|
326
322
|
return /* @__PURE__ */ jsx(Combobox.ItemIndicator, {
|
|
327
323
|
...props,
|
|
328
324
|
ref,
|
|
329
|
-
className: cn("tw:pointer-events-none", "tw:absolute", "tw:right-2", "tw:
|
|
325
|
+
className: cn("tw:pointer-events-none", "tw:absolute", "tw:right-2", "tw:size-4", "tw:group-data-[highlighted]/combobox-item:text-hover-foreground", className),
|
|
330
326
|
render: /* @__PURE__ */ jsx(Check, {})
|
|
331
327
|
});
|
|
332
328
|
};
|
|
@@ -362,17 +358,19 @@ const useVirtualList = (items, virtualized) => {
|
|
|
362
358
|
};
|
|
363
359
|
//#endregion
|
|
364
360
|
//#region src/components/Combobox/ComboboxItem.tsx
|
|
365
|
-
const ComboboxItem = ({ ref, className, children, icon, indicator: variant = "check", ...props }) => /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
361
|
+
const ComboboxItem = ({ ref, className, children, icon, indicator: variant = "check", locked, ...props }) => /* @__PURE__ */ jsxs(Combobox.Item, {
|
|
366
362
|
...props,
|
|
367
363
|
...use(VirtualRowContext),
|
|
368
364
|
ref,
|
|
369
365
|
"data-slot": "combobox-item",
|
|
370
|
-
|
|
366
|
+
"data-locked": locked || void 0,
|
|
367
|
+
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:rounded-lg", "tw:text-sm", "tw:select-none", "tw:cursor-default", "tw:outline-hidden", "tw:data-[highlighted]:bg-hover", "tw:data-[highlighted]:text-hover-foreground", "tw:data-disabled:pointer-events-none", "tw:data-disabled:opacity-disabled", "tw:data-locked:opacity-disabled", "tw:[&_svg]:pointer-events-none", "tw:[&_svg]:shrink-0", "tw:[&_svg]:text-muted-foreground", "tw:[&_svg:not([class*='size-'])]:size-4", className),
|
|
371
368
|
children: [
|
|
372
369
|
variant !== "none" && /* @__PURE__ */ jsx(ComboboxItemIndicator, { variant }),
|
|
373
370
|
icon,
|
|
374
371
|
/* @__PURE__ */ jsx("span", {
|
|
375
|
-
|
|
372
|
+
"data-slot": "combobox-item-label",
|
|
373
|
+
className: "tw:min-w-0 tw:flex-1 tw:wrap-anywhere",
|
|
376
374
|
children
|
|
377
375
|
})
|
|
378
376
|
]
|
|
@@ -381,7 +379,7 @@ const ComboboxItem = ({ ref, className, children, icon, indicator: variant = "ch
|
|
|
381
379
|
//#region src/components/Combobox/ComboboxList.tsx
|
|
382
380
|
const ComboboxList = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Combobox.List, {
|
|
383
381
|
ref,
|
|
384
|
-
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",
|
|
382
|
+
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", className),
|
|
385
383
|
...props
|
|
386
384
|
});
|
|
387
385
|
//#endregion
|
|
@@ -400,38 +398,39 @@ const ComboboxOpenButton = ({ disabled, isLoading }) => /* @__PURE__ */ jsx(Inpu
|
|
|
400
398
|
"aria-label": "Open combobox",
|
|
401
399
|
children: /* @__PURE__ */ jsx(Combobox.Trigger, { children: isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "tw:size-4 tw:animate-spin" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "tw:size-4" }) })
|
|
402
400
|
});
|
|
403
|
-
//#endregion
|
|
404
|
-
//#region src/components/Combobox/Group/ComboboxGroupHeader.tsx
|
|
405
|
-
/** Indent of a header's children (chevron + gap); the legacy variant pads its rows wider. */
|
|
406
|
-
const GROUP_CHILD_INDENT = "tw:pl-8 tw:group-data-[variant=default]/combobox-content:pl-10";
|
|
407
401
|
/**
|
|
408
402
|
* A group's own row, standing for the whole group.
|
|
409
403
|
*
|
|
410
404
|
* - Keyboard-navigable like any other row.
|
|
411
|
-
* - The chevron toggles by pointer
|
|
405
|
+
* - The chevron toggles by pointer, Cmd- or Ctrl-click toggles every group; its tooltip says so.
|
|
406
|
+
* - `ArrowRight` / `ArrowLeft` are handled by the owning control.
|
|
412
407
|
*/
|
|
413
|
-
const ComboboxGroupHeader = ({ value, children, expanded, onToggle, checked, indicator = "check", disabled }) => {
|
|
408
|
+
const ComboboxGroupHeader = ({ value, children, expanded, onToggle, checked, indicator = "check", disabled, locked }) => {
|
|
414
409
|
const toggleFromChevron = (event) => {
|
|
415
410
|
event.stopPropagation();
|
|
416
|
-
onToggle();
|
|
411
|
+
onToggle(isToggleAllClick(event), event.currentTarget);
|
|
417
412
|
};
|
|
418
413
|
return /* @__PURE__ */ jsx(ComboboxItem, {
|
|
419
414
|
value,
|
|
420
415
|
disabled,
|
|
416
|
+
locked,
|
|
421
417
|
"aria-description": expanded === void 0 ? void 0 : expanded ? "Expanded" : "Collapsed",
|
|
422
418
|
...checked !== void 0 && { "aria-selected": checked === true },
|
|
423
419
|
indicator: "none",
|
|
424
420
|
className: "tw:font-medium",
|
|
425
421
|
onClick: checked !== void 0 ? void 0 : (event) => {
|
|
426
422
|
event.preventBaseUIHandler();
|
|
427
|
-
onToggle();
|
|
423
|
+
onToggle(isToggleAllClick(event), event.currentTarget);
|
|
428
424
|
},
|
|
429
|
-
icon: /* @__PURE__ */ jsxs(Fragment$1, { children: [expanded !== void 0 && /* @__PURE__ */ jsx(
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
425
|
+
icon: /* @__PURE__ */ jsxs(Fragment$1, { children: [expanded !== void 0 && /* @__PURE__ */ jsx(ToggleAllTooltip, {
|
|
426
|
+
expanded,
|
|
427
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
428
|
+
"aria-hidden": true,
|
|
429
|
+
"data-slot": "combobox-group-toggle",
|
|
430
|
+
className: "tw:pointer-events-auto tw:-m-1 tw:inline-flex tw:shrink-0 tw:cursor-pointer tw:rounded tw:p-1 tw:transition-colors tw:hover:bg-foreground/10",
|
|
431
|
+
onClick: toggleFromChevron,
|
|
432
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: cn("tw:transition-transform", expanded && "tw:rotate-90") })
|
|
433
|
+
})
|
|
435
434
|
}), checked !== void 0 && /* @__PURE__ */ jsx(GroupIndicator, {
|
|
436
435
|
checked,
|
|
437
436
|
variant: indicator
|
|
@@ -456,7 +455,7 @@ const GroupIndicator = ({ checked, variant }) => {
|
|
|
456
455
|
if (checked === false) return null;
|
|
457
456
|
return /* @__PURE__ */ jsx(Mark, {
|
|
458
457
|
"aria-hidden": true,
|
|
459
|
-
className: cn("tw:pointer-events-none tw:absolute tw:right-2 tw:size-4", "tw:group-data-[
|
|
458
|
+
className: cn("tw:pointer-events-none tw:absolute tw:right-2 tw:size-4", "tw:group-data-[highlighted]/combobox-item:text-hover-foreground")
|
|
460
459
|
});
|
|
461
460
|
};
|
|
462
461
|
//#endregion
|
|
@@ -472,7 +471,7 @@ const ComboboxGroup = ({ ref, className, children, ...props }) => /* @__PURE__ *
|
|
|
472
471
|
const ComboboxGroupLabel = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(Combobox.GroupLabel, {
|
|
473
472
|
...props,
|
|
474
473
|
ref,
|
|
475
|
-
className: cn("tw:px-2", "tw:py-1.5", "tw:text-xs", "tw:font-medium", "tw:leading-none", "tw:text-muted-foreground",
|
|
474
|
+
className: cn("tw:px-2", "tw:py-1.5", "tw:text-xs", "tw:font-medium", "tw:leading-none", "tw:text-muted-foreground", className)
|
|
476
475
|
});
|
|
477
476
|
//#endregion
|
|
478
477
|
//#region src/components/Combobox/Group/ComboboxCollection.tsx
|
|
@@ -516,7 +515,21 @@ const ComboboxLoadingEmpty = () => /* @__PURE__ */ jsxs("span", {
|
|
|
516
515
|
//#region src/components/Combobox/ComboboxVirtualList.tsx
|
|
517
516
|
/** Rows rendered past each edge of the viewport, so a fast scroll does not paint blank. */
|
|
518
517
|
const OVERSCAN = 12;
|
|
519
|
-
const
|
|
518
|
+
const isGroupLast = (row) => row.type === "item" && row.group !== void 0 && row.posInSet === row.setSize;
|
|
519
|
+
const kindOf = (row) => row.type === "label" ? "label" : `${row.padded ? "padded" : "plain"}${isGroupLast(row) ? "-last" : ""}`;
|
|
520
|
+
/** A row's React key: its group and its place in it, so a fold leaves other rows mounted. */
|
|
521
|
+
const placeOf = (row, index) => {
|
|
522
|
+
if (!row) return String(index);
|
|
523
|
+
if (row.type === "label") return `${row.group}:label`;
|
|
524
|
+
return `${row.group ?? "loose"}:${row.posInSet}`;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* A row's key for the virtualizer, which keeps measured heights by it.
|
|
528
|
+
*
|
|
529
|
+
* - Folding one group leaves every other row's height in place.
|
|
530
|
+
* - A row that becomes its group's last is estimated afresh, its element kept.
|
|
531
|
+
*/
|
|
532
|
+
const keyOf = (row, index) => `${placeOf(row, index)}${row && isGroupLast(row) ? ":last" : ""}`;
|
|
520
533
|
/**
|
|
521
534
|
* Base UI's filtered entries as one row per option or group label, in list order.
|
|
522
535
|
*
|
|
@@ -601,11 +614,14 @@ const ComboboxVirtualList = ({ renderItem, renderGroupItem, groupToLabel, ref })
|
|
|
601
614
|
const [rem] = useState(() => Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 0);
|
|
602
615
|
const virtualizer = useVirtualizer({
|
|
603
616
|
count: rows.length,
|
|
617
|
+
getItemKey: (index) => keyOf(rows[index], index),
|
|
604
618
|
getScrollElement: () => listElement,
|
|
605
619
|
estimateSize: (index) => {
|
|
606
620
|
const row = rows[index];
|
|
607
621
|
const measured = sizesRef.current;
|
|
608
|
-
|
|
622
|
+
const kind = row && kindOf(row);
|
|
623
|
+
const lastKinds = kind?.endsWith("-last") ? [measured["plain-last"], measured["padded-last"]] : [];
|
|
624
|
+
return (kind && measured[kind]) ?? lastKinds.find((size) => size !== void 0) ?? measured.plain ?? measured.padded ?? rem;
|
|
609
625
|
},
|
|
610
626
|
measureElement: (element, entry, instance) => {
|
|
611
627
|
const size = measureElement(element, entry, instance);
|
|
@@ -645,7 +661,7 @@ const ComboboxVirtualList = ({ renderItem, renderGroupItem, groupToLabel, ref })
|
|
|
645
661
|
width: "100%",
|
|
646
662
|
transform: `translateY(${start - scrollMargin}px)`
|
|
647
663
|
});
|
|
648
|
-
const renderRow = ({
|
|
664
|
+
const renderRow = ({ index, start }) => {
|
|
649
665
|
const row = rows[index];
|
|
650
666
|
if (!row) return null;
|
|
651
667
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -653,6 +669,7 @@ const ComboboxVirtualList = ({ renderItem, renderGroupItem, groupToLabel, ref })
|
|
|
653
669
|
ref: virtualizer.measureElement,
|
|
654
670
|
className: row.padded ? "tw:pt-0.5" : void 0,
|
|
655
671
|
style: row.group === void 0 ? placeAt(start) : void 0,
|
|
672
|
+
"data-group-last": isGroupLast(row) ? "" : void 0,
|
|
656
673
|
children: row.type === "label" ? /* @__PURE__ */ jsx(ComboboxGroupLabel, { children: labels.get(row.group ?? "") }) : /* @__PURE__ */ jsx(VirtualRowContext, {
|
|
657
674
|
value: {
|
|
658
675
|
index: row.index,
|
|
@@ -661,7 +678,7 @@ const ComboboxVirtualList = ({ renderItem, renderGroupItem, groupToLabel, ref })
|
|
|
661
678
|
},
|
|
662
679
|
children: row.group === void 0 ? renderItem(row.item) : renderGroupItem(row.item)
|
|
663
680
|
})
|
|
664
|
-
},
|
|
681
|
+
}, placeOf(row, index));
|
|
665
682
|
};
|
|
666
683
|
return /* @__PURE__ */ jsx(ComboboxList, {
|
|
667
684
|
ref: attachList,
|
|
@@ -689,12 +706,17 @@ const ComboboxVirtualList = ({ renderItem, renderGroupItem, groupToLabel, ref })
|
|
|
689
706
|
};
|
|
690
707
|
//#endregion
|
|
691
708
|
//#region src/components/Combobox/ComboboxOptions.tsx
|
|
709
|
+
/** A group's items fade and slide in as it unfolds and out as it folds; nothing under reduced motion. */
|
|
710
|
+
const ITEM_MOTION = {
|
|
711
|
+
entering: "tw:motion-safe:animate-in tw:motion-safe:fade-in-0 tw:motion-safe:slide-in-from-top-1 tw:motion-safe:duration-150 tw:motion-safe:ease-out",
|
|
712
|
+
leaving: "tw:motion-safe:animate-out tw:motion-safe:fade-out-0 tw:motion-safe:slide-out-to-top-1 tw:motion-safe:duration-100 tw:motion-safe:ease-in tw:motion-safe:fill-mode-forwards"
|
|
713
|
+
};
|
|
692
714
|
/**
|
|
693
715
|
* What a combobox popup lists: every row, the empty slot, and the loading text in it.
|
|
694
716
|
*
|
|
695
717
|
* - The list is windowed while `virtualized`, fully rendered otherwise.
|
|
696
718
|
*/
|
|
697
|
-
const ComboboxOptions = ({ isLoading, empty, virtualized, listRef, groupHeaders, groupToLabel, indicator, itemToLabel, itemToIcon, itemToDisabled, createLabel, groupRowState }) => {
|
|
719
|
+
const ComboboxOptions = ({ isLoading, empty, virtualized, listRef, groupHeaders, groupToLabel, indicator, itemToLabel, itemToIcon, itemToDisabled, itemToLocked, createLabel, groupRowState }) => {
|
|
698
720
|
const renderItem = (item, className) => {
|
|
699
721
|
if (isSelectAllItem(item)) return /* @__PURE__ */ jsx(ComboboxItem, {
|
|
700
722
|
value: item,
|
|
@@ -711,21 +733,26 @@ const ComboboxOptions = ({ isLoading, empty, virtualized, listRef, groupHeaders,
|
|
|
711
733
|
indicator,
|
|
712
734
|
icon: itemToIcon(item),
|
|
713
735
|
disabled: itemToDisabled(item),
|
|
736
|
+
locked: itemToLocked?.(item),
|
|
714
737
|
className,
|
|
715
738
|
children: itemToLabel(item)
|
|
716
739
|
});
|
|
717
740
|
};
|
|
718
741
|
const renderGroupItem = (item) => {
|
|
719
742
|
const header = groupHeaders.headerOf(item);
|
|
720
|
-
if (!header)
|
|
743
|
+
if (!header) {
|
|
744
|
+
const motion = groupHeaders.motionOf(item);
|
|
745
|
+
return renderItem(item, cn(groupHeaders.collapsible && "tw:pl-8", motion && ITEM_MOTION[motion]));
|
|
746
|
+
}
|
|
721
747
|
const state = groupRowState?.(item);
|
|
722
748
|
return /* @__PURE__ */ jsx(ComboboxGroupHeader, {
|
|
723
749
|
value: item,
|
|
724
750
|
expanded: groupHeaders.collapsible ? !header.collapsed : void 0,
|
|
725
|
-
onToggle: () => groupHeaders.toggle(header.index),
|
|
751
|
+
onToggle: (all, from) => all ? groupHeaders.setAllCollapsed(!header.collapsed, from) : groupHeaders.toggle(header.index, from),
|
|
726
752
|
checked: state?.checked,
|
|
727
753
|
indicator,
|
|
728
754
|
disabled: state?.disabled ?? false,
|
|
755
|
+
locked: state?.locked,
|
|
729
756
|
children: groupToLabel(header.group)
|
|
730
757
|
});
|
|
731
758
|
};
|
|
@@ -759,22 +786,114 @@ const ComboboxSeparator = ({ ref, className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
759
786
|
*/
|
|
760
787
|
const useWithCreated = (list, created) => useMemo(() => created.length === 0 ? list : [...list, ...toEntries(list, created)], [list, created]);
|
|
761
788
|
//#endregion
|
|
789
|
+
//#region src/components/Combobox/groupFlip.ts
|
|
790
|
+
/** How long the groups under a fold take to slide to their new place. */
|
|
791
|
+
const SLIDE_MS = 150;
|
|
792
|
+
/** A capture no commit moved anything for in this long is dropped. */
|
|
793
|
+
const STALE_MS = 500;
|
|
794
|
+
const listOf = (from) => from.closest("[role=listbox]") ?? from.ownerDocument.getElementById(from.getAttribute("aria-controls") ?? "");
|
|
795
|
+
const topIn = (list, element) => element.getBoundingClientRect().top - list.getBoundingClientRect().top + list.scrollTop;
|
|
796
|
+
/**
|
|
797
|
+
* Slides a list's groups from where they sat before a fold to where it puts them.
|
|
798
|
+
*
|
|
799
|
+
* - `capture` records each group's place; the next commit that moves one plays the slide.
|
|
800
|
+
* - A group the windowed list only now renders slides by the move of the group above it.
|
|
801
|
+
* - The caller skips `capture` under reduced motion; nothing plays without Web Animations.
|
|
802
|
+
*/
|
|
803
|
+
const useGroupFlip = (enabled) => {
|
|
804
|
+
const captureRef = useRef(null);
|
|
805
|
+
const slidesRef = useRef(/* @__PURE__ */ new WeakMap());
|
|
806
|
+
const settledTop = (list, group) => {
|
|
807
|
+
const slide = slidesRef.current.get(group);
|
|
808
|
+
const progress = slide?.animation.effect?.getComputedTiming().progress;
|
|
809
|
+
const offset = slide && typeof progress === "number" ? slide.shift * (1 - progress) : 0;
|
|
810
|
+
return topIn(list, group) - offset;
|
|
811
|
+
};
|
|
812
|
+
useLayoutEffect(() => {
|
|
813
|
+
const capture = captureRef.current;
|
|
814
|
+
if (!capture) return;
|
|
815
|
+
if (performance.now() - capture.at > STALE_MS) {
|
|
816
|
+
captureRef.current = null;
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
const groups = [...capture.list.querySelectorAll("[role=group]")];
|
|
820
|
+
let lastShift = 0;
|
|
821
|
+
const shifts = groups.map((group) => {
|
|
822
|
+
const before = capture.tops.get(group);
|
|
823
|
+
const shift = before === void 0 ? lastShift : before - settledTop(capture.list, group);
|
|
824
|
+
lastShift = shift;
|
|
825
|
+
return shift;
|
|
826
|
+
});
|
|
827
|
+
if (shifts.every((shift) => Math.abs(shift) < .5)) return;
|
|
828
|
+
captureRef.current = null;
|
|
829
|
+
groups.forEach((group, index) => {
|
|
830
|
+
const shift = shifts[index] ?? 0;
|
|
831
|
+
slidesRef.current.get(group)?.animation.cancel();
|
|
832
|
+
if (Math.abs(shift) < .5) return;
|
|
833
|
+
const animation = group.animate([{ transform: `translateY(${shift}px)` }, { transform: "translateY(0)" }], {
|
|
834
|
+
duration: SLIDE_MS,
|
|
835
|
+
easing: "ease-out",
|
|
836
|
+
composite: "add"
|
|
837
|
+
});
|
|
838
|
+
slidesRef.current.set(group, {
|
|
839
|
+
animation,
|
|
840
|
+
shift
|
|
841
|
+
});
|
|
842
|
+
});
|
|
843
|
+
});
|
|
844
|
+
return {
|
|
845
|
+
/** Records where the groups of the list `from` belongs to sit now. */
|
|
846
|
+
capture: (from) => {
|
|
847
|
+
const list = from && listOf(from);
|
|
848
|
+
if (!enabled || !list || typeof list.animate !== "function") return;
|
|
849
|
+
const tops = /* @__PURE__ */ new Map();
|
|
850
|
+
for (const group of list.querySelectorAll("[role=group]")) tops.set(group, topIn(list, group));
|
|
851
|
+
captureRef.current = {
|
|
852
|
+
list,
|
|
853
|
+
tops,
|
|
854
|
+
at: performance.now()
|
|
855
|
+
};
|
|
856
|
+
} };
|
|
857
|
+
};
|
|
858
|
+
//#endregion
|
|
762
859
|
//#region src/components/Combobox/groupHeaders.ts
|
|
860
|
+
/** How long a folding group's items fade out before they leave the list. */
|
|
861
|
+
const FOLD_MS = 100;
|
|
862
|
+
/** How long an unfolding group's items animate in; their marker clears after it. */
|
|
863
|
+
const ENTER_MS = 150;
|
|
864
|
+
const NO_FOLDS = /* @__PURE__ */ new Set();
|
|
865
|
+
const hasMotion = () => typeof window.matchMedia === "function" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
763
866
|
/**
|
|
764
867
|
* Gives each group a row (rendered with `ComboboxGroupHeader`) and collapses groups on request.
|
|
765
868
|
*
|
|
766
869
|
* - The row is the group's first item, so Base UI navigates, filters and presses it.
|
|
767
870
|
* - A collapsed group hands Base UI only its row: Base UI never filters an empty query.
|
|
768
|
-
* - A query
|
|
871
|
+
* - A query opens every group with a match; a fold made under it lasts until the query changes.
|
|
872
|
+
* - A row shows only while its group matches.
|
|
769
873
|
* - Collapse state is keyed by a group's position in `items`.
|
|
770
874
|
*/
|
|
771
|
-
const useGroupHeaders = ({ items, collapsible, selectable, query, matches, groupToValue, isItemEqualToValue }) => {
|
|
772
|
-
const [collapsedIndexes, setCollapsedIndexes] = useState(() => /* @__PURE__ */ new Set());
|
|
875
|
+
const useGroupHeaders = ({ items, collapsible, selectable, query, matches, groupToValue, isItemEqualToValue, startsCollapsed, startsOpen = false }) => {
|
|
876
|
+
const [collapsedIndexes, setCollapsedIndexes] = useState(() => startsOpen && collapsible && startsCollapsed && isGroupItems(items) ? new Set(items.flatMap((group, index) => startsCollapsed(group) ? [index] : [])) : /* @__PURE__ */ new Set());
|
|
877
|
+
const [searchFolds, setSearchFolds] = useState({
|
|
878
|
+
query: "",
|
|
879
|
+
indexes: /* @__PURE__ */ new Set()
|
|
880
|
+
});
|
|
881
|
+
/** The folds that apply now: those made without a query, or under this very query. */
|
|
882
|
+
const folded = query === "" ? collapsedIndexes : searchFolds.query === query ? searchFolds.indexes : NO_FOLDS;
|
|
883
|
+
const queryRef = useRef(query);
|
|
884
|
+
useLayoutEffect(() => {
|
|
885
|
+
queryRef.current = query;
|
|
886
|
+
}, [query]);
|
|
773
887
|
const highlightedRef = useRef(void 0);
|
|
888
|
+
/** The groups animating, and the query their fold belongs to. */
|
|
889
|
+
const [motion, setMotion] = useState(null);
|
|
890
|
+
const foldTimerRef = useRef(void 0);
|
|
891
|
+
useEffect(() => () => clearTimeout(foldTimerRef.current), []);
|
|
892
|
+
const flip = useGroupFlip(collapsible);
|
|
774
893
|
const enabled = (collapsible || selectable) && isGroupItems(items);
|
|
775
894
|
const headers = /* @__PURE__ */ new Map();
|
|
776
895
|
const listItems = !enabled ? items : items.map((group, index) => {
|
|
777
|
-
const collapsed = collapsible &&
|
|
896
|
+
const collapsed = collapsible && folded.has(index);
|
|
778
897
|
const matching = query === "" ? group.items : group.items.filter(matches);
|
|
779
898
|
const row = groupToValue ? groupToValue(group) : createGroupHeaderItem(index);
|
|
780
899
|
headers.set(row, {
|
|
@@ -788,11 +907,78 @@ const useGroupHeaders = ({ items, collapsible, selectable, query, matches, group
|
|
|
788
907
|
items: collapsed ? [row] : [row, ...group.items]
|
|
789
908
|
};
|
|
790
909
|
});
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
910
|
+
/**
|
|
911
|
+
* Folds or unfolds groups under `scope`, the query the toggle was made under.
|
|
912
|
+
*
|
|
913
|
+
* - A fold made without a query always lands.
|
|
914
|
+
* - A fold made under a query the input no longer holds is dropped: it would never show.
|
|
915
|
+
*/
|
|
916
|
+
const setCollapsed = (indexes, collapsed, scope = query) => {
|
|
917
|
+
const apply = (prev) => {
|
|
918
|
+
const next = new Set(prev);
|
|
919
|
+
for (const index of indexes) if (collapsed) next.add(index);
|
|
920
|
+
else next.delete(index);
|
|
921
|
+
return next.size === prev.size && [...next].every((index) => prev.has(index)) ? prev : next;
|
|
922
|
+
};
|
|
923
|
+
if (scope === "") setCollapsedIndexes(apply);
|
|
924
|
+
else if (scope === queryRef.current) setSearchFolds((prev) => {
|
|
925
|
+
const base = prev.query === scope ? prev.indexes : NO_FOLDS;
|
|
926
|
+
const next = apply(base);
|
|
927
|
+
return next === base && prev.query === scope ? prev : {
|
|
928
|
+
query: scope,
|
|
929
|
+
indexes: next
|
|
930
|
+
};
|
|
931
|
+
});
|
|
932
|
+
};
|
|
933
|
+
const endMotionAfter = (ms, then) => {
|
|
934
|
+
clearTimeout(foldTimerRef.current);
|
|
935
|
+
foldTimerRef.current = setTimeout(() => {
|
|
936
|
+
then?.();
|
|
937
|
+
setMotion(null);
|
|
938
|
+
}, ms);
|
|
939
|
+
};
|
|
940
|
+
const folding = motion?.folding ? motion.indexes : /* @__PURE__ */ new Set();
|
|
941
|
+
/** A group still fading out counts as folded. */
|
|
942
|
+
const isCollapsed = (index) => folded.has(index) || folding.has(index);
|
|
943
|
+
/**
|
|
944
|
+
* Unfolds groups with their items animating in, or fades them out, then folds them.
|
|
945
|
+
*
|
|
946
|
+
* - The groups under them slide to their new place.
|
|
947
|
+
* - Folds still fading out finish at once, except those this call unfolds again.
|
|
948
|
+
*/
|
|
949
|
+
const animate = (indexes, collapse, from) => {
|
|
950
|
+
clearTimeout(foldTimerRef.current);
|
|
951
|
+
const animated = hasMotion();
|
|
952
|
+
const finishing = [...folding].filter((index) => collapse || !indexes.includes(index));
|
|
953
|
+
const changing = indexes.filter((index) => isCollapsed(index) !== collapse);
|
|
954
|
+
if (animated && (finishing.length > 0 || changing.length > 0)) flip.capture(from);
|
|
955
|
+
if (motion) setCollapsed(finishing, true, motion.scope);
|
|
956
|
+
if (!animated || changing.length === 0) {
|
|
957
|
+
setCollapsed(changing, collapse);
|
|
958
|
+
setMotion(null);
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
const scope = query;
|
|
962
|
+
setMotion({
|
|
963
|
+
indexes: new Set(changing),
|
|
964
|
+
folding: collapse,
|
|
965
|
+
scope
|
|
966
|
+
});
|
|
967
|
+
if (collapse) endMotionAfter(FOLD_MS, () => setCollapsed(changing, true, scope));
|
|
968
|
+
else {
|
|
969
|
+
setCollapsed(changing, false);
|
|
970
|
+
endMotionAfter(ENTER_MS);
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
/** Unfolds a folded group, folds an open one. */
|
|
974
|
+
const toggle = (index, from) => animate([index], !isCollapsed(index), from);
|
|
975
|
+
/** Folds or unfolds every group. */
|
|
976
|
+
const setAllCollapsed = (collapse, from) => {
|
|
977
|
+
if (!isGroupItems(items)) return;
|
|
978
|
+
animate(items.map((_, index) => index), collapse, from);
|
|
979
|
+
};
|
|
980
|
+
const groupIndexOf = /* @__PURE__ */ new Map();
|
|
981
|
+
if (motion && enabled && isGroupItems(items)) for (const index of motion.indexes) for (const item of items[index]?.items ?? []) groupIndexOf.set(item, index);
|
|
796
982
|
const headerOf = (item) => headers.get(item);
|
|
797
983
|
const highlightedHeader = () => {
|
|
798
984
|
const item = highlightedRef.current;
|
|
@@ -808,6 +994,12 @@ const useGroupHeaders = ({ items, collapsible, selectable, query, matches, group
|
|
|
808
994
|
collapsible,
|
|
809
995
|
headerOf,
|
|
810
996
|
toggle,
|
|
997
|
+
setAllCollapsed,
|
|
998
|
+
/** `entering` / `leaving` for an item of the group that last unfolded / is folding. */
|
|
999
|
+
motionOf: (item) => {
|
|
1000
|
+
if (!motion || !groupIndexOf.has(item)) return void 0;
|
|
1001
|
+
return motion.folding ? "leaving" : "entering";
|
|
1002
|
+
},
|
|
811
1003
|
/** `filter` verdict for a group row (matches while its group does); `undefined` otherwise. */
|
|
812
1004
|
filterHeader: (item) => {
|
|
813
1005
|
const header = headerOf(item);
|
|
@@ -817,9 +1009,13 @@ const useGroupHeaders = ({ items, collapsible, selectable, query, matches, group
|
|
|
817
1009
|
onItemHighlighted: (item) => {
|
|
818
1010
|
highlightedRef.current = item;
|
|
819
1011
|
},
|
|
820
|
-
/** For the root's `onOpenChange`:
|
|
1012
|
+
/** For the root's `onOpenChange`: clears the highlight on close, folds `startsCollapsed` on open. */
|
|
821
1013
|
onOpenChange: (open) => {
|
|
822
1014
|
if (!open) highlightedRef.current = void 0;
|
|
1015
|
+
clearTimeout(foldTimerRef.current);
|
|
1016
|
+
if (motion?.folding) setCollapsed(motion.indexes, true, motion.scope);
|
|
1017
|
+
setMotion(null);
|
|
1018
|
+
if (open && collapsible && startsCollapsed && isGroupItems(items)) setCollapsedIndexes(new Set(items.flatMap((group, index) => startsCollapsed(group) ? [index] : [])));
|
|
823
1019
|
},
|
|
824
1020
|
/**
|
|
825
1021
|
* For the input's `onKeyDown`: `ArrowRight` / `ArrowLeft` expand / collapse the highlighted row.
|
|
@@ -832,7 +1028,7 @@ const useGroupHeaders = ({ items, collapsible, selectable, query, matches, group
|
|
|
832
1028
|
if (!header) return;
|
|
833
1029
|
event.preventDefault();
|
|
834
1030
|
event.preventBaseUIHandler();
|
|
835
|
-
if (header.
|
|
1031
|
+
if (isCollapsed(header.index) === (event.key === "ArrowRight")) toggle(header.index, event.currentTarget);
|
|
836
1032
|
}
|
|
837
1033
|
};
|
|
838
1034
|
};
|
|
@@ -867,7 +1063,7 @@ const useQueryReporter = (query, onQueryChange) => {
|
|
|
867
1063
|
//#region src/components/Combobox/Combobox.tsx
|
|
868
1064
|
const acceptAll = () => true;
|
|
869
1065
|
const NO_ITEMS = [];
|
|
870
|
-
const Combobox$1 = ({ items: _itemsProp, value, defaultValue, onValueChange, itemToStringLabel: itemToStringLabelProp, itemToStringValue, disabled, filter, inputRef, onOpenChangeComplete, isItemEqualToValue: isItemEqualToValueProp,
|
|
1066
|
+
const Combobox$1 = ({ items: _itemsProp, value, defaultValue, onValueChange, itemToStringLabel: itemToStringLabelProp, itemToStringValue, disabled, filter, inputRef, onOpenChangeComplete, isItemEqualToValue: isItemEqualToValueProp, focusVariant, state, placeholder, allowClear = true, name, onBlur, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, className, empty = "No items", isLoading = false, indicator, prefix, virtualized = false, inputValueSanitizer, onQueryChange, allowCreate, queryToCreateValue, queryToCreateLabel = defaultQueryToCreateLabel, canCreate, itemToDisabled = defaultItemToDisabled, itemToLabel: itemToLabelProp, itemToIcon = defaultItemToIcon, itemToSelectedLabel, groupToLabel = defaultGroupToLabel, collapsibleGroups = false, groupToValue, ...accessibleName }) => {
|
|
871
1067
|
/** An item's string identity: input text, default search subject, accessible value. */
|
|
872
1068
|
const labelOf = useCallback((item) => itemToStringLabelProp?.(item) ?? toLabel(item), [itemToStringLabelProp]);
|
|
873
1069
|
const itemToLabel = itemToLabelProp ?? defaultRowLabel(itemToStringLabelProp);
|
|
@@ -992,8 +1188,6 @@ const Combobox$1 = ({ items: _itemsProp, value, defaultValue, onValueChange, ite
|
|
|
992
1188
|
virtualList.onItemHighlighted(details);
|
|
993
1189
|
},
|
|
994
1190
|
children: [/* @__PURE__ */ jsxs(ComboboxInputGroup, {
|
|
995
|
-
variant,
|
|
996
|
-
sizing,
|
|
997
1191
|
state,
|
|
998
1192
|
focusVariant,
|
|
999
1193
|
className,
|
|
@@ -1078,4 +1272,4 @@ const filterByWords = (item, query, itemToString) => matchByWords(itemToString?.
|
|
|
1078
1272
|
//#endregion
|
|
1079
1273
|
export { BLANK_VALUES, Combobox$1 as Combobox, ComboboxClearButton, ComboboxOpenButton, ComboboxOptions, createCreatableItem, defaultGroupToLabel, defaultItemToDisabled, defaultItemToIcon, defaultQueryToCreateLabel, defaultRowLabel, defaultToCreateValue, filterByWords, flatItems, isCreatableItem, isGroupHeaderItem, isSelectAllItem, matchByWords, namedLabel, sanitizeTypedInput, selectAllItem, toEntries, toLabel, useCreatableStringValue, useGroupHeaders, useItemEquality, useQueryReporter, useVirtualList, useWithCreated, withBlankValues };
|
|
1080
1274
|
|
|
1081
|
-
//# sourceMappingURL=Combobox-
|
|
1275
|
+
//# sourceMappingURL=Combobox-CaKqgstG.js.map
|