@parallelworks/ui 0.44.0 → 0.45.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/README.md +348 -25
- package/dist/ai/agent/diff.d.ts +2 -1
- package/dist/ai/agent/diff.js +4 -12
- package/dist/ai/agent/diffHighlight.d.ts +1 -1
- package/dist/ai/agent/diffHighlight.js +4 -3
- package/dist/ai/agent/index.d.ts +2 -1
- package/dist/ai/agent/toolStrings.d.ts +37 -0
- package/dist/ai/agent/toolStrings.js +35 -0
- package/dist/ai/agent/toolfmt.d.ts +8 -3
- package/dist/ai/agent/toolfmt.js +50 -65
- package/dist/ai/ai.css +18 -31
- package/dist/ai/components/AllocationSelector.js +2 -2
- package/dist/ai/components/AttachmentManager.js +28 -29
- package/dist/ai/components/AttachmentUpload.js +25 -30
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +3 -4
- package/dist/ai/components/ChatEmptyState.js +8 -7
- package/dist/ai/components/ChatInput.js +10 -12
- package/dist/ai/components/ChatLayout.js +3 -3
- package/dist/ai/components/ChatMessage.js +49 -61
- package/dist/ai/components/ChatMessageList.js +46 -42
- package/dist/ai/components/ChatSidebar.js +26 -34
- package/dist/ai/components/ChatStage.js +1 -1
- package/dist/ai/components/ComposerChrome.js +3 -4
- package/dist/ai/components/DragOverlay.js +6 -4
- package/dist/ai/components/ModelSelector.js +14 -15
- package/dist/ai/components/PastedText.js +18 -14
- package/dist/ai/components/ProviderIssueBanner.js +3 -4
- package/dist/ai/components/Reasoning.d.ts +12 -6
- package/dist/ai/components/Reasoning.js +31 -18
- package/dist/ai/components/ShareDialog.js +25 -28
- package/dist/ai/components/SlashMenu.js +3 -3
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -5
- package/dist/ai/components/agent/ActivityLine.js +17 -54
- package/dist/ai/components/agent/AgentMessageParts.js +139 -149
- package/dist/ai/components/conversationActions.js +16 -16
- package/dist/ai/core/ChatProvider.d.ts +2 -4
- package/dist/ai/core/ChatProvider.js +25 -38
- package/dist/ai/core/exportConversation.js +4 -4
- package/dist/ai/core/sidebarState.d.ts +8 -6
- package/dist/ai/core/sidebarState.js +21 -28
- package/dist/ai/core/useKeyboardShortcuts.js +14 -5
- package/dist/ai/index.d.ts +4 -5
- package/dist/ai/index.js +7 -7
- package/dist/ai/strings.d.ts +14 -31
- package/dist/ai/strings.js +19 -39
- package/dist/ai/types.d.ts +0 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +12 -9
- package/dist/ai/ui/ConversationSidebar.js +43 -87
- package/dist/ai/ui/Markdown.d.ts +3 -6
- package/dist/ai/ui/Markdown.js +6 -73
- package/dist/ai/ui/Notice.js +10 -12
- package/dist/ai/ui/chip.d.ts +2 -2
- package/dist/ai/ui/chip.js +1 -1
- package/dist/ai/ui/sidebar.d.ts +4 -20
- package/dist/ai/ui/sidebar.js +30 -67
- package/dist/ai/utils.d.ts +0 -1
- package/dist/ai/utils.js +1 -14
- package/dist/brandIcons.d.ts +51 -0
- package/dist/brandIcons.js +75 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.js +34 -28
- package/dist/components/Button.d.ts +12 -7
- package/dist/components/Button.js +39 -44
- package/dist/components/Callout.js +18 -12
- package/dist/components/Card.d.ts +18 -8
- package/dist/components/Card.js +17 -6
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Combobox.d.ts +9 -1
- package/dist/components/Combobox.js +71 -44
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +2 -8
- package/dist/components/ContextMenu.js +2 -29
- package/dist/components/CopyToClipboard.js +17 -36
- package/dist/components/CreateModal.d.ts +3 -24
- package/dist/components/CreateModal.js +46 -113
- package/dist/components/DatePicker.d.ts +31 -0
- package/dist/components/DatePicker.js +191 -0
- package/dist/components/DescriptionList.js +4 -4
- package/dist/components/Disclosure.d.ts +34 -0
- package/dist/components/Disclosure.js +46 -0
- package/dist/components/Drawer.d.ts +47 -0
- package/dist/components/Drawer.js +120 -0
- package/dist/components/EmptyState.d.ts +15 -10
- package/dist/components/EmptyState.js +13 -8
- package/dist/components/ExternalLink.d.ts +8 -0
- package/dist/components/ExternalLink.js +29 -0
- package/dist/components/Field.d.ts +70 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/HoverCard.js +11 -14
- package/dist/components/IconButton.d.ts +16 -13
- package/dist/components/IconButton.js +27 -18
- package/dist/components/InfoTip.js +16 -23
- package/dist/components/Input.d.ts +10 -9
- package/dist/components/Input.js +54 -96
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.d.ts +15 -8
- package/dist/components/Loader.js +29 -19
- package/dist/components/Markdown.d.ts +7 -1
- package/dist/components/Markdown.js +2 -0
- package/dist/components/MarkdownImpl.d.ts +1 -1
- package/dist/components/MarkdownImpl.js +55 -14
- package/dist/components/Menu.js +13 -15
- package/dist/components/MenuEntries.js +11 -16
- package/dist/components/Meter.d.ts +48 -0
- package/dist/components/Meter.js +94 -0
- package/dist/components/Modal.js +11 -14
- package/dist/components/NumberInput.d.ts +25 -0
- package/dist/components/NumberInput.js +55 -0
- package/dist/components/Overview.js +12 -10
- package/dist/components/PageHeader.d.ts +2 -3
- package/dist/components/PageHeader.js +30 -21
- package/dist/components/Pagination.d.ts +27 -14
- package/dist/components/Pagination.js +86 -25
- package/dist/components/Popover.d.ts +47 -0
- package/dist/components/Popover.js +63 -0
- package/dist/components/Provider.d.ts +197 -80
- package/dist/components/Provider.js +200 -118
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/RefreshButton.d.ts +15 -0
- package/dist/components/RefreshButton.js +53 -0
- package/dist/components/RunStatusIcon.d.ts +12 -0
- package/dist/components/RunStatusIcon.js +84 -0
- package/dist/components/SearchInput.d.ts +16 -0
- package/dist/components/SearchInput.js +52 -0
- package/dist/components/Section.d.ts +28 -0
- package/dist/components/Section.js +76 -0
- package/dist/components/SegmentedControl.d.ts +7 -11
- package/dist/components/SegmentedControl.js +25 -56
- package/dist/components/Select.d.ts +5 -1
- package/dist/components/Select.js +43 -44
- package/dist/components/SettingModeOption.d.ts +3 -5
- package/dist/components/SettingModeOption.js +5 -6
- package/dist/components/SettingsCard.d.ts +32 -19
- package/dist/components/SettingsCard.js +40 -13
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +34 -0
- package/dist/components/Slider.d.ts +16 -0
- package/dist/components/Slider.js +30 -0
- package/dist/components/Sort.js +4 -6
- package/dist/components/StatusBadge.d.ts +3 -1
- package/dist/components/StatusBadge.js +9 -32
- package/dist/components/StatusIcons.d.ts +0 -4
- package/dist/components/StatusIcons.js +5 -13
- package/dist/components/Switch.d.ts +5 -1
- package/dist/components/Switch.js +23 -6
- package/dist/components/Table.js +13 -20
- package/dist/components/Tabs.d.ts +52 -0
- package/dist/components/Tabs.js +75 -0
- package/dist/components/ThemeEditor.d.ts +29 -0
- package/dist/components/ThemeEditor.js +397 -0
- package/dist/components/Toast.d.ts +57 -0
- package/dist/components/Toast.js +203 -0
- package/dist/components/Tooltip.js +12 -15
- package/dist/components/buttonClasses.d.ts +18 -0
- package/dist/components/buttonClasses.js +31 -0
- package/dist/components/codeTheme.d.ts +5 -0
- package/dist/components/codeTheme.js +93 -0
- package/dist/components/fieldBox.d.ts +14 -0
- package/dist/components/fieldBox.js +29 -0
- package/dist/components/floating.d.ts +26 -5
- package/dist/components/floating.js +31 -9
- package/dist/{ai/ui/codeBreaks.js → components/markdownCodeBreaks.js} +1 -1
- package/dist/components/persistedState.d.ts +2 -0
- package/dist/components/persistedState.js +63 -0
- package/dist/components/relativeTime.d.ts +36 -8
- package/dist/components/relativeTime.js +106 -23
- package/dist/components/segmented.d.ts +17 -0
- package/dist/components/segmented.js +27 -0
- package/dist/components/shortcutKey.d.ts +4 -0
- package/dist/components/shortcutKey.js +27 -0
- package/dist/components/splitter.d.ts +26 -0
- package/dist/components/splitter.js +69 -0
- package/dist/components/tone.d.ts +9 -0
- package/dist/components/tone.js +30 -0
- package/dist/components/useCopy.d.ts +14 -0
- package/dist/components/useCopy.js +31 -0
- package/dist/components/useCssIsDark.d.ts +2 -0
- package/dist/components/useCssIsDark.js +2 -1
- package/dist/components/useTheme.d.ts +10 -0
- package/dist/components/useTheme.js +40 -0
- package/dist/cx.d.ts +5 -0
- package/dist/cx.js +11 -0
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/EditorField.js +7 -10
- package/dist/editor/FormCodePanel.js +10 -23
- package/dist/editor/Monaco.js +7 -4
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/themes.js +75 -76
- package/dist/file-explorer/FileExplorer.js +180 -187
- package/dist/file-explorer/FileExplorerContext.js +36 -58
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +2 -1
- package/dist/file-explorer/FilePreview/Inline.js +9 -7
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +32 -34
- package/dist/file-explorer/FilePreview/index.js +60 -92
- package/dist/file-explorer/FileRow.js +10 -15
- package/dist/file-explorer/FileRowsWindow.js +2 -6
- package/dist/file-explorer/FileTable.js +2 -2
- package/dist/file-explorer/FileTableHeaders.js +8 -11
- package/dist/file-explorer/LoadMoreRow.js +8 -9
- package/dist/file-explorer/TreeView.js +16 -16
- package/dist/file-explorer/helpers.d.ts +1 -4
- package/dist/file-explorer/helpers.js +101 -114
- package/dist/file-explorer/lib/utils.d.ts +0 -2
- package/dist/file-explorer/lib/utils.js +1 -25
- package/dist/file-explorer/toasts.js +104 -185
- package/dist/form/Fields/BooleanField.js +12 -14
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +16 -18
- package/dist/form/Fields/ColorField.js +11 -11
- package/dist/form/Fields/DropdownField.d.ts +1 -1
- package/dist/form/Fields/DropdownField.js +20 -36
- package/dist/form/Fields/DurationField.d.ts +1 -1
- package/dist/form/Fields/DurationField.js +36 -50
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +9 -14
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +13 -48
- package/dist/form/Fields/ObjectField.js +3 -3
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +15 -18
- package/dist/form/Fields/RangeField.js +34 -35
- package/dist/form/Fields/StringField.d.ts +1 -1
- package/dist/form/Fields/StringField.js +15 -25
- package/dist/form/Fields/TextAreaField.js +10 -15
- package/dist/form/Form.d.ts +7 -2
- package/dist/form/Form.js +144 -49
- package/dist/form/FormLayout.js +18 -12
- package/dist/form/Wizard/WizardContainer.js +44 -18
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +31 -56
- package/dist/form/Wizard/WizardStepIndicator.d.ts +3 -0
- package/dist/form/Wizard/WizardStepIndicator.js +98 -114
- package/dist/form/Wizard/types.d.ts +2 -2
- package/dist/form/fieldFrame.d.ts +7 -0
- package/dist/form/fieldFrame.js +19 -0
- package/dist/form/index.d.ts +5 -5
- package/dist/form/index.js +4 -6
- package/dist/form/layoutCSS.js +5 -4
- package/dist/form/types/fieldComponentTypes.d.ts +5 -3
- package/dist/form/useChoiceField.js +2 -3
- package/dist/form/useFieldValue.d.ts +3 -0
- package/dist/form/useFieldValue.js +24 -7
- package/dist/form/utils/duration.d.ts +2 -2
- package/dist/form/utils/duration.js +3 -3
- package/dist/form/utils/fieldPath.d.ts +5 -3
- package/dist/form/utils/fieldPath.js +18 -3
- package/dist/form/utils/secondaryField.d.ts +0 -7
- package/dist/form/utils/secondaryField.js +1 -12
- package/dist/form/validation.d.ts +29 -0
- package/dist/form/validation.js +14 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.js +64 -0
- package/dist/graph/AnnotationBanner.js +20 -31
- package/dist/graph/Connectors.js +1 -1
- package/dist/graph/DependencyGraph.js +51 -65
- package/dist/graph/GraphEditor.js +24 -28
- package/dist/graph/GraphEditorDialogs.js +239 -245
- package/dist/graph/InputDialog.js +93 -112
- package/dist/graph/InputsEditor.js +83 -84
- package/dist/graph/JobSummary.js +10 -11
- package/dist/graph/MatrixGroup.js +3 -3
- package/dist/graph/ProblemsButton.js +9 -10
- package/dist/graph/ShortcutsButton.js +12 -17
- package/dist/graph/SuggestionInput.d.ts +1 -2
- package/dist/graph/SuggestionInput.js +1 -3
- package/dist/graph/TreeView.js +47 -45
- package/dist/graph/WorkflowSettingsDialog.js +97 -102
- package/dist/graph/editorChrome.js +10 -12
- package/dist/graph/editorFields.d.ts +19 -16
- package/dist/graph/editorFields.js +97 -135
- package/dist/graph/editorPrimitives.js +2 -2
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +16 -19
- package/dist/graph/editorStrings.js +11 -23
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -4
- package/dist/graph/inputRefs.d.ts +0 -13
- package/dist/graph/inputRefs.js +121 -159
- package/dist/graph/settingsViews.js +5 -3
- package/dist/graph/stepWith.js +100 -100
- package/dist/graph/toolbarPanel.d.ts +8 -0
- package/dist/graph/toolbarPanel.js +11 -0
- package/dist/icons.d.ts +234 -23
- package/dist/icons.js +249 -264
- package/dist/index.d.ts +38 -21
- package/dist/index.js +42 -21
- package/dist/list/ActionToolbar.d.ts +1 -5
- package/dist/list/ActionToolbar.js +21 -20
- package/dist/list/ListPage.js +7 -7
- package/dist/list/ListTable.d.ts +3 -2
- package/dist/list/ListTable.js +33 -29
- package/dist/list/ListViewControls.d.ts +0 -17
- package/dist/list/ListViewControls.js +50 -118
- package/dist/list/UserHoverCard.js +24 -32
- package/dist/list/index.d.ts +2 -4
- package/dist/list/index.js +3 -5
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +19 -14
- package/dist/list/rowMenu.js +20 -26
- package/dist/logviewer/LogViewer.js +268 -382
- package/dist/logviewer/logviewer.css +53 -41
- package/dist/styles/base.css +16 -40
- package/dist/styles/theme.css +75 -106
- package/dist/styles.css +1 -1
- package/dist/theme/color.d.ts +40 -0
- package/dist/theme/color.js +228 -0
- package/dist/theme/contrast.d.ts +42 -0
- package/dist/theme/contrast.js +145 -0
- package/dist/theme/derive.d.ts +25 -0
- package/dist/theme/derive.js +475 -0
- package/dist/theme/fit.d.ts +35 -0
- package/dist/theme/fit.js +185 -0
- package/dist/theme/index.d.ts +14 -29
- package/dist/theme/index.js +20 -279
- package/dist/theme/model.d.ts +64 -0
- package/dist/theme/model.js +219 -0
- package/package.json +9 -5
- package/dist/ai/ui/Avatar.d.ts +0 -7
- package/dist/ai/ui/Avatar.js +0 -24
- package/dist/components/Filter.d.ts +0 -15
- package/dist/components/Filter.js +0 -32
- package/dist/components/FilterPill.d.ts +0 -7
- package/dist/components/FilterPill.js +0 -14
- package/dist/components/Indicator.d.ts +0 -4
- package/dist/components/Indicator.js +0 -44
- package/dist/components/SectionHeader.d.ts +0 -8
- package/dist/components/SectionHeader.js +0 -11
- package/dist/components/SettingRow.d.ts +0 -18
- package/dist/components/SettingRow.js +0 -35
- package/dist/components/SettingsGroup.d.ts +0 -8
- package/dist/components/SettingsGroup.js +0 -17
- package/dist/components/ghostButton.d.ts +0 -4
- package/dist/components/ghostButton.js +0 -7
- package/dist/components/inputClasses.d.ts +0 -1
- package/dist/components/inputClasses.js +0 -4
- package/dist/duration.d.ts +0 -3
- package/dist/duration.js +0 -17
- package/dist/form/FieldGroup.d.ts +0 -11
- package/dist/form/FieldGroup.js +0 -36
- package/dist/form/FieldWrapper.d.ts +0 -16
- package/dist/form/FieldWrapper.js +0 -55
- package/dist/form/fieldContext.d.ts +0 -19
- package/dist/form/fieldContext.js +0 -26
- package/dist/graph/Collapse.d.ts +0 -7
- package/dist/graph/Collapse.js +0 -15
- package/dist/graph/ToolbarPopover.d.ts +0 -13
- package/dist/graph/ToolbarPopover.js +0 -39
- package/dist/icons/ai/AiOutlineRollback.js +0 -16
- package/dist/icons/bi/BiBell.js +0 -16
- package/dist/icons/bi/BiBellOff.js +0 -16
- package/dist/icons/bi/BiBuildings.js +0 -20
- package/dist/icons/bi/BiError.js +0 -20
- package/dist/icons/bi/BiExpandVertical.js +0 -16
- package/dist/icons/bi/BiPause.js +0 -16
- package/dist/icons/bi/BiPlay.js +0 -16
- package/dist/icons/bi/BiRedo.js +0 -16
- package/dist/icons/bi/BiSolidCheckShield.js +0 -16
- package/dist/icons/bi/BiSolidTrashAlt.js +0 -16
- package/dist/icons/bi/BiStop.js +0 -16
- package/dist/icons/bi/BiUndo.js +0 -16
- package/dist/icons/bs/BsArrowsCollapse.js +0 -22
- package/dist/icons/bs/BsBank2.js +0 -19
- package/dist/icons/bs/BsBriefcase.js +0 -19
- package/dist/icons/bs/BsBucket.js +0 -19
- package/dist/icons/bs/BsCalendarX.js +0 -23
- package/dist/icons/bs/BsChatLeft.js +0 -19
- package/dist/icons/bs/BsChevronDoubleDown.js +0 -29
- package/dist/icons/bs/BsChevronDoubleUp.js +0 -29
- package/dist/icons/bs/BsClipboardCheck.js +0 -34
- package/dist/icons/bs/BsCurrencyDollar.js +0 -19
- package/dist/icons/bs/BsDash.js +0 -19
- package/dist/icons/bs/BsFileEarmarkZip.js +0 -23
- package/dist/icons/bs/BsFiles.js +0 -19
- package/dist/icons/bs/BsGeoAlt.js +0 -23
- package/dist/icons/bs/BsGrid.js +0 -19
- package/dist/icons/bs/BsLayers.js +0 -19
- package/dist/icons/bs/BsLayoutThreeColumns.js +0 -19
- package/dist/icons/bs/BsListUl.js +0 -22
- package/dist/icons/bs/BsMortarboard.js +0 -23
- package/dist/icons/bs/BsMusicNoteBeamed.js +0 -34
- package/dist/icons/bs/BsOpenai.js +0 -19
- package/dist/icons/bs/BsPersonPlus.js +0 -26
- package/dist/icons/bs/BsSearch.js +0 -19
- package/dist/icons/bs/BsSend.js +0 -19
- package/dist/icons/bs/BsShieldSlash.js +0 -22
- package/dist/icons/bs/BsStar.js +0 -19
- package/dist/icons/bs/BsStarFill.js +0 -19
- package/dist/icons/bs/BsStopCircle.js +0 -23
- package/dist/icons/bs/BsTag.js +0 -23
- package/dist/icons/bs/BsTelephone.js +0 -19
- package/dist/icons/bs/BsTerminal.js +0 -23
- package/dist/icons/bs/BsTerminalFill.js +0 -19
- package/dist/icons/bs/BsThreeDots.js +0 -19
- package/dist/icons/bs/BsThreeDotsVertical.js +0 -19
- package/dist/icons/bs/BsZoomIn.js +0 -37
- package/dist/icons/fa/FaAmazon.js +0 -16
- package/dist/icons/fa/FaAngleDown.js +0 -16
- package/dist/icons/fa/FaAngleLeft.js +0 -16
- package/dist/icons/fa/FaAngleRight.js +0 -16
- package/dist/icons/fa/FaAngleUp.js +0 -16
- package/dist/icons/fa/FaArrowDown.js +0 -16
- package/dist/icons/fa/FaArrowLeft.js +0 -16
- package/dist/icons/fa/FaArrowRight.js +0 -16
- package/dist/icons/fa/FaArrowUp.js +0 -16
- package/dist/icons/fa/FaBalanceScale.js +0 -16
- package/dist/icons/fa/FaCaretDown.js +0 -16
- package/dist/icons/fa/FaCentos.js +0 -16
- package/dist/icons/fa/FaChartLine.js +0 -16
- package/dist/icons/fa/FaChartPie.js +0 -16
- package/dist/icons/fa/FaCheck.js +0 -16
- package/dist/icons/fa/FaChevronDown.js +0 -16
- package/dist/icons/fa/FaChevronUp.js +0 -16
- package/dist/icons/fa/FaChrome.js +0 -16
- package/dist/icons/fa/FaCircleNotch.js +0 -16
- package/dist/icons/fa/FaCloud.js +0 -16
- package/dist/icons/fa/FaCloudDownloadAlt.js +0 -16
- package/dist/icons/fa/FaCog.js +0 -16
- package/dist/icons/fa/FaCogs.js +0 -16
- package/dist/icons/fa/FaComments.js +0 -16
- package/dist/icons/fa/FaCompress.js +0 -16
- package/dist/icons/fa/FaDesktop.js +0 -16
- package/dist/icons/fa/FaDocker.js +0 -16
- package/dist/icons/fa/FaDollarSign.js +0 -16
- package/dist/icons/fa/FaEdge.js +0 -16
- package/dist/icons/fa/FaEdit.js +0 -16
- package/dist/icons/fa/FaExclamationTriangle.js +0 -16
- package/dist/icons/fa/FaExpand.js +0 -16
- package/dist/icons/fa/FaEye.js +0 -16
- package/dist/icons/fa/FaEyeSlash.js +0 -16
- package/dist/icons/fa/FaFile.js +0 -16
- package/dist/icons/fa/FaFilePdf.js +0 -16
- package/dist/icons/fa/FaFilter.js +0 -16
- package/dist/icons/fa/FaFirefoxBrowser.js +0 -16
- package/dist/icons/fa/FaFlask.js +0 -16
- package/dist/icons/fa/FaFolder.js +0 -16
- package/dist/icons/fa/FaGithub.js +0 -16
- package/dist/icons/fa/FaGitlab.js +0 -16
- package/dist/icons/fa/FaGlobe.js +0 -16
- package/dist/icons/fa/FaGlobeAmericas.js +0 -16
- package/dist/icons/fa/FaImage.js +0 -16
- package/dist/icons/fa/FaInfoCircle.js +0 -16
- package/dist/icons/fa/FaKey.js +0 -16
- package/dist/icons/fa/FaLayerGroup.js +0 -16
- package/dist/icons/fa/FaLink.js +0 -16
- package/dist/icons/fa/FaLinkedin.js +0 -16
- package/dist/icons/fa/FaLinux.js +0 -16
- package/dist/icons/fa/FaList.js +0 -16
- package/dist/icons/fa/FaLock.js +0 -16
- package/dist/icons/fa/FaOpenid.js +0 -16
- package/dist/icons/fa/FaOpera.js +0 -16
- package/dist/icons/fa/FaPaperclip.js +0 -16
- package/dist/icons/fa/FaPlus.js +0 -16
- package/dist/icons/fa/FaPowerOff.js +0 -16
- package/dist/icons/fa/FaPrint.js +0 -16
- package/dist/icons/fa/FaQrcode.js +0 -16
- package/dist/icons/fa/FaQuestionCircle.js +0 -16
- package/dist/icons/fa/FaRedhat.js +0 -16
- package/dist/icons/fa/FaRegCircle.js +0 -16
- package/dist/icons/fa/FaRegFileImage.js +0 -16
- package/dist/icons/fa/FaRegFolder.js +0 -16
- package/dist/icons/fa/FaRobot.js +0 -16
- package/dist/icons/fa/FaRocket.js +0 -16
- package/dist/icons/fa/FaRunning.js +0 -16
- package/dist/icons/fa/FaSafari.js +0 -16
- package/dist/icons/fa/FaSave.js +0 -16
- package/dist/icons/fa/FaSearch.js +0 -16
- package/dist/icons/fa/FaShieldAlt.js +0 -16
- package/dist/icons/fa/FaSlack.js +0 -16
- package/dist/icons/fa/FaStar.js +0 -16
- package/dist/icons/fa/FaStop.js +0 -16
- package/dist/icons/fa/FaSuse.js +0 -16
- package/dist/icons/fa/FaTerminal.js +0 -16
- package/dist/icons/fa/FaTimes.js +0 -16
- package/dist/icons/fa/FaUbuntu.js +0 -16
- package/dist/icons/fa/FaUndoAlt.js +0 -16
- package/dist/icons/fa/FaUnlink.js +0 -16
- package/dist/icons/fa/FaUser.js +0 -16
- package/dist/icons/fa/FaUsers.js +0 -16
- package/dist/icons/fa/FaWindows.js +0 -16
- package/dist/icons/fa6/FaApple.js +0 -16
- package/dist/icons/fa6/FaArrowsRotate.js +0 -16
- package/dist/icons/fa6/FaDebian.js +0 -16
- package/dist/icons/fa6/FaFilterCircleXmark.js +0 -16
- package/dist/icons/fa6/FaInbox.js +0 -16
- package/dist/icons/fa6/FaLocationDot.js +0 -16
- package/dist/icons/fa6/FaRegFilePdf.js +0 -16
- package/dist/icons/fa6/FaRegFolderOpen.js +0 -16
- package/dist/icons/fa6/FaUpRightFromSquare.js +0 -16
- package/dist/icons/fa6/FaWandMagicSparkles.js +0 -16
- package/dist/icons/fa6/FaXTwitter.js +0 -16
- package/dist/icons/fi/FiActivity.js +0 -23
- package/dist/icons/fi/FiAlertCircle.js +0 -49
- package/dist/icons/fi/FiChevronDown.js +0 -23
- package/dist/icons/fi/FiClock.js +0 -31
- package/dist/icons/fi/FiCopy.js +0 -34
- package/dist/icons/fi/FiDownload.js +0 -40
- package/dist/icons/fi/FiFile.js +0 -27
- package/dist/icons/fi/FiFileText.js +0 -55
- package/dist/icons/fi/FiHardDrive.js +0 -55
- package/dist/icons/fi/FiRotateCcw.js +0 -27
- package/dist/icons/fi/FiUpload.js +0 -40
- package/dist/icons/fi/FiX.js +0 -37
- package/dist/icons/fi/FiZap.js +0 -23
- package/dist/icons/gi/GiSpy.js +0 -16
- package/dist/icons/go/GoGitCommit.js +0 -16
- package/dist/icons/go/GoGitPullRequest.js +0 -20
- package/dist/icons/go/GoIssueOpened.js +0 -16
- package/dist/icons/go/GoPlus.js +0 -16
- package/dist/icons/go/GoRepoForked.js +0 -28
- package/dist/icons/go/GoSignOut.js +0 -16
- package/dist/icons/go/GoSkip.js +0 -20
- package/dist/icons/go/GoVideo.js +0 -20
- package/dist/icons/gr/GrCloudComputer.js +0 -20
- package/dist/icons/gr/GrInbox.js +0 -20
- package/dist/icons/gr/GrServerCluster.js +0 -20
- package/dist/icons/gr/GrStorage.js +0 -20
- package/dist/icons/gr/GrTasks.js +0 -20
- package/dist/icons/hi/HiCog.js +0 -24
- package/dist/icons/hi/HiDuplicate.js +0 -24
- package/dist/icons/hi/HiOutlineArchive.js +0 -26
- package/dist/icons/hi/HiOutlineClipboardCopy.js +0 -26
- package/dist/icons/hi/HiOutlineHome.js +0 -26
- package/dist/icons/hi/HiQuestionMarkCircle.js +0 -24
- package/dist/icons/hi/HiServer.js +0 -24
- package/dist/icons/hi2/HiMiniCheckCircle.js +0 -24
- package/dist/icons/hi2/HiMiniLanguage.js +0 -28
- package/dist/icons/hi2/HiMiniMinusCircle.js +0 -24
- package/dist/icons/hi2/HiMiniXCircle.js +0 -24
- package/dist/icons/hi2/HiSparkles.js +0 -24
- package/dist/icons/im/ImSpinner5.js +0 -19
- package/dist/icons/io/IoIosNotifications.js +0 -16
- package/dist/icons/io/IoMdBuild.js +0 -16
- package/dist/icons/io/IoMdClose.js +0 -16
- package/dist/icons/io5/IoCloudUploadOutline.js +0 -32
- package/dist/icons/io5/IoDocumentTextOutline.js +0 -31
- package/dist/icons/io5/IoFileTrayFullOutline.js +0 -31
- package/dist/icons/io5/IoHeart.js +0 -16
- package/dist/icons/io5/IoHeartDislike.js +0 -16
- package/dist/icons/io5/IoHeartOutline.js +0 -22
- package/dist/icons/io5/IoInformationCircleOutline.js +0 -50
- package/dist/icons/io5/IoSettingsOutline.js +0 -22
- package/dist/icons/io5/IoWarningOutline.js +0 -40
- package/dist/icons/lu/LuArrowRight.js +0 -27
- package/dist/icons/lu/LuBadgeCheck.js +0 -27
- package/dist/icons/lu/LuBraces.js +0 -27
- package/dist/icons/lu/LuBrainCircuit.js +0 -101
- package/dist/icons/lu/LuCalendar.js +0 -46
- package/dist/icons/lu/LuCheck.js +0 -23
- package/dist/icons/lu/LuChevronLeft.js +0 -23
- package/dist/icons/lu/LuChevronRight.js +0 -23
- package/dist/icons/lu/LuCode.js +0 -27
- package/dist/icons/lu/LuExternalLink.js +0 -35
- package/dist/icons/lu/LuEye.js +0 -31
- package/dist/icons/lu/LuEyeOff.js +0 -40
- package/dist/icons/lu/LuFolderTree.js +0 -40
- package/dist/icons/lu/LuIdCard.js +0 -55
- package/dist/icons/lu/LuKeyboard.js +0 -71
- package/dist/icons/lu/LuLogs.js +0 -65
- package/dist/icons/lu/LuMail.js +0 -33
- package/dist/icons/lu/LuMegaphone.js +0 -27
- package/dist/icons/lu/LuMoon.js +0 -23
- package/dist/icons/lu/LuNetwork.js +0 -63
- package/dist/icons/lu/LuPartyPopper.js +0 -65
- package/dist/icons/lu/LuSettings2.js +0 -48
- package/dist/icons/lu/LuSheet.js +0 -72
- package/dist/icons/lu/LuShield.js +0 -23
- package/dist/icons/lu/LuSun.js +0 -69
- package/dist/icons/lu/LuTextCursorInput.js +0 -45
- package/dist/icons/lu/LuX.js +0 -27
- package/dist/icons/lu/LuZoomIn.js +0 -59
- package/dist/icons/lu/LuZoomOut.js +0 -49
- package/dist/icons/md/MdClear.js +0 -23
- package/dist/icons/md/MdDragHandle.js +0 -23
- package/dist/icons/md/MdInstallDesktop.js +0 -31
- package/dist/icons/md/MdOutlineAttachMoney.js +0 -23
- package/dist/icons/md/MdOutlineMoneyOff.js +0 -23
- package/dist/icons/md/MdPieChart.js +0 -23
- package/dist/icons/md/MdRefresh.js +0 -23
- package/dist/icons/md/MdReplay.js +0 -23
- package/dist/icons/md/MdSmartphone.js +0 -23
- package/dist/icons/pi/PiArrowBendUpRightBold.js +0 -19
- package/dist/icons/pi/PiPlugsConnectedFill.js +0 -19
- package/dist/icons/pi/PiRectangleDashed.js +0 -19
- package/dist/icons/pi/PiShareBold.js +0 -19
- package/dist/icons/si/SiAnthropic.js +0 -19
- package/dist/icons/si/SiHelm.js +0 -19
- package/dist/icons/si/SiKubernetes.js +0 -19
- package/dist/icons/tb/TbAlertTriangle.js +0 -35
- package/dist/icons/tb/TbAlertTriangleFilled.js +0 -19
- package/dist/icons/tb/TbApi.js +0 -40
- package/dist/icons/tb/TbBrain.js +0 -50
- package/dist/icons/tb/TbBuildingTunnel.js +0 -65
- package/dist/icons/tb/TbEdit.js +0 -35
- package/dist/icons/tb/TbLayoutSidebar.js +0 -27
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +0 -35
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +0 -35
- package/dist/icons/tb/TbUser.js +0 -27
- package/dist/icons/tb/TbUserOff.js +0 -35
- package/dist/icons/tb/TbWorldShare.js +0 -55
- package/dist/icons/tb/TbWorldWww.js +0 -65
- package/dist/icons/ti/TiArrowSortedDown.js +0 -20
- package/dist/icons/ti/TiArrowSortedUp.js +0 -20
- package/dist/icons/ti/TiArrowUnsorted.js +0 -20
- package/dist/icons/ti/TiCancel.js +0 -20
- package/dist/icons/vsc/VscChromeMinimize.js +0 -19
- package/dist/icons/vsc/VscJson.js +0 -19
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +0 -19
- package/dist/icons/vsc/VscPass.js +0 -27
- package/dist/icons/vsc/VscSplitHorizontal.js +0 -19
- package/dist/icons/vsc/VscTerminalPowershell.js +0 -19
- package/dist/list/ListPager.d.ts +0 -14
- package/dist/list/ListPager.js +0 -62
- package/dist/list/textEntry.d.ts +0 -2
- package/dist/list/textEntry.js +0 -10
- /package/dist/{ai/ui/codeBreaks.d.ts → components/markdownCodeBreaks.d.ts} +0 -0
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
interface: ThemeSeed;
|
|
16
|
-
sidebar?: ThemeSeed;
|
|
17
|
-
}
|
|
18
|
-
export declare function contrastRatio(a: string, b: string): number;
|
|
19
|
-
/** Uses the WCAG luminance threshold 0.179, matching how org themes classify backgrounds. */
|
|
20
|
-
export declare function isDarkColor(hex: string): boolean;
|
|
21
|
-
export declare function deriveTheme(seed: ThemeSeed | SurfaceSeeds): ThemeVariables;
|
|
22
|
-
export interface ThemePreset {
|
|
23
|
-
name: string;
|
|
24
|
-
label: string;
|
|
25
|
-
seed: SurfaceSeeds;
|
|
26
|
-
}
|
|
27
|
-
export declare const THEME_PRESETS: readonly ThemePreset[];
|
|
28
|
-
export declare const DEFAULT_PRESET: ThemePreset;
|
|
29
|
-
export declare function applyTheme(el: HTMLElement, vars: Partial<ThemeVariables>): void;
|
|
1
|
+
import type { GeneratedTheme, ThemeVariables } from './derive.js';
|
|
2
|
+
export { composite, deltaE, type Gamut, JND, type Oklch, parseColor, toHex, toP3, } from './color.js';
|
|
3
|
+
export { apcaContrast, type ContrastTarget, contrastRatio, isDarkColor } from './contrast.js';
|
|
4
|
+
export { type DeriveOptions, deriveTheme, type GeneratedTheme, generateTheme, SIDEBAR_TOKENS, THEME_TOKENS, type ThemeToken, type ThemeVariables, themeStylesheet, } from './derive.js';
|
|
5
|
+
export { type FitOptions, type FitReport, type FitResult, type FitToken, fitSeed } from './fit.js';
|
|
6
|
+
export { CODE_STYLES, type CodeStyle, type ColorPreference, DEFAULT_CONTRAST, DEFAULT_PRESET, DEFAULT_THEME, type Mode, modeOf, parseTheme, resolveMode, type Scheme, type Seed, schemeFor, serializeTheme, THEME_PRESETS, type Theme, type ThemeParseError, type ThemeParseResult, type ThemePreset, } from './model.js';
|
|
7
|
+
/** Whether the screen shows display-p3, so wide-gamut values are worth setting. */
|
|
8
|
+
export declare function prefersWideGamut(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Sets tokens on an element, such as the document root or a preview pane.
|
|
11
|
+
* Given a generated theme, it sets the sRGB values and, on a wide-gamut screen,
|
|
12
|
+
* the display-p3 ones over them; inline values can't carry a media query.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyTheme(el: HTMLElement, theme: Partial<ThemeVariables> | GeneratedTheme, wide?: boolean): void;
|
package/dist/theme/index.js
CHANGED
|
@@ -1,283 +1,24 @@
|
|
|
1
|
+
import { JND, composite, deltaE, parseColor, toHex, toP3 } from "./color.js";
|
|
2
|
+
import { apcaContrast, contrastRatio, isDarkColor } from "./contrast.js";
|
|
3
|
+
import { CODE_STYLES, DEFAULT_CONTRAST, DEFAULT_PRESET, DEFAULT_THEME, THEME_PRESETS, modeOf, parseTheme, resolveMode, schemeFor, serializeTheme } from "./model.js";
|
|
4
|
+
import { SIDEBAR_TOKENS, THEME_TOKENS, deriveTheme, generateTheme, themeStylesheet } from "./derive.js";
|
|
5
|
+
import { fitSeed } from "./fit.js";
|
|
1
6
|
//#region src/theme/index.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"--theme-link",
|
|
17
|
-
"--theme-input-bg",
|
|
18
|
-
"--theme-input",
|
|
19
|
-
"--theme-input-disabled-bg",
|
|
20
|
-
"--theme-input-disabled-text",
|
|
21
|
-
"--theme-card-bg",
|
|
22
|
-
"--theme-card-border",
|
|
23
|
-
"--theme-card-hover",
|
|
24
|
-
"--theme-accent",
|
|
25
|
-
"--theme-accent-text",
|
|
26
|
-
"--theme-focus-ring",
|
|
27
|
-
"--theme-hover-overlay",
|
|
28
|
-
"--theme-success",
|
|
29
|
-
"--theme-success-muted",
|
|
30
|
-
"--theme-error",
|
|
31
|
-
"--theme-error-muted",
|
|
32
|
-
"--theme-warning",
|
|
33
|
-
"--theme-warning-muted",
|
|
34
|
-
"--theme-info",
|
|
35
|
-
"--theme-info-muted",
|
|
36
|
-
"--theme-favorite",
|
|
37
|
-
"--theme-favorite-muted",
|
|
38
|
-
"--theme-shadow-sm",
|
|
39
|
-
"--theme-shadow",
|
|
40
|
-
"--theme-shadow-lg",
|
|
41
|
-
"--theme-auth-shadow",
|
|
42
|
-
"--theme-bg",
|
|
43
|
-
"--theme-sidebar-text",
|
|
44
|
-
"--theme-sidebar-hover",
|
|
45
|
-
"--theme-sidebar-hover-text",
|
|
46
|
-
"--theme-sidebar-active-bg",
|
|
47
|
-
"--theme-sidebar-active-text"
|
|
48
|
-
];
|
|
49
|
-
function parseHex(hex) {
|
|
50
|
-
const [, r, g, b] = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) ?? [];
|
|
51
|
-
if (r === void 0 || g === void 0 || b === void 0) throw new Error(`Invalid hex color: ${hex}`);
|
|
52
|
-
return [
|
|
53
|
-
Number.parseInt(r, 16),
|
|
54
|
-
Number.parseInt(g, 16),
|
|
55
|
-
Number.parseInt(b, 16)
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
function toHex([r, g, b]) {
|
|
59
|
-
const c = (v) => Math.max(0, Math.min(255, Math.round(v))).toString(16).padStart(2, "0");
|
|
60
|
-
return `#${c(r)}${c(g)}${c(b)}`;
|
|
61
|
-
}
|
|
62
|
-
/** Linear interpolation from `a` toward `b` by `t` in sRGB. */
|
|
63
|
-
function mix(a, b, t) {
|
|
64
|
-
const ca = parseHex(a);
|
|
65
|
-
const cb = parseHex(b);
|
|
66
|
-
return toHex([
|
|
67
|
-
ca[0] + (cb[0] - ca[0]) * t,
|
|
68
|
-
ca[1] + (cb[1] - ca[1]) * t,
|
|
69
|
-
ca[2] + (cb[2] - ca[2]) * t
|
|
70
|
-
]);
|
|
71
|
-
}
|
|
72
|
-
function alpha(hex, a) {
|
|
73
|
-
const [r, g, b] = parseHex(hex);
|
|
74
|
-
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
75
|
-
}
|
|
76
|
-
function relativeLuminance(hex) {
|
|
77
|
-
const toLinear = (v) => {
|
|
78
|
-
const s = v / 255;
|
|
79
|
-
return s <= .03928 ? s / 12.92 : ((s + .055) / 1.055) ** 2.4;
|
|
80
|
-
};
|
|
81
|
-
const [r, g, b] = parseHex(hex);
|
|
82
|
-
return .2126 * toLinear(r) + .7152 * toLinear(g) + .0722 * toLinear(b);
|
|
83
|
-
}
|
|
84
|
-
function contrastRatio(a, b) {
|
|
85
|
-
const la = relativeLuminance(a);
|
|
86
|
-
const lb = relativeLuminance(b);
|
|
87
|
-
const [hi, lo] = la > lb ? [la, lb] : [lb, la];
|
|
88
|
-
return (hi + .05) / (lo + .05);
|
|
89
|
-
}
|
|
90
|
-
/** Uses the WCAG luminance threshold 0.179, matching how org themes classify backgrounds. */
|
|
91
|
-
function isDarkColor(hex) {
|
|
92
|
-
return relativeLuminance(hex) < .179;
|
|
93
|
-
}
|
|
94
|
-
/** White or black, whichever reads better on the given color. */
|
|
95
|
-
function readableOn(hex) {
|
|
96
|
-
return contrastRatio(hex, "#ffffff") >= contrastRatio(hex, "#000000") ? "#ffffff" : "#000000";
|
|
97
|
-
}
|
|
98
|
-
/** Nudges `color` toward the readable pole of `bg` until it clears `ratio`. */
|
|
99
|
-
function ensureReadable(color, bg, ratio) {
|
|
100
|
-
const pole = isDarkColor(bg) ? "#ffffff" : "#000000";
|
|
101
|
-
let out = color;
|
|
102
|
-
for (let t = 0; t <= 1 && contrastRatio(out, bg) < ratio; t += .05) out = mix(color, pole, t);
|
|
103
|
-
return out;
|
|
104
|
-
}
|
|
105
|
-
function clampContrast(contrast) {
|
|
106
|
-
return Math.max(.25, Math.min(2, contrast ?? 1));
|
|
107
|
-
}
|
|
108
|
-
var STATUS_HUES = {
|
|
109
|
-
success: {
|
|
110
|
-
onLight: "#16a34a",
|
|
111
|
-
onDark: "#22c55e"
|
|
112
|
-
},
|
|
113
|
-
error: {
|
|
114
|
-
onLight: "#dc2626",
|
|
115
|
-
onDark: "#ef4444"
|
|
116
|
-
},
|
|
117
|
-
warning: {
|
|
118
|
-
onLight: "#d97706",
|
|
119
|
-
onDark: "#f59e0b"
|
|
120
|
-
},
|
|
121
|
-
info: {
|
|
122
|
-
onLight: "#2563eb",
|
|
123
|
-
onDark: "#3b82f6"
|
|
124
|
-
},
|
|
125
|
-
favorite: {
|
|
126
|
-
onLight: "#e11d48",
|
|
127
|
-
onDark: "#f43f5e"
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
function deriveSidebar(seed) {
|
|
131
|
-
const bg = seed.background;
|
|
132
|
-
const c = clampContrast(seed.contrast);
|
|
133
|
-
const dark = isDarkColor(bg);
|
|
134
|
-
const pole = dark ? "#ffffff" : "#000000";
|
|
135
|
-
const text = mix(pole, bg, Math.max(0, 1 - c) * .5);
|
|
136
|
-
const hover = mix(bg, pole, .12 * c);
|
|
137
|
-
const activeBg = dark ? mix(seed.accent, "#ffffff", .85) : seed.accent;
|
|
138
|
-
return {
|
|
139
|
-
bg,
|
|
140
|
-
text,
|
|
141
|
-
hover,
|
|
142
|
-
hoverText: text,
|
|
143
|
-
activeBg,
|
|
144
|
-
activeText: readableOn(activeBg)
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function authShadow(dark) {
|
|
148
|
-
const [far, near] = dark ? [.6, .4] : [.2, .1];
|
|
149
|
-
return `0 25px 80px -20px rgba(0, 0, 0, ${far}), 0 10px 30px -10px rgba(0, 0, 0, ${near})`;
|
|
150
|
-
}
|
|
151
|
-
function deriveTheme(seed) {
|
|
152
|
-
const surfaces = "interface" in seed ? seed : { interface: seed };
|
|
153
|
-
const { accent, background: bg } = surfaces.interface;
|
|
154
|
-
const c = clampContrast(surfaces.interface.contrast);
|
|
155
|
-
const dark = isDarkColor(bg);
|
|
156
|
-
const pole = dark ? "#ffffff" : "#000000";
|
|
157
|
-
const fg = mix(pole, bg, Math.max(0, 1 - c) * .5);
|
|
158
|
-
const panelBg = dark ? mix(bg, "#ffffff", .045) : mix(bg, "#ffffff", .8);
|
|
159
|
-
const mutedPanelBg = dark ? mix(bg, "#ffffff", .09) : mix(bg, "#ffffff", .5);
|
|
160
|
-
const border = mix(bg, pole, (dark ? .16 : .16) * c);
|
|
161
|
-
const mutedText = mix(fg, bg, .42);
|
|
162
|
-
const hover = dark ? mix(bg, "#ffffff", .08) : mix(bg, "#000000", .04);
|
|
163
|
-
const inputBg = dark ? mix(bg, "#ffffff", .08) : mix(bg, "#ffffff", .65);
|
|
164
|
-
const link = ensureReadable(accent, bg, 4.5);
|
|
165
|
-
const accentText = surfaces.interface.accentText ?? readableOn(accent);
|
|
166
|
-
const accentHover = mix(accent, pole, .1);
|
|
167
|
-
const cardBg = panelBg;
|
|
168
|
-
let sidebarBg = panelBg;
|
|
169
|
-
if (!dark) sidebarBg = isDarkColor(accent) ? accent : mix(accent, "#000000", .4);
|
|
170
|
-
const sidebar = deriveSidebar(surfaces.sidebar ?? {
|
|
171
|
-
accent,
|
|
172
|
-
background: sidebarBg,
|
|
173
|
-
contrast: c
|
|
174
|
-
});
|
|
175
|
-
const status = (name) => ensureReadable(dark ? STATUS_HUES[name].onDark : STATUS_HUES[name].onLight, bg, 3);
|
|
176
|
-
const shadowInk = dark ? .35 : .07;
|
|
177
|
-
return {
|
|
178
|
-
"--theme-app-bg": bg,
|
|
179
|
-
"--theme-app": fg,
|
|
180
|
-
"--theme-panel-bg": panelBg,
|
|
181
|
-
"--theme-panel": fg,
|
|
182
|
-
"--theme-muted-panel-bg": mutedPanelBg,
|
|
183
|
-
"--theme-muted-panel-color": mutedText,
|
|
184
|
-
"--theme-muted-text-color": mutedText,
|
|
185
|
-
"--theme-border": border,
|
|
186
|
-
"--theme-element": accent,
|
|
187
|
-
"--theme-element-text": accentText,
|
|
188
|
-
"--theme-element-hover": accentHover,
|
|
189
|
-
"--theme-hover": hover,
|
|
190
|
-
"--theme-hover-text": fg,
|
|
191
|
-
"--theme-link": link,
|
|
192
|
-
"--theme-input-bg": inputBg,
|
|
193
|
-
"--theme-input": link,
|
|
194
|
-
"--theme-input-disabled-bg": mix(inputBg, bg, .5),
|
|
195
|
-
"--theme-input-disabled-text": mix(fg, bg, .6),
|
|
196
|
-
"--theme-card-bg": cardBg,
|
|
197
|
-
"--theme-card-border": alpha(pole, dark ? .06 : .04),
|
|
198
|
-
"--theme-card-hover": dark ? mix(cardBg, "#ffffff", .05) : mix(cardBg, "#000000", .02),
|
|
199
|
-
"--theme-accent": accent,
|
|
200
|
-
"--theme-accent-text": accentText,
|
|
201
|
-
"--theme-focus-ring": alpha(link, dark ? .25 : .2),
|
|
202
|
-
"--theme-hover-overlay": alpha(pole, dark ? .03 : .02),
|
|
203
|
-
"--theme-success": status("success"),
|
|
204
|
-
"--theme-success-muted": alpha(status("success"), dark ? .15 : .1),
|
|
205
|
-
"--theme-error": status("error"),
|
|
206
|
-
"--theme-error-muted": alpha(status("error"), dark ? .15 : .1),
|
|
207
|
-
"--theme-warning": status("warning"),
|
|
208
|
-
"--theme-warning-muted": alpha(status("warning"), dark ? .15 : .1),
|
|
209
|
-
"--theme-info": status("info"),
|
|
210
|
-
"--theme-info-muted": alpha(status("info"), dark ? .15 : .1),
|
|
211
|
-
"--theme-favorite": status("favorite"),
|
|
212
|
-
"--theme-favorite-muted": alpha(status("favorite"), dark ? .15 : .1),
|
|
213
|
-
"--theme-shadow-sm": `0 1px 2px rgba(0, 0, 0, ${shadowInk})`,
|
|
214
|
-
"--theme-shadow": `0 4px 6px -1px rgba(0, 0, 0, ${shadowInk}), 0 2px 4px -2px rgba(0, 0, 0, ${shadowInk})`,
|
|
215
|
-
"--theme-shadow-lg": `0 10px 15px -3px rgba(0, 0, 0, ${shadowInk}), 0 4px 6px -4px rgba(0, 0, 0, ${shadowInk})`,
|
|
216
|
-
"--theme-auth-shadow": authShadow(dark),
|
|
217
|
-
"--theme-bg": sidebar.bg,
|
|
218
|
-
"--theme-sidebar-text": sidebar.text,
|
|
219
|
-
"--theme-sidebar-hover": sidebar.hover,
|
|
220
|
-
"--theme-sidebar-hover-text": sidebar.hoverText,
|
|
221
|
-
"--theme-sidebar-active-bg": sidebar.activeBg,
|
|
222
|
-
"--theme-sidebar-active-text": sidebar.activeText
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
var THEME_PRESETS = [
|
|
226
|
-
{
|
|
227
|
-
name: "navy",
|
|
228
|
-
label: "Navy",
|
|
229
|
-
seed: {
|
|
230
|
-
interface: {
|
|
231
|
-
accent: "#06354f",
|
|
232
|
-
background: "#f3f4f6"
|
|
233
|
-
},
|
|
234
|
-
sidebar: {
|
|
235
|
-
accent: "#06354f",
|
|
236
|
-
background: "#06354f"
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
name: "light",
|
|
242
|
-
label: "Light",
|
|
243
|
-
seed: { interface: {
|
|
244
|
-
accent: "#0d6efd",
|
|
245
|
-
background: "#ffffff",
|
|
246
|
-
accentText: "#ffffff"
|
|
247
|
-
} }
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: "dark",
|
|
251
|
-
label: "Dark",
|
|
252
|
-
seed: {
|
|
253
|
-
interface: {
|
|
254
|
-
accent: "#2f81f7",
|
|
255
|
-
background: "#0d1117"
|
|
256
|
-
},
|
|
257
|
-
sidebar: {
|
|
258
|
-
accent: "#2f81f7",
|
|
259
|
-
background: "#161b22"
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
name: "rose-pine",
|
|
265
|
-
label: "Rosé Pine",
|
|
266
|
-
seed: {
|
|
267
|
-
interface: {
|
|
268
|
-
accent: "#c4a7e7",
|
|
269
|
-
background: "#191724"
|
|
270
|
-
},
|
|
271
|
-
sidebar: {
|
|
272
|
-
accent: "#c4a7e7",
|
|
273
|
-
background: "#1f1d2e"
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
];
|
|
278
|
-
var DEFAULT_PRESET = THEME_PRESETS[0];
|
|
279
|
-
function applyTheme(el, vars) {
|
|
7
|
+
/** Whether the screen shows display-p3, so wide-gamut values are worth setting. */
|
|
8
|
+
function prefersWideGamut() {
|
|
9
|
+
return typeof matchMedia === "function" && matchMedia("(color-gamut: p3)").matches;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Sets tokens on an element, such as the document root or a preview pane.
|
|
13
|
+
* Given a generated theme, it sets the sRGB values and, on a wide-gamut screen,
|
|
14
|
+
* the display-p3 ones over them; inline values can't carry a media query.
|
|
15
|
+
*/
|
|
16
|
+
function applyTheme(el, theme, wide = prefersWideGamut()) {
|
|
17
|
+
const vars = "srgb" in theme && typeof theme.srgb === "object" ? {
|
|
18
|
+
...theme.srgb,
|
|
19
|
+
...wide ? theme.p3 : {}
|
|
20
|
+
} : theme;
|
|
280
21
|
for (const [token, value] of Object.entries(vars)) if (value !== void 0) el.style.setProperty(token, value);
|
|
281
22
|
}
|
|
282
23
|
//#endregion
|
|
283
|
-
export { DEFAULT_PRESET, THEME_PRESETS, THEME_TOKENS, applyTheme, contrastRatio, deriveTheme, isDarkColor };
|
|
24
|
+
export { CODE_STYLES, DEFAULT_CONTRAST, DEFAULT_PRESET, DEFAULT_THEME, JND, SIDEBAR_TOKENS, THEME_PRESETS, THEME_TOKENS, apcaContrast, applyTheme, composite, contrastRatio, deltaE, deriveTheme, fitSeed, generateTheme, isDarkColor, modeOf, parseColor, parseTheme, prefersWideGamut, resolveMode, schemeFor, serializeTheme, themeStylesheet, toHex, toP3 };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type Mode = 'light' | 'dark';
|
|
2
|
+
/** What a person prefers: one mode, or whichever the device asks for. */
|
|
3
|
+
export type ColorPreference = Mode | 'system';
|
|
4
|
+
/** How strongly the code theme colors syntax. */
|
|
5
|
+
export type CodeStyle = 'balanced' | 'vivid' | 'muted' | 'mono';
|
|
6
|
+
export declare const CODE_STYLES: readonly CodeStyle[];
|
|
7
|
+
/** The three choices a surface is generated from. */
|
|
8
|
+
export interface Seed {
|
|
9
|
+
/** The background, as a hex or `oklch()`. Its lightness sets light or dark; its hue tints every neutral. */
|
|
10
|
+
base: string;
|
|
11
|
+
/** The brand color, as a hex or `oklch()`. Filled buttons show it exactly. */
|
|
12
|
+
accent: string;
|
|
13
|
+
/** 0–100, 30 by default. Raises the separation of surfaces and borders and the contrast of text; text never drops below WCAG AA. */
|
|
14
|
+
contrast?: number;
|
|
15
|
+
}
|
|
16
|
+
/** A theme in one mode: the page's seed, and the sidebar's own base or accent when it has them. */
|
|
17
|
+
export interface Scheme {
|
|
18
|
+
interface: Seed;
|
|
19
|
+
sidebar?: {
|
|
20
|
+
base?: string;
|
|
21
|
+
accent?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** A theme for both modes, as a host stores it and a person copies it. A missing mode is derived from the other. */
|
|
25
|
+
export interface Theme {
|
|
26
|
+
version: 1;
|
|
27
|
+
light?: Scheme;
|
|
28
|
+
dark?: Scheme;
|
|
29
|
+
/** How the code theme colors syntax; balanced by default. */
|
|
30
|
+
code?: CodeStyle;
|
|
31
|
+
}
|
|
32
|
+
export declare const DEFAULT_CONTRAST = 30;
|
|
33
|
+
export interface ThemePreset {
|
|
34
|
+
name: string;
|
|
35
|
+
label: string;
|
|
36
|
+
theme: Theme;
|
|
37
|
+
}
|
|
38
|
+
export declare const THEME_PRESETS: readonly ThemePreset[];
|
|
39
|
+
export declare const DEFAULT_PRESET: ThemePreset;
|
|
40
|
+
export declare const DEFAULT_THEME: Theme;
|
|
41
|
+
/** The mode a scheme renders in, read from its base. */
|
|
42
|
+
export declare function modeOf(scheme: Scheme): Mode;
|
|
43
|
+
/** The mode a preference resolves to. */
|
|
44
|
+
export declare function resolveMode(preference: ColorPreference, prefersDark: boolean): Mode;
|
|
45
|
+
/** The scheme a theme has for a mode, derived from its other mode when it has none,
|
|
46
|
+
* and from the default theme when it has neither. */
|
|
47
|
+
export declare function schemeFor(theme: Theme | undefined, mode: Mode): Scheme;
|
|
48
|
+
/** Why a pasted theme was refused, and where. */
|
|
49
|
+
export interface ThemeParseError {
|
|
50
|
+
code: 'json' | 'version' | 'shape' | 'color' | 'range';
|
|
51
|
+
/** The field at fault, such as `light.interface.accent`. */
|
|
52
|
+
path: string;
|
|
53
|
+
}
|
|
54
|
+
export type ThemeParseResult = {
|
|
55
|
+
ok: true;
|
|
56
|
+
theme: Theme;
|
|
57
|
+
} | {
|
|
58
|
+
ok: false;
|
|
59
|
+
error: ThemeParseError;
|
|
60
|
+
};
|
|
61
|
+
/** Reads a theme from JSON text or a parsed value, such as a paste or a stored row. Never throws. */
|
|
62
|
+
export declare function parseTheme(input: unknown): ThemeParseResult;
|
|
63
|
+
/** A theme as small, stable JSON: what a host stores and a person copies. */
|
|
64
|
+
export declare function serializeTheme(theme: Theme): string;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { oklch, parseColor, toHex } from "./color.js";
|
|
2
|
+
import { isDarkColor } from "./contrast.js";
|
|
3
|
+
//#region src/theme/model.ts
|
|
4
|
+
var CODE_STYLES = [
|
|
5
|
+
"balanced",
|
|
6
|
+
"vivid",
|
|
7
|
+
"muted",
|
|
8
|
+
"mono"
|
|
9
|
+
];
|
|
10
|
+
var DEFAULT_CONTRAST = 30;
|
|
11
|
+
var THEME_PRESETS = [
|
|
12
|
+
{
|
|
13
|
+
name: "navy",
|
|
14
|
+
label: "Navy",
|
|
15
|
+
theme: {
|
|
16
|
+
version: 1,
|
|
17
|
+
light: {
|
|
18
|
+
interface: {
|
|
19
|
+
base: "#f3f4f6",
|
|
20
|
+
accent: "#06354f"
|
|
21
|
+
},
|
|
22
|
+
sidebar: { base: "#06354f" }
|
|
23
|
+
},
|
|
24
|
+
dark: { interface: {
|
|
25
|
+
base: "#111418",
|
|
26
|
+
accent: "#5b9ccf"
|
|
27
|
+
} }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "light",
|
|
32
|
+
label: "Light",
|
|
33
|
+
theme: {
|
|
34
|
+
version: 1,
|
|
35
|
+
light: { interface: {
|
|
36
|
+
base: "#ffffff",
|
|
37
|
+
accent: "#0d6efd"
|
|
38
|
+
} }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "dark",
|
|
43
|
+
label: "Dark",
|
|
44
|
+
theme: {
|
|
45
|
+
version: 1,
|
|
46
|
+
dark: {
|
|
47
|
+
interface: {
|
|
48
|
+
base: "#0d1117",
|
|
49
|
+
accent: "#2f81f7"
|
|
50
|
+
},
|
|
51
|
+
sidebar: { base: "#161b22" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "rose-pine",
|
|
57
|
+
label: "Rosé Pine",
|
|
58
|
+
theme: {
|
|
59
|
+
version: 1,
|
|
60
|
+
dark: {
|
|
61
|
+
interface: {
|
|
62
|
+
base: "#191724",
|
|
63
|
+
accent: "#c4a7e7"
|
|
64
|
+
},
|
|
65
|
+
sidebar: { base: "#1f1d2e" }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
var DEFAULT_PRESET = THEME_PRESETS[0];
|
|
71
|
+
var DEFAULT_THEME = DEFAULT_PRESET.theme;
|
|
72
|
+
/** The mode a scheme renders in, read from its base. */
|
|
73
|
+
function modeOf(scheme) {
|
|
74
|
+
return isDarkColor(toHex(oklch(scheme.interface.base))) ? "dark" : "light";
|
|
75
|
+
}
|
|
76
|
+
/** The mode a preference resolves to. */
|
|
77
|
+
function resolveMode(preference, prefersDark) {
|
|
78
|
+
if (preference === "system") return prefersDark ? "dark" : "light";
|
|
79
|
+
return preference;
|
|
80
|
+
}
|
|
81
|
+
var ANCHOR = {
|
|
82
|
+
light: .985,
|
|
83
|
+
dark: .19
|
|
84
|
+
};
|
|
85
|
+
/** One scheme carried into the other mode: the base keeps its hue and tint at the
|
|
86
|
+
* other mode's lightness, the accent and contrast carry over, and the sidebar
|
|
87
|
+
* falls back to its derived default since its relation to the page doesn't flip. */
|
|
88
|
+
function carry(scheme, mode) {
|
|
89
|
+
const base = oklch(scheme.interface.base);
|
|
90
|
+
const sidebarAccent = scheme.sidebar?.accent;
|
|
91
|
+
return {
|
|
92
|
+
interface: {
|
|
93
|
+
...scheme.interface,
|
|
94
|
+
base: toHex({
|
|
95
|
+
...base,
|
|
96
|
+
l: ANCHOR[mode],
|
|
97
|
+
c: Math.min(base.c, mode === "dark" ? .03 : .02)
|
|
98
|
+
})
|
|
99
|
+
},
|
|
100
|
+
...sidebarAccent ? { sidebar: { accent: sidebarAccent } } : {}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** The scheme a theme has for a mode, derived from its other mode when it has none,
|
|
104
|
+
* and from the default theme when it has neither. */
|
|
105
|
+
function schemeFor(theme, mode) {
|
|
106
|
+
const own = theme?.[mode];
|
|
107
|
+
if (own) return own;
|
|
108
|
+
const other = theme?.[mode === "light" ? "dark" : "light"];
|
|
109
|
+
if (other) return carry(other, mode);
|
|
110
|
+
return schemeFor(DEFAULT_THEME, mode);
|
|
111
|
+
}
|
|
112
|
+
var isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
113
|
+
/** Reads a theme from JSON text or a parsed value, such as a paste or a stored row. Never throws. */
|
|
114
|
+
function parseTheme(input) {
|
|
115
|
+
let value = input;
|
|
116
|
+
if (typeof input === "string") try {
|
|
117
|
+
value = JSON.parse(input);
|
|
118
|
+
} catch {
|
|
119
|
+
return {
|
|
120
|
+
ok: false,
|
|
121
|
+
error: {
|
|
122
|
+
code: "json",
|
|
123
|
+
path: ""
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
if (!isRecord(value)) return {
|
|
128
|
+
ok: false,
|
|
129
|
+
error: {
|
|
130
|
+
code: "shape",
|
|
131
|
+
path: ""
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
if (value.version !== 1) return {
|
|
135
|
+
ok: false,
|
|
136
|
+
error: {
|
|
137
|
+
code: "version",
|
|
138
|
+
path: "version"
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const theme = { version: 1 };
|
|
142
|
+
const fail = (code, path) => ({
|
|
143
|
+
ok: false,
|
|
144
|
+
error: {
|
|
145
|
+
code,
|
|
146
|
+
path
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const color = (v, path) => {
|
|
150
|
+
if (typeof v !== "string") return fail("shape", path);
|
|
151
|
+
return parseColor(v) ? v.trim() : fail("color", path);
|
|
152
|
+
};
|
|
153
|
+
for (const mode of ["light", "dark"]) {
|
|
154
|
+
const scheme = value[mode];
|
|
155
|
+
if (scheme === void 0) continue;
|
|
156
|
+
if (!isRecord(scheme) || !isRecord(scheme.interface)) return fail("shape", `${mode}.interface`);
|
|
157
|
+
const at = `${mode}.interface`;
|
|
158
|
+
const base = color(scheme.interface.base, `${at}.base`);
|
|
159
|
+
if (typeof base !== "string") return base;
|
|
160
|
+
const accent = color(scheme.interface.accent, `${at}.accent`);
|
|
161
|
+
if (typeof accent !== "string") return accent;
|
|
162
|
+
const seed = {
|
|
163
|
+
base,
|
|
164
|
+
accent
|
|
165
|
+
};
|
|
166
|
+
const contrast = scheme.interface.contrast;
|
|
167
|
+
if (contrast !== void 0) {
|
|
168
|
+
if (typeof contrast !== "number" || !Number.isFinite(contrast)) return fail("shape", `${at}.contrast`);
|
|
169
|
+
if (contrast < 0 || contrast > 100) return fail("range", `${at}.contrast`);
|
|
170
|
+
seed.contrast = contrast;
|
|
171
|
+
}
|
|
172
|
+
const parsed = { interface: seed };
|
|
173
|
+
if (scheme.sidebar !== void 0) {
|
|
174
|
+
if (!isRecord(scheme.sidebar)) return fail("shape", `${mode}.sidebar`);
|
|
175
|
+
parsed.sidebar = {};
|
|
176
|
+
if (scheme.sidebar.base !== void 0) {
|
|
177
|
+
const sidebarBase = color(scheme.sidebar.base, `${mode}.sidebar.base`);
|
|
178
|
+
if (typeof sidebarBase !== "string") return sidebarBase;
|
|
179
|
+
parsed.sidebar.base = sidebarBase;
|
|
180
|
+
}
|
|
181
|
+
if (scheme.sidebar.accent !== void 0) {
|
|
182
|
+
const sidebarAccent = color(scheme.sidebar.accent, `${mode}.sidebar.accent`);
|
|
183
|
+
if (typeof sidebarAccent !== "string") return sidebarAccent;
|
|
184
|
+
parsed.sidebar.accent = sidebarAccent;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
theme[mode] = parsed;
|
|
188
|
+
}
|
|
189
|
+
if (value.code !== void 0) {
|
|
190
|
+
if (!CODE_STYLES.includes(value.code)) return fail("range", "code");
|
|
191
|
+
theme.code = value.code;
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
ok: true,
|
|
195
|
+
theme
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/** A theme as small, stable JSON: what a host stores and a person copies. */
|
|
199
|
+
function serializeTheme(theme) {
|
|
200
|
+
const scheme = (s) => s && {
|
|
201
|
+
interface: {
|
|
202
|
+
base: s.interface.base,
|
|
203
|
+
accent: s.interface.accent,
|
|
204
|
+
...s.interface.contrast === void 0 ? {} : { contrast: s.interface.contrast }
|
|
205
|
+
},
|
|
206
|
+
...s.sidebar ? { sidebar: {
|
|
207
|
+
...s.sidebar.base ? { base: s.sidebar.base } : {},
|
|
208
|
+
...s.sidebar.accent ? { accent: s.sidebar.accent } : {}
|
|
209
|
+
} } : {}
|
|
210
|
+
};
|
|
211
|
+
return JSON.stringify({
|
|
212
|
+
version: 1,
|
|
213
|
+
...theme.light ? { light: scheme(theme.light) } : {},
|
|
214
|
+
...theme.dark ? { dark: scheme(theme.dark) } : {},
|
|
215
|
+
...theme.code ? { code: theme.code } : {}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { CODE_STYLES, DEFAULT_CONTRAST, DEFAULT_PRESET, DEFAULT_THEME, THEME_PRESETS, modeOf, parseTheme, resolveMode, schemeFor, serializeTheme };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallelworks/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "React UI components: a theme contract, icons, primitives, lists, forms, a job graph, a code editor, a log viewer, a file explorer and an AI chat, each on its own subpath",
|
|
3
|
+
"version": "0.45.0",
|
|
4
|
+
"description": "React UI components: a theme contract, icons, brand logos, primitives, lists, forms, a job graph, a code editor, a log viewer, a file explorer and an AI chat, each on its own subpath",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"types": "./dist/icons.d.ts",
|
|
22
22
|
"import": "./dist/icons.js"
|
|
23
23
|
},
|
|
24
|
+
"./brand-icons": {
|
|
25
|
+
"types": "./dist/brandIcons.d.ts",
|
|
26
|
+
"import": "./dist/brandIcons.js"
|
|
27
|
+
},
|
|
24
28
|
"./theme": {
|
|
25
29
|
"types": "./dist/theme/index.d.ts",
|
|
26
30
|
"import": "./dist/theme/index.js"
|
|
@@ -82,6 +86,7 @@
|
|
|
82
86
|
},
|
|
83
87
|
"dependencies": {
|
|
84
88
|
"@base-ui/react": "^1.9.0",
|
|
89
|
+
"@daypicker/react": "^10.0.2",
|
|
85
90
|
"@streamdown/code": "^2.0.0",
|
|
86
91
|
"@streamdown/math": "^1.0.3",
|
|
87
92
|
"@streamdown/mermaid": "^1.0.3",
|
|
@@ -91,14 +96,13 @@
|
|
|
91
96
|
"clsx": "^2.1.1",
|
|
92
97
|
"css-tree": "^3.2.1",
|
|
93
98
|
"dequal": "^2.0.3",
|
|
99
|
+
"lucide-react": "1.48.0",
|
|
94
100
|
"luxon": "^3.7.2",
|
|
95
|
-
"re-resizable": "^6.11.2",
|
|
96
|
-
"react-icons": "5.7.0",
|
|
97
101
|
"react-zoom-pan-pinch": "^4.2.0",
|
|
98
102
|
"shiki": "^4.5.0",
|
|
99
103
|
"streamdown": "^2.7.0",
|
|
100
104
|
"swr": "^2.5.1",
|
|
101
|
-
"
|
|
105
|
+
"tailwind-merge": "^3.7.0"
|
|
102
106
|
},
|
|
103
107
|
"devDependencies": {
|
|
104
108
|
"@arethetypeswrong/cli": "^0.18.5",
|