@keboola/design 11.6.1 → 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 +50 -9
- package/CHANGELOG.md +241 -0
- package/COMPONENT-API.md +337 -288
- package/README.md +12 -2
- package/dist/{AIKit-CQxVwyAk.js → AIKit-BD4r7ff-.js} +807 -199
- package/dist/AIKit-BD4r7ff-.js.map +1 -0
- package/dist/{Alert-C4Y9IwMI.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-CS9P4r2p.js → BrandEditor-BU23Vl8V.js} +7 -7
- package/dist/{BrandEditor-CS9P4r2p.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-D1id7YXd.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-Bqr6zXcW.js → Checkbox-8yIIgY7g.js} +4 -4
- package/dist/Checkbox-8yIIgY7g.js.map +1 -0
- package/dist/{Clipboard-C2YBRfD8.js → Clipboard-_xf6hMDD.js} +2 -2
- package/dist/{Clipboard-C2YBRfD8.js.map → Clipboard-_xf6hMDD.js.map} +1 -1
- package/dist/{ClipboardButton-CrljClL1.js → ClipboardButton-DHa1trtI.js} +4 -4
- package/dist/{ClipboardButton-CrljClL1.js.map → ClipboardButton-DHa1trtI.js.map} +1 -1
- package/dist/{CodeEditor-C9AS8Ch0.js → CodeEditor-BSo-oLFG.js} +55 -165
- package/dist/CodeEditor-BSo-oLFG.js.map +1 -0
- package/dist/{ColorInput-Dg87lKcR.js → ColorInput-DSMqrs2-.js} +12 -27
- package/dist/ColorInput-DSMqrs2-.js.map +1 -0
- package/dist/{ColorModeSwitch-CsWLiTBX.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-CqxoI_De.js → Command-BU_cVurn.js} +4 -4
- package/dist/{Command-CqxoI_De.js.map → Command-BU_cVurn.js.map} +1 -1
- package/dist/{CopyField-Rx9HPTbJ.js → CopyField-6_c-NdLO.js} +17 -53
- package/dist/{CopyField-Rx9HPTbJ.js.map → CopyField-6_c-NdLO.js.map} +1 -1
- package/dist/{DateInput-DpifECUQ.js → DateInput-DyEErfJf.js} +6 -6
- package/dist/{DateInput-DpifECUQ.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-9MIw7P6L.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-CASr-jgl.js → DropdownMenu-gRM-A8qU.js} +11 -6
- package/dist/DropdownMenu-gRM-A8qU.js.map +1 -0
- package/dist/{FieldItem-DtPTzNef.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-DAaatlBk.js → Form-95rVLfX8.js} +15 -23
- package/dist/{Form-DAaatlBk.js.map → Form-95rVLfX8.js.map} +1 -1
- package/dist/{FormGroup-Bl8JmnzJ.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-DcZRlVnN.js → InputGroup-B4QOPxHl.js} +12 -13
- package/dist/InputGroup-B4QOPxHl.js.map +1 -0
- package/dist/{Kbd-D1Azcc4g.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-CujFxVzk.js → MermaidDiagram-BQvz6bhv.js} +16 -34
- package/dist/MermaidDiagram-BQvz6bhv.js.map +1 -0
- package/dist/{Modal-Coj-H02o.js → Modal-Driyqs_N.js} +17 -34
- package/dist/Modal-Driyqs_N.js.map +1 -0
- package/dist/{ModalTitle-C76ke2eo.js → ModalTitle-BxopkIoQ.js} +3 -3
- package/dist/ModalTitle-BxopkIoQ.js.map +1 -0
- package/dist/{MultiActionButtonGroup-CNNoBQbv.js → MultiActionButtonGroup-BPnmzBtw.js} +3 -3
- package/dist/{MultiActionButtonGroup-CNNoBQbv.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-CUBsuP7r.js → RadioGroup-CBPRLRN0.js} +4 -4
- package/dist/{RadioGroup-CUBsuP7r.js.map → RadioGroup-CBPRLRN0.js.map} +1 -1
- package/dist/{Search-DVpJuzr9.js → Search-DmkQo716.js} +3 -3
- package/dist/{Search-DVpJuzr9.js.map → Search-DmkQo716.js.map} +1 -1
- package/dist/{SearchInput-Q85p8Ews.js → SearchInput-CEfQDNl3.js} +8 -13
- package/dist/SearchInput-CEfQDNl3.js.map +1 -0
- package/dist/{SectionNav-mpmSM3OC.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-Chf0kX1E.js → Sheet-C-yXk5Da.js} +5 -9
- package/dist/Sheet-C-yXk5Da.js.map +1 -0
- package/dist/{Sidebar-CTWsHZhF.js → Sidebar-Ds0E6PbR.js} +181 -33
- package/dist/Sidebar-Ds0E6PbR.js.map +1 -0
- package/dist/{Slider-Bv0B6lI0.js → Slider-DWdu9NuM.js} +3 -3
- package/dist/{Slider-Bv0B6lI0.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-DiEMxVF6.js → TextInput-CDG2XpBl.js} +12 -15
- package/dist/TextInput-CDG2XpBl.js.map +1 -0
- package/dist/{ThemeProvider-BI6JWBdJ.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-BG5Xogxh.js → Timeline-B-I6sb0M.js} +2 -2
- package/dist/{Timeline-BG5Xogxh.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-U_VH3QRO.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 +1461 -1809
- package/dist/index.js +70 -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 +129 -0
- package/dist/internal/blocks/ChipEditor.js.map +1 -0
- 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 +162 -165
- 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 +60 -0
- package/dist/internal/components/StatusDot.js.map +1 -0
- 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 +2 -2
- 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/mergeRefs.js +27 -9
- package/dist/internal/utils/mergeRefs.js.map +1 -1
- package/dist/internal/utils.js +3 -3
- 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-DnkrFYqY.js → utils-Bd28bWgm.js} +53 -20
- 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 +11 -9
- package/src/styles.css +120 -14
- package/src/theme.css +126 -6
- package/dist/AIKit-CQxVwyAk.js.map +0 -1
- package/dist/Alert-C4Y9IwMI.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-D1id7YXd.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-Bqr6zXcW.js.map +0 -1
- package/dist/CodeEditor-C9AS8Ch0.js.map +0 -1
- package/dist/ColorInput-Dg87lKcR.js.map +0 -1
- package/dist/ColorModeSwitch-CsWLiTBX.js.map +0 -1
- package/dist/Combobox-BfanUAqY.js +0 -619
- package/dist/Combobox-BfanUAqY.js.map +0 -1
- package/dist/DateRangeInput-9MIw7P6L.js.map +0 -1
- package/dist/DateRangePicker-DjSUFjh4.js.map +0 -1
- package/dist/DropdownMenu-CASr-jgl.js.map +0 -1
- package/dist/FieldItem-DtPTzNef.js.map +0 -1
- package/dist/FormGroup-Bl8JmnzJ.js.map +0 -1
- package/dist/FullScreenModal-CN9nAs72.js.map +0 -1
- package/dist/InputGroup-DcZRlVnN.js.map +0 -1
- package/dist/Kbd-D1Azcc4g.js.map +0 -1
- package/dist/MermaidDiagram-CujFxVzk.js.map +0 -1
- package/dist/Modal-Coj-H02o.js.map +0 -1
- package/dist/ModalTitle-C76ke2eo.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-Q85p8Ews.js.map +0 -1
- package/dist/SectionNav-mpmSM3OC.js.map +0 -1
- package/dist/Sheet-Chf0kX1E.js.map +0 -1
- package/dist/Sidebar-CTWsHZhF.js.map +0 -1
- package/dist/TextInput-DiEMxVF6.js.map +0 -1
- package/dist/ThemeProvider-BI6JWBdJ.js.map +0 -1
- package/dist/ZoomableSvg-U_VH3QRO.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-DkF6esWL.js +0 -15
- package/dist/useElement-DkF6esWL.js.map +0 -1
- package/dist/utils-DnkrFYqY.js.map +0 -1
- package/dist/vegaTheme-CSvFEMBl.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal-Coj-H02o.js","names":[],"sources":["../src/components/Modal/ModalBody.tsx","../src/components/Modal/ModalContent.tsx","../src/components/Modal/ModalFooter.tsx","../src/components/Modal/ModalActions.tsx","../src/components/Modal/ModalHeader.tsx","../src/components/Modal/ModalIcon.tsx","../src/components/Modal/ModalImage.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\n/** Props for `Modal.Body`. Accepts all `<div>` attributes; `as=\"form\"` is reserved for future use. */\ntype Props = ComponentProps<'div'> & {\n as?: 'form';\n};\n\n/**\n * Scrollable body slot for `Modal`. Place form fields, content blocks, or detail panels here.\n * Takes available height inside `Modal.Content` and scrolls when content overflows.\n */\nexport const ModalBody = ({ className, ...props }: Props) => (\n <div\n data-slot=\"modal-body\"\n className={cn(\n // scrollable body - takes available space and scrolls when content overflows\n 'tw:flex-1',\n 'tw:overflow-y-auto',\n\n // argo: soft top/bottom edge fade in place of header/footer separators (pure-CSS utility)\n 'tw:group-data-[argo=true]/modal:scroll-fade-y',\n\n // Own horizontal padding, matching Header/Footer so content edges align (ModalContent adds none)\n 'tw:group-data-[argo=false]/modal:px-7',\n 'tw:group-data-[argo=true]/modal:px-4',\n 'tw:py-1',\n\n // normalize nested Lucide icon sizing, matching Popover/HoverCard/Alert content surfaces\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { ModalOverlay } from './ModalOverlay';\n\ntype Props = ComponentProps<typeof Content> & {\n size?: 'small' | 'medium' | 'large';\n};\n\nexport const ModalContent = ({\n size = 'medium',\n className,\n children,\n onEscapeKeyDown,\n ...props\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handleEscapeKeyDown: typeof onEscapeKeyDown = (event) => {\n // Stop propagation to prevent parent modals (like FullScreenModal) from closing\n event.stopPropagation();\n onEscapeKeyDown?.(event);\n };\n\n return (\n <Portal>\n <ModalOverlay>\n <Content\n // props first so callers can't override the computed data-argo / data-size\n {...props}\n data-argo={renderArgo}\n data-size={size}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group/modal',\n\n // positioning - horizontally centered; vertical anchor depends on the design language\n 'tw:fixed',\n 'tw:left-1/2',\n 'tw:-translate-x-1/2',\n 'tw:z-[1051]',\n\n // legacy: anchored near the top; argo: centered in the viewport (like AlertModal)\n 'tw:data-[argo=false]:top-20',\n 'tw:data-[argo=true]:top-1/2',\n 'tw:data-[argo=true]:-translate-y-1/2',\n\n // sizing - responsive max dimensions\n 'tw:w-full',\n 'tw:max-w-2xl',\n 'tw:max-h-[calc(100vh-2*theme(spacing.20))]',\n\n // layout\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-4',\n 'tw:data-[argo=false]:rounded-lg',\n 'tw:data-[argo=true]:rounded-3xl',\n 'tw:bg-card',\n 'tw:text-card-foreground',\n\n // Vertical (edge) padding lives here so it survives an omitted Header or Footer.\n // Horizontal padding is owned by Header / Body / Footer, so the Body runs full-bleed and\n // its scrollbar sits at the modal edge (see ModalBody).\n 'tw:data-[argo=false]:py-8',\n 'tw:data-[argo=true]:py-4',\n\n // animation — shared\n 'tw:duration-200',\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n\n // NOTE: no `slide-*-left-1/2` (both) or argo `slide-*-top-1/2`. Those re-pinned the\n // -50%/-50% centring during the animation under v3, where centring and the animation\n // shared the `transform` property (the animation overrode it). Under v4 the centring\n // uses the `translate` PROPERTY while tw-animate-css animates `transform` — they compose\n // instead of overriding, so a -50% enter-translate stacks on the -50% centring (= -100%)\n // and the modal flies in from the top-left. Centring now persists on its own, so we\n // animate transform-only (zoom + fade) and the modal stays put.\n\n // legacy: slide-down + zoom (top-anchored via `top-20`, so no `translate-y` to double)\n 'tw:data-[argo=false]:data-[state=open]:zoom-in-80',\n 'tw:data-[argo=false]:data-[state=open]:slide-in-from-top-[48%]',\n 'tw:data-[argo=false]:data-[state=closed]:zoom-out-80',\n 'tw:data-[argo=false]:data-[state=closed]:slide-out-to-top-[48%]',\n\n // argo: pop from the centre — zoom only\n 'tw:data-[argo=true]:data-[state=open]:zoom-in-95',\n 'tw:data-[argo=true]:data-[state=closed]:zoom-out-95',\n\n {\n 'tw:max-w-[480px]': size === 'small',\n 'tw:max-w-4xl': size === 'large',\n },\n\n className,\n )}\n onEscapeKeyDown={handleEscapeKeyDown}\n >\n {children}\n </Content>\n </ModalOverlay>\n </Portal>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\n/**\n * The modal's action row.\n *\n * - Right-aligns its children in a row, 8px apart, at their natural height.\n * - Imposes no width on its children: one that should fill the row carries `tw:w-full` itself\n * (`Button block`, `ButtonGroup variant=\"block\"`). Passing `tw:w-full` to the footer does\n * nothing — it already stretches to the modal's width as a `ModalContent` flex item.\n * - Owns the horizontal padding; `ModalContent` owns the vertical edge padding.\n * - Overriding the arrangement means passing the conflicting class: `cn` runs tailwind-merge, which\n * displaces only within a group. `tw:justify-between` replaces `justify-end`; `tw:flex-col`\n * leaves `items-center` and the gap in place, so a stacked footer wants `tw:items-stretch` too.\n */\nexport const ModalFooter = ({ className, ...props }: Props) => (\n <div\n {...props}\n className={cn(\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-end',\n 'tw:gap-2',\n\n // Own horizontal padding (ModalContent owns the vertical edge padding)\n 'tw:group-data-[argo=false]/modal:px-7',\n 'tw:group-data-[argo=true]/modal:px-4',\n className,\n )}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\n/**\n * Container for the header's top-right controls — any `actions` passed to `Modal.Header` plus the\n * close icon. Sits in the header grid's last column, top-aligned. Mirrors `Alert`'s action slot.\n */\nexport const ModalActions = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:col-start-3',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-1',\n // argo: gutter separating the actions/close from the title (carried here so the grid needs no\n // column gap — see ModalHeader)\n 'tw:group-data-[argo=true]/modal:ml-3',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Close } from '@radix-ui/react-dialog';\n\nimport { X } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { Separator } from '../Separator';\n\nimport { ModalActions } from './ModalActions';\nimport { ModalDescription } from './ModalDescription';\nimport { ModalTitle } from './ModalTitle';\n\ntype Props = {\n /** Status icon slot — `<Modal.Icon />` or `<Modal.Image />`. */\n icon?: ReactNode;\n /** Visible subtitle below the title (also fills `aria-describedby`). */\n description?: ReactNode;\n /** Screen-reader-only description; fills `aria-describedby` without rendering visibly. */\n 'aria-description'?: string;\n /** Controls rendered top-right, before the close icon. */\n actions?: ReactNode;\n /** Hide the top-right close icon. */\n hideCloseIcon?: boolean;\n} & ComponentProps<'div'>;\n\n/** Modal header: `[icon] | title (children) | actions + close` on row 1, `description` on row 2. */\nexport const ModalHeader = ({\n className,\n icon,\n description,\n 'aria-description': ariaDescription,\n actions,\n hideCloseIcon = false,\n children,\n ...props\n}: Props) => (\n <div\n {...props}\n data-slot=\"modal-header\"\n className={cn(\n 'tw:grid',\n 'tw:grid-cols-[auto_1fr_auto]',\n 'tw:items-center',\n 'tw:group-data-[argo=false]/modal:px-7',\n 'tw:group-data-[argo=true]/modal:px-4',\n className,\n )}\n >\n {icon}\n\n {children && <ModalTitle className=\"tw:col-start-2 tw:row-start-1\">{children}</ModalTitle>}\n {(actions || !hideCloseIcon) && (\n <ModalActions>\n {actions}\n {!hideCloseIcon && (\n <Close asChild>\n <Button variant=\"invisible\" size=\"icon-sm\">\n <X />\n <span className=\"tw:sr-only\">Close</span>\n </Button>\n </Close>\n )}\n </ModalActions>\n )}\n {(description || ariaDescription) && (\n <ModalDescription\n className={cn(\n 'tw:col-start-1',\n 'tw:col-end-4',\n 'tw:row-start-2',\n description ? 'tw:mt-1' : 'tw:sr-only',\n )}\n >\n {description ?? ariaDescription}\n </ModalDescription>\n )}\n\n {/* Legacy-only separator; shown when a Body follows, hidden when that body hosts Tabs. */}\n <div\n className={cn(\n 'tw:col-start-1',\n 'tw:col-end-4',\n 'tw:mt-5',\n 'tw:hidden',\n 'tw:group-data-[argo=false]/modal:[[data-slot=modal-header]:has(~[data-slot=modal-body])_&]:block',\n 'tw:group-data-[argo=false]/modal:[[data-slot=modal-header]:has(~[data-slot=modal-body]_[data-slot=tabs-root])_&]:!hidden',\n )}\n >\n <Separator orientation=\"horizontal\" />\n </div>\n </div>\n);\n","import type { ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\ntype NamedColor = 'orange' | 'blue' | 'red' | 'green' | 'gray' | 'violet';\n\ntype Props = {\n color: NamedColor | (string & {});\n icon: ReactNode;\n};\n\nconst NAMED_COLORS = new Set<string>(['orange', 'blue', 'red', 'green', 'gray', 'violet']);\n\n/**\n * Status-coloured icon for `Modal`. Authored inside `Modal.Header`. For a remote image badge (a\n * component or backend logo fetched by URL) use `Modal.Image` instead.\n *\n * - **Legacy anatomy:** a solid-filled circular badge docked to the top-left of `Modal.Content`\n * (absolutely positioned, so it renders identically wherever it is authored).\n * - **Argo anatomy** (`data-argo` on `Modal.Content`): a small soft-tinted inline badge in the\n * header grid, next to the title.\n *\n * Both variants are rendered and toggled purely via CSS (`group-data-[argo=true]/modal:`) — no\n * context. Use the categorical `color` (`red` destructive, `orange` warning, `green` success,\n * `blue` info, `gray` neutral, `violet` agent) to encode meaning; the palette stays fixed across\n * brand themes.\n */\nexport const ModalIcon = ({ color, icon }: Props) => {\n const customColor = color && !NAMED_COLORS.has(color) ? color : undefined;\n\n return (\n <span\n data-slot=\"modal-icon\"\n className={cn(\n 'tw:flex',\n 'tw:shrink-0',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:[&_svg]:aspect-square',\n\n // legacy: solid-filled circular badge floating at the modal's top-left\n 'tw:group-data-[argo=false]/modal:absolute',\n 'tw:group-data-[argo=false]/modal:top-0',\n 'tw:group-data-[argo=false]/modal:left-8',\n 'tw:group-data-[argo=false]/modal:-translate-y-1/2',\n 'tw:group-data-[argo=false]/modal:size-12',\n 'tw:group-data-[argo=false]/modal:rounded-full',\n 'tw:group-data-[argo=false]/modal:[&_svg:not([class*=\"tw:size-\"])]:size-6',\n\n // argo: soft-tinted inline badge in the header grid's first column\n 'tw:group-data-[argo=true]/modal:col-start-1',\n 'tw:group-data-[argo=true]/modal:row-start-1',\n 'tw:group-data-[argo=true]/modal:self-start',\n 'tw:group-data-[argo=true]/modal:mr-3',\n 'tw:group-data-[argo=true]/modal:size-8',\n 'tw:group-data-[argo=true]/modal:rounded',\n 'tw:group-data-[argo=true]/modal:overflow-hidden',\n 'tw:group-data-[argo=true]/modal:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n\n // legacy palette: solid fill + white glyph (violet is the exception — tinted)\n {\n 'tw:group-data-[argo=false]/modal:bg-warning-500': color === 'orange',\n 'tw:group-data-[argo=false]/modal:bg-blue-500': color === 'blue',\n 'tw:group-data-[argo=false]/modal:bg-green-500': color === 'green',\n 'tw:group-data-[argo=false]/modal:bg-error-500': color === 'red',\n 'tw:group-data-[argo=false]/modal:bg-neutral-150': color === 'gray',\n 'tw:group-data-[argo=false]/modal:bg-purple-100': color === 'violet',\n 'tw:group-data-[argo=false]/modal:text-white': color !== 'violet',\n 'tw:group-data-[argo=false]/modal:text-purple-500': color === 'violet',\n },\n\n // argo palette: soft tint + matching glyph colour\n {\n 'tw:group-data-[argo=true]/modal:bg-warning-100 tw:group-data-[argo=true]/modal:text-warning-500':\n color === 'orange',\n 'tw:group-data-[argo=true]/modal:bg-blue-100 tw:group-data-[argo=true]/modal:text-blue-600':\n color === 'blue',\n 'tw:group-data-[argo=true]/modal:bg-green-100 tw:group-data-[argo=true]/modal:text-green-900':\n color === 'green',\n 'tw:group-data-[argo=true]/modal:bg-error-100 tw:group-data-[argo=true]/modal:text-error-500':\n color === 'red',\n 'tw:group-data-[argo=true]/modal:bg-neutral-100 tw:group-data-[argo=true]/modal:text-neutral-500':\n color === 'gray',\n 'tw:group-data-[argo=true]/modal:bg-purple-100 tw:group-data-[argo=true]/modal:text-purple-500':\n color === 'violet',\n },\n\n // custom (non-named) colour: caller-provided fill + white glyph\n { 'tw:text-white': !!customColor },\n )}\n style={customColor ? { backgroundColor: customColor } : undefined}\n >\n {icon}\n </span>\n );\n};\n","import { useEffect, useState } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = {\n src: string;\n /** Accessible alt text. Defaults to `\"\"` (decorative) — provide it when the image carries meaning. */\n alt?: string;\n};\n\nexport const ModalImage = ({ src, alt = '' }: Props) => {\n const [hasImageError, setHasImageError] = useState(false);\n\n // Reset the error state when the source changes, so a reused badge (new logo, or a retry after a\n // transient failure) isn't permanently hidden by an earlier onError.\n useEffect(() => setHasImageError(false), [src]);\n\n if (hasImageError) return null;\n\n return (\n <span\n data-slot=\"modal-image\"\n className={cn(\n 'tw:shrink-0',\n 'tw:overflow-hidden',\n\n // legacy: circular badge floating at the top-left of the modal\n 'tw:group-data-[argo=false]/modal:absolute',\n 'tw:group-data-[argo=false]/modal:top-0',\n 'tw:group-data-[argo=false]/modal:left-8',\n 'tw:group-data-[argo=false]/modal:-translate-y-1/2',\n 'tw:group-data-[argo=false]/modal:size-12',\n 'tw:group-data-[argo=false]/modal:rounded-full',\n\n // argo: inline badge in the header grid's first column\n 'tw:group-data-[argo=true]/modal:flex',\n 'tw:group-data-[argo=true]/modal:col-start-1',\n 'tw:group-data-[argo=true]/modal:row-start-1',\n 'tw:group-data-[argo=true]/modal:self-start',\n 'tw:group-data-[argo=true]/modal:mr-3',\n 'tw:group-data-[argo=true]/modal:items-center',\n 'tw:group-data-[argo=true]/modal:justify-center',\n 'tw:group-data-[argo=true]/modal:rounded',\n 'tw:group-data-[argo=true]/modal:size-8',\n )}\n >\n <img\n src={src}\n alt={alt}\n className=\"tw:size-full tw:object-contain\"\n onError={() => setHasImageError(true)}\n />\n </span>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Close, Root, Trigger } from '@radix-ui/react-dialog';\n\nimport { ModalBody } from './ModalBody';\nimport { ModalContent } from './ModalContent';\nimport { ModalFooter } from './ModalFooter';\nimport { ModalHeader } from './ModalHeader';\nimport { ModalIcon } from './ModalIcon';\nimport { ModalImage } from './ModalImage';\nimport { ModalOverlay } from './ModalOverlay';\n\ntype Props = ComponentProps<typeof Root>;\n\n/**\n * Blocking dialog for confirmations, forms, and detail views. Built on Radix Dialog.\n *\n * **When to use:** the user must act before continuing (confirm a destructive action, fill a short form,\n * view a focused detail panel). Use the compound parts `Modal.Trigger`, `Modal.Content`, `Modal.Header`,\n * `Modal.Body`, `Modal.Footer`, and optionally `Modal.Icon` for a status-coloured header glyph.\n * **When NOT to use:** for slide-in side editing use `Sheet`; for an inline destructive confirmation anchored\n * to its trigger use `Popconfirm`; for hover previews use `HoverCard`.\n * **Composition:** wrap `Modal.Content` around `Modal.Header` + `Modal.Body` + `Modal.Footer`. Put `useAppForm`\n * `FormBody` inside `Modal.Body` and the submit / cancel buttons inside `Modal.Footer`.\n *\n * @see RECIPES.md#modal-form — for the canonical form-in-modal composition\n * @see RECIPES.md#confirm-dialog — for destructive-confirm dialogs\n */\nexport const Modal = (props: Props) => <Root {...props} />;\n\nModal.Close = Close;\nModal.Trigger = Trigger;\n\nModal.Content = ModalContent;\nModal.Body = ModalBody;\nModal.Icon = ModalIcon;\nModal.Image = ModalImage;\nModal.Footer = ModalFooter;\nModal.Header = ModalHeader;\nModal.Overlay = ModalOverlay;\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,aAAa,EAAE,WAAW,GAAG,YACxC,oBAAC,OAAD;CACE,aAAU;CACV,WAAW,GAET,aACA,sBAGA,iDAGA,yCACA,wCACA,WAGA,qDACA,uBACA,SACF;CACA,GAAI;AACL,CAAA;;;ACvBH,MAAa,gBAAgB,EAC3B,OAAO,UACP,WACA,UACA,iBACA,GAAG,YACQ;CACX,MAAM,aAAa,cAAc;CAEjC,MAAM,uBAA+C,UAAU;EAE7D,MAAM,gBAAgB;EACtB,kBAAkB,KAAK;CACzB;CAEA,OACE,oBAAC,QAAD,EAAA,UACE,oBAAC,c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,OACE,oBAAC,QAAD;EACE,aAAU;EACV,WAAW,GACT,eACA,sBAGA,6CACA,0CACA,2CACA,qDACA,4CACA,iDAGA,wCACA,+CACA,+CACA,8CACA,wCACA,gDACA,kDACA,2CACA,wCACF;EAEA,UAAA,oBAAC,OAAD;GACO;GACA;GACL,WAAU;GACV,eAAe,iBAAiB,IAAI;EACrC,CAAA;CACG,CAAA;AAEV;;;;;;;;;;;;;;;;;AC3BA,MAAa,SAAS,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;AAEzD,MAAM,QAAQ;AACd,MAAM,UAAU;AAEhB,MAAM,UAAU;AAChB,MAAM,OAAO;AACb,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTitle-C76ke2eo.js","names":[],"sources":["../src/components/Modal/ModalOverlay.tsx","../src/components/Modal/ModalDescription.tsx","../src/components/Modal/ModalTitle.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Overlay } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Overlay> & {\n disableTransition?: boolean;\n};\n\nexport const ModalOverlay = ({ ref, className, disableTransition = false, ...props }: Props) => (\n <Overlay\n {...props}\n ref={ref}\n className={cn(\n // positioning\n 'tw:fixed',\n 'tw:inset-0',\n 'tw:z-[1051]',\n\n // background\n 'tw:bg-black/50',\n\n // opening animation\n 'tw:data-[state=open]:duration-500',\n 'tw:data-[state=open]:fade-in-0',\n\n // closing animation\n 'tw:data-[state=closed]:duration-500',\n 'tw:data-[state=closed]:fade-out-0',\n {\n 'tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out': !disableTransition,\n },\n className,\n )}\n onClick={(event) => event.stopPropagation()}\n />\n);\n","import type { ComponentProps } from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof DialogPrimitive.Description>;\n\nexport const ModalDescription = ({ className, ...props }: Props) => (\n <DialogPrimitive.Description\n className={cn(\n 'tw:text-sm',\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-neutral-400',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Title } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Title>;\n\nexport const ModalTitle = ({ children, className, ...props }: Props) => (\n <Title\n {...props}\n className={cn('tw:flex-1', 'tw:break-anywhere', 'tw:text-base', 'tw:font-semibold', className)}\n >\n {children}\n </Title>\n);\n"],"mappings":";;;;;AASA,MAAa,gBAAgB,EAAE,KAAK,WAAW,oBAAoB,OAAO,GAAG,YAC3E,oBAAC,SAAD;CACE,GAAI;CACC;CACL,WAAW,GAET,YACA,cACA,eAGA,kBAGA,qCACA,kCAGA,uCACA,qCACA,EACE,sEAAsE,CAAC,kBACzE,GACA,SACF;CACA,UAAU,UAAU,MAAM,gBAAgB;AAC3C,CAAA;;;AC5BH,MAAa,oBAAoB,EAAE,WAAW,GAAG,YAC/C,oBAAC,gBAAgB,aAAjB;CACE,WAAW,GACT,cACA,gBACA,sBACA,kBACA,uBACA,SACF;CACA,GAAI;AACL,CAAA;;;ACXH,MAAa,cAAc,EAAE,UAAU,WAAW,GAAG,YACnD,oBAAC,OAAD;CACE,GAAI;CACJ,WAAW,GAAG,aAAa,qBAAqB,gBAAgB,oBAAoB,SAAS;CAE5F;AACI,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader-Q3IpCnQd.js","names":[],"sources":["../src/blocks/PageHeader/styles.ts","../src/blocks/PageHeader/PageHeaderDetail.tsx","../src/blocks/PageHeader/PageHeaderIndex.tsx","../src/blocks/PageHeader/PageHeader.tsx"],"sourcesContent":["export const titleRowClass = 'tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2';\nexport const titleClass =\n 'tw:m-0 tw:text-3xl tw:font-semibold tw:leading-9 tw:text-foreground tw:break-words';\nexport const titleCompactClass =\n 'tw:m-0 tw:text-xl tw:font-semibold tw:leading-7 tw:text-foreground tw:break-words';\n// Header badges always read as pills: force pill shape/case/tracking on any\n// Badge inside the slot via its `data-slot=\"badge\"` root (higher specificity\n// than the Badge's own variant classes, so it wins regardless of variant).\n// `tw:py-0` neutralises consumer-forced vertical padding (e.g. StatusLabel's\n// `tw:py-1.5`) so every header pill keeps the standard badge height.\nexport const badgesClass =\n 'tw:flex tw:flex-wrap tw:items-center tw:gap-2 tw:[&_[data-slot=badge]]:rounded-full tw:[&_[data-slot=badge]]:normal-case tw:[&_[data-slot=badge]]:tracking-normal tw:[&_[data-slot=badge]]:py-0';\nexport const descriptionClass =\n 'tw:m-0 tw:max-w-[800px] tw:break-words tw:text-sm tw:leading-5 tw:text-muted-foreground';\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\nimport {\n badgesClass,\n descriptionClass,\n titleClass,\n titleCompactClass,\n titleRowClass,\n} from './styles';\n\n// Detail page header — single entity pages (bucket, flow, data app, …).\n// Pattern: docs/patterns/page-header/detail/detail-page-header.md\n// - Breadcrumbs are required; overflow menu sits on the breadcrumbs row.\n// - Max two visible actions: `primaryAction` + optional `secondaryAction`.\n// - All other actions belong in the breadcrumbs-row overflow menu.\n/**\n * Props for `PageHeader.Detail`. Detail pages enforce mandatory breadcrumbs, ≤ 2 visible actions, and an\n * overflow-menu slot on the breadcrumbs row.\n */\ntype PageHeaderDetailProps = Omit<ComponentProps<'header'>, 'title'> & {\n /**\n * `Breadcrumb` chain to the entity's parent list / hierarchy. Required. Never repeat the\n * entity's own name as a final, non-link item — it's already the `title` below.\n */\n breadcrumbs: ReactNode;\n /** `DropdownMenu` for tertiary actions. Sits on the breadcrumbs row, not the title row. */\n overflowActions?: ReactNode;\n title: ReactNode;\n /** Optional icon rendered immediately left of the title (entity / component / type icon). */\n titleIcon?: ReactNode;\n /** Inline `Badge`s rendered next to the title (status, environment, version). Always rendered as pills. */\n badges?: ReactNode;\n description?: ReactNode;\n /** Compact title mode: renders a smaller title for information-dense pages. Default `false`. */\n compact?: boolean;\n /** Primary action (`Button`). Use the verb appropriate to the entity (Deploy / Run / Save). */\n primaryAction?: ReactNode;\n /** Optional second action (`Button variant=\"secondary\"`). Everything beyond goes in `overflowActions`. */\n secondaryAction?: ReactNode;\n /** Optional `Tabs` row below the title block. */\n headerNav?: ReactNode;\n /**\n * Opt into the responsive layout: the description spans its own full-width row below the title/actions row\n * instead of sharing the title column. Defaults to `false` (description sits inside the title column).\n * Enabled per the `sidebar-navigation` feature in kbc-ui; leaving it off keeps existing consumers\n * byte-identical.\n */\n fullWidthDescription?: boolean;\n};\n\n/**\n * Page header for single-entity pages.\n *\n * **When to use:** the page shows one entity (a bucket, flow, data app) with a parent hierarchy worth\n * breadcrumbing. Primary action is typically \"edit / deploy / run on this entity\".\n * **When NOT to use:** for top-level list pages use `PageHeader.Index`. For pages without a parent\n * hierarchy use `PageHeader.Index` even if they show one entity.\n * **Composition:** nest inside `PageLayout.Header`. Pass `Button`s for actions. Anything beyond the\n * 2-visible-actions cap belongs in `overflowActions` (a `DropdownMenu`), not in extra slots.\n *\n * @see RECIPES.md#list-detail — for the list-page → detail-page navigation pattern\n */\nexport const PageHeaderDetail = ({\n ref,\n className,\n breadcrumbs,\n overflowActions,\n title,\n titleIcon,\n badges,\n description,\n compact = false,\n primaryAction,\n secondaryAction,\n headerNav,\n fullWidthDescription = false,\n ...props\n}: PageHeaderDetailProps) => {\n const titleRow = (\n <div className={cn(titleRowClass, 'tw:min-w-64 tw:flex-1 tw:pr-2')}>\n {titleIcon && <span className=\"tw:flex tw:shrink-0 tw:items-center\">{titleIcon}</span>}\n <h1 className={compact ? titleCompactClass : titleClass}>{title}</h1>\n {badges && <div className={badgesClass}>{badges}</div>}\n </div>\n );\n const actions = (primaryAction || secondaryAction) && (\n <div className=\"tw:ml-auto tw:flex tw:flex-wrap tw:items-center tw:justify-end tw:gap-2\">\n {secondaryAction}\n {primaryAction}\n </div>\n );\n const descriptionNode = description && <p className={descriptionClass}>{description}</p>;\n return (\n <header\n ref={ref}\n className={cn('tw:flex tw:w-full tw:flex-col tw:gap-4', className)}\n {...props}\n >\n <div className=\"tw:flex tw:w-full tw:items-center tw:justify-between tw:gap-4\">\n <div className=\"tw:min-w-0 tw:flex-1\">{breadcrumbs}</div>\n {overflowActions && (\n <div className=\"tw:flex tw:shrink-0 tw:items-center tw:gap-2\">{overflowActions}</div>\n )}\n </div>\n\n {fullWidthDescription ? (\n <div className=\"tw:flex tw:w-full tw:flex-col tw:gap-2\">\n <div className=\"tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3\">\n {titleRow}\n {actions}\n </div>\n {descriptionNode}\n </div>\n ) : (\n <div className=\"tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3\">\n <div className=\"tw:flex tw:min-w-64 tw:flex-1 tw:flex-col tw:gap-2 tw:pr-2\">\n <div className={titleRowClass}>\n {titleIcon && (\n <span className=\"tw:flex tw:shrink-0 tw:items-center\">{titleIcon}</span>\n )}\n <h1 className={compact ? titleCompactClass : titleClass}>{title}</h1>\n {badges && <div className={badgesClass}>{badges}</div>}\n </div>\n {descriptionNode}\n </div>\n {actions}\n </div>\n )}\n\n {headerNav}\n </header>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { descriptionClass, titleClass, titleRowClass } from './styles';\n\n// Index page header — list / collection pages (Flows, Storage, Jobs, …).\n// Pattern: docs/patterns/page-header/index/index-page-header.md\n// - No breadcrumbs (top-level pages).\n// - `metadata` wins over `description` (mutually exclusive in pattern).\n// - At most one primary `action`; pair with the `documentation` icon button.\n/**\n * Props for `PageHeader.Index`. Index pages have no breadcrumbs and no overflow menu — search and filters\n * belong in `PageToolbar`, not here.\n */\ntype PageHeaderIndexProps = Omit<ComponentProps<'header'>, 'title'> & {\n title: ReactNode;\n /** Prose description shown below the title. Mutually exclusive with `metadata` in the pattern; `metadata` wins when both are passed. */\n description?: ReactNode;\n /** Count / system summary shown below the title (e.g. \"3 buckets and 39 tables\"). Wins over `description`. */\n metadata?: ReactNode;\n /** Icon-only docs button (`Button variant=\"invisible\" icon={<BookOpen />}`). Sits next to `action`. */\n documentation?: ReactNode;\n /** Primary \"create / add new X\" `Button`. */\n action?: ReactNode;\n /** Optional `Tabs` row rendered below the title block. Use only when >1 dataset / section is worth navigating to. */\n headerNav?: ReactNode;\n /**\n * Opt into the responsive layout: the description spans its own full-width row below the title, and the\n * action group wraps beneath the title (right-aligned) on narrow widths instead of shrinking. Defaults to\n * `false` (the description shares the title column and actions stay `shrink-0`). Enabled per the\n * `sidebar-navigation` feature in kbc-ui; leaving it off keeps existing consumers byte-identical.\n */\n fullWidthDescription?: boolean;\n};\n\n/**\n * Page header for top-level list / collection pages.\n *\n * **When to use:** the page is a list (Flows, Storage, Jobs, …) with no parent in the same section.\n * Primary action is typically \"create / add a new X\".\n * **When NOT to use:** for single-entity detail pages use `PageHeader.Detail`; for layouts that don't fit\n * either pattern host custom JSX in `PageLayout.Header` directly.\n * **Composition:** nest inside `PageLayout.Header`. Pass `Button`s into `action` and\n * `documentation`. Search and filter chips belong in `PageToolbar`, not here.\n */\nexport const PageHeaderIndex = ({\n ref,\n className,\n title,\n description,\n metadata,\n documentation,\n action,\n headerNav,\n fullWidthDescription = false,\n ...props\n}: PageHeaderIndexProps) => {\n const subtitle = metadata ?? description;\n const hasActions = Boolean(documentation || action);\n return (\n <header\n ref={ref}\n className={cn('tw:flex tw:w-full tw:flex-col tw:gap-4', className)}\n {...props}\n >\n {fullWidthDescription ? (\n <div className=\"tw:flex tw:w-full tw:flex-col tw:gap-2\">\n <div className=\"tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3\">\n <div className={cn(titleRowClass, 'tw:min-w-64 tw:flex-1 tw:pr-2')}>\n <h1 className={titleClass}>{title}</h1>\n </div>\n {hasActions && (\n <div className=\"tw:ml-auto tw:flex tw:flex-wrap tw:items-center tw:justify-end tw:gap-2\">\n {documentation}\n {action}\n </div>\n )}\n </div>\n {subtitle && <p className={descriptionClass}>{subtitle}</p>}\n </div>\n ) : (\n <div className=\"tw:flex tw:w-full tw:items-start tw:justify-between tw:gap-4\">\n <div className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-2 tw:pr-2\">\n <div className={titleRowClass}>\n <h1 className={titleClass}>{title}</h1>\n </div>\n {subtitle && <p className={descriptionClass}>{subtitle}</p>}\n </div>\n {hasActions && (\n <div className=\"tw:flex tw:shrink-0 tw:items-center tw:gap-2\">\n {documentation}\n {action}\n </div>\n )}\n </div>\n )}\n {headerNav}\n </header>\n );\n};\n","import { PageHeaderDetail } from './PageHeaderDetail';\nimport { PageHeaderIndex } from './PageHeaderIndex';\n\n/**\n * Structured page-header block that encodes the evviku page-header patterns 1:1 at the type level.\n *\n * **When to use:** every kbc-ui page with a structured header (title + actions + optional badges /\n * description / tabs). Choose `PageHeader.Index` for list / collection pages, `PageHeader.Detail` for\n * single-entity pages with breadcrumbs.\n * **When NOT to use:** for layouts that don't match either pattern, host custom JSX inside\n * `PageLayout.Header` directly. For routing-driven tab rows below the header use `PageLayout.Tabs`.\n * **Composition:** nest inside `PageLayout.Header`. Pass `@keboola/design` `Button`s into the header slots\n * (chrome is brand-driven). The variant types enforce pattern constraints (e.g. `Index` rejects breadcrumbs).\n *\n * @see RECIPES.md#page-header-tabs — for the canonical page-header + tabs composition\n */\nexport const PageHeader = {\n /** Index variant — top-level list / collection pages. No breadcrumbs; `metadata` wins over `description`. */\n Index: PageHeaderIndex,\n /** Detail variant — single-entity pages with required breadcrumbs and an overflow-actions slot. Max 2 visible actions. */\n Detail: PageHeaderDetail,\n};\n"],"mappings":";;;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;;;;;;;;;;;;;;;ACpFA,MAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;AACV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout-DSVM-ASz.js","names":[],"sources":["../src/blocks/SectionNav/constants.ts","../src/blocks/PageLayout/context.ts","../src/blocks/PageLayout/PageLayout.tsx"],"sourcesContent":["/**\n * Names the container query `SectionNav` reads to pick the tree over the dropdown.\n *\n * It has to sit on an **ancestor**: a container query matches descendants only, so the element that\n * names the container can never read it — and it cannot be `SectionNav`'s own wrapper either, whose\n * width is what the switch changes (256px in a row, full width in a column), which would oscillate.\n * `PageLayout.Content nav={…}` puts it on the right element for you.\n */\nexport const SECTION_NAV_CONTAINER = 'tw:@container/section-nav';\n","import { createContext, use } from 'react';\nimport type { RefObject } from 'react';\n\n/**\n * The `PageLayout` root element, so `PageLayout.Header` can publish its measured height as a CSS\n * custom property the whole page can read — `PageLayout.Content nav={…}` pins the nav to it.\n *\n * A slot rendered outside a `PageLayout` reads `null` and skips publishing rather than throwing:\n * `PageLayout.Footer` is already documented as usable on its own.\n */\nexport const PageLayoutRootContext = createContext<RefObject<HTMLDivElement | null> | null>(null);\n\nexport const usePageLayoutRoot = () => use(PageLayoutRootContext);\n","import { useEffect, useRef } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { cn, mergeRefs } from '../../utils';\nimport { SECTION_NAV_CONTAINER } from '../SectionNav/constants';\n\nimport { PageLayoutRootContext, usePageLayoutRoot } from './context';\n\n/**\n * Props for `PageLayout` root. `maxWidth` constrains the content column —\n * `narrow` (976px) for forms, `default` (1280px) for most pages, `wide` (1600px) for dense detail views,\n * `full` for edge-to-edge layouts.\n */\ntype RootProps = ComponentProps<'div'> & {\n maxWidth?: 'default' | 'narrow' | 'wide' | 'full';\n};\n\nconst maxWidthClass = {\n narrow: 'tw:max-w-[976px]',\n default: 'tw:max-w-[1280px]',\n wide: 'tw:max-w-[1600px]',\n full: 'tw:max-w-full',\n} as const;\n\nconst Root = ({ ref, className, maxWidth = 'full', children, ...props }: RootProps) => {\n const rootRef = useRef<HTMLDivElement>(null);\n\n return (\n <PageLayoutRootContext value={rootRef}>\n <div\n ref={mergeRefs(ref ?? null, rootRef)}\n className={cn(\n 'tw:flex tw:flex-col tw:gap-4 tw:w-full tw:mx-auto',\n maxWidthClass[maxWidth],\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </PageLayoutRootContext>\n );\n};\n\nconst Breadcrumbs = ({ ref, className, children, ...props }: ComponentProps<'div'>) => (\n <div ref={ref} className={cn('tw:w-full', className)} {...props}>\n {children}\n </div>\n);\n\nconst STICKY_CHROME_BLEED =\n 'tw:before:absolute tw:before:inset-x-[-0.5rem] tw:before:inset-y-0 tw:before:-z-10 tw:before:bg-background';\n\ntype HeaderProps = ComponentProps<'header'> & {\n sticky?: boolean;\n};\n\nconst Header = ({ ref, className, sticky = false, children, ...props }: HeaderProps) => {\n const rootRef = usePageLayoutRoot();\n const headerRef = useRef<HTMLElement>(null);\n\n useEffect(() => {\n const header = headerRef.current;\n const root = rootRef?.current;\n\n if (!sticky || !header || !root || typeof ResizeObserver === 'undefined') return;\n\n const publish = () => {\n root.style.setProperty(\n '--page-header-height',\n `${Math.round(header.getBoundingClientRect().height)}px`,\n );\n };\n\n const observer = new ResizeObserver(publish);\n\n observer.observe(header);\n publish();\n\n return () => {\n observer.disconnect();\n root.style.removeProperty('--page-header-height');\n };\n }, [sticky, rootRef]);\n\n return (\n <header\n ref={mergeRefs(ref ?? null, headerRef)}\n className={cn(\n 'tw:w-full',\n sticky && ['tw:sticky tw:top-0 tw:z-20 tw:bg-background', STICKY_CHROME_BLEED],\n className,\n )}\n {...props}\n >\n {children}\n {sticky && (\n <div\n aria-hidden\n className=\"tw:pointer-events-none tw:absolute tw:inset-x-0 tw:top-full tw:h-6 tw:bg-linear-to-b tw:from-background tw:to-[rgb(var(--background)/0)]\"\n />\n )}\n </header>\n );\n};\n\nconst Tabs = ({ ref, className, children, ...props }: ComponentProps<'div'>) => (\n <div\n ref={ref}\n className={cn('tw:flex tw:w-full tw:items-center tw:border-b tw:border-border', className)}\n {...props}\n >\n {children}\n </div>\n);\n\ntype ContentProps = ComponentProps<'div'> & {\n nav?: ReactNode;\n};\n\nconst scrollParent = (from: HTMLElement): HTMLElement | null => {\n for (let el = from.parentElement; el; el = el.parentElement) {\n if (/auto|scroll/.test(getComputedStyle(el).overflowY)) return el;\n }\n\n return null;\n};\n\nconst useAvailableHeight = () => {\n const rowRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const row = rowRef.current;\n\n if (!row || typeof ResizeObserver === 'undefined') return;\n\n const scroller = scrollParent(row);\n\n const publish = () => {\n const top = row.getBoundingClientRect().top + (scroller?.scrollTop ?? window.scrollY);\n const room = scroller\n ? scroller.clientHeight - (top - scroller.getBoundingClientRect().top)\n : window.innerHeight - top;\n\n row.style.setProperty('--section-nav-available', `${Math.max(0, Math.round(room))}px`);\n };\n\n const observer = new ResizeObserver(publish);\n\n observer.observe(row);\n if (scroller) observer.observe(scroller);\n publish();\n\n return () => observer.disconnect();\n }, []);\n\n return rowRef;\n};\n\nconst Content = ({ ref, className, nav, children, ...props }: ContentProps) => {\n const rowRef = useAvailableHeight();\n\n if (!nav) {\n return (\n <div\n ref={ref}\n className={cn('tw:flex tw:w-full tw:flex-1 tw:flex-col', className)}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'tw:group/page-layout-content tw:flex tw:w-full tw:flex-1 tw:flex-col',\n SECTION_NAV_CONTAINER,\n className,\n )}\n {...props}\n >\n <div\n ref={rowRef}\n className=\"tw:flex tw:w-full tw:@[640px]/section-nav:flex-row tw:@[640px]/section-nav:gap-8 tw:@max-[640px]/section-nav:flex-col tw:@max-[640px]/section-nav:gap-4\"\n >\n <div\n data-slot=\"page-layout-nav\"\n className=\"tw:sticky tw:top-[calc(var(--page-header-height,0px)+1rem)] tw:z-10 tw:shrink-0 tw:self-start tw:@[640px]/section-nav:max-h-[var(--section-nav-available,100dvh)] tw:@[640px]/section-nav:w-64 tw:@[640px]/section-nav:overflow-y-auto tw:@[640px]/section-nav:supports-[animation-timeline:scroll()]:scroll-fade-y tw:@max-[640px]/section-nav:w-full tw:@max-[640px]/section-nav:bg-background tw:@max-[640px]/section-nav:before:absolute tw:@max-[640px]/section-nav:before:inset-x-[-0.5rem] tw:@max-[640px]/section-nav:before:top-[-1rem] tw:@max-[640px]/section-nav:before:bottom-0 tw:@max-[640px]/section-nav:before:-z-10 tw:@max-[640px]/section-nav:before:bg-background tw:@max-[640px]/section-nav:after:pointer-events-none tw:@max-[640px]/section-nav:after:absolute tw:@max-[640px]/section-nav:after:inset-x-0 tw:@max-[640px]/section-nav:after:top-full tw:@max-[640px]/section-nav:after:h-6 tw:@max-[640px]/section-nav:after:bg-linear-to-b tw:@max-[640px]/section-nav:after:from-background tw:@max-[640px]/section-nav:after:to-[rgb(var(--background)/0)]\"\n >\n {nav}\n </div>\n <div\n data-slot=\"page-layout-content-body\"\n className=\"tw:[--page-content-sticky-top:var(--page-header-height,0px)] tw:min-w-0 tw:flex-1\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n};\n\ntype FooterProps = ComponentProps<'footer'> & {\n sticky?: boolean;\n};\n\nconst Footer = ({ ref, className, sticky = false, children, ...props }: FooterProps) => (\n <footer\n ref={ref}\n className={cn(\n 'tw:flex tw:w-full tw:items-center tw:justify-end tw:gap-3 tw:border-t tw:border-border tw:bg-background tw:px-6 tw:py-4',\n sticky && ['tw:sticky tw:bottom-0 tw:z-10', STICKY_CHROME_BLEED],\n className,\n )}\n {...props}\n >\n {children}\n </footer>\n);\n\n/**\n * Compound page-chrome block. Provides every kbc-ui page with the same content-column shape:\n * max-width container + vertical rhythm + named slots. The gutter between content and the app\n * frame (sidebar / navbar) is owned by the shell, not by `PageLayout` — so the `Root` adds no\n * outer page padding of its own (`PageLayout.Footer` keeps its own action-bar padding).\n *\n * **When to use:** every new kbc-ui page. Do not roll your own `<div className=\"tw:flex tw:flex-col\">`\n * chrome. Host `PageHeader.Index` / `PageHeader.Detail` inside `PageLayout.Header` for the structured\n * page-header patterns.\n * **When NOT to use:** the left-rail `Sidebar` lives in the app shell outside `PageLayout`. For embedded\n * widgets or modal bodies the layout chrome is the modal / card itself, not `PageLayout`.\n * **Composition:** `PageLayout` is opinionated about chrome only — slots accept any `ReactNode`. Put\n * search / filter pills in `PageToolbar`, never in the header. Form submit bars go in\n * `PageLayout.Footer sticky`.\n *\n * @see RECIPES.md#list-detail — for the index → detail page pattern\n * @see RECIPES.md#section-nav — for the in-page vertical navigation pattern\n */\nexport const PageLayout = Object.assign(Root, {\n /** Detail-pattern breadcrumb row. Usually composed automatically by `PageHeader.Detail` — slot exists for layouts that don't fit either `PageHeader` variant. */\n Breadcrumbs,\n /** Host slot for `PageHeader.Index` / `PageHeader.Detail`, or custom header JSX when neither variant fits. Pass `sticky` to pin it — it then also publishes its measured height as `--page-header-height` on the root, which `Content nav` pins the nav to. */\n Header,\n /** Escape hatch for routing-based tab rows. Use `Tabs` / `TabsContent` core components inside, never a raw `<button>`. */\n Tabs,\n /** Main content slot. Lists, cards, tables. Pass `nav` (a `SectionNav`) for the two-column in-page-navigation layout; without it the slot is a plain column, exactly as before. */\n Content,\n /** Bottom action bar — form submit + cancel. Pass `sticky` for a footer that pins to the viewport. */\n Footer,\n});\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAa,wBAAwB;;;;;;;;;;ACErC,MAAa,wBAAwB,cAAuD,IAAI;AAEhG,MAAa,0BAA0B,IAAI,qBAAqB;;;ACKhE,MAAM,gBAAgB;CACpB,QAAQ;CACR,SAAS;CACT,MAAM;CACN,MAAM;AACR;AAEA,MAAM,QAAQ,EAAE,KAAK,WAAW,WAAW,QAAQ,UAAU,GAAG,YAAuB;CACrF,MAAM,UAAU,OAAuB,IAAI;CAE3C,OACE,oBAAC,uBAAD;EAAuB,OAAO;EAC5B,UAAA,oBAAC,OAAD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,EAAE,KAAK,WAAW,SAAS,OAAO,UAAU,GAAG,YAC7D,oBAAC,UAAD;CACO;CACL,WAAW,GACT,2HACA,UAAU,CAAC,iCAAiC,mBAAmB,GAC/D,SACF;CACA,GAAI;CAEH;AACK,CAAA;;;;;;;;;;;;;;;;;;;AAqBV,MAAa,aAAa,OAAO,OAAO,MAAM;;CAE5C;;CAEA;;CAEA;;CAEA;;CAEA;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PageToolbar-BKVJiDAL.js","names":[],"sources":["../src/blocks/PageToolbar/PageToolbarToken.tsx","../src/blocks/PageToolbar/PageToolbar.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport { Badge } from '../../components/Badge';\nimport { Button } from '../../components/Button';\nimport { Popover } from '../../components/Popover';\nimport { ChevronDown, X } from '../../icons';\n\ntype PageToolbarTokenProps = Omit<\n ComponentPropsWithoutRef<typeof Badge>,\n 'variant' | 'color' | 'suffix' | 'children' | 'asChild' | 'popover'\n> & {\n children: ReactNode;\n /** Popover content rendered when the chevron-down trigger is clicked — typically a value editor. */\n popover: ReactNode;\n onRemove: () => void;\n removeAriaLabel: string;\n};\n\n/**\n * Editable filter token (Query Builder variant) — `Badge` pill with a `chevron-down`\n * popover trigger for editing values and an `×` dismiss button. The popover content\n * is supplied by the caller via the `popover` slot (typically a `Combobox` or option list).\n */\nexport const PageToolbarToken = ({\n children,\n popover,\n onRemove,\n removeAriaLabel,\n ...props\n}: PageToolbarTokenProps) => (\n <Popover>\n <Badge\n {...props}\n asChild\n variant=\"pill\"\n color=\"blue-inverse\"\n suffix={\n <Button\n type=\"button\"\n variant=\"inline\"\n size=\"icon-2xs\"\n aria-label={removeAriaLabel}\n onClick={onRemove}\n >\n <X className=\"tw:size-3\" />\n </Button>\n }\n >\n <Popover.Trigger\n type=\"button\"\n className=\"tw:inline-flex tw:cursor-pointer tw:items-center tw:gap-1 tw:bg-inherit tw:text-inherit tailwindcss-preflight\"\n >\n {children}\n <ChevronDown className=\"tw:size-3\" />\n </Popover.Trigger>\n </Badge>\n <Popover.Content align=\"start\">{popover}</Popover.Content>\n </Popover>\n);\n","import type { ComponentProps, ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport { Badge } from '../../components/Badge';\nimport { Button } from '../../components/Button';\nimport { Plus, X } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { PageToolbarToken } from './PageToolbarToken';\n\ntype DivProps = ComponentProps<'div'>;\n\nconst Root = ({ ref, className, children, ...props }: DivProps) => (\n <div\n ref={ref}\n className={cn('tw:flex tw:flex-wrap tw:items-center tw:gap-3 tw:w-full', className)}\n {...props}\n >\n {children}\n </div>\n);\n\nconst Search = ({ ref, className, children, ...props }: DivProps) => (\n <div\n ref={ref}\n className={cn(\n 'tw:mr-auto tw:flex tw:items-center tw:gap-2 tw:w-full tw:sm:w-auto tw:sm:min-w-64 tw:sm:max-w-md',\n // The slot sizes itself between `min-w-64` and `max-w-md`, so the search field has to fill it —\n // without this the input stays content-width (≈224px inside a 448px slot) and truncates its own\n // placeholder, and every caller ends up hand-picking a width class to compensate.\n //\n // - First child only. The documented composition is the search field followed by filter pills;\n // stretching every child would size the pills to match the input.\n // - `min-w-0` so a long value shrinks the input rather than overflowing the toolbar.\n 'tw:*:first:min-w-0 tw:*:first:flex-1',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nconst Right = ({ ref, className, children, ...props }: DivProps) => (\n <div\n ref={ref}\n className={cn('tw:flex tw:flex-wrap tw:items-center tw:gap-2', className)}\n {...props}\n >\n {children}\n </div>\n);\n\nconst ControlGroup = ({ ref, className, children, ...props }: DivProps) => (\n <div ref={ref} className={cn('tw:flex tw:items-center tw:gap-2', className)} {...props}>\n {children}\n </div>\n);\n\nconst ActiveFilters = ({ ref, className, children, ...props }: DivProps) => (\n <div\n ref={ref}\n className={cn('tw:flex tw:flex-wrap tw:items-center tw:gap-2 tw:basis-full', className)}\n {...props}\n >\n {children}\n </div>\n);\n\ntype ChipProps = Omit<\n ComponentPropsWithoutRef<typeof Badge>,\n 'variant' | 'color' | 'suffix' | 'children'\n> & {\n children: ReactNode;\n onRemove: () => void;\n removeAriaLabel: string;\n};\n\nconst Chip = ({ children, onRemove, removeAriaLabel, ...props }: ChipProps) => (\n <Badge\n {...props}\n variant=\"pill\"\n color=\"blue-inverse\"\n suffix={\n <Button\n type=\"button\"\n variant=\"inline\"\n size=\"icon-2xs\"\n aria-label={removeAriaLabel}\n onClick={onRemove}\n >\n <X className=\"tw:size-3\" />\n </Button>\n }\n >\n {children}\n </Badge>\n);\n\ntype ActionProps = ComponentPropsWithoutRef<typeof Button>;\n\nconst AddFilter = ({ className, children, ...props }: ActionProps) => (\n <Button variant=\"invisible\" size=\"small\" className={cn('tw:gap-1.5', className)} {...props}>\n <Plus className=\"tw:size-4\" />\n {children ?? 'Add filter'}\n </Button>\n);\n\nconst Clear = ({ className, children, ...props }: ActionProps) => (\n <Button variant=\"invisible\" size=\"small\" className={cn('tw:ml-auto', className)} {...props}>\n {children ?? 'Clear all'}\n </Button>\n);\n\n/**\n * Two-row toolbar for index pages — search on the left, filter / sort / utility / view\n * controls on the right, an optional Active Filters row below for filter chips or tokens.\n *\n * **When to use:** every index page that supports search or filtering. Hosts inside\n * `PageLayout` as the search / filter row, between `PageLayout.Header` and `PageLayout.Content`.\n * **When NOT to use:** detail pages, form pages, or anywhere there is no search / filter\n * surface. For routing-based tab rows reach for `PageLayout.Tabs`.\n *\n * **Recommended composition (enforced at the call site):**\n *\n * - `Search` sits on the left; the right cluster auto-aligns via flex.\n * - Right cluster order: `Filters` → `Sort` → `Actions` → `View`. View controls are always\n * the final control group — do not render any control after `View`.\n * - `ActiveFilters` is the second row. Render it only when one or more filters are active.\n * - `Clear` self-aligns to the far right of `ActiveFilters`.\n *\n * The block is variant-agnostic: render filter chips (Standard variant, non-editable) or\n * tokens (Query Builder variant, editable) into `ActiveFilters` as plain children — do not\n * mix the two in one toolbar.\n *\n * @see https://github.com/evviku/design-system-docs/blob/main/docs/patterns/toolbar/toolbar.md\n */\nexport const PageToolbar = Object.assign(Root, {\n /** Left slot — typically a `SearchInput`. */\n Search,\n /** Right cluster — host the four control groups below in the recommended order. */\n Right,\n /** Filter controls (`Combobox`, `Select`, `DatePicker`). */\n Filters: ControlGroup,\n /** Sort control. */\n Sort: ControlGroup,\n /** Utility actions (Export, Refresh, …). */\n Actions: ControlGroup,\n /** View toggle (List / Grid). Always render last in the right cluster. */\n View: ControlGroup,\n /**\n * Active filters row. Render only when one or more filters are active. Pass filter chips\n * (Standard variant) or tokens (Query Builder variant) as children, optionally followed\n * by `AddFilter` / `Clear`.\n */\n ActiveFilters,\n /** Non-editable filter chip (Standard variant) — `Badge` pill with a dismiss button. */\n Chip,\n /**\n * Editable filter token (Query Builder variant) — `Badge` pill with a `chevron-down`\n * popover trigger for editing values and an `×` dismiss button. The popover content\n * is supplied by the caller via the `popover` slot (typically a `Combobox` or option list).\n */\n Token: PageToolbarToken,\n /** \"+ Add filter\" action — typically rendered after the chips/tokens in `ActiveFilters`. */\n AddFilter,\n /** \"Clear all\" action — self-aligns to the far right of `ActiveFilters`. */\n Clear,\n});\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAa,oBAAoB,EAC/B,UACA,SACA,UACA,iBACA,GAAG,YAEH,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,OAAD;CACE,GAAI;CACJ,SAAA;CACA,SAAQ;CACR,OAAM;CACN,QACE,oBAAC,QAAD;EACE,MAAK;EACL,SAAQ;EACR,MAAK;EACL,cAAY;EACZ,SAAS;EAET,UAAA,oBAAC,GAAD,EAAG,WAAU,YAAa,CAAA;CACpB,CAAA;CAGV,UAAA,qBAAC,QAAQ,SAAT;EACE,MAAK;EACL,WAAU;EAFZ,UAAA,CAIG,UACD,oBAAC,aAAD,EAAa,WAAU,YAAa,CAAA,CACrB;;AACZ,CAAA,GACP,oBAAC,QAAQ,SAAT;CAAiB,OAAM;CAAS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C,oBAAC,QAAD;CAAQ,SAAQ;CAAY,MAAK;CAAQ,WAAW,GAAG,cAAc,SAAS;CAAG,GAAI;CAClF,UAAA,YAAY;AACP,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AA0BV,MAAa,cAAc,OAAO,OAAO,MAAM;;CAE7C;;CAEA;;CAEA,SAAS;;CAET,MAAM;;CAEN,SAAS;;CAET,MAAM;;;;;;CAMN;;CAEA;;;;;;CAMA,OAAO;;CAEP;;CAEA;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popover-BEbQrC_P.js","names":[],"sources":["../src/components/Popover/PopoverContent.tsx","../src/components/Popover/Popover.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-popover';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nconst variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group/popover-content',\n 'tw:z-[1055]',\n 'tw:focus-visible:outline-hidden',\n\n // An open Radix Dialog locks `pointer-events: none` on <body>. Popover content\n // is portalled to <body> as a sibling of the dialog, so it inherits the lock\n // and clicks fall through — re-enable pointer events on the content itself\n // (dismiss-on-outside-click still works, it listens on document).\n 'tw:pointer-events-auto',\n\n // sizing\n 'tw:min-w-32',\n 'tw:max-h-[var(--radix-popover-content-available-height)]',\n 'tw:origin-(--radix-popover-content-transform-origin)',\n\n // layout\n 'tw:flex',\n 'tw:flex-col',\n 'tw:overflow-y-auto',\n\n // border\n 'tw:box-border',\n 'tw:border',\n 'tw:border-solid',\n 'tw:border-border',\n 'tw:shadow-lg',\n\n // surface — semantic tokens, so a portalled panel follows the brand and the scheme\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n\n // open animation\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:zoom-in-95',\n\n // closed animation\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:zoom-out-95',\n\n // position animation\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n\n // Default size for nested Lucide icons; callers can override on the icon.\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n ],\n {\n defaultVariants: {\n matchTriggerWidth: false,\n variant: 'default',\n },\n variants: {\n // Radius is the only thing the surface variants differ in — the panel's colours\n // live in the base array.\n variant: {\n default: ['tw:rounded-md'],\n argo: ['tw:rounded-2xl'],\n },\n matchTriggerWidth: {\n true: ['tw:w-[var(--radix-popover-trigger-width)]'],\n false: [],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof Content> &\n Omit<VariantProps<typeof variants>, 'variant'> & {\n /**\n * Where the popover portals to. Defaults to `document.body`; a host that\n * scopes its own theme passes the element that carries it, so the panel is\n * styled by the scope it belongs to rather than the page behind it.\n */\n container?: ComponentProps<typeof Portal>['container'];\n };\n\nexport const PopoverContent = ({\n ref,\n className,\n align = 'center',\n sideOffset = 4,\n matchTriggerWidth = false,\n children,\n onEscapeKeyDown,\n container,\n ...props\n}: Props) => {\n const effectiveVariant: NonNullable<VariantProps<typeof variants>['variant']> = useArgoDesign()\n ? 'argo'\n : 'default';\n return (\n <Portal container={container}>\n <Content\n ref={ref}\n align={matchTriggerWidth ? 'start' : align}\n sideOffset={sideOffset}\n className={cn(variants({ className, matchTriggerWidth, variant: effectiveVariant }))}\n onEscapeKeyDown={(event) => {\n // Stop propagation to prevent parent modals (like FullScreenModal) from closing\n event.stopPropagation();\n onEscapeKeyDown?.(event);\n }}\n {...props}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Close, Root, Trigger } from '@radix-ui/react-popover';\n\nimport { PopoverContent } from './PopoverContent';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Popover = (props: Props) => <Root {...props} />;\n\n/**\n * Main Layout\n */\nPopover.Content = PopoverContent;\nPopover.Trigger = Trigger;\nPopover.Close = Close;\n"],"mappings":";;;;;;AAQA,MAAM,WAAW,IACf;CACE;CACA;CACA;CACA;CAMA;CAGA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB;EACf,mBAAmB;EACnB,SAAS;CACX;CACA,UAAU;EAGR,SAAS;GACP,SAAS,CAAC,eAAe;GACzB,MAAM,CAAC,gBAAgB;EACzB;EACA,mBAAmB;GACjB,MAAM,CAAC,2CAA2C;GAClD,OAAO,CAAC;EACV;CACF;AACF,CACF;AAYA,MAAa,kBAAkB,EAC7B,KACA,WACA,QAAQ,UACR,aAAa,GACb,oBAAoB,OACpB,UACA,iBACA,WACA,GAAG,YACQ;CACX,MAAM,mBAA0E,cAAc,IAC1F,SACA;CACJ,OACE,oBAAC,QAAD;EAAmB;EACjB,UAAA,oBAAC,SAAD;GACO;GACL,OAAO,oBAAoB,UAAU;GACzB;GACZ,WAAW,GAAG,SAAS;IAAE;IAAW;IAAmB,SAAS;GAAiB,CAAC,CAAC;GACnF,kBAAkB,UAAU;IAE1B,MAAM,gBAAgB;IACtB,kBAAkB,KAAK;GACzB;GACA,GAAI;GAEH;EACM,CAAA;CACH,CAAA;AAEZ;;;ACrHA,MAAa,WAAW,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;;;;AAK3D,QAAQ,UAAU;AAClB,QAAQ,UAAU;AAClB,QAAQ,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput-Q85p8Ews.js","names":[],"sources":["../src/blocks/SearchInput/SearchInput.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport type { ChangeEventHandler, ComponentProps, FocusEventHandler } from 'react';\n\nimport { InputGroup } from '../../components/InputGroup';\nimport { Search, X } from '../../icons';\nimport { debounce } from '../../utils';\n\ntype InputGroupProps = Pick<\n ComponentProps<typeof InputGroup>,\n 'variant' | 'focusVariant' | 'state' | 'sizing'\n>;\n\ntype InputGroupInputProps = Omit<ComponentProps<typeof InputGroup.Input>, 'value' | 'defaultValue'>;\n\n/**\n * Props for `SearchInput`. `onValueChange` is debounced by default (300ms) so callers can wire it directly\n * to expensive filter / fetch operations without `useMemo` plumbing. `value={null}` / `value={undefined}`\n * is treated as \"not provided\" — the component falls back to `defaultValue` (or, if absent, internal\n * state initialized to empty). `value={\"\"}` is controlled-empty.\n */\ntype Props = InputGroupProps &\n InputGroupInputProps & {\n value?: string | null;\n defaultValue?: string | null;\n /** Called with the latest string value after the debounce window (default 300ms). Fires synchronously on clear and when `disableDebounce` is set. For sync echo of every keystroke use `onChange`. */\n onValueChange?: (value: string) => void;\n /** Called with the string value on blur. */\n onValueBlur?: (value: string) => void;\n /** Called when the user clicks the clear button. Receives no arguments — the value is reset to \"\". */\n onClear?: () => void;\n /** Render the trailing clear (x) button when there's a non-empty value. */\n allowClear?: boolean;\n /** Bypass the debounce — `onValueChange` fires synchronously on every keystroke. */\n disableDebounce?: boolean;\n /** Debounce window in ms. Default 300. Ignored when `disableDebounce` is set. */\n debounceDelay?: number;\n };\n\n/**\n * Debounced search input with a leading magnifying-glass icon and optional clear button.\n *\n * **When to use:** the search field inside `PageToolbar.Search`, list / table search, combobox-less\n * free-text filters. `onValueChange` is debounced so callers can wire it directly to fetches without\n * `useMemo` plumbing.\n * **When NOT to use:** for a plain string input use `TextInput`; for selecting from a known enumerated\n * list use `Combobox` (which has its own search built in).\n * **Composition:** typically rendered in `PageToolbar.Search` next to `MultiCombobox` filter pills. Use\n * `allowClear` for the canonical x-to-reset affordance.\n *\n * @see RECIPES.md#filter-toolbar — for the search + filter chips toolbar pattern\n */\nexport const SearchInput = ({\n ref,\n\n // group props\n state,\n variant,\n focusVariant,\n sizing,\n className,\n\n // own props\n value: valueProp,\n defaultValue,\n onValueChange,\n onValueBlur,\n onChange,\n onBlur,\n onClear,\n allowClear = false,\n disableDebounce = false,\n debounceDelay = 300,\n\n // input props\n disabled,\n readOnly,\n ...restInputProps\n}: Props) => {\n const [internalValue, setInternalValue] = useState<string>(\n valueProp != null ? valueProp : (defaultValue ?? ''),\n );\n\n // Tracks whether a debounced call is pending so the controlled-value sync\n // effect doesn't overwrite characters the user typed during the debounce window.\n const debounceInFlightRef = useRef(false);\n const cancelRef = useRef<() => void>(() => {});\n\n const debouncedOnValueChange = useMemo(() => {\n if (!onValueChange || disableDebounce) {\n cancelRef.current = () => {};\n return onValueChange;\n }\n const d = debounce((val: string) => {\n debounceInFlightRef.current = false;\n onValueChange(val);\n }, debounceDelay);\n cancelRef.current = d.cancel;\n return d;\n }, [onValueChange, disableDebounce, debounceDelay]);\n\n // Cancel any pending debounced call when the debounced fn changes or on unmount.\n useEffect(() => {\n return () => cancelRef.current();\n }, [debouncedOnValueChange]);\n\n // Sync controlled value — but skip while a debounced call is in flight to\n // avoid snapping the input back to the old value mid-typing.\n useEffect(() => {\n if (valueProp == null) return;\n if (debounceInFlightRef.current) return;\n setInternalValue(valueProp);\n }, [valueProp]);\n\n const canClear = allowClear && !!internalValue && !disabled && !readOnly;\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n const val = event.target.value;\n setInternalValue(val);\n if (!disableDebounce && debouncedOnValueChange) debounceInFlightRef.current = true;\n debouncedOnValueChange?.(val);\n onChange?.(event);\n };\n\n const handleBlur: FocusEventHandler<HTMLInputElement> = (event) => {\n onValueBlur?.(event.target.value);\n onBlur?.(event);\n };\n\n const handleClear = () => {\n cancelRef.current();\n debounceInFlightRef.current = false;\n setInternalValue('');\n onValueChange?.('');\n onClear?.();\n };\n\n return (\n <InputGroup\n state={state}\n variant={variant}\n sizing={sizing}\n focusVariant={focusVariant}\n className={className}\n >\n <InputGroup.Addon align=\"inline-start\">\n <Search className=\"tw:size-4 tw:shrink-0 tw:text-muted-foreground\" />\n </InputGroup.Addon>\n\n <InputGroup.Input\n {...restInputProps}\n ref={ref}\n value={internalValue}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n readOnly={readOnly}\n />\n\n {canClear && (\n <InputGroup.Addon align=\"inline-end\">\n <InputGroup.Button\n aria-label=\"Clear search\"\n onMouseDown={(event) => event.preventDefault()}\n onClick={handleClear}\n >\n <X className=\"tw:size-4\" />\n </InputGroup.Button>\n </InputGroup.Addon>\n )}\n </InputGroup>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmDA,MAAa,eAAe,EAC1B,KAGA,OACA,SACA,cACA,QACA,WAGA,OAAO,WACP,cACA,eACA,aACA,UACA,QACA,SACA,aAAa,OACb,kBAAkB,OAClB,gBAAgB,KAGhB,UACA,UACA,GAAG,qBACQ;CACX,MAAM,CAAC,eAAe,oBAAoB,SACxC,aAAa,OAAO,YAAa,gBAAgB,EACnD;CAIA,MAAM,sBAAsB,OAAO,KAAK;CACxC,MAAM,YAAY,aAAyB,CAAC,CAAC;CAE7C,MAAM,yBAAyB,cAAc;EAC3C,IAAI,CAAC,iBAAiB,iBAAiB;GACrC,UAAU,gBAAgB,CAAC;GAC3B,OAAO;EACT;EACA,MAAM,IAAI,UAAU,QAAgB;GAClC,oBAAoB,UAAU;GAC9B,cAAc,GAAG;EACnB,GAAG,aAAa;EAChB,UAAU,UAAU,EAAE;EACtB,OAAO;CACT,GAAG;EAAC;EAAe;EAAiB;CAAa,CAAC;CAGlD,gBAAgB;EACd,aAAa,UAAU,QAAQ;CACjC,GAAG,CAAC,sBAAsB,CAAC;CAI3B,gBAAgB;EACd,IAAI,aAAa,MAAM;EACvB,IAAI,oBAAoB,SAAS;EACjC,iBAAiB,SAAS;CAC5B,GAAG,CAAC,SAAS,CAAC;CAEd,MAAM,WAAW,cAAc,CAAC,CAAC,iBAAiB,CAAC,YAAY,CAAC;CAEhE,MAAM,gBAAsD,UAAU;EACpE,MAAM,MAAM,MAAM,OAAO;EACzB,iBAAiB,GAAG;EACpB,IAAI,CAAC,mBAAmB,wBAAwB,oBAAoB,UAAU;EAC9E,yBAAyB,GAAG;EAC5B,WAAW,KAAK;CAClB;CAEA,MAAM,cAAmD,UAAU;EACjE,cAAc,MAAM,OAAO,KAAK;EAChC,SAAS,KAAK;CAChB;CAEA,MAAM,oBAAoB;EACxB,UAAU,QAAQ;EAClB,oBAAoB,UAAU;EAC9B,iBAAiB,EAAE;EACnB,gBAAgB,EAAE;EAClB,UAAU;CACZ;CAEA,OACE,qBAAC,YAAD;EACS;EACE;EACD;EACM;EACH;EALb,UAAA;GAOE,oBAAC,WAAW,OAAZ;IAAkB,OAAM;IACtB,UAAA,oBAAC,QAAD,EAAQ,WAAU,iDAAkD,CAAA;GACpD,CAAA;GAElB,oBAAC,WAAW,OAAZ;IACE,GAAI;IACC;IACL,OAAO;IACP,UAAU;IACV,QAAQ;IACE;IACA;GACX,CAAA;GAEA,YACC,oBAAC,WAAW,OAAZ;IAAkB,OAAM;IACtB,UAAA,oBAAC,WAAW,QAAZ;KACE,cAAW;KACX,cAAc,UAAU,MAAM,eAAe;KAC7C,SAAS;KAET,UAAA,oBAAC,GAAD,EAAG,WAAU,YAAa,CAAA;IACT,CAAA;GACH,CAAA;EAEV;;AAEhB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SectionNav-mpmSM3OC.js","names":[],"sources":["../src/blocks/SectionNav/SectionNavItemContent.tsx","../src/blocks/SectionNav/SectionNavGroupRow.tsx","../src/blocks/SectionNav/SectionNav.tsx"],"sourcesContent":["import { Badge } from '../../components/Badge';\nimport { ChevronDown } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { SectionNavItem } from './types';\n\ntype Props = {\n item: SectionNavItem;\n /** Tints the title. */\n active: boolean;\n showDescription?: boolean;\n /** Group rows only — renders the chevron, pointing the way the list is about to move. */\n expanded?: boolean;\n /**\n * Sub-section rows pass `false`. A group's icon stands for the group, and repeating a glyph on\n * each indented child turns a short list into a column of competing marks: the indent and the\n * rule already say these belong to the row above. An item may still carry an `icon` for surfaces\n * that flatten the tree, such as a tab row, where every destination is top level.\n */\n showIcon?: boolean;\n};\n\n/**\n * One row's body, rendered identically in the tree and in the collapsed dropdown — same title, same\n * badge, same description. Shared rather than written twice so the two cannot drift.\n */\nexport const SectionNavItemContent = ({\n item,\n active,\n showDescription = false,\n expanded,\n showIcon = true,\n}: Props) => {\n const Icon = item.icon;\n\n return (\n <span className=\"tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-0.5\">\n <span className=\"tw:flex tw:items-center tw:gap-2\">\n {showIcon && Icon && <Icon className=\"tw:size-4 tw:shrink-0\" />}\n <span\n className={cn(\n 'tw:flex-1 tw:truncate tw:text-sm',\n active ? 'tw:font-medium tw:text-accent-foreground' : 'tw:text-foreground',\n )}\n >\n {item.title}\n </span>\n {item.isNew && (\n <Badge\n color=\"blue-inverse\"\n className=\"tw:min-h-0 tw:text-[10px]\"\n labelClassName=\"tw:px-1.5 tw:py-0\"\n >\n New\n </Badge>\n )}\n {expanded !== undefined && (\n <ChevronDown\n className={cn(\n 'tw:size-4 tw:shrink-0 tw:text-muted-foreground tw:transition-transform tw:duration-200',\n expanded && 'tw:rotate-180',\n )}\n />\n )}\n </span>\n {/* Descriptions wrap rather than truncate — they are the second line, not the label. A token\n with no break opportunity would still paint straight out of the 256px column, so break it. */}\n {showDescription && item.description && (\n <span className=\"tw:text-xs tw:break-words tw:text-muted-foreground\">\n {item.description}\n </span>\n )}\n </span>\n );\n};\n","import { useState } from 'react';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { Collapsible } from '../../components/Collapsible';\nimport { cn, noop } from '../../utils';\n\nimport { SectionNavItemContent } from './SectionNavItemContent';\nimport type { SectionNavGroup, SectionNavItemRenderProps } from './types';\n\ntype Props = {\n group: SectionNavGroup;\n activeId: string | undefined;\n renderItem: (props: SectionNavItemRenderProps) => ReactNode;\n showDescriptions: boolean;\n};\n\n/**\n * The ring is **inset**, not an outline. A row is exactly as wide as the nav column, and\n * `PageLayout.Content nav` makes that column a scroll container (`overflow-y-auto`, which forces\n * `overflow-x` to `auto` too) — so there is 0px of slack for anything painted outside the border\n * box, and the browser's default `outline-offset: 1px` ring gets clipped on both edges. Painting\n * inside the box cannot be clipped, at any column width, by any ancestor.\n */\nconst FOCUS_RING =\n 'tw:focus-visible:outline-hidden tw:focus-visible:ring-2 tw:focus-visible:ring-inset tw:focus-visible:ring-ring';\n\nconst rowClass = (active: boolean) =>\n cn(\n 'tw:flex tw:w-full tw:cursor-pointer tw:items-center tw:gap-2 tw:rounded-md tw:border-none tw:px-3 tw:py-2 tw:text-left tw:text-sm tw:no-underline tw:transition-colors',\n FOCUS_RING,\n active\n ? 'tw:bg-accent tw:font-medium tw:text-accent-foreground'\n : 'tw:bg-transparent tw:text-foreground tw:hover:bg-muted',\n );\n\nconst childRowClass = (active: boolean) =>\n cn(\n 'tw:flex tw:w-full tw:cursor-pointer tw:rounded-md tw:border-none tw:px-3 tw:py-1.5 tw:text-left tw:no-underline tw:transition-colors',\n FOCUS_RING,\n active ? 'tw:bg-accent' : 'tw:bg-transparent tw:hover:bg-muted',\n );\n\n/**\n * One group row and its sub-sections. The row is a single control: it opens the group **and** goes to\n * its first section, and only collapses once you are already there — so the chevron never becomes a\n * separate thing to aim at, and one click always makes progress.\n */\nexport const SectionNavGroupRow = ({ group, activeId, renderItem, showDescriptions }: Props) => {\n // Open on arrival: the nav is short enough that hiding any of it costs more than it saves.\n const [open, setOpen] = useState(true);\n\n const hasChildren = group.children.length > 0;\n const targetId = group.children[0]?.id ?? group.id;\n const isCurrent = group.id === activeId;\n const holdsCurrent = isCurrent || group.children.some((child) => child.id === activeId);\n\n const onClick = (event: MouseEvent<HTMLElement>) => {\n if (!hasChildren) return;\n\n // Already on the row's target, so navigating would be a no-op and the only thing left for the\n // click to do is toggle. `preventDefault` is what tells the caller's link not to navigate.\n if (activeId === targetId) {\n event.preventDefault();\n setOpen((isOpen) => !isOpen);\n\n return;\n }\n\n setOpen(true);\n };\n\n return (\n <Collapsible open={open} onOpenChange={setOpen} className=\"tw:flex tw:flex-col tw:gap-0.5\">\n {renderItem({\n targetId,\n isActive: isCurrent,\n children: (\n <SectionNavItemContent\n item={group}\n active={holdsCurrent}\n expanded={hasChildren ? open : undefined}\n />\n ),\n itemProps: {\n className: rowClass(holdsCurrent),\n 'aria-current': isCurrent ? 'page' : undefined,\n 'aria-expanded': hasChildren ? open : undefined,\n 'data-active': holdsCurrent && !isCurrent ? true : undefined,\n onClick,\n },\n })}\n\n {hasChildren && (\n <Collapsible.Content>\n {/* `pl-1` keeps each row's background box off the group's rule — without it an active\n row's `bg-accent` sits flush against the line. 4px is also what lines the child titles\n (20 + 1 + 4 + 12 = 37px) up with the parent's, which its icon puts at 12 + 16 + 8 = 36px. */}\n {/* `my-0 mr-0` and not `m-0`: a host app emits its own `.tw\\:m-0` from its own source, and\n its stylesheet is the later one — shorthand and longhand at equal specificity means the\n app's `m-0` would land after this `ml-5` and flatten the indent. Longhands only, so\n nothing here can be overridden by a copy of a class this block also uses. */}\n <ul className=\"tw:my-0 tw:mr-0 tw:ml-5 tw:flex tw:list-none tw:flex-col tw:gap-0.5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1\">\n {group.children.map((child) => {\n const active = child.id === activeId;\n\n return (\n <li key={child.id}>\n {renderItem({\n targetId: child.id,\n isActive: active,\n children: (\n <SectionNavItemContent\n item={child}\n active={active}\n showDescription={showDescriptions}\n showIcon={false}\n />\n ),\n itemProps: {\n className: childRowClass(active),\n 'aria-current': active ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </li>\n );\n })}\n {group.note && (\n <li className=\"tw:py-1 tw:pl-3 tw:text-xs tw:text-muted-foreground\">{group.note}</li>\n )}\n </ul>\n </Collapsible.Content>\n )}\n </Collapsible>\n );\n};\n","import type { ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { DropdownMenu } from '../../components/DropdownMenu';\nimport { ChevronDown } from '../../icons';\nimport { cn, noop } from '../../utils';\n\nimport { SectionNavGroupRow } from './SectionNavGroupRow';\nimport { SectionNavItemContent } from './SectionNavItemContent';\nimport type { SectionNavGroup, SectionNavItemRenderProps } from './types';\n\ntype Props = {\n /**\n * The sections to show, already filtered. Visibility, permissions and feature flags stay in the\n * app — this block renders exactly what it is handed, in order.\n */\n groups: SectionNavGroup[];\n /** `id` of the current section: a child's, or a childless group's. */\n activeId?: string;\n /**\n * Renders the clickable element for one row, so routing never enters the design system. Return a\n * `NavLink` / TanStack `Link` / `<a>` pointing at `targetId` and spread `itemProps` onto it.\n */\n renderItem: (props: SectionNavItemRenderProps) => ReactNode;\n /** Print each section's `description` under its title. Off — the tree stays scannable without it. */\n showDescriptions?: boolean;\n /** Accessible name for the tree's `<nav>`, and the collapsed label with nothing active. */\n label?: string;\n /** Applied to the tree's `<nav>`. The column's own geometry belongs to `PageLayout.Content nav`. */\n className?: string;\n};\n\n/**\n * In-page grouped navigation for one page's sections: a tree above the container's breakpoint, a\n * single dropdown below it. Both are rendered and CSS picks one, and both draw their rows through\n * the same renderer, so the two can never drift apart.\n *\n * **This is not `Sidebar`.** `Sidebar` is the app-level left rail — `SidebarProvider`, icon-collapse,\n * one per app shell, outside `PageLayout`. `SectionNav` is scoped to a single page's sections, lives\n * inside `PageLayout.Content`, and owns no global state. See `AGENTS.md`.\n *\n * **Router-agnostic:** `renderItem` is the seam. Pass it whatever your router calls a link.\n *\n * ```tsx\n * <PageLayout.Content nav={\n * <SectionNav\n * groups={groups}\n * activeId={activeId}\n * renderItem={({ targetId, children, itemProps }) => (\n * <Link to={targetId} {...itemProps}>{children}</Link>\n * )}\n * />\n * }>\n * {page}\n * </PageLayout.Content>\n * ```\n *\n * The tree↔dropdown switch is a **container** query on the content area's width, never the viewport\n * — a product sidebar or a chat panel narrows the page without the window resizing.\n * `PageLayout.Content nav={…}` names that container; standalone, put `tw:@container/section-nav` on\n * an ancestor yourself.\n *\n * @see RECIPES.md#section-nav\n */\nexport const SectionNav = ({\n groups,\n activeId,\n renderItem,\n showDescriptions = false,\n label = 'Sections',\n className,\n}: Props) => {\n /**\n * What the collapsed trigger names. A sub-section carries its group with it — \"Developer settings /\n * CLI agents\" — so the trigger says where you are, not just what page this is.\n */\n const activeChild = groups\n .flatMap((group) => group.children.map((child) => ({ group, child })))\n .find(({ child }) => child.id === activeId);\n const activeGroup = groups.find((group) => group.id === activeId);\n const current = activeChild\n ? {\n icon: activeChild.group.icon,\n title: activeChild.child.title,\n parent: activeChild.group.title,\n }\n : { icon: activeGroup?.icon, title: activeGroup?.title ?? label, parent: undefined };\n const CurrentIcon = current.icon;\n /** A group whose subtree holds the active section: tinted like the tree's row, but not `aria-current`. */\n const holdsActive = (group: SectionNavGroup) =>\n group.id === activeId || group.children.some((child) => child.id === activeId);\n\n return (\n <>\n {/* The reset is scoped (`.tailwindcss-preflight`, see `styles.css`), and the rows are\n caller-owned elements — `renderItem` returns the app's own `<a>`, which never inherits a\n scope this block does not open. Without it those rows are `content-box`, so the `w-full`\n + `px-3` in `rowClass` measures 24px wider than the 256px column and every row bleeds out\n of it. Opening the scope here covers the whole tree, rows included. */}\n {/* `display` is set by TWO container variants and never by a plain utility. A host app that\n emits `tw:flex` or `tw:hidden` from its own source ships an identical `.tw\\:flex` /\n `.tw\\:hidden` rule — same specificity, same layer, and its stylesheet is the later one, so\n whichever of the two this block wrote plainly would lose to the app's copy and the tree\n would be stuck visible or stuck hidden. Both variants are selectors only this block emits,\n and their queries are mutually exclusive, so nothing outside can outrank them. */}\n <nav\n aria-label={label}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:w-full tw:flex-col tw:gap-0.5 tw:@[640px]/section-nav:flex tw:@max-[640px]/section-nav:hidden',\n className,\n )}\n >\n {groups.map((group) => (\n <SectionNavGroupRow\n key={group.id}\n group={group}\n activeId={activeId}\n renderItem={renderItem}\n showDescriptions={showDescriptions}\n />\n ))}\n </nav>\n\n <div className=\"tw:w-full tw:bg-background tw:@[640px]/section-nav:hidden tw:@max-[640px]/section-nav:block\">\n <DropdownMenu>\n <DropdownMenu.Trigger asChild>\n <Button variant=\"outline\" className=\"tw:w-full tw:justify-between\">\n <span className=\"tw:flex tw:min-w-0 tw:items-center tw:gap-2\">\n {CurrentIcon && <CurrentIcon className=\"tw:size-4 tw:shrink-0\" />}\n {current.parent && (\n <>\n <span className=\"tw:truncate tw:font-normal tw:text-muted-foreground\">\n {current.parent}\n </span>\n <span className=\"tw:text-border\">/</span>\n </>\n )}\n <span className=\"tw:truncate tw:font-medium tw:text-foreground\">\n {current.title}\n </span>\n </span>\n <ChevronDown className=\"tw:size-4 tw:shrink-0\" />\n </Button>\n </DropdownMenu.Trigger>\n\n <DropdownMenu.Content\n align=\"start\"\n className=\"tw:w-(--radix-dropdown-menu-trigger-width)\"\n >\n {groups.map((group) =>\n group.children.length > 0 ? (\n <DropdownMenu.Group key={group.id}>\n {/* A real item, not a label: it is a destination in the tree (it goes to the\n group's first section), so a menu that made it unclickable would be a different\n navigation, not a smaller one. Same row treatment as every other item. */}\n <DropdownMenu.Item asChild>\n {renderItem({\n targetId: group.children[0]?.id ?? group.id,\n isActive: false,\n children: <SectionNavItemContent item={group} active={holdsActive(group)} />,\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': undefined,\n 'aria-expanded': undefined,\n 'data-active': holdsActive(group) ? true : undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n <div className=\"tw:ml-5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1\">\n {group.children.map((child) => (\n <DropdownMenu.Item key={child.id} asChild>\n {renderItem({\n targetId: child.id,\n isActive: child.id === activeId,\n children: (\n <SectionNavItemContent\n item={child}\n active={child.id === activeId}\n showDescription={showDescriptions}\n showIcon={false}\n />\n ),\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': child.id === activeId ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n ))}\n </div>\n </DropdownMenu.Group>\n ) : (\n <DropdownMenu.Item key={group.id} asChild>\n {renderItem({\n targetId: group.id,\n isActive: group.id === activeId,\n children: <SectionNavItemContent item={group} active={group.id === activeId} />,\n itemProps: {\n className: 'tw:no-underline',\n 'aria-current': group.id === activeId ? 'page' : undefined,\n 'aria-expanded': undefined,\n 'data-active': undefined,\n onClick: noop,\n },\n })}\n </DropdownMenu.Item>\n ),\n )}\n </DropdownMenu.Content>\n </DropdownMenu>\n </div>\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAa,yBAAyB,EACpC,MACA,QACA,kBAAkB,OAClB,UACA,WAAW,WACA;CACX,MAAM,OAAO,KAAK;CAElB,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACE,qBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACG,YAAY,QAAQ,oBAAC,MAAD,EAAM,WAAU,wBAAyB,CAAA;IAC9D,oBAAC,QAAD;KACE,WAAW,GACT,oCACA,SAAS,6CAA6C,oBACxD;KAEC,UAAA,KAAK;IACF,CAAA;IACL,KAAK,SACJ,oBAAC,OAAD;KACE,OAAM;KACN,WAAU;KACV,gBAAe;KAChB,UAAA;IAEM,CAAA;IAER,aAAa,KAAA,KACZ,oBAAC,aAAD,EACE,WAAW,GACT,0FACA,YAAY,eACd,EACD,CAAA;GAEC;EAGL,CAAA,GAAA,mBAAmB,KAAK,eACvB,oBAAC,QAAD;GAAM,WAAU;GACb,UAAA,KAAK;EACF,CAAA,CAEJ;;AAEV;;;;;;;;;;ACnDA,MAAM,aACJ;AAEF,MAAM,YAAY,WAChB,GACE,0KACA,YACA,SACI,0DACA,wDACN;AAEF,MAAM,iBAAiB,WACrB,GACE,wIACA,YACA,S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3CK,MAAM,EA2CX,IAEpB,oBAAC,aAAa,MAAd;IAAkC,SAAA;IAC/B,UAAA,WAAW;KACV,UAAU,MAAM;KAChB,UAAU,MAAM,OAAO;KACvB,UAAU,oBAAC,uBAAD;MAAuB,MAAM;MAAO,QAAQ,MAAM,OAAO;KAAW,CAAA;KAC9E,WAAW;MACT,WAAW;MACX,gBAAgB,MAAM,OAAO,WAAW,SAAS,KAAA;MACjD,iBAAiB,KAAA;MACjB,eAAe,KAAA;MACf,SAAS;KACX;IACF,CAAC;GACgB,GAbK,MAAM,EAaX,CAEvB;EACoB,CAAA,CACV,EAAA,CAAA;CACX,CAAA,CACL,EAAA,CAAA;AAEN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet-Chf0kX1E.js","names":[],"sources":["../src/components/Sheet/SheetBody.tsx","../src/components/Sheet/SheetOverlay.tsx","../src/components/Sheet/SheetContent.tsx","../src/components/Sheet/SheetFooter.tsx","../src/components/Sheet/SheetHeader.tsx","../src/components/Sheet/SheetTitle.tsx","../src/components/Sheet/Sheet.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SheetBody = ({ className, ...rest }: Props) => (\n <div\n {...rest}\n className={cn('tw:flex', 'tw:flex-col', 'tw:overflow-x-hidden', 'tw:px-4', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { ModalOverlay } from '../Modal/ModalOverlay';\n\ntype Props = ComponentProps<typeof ModalOverlay>;\n\n// Assuming it should have the same style as standard modal, if not remove the modal dependency and style it separately.\nexport const SheetOverlay = ({ ref, ...props }: Props) => <ModalOverlay ref={ref} {...props} />;\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-dialog';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { SheetOverlay } from './SheetOverlay';\n\nconst sheetContentVariants = cva(\n [\n // reset\n 'tailwindcss-preflight',\n\n // positioning\n 'tw:fixed',\n\n // Use standard tailwindcss class when, global override in tooltip.less file is removed.\n 'tw:z-[1051]',\n\n 'tw:flex',\n 'tw:flex-col',\n\n 'tw:bg-card',\n 'tw:text-card-foreground',\n 'tw:shadow-lg',\n\n // argo chrome overrides\n 'tw:data-[argo=true]:border',\n 'tw:data-[argo=true]:border-border',\n 'tw:data-[argo=true]:focus-visible:outline-hidden',\n 'tw:data-[argo=true]:focus-visible:ring-2',\n 'tw:data-[argo=true]:focus-visible:ring-ring/50',\n\n 'tw:ease-in-out',\n // opening animation\n 'tw:data-[state=open]:duration-200',\n\n // close animation\n 'tw:data-[state=closed]:duration-200',\n ],\n {\n defaultVariants: {\n side: 'right',\n disableTransition: false,\n },\n variants: {\n disableTransition: {\n true: [],\n false: ['tw:data-[state=open]:animate-in', 'tw:data-[state=closed]:animate-out'],\n },\n side: {\n top: [\n 'tw:inset-x-0',\n 'tw:top-0',\n 'tw:h-auto',\n 'tw:data-[state=closed]:slide-out-to-top',\n 'tw:data-[state=open]:slide-in-from-top',\n 'tw:data-[argo=true]:rounded-b-lg',\n ],\n right: [\n 'tw:inset-y-0',\n 'tw:right-0',\n 'tw:h-full',\n 'tw:data-[state=closed]:slide-out-to-right',\n 'tw:data-[state=open]:slide-in-from-right',\n 'tw:data-[argo=true]:rounded-l-lg',\n ],\n\n bottom: [\n 'tw:inset-x-0',\n 'tw:bottom-0',\n 'tw:h-auto',\n 'tw:data-[state=closed]:slide-out-to-bottom',\n 'tw:data-[state=open]:slide-in-from-bottom',\n 'tw:drop-shadow-2xl', // standard tailwindcss shadow is invisible for a bottom sheet because of positioning\n 'tw:data-[argo=true]:rounded-t-lg',\n ],\n\n left: [\n 'tw:inset-y-0',\n 'tw:left-0',\n 'tw:h-full',\n 'tw:data-[state=closed]:slide-out-to-left',\n 'tw:data-[state=open]:slide-in-from-left',\n 'tw:data-[argo=true]:rounded-r-lg',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n hideOverlay?: boolean;\n keepOpenOnPointerDownOutside?: boolean;\n} & VariantProps<typeof sheetContentVariants> &\n Pick<ComponentProps<typeof Portal>, 'container'>;\n\nexport const SheetContent = ({\n className,\n children,\n side = 'right',\n disableTransition = false,\n hideOverlay = false,\n keepOpenOnPointerDownOutside = false,\n onPointerDownOutside,\n onInteractOutside,\n container,\n ...props\n}: Props) => {\n const renderArgo = useArgoDesign();\n\n const handleOnPointerDownOutside: ComponentProps<typeof Content>['onPointerDownOutside'] = (\n event,\n ) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onPointerDownOutside?.(event);\n };\n\n const handleOnInteractOutside: ComponentProps<typeof Content>['onInteractOutside'] = (event) => {\n if (keepOpenOnPointerDownOutside) event.preventDefault();\n onInteractOutside?.(event);\n };\n\n return (\n <Portal container={container}>\n {!hideOverlay && <SheetOverlay disableTransition={disableTransition ?? false} />}\n <Content\n {...props}\n /**\n * Intentionally set undefined to avoid warning as suggested in docs, (https://www.radix-ui.com/primitives/docs/components/dialog#description)\n * as of now we don't use modal description anywhere, if we decide to fix this issue, we fix it everywhere at once.\n */\n aria-describedby={undefined}\n className={cn(sheetContentVariants({ side, className, disableTransition }))}\n onPointerDownOutside={handleOnPointerDownOutside}\n onInteractOutside={handleOnInteractOutside}\n data-side={side}\n data-argo={renderArgo}\n >\n {children}\n </Content>\n </Portal>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SheetFooter = ({ className, ...props }: Props) => (\n <div className={cn('tw:mt-auto tw:flex tw:flex-col tw:gap-2 tw:p-4', className)} {...props} />\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Close } from '@radix-ui/react-dialog';\n\nimport { X } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { ModalDescription } from '../Modal/ModalDescription';\nimport { ModalTitle } from '../Modal/ModalTitle';\n\ntype Props = {\n title?: ReactNode;\n description?: ReactNode;\n hideCloseIcon?: boolean;\n} & ComponentProps<'div'>;\n\nexport const SheetHeader = ({\n className,\n children,\n hideCloseIcon = false,\n title,\n description,\n ...props\n}: Props) => {\n const isHeaderRendered = title || description || !hideCloseIcon;\n\n return (\n <div className={cn('tw:flex', 'tw:flex-col', 'tw:gap-1.5', 'tw:p-4', className)} {...props}>\n {isHeaderRendered && (\n <div className=\"tw:flex tw:flex-col\">\n <div className=\"tw:flex tw:justify-end tw:gap-2\">\n {title && <ModalTitle>{title}</ModalTitle>}\n {!hideCloseIcon && (\n <Close asChild>\n <Button variant=\"invisible\" size=\"icon-sm\">\n <X />\n <span className=\"tw:sr-only\">Close</span>\n </Button>\n </Close>\n )}\n </div>\n {description && <ModalDescription>{description}</ModalDescription>}\n </div>\n )}\n\n {children}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Title } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Title> & {\n visuallyHidden?: boolean;\n};\n\nexport const SheetTitle = ({ className, visuallyHidden = false, ...props }: Props) => (\n <Title className={cn({ 'tw:sr-only': visuallyHidden }, className)} {...props} />\n);\n","import type { ComponentProps } from 'react';\nimport { Close, Root, Trigger } from '@radix-ui/react-dialog';\n\nimport { SheetBody } from './SheetBody';\nimport { SheetContent } from './SheetContent';\nimport { SheetFooter } from './SheetFooter';\nimport { SheetHeader } from './SheetHeader';\nimport { SheetTitle } from './SheetTitle';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Sheet = (props: Props) => <Root {...props} />;\n\nSheet.Close = Close;\nSheet.Trigger = Trigger;\nSheet.Content = SheetContent;\nSheet.Title = SheetTitle;\n\nSheet.Header = SheetHeader;\nSheet.Footer = SheetFooter;\nSheet.Body = SheetBody;\n"],"mappings":";;;;;;;;;AAMA,MAAa,aAAa,EA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
{"version":3,"file":"Sidebar-CTWsHZhF.js","names":[],"sources":["../src/components/Sidebar/SidebarProvider/useTransitionPresence.ts","../src/components/Sidebar/SidebarContent.tsx","../src/components/Sidebar/utils.ts","../src/components/Sidebar/SidebarProvider/context.ts","../src/components/Sidebar/SidebarProvider/useHoverTracking.ts","../src/components/Sidebar/SidebarProvider/useSidebarState.ts","../src/components/Sidebar/SidebarProvider/SidebarProvider.tsx","../src/components/Sidebar/SidebarFillTrigger.tsx","../src/components/Sidebar/SidebarFooter.tsx","../src/components/Sidebar/SidebarGroup/SidebarGroup.tsx","../src/components/Sidebar/SidebarGroup/SidebarGroupContent.tsx","../src/components/Sidebar/SidebarGroup/SidebarGroupAction.tsx","../src/components/Sidebar/SidebarGroup/SidebarGroupLabel.tsx","../src/components/Sidebar/SidebarInstanceContext.ts","../src/components/Sidebar/SidebarHeader.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenu.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuIcon.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuButton.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuItem.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuAction.tsx","../src/components/Sidebar/SidebarMenu/SidebarSearchInput.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuCard.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuBadge.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuSub.tsx","../src/components/Sidebar/SidebarMenu/SidebarMenuSubItem.tsx","../src/components/Sidebar/useResizeSidebar.ts","../src/components/Sidebar/SidebarResizeHandle.tsx","../src/components/Sidebar/SidebarSeparator.tsx","../src/components/Sidebar/SidebarTrigger.tsx","../src/components/Sidebar/Sidebar.tsx"],"sourcesContent":["import { useEffect, useLayoutEffect, useMemo, useReducer } from 'react';\n\ntype MountState = 'mounted' | 'enterSuspended' | 'unmountSuspended' | 'unmounted';\ntype MountEvent = 'MOUNT' | 'ENTER' | 'TRANSITION_OUT' | 'TRANSITION_END';\n\ntype UseTransitionPresenceOptions = {\n mounted: boolean;\n keepMounted?: boolean;\n /** Hold the subtree back until the enter transition ends — a heavy mount in the same commit blocks every frame of it. */\n mountAfterEnter?: boolean;\n};\n\nconst FALLBACK_TIMEOUT_MS = 500;\n\n/** Under reduced motion there is no `transitionend` to wait for, so the mount is not deferred. */\nconst prefersReducedMotion = () =>\n typeof window !== 'undefined' &&\n (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false);\n\nconst reducer = (state: MountState, event: MountEvent): MountState => {\n switch (event) {\n case 'MOUNT':\n return 'mounted';\n case 'ENTER':\n // Already-mounted content stays put; only a cold open waits.\n return state === 'unmounted' ? 'enterSuspended' : 'mounted';\n case 'TRANSITION_OUT':\n // Closed before the content arrived: nothing to animate out.\n if (state === 'enterSuspended') return 'unmounted';\n return state === 'mounted' ? 'unmountSuspended' : state;\n case 'TRANSITION_END':\n if (state === 'unmountSuspended') return 'unmounted';\n if (state === 'enterSuspended') return 'mounted';\n return state;\n default:\n return state;\n }\n};\n\nexport const useTransitionPresence = ({\n mounted,\n keepMounted = false,\n mountAfterEnter = false,\n}: UseTransitionPresenceOptions) => {\n const [state, send] = useReducer(reducer, mounted ? 'mounted' : 'unmounted');\n\n useLayoutEffect(() => {\n if (keepMounted) return;\n if (!mounted) {\n send('TRANSITION_OUT');\n return;\n }\n send(mountAfterEnter && !prefersReducedMotion() ? 'ENTER' : 'MOUNT');\n }, [mounted, keepMounted, mountAfterEnter]);\n\n // Fallback for both suspensions when `onTransitionEnd` never fires.\n useEffect(() => {\n if (state !== 'unmountSuspended' && state !== 'enterSuspended') return;\n\n const id = setTimeout(() => send('TRANSITION_END'), FALLBACK_TIMEOUT_MS);\n return () => clearTimeout(id);\n }, [state]);\n\n return useMemo(\n () => ({\n isMounted: keepMounted || state === 'mounted' || state === 'unmountSuspended',\n /** Resolves whichever transition the subtree is waiting on. */\n completeUnmount: () => send('TRANSITION_END'),\n }),\n [state, keepMounted],\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { useScrollbarPosition } from '../../hooks/useScrollbarPosition';\nimport { cn, mergeRefs } from '../../utils';\nimport { ScrollArea } from '../ScrollArea';\n\ntype Props = {\n className?: string;\n children?: ReactNode;\n contentRef?: ComponentProps<'div'>['ref'];\n ref?: ComponentProps<'div'>['ref'];\n};\n\nexport const SidebarContent = ({ ref, className, children, contentRef }: Props) => {\n const { setElement, isBottom, isTop, isMiddle } = useScrollbarPosition();\n const mergedRefs = mergeRefs(ref ?? null, (ref) => setElement(ref));\n\n return (\n <ScrollArea\n ref={mergedRefs}\n type=\"scroll\"\n className=\"tw:group/sidebar-content tw:flex-1\"\n data-slot=\"sidebar-content\"\n scrollBarClassName=\"tw:w-1.5\"\n viewPortClassName={cn(\n 'tw:overflow-x-hidden',\n 'tw:overscroll-contain',\n 'tw:[&>div]:!flex', // overflow fix for scrollbar\n // Hide scroll-position-based borders (top/bottom) if SidebarHeader or SidebarFooter is omitted.\n 'tw:group-first/sidebar-content:before:hidden',\n 'tw:group-last/sidebar-content:after:hidden',\n 'tw:!box-border',\n {\n 'tw:before:absolute tw:before:top-0 tw:before:left-0 tw:before:right-0 tw:before:h-px tw:before:bg-sidebar-border tw:before:z-10 tw:before:content-[\"\"]':\n isBottom || isMiddle,\n 'tw:after:absolute tw:after:bottom-0 tw:after:left-0 tw:after:right-0 tw:after:h-px tw:after:bg-sidebar-border tw:after:z-10 tw:after:content-[\"\"]':\n isTop || isMiddle,\n },\n )}\n >\n <div\n ref={contentRef}\n className={cn(\n 'tw:flex',\n 'tw:flex-1',\n 'tw:flex-col',\n 'tw:gap-1',\n 'tw:overflow-x-hidden',\n 'tw:p-2',\n className,\n )}\n >\n {children}\n </div>\n </ScrollArea>\n );\n};\n","import type { SidebarCollapsible, SidebarMode, SidebarState, SidebarVariant } from './types';\n\nexport const SidebarWidthInPx = {\n MIN_DEFAULT: 256,\n\n // 8 px / 36 px / 8 px = 52 px\n // left padding / icon width / right padding\n COLLAPSED_ICON: 52,\n\n // padding from every side for floating variant (see --sidebar-floating-padding)\n FLOATING_VARIANT_PADDING: 8,\n} as const;\n\nconst floatingSideCount: Record<SidebarVariant, number> = {\n 'sided-floating': 1,\n floating: 2,\n inset: 0,\n none: 0,\n};\n\ntype Input = {\n variant: SidebarVariant;\n width?: number;\n collapsible: SidebarCollapsible;\n mode: SidebarMode;\n state: SidebarState;\n};\n\ntype EffectiveWidths = {\n sidebar: number;\n gap: number;\n fill: number;\n};\n\nexport const calcEffectiveWidths = ({\n variant,\n width: customWidth,\n collapsible,\n state,\n mode,\n}: Input) => {\n if (variant === 'none') return { sidebar: 0, gap: 0, fill: 0 };\n\n const padding = floatingSideCount[variant] * SidebarWidthInPx.FLOATING_VARIANT_PADDING;\n const width = Math.max(customWidth ?? 0, SidebarWidthInPx.MIN_DEFAULT) + padding;\n const iconWidth = SidebarWidthInPx.COLLAPSED_ICON + padding;\n const isExpanded = state === 'expanded';\n\n // Only compensate for floating padding when this sidebar itself has padding,\n // so the opposite filled sidebar doesn't double-count the gap.\n const reduction = variant === 'inset' ? 0 : SidebarWidthInPx.FLOATING_VARIANT_PADDING;\n\n const iconWidths = ((): EffectiveWidths => {\n const sidebar = isExpanded ? width : iconWidth;\n const gap = mode === 'expand-on-hover' ? iconWidth : sidebar;\n // Use gap (not sidebar) so the opposite filled sidebar stays stable\n // during expand-on-hover — gap stays at iconWidth while sidebar grows\n const fill = gap - reduction;\n return { sidebar, gap, fill };\n })();\n\n const offCanvasWidths = ((): EffectiveWidths => {\n const sidebar = width; //We use CSS translate to hide elements because it allows for transitions without shrinking the width.\n const gap = isExpanded ? width : SidebarWidthInPx.FLOATING_VARIANT_PADDING; // The gap is invisible and needs to be shrunk to move the content to its place.\n const fill = gap - reduction;\n return { sidebar, gap, fill };\n })();\n\n return collapsible === 'icon' ? iconWidths : offCanvasWidths;\n};\n","import { createContext, use } from 'react';\n\nimport type { SidebarCollapsible, SidebarSide, SidebarVariant } from '../types';\nimport type { calcEffectiveWidths } from '../utils';\n\nimport type { useSidebarState } from './useSidebarState';\n\ntype SidebarWidths = ReturnType<typeof calcEffectiveWidths>;\ntype SidebarState = ReturnType<typeof useSidebarState>;\n\ntype SidebarSideValue = SidebarState & {\n isFill: boolean;\n toggleFill: () => void;\n /** Idempotent counterpart to `toggleFill` — safe to call twice, or when already in that state. */\n setFill: (fill: boolean) => void;\n widths: SidebarWidths;\n collapsible: SidebarCollapsible;\n variant: SidebarVariant;\n baseWidth: number | undefined;\n onWidthChange: ((width: number) => void) | undefined;\n setDragWidth: (width: number | null) => void;\n isDragging: boolean;\n setIsDragging: (dragging: boolean) => void;\n};\n\nexport type SidebarContextValue = {\n left: SidebarSideValue;\n right: SidebarSideValue;\n};\n\nexport const SidebarContext = createContext<SidebarContextValue | null>(null);\n\n/**\n * The sidebar if there is one, `null` otherwise — for code that ENHANCES a page when the app shell is\n * around it (borrowing width, collapsing a panel) and must still render without one, in a test, a\n * story, or an embedded surface. Anything that genuinely requires a sidebar keeps `useSidebar`.\n */\nexport const useOptionalSidebar = (side: SidebarSide = 'left'): SidebarSideValue | null =>\n use(SidebarContext)?.[side] ?? null;\n\nexport const useSidebar = (side: SidebarSide = 'left'): SidebarSideValue => {\n const context = use(SidebarContext);\n if (context === null) throw new Error('useSidebar must be used within a SidebarProvider.');\n return context[side];\n};\n","import { useEffect, useRef, useState } from 'react';\n\n/**\n * CSS selectors matching portal-based overlay triggers in their open state.\n *\n * The sidebar's hover tracking ignores `mouseleave` while any of these selectors\n * match inside the sidebar DOM — preventing the sidebar from collapsing while the\n * user interacts with portal content rendered outside the sidebar tree.\n *\n * Update this list when changing or adding new components:\n */\nconst PORTAL_OPEN_SELECTORS = [\n '[aria-haspopup=\"menu\"][aria-expanded=true]', // DropdownMenu\n '[aria-haspopup=\"dialog\"][aria-expanded=true]', // Popover, Dialogs (Modal, Sheet)\n];\n\nconst PORTAL_OPEN_SELECTORS_STRING = PORTAL_OPEN_SELECTORS.join(',');\n\nexport const useHoverTracking = (sidebarElement: HTMLElement | null) => {\n const [isHovered, setIsHovered] = useState(false);\n const isLockedRef = useRef(false);\n\n useEffect(() => {\n if (!sidebarElement) return;\n\n const handleMouseEnter = () => setIsHovered(true);\n const handleMouseLeave = () => {\n if (isLockedRef.current) return;\n setIsHovered(false);\n };\n\n sidebarElement.addEventListener('mouseenter', handleMouseEnter);\n sidebarElement.addEventListener('mouseleave', handleMouseLeave);\n\n return () => {\n sidebarElement.removeEventListener('mouseenter', handleMouseEnter);\n sidebarElement.removeEventListener('mouseleave', handleMouseLeave);\n };\n }, [sidebarElement]);\n\n useEffect(() => {\n if (!sidebarElement) return;\n let animationFrameId: number;\n\n const observer = new MutationObserver(() => {\n const hasOpenPortal = sidebarElement.querySelector(PORTAL_OPEN_SELECTORS_STRING) !== null;\n isLockedRef.current = hasOpenPortal;\n\n if (hasOpenPortal) return;\n\n animationFrameId = requestAnimationFrame(() => {\n setIsHovered(sidebarElement.matches(':hover'));\n });\n });\n\n // Sync lock state immediately in case a portal trigger is already open on mount.\n isLockedRef.current = sidebarElement.querySelector(PORTAL_OPEN_SELECTORS_STRING) !== null;\n\n observer.observe(sidebarElement, {\n attributes: true,\n attributeFilter: ['aria-expanded'],\n subtree: true,\n });\n\n return () => {\n cancelAnimationFrame(animationFrameId);\n observer.disconnect();\n };\n }, [sidebarElement]);\n\n return isHovered;\n};\n","import { useCallback, useMemo, useState } from 'react';\n\nimport { useElement } from '../../../hooks/useElement';\nimport type { SidebarMode, SidebarState } from '../types';\n\nimport { useHoverTracking } from './useHoverTracking';\n\ntype Props = {\n defaultMode?: SidebarMode;\n mode?: SidebarMode;\n onModeChange?: (state: SidebarMode) => void;\n};\n\nexport const useSidebarState = ({ defaultMode, mode: modeProp, onModeChange }: Props) => {\n const [sidebarElement, setSidebarElement] = useElement();\n const isHovered = useHoverTracking(sidebarElement);\n const [_mode, _setMode] = useState(defaultMode ?? 'expanded');\n const mode = modeProp ?? _mode;\n\n const setMode = useCallback(\n (dispatch: Parameters<typeof _setMode>[0]) => {\n const newState = typeof dispatch === 'function' ? dispatch(mode) : dispatch;\n const set = onModeChange ?? _setMode;\n set(newState);\n },\n [onModeChange, mode],\n );\n\n const toggle = useCallback(() => {\n setMode((currState) => (currState === 'expanded' ? 'collapsed' : 'expanded'));\n }, [setMode]);\n\n const state: SidebarState = (() => {\n if (mode === 'expand-on-hover') return isHovered ? 'expanded' : 'collapsed';\n return mode;\n })();\n\n return useMemo(\n () => ({\n isHovered,\n toggle,\n setMode,\n mode,\n state,\n sidebarElement,\n setSidebarElement,\n }),\n [isHovered, toggle, setMode, mode, state, sidebarElement, setSidebarElement],\n );\n};\n","import { type ReactNode, useCallback, useMemo, useState } from 'react';\n\nimport type { SidebarCollapsible, SidebarMode, SidebarSide, SidebarVariant } from '../types';\nimport { calcEffectiveWidths } from '../utils';\n\nimport type { SidebarContextValue } from './context';\nimport { SidebarContext } from './context';\nimport { useSidebarState } from './useSidebarState';\n\nconst DEFAULT_SIDEBAR_VARIANT: SidebarVariant = 'none';\nconst DEFAULT_SIDEBAR_MODE: SidebarMode = 'expanded';\nconst DEFAULT_SIDEBAR_COLLAPSIBLE: SidebarCollapsible = 'off-canvas';\n\ntype Props = {\n children?: ReactNode;\n // left state\n defaultLeftMode?: SidebarMode;\n leftMode?: SidebarMode;\n onLeftModeChange?: (mode: SidebarMode) => void;\n\n // right state\n defaultRightMode?: SidebarMode;\n rightMode?: SidebarMode;\n onRightModeChange?: (mode: SidebarMode) => void;\n\n // left\n leftVariant?: SidebarVariant;\n leftWidth?: number;\n leftCollapsible?: SidebarCollapsible;\n\n // right\n rightVariant?: SidebarVariant;\n rightWidth?: number;\n rightCollapsible?: SidebarCollapsible;\n\n // width change callbacks\n onLeftWidthChange?: (width: number) => void;\n onRightWidthChange?: (width: number) => void;\n\n // fill\n defaultFilledSide?: SidebarSide | null;\n};\n\nexport const SidebarProvider = ({\n children,\n // left state\n defaultLeftMode = DEFAULT_SIDEBAR_MODE,\n leftMode,\n onLeftModeChange,\n\n // right state\n defaultRightMode = DEFAULT_SIDEBAR_MODE,\n rightMode,\n onRightModeChange,\n\n // left\n leftCollapsible = DEFAULT_SIDEBAR_COLLAPSIBLE,\n leftVariant = DEFAULT_SIDEBAR_VARIANT,\n leftWidth,\n\n // right\n rightCollapsible = DEFAULT_SIDEBAR_COLLAPSIBLE,\n rightVariant = DEFAULT_SIDEBAR_VARIANT,\n rightWidth,\n\n // width change callbacks\n onLeftWidthChange,\n onRightWidthChange,\n\n // fill\n defaultFilledSide = null,\n}: Props) => {\n const [filledSide, setFilledSide] = useState<SidebarSide | null>(defaultFilledSide);\n const [isLeftDragging, setIsLeftDragging] = useState(false);\n const [isRightDragging, setIsRightDragging] = useState(false);\n const [leftDragWidth, setLeftDragWidth] = useState<number | null>(null);\n const [rightDragWidth, setRightDragWidth] = useState<number | null>(null);\n\n // Clear the local drag override the moment it matches the controlled width, so a\n // later width prop change isn't masked by a stale override (`baseWidth` is\n // `dragWidth ?? width`). Done during render rather than in an effect: it\n // converges (the override becomes null, so it can't loop) and triggers on a\n // change to either the prop or the drag width — matching the original effect,\n // whose dependency array also watched the drag width.\n if (leftDragWidth !== null && leftWidth === leftDragWidth) setLeftDragWidth(null);\n if (rightDragWidth !== null && rightWidth === rightDragWidth) setRightDragWidth(null);\n\n const leftState = useSidebarState({\n defaultMode: defaultLeftMode,\n mode: leftMode,\n onModeChange: onLeftModeChange,\n });\n\n const rightState = useSidebarState({\n defaultMode: defaultRightMode,\n mode: rightMode,\n onModeChange: onRightModeChange,\n });\n\n const toggleLeftFill = useCallback(\n () => setFilledSide((prev) => (prev === 'left' ? null : 'left')),\n [],\n );\n const toggleRightFill = useCallback(\n () => setFilledSide((prev) => (prev === 'right' ? null : 'right')),\n [],\n );\n\n // Idempotent per side: unlike `toggleFill`, these need no knowledge of the current value, so\n // repeated calls for one side land on the value they ask for. Fill is a single slot, so two\n // sides asking at once still race — the last write wins.\n const setLeftFill = useCallback(\n (fill: boolean) => setFilledSide((prev) => (fill ? 'left' : prev === 'left' ? null : prev)),\n [],\n );\n const setRightFill = useCallback(\n (fill: boolean) => setFilledSide((prev) => (fill ? 'right' : prev === 'right' ? null : prev)),\n [],\n );\n\n const value = useMemo<SidebarContextValue>(\n () => ({\n left: {\n ...leftState,\n isFill: filledSide === 'left',\n toggleFill: toggleLeftFill,\n setFill: setLeftFill,\n widths: calcEffectiveWidths({\n variant: leftVariant,\n width: leftDragWidth ?? leftWidth,\n collapsible: leftCollapsible,\n state: leftState.state,\n mode: leftState.mode,\n }),\n collapsible: leftCollapsible,\n variant: leftVariant,\n baseWidth: leftDragWidth ?? leftWidth,\n onWidthChange: onLeftWidthChange,\n setDragWidth: setLeftDragWidth,\n isDragging: isLeftDragging,\n setIsDragging: setIsLeftDragging,\n },\n right: {\n ...rightState,\n isFill: filledSide === 'right',\n toggleFill: toggleRightFill,\n setFill: setRightFill,\n widths: calcEffectiveWidths({\n variant: rightVariant,\n width: rightDragWidth ?? rightWidth,\n collapsible: rightCollapsible,\n state: rightState.state,\n mode: rightState.mode,\n }),\n collapsible: rightCollapsible,\n variant: rightVariant,\n baseWidth: rightDragWidth ?? rightWidth,\n onWidthChange: onRightWidthChange,\n setDragWidth: setRightDragWidth,\n isDragging: isRightDragging,\n setIsDragging: setIsRightDragging,\n },\n }),\n [\n leftState,\n filledSide,\n toggleLeftFill,\n setLeftFill,\n leftVariant,\n leftWidth,\n leftDragWidth,\n leftCollapsible,\n onLeftWidthChange,\n isLeftDragging,\n rightState,\n toggleRightFill,\n setRightFill,\n rightVariant,\n rightWidth,\n rightDragWidth,\n rightCollapsible,\n onRightWidthChange,\n isRightDragging,\n ],\n );\n\n return <SidebarContext value={value}>{children}</SidebarContext>;\n};\n","import type { ComponentProps, MouseEventHandler } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { useSidebar } from './SidebarProvider';\nimport type { SidebarSide } from './types';\n\ntype Props = ComponentProps<typeof Slot> & {\n side?: SidebarSide;\n};\n\nexport const SidebarFillTrigger = ({ ref, side = 'left', onClick, ...rest }: Props) => {\n const { toggleFill, isFill } = useSidebar(side);\n\n const handleOnClick: MouseEventHandler<HTMLElement> = (event) => {\n toggleFill();\n onClick?.(event);\n };\n\n return <Slot {...rest} ref={ref} onClick={handleOnClick} aria-selected={isFill} />;\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SidebarFooter = ({ className, ...props }: Props) => (\n <div\n data-slot=\"sidebar-footer\"\n className={cn('tw:flex', 'tw:flex-col', 'tw:gap-2', 'tw:p-2', className)}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SidebarGroup = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:group/sidebar-group',\n 'tw:relative',\n 'tw:w-full',\n\n // positioning\n 'tw:flex',\n 'tw:flex-col',\n 'tw:min-w-0',\n 'tw:rounded-lg',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SidebarGroupContent = ({ className, ...props }: Props) => (\n <div\n className={cn(\n // positioning\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-2',\n\n 'tw:w-full',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'button'>;\n\nexport const SidebarGroupAction = ({\n ref,\n className,\n type = 'button',\n children,\n ...props\n}: Props) => (\n <button\n {...props}\n type={type}\n ref={ref}\n className={cn(\n 'tw:group-data-[state=collapsed]/sidebar:hidden',\n\n // positioning\n 'tw:absolute',\n 'tw:right-1.5',\n 'tw:top-2',\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n\n // sizing\n 'tw:size-5',\n\n // styles\n 'tw:text-neutral-800',\n 'tw:rounded-full',\n\n // svg defaults: size + colour\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n 'tw:[&_svg]:text-neutral-400',\n 'tw:hover:[&_svg]:text-secondary-600',\n\n 'tw:hover:bg-neutral-100',\n\n 'tw:focus-visible:ring-4',\n 'tw:focus-visible:ring-ring/30',\n 'tw:focus-visible:outline',\n 'tw:focus-visible:outline-1',\n 'tw:focus-visible:outline-ring',\n className,\n )}\n >\n {children}\n </button>\n);\n","import type { ComponentProps, Ref } from 'react';\n\nimport { cn } from '../../../utils';\nimport { Separator } from '../../Separator';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SidebarGroupLabel = ({\n ref,\n className,\n children,\n ...props\n}: Props & { ref?: Ref<HTMLDivElement> }) => (\n <div\n ref={ref}\n className={cn(\n 'tw:relative',\n // positioning\n 'tw:flex',\n 'tw:flex-col',\n 'tw:shrink-0',\n\n // styling\n 'tw:h-8',\n 'tw:px-2',\n 'tw:-mb-1',\n 'tw:rounded-lg',\n\n // text\n 'tw:uppercase',\n 'tw:font-sans',\n 'tw:text-xs',\n 'tw:tracking-[1px]',\n className,\n )}\n {...props}\n >\n <Separator\n orientation=\"horizontal\"\n size=\"3/4\"\n className={cn(\n 'tw:opacity-0',\n 'tw:group-data-[state=collapsed]/sidebar:opacity-100',\n\n // positioning\n 'tw:absolute',\n 'tw:w-full',\n 'tw:left-0',\n 'tw:top-1/2 tw:-translate-y-1/2',\n\n 'tw:transition-opacity',\n 'tw:duration-(--sidebar-motion-duration)',\n 'tw:ease-(--sidebar-motion-easing)',\n 'tw:motion-reduce:transition-none',\n )}\n />\n\n <span\n className={cn(\n 'tw:flex',\n 'tw:group-data-[state=collapsed]/sidebar:opacity-0',\n\n 'tw:items-center',\n 'tw:flex-1',\n 'tw:text-muted-foreground',\n 'tw:whitespace-nowrap',\n\n // transition\n 'tw:transition-opacity',\n 'tw:duration-(--sidebar-motion-duration)',\n 'tw:ease-(--sidebar-motion-easing)',\n 'tw:motion-reduce:transition-none',\n )}\n >\n {children}\n </span>\n </div>\n);\n","import { createContext, use } from 'react';\n\nimport type { SidebarMode, SidebarSide, SidebarState } from './types';\n\ntype SidebarInstanceContextValue = {\n state: SidebarState;\n mode: SidebarMode;\n side: SidebarSide;\n};\n\nexport const SidebarInstanceContext = createContext<SidebarInstanceContextValue | null>(null);\n\nexport const useSidebarInstance = () => {\n const context = use(SidebarInstanceContext);\n if (context === null)\n throw new Error('useSidebarInstance must be used within a SidebarInstanceContext.');\n return context;\n};\n","import { type ComponentProps, use } from 'react';\n\nimport { cn } from '../../utils';\nimport { BrandLogo } from '../BrandLogo';\n\nimport { SidebarInstanceContext } from './SidebarInstanceContext';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SidebarHeader = ({ className, children, ...props }: Props) => {\n const instance = use(SidebarInstanceContext);\n // BrandLogo reads the nearest ThemeProvider (or the default context) and renders\n // null when the active brand ships no logo, so no provider gate is needed.\n const variant = instance?.state === 'collapsed' ? 'mark' : 'wordmark';\n const fallback = <BrandLogo variant={variant} className=\"tw:h-7\" />;\n\n return (\n <div\n data-slot=\"sidebar-header\"\n className={cn(\n 'tw:peer/sidebar-header',\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-2',\n 'tw:p-2',\n className,\n )}\n {...props}\n >\n {children ?? fallback}\n </div>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'ul'>;\n\nexport const SidebarMenu = ({ className, ...props }: Props) => (\n <ul\n data-sidebar=\"menu\"\n className={cn(\n 'tw:flex',\n 'tw:w-full',\n 'tw:min-w-0',\n 'tw:flex-col',\n 'tw:gap-1',\n\n // transition\n 'tw:transition-[margin,opacity]',\n 'tw:duration-(--sidebar-motion-duration)',\n 'tw:ease-(--sidebar-motion-easing)',\n 'tw:motion-reduce:transition-none',\n\n // TODO: remove when boostrap is gone\n 'tw:pl-0',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'span'>;\n\nexport const SidebarMenuIcon = ({ ref, className, children, ...rest }: Props) => (\n <span\n {...rest}\n ref={ref}\n className={cn(\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:aspect-square',\n 'tw:shrink-0',\n 'tw:p-0.5',\n 'tw:text-sidebar-primary',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n className,\n )}\n >\n {children}\n </span>\n);\n","import type { ComponentProps, ReactNode, Ref } from 'react';\nimport { Root, Slottable } from '@radix-ui/react-slot';\n\nimport { cn } from '../../../utils';\nimport { Tooltip } from '../../Tooltip';\nimport { useSidebarInstance } from '../SidebarInstanceContext';\n\nimport { SidebarMenuIcon } from './SidebarMenuIcon';\n\ntype Props = ComponentProps<'button'> & {\n asChild?: boolean;\n tooltip?: ReactNode;\n icon?: ReactNode;\n};\n\nexport const SidebarMenuButton = ({\n ref,\n 'aria-selected': selected,\n className,\n children,\n asChild = false,\n icon,\n tooltip,\n ...props\n}: Props & { ref?: Ref<HTMLButtonElement> }) => {\n const Component = asChild ? Root : 'button';\n const { state, mode, side } = useSidebarInstance();\n\n const button = (\n <Component\n {...props}\n ref={ref}\n data-slot=\"sidebar-menu-button\"\n // `type` and `aria-selected` belong to a real <button>. With `asChild` the slot is\n // usually an <a> (the canonical nav item), where both are invalid — axe flags\n // `aria-selected` on a link as a critical violation. Mark the active link with\n // `aria-current=\"page\"` instead; it is styled identically below. `aria-selected`\n // is still forwarded when a caller passes it explicitly.\n {...(asChild ? {} : { type: 'button' as const })}\n {...(selected === undefined ? {} : { 'aria-selected': selected })}\n className={cn(\n 'tw:peer/sidebar-menu-button',\n 'tw:group/sidebar-menu-button',\n\n // if <SidebarMenuAction /> visible, prevent the text from being under the action button.\n 'tw:group-data-[state=expanded]/sidebar:group-has-[[data-slot=sidebar-menu-action][data-hover-only=false]]/sidebar-menu-item:pr-8',\n 'tw:group-data-[state=expanded]/sidebar:[&:has(+[data-slot=\"sidebar-menu-action\"])]:group-hover/sidebar-menu-item:pr-8',\n 'tw:group-data-[state=expanded]/sidebar:[&:has(+[data-slot=\"sidebar-menu-action\"])]:group-focus-within/sidebar-menu-item:pr-8',\n 'tw:group-data-[state=expanded]/sidebar:[&:has(+[data-slot=\"sidebar-menu-action\"][data-hover-only=true][data-state=open])]:pr-8',\n\n 'tw:flex',\n 'tw:w-full',\n 'tw:gap-2',\n 'tw:items-center',\n 'tw:z-10',\n 'tw:font-normal',\n 'tw:text-sidebar-foreground',\n 'tw:p-2',\n 'tw:whitespace-nowrap',\n 'tw:overflow-hidden',\n 'tw:rounded-lg',\n 'tw:text-start',\n 'tw:no-underline',\n 'tw:select-none',\n\n // hover\n 'tw:hover:not-disabled:bg-sidebar-accent',\n 'tw:hover:text-sidebar-accent-foreground',\n 'tw:focus:text-sidebar-accent-foreground', // anchor override\n 'tw:data-[slot=dropdown-menu-trigger]:data-[state=open]:bg-sidebar-accent',\n\n // disabled\n 'tw:disabled:opacity-50',\n 'tw:disabled:cursor-not-allowed',\n\n // active\n 'tw:aria-selected:font-medium',\n 'tw:aria-selected:bg-sidebar-accent',\n 'tw:aria-selected:cursor-default',\n // active for links https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-current\n 'tw:aria-[current=page]:bg-sidebar-accent',\n 'tw:aria-[current=page]:font-medium',\n 'tw:aria-[current=page]:focus:text-sidebar-accent-foreground',\n\n // focus-visible\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:z-10',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-sidebar-ring/50',\n 'tw:focus-visible:text-sidebar-foreground', // anchor override\n className,\n )}\n // Explicitly set the tabIndex to 0 to ensure the button is focusable; in Safari, anchors are not focusable by default.\n tabIndex={0}\n >\n {icon && <SidebarMenuIcon>{icon}</SidebarMenuIcon>}\n <Slottable>{children}</Slottable>\n </Component>\n );\n\n const shouldShowTooltip = state === 'collapsed' && mode !== 'expand-on-hover' && tooltip;\n\n if (shouldShowTooltip) {\n const tooltipPlacement = side === 'right' ? 'left' : 'right';\n\n return (\n <Tooltip tooltip={tooltip} placement={tooltipPlacement} triggerAsChild>\n {button}\n </Tooltip>\n );\n }\n\n return button;\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'li'>;\n\nexport const SidebarMenuItem = ({ className, ...props }: Props) => (\n <li className={cn('tw:group/sidebar-menu-item', 'tw:relative', className)} {...props} />\n);\n","import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'button'> & {\n asChild?: boolean;\n showOnHover?: boolean;\n};\n\nexport const SidebarMenuAction = ({\n ref,\n className,\n asChild = false,\n showOnHover = false,\n children,\n ...props\n}: Props) => {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp\n {...props}\n data-slot=\"sidebar-menu-action\"\n data-hover-only={showOnHover}\n ref={ref}\n className={cn(\n 'tw:absolute',\n 'tw:top-1/2',\n 'tw:-translate-y-1/2',\n 'tw:right-3',\n 'tw:z-10',\n 'tw:p-0.5',\n\n // display\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:aspect-square',\n\n // hiding\n 'tw:data-[hover-only=true]:opacity-0',\n 'tw:group-data-[state=collapsed]/sidebar:hidden',\n\n 'tw:group-data-[state=expanded]/sidebar:group-hover/sidebar-menu-item:opacity-100',\n 'tw:group-data-[state=expanded]/sidebar:group-focus-within/sidebar-menu-item:opacity-100', // keyboard navigation\n\n 'tw:group-data-[state=expanded]/sidebar:data-[hover-only=true]:data-[state=open]:opacity-100', // for triggers (dropdown, tooltip, popover)\n\n 'tw:size-4',\n 'tw:rounded',\n\n // icon styling\n 'tw:[&_svg]:shrink-0',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3.5',\n 'tw:[&_svg]:text-sidebar-accent-foreground',\n\n // focus visible\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:z-10',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-sidebar-ring/50',\n 'tw:focus-visible:text-sidebar-foreground',\n className,\n )}\n >\n {children}\n </Comp>\n );\n};\n","import { useRef } from 'react';\nimport type { ComponentProps } from 'react';\n\nimport { Search } from '../../../icons';\nimport { cn, mergeRefs } from '../../../utils';\nimport { useSidebarInstance } from '../SidebarInstanceContext';\nimport { useSidebar } from '../SidebarProvider';\n\nconst wrapperClassnames = cn(\n 'tw:group/search-input',\n 'tw:relative',\n 'tw:flex',\n 'tw:items-center',\n 'tw:min-h-9',\n 'tw:rounded-lg',\n 'tw:border',\n 'tw:transition-all',\n\n // collapsed state - transparent border/bg, hover like search button\n 'tw:group-data-[state=collapsed]/sidebar:cursor-pointer',\n 'tw:group-data-[state=collapsed]/sidebar:border-transparent',\n 'tw:group-data-[state=collapsed]/sidebar:hover:bg-sidebar-accent',\n\n // expanded state - visible border/bg, padding for input, text cursor\n 'tw:group-data-[state=expanded]/sidebar:cursor-text',\n 'tw:group-data-[state=expanded]/sidebar:px-2',\n 'tw:group-data-[state=expanded]/sidebar:border-neutral-200',\n\n // focus styles (only relevant when expanded)\n 'tw:focus-within:ring-2',\n 'tw:focus-within:ring-sidebar-ring/50',\n 'tw:focus-within:text-sidebar-foreground',\n);\n\ntype Props = Omit<ComponentProps<'input'>, 'prefix'>;\n\nexport const SidebarSearchInput = ({ ref: forwardedRef, className, ...inputProps }: Props) => {\n const { side } = useSidebarInstance();\n const { setMode } = useSidebar(side);\n const inputRef = useRef<HTMLInputElement>(null);\n\n const handleFocus = () => {\n setMode('expanded');\n };\n\n return (\n <div className={cn(wrapperClassnames, className)}>\n <Search\n className={cn(\n 'tw:pointer-events-none',\n 'tw:absolute',\n 'tw:left-2',\n 'tw:size-4',\n\n 'tw:text-sidebar-primary',\n 'tw:group-data-[state=expanded]/sidebar:text-neutral-400',\n )}\n />\n <input\n ref={mergeRefs(forwardedRef ?? null, inputRef)}\n {...inputProps}\n onFocus={(e) => {\n handleFocus();\n inputProps.onFocus?.(e);\n }}\n className={cn(\n 'tw:w-full',\n 'tw:bg-transparent',\n 'tw:text-sm',\n 'tw:font-sans',\n 'tw:outline-hidden',\n 'tw:placeholder:text-neutral-400',\n\n // collapsed state - visually hidden but still focusable for a11y\n 'tw:group-data-[state=collapsed]/sidebar:opacity-0',\n 'tw:group-data-[state=collapsed]/sidebar:cursor-pointer',\n\n // expanded state\n 'tw:group-data-[state=expanded]/sidebar:pl-6',\n )}\n />\n </div>\n );\n};\n","import { useCallback, useState } from 'react';\nimport type { ComponentProps, HTMLAttributes, ReactNode } from 'react';\n\nimport { cn } from '../../../utils';\nimport { HoverCard } from '../../HoverCard';\nimport { useSidebarInstance } from '../SidebarInstanceContext';\nimport { useSidebar } from '../SidebarProvider';\n\nimport { SidebarMenuIcon } from './SidebarMenuIcon';\n\nconst Title = ({ children }: { children: ReactNode }) => (\n <div className=\"tw:flex tw:select-none tw:gap-2 tw:text-sm tw:font-semibold\">{children}</div>\n);\n\nconst Content = ({ children, className }: { children: ReactNode; className?: string }) => (\n <div\n className={cn(\n 'tw:whitespace-pre-line',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:invisible',\n className,\n )}\n >\n {children}\n </div>\n);\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n icon: ReactNode;\n title: ReactNode;\n};\n\nexport const SidebarMenuCard = ({ children, className, icon, title, ...rest }: Props) => {\n const [isOpen, setIsOpen] = useState(false);\n const { side = 'left' } = useSidebarInstance();\n const { state, isFill } = useSidebar(side);\n const isExpanded = state === 'expanded' || isFill;\n\n const handleOnOpenChange: ComponentProps<typeof HoverCard>['onOpenChange'] = useCallback(\n (open: boolean) => {\n setIsOpen(isExpanded || document.hidden ? false : open);\n },\n [isExpanded],\n );\n\n return (\n <HoverCard open={isOpen} onOpenChange={handleOnOpenChange}>\n <HoverCard.Trigger asChild>\n <div\n {...rest}\n data-slot=\"sidebar-menu-card\"\n tabIndex={isExpanded ? -1 : 0}\n className={cn(\n 'tw:group/sidebar-menu-card',\n 'tw:peer/sidebar-menu-card',\n\n 'tw:overflow-hidden',\n\n 'tw:border',\n 'tw:border-sidebar-border',\n 'tw:rounded-2xl',\n\n // layout\n 'tw:grid',\n 'tw:grid-rows-[1fr]',\n 'tw:flex-1',\n 'tw:p-4',\n\n // icon collapsed\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:p-2',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:border-transparent',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:grid-rows-[18px]',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:rounded-md',\n\n // focus-visible\n 'tw:outline-hidden',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:hover:bg-sidebar-accent',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:focus-visible:ring-2',\n 'tw:group-data-[fill=false]/sidebar:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:focus-visible:ring-sidebar-ring/50',\n\n // transition\n 'tw:transition-[padding,border]',\n 'tw:duration-(--sidebar-motion-duration)',\n 'tw:ease-(--sidebar-motion-easing)',\n 'tw:motion-reduce:transition-none',\n )}\n >\n <div className=\"tw:flex tw:flex-col tw:gap-2\">\n <Title>\n <SidebarMenuIcon className=\"tw:p-px\">{icon}</SidebarMenuIcon>\n {title}\n </Title>\n <Content className={className}>{children}</Content>\n </div>\n </div>\n </HoverCard.Trigger>\n\n <HoverCard.Content\n sideOffset={10}\n align=\"center\"\n side={side === 'left' ? 'right' : 'left'}\n className=\"tw:flex tw:flex-col tw:gap-2\"\n >\n <Title>{title}</Title>\n <Content className={className}>{children}</Content>\n </HoverCard.Content>\n </HoverCard>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../../utils';\n\ntype Props = ComponentProps<'div'>;\n\nexport const SidebarMenuBadge = ({ ref, className, ...props }: Props) => {\n return (\n <div\n ref={ref}\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n // layout\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:z-20',\n\n 'tw:absolute',\n\n // menu button position\n 'tw:peer-[]/sidebar-menu-button:right-2',\n // menu card position\n 'tw:peer-[]/sidebar-menu-card:right-4',\n 'tw:peer-[]/sidebar-menu-card:top-4',\n\n // icon collapsed position\n 'tw:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:right-0',\n 'tw:group-data-[state=collapsed]/sidebar:group-data-[collapsible=icon]/sidebar:-top-1',\n\n 'tw:text-xs',\n 'tw:text-sidebar-primary-foreground',\n 'tw:bg-sidebar-primary',\n 'tw:px-1',\n 'tw:min-w-5',\n 'tw:h-5',\n 'tw:rounded-full',\n 'tw:pointer-events-none',\n 'tw:font-medium',\n 'tw:tabular-nums',\n 'tw:select-none',\n\n 'tw:transition-[top,right]',\n 'tw:delay-50',\n 'tw:duration-(--sidebar-motion-duration)',\n 'tw:ease-(--sidebar-motion-easing)',\n 'tw:motion-reduce:transition-none',\n className,\n )}\n {...props}\n />\n );\n};\n","import { useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { ChevronDown } from '../../../icons';\nimport { cn } from '../../../utils';\nimport { Collapsible } from '../../Collapsible';\nimport { DropdownMenu } from '../../DropdownMenu';\nimport { Tooltip } from '../../Tooltip';\nimport { useSidebarInstance } from '../SidebarInstanceContext';\n\nimport { SidebarMenuButton } from './SidebarMenuButton';\n\ntype Props = {\n children: ReactNode;\n icon: ReactNode;\n isActive?: boolean;\n label: string;\n} & Pick<ComponentProps<typeof Collapsible>, 'defaultOpen' | 'open' | 'onOpenChange'>;\n\nexport const SidebarMenuSub = ({\n children,\n icon,\n isActive = false,\n label,\n\n // collapsible props\n defaultOpen = false,\n open: openProp,\n onOpenChange,\n}: Props) => {\n const { state, side, mode } = useSidebarInstance();\n const [open, setOpen] = useState<'open-tooltip' | 'open-dropdown-menu' | null>(null);\n const [innerCollapsibleOpen, setInnerCollapsibleOpen] = useState(defaultOpen);\n\n const isCollapsibleOpen = (() => {\n // In the collapsed sidebar state, it is always closed.\n if (state === 'collapsed') return false;\n return openProp ?? innerCollapsibleOpen;\n })();\n\n const isDropdownMenu = mode === 'expand-on-hover' || mode === 'collapsed';\n\n const handleCollapsibleOpenChange = (open: boolean) => {\n if (openProp === undefined) setInnerCollapsibleOpen(open);\n\n onOpenChange?.(open);\n };\n\n const handleDropdownOpenChange = (open: boolean) => {\n setOpen(open ? 'open-dropdown-menu' : null);\n };\n\n const handleTooltipOpenChange = (open: boolean) => {\n setOpen((currentOpen) => {\n // dropdown menu has higher priority than tooltip, if it's open, keep it open\n if (currentOpen === 'open-dropdown-menu') return 'open-dropdown-menu';\n // no need to show tooltip in expanded state, so return null\n if (state === 'expanded') return null;\n return open ? 'open-tooltip' : null;\n });\n };\n\n if (isDropdownMenu) {\n return (\n <DropdownMenu open={open === 'open-dropdown-menu'} onOpenChange={handleDropdownOpenChange}>\n <Tooltip.Root open={open === 'open-tooltip'} onOpenChange={handleTooltipOpenChange}>\n <Tooltip.Trigger asChild>\n <DropdownMenu.Trigger asChild>\n <SidebarMenuButton\n icon={icon}\n data-active={isActive}\n className={cn(\n 'tw:data-[active=true]:bg-sidebar-accent',\n 'tw:data-[active=true]:font-medium',\n )}\n >\n {label}\n </SidebarMenuButton>\n </DropdownMenu.Trigger>\n </Tooltip.Trigger>\n <Tooltip.Content variant=\"action\" placement={side}>\n {label}\n </Tooltip.Content>\n </Tooltip.Root>\n\n <DropdownMenu.Content side={side} align=\"start\">\n <DropdownMenu.Label>{label}</DropdownMenu.Label>\n {children}\n </DropdownMenu.Content>\n </DropdownMenu>\n );\n }\n\n return (\n <Collapsible open={isCollapsibleOpen} onOpenChange={handleCollapsibleOpenChange}>\n <Collapsible.Trigger asChild>\n <SidebarMenuButton\n icon={icon}\n data-active={isActive && !isCollapsibleOpen}\n className={cn(\n 'tw:group',\n 'tw:data-[active=true]:bg-sidebar-accent',\n 'tw:data-[active=true]:font-medium',\n )}\n >\n {label}\n <ChevronDown className=\"tw:ml-auto tw:size-5 tw:transition-transform tw:duration-200 tw:group-data-[state=open]:rotate-180\" />\n </SidebarMenuButton>\n </Collapsible.Trigger>\n <Collapsible.Content>\n <ul\n data-sidebar=\"menu-sub\"\n className={cn(\n 'tw:ml-3.5',\n 'tw:flex',\n 'tw:min-w-0',\n 'tw:translate-x-px',\n 'tw:flex-col',\n 'tw:gap-1',\n 'tw:border-l',\n 'tw:border-sidebar-border',\n 'tw:py-0.5',\n 'tw:pl-2.5',\n 'tw:pr-0',\n\n // TODO: remove when bootstrap is gone\n 'tw:list-none',\n )}\n >\n {children}\n </ul>\n </Collapsible.Content>\n </Collapsible>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Root, Slottable } from '@radix-ui/react-slot';\n\nimport { cn } from '../../../utils';\nimport { DropdownMenu } from '../../DropdownMenu';\nimport { useSidebarInstance } from '../SidebarInstanceContext';\n\ntype Props = ComponentProps<'button'> & {\n asChild?: boolean;\n};\n\nexport const SidebarMenuSubItem = ({\n ref,\n className,\n asChild = false,\n children,\n disabled,\n 'aria-current': ariaCurrent,\n ...props\n}: Props) => {\n const { mode } = useSidebarInstance();\n const isDropdownMenu = mode === 'collapsed' || mode === 'expand-on-hover';\n\n if (isDropdownMenu) {\n return (\n <DropdownMenu.Item\n aria-current={ariaCurrent}\n asChild={asChild}\n disabled={disabled}\n className={cn(\n // use sidebar colors for active and focus states\n 'tw:focus:!bg-sidebar-accent',\n 'tw:aria-[current=page]:bg-sidebar-accent',\n 'tw:aria-[current=page]:focus:text-sidebar-accent-foreground',\n className,\n )}\n >\n {children}\n </DropdownMenu.Item>\n );\n }\n\n const Component = asChild ? Root : 'button';\n\n return (\n <li className=\"tw:group/sidebar-menu-sub-item tw:relative\">\n <Component\n {...props}\n ref={ref}\n aria-current={ariaCurrent}\n data-slot=\"sidebar-menu-sub-button\"\n type=\"button\"\n disabled={disabled}\n className={cn(\n // layout\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-2',\n\n // sizing\n 'tw:h-7',\n 'tw:w-full',\n 'tw:min-w-0',\n 'tw:px-2',\n\n //font\n 'tw:text-sidebar-foreground',\n 'tw:text-sm',\n 'tw:font-normal',\n 'tw:text-start',\n 'tw:whitespace-nowrap',\n\n 'tw:overflow-hidden',\n 'tw:rounded-md',\n 'tw:no-underline',\n\n 'tw:select-none',\n 'tw:outline-hidden',\n\n // hover\n 'tw:hover:not-disabled:bg-sidebar-accent',\n 'tw:hover:text-sidebar-accent-foreground',\n 'tw:focus:text-sidebar-accent-foreground',\n\n // active\n 'tw:aria-selected:font-medium',\n 'tw:aria-selected:bg-sidebar-accent',\n 'tw:aria-[current=page]:bg-sidebar-accent',\n 'tw:aria-[current=page]:font-medium',\n\n // disabled\n 'tw:disabled:opacity-50',\n 'tw:disabled:cursor-not-allowed',\n\n // focus-visible\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-sidebar-ring/50',\n className,\n )}\n >\n <Slottable>{children}</Slottable>\n </Component>\n </li>\n );\n};\n","import { type MouseEventHandler, useCallback, useEffect, useRef } from 'react';\n\nimport { useSidebar } from './SidebarProvider';\nimport type { SidebarSide } from './types';\nimport { SidebarWidthInPx } from './utils';\n\nconst DEFAULT_MIN_WIDTH = 384;\nconst DEFAULT_MAX_WIDTH = 800;\n\ntype UseResizeSidebarInput = {\n side: SidebarSide;\n minWidth?: number;\n maxWidth?: number;\n};\n\nexport const useResizeSidebar = ({\n side,\n minWidth = DEFAULT_MIN_WIDTH,\n maxWidth = DEFAULT_MAX_WIDTH,\n}: UseResizeSidebarInput) => {\n const { onWidthChange, baseWidth, isFill, state, isDragging, setIsDragging, setDragWidth } =\n useSidebar(side);\n const isResizable = state === 'expanded' && !isFill && onWidthChange !== undefined;\n const startXRef = useRef(0);\n const startWidthRef = useRef(0);\n const cleanupRef = useRef<(() => void) | null>(null);\n\n useEffect(() => {\n return () => {\n cleanupRef.current?.();\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n };\n }, []);\n\n const clampToRange = useCallback(\n (width: number) => {\n const effectiveMax = Math.max(minWidth, Math.min(maxWidth, window.innerWidth * 0.5));\n return Math.round(Math.min(effectiveMax, Math.max(minWidth, width)));\n },\n [minWidth, maxWidth],\n );\n\n const handleMouseDown: MouseEventHandler = useCallback(\n (e) => {\n if (!isResizable || isDragging) return;\n\n cleanupRef.current?.();\n setIsDragging(true);\n\n startWidthRef.current = baseWidth ?? SidebarWidthInPx.MIN_DEFAULT;\n startXRef.current = e.clientX;\n\n const handleMouseMove = (moveEvent: MouseEvent) => {\n const delta =\n side === 'right'\n ? startXRef.current - moveEvent.clientX\n : moveEvent.clientX - startXRef.current;\n setDragWidth(clampToRange(startWidthRef.current + delta));\n };\n\n const handleMouseUp = (upEvent: MouseEvent) => {\n const delta =\n side === 'right'\n ? startXRef.current - upEvent.clientX\n : upEvent.clientX - startXRef.current;\n onWidthChange?.(clampToRange(startWidthRef.current + delta));\n setIsDragging(false);\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n cleanupRef.current = null;\n };\n\n document.body.style.cursor = 'col-resize';\n document.body.style.userSelect = 'none';\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n\n cleanupRef.current = () => {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n setIsDragging(false);\n setDragWidth(null);\n };\n },\n [\n isResizable,\n isDragging,\n side,\n onWidthChange,\n baseWidth,\n setIsDragging,\n setDragWidth,\n clampToRange,\n ],\n );\n\n const handleDoubleClick = useCallback(() => {\n onWidthChange?.(minWidth);\n }, [onWidthChange, minWidth]);\n\n return {\n handleProps: {\n onMouseDown: handleMouseDown,\n onDoubleClick: handleDoubleClick,\n },\n isDragging,\n isResizable,\n };\n};\n","import { cn } from '../../utils';\n\nimport type { SidebarSide } from './types';\nimport { useResizeSidebar } from './useResizeSidebar';\n\ntype Props = {\n side: SidebarSide;\n minWidth?: number;\n maxWidth?: number;\n};\n\nexport const SidebarResizeHandle = ({ side, minWidth, maxWidth }: Props) => {\n const { handleProps, isResizable } = useResizeSidebar({ side, minWidth, maxWidth });\n\n if (!isResizable) return null;\n\n return (\n <div\n {...handleProps}\n aria-hidden\n className={cn(\n 'tw:absolute tw:inset-y-0 tw:z-10 tw:w-3',\n side === 'right' ? 'tw:left-0' : 'tw:right-0',\n 'tw:cursor-col-resize',\n )}\n />\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { Separator } from '../Separator';\n\ntype Props = Omit<ComponentProps<typeof Separator>, 'orientation' | 'size'>;\n\nexport const SidebarSeparator = ({ className, ...props }: Props) => (\n <Separator\n {...props}\n orientation=\"horizontal\"\n size=\"full\"\n className={cn('tw:before:bg-sidebar-border tw:p-2', className)}\n />\n);\n","import type { ComponentProps, MouseEventHandler } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\n\nimport { useSidebar } from './SidebarProvider';\nimport type { SidebarSide } from './types';\n\ntype Props = ComponentProps<typeof Slot> & {\n side?: SidebarSide;\n hideWhenCollapsed?: boolean;\n};\n\nexport const SidebarTrigger = ({\n side = 'left',\n onClick,\n hideWhenCollapsed = false,\n className,\n ...rest\n}: Props) => {\n const { toggle } = useSidebar(side);\n\n const handleOnClick: MouseEventHandler<HTMLElement> = (event) => {\n toggle();\n onClick?.(event);\n };\n\n return (\n <Slot\n {...rest}\n onClick={handleOnClick}\n className={cn(\n {\n 'tw:group-data-[state=collapsed]/sidebar:hidden': hideWhenCollapsed,\n },\n className,\n )}\n />\n );\n};\n","import { useMemo } from 'react';\nimport type { ComponentProps, CSSProperties, ReactNode, TransitionEventHandler } from 'react';\n\nimport { cn } from '../../utils';\nimport { TooltipProvider } from '../Tooltip';\n\nimport { useTransitionPresence } from './SidebarProvider/useTransitionPresence';\nimport { SidebarContent } from './SidebarContent';\nimport { SidebarFillTrigger } from './SidebarFillTrigger';\nimport { SidebarFooter } from './SidebarFooter';\nimport {\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n} from './SidebarGroup';\nimport { SidebarHeader } from './SidebarHeader';\nimport { SidebarInstanceContext } from './SidebarInstanceContext';\nimport {\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuCard,\n SidebarMenuIcon,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubItem,\n SidebarSearchInput,\n} from './SidebarMenu';\nimport { useSidebar } from './SidebarProvider';\nimport { SidebarResizeHandle } from './SidebarResizeHandle';\nimport { SidebarSeparator } from './SidebarSeparator';\nimport { SidebarTrigger } from './SidebarTrigger';\nimport type { SidebarSide } from './types';\nimport { SidebarWidthInPx } from './utils';\n\n/**\n * `className` and `style` land on the inner wrapper (the rail's own box); everything else\n * (`data-*`, `aria-*`, handlers) lands on the outer element, so a `ThemeScope` around the\n * sidebar reaches it.\n */\ntype Props = Omit<ComponentProps<'div'>, 'children' | 'className' | 'style' | 'id'> & {\n children: ReactNode;\n className?: string;\n id?: string;\n side?: SidebarSide;\n style?: CSSProperties;\n container?: boolean;\n keepMounted?: boolean;\n /** Hold the panel's content back until it has finished sliding in. */\n mountAfterEnter?: boolean;\n resizable?: boolean;\n};\n\nexport const Sidebar = ({\n children,\n className,\n id,\n side = 'left',\n style,\n container = false,\n keepMounted,\n mountAfterEnter,\n resizable = false,\n ...rest\n}: Props) => {\n const oppositeSide = side === 'left' ? 'right' : 'left';\n const { setSidebarElement, state, mode, isFill, widths, collapsible, variant, isDragging } =\n useSidebar(side);\n\n const { isMounted, completeUnmount } = useTransitionPresence({\n mounted: collapsible !== 'off-canvas' || mode !== 'collapsed',\n keepMounted,\n mountAfterEnter,\n });\n const { widths: oppositeWidths } = useSidebar(oppositeSide);\n const sidebarInstanceContextValue = useMemo(() => ({ state, mode, side }), [state, mode, side]);\n\n const handleTransitionEnd: TransitionEventHandler<HTMLDivElement> = (event) => {\n // Ignore bubbled transitions from child elements\n if (event.target !== event.currentTarget) return;\n completeUnmount();\n };\n\n const styles = {\n // The caller's vars ride on this element too (a `ThemeScope`'s tokens must reach the\n // gap and the wrapper alike); the sidebar's own geometry vars are listed after, so they win here.\n ...style,\n '--sidebar-floating-padding': `${SidebarWidthInPx.FLOATING_VARIANT_PADDING}px`,\n '--sidebar-width': `${widths.sidebar}px`,\n '--sidebar-width-gap': `${widths.gap}px`,\n '--opposite-sidebar-width': `${oppositeWidths.fill}px`,\n } as CSSProperties;\n\n if (variant === 'none') return null;\n\n return (\n <TooltipProvider>\n <SidebarInstanceContext value={sidebarInstanceContextValue}>\n <div\n {...rest}\n id={id}\n ref={setSidebarElement}\n data-state={state}\n data-side={side}\n data-mode={mode}\n data-collapsible={collapsible}\n data-variant={variant}\n data-fill={isFill}\n style={styles}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:flex',\n 'tw:relative',\n // expand-on-hover needs a higher z-index so the expanding sidebar\n // overlaps the opposite filled sidebar instead of sliding behind it\n mode === 'expand-on-hover' ? 'tw:z-[51]' : 'tw:z-50',\n {\n // group/peer scoping is only for page-level sidebars — container\n // sidebars are nested inside other components and must not leak\n // group/peer selectors to avoid clashing with the outer sidebar\n 'tw:group/sidebar tw:peer/sidebar': !container,\n },\n\n // ── GAP DIV ──\n 'tw:[&>[data-slot=gap]]:w-(--sidebar-width-gap)',\n 'tw:[&[data-side=right]>[data-slot=gap]]:rotate-180',\n\n // ── SIDEBAR-WRAPPER DIV ──\n 'tw:[&>[data-slot=sidebar-wrapper]]:w-(--sidebar-width)',\n 'tw:[&[data-side=left]>[data-slot=sidebar-wrapper]]:left-0',\n 'tw:[&[data-side=right]>[data-slot=sidebar-wrapper]]:right-0',\n // Off-canvas hiding.\n // - `translate-x-*` sets the standalone `translate` property, not `transform`.\n // - The wrapper's transition list must therefore name `translate`, or the rail\n // teleports instead of sliding.\n 'tw:[&[data-state=collapsed][data-collapsible=off-canvas][data-side=left]>[data-slot=sidebar-wrapper]]:-translate-x-full',\n 'tw:[&[data-state=collapsed][data-collapsible=off-canvas][data-side=right]>[data-slot=sidebar-wrapper]]:translate-x-full',\n\n // floating variants styles\n 'tw:[&[data-variant=sided-floating]>[data-slot=sidebar-wrapper]]:pt-(--sidebar-floating-padding)',\n 'tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]]:pr-(--sidebar-floating-padding)',\n 'tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]]:pl-(--sidebar-floating-padding)',\n\n 'tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]]:p-(--sidebar-floating-padding)',\n\n // fill state\n 'tw:[&[data-fill=true]>[data-slot=sidebar-wrapper]]:!w-[calc(100svw-var(--opposite-sidebar-width))]',\n 'tw:[&[data-fill=true][data-variant=floating]>[data-slot=sidebar-wrapper]]:!p-(--sidebar-floating-padding)',\n 'tw:[&[data-fill=true][data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:!rounded-tr-xl',\n 'tw:[&[data-fill=true][data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:!rounded-tl-xl',\n\n // ── SIDEBAR DIV (INNERMOST) ──\n 'tw:[&[data-variant=inset][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-r',\n 'tw:[&[data-variant=inset][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-l',\n 'tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:shadow',\n 'tw:[&[data-variant=floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-xl',\n 'tw:[&[data-variant=sided-floating]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:shadow',\n 'tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-tr-xl',\n 'tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:rounded-tl-xl',\n // The rail's inner edge, mirroring `inset`. The shadow above cannot carry\n // this alone: a shadow needs a lighter ground to fall on, and on the dark\n // scheme `--sidebar` is darker than `--background`, so the rail's edge\n // dissolves into the page beside it.\n 'tw:[&[data-variant=sided-floating][data-side=left]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-r',\n 'tw:[&[data-variant=sided-floating][data-side=right]>[data-slot=sidebar-wrapper]>[data-slot=sidebar]]:border-l',\n\n // Ease-out (linear reads as choppy). The page reflowing beside the rail is layout every frame;\n // `motion-reduce` is the lever for weak machines.\n isDragging\n ? 'tw:transition-none'\n : 'tw:transition-[width,translate,transform] tw:duration-(--sidebar-motion-duration) tw:ease-(--sidebar-motion-easing) tw:motion-reduce:transition-none',\n )}\n >\n <div\n data-slot=\"gap\"\n className={cn(\n 'tw:bg-transparent',\n isDragging\n ? ''\n : 'tw:transition-[width] tw:duration-(--sidebar-motion-duration) tw:ease-(--sidebar-motion-easing) tw:motion-reduce:transition-none',\n )}\n />\n\n <div\n data-slot=\"sidebar-wrapper\"\n onTransitionEnd={handleTransitionEnd}\n className={cn(\n 'tw:fixed',\n 'tw:inset-y-0',\n 'tw:border-border',\n\n // transition\n isDragging\n ? 'tw:transition-none'\n : 'tw:transition-[width,translate,transform] tw:duration-(--sidebar-motion-duration) tw:ease-(--sidebar-motion-easing) tw:motion-reduce:transition-none',\n // Composite the slide.\n 'tw:transform-gpu',\n className,\n )}\n style={style}\n >\n {resizable && <SidebarResizeHandle side={side} />}\n <div\n data-slot=\"sidebar\"\n className={cn(\n 'tw:bg-sidebar',\n 'tw:overflow-hidden',\n 'tw:relative',\n 'tw:flex',\n 'tw:flex-col',\n 'tw:size-full',\n 'tw:border-sidebar-border',\n 'tw:group-[]/sidebar:pt-2',\n )}\n >\n {isMounted ? children : null}\n </div>\n </div>\n </div>\n </SidebarInstanceContext>\n </TooltipProvider>\n );\n};\n\n// main layout\nSidebar.Header = SidebarHeader;\nSidebar.Content = SidebarContent;\nSidebar.Footer = SidebarFooter;\nSidebar.Trigger = SidebarTrigger;\nSidebar.FillTrigger = SidebarFillTrigger;\nSidebar.Separator = SidebarSeparator;\nSidebar.MenuIcon = SidebarMenuIcon;\n\n// group features\nSidebar.Group = SidebarGroup;\nSidebar.GroupLabel = SidebarGroupLabel;\nSidebar.GroupContent = SidebarGroupContent;\nSidebar.GroupAction = SidebarGroupAction;\n\n// menu features\nSidebar.Menu = SidebarMenu;\nSidebar.MenuItem = SidebarMenuItem;\nSidebar.MenuButton = SidebarMenuButton;\nSidebar.MenuAction = SidebarMenuAction;\nSidebar.SearchInput = SidebarSearchInput;\nSidebar.MenuCard = SidebarMenuCard;\nSidebar.MenuBadge = SidebarMenuBadge;\n\n// sub-menu features\nSidebar.SubMenu = SidebarMenuSub;\nSidebar.SubItem = SidebarMenuSubItem;\n"],"mappings":";;;;;;;;;;;;;;;;AAYA,MAAM,sBAAsB;;AAG5B,MAAM,6BACJ,OAAO,WAAW,gBACjB,OAAO,aAAa,kCAAkC,CAAC,CAAC,WAAW;AAEtE,MAAM,WAAW,OAAmB,UAAkC;CACpE,QAAQ,OAAR;EACE,KAAK,SACH,OAAO;EACT,KAAK,SAEH,OAAO,UAAU,cAAc,mBAAmB;EACpD,KAAK;GAEH,IAAI,UAAU,kBAAkB,OAAO;GACvC,OAAO,UAAU,YAAY,qBAAqB;EACpD,KAAK;GACH,IAAI,UAAU,oBAAoB,OAAO;GACzC,I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/TextInput/utils.ts","../src/blocks/TextInput/TextInput.tsx"],"sourcesContent":["import { createPrefixedString } from '../../utils';\n\nexport const genInputTestId = (prefix: string = '') => {\n const ps = createPrefixedString(prefix);\n return {\n toString: () => prefix,\n inputWrapper: ps`input-wrapper`,\n input: ps`input`,\n clearButton: ps`clear-button`,\n };\n};\n","import { useRef } from 'react';\nimport type {\n ChangeEventHandler,\n ComponentProps,\n ComponentRef,\n FocusEventHandler,\n MouseEventHandler,\n ReactNode,\n} from 'react';\n\nimport { InputGroup } from '../../components/InputGroup';\nimport { useControllableState } from '../../hooks/useControllableState';\nimport { X } from '../../icons';\nimport { cn, createChangeInputEvent, mergeRefs } from '../../utils';\n\nimport { genInputTestId } from './utils';\n\ntype InputGroupProps = Pick<\n ComponentProps<typeof InputGroup>,\n 'variant' | 'focusVariant' | 'sizing' | 'state'\n>;\n\ntype OwnProps = {\n prefix?: ReactNode;\n rightSuffix?: ReactNode;\n rightSuffixVariant?: 'addon' | 'default';\n leftSuffix?: ReactNode;\n allowClear?: boolean;\n onClear?: () => void;\n testId?: string;\n value?: string | null;\n defaultValue?: string | null;\n /** Called with the unwrapped string value on every change. For the raw event use `onChange`. */\n onValueChange?: (value: string) => void;\n /** Called with the unwrapped string value on blur. For the raw event use `onBlur`. */\n onValueBlur?: (value: string) => void;\n type?: 'text' | 'email' | 'password' | 'datetime-local' | 'date';\n};\n\n/**\n * Props for `TextInput`. Combines `InputGroup` chrome (variant / sizing / state / focusVariant) with\n * input-specific slots (`prefix`, `leftSuffix`, `rightSuffix`, `allowClear`) and a string-typed\n * `value` / `defaultValue` plus convenience `onValueChange` / `onValueBlur` callbacks. `null` /\n * `undefined` are coerced to empty strings.\n */\nexport type Props = InputGroupProps &\n OwnProps &\n Omit<ComponentProps<'input'>, 'prefix' | 'value' | 'defaultValue' | 'type' | 'accept' | 'step'>;\n\nconst sanitizeTextInputValue = (value: string | null | undefined) => {\n if (typeof value === 'string' && value.trim() === '') return '';\n return value;\n};\n\n/**\n * Standard text input with a string-only API, built on `InputGroup` chrome — addons, clear button,\n * sizing, focus variants. The default choice for a bare text input.\n *\n * **When to use:** any plain text / email / password / date-input field outside `useAppForm`. Pair with\n * `onValueChange` instead of unwrapping `event.target.value` from `onChange`.\n * **When NOT to use:** for fields inside a labelled group use `FormGroup.TextInput`; for forms with\n * validation use `useAppForm` + `field.TextField`; for search use `SearchInput`.\n * **Composition:** wrap in a `FormGroup` for shared error / help-text state, or render directly inside\n * page layouts. Chrome resolves from the active brand automatically: a modern brand always renders argo\n * (any `variant` is ignored), while `variant` only tunes the legacy-brand chrome.\n */\nexport const TextInput = ({\n ref: forwardedRef,\n state = 'default',\n sizing = 'default',\n className,\n prefix = null,\n rightSuffix = null,\n rightSuffixVariant = 'default',\n leftSuffix = null,\n allowClear = false,\n onClear,\n disabled = false,\n testId: prefixTestId = '',\n autoFocus = false,\n id,\n name,\n variant,\n readOnly,\n type = 'text',\n focusVariant = 'default',\n onChange,\n onBlur,\n onValueChange,\n onValueBlur,\n value: valueProp,\n defaultValue,\n ...inputProps\n}: Props) => {\n const inputRef = useRef<ComponentRef<'input'>>(null);\n\n const [value, setValue] = useControllableState<string>({\n // `undefined` stays uncontrolled; any provided value (incl. `null`) is controlled and coerced\n // to a string. Whitespace-only input collapses to '' via `sanitizeTextInputValue`.\n prop: valueProp === undefined ? undefined : (sanitizeTextInputValue(valueProp) ?? ''),\n defaultProp: sanitizeTextInputValue(defaultValue) ?? '',\n onChange: onValueChange,\n });\n\n const testId = genInputTestId(prefixTestId);\n const isClearButtonVisible = (!!value && !disabled && !readOnly) || !!onClear;\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n setValue(event.target.value);\n onChange?.(event);\n };\n\n const handleBlur: FocusEventHandler<HTMLInputElement> = (event) => {\n onValueBlur?.(event.target.value);\n onBlur?.(event);\n };\n\n const handleClear: MouseEventHandler<HTMLButtonElement> = () => {\n if (inputRef.current === null) return;\n inputRef.current.value = ''; // keep the DOM node in sync before firing the synthetic change\n inputRef.current.focus();\n onClear?.();\n handleChange(createChangeInputEvent(inputRef.current));\n };\n\n return (\n <InputGroup\n state={state}\n variant={variant}\n sizing={sizing}\n focusVariant={focusVariant}\n className={className}\n data-testid={testId.inputWrapper}\n >\n {prefix && <InputGroup.Addon align=\"inline-start\">{prefix}</InputGroup.Addon>}\n\n <InputGroup.Input\n {...inputProps}\n value={value}\n autoFocus={autoFocus}\n type={type}\n onChange={handleChange}\n onBlur={handleBlur}\n ref={mergeRefs(forwardedRef ?? null, inputRef)}\n disabled={disabled}\n id={id}\n name={name}\n readOnly={readOnly}\n data-testid={testId.input}\n />\n\n {(leftSuffix || allowClear || rightSuffix) && (\n <InputGroup.Addon align=\"inline-end\">\n {leftSuffix}\n {allowClear && isClearButtonVisible && (\n <InputGroup.Button\n aria-label=\"Clear\"\n onMouseDown={(e) => e.preventDefault()}\n onClick={handleClear}\n data-testid={testId.clearButton}\n >\n <X className=\"tw:size-4\" />\n </InputGroup.Button>\n )}\n {rightSuffix && (\n <div\n className={cn({\n 'tw:whitespace-nowrap tw:bg-muted tw:px-4 tw:-mr-4 tw:py-2.5':\n rightSuffixVariant === 'addon',\n })}\n >\n {rightSuffix}\n </div>\n )}\n </InputGroup.Addon>\n )}\n </InputGroup>\n );\n};\n"],"mappings":";;;;;;;;;AAEA,MAAa,kBAAkB,SAAiB,OAAO;CACrD,MAAM,KAAK,qBAAqB,MAAM;CACtC,OAAO;EACL,gBAAgB;EAChB,cAAc,EAAE;EAChB,OAAO,EAAE;EACT,aAAa,EAAE;CACjB;AACF;;;ACuCA,MAAM,0BAA0B,UAAqC;CACnE,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,IAAI,OAAO;CAC7D,OAAO;AACT;;;;;;;;;;;;;AAcA,MAAa,aAAa,EACxB,KAAK,cACL,QAAQ,WACR,SAAS,WACT,WACA,SAAS,MACT,cAAc,MACd,qBAAqB,WACrB,aAAa,MACb,aAAa,OACb,SACA,WAAW,OACX,QAAQ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