@keboola/design 10.1.0 → 11.0.1
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 +2 -0
- package/dist/AIKit-Dre37SJr.js +1320 -0
- package/dist/AIKit-Dre37SJr.js.map +1 -0
- package/dist/Alert-DfZq9kGe.js +133 -0
- package/dist/Alert-DfZq9kGe.js.map +1 -0
- package/dist/AlertModal-BUC4Es8o.js +222 -0
- package/dist/AlertModal-BUC4Es8o.js.map +1 -0
- package/dist/AppShell-B5GQN6Zs.js +143 -0
- package/dist/AppShell-B5GQN6Zs.js.map +1 -0
- package/dist/AutoSaveTextarea-BeuWuszr.js +58 -0
- package/dist/AutoSaveTextarea-BeuWuszr.js.map +1 -0
- package/dist/Badge-Ch26CXoP.js +195 -0
- package/dist/Badge-Ch26CXoP.js.map +1 -0
- package/dist/BrandEditor-B8o9zdZO.js +903 -0
- package/dist/BrandEditor-B8o9zdZO.js.map +1 -0
- package/dist/BrandLogo-CJkRd0F8.js +46 -0
- package/dist/BrandLogo-CJkRd0F8.js.map +1 -0
- package/dist/Breadcrumb-DJp7WwSv.js +330 -0
- package/dist/Breadcrumb-DJp7WwSv.js.map +1 -0
- package/dist/Button-nzmDNS2q.js +391 -0
- package/dist/Button-nzmDNS2q.js.map +1 -0
- package/dist/Calendar-cG5NIJ4O.js +6768 -0
- package/dist/Calendar-cG5NIJ4O.js.map +1 -0
- package/dist/Card-BAoZ35CV.js +105 -0
- package/dist/Card-BAoZ35CV.js.map +1 -0
- package/dist/Checkbox-GJ8-srt4.js +97 -0
- package/dist/Checkbox-GJ8-srt4.js.map +1 -0
- package/dist/Clipboard-CBJZiviP.js +58 -0
- package/dist/Clipboard-CBJZiviP.js.map +1 -0
- package/dist/ClipboardButton-ez5V3fkk.js +43 -0
- package/dist/ClipboardButton-ez5V3fkk.js.map +1 -0
- package/dist/CodeEditor-BfQJfbhL.js +952 -0
- package/dist/CodeEditor-BfQJfbhL.js.map +1 -0
- package/dist/Collapsible-BQXWEOBC.js +34 -0
- package/dist/Collapsible-BQXWEOBC.js.map +1 -0
- package/dist/ColorInput-Dx8Dsv7Y.js +180 -0
- package/dist/ColorInput-Dx8Dsv7Y.js.map +1 -0
- package/dist/ColorModeSwitch-CCqj7tjE.js +77 -0
- package/dist/ColorModeSwitch-CCqj7tjE.js.map +1 -0
- package/dist/Combobox-c_xBjf0P.js +439 -0
- package/dist/Combobox-c_xBjf0P.js.map +1 -0
- package/dist/Command-CQ_bQsJp.js +102 -0
- package/dist/Command-CQ_bQsJp.js.map +1 -0
- package/dist/CopyField-BJ96zvXs.js +322 -0
- package/dist/CopyField-BJ96zvXs.js.map +1 -0
- package/dist/DateInput-CMD3dY-T.js +141 -0
- package/dist/DateInput-CMD3dY-T.js.map +1 -0
- package/dist/DatePicker-BbFbmsGl.js +24 -0
- package/dist/DatePicker-BbFbmsGl.js.map +1 -0
- package/dist/DateRangeInput-D3BhiKyk.js +139 -0
- package/dist/DateRangeInput-D3BhiKyk.js.map +1 -0
- package/dist/DateRangePicker-BiUgtt_M.js +159 -0
- package/dist/DateRangePicker-BiUgtt_M.js.map +1 -0
- package/dist/DiagramSkeleton-lwBS2YBa.js +11 -0
- package/dist/DiagramSkeleton-lwBS2YBa.js.map +1 -0
- package/dist/DiffView-ppTIzh2h.js +429 -0
- package/dist/DiffView-ppTIzh2h.js.map +1 -0
- package/dist/DropdownMenu-B6ZbYvaM.js +327 -0
- package/dist/DropdownMenu-B6ZbYvaM.js.map +1 -0
- package/dist/FieldBox-D7DYtX_m.js +70 -0
- package/dist/FieldBox-D7DYtX_m.js.map +1 -0
- package/dist/FileUpload-sXRv7JiY.js +2527 -0
- package/dist/FileUpload-sXRv7JiY.js.map +1 -0
- package/dist/Form-BDCef6O9.js +371 -0
- package/dist/Form-BDCef6O9.js.map +1 -0
- package/dist/FormGroup-S9mPNHKH.js +124 -0
- package/dist/FormGroup-S9mPNHKH.js.map +1 -0
- package/dist/FullScreenModal-CJa2VkJ2.js +96 -0
- package/dist/FullScreenModal-CJa2VkJ2.js.map +1 -0
- package/dist/HoverCard-WfDkLK1s.js +31 -0
- package/dist/HoverCard-WfDkLK1s.js.map +1 -0
- package/dist/InputGroup-BJWsI35s.js +292 -0
- package/dist/InputGroup-BJWsI35s.js.map +1 -0
- package/dist/Kbd-CxHAo1oo.js +111 -0
- package/dist/Kbd-CxHAo1oo.js.map +1 -0
- package/dist/MarkedText-Ckbft5mw.js +44 -0
- package/dist/MarkedText-Ckbft5mw.js.map +1 -0
- package/dist/MermaidDiagram-BB06gymm.js +399 -0
- package/dist/MermaidDiagram-BB06gymm.js.map +1 -0
- package/dist/Modal-BA5Wc3sx.js +185 -0
- package/dist/Modal-BA5Wc3sx.js.map +1 -0
- package/dist/ModalTitle-C76ke2eo.js +28 -0
- package/dist/ModalTitle-C76ke2eo.js.map +1 -0
- package/dist/MultiActionButtonGroup-CiBHxsSk.js +33 -0
- package/dist/MultiActionButtonGroup-CiBHxsSk.js.map +1 -0
- package/dist/Navbar-t16usFZQ.js +322 -0
- package/dist/Navbar-t16usFZQ.js.map +1 -0
- package/dist/OtpInput-CbbymqYs.js +93 -0
- package/dist/OtpInput-CbbymqYs.js.map +1 -0
- package/dist/PageHeader-Q3IpCnQd.js +177 -0
- package/dist/PageHeader-Q3IpCnQd.js.map +1 -0
- package/dist/PageLayout-DSVM-ASz.js +176 -0
- package/dist/PageLayout-DSVM-ASz.js.map +1 -0
- package/dist/PageToolbar-0_1OBzaZ.js +153 -0
- package/dist/PageToolbar-0_1OBzaZ.js.map +1 -0
- package/dist/Pagination-CM_Rszz-.js +70 -0
- package/dist/Pagination-CM_Rszz-.js.map +1 -0
- package/dist/Popconfirm-BGe1jLov.js +170 -0
- package/dist/Popconfirm-BGe1jLov.js.map +1 -0
- package/dist/Popover-Ca0V6AD1.js +92 -0
- package/dist/Popover-Ca0V6AD1.js.map +1 -0
- package/dist/RadioGroup-sIveSsNa.js +233 -0
- package/dist/RadioGroup-sIveSsNa.js.map +1 -0
- package/dist/Resizable-D3vYToZH.js +52 -0
- package/dist/Resizable-D3vYToZH.js.map +1 -0
- package/dist/Search-3UiqNZRj.js +184 -0
- package/dist/Search-3UiqNZRj.js.map +1 -0
- package/dist/SearchInput-D2fcOv7E.js +102 -0
- package/dist/SearchInput-D2fcOv7E.js.map +1 -0
- package/dist/SectionNav--7bw2b6u.js +276 -0
- package/dist/SectionNav--7bw2b6u.js.map +1 -0
- package/dist/Select-4YX38G5h.js +181 -0
- package/dist/Select-4YX38G5h.js.map +1 -0
- package/dist/Sheet-BQrX8-h5.js +169 -0
- package/dist/Sheet-BQrX8-h5.js.map +1 -0
- package/dist/Sidebar-ROaR_AqC.js +799 -0
- package/dist/Sidebar-ROaR_AqC.js.map +1 -0
- package/dist/Slider-Da_3mS5v.js +127 -0
- package/dist/Slider-Da_3mS5v.js.map +1 -0
- package/dist/Stepper-C8sm9ZFM.js +325 -0
- package/dist/Stepper-C8sm9ZFM.js.map +1 -0
- package/dist/Switch-CX2A0v50.js +201 -0
- package/dist/Switch-CX2A0v50.js.map +1 -0
- package/dist/Table-CvYuTuNU.js +104 -0
- package/dist/Table-CvYuTuNU.js.map +1 -0
- package/dist/Tabs-EAihyqCt.js +74 -0
- package/dist/Tabs-EAihyqCt.js.map +1 -0
- package/dist/TextInput-BGed-V13.js +110 -0
- package/dist/TextInput-BGed-V13.js.map +1 -0
- package/dist/ThemeProvider-QncUrfJn.js +203 -0
- package/dist/ThemeProvider-QncUrfJn.js.map +1 -0
- package/dist/TimePicker-B_NegL-7.js +98 -0
- package/dist/TimePicker-B_NegL-7.js.map +1 -0
- package/dist/Timeline-6btyJl4D.js +154 -0
- package/dist/Timeline-6btyJl4D.js.map +1 -0
- package/dist/Toast-DQSbs3oA.js +49 -0
- package/dist/Toast-DQSbs3oA.js.map +1 -0
- package/dist/ToggleGroup-Cy_10Mvu.js +47 -0
- package/dist/ToggleGroup-Cy_10Mvu.js.map +1 -0
- package/dist/Workbench-BzE-Vvd9.js +293 -0
- package/dist/Workbench-BzE-Vvd9.js.map +1 -0
- package/dist/ZoomableSvg-DG9PnAm8.js +248 -0
- package/dist/ZoomableSvg-DG9PnAm8.js.map +1 -0
- package/dist/charts.d.ts +124 -111
- package/dist/charts.js +303 -249
- package/dist/charts.js.map +1 -1
- package/dist/classNames-BzrkDnOD.js +9 -0
- package/dist/classNames-BzrkDnOD.js.map +1 -0
- package/dist/constants-D6JcsD4_.d.ts +41 -0
- package/dist/context-KxxeMHbR.js +62 -0
- package/dist/context-KxxeMHbR.js.map +1 -0
- package/dist/editors.d.ts +180 -173
- package/dist/editors.js +747 -420
- package/dist/editors.js.map +1 -1
- package/dist/escapeStringRegexp-8MxP2knR.js +6 -0
- package/dist/escapeStringRegexp-8MxP2knR.js.map +1 -0
- package/dist/icons-Cek151jC.js +640 -0
- package/dist/icons-Cek151jC.js.map +1 -0
- package/dist/icons.d.ts +2 -41
- package/dist/icons.js +2 -4
- package/dist/index-m-kQEWiY.d.ts +54 -0
- package/dist/index.d.ts +6192 -9904
- package/dist/index.js +112 -15803
- package/dist/internal/blocks/AIKit.js +2 -0
- package/dist/internal/blocks/AppShell.js +2 -0
- package/dist/internal/blocks/AutoSaveTextarea.js +2 -0
- package/dist/internal/blocks/BrandEditor.js +2 -0
- package/dist/internal/blocks/ChartPanel.js +46 -0
- package/dist/internal/blocks/ChartPanel.js.map +1 -0
- package/dist/internal/blocks/ClipboardButton.js +2 -0
- package/dist/internal/blocks/ColorInput.js +2 -0
- package/dist/internal/blocks/ColorModeSwitch.js +2 -0
- package/dist/internal/blocks/Command.js +2 -0
- package/dist/internal/blocks/CopyField.js +2 -0
- package/dist/internal/blocks/DashboardHero.js +59 -0
- package/dist/internal/blocks/DashboardHero.js.map +1 -0
- package/dist/internal/blocks/DateInput.js +2 -0
- package/dist/internal/blocks/DateRangeInput.js +2 -0
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +16 -0
- package/dist/internal/blocks/EmptyConfigurationActionCard.js.map +1 -0
- package/dist/internal/blocks/EmptyState.js +142 -0
- package/dist/internal/blocks/EmptyState.js.map +1 -0
- package/dist/internal/blocks/ErrorState.js +179 -0
- package/dist/internal/blocks/ErrorState.js.map +1 -0
- package/dist/internal/blocks/ExportMenu.js +41 -0
- package/dist/internal/blocks/ExportMenu.js.map +1 -0
- package/dist/internal/blocks/Form.js +2 -0
- package/dist/internal/blocks/FormGroup.js +2 -0
- package/dist/internal/blocks/GoogleButton.js +95 -0
- package/dist/internal/blocks/GoogleButton.js.map +1 -0
- package/dist/internal/blocks/MicrosoftButton.js +64 -0
- package/dist/internal/blocks/MicrosoftButton.js.map +1 -0
- package/dist/internal/blocks/MultiActionButtonGroup.js +2 -0
- package/dist/internal/blocks/MultiCombobox.js +188 -0
- package/dist/internal/blocks/MultiCombobox.js.map +1 -0
- package/dist/internal/blocks/NumberInput.js +44 -0
- package/dist/internal/blocks/NumberInput.js.map +1 -0
- package/dist/internal/blocks/OtpInput.js +2 -0
- package/dist/internal/blocks/PageHeader.js +2 -0
- package/dist/internal/blocks/PageLayout.js +2 -0
- package/dist/internal/blocks/PageToolbar.js +2 -0
- package/dist/internal/blocks/PasswordInput.js +97 -0
- package/dist/internal/blocks/PasswordInput.js.map +1 -0
- package/dist/internal/blocks/SearchInput.js +2 -0
- package/dist/internal/blocks/SearchInputWithNavigation.js +65 -0
- package/dist/internal/blocks/SearchInputWithNavigation.js.map +1 -0
- package/dist/internal/blocks/SectionNav.js +2 -0
- package/dist/internal/blocks/SplitButton.js +46 -0
- package/dist/internal/blocks/SplitButton.js.map +1 -0
- package/dist/internal/blocks/StatCard.js +97 -0
- package/dist/internal/blocks/StatCard.js.map +1 -0
- package/dist/internal/blocks/TextInput.js +2 -0
- package/dist/internal/blocks/Textarea.js +32 -0
- package/dist/internal/blocks/Textarea.js.map +1 -0
- package/dist/internal/blocks/TimeInput.js +77 -0
- package/dist/internal/blocks/TimeInput.js.map +1 -0
- package/dist/internal/components/Alert.js +2 -0
- package/dist/internal/components/AlertModal.js +2 -0
- package/dist/internal/components/Avatar.js +53 -0
- package/dist/internal/components/Avatar.js.map +1 -0
- package/dist/internal/components/Badge.js +2 -0
- package/dist/internal/components/BrandLogo.js +2 -0
- package/dist/internal/components/Breadcrumb.js +2 -0
- package/dist/internal/components/Button.js +2 -0
- package/dist/internal/components/ButtonGroup.js +66 -0
- package/dist/internal/components/ButtonGroup.js.map +1 -0
- package/dist/internal/components/Calendar.js +2 -0
- package/dist/internal/components/Card.js +2 -0
- package/dist/internal/components/Checkbox.js +2 -0
- package/dist/internal/components/Clipboard.js +2 -0
- package/dist/internal/components/Collapsible.js +2 -0
- package/dist/internal/components/CollapsiblePanel.js +87 -0
- package/dist/internal/components/CollapsiblePanel.js.map +1 -0
- package/dist/internal/components/Combobox.js +2 -0
- package/dist/internal/components/DatePicker.js +2 -0
- package/dist/internal/components/DateRangePicker.js +2 -0
- package/dist/internal/components/DiffView.js +2 -0
- package/dist/internal/components/DotsLoader.js +18 -0
- package/dist/internal/components/DotsLoader.js.map +1 -0
- package/dist/internal/components/DropdownMenu.js +2 -0
- package/dist/internal/components/EmptySearchContent.js +12 -0
- package/dist/internal/components/EmptySearchContent.js.map +1 -0
- package/dist/internal/components/FileUpload.js +2 -0
- package/dist/internal/components/FullScreenModal.js +2 -0
- package/dist/internal/components/HelpBlock.js +25 -0
- package/dist/internal/components/HelpBlock.js.map +1 -0
- package/dist/internal/components/HoverCard.js +2 -0
- package/dist/internal/components/InputGroup.js +2 -0
- package/dist/internal/components/Kbd.js +2 -0
- package/dist/internal/components/Label.js +39 -0
- package/dist/internal/components/Label.js.map +1 -0
- package/dist/internal/components/Link.js +22 -0
- package/dist/internal/components/Link.js.map +1 -0
- package/dist/internal/components/MarkedText.js +2 -0
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js +20 -0
- package/dist/internal/components/MergeEditor/ConflictStatus/ConflictStatusIndicator.js.map +1 -0
- package/dist/internal/components/MergeEditor/PaneHeader.js +13 -0
- package/dist/internal/components/MergeEditor/PaneHeader.js.map +1 -0
- package/dist/internal/components/MergeEditor/constants.js +18 -0
- package/dist/internal/components/MergeEditor/constants.js.map +1 -0
- package/dist/internal/components/MergeEditor/useMergeDiff.js +2 -0
- package/dist/internal/components/Modal.js +2 -0
- package/dist/internal/components/Navbar.js +2 -0
- package/dist/internal/components/Pagination.js +2 -0
- package/dist/internal/components/PanelWithDetails.js +31 -0
- package/dist/internal/components/PanelWithDetails.js.map +1 -0
- package/dist/internal/components/Popconfirm.js +2 -0
- package/dist/internal/components/Popover.js +2 -0
- package/dist/internal/components/Progress.js +47 -0
- package/dist/internal/components/Progress.js.map +1 -0
- package/dist/internal/components/RadioGroup.js +2 -0
- package/dist/internal/components/Resizable.js +2 -0
- package/dist/internal/components/ScrollArea.js +42 -0
- package/dist/internal/components/ScrollArea.js.map +1 -0
- package/dist/internal/components/Search.js +2 -0
- package/dist/internal/components/Select.js +2 -0
- package/dist/internal/components/Separator.js +84 -0
- package/dist/internal/components/Separator.js.map +1 -0
- package/dist/internal/components/Sheet.js +2 -0
- package/dist/internal/components/Sidebar.js +2 -0
- package/dist/internal/components/Skeleton/Skeleton.js +39 -0
- package/dist/internal/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/internal/components/Skeleton/SkeletonList.js +41 -0
- package/dist/internal/components/Skeleton/SkeletonList.js.map +1 -0
- package/dist/internal/components/Slider.js +2 -0
- package/dist/internal/components/SpotlightBackdrop.js +132 -0
- package/dist/internal/components/SpotlightBackdrop.js.map +1 -0
- package/dist/internal/components/Stepper.js +2 -0
- package/dist/internal/components/Switch.js +2 -0
- package/dist/internal/components/Table.js +2 -0
- package/dist/internal/components/Tabs.js +2 -0
- package/dist/internal/components/ThemeProvider.js +3 -0
- package/dist/internal/components/TimePicker.js +2 -0
- package/dist/internal/components/Timeline.js +2 -0
- package/dist/internal/components/Toast.js +3 -0
- package/dist/internal/components/Toggle.js +169 -0
- package/dist/internal/components/Toggle.js.map +1 -0
- package/dist/internal/components/ToggleGroup.js +2 -0
- package/dist/internal/components/Tooltip.js +2 -0
- package/dist/internal/components/Truncated.js +45 -0
- package/dist/internal/components/Truncated.js.map +1 -0
- package/dist/internal/components/Workbench.js +2 -0
- package/dist/internal/components/ZoomableSvg.js +2 -0
- package/dist/internal/hooks/useAutosizeInput.js +77 -0
- package/dist/internal/hooks/useAutosizeInput.js.map +1 -0
- package/dist/internal/hooks/useScrollbarPosition.js +45 -0
- package/dist/internal/hooks/useScrollbarPosition.js.map +1 -0
- package/dist/internal/hooks/useStableCallback.js +29 -0
- package/dist/internal/hooks/useStableCallback.js.map +1 -0
- package/dist/internal/utils/mergeRefs.js +20 -0
- package/dist/internal/utils/mergeRefs.js.map +1 -0
- package/dist/internal/utils.js +5 -0
- package/dist/markdown-editor.d.ts +72 -72
- package/dist/markdown-editor.js +1122 -1193
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.d.ts +12 -12
- package/dist/mermaid.js +2 -10
- package/dist/rjsf.d.ts +33 -34
- package/dist/rjsf.js +1543 -1600
- package/dist/rjsf.js.map +1 -1
- package/dist/rolldown-runtime-Bdc48AWt.js +33 -0
- package/dist/styles-DSUP_-9Z.js +158 -0
- package/dist/styles-DSUP_-9Z.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/testing.d.ts +8 -7
- package/dist/testing.js +36 -16
- package/dist/testing.js.map +1 -1
- package/dist/themeTokens-BNg98Mu9.js +85 -0
- package/dist/themeTokens-BNg98Mu9.js.map +1 -0
- package/dist/toast-CjkURw0M.js +184 -0
- package/dist/toast-CjkURw0M.js.map +1 -0
- package/dist/useColorSchemeState-CYqcUfSH.js +61 -0
- package/dist/useColorSchemeState-CYqcUfSH.js.map +1 -0
- package/dist/useControllableState-M6494mCT.js +31 -0
- package/dist/useControllableState-M6494mCT.js.map +1 -0
- package/dist/useElement-DkF6esWL.js +15 -0
- package/dist/useElement-DkF6esWL.js.map +1 -0
- package/dist/useMergeDiff-CvowEXJ1.js +465 -0
- package/dist/useMergeDiff-CvowEXJ1.js.map +1 -0
- package/dist/utils-D0c5VAyF.js +308 -0
- package/dist/utils-D0c5VAyF.js.map +1 -0
- package/package.json +10 -9
- package/src/styles.css +35 -7
- package/src/theme.css +64 -0
- package/dist/MermaidDiagram-EOKJHQQV.js +0 -10
- package/dist/MermaidDiagram-EOKJHQQV.js.map +0 -1
- package/dist/chunk-63NSN2VL.js +0 -274
- package/dist/chunk-63NSN2VL.js.map +0 -1
- package/dist/chunk-6FPEI4EM.js +0 -6683
- package/dist/chunk-6FPEI4EM.js.map +0 -1
- package/dist/chunk-7PUUHEJQ.js +0 -1313
- package/dist/chunk-7PUUHEJQ.js.map +0 -1
- package/dist/chunk-BOHNXTMM.js +0 -606
- package/dist/chunk-BOHNXTMM.js.map +0 -1
- package/dist/chunk-C3L3TBBT.js +0 -242
- package/dist/chunk-C3L3TBBT.js.map +0 -1
- package/dist/chunk-CTCFYWJC.js +0 -407
- package/dist/chunk-CTCFYWJC.js.map +0 -1
- package/dist/chunk-ESBL3IPF.js +0 -23
- package/dist/chunk-ESBL3IPF.js.map +0 -1
- package/dist/chunk-IJTHFNNJ.js +0 -261
- package/dist/chunk-IJTHFNNJ.js.map +0 -1
- package/dist/chunk-JP7PNHLH.js +0 -40
- package/dist/chunk-JP7PNHLH.js.map +0 -1
- package/dist/chunk-KPNAW5MU.js +0 -229
- package/dist/chunk-KPNAW5MU.js.map +0 -1
- package/dist/chunk-L37JJ6MR.js +0 -152
- package/dist/chunk-L37JJ6MR.js.map +0 -1
- package/dist/chunk-Q7NWXLCT.js +0 -90
- package/dist/chunk-Q7NWXLCT.js.map +0 -1
- package/dist/chunk-SYIEF644.js +0 -1016
- package/dist/chunk-SYIEF644.js.map +0 -1
- package/dist/chunk-VMFSRV5H.js +0 -16
- package/dist/chunk-VMFSRV5H.js.map +0 -1
- package/dist/chunk-VPPM7UUQ.js +0 -47
- package/dist/chunk-VPPM7UUQ.js.map +0 -1
- package/dist/chunk-XV3UUOYF.js +0 -845
- package/dist/chunk-XV3UUOYF.js.map +0 -1
- package/dist/constants-D3gaMY-W.d.ts +0 -39
- package/dist/icons.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mermaid.js.map +0 -1
|
@@ -0,0 +1,903 @@
|
|
|
1
|
+
import { Button } from "./Button-nzmDNS2q.js";
|
|
2
|
+
import { ToggleGroup } from "./ToggleGroup-Cy_10Mvu.js";
|
|
3
|
+
import { Label } from "./internal/components/Label.js";
|
|
4
|
+
import { TextInput } from "./TextInput-BGed-V13.js";
|
|
5
|
+
import { Slider } from "./Slider-Da_3mS5v.js";
|
|
6
|
+
import { Select } from "./Select-4YX38G5h.js";
|
|
7
|
+
import { Badge } from "./Badge-Ch26CXoP.js";
|
|
8
|
+
import { Textarea } from "./internal/blocks/Textarea.js";
|
|
9
|
+
import { ColorInput } from "./ColorInput-Dx8Dsv7Y.js";
|
|
10
|
+
import { Collapsible } from "./Collapsible-BQXWEOBC.js";
|
|
11
|
+
import { useId, useMemo } from "react";
|
|
12
|
+
import { keboola } from "@keboola/brand-registry";
|
|
13
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import DOMPurify from "dompurify";
|
|
15
|
+
//#region src/blocks/BrandEditor/color.ts
|
|
16
|
+
const hexToChannels = (hex) => {
|
|
17
|
+
let h = hex.trim().replace(/^#/, "");
|
|
18
|
+
if (h.length === 3 || h.length === 4) h = h.slice(0, 3).split("").map((c) => c + c).join("");
|
|
19
|
+
else if (h.length === 8) h = h.slice(0, 6);
|
|
20
|
+
if (!/^[0-9a-fA-F]{6}$/.test(h)) return "0 0 0";
|
|
21
|
+
const n = parseInt(h, 16);
|
|
22
|
+
return `${n >> 16 & 255} ${n >> 8 & 255} ${n & 255}`;
|
|
23
|
+
};
|
|
24
|
+
const channelsToHex = (channels) => {
|
|
25
|
+
const [r = 0, g = 0, b = 0] = channels.trim().split(/\s+/).map((n) => Number(n) || 0);
|
|
26
|
+
const to2 = (v) => Math.max(0, Math.min(255, v)).toString(16).padStart(2, "0");
|
|
27
|
+
return `#${to2(r)}${to2(g)}${to2(b)}`;
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/blocks/BrandEditor/ColorField.tsx
|
|
31
|
+
const COMPLETE_HEX = /^([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
32
|
+
/** A labelled hex colour picker bound to a brand token (stored as RGB channels). */
|
|
33
|
+
const ColorField = ({ id, label, channels, onChange }) => {
|
|
34
|
+
const hex = channelsToHex(channels);
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "tw:flex tw:items-center tw:justify-between tw:gap-2",
|
|
37
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
38
|
+
htmlFor: id,
|
|
39
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
40
|
+
children: label
|
|
41
|
+
}), /* @__PURE__ */ jsx(ColorInput, {
|
|
42
|
+
id,
|
|
43
|
+
sizing: "medium",
|
|
44
|
+
value: hex,
|
|
45
|
+
className: "tw:w-36",
|
|
46
|
+
onValueChange: (next) => {
|
|
47
|
+
const clean = next.trim().replace(/^#/, "");
|
|
48
|
+
if (COMPLETE_HEX.test(clean)) onChange(hexToChannels(`#${clean}`));
|
|
49
|
+
}
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/blocks/BrandEditor/contrast.ts
|
|
55
|
+
const clampChannel = (n) => Number.isFinite(n) ? Math.min(255, Math.max(0, n)) : 0;
|
|
56
|
+
const parseChannels = (channels) => {
|
|
57
|
+
const [r = 0, g = 0, b = 0] = channels.trim().split(/\s+/).map((n) => clampChannel(Number(n)));
|
|
58
|
+
return [
|
|
59
|
+
r,
|
|
60
|
+
g,
|
|
61
|
+
b
|
|
62
|
+
];
|
|
63
|
+
};
|
|
64
|
+
const relativeLuminance = (channels) => {
|
|
65
|
+
const [r = 0, g = 0, b = 0] = parseChannels(channels).map((c) => {
|
|
66
|
+
const s = c / 255;
|
|
67
|
+
return s <= .03928 ? s / 12.92 : ((s + .055) / 1.055) ** 2.4;
|
|
68
|
+
});
|
|
69
|
+
return .2126 * r + .7152 * g + .0722 * b;
|
|
70
|
+
};
|
|
71
|
+
/** WCAG contrast ratio (1–21) between two `"R G B"` colours. */
|
|
72
|
+
const contrastRatio = (fg, bg) => {
|
|
73
|
+
const l1 = relativeLuminance(fg);
|
|
74
|
+
const l2 = relativeLuminance(bg);
|
|
75
|
+
const [lighter, darker] = l1 >= l2 ? [l1, l2] : [l2, l1];
|
|
76
|
+
return (lighter + .05) / (darker + .05);
|
|
77
|
+
};
|
|
78
|
+
/** WCAG level for normal-size text at a given ratio. */
|
|
79
|
+
const wcagLevel = (ratio) => ratio >= 7 ? "AAA" : ratio >= 4.5 ? "AA" : "fail";
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/blocks/BrandEditor/ControlSection.tsx
|
|
82
|
+
/** A titled block inside `BrandEditor`. */
|
|
83
|
+
const ControlSection = ({ title, children }) => /* @__PURE__ */ jsxs("section", {
|
|
84
|
+
className: "tw:flex tw:flex-col tw:gap-3 tw:border-b tw:border-border tw:p-4",
|
|
85
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
86
|
+
className: "tw:m-0 tw:text-xs tw:font-semibold tw:uppercase tw:tracking-wide tw:text-muted-foreground",
|
|
87
|
+
children: title
|
|
88
|
+
}), children]
|
|
89
|
+
});
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/blocks/BrandEditor/LogoField.tsx
|
|
92
|
+
/** A labelled multi-line field for a brand logo source. */
|
|
93
|
+
const LogoField = ({ id, label, value, onChange }) => /* @__PURE__ */ jsxs("div", {
|
|
94
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
95
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
96
|
+
htmlFor: id,
|
|
97
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
98
|
+
children: label
|
|
99
|
+
}), /* @__PURE__ */ jsx(Textarea, {
|
|
100
|
+
id,
|
|
101
|
+
value,
|
|
102
|
+
onValueChange: onChange,
|
|
103
|
+
maxRows: 4,
|
|
104
|
+
placeholder: "<svg…>, a data: URI, or an https:// URL",
|
|
105
|
+
className: "tw:font-mono tw:text-xs"
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/blocks/BrandEditor/TextField.tsx
|
|
110
|
+
/** A labelled single-line field for a free-form CSS-value token (shadow, motion, gradient). */
|
|
111
|
+
const TextField = ({ id, label, value, onChange, placeholder }) => /* @__PURE__ */ jsxs("div", {
|
|
112
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
113
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
114
|
+
htmlFor: id,
|
|
115
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
116
|
+
children: label
|
|
117
|
+
}), /* @__PURE__ */ jsx(TextInput, {
|
|
118
|
+
id,
|
|
119
|
+
sizing: "small",
|
|
120
|
+
value,
|
|
121
|
+
onValueChange: onChange,
|
|
122
|
+
placeholder,
|
|
123
|
+
className: "tw:font-mono tw:text-xs"
|
|
124
|
+
})]
|
|
125
|
+
});
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/blocks/BrandEditor/BrandEditor.tsx
|
|
128
|
+
const DEFAULT_FALLBACK_FONT = "'Inter', system-ui, sans-serif";
|
|
129
|
+
const DEFAULT_FONT_OPTIONS = [
|
|
130
|
+
{
|
|
131
|
+
value: DEFAULT_FALLBACK_FONT,
|
|
132
|
+
label: "Inter (default)"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: "'Space Grotesk', system-ui, sans-serif",
|
|
136
|
+
label: "Space Grotesk"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: "'Poppins', system-ui, sans-serif",
|
|
140
|
+
label: "Poppins"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: "'Manrope', system-ui, sans-serif",
|
|
144
|
+
label: "Manrope"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
value: "'Quicksand', system-ui, sans-serif",
|
|
148
|
+
label: "Quicksand"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
value: "'Baloo 2', system-ui, sans-serif",
|
|
152
|
+
label: "Baloo 2"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
value: "'Fraunces', Georgia, serif",
|
|
156
|
+
label: "Fraunces (serif)"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
value: "Georgia, 'Times New Roman', serif",
|
|
160
|
+
label: "Georgia (serif)"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
value: "'JetBrains Mono', ui-monospace, monospace",
|
|
164
|
+
label: "JetBrains Mono"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
value: "system-ui, sans-serif",
|
|
168
|
+
label: "System UI"
|
|
169
|
+
}
|
|
170
|
+
];
|
|
171
|
+
const COLOR_LABELS = {
|
|
172
|
+
primary: "Primary",
|
|
173
|
+
primaryForeground: "Primary foreground",
|
|
174
|
+
background: "Background",
|
|
175
|
+
foreground: "Foreground",
|
|
176
|
+
card: "Card",
|
|
177
|
+
cardForeground: "Card foreground",
|
|
178
|
+
popover: "Popover",
|
|
179
|
+
popoverForeground: "Popover foreground",
|
|
180
|
+
secondary: "Secondary",
|
|
181
|
+
secondaryForeground: "Secondary foreground",
|
|
182
|
+
muted: "Muted",
|
|
183
|
+
mutedForeground: "Muted foreground",
|
|
184
|
+
accent: "Accent",
|
|
185
|
+
accentForeground: "Accent foreground",
|
|
186
|
+
border: "Border",
|
|
187
|
+
input: "Input border",
|
|
188
|
+
inputBackground: "Input background",
|
|
189
|
+
ring: "Ring",
|
|
190
|
+
ringOffset: "Ring offset",
|
|
191
|
+
destructive: "Destructive",
|
|
192
|
+
destructiveForeground: "Destructive foreground",
|
|
193
|
+
success: "Success",
|
|
194
|
+
successForeground: "Success foreground",
|
|
195
|
+
warning: "Warning",
|
|
196
|
+
warningForeground: "Warning foreground",
|
|
197
|
+
info: "Info",
|
|
198
|
+
infoForeground: "Info foreground"
|
|
199
|
+
};
|
|
200
|
+
const SIDEBAR_LABELS = {
|
|
201
|
+
sidebar: "Sidebar",
|
|
202
|
+
sidebarForeground: "Foreground",
|
|
203
|
+
sidebarPrimary: "Primary",
|
|
204
|
+
sidebarPrimaryForeground: "Primary foreground",
|
|
205
|
+
sidebarAccent: "Accent",
|
|
206
|
+
sidebarAccentForeground: "Accent foreground",
|
|
207
|
+
sidebarBorder: "Border",
|
|
208
|
+
sidebarRing: "Ring"
|
|
209
|
+
};
|
|
210
|
+
const CHART_LABELS = {
|
|
211
|
+
chart1: "Chart 1",
|
|
212
|
+
chart2: "Chart 2",
|
|
213
|
+
chart3: "Chart 3",
|
|
214
|
+
chart4: "Chart 4",
|
|
215
|
+
chart5: "Chart 5"
|
|
216
|
+
};
|
|
217
|
+
const WEIGHT_LABELS = {
|
|
218
|
+
normal: "Normal",
|
|
219
|
+
medium: "Medium",
|
|
220
|
+
semibold: "Semibold",
|
|
221
|
+
bold: "Bold"
|
|
222
|
+
};
|
|
223
|
+
const SHADOW_LABELS = {
|
|
224
|
+
sm: "Small",
|
|
225
|
+
md: "Medium",
|
|
226
|
+
lg: "Large",
|
|
227
|
+
lift: "Lift (raised)"
|
|
228
|
+
};
|
|
229
|
+
const SPACING_LABELS = {
|
|
230
|
+
gutter: "Gutter (between sections)",
|
|
231
|
+
inset: "Inset (in-container)"
|
|
232
|
+
};
|
|
233
|
+
const MOTION_LABELS = {
|
|
234
|
+
duration: "Duration",
|
|
235
|
+
easing: "Easing"
|
|
236
|
+
};
|
|
237
|
+
const COLOR_SLOTS = Object.keys(COLOR_LABELS);
|
|
238
|
+
const SIDEBAR_SLOTS = Object.keys(SIDEBAR_LABELS);
|
|
239
|
+
const CHART_SLOTS = Object.keys(CHART_LABELS);
|
|
240
|
+
const WEIGHT_SLOTS = Object.keys(WEIGHT_LABELS);
|
|
241
|
+
const SHADOW_SLOTS = Object.keys(SHADOW_LABELS);
|
|
242
|
+
const SPACING_SLOTS = Object.keys(SPACING_LABELS);
|
|
243
|
+
const MOTION_SLOTS = Object.keys(MOTION_LABELS);
|
|
244
|
+
const RADIUS_SIZES = [
|
|
245
|
+
"sm",
|
|
246
|
+
"md",
|
|
247
|
+
"lg"
|
|
248
|
+
];
|
|
249
|
+
const A11Y_PAIRS = [
|
|
250
|
+
{
|
|
251
|
+
label: "Text on background",
|
|
252
|
+
fg: "foreground",
|
|
253
|
+
bg: "background"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
label: "Text on card",
|
|
257
|
+
fg: "cardForeground",
|
|
258
|
+
bg: "card"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
label: "Primary button",
|
|
262
|
+
fg: "primaryForeground",
|
|
263
|
+
bg: "primary"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
label: "Muted text",
|
|
267
|
+
fg: "mutedForeground",
|
|
268
|
+
bg: "muted"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
label: "Accent",
|
|
272
|
+
fg: "accentForeground",
|
|
273
|
+
bg: "accent"
|
|
274
|
+
}
|
|
275
|
+
];
|
|
276
|
+
const DEFAULT_SIDEBAR = {
|
|
277
|
+
light: {
|
|
278
|
+
sidebar: "255 255 255",
|
|
279
|
+
sidebarForeground: "30 41 59",
|
|
280
|
+
sidebarPrimary: "31 143 255",
|
|
281
|
+
sidebarPrimaryForeground: "255 255 255",
|
|
282
|
+
sidebarAccent: "219 234 254",
|
|
283
|
+
sidebarAccentForeground: "30 41 59",
|
|
284
|
+
sidebarBorder: "229 231 235",
|
|
285
|
+
sidebarRing: "31 143 255"
|
|
286
|
+
},
|
|
287
|
+
dark: {
|
|
288
|
+
sidebar: "14 14 18",
|
|
289
|
+
sidebarForeground: "229 230 236",
|
|
290
|
+
sidebarPrimary: "31 143 255",
|
|
291
|
+
sidebarPrimaryForeground: "255 255 255",
|
|
292
|
+
sidebarAccent: "38 38 45",
|
|
293
|
+
sidebarAccentForeground: "229 230 236",
|
|
294
|
+
sidebarBorder: "48 49 57",
|
|
295
|
+
sidebarRing: "31 143 255"
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
const DEFAULT_RADII = {
|
|
299
|
+
sm: "0.25rem",
|
|
300
|
+
md: "0.375rem",
|
|
301
|
+
lg: "0.5rem"
|
|
302
|
+
};
|
|
303
|
+
const DEFAULT_CHART = {
|
|
304
|
+
light: {
|
|
305
|
+
chart1: "31 143 255",
|
|
306
|
+
chart2: "0 194 135",
|
|
307
|
+
chart3: "146 92 255",
|
|
308
|
+
chart4: "245 147 0",
|
|
309
|
+
chart5: "237 94 223"
|
|
310
|
+
},
|
|
311
|
+
dark: {
|
|
312
|
+
chart1: "92 173 255",
|
|
313
|
+
chart2: "0 230 161",
|
|
314
|
+
chart3: "173 133 255",
|
|
315
|
+
chart4: "255 190 92",
|
|
316
|
+
chart5: "242 140 232"
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const DEFAULT_FONT_WEIGHTS = {
|
|
320
|
+
normal: "400",
|
|
321
|
+
medium: "500",
|
|
322
|
+
semibold: "600",
|
|
323
|
+
bold: "700"
|
|
324
|
+
};
|
|
325
|
+
const DEFAULT_LETTER_SPACING = "1px";
|
|
326
|
+
const MONO_FALLBACK = "'JetBrains Mono', ui-monospace, monospace";
|
|
327
|
+
const DEFAULT_SHADOWS = {
|
|
328
|
+
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
329
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
330
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
331
|
+
lift: "0 10px 30px -12px rgb(0 0 0 / 0.28), 0 2px 6px rgb(0 0 0 / 0.06)"
|
|
332
|
+
};
|
|
333
|
+
const DEFAULT_SPACING = {
|
|
334
|
+
gutter: "1.5rem",
|
|
335
|
+
inset: "1.5rem"
|
|
336
|
+
};
|
|
337
|
+
const DEFAULT_MOTION = {
|
|
338
|
+
duration: "200ms",
|
|
339
|
+
easing: "cubic-bezier(0.2, 0.7, 0.2, 1)"
|
|
340
|
+
};
|
|
341
|
+
const DEFAULT_GRADIENT = "linear-gradient(135deg, rgb(var(--primary)), rgb(var(--accent, var(--primary))))";
|
|
342
|
+
const numOf = (value, fallback) => {
|
|
343
|
+
const n = Number.parseFloat(value);
|
|
344
|
+
return Number.isFinite(n) ? n : fallback;
|
|
345
|
+
};
|
|
346
|
+
const letterSpacingToPx = (value) => {
|
|
347
|
+
const n = Number.parseFloat(value);
|
|
348
|
+
if (!Number.isFinite(n)) return 0;
|
|
349
|
+
return value.trim().endsWith("em") ? n * 16 : n;
|
|
350
|
+
};
|
|
351
|
+
const pxToLetterSpacing = (px, currentValue) => currentValue.trim().endsWith("em") ? `${Number((px / 16).toFixed(3))}em` : `${px}px`;
|
|
352
|
+
const lengthToPx = (value) => {
|
|
353
|
+
const n = Number.parseFloat(value);
|
|
354
|
+
if (!Number.isFinite(n)) return 0;
|
|
355
|
+
return Math.round(value.trim().endsWith("rem") ? n * 16 : n);
|
|
356
|
+
};
|
|
357
|
+
const pxToLength = (px, currentValue) => {
|
|
358
|
+
const trimmed = currentValue.trim();
|
|
359
|
+
if (trimmed.endsWith("rem")) return `${px / 16}rem`;
|
|
360
|
+
if (/^-?\d*\.?\d+$/.test(trimmed)) return `${px}`;
|
|
361
|
+
return `${px}px`;
|
|
362
|
+
};
|
|
363
|
+
const isSvgMarkup = (source) => source.trimStart().startsWith("<");
|
|
364
|
+
const isImageSource = (source) => /^(data:|https?:\/\/)/.test(source.trim());
|
|
365
|
+
/** Renders a logo source (SVG markup, `data:` URI, or `http(s)` URL) from the raw string. */
|
|
366
|
+
const LogoPreviewImage = ({ source, className }) => {
|
|
367
|
+
const safeSvg = useMemo(() => isSvgMarkup(source) ? DOMPurify.sanitize(source, { USE_PROFILES: {
|
|
368
|
+
svg: true,
|
|
369
|
+
svgFilters: true
|
|
370
|
+
} }) : null, [source]);
|
|
371
|
+
if (safeSvg !== null) return /* @__PURE__ */ jsx("span", {
|
|
372
|
+
"aria-hidden": true,
|
|
373
|
+
className,
|
|
374
|
+
dangerouslySetInnerHTML: { __html: safeSvg }
|
|
375
|
+
});
|
|
376
|
+
if (isImageSource(source)) return /* @__PURE__ */ jsx("img", {
|
|
377
|
+
src: source,
|
|
378
|
+
alt: "",
|
|
379
|
+
className
|
|
380
|
+
});
|
|
381
|
+
return null;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Controlled brand-editing block — colors (light/dark), sidebar colors, WCAG contrast readout,
|
|
385
|
+
* corner radius, typography, and logo. Reads/writes a `Brand` (`@keboola/brand-registry`) via
|
|
386
|
+
* `value` / `onChange`; owns no state of its own, so the caller decides where the brand and the
|
|
387
|
+
* active color scheme live (Kai build-mode preview, theme-generator, …).
|
|
388
|
+
*/
|
|
389
|
+
const BrandEditor = ({ value, onChange, colorScheme = "light", onColorSchemeChange, fontOptions = DEFAULT_FONT_OPTIONS }) => {
|
|
390
|
+
const baseId = useId();
|
|
391
|
+
const { theme } = value;
|
|
392
|
+
const coreColors = colorScheme === "light" ? theme.colors : theme.colorsDark;
|
|
393
|
+
const sidebarColors = colorScheme === "light" ? theme.colors?.sidebar : theme.colorsDark?.sidebar;
|
|
394
|
+
const chartColors = colorScheme === "light" ? theme.colors?.chart : theme.colorsDark?.chart;
|
|
395
|
+
const defaultColors = colorScheme === "light" ? keboola.theme.colors : keboola.theme.colorsDark;
|
|
396
|
+
const radii = theme.radii ?? DEFAULT_RADII;
|
|
397
|
+
const typography = theme.typography;
|
|
398
|
+
const setColor = (slot, channels) => {
|
|
399
|
+
if (colorScheme === "light") {
|
|
400
|
+
onChange({
|
|
401
|
+
...value,
|
|
402
|
+
theme: {
|
|
403
|
+
...theme,
|
|
404
|
+
colors: {
|
|
405
|
+
...theme.colors,
|
|
406
|
+
[slot]: channels
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
onChange({
|
|
413
|
+
...value,
|
|
414
|
+
theme: {
|
|
415
|
+
...theme,
|
|
416
|
+
colorsDark: {
|
|
417
|
+
...theme.colorsDark,
|
|
418
|
+
[slot]: channels
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
const setSidebarColor = (slot, channels) => {
|
|
424
|
+
if (colorScheme === "light") {
|
|
425
|
+
const base = theme.colors?.sidebar ?? DEFAULT_SIDEBAR.light;
|
|
426
|
+
onChange({
|
|
427
|
+
...value,
|
|
428
|
+
theme: {
|
|
429
|
+
...theme,
|
|
430
|
+
colors: {
|
|
431
|
+
...theme.colors,
|
|
432
|
+
sidebar: {
|
|
433
|
+
...base,
|
|
434
|
+
[slot]: channels
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const sidebarBase = theme.colorsDark?.sidebar ?? DEFAULT_SIDEBAR.dark;
|
|
442
|
+
onChange({
|
|
443
|
+
...value,
|
|
444
|
+
theme: {
|
|
445
|
+
...theme,
|
|
446
|
+
colorsDark: {
|
|
447
|
+
...theme.colorsDark,
|
|
448
|
+
sidebar: {
|
|
449
|
+
...sidebarBase,
|
|
450
|
+
[slot]: channels
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
const setChart = (slot, channels) => {
|
|
457
|
+
const chart = {
|
|
458
|
+
...chartColors ?? DEFAULT_CHART[colorScheme],
|
|
459
|
+
[slot]: channels
|
|
460
|
+
};
|
|
461
|
+
if (colorScheme === "light") {
|
|
462
|
+
onChange({
|
|
463
|
+
...value,
|
|
464
|
+
theme: {
|
|
465
|
+
...theme,
|
|
466
|
+
colors: {
|
|
467
|
+
...theme.colors,
|
|
468
|
+
chart
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
onChange({
|
|
475
|
+
...value,
|
|
476
|
+
theme: {
|
|
477
|
+
...theme,
|
|
478
|
+
colorsDark: {
|
|
479
|
+
...theme.colorsDark,
|
|
480
|
+
chart
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
};
|
|
485
|
+
const setRadius = (size, radius) => onChange({
|
|
486
|
+
...value,
|
|
487
|
+
theme: {
|
|
488
|
+
...theme,
|
|
489
|
+
radii: {
|
|
490
|
+
...theme.radii ?? DEFAULT_RADII,
|
|
491
|
+
[size]: radius
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
const patchTypography = (patch) => onChange({
|
|
496
|
+
...value,
|
|
497
|
+
theme: {
|
|
498
|
+
...theme,
|
|
499
|
+
typography: {
|
|
500
|
+
...theme.typography,
|
|
501
|
+
...patch
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
const setFontFace = (face, font) => patchTypography({ [face]: font.trim() || void 0 });
|
|
506
|
+
const setFontWeight = (slot, weight) => patchTypography({ weight: {
|
|
507
|
+
...theme.typography?.weight,
|
|
508
|
+
[slot]: weight || void 0
|
|
509
|
+
} });
|
|
510
|
+
const setLetterSpacing = (chrome) => patchTypography({ letterSpacing: { chrome: chrome.trim() || void 0 } });
|
|
511
|
+
const setShadow = (slot, shadow) => onChange({
|
|
512
|
+
...value,
|
|
513
|
+
theme: {
|
|
514
|
+
...theme,
|
|
515
|
+
shadows: {
|
|
516
|
+
...theme.shadows,
|
|
517
|
+
[slot]: shadow.trim() || void 0
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
const setSpacing = (slot, length) => onChange({
|
|
522
|
+
...value,
|
|
523
|
+
theme: {
|
|
524
|
+
...theme,
|
|
525
|
+
spacing: {
|
|
526
|
+
...theme.spacing,
|
|
527
|
+
[slot]: length.trim() || void 0
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
const setMotion = (slot, token) => onChange({
|
|
532
|
+
...value,
|
|
533
|
+
theme: {
|
|
534
|
+
...theme,
|
|
535
|
+
motion: {
|
|
536
|
+
...theme.motion,
|
|
537
|
+
[slot]: token.trim() || void 0
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
const setGradient = (gradient) => onChange({
|
|
542
|
+
...value,
|
|
543
|
+
theme: {
|
|
544
|
+
...theme,
|
|
545
|
+
gradient: { brand: gradient.trim() || void 0 }
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
const setLogo = (slot, source) => {
|
|
549
|
+
const trimmed = source.trim();
|
|
550
|
+
const nextLogo = { ...value.logo };
|
|
551
|
+
if (trimmed) nextLogo[slot] = trimmed;
|
|
552
|
+
else delete nextLogo[slot];
|
|
553
|
+
const { logo: _drop, ...rest } = value;
|
|
554
|
+
onChange(Object.keys(nextLogo).length > 0 ? {
|
|
555
|
+
...value,
|
|
556
|
+
logo: nextLogo
|
|
557
|
+
} : rest);
|
|
558
|
+
};
|
|
559
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
560
|
+
className: "tw:flex tw:flex-col",
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
563
|
+
title: "Colors",
|
|
564
|
+
children: [onColorSchemeChange ? /* @__PURE__ */ jsxs(ToggleGroup, {
|
|
565
|
+
type: "single",
|
|
566
|
+
value: colorScheme,
|
|
567
|
+
onValueChange: (next) => {
|
|
568
|
+
if (next === "light" || next === "dark") onColorSchemeChange(next);
|
|
569
|
+
},
|
|
570
|
+
"aria-label": "Color scheme",
|
|
571
|
+
className: "tw:w-full",
|
|
572
|
+
children: [/* @__PURE__ */ jsx(ToggleGroup.Item, {
|
|
573
|
+
value: "light",
|
|
574
|
+
className: "tw:flex-1",
|
|
575
|
+
children: "Light"
|
|
576
|
+
}), /* @__PURE__ */ jsx(ToggleGroup.Item, {
|
|
577
|
+
value: "dark",
|
|
578
|
+
className: "tw:flex-1",
|
|
579
|
+
children: "Dark"
|
|
580
|
+
})]
|
|
581
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
582
|
+
className: "tw:flex tw:flex-col tw:gap-2",
|
|
583
|
+
children: COLOR_SLOTS.map((slot) => /* @__PURE__ */ jsx(ColorField, {
|
|
584
|
+
id: `${baseId}color-${colorScheme}-${slot}`,
|
|
585
|
+
label: COLOR_LABELS[slot],
|
|
586
|
+
channels: coreColors?.[slot] ?? defaultColors?.[slot] ?? "0 0 0",
|
|
587
|
+
onChange: (channels) => setColor(slot, channels)
|
|
588
|
+
}, slot))
|
|
589
|
+
})]
|
|
590
|
+
}),
|
|
591
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
592
|
+
title: "Accessibility",
|
|
593
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
594
|
+
className: "tw:m-0 tw:text-xs tw:text-muted-foreground",
|
|
595
|
+
children: [
|
|
596
|
+
"WCAG contrast for the ",
|
|
597
|
+
colorScheme,
|
|
598
|
+
" palette (AA needs 4.5:1)."
|
|
599
|
+
]
|
|
600
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
601
|
+
className: "tw:flex tw:flex-col tw:gap-1.5",
|
|
602
|
+
children: A11Y_PAIRS.map((pair) => {
|
|
603
|
+
const fg = coreColors?.[pair.fg] ?? defaultColors?.[pair.fg] ?? "0 0 0";
|
|
604
|
+
const bg = coreColors?.[pair.bg] ?? defaultColors?.[pair.bg] ?? "255 255 255";
|
|
605
|
+
const ratio = contrastRatio(fg, bg);
|
|
606
|
+
const level = wcagLevel(ratio);
|
|
607
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
608
|
+
className: "tw:flex tw:items-center tw:justify-between tw:gap-2",
|
|
609
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
610
|
+
className: "tw:text-xs tw:text-foreground",
|
|
611
|
+
children: pair.label
|
|
612
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
613
|
+
className: "tw:flex tw:items-center tw:gap-1.5",
|
|
614
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
615
|
+
className: "tw:text-xs tw:tabular-nums tw:text-muted-foreground",
|
|
616
|
+
children: [ratio.toFixed(1), ":1"]
|
|
617
|
+
}), /* @__PURE__ */ jsx(Badge, {
|
|
618
|
+
color: level === "fail" ? "red" : "green",
|
|
619
|
+
children: level === "fail" ? "Fail" : level
|
|
620
|
+
})]
|
|
621
|
+
})]
|
|
622
|
+
}, pair.label);
|
|
623
|
+
})
|
|
624
|
+
})]
|
|
625
|
+
}),
|
|
626
|
+
/* @__PURE__ */ jsx(ControlSection, {
|
|
627
|
+
title: "Sidebar colors",
|
|
628
|
+
children: /* @__PURE__ */ jsxs(Collapsible, {
|
|
629
|
+
className: "tw:flex tw:flex-col tw:gap-2",
|
|
630
|
+
children: [/* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
631
|
+
asChild: true,
|
|
632
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
633
|
+
variant: "outline",
|
|
634
|
+
size: "small",
|
|
635
|
+
className: "tw:w-full",
|
|
636
|
+
children: [
|
|
637
|
+
"Toggle sidebar tokens (",
|
|
638
|
+
colorScheme,
|
|
639
|
+
")"
|
|
640
|
+
]
|
|
641
|
+
})
|
|
642
|
+
}), /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
643
|
+
className: "tw:flex tw:flex-col tw:gap-2",
|
|
644
|
+
children: SIDEBAR_SLOTS.map((slot) => /* @__PURE__ */ jsx(ColorField, {
|
|
645
|
+
id: `${baseId}sidebar-${colorScheme}-${slot}`,
|
|
646
|
+
label: SIDEBAR_LABELS[slot],
|
|
647
|
+
channels: sidebarColors?.[slot] ?? DEFAULT_SIDEBAR[colorScheme][slot],
|
|
648
|
+
onChange: (channels) => setSidebarColor(slot, channels)
|
|
649
|
+
}, slot))
|
|
650
|
+
})]
|
|
651
|
+
})
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
654
|
+
title: "Chart palette",
|
|
655
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
656
|
+
className: "tw:m-0 tw:text-xs tw:text-muted-foreground",
|
|
657
|
+
children: [
|
|
658
|
+
"Categorical series colours for the ",
|
|
659
|
+
colorScheme,
|
|
660
|
+
" palette (`--chart-1…5`)."
|
|
661
|
+
]
|
|
662
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
663
|
+
className: "tw:flex tw:flex-col tw:gap-2",
|
|
664
|
+
children: CHART_SLOTS.map((slot) => /* @__PURE__ */ jsx(ColorField, {
|
|
665
|
+
id: `${baseId}chart-${colorScheme}-${slot}`,
|
|
666
|
+
label: CHART_LABELS[slot],
|
|
667
|
+
channels: chartColors?.[slot] ?? DEFAULT_CHART[colorScheme][slot],
|
|
668
|
+
onChange: (channels) => setChart(slot, channels)
|
|
669
|
+
}, slot))
|
|
670
|
+
})]
|
|
671
|
+
}),
|
|
672
|
+
/* @__PURE__ */ jsx(ControlSection, {
|
|
673
|
+
title: "Radius",
|
|
674
|
+
children: RADIUS_SIZES.map((size) => {
|
|
675
|
+
const current = radii[size];
|
|
676
|
+
const px = lengthToPx(current);
|
|
677
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
678
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
679
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
680
|
+
className: "tw:flex tw:items-center tw:justify-between",
|
|
681
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
682
|
+
className: "tw:text-xs tw:font-normal tw:uppercase tw:text-foreground",
|
|
683
|
+
children: size
|
|
684
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
685
|
+
className: "tw:text-xs tw:tabular-nums tw:text-muted-foreground",
|
|
686
|
+
children: radii[size]
|
|
687
|
+
})]
|
|
688
|
+
}), /* @__PURE__ */ jsx(Slider, {
|
|
689
|
+
min: 0,
|
|
690
|
+
max: 24,
|
|
691
|
+
step: 1,
|
|
692
|
+
value: [px],
|
|
693
|
+
onValueChange: (values) => setRadius(size, pxToLength(values[0] ?? 0, current))
|
|
694
|
+
})]
|
|
695
|
+
}, size);
|
|
696
|
+
})
|
|
697
|
+
}),
|
|
698
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
699
|
+
title: "Typography",
|
|
700
|
+
children: [
|
|
701
|
+
/* @__PURE__ */ jsxs("div", {
|
|
702
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
703
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
704
|
+
htmlFor: `${baseId}font-family`,
|
|
705
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
706
|
+
children: "Font family"
|
|
707
|
+
}), /* @__PURE__ */ jsx(Select, {
|
|
708
|
+
id: `${baseId}font-family`,
|
|
709
|
+
value: typography?.fontFamily ?? "'Inter', system-ui, sans-serif",
|
|
710
|
+
onValueChange: (font) => setFontFace("fontFamily", font),
|
|
711
|
+
items: fontOptions
|
|
712
|
+
})]
|
|
713
|
+
}),
|
|
714
|
+
/* @__PURE__ */ jsxs("div", {
|
|
715
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
716
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
717
|
+
htmlFor: `${baseId}font-display`,
|
|
718
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
719
|
+
children: "Display font (headings)"
|
|
720
|
+
}), /* @__PURE__ */ jsx(Select, {
|
|
721
|
+
id: `${baseId}font-display`,
|
|
722
|
+
value: typography?.fontDisplay ?? typography?.fontFamily ?? "'Inter', system-ui, sans-serif",
|
|
723
|
+
onValueChange: (font) => setFontFace("fontDisplay", font),
|
|
724
|
+
items: fontOptions
|
|
725
|
+
})]
|
|
726
|
+
}),
|
|
727
|
+
/* @__PURE__ */ jsxs("div", {
|
|
728
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
729
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
730
|
+
htmlFor: `${baseId}font-mono`,
|
|
731
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
732
|
+
children: "Monospace font"
|
|
733
|
+
}), /* @__PURE__ */ jsx(Select, {
|
|
734
|
+
id: `${baseId}font-mono`,
|
|
735
|
+
value: typography?.fontMono ?? MONO_FALLBACK,
|
|
736
|
+
onValueChange: (font) => setFontFace("fontMono", font),
|
|
737
|
+
items: fontOptions
|
|
738
|
+
})]
|
|
739
|
+
}),
|
|
740
|
+
/* @__PURE__ */ jsx("span", {
|
|
741
|
+
className: "tw:text-xs tw:text-muted-foreground",
|
|
742
|
+
children: "Chrome font weights"
|
|
743
|
+
}),
|
|
744
|
+
WEIGHT_SLOTS.map((slot) => {
|
|
745
|
+
const current = typography?.weight?.[slot] ?? DEFAULT_FONT_WEIGHTS[slot];
|
|
746
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
747
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
748
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
749
|
+
className: "tw:flex tw:items-center tw:justify-between",
|
|
750
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
751
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
752
|
+
children: WEIGHT_LABELS[slot]
|
|
753
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
754
|
+
className: "tw:text-xs tw:tabular-nums tw:text-muted-foreground",
|
|
755
|
+
children: current
|
|
756
|
+
})]
|
|
757
|
+
}), /* @__PURE__ */ jsx(Slider, {
|
|
758
|
+
min: 100,
|
|
759
|
+
max: 900,
|
|
760
|
+
step: 25,
|
|
761
|
+
value: [numOf(current, 400)],
|
|
762
|
+
onValueChange: (values) => setFontWeight(slot, String(values[0] ?? 400))
|
|
763
|
+
})]
|
|
764
|
+
}, slot);
|
|
765
|
+
}),
|
|
766
|
+
/* @__PURE__ */ jsxs("div", {
|
|
767
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
768
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
769
|
+
className: "tw:flex tw:items-center tw:justify-between",
|
|
770
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
771
|
+
className: "tw:text-xs tw:font-normal tw:text-foreground",
|
|
772
|
+
children: "Chrome letter spacing"
|
|
773
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
774
|
+
className: "tw:text-xs tw:tabular-nums tw:text-muted-foreground",
|
|
775
|
+
children: typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING
|
|
776
|
+
})]
|
|
777
|
+
}), /* @__PURE__ */ jsx(Slider, {
|
|
778
|
+
min: -2,
|
|
779
|
+
max: 4,
|
|
780
|
+
step: .25,
|
|
781
|
+
value: [letterSpacingToPx(typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING)],
|
|
782
|
+
onValueChange: (values) => setLetterSpacing(pxToLetterSpacing(values[0] ?? 0, typography?.letterSpacing?.chrome ?? DEFAULT_LETTER_SPACING))
|
|
783
|
+
})]
|
|
784
|
+
})
|
|
785
|
+
]
|
|
786
|
+
}),
|
|
787
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
788
|
+
title: "Elevation",
|
|
789
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
790
|
+
className: "tw:m-0 tw:text-xs tw:text-muted-foreground",
|
|
791
|
+
children: "Box-shadow scale (`--shadow-*`), shared across light & dark. Empty inherits the default."
|
|
792
|
+
}), SHADOW_SLOTS.map((slot) => /* @__PURE__ */ jsx(TextField, {
|
|
793
|
+
id: `${baseId}shadow-${slot}`,
|
|
794
|
+
label: SHADOW_LABELS[slot],
|
|
795
|
+
value: theme.shadows?.[slot] ?? "",
|
|
796
|
+
placeholder: DEFAULT_SHADOWS[slot],
|
|
797
|
+
onChange: (next) => setShadow(slot, next)
|
|
798
|
+
}, slot))]
|
|
799
|
+
}),
|
|
800
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
801
|
+
title: "Density",
|
|
802
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
803
|
+
className: "tw:m-0 tw:text-xs tw:text-muted-foreground",
|
|
804
|
+
children: "Semantic spacing (`--space-*`), as CSS lengths."
|
|
805
|
+
}), SPACING_SLOTS.map((slot) => /* @__PURE__ */ jsx(TextField, {
|
|
806
|
+
id: `${baseId}spacing-${slot}`,
|
|
807
|
+
label: SPACING_LABELS[slot],
|
|
808
|
+
value: theme.spacing?.[slot] ?? "",
|
|
809
|
+
placeholder: DEFAULT_SPACING[slot],
|
|
810
|
+
onChange: (next) => setSpacing(slot, next)
|
|
811
|
+
}, slot))]
|
|
812
|
+
}),
|
|
813
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
814
|
+
title: "Motion",
|
|
815
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
816
|
+
className: "tw:m-0 tw:text-xs tw:text-muted-foreground",
|
|
817
|
+
children: "Base transition `duration` + `easing` (`--motion-*`)."
|
|
818
|
+
}), MOTION_SLOTS.map((slot) => /* @__PURE__ */ jsx(TextField, {
|
|
819
|
+
id: `${baseId}motion-${slot}`,
|
|
820
|
+
label: MOTION_LABELS[slot],
|
|
821
|
+
value: theme.motion?.[slot] ?? "",
|
|
822
|
+
placeholder: DEFAULT_MOTION[slot],
|
|
823
|
+
onChange: (next) => setMotion(slot, next)
|
|
824
|
+
}, slot))]
|
|
825
|
+
}),
|
|
826
|
+
/* @__PURE__ */ jsx(ControlSection, {
|
|
827
|
+
title: "Gradient",
|
|
828
|
+
children: /* @__PURE__ */ jsx(TextField, {
|
|
829
|
+
id: `${baseId}gradient-brand`,
|
|
830
|
+
label: "Brand gradient",
|
|
831
|
+
value: theme.gradient?.brand ?? "",
|
|
832
|
+
placeholder: DEFAULT_GRADIENT,
|
|
833
|
+
onChange: setGradient
|
|
834
|
+
})
|
|
835
|
+
}),
|
|
836
|
+
/* @__PURE__ */ jsxs(ControlSection, {
|
|
837
|
+
title: "Logo",
|
|
838
|
+
children: [
|
|
839
|
+
/* @__PURE__ */ jsx(LogoField, {
|
|
840
|
+
id: `${baseId}logo-mark`,
|
|
841
|
+
label: "Mark (icon)",
|
|
842
|
+
value: value.logo?.mark ?? "",
|
|
843
|
+
onChange: (source) => setLogo("mark", source)
|
|
844
|
+
}),
|
|
845
|
+
/* @__PURE__ */ jsx(LogoField, {
|
|
846
|
+
id: `${baseId}logo-wordmark`,
|
|
847
|
+
label: "Wordmark (full)",
|
|
848
|
+
value: value.logo?.wordmark ?? "",
|
|
849
|
+
onChange: (source) => setLogo("wordmark", source)
|
|
850
|
+
}),
|
|
851
|
+
/* @__PURE__ */ jsxs(Collapsible, {
|
|
852
|
+
className: "tw:flex tw:flex-col tw:gap-2",
|
|
853
|
+
children: [/* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
854
|
+
asChild: true,
|
|
855
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
856
|
+
variant: "outline",
|
|
857
|
+
size: "small",
|
|
858
|
+
className: "tw:w-full",
|
|
859
|
+
children: "Toggle dark-mode logos"
|
|
860
|
+
})
|
|
861
|
+
}), /* @__PURE__ */ jsxs(Collapsible.Content, {
|
|
862
|
+
className: "tw:flex tw:flex-col tw:gap-2",
|
|
863
|
+
children: [/* @__PURE__ */ jsx(LogoField, {
|
|
864
|
+
id: `${baseId}logo-mark-dark`,
|
|
865
|
+
label: "Mark (dark)",
|
|
866
|
+
value: value.logo?.markDark ?? "",
|
|
867
|
+
onChange: (source) => setLogo("markDark", source)
|
|
868
|
+
}), /* @__PURE__ */ jsx(LogoField, {
|
|
869
|
+
id: `${baseId}logo-wordmark-dark`,
|
|
870
|
+
label: "Wordmark (dark)",
|
|
871
|
+
value: value.logo?.wordmarkDark ?? "",
|
|
872
|
+
onChange: (source) => setLogo("wordmarkDark", source)
|
|
873
|
+
})]
|
|
874
|
+
})]
|
|
875
|
+
}),
|
|
876
|
+
/* @__PURE__ */ jsxs("div", {
|
|
877
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
878
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
879
|
+
className: "tw:text-xs tw:text-muted-foreground",
|
|
880
|
+
children: "Preview"
|
|
881
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
882
|
+
className: "tw:flex tw:min-h-12 tw:items-center tw:gap-4 tw:rounded-md tw:border tw:border-border tw:bg-background tw:p-3",
|
|
883
|
+
children: value.logo?.mark || value.logo?.wordmark ? /* @__PURE__ */ jsxs(Fragment$1, { children: [value.logo.mark ? /* @__PURE__ */ jsx(LogoPreviewImage, {
|
|
884
|
+
source: value.logo.mark,
|
|
885
|
+
className: "tw:h-8"
|
|
886
|
+
}) : null, value.logo.wordmark ? /* @__PURE__ */ jsx(LogoPreviewImage, {
|
|
887
|
+
source: value.logo.wordmark,
|
|
888
|
+
className: "tw:h-8"
|
|
889
|
+
}) : null] }) : /* @__PURE__ */ jsx("span", {
|
|
890
|
+
className: "tw:text-xs tw:text-muted-foreground",
|
|
891
|
+
children: "No logo set"
|
|
892
|
+
})
|
|
893
|
+
})]
|
|
894
|
+
})
|
|
895
|
+
]
|
|
896
|
+
})
|
|
897
|
+
]
|
|
898
|
+
});
|
|
899
|
+
};
|
|
900
|
+
//#endregion
|
|
901
|
+
export { BrandEditor, DEFAULT_FALLBACK_FONT, DEFAULT_FONT_OPTIONS, channelsToHex, contrastRatio, hexToChannels, wcagLevel };
|
|
902
|
+
|
|
903
|
+
//# sourceMappingURL=BrandEditor-B8o9zdZO.js.map
|