@keboola/design 11.6.1 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +50 -9
- package/CHANGELOG.md +241 -0
- package/COMPONENT-API.md +337 -288
- package/README.md +12 -2
- package/dist/{AIKit-CQxVwyAk.js → AIKit-BD4r7ff-.js} +807 -199
- package/dist/AIKit-BD4r7ff-.js.map +1 -0
- package/dist/{Alert-C4Y9IwMI.js → Alert-UI-CIs-1.js} +16 -16
- package/dist/Alert-UI-CIs-1.js.map +1 -0
- package/dist/{AlertModal-BGJdaRRj.js → AlertModal-Th2khjPi.js} +5 -5
- package/dist/AlertModal-Th2khjPi.js.map +1 -0
- package/dist/{AppShell-DRgJxpXW.js → AppShell-WSQabK8r.js} +15 -52
- package/dist/AppShell-WSQabK8r.js.map +1 -0
- package/dist/{AutoSaveTextarea-BeuWuszr.js → AutoSaveTextarea-C5iIr2Ts.js} +2 -2
- package/dist/{AutoSaveTextarea-BeuWuszr.js.map → AutoSaveTextarea-C5iIr2Ts.js.map} +1 -1
- package/dist/{Badge-o5jURtpB.js → Badge-DIjhwPvh.js} +4 -9
- package/dist/Badge-DIjhwPvh.js.map +1 -0
- package/dist/{BrandEditor-CS9P4r2p.js → BrandEditor-BU23Vl8V.js} +7 -7
- package/dist/{BrandEditor-CS9P4r2p.js.map → BrandEditor-BU23Vl8V.js.map} +1 -1
- package/dist/{BrandLogo-CoKBk4MI.js → BrandLogo-CKpVSZb6.js} +4 -4
- package/dist/BrandLogo-CKpVSZb6.js.map +1 -0
- package/dist/{Breadcrumb-D1id7YXd.js → Breadcrumb-p9HtMLCc.js} +8 -14
- package/dist/Breadcrumb-p9HtMLCc.js.map +1 -0
- package/dist/{Button-DsRrU5F1.js → Button-Ca4Q3VJU.js} +31 -13
- package/dist/Button-Ca4Q3VJU.js.map +1 -0
- package/dist/{Calendar-cG5NIJ4O.js → Calendar-DFtmZzbF.js} +99 -99
- package/dist/Calendar-DFtmZzbF.js.map +1 -0
- package/dist/{Card-Dyo7055Q.js → Card-Cr9MBNHu.js} +4 -4
- package/dist/Card-Cr9MBNHu.js.map +1 -0
- package/dist/{Checkbox-Bqr6zXcW.js → Checkbox-8yIIgY7g.js} +4 -4
- package/dist/Checkbox-8yIIgY7g.js.map +1 -0
- package/dist/{Clipboard-C2YBRfD8.js → Clipboard-_xf6hMDD.js} +2 -2
- package/dist/{Clipboard-C2YBRfD8.js.map → Clipboard-_xf6hMDD.js.map} +1 -1
- package/dist/{ClipboardButton-CrljClL1.js → ClipboardButton-DHa1trtI.js} +4 -4
- package/dist/{ClipboardButton-CrljClL1.js.map → ClipboardButton-DHa1trtI.js.map} +1 -1
- package/dist/{CodeEditor-C9AS8Ch0.js → CodeEditor-BSo-oLFG.js} +55 -165
- package/dist/CodeEditor-BSo-oLFG.js.map +1 -0
- package/dist/{ColorInput-Dg87lKcR.js → ColorInput-DSMqrs2-.js} +12 -27
- package/dist/ColorInput-DSMqrs2-.js.map +1 -0
- package/dist/{ColorModeSwitch-CsWLiTBX.js → ColorModeSwitch-D7EuWyJz.js} +7 -17
- package/dist/ColorModeSwitch-D7EuWyJz.js.map +1 -0
- package/dist/Combobox-CxRAYOBt.js +1069 -0
- package/dist/Combobox-CxRAYOBt.js.map +1 -0
- package/dist/{Command-CqxoI_De.js → Command-BU_cVurn.js} +4 -4
- package/dist/{Command-CqxoI_De.js.map → Command-BU_cVurn.js.map} +1 -1
- package/dist/{CopyField-Rx9HPTbJ.js → CopyField-6_c-NdLO.js} +17 -53
- package/dist/{CopyField-Rx9HPTbJ.js.map → CopyField-6_c-NdLO.js.map} +1 -1
- package/dist/{DateInput-DpifECUQ.js → DateInput-DyEErfJf.js} +6 -6
- package/dist/{DateInput-DpifECUQ.js.map → DateInput-DyEErfJf.js.map} +1 -1
- package/dist/{DatePicker-nA8YdE84.js → DatePicker-CtSa9b3V.js} +3 -3
- package/dist/{DatePicker-nA8YdE84.js.map → DatePicker-CtSa9b3V.js.map} +1 -1
- package/dist/{DateRangeInput-9MIw7P6L.js → DateRangeInput-Dg7-VUd9.js} +10 -14
- package/dist/DateRangeInput-Dg7-VUd9.js.map +1 -0
- package/dist/{DateRangePicker-DjSUFjh4.js → DateRangePicker-BoPnh4aH.js} +9 -13
- package/dist/DateRangePicker-BoPnh4aH.js.map +1 -0
- package/dist/DiffView-ppTIzh2h.js.map +1 -1
- package/dist/{DropdownMenu-CASr-jgl.js → DropdownMenu-gRM-A8qU.js} +11 -6
- package/dist/DropdownMenu-gRM-A8qU.js.map +1 -0
- package/dist/{FieldItem-DtPTzNef.js → FieldItem-2wMXQ0Qw.js} +12 -25
- package/dist/FieldItem-2wMXQ0Qw.js.map +1 -0
- package/dist/{FieldItem-vhIJW4pj.d.ts → FieldItem-CPN1xjN5.d.ts} +11 -25
- package/dist/{FileUpload-DYQCTGjU.js → FileUpload-C83tXuE2.js} +11 -16
- package/dist/{FileUpload-DYQCTGjU.js.map → FileUpload-C83tXuE2.js.map} +1 -1
- package/dist/{Form-DAaatlBk.js → Form-95rVLfX8.js} +15 -23
- package/dist/{Form-DAaatlBk.js.map → Form-95rVLfX8.js.map} +1 -1
- package/dist/{FormGroup-Bl8JmnzJ.js → FormGroup-CmNiAtU6.js} +11 -17
- package/dist/FormGroup-CmNiAtU6.js.map +1 -0
- package/dist/{FullScreenModal-CN9nAs72.js → FullScreenModal-CD7mYeTz.js} +15 -29
- package/dist/FullScreenModal-CD7mYeTz.js.map +1 -0
- package/dist/{HoverCard-B9ZMJxjn.js → HoverCard-B8OKu9XZ.js} +2 -2
- package/dist/{HoverCard-B9ZMJxjn.js.map → HoverCard-B8OKu9XZ.js.map} +1 -1
- package/dist/{InputGroup-DcZRlVnN.js → InputGroup-B4QOPxHl.js} +12 -13
- package/dist/InputGroup-B4QOPxHl.js.map +1 -0
- package/dist/{Kbd-D1Azcc4g.js → Kbd-J4n1J6i4.js} +23 -13
- package/dist/Kbd-J4n1J6i4.js.map +1 -0
- package/dist/{MarkedText-DNGEUVWc.js → MarkedText-DlmlJO0u.js} +2 -2
- package/dist/{MarkedText-DNGEUVWc.js.map → MarkedText-DlmlJO0u.js.map} +1 -1
- package/dist/{MermaidDiagram-CujFxVzk.js → MermaidDiagram-BQvz6bhv.js} +16 -34
- package/dist/MermaidDiagram-BQvz6bhv.js.map +1 -0
- package/dist/{Modal-Coj-H02o.js → Modal-Driyqs_N.js} +17 -34
- package/dist/Modal-Driyqs_N.js.map +1 -0
- package/dist/{ModalTitle-C76ke2eo.js → ModalTitle-BxopkIoQ.js} +3 -3
- package/dist/ModalTitle-BxopkIoQ.js.map +1 -0
- package/dist/{MultiActionButtonGroup-CNNoBQbv.js → MultiActionButtonGroup-BPnmzBtw.js} +3 -3
- package/dist/{MultiActionButtonGroup-CNNoBQbv.js.map → MultiActionButtonGroup-BPnmzBtw.js.map} +1 -1
- package/dist/{Navbar-Liy1TPI7.js → Navbar-B_DNpv5s.js} +9 -13
- package/dist/{Navbar-Liy1TPI7.js.map → Navbar-B_DNpv5s.js.map} +1 -1
- package/dist/{OtpInput-CbbymqYs.js → OtpInput-I8B8Vjdl.js} +2 -2
- package/dist/{OtpInput-CbbymqYs.js.map → OtpInput-I8B8Vjdl.js.map} +1 -1
- package/dist/{PageHeader-Q3IpCnQd.js → PageHeader-CgfyXpf1.js} +13 -26
- package/dist/PageHeader-CgfyXpf1.js.map +1 -0
- package/dist/{PageLayout-DSVM-ASz.js → PageLayout-DiAAILuS.js} +12 -20
- package/dist/PageLayout-DiAAILuS.js.map +1 -0
- package/dist/{PageToolbar-BKVJiDAL.js → PageToolbar-DOAtAnfL.js} +12 -42
- package/dist/PageToolbar-DOAtAnfL.js.map +1 -0
- package/dist/{Pagination-C_b7Xhey.js → Pagination-LaSg-5cl.js} +3 -3
- package/dist/{Pagination-C_b7Xhey.js.map → Pagination-LaSg-5cl.js.map} +1 -1
- package/dist/{Popconfirm-5pBzT_HQ.js → Popconfirm-SLz0zodk.js} +3 -3
- package/dist/{Popconfirm-5pBzT_HQ.js.map → Popconfirm-SLz0zodk.js.map} +1 -1
- package/dist/{Popover-BEbQrC_P.js → Popover-CEk915I1.js} +4 -3
- package/dist/Popover-CEk915I1.js.map +1 -0
- package/dist/{RadioGroup-CUBsuP7r.js → RadioGroup-CBPRLRN0.js} +4 -4
- package/dist/{RadioGroup-CUBsuP7r.js.map → RadioGroup-CBPRLRN0.js.map} +1 -1
- package/dist/{Search-DVpJuzr9.js → Search-DmkQo716.js} +3 -3
- package/dist/{Search-DVpJuzr9.js.map → Search-DmkQo716.js.map} +1 -1
- package/dist/{SearchInput-Q85p8Ews.js → SearchInput-CEfQDNl3.js} +8 -13
- package/dist/SearchInput-CEfQDNl3.js.map +1 -0
- package/dist/{SectionNav-mpmSM3OC.js → SectionNav-B_qf0AXi.js} +10 -42
- package/dist/SectionNav-B_qf0AXi.js.map +1 -0
- package/dist/{Select-DV3Hak_l.js → Select-ByRvkZ3D.js} +8 -11
- package/dist/{Select-DV3Hak_l.js.map → Select-ByRvkZ3D.js.map} +1 -1
- package/dist/{Sheet-Chf0kX1E.js → Sheet-C-yXk5Da.js} +5 -9
- package/dist/Sheet-C-yXk5Da.js.map +1 -0
- package/dist/{Sidebar-CTWsHZhF.js → Sidebar-Ds0E6PbR.js} +181 -33
- package/dist/Sidebar-Ds0E6PbR.js.map +1 -0
- package/dist/{Slider-Bv0B6lI0.js → Slider-DWdu9NuM.js} +3 -3
- package/dist/{Slider-Bv0B6lI0.js.map → Slider-DWdu9NuM.js.map} +1 -1
- package/dist/{Stepper-C8sm9ZFM.js → Stepper-BLkLhfnd.js} +6 -9
- package/dist/{Stepper-C8sm9ZFM.js.map → Stepper-BLkLhfnd.js.map} +1 -1
- package/dist/{Switch-B0WdGSjz.js → Switch-DZvNePOm.js} +2 -2
- package/dist/{Switch-B0WdGSjz.js.map → Switch-DZvNePOm.js.map} +1 -1
- package/dist/{Table-CvYuTuNU.js → Table-BaVT5Tkn.js} +6 -11
- package/dist/{Table-CvYuTuNU.js.map → Table-BaVT5Tkn.js.map} +1 -1
- package/dist/{Tabs-eB974xJf.js → Tabs-Dt9oLYHC.js} +3 -3
- package/dist/{Tabs-eB974xJf.js.map → Tabs-Dt9oLYHC.js.map} +1 -1
- package/dist/{TextInput-DiEMxVF6.js → TextInput-CDG2XpBl.js} +12 -15
- package/dist/TextInput-CDG2XpBl.js.map +1 -0
- package/dist/{ThemeProvider-BI6JWBdJ.js → ThemeProvider-DXsxFg1U.js} +13 -31
- package/dist/ThemeProvider-DXsxFg1U.js.map +1 -0
- package/dist/{TimePicker-BGeqc-Ed.js → TimePicker-CDGYrRxi.js} +2 -2
- package/dist/{TimePicker-BGeqc-Ed.js.map → TimePicker-CDGYrRxi.js.map} +1 -1
- package/dist/{Timeline-BG5Xogxh.js → Timeline-B-I6sb0M.js} +2 -2
- package/dist/{Timeline-BG5Xogxh.js.map → Timeline-B-I6sb0M.js.map} +1 -1
- package/dist/{Toast-Dr6Uw7ao.js → Toast-PfQf3vj-.js} +2 -2
- package/dist/{Toast-Dr6Uw7ao.js.map → Toast-PfQf3vj-.js.map} +1 -1
- package/dist/{Workbench-UR2FBC7I.js → Workbench-DmZzpkj7.js} +2 -2
- package/dist/{Workbench-UR2FBC7I.js.map → Workbench-DmZzpkj7.js.map} +1 -1
- package/dist/{ZoomableSvg-U_VH3QRO.js → ZoomableSvg-BzXVfgnI.js} +5 -19
- package/dist/ZoomableSvg-BzXVfgnI.js.map +1 -0
- package/dist/charts.d.ts +21 -52
- package/dist/charts.js +13 -39
- package/dist/charts.js.map +1 -1
- package/dist/{context-D7X470dy.js → context-U293r3v-.js} +5 -9
- package/dist/context-U293r3v-.js.map +1 -0
- package/dist/editors.d.ts +27 -124
- package/dist/editors.js +29 -71
- package/dist/editors.js.map +1 -1
- package/dist/{findLiteralMatches-BGBw8Vbl.js → findLiteralMatches-DgGLzyG0.js} +8 -20
- package/dist/findLiteralMatches-DgGLzyG0.js.map +1 -0
- package/dist/flint.d.ts +3 -6
- package/dist/flint.js +31 -80
- package/dist/flint.js.map +1 -1
- package/dist/{icons-Cek151jC.js → icons-wcA70iQx.js} +105 -2
- package/dist/icons-wcA70iQx.js.map +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +2 -2
- package/dist/{index-m-kQEWiY.d.ts → index-B7k-09i1.d.ts} +14 -2
- package/dist/index.d.ts +1461 -1809
- package/dist/index.js +70 -67
- package/dist/internal/blocks/AIKit.js +2 -2
- package/dist/internal/blocks/AppShell.js +1 -1
- package/dist/internal/blocks/AuthLayout.js +7 -27
- package/dist/internal/blocks/AuthLayout.js.map +1 -1
- package/dist/internal/blocks/AutoSaveTextarea.js +1 -1
- package/dist/internal/blocks/BrandEditor.js +1 -1
- package/dist/internal/blocks/ChartPanel.js +4 -8
- package/dist/internal/blocks/ChartPanel.js.map +1 -1
- package/dist/internal/blocks/ChipEditor.js +129 -0
- package/dist/internal/blocks/ChipEditor.js.map +1 -0
- package/dist/internal/blocks/ClipboardButton.js +1 -1
- package/dist/internal/blocks/ColorInput.js +1 -1
- package/dist/internal/blocks/ColorModeSwitch.js +1 -1
- package/dist/internal/blocks/Command.js +1 -1
- package/dist/internal/blocks/CopyField.js +1 -1
- package/dist/internal/blocks/DashboardHero.js +4 -7
- package/dist/internal/blocks/DashboardHero.js.map +1 -1
- package/dist/internal/blocks/DateInput.js +1 -1
- package/dist/internal/blocks/DateRangeInput.js +1 -1
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
- package/dist/internal/blocks/EmptyState.js +5 -9
- package/dist/internal/blocks/EmptyState.js.map +1 -1
- package/dist/internal/blocks/ErrorState.js +5 -9
- package/dist/internal/blocks/ErrorState.js.map +1 -1
- package/dist/internal/blocks/ExportMenu.js +6 -10
- package/dist/internal/blocks/ExportMenu.js.map +1 -1
- package/dist/internal/blocks/Form/connectors/ComboboxField.js +40 -0
- package/dist/internal/blocks/Form/connectors/ComboboxField.js.map +1 -0
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +5 -22
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js.map +1 -1
- package/dist/internal/blocks/Form.js +1 -1
- package/dist/internal/blocks/FormGroup.js +1 -1
- package/dist/internal/blocks/GoogleButton.js +1 -1
- package/dist/internal/blocks/MicrosoftButton.js +1 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
- package/dist/internal/blocks/MultiCombobox.js +162 -165
- package/dist/internal/blocks/MultiCombobox.js.map +1 -1
- package/dist/internal/blocks/NumberInput.js +1 -1
- package/dist/internal/blocks/OtpInput.js +1 -1
- package/dist/internal/blocks/PageHeader.js +1 -1
- package/dist/internal/blocks/PageLayout.js +1 -1
- package/dist/internal/blocks/PageToolbar.js +1 -1
- package/dist/internal/blocks/PasswordInput.js +4 -4
- package/dist/internal/blocks/PasswordInput.js.map +1 -1
- package/dist/internal/blocks/SearchInput.js +1 -1
- package/dist/internal/blocks/SearchInputWithNavigation.js +4 -4
- package/dist/internal/blocks/SectionNav.js +1 -1
- package/dist/internal/blocks/SplitButton.js +3 -3
- package/dist/internal/blocks/StatCard.js +4 -8
- package/dist/internal/blocks/StatCard.js.map +1 -1
- package/dist/internal/blocks/TextInput.js +1 -1
- package/dist/internal/blocks/Textarea.js +2 -2
- package/dist/internal/blocks/TimeInput.js +5 -5
- package/dist/internal/blocks/TimeInput.js.map +1 -1
- package/dist/internal/components/Alert.js +1 -1
- package/dist/internal/components/AlertModal.js +1 -1
- package/dist/internal/components/Avatar.js +1 -1
- package/dist/internal/components/Badge.js +1 -1
- package/dist/internal/components/BrandLogo.js +1 -1
- package/dist/internal/components/Breadcrumb.js +1 -1
- package/dist/internal/components/Button.js +1 -1
- package/dist/internal/components/ButtonGroup.js.map +1 -1
- package/dist/internal/components/Calendar.js +1 -1
- package/dist/internal/components/Card.js +1 -1
- package/dist/internal/components/Checkbox.js +1 -1
- package/dist/internal/components/Clipboard.js +1 -1
- package/dist/internal/components/CollapsiblePanel.js +2 -2
- package/dist/internal/components/Combobox.js +2 -2
- package/dist/internal/components/DatePicker.js +1 -1
- package/dist/internal/components/DateRangePicker.js +1 -1
- package/dist/internal/components/DropdownMenu.js +1 -1
- package/dist/internal/components/FileUpload.js +1 -1
- package/dist/internal/components/FullScreenModal.js +1 -1
- package/dist/internal/components/HoverCard.js +1 -1
- package/dist/internal/components/InputGroup.js +1 -1
- package/dist/internal/components/Kbd.js +1 -1
- package/dist/internal/components/MarkedText.js +1 -1
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +1 -1
- package/dist/internal/components/Modal.js +1 -1
- package/dist/internal/components/Navbar.js +1 -1
- package/dist/internal/components/Pagination.js +1 -1
- package/dist/internal/components/PanelWithDetails.js +1 -1
- package/dist/internal/components/Popconfirm.js +1 -1
- package/dist/internal/components/Popover.js +1 -1
- package/dist/internal/components/RadioGroup.js +1 -1
- package/dist/internal/components/Search.js +1 -1
- package/dist/internal/components/Select.js +1 -1
- package/dist/internal/components/Separator.js.map +1 -1
- package/dist/internal/components/Sheet.js +1 -1
- package/dist/internal/components/Sidebar.js +1 -1
- package/dist/internal/components/Skeleton/Skeleton.js +5 -9
- package/dist/internal/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/internal/components/Slider.js +1 -1
- package/dist/internal/components/SpotlightBackdrop.js +3 -8
- package/dist/internal/components/SpotlightBackdrop.js.map +1 -1
- package/dist/internal/components/StatusDot.js +60 -0
- package/dist/internal/components/StatusDot.js.map +1 -0
- package/dist/internal/components/Stepper.js +1 -1
- package/dist/internal/components/Switch.js +1 -1
- package/dist/internal/components/Table.js +1 -1
- package/dist/internal/components/Tabs.js +1 -1
- package/dist/internal/components/ThemeProvider.js +3 -3
- package/dist/internal/components/TimePicker.js +1 -1
- package/dist/internal/components/Timeline.js +1 -1
- package/dist/internal/components/Toast.js +2 -2
- package/dist/internal/components/Tooltip.js +2 -2
- package/dist/internal/components/Truncated.js +4 -8
- package/dist/internal/components/Truncated.js.map +1 -1
- package/dist/internal/components/Workbench.js +1 -1
- package/dist/internal/components/ZoomableSvg.js +1 -1
- package/dist/internal/hooks/useScrollbarPosition.js +1 -1
- package/dist/internal/hooks/useStableCallback.js +4 -13
- package/dist/internal/hooks/useStableCallback.js.map +1 -1
- package/dist/internal/utils/mergeRefs.js +27 -9
- package/dist/internal/utils/mergeRefs.js.map +1 -1
- package/dist/internal/utils.js +3 -3
- package/dist/markdown-editor.d.ts +15 -37
- package/dist/markdown-editor.js +17 -23
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +4 -6
- package/dist/mermaid.js +1 -1
- package/dist/rjsf.d.ts +9 -19
- package/dist/rjsf.js +44 -84
- package/dist/rjsf.js.map +1 -1
- package/dist/{styles-BAFscjSV.js → styles-gzcjOyKv.js} +6 -6
- package/dist/styles-gzcjOyKv.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/svgTransforms-Dw2hRA-i.js +51 -0
- package/dist/svgTransforms-Dw2hRA-i.js.map +1 -0
- package/dist/testing.d.ts +3 -10
- package/dist/testing.js +5 -12
- package/dist/testing.js.map +1 -1
- package/dist/themeTokens-7DEab0kp.js +31 -0
- package/dist/themeTokens-7DEab0kp.js.map +1 -0
- package/dist/{toast-DIC0iNRf.js → toast-CyXEdaCZ.js} +3 -3
- package/dist/toast-CyXEdaCZ.js.map +1 -0
- package/dist/{themeScopeContext-D7fSyb06.js → useColorSchemeState-Cw4MCXUs.js} +14 -14
- package/dist/useColorSchemeState-Cw4MCXUs.js.map +1 -0
- package/dist/{useControllableState-M6494mCT.js → useControllableState-CUYXMsfz.js} +3 -7
- package/dist/useControllableState-CUYXMsfz.js.map +1 -0
- package/dist/useElement-D-RjrGa4.js +21 -0
- package/dist/useElement-D-RjrGa4.js.map +1 -0
- package/dist/useThemeAttributes-B199Regy.js +67 -0
- package/dist/useThemeAttributes-B199Regy.js.map +1 -0
- package/dist/{utils-DnkrFYqY.js → utils-Bd28bWgm.js} +53 -20
- package/dist/utils-Bd28bWgm.js.map +1 -0
- package/dist/vega.d.ts +8 -30
- package/dist/vega.js +5 -13
- package/dist/vega.js.map +1 -1
- package/dist/{vegaTheme-CSvFEMBl.js → vegaTheme-VQMWTlBw.js} +7 -21
- package/dist/vegaTheme-VQMWTlBw.js.map +1 -0
- package/package.json +11 -9
- package/src/styles.css +120 -14
- package/src/theme.css +126 -6
- package/dist/AIKit-CQxVwyAk.js.map +0 -1
- package/dist/Alert-C4Y9IwMI.js.map +0 -1
- package/dist/AlertModal-BGJdaRRj.js.map +0 -1
- package/dist/AppShell-DRgJxpXW.js.map +0 -1
- package/dist/Badge-o5jURtpB.js.map +0 -1
- package/dist/BrandLogo-CoKBk4MI.js.map +0 -1
- package/dist/Breadcrumb-D1id7YXd.js.map +0 -1
- package/dist/Button-DsRrU5F1.js.map +0 -1
- package/dist/Calendar-cG5NIJ4O.js.map +0 -1
- package/dist/Card-Dyo7055Q.js.map +0 -1
- package/dist/Checkbox-Bqr6zXcW.js.map +0 -1
- package/dist/CodeEditor-C9AS8Ch0.js.map +0 -1
- package/dist/ColorInput-Dg87lKcR.js.map +0 -1
- package/dist/ColorModeSwitch-CsWLiTBX.js.map +0 -1
- package/dist/Combobox-BfanUAqY.js +0 -619
- package/dist/Combobox-BfanUAqY.js.map +0 -1
- package/dist/DateRangeInput-9MIw7P6L.js.map +0 -1
- package/dist/DateRangePicker-DjSUFjh4.js.map +0 -1
- package/dist/DropdownMenu-CASr-jgl.js.map +0 -1
- package/dist/FieldItem-DtPTzNef.js.map +0 -1
- package/dist/FormGroup-Bl8JmnzJ.js.map +0 -1
- package/dist/FullScreenModal-CN9nAs72.js.map +0 -1
- package/dist/InputGroup-DcZRlVnN.js.map +0 -1
- package/dist/Kbd-D1Azcc4g.js.map +0 -1
- package/dist/MermaidDiagram-CujFxVzk.js.map +0 -1
- package/dist/Modal-Coj-H02o.js.map +0 -1
- package/dist/ModalTitle-C76ke2eo.js.map +0 -1
- package/dist/PageHeader-Q3IpCnQd.js.map +0 -1
- package/dist/PageLayout-DSVM-ASz.js.map +0 -1
- package/dist/PageToolbar-BKVJiDAL.js.map +0 -1
- package/dist/Popover-BEbQrC_P.js.map +0 -1
- package/dist/SearchInput-Q85p8Ews.js.map +0 -1
- package/dist/SectionNav-mpmSM3OC.js.map +0 -1
- package/dist/Sheet-Chf0kX1E.js.map +0 -1
- package/dist/Sidebar-CTWsHZhF.js.map +0 -1
- package/dist/TextInput-DiEMxVF6.js.map +0 -1
- package/dist/ThemeProvider-BI6JWBdJ.js.map +0 -1
- package/dist/ZoomableSvg-U_VH3QRO.js.map +0 -1
- package/dist/context-D7X470dy.js.map +0 -1
- package/dist/findLiteralMatches-BGBw8Vbl.js.map +0 -1
- package/dist/icons-Cek151jC.js.map +0 -1
- package/dist/styles-BAFscjSV.js.map +0 -1
- package/dist/svgTransforms-CJAYPk7o.js +0 -81
- package/dist/svgTransforms-CJAYPk7o.js.map +0 -1
- package/dist/themeScopeContext-D7fSyb06.js.map +0 -1
- package/dist/themeTokens-qP1-55O7.js +0 -119
- package/dist/themeTokens-qP1-55O7.js.map +0 -1
- package/dist/toast-DIC0iNRf.js.map +0 -1
- package/dist/useControllableState-M6494mCT.js.map +0 -1
- package/dist/useElement-DkF6esWL.js +0 -15
- package/dist/useElement-DkF6esWL.js.map +0 -1
- package/dist/utils-DnkrFYqY.js.map +0 -1
- package/dist/vegaTheme-CSvFEMBl.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
-
import { useArgoDesign } from "./context-
|
|
2
|
+
import { useArgoDesign } from "./context-U293r3v-.js";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Card/styles.ts
|
|
@@ -13,7 +13,7 @@ const cardClassnames = cva([
|
|
|
13
13
|
defaultVariants: { padding: "small" },
|
|
14
14
|
variants: {
|
|
15
15
|
bordered: {
|
|
16
|
-
true: "tw:border tw:border-solid tw:border-
|
|
16
|
+
true: "tw:border tw:border-solid tw:border-border",
|
|
17
17
|
false: "tw:shadow-raised tw:data-[argo=true]:shadow-sm"
|
|
18
18
|
},
|
|
19
19
|
padding: {
|
|
@@ -31,7 +31,7 @@ const cardHeaderClassnames = cva("tw:flex", {
|
|
|
31
31
|
},
|
|
32
32
|
variants: {
|
|
33
33
|
divider: {
|
|
34
|
-
true: "tw:min-h-16 tw:border-b tw:border-
|
|
34
|
+
true: "tw:min-h-16 tw:border-b tw:border-border tw:px-6 tw:py-2",
|
|
35
35
|
false: ""
|
|
36
36
|
},
|
|
37
37
|
layout: {
|
|
@@ -102,4 +102,4 @@ Card.Title = CardTitle;
|
|
|
102
102
|
//#endregion
|
|
103
103
|
export { Card };
|
|
104
104
|
|
|
105
|
-
//# sourceMappingURL=Card-
|
|
105
|
+
//# sourceMappingURL=Card-Cr9MBNHu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card-Cr9MBNHu.js","names":[],"sources":["../src/components/Card/styles.ts","../src/components/Card/CardContent.tsx","../src/components/Card/CardHeader.tsx","../src/components/Card/CardTitle.tsx","../src/components/Card/Card.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nexport const cardClassnames = cva(\n ['tw:flex', 'tw:flex-col', 'tw:rounded-lg', 'tw:bg-card', 'tw:text-card-foreground'],\n {\n defaultVariants: {\n padding: 'small',\n },\n variants: {\n bordered: {\n true: 'tw:border tw:border-solid tw:border-border',\n false: 'tw:shadow-raised tw:data-[argo=true]:shadow-sm',\n },\n // `none` drops the gap too: slots own their padding, so a gap would\n // double-space a `Card.Header divider`.\n padding: {\n none: 'tw:p-0',\n small: 'tw:gap-4 tw:px-6 tw:py-4',\n medium: 'tw:gap-4 tw:p-7',\n large: 'tw:gap-4 tw:p-8',\n },\n },\n },\n);\n\nexport const cardHeaderClassnames = cva('tw:flex', {\n defaultVariants: {\n divider: false,\n layout: 'row',\n },\n variants: {\n // No `border-solid`: it would give the other sides a 3px `medium` border.\n // `min-h-16` holds one height with or without a button; keep padding under it.\n divider: {\n true: 'tw:min-h-16 tw:border-b tw:border-border tw:px-6 tw:py-2',\n false: '',\n },\n layout: {\n row: 'tw:items-center tw:justify-between tw:gap-4',\n inline: 'tw:items-center tw:gap-3',\n stack: 'tw:flex-col tw:gap-1.5',\n },\n },\n});\n\nexport const cardContentClassnames = cva('', {\n defaultVariants: {\n padded: false,\n },\n variants: {\n padded: {\n true: 'tw:px-6 tw:py-5',\n false: '',\n },\n },\n});\n\nexport const cardTitleClassnames = cn(\n 'tw:m-0',\n 'tw:leading-6',\n 'tw:font-medium',\n 'tw:text-base',\n 'tw:text-card-foreground',\n);\n","import type { HTMLAttributes } from 'react';\n\nimport { cardContentClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n /** Applies the standard body padding. Use with `Card padding=\"none\"`, where the\n * root adds none — otherwise the padding is doubled. */\n padded?: boolean;\n};\n\nexport const CardContent = ({ children, className, padded = false, ...rest }: Props) => (\n // `|| undefined` so an unpadded, unstyled content slot stays attribute-free\n // rather than rendering `class=\"\"`.\n <div {...rest} className={cardContentClassnames({ className, padded }) || undefined}>\n {children}\n </div>\n);\n","import type { HTMLAttributes } from 'react';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { cardHeaderClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & {\n /** Bottom rule plus own padding and a 64px min height. Full-bleed only with `Card padding=\"none\"`. */\n divider?: boolean;\n /** `row`: title left, actions right. `inline`: together, e.g. title + badge.\n * `stack`: description under the title. */\n layout?: 'row' | 'inline' | 'stack';\n};\n\nexport const CardHeader = ({\n children,\n className,\n divider = false,\n layout = 'row',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n return (\n <div\n {...rest}\n data-argo={renderArgo}\n className={cardHeaderClassnames({ className, divider, layout })}\n >\n {children}\n </div>\n );\n};\n","import type { HTMLAttributes } from 'react';\n\nimport { cn } from '../../utils';\n\nimport { cardTitleClassnames } from './styles';\n\ntype HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\ntype Props = HTMLAttributes<HTMLHeadingElement> & {\n /** Heading tag to render. Defaults to `h3`; set explicitly to avoid a heading-order skip\n * (e.g. `as=\"h2\"` when the Card sits directly under a page's `h1`). */\n as?: HeadingLevel;\n};\n\nexport const CardTitle = ({ children, className, as: Tag = 'h3', ...rest }: Props) => (\n <Tag className={cn(cardTitleClassnames, className)} {...rest}>\n {children}\n </Tag>\n);\n","import type { HTMLAttributes } from 'react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { useArgoDesign } from '../ThemeProvider/context';\n\nimport { CardContent } from './CardContent';\nimport { CardHeader } from './CardHeader';\nimport { CardTitle } from './CardTitle';\nimport { cardClassnames } from './styles';\n\ntype Props = HTMLAttributes<HTMLDivElement> & VariantProps<typeof cardClassnames>;\n\nexport const Card = ({\n children,\n className,\n bordered = false,\n padding = 'small',\n ...rest\n}: Props) => {\n const renderArgo = useArgoDesign();\n return (\n <div\n {...rest}\n data-argo={renderArgo}\n className={cardClassnames({ className, bordered, padding })}\n >\n {children}\n </div>\n );\n};\n\nCard.Header = CardHeader;\nCard.Content = CardContent;\nCard.Title = CardTitle;\n"],"mappings":";;;;;AAIA,MAAa,iBAAiB,IAC5B;CAAC;CAAW;CAAe;CAAiB;CAAc;AAAyB,GACnF;CACE,iBAAiB,EACf,SAAS,QACX;CACA,UAAU;EACR,UAAU;GACR,MAAM;GACN,OAAO;EACT;EAGA,SAAS;GACP,MAAM;GACN,OAAO;GACP,QAAQ;GACR,OAAO;EACT;CACF;AACF,CACF;AAEA,MAAa,uBAAuB,IAAI,WAAW;CACjD,iBAAiB;EACf,SAAS;EACT,QAAQ;CACV;CACA,UAAU;EAGR,SAAS;GACP,MAAM;GACN,OAAO;EACT;EACA,QAAQ;GACN,KAAK;GACL,QAAQ;GACR,OAAO;EACT;CACF;AACF,CAAC;AAED,MAAa,wBAAwB,IAAI,IAAI;CAC3C,iBAAiB,EACf,QAAQ,MACV;CACA,UAAU,EACR,QAAQ;EACN,MAAM;EACN,OAAO;CACT,EACF;AACF,CAAC;AAED,MAAa,sBAAsB,GACjC,UACA,gBACA,kBACA,gBACA,yBACF;;;ACvDA,MAAa,eAAe,EAAE,UAAU,WAAW,SAAS,OAAO,GAAG,WAGpE,oBAAC,OAAD;CAAK,GAAI;CAAM,WAAW,sBAAsB;EAAE;EAAW;CAAO,CAAC,KAAK,KAAA;CACvE;AACE,CAAA;;;ACDP,MAAa,cAAc,EACzB,UACA,WACA,UAAU,OACV,SAAS,OACT,GAAG,WACQ;CACX,MAAM,aAAa,cAAc;CACjC,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAW;EACX,WAAW,qBAAqB;GAAE;GAAW;GAAS;EAAO,CAAC;EAE7D;CACE,CAAA;AAET;;;ACjBA,MAAa,aAAa,EAAE,UAAU,WAAW,IAAI,MAAM,MAAM,GAAG,WAClE,oBAAC,KAAD;CAAK,WAAW,GAAG,qBAAqB,SAAS;CAAG,GAAI;CACrD;AACE,CAAA;;;ACLP,MAAa,QAAQ,EACnB,UACA,WACA,WAAW,OACX,UAAU,SACV,GAAG,WACQ;CACX,MAAM,aAAa,cAAc;CACjC,OACE,oBAAC,OAAD;EACE,GAAI;EACJ,aAAW;EACX,WAAW,eAAe;GAAE;GAAW;GAAU;EAAQ,CAAC;EAEzD;CACE,CAAA;AAET;AAEA,KAAK,SAAS;AACd,KAAK,UAAU;AACf,KAAK,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
-
import { Tooltip } from "./utils-
|
|
3
|
-
import { useArgoDesign } from "./context-
|
|
4
|
-
import { Check, Minus } from "./icons-
|
|
2
|
+
import { Tooltip } from "./utils-Bd28bWgm.js";
|
|
3
|
+
import { useArgoDesign } from "./context-U293r3v-.js";
|
|
4
|
+
import { Check, Minus } from "./icons-wcA70iQx.js";
|
|
5
5
|
import { FieldBox } from "./FieldBox-D7DYtX_m.js";
|
|
6
6
|
import { useId } from "react";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
@@ -94,4 +94,4 @@ function Checkbox({ className, id: idProp, children, description, variant, posit
|
|
|
94
94
|
//#endregion
|
|
95
95
|
export { Checkbox };
|
|
96
96
|
|
|
97
|
-
//# sourceMappingURL=Checkbox-
|
|
97
|
+
//# sourceMappingURL=Checkbox-8yIIgY7g.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox-8yIIgY7g.js","names":[],"sources":["../src/components/Checkbox/styles.ts","../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const rootVariants = cva(\n [\n // reset\n 'tailwindcss-preflight',\n\n // position\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n\n 'tw:peer',\n 'tw:size-4',\n 'tw:shrink-0',\n 'tw:cursor-pointer',\n\n // border\n 'tw:border',\n 'tw:border-solid',\n\n // disabled\n 'tw:disabled:opacity-50',\n 'tw:disabled:cursor-not-allowed',\n ],\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:rounded',\n 'tw:border-neutral-200',\n\n 'tw:data-[state=checked]:bg-primary',\n 'tw:data-[state=checked]:border-primary',\n\n 'tw:data-[state=indeterminate]:bg-white',\n 'tw:data-[state=indeterminate]:border-neutral-200',\n ],\n argo: [\n 'tw:rounded',\n 'tw:border-input',\n 'tw:transition-colors',\n\n 'tw:data-[state=checked]:bg-primary',\n 'tw:data-[state=checked]:border-primary',\n\n 'tw:data-[state=indeterminate]:bg-primary',\n 'tw:data-[state=indeterminate]:border-primary',\n\n // focus\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:border-primary',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-ring/50',\n ],\n },\n },\n },\n);\n\nexport const indicatorVariants = cva(['tw:group', 'tw:flex', 'tw:items-center'], {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: [\n 'tw:data-[state=checked]:text-primary-foreground',\n 'tw:data-[state=indeterminate]:text-neutral-200',\n ],\n argo: ['tw:text-primary-foreground'],\n },\n },\n});\n","import { useId } from 'react';\nimport type { ComponentProps, ReactNode } from 'react';\nimport type { CheckedState } from '@radix-ui/react-checkbox';\nimport { Indicator, Root } from '@radix-ui/react-checkbox';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Check, Minus } from '../../icons';\nimport { cn } from '../../utils';\nimport { FieldBox } from '../FieldBox';\nimport type { fieldBoxVariants } from '../FieldBox/styles';\nimport { useArgoDesign } from '../ThemeProvider/context';\nimport type { Props as TooltipProps } from '../Tooltip';\nimport { Tooltip } from '../Tooltip';\n\nimport { indicatorVariants, rootVariants } from './styles';\n\ntype Props = {\n id?: string | number;\n description?: ReactNode;\n variant?: VariantProps<typeof fieldBoxVariants>['variant'];\n position?: 'start' | 'end';\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n} & Omit<ComponentProps<typeof Root>, 'id'>;\n\nexport function Checkbox(\n prop: Omit<Props, 'checked' | 'onCheckedChange'> & {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n },\n): ReactNode;\n\nexport function Checkbox(\n prop: Omit<Props, 'checked' | 'onCheckedChange'> & {\n checked?: CheckedState;\n onCheckedChange?: (checked: CheckedState) => void;\n },\n): ReactNode;\n\nexport function Checkbox({\n className,\n id: idProp,\n children,\n description,\n variant,\n position,\n tooltip,\n tooltipPlacement = 'top',\n ...rest\n}: Props) {\n const fallbackId = useId();\n const id = idProp?.toString() ?? fallbackId;\n const styleVariant = useArgoDesign() ? 'argo' : 'default';\n\n const checkboxElement = (\n <Root id={id} {...rest} className={cn(rootVariants({ variant: styleVariant, className }))}>\n <Indicator className={cn(indicatorVariants({ variant: styleVariant }))}>\n <Check className=\"tw:hidden tw:size-3 tw:stroke-[4px] tw:group-data-[state=checked]:block\" />\n <Minus className=\"tw:hidden tw:size-3 tw:stroke-[4px] tw:group-data-[state=indeterminate]:block\" />\n </Indicator>\n </Root>\n );\n\n const rendered = !children ? (\n checkboxElement\n ) : (\n <FieldBox htmlFor={id} variant={variant} position={position} control={checkboxElement}>\n <FieldBox.Title>{children}</FieldBox.Title>\n {description && <FieldBox.Description>{description}</FieldBox.Description>}\n </FieldBox>\n );\n\n if (!tooltip) return rendered;\n\n // `asChild` only onto the labelled FieldBox: on the bare Radix `Root` the tooltip's\n // `data-state` overwrites the checkbox's and it stops toggling.\n return (\n <Tooltip tooltip={tooltip} placement={tooltipPlacement} triggerAsChild={!!children}>\n {rendered}\n </Tooltip>\n );\n}\n"],"mappings":";;;;;;;;;;AAEA,MAAa,eAAe,IAC1B;CAEE;CAGA;CACA;CACA;CAEA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB,EACf,SAAS,UACX;CACA,UAAU,EACR,SAAS;EACP,SAAS;GACP;GACA;GAEA;GACA;GAEA;GACA;EACF;EACA,MAAM;GACJ;GACA;GACA;GAEA;GACA;GAEA;GACA;GAGA;GACA;GACA;GACA;EACF;CACF,EACF;AACF,CACF;AAEA,MAAa,oBAAoB,IAAI;CAAC;CAAY;CAAW;AAAiB,GAAG;CAC/E,iBAAiB,EACf,SAAS,UACX;CACA,UAAU,EACR,SAAS;EACP,SAAS,CACP,mDACA,gDACF;EACA,MAAM,CAAC,4BAA4B;CACrC,EACF;AACF,CAAC;;;ACrCD,SAAgB,SAAS,EACvB,WACA,IAAI,QACJ,UACA,aACA,SACA,UACA,SACA,mBAAmB,OACnB,GAAG,QACK;CACR,MAAM,aAAa,MAAM;CACzB,MAAM,KAAK,QAAQ,SAAS,KAAK;CACjC,MAAM,eAAe,cAAc,IAAI,SAAS;CAEhD,MAAM,kBACJ,oBAAC,MAAD;EAAU;EAAI,GAAI;EAAM,WAAW,GAAG,aAAa;GAAE,SAAS;GAAc;EAAU,CAAC,CAAC;EACtF,UAAA,qBAAC,WAAD;GAAW,WAAW,GAAG,kBAAkB,EAAE,SAAS,aAAa,CAAC,CAAC;GAArE,UAAA,CACE,oBAAC,OAAD,EAAO,WAAU,0EAA2E,CAAA,GAC5F,oBAAC,OAAD,EAAO,WAAU,gFAAiF,CAAA,CACzF;;CACP,CAAA;CAGR,MAAM,WAAW,CAAC,WAChB,kBAEA,qBAAC,UAAD;EAAU,SAAS;EAAa;EAAmB;EAAU,SAAS;EAAtE,UAAA,CACE,oBAAC,SAAS,OAAV,EAAiB,SAAyB,CAAA,GACzC,eAAe,oBAAC,SAAS,aAAV,EAAA,UAAuB,YAAkC,CAAA,CACjE;;CAGZ,IAAI,CAAC,SAAS,OAAO;CAIrB,OACE,oBAAC,SAAD;EAAkB;EAAS,WAAW;EAAkB,gBAAgB,CAAC,CAAC;EACvE,UAAA;CACM,CAAA;AAEb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
-
import { Tooltip, copyToClipboard } from "./utils-
|
|
2
|
+
import { Tooltip, copyToClipboard } from "./utils-Bd28bWgm.js";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Clipboard/Clipboard.tsx
|
|
@@ -55,4 +55,4 @@ const Clipboard = ({ ref, text: textProp, children, tooltip = "Copy to Clipboard
|
|
|
55
55
|
//#endregion
|
|
56
56
|
export { Clipboard };
|
|
57
57
|
|
|
58
|
-
//# sourceMappingURL=Clipboard-
|
|
58
|
+
//# sourceMappingURL=Clipboard-_xf6hMDD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clipboard-
|
|
1
|
+
{"version":3,"file":"Clipboard-_xf6hMDD.js","names":[],"sources":["../src/components/Clipboard/Clipboard.tsx"],"sourcesContent":["import { useState } from 'react';\nimport type { ComponentProps, MouseEventHandler } from 'react';\n\nimport { cn, copyToClipboard } from '../../utils';\nimport { type Props as TooltipProps, Tooltip } from '../Tooltip';\n\ntype Props = {\n tooltip?: TooltipProps['tooltip'];\n tooltipPlacement?: TooltipProps['placement'];\n tooltipVariant?: TooltipProps['variant'];\n asChild?: TooltipProps['triggerAsChild'];\n text?: string | (() => string);\n} & ComponentProps<'button'>;\n\nexport const Clipboard = ({\n ref,\n text: textProp,\n children,\n tooltip = 'Copy to Clipboard',\n tooltipPlacement = 'top',\n tooltipVariant: tooltipVariantProp = 'action',\n asChild = false,\n onClick,\n className,\n ...restButtonProps\n}: Props) => {\n const [isTooltipOpen, setIsTooltipOpen] = useState(false);\n const [state, setState] = useState<'ready' | 'copied' | 'error'>('ready');\n const text = typeof textProp === 'function' ? textProp() : textProp;\n\n const copy = async (text: string) => {\n try {\n // For the clipboard feature to work reliably, the window must be in focus for security reasons.\n // However, the button can be clicked without the window being focused.\n if (!document.hasFocus()) window.focus();\n\n await copyToClipboard(text);\n setState('copied');\n } catch {\n setState('error');\n }\n };\n\n const handleOnClick: MouseEventHandler<HTMLButtonElement> = (event) => {\n // Open on click rather than waiting for hover. Radix opens on pointer-enter via a\n // `delayDuration` timer (300ms here), so clicking faster than that left the outcome invisible\n // until the timer caught up — the message was already rendered, just inside a closed tooltip.\n setIsTooltipOpen(true);\n if (text && state === 'ready') void copy(text);\n onClick?.(event);\n };\n\n const handleOnOpenChange: ComponentProps<typeof Tooltip.Root>['onOpenChange'] = (open) => {\n // Reset when the tooltip closes, allowing the user to leave the copy button.\n if (!open && state !== 'ready') setState('ready');\n setIsTooltipOpen(open);\n };\n\n const tooltipContent = (() => {\n if (!text) return 'Nothing to copy';\n if (state === 'error') return 'Failed to copy';\n if (state === 'copied') return 'Copied to Clipboard';\n return tooltip;\n })();\n\n const tooltipVariant: TooltipProps['variant'] =\n state === 'ready' && !!text ? tooltipVariantProp : 'action';\n\n // `tooltip={null}` leaves nothing to say until there is an outcome. Not rendering `Content` at all\n // is what makes that work: hovering still opens the tooltip, there is simply nothing in it, and\n // the copied / failed message appears in place the moment `state` changes. It also keeps Radix\n // from pointing the trigger's `aria-describedby` at content that has no text.\n const hasTooltipContent = tooltipContent !== null && tooltipContent !== undefined;\n\n return (\n <Tooltip.Root open={isTooltipOpen} onOpenChange={handleOnOpenChange}>\n <Tooltip.Trigger\n {...restButtonProps}\n asChild={asChild}\n keepOpenOnClick\n onClick={handleOnClick}\n className={cn('tw:cursor-pointer', className)}\n ref={ref}\n >\n {children ?? text}\n </Tooltip.Trigger>\n\n {hasTooltipContent && (\n <Tooltip.Content\n keepOpenOnPointerDownOutside\n placement={tooltipPlacement}\n variant={tooltipVariant}\n >\n {tooltipContent}\n </Tooltip.Content>\n )}\n </Tooltip.Root>\n );\n};\n"],"mappings":";;;;;AAcA,MAAa,aAAa,EACxB,KACA,MAAM,UACN,UACA,UAAU,qBACV,mBAAmB,OACnB,gBAAgB,qBAAqB,UACrC,UAAU,OACV,SACA,WACA,GAAG,sBACQ;CACX,MAAM,CAAC,eAAe,oBAAoB,SAAS,KAAK;CACxD,MAAM,CAAC,OAAO,YAAY,SAAuC,OAAO;CACxE,MAAM,OAAO,OAAO,aAAa,aAAa,SAAS,IAAI;CAE3D,MAAM,OAAO,OAAO,SAAiB;EACnC,IAAI;GAGF,IAAI,CAAC,SAAS,SAAS,GAAG,OAAO,MAAM;GAEvC,MAAM,gBAAgB,IAAI;GAC1B,SAAS,QAAQ;EACnB,QAAQ;GACN,SAAS,OAAO;EAClB;CACF;CAEA,MAAM,iBAAuD,UAAU;EAIrE,iBAAiB,IAAI;EACrB,IAAI,QAAQ,UAAU,SAAS,KAAU,IAAI;EAC7C,UAAU,KAAK;CACjB;CAEA,MAAM,sBAA2E,SAAS;EAExF,IAAI,CAAC,QAAQ,UAAU,SAAS,SAAS,OAAO;EAChD,iBAAiB,IAAI;CACvB;CAEA,MAAM,wBAAwB;EAC5B,IAAI,CAAC,MAAM,OAAO;EAClB,IAAI,UAAU,SAAS,OAAO;EAC9B,IAAI,UAAU,UAAU,OAAO;EAC/B,OAAO;CACT,EAAA,CAAG;CAEH,MAAM,iBACJ,UAAU,WAAW,CAAC,CAAC,OAAO,qBAAqB;CAMrD,MAAM,oBAAoB,mBAAmB,QAAQ,mBAAmB,KAAA;CAExE,OACE,qBAAC,QAAQ,MAAT;EAAc,MAAM;EAAe,cAAc;EAAjD,UAAA,CACE,oBAAC,QAAQ,SAAT;GACE,GAAI;GACK;GACT,iBAAA;GACA,SAAS;GACT,WAAW,GAAG,qBAAqB,SAAS;GACvC;GAEJ,UAAA,YAAY;EACE,CAAA,GAEhB,qBACC,oBAAC,QAAQ,SAAT;GACE,8BAAA;GACA,WAAW;GACX,SAAS;GAER,UAAA;EACc,CAAA,CAEP;;AAElB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Copy } from "./icons-
|
|
2
|
-
import { Button, ButtonInline } from "./Button-
|
|
3
|
-
import { Clipboard } from "./Clipboard-
|
|
1
|
+
import { Copy } from "./icons-wcA70iQx.js";
|
|
2
|
+
import { Button, ButtonInline } from "./Button-Ca4Q3VJU.js";
|
|
3
|
+
import { Clipboard } from "./Clipboard-_xf6hMDD.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/blocks/ClipboardButton/ClipboardButton.tsx
|
|
6
6
|
const DEFAULT_ICON = /* @__PURE__ */ jsx(Copy, {});
|
|
@@ -40,4 +40,4 @@ const ClipboardInline = ({ text, tooltip, tooltipPlacement, tooltipVariant, chil
|
|
|
40
40
|
//#endregion
|
|
41
41
|
export { ClipboardButton, ClipboardInline };
|
|
42
42
|
|
|
43
|
-
//# sourceMappingURL=ClipboardButton-
|
|
43
|
+
//# sourceMappingURL=ClipboardButton-DHa1trtI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardButton-
|
|
1
|
+
{"version":3,"file":"ClipboardButton-DHa1trtI.js","names":[],"sources":["../src/blocks/ClipboardButton/ClipboardButton.tsx","../src/blocks/ClipboardButton/ClipboardInline.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport { Button } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof Button>, 'disabled' | 'icon'>;\n\ntype Props = ClipboardProps & ButtonProps & { icon?: ReactNode };\n\nconst DEFAULT_ICON: ReactNode = <Copy />;\nconst DEFAULT_ARIA_LABEL = 'Copy';\n\nexport const ClipboardButton = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n icon = DEFAULT_ICON,\n variant = 'outline',\n children,\n ...rest\n}: Props) => {\n // Icon-only (no text children): the `tooltip` is visual only, not an accessible\n // name, so fall back to it (when it's a string) or a sensible default. A\n // consumer-supplied `aria-label` in `rest` still wins.\n // A non-empty string tooltip names the action; an empty/absent tooltip still\n // needs a name, so fall back to the default rather than an empty aria-label.\n const defaultAriaLabel =\n typeof tooltip === 'string' && tooltip.trim() ? tooltip : DEFAULT_ARIA_LABEL;\n const ariaLabel = rest['aria-label'] ?? (children == null ? defaultAriaLabel : undefined);\n\n return (\n <Clipboard\n asChild\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n text={text}\n >\n <Button {...rest} aria-label={ariaLabel} variant={variant} disabled={!text}>\n {icon}\n {children}\n </Button>\n </Clipboard>\n );\n};\n","import type { ComponentProps } from 'react';\n\nimport { ButtonInline } from '../../components/Button';\nimport { Clipboard } from '../../components/Clipboard';\nimport { Copy } from '../../icons';\n\ntype ClipboardProps = Pick<\n ComponentProps<typeof Clipboard>,\n 'text' | 'tooltip' | 'tooltipPlacement' | 'tooltipVariant'\n>;\n\ntype ButtonProps = Omit<ComponentProps<typeof ButtonInline>, 'disabled'>;\n\ntype Props = { hideIcon?: boolean } & ClipboardProps & ButtonProps;\n\nexport const ClipboardInline = ({\n // clipboard props\n text,\n tooltip,\n tooltipPlacement,\n tooltipVariant,\n\n // button props\n children = 'Copy To Clipboard',\n hideIcon = false,\n ...rest\n}: Props) => (\n <Clipboard\n asChild\n text={text}\n tooltip={tooltip}\n tooltipPlacement={tooltipPlacement}\n tooltipVariant={tooltipVariant}\n >\n <ButtonInline {...rest} disabled={!text}>\n {!hideIcon && <Copy className=\"tw:size-4\" />}\n {children}\n </ButtonInline>\n </Clipboard>\n);\n"],"mappings":";;;;;AAeA,MAAM,eAA0B,oBAAC,MAAD,CAAO,CAAA;AACvC,MAAM,qBAAqB;AAE3B,MAAa,mBAAmB,EAE9B,MACA,SACA,kBACA,gBAGA,OAAO,cACP,UAAU,WACV,UACA,GAAG,WACQ;CAMX,MAAM,mBACJ,OAAO,YAAY,YAAY,QAAQ,KAAK,IAAI,UAAU;CAC5D,MAAM,YAAY,KAAK,kBAAkB,YAAY,OAAO,mBAAmB,KAAA;CAE/E,OACE,oBAAC,WAAD;EACE,SAAA;EACS;EACS;EACF;EACV;EAEN,UAAA,qBAAC,QAAD;GAAQ,GAAI;GAAM,cAAY;GAAoB;GAAS,UAAU,CAAC;GAAtE,UAAA,CACG,MACA,QACK;;CACC,CAAA;AAEf;;;ACvCA,MAAa,mBAAmB,EAE9B,MACA,SACA,kBACA,gBAGA,WAAW,qBACX,WAAW,OACX,GAAG,WAEH,oBAAC,WAAD;CACE,SAAA;CACM;CACG;CACS;CACF;CAEhB,UAAA,qBAAC,cAAD;EAAc,GAAI;EAAM,UAAU,CAAC;EAAnC,UAAA,CACG,CAAC,YAAY,oBAAC,MAAD,EAAM,WAAU,YAAa,CAAA,GAC1C,QACW;;AACL,CAAA"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
-
import { isMac, keyCodes } from "./utils-
|
|
3
|
-
import { useArgoDesign } from "./context-
|
|
4
|
-
import { findLiteralMatches } from "./findLiteralMatches-
|
|
5
|
-
import { ClipboardButton } from "./ClipboardButton-
|
|
2
|
+
import { isMac, keyCodes } from "./utils-Bd28bWgm.js";
|
|
3
|
+
import { useArgoDesign } from "./context-U293r3v-.js";
|
|
4
|
+
import { findLiteralMatches } from "./findLiteralMatches-DgGLzyG0.js";
|
|
5
|
+
import { ClipboardButton } from "./ClipboardButton-DHa1trtI.js";
|
|
6
6
|
import { useStableCallback } from "./internal/hooks/useStableCallback.js";
|
|
7
7
|
import { HelpBlock } from "./internal/components/HelpBlock.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useThemeAttributes } from "./useThemeAttributes-B199Regy.js";
|
|
9
|
+
import { Kbd } from "./Kbd-J4n1J6i4.js";
|
|
10
|
+
import { resolveToken } from "./themeTokens-7DEab0kp.js";
|
|
10
11
|
import { useEffect, useLayoutEffect, useMemo, useRef } from "react";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { autocompletion, completeAnyWord } from "@codemirror/autocomplete";
|
|
13
14
|
import { unifiedMergeView } from "@codemirror/merge";
|
|
14
15
|
import { Decoration, EditorView, ViewPlugin, keymap, placeholder, tooltips } from "@codemirror/view";
|
|
15
16
|
import CodeMirror, { EditorState } from "@uiw/react-codemirror";
|
|
16
|
-
import colors from "@keboola/tailwind-config/colors";
|
|
17
17
|
import { javascript } from "@codemirror/lang-javascript";
|
|
18
18
|
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
19
19
|
import { python } from "@codemirror/lang-python";
|
|
@@ -25,6 +25,7 @@ import { toml } from "@codemirror/legacy-modes/mode/toml";
|
|
|
25
25
|
import { linter } from "@codemirror/lint";
|
|
26
26
|
import { githubDarkInit, githubLightInit } from "@uiw/codemirror-theme-github";
|
|
27
27
|
import { getSqlLanguageSupport } from "@keboola/codemirror-lang-sql";
|
|
28
|
+
import colors from "@keboola/tailwind-config/colors";
|
|
28
29
|
import { simpleMode } from "@codemirror/legacy-modes/mode/simple-mode";
|
|
29
30
|
import { tags } from "@lezer/highlight";
|
|
30
31
|
import { Compartment, StateEffect, StateField } from "@codemirror/state";
|
|
@@ -200,15 +201,9 @@ const dbt = simpleMode({
|
|
|
200
201
|
//#endregion
|
|
201
202
|
//#region src/components/CodeEditor/modes/jsonnet.ts
|
|
202
203
|
/**
|
|
203
|
-
*
|
|
204
|
-
* the language's own authors, which was never taken past CodeMirror 5.
|
|
205
|
-
* CodeMirror 5 style names are replaced by their CodeMirror 6 highlight tags:
|
|
206
|
-
* `string-2` is `escape`, `error` is `invalid`.
|
|
204
|
+
* Port of google/codemirror-mode-jsonnet (Apache-2.0) to CodeMirror 6 tags.
|
|
207
205
|
*
|
|
208
|
-
*
|
|
209
|
-
* the line and, without `^`, scans all of it for a match it then discards unless
|
|
210
|
-
* it started at the cursor — so an unanchored probe costs the whole remaining
|
|
211
|
-
* line, and this tokenizer makes up to twenty of them per token.
|
|
206
|
+
* - Patterns are anchored with `^`: unanchored, `StringStream.match` scans the whole rest of the line.
|
|
212
207
|
*/
|
|
213
208
|
const COMMENT_END = /^\*\//;
|
|
214
209
|
const COMMENT_START = /^\/\/|^#/;
|
|
@@ -346,14 +341,10 @@ const jsonnet = {
|
|
|
346
341
|
};
|
|
347
342
|
const DARK_GUTTER_ALPHA = "47";
|
|
348
343
|
/**
|
|
349
|
-
* The two diff fills
|
|
350
|
-
* low alpha over whatever token surface is behind it.
|
|
344
|
+
* The two diff fills per scheme: light uses the opaque pastel, dark the `500` hue at low alpha.
|
|
351
345
|
*
|
|
352
|
-
* -
|
|
353
|
-
*
|
|
354
|
-
* - Shared by the unified merge wash in `helpers.ts` and `buildDiffHighlightTheme` in
|
|
355
|
-
* `MergeEditor/decorations.ts`, so the two views cannot drift apart on the alphas.
|
|
356
|
-
* - Callers pass the hue and the pastel; which one is used is this function's business.
|
|
346
|
+
* - Imports nothing, so `MergeEditor` shares it without pulling in CodeMirror via `helpers.ts`.
|
|
347
|
+
* - Shared by `helpers.ts` and `MergeEditor/decorations.ts`, so their alphas cannot drift.
|
|
357
348
|
*/
|
|
358
349
|
const buildDiffWash = (scheme) => {
|
|
359
350
|
const dark = scheme === "dark";
|
|
@@ -367,16 +358,9 @@ const buildDiffWash = (scheme) => {
|
|
|
367
358
|
/**
|
|
368
359
|
* The tag colours layered over the stock github palette, per colour scheme.
|
|
369
360
|
*
|
|
370
|
-
* -
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* - Later entries win over the stock rule for the same tag — both `githubLightInit` and
|
|
374
|
-
* `githubDarkInit` concatenate these after their own.
|
|
375
|
-
* - `foreground` is the caller's, because it is a live `--*` token rather than a ramp step: the
|
|
376
|
-
* theme passes `resolveToken('foreground')`, the audit passes the scheme's channel value.
|
|
377
|
-
* - Every ramp step here is a light/dark pair, and each pair is chosen against **two** surfaces —
|
|
378
|
-
* the theme's `background` setting is the page, but `variant="field"` paints on `muted`, which
|
|
379
|
-
* the theme never sees. Ratios in the comments are quoted `background` / `muted`.
|
|
361
|
+
* - Imports only tags and ramps, so `scripts/contrast-audit.ts` can measure it.
|
|
362
|
+
* - These override stock rules for the same tag.
|
|
363
|
+
* - Colours are chosen against `background` and `muted` (`variant="field"`); ratios quote both.
|
|
380
364
|
*/
|
|
381
365
|
const buildSyntaxPalette = (scheme, foreground) => {
|
|
382
366
|
const dark = scheme === "dark";
|
|
@@ -460,14 +444,10 @@ const EDITABLE_EDITOR = "&.cm-editor:has(.cm-content[contenteditable=\"true\"])"
|
|
|
460
444
|
/**
|
|
461
445
|
* Editor chrome and the unified merge (diff) wash.
|
|
462
446
|
*
|
|
463
|
-
* - Chrome
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
* -
|
|
467
|
-
* chrome — but each is a light/dark pair from `buildDiffWash`, shared with
|
|
468
|
-
* `buildDiffHighlightTheme` in `MergeEditor/decorations.ts`.
|
|
469
|
-
* - This wash reaches only `CodeEditor`'s *unified* merge view — the one a `previousValue` turns on.
|
|
470
|
-
* `MergePane` builds its own theme from scratch.
|
|
447
|
+
* - Chrome resolves from live `--*` tokens; fallbacks mirror light-mode values for SSR.
|
|
448
|
+
* - Diff colours are fixed across brands; light/dark pairs from `buildDiffWash`, shared with
|
|
449
|
+
* `MergeEditor/decorations.ts`.
|
|
450
|
+
* - Only `CodeEditor`'s unified merge view uses this; `MergePane` has its own theme.
|
|
471
451
|
*/
|
|
472
452
|
const buildBaseThemeStyles = (scheme) => {
|
|
473
453
|
const { line, gutter } = buildDiffWash(scheme);
|
|
@@ -533,30 +513,9 @@ const buildBasicSetup = (readOnly) => ({
|
|
|
533
513
|
/**
|
|
534
514
|
* The syntax theme, per colour scheme.
|
|
535
515
|
*
|
|
536
|
-
* -
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
* - `githubDarkInit` also passes `dark: true` to `EditorView.theme`, which sets the
|
|
540
|
-
* `EditorView.darkTheme` facet. That is what makes the `&dark` rules apply — CodeMirror's own
|
|
541
|
-
* base theme (cursor, selection layer, panels, buttons) and ours (`search.ts`,
|
|
542
|
-
* `highlighting.ts`) both key off it, so they follow the scheme without a second signal.
|
|
543
|
-
* - Chrome (surface, gutter, selection, caret) resolves from live `--*` tokens, so it re-skins with
|
|
544
|
-
* the brand too. Fallback channels mirror the light-mode token values, for SSR and jsdom.
|
|
545
|
-
* - `caret` and `selectionMatch` are pinned because the two initialisers disagree on them, and the
|
|
546
|
-
* branch would otherwise change values nothing here chose. The caret follows `foreground`; before
|
|
547
|
-
* the facet was set, CodeMirror's own default painted it black on the dark page, so it was
|
|
548
|
-
* invisible. `selectionMatch` is a 10% `primary` tint, which beats each initialiser's own value
|
|
549
|
-
* on the token it hurts most: 3.82:1 against the light default's 3.29, 5.40:1 against the dark
|
|
550
|
-
* default's 3.57. Any occurrence wash costs contrast — this is the cheapest one, and it is the
|
|
551
|
-
* same in both schemes.
|
|
552
|
-
* - `styles` comes from `buildSyntaxPalette`, which lives apart so the audit script can measure it.
|
|
553
|
-
*
|
|
554
|
-
* Those overrides exist because the github theme paints every `name`-family tag one colour, and in
|
|
555
|
-
* SQL nearly every token is a name — identifiers, function calls and `$variables` all drowned
|
|
556
|
-
* together, and a keyword that doubles as a function (`create or REPLACE`) read as a value
|
|
557
|
-
* (UT-5024). Instead: identifiers and brackets carry no colour, functions and special vars get
|
|
558
|
-
* their own hues, and amber is unique to string literals — in JSON that shifts string values from
|
|
559
|
-
* navy to amber, the one visible non-SQL change.
|
|
516
|
+
* - Light github palette fails AA on dark surfaces, so the palette is picked by scheme.
|
|
517
|
+
* - `githubDarkInit` sets the `EditorView.darkTheme` facet that every `&dark` rule keys off.
|
|
518
|
+
* - `caret` and `selectionMatch` are pinned: the initialisers disagree on them.
|
|
560
519
|
*/
|
|
561
520
|
const buildCustomTheme = (scheme) => {
|
|
562
521
|
const foreground = resolveToken("foreground", "30 41 59");
|
|
@@ -605,24 +564,14 @@ const shouldLintJson = (mode, readOnly) => mode === "application/json" && !readO
|
|
|
605
564
|
/**
|
|
606
565
|
* Wraps a lint source so a blank document produces no diagnostics.
|
|
607
566
|
*
|
|
608
|
-
*
|
|
609
|
-
* wrong for an *optional* form field: it starts empty, and clearing it is how its value is removed.
|
|
610
|
-
* Left unwrapped, every such field opens with a red gutter marker contradicting its own validation —
|
|
611
|
-
* `CodeEditorField` puts six of them on one screen.
|
|
612
|
-
*
|
|
613
|
-
* Exported for its test: the wrapper is the behaviour worth pinning, and it needs no editor to exercise.
|
|
567
|
+
* - For optional fields, where empty is valid but `jsonParseLinter` reports an error.
|
|
614
568
|
*/
|
|
615
569
|
const skipBlankDocument = (source) => (view) => view.state.doc.toString().trim() === "" ? [] : source(view);
|
|
616
570
|
/**
|
|
617
571
|
* The JSON linter, optionally blind to a blank document.
|
|
618
572
|
*
|
|
619
|
-
* -
|
|
620
|
-
*
|
|
621
|
-
* `ex-generic/JsonConfiguration.tsx`, `flows/TaskParamsModalContent.tsx` and
|
|
622
|
-
* `stream/PayloadTest.tsx` all gate their button on `isValidJsonConfig`, which is `false` for `''`,
|
|
623
|
-
* with no `disabledReason` — so the gutter marker is the only thing explaining a dead button.
|
|
624
|
-
* - Not derivable from `variant`: `ex-generic/FunctionControl.tsx` is `variant="field"` and empty is
|
|
625
|
-
* an error there too. Whether blank is valid is the *field's* contract, not the control's shape.
|
|
573
|
+
* - Opt-in: some callers rely on the marker alone to explain why empty disables their button.
|
|
574
|
+
* - Not derivable from `variant` — whether blank is valid is the field's contract.
|
|
626
575
|
*/
|
|
627
576
|
const buildJsonLinter = (allowBlankDocument) => {
|
|
628
577
|
const source = jsonParseLinter();
|
|
@@ -631,28 +580,18 @@ const buildJsonLinter = (allowBlankDocument) => {
|
|
|
631
580
|
//#endregion
|
|
632
581
|
//#region src/components/CodeEditor/editorChrome.ts
|
|
633
582
|
/**
|
|
634
|
-
* Mirrors `InputGroup` at
|
|
635
|
-
* so an editor dropped into a form reads as one of its fields.
|
|
583
|
+
* Mirrors `InputGroup` at each design language's `TextInput` sizing, so it reads as a form field.
|
|
636
584
|
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* input next to it" mismatch this preset exists to remove.
|
|
641
|
-
*
|
|
642
|
-
* That ramp is fixed, so the legacy preset needs its own scheme pair — a legacy brand and the dark
|
|
643
|
-
* scheme are independent choices, and `neutral[100]` under dark is a light slab: `foreground` on it
|
|
644
|
-
* is 1.09:1 and the darkest syntax colour 2.69:1. Dark mirrors the same two steps from the other
|
|
645
|
-
* end of the ramp (`800` / `900`, 5.00:1 and 6.14:1 for that colour).
|
|
585
|
+
* - Same colour-scheme tokens as `InputGroup`, so it follows light/dark.
|
|
586
|
+
* - argo: `muted`/`input`, the editable argo field's pair.
|
|
587
|
+
* - legacy: `secondary` as `variant="secondary"`; readonly `muted`/`input` as base `InputGroup`.
|
|
646
588
|
*/
|
|
647
|
-
const buildInputChrome = (isArgo
|
|
648
|
-
const dark = scheme === "dark";
|
|
649
|
-
const legacySurface = dark ? colors.neutral[800] : colors.neutral[100];
|
|
650
|
-
const legacyReadOnly = dark ? colors.neutral[900] : colors.neutral[150];
|
|
589
|
+
const buildInputChrome = (isArgo) => {
|
|
651
590
|
return {
|
|
652
|
-
surface: isArgo ? resolveToken("muted", "241 245 249") :
|
|
653
|
-
borderColor: isArgo ? resolveToken("input", "203 213 225") :
|
|
654
|
-
readOnlySurface:
|
|
655
|
-
readOnlyBorderColor:
|
|
591
|
+
surface: isArgo ? resolveToken("muted", "241 245 249") : resolveToken("secondary", "226 232 240"),
|
|
592
|
+
borderColor: isArgo ? resolveToken("input", "203 213 225") : resolveToken("secondary", "226 232 240"),
|
|
593
|
+
readOnlySurface: resolveToken("muted", "241 245 249"),
|
|
594
|
+
readOnlyBorderColor: resolveToken("input", "203 213 225"),
|
|
656
595
|
hoverBorderColor: null,
|
|
657
596
|
focusBorderColor: isArgo ? resolveToken("primary", "37 99 235") : resolveToken("ring", "31 143 255"),
|
|
658
597
|
focusRing: `0 0 0 4px ${resolveToken("ring", "31 143 255", isArgo ? .5 : .3)}`,
|
|
@@ -677,10 +616,7 @@ const buildCanvasChrome = () => ({
|
|
|
677
616
|
paddingY: "8px",
|
|
678
617
|
paddingX: null
|
|
679
618
|
});
|
|
680
|
-
/**
|
|
681
|
-
* Spread over `buildBaseThemeStyles()` — never used alone. The read-only keys
|
|
682
|
-
* are the base's own, so they replace its wash instead of landing beside it.
|
|
683
|
-
*/
|
|
619
|
+
/** Spread over `buildBaseThemeStyles()`; read-only keys match the base's to replace its wash. */
|
|
684
620
|
const buildChromeStyles = (chrome) => ({
|
|
685
621
|
"&.cm-editor": {
|
|
686
622
|
border: `solid 1px ${chrome.borderColor}`,
|
|
@@ -776,15 +712,8 @@ const searchViewPlugin = ViewPlugin.fromClass(class {
|
|
|
776
712
|
/**
|
|
777
713
|
* Match and current-match fills, per colour scheme.
|
|
778
714
|
*
|
|
779
|
-
* - `&dark`
|
|
780
|
-
*
|
|
781
|
-
* whenever the `EditorView.darkTheme` facet is set — see `buildBaseThemeStyles`' callers, which
|
|
782
|
-
* set it explicitly.
|
|
783
|
-
* - Light text is `blue[700]`: 5.42:1 on the fill, and 6.29:1 for white on the current match.
|
|
784
|
-
* - Dark tints `blue[500]` for the plain match, with `blue[200]` text: 11.10:1 on the page surface,
|
|
785
|
-
* 8.86:1 on the `variant="field"` one. The current match keeps a solid `blue[500]` and takes
|
|
786
|
-
* `neutral[900]` as its text (5.78:1) — white on it is 2.55:1, since the token that reads as
|
|
787
|
-
* "strong" in light is a light colour.
|
|
715
|
+
* - `&dark` keeps this a static base theme; it applies when the `EditorView.darkTheme` facet is set.
|
|
716
|
+
* - Dark current match uses `neutral[900]` text: white on `blue[500]` is 2.55:1.
|
|
788
717
|
*/
|
|
789
718
|
const searchTheme = EditorView.baseTheme({
|
|
790
719
|
".cm-searchMatch": { backgroundColor: colors.blue[100] },
|
|
@@ -820,20 +749,11 @@ const ToggleComponentHelp = () => /* @__PURE__ */ jsxs("div", { children: [
|
|
|
820
749
|
//#region src/components/CodeEditor/tokenTheme.ts
|
|
821
750
|
const themeCache = /* @__PURE__ */ new Map();
|
|
822
751
|
/**
|
|
823
|
-
*
|
|
824
|
-
* every instance that passes the same `cacheKey` and rebuilt whenever the active
|
|
825
|
-
* brand / light-dark mode changes. `build` reads live `--*` values off `<html>`,
|
|
826
|
-
* so the active theme is an invisible dependency a deps array can't see.
|
|
827
|
-
*
|
|
828
|
-
* `build` receives the scheme those values were read under, for the theme values
|
|
829
|
-
* that are a light/dark *pair* rather than a token lookup (a categorical diff
|
|
830
|
-
* wash has no semantic token, but an opaque light pastel still has to become a
|
|
831
|
-
* low-alpha tint under dark). It comes from the same read that produced the key,
|
|
832
|
-
* so a builder cannot resolve one scheme's colours under the other one's key.
|
|
752
|
+
* A CodeMirror extension shared per `cacheKey`, rebuilt when the brand or light/dark mode changes.
|
|
833
753
|
*
|
|
834
|
-
* `
|
|
835
|
-
*
|
|
836
|
-
*
|
|
754
|
+
* - `build` reads live `--*` values off `<html>`, a dependency no deps array can see.
|
|
755
|
+
* - `scheme` comes from the same read as the key, for values that are a light/dark pair.
|
|
756
|
+
* - `cacheKey` must include everything `build` closes over, or different inputs share a theme.
|
|
837
757
|
*/
|
|
838
758
|
const useThemedExtension = (cacheKey, build) => {
|
|
839
759
|
const { scheme, cacheKey: themeKey } = useThemeAttributes();
|
|
@@ -850,19 +770,11 @@ const useThemedExtension = (cacheKey, build) => {
|
|
|
850
770
|
const establishesFixedContainingBlock = (style) => style.transform !== "none" || style.translate !== "none" || style.rotate !== "none" || style.scale !== "none" || style.perspective !== "none" || style.filter !== "none" || style.backdropFilter !== "none" || /\b(paint|layout|strict|content)\b/.test(style.contain) || /\b(transform|perspective|filter|contain)\b/.test(style.willChange);
|
|
851
771
|
const crops = (style) => style.overflowX !== "visible" || style.overflowY !== "visible" || style.maskImage !== "none" || style.contentVisibility !== "visible" || /\b(paint|strict|content)\b/.test(style.contain);
|
|
852
772
|
/**
|
|
853
|
-
* Where a tooltip can hang
|
|
854
|
-
* CodeMirror would put it anyway".
|
|
855
|
-
*
|
|
856
|
-
* Two ancestors matter, and they are not the same ancestor. The **outermost
|
|
857
|
-
* cropper** is the one to get above — landing anywhere below it leaves the
|
|
858
|
-
* tooltip inside the box doing the cropping. The **containing block** is where
|
|
859
|
-
* the search can stop, because from there upwards `position: fixed` is measured
|
|
860
|
-
* against that element and nothing higher can crop it.
|
|
773
|
+
* Where a tooltip can hang uncropped, or `null` for CodeMirror's default.
|
|
861
774
|
*
|
|
862
|
-
*
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
* pointer-events scope for no gain.
|
|
775
|
+
* - Hosts above the outermost cropper.
|
|
776
|
+
* - Stops at the fixed containing block; nothing higher can crop.
|
|
777
|
+
* - `<body>` and `<html>` never count as croppers.
|
|
866
778
|
*/
|
|
867
779
|
const findTooltipHost = (from) => {
|
|
868
780
|
let outermostCropper = null;
|
|
@@ -876,26 +788,9 @@ const findTooltipHost = (from) => {
|
|
|
876
788
|
/**
|
|
877
789
|
* `tooltips()`, re-hosted so the completion popup is never cropped.
|
|
878
790
|
*
|
|
879
|
-
*
|
|
880
|
-
*
|
|
881
|
-
*
|
|
882
|
-
* paint containment takes that job, and then every scroller, mask and contained
|
|
883
|
-
* box in between crops the popup instead. A tall editor hides the damage; a
|
|
884
|
-
* one-line one shows a sliver of an unreadable list.
|
|
885
|
-
*
|
|
886
|
-
* The two shapes this has to survive in production are a `Modal`, whose body
|
|
887
|
-
* scrolls and carries the argo fade mask, and kbc-ui's SQL editor, which wraps
|
|
888
|
-
* every code block in `content-visibility: auto` to keep long scripts cheap.
|
|
889
|
-
*
|
|
890
|
-
* Hosting the layer above the outermost cropper clears all of that while keeping
|
|
891
|
-
* the popup inside the modal's stacking, focus and pointer-events scope — which
|
|
892
|
-
* `document.body` would not: the popup would sit behind the modal, and Radix
|
|
893
|
-
* leaves the body `pointer-events: none` while a dialog is open.
|
|
894
|
-
*
|
|
895
|
-
* Both editors install this, and it is the only place either of them configures
|
|
896
|
-
* a tooltip host. Keep it that way: CodeMirror's tooltip config takes the first
|
|
897
|
-
* contributor that names a parent, so a second mechanism would not compose with
|
|
898
|
-
* this one — it would silently win or lose on extension order.
|
|
791
|
+
* - Must survive a masked, scrolling `Modal` and kbc-ui's `content-visibility: auto` blocks.
|
|
792
|
+
* - Not `document.body`: the popup would sit behind the modal, which disables pointer events there.
|
|
793
|
+
* - The only tooltip host in either editor: CodeMirror takes the first parent configured.
|
|
899
794
|
*/
|
|
900
795
|
const tooltipsExtension = () => {
|
|
901
796
|
const layer = new Compartment();
|
|
@@ -909,9 +804,7 @@ const tooltipsExtension = () => {
|
|
|
909
804
|
})];
|
|
910
805
|
};
|
|
911
806
|
/**
|
|
912
|
-
* The extension
|
|
913
|
-
* CodeMirror a fresh compartment and plugin on every reconfigure, dropping the
|
|
914
|
-
* host it had already resolved — so it is only ever reached through this hook.
|
|
807
|
+
* The tooltips extension, built once per editor; a rebuild would drop the resolved host.
|
|
915
808
|
*/
|
|
916
809
|
const useTooltipsExtension = () => useMemo(tooltipsExtension, []);
|
|
917
810
|
//#endregion
|
|
@@ -962,13 +855,10 @@ const completeVariables = (variables = []) => {
|
|
|
962
855
|
};
|
|
963
856
|
};
|
|
964
857
|
/**
|
|
965
|
-
* The completion source both editors install, with
|
|
858
|
+
* The completion source both editors install, with a stable identity.
|
|
966
859
|
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
969
|
-
* selector, so a fresh array arrives on every store push. Because CodeMirror asks
|
|
970
|
-
* the source for options rather than reading them up front, holding it steady costs
|
|
971
|
-
* nothing: a completion request always reaches the latest render's variables.
|
|
860
|
+
* - It keys their extension memo, while callers pass a fresh array on every store push.
|
|
861
|
+
* - CodeMirror asks per request, so it still sees the latest variables.
|
|
972
862
|
*/
|
|
973
863
|
const useVariableCompletion = (variables = []) => useStableCallback(completeVariables(variables));
|
|
974
864
|
//#endregion
|
|
@@ -1019,7 +909,7 @@ const CodeEditor = ({ value, previousValue, onChange, variant = "plain", mode =
|
|
|
1019
909
|
const isField = variant === "field";
|
|
1020
910
|
const baseTheme = useThemedExtension(isField ? `code-editor:field:${isArgo ? "argo" : "legacy"}` : "code-editor:chrome", (scheme) => EditorView.theme({
|
|
1021
911
|
...buildBaseThemeStyles(scheme),
|
|
1022
|
-
...isField ? buildChromeStyles(buildInputChrome(isArgo
|
|
912
|
+
...isField ? buildChromeStyles(buildInputChrome(isArgo)) : null
|
|
1023
913
|
}, { dark: scheme === "dark" }));
|
|
1024
914
|
const commonExtensions = useMemo(() => {
|
|
1025
915
|
const callerCompletions = completionSource ?? (completeAny ? completeAnyWord : autocompletions?.length ? autocompletions : null);
|
|
@@ -1128,4 +1018,4 @@ const CodeEditor = ({ value, previousValue, onChange, variant = "plain", mode =
|
|
|
1128
1018
|
//#endregion
|
|
1129
1019
|
export { CodeEditor, LANGUAGE_MODES, buildBaseThemeStyles, buildBasicSetup, buildCanvasChrome, buildChromeStyles, buildCustomTheme, buildDiffWash, isLanguageMode, searchExtension, updateSearch, useThemedExtension, useTooltipsExtension, useVariableCompletion };
|
|
1130
1020
|
|
|
1131
|
-
//# sourceMappingURL=CodeEditor-
|
|
1021
|
+
//# sourceMappingURL=CodeEditor-BSo-oLFG.js.map
|