@keboola/design 15.1.0 → 16.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 +6 -5
- package/CHANGELOG.md +69 -0
- package/COMPONENT-API.md +62 -61
- package/dist/{AIKit-BR6jfsdI.js → AIKit-Cf5plya2.js} +328 -210
- package/dist/AIKit-Cf5plya2.js.map +1 -0
- package/dist/{Alert-Chz6KZ7e.js → Alert-DziS8n1H.js} +12 -19
- package/dist/{Alert-Chz6KZ7e.js.map → Alert-DziS8n1H.js.map} +1 -1
- package/dist/{AlertModal-DMsn62JJ.js → AlertModal-De04fFoy.js} +14 -24
- package/dist/{AlertModal-DMsn62JJ.js.map → AlertModal-De04fFoy.js.map} +1 -1
- package/dist/{AppShell-C8V1KRr_.js → AppShell-BUa3U7-e.js} +6 -9
- package/dist/{AppShell-C8V1KRr_.js.map → AppShell-BUa3U7-e.js.map} +1 -1
- package/dist/{AutoSaveTextarea-BbMhC5Aq.js → AutoSaveTextarea-CXHOQSun.js} +4 -5
- package/dist/{AutoSaveTextarea-BbMhC5Aq.js.map → AutoSaveTextarea-CXHOQSun.js.map} +1 -1
- package/dist/{Badge-CqlOE5A2.js → Badge-CFRhducL.js} +9 -14
- package/dist/{Badge-CqlOE5A2.js.map → Badge-CFRhducL.js.map} +1 -1
- package/dist/{BrandEditor-D61pzWRq.js → BrandEditor-hiLBX7az.js} +16 -23
- package/dist/{BrandEditor-D61pzWRq.js.map → BrandEditor-hiLBX7az.js.map} +1 -1
- package/dist/{BrandLogo-DkESE19K.js → BrandLogo-Dn7hhp2c.js} +4 -5
- package/dist/{BrandLogo-DkESE19K.js.map → BrandLogo-Dn7hhp2c.js.map} +1 -1
- package/dist/{Breadcrumb-DbqvDnYl.js → Breadcrumb-uGFEIjFF.js} +17 -28
- package/dist/{Breadcrumb-DbqvDnYl.js.map → Breadcrumb-uGFEIjFF.js.map} +1 -1
- package/dist/{Button-BNkyYU8u.js → Button-DbvGzEDb.js} +24 -20
- package/dist/Button-DbvGzEDb.js.map +1 -0
- package/dist/{Calendar-BnKi1kPu.js → Calendar-lJBTETbk.js} +752 -905
- package/dist/Calendar-lJBTETbk.js.map +1 -0
- package/dist/{Card-DxjGiqH8.js → Card-VIPfOVW5.js} +8 -14
- package/dist/{Card-DxjGiqH8.js.map → Card-VIPfOVW5.js.map} +1 -1
- package/dist/{Checkbox-CHDDJyAA.js → Checkbox-B2jLlyaO.js} +6 -8
- package/dist/{Checkbox-CHDDJyAA.js.map → Checkbox-B2jLlyaO.js.map} +1 -1
- package/dist/{Clipboard-DlwVZS1P.js → Clipboard-fAkDdpEu.js} +4 -5
- package/dist/{Clipboard-DlwVZS1P.js.map → Clipboard-fAkDdpEu.js.map} +1 -1
- package/dist/{ClipboardButton-B1Hr_n_Z.js → ClipboardButton-71Ugbl8c.js} +6 -8
- package/dist/{ClipboardButton-B1Hr_n_Z.js.map → ClipboardButton-71Ugbl8c.js.map} +1 -1
- package/dist/{CodeEditor-DVSPdfdo.js → CodeEditor-D_b-ZCng.js} +19 -31
- package/dist/{CodeEditor-DVSPdfdo.js.map → CodeEditor-D_b-ZCng.js.map} +1 -1
- package/dist/{Collapsible-DD4xTL75.js → Collapsible-zsXk4Vpp.js} +5 -8
- package/dist/{Collapsible-DD4xTL75.js.map → Collapsible-zsXk4Vpp.js.map} +1 -1
- package/dist/{ColorInput-B_eZIu39.js → ColorInput-Cjr1jkvy.js} +9 -12
- package/dist/{ColorInput-B_eZIu39.js.map → ColorInput-Cjr1jkvy.js.map} +1 -1
- package/dist/{ColorModeSwitch-BlrH8jAi.js → ColorModeSwitch-CuPYnJ2V.js} +5 -6
- package/dist/{ColorModeSwitch-BlrH8jAi.js.map → ColorModeSwitch-CuPYnJ2V.js.map} +1 -1
- package/dist/{Combobox-BLqX-Tdh.js → Combobox-DYjvYgl3.js} +37 -66
- package/dist/{Combobox-BLqX-Tdh.js.map → Combobox-DYjvYgl3.js.map} +1 -1
- package/dist/{Command-DhXmqFLT.js → Command-BcTb6GsR.js} +14 -24
- package/dist/{Command-DhXmqFLT.js.map → Command-BcTb6GsR.js.map} +1 -1
- package/dist/{CopyField-D0Pg4Z0R.js → CopyField-CnwAvQz9.js} +16 -28
- package/dist/{CopyField-D0Pg4Z0R.js.map → CopyField-CnwAvQz9.js.map} +1 -1
- package/dist/{DateInput-duinbI9_.js → DateInput-DJNX7Vdx.js} +8 -10
- package/dist/{DateInput-duinbI9_.js.map → DateInput-DJNX7Vdx.js.map} +1 -1
- package/dist/{DatePicker-Cg_aG_N4.js → DatePicker-CI59gF3S.js} +4 -5
- package/dist/{DatePicker-Cg_aG_N4.js.map → DatePicker-CI59gF3S.js.map} +1 -1
- package/dist/{DateRangeInput-BYVHf9zo.js → DateRangeInput-B3g8cyS0.js} +8 -10
- package/dist/{DateRangeInput-BYVHf9zo.js.map → DateRangeInput-B3g8cyS0.js.map} +1 -1
- package/dist/{DateRangePicker-m47cSV1r.js → DateRangePicker-48yOB2qV.js} +9 -10
- package/dist/{DateRangePicker-m47cSV1r.js.map → DateRangePicker-48yOB2qV.js.map} +1 -1
- package/dist/{DiffView-Dy4z-n-1.js → DiffView-DITZdVbh.js} +7 -12
- package/dist/{DiffView-Dy4z-n-1.js.map → DiffView-DITZdVbh.js.map} +1 -1
- package/dist/{DropdownMenu-Bum99mVf.js → DropdownMenu-Ba9atqDa.js} +20 -36
- package/dist/{DropdownMenu-Bum99mVf.js.map → DropdownMenu-Ba9atqDa.js.map} +1 -1
- package/dist/{FieldBox-BrxLkY9C.js → FieldBox-DdSdJ3ZN.js} +6 -10
- package/dist/{FieldBox-BrxLkY9C.js.map → FieldBox-DdSdJ3ZN.js.map} +1 -1
- package/dist/{FieldItem-BHUqgSO1.js → FieldItem-D7eCMfMB.js} +6 -8
- package/dist/{FieldItem-BHUqgSO1.js.map → FieldItem-D7eCMfMB.js.map} +1 -1
- package/dist/{FieldItem-CPN1xjN5.d.ts → FieldItem-fqm3CNR8.d.ts} +7 -6
- package/dist/{FileUpload-BYFONpEl.js → FileUpload-DskvxhAr.js} +25 -45
- package/dist/{FileUpload-BYFONpEl.js.map → FileUpload-DskvxhAr.js.map} +1 -1
- package/dist/{Form-Dqbt_tIs.js → Form-BUNW7nlt.js} +24 -38
- package/dist/{Form-Dqbt_tIs.js.map → Form-BUNW7nlt.js.map} +1 -1
- package/dist/{FormGroup-V5kIgQRN.js → FormGroup-QJB21LKp.js} +12 -20
- package/dist/{FormGroup-V5kIgQRN.js.map → FormGroup-QJB21LKp.js.map} +1 -1
- package/dist/{FullScreenModal-DAvvlGOz.js → FullScreenModal-RzY5XxiG.js} +8 -12
- package/dist/{FullScreenModal-DAvvlGOz.js.map → FullScreenModal-RzY5XxiG.js.map} +1 -1
- package/dist/{HoverCard-Cf9iYyaW.js → HoverCard-OGWKRXJ7.js} +4 -6
- package/dist/{HoverCard-Cf9iYyaW.js.map → HoverCard-OGWKRXJ7.js.map} +1 -1
- package/dist/{InlineEdit-D4P0SvCB.js → InlineEdit-CXL0ZslO.js} +7 -8
- package/dist/{InlineEdit-D4P0SvCB.js.map → InlineEdit-CXL0ZslO.js.map} +1 -1
- package/dist/{InputGroup-CZv_7QlM.js → InputGroup-BWeanEo7.js} +9 -15
- package/dist/{InputGroup-CZv_7QlM.js.map → InputGroup-BWeanEo7.js.map} +1 -1
- package/dist/{Kbd-CflKthfu.js → Kbd-BprYCICe.js} +8 -13
- package/dist/{Kbd-CflKthfu.js.map → Kbd-BprYCICe.js.map} +1 -1
- package/dist/{MarkedText-DlmlJO0u.js → MarkedText-BrganZ_V.js} +4 -6
- package/dist/{MarkedText-DlmlJO0u.js.map → MarkedText-BrganZ_V.js.map} +1 -1
- package/dist/{MermaidDiagram-2-EuNu1i.js → MermaidDiagram-E3azndPk.js} +9 -11
- package/dist/{MermaidDiagram-2-EuNu1i.js.map → MermaidDiagram-E3azndPk.js.map} +1 -1
- package/dist/{Modal-DwuvuiUx.js → Modal-Cf_kPEBW.js} +13 -21
- package/dist/{Modal-DwuvuiUx.js.map → Modal-Cf_kPEBW.js.map} +1 -1
- package/dist/{ModalTitle-RGWwIMU6.js → ModalTitle-7vgpfc6B.js} +5 -8
- package/dist/{ModalTitle-RGWwIMU6.js.map → ModalTitle-7vgpfc6B.js.map} +1 -1
- package/dist/{MultiActionButtonGroup-Dzig87s1.js → MultiActionButtonGroup-8WQwL4UQ.js} +6 -8
- package/dist/{MultiActionButtonGroup-Dzig87s1.js.map → MultiActionButtonGroup-8WQwL4UQ.js.map} +1 -1
- package/dist/{Navbar-DHUS7XiU.js → Navbar-CRjxVboE.js} +13 -22
- package/dist/{Navbar-DHUS7XiU.js.map → Navbar-CRjxVboE.js.map} +1 -1
- package/dist/{OtpInput-CY8yCaJk.js → OtpInput-C5plPzGU.js} +7 -11
- package/dist/{OtpInput-CY8yCaJk.js.map → OtpInput-C5plPzGU.js.map} +1 -1
- package/dist/{PageHeader-CL1A6jFM.js → PageHeader-DosMyar2.js} +6 -10
- package/dist/{PageHeader-CL1A6jFM.js.map → PageHeader-DosMyar2.js.map} +1 -1
- package/dist/{PageLayout-C9aXTpqV.js → PageLayout-LcvJccOW.js} +5 -8
- package/dist/{PageLayout-C9aXTpqV.js.map → PageLayout-LcvJccOW.js.map} +1 -1
- package/dist/{PageToolbar-LKP6PiP_.js → PageToolbar-By2HznxO.js} +8 -10
- package/dist/{PageToolbar-LKP6PiP_.js.map → PageToolbar-By2HznxO.js.map} +1 -1
- package/dist/{Pagination-D27x5KmH.js → Pagination-DrXTrvfD.js} +11 -18
- package/dist/{Pagination-D27x5KmH.js.map → Pagination-DrXTrvfD.js.map} +1 -1
- package/dist/{Popconfirm-p72DiagN.js → Popconfirm-BJuDOHdv.js} +46 -25
- package/dist/Popconfirm-BJuDOHdv.js.map +1 -0
- package/dist/{Popover-DnBw5Uay.js → Popover-DhOPlWgF.js} +4 -6
- package/dist/{Popover-DnBw5Uay.js.map → Popover-DhOPlWgF.js.map} +1 -1
- package/dist/{RadioGroup-B0TwHjBb.js → RadioGroup-B9oC8P15.js} +12 -18
- package/dist/{RadioGroup-B0TwHjBb.js.map → RadioGroup-B9oC8P15.js.map} +1 -1
- package/dist/{Resizable-D8zs0kcq.js → Resizable-Co-L3qg7.js} +4 -6
- package/dist/{Resizable-D8zs0kcq.js.map → Resizable-Co-L3qg7.js.map} +1 -1
- package/dist/{Search-vyZwGKMU.js → Search-OgaNjqQM.js} +26 -21
- package/dist/Search-OgaNjqQM.js.map +1 -0
- package/dist/{SearchInput-DyYXyw3u.js → SearchInput-eLS-uvOn.js} +18 -29
- package/dist/SearchInput-eLS-uvOn.js.map +1 -0
- package/dist/{SectionNav-6hcIpZLO.js → SectionNav-L81iJBo3.js} +11 -14
- package/dist/{SectionNav-6hcIpZLO.js.map → SectionNav-L81iJBo3.js.map} +1 -1
- package/dist/{Select-C6zKeip5.js → Select-DRdkdzBp.js} +28 -25
- package/dist/{Select-C6zKeip5.js.map → Select-DRdkdzBp.js.map} +1 -1
- package/dist/{Sheet-DKG20J7W.js → Sheet-DVb4XoJ5.js} +12 -19
- package/dist/{Sheet-DKG20J7W.js.map → Sheet-DVb4XoJ5.js.map} +1 -1
- package/dist/{Sidebar-BlYqasnX.js → Sidebar-DYvodJWN.js} +43 -75
- package/dist/{Sidebar-BlYqasnX.js.map → Sidebar-DYvodJWN.js.map} +1 -1
- package/dist/{Slider-DrcsM8_G.js → Slider-B9IskDxf.js} +8 -12
- package/dist/{Slider-DrcsM8_G.js.map → Slider-B9IskDxf.js.map} +1 -1
- package/dist/{Stepper-CQrUPVFL.js → Stepper-D7VspVEt.js} +11 -19
- package/dist/{Stepper-CQrUPVFL.js.map → Stepper-D7VspVEt.js.map} +1 -1
- package/dist/{Switch-DccpSpzC.js → Switch-DONWW7ju.js} +4 -6
- package/dist/{Switch-DccpSpzC.js.map → Switch-DONWW7ju.js.map} +1 -1
- package/dist/{Table-CilEvpMq.js → Table-BwgBm3hJ.js} +12 -21
- package/dist/{Table-CilEvpMq.js.map → Table-BwgBm3hJ.js.map} +1 -1
- package/dist/{Tabs-Ck4uWf8U.js → Tabs-DmJB4l_N.js} +9 -14
- package/dist/{Tabs-Ck4uWf8U.js.map → Tabs-DmJB4l_N.js.map} +1 -1
- package/dist/{TextInput-CR0_USaY.js → TextInput--1CfZybC.js} +8 -10
- package/dist/TextInput--1CfZybC.js.map +1 -0
- package/dist/{ThemeProvider-BTK7AL-T.js → ThemeProvider-BCHllN7d.js} +8 -13
- package/dist/{ThemeProvider-BTK7AL-T.js.map → ThemeProvider-BCHllN7d.js.map} +1 -1
- package/dist/{TimePicker-lk3NGqeK.js → TimePicker-CCV3SOw5.js} +4 -6
- package/dist/{TimePicker-lk3NGqeK.js.map → TimePicker-CCV3SOw5.js.map} +1 -1
- package/dist/{Timeline-DUXgByUE.js → Timeline-EMOpTLAT.js} +8 -13
- package/dist/{Timeline-DUXgByUE.js.map → Timeline-EMOpTLAT.js.map} +1 -1
- package/dist/{Toast-937n7n8i.js → Toast-BOTINeTX.js} +4 -6
- package/dist/{Toast-937n7n8i.js.map → Toast-BOTINeTX.js.map} +1 -1
- package/dist/{ToggleAllTooltip-DEjbWFoj.js → ToggleAllTooltip-BFmA6TXf.js} +4 -6
- package/dist/{ToggleAllTooltip-DEjbWFoj.js.map → ToggleAllTooltip-BFmA6TXf.js.map} +1 -1
- package/dist/{ToggleGroup-BOz1yyz6.js → ToggleGroup-DsDS7k70.js} +3 -4
- package/dist/{ToggleGroup-BOz1yyz6.js.map → ToggleGroup-DsDS7k70.js.map} +1 -1
- package/dist/{Workbench-CxgNCs3I.js → Workbench-4s0xP6XU.js} +18 -32
- package/dist/{Workbench-CxgNCs3I.js.map → Workbench-4s0xP6XU.js.map} +1 -1
- package/dist/{ZoomableSvg-CxXKanUR.js → ZoomableSvg-BRPGgaWJ.js} +8 -10
- package/dist/{ZoomableSvg-CxXKanUR.js.map → ZoomableSvg-BRPGgaWJ.js.map} +1 -1
- package/dist/charts.d.ts +0 -16
- package/dist/charts.js +10 -19
- package/dist/charts.js.map +1 -1
- package/dist/{classNames-DcGnTh2N.js → classNames-DkX30VJU.js} +2 -3
- package/dist/{classNames-DcGnTh2N.js.map → classNames-DkX30VJU.js.map} +1 -1
- package/dist/editors.d.ts +2 -16
- package/dist/editors.js +16 -26
- package/dist/editors.js.map +1 -1
- package/dist/{findLiteralMatches-DgGLzyG0.js → findLiteralMatches-BaLZTPtx.js} +2 -3
- package/dist/{findLiteralMatches-DgGLzyG0.js.map → findLiteralMatches-BaLZTPtx.js.map} +1 -1
- package/dist/flint.d.ts +0 -2
- package/dist/flint.js +10 -14
- package/dist/flint.js.map +1 -1
- package/dist/{highlightCode-D354tCXO.js → highlightCode-2spZP7ZA.js} +2 -3
- package/dist/{highlightCode-D354tCXO.js.map → highlightCode-2spZP7ZA.js.map} +1 -1
- package/dist/{icons-ZIeZXXS7.js → icons-DDR9dFSr.js} +21 -40
- package/dist/{icons-ZIeZXXS7.js.map → icons-DDR9dFSr.js.map} +1 -1
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +1 -2
- package/dist/{index-D-itZ3VP.d.ts → index-BljYaTWL.d.ts} +1 -39
- package/dist/index.d.ts +418 -1296
- package/dist/index.js +75 -74
- package/dist/internal/blocks/AIKit.js +1 -2
- package/dist/internal/blocks/AppShell.js +1 -2
- package/dist/internal/blocks/AuthLayout.js +3 -4
- package/dist/internal/blocks/AutoSaveTextarea.js +1 -2
- package/dist/internal/blocks/BrandEditor.js +1 -2
- package/dist/internal/blocks/ChartPanel.js +3 -4
- package/dist/internal/blocks/ChipEditor.js +6 -7
- package/dist/internal/blocks/ClipboardButton.js +1 -2
- package/dist/internal/blocks/ColorInput.js +1 -2
- package/dist/internal/blocks/ColorModeSwitch.js +1 -2
- package/dist/internal/blocks/Command.js +1 -2
- package/dist/internal/blocks/CopyField.js +1 -2
- package/dist/internal/blocks/DashboardHero.js +2 -3
- package/dist/internal/blocks/DateInput.js +1 -2
- package/dist/internal/blocks/DateRangeInput.js +1 -2
- package/dist/internal/blocks/DiagramShared/DiagramSkeleton.js +1 -2
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +2 -3
- package/dist/internal/blocks/EmptyState.js +1 -2
- package/dist/internal/blocks/ErrorState.js +1 -2
- package/dist/internal/blocks/ExportMenu.js +5 -6
- package/dist/internal/blocks/FacebookButton.js +3 -4
- package/dist/internal/blocks/Form/connectors/ComboboxField.js +3 -4
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +2 -3
- package/dist/internal/blocks/Form.js +3 -2
- package/dist/internal/blocks/FormGroup.js +1 -2
- package/dist/internal/blocks/GoogleButton.js +3 -4
- package/dist/internal/blocks/InlineEdit.js +1 -2
- package/dist/internal/blocks/MicrosoftButton.js +3 -4
- package/dist/internal/blocks/MultiActionButtonGroup.js +1 -2
- package/dist/internal/blocks/MultiCombobox.js +7 -8
- package/dist/internal/blocks/NumberInput.js +2 -3
- package/dist/internal/blocks/OtpInput.js +1 -2
- package/dist/internal/blocks/PageHeader.js +1 -2
- package/dist/internal/blocks/PageLayout.js +1 -2
- package/dist/internal/blocks/PageToolbar.js +1 -2
- package/dist/internal/blocks/PasswordInput.js +5 -6
- package/dist/internal/blocks/SearchInput.js +1 -2
- package/dist/internal/blocks/SearchInputWithNavigation.js +6 -7
- package/dist/internal/blocks/SectionNav.js +1 -2
- package/dist/internal/blocks/SplitButton.js +4 -5
- package/dist/internal/blocks/StatCard.js +4 -6
- package/dist/internal/blocks/StatCard.js.map +1 -1
- package/dist/internal/blocks/TextInput.js +1 -2
- package/dist/internal/blocks/Textarea.js +3 -4
- package/dist/internal/blocks/TimeInput.js +6 -7
- package/dist/internal/components/Alert.js +1 -2
- package/dist/internal/components/AlertModal.js +1 -2
- package/dist/internal/components/Avatar.js +3 -4
- package/dist/internal/components/Badge.js +1 -2
- package/dist/internal/components/BrandLogo.js +1 -2
- package/dist/internal/components/Breadcrumb.js +1 -2
- package/dist/internal/components/Button.js +1 -2
- package/dist/internal/components/ButtonGroup.js +2 -3
- package/dist/internal/components/Calendar.js +1 -2
- package/dist/internal/components/Card.js +1 -2
- package/dist/internal/components/Checkbox.js +1 -2
- package/dist/internal/components/Clipboard.js +1 -2
- package/dist/internal/components/Collapsible.js +1 -2
- package/dist/internal/components/CollapsiblePanel.js +5 -6
- package/dist/internal/components/Combobox.js +1 -2
- package/dist/internal/components/DatePicker.js +1 -2
- package/dist/internal/components/DateRangePicker.js +1 -2
- package/dist/internal/components/DiffView.js +1 -2
- package/dist/internal/components/DotsLoader.js +2 -3
- package/dist/internal/components/DropdownMenu.js +1 -2
- package/dist/internal/components/EmptySearchContent.js +1 -2
- package/dist/internal/components/FileUpload.js +1 -2
- package/dist/internal/components/FullScreenModal.js +1 -2
- package/dist/internal/components/HelpBlock.js +1 -2
- package/dist/internal/components/HoverCard.js +1 -2
- package/dist/internal/components/InputGroup.js +1 -2
- package/dist/internal/components/Kbd.js +1 -2
- package/dist/internal/components/Label.js +2 -3
- package/dist/internal/components/Link.js +2 -3
- package/dist/internal/components/MarkedText.js +1 -2
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +3 -4
- package/dist/internal/components/MergeEditor/PaneHeader.js +1 -2
- package/dist/internal/components/MergeEditor/constants.js +1 -2
- package/dist/internal/components/MergeEditor/useMergeDiff.js +1 -2
- package/dist/internal/components/Modal.js +1 -2
- package/dist/internal/components/Navbar.js +1 -2
- package/dist/internal/components/Pagination.js +1 -2
- package/dist/internal/components/PanelWithDetails.js +4 -5
- package/dist/internal/components/Popconfirm.js +1 -2
- package/dist/internal/components/Popover.js +1 -2
- package/dist/internal/components/Progress.js +2 -3
- package/dist/internal/components/RadioGroup.js +1 -2
- package/dist/internal/components/Resizable.js +1 -2
- package/dist/internal/components/ScrollArea.js +3 -5
- package/dist/internal/components/ScrollArea.js.map +1 -1
- package/dist/internal/components/Search.js +1 -2
- package/dist/internal/components/Select.js +1 -2
- package/dist/internal/components/Separator.js +2 -3
- package/dist/internal/components/Sheet.js +1 -2
- package/dist/internal/components/Sidebar.js +1 -2
- package/dist/internal/components/Skeleton/Skeleton.js +2 -3
- package/dist/internal/components/Skeleton/SkeletonList.js +2 -3
- package/dist/internal/components/Slider.js +1 -2
- package/dist/internal/components/SpotlightBackdrop.js +3 -5
- package/dist/internal/components/SpotlightBackdrop.js.map +1 -1
- package/dist/internal/components/Stepper.js +1 -2
- package/dist/internal/components/Switch.js +1 -2
- package/dist/internal/components/Table.js +1 -2
- package/dist/internal/components/Tabs.js +1 -2
- package/dist/internal/components/ThemeProvider.js +2 -2
- package/dist/internal/components/TimePicker.js +1 -2
- package/dist/internal/components/Timeline.js +1 -2
- package/dist/internal/components/Toast.js +2 -2
- package/dist/internal/components/Toggle.js +2 -3
- package/dist/internal/components/ToggleGroup.js +1 -2
- package/dist/internal/components/Tooltip.js +1 -2
- package/dist/internal/components/Truncated.js +3 -4
- package/dist/internal/components/Workbench.js +1 -2
- package/dist/internal/components/ZoomableSvg.js +1 -2
- package/dist/internal/hooks/useAltDigitHotkey.js +1 -2
- package/dist/internal/hooks/useAutosizeInput.js +1 -2
- package/dist/internal/hooks/useScrollbarPosition.js +2 -3
- package/dist/internal/hooks/useStableCallback.js +1 -2
- package/dist/internal/hooks/useTimeout.js +1 -2
- package/dist/internal/utils/accessibleName.js +1 -2
- package/dist/internal/utils/mergeRefs.js +1 -2
- package/dist/internal/utils.js +3 -3
- package/dist/markdown-editor.d.ts +0 -4
- package/dist/markdown-editor.js +30 -49
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +0 -2
- package/dist/mermaid.js +1 -2
- package/dist/rjsf.d.ts +0 -8
- package/dist/rjsf.js +47 -78
- package/dist/rjsf.js.map +1 -1
- package/dist/{rolldown-runtime-Bdc48AWt.js → rolldown-runtime-BrwM56v-.js} +2 -3
- package/dist/{styles-T8xwr0sR.js → styles-BXXXosW_.js} +2 -3
- package/dist/{styles-T8xwr0sR.js.map → styles-BXXXosW_.js.map} +1 -1
- package/dist/{styles-DxazJ8Mz.js → styles-nwtCRF7y.js} +2 -3
- package/dist/{styles-DxazJ8Mz.js.map → styles-nwtCRF7y.js.map} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{svgCache-Dhmbe-7i.js → svgCache-BzvN_fgr.js} +2 -3
- package/dist/{svgCache-Dhmbe-7i.js.map → svgCache-BzvN_fgr.js.map} +1 -1
- package/dist/{svgTransforms-Hnvev3Vs.js → svgTransforms-BBxxO9T6.js} +4 -6
- package/dist/{svgTransforms-Hnvev3Vs.js.map → svgTransforms-BBxxO9T6.js.map} +1 -1
- package/dist/testing.d.ts +0 -2
- package/dist/testing.js +2 -3
- package/dist/{themeScopeContext-CEVXbYvZ.js → themeScopeContext-BZGPdyG8.js} +6 -11
- package/dist/{themeScopeContext-CEVXbYvZ.js.map → themeScopeContext-BZGPdyG8.js.map} +1 -1
- package/dist/{themeTokens-DCeb62ap.js → themeTokens-B60cQtAY.js} +4 -6
- package/dist/{themeTokens-DCeb62ap.js.map → themeTokens-B60cQtAY.js.map} +1 -1
- package/dist/{toast-Y3cTMBW8.js → toast-Dzj1EFOb.js} +10 -17
- package/dist/{toast-Y3cTMBW8.js.map → toast-Dzj1EFOb.js.map} +1 -1
- package/dist/{types-BPcAjMG0.d.ts → types-CsZuwfxc.d.ts} +1 -3
- package/dist/{useControllableState-CUYXMsfz.js → useControllableState-BCvUOC6G.js} +2 -3
- package/dist/{useControllableState-CUYXMsfz.js.map → useControllableState-BCvUOC6G.js.map} +1 -1
- package/dist/{useElement-D-RjrGa4.js → useElement-Dcoo9Jlr.js} +2 -3
- package/dist/{useElement-D-RjrGa4.js.map → useElement-Dcoo9Jlr.js.map} +1 -1
- package/dist/{useMergeDiff-CvowEXJ1.js → useMergeDiff-DFIATaTw.js} +3 -5
- package/dist/{useMergeDiff-CvowEXJ1.js.map → useMergeDiff-DFIATaTw.js.map} +1 -1
- package/dist/{utils-DwC9u0tM.js → utils-DjFceY3H.js} +18 -34
- package/dist/{utils-DwC9u0tM.js.map → utils-DjFceY3H.js.map} +1 -1
- package/dist/vega.d.ts +1 -5
- package/dist/vega.js +3 -4
- package/dist/{vegaTheme-ISwGXvof.js → vegaTheme-BcTNRmVS.js} +3 -4
- package/dist/{vegaTheme-ISwGXvof.js.map → vegaTheme-BcTNRmVS.js.map} +1 -1
- package/dist/{vegaTokens-DCkvpIVE.js → vegaTokens-DnCcy7JY.js} +3 -4
- package/dist/{vegaTokens-DCkvpIVE.js.map → vegaTokens-DnCcy7JY.js.map} +1 -1
- package/package.json +40 -40
- package/src/styles.css +70 -4
- package/src/theme.css +113 -11
- package/dist/AIKit-BR6jfsdI.js.map +0 -1
- package/dist/Button-BNkyYU8u.js.map +0 -1
- package/dist/Calendar-BnKi1kPu.js.map +0 -1
- package/dist/Popconfirm-p72DiagN.js.map +0 -1
- package/dist/Search-vyZwGKMU.js.map +0 -1
- package/dist/SearchInput-DyYXyw3u.js.map +0 -1
- package/dist/TextInput-CR0_USaY.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cn } from "./classNames-
|
|
1
|
+
import { cn } from "./classNames-DkX30VJU.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/blocks/PageHeader/styles.ts
|
|
4
4
|
const titleRowClass = "tw:group/title-row tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2 tw:has-[[data-slot=inline-edit]]:items-start";
|
|
5
5
|
const titleLineClass = "tw:group-has-[[data-slot=inline-edit]]/title-row:min-h-9";
|
|
6
6
|
const titleCompactLineClass = "tw:group-has-[[data-slot=inline-edit]]/title-row:min-h-7";
|
|
@@ -9,8 +9,7 @@ const titleIconClass = "tw:flex tw:shrink-0 tw:items-center tw:group-has-[[data-
|
|
|
9
9
|
const titleCompactIconClass = "tw:flex tw:shrink-0 tw:items-center tw:group-has-[[data-slot=inline-edit]]/title-row:h-7";
|
|
10
10
|
const titleClass = "tw:m-0 tw:text-3xl tw:font-semibold tw:leading-9 tw:text-foreground tw:break-words tw:has-[[data-slot=inline-edit]]:min-w-0 tw:has-[[data-expanded]]:flex-1";
|
|
11
11
|
const titleCompactClass = "tw:m-0 tw:text-xl tw:font-semibold tw:leading-7 tw:text-foreground tw:break-words tw:has-[[data-slot=inline-edit]]:min-w-0 tw:has-[[data-expanded]]:flex-1";
|
|
12
|
-
|
|
13
|
-
//#region src/blocks/PageHeader/PageHeaderDetail.tsx
|
|
12
|
+
// src/blocks/PageHeader/PageHeaderDetail.tsx
|
|
14
13
|
/**
|
|
15
14
|
* Page header for one entity with a parent hierarchy worth breadcrumbing.
|
|
16
15
|
*
|
|
@@ -95,8 +94,7 @@ const PageHeaderDetail = ({ ref, className, breadcrumbs, overflowActions, title,
|
|
|
95
94
|
]
|
|
96
95
|
});
|
|
97
96
|
};
|
|
98
|
-
|
|
99
|
-
//#region src/blocks/PageHeader/PageHeaderIndex.tsx
|
|
97
|
+
// src/blocks/PageHeader/PageHeaderIndex.tsx
|
|
100
98
|
/**
|
|
101
99
|
* Page header for top-level list / collection pages.
|
|
102
100
|
*
|
|
@@ -149,8 +147,7 @@ const PageHeaderIndex = ({ ref, className, title, description, metadata, documen
|
|
|
149
147
|
}), headerNav]
|
|
150
148
|
});
|
|
151
149
|
};
|
|
152
|
-
|
|
153
|
-
//#region src/blocks/PageHeader/PageHeader.tsx
|
|
150
|
+
// src/blocks/PageHeader/PageHeader.tsx
|
|
154
151
|
/**
|
|
155
152
|
* Page header whose variant types enforce the page-header patterns.
|
|
156
153
|
*
|
|
@@ -165,7 +162,6 @@ const PageHeader = {
|
|
|
165
162
|
/** Single-entity pages: required breadcrumbs, overflow menu, max 2 visible actions. */
|
|
166
163
|
Detail: PageHeaderDetail
|
|
167
164
|
};
|
|
168
|
-
//#endregion
|
|
169
165
|
export { PageHeader };
|
|
170
166
|
|
|
171
|
-
//# sourceMappingURL=PageHeader-
|
|
167
|
+
//# sourceMappingURL=PageHeader-DosMyar2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageHeader-CL1A6jFM.js","names":[],"sources":["../src/blocks/PageHeader/styles.ts","../src/blocks/PageHeader/PageHeaderDetail.tsx","../src/blocks/PageHeader/PageHeaderIndex.tsx","../src/blocks/PageHeader/PageHeader.tsx"],"sourcesContent":["// A title holding an InlineEdit is top-aligned, with the icon and badges one title line tall,\n// so they centre on its first line however far it wraps. Other titles stay centred.\nexport const titleRowClass =\n 'tw:group/title-row tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2 tw:has-[[data-slot=inline-edit]]:items-start';\nexport const titleLineClass = 'tw:group-has-[[data-slot=inline-edit]]/title-row:min-h-9';\nexport const titleCompactLineClass = 'tw:group-has-[[data-slot=inline-edit]]/title-row:min-h-7';\n// Actions step aside while the title is renamed, and fade back once it has shrunk.\n// - Invisible at zero width rather than gone: a legacy 40px button holds the row's height.\n// - Held on one line, so their wrapped contents add no room below the field.\n// - The group drops its gap, so the field's last button lines up with the actions above.\nexport const titleGroupClass =\n 'tw:group/title tw:has-[[data-slot=inline-edit][data-expanded]]:gap-x-0';\nexport const actionsHiddenWhileRenamingClass =\n 'tw:transition-opacity tw:duration-150 tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:invisible tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:w-0 tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:flex-nowrap tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:overflow-hidden tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:opacity-0';\n// Badges, no taller than the title line, are gone while it is renamed and fade back once it settles.\nexport const badgesHiddenWhileRenamingClass =\n 'tw:transition-opacity tw:duration-150 tw:group-has-[[data-slot=inline-edit][data-settled]]/title:starting:opacity-0 tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:hidden';\n// Beside an InlineEdit the icon box is exactly one line tall, so a taller icon overhangs it evenly.\nexport const titleIconClass =\n 'tw:flex tw:shrink-0 tw:items-center tw:group-has-[[data-slot=inline-edit]]/title-row:h-9';\nexport const titleCompactIconClass =\n 'tw:flex tw:shrink-0 tw:items-center tw:group-has-[[data-slot=inline-edit]]/title-row:h-7';\n// A title holding an InlineEdit may shrink below its text; an open rename takes the rest of the row.\nexport const titleClass =\n 'tw:m-0 tw:text-3xl tw:font-semibold tw:leading-9 tw:text-foreground tw:break-words tw:has-[[data-slot=inline-edit]]:min-w-0 tw:has-[[data-expanded]]:flex-1';\nexport const titleCompactClass =\n 'tw:m-0 tw:text-xl tw:font-semibold tw:leading-7 tw:text-foreground tw:break-words tw:has-[[data-slot=inline-edit]]:min-w-0 tw:has-[[data-expanded]]:flex-1';\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.\n// Beside an InlineEdit an empty wrapper (no badges to show) collapses, so the title keeps the row.\nexport const badgesClass =\n 'tw:flex tw:flex-wrap tw:items-center tw:gap-2 tw:group-has-[[data-slot=inline-edit]]/title-row:empty:hidden tw:group-has-[[data-slot=inline-edit]]/title-row:has-[>:only-child:empty]:hidden 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 actionsHiddenWhileRenamingClass,\n badgesClass,\n badgesHiddenWhileRenamingClass,\n descriptionClass,\n titleClass,\n titleCompactClass,\n titleCompactIconClass,\n titleCompactLineClass,\n titleGroupClass,\n titleIconClass,\n titleLineClass,\n titleRowClass,\n} from './styles';\n\n// Pattern: docs/patterns/page-header/detail/detail-page-header.md\ntype PageHeaderDetailProps = Omit<ComponentProps<'header'>, 'title'> & {\n /** Chain to the entity's parent. Don't end with the entity's own name — that's the `title`. */\n breadcrumbs: ReactNode;\n /** `DropdownMenu` for all other actions, on the breadcrumbs row. */\n overflowActions?: ReactNode;\n title: ReactNode;\n /** Entity / type icon left of the title. */\n titleIcon?: ReactNode;\n /** `Badge`s beside the title (status, environment, version). */\n badges?: ReactNode;\n description?: ReactNode;\n /** Smaller title for information-dense pages. */\n compact?: boolean;\n /** `Button` with the verb appropriate to the entity (Deploy / Run / Save). */\n primaryAction?: ReactNode;\n /** `Button variant=\"secondary\"`. Further actions go in `overflowActions`. */\n secondaryAction?: ReactNode;\n /** `Tabs` row below the title block. */\n headerNav?: ReactNode;\n /** Description on its own full-width row below title and actions, not in the title column. */\n fullWidthDescription?: boolean;\n};\n\n/**\n * Page header for one entity with a parent hierarchy worth breadcrumbing.\n *\n * - Nest inside `PageLayout.Header`.\n * - A page with no parent hierarchy uses `PageHeader.Index`, even for one entity.\n *\n * @see RECIPES.md#list-detail\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 iconClass = compact ? titleCompactIconClass : titleIconClass;\n const lineClass = compact ? titleCompactLineClass : titleLineClass;\n const titleRow = (\n <div\n className={cn(titleRowClass, 'tw:min-w-64 tw:flex-1 tw:pr-2 tw:has-[[data-expanded]]:pr-0')}\n >\n {titleIcon && <span className={iconClass}>{titleIcon}</span>}\n <h1 className={compact ? titleCompactClass : titleClass}>{title}</h1>\n {badges && (\n <div className={cn(badgesClass, lineClass, badgesHiddenWhileRenamingClass)}>{badges}</div>\n )}\n </div>\n );\n const actions = (primaryAction || secondaryAction) && (\n <div\n className={cn(\n 'tw:ml-auto tw:flex tw:flex-wrap tw:items-center tw:justify-end tw:gap-2',\n actionsHiddenWhileRenamingClass,\n )}\n >\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\n className={cn(\n titleGroupClass,\n 'tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3',\n )}\n >\n {titleRow}\n {actions}\n </div>\n {descriptionNode}\n </div>\n ) : (\n <div\n className={cn(\n titleGroupClass,\n 'tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3',\n )}\n >\n <div className=\"tw:flex tw:min-w-64 tw:flex-1 tw:flex-col tw:gap-2 tw:pr-2 tw:has-[[data-expanded]]:pr-0\">\n <div className={titleRowClass}>\n {titleIcon && <span className={iconClass}>{titleIcon}</span>}\n <h1 className={compact ? titleCompactClass : titleClass}>{title}</h1>\n {badges && (\n <div className={cn(badgesClass, lineClass, badgesHiddenWhileRenamingClass)}>\n {badges}\n </div>\n )}\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// Pattern: docs/patterns/page-header/index/index-page-header.md\ntype PageHeaderIndexProps = Omit<ComponentProps<'header'>, 'title'> & {\n title: ReactNode;\n /** Prose below the title; `metadata` wins when both are set. */\n description?: ReactNode;\n /** Count summary (\"3 buckets and 39 tables\"). Wins over `description`. */\n metadata?: ReactNode;\n /** Icon-only docs button (`Button variant=\"invisible\" icon={<BookOpen />}`). */\n documentation?: ReactNode;\n /** The one primary \"create X\" `Button`. */\n action?: ReactNode;\n /** `Tabs` row below the title block. */\n headerNav?: ReactNode;\n /** Description on its own full-width row; actions wrap below the title on narrow widths. */\n fullWidthDescription?: boolean;\n};\n\n/**\n * Page header for top-level list / collection pages.\n *\n * - No breadcrumbs, no overflow menu.\n * - Search and filters 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 * Page header whose variant types enforce the page-header patterns.\n *\n * - Nest inside `PageLayout.Header`; pass `@keboola/design` `Button`s into the slots.\n * - Other layouts: custom JSX in `PageLayout.Header`; routed tabs: `PageLayout.Tabs`.\n *\n * @see RECIPES.md#page-header-tabs\n */\nexport const PageHeader = {\n /** List / collection pages. No breadcrumbs; `metadata` wins over `description`. */\n Index: PageHeaderIndex,\n /** Single-entity pages: required breadcrumbs, overflow menu, max 2 visible actions. */\n Detail: PageHeaderDetail,\n};\n"],"mappings":";;;AAEA,MAAa,gBACX;AACF,MAAa,iBAAiB;AAC9B,MAAa,wBAAwB;AAKrC,MAAa,kBACX;AAOF,MAAa,iBACX;AACF,MAAa,wBACX;AAEF,MAAa,aACX;AACF,MAAa,oBACX;;;;;;;;;;;ACyBF,MAAa,oBAAoB,EAC/B,KACA,WACA,aACA,iBACA,OACA,WACA,QACA,aACA,UAAU,OACV,eACA,iBACA,WACA,uBAAuB,OACvB,GAAG,YACwB;CAC3B,MAAM,YAAY,UAAU,wBAAwB;CACpD,MAAM,YAAY,UAAU,wBAAwB;CACpD,MAAM,WACJ,qBAAC,OAAD;EACE,WAAW,GAAG,eAAe,6DAA6D;EAD5F,UAAA;GAGG,aAAa,oBAAC,QAAD;IAAM,WAAW;IAAY,UAAA;GAAgB,CAAA;GAC3D,oBAAC,MAAD;IAAI,WAAW,UAAU,oBAAoB;IAAa,UAAA;GAAU,CAAA;GACnE,UACC,oBAAC,OAAD;IAAK,WAAW,GAAA,kVAAgB,WAAA,wLAAyC;IAAI,UAAA;GAAY,CAAA;EAExF;;CAEP,MAAM,WAAW,iBAAiB,oBAChC,qBAAC,OAAD;EACE,WAAW,GACT,2EAAA,uYAEF;EAJF,UAAA,CAMG,iBACA,aACE;;CAEP,MAAM,kBAAkB,eAAe,oBAAC,KAAD;EAAG,WAAA;EAA8B,UAAA;CAAe,CAAA;CACvF,OACE,qBAAC,UAAD;EACO;EACL,WA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,MAAD;MAAI,WAAW;MAAa,UAAA;KAAU,CAAA;IACnC,CAAA,GACJ,cACC,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACG,eACA,MACE;IAEJ,CAAA,CAAA;GACJ,CAAA,GAAA,YAAY,oBAAC,KAAD;IAAG,WAAA;IAA8B,UAAA;GAAY,CAAA,CACvD;EAEL,CAAA,IAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,OAAD;KAAK,WAAW;KACd,UAAA,oBAAC,MAAD;MAAI,WAAW;MAAa,UAAA;KAAU,CAAA;IACnC,CAAA,GACJ,YAAY,oBAAC,KAAD;KAAG,WAAA;KAA8B,UAAA;IAAY,CAAA,CACvD;GACJ,CAAA,GAAA,cACC,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,eACA,MACE;GAEJ,CAAA,CAAA;EAEN,CAAA,GAAA,SACK;;AAEZ;;;;;;;;;;;ACxEA,MAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;AACV"}
|
|
1
|
+
{"version":3,"file":"PageHeader-DosMyar2.js","names":[],"sources":["../src/blocks/PageHeader/styles.ts","../src/blocks/PageHeader/PageHeaderDetail.tsx","../src/blocks/PageHeader/PageHeaderIndex.tsx","../src/blocks/PageHeader/PageHeader.tsx"],"sourcesContent":["// A title holding an InlineEdit is top-aligned, with the icon and badges one title line tall,\n// so they centre on its first line however far it wraps. Other titles stay centred.\nexport const titleRowClass =\n 'tw:group/title-row tw:flex tw:flex-wrap tw:items-center tw:gap-x-3 tw:gap-y-2 tw:has-[[data-slot=inline-edit]]:items-start';\nexport const titleLineClass = 'tw:group-has-[[data-slot=inline-edit]]/title-row:min-h-9';\nexport const titleCompactLineClass = 'tw:group-has-[[data-slot=inline-edit]]/title-row:min-h-7';\n// Actions step aside while the title is renamed, and fade back once it has shrunk.\n// - Invisible at zero width rather than gone: a legacy 40px button holds the row's height.\n// - Held on one line, so their wrapped contents add no room below the field.\n// - The group drops its gap, so the field's last button lines up with the actions above.\nexport const titleGroupClass =\n 'tw:group/title tw:has-[[data-slot=inline-edit][data-expanded]]:gap-x-0';\nexport const actionsHiddenWhileRenamingClass =\n 'tw:transition-opacity tw:duration-150 tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:invisible tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:w-0 tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:flex-nowrap tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:overflow-hidden tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:opacity-0';\n// Badges, no taller than the title line, are gone while it is renamed and fade back once it settles.\nexport const badgesHiddenWhileRenamingClass =\n 'tw:transition-opacity tw:duration-150 tw:group-has-[[data-slot=inline-edit][data-settled]]/title:starting:opacity-0 tw:group-has-[[data-slot=inline-edit][data-expanded]]/title:hidden';\n// Beside an InlineEdit the icon box is exactly one line tall, so a taller icon overhangs it evenly.\nexport const titleIconClass =\n 'tw:flex tw:shrink-0 tw:items-center tw:group-has-[[data-slot=inline-edit]]/title-row:h-9';\nexport const titleCompactIconClass =\n 'tw:flex tw:shrink-0 tw:items-center tw:group-has-[[data-slot=inline-edit]]/title-row:h-7';\n// A title holding an InlineEdit may shrink below its text; an open rename takes the rest of the row.\nexport const titleClass =\n 'tw:m-0 tw:text-3xl tw:font-semibold tw:leading-9 tw:text-foreground tw:break-words tw:has-[[data-slot=inline-edit]]:min-w-0 tw:has-[[data-expanded]]:flex-1';\nexport const titleCompactClass =\n 'tw:m-0 tw:text-xl tw:font-semibold tw:leading-7 tw:text-foreground tw:break-words tw:has-[[data-slot=inline-edit]]:min-w-0 tw:has-[[data-expanded]]:flex-1';\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.\n// Beside an InlineEdit an empty wrapper (no badges to show) collapses, so the title keeps the row.\nexport const badgesClass =\n 'tw:flex tw:flex-wrap tw:items-center tw:gap-2 tw:group-has-[[data-slot=inline-edit]]/title-row:empty:hidden tw:group-has-[[data-slot=inline-edit]]/title-row:has-[>:only-child:empty]:hidden 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 actionsHiddenWhileRenamingClass,\n badgesClass,\n badgesHiddenWhileRenamingClass,\n descriptionClass,\n titleClass,\n titleCompactClass,\n titleCompactIconClass,\n titleCompactLineClass,\n titleGroupClass,\n titleIconClass,\n titleLineClass,\n titleRowClass,\n} from './styles';\n\n// Pattern: docs/patterns/page-header/detail/detail-page-header.md\ntype PageHeaderDetailProps = Omit<ComponentProps<'header'>, 'title'> & {\n /** Chain to the entity's parent. Don't end with the entity's own name — that's the `title`. */\n breadcrumbs: ReactNode;\n /** `DropdownMenu` for all other actions, on the breadcrumbs row. */\n overflowActions?: ReactNode;\n title: ReactNode;\n /** Entity / type icon left of the title. */\n titleIcon?: ReactNode;\n /** `Badge`s beside the title (status, environment, version). */\n badges?: ReactNode;\n description?: ReactNode;\n /** Smaller title for information-dense pages. */\n compact?: boolean;\n /** `Button` with the verb appropriate to the entity (Deploy / Run / Save). */\n primaryAction?: ReactNode;\n /** `Button variant=\"secondary\"`. Further actions go in `overflowActions`. */\n secondaryAction?: ReactNode;\n /** `Tabs` row below the title block. */\n headerNav?: ReactNode;\n /** Description on its own full-width row below title and actions, not in the title column. */\n fullWidthDescription?: boolean;\n};\n\n/**\n * Page header for one entity with a parent hierarchy worth breadcrumbing.\n *\n * - Nest inside `PageLayout.Header`.\n * - A page with no parent hierarchy uses `PageHeader.Index`, even for one entity.\n *\n * @see RECIPES.md#list-detail\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 iconClass = compact ? titleCompactIconClass : titleIconClass;\n const lineClass = compact ? titleCompactLineClass : titleLineClass;\n const titleRow = (\n <div\n className={cn(titleRowClass, 'tw:min-w-64 tw:flex-1 tw:pr-2 tw:has-[[data-expanded]]:pr-0')}\n >\n {titleIcon && <span className={iconClass}>{titleIcon}</span>}\n <h1 className={compact ? titleCompactClass : titleClass}>{title}</h1>\n {badges && (\n <div className={cn(badgesClass, lineClass, badgesHiddenWhileRenamingClass)}>{badges}</div>\n )}\n </div>\n );\n const actions = (primaryAction || secondaryAction) && (\n <div\n className={cn(\n 'tw:ml-auto tw:flex tw:flex-wrap tw:items-center tw:justify-end tw:gap-2',\n actionsHiddenWhileRenamingClass,\n )}\n >\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\n className={cn(\n titleGroupClass,\n 'tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3',\n )}\n >\n {titleRow}\n {actions}\n </div>\n {descriptionNode}\n </div>\n ) : (\n <div\n className={cn(\n titleGroupClass,\n 'tw:flex tw:w-full tw:flex-wrap tw:items-start tw:justify-between tw:gap-x-4 tw:gap-y-3',\n )}\n >\n <div className=\"tw:flex tw:min-w-64 tw:flex-1 tw:flex-col tw:gap-2 tw:pr-2 tw:has-[[data-expanded]]:pr-0\">\n <div className={titleRowClass}>\n {titleIcon && <span className={iconClass}>{titleIcon}</span>}\n <h1 className={compact ? titleCompactClass : titleClass}>{title}</h1>\n {badges && (\n <div className={cn(badgesClass, lineClass, badgesHiddenWhileRenamingClass)}>\n {badges}\n </div>\n )}\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// Pattern: docs/patterns/page-header/index/index-page-header.md\ntype PageHeaderIndexProps = Omit<ComponentProps<'header'>, 'title'> & {\n title: ReactNode;\n /** Prose below the title; `metadata` wins when both are set. */\n description?: ReactNode;\n /** Count summary (\"3 buckets and 39 tables\"). Wins over `description`. */\n metadata?: ReactNode;\n /** Icon-only docs button (`Button variant=\"invisible\" icon={<BookOpen />}`). */\n documentation?: ReactNode;\n /** The one primary \"create X\" `Button`. */\n action?: ReactNode;\n /** `Tabs` row below the title block. */\n headerNav?: ReactNode;\n /** Description on its own full-width row; actions wrap below the title on narrow widths. */\n fullWidthDescription?: boolean;\n};\n\n/**\n * Page header for top-level list / collection pages.\n *\n * - No breadcrumbs, no overflow menu.\n * - Search and filters 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 * Page header whose variant types enforce the page-header patterns.\n *\n * - Nest inside `PageLayout.Header`; pass `@keboola/design` `Button`s into the slots.\n * - Other layouts: custom JSX in `PageLayout.Header`; routed tabs: `PageLayout.Tabs`.\n *\n * @see RECIPES.md#page-header-tabs\n */\nexport const PageHeader = {\n /** List / collection pages. No breadcrumbs; `metadata` wins over `description`. */\n Index: PageHeaderIndex,\n /** Single-entity pages: required breadcrumbs, overflow menu, max 2 visible actions. */\n Detail: PageHeaderDetail,\n};\n"],"mappings":";;;AAEA,MAAa,gBACX;AACF,MAAa,iBAAiB;AAC9B,MAAa,wBAAwB;AAKrC,MAAa,kBACX;AAOF,MAAa,iBACX;AACF,MAAa,wBACX;AAEF,MAAa,aACX;AACF,MAAa,oBACX;;;;;;;;;;ACyBF,MAAa,oBAAoB,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AAA,CACG,eACA,MACE;GAEJ,CAAA,CAAA;EAEN,CAAA,GAAA,SACK;;AAEZ;;;;;;;;;;ACxEA,MAAa,aAAa;;CAExB,OAAO;;CAEP,QAAQ;AACV"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { cn } from "./classNames-
|
|
1
|
+
import { cn } from "./classNames-DkX30VJU.js";
|
|
2
2
|
import { mergeRefs } from "./internal/utils/mergeRefs.js";
|
|
3
3
|
import { createContext, use, useEffect, useRef } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/blocks/SectionNav/constants.ts
|
|
6
6
|
/**
|
|
7
7
|
* Names the container query `SectionNav` reads to pick the tree over the dropdown.
|
|
8
8
|
*
|
|
@@ -12,8 +12,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* `PageLayout.Content nav={…}` puts it on the right element for you.
|
|
13
13
|
*/
|
|
14
14
|
const SECTION_NAV_CONTAINER = "tw:@container/section-nav";
|
|
15
|
-
|
|
16
|
-
//#region src/blocks/PageLayout/context.ts
|
|
15
|
+
// src/blocks/PageLayout/context.ts
|
|
17
16
|
/**
|
|
18
17
|
* The `PageLayout` root element, so `PageLayout.Header` can publish its measured height as a CSS
|
|
19
18
|
* custom property the whole page can read — `PageLayout.Content nav={…}` pins the nav to it.
|
|
@@ -23,8 +22,7 @@ const SECTION_NAV_CONTAINER = "tw:@container/section-nav";
|
|
|
23
22
|
*/
|
|
24
23
|
const PageLayoutRootContext = createContext(null);
|
|
25
24
|
const usePageLayoutRoot = () => use(PageLayoutRootContext);
|
|
26
|
-
|
|
27
|
-
//#region src/blocks/PageLayout/PageLayout.tsx
|
|
25
|
+
// src/blocks/PageLayout/PageLayout.tsx
|
|
28
26
|
const maxWidthClass = {
|
|
29
27
|
narrow: "tw:max-w-[976px]",
|
|
30
28
|
default: "tw:max-w-[1280px]",
|
|
@@ -162,7 +160,6 @@ const PageLayout = Object.assign(Root, {
|
|
|
162
160
|
/** Form submit bar; `sticky` pins it to the viewport. */
|
|
163
161
|
Footer
|
|
164
162
|
});
|
|
165
|
-
//#endregion
|
|
166
163
|
export { PageLayout };
|
|
167
164
|
|
|
168
|
-
//# sourceMappingURL=PageLayout-
|
|
165
|
+
//# sourceMappingURL=PageLayout-LcvJccOW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout-C9aXTpqV.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/** `maxWidth`: `narrow` for forms, `default` for most pages, `wide` for dense detail views, `full` edge-to-edge. */\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 * Page chrome for every new kbc-ui page: max-width column + vertical rhythm + named slots.\n *\n * - No outer padding: the shell owns the gutter to the app frame.\n * - Not for modal bodies or embedded widgets; the `Sidebar` lives in the app shell.\n * - Search / filter pills go in `PageToolbar`, never in the header.\n *\n * @see RECIPES.md#list-detail\n * @see RECIPES.md#section-nav\n */\nexport const PageLayout = Object.assign(Root, {\n /** Usually composed by `PageHeader.Detail`; for layouts that fit neither `PageHeader` variant. */\n Breadcrumbs,\n /** `sticky` also publishes its height as `--page-header-height`, which `Content nav` pins to. */\n Header,\n /** Routing-based tab rows; use `Tabs` / `TabsContent` inside, never a raw `<button>`. */\n Tabs,\n /** `nav` (a `SectionNav`) makes it a two-column layout. */\n Content,\n /** Form submit bar; `sticky` pins it to the viewport. */\n Footer,\n});\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAa,wBAAwB;;;;;;;;;;ACErC,MAAa,wBAAwB,cAAuD,IAAI;AAEhG,MAAa,0BAA0B,IAAI,qBAAqB;;;ACChE,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;GACE,KAAK,UAAU,OAAO,MAAM,OAAO;GACnC,WAAW,GACT,qDACA,cAAc,WACd,SACF;GACA,GAAI;GAEH;EACE,CAAA;CACgB,CAAA;AAE3B;AAEA,MAAM,eAAe,EAAE,KAAK,WAAW,UAAU,GAAG,YAClD,oBAAC,OAAD;CAAU;CAAK,WAAW,GAAG,aAAa,SAAS;CAAG,GAAI;CACvD;AACE,CAAA;AAGP,MAAM,sBACJ;AAMF,MAAM,UAAU,EAAE,KAAK,WAAW,SAAS,OAAO,UAAU,GAAG,YAAyB;CACtF,MAAM,UAAU,kBAAkB;CAClC,MAAM,YAAY,OAAoB,IAAI;CAE1C,gBAAgB;EACd,MAAM,SAAS,UAAU;EACzB,MAAM,OAAO,SAAS;EAEtB,IAAI,CAAC,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I,MAAM,YAAY,2BAA2B,GAAG,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,CAAC,EAAE,GAAG;EACvF;EAEA,MAAM,WAAW,IAAI,eAAe,OAAO;EAE3C,SAAS,QAAQ,GAAG;EACpB,IAAI,UAAU,SAAS,QAAQ,QAAQ;EACvC,QAAQ;EAER,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,CAAC;CAEL,OAAO;AACT;AAEA,MAAM,WAAW,EAAE,KAAK,WAAW,KAAK,UAAU,GAAG,YAA0B;CAC7E,MAAM,SAAS,mBAAmB;CAElC,IAAI,CAAC,KACH,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,2CAA2C,SAAS;EAClE,GAAI;EAEH;CACE,CAAA;CAIT,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,wEACA,uBACA,SACF;EACA,GAAI;EAEJ,UAAA,qBAAC,OAAD;GACE,KAAK;GACL,WAAU;GAFZ,UAAA,CAIE,oBAAC,OAAD;IACE,aAAU;IACV,WAAU;IAET,UAAA;GACE,CAAA,GACL,oBAAC,OAAD;IACE,aAAU;IACV,WAAU;IAET;GACE,CAAA,CACF;;CACF,CAAA;AAET;AAMA,MAAM,UAAU,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;;;;;;;;;;;AAaV,MAAa,aAAa,OAAO,OAAO,MAAM;;CAE5C;;CAEA;;CAEA;;CAEA;;CAEA;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"PageLayout-LcvJccOW.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/** `maxWidth`: `narrow` for forms, `default` for most pages, `wide` for dense detail views, `full` edge-to-edge. */\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 * Page chrome for every new kbc-ui page: max-width column + vertical rhythm + named slots.\n *\n * - No outer padding: the shell owns the gutter to the app frame.\n * - Not for modal bodies or embedded widgets; the `Sidebar` lives in the app shell.\n * - Search / filter pills go in `PageToolbar`, never in the header.\n *\n * @see RECIPES.md#list-detail\n * @see RECIPES.md#section-nav\n */\nexport const PageLayout = Object.assign(Root, {\n /** Usually composed by `PageHeader.Detail`; for layouts that fit neither `PageHeader` variant. */\n Breadcrumbs,\n /** `sticky` also publishes its height as `--page-header-height`, which `Content nav` pins to. */\n Header,\n /** Routing-based tab rows; use `Tabs` / `TabsContent` inside, never a raw `<button>`. */\n Tabs,\n /** `nav` (a `SectionNav`) makes it a two-column layout. */\n Content,\n /** Form submit bar; `sticky` pins it to the viewport. */\n Footer,\n});\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAa,wBAAwB;;;;;;;;;ACErC,MAAa,wBAAwB,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IT,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,wEACA,uBACA,SACF;EACA,GAAI;EAEJ,UAAA,qBAAC,OAAD;GACE,KAAK;GACL,WAAU;GAFZ,UAAA,CAIE,oBAAC,OAAD;IACE,aAAU;IACV,WAAU;IAET,UAAA;GACE,CAAA,GACL,oBAAC,OAAD;IACE,aAAU;IACV,WAAU;IAET;GACE,CAAA,CACF;;CACF,CAAA;AAET;AAMA,MAAM,UAAU,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;;;;;;;;;;;AAaV,MAAa,aAAa,OAAO,OAAO,MAAM;;CAE5C;;CAEA;;CAEA;;CAEA;;CAEA;AACF,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { cn } from "./classNames-
|
|
2
|
-
import { ChevronDown, Plus, X } from "./icons-
|
|
3
|
-
import { Button } from "./Button-
|
|
4
|
-
import { Popover } from "./Popover-
|
|
5
|
-
import { Badge } from "./Badge-
|
|
1
|
+
import { cn } from "./classNames-DkX30VJU.js";
|
|
2
|
+
import { ChevronDown, Plus, X } from "./icons-DDR9dFSr.js";
|
|
3
|
+
import { Button } from "./Button-DbvGzEDb.js";
|
|
4
|
+
import { Popover } from "./Popover-DhOPlWgF.js";
|
|
5
|
+
import { Badge } from "./Badge-CFRhducL.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/blocks/PageToolbar/PageToolbarToken.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Editable filter token (Query Builder variant) — `Badge` pill with a `chevron-down`
|
|
10
10
|
* popover trigger for editing values and an `×` dismiss button. The popover content
|
|
@@ -32,8 +32,7 @@ const PageToolbarToken = ({ children, popover, onRemove, removeAriaLabel, ...pro
|
|
|
32
32
|
align: "start",
|
|
33
33
|
children: popover
|
|
34
34
|
})] });
|
|
35
|
-
|
|
36
|
-
//#region src/blocks/PageToolbar/PageToolbar.tsx
|
|
35
|
+
// src/blocks/PageToolbar/PageToolbar.tsx
|
|
37
36
|
const Root = ({ ref, className, children, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
38
37
|
ref,
|
|
39
38
|
className: cn("tw:flex tw:flex-wrap tw:items-center tw:gap-3 tw:w-full", className),
|
|
@@ -117,7 +116,6 @@ const PageToolbar = Object.assign(Root, {
|
|
|
117
116
|
AddFilter,
|
|
118
117
|
Clear
|
|
119
118
|
});
|
|
120
|
-
//#endregion
|
|
121
119
|
export { PageToolbar };
|
|
122
120
|
|
|
123
|
-
//# sourceMappingURL=PageToolbar-
|
|
121
|
+
//# sourceMappingURL=PageToolbar-By2HznxO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageToolbar-
|
|
1
|
+
{"version":3,"file":"PageToolbar-By2HznxO.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 search field fills the slot, else it stays content-width and truncates its placeholder.\n // - First child only: stretching the filter pills after it would size them like 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 * Search / filter toolbar for index pages, between `PageLayout.Header` and `PageLayout.Content`.\n *\n * - Right cluster order: `Filters` → `Sort` → `Actions` → `View`; nothing after `View`.\n * - `ActiveFilters` only while a filter is active; chips or tokens, never both 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 Search,\n Right,\n Filters: ControlGroup,\n Sort: ControlGroup,\n Actions: ControlGroup,\n /** Always last in the right cluster. */\n View: ControlGroup,\n /** Render only while a filter is active. */\n ActiveFilters,\n /** Non-editable filter chip. */\n Chip,\n /** Editable filter token; the caller supplies the edit popover via `popover`. */\n Token: PageToolbarToken,\n AddFilter,\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,UAAA;AAAyB,CAAA,CAClD,EAAA,CAAA;;AC9CX,MAAM,QAAQ,EAAE,KAAK,WAAW,UAAU,GAAG,YAC3C,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,2DAA2D,SAAS;CAClF,GAAI;CAEH;AACE,CAAA;AAGP,MAAM,UAAU,EAAE,KAAK,WAAW,UAAU,GAAG,YAC7C,oBAAC,OAAD;CACO;CACL,WAAW,GACT,oGAIA,wCACA,SACF;CACA,GAAI;CAEH;AACE,CAAA;AAGP,MAAM,SAAS,EAAE,KAAK,WAAW,UAAU,GAAG,YAC5C,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,iDAAiD,SAAS;CACxE,GAAI;CAEH;AACE,CAAA;AAGP,MAAM,gBAAgB,EAAE,KAAK,WAAW,UAAU,GAAG,YACnD,oBAAC,OAAD;CAAU;CAAK,WAAW,GAAG,oCAAoC,SAAS;CAAG,GAAI;CAC9E;AACE,CAAA;AAGP,MAAM,iBAAiB,EAAE,KAAK,WAAW,UAAU,GAAG,YACpD,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,+DAA+D,SAAS;CACtF,GAAI;CAEH;AACE,CAAA;AAYP,MAAM,QAAQ,EAAE,UAAU,UAAU,iBAAiB,GAAG,YACtD,oBAAC,OAAD;CACE,GAAI;CACJ,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;CAGT;AACI,CAAA;AAKT,MAAM,aAAa,EAAE,WAAW,UAAU,GAAG,YAC3C,qBAAC,QAAD;CAAQ,SAAQ;CAAY,MAAK;CAAQ,WAAW,GAAG,cAAc,SAAS;CAAG,GAAI;CAArF,UAAA,CACE,oBAAC,MAAD,EAAM,WAAU,YAAa,CAAA,GAC5B,YAAY,YACP;;AAGV,MAAM,SAAS,EAAE,WAAW,UAAU,GAAG,YACvC,oBAAC,QAAD;CAAQ,SAAQ;CAAY,MAAK;CAAQ,WAAW,GAAG,cAAc,SAAS;CAAG,GAAI;CAClF,UAAA,YAAY;AACP,CAAA;;;;;;;;;AAWV,MAAa,cAAc,OAAO,OAAO,MAAM;CAC7C;CACA;CACA,SAAS;CACT,MAAM;CACN,SAAS;;CAET,MAAM;;CAEN;;CAEA;;CAEA,OAAO;CACP;CACA;AACF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { cn } from "./classNames-
|
|
2
|
-
import { ChevronLeft, ChevronRight, Ellipsis } from "./icons-
|
|
3
|
-
import { Button } from "./Button-
|
|
1
|
+
import { cn } from "./classNames-DkX30VJU.js";
|
|
2
|
+
import { ChevronLeft, ChevronRight, Ellipsis } from "./icons-DDR9dFSr.js";
|
|
3
|
+
import { Button } from "./Button-DbvGzEDb.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/Pagination/PaginationButton.tsx
|
|
6
6
|
const PaginationButton = ({ ref, active: isActive = false, className, children, size = "icon", ...props }) => /* @__PURE__ */ jsx(Button, {
|
|
7
7
|
...props,
|
|
8
8
|
ref,
|
|
@@ -14,28 +14,24 @@ const PaginationButton = ({ ref, active: isActive = false, className, children,
|
|
|
14
14
|
className: cn("tw:data-[active=true]:bg-selected", "tw:data-[active=true]:text-selected-foreground", "tw:data-[active=true]:border-selected", className),
|
|
15
15
|
children
|
|
16
16
|
});
|
|
17
|
-
|
|
18
|
-
//#region src/components/Pagination/PaginationContent.tsx
|
|
17
|
+
// src/components/Pagination/PaginationContent.tsx
|
|
19
18
|
const PaginationContent = ({ className, ...props }) => /* @__PURE__ */ jsx("ul", {
|
|
20
19
|
...props,
|
|
21
20
|
className: cn("tw:flex", "tw:flex-row", "tw:items-center", "tw:gap-1", className)
|
|
22
21
|
});
|
|
23
|
-
|
|
24
|
-
//#region src/components/Pagination/PaginationEllipsis.tsx
|
|
22
|
+
// src/components/Pagination/PaginationEllipsis.tsx
|
|
25
23
|
const PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsx("span", {
|
|
26
24
|
"aria-hidden": "true",
|
|
27
25
|
className: cn("tw:flex", "tw:p-2.5", "tw:items-center", "tw:justify-center", "tw:text-foreground", "tw:[&_svg:not([class*=\"tw:size-\"])]:size-4", className),
|
|
28
26
|
...props,
|
|
29
27
|
children: /* @__PURE__ */ jsx(Ellipsis, {})
|
|
30
28
|
});
|
|
31
|
-
|
|
32
|
-
//#region src/components/Pagination/PaginationItem.tsx
|
|
29
|
+
// src/components/Pagination/PaginationItem.tsx
|
|
33
30
|
const PaginationItem = ({ className, ...props }) => /* @__PURE__ */ jsx("li", {
|
|
34
31
|
className: cn("tw:list-none", className),
|
|
35
32
|
...props
|
|
36
33
|
});
|
|
37
|
-
|
|
38
|
-
//#region src/components/Pagination/PaginationNext.tsx
|
|
34
|
+
// src/components/Pagination/PaginationNext.tsx
|
|
39
35
|
const PaginationNext = ({ children, className, ...props }) => /* @__PURE__ */ jsxs(PaginationButton, {
|
|
40
36
|
...props,
|
|
41
37
|
"aria-label": "Go to next page",
|
|
@@ -43,16 +39,14 @@ const PaginationNext = ({ children, className, ...props }) => /* @__PURE__ */ js
|
|
|
43
39
|
className: cn("tw:flex-row-reverse", className),
|
|
44
40
|
children: [/* @__PURE__ */ jsx(ChevronRight, { className: "tw:size-5" }), children ?? "Next"]
|
|
45
41
|
});
|
|
46
|
-
|
|
47
|
-
//#region src/components/Pagination/PaginationPrevious.tsx
|
|
42
|
+
// src/components/Pagination/PaginationPrevious.tsx
|
|
48
43
|
const PaginationPrevious = ({ children, ...props }) => /* @__PURE__ */ jsxs(PaginationButton, {
|
|
49
44
|
...props,
|
|
50
45
|
size: "medium",
|
|
51
46
|
"aria-label": "Go to previous page",
|
|
52
47
|
children: [/* @__PURE__ */ jsx(ChevronLeft, { className: "tw:size-5" }), children ?? "Previous"]
|
|
53
48
|
});
|
|
54
|
-
|
|
55
|
-
//#region src/components/Pagination/Pagination.tsx
|
|
49
|
+
// src/components/Pagination/Pagination.tsx
|
|
56
50
|
const Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx("nav", {
|
|
57
51
|
...props,
|
|
58
52
|
"aria-label": "pagination",
|
|
@@ -64,7 +58,6 @@ Pagination.Button = PaginationButton;
|
|
|
64
58
|
Pagination.Previous = PaginationPrevious;
|
|
65
59
|
Pagination.Next = PaginationNext;
|
|
66
60
|
Pagination.Ellipsis = PaginationEllipsis;
|
|
67
|
-
//#endregion
|
|
68
61
|
export { Pagination };
|
|
69
62
|
|
|
70
|
-
//# sourceMappingURL=Pagination-
|
|
63
|
+
//# sourceMappingURL=Pagination-DrXTrvfD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination-
|
|
1
|
+
{"version":3,"file":"Pagination-DrXTrvfD.js","names":[],"sources":["../src/components/Pagination/PaginationButton.tsx","../src/components/Pagination/PaginationContent.tsx","../src/components/Pagination/PaginationEllipsis.tsx","../src/components/Pagination/PaginationItem.tsx","../src/components/Pagination/PaginationNext.tsx","../src/components/Pagination/PaginationPrevious.tsx","../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\n\ntype Props = {\n active?: boolean;\n} & Omit<ComponentProps<typeof Button>, 'variant'>;\n\nexport const PaginationButton = ({\n ref,\n active: isActive = false,\n className,\n children,\n size = 'icon',\n ...props\n}: Props) => (\n <Button\n {...props}\n ref={ref}\n variant=\"invisible\"\n size={size}\n data-slot=\"pagination-link\"\n aria-current={isActive ? 'page' : undefined}\n data-active={isActive}\n className={cn(\n 'tw:data-[active=true]:bg-selected',\n 'tw:data-[active=true]:text-selected-foreground',\n 'tw:data-[active=true]:border-selected',\n className,\n )}\n >\n {children}\n </Button>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'ul'>;\n\nexport const PaginationContent = ({ className, ...props }: Props) => (\n <ul\n {...props}\n className={cn('tw:flex', 'tw:flex-row', 'tw:items-center', 'tw:gap-1', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { Ellipsis } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'>;\n\nexport const PaginationEllipsis = ({ className, ...props }: Props) => (\n <span\n aria-hidden=\"true\"\n className={cn(\n // layout\n 'tw:flex',\n 'tw:p-2.5',\n 'tw:items-center',\n 'tw:justify-center',\n\n 'tw:text-foreground',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n className,\n )}\n {...props}\n >\n <Ellipsis />\n </span>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'li'>;\n\nexport const PaginationItem = ({ className, ...props }: Props) => (\n <li className={cn('tw:list-none', className)} {...props} />\n);\n","import type { ComponentProps } from 'react';\n\nimport { ChevronRight } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { PaginationButton } from './PaginationButton';\n\ntype Props = ComponentProps<typeof PaginationButton>;\n\nexport const PaginationNext = ({ children, className, ...props }: Props) => (\n <PaginationButton\n {...props}\n aria-label=\"Go to next page\"\n size=\"medium\"\n className={cn('tw:flex-row-reverse', className)}\n >\n <ChevronRight className=\"tw:size-5\" />\n {children ?? 'Next'}\n </PaginationButton>\n);\n","import type { ComponentProps } from 'react';\n\nimport { ChevronLeft } from '../../icons';\n\nimport { PaginationButton } from './PaginationButton';\n\ntype Props = ComponentProps<typeof PaginationButton>;\n\nexport const PaginationPrevious = ({ children, ...props }: Props) => (\n <PaginationButton {...props} size=\"medium\" aria-label=\"Go to previous page\">\n <ChevronLeft className=\"tw:size-5\" />\n {children ?? 'Previous'}\n </PaginationButton>\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { PaginationButton } from './PaginationButton';\nimport { PaginationContent } from './PaginationContent';\nimport { PaginationEllipsis } from './PaginationEllipsis';\nimport { PaginationItem } from './PaginationItem';\nimport { PaginationNext } from './PaginationNext';\nimport { PaginationPrevious } from './PaginationPrevious';\n\ntype Props = ComponentProps<'nav'>;\n\nexport const Pagination = ({ className, ...props }: Props) => (\n <nav\n {...props}\n aria-label=\"pagination\"\n className={cn(\n 'tailwindcss-preflight',\n 'tw:mx-auto',\n 'tw:flex',\n 'tw:w-full',\n 'tw:justify-center',\n className,\n )}\n />\n);\n\nPagination.Content = PaginationContent;\nPagination.Item = PaginationItem;\nPagination.Button = PaginationButton;\nPagination.Previous = PaginationPrevious;\nPagination.Next = PaginationNext;\nPagination.Ellipsis = PaginationEllipsis;\n"],"mappings":";;;;;AASA,MAAa,oBAAoB,EAC/B,KACA,QAAQ,WAAW,OACnB,WACA,UACA,OAAO,QACP,GAAG,YAEH,oBAAC,QAAD;CACE,GAAI;CACC;CACL,SAAQ;CACF;CACN,aAAU;CACV,gBAAc,WAAW,SAAS,KAAA;CAClC,eAAa;CACb,WAAW,GACT,qCACA,kDACA,yCACA,SACF;CAEC;AACK,CAAA;;AC3BV,MAAa,qBAAqB,EAAE,WAAW,GAAG,YAChD,oBAAC,MAAD;CACE,GAAI;CACJ,WAAW,GAAG,WAAW,eAAe,mBAAmB,YAAY,SAAS;AACjF,CAAA;;ACHH,MAAa,sBAAsB,EAAE,WAAW,GAAG,YACjD,oBAAC,QAAD;CACE,eAAY;CACZ,WAAW,GAET,WACA,YACA,mBACA,qBAEA,sBACA,gDACA,SACF;CACA,GAAI;CAEJ,UAAA,oBAAC,UAAD,CAAW,CAAA;AACP,CAAA;;AClBR,MAAa,kBAAkB,EAAE,WAAW,GAAG,YAC7C,oBAAC,MAAD;CAAI,WAAW,GAAG,gBAAgB,SAAS;CAAG,GAAI;AAAQ,CAAA;;ACE5D,MAAa,kBAAkB,EAAE,UAAU,WAAW,GAAG,YACvD,qBAAC,kBAAD;CACE,GAAI;CACJ,cAAW;CACX,MAAK;CACL,WAAW,GAAG,uBAAuB,SAAS;CAJhD,UAAA,CAME,oBAAC,cAAD,EAAc,WAAU,YAAa,CAAA,GACpC,YAAY,MACG;;;ACVpB,MAAa,sBAAsB,EAAE,UAAU,GAAG,YAChD,qBAAC,kBAAD;CAAkB,GAAI;CAAO,MAAK;CAAS,cAAW;CAAtD,UAAA,CACE,oBAAC,aAAD,EAAa,WAAU,YAAa,CAAA,GACnC,YAAY,UACG;;;ACCpB,MAAa,cAAc,EAAE,WAAW,GAAG,YACzC,oBAAC,OAAD;CACE,GAAI;CACJ,cAAW;CACX,WAAW,GACT,yBACA,cACA,WACA,aACA,qBACA,SACF;AACD,CAAA;AAGH,WAAW,UAAU;AACrB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,WAAW;AACtB,WAAW,OAAO;AAClB,WAAW,WAAW"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { cn } from "./classNames-
|
|
2
|
-
import { Button } from "./Button-
|
|
1
|
+
import { cn } from "./classNames-DkX30VJU.js";
|
|
2
|
+
import { Button } from "./Button-DbvGzEDb.js";
|
|
3
3
|
import { useStableCallback } from "./internal/hooks/useStableCallback.js";
|
|
4
|
-
import { Popover } from "./Popover-
|
|
4
|
+
import { Popover } from "./Popover-DhOPlWgF.js";
|
|
5
5
|
import { createContext, use, useMemo, useState } from "react";
|
|
6
6
|
import { Slot } from "@radix-ui/react-slot";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/Popconfirm/context.ts
|
|
9
9
|
const PopconfirmContext = createContext(null);
|
|
10
10
|
const PopconfirmContextProvider = PopconfirmContext;
|
|
11
11
|
const usePopconfirmContext = () => {
|
|
@@ -13,11 +13,18 @@ const usePopconfirmContext = () => {
|
|
|
13
13
|
if (!context) throw new Error("usePopconfirmContext must be used within a Popconfirm");
|
|
14
14
|
return context;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
// src/components/Popconfirm/PopconfirmBody.tsx
|
|
17
|
+
/**
|
|
18
|
+
* The popconfirm's message: plain text, or `Popconfirm.Title` + `Popconfirm.Description`.
|
|
19
|
+
*
|
|
20
|
+
* - Text wraps at 384 px; only the footer's buttons widen the popover past that.
|
|
21
|
+
* - Owns the spacing between its blocks: 12 px, 2 px between a title and its description.
|
|
22
|
+
*/
|
|
23
|
+
const PopconfirmBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
24
|
+
...props,
|
|
25
|
+
className: cn("tw:w-full tw:max-w-sm tw:text-sm tw:[&>*+*]:mt-3", className)
|
|
26
|
+
});
|
|
27
|
+
// src/components/Popconfirm/PopconfirmCancel.tsx
|
|
21
28
|
const PopconfirmCancel = ({ ref, onClick, children, asChild, className, ...props }) => {
|
|
22
29
|
const { onCancel, isLoading } = usePopconfirmContext();
|
|
23
30
|
const handleClick = (event) => {
|
|
@@ -43,8 +50,7 @@ const PopconfirmCancel = ({ ref, onClick, children, asChild, className, ...props
|
|
|
43
50
|
})
|
|
44
51
|
});
|
|
45
52
|
};
|
|
46
|
-
|
|
47
|
-
//#region src/components/Popconfirm/PopconfirmConfirm.tsx
|
|
53
|
+
// src/components/Popconfirm/PopconfirmConfirm.tsx
|
|
48
54
|
const PopconfirmConfirm = ({ ref, onClick, children, asChild, className, ...props }) => {
|
|
49
55
|
const { onConfirm, variant, isLoading } = usePopconfirmContext();
|
|
50
56
|
const handleOnClick = (event) => {
|
|
@@ -70,15 +76,14 @@ const PopconfirmConfirm = ({ ref, onClick, children, asChild, className, ...prop
|
|
|
70
76
|
variant: variant === "danger" ? "danger" : "primary",
|
|
71
77
|
...props,
|
|
72
78
|
ref,
|
|
73
|
-
className
|
|
79
|
+
className,
|
|
74
80
|
isLoading,
|
|
75
81
|
children: defaultLabel
|
|
76
82
|
})
|
|
77
83
|
});
|
|
78
84
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const PopconfirmContent = ({ className, onInteractOutside, ...props }) => {
|
|
85
|
+
// src/components/Popconfirm/PopconfirmContent.tsx
|
|
86
|
+
const PopconfirmContent = ({ className, onInteractOutside, layout = "default", ...props }) => {
|
|
82
87
|
const { isLoading } = usePopconfirmContext();
|
|
83
88
|
const handleOnInteractOutside = (event) => {
|
|
84
89
|
if (isLoading) event.preventDefault();
|
|
@@ -87,17 +92,33 @@ const PopconfirmContent = ({ className, onInteractOutside, ...props }) => {
|
|
|
87
92
|
return /* @__PURE__ */ jsx(Popover.Content, {
|
|
88
93
|
...props,
|
|
89
94
|
onInteractOutside: handleOnInteractOutside,
|
|
90
|
-
className: cn("tw:
|
|
95
|
+
className: cn("tw:min-w-72 tw:gap-3", layout === "centered" ? "tw:p-4 tw:[&_[data-slot^=popconfirm-]]:text-center" : "tw:p-3", className)
|
|
91
96
|
});
|
|
92
97
|
};
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
// src/components/Popconfirm/PopconfirmDescription.tsx
|
|
99
|
+
const PopconfirmDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("p", {
|
|
100
|
+
...props,
|
|
101
|
+
"data-slot": "popconfirm-description",
|
|
102
|
+
className: cn("tw:m-0 tw:text-xs tw:text-muted-foreground tw:[[data-slot=popconfirm-title]+&]:mt-0.5", className)
|
|
103
|
+
});
|
|
104
|
+
// src/components/Popconfirm/PopconfirmFooter.tsx
|
|
105
|
+
/**
|
|
106
|
+
* The popconfirm's action row.
|
|
107
|
+
*
|
|
108
|
+
* - Every child gets an equal-width column, so Cancel and Confirm split the row evenly.
|
|
109
|
+
* - A lone Confirm spans the whole row.
|
|
110
|
+
*/
|
|
95
111
|
const PopconfirmFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
96
112
|
...props,
|
|
97
|
-
className: cn("tw:
|
|
113
|
+
className: cn("tw:grid tw:w-full tw:auto-cols-fr tw:grid-flow-col tw:gap-2", className)
|
|
114
|
+
});
|
|
115
|
+
// src/components/Popconfirm/PopconfirmTitle.tsx
|
|
116
|
+
const PopconfirmTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("p", {
|
|
117
|
+
...props,
|
|
118
|
+
"data-slot": "popconfirm-title",
|
|
119
|
+
className: cn("tw:m-0 tw:wrap-anywhere tw:font-medium", className)
|
|
98
120
|
});
|
|
99
|
-
|
|
100
|
-
//#region src/components/Popconfirm/PopconfirmTrigger.tsx
|
|
121
|
+
// src/components/Popconfirm/PopconfirmTrigger.tsx
|
|
101
122
|
const PopconfirmTrigger = ({ onClick, ...props }) => {
|
|
102
123
|
const { enabled, onConfirm } = usePopconfirmContext();
|
|
103
124
|
const handleClick = (event) => {
|
|
@@ -112,8 +133,7 @@ const PopconfirmTrigger = ({ onClick, ...props }) => {
|
|
|
112
133
|
onClick: handleClick
|
|
113
134
|
});
|
|
114
135
|
};
|
|
115
|
-
|
|
116
|
-
//#region src/components/Popconfirm/Popconfirm.tsx
|
|
136
|
+
// src/components/Popconfirm/Popconfirm.tsx
|
|
117
137
|
const noop = () => void 0;
|
|
118
138
|
const Popconfirm = ({ children, onConfirm = noop, onCancel = noop, variant = "confirm", enabled = true, onOpenChange = noop, open, skipAsyncWait = false, ...rest }) => {
|
|
119
139
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -159,8 +179,9 @@ Popconfirm.Cancel = PopconfirmCancel;
|
|
|
159
179
|
Popconfirm.Footer = PopconfirmFooter;
|
|
160
180
|
Popconfirm.Content = PopconfirmContent;
|
|
161
181
|
Popconfirm.Body = PopconfirmBody;
|
|
182
|
+
Popconfirm.Title = PopconfirmTitle;
|
|
183
|
+
Popconfirm.Description = PopconfirmDescription;
|
|
162
184
|
Popconfirm.Trigger = PopconfirmTrigger;
|
|
163
|
-
//#endregion
|
|
164
185
|
export { Popconfirm };
|
|
165
186
|
|
|
166
|
-
//# sourceMappingURL=Popconfirm-
|
|
187
|
+
//# sourceMappingURL=Popconfirm-BJuDOHdv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popconfirm-BJuDOHdv.js","names":[],"sources":["../src/components/Popconfirm/context.ts","../src/components/Popconfirm/PopconfirmBody.tsx","../src/components/Popconfirm/PopconfirmCancel.tsx","../src/components/Popconfirm/PopconfirmConfirm.tsx","../src/components/Popconfirm/PopconfirmContent.tsx","../src/components/Popconfirm/PopconfirmDescription.tsx","../src/components/Popconfirm/PopconfirmFooter.tsx","../src/components/Popconfirm/PopconfirmTitle.tsx","../src/components/Popconfirm/PopconfirmTrigger.tsx","../src/components/Popconfirm/Popconfirm.tsx"],"sourcesContent":["import { createContext, type MouseEvent, use } from 'react';\n\nexport type PopconfirmContextType = {\n variant: 'confirm' | 'danger';\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => void | Promise<void>;\n onCancel: (event: MouseEvent<HTMLButtonElement>) => void;\n enabled: boolean;\n isLoading: boolean;\n};\n\nconst PopconfirmContext = createContext<PopconfirmContextType | null>(null);\n\nexport const PopconfirmContextProvider = PopconfirmContext;\n\nexport const usePopconfirmContext = () => {\n const context = use(PopconfirmContext);\n if (!context) throw new Error('usePopconfirmContext must be used within a Popconfirm');\n return context;\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\n/**\n * The popconfirm's message: plain text, or `Popconfirm.Title` + `Popconfirm.Description`.\n *\n * - Text wraps at 384 px; only the footer's buttons widen the popover past that.\n * - Owns the spacing between its blocks: 12 px, 2 px between a title and its description.\n */\nexport const PopconfirmBody = ({ className, ...props }: Props) => (\n <div {...props} className={cn('tw:w-full tw:max-w-sm tw:text-sm tw:[&>*+*]:mt-3', className)} />\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\nimport { Popover } from '../Popover';\n\nimport { usePopconfirmContext } from './context';\n\ntype SlotProps = { asChild: true } & ComponentProps<'button'>;\ntype ButtonProps = { asChild?: false; children?: ReactNode } & Omit<\n ComponentProps<typeof Button>,\n 'children'\n>;\ntype Props = SlotProps | ButtonProps;\n\nexport const PopconfirmCancel = ({\n ref,\n onClick,\n children,\n asChild,\n className,\n ...props\n}: Props) => {\n const { onCancel, isLoading } = usePopconfirmContext();\n\n const handleClick: ComponentProps<'button'>['onClick'] = (event) => {\n onClick?.(event);\n onCancel(event);\n };\n\n return (\n <Popover.Close asChild onClick={handleClick} disabled={isLoading}>\n {asChild ? (\n <Slot {...props} ref={ref} className={className}>\n {children}\n </Slot>\n ) : (\n <Button variant=\"outline\" size=\"small\" {...props} ref={ref} className={cn(className)}>\n {children ?? 'Cancel'}\n </Button>\n )}\n </Popover.Close>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { Button } from '../Button/Button';\nimport { Popover } from '../Popover';\n\nimport { usePopconfirmContext } from './context';\n\ntype SlotProps = { asChild: true } & ComponentProps<'button'>;\ntype ButtonProps = { asChild?: false; children?: ReactNode } & Omit<\n ComponentProps<typeof Button>,\n 'children' | 'isLoading'\n>;\ntype Props = SlotProps | ButtonProps;\n\nexport const PopconfirmConfirm = ({\n ref,\n onClick,\n children,\n asChild,\n className,\n ...props\n}: Props) => {\n const { onConfirm, variant, isLoading } = usePopconfirmContext();\n\n const handleOnClick: ComponentProps<'button'>['onClick'] = (event) => {\n onClick?.(event);\n onConfirm(event);\n };\n\n const defaultLabel = (() => {\n if (children) return children;\n return variant === 'danger' ? 'Delete' : 'Confirm';\n })();\n\n return (\n <Popover.Close asChild onClick={handleOnClick} disabled={isLoading} data-loading={isLoading}>\n {asChild ? (\n <Slot {...props} ref={ref} className={className}>\n {children}\n </Slot>\n ) : (\n <Button\n size=\"small\"\n variant={variant === 'danger' ? 'danger' : 'primary'}\n {...props}\n ref={ref}\n className={className}\n isLoading={isLoading}\n >\n {defaultLabel}\n </Button>\n )}\n </Popover.Close>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\nimport { Popover } from '../Popover';\n\nimport { usePopconfirmContext } from './context';\n\ntype Props = Omit<ComponentProps<typeof Popover.Content>, 'showArrow'> & {\n /** `centered` centres the title and description; other content keeps its alignment. */\n layout?: 'default' | 'centered';\n};\n\nexport const PopconfirmContent = ({\n className,\n onInteractOutside,\n layout = 'default',\n ...props\n}: Props) => {\n const { isLoading } = usePopconfirmContext();\n\n const handleOnInteractOutside: Props['onInteractOutside'] = (event) => {\n if (isLoading) event.preventDefault();\n onInteractOutside?.(event);\n };\n\n return (\n <Popover.Content\n {...props}\n onInteractOutside={handleOnInteractOutside}\n className={cn(\n 'tw:min-w-72 tw:gap-3',\n layout === 'centered' ? 'tw:p-4 tw:[&_[data-slot^=popconfirm-]]:text-center' : 'tw:p-3',\n className,\n )}\n />\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'p'>;\n\nexport const PopconfirmDescription = ({ className, ...props }: Props) => (\n <p\n {...props}\n data-slot=\"popconfirm-description\"\n className={cn(\n 'tw:m-0 tw:text-xs tw:text-muted-foreground tw:[[data-slot=popconfirm-title]+&]:mt-0.5',\n className,\n )}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\n/**\n * The popconfirm's action row.\n *\n * - Every child gets an equal-width column, so Cancel and Confirm split the row evenly.\n * - A lone Confirm spans the whole row.\n */\nexport const PopconfirmFooter = ({ className, ...props }: Props) => (\n <div\n {...props}\n className={cn('tw:grid tw:w-full tw:auto-cols-fr tw:grid-flow-col tw:gap-2', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'p'>;\n\nexport const PopconfirmTitle = ({ className, ...props }: Props) => (\n <p\n {...props}\n data-slot=\"popconfirm-title\"\n className={cn('tw:m-0 tw:wrap-anywhere tw:font-medium', className)}\n />\n);\n","import type { ComponentProps, MouseEventHandler } from 'react';\n\nimport { Popover } from '../Popover';\n\nimport { usePopconfirmContext } from './context';\n\ntype Props = ComponentProps<typeof Popover.Trigger>;\n\nexport const PopconfirmTrigger = ({ onClick, ...props }: Props) => {\n const { enabled, onConfirm } = usePopconfirmContext();\n\n const handleClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (!enabled) {\n event.preventDefault();\n onConfirm(event);\n }\n\n onClick?.(event);\n };\n\n return <Popover.Trigger {...props} onClick={handleClick} />;\n};\n","import { useMemo, useState } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport { useStableCallback } from '../../hooks/useStableCallback';\nimport { Popover } from '../Popover';\n\nimport { PopconfirmContextProvider, type PopconfirmContextType } from './context';\nimport { PopconfirmBody } from './PopconfirmBody';\nimport { PopconfirmCancel } from './PopconfirmCancel';\nimport { PopconfirmConfirm } from './PopconfirmConfirm';\nimport { PopconfirmContent } from './PopconfirmContent';\nimport { PopconfirmDescription } from './PopconfirmDescription';\nimport { PopconfirmFooter } from './PopconfirmFooter';\nimport { PopconfirmTitle } from './PopconfirmTitle';\nimport { PopconfirmTrigger } from './PopconfirmTrigger';\n\nconst noop = () => void 0;\n\ntype Props = {\n children: ReactNode;\n skipAsyncWait?: boolean;\n} & ComponentProps<typeof Popover> &\n Omit<Partial<PopconfirmContextType>, 'isLoading'>;\n\nexport const Popconfirm = ({\n children,\n onConfirm = noop,\n onCancel = noop,\n variant = 'confirm',\n enabled = true,\n onOpenChange = noop,\n open,\n skipAsyncWait = false,\n ...rest\n}: Props) => {\n const [isLoading, setIsLoading] = useState(false);\n const [isOpen, setIsOpen] = useState(false);\n\n const handleConfirm = useStableCallback(onConfirm);\n const handleCancel = useStableCallback(onCancel);\n\n const handleOnOpenChange = (open: boolean) => {\n setIsOpen(open);\n onOpenChange(open);\n };\n\n const context = useMemo<PopconfirmContextType>(\n () => ({\n variant,\n isLoading,\n enabled,\n onConfirm: (event) => {\n const result = handleConfirm(event);\n\n if (!(result instanceof Promise) || skipAsyncWait) return;\n\n // The async confirm's outcome drives the popover.\n // - `preventDefault` stops the click closing it, so it stays up while the action runs.\n // - Resolved closes it; rejected leaves it up so the failure stays visible.\n // - The rejection is deliberately not caught — the host's global handler reports it.\n event.preventDefault();\n setIsLoading(true);\n result.then(() => setIsOpen(false)).finally(() => setIsLoading(false));\n },\n onCancel: handleCancel,\n }),\n [variant, isLoading, enabled, skipAsyncWait, handleConfirm, handleCancel],\n );\n\n return (\n <Popover {...rest} open={open || isOpen} onOpenChange={handleOnOpenChange}>\n <PopconfirmContextProvider value={context}>{children}</PopconfirmContextProvider>\n </Popover>\n );\n};\n\nPopconfirm.Confirm = PopconfirmConfirm;\nPopconfirm.Cancel = PopconfirmCancel;\nPopconfirm.Footer = PopconfirmFooter;\nPopconfirm.Content = PopconfirmContent;\nPopconfirm.Body = PopconfirmBody;\nPopconfirm.Title = PopconfirmTitle;\nPopconfirm.Description = PopconfirmDescription;\nPopconfirm.Trigger = PopconfirmTrigger;\n"],"mappings":";;;;;;;;AAUA,MAAM,oBAAoB,cAA4C,IAAI;AAE1E,MAAa,4BAA4B;AAEzC,MAAa,6BAA6B;CACxC,MAAM,UAAU,I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AE/C,MAAM,sBAAsB,SAAkB;EAC5C,UAAU,IAAI;EACd,aAAa,IAAI;CACnB;CAEA,MAAM,UAAU,eACP;EACL;EACA;EACA;EACA,YAAY,UAAU;GACpB,MAAM,SAAS,cAAc,KAAK;GAElC,IAAI,EAAE,kBAAkB,YAAY,eAAe;GAMnD,MAAM,eAAe;GACrB,aAAa,IAAI;GACjB,OAAO,WAAW,UAAU,KAAK,CAAC,CAAC,CAAC,cAAc,aAAa,KAAK,CAAC;EACvE;EACA,UAAU;CACZ,IACA;EAAC;EAAS;EAAW;EAAS;EAAe;EAAe;CAAY,CAC1E;CAEA,OACE,oBAAC,SAAD;EAAS,GAAI;EAAM,MAAM,QAAQ;EAAQ,cAAc;EACrD,UAAA,oBAAC,2BAAD;GAA2B,OAAO;GAAU;EAAoC,CAAA;CACzE,CAAA;AAEb;AAEA,WAAW,UAAU;AACrB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,UAAU;AACrB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,cAAc;AACzB,WAAW,UAAU"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { cn } from "./classNames-
|
|
1
|
+
import { cn } from "./classNames-DkX30VJU.js";
|
|
2
2
|
import { cva } from "class-variance-authority";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Anchor, Close, Content, Portal, Root, Trigger } from "@radix-ui/react-popover";
|
|
5
|
-
|
|
5
|
+
// src/components/Popover/PopoverContent.tsx
|
|
6
6
|
const variants = cva([
|
|
7
7
|
"tailwindcss-preflight",
|
|
8
8
|
"tw:group/popover-content",
|
|
@@ -60,8 +60,7 @@ const PopoverContent = ({ ref, className, align = "center", sideOffset = 4, matc
|
|
|
60
60
|
children
|
|
61
61
|
})
|
|
62
62
|
});
|
|
63
|
-
|
|
64
|
-
//#region src/components/Popover/Popover.tsx
|
|
63
|
+
// src/components/Popover/Popover.tsx
|
|
65
64
|
const Popover = (props) => /* @__PURE__ */ jsx(Root, { ...props });
|
|
66
65
|
/**
|
|
67
66
|
* Main Layout
|
|
@@ -70,7 +69,6 @@ Popover.Content = PopoverContent;
|
|
|
70
69
|
Popover.Trigger = Trigger;
|
|
71
70
|
Popover.Anchor = Anchor;
|
|
72
71
|
Popover.Close = Close;
|
|
73
|
-
//#endregion
|
|
74
72
|
export { Popover };
|
|
75
73
|
|
|
76
|
-
//# sourceMappingURL=Popover-
|
|
74
|
+
//# sourceMappingURL=Popover-DhOPlWgF.js.map
|