@keboola/design 11.0.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +16 -1
- package/CHANGELOG.md +2138 -0
- package/COMPONENT-API.md +40 -1
- package/dist/AIKit-DiS0CVOW.js +1320 -0
- package/dist/AIKit-DiS0CVOW.js.map +1 -0
- package/dist/Alert-DfZq9kGe.js +133 -0
- package/dist/Alert-DfZq9kGe.js.map +1 -0
- package/dist/AlertModal-Dp_XuJBW.js +219 -0
- package/dist/AlertModal-Dp_XuJBW.js.map +1 -0
- package/dist/AppShell-B5GQN6Zs.js +143 -0
- package/dist/AppShell-B5GQN6Zs.js.map +1 -0
- package/dist/AutoSaveTextarea-BeuWuszr.js +58 -0
- package/dist/{chunk-UGT6DKWM.js.map → AutoSaveTextarea-BeuWuszr.js.map} +1 -1
- package/dist/Badge-Ch26CXoP.js +195 -0
- package/dist/Badge-Ch26CXoP.js.map +1 -0
- package/dist/BrandEditor-DyzgfVkl.js +903 -0
- package/dist/BrandEditor-DyzgfVkl.js.map +1 -0
- package/dist/BrandLogo-CJkRd0F8.js +46 -0
- package/dist/BrandLogo-CJkRd0F8.js.map +1 -0
- package/dist/Breadcrumb-Frst8MTA.js +330 -0
- package/dist/Breadcrumb-Frst8MTA.js.map +1 -0
- package/dist/Button-6xBX0nNl.js +391 -0
- package/dist/Button-6xBX0nNl.js.map +1 -0
- package/dist/Calendar-cG5NIJ4O.js +6768 -0
- package/dist/Calendar-cG5NIJ4O.js.map +1 -0
- package/dist/Card-BAoZ35CV.js +105 -0
- package/dist/Card-BAoZ35CV.js.map +1 -0
- package/dist/Checkbox-GJ8-srt4.js +97 -0
- package/dist/Checkbox-GJ8-srt4.js.map +1 -0
- package/dist/Clipboard-CBJZiviP.js +58 -0
- package/dist/Clipboard-CBJZiviP.js.map +1 -0
- package/dist/ClipboardButton-ClcluT0C.js +43 -0
- package/dist/ClipboardButton-ClcluT0C.js.map +1 -0
- package/dist/CodeEditor-DyaN-Ij2.js +1000 -0
- package/dist/CodeEditor-DyaN-Ij2.js.map +1 -0
- package/dist/Collapsible-BQXWEOBC.js +34 -0
- package/dist/Collapsible-BQXWEOBC.js.map +1 -0
- package/dist/ColorInput-B8z4j4Y_.js +180 -0
- package/dist/ColorInput-B8z4j4Y_.js.map +1 -0
- package/dist/ColorModeSwitch-dZFZyqy1.js +77 -0
- package/dist/ColorModeSwitch-dZFZyqy1.js.map +1 -0
- package/dist/Combobox-Dgm6Z4ib.js +443 -0
- package/dist/Combobox-Dgm6Z4ib.js.map +1 -0
- package/dist/Command-C0aZfVTq.js +102 -0
- package/dist/Command-C0aZfVTq.js.map +1 -0
- package/dist/CopyField-BJ96zvXs.js +322 -0
- package/dist/CopyField-BJ96zvXs.js.map +1 -0
- package/dist/DateInput-B3UdzRfW.js +141 -0
- package/dist/DateInput-B3UdzRfW.js.map +1 -0
- package/dist/DatePicker-Dw3DpbUh.js +24 -0
- package/dist/DatePicker-Dw3DpbUh.js.map +1 -0
- package/dist/DateRangeInput-DTuySEiq.js +139 -0
- package/dist/DateRangeInput-DTuySEiq.js.map +1 -0
- package/dist/DateRangePicker-DCmMHg4s.js +159 -0
- package/dist/DateRangePicker-DCmMHg4s.js.map +1 -0
- package/dist/DiagramSkeleton-lwBS2YBa.js +11 -0
- package/dist/DiagramSkeleton-lwBS2YBa.js.map +1 -0
- package/dist/DiffView-ppTIzh2h.js +429 -0
- package/dist/DiffView-ppTIzh2h.js.map +1 -0
- package/dist/DropdownMenu-t90tVw6l.js +327 -0
- package/dist/DropdownMenu-t90tVw6l.js.map +1 -0
- package/dist/FieldBox-D7DYtX_m.js +70 -0
- package/dist/FieldBox-D7DYtX_m.js.map +1 -0
- package/dist/FieldItem-CAPj9lj3.d.ts +111 -0
- package/dist/FieldItem-D-h1NeBo.js +108 -0
- package/dist/FieldItem-D-h1NeBo.js.map +1 -0
- package/dist/FileUpload-BRv0TaZk.js +2527 -0
- package/dist/FileUpload-BRv0TaZk.js.map +1 -0
- package/dist/Form-DHvcFoEi.js +311 -0
- package/dist/Form-DHvcFoEi.js.map +1 -0
- package/dist/FormGroup-C41n65cE.js +124 -0
- package/dist/FormGroup-C41n65cE.js.map +1 -0
- package/dist/FullScreenModal-Cb3PGgh4.js +96 -0
- package/dist/FullScreenModal-Cb3PGgh4.js.map +1 -0
- package/dist/HoverCard-WfDkLK1s.js +31 -0
- package/dist/HoverCard-WfDkLK1s.js.map +1 -0
- package/dist/InputGroup-CdTq8H7c.js +292 -0
- package/dist/InputGroup-CdTq8H7c.js.map +1 -0
- package/dist/Kbd-CxHAo1oo.js +111 -0
- package/dist/Kbd-CxHAo1oo.js.map +1 -0
- package/dist/MarkedText-Ckbft5mw.js +44 -0
- package/dist/MarkedText-Ckbft5mw.js.map +1 -0
- package/dist/MermaidDiagram-ChL3WIQT.js +399 -0
- package/dist/MermaidDiagram-ChL3WIQT.js.map +1 -0
- package/dist/Modal-wqG8nJiK.js +185 -0
- package/dist/Modal-wqG8nJiK.js.map +1 -0
- package/dist/ModalTitle-C76ke2eo.js +28 -0
- package/dist/ModalTitle-C76ke2eo.js.map +1 -0
- package/dist/MultiActionButtonGroup-BiIIubiL.js +33 -0
- package/dist/MultiActionButtonGroup-BiIIubiL.js.map +1 -0
- package/dist/Navbar-BfaPeLUL.js +325 -0
- package/dist/Navbar-BfaPeLUL.js.map +1 -0
- package/dist/OtpInput-CbbymqYs.js +93 -0
- package/dist/OtpInput-CbbymqYs.js.map +1 -0
- package/dist/PageHeader-Q3IpCnQd.js +177 -0
- package/dist/PageHeader-Q3IpCnQd.js.map +1 -0
- package/dist/PageLayout-DSVM-ASz.js +176 -0
- package/dist/PageLayout-DSVM-ASz.js.map +1 -0
- package/dist/PageToolbar-OQg3mPF-.js +153 -0
- package/dist/PageToolbar-OQg3mPF-.js.map +1 -0
- package/dist/Pagination-Cjfda8KG.js +70 -0
- package/dist/Pagination-Cjfda8KG.js.map +1 -0
- package/dist/Popconfirm-D7_vfxFd.js +167 -0
- package/dist/Popconfirm-D7_vfxFd.js.map +1 -0
- package/dist/Popover-CzeHjvrB.js +85 -0
- package/dist/Popover-CzeHjvrB.js.map +1 -0
- package/dist/RadioGroup-sIveSsNa.js +233 -0
- package/dist/RadioGroup-sIveSsNa.js.map +1 -0
- package/dist/Resizable-D3vYToZH.js +52 -0
- package/dist/Resizable-D3vYToZH.js.map +1 -0
- package/dist/Search-3UiqNZRj.js +184 -0
- package/dist/Search-3UiqNZRj.js.map +1 -0
- package/dist/SearchInput-C7dF_Ir-.js +102 -0
- package/dist/SearchInput-C7dF_Ir-.js.map +1 -0
- package/dist/SectionNav-8NoTOKO8.js +276 -0
- package/dist/SectionNav-8NoTOKO8.js.map +1 -0
- package/dist/Select-Is0VkePH.js +181 -0
- package/dist/Select-Is0VkePH.js.map +1 -0
- package/dist/Sheet-Dw9BDvjI.js +169 -0
- package/dist/Sheet-Dw9BDvjI.js.map +1 -0
- package/dist/Sidebar-Dcb4rinA.js +799 -0
- package/dist/Sidebar-Dcb4rinA.js.map +1 -0
- package/dist/Slider-BOPfMOMm.js +127 -0
- package/dist/Slider-BOPfMOMm.js.map +1 -0
- package/dist/Stepper-C8sm9ZFM.js +325 -0
- package/dist/Stepper-C8sm9ZFM.js.map +1 -0
- package/dist/Switch-CX2A0v50.js +201 -0
- package/dist/Switch-CX2A0v50.js.map +1 -0
- package/dist/Table-CvYuTuNU.js +104 -0
- package/dist/Table-CvYuTuNU.js.map +1 -0
- package/dist/Tabs-UMQuDoW8.js +74 -0
- package/dist/Tabs-UMQuDoW8.js.map +1 -0
- package/dist/TextInput-CMuN1WfY.js +110 -0
- package/dist/TextInput-CMuN1WfY.js.map +1 -0
- package/dist/ThemeProvider-QncUrfJn.js +203 -0
- package/dist/ThemeProvider-QncUrfJn.js.map +1 -0
- package/dist/TimePicker-D9zktB8A.js +98 -0
- package/dist/TimePicker-D9zktB8A.js.map +1 -0
- package/dist/Timeline-6btyJl4D.js +154 -0
- package/dist/Timeline-6btyJl4D.js.map +1 -0
- package/dist/Toast-DQSbs3oA.js +49 -0
- package/dist/Toast-DQSbs3oA.js.map +1 -0
- package/dist/ToggleGroup-Cy_10Mvu.js +47 -0
- package/dist/ToggleGroup-Cy_10Mvu.js.map +1 -0
- package/dist/Workbench-BzE-Vvd9.js +293 -0
- package/dist/Workbench-BzE-Vvd9.js.map +1 -0
- package/dist/ZoomableSvg-CZEu6sAq.js +248 -0
- package/dist/ZoomableSvg-CZEu6sAq.js.map +1 -0
- package/dist/charts.d.ts +110 -103
- package/dist/charts.js +303 -254
- package/dist/charts.js.map +1 -1
- package/dist/classNames-BzrkDnOD.js +9 -0
- package/dist/classNames-BzrkDnOD.js.map +1 -0
- package/dist/context-KxxeMHbR.js +62 -0
- package/dist/context-KxxeMHbR.js.map +1 -0
- package/dist/editors.d.ts +244 -175
- package/dist/editors.js +802 -428
- package/dist/editors.js.map +1 -1
- package/dist/escapeStringRegexp-8MxP2knR.js +6 -0
- package/dist/escapeStringRegexp-8MxP2knR.js.map +1 -0
- package/dist/icons-Cek151jC.js +640 -0
- package/dist/icons-Cek151jC.js.map +1 -0
- package/dist/icons.d.ts +2 -41
- package/dist/icons.js +2 -9
- package/dist/index-m-kQEWiY.d.ts +54 -0
- package/dist/index.d.ts +6191 -9891
- package/dist/index.js +113 -124
- package/dist/internal/blocks/AIKit.js +2 -30
- package/dist/internal/blocks/AppShell.js +2 -11
- package/dist/internal/blocks/AutoSaveTextarea.js +2 -14
- package/dist/internal/blocks/BrandEditor.js +2 -23
- package/dist/internal/blocks/ChartPanel.js +45 -9
- package/dist/internal/blocks/ChartPanel.js.map +1 -1
- package/dist/internal/blocks/ClipboardButton.js +2 -12
- package/dist/internal/blocks/ColorInput.js +2 -13
- package/dist/internal/blocks/ColorModeSwitch.js +2 -13
- package/dist/internal/blocks/Command.js +2 -15
- package/dist/internal/blocks/CopyField.js +2 -11
- package/dist/internal/blocks/DashboardHero.js +58 -8
- package/dist/internal/blocks/DashboardHero.js.map +1 -1
- package/dist/internal/blocks/DateInput.js +2 -16
- package/dist/internal/blocks/DateRangeInput.js +2 -16
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +15 -9
- package/dist/internal/blocks/EmptyConfigurationActionCard.js.map +1 -1
- package/dist/internal/blocks/EmptyState.js +141 -3
- package/dist/internal/blocks/EmptyState.js.map +1 -1
- package/dist/internal/blocks/ErrorState.js +178 -4
- package/dist/internal/blocks/ErrorState.js.map +1 -1
- package/dist/internal/blocks/ExportMenu.js +40 -12
- package/dist/internal/blocks/ExportMenu.js.map +1 -1
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +56 -0
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js.map +1 -0
- package/dist/internal/blocks/Form.js +2 -29
- package/dist/internal/blocks/FormGroup.js +2 -18
- package/dist/internal/blocks/GoogleButton.js +94 -9
- package/dist/internal/blocks/GoogleButton.js.map +1 -1
- package/dist/internal/blocks/MicrosoftButton.js +63 -9
- package/dist/internal/blocks/MicrosoftButton.js.map +1 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js +2 -12
- package/dist/internal/blocks/MultiCombobox.js +192 -13
- package/dist/internal/blocks/MultiCombobox.js.map +1 -1
- package/dist/internal/blocks/NumberInput.js +43 -11
- package/dist/internal/blocks/NumberInput.js.map +1 -1
- package/dist/internal/blocks/OtpInput.js +2 -10
- package/dist/internal/blocks/PageHeader.js +2 -9
- package/dist/internal/blocks/PageLayout.js +2 -9
- package/dist/internal/blocks/PageToolbar.js +2 -13
- package/dist/internal/blocks/PasswordInput.js +96 -12
- package/dist/internal/blocks/PasswordInput.js.map +1 -1
- package/dist/internal/blocks/SearchInput.js +2 -12
- package/dist/internal/blocks/SearchInputWithNavigation.js +64 -15
- package/dist/internal/blocks/SearchInputWithNavigation.js.map +1 -1
- package/dist/internal/blocks/SectionNav.js +2 -15
- package/dist/internal/blocks/SplitButton.js +45 -13
- package/dist/internal/blocks/SplitButton.js.map +1 -1
- package/dist/internal/blocks/StatCard.js +96 -9
- package/dist/internal/blocks/StatCard.js.map +1 -1
- package/dist/internal/blocks/TextInput.js +2 -13
- package/dist/internal/blocks/Textarea.js +31 -12
- package/dist/internal/blocks/Textarea.js.map +1 -1
- package/dist/internal/blocks/TimeInput.js +76 -16
- package/dist/internal/blocks/TimeInput.js.map +1 -1
- package/dist/internal/components/Alert.js +2 -11
- package/dist/internal/components/AlertModal.js +2 -11
- package/dist/internal/components/Avatar.js +52 -8
- package/dist/internal/components/Avatar.js.map +1 -1
- package/dist/internal/components/Badge.js +2 -9
- package/dist/internal/components/BrandLogo.js +2 -11
- package/dist/internal/components/Breadcrumb.js +2 -14
- package/dist/internal/components/Button.js +2 -10
- package/dist/internal/components/ButtonGroup.js +65 -8
- package/dist/internal/components/ButtonGroup.js.map +1 -1
- package/dist/internal/components/Calendar.js +2 -9
- package/dist/internal/components/Card.js +2 -9
- package/dist/internal/components/Checkbox.js +2 -11
- package/dist/internal/components/Clipboard.js +2 -9
- package/dist/internal/components/Collapsible.js +2 -9
- package/dist/internal/components/CollapsiblePanel.js +86 -10
- package/dist/internal/components/CollapsiblePanel.js.map +1 -1
- package/dist/internal/components/Combobox.js +2 -13
- package/dist/internal/components/DatePicker.js +2 -11
- package/dist/internal/components/DateRangePicker.js +2 -17
- package/dist/internal/components/DiffView.js +2 -9
- package/dist/internal/components/DotsLoader.js +17 -4
- package/dist/internal/components/DotsLoader.js.map +1 -1
- package/dist/internal/components/DropdownMenu.js +2 -11
- package/dist/internal/components/EmptySearchContent.js +11 -3
- package/dist/internal/components/EmptySearchContent.js.map +1 -1
- package/dist/internal/components/FileUpload.js +2 -11
- package/dist/internal/components/FullScreenModal.js +2 -12
- package/dist/internal/components/HelpBlock.js +24 -3
- package/dist/internal/components/HelpBlock.js.map +1 -1
- package/dist/internal/components/HoverCard.js +2 -9
- package/dist/internal/components/InputGroup.js +2 -11
- package/dist/internal/components/Kbd.js +2 -9
- package/dist/internal/components/Label.js +38 -8
- package/dist/internal/components/Label.js.map +1 -1
- package/dist/internal/components/Link.js +21 -8
- package/dist/internal/components/Link.js.map +1 -1
- package/dist/internal/components/MarkedText.js +2 -5
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +19 -9
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js.map +1 -1
- package/dist/internal/components/MergeEditor/PaneHeader.js +12 -3
- package/dist/internal/components/MergeEditor/PaneHeader.js.map +1 -1
- package/dist/internal/components/MergeEditor/constants.js +17 -3
- package/dist/internal/components/MergeEditor/constants.js.map +1 -1
- package/dist/internal/components/MergeEditor/useMergeDiff.js +2 -5
- package/dist/internal/components/Modal.js +2 -13
- package/dist/internal/components/Navbar.js +2 -14
- package/dist/internal/components/Pagination.js +2 -11
- package/dist/internal/components/PanelWithDetails.js +30 -10
- package/dist/internal/components/PanelWithDetails.js.map +1 -1
- package/dist/internal/components/Popconfirm.js +2 -12
- package/dist/internal/components/Popover.js +2 -9
- package/dist/internal/components/Progress.js +46 -8
- package/dist/internal/components/Progress.js.map +1 -1
- package/dist/internal/components/RadioGroup.js +2 -12
- package/dist/internal/components/Resizable.js +2 -9
- package/dist/internal/components/ScrollArea.js +41 -8
- package/dist/internal/components/ScrollArea.js.map +1 -1
- package/dist/internal/components/Search.js +2 -10
- package/dist/internal/components/Select.js +2 -12
- package/dist/internal/components/Separator.js +83 -8
- package/dist/internal/components/Separator.js.map +1 -1
- package/dist/internal/components/Sheet.js +2 -12
- package/dist/internal/components/Sidebar.js +2 -20
- package/dist/internal/components/Skeleton/Skeleton.js +38 -8
- package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/internal/components/Skeleton/SkeletonList.js +40 -9
- package/dist/internal/components/Skeleton/SkeletonList.js.map +1 -1
- package/dist/internal/components/Slider.js +2 -11
- package/dist/internal/components/SpotlightBackdrop.js +131 -8
- package/dist/internal/components/SpotlightBackdrop.js.map +1 -1
- package/dist/internal/components/Stepper.js +2 -10
- package/dist/internal/components/Switch.js +2 -10
- package/dist/internal/components/Table.js +2 -10
- package/dist/internal/components/Tabs.js +2 -12
- package/dist/internal/components/ThemeProvider.js +3 -10
- package/dist/internal/components/TimePicker.js +2 -12
- package/dist/internal/components/Timeline.js +2 -10
- package/dist/internal/components/Toast.js +3 -11
- package/dist/internal/components/Toggle.js +168 -8
- package/dist/internal/components/Toggle.js.map +1 -1
- package/dist/internal/components/ToggleGroup.js +2 -9
- package/dist/internal/components/Tooltip.js +2 -8
- package/dist/internal/components/Truncated.js +44 -8
- package/dist/internal/components/Truncated.js.map +1 -1
- package/dist/internal/components/Workbench.js +2 -11
- package/dist/internal/components/ZoomableSvg.js +2 -13
- package/dist/internal/hooks/useAutosizeInput.js +76 -3
- package/dist/internal/hooks/useAutosizeInput.js.map +1 -1
- package/dist/internal/hooks/useScrollbarPosition.js +44 -4
- package/dist/internal/hooks/useScrollbarPosition.js.map +1 -1
- package/dist/internal/hooks/useStableCallback.js +28 -3
- package/dist/internal/hooks/useStableCallback.js.map +1 -1
- package/dist/internal/utils/mergeRefs.js +19 -3
- package/dist/internal/utils/mergeRefs.js.map +1 -1
- package/dist/internal/utils.js +5 -8
- package/dist/markdown-editor.d.ts +72 -72
- package/dist/markdown-editor.js +1122 -1207
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +12 -12
- package/dist/mermaid.js +2 -18
- package/dist/rjsf.d.ts +45 -34
- package/dist/rjsf.js +1601 -1671
- package/dist/rjsf.js.map +1 -1
- package/dist/rolldown-runtime-Bdc48AWt.js +33 -0
- package/dist/styles-DSUP_-9Z.js +158 -0
- package/dist/styles-DSUP_-9Z.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/testing.d.ts +8 -7
- package/dist/testing.js +36 -21
- package/dist/testing.js.map +1 -1
- package/dist/themeTokens-BNg98Mu9.js +85 -0
- package/dist/themeTokens-BNg98Mu9.js.map +1 -0
- package/dist/toast-CjkURw0M.js +184 -0
- package/dist/toast-CjkURw0M.js.map +1 -0
- package/dist/useColorSchemeState-CYqcUfSH.js +61 -0
- package/dist/useColorSchemeState-CYqcUfSH.js.map +1 -0
- package/dist/useControllableState-M6494mCT.js +31 -0
- package/dist/useControllableState-M6494mCT.js.map +1 -0
- package/dist/useElement-DkF6esWL.js +15 -0
- package/dist/useElement-DkF6esWL.js.map +1 -0
- package/dist/useMergeDiff-CvowEXJ1.js +465 -0
- package/dist/useMergeDiff-CvowEXJ1.js.map +1 -0
- package/dist/utils-D0c5VAyF.js +308 -0
- package/dist/utils-D0c5VAyF.js.map +1 -0
- package/package.json +11 -10
- package/dist/MermaidDiagram-ZU5KAVRT.js +0 -18
- package/dist/MermaidDiagram-ZU5KAVRT.js.map +0 -1
- package/dist/chunk-2YYJDKSP.js +0 -51
- package/dist/chunk-2YYJDKSP.js.map +0 -1
- package/dist/chunk-3P5UUCFI.js +0 -385
- package/dist/chunk-3P5UUCFI.js.map +0 -1
- package/dist/chunk-3QDFDDWZ.js +0 -99
- package/dist/chunk-3QDFDDWZ.js.map +0 -1
- package/dist/chunk-3W27OLK5.js +0 -15
- package/dist/chunk-3W27OLK5.js.map +0 -1
- package/dist/chunk-4FIZZONW.js +0 -40
- package/dist/chunk-4FIZZONW.js.map +0 -1
- package/dist/chunk-4GIAXOJG.js +0 -133
- package/dist/chunk-4GIAXOJG.js.map +0 -1
- package/dist/chunk-52NDNMK7.js +0 -99
- package/dist/chunk-52NDNMK7.js.map +0 -1
- package/dist/chunk-576G5OES.js +0 -201
- package/dist/chunk-576G5OES.js.map +0 -1
- package/dist/chunk-5AIE6SET.js +0 -659
- package/dist/chunk-5AIE6SET.js.map +0 -1
- package/dist/chunk-5FTNAZRW.js +0 -327
- package/dist/chunk-5FTNAZRW.js.map +0 -1
- package/dist/chunk-5IG2S7ZY.js +0 -70
- package/dist/chunk-5IG2S7ZY.js.map +0 -1
- package/dist/chunk-5QCXHNCW.js +0 -404
- package/dist/chunk-5QCXHNCW.js.map +0 -1
- package/dist/chunk-6DUMGC7Y.js +0 -105
- package/dist/chunk-6DUMGC7Y.js.map +0 -1
- package/dist/chunk-6J25CVST.js +0 -174
- package/dist/chunk-6J25CVST.js.map +0 -1
- package/dist/chunk-6NN35XOP.js +0 -120
- package/dist/chunk-6NN35XOP.js.map +0 -1
- package/dist/chunk-6NZBVA4T.js +0 -24
- package/dist/chunk-6NZBVA4T.js.map +0 -1
- package/dist/chunk-6W5BHRCL.js +0 -295
- package/dist/chunk-6W5BHRCL.js.map +0 -1
- package/dist/chunk-72BKRCEG.js +0 -409
- package/dist/chunk-72BKRCEG.js.map +0 -1
- package/dist/chunk-7GTI3PPI.js +0 -95
- package/dist/chunk-7GTI3PPI.js.map +0 -1
- package/dist/chunk-7P6PLZ4B.js +0 -74
- package/dist/chunk-7P6PLZ4B.js.map +0 -1
- package/dist/chunk-7WZWY5IA.js +0 -46
- package/dist/chunk-7WZWY5IA.js.map +0 -1
- package/dist/chunk-AIYO2632.js +0 -489
- package/dist/chunk-AIYO2632.js.map +0 -1
- package/dist/chunk-ANFZWPNE.js +0 -112
- package/dist/chunk-ANFZWPNE.js.map +0 -1
- package/dist/chunk-ANZTVAJU.js +0 -73
- package/dist/chunk-ANZTVAJU.js.map +0 -1
- package/dist/chunk-BD5BTJKX.js +0 -166
- package/dist/chunk-BD5BTJKX.js.map +0 -1
- package/dist/chunk-BHGIDSRJ.js +0 -140
- package/dist/chunk-BHGIDSRJ.js.map +0 -1
- package/dist/chunk-BSQWZITZ.js +0 -507
- package/dist/chunk-BSQWZITZ.js.map +0 -1
- package/dist/chunk-D3LAIK62.js +0 -23
- package/dist/chunk-D3LAIK62.js.map +0 -1
- package/dist/chunk-DODCR43C.js +0 -155
- package/dist/chunk-DODCR43C.js.map +0 -1
- package/dist/chunk-EEK5NGZF.js +0 -40
- package/dist/chunk-EEK5NGZF.js.map +0 -1
- package/dist/chunk-ENRG7TXA.js +0 -11
- package/dist/chunk-ENRG7TXA.js.map +0 -1
- package/dist/chunk-EQRMGIGY.js +0 -239
- package/dist/chunk-EQRMGIGY.js.map +0 -1
- package/dist/chunk-ERAHK5YQ.js +0 -495
- package/dist/chunk-ERAHK5YQ.js.map +0 -1
- package/dist/chunk-F3FOFY2P.js +0 -124
- package/dist/chunk-F3FOFY2P.js.map +0 -1
- package/dist/chunk-F6BTWFOC.js +0 -507
- package/dist/chunk-F6BTWFOC.js.map +0 -1
- package/dist/chunk-F6J6NNAL.js +0 -34
- package/dist/chunk-F6J6NNAL.js.map +0 -1
- package/dist/chunk-FCHJ7D5O.js +0 -59
- package/dist/chunk-FCHJ7D5O.js.map +0 -1
- package/dist/chunk-FFJTEQCC.js +0 -80
- package/dist/chunk-FFJTEQCC.js.map +0 -1
- package/dist/chunk-FUFMVW7O.js +0 -64
- package/dist/chunk-FUFMVW7O.js.map +0 -1
- package/dist/chunk-FVPGQ6UE.js +0 -25
- package/dist/chunk-FVPGQ6UE.js.map +0 -1
- package/dist/chunk-G3PMV62Z.js +0 -33
- package/dist/chunk-G3PMV62Z.js.map +0 -1
- package/dist/chunk-GACFOW3E.js +0 -51
- package/dist/chunk-GACFOW3E.js.map +0 -1
- package/dist/chunk-GDT6HQMK.js +0 -42
- package/dist/chunk-GDT6HQMK.js.map +0 -1
- package/dist/chunk-HLGU22C6.js +0 -2589
- package/dist/chunk-HLGU22C6.js.map +0 -1
- package/dist/chunk-HPMYYGP7.js +0 -134
- package/dist/chunk-HPMYYGP7.js.map +0 -1
- package/dist/chunk-I2UCOD45.js +0 -197
- package/dist/chunk-I2UCOD45.js.map +0 -1
- package/dist/chunk-IEGDZUVM.js +0 -75
- package/dist/chunk-IEGDZUVM.js.map +0 -1
- package/dist/chunk-IIS7INHF.js +0 -47
- package/dist/chunk-IIS7INHF.js.map +0 -1
- package/dist/chunk-ITELSEFU.js +0 -256
- package/dist/chunk-ITELSEFU.js.map +0 -1
- package/dist/chunk-IXAYNBOY.js +0 -407
- package/dist/chunk-IXAYNBOY.js.map +0 -1
- package/dist/chunk-JUW2ETEI.js +0 -191
- package/dist/chunk-JUW2ETEI.js.map +0 -1
- package/dist/chunk-K65C7CVE.js +0 -127
- package/dist/chunk-K65C7CVE.js.map +0 -1
- package/dist/chunk-KDI64MCY.js +0 -189
- package/dist/chunk-KDI64MCY.js.map +0 -1
- package/dist/chunk-KN4ASMH5.js +0 -160
- package/dist/chunk-KN4ASMH5.js.map +0 -1
- package/dist/chunk-KQW7QNTU.js +0 -1549
- package/dist/chunk-KQW7QNTU.js.map +0 -1
- package/dist/chunk-KR7NXXHC.js +0 -66
- package/dist/chunk-KR7NXXHC.js.map +0 -1
- package/dist/chunk-KRZKIVMA.js +0 -142
- package/dist/chunk-KRZKIVMA.js.map +0 -1
- package/dist/chunk-KTTLLKGQ.js +0 -185
- package/dist/chunk-KTTLLKGQ.js.map +0 -1
- package/dist/chunk-KWKSHPDP.js +0 -234
- package/dist/chunk-KWKSHPDP.js.map +0 -1
- package/dist/chunk-KZVC7OYG.js +0 -57
- package/dist/chunk-KZVC7OYG.js.map +0 -1
- package/dist/chunk-L5DHUN2V.js +0 -204
- package/dist/chunk-L5DHUN2V.js.map +0 -1
- package/dist/chunk-LCTGEH57.js +0 -1376
- package/dist/chunk-LCTGEH57.js.map +0 -1
- package/dist/chunk-LXLIQ2D6.js +0 -12
- package/dist/chunk-LXLIQ2D6.js.map +0 -1
- package/dist/chunk-M4CTURKX.js +0 -84
- package/dist/chunk-M4CTURKX.js.map +0 -1
- package/dist/chunk-M6LTUPVP.js +0 -301
- package/dist/chunk-M6LTUPVP.js.map +0 -1
- package/dist/chunk-MA6RRHDT.js +0 -291
- package/dist/chunk-MA6RRHDT.js.map +0 -1
- package/dist/chunk-MODE4QIA.js +0 -6
- package/dist/chunk-MODE4QIA.js.map +0 -1
- package/dist/chunk-MVILMVGG.js +0 -118
- package/dist/chunk-MVILMVGG.js.map +0 -1
- package/dist/chunk-MWS4VCLV.js +0 -17
- package/dist/chunk-MWS4VCLV.js.map +0 -1
- package/dist/chunk-NEUX74SO.js +0 -315
- package/dist/chunk-NEUX74SO.js.map +0 -1
- package/dist/chunk-NFHKYBRD.js +0 -156
- package/dist/chunk-NFHKYBRD.js.map +0 -1
- package/dist/chunk-NHJNNXD3.js +0 -89
- package/dist/chunk-NHJNNXD3.js.map +0 -1
- package/dist/chunk-O2BF3HZL.js +0 -33
- package/dist/chunk-O2BF3HZL.js.map +0 -1
- package/dist/chunk-OANXCZYD.js +0 -212
- package/dist/chunk-OANXCZYD.js.map +0 -1
- package/dist/chunk-ODJF7YIP.js +0 -230
- package/dist/chunk-ODJF7YIP.js.map +0 -1
- package/dist/chunk-ON4BJTHI.js +0 -101
- package/dist/chunk-ON4BJTHI.js.map +0 -1
- package/dist/chunk-OTL5WXIJ.js +0 -16
- package/dist/chunk-OTL5WXIJ.js.map +0 -1
- package/dist/chunk-PACNBKJV.js +0 -47
- package/dist/chunk-PACNBKJV.js.map +0 -1
- package/dist/chunk-PROCA7K7.js +0 -23
- package/dist/chunk-PROCA7K7.js.map +0 -1
- package/dist/chunk-QGMIPA67.js +0 -85
- package/dist/chunk-QGMIPA67.js.map +0 -1
- package/dist/chunk-QQA37LFB.js +0 -190
- package/dist/chunk-QQA37LFB.js.map +0 -1
- package/dist/chunk-QZAWRSEB.js +0 -61
- package/dist/chunk-QZAWRSEB.js.map +0 -1
- package/dist/chunk-R74KGWNS.js +0 -699
- package/dist/chunk-R74KGWNS.js.map +0 -1
- package/dist/chunk-RFDLHMKL.js +0 -110
- package/dist/chunk-RFDLHMKL.js.map +0 -1
- package/dist/chunk-RL64HN7S.js +0 -40
- package/dist/chunk-RL64HN7S.js.map +0 -1
- package/dist/chunk-RMRQKPL7.js +0 -115
- package/dist/chunk-RMRQKPL7.js.map +0 -1
- package/dist/chunk-RQVK4IYC.js +0 -606
- package/dist/chunk-RQVK4IYC.js.map +0 -1
- package/dist/chunk-RTW56PWZ.js +0 -59
- package/dist/chunk-RTW56PWZ.js.map +0 -1
- package/dist/chunk-RUTPQNLR.js +0 -266
- package/dist/chunk-RUTPQNLR.js.map +0 -1
- package/dist/chunk-S6TAF63G.js +0 -25
- package/dist/chunk-S6TAF63G.js.map +0 -1
- package/dist/chunk-SBGAUGXY.js +0 -224
- package/dist/chunk-SBGAUGXY.js.map +0 -1
- package/dist/chunk-SC275NHZ.js +0 -407
- package/dist/chunk-SC275NHZ.js.map +0 -1
- package/dist/chunk-SCQPU4UE.js +0 -97
- package/dist/chunk-SCQPU4UE.js.map +0 -1
- package/dist/chunk-SFFF2WQP.js +0 -8
- package/dist/chunk-SFFF2WQP.js.map +0 -1
- package/dist/chunk-SJYMHZKA.js +0 -36
- package/dist/chunk-SJYMHZKA.js.map +0 -1
- package/dist/chunk-SLCCUJVN.js +0 -125
- package/dist/chunk-SLCCUJVN.js.map +0 -1
- package/dist/chunk-SVBSNSD4.js +0 -259
- package/dist/chunk-SVBSNSD4.js.map +0 -1
- package/dist/chunk-SVPLTL35.js +0 -62
- package/dist/chunk-SVPLTL35.js.map +0 -1
- package/dist/chunk-SWQFYNYG.js +0 -338
- package/dist/chunk-SWQFYNYG.js.map +0 -1
- package/dist/chunk-THHB4EWS.js +0 -72
- package/dist/chunk-THHB4EWS.js.map +0 -1
- package/dist/chunk-TUCDD33E.js +0 -246
- package/dist/chunk-TUCDD33E.js.map +0 -1
- package/dist/chunk-TV4WAP2R.js +0 -14
- package/dist/chunk-TV4WAP2R.js.map +0 -1
- package/dist/chunk-U3A6YBTZ.js +0 -134
- package/dist/chunk-U3A6YBTZ.js.map +0 -1
- package/dist/chunk-UGT6DKWM.js +0 -95
- package/dist/chunk-VSERHUWD.js +0 -212
- package/dist/chunk-VSERHUWD.js.map +0 -1
- package/dist/chunk-VYG7BDXC.js +0 -49
- package/dist/chunk-VYG7BDXC.js.map +0 -1
- package/dist/chunk-WETKNYZX.js +0 -52
- package/dist/chunk-WETKNYZX.js.map +0 -1
- package/dist/chunk-WGG4AML3.js +0 -216
- package/dist/chunk-WGG4AML3.js.map +0 -1
- package/dist/chunk-WKAUEL6I.js +0 -30
- package/dist/chunk-WKAUEL6I.js.map +0 -1
- package/dist/chunk-WPOLA5CG.js +0 -81
- package/dist/chunk-WPOLA5CG.js.map +0 -1
- package/dist/chunk-WPVETCGJ.js +0 -254
- package/dist/chunk-WPVETCGJ.js.map +0 -1
- package/dist/chunk-WTSM3A7E.js +0 -13
- package/dist/chunk-WTSM3A7E.js.map +0 -1
- package/dist/chunk-WU3F2K3T.js +0 -148
- package/dist/chunk-WU3F2K3T.js.map +0 -1
- package/dist/chunk-WZZK2DTZ.js +0 -39
- package/dist/chunk-WZZK2DTZ.js.map +0 -1
- package/dist/chunk-X4IHLKRD.js +0 -42
- package/dist/chunk-X4IHLKRD.js.map +0 -1
- package/dist/chunk-XAHEXZJC.js +0 -80
- package/dist/chunk-XAHEXZJC.js.map +0 -1
- package/dist/chunk-XCYGJDUX.js +0 -31
- package/dist/chunk-XCYGJDUX.js.map +0 -1
- package/dist/chunk-Y4W3JORC.js +0 -104
- package/dist/chunk-Y4W3JORC.js.map +0 -1
- package/dist/chunk-YFZJ3ZLG.js +0 -1297
- package/dist/chunk-YFZJ3ZLG.js.map +0 -1
- package/dist/chunk-YI3WLXEN.js +0 -4387
- package/dist/chunk-YI3WLXEN.js.map +0 -1
- package/dist/chunk-ZBKFSPD3.js +0 -29
- package/dist/chunk-ZBKFSPD3.js.map +0 -1
- package/dist/chunk-ZOERRQ6A.js +0 -79
- package/dist/chunk-ZOERRQ6A.js.map +0 -1
- package/dist/chunk-ZSTGUKHU.js +0 -10
- package/dist/chunk-ZSTGUKHU.js.map +0 -1
- package/dist/chunk-ZUEHDL27.js +0 -65
- package/dist/chunk-ZUEHDL27.js.map +0 -1
- package/dist/constants-D3gaMY-W.d.ts +0 -39
- package/dist/icons.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/blocks/AIKit.js.map +0 -1
- package/dist/internal/blocks/AppShell.js.map +0 -1
- package/dist/internal/blocks/AutoSaveTextarea.js.map +0 -1
- package/dist/internal/blocks/BrandEditor.js.map +0 -1
- package/dist/internal/blocks/ClipboardButton.js.map +0 -1
- package/dist/internal/blocks/ColorInput.js.map +0 -1
- package/dist/internal/blocks/ColorModeSwitch.js.map +0 -1
- package/dist/internal/blocks/Command.js.map +0 -1
- package/dist/internal/blocks/CopyField.js.map +0 -1
- package/dist/internal/blocks/DateInput.js.map +0 -1
- package/dist/internal/blocks/DateRangeInput.js.map +0 -1
- package/dist/internal/blocks/Form.js.map +0 -1
- package/dist/internal/blocks/FormGroup.js.map +0 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js.map +0 -1
- package/dist/internal/blocks/OtpInput.js.map +0 -1
- package/dist/internal/blocks/PageHeader.js.map +0 -1
- package/dist/internal/blocks/PageLayout.js.map +0 -1
- package/dist/internal/blocks/PageToolbar.js.map +0 -1
- package/dist/internal/blocks/SearchInput.js.map +0 -1
- package/dist/internal/blocks/SectionNav.js.map +0 -1
- package/dist/internal/blocks/TextInput.js.map +0 -1
- package/dist/internal/components/Alert.js.map +0 -1
- package/dist/internal/components/AlertModal.js.map +0 -1
- package/dist/internal/components/Badge.js.map +0 -1
- package/dist/internal/components/BrandLogo.js.map +0 -1
- package/dist/internal/components/Breadcrumb.js.map +0 -1
- package/dist/internal/components/Button.js.map +0 -1
- package/dist/internal/components/Calendar.js.map +0 -1
- package/dist/internal/components/Card.js.map +0 -1
- package/dist/internal/components/Checkbox.js.map +0 -1
- package/dist/internal/components/Clipboard.js.map +0 -1
- package/dist/internal/components/Collapsible.js.map +0 -1
- package/dist/internal/components/Combobox.js.map +0 -1
- package/dist/internal/components/DatePicker.js.map +0 -1
- package/dist/internal/components/DateRangePicker.js.map +0 -1
- package/dist/internal/components/DiffView.js.map +0 -1
- package/dist/internal/components/DropdownMenu.js.map +0 -1
- package/dist/internal/components/FileUpload.js.map +0 -1
- package/dist/internal/components/FullScreenModal.js.map +0 -1
- package/dist/internal/components/HoverCard.js.map +0 -1
- package/dist/internal/components/InputGroup.js.map +0 -1
- package/dist/internal/components/Kbd.js.map +0 -1
- package/dist/internal/components/MarkedText.js.map +0 -1
- package/dist/internal/components/MergeEditor/useMergeDiff.js.map +0 -1
- package/dist/internal/components/Modal.js.map +0 -1
- package/dist/internal/components/Navbar.js.map +0 -1
- package/dist/internal/components/Pagination.js.map +0 -1
- package/dist/internal/components/Popconfirm.js.map +0 -1
- package/dist/internal/components/Popover.js.map +0 -1
- package/dist/internal/components/RadioGroup.js.map +0 -1
- package/dist/internal/components/Resizable.js.map +0 -1
- package/dist/internal/components/Search.js.map +0 -1
- package/dist/internal/components/Select.js.map +0 -1
- package/dist/internal/components/Sheet.js.map +0 -1
- package/dist/internal/components/Sidebar.js.map +0 -1
- package/dist/internal/components/Slider.js.map +0 -1
- package/dist/internal/components/Stepper.js.map +0 -1
- package/dist/internal/components/Switch.js.map +0 -1
- package/dist/internal/components/Table.js.map +0 -1
- package/dist/internal/components/Tabs.js.map +0 -1
- package/dist/internal/components/ThemeProvider.js.map +0 -1
- package/dist/internal/components/TimePicker.js.map +0 -1
- package/dist/internal/components/Timeline.js.map +0 -1
- package/dist/internal/components/Toast.js.map +0 -1
- package/dist/internal/components/ToggleGroup.js.map +0 -1
- package/dist/internal/components/Tooltip.js.map +0 -1
- package/dist/internal/components/Workbench.js.map +0 -1
- package/dist/internal/components/ZoomableSvg.js.map +0 -1
- package/dist/internal/utils.js.map +0 -1
- package/dist/mermaid.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Group, Panel as ResizablePanel, Separator, useDefaultLayout } from "react-resizable-panels";
|
|
5
|
+
//#region src/components/Resizable/ResizableHandle.tsx
|
|
6
|
+
const resizableHandleVariants = cva([
|
|
7
|
+
"tw:bg-border",
|
|
8
|
+
"tw:relative",
|
|
9
|
+
"tw:flex",
|
|
10
|
+
"tw:w-px",
|
|
11
|
+
"tw:items-center",
|
|
12
|
+
"tw:justify-center",
|
|
13
|
+
"tw:focus-visible:ring-ring",
|
|
14
|
+
"tw:focus-visible:ring-1",
|
|
15
|
+
"tw:focus-visible:ring-offset-1",
|
|
16
|
+
"tw:focus-visible:ring-offset-ring-offset",
|
|
17
|
+
"tw:focus-visible:outline-hidden",
|
|
18
|
+
"tw:after:absolute",
|
|
19
|
+
"tw:after:inset-y-0",
|
|
20
|
+
"tw:after:left-1/2",
|
|
21
|
+
"tw:after:w-1",
|
|
22
|
+
"tw:after:-translate-x-1/2",
|
|
23
|
+
"tw:aria-[orientation=horizontal]:h-px",
|
|
24
|
+
"tw:aria-[orientation=horizontal]:w-full",
|
|
25
|
+
"tw:aria-[orientation=horizontal]:after:left-0",
|
|
26
|
+
"tw:aria-[orientation=horizontal]:after:top-1/2",
|
|
27
|
+
"tw:aria-[orientation=horizontal]:after:bottom-auto",
|
|
28
|
+
"tw:aria-[orientation=horizontal]:after:h-1",
|
|
29
|
+
"tw:aria-[orientation=horizontal]:after:w-full",
|
|
30
|
+
"tw:aria-[orientation=horizontal]:after:translate-x-0",
|
|
31
|
+
"tw:aria-[orientation=horizontal]:after:-translate-y-1/2",
|
|
32
|
+
"tw:[&[aria-orientation=horizontal]>div]:rotate-90"
|
|
33
|
+
]);
|
|
34
|
+
const ResizableHandle = ({ className, ...props }) => {
|
|
35
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
36
|
+
className: resizableHandleVariants({ className }),
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/components/Resizable/ResizablePanelGroup.tsx
|
|
42
|
+
const ResizablePanelGroup = ({ className, orientation = "horizontal", ...props }) => {
|
|
43
|
+
return /* @__PURE__ */ jsx(Group, {
|
|
44
|
+
orientation,
|
|
45
|
+
className: cn("tw:flex tw:h-full tw:w-full", orientation === "vertical" && "tw:flex-col", className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup, useDefaultLayout };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=Resizable-D3vYToZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resizable-D3vYToZH.js","names":[],"sources":["../src/components/Resizable/ResizableHandle.tsx","../src/components/Resizable/ResizablePanelGroup.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Separator } from 'react-resizable-panels';\nimport { cva } from 'class-variance-authority';\n\n// v4 renders the separator with `aria-orientation`: a separator between horizontally-arranged\n// panels is vertical (default here); one between vertically-stacked panels is horizontal.\nconst resizableHandleVariants = cva([\n // base styles\n 'tw:bg-border',\n 'tw:relative',\n 'tw:flex',\n 'tw:w-px',\n 'tw:items-center',\n 'tw:justify-center',\n\n // focus styles\n 'tw:focus-visible:ring-ring',\n 'tw:focus-visible:ring-1',\n 'tw:focus-visible:ring-offset-1',\n 'tw:focus-visible:ring-offset-ring-offset',\n 'tw:focus-visible:outline-hidden',\n\n // after pseudo-element for horizontal\n 'tw:after:absolute',\n 'tw:after:inset-y-0',\n 'tw:after:left-1/2',\n 'tw:after:w-1',\n 'tw:after:-translate-x-1/2',\n\n // horizontal separator (vertical panel group): center a full-width 4px hit target;\n // top-1/2 + bottom-auto override the base inset-y-0 so the height takes effect\n 'tw:aria-[orientation=horizontal]:h-px',\n 'tw:aria-[orientation=horizontal]:w-full',\n 'tw:aria-[orientation=horizontal]:after:left-0',\n 'tw:aria-[orientation=horizontal]:after:top-1/2',\n 'tw:aria-[orientation=horizontal]:after:bottom-auto',\n 'tw:aria-[orientation=horizontal]:after:h-1',\n 'tw:aria-[orientation=horizontal]:after:w-full',\n 'tw:aria-[orientation=horizontal]:after:translate-x-0',\n 'tw:aria-[orientation=horizontal]:after:-translate-y-1/2',\n\n // handle icon rotation for horizontal separator\n 'tw:[&[aria-orientation=horizontal]>div]:rotate-90',\n]);\n\nexport const ResizableHandle = ({ className, ...props }: ComponentProps<typeof Separator>) => {\n return <Separator className={resizableHandleVariants({ className })} {...props} />;\n};\n","import type { ComponentProps } from 'react';\nimport { Group } from 'react-resizable-panels';\n\nimport { cn } from '../../utils';\n\nexport { useDefaultLayout } from 'react-resizable-panels';\n\nexport const ResizablePanelGroup = ({\n className,\n orientation = 'horizontal',\n ...props\n}: ComponentProps<typeof Group>) => {\n return (\n <Group\n orientation={orientation}\n className={cn(\n 'tw:flex tw:h-full tw:w-full',\n orientation === 'vertical' && 'tw:flex-col',\n className,\n )}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;AAMA,MAAM,0BAA0B,IAAI;CAElC;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CAIA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;AACF,CAAC;AAED,MAAa,mBAAmB,EAAE,WAAW,GAAG,YAA8C;CAC5F,OAAO,oBAAC,WAAD;EAAW,WAAW,wBAAwB,EAAE,UAAU,CAAC;EAAG,GAAI;CAAQ,CAAA;AACnF;;;ACxCA,MAAa,uBAAuB,EAClC,WACA,cAAc,cACd,GAAG,YAC+B;CAClC,OACE,oBAAC,OAAD;EACe;EACb,WAAW,GACT,+BACA,gBAAgB,cAAc,eAC9B,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
+
import { createPrefixedString, debounce, noop } from "./utils-D0c5VAyF.js";
|
|
3
|
+
import { Search as Search$1, Sparkles, X } from "./icons-Cek151jC.js";
|
|
4
|
+
import { useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Search/ClearButton.tsx
|
|
8
|
+
const ClearButton = ({ onClick, testId }) => {
|
|
9
|
+
const handleMouseDown = (event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ jsx("button", {
|
|
13
|
+
type: "button",
|
|
14
|
+
onClick,
|
|
15
|
+
tabIndex: -1,
|
|
16
|
+
onMouseDown: handleMouseDown,
|
|
17
|
+
className: cn("tw:border-none", "tw:bg-transparent", "tw:p-0", "tw:flex", "tw:items-center", "tw:cursor-pointer", "tw:text-muted-foreground", "tw:hover:text-foreground"),
|
|
18
|
+
"data-testid": testId,
|
|
19
|
+
children: /* @__PURE__ */ jsx(X, { className: "tw:size-4" })
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/Search/styles.ts
|
|
24
|
+
const searchWrapperVariants = cva([
|
|
25
|
+
"tw:flex",
|
|
26
|
+
"tw:items-center",
|
|
27
|
+
"tw:gap-2.5",
|
|
28
|
+
"tw:text-card-foreground",
|
|
29
|
+
"tw:transition-all",
|
|
30
|
+
"tw:font-sans",
|
|
31
|
+
"tw:has-[input[readonly]]:bg-secondary",
|
|
32
|
+
"tw:has-[input[readonly]]:focus-within:ring-0",
|
|
33
|
+
"tw:has-[input[readonly]]:outline-0",
|
|
34
|
+
"tw:disabled:opacity-40",
|
|
35
|
+
"tw:[&>input]:py-[15px]"
|
|
36
|
+
], {
|
|
37
|
+
defaultVariants: { variant: "default" },
|
|
38
|
+
variants: { variant: {
|
|
39
|
+
default: [
|
|
40
|
+
"tw:rounded-lg",
|
|
41
|
+
"tw:px-5",
|
|
42
|
+
"tw:bg-card",
|
|
43
|
+
"tw:shadow-raised",
|
|
44
|
+
"tw:outline",
|
|
45
|
+
"tw:outline-1",
|
|
46
|
+
"tw:outline-transparent",
|
|
47
|
+
"tw:has-[input:focus]:outline-1",
|
|
48
|
+
"tw:has-[input:focus]:ring-4",
|
|
49
|
+
"tw:has-[input:focus]:outline-ring",
|
|
50
|
+
"tw:has-[input:focus]:ring-ring/30"
|
|
51
|
+
],
|
|
52
|
+
ai: [
|
|
53
|
+
"tailwindcss-preflight",
|
|
54
|
+
"tw:relative",
|
|
55
|
+
"tw:rounded-card",
|
|
56
|
+
"tw:px-4",
|
|
57
|
+
"tw:cursor-text",
|
|
58
|
+
"tw:border-2",
|
|
59
|
+
"tw:border-transparent",
|
|
60
|
+
"tw:bg-gradient-to-br",
|
|
61
|
+
"tw:from-secondary-600",
|
|
62
|
+
"tw:to-purple-600",
|
|
63
|
+
"tw:bg-origin-border",
|
|
64
|
+
"tw:shadow-[inset_0_100vw_rgb(var(--card))]",
|
|
65
|
+
"tw:has-[input:focus]:ring-4",
|
|
66
|
+
"tw:has-[input:focus]:ring-ring/30"
|
|
67
|
+
]
|
|
68
|
+
} }
|
|
69
|
+
});
|
|
70
|
+
const searchInputClassnames = [
|
|
71
|
+
"tw:border-none",
|
|
72
|
+
"tw:bg-transparent",
|
|
73
|
+
"tw:outline-hidden",
|
|
74
|
+
"tw:w-full",
|
|
75
|
+
"tw:p-0",
|
|
76
|
+
"tw:text-base",
|
|
77
|
+
"tw:leading-6",
|
|
78
|
+
"tw:font-normal",
|
|
79
|
+
"tw:font-sans",
|
|
80
|
+
"tw:placeholder:text-muted-foreground",
|
|
81
|
+
"tw:disabled:cursor-not-allowed"
|
|
82
|
+
].join(" ");
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/components/Search/utils.ts
|
|
85
|
+
const genSearchTestId = (prefix = "") => {
|
|
86
|
+
const ps = createPrefixedString(prefix);
|
|
87
|
+
return {
|
|
88
|
+
toString: () => prefix,
|
|
89
|
+
wrapper: ps`search-wrapper`,
|
|
90
|
+
input: ps`search-input`,
|
|
91
|
+
clearButton: ps`search-clear-button`
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/components/Search/Search.tsx
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated Use `SearchInput` instead. `Search` is kept only for the legacy (non-sidebar) layout.
|
|
98
|
+
*/
|
|
99
|
+
const Search = ({ ref, suffix, className, onBlur, onChange = noop, disabled = false, readOnly = false, disableDebounce = false, debounceDelay = 300, value: externalValue, defaultValue, testId: prefixTestId = "", placeholder = "Search", onClear, variant = "default", ...rest }) => {
|
|
100
|
+
const [internalValue, setInternalValue] = useState(() => externalValue != null ? externalValue : defaultValue);
|
|
101
|
+
const isClearButtonVisible = internalValue !== "" && !disabled && !readOnly;
|
|
102
|
+
const testId = genSearchTestId(prefixTestId);
|
|
103
|
+
const debouncedOnChange = useMemo(() => disableDebounce ? onChange : debounce(onChange, debounceDelay), [
|
|
104
|
+
disableDebounce,
|
|
105
|
+
debounceDelay,
|
|
106
|
+
onChange
|
|
107
|
+
]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (externalValue == null) return;
|
|
110
|
+
setInternalValue(externalValue);
|
|
111
|
+
}, [externalValue]);
|
|
112
|
+
const handleChange = (event) => {
|
|
113
|
+
const currentValue = event.target.value;
|
|
114
|
+
setInternalValue(currentValue);
|
|
115
|
+
debouncedOnChange(currentValue, event);
|
|
116
|
+
};
|
|
117
|
+
const handleBlur = (event) => {
|
|
118
|
+
const currentValue = event.target.value;
|
|
119
|
+
setInternalValue(currentValue);
|
|
120
|
+
onBlur?.(currentValue, event);
|
|
121
|
+
};
|
|
122
|
+
const handleClear = (event) => {
|
|
123
|
+
setInternalValue("");
|
|
124
|
+
onChange?.("", event);
|
|
125
|
+
onClear?.();
|
|
126
|
+
};
|
|
127
|
+
const handleWrapperMouseDown = (event) => {
|
|
128
|
+
if (disabled || readOnly) return;
|
|
129
|
+
if (event.target.closest("button, a, input, textarea, [role=\"button\"]")) return;
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
event.currentTarget.querySelector("input")?.focus();
|
|
132
|
+
};
|
|
133
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
134
|
+
className: cn(searchWrapperVariants({ variant }), { "tw:cursor-not-allowed tw:opacity-40": disabled }, className),
|
|
135
|
+
"data-testid": testId.wrapper,
|
|
136
|
+
onMouseDown: handleWrapperMouseDown,
|
|
137
|
+
children: [
|
|
138
|
+
variant === "ai" ? /* @__PURE__ */ jsx(Sparkles, { className: "tw:size-4 tw:shrink-0 tw:[&_*]:stroke-aigradient-600" }) : /* @__PURE__ */ jsx(Search$1, { className: "tw:size-4 tw:shrink-0 tw:text-neutral-400" }),
|
|
139
|
+
/* @__PURE__ */ jsx("input", {
|
|
140
|
+
...rest,
|
|
141
|
+
ref,
|
|
142
|
+
placeholder,
|
|
143
|
+
"data-testid": testId.input,
|
|
144
|
+
type: "text",
|
|
145
|
+
value: internalValue ?? "",
|
|
146
|
+
onChange: handleChange,
|
|
147
|
+
onBlur: handleBlur,
|
|
148
|
+
className: searchInputClassnames,
|
|
149
|
+
disabled,
|
|
150
|
+
readOnly
|
|
151
|
+
}),
|
|
152
|
+
isClearButtonVisible && /* @__PURE__ */ jsx(ClearButton, {
|
|
153
|
+
onClick: handleClear,
|
|
154
|
+
testId: testId.clearButton
|
|
155
|
+
}),
|
|
156
|
+
suffix
|
|
157
|
+
]
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/components/Search/SearchForm.tsx
|
|
162
|
+
const SearchForm = ({ ref, onSubmit, name = "search-field", ...props }) => {
|
|
163
|
+
const handleSubmit = (event) => {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
onSubmit(event.currentTarget.elements.namedItem(name).value);
|
|
166
|
+
};
|
|
167
|
+
const onClear = () => {
|
|
168
|
+
onSubmit("");
|
|
169
|
+
};
|
|
170
|
+
return /* @__PURE__ */ jsx("form", {
|
|
171
|
+
onSubmit: handleSubmit,
|
|
172
|
+
children: /* @__PURE__ */ jsx(Search, {
|
|
173
|
+
...props,
|
|
174
|
+
ref,
|
|
175
|
+
onClear,
|
|
176
|
+
name,
|
|
177
|
+
disableDebounce: true
|
|
178
|
+
})
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
//#endregion
|
|
182
|
+
export { Search, SearchForm };
|
|
183
|
+
|
|
184
|
+
//# sourceMappingURL=Search-3UiqNZRj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search-3UiqNZRj.js","names":["SearchIcon"],"sources":["../src/components/Search/ClearButton.tsx","../src/components/Search/styles.ts","../src/components/Search/utils.ts","../src/components/Search/Search.tsx","../src/components/Search/SearchForm.tsx"],"sourcesContent":["import type { MouseEventHandler } from 'react';\n\nimport { X } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Props = {\n onClick: MouseEventHandler<HTMLButtonElement>;\n testId?: string;\n};\n\nexport const ClearButton = ({ onClick, testId }: Props) => {\n // Prevent default, as we do not want to lose input focus.\n const handleMouseDown: MouseEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n };\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n tabIndex={-1} // clear button should not be focusable\n onMouseDown={handleMouseDown}\n className={cn(\n // reset\n 'tw:border-none',\n 'tw:bg-transparent',\n 'tw:p-0',\n\n // positioning\n 'tw:flex',\n 'tw:items-center',\n\n 'tw:cursor-pointer',\n 'tw:text-muted-foreground',\n 'tw:hover:text-foreground',\n )}\n data-testid={testId}\n >\n <X className=\"tw:size-4\" />\n </button>\n );\n};\n","import { cva } from 'class-variance-authority';\n\nexport const searchWrapperVariants = cva(\n [\n // positioning\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-2.5',\n\n // base\n 'tw:text-card-foreground',\n 'tw:transition-all',\n 'tw:font-sans',\n\n // readonly — `secondary` over `muted`, which is too close to the `card` fill to\n // read as non-editable in either scheme\n 'tw:has-[input[readonly]]:bg-secondary',\n 'tw:has-[input[readonly]]:focus-within:ring-0',\n 'tw:has-[input[readonly]]:outline-0',\n\n // disabled\n 'tw:disabled:opacity-40',\n\n // default input padding (was sizing.default)\n 'tw:[&>input]:py-[15px]',\n ],\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:rounded-lg',\n 'tw:px-5',\n 'tw:bg-card',\n 'tw:shadow-raised',\n // outline\n 'tw:outline',\n 'tw:outline-1',\n 'tw:outline-transparent',\n // focus\n 'tw:has-[input:focus]:outline-1',\n 'tw:has-[input:focus]:ring-4',\n 'tw:has-[input:focus]:outline-ring',\n 'tw:has-[input:focus]:ring-ring/30',\n ],\n ai: [\n 'tailwindcss-preflight',\n 'tw:relative',\n 'tw:rounded-card',\n 'tw:px-4',\n 'tw:cursor-text',\n 'tw:border-2',\n 'tw:border-transparent',\n 'tw:bg-gradient-to-br',\n 'tw:from-secondary-600',\n 'tw:to-purple-600',\n 'tw:bg-origin-border',\n // Floods the interior so the gradient shows only in the 2px border box.\n 'tw:shadow-[inset_0_100vw_rgb(var(--card))]',\n // focus\n 'tw:has-[input:focus]:ring-4',\n 'tw:has-[input:focus]:ring-ring/30',\n ],\n },\n },\n },\n);\n\nexport const searchInputClassnames = [\n // reset\n 'tw:border-none',\n 'tw:bg-transparent',\n 'tw:outline-hidden',\n 'tw:w-full',\n 'tw:p-0',\n\n // base\n 'tw:text-base',\n 'tw:leading-6',\n 'tw:font-normal',\n 'tw:font-sans',\n\n // placeholder\n 'tw:placeholder:text-muted-foreground',\n\n // disabled\n 'tw:disabled:cursor-not-allowed',\n].join(' ');\n","import { createPrefixedString } from '../../utils';\n\nexport const genSearchTestId = (prefix: string = '') => {\n const ps = createPrefixedString(prefix);\n return {\n toString: () => prefix,\n wrapper: ps`search-wrapper`,\n input: ps`search-input`,\n clearButton: ps`search-clear-button`,\n };\n};\n","import { useEffect, useMemo, useState } from 'react';\nimport type {\n ChangeEvent,\n ChangeEventHandler,\n ComponentProps,\n FocusEvent,\n FocusEventHandler,\n MouseEvent,\n MouseEventHandler,\n ReactNode,\n} from 'react';\n\nimport { Search as SearchIcon, Sparkles } from '../../icons';\nimport { cn, debounce, noop } from '../../utils';\n\nimport { ClearButton } from './ClearButton';\nimport { searchInputClassnames, searchWrapperVariants } from './styles';\nimport { genSearchTestId } from './utils';\n\ntype SearchChangeEventHandler = (\n value: string,\n event: ChangeEvent<HTMLInputElement> | MouseEvent<HTMLButtonElement>,\n) => void;\n\ntype SearchBlurEventHandler = (value: string, event: FocusEvent<HTMLInputElement, Element>) => void;\n\ntype Props = {\n suffix?: ReactNode;\n disableDebounce?: boolean;\n debounceDelay?: number;\n onChange?: SearchChangeEventHandler;\n onBlur?: SearchBlurEventHandler;\n value?: string | null;\n defaultValue?: string | null;\n testId?: string;\n onClear?: () => void;\n variant?: 'default' | 'ai';\n} & Omit<\n ComponentProps<'input'>,\n 'type' | 'onBlur' | 'onChange' | 'value' | 'defaultValue' | 'prefix' | 'suffix'\n>;\n\n/**\n * @deprecated Use `SearchInput` instead. `Search` is kept only for the legacy (non-sidebar) layout.\n */\nexport const Search = ({\n ref,\n suffix,\n className,\n onBlur,\n onChange = noop,\n disabled = false,\n readOnly = false,\n disableDebounce = false,\n debounceDelay = 300,\n value: externalValue,\n defaultValue,\n testId: prefixTestId = '',\n placeholder = 'Search',\n onClear,\n variant = 'default',\n ...rest\n}: Props) => {\n const [internalValue, setInternalValue] = useState(() =>\n externalValue != null ? externalValue : defaultValue,\n );\n const hasValue = internalValue !== '';\n\n const isClearButtonVisible = hasValue && !disabled && !readOnly;\n const testId = genSearchTestId(prefixTestId);\n\n const debouncedOnChange = useMemo(\n () => (disableDebounce ? onChange : debounce(onChange, debounceDelay)),\n [disableDebounce, debounceDelay, onChange],\n );\n\n useEffect(() => {\n if (externalValue == null) return; // uncontrolled state\n // oxlint-disable-next-line react-x/set-state-in-effect\n setInternalValue(externalValue);\n }, [externalValue]);\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (event) => {\n const currentValue = event.target.value;\n setInternalValue(currentValue);\n debouncedOnChange(currentValue, event);\n };\n\n const handleBlur: FocusEventHandler<HTMLInputElement> = (event) => {\n const currentValue = event.target.value;\n setInternalValue(currentValue);\n onBlur?.(currentValue, event);\n };\n\n const handleClear: MouseEventHandler<HTMLButtonElement> = (event) => {\n setInternalValue('');\n onChange?.('', event);\n onClear?.();\n };\n\n // Clicking anywhere in the field that isn't an interactive control (the leading icon,\n // the empty chrome) focuses the input — the whole pill acts as one click target.\n const handleWrapperMouseDown: MouseEventHandler<HTMLDivElement> = (event) => {\n if (disabled || readOnly) return;\n if ((event.target as HTMLElement).closest('button, a, input, textarea, [role=\"button\"]')) {\n return;\n }\n event.preventDefault();\n event.currentTarget.querySelector('input')?.focus();\n };\n\n return (\n // Mouse-only convenience: clicking the chrome focuses the input. The input itself is the\n // real interactive/focusable target, so no extra role or key handler is needed here.\n // oxlint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n className={cn(\n searchWrapperVariants({ variant }),\n {\n 'tw:cursor-not-allowed tw:opacity-40': disabled,\n },\n className,\n )}\n data-testid={testId.wrapper}\n onMouseDown={handleWrapperMouseDown}\n >\n {variant === 'ai' ? (\n <Sparkles className=\"tw:size-4 tw:shrink-0 tw:[&_*]:stroke-aigradient-600\" />\n ) : (\n <SearchIcon className=\"tw:size-4 tw:shrink-0 tw:text-neutral-400\" />\n )}\n\n <input\n {...rest}\n ref={ref}\n placeholder={placeholder}\n data-testid={testId.input}\n type=\"text\"\n value={internalValue ?? ''}\n onChange={handleChange}\n onBlur={handleBlur}\n className={searchInputClassnames}\n disabled={disabled}\n readOnly={readOnly}\n />\n\n {isClearButtonVisible && <ClearButton onClick={handleClear} testId={testId.clearButton} />}\n\n {suffix}\n </div>\n );\n};\n","import type { ComponentProps, FormEventHandler } from 'react';\n\nimport { Search } from './Search';\n\ntype Props = {\n onSubmit: (value: string) => void;\n} & Omit<ComponentProps<typeof Search>, 'onClear' | 'onBlur' | 'onSubmit'>;\n\nexport const SearchForm = ({ ref, onSubmit, name = 'search-field', ...props }: Props) => {\n const handleSubmit: FormEventHandler<HTMLFormElement> = (event) => {\n event.preventDefault();\n const searchEl = event.currentTarget.elements.namedItem(name) as HTMLInputElement;\n onSubmit(searchEl.value);\n };\n\n const onClear = () => {\n onSubmit('');\n };\n\n return (\n <form onSubmit={handleSubmit}>\n <Search\n {...props}\n ref={ref}\n onClear={onClear}\n name={name}\n // Debounce has no meaning when we use submit, which is triggered by pressing enter.\n disableDebounce\n />\n </form>\n );\n};\n"],"mappings":";;;;;;;AAUA,MAAa,eAAe,EAAE,SAAS,aAAoB;CAEzD,MAAM,mBAAyD,UAAU;EACvE,MAAM,eAAe;CACvB;CAEA,OACE,oBAAC,UAAD;EACE,MAAK;EACI;EACT,UAAU;EACV,aAAa;EACb,WAAW,GAET,kBACA,qBACA,UAGA,WACA,mBAEA,qBACA,4BACA,0BACF;EACA,eAAa;EAEb,UAAA,oBAAC,GAAD,EAAG,WAAU,YAAa,CAAA;CACpB,CAAA;AAEZ;;;ACvCA,MAAa,wBAAwB,IACnC;CAEE;CACA;CACA;CAGA;CACA;CACA;CAIA;CACA;CACA;CAGA;CAGA;AACF,GACA;CACE,iBAAiB,EACf,SAAS,UACX;CACA,UAAU,EACR,SAAS;EACP,SAAS;GACP;GACA;GACA;GACA;GAEA;GACA;GACA;GAEA;GACA;GACA;GACA;EACF;EACA,IAAI;GACF;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAEA;GAEA;GACA;EACF;CACF,EACF;AACF,CACF;AAEA,MAAa,wBAAwB;CAEnC;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CAGA;AACF,CAAC,CAAC,KAAK,GAAG;;;ACvFV,MAAa,mBAAmB,SAAiB,OAAO;CACtD,MAAM,KAAK,qBAAqB,MAAM;CACtC,OAAO;EACL,gBAAgB;EAChB,SAAS,EAAE;EACX,OAAO,EAAE;EACT,aAAa,EAAE;CACjB;AACF;;;;;;ACmCA,MAAa,UAAU,EACrB,KACA,QACA,WACA,QACA,WAAW,MACX,WAAW,OACX,WAAW,OACX,kBAAkB,OAClB,gBAAgB,KAChB,OAAO,eACP,cACA,QAAQ,eAAe,IACvB,cAAc,UACd,SACA,UAAU,WACV,GAAG,WACQ;CACX,MAAM,CAAC,eAAe,oBAAoB,eACxC,iBAAiB,OAAO,gBAAgB,YAC1C;CAGA,MAAM,uBAFW,kBAAkB,MAEM,CAAC,YAAY,CAAC;CACvD,MAAM,SAAS,gBAAgB,YAAY;CAE3C,MAAM,oBAAoB,cACjB,kBAAkB,WAAW,SAAS,UAAU,aAAa,GACpE;EAAC;EAAiB;EAAe;CAAQ,CAC3C;CAEA,gBAAgB;EACd,IAAI,iBAAiB,MAAM;EAE3B,iBAAiB,aAAa;CAChC,GAAG,CAAC,aAAa,CAAC;CAElB,MAAM,gBAAsD,UAAU;EACpE,MAAM,eAAe,MAAM,OAAO;EAClC,iBAAiB,YAAY;EAC7B,kBAAkB,cAAc,KAAK;CACvC;CAEA,MAAM,cAAmD,UAAU;EACjE,MAAM,eAAe,MAAM,OAAO;EAClC,iBAAiB,YAAY;EAC7B,SAAS,cAAc,KAAK;CAC9B;CAEA,MAAM,eAAqD,UAAU;EACnE,iBAAiB,EAAE;EACnB,WAAW,IAAI,KAAK;EACpB,UAAU;CACZ;CAIA,MAAM,0BAA6D,UAAU;EAC3E,IAAI,YAAY,UAAU;EAC1B,IAAK,MAAM,OAAuB,QAAQ,+CAA6C,GACrF;EAEF,MAAM,eAAe;EACrB,MAAM,cAAc,cAAc,OAAO,CAAC,EAAE,MAAM;CACpD;CAEA,OAIE,qBAAC,OAAD;EACE,WAAW,GACT,sBAAsB,EAAE,QAAQ,CAAC,GACjC,EACE,uCAAuC,SACzC,GACA,SACF;EACA,eAAa,OAAO;EACpB,aAAa;EATf,UAAA;GAWG,YAAY,OACX,oBAAC,UAAD,EAAU,WAAU,uDAAwD,CAAA,IAE5E,oBAACA,UAAD,EAAY,WAAU,4CAA6C,CAAA;GAGrE,oBAAC,SAAD;IACE,GAAI;IACC;IACQ;IACb,eAAa,OAAO;IACpB,MAAK;IACL,OAAO,iBAAiB;IACxB,UAAU;IACV,QAAQ;IACR,WAAW;IACD;IACA;GACX,CAAA;GAEA,wBAAwB,oBAAC,aAAD;IAAa,SAAS;IAAa,QAAQ,OAAO;GAAc,CAAA;GAExF;EACE;;AAET;;;AC/IA,MAAa,cAAc,EAAE,KAAK,UAAU,OAAO,gBAAgB,GAAG,YAAmB;CACvF,MAAM,gBAAmD,UAAU;EACjE,MAAM,eAAe;EAErB,SADiB,MAAM,cAAc,SAAS,UAAU,IACxC,CAAC,CAAC,KAAK;CACzB;CAEA,MAAM,gBAAgB;EACpB,SAAS,EAAE;CACb;CAEA,OACE,oBAAC,QAAD;EAAM,UAAU;EACd,UAAA,oBAAC,QAAD;GACE,GAAI;GACC;GACI;GACH;GAEN,iBAAA;EACD,CAAA;CACG,CAAA;AAEV"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { debounce } from "./utils-D0c5VAyF.js";
|
|
2
|
+
import { Search, X } from "./icons-Cek151jC.js";
|
|
3
|
+
import { InputGroup } from "./InputGroup-CdTq8H7c.js";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/blocks/SearchInput/SearchInput.tsx
|
|
7
|
+
/**
|
|
8
|
+
* Debounced search input with a leading magnifying-glass icon and optional clear button.
|
|
9
|
+
*
|
|
10
|
+
* **When to use:** the search field inside `PageToolbar.Search`, list / table search, combobox-less
|
|
11
|
+
* free-text filters. `onValueChange` is debounced so callers can wire it directly to fetches without
|
|
12
|
+
* `useMemo` plumbing.
|
|
13
|
+
* **When NOT to use:** for a plain string input use `TextInput`; for selecting from a known enumerated
|
|
14
|
+
* list use `Combobox` (which has its own search built in).
|
|
15
|
+
* **Composition:** typically rendered in `PageToolbar.Search` next to `MultiCombobox` filter pills. Use
|
|
16
|
+
* `allowClear` for the canonical x-to-reset affordance.
|
|
17
|
+
*
|
|
18
|
+
* @see RECIPES.md#filter-toolbar — for the search + filter chips toolbar pattern
|
|
19
|
+
*/
|
|
20
|
+
const SearchInput = ({ ref, state, variant, focusVariant, sizing, className, value: valueProp, defaultValue, onValueChange, onValueBlur, onChange, onBlur, onClear, allowClear = false, disableDebounce = false, debounceDelay = 300, disabled, readOnly, ...restInputProps }) => {
|
|
21
|
+
const [internalValue, setInternalValue] = useState(valueProp != null ? valueProp : defaultValue ?? "");
|
|
22
|
+
const debounceInFlightRef = useRef(false);
|
|
23
|
+
const cancelRef = useRef(() => {});
|
|
24
|
+
const debouncedOnValueChange = useMemo(() => {
|
|
25
|
+
if (!onValueChange || disableDebounce) {
|
|
26
|
+
cancelRef.current = () => {};
|
|
27
|
+
return onValueChange;
|
|
28
|
+
}
|
|
29
|
+
const d = debounce((val) => {
|
|
30
|
+
debounceInFlightRef.current = false;
|
|
31
|
+
onValueChange(val);
|
|
32
|
+
}, debounceDelay);
|
|
33
|
+
cancelRef.current = d.cancel;
|
|
34
|
+
return d;
|
|
35
|
+
}, [
|
|
36
|
+
onValueChange,
|
|
37
|
+
disableDebounce,
|
|
38
|
+
debounceDelay
|
|
39
|
+
]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
return () => cancelRef.current();
|
|
42
|
+
}, [debouncedOnValueChange]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (valueProp == null) return;
|
|
45
|
+
if (debounceInFlightRef.current) return;
|
|
46
|
+
setInternalValue(valueProp);
|
|
47
|
+
}, [valueProp]);
|
|
48
|
+
const canClear = allowClear && !!internalValue && !disabled && !readOnly;
|
|
49
|
+
const handleChange = (event) => {
|
|
50
|
+
const val = event.target.value;
|
|
51
|
+
setInternalValue(val);
|
|
52
|
+
if (!disableDebounce && debouncedOnValueChange) debounceInFlightRef.current = true;
|
|
53
|
+
debouncedOnValueChange?.(val);
|
|
54
|
+
onChange?.(event);
|
|
55
|
+
};
|
|
56
|
+
const handleBlur = (event) => {
|
|
57
|
+
onValueBlur?.(event.target.value);
|
|
58
|
+
onBlur?.(event);
|
|
59
|
+
};
|
|
60
|
+
const handleClear = () => {
|
|
61
|
+
cancelRef.current();
|
|
62
|
+
debounceInFlightRef.current = false;
|
|
63
|
+
setInternalValue("");
|
|
64
|
+
onValueChange?.("");
|
|
65
|
+
onClear?.();
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ jsxs(InputGroup, {
|
|
68
|
+
state,
|
|
69
|
+
variant,
|
|
70
|
+
sizing,
|
|
71
|
+
focusVariant,
|
|
72
|
+
className,
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsx(InputGroup.Addon, {
|
|
75
|
+
align: "inline-start",
|
|
76
|
+
children: /* @__PURE__ */ jsx(Search, { className: "tw:size-4 tw:shrink-0 tw:text-muted-foreground" })
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ jsx(InputGroup.Input, {
|
|
79
|
+
...restInputProps,
|
|
80
|
+
ref,
|
|
81
|
+
value: internalValue,
|
|
82
|
+
onChange: handleChange,
|
|
83
|
+
onBlur: handleBlur,
|
|
84
|
+
disabled,
|
|
85
|
+
readOnly
|
|
86
|
+
}),
|
|
87
|
+
canClear && /* @__PURE__ */ jsx(InputGroup.Addon, {
|
|
88
|
+
align: "inline-end",
|
|
89
|
+
children: /* @__PURE__ */ jsx(InputGroup.Button, {
|
|
90
|
+
"aria-label": "Clear search",
|
|
91
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
92
|
+
onClick: handleClear,
|
|
93
|
+
children: /* @__PURE__ */ jsx(X, { className: "tw:size-4" })
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { SearchInput };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=SearchInput-C7dF_Ir-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput-C7dF_Ir-.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"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
+
import { noop } from "./utils-D0c5VAyF.js";
|
|
3
|
+
import { ChevronDown } from "./icons-Cek151jC.js";
|
|
4
|
+
import { Button } from "./Button-6xBX0nNl.js";
|
|
5
|
+
import { DropdownMenu } from "./DropdownMenu-t90tVw6l.js";
|
|
6
|
+
import { Badge } from "./Badge-Ch26CXoP.js";
|
|
7
|
+
import { Collapsible } from "./Collapsible-BQXWEOBC.js";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/blocks/SectionNav/SectionNavItemContent.tsx
|
|
11
|
+
/**
|
|
12
|
+
* One row's body, rendered identically in the tree and in the collapsed dropdown — same title, same
|
|
13
|
+
* badge, same description. Shared rather than written twice so the two cannot drift.
|
|
14
|
+
*/
|
|
15
|
+
const SectionNavItemContent = ({ item, active, showDescription = false, expanded, showIcon = true }) => {
|
|
16
|
+
const Icon = item.icon;
|
|
17
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
18
|
+
className: "tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-0.5",
|
|
19
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
20
|
+
className: "tw:flex tw:items-center tw:gap-2",
|
|
21
|
+
children: [
|
|
22
|
+
showIcon && Icon && /* @__PURE__ */ jsx(Icon, { className: "tw:size-4 tw:shrink-0" }),
|
|
23
|
+
/* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: cn("tw:flex-1 tw:truncate tw:text-sm", active ? "tw:font-medium tw:text-accent-foreground" : "tw:text-foreground"),
|
|
25
|
+
children: item.title
|
|
26
|
+
}),
|
|
27
|
+
item.isNew && /* @__PURE__ */ jsx(Badge, {
|
|
28
|
+
color: "blue-inverse",
|
|
29
|
+
className: "tw:min-h-0 tw:text-[10px]",
|
|
30
|
+
labelClassName: "tw:px-1.5 tw:py-0",
|
|
31
|
+
children: "New"
|
|
32
|
+
}),
|
|
33
|
+
expanded !== void 0 && /* @__PURE__ */ jsx(ChevronDown, { className: cn("tw:size-4 tw:shrink-0 tw:text-muted-foreground tw:transition-transform tw:duration-200", expanded && "tw:rotate-180") })
|
|
34
|
+
]
|
|
35
|
+
}), showDescription && item.description && /* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: "tw:text-xs tw:break-words tw:text-muted-foreground",
|
|
37
|
+
children: item.description
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/blocks/SectionNav/SectionNavGroupRow.tsx
|
|
43
|
+
/**
|
|
44
|
+
* The ring is **inset**, not an outline. A row is exactly as wide as the nav column, and
|
|
45
|
+
* `PageLayout.Content nav` makes that column a scroll container (`overflow-y-auto`, which forces
|
|
46
|
+
* `overflow-x` to `auto` too) — so there is 0px of slack for anything painted outside the border
|
|
47
|
+
* box, and the browser's default `outline-offset: 1px` ring gets clipped on both edges. Painting
|
|
48
|
+
* inside the box cannot be clipped, at any column width, by any ancestor.
|
|
49
|
+
*/
|
|
50
|
+
const FOCUS_RING = "tw:focus-visible:outline-hidden tw:focus-visible:ring-2 tw:focus-visible:ring-inset tw:focus-visible:ring-ring";
|
|
51
|
+
const rowClass = (active) => cn("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", FOCUS_RING, active ? "tw:bg-accent tw:font-medium tw:text-accent-foreground" : "tw:bg-transparent tw:text-foreground tw:hover:bg-muted");
|
|
52
|
+
const childRowClass = (active) => cn("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", FOCUS_RING, active ? "tw:bg-accent" : "tw:bg-transparent tw:hover:bg-muted");
|
|
53
|
+
/**
|
|
54
|
+
* One group row and its sub-sections. The row is a single control: it opens the group **and** goes to
|
|
55
|
+
* its first section, and only collapses once you are already there — so the chevron never becomes a
|
|
56
|
+
* separate thing to aim at, and one click always makes progress.
|
|
57
|
+
*/
|
|
58
|
+
const SectionNavGroupRow = ({ group, activeId, renderItem, showDescriptions }) => {
|
|
59
|
+
const [open, setOpen] = useState(true);
|
|
60
|
+
const hasChildren = group.children.length > 0;
|
|
61
|
+
const targetId = group.children[0]?.id ?? group.id;
|
|
62
|
+
const isCurrent = group.id === activeId;
|
|
63
|
+
const holdsCurrent = isCurrent || group.children.some((child) => child.id === activeId);
|
|
64
|
+
const onClick = (event) => {
|
|
65
|
+
if (!hasChildren) return;
|
|
66
|
+
if (activeId === targetId) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
setOpen((isOpen) => !isOpen);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
setOpen(true);
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
74
|
+
open,
|
|
75
|
+
onOpenChange: setOpen,
|
|
76
|
+
className: "tw:flex tw:flex-col tw:gap-0.5",
|
|
77
|
+
children: [renderItem({
|
|
78
|
+
targetId,
|
|
79
|
+
isActive: isCurrent,
|
|
80
|
+
children: /* @__PURE__ */ jsx(SectionNavItemContent, {
|
|
81
|
+
item: group,
|
|
82
|
+
active: holdsCurrent,
|
|
83
|
+
expanded: hasChildren ? open : void 0
|
|
84
|
+
}),
|
|
85
|
+
itemProps: {
|
|
86
|
+
className: rowClass(holdsCurrent),
|
|
87
|
+
"aria-current": isCurrent ? "page" : void 0,
|
|
88
|
+
"aria-expanded": hasChildren ? open : void 0,
|
|
89
|
+
"data-active": holdsCurrent && !isCurrent ? true : void 0,
|
|
90
|
+
onClick
|
|
91
|
+
}
|
|
92
|
+
}), hasChildren && /* @__PURE__ */ jsx(Collapsible.Content, { children: /* @__PURE__ */ jsxs("ul", {
|
|
93
|
+
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",
|
|
94
|
+
children: [group.children.map((child) => {
|
|
95
|
+
const active = child.id === activeId;
|
|
96
|
+
return /* @__PURE__ */ jsx("li", { children: renderItem({
|
|
97
|
+
targetId: child.id,
|
|
98
|
+
isActive: active,
|
|
99
|
+
children: /* @__PURE__ */ jsx(SectionNavItemContent, {
|
|
100
|
+
item: child,
|
|
101
|
+
active,
|
|
102
|
+
showDescription: showDescriptions,
|
|
103
|
+
showIcon: false
|
|
104
|
+
}),
|
|
105
|
+
itemProps: {
|
|
106
|
+
className: childRowClass(active),
|
|
107
|
+
"aria-current": active ? "page" : void 0,
|
|
108
|
+
"aria-expanded": void 0,
|
|
109
|
+
"data-active": void 0,
|
|
110
|
+
onClick: noop
|
|
111
|
+
}
|
|
112
|
+
}) }, child.id);
|
|
113
|
+
}), group.note && /* @__PURE__ */ jsx("li", {
|
|
114
|
+
className: "tw:py-1 tw:pl-3 tw:text-xs tw:text-muted-foreground",
|
|
115
|
+
children: group.note
|
|
116
|
+
})]
|
|
117
|
+
}) })]
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/blocks/SectionNav/SectionNav.tsx
|
|
122
|
+
/**
|
|
123
|
+
* In-page grouped navigation for one page's sections: a tree above the container's breakpoint, a
|
|
124
|
+
* single dropdown below it. Both are rendered and CSS picks one, and both draw their rows through
|
|
125
|
+
* the same renderer, so the two can never drift apart.
|
|
126
|
+
*
|
|
127
|
+
* **This is not `Sidebar`.** `Sidebar` is the app-level left rail — `SidebarProvider`, icon-collapse,
|
|
128
|
+
* one per app shell, outside `PageLayout`. `SectionNav` is scoped to a single page's sections, lives
|
|
129
|
+
* inside `PageLayout.Content`, and owns no global state. See `AGENTS.md`.
|
|
130
|
+
*
|
|
131
|
+
* **Router-agnostic:** `renderItem` is the seam. Pass it whatever your router calls a link.
|
|
132
|
+
*
|
|
133
|
+
* ```tsx
|
|
134
|
+
* <PageLayout.Content nav={
|
|
135
|
+
* <SectionNav
|
|
136
|
+
* groups={groups}
|
|
137
|
+
* activeId={activeId}
|
|
138
|
+
* renderItem={({ targetId, children, itemProps }) => (
|
|
139
|
+
* <Link to={targetId} {...itemProps}>{children}</Link>
|
|
140
|
+
* )}
|
|
141
|
+
* />
|
|
142
|
+
* }>
|
|
143
|
+
* {page}
|
|
144
|
+
* </PageLayout.Content>
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* The tree↔dropdown switch is a **container** query on the content area's width, never the viewport
|
|
148
|
+
* — a product sidebar or a chat panel narrows the page without the window resizing.
|
|
149
|
+
* `PageLayout.Content nav={…}` names that container; standalone, put `tw:@container/section-nav` on
|
|
150
|
+
* an ancestor yourself.
|
|
151
|
+
*
|
|
152
|
+
* @see RECIPES.md#section-nav
|
|
153
|
+
*/
|
|
154
|
+
const SectionNav = ({ groups, activeId, renderItem, showDescriptions = false, label = "Sections", className }) => {
|
|
155
|
+
/**
|
|
156
|
+
* What the collapsed trigger names. A sub-section carries its group with it — "Developer settings /
|
|
157
|
+
* CLI agents" — so the trigger says where you are, not just what page this is.
|
|
158
|
+
*/
|
|
159
|
+
const activeChild = groups.flatMap((group) => group.children.map((child) => ({
|
|
160
|
+
group,
|
|
161
|
+
child
|
|
162
|
+
}))).find(({ child }) => child.id === activeId);
|
|
163
|
+
const activeGroup = groups.find((group) => group.id === activeId);
|
|
164
|
+
const current = activeChild ? {
|
|
165
|
+
icon: activeChild.group.icon,
|
|
166
|
+
title: activeChild.child.title,
|
|
167
|
+
parent: activeChild.group.title
|
|
168
|
+
} : {
|
|
169
|
+
icon: activeGroup?.icon,
|
|
170
|
+
title: activeGroup?.title ?? label,
|
|
171
|
+
parent: void 0
|
|
172
|
+
};
|
|
173
|
+
const CurrentIcon = current.icon;
|
|
174
|
+
/** A group whose subtree holds the active section: tinted like the tree's row, but not `aria-current`. */
|
|
175
|
+
const holdsActive = (group) => group.id === activeId || group.children.some((child) => child.id === activeId);
|
|
176
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("nav", {
|
|
177
|
+
"aria-label": label,
|
|
178
|
+
className: cn("tailwindcss-preflight", "tw:w-full tw:flex-col tw:gap-0.5 tw:@[640px]/section-nav:flex tw:@max-[640px]/section-nav:hidden", className),
|
|
179
|
+
children: groups.map((group) => /* @__PURE__ */ jsx(SectionNavGroupRow, {
|
|
180
|
+
group,
|
|
181
|
+
activeId,
|
|
182
|
+
renderItem,
|
|
183
|
+
showDescriptions
|
|
184
|
+
}, group.id))
|
|
185
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
186
|
+
className: "tw:w-full tw:bg-background tw:@[640px]/section-nav:hidden tw:@max-[640px]/section-nav:block",
|
|
187
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
188
|
+
asChild: true,
|
|
189
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
190
|
+
variant: "outline",
|
|
191
|
+
className: "tw:w-full tw:justify-between",
|
|
192
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
193
|
+
className: "tw:flex tw:min-w-0 tw:items-center tw:gap-2",
|
|
194
|
+
children: [
|
|
195
|
+
CurrentIcon && /* @__PURE__ */ jsx(CurrentIcon, { className: "tw:size-4 tw:shrink-0" }),
|
|
196
|
+
current.parent && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
197
|
+
className: "tw:truncate tw:font-normal tw:text-muted-foreground",
|
|
198
|
+
children: current.parent
|
|
199
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
200
|
+
className: "tw:text-border",
|
|
201
|
+
children: "/"
|
|
202
|
+
})] }),
|
|
203
|
+
/* @__PURE__ */ jsx("span", {
|
|
204
|
+
className: "tw:truncate tw:font-medium tw:text-foreground",
|
|
205
|
+
children: current.title
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
}), /* @__PURE__ */ jsx(ChevronDown, { className: "tw:size-4 tw:shrink-0" })]
|
|
209
|
+
})
|
|
210
|
+
}), /* @__PURE__ */ jsx(DropdownMenu.Content, {
|
|
211
|
+
align: "start",
|
|
212
|
+
className: "tw:w-(--radix-dropdown-menu-trigger-width)",
|
|
213
|
+
children: groups.map((group) => group.children.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenu.Group, { children: [/* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
214
|
+
asChild: true,
|
|
215
|
+
children: renderItem({
|
|
216
|
+
targetId: group.children[0]?.id ?? group.id,
|
|
217
|
+
isActive: false,
|
|
218
|
+
children: /* @__PURE__ */ jsx(SectionNavItemContent, {
|
|
219
|
+
item: group,
|
|
220
|
+
active: holdsActive(group)
|
|
221
|
+
}),
|
|
222
|
+
itemProps: {
|
|
223
|
+
className: "tw:no-underline",
|
|
224
|
+
"aria-current": void 0,
|
|
225
|
+
"aria-expanded": void 0,
|
|
226
|
+
"data-active": holdsActive(group) ? true : void 0,
|
|
227
|
+
onClick: noop
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
231
|
+
className: "tw:ml-5 tw:border-l tw:border-border tw:py-0.5 tw:pl-1",
|
|
232
|
+
children: group.children.map((child) => /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
233
|
+
asChild: true,
|
|
234
|
+
children: renderItem({
|
|
235
|
+
targetId: child.id,
|
|
236
|
+
isActive: child.id === activeId,
|
|
237
|
+
children: /* @__PURE__ */ jsx(SectionNavItemContent, {
|
|
238
|
+
item: child,
|
|
239
|
+
active: child.id === activeId,
|
|
240
|
+
showDescription: showDescriptions,
|
|
241
|
+
showIcon: false
|
|
242
|
+
}),
|
|
243
|
+
itemProps: {
|
|
244
|
+
className: "tw:no-underline",
|
|
245
|
+
"aria-current": child.id === activeId ? "page" : void 0,
|
|
246
|
+
"aria-expanded": void 0,
|
|
247
|
+
"data-active": void 0,
|
|
248
|
+
onClick: noop
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
}, child.id))
|
|
252
|
+
})] }, group.id) : /* @__PURE__ */ jsx(DropdownMenu.Item, {
|
|
253
|
+
asChild: true,
|
|
254
|
+
children: renderItem({
|
|
255
|
+
targetId: group.id,
|
|
256
|
+
isActive: group.id === activeId,
|
|
257
|
+
children: /* @__PURE__ */ jsx(SectionNavItemContent, {
|
|
258
|
+
item: group,
|
|
259
|
+
active: group.id === activeId
|
|
260
|
+
}),
|
|
261
|
+
itemProps: {
|
|
262
|
+
className: "tw:no-underline",
|
|
263
|
+
"aria-current": group.id === activeId ? "page" : void 0,
|
|
264
|
+
"aria-expanded": void 0,
|
|
265
|
+
"data-active": void 0,
|
|
266
|
+
onClick: noop
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
}, group.id))
|
|
270
|
+
})] })
|
|
271
|
+
})] });
|
|
272
|
+
};
|
|
273
|
+
//#endregion
|
|
274
|
+
export { SectionNav };
|
|
275
|
+
|
|
276
|
+
//# sourceMappingURL=SectionNav-8NoTOKO8.js.map
|