@orcestr/ui 0.0.3 → 0.1.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/dist/components/Alert/Alert.d.ts +5 -4
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +5 -2
- package/dist/components/AppShell/AppShell.d.ts +13 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.js +14 -9
- package/dist/components/AppSidebar/AppSidebar.d.ts +36 -0
- package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -0
- package/dist/components/AppSidebar/AppSidebar.js +117 -0
- package/dist/components/Badge/Badge.d.ts +8 -6
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +4 -4
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts +22 -0
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts.map +1 -0
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.js +50 -0
- package/dist/components/Box/Box.d.ts +2 -0
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +15 -2
- package/dist/components/Button/Button.d.ts +7 -3
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +23 -3
- package/dist/components/Card/Card.d.ts +26 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/Card.js +25 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -2
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +13 -4
- package/dist/components/Collapse/Collapse.d.ts.map +1 -1
- package/dist/components/Collapse/Collapse.js +5 -25
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +10 -9
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js +5 -2
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +2 -2
- package/dist/components/CopyButton/CopyButton.d.ts +24 -0
- package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton/CopyButton.js +81 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +9 -1
- package/dist/components/Dialog/Dialog.d.ts +69 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +48 -1
- package/dist/components/Drawer/Drawer.d.ts +2 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +4 -4
- package/dist/components/EntityPicker/EntityPicker.d.ts +2 -1
- package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
- package/dist/components/EntityPicker/EntityPicker.js +2 -2
- package/dist/components/Flex/Flex.d.ts +5 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.js +16 -3
- package/dist/components/Grid/Grid.d.ts +9 -2
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/Grid.js +22 -1
- package/dist/components/IconButton/IconButton.d.ts +19 -7
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +40 -5
- package/dist/components/IconTextButton/IconTextButton.d.ts +20 -0
- package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -0
- package/dist/components/IconTextButton/IconTextButton.js +24 -0
- package/dist/components/InlineEdit/InlineEdit.d.ts +63 -0
- package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -0
- package/dist/components/InlineEdit/InlineEdit.js +98 -0
- package/dist/components/LinkButton/LinkButton.d.ts +25 -0
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/components/LinkButton/LinkButton.js +12 -0
- package/dist/components/Modal/Modal.d.ts +29 -6
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +37 -13
- package/dist/components/Overlay/OverlayProvider.d.ts +1 -0
- package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
- package/dist/components/Overlay/OverlayProvider.js +18 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +2 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.js +3 -3
- package/dist/components/Popover/Popover.d.ts +37 -3
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +56 -9
- package/dist/components/ScrollArea/ScrollArea.d.ts +4 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +30 -4
- package/dist/components/Section/Section.d.ts +2 -0
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +24 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +28 -2
- package/dist/components/Select/Select.d.ts +36 -4
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +70 -3
- package/dist/components/Separator/Separator.d.ts +3 -1
- package/dist/components/Separator/Separator.d.ts.map +1 -1
- package/dist/components/Separator/Separator.js +4 -2
- package/dist/components/SpecialModal/SpecialModal.d.ts +43 -0
- package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -0
- package/dist/components/SpecialModal/SpecialModal.js +34 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -1
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +2 -2
- package/dist/components/State/State.d.ts +8 -1
- package/dist/components/State/State.d.ts.map +1 -1
- package/dist/components/State/State.js +2 -2
- package/dist/components/Switch/Switch.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +2 -1
- package/dist/components/Table/Table.d.ts +64 -0
- package/dist/components/Table/Table.d.ts.map +1 -0
- package/dist/components/Table/Table.js +38 -0
- package/dist/components/Tabs/Tabs.d.ts +33 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +201 -5
- package/dist/components/Text/Text.d.ts +13 -3
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +16 -3
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/Toast/Toast.d.ts +1 -4
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +72 -37
- package/dist/components/Tooltip/Tooltip.d.ts +11 -3
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +58 -9
- package/dist/example/CodePreview.d.ts +2 -1
- package/dist/example/CodePreview.d.ts.map +1 -1
- package/dist/example/CodePreview.js +16 -51
- package/dist/example/ExampleActionsSection.d.ts.map +1 -1
- package/dist/example/ExampleActionsSection.js +3 -3
- package/dist/example/ExampleApplicationSection.d.ts +7 -0
- package/dist/example/ExampleApplicationSection.d.ts.map +1 -0
- package/dist/example/ExampleApplicationSection.js +88 -0
- package/dist/example/ExampleBasicsSections.d.ts +1 -1
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
- package/dist/example/ExampleBasicsSections.js +15 -13
- package/dist/example/ExampleDataSection.d.ts.map +1 -1
- package/dist/example/ExampleDataSection.js +31 -30
- package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
- package/dist/example/ExampleFieldsSection.js +51 -3
- package/dist/example/ExampleFoundationsSection.js +1 -1
- package/dist/example/ExampleOverlays.d.ts.map +1 -1
- package/dist/example/ExampleOverlays.js +7 -2
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
- package/dist/example/ExampleOverlaysSection.js +20 -30
- package/dist/example/ExampleSelectionSection.d.ts +3 -1
- package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
- package/dist/example/ExampleSelectionSection.js +10 -3
- package/dist/example/ExampleStateSection.d.ts +3 -0
- package/dist/example/ExampleStateSection.d.ts.map +1 -1
- package/dist/example/ExampleStateSection.js +65 -9
- package/dist/example/ExampleThemePlayground.d.ts +84 -54
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
- package/dist/example/ExampleThemePlayground.js +129 -63
- package/dist/example/UiExamplePage.d.ts.map +1 -1
- package/dist/example/UiExamplePage.js +39 -19
- package/dist/example/codeSamples.d.ts +8 -1
- package/dist/example/codeSamples.d.ts.map +1 -1
- package/dist/example/codeSamples.js +590 -119
- package/dist/example/exampleData.d.ts.map +1 -1
- package/dist/example/exampleData.js +18 -10
- package/dist/example/styles.css +277 -146
- package/dist/hooks/useFloatingPosition.js +1 -1
- package/dist/hooks/usePresence.d.ts.map +1 -1
- package/dist/hooks/usePresence.js +9 -7
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/styles/orcestr-ui.css +3002 -872
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +109 -53
- package/dist/theme/defaultTheme.d.ts.map +1 -1
- package/dist/theme/defaultTheme.js +356 -223
- package/dist/theme/systemProps.d.ts +48 -28
- package/dist/theme/systemProps.d.ts.map +1 -1
- package/dist/theme/systemProps.js +103 -1
- package/dist/theme/themeTypes.d.ts +44 -35
- package/dist/theme/themeTypes.d.ts.map +1 -1
- package/dist/utils/slot.d.ts +11 -0
- package/dist/utils/slot.d.ts.map +1 -0
- package/dist/utils/slot.js +18 -0
- package/package.json +4 -1
- package/dist/components/Workflow/Workflow.d.ts +0 -82
- package/dist/components/Workflow/Workflow.d.ts.map +0 -1
- package/dist/components/Workflow/Workflow.js +0 -73
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAGR,yBAAyB,EAE5B,MAAM,cAAc,CAAC;AAEtB,wBAAgB,oBAAoB,CAAC,EACjC,QAAQ,EACR,IAAI,EAAE,cAAc,EACpB,WAAoB,EACpB,cAA0B,EAC1B,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EACd,SAAS,EACT,KAAK,EACL,MAAM,GACT,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/theme/ThemeProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAGR,yBAAyB,EAE5B,MAAM,cAAc,CAAC;AAEtB,wBAAgB,oBAAoB,CAAC,EACjC,QAAQ,EACR,IAAI,EAAE,cAAc,EACpB,WAAoB,EACpB,cAA0B,EAC1B,OAAO,EACP,YAAY,EACZ,eAAe,EACf,cAAc,EACd,SAAS,EACT,KAAK,EACL,MAAM,GACT,EAAE,yBAAyB,2CA+P3B"}
|
|
@@ -23,39 +23,53 @@ export function OrcestrThemeProvider({ children, mode: controlledMode, defaultMo
|
|
|
23
23
|
const toggleMode = useCallback(() => {
|
|
24
24
|
setMode(resolvedMode === 'dark' ? 'light' : 'dark');
|
|
25
25
|
}, [resolvedMode, setMode]);
|
|
26
|
-
const value = useMemo(() => ({
|
|
27
|
-
mode: resolvedMode,
|
|
28
|
-
surface: resolvedSurface,
|
|
29
|
-
theme,
|
|
30
|
-
setMode,
|
|
31
|
-
setSurface,
|
|
32
|
-
toggleMode,
|
|
33
|
-
}), [resolvedMode, resolvedSurface, theme, setMode, setSurface, toggleMode]);
|
|
34
26
|
const rootStyle = useMemo(() => ({
|
|
35
27
|
'--oui-bg': theme.colors.bg,
|
|
36
28
|
'--oui-panel': theme.colors.panel,
|
|
37
29
|
'--oui-panel-2': theme.colors.panelSoft,
|
|
38
|
-
'--oui-control-bg': theme
|
|
30
|
+
'--oui-control-bg': controlBackgroundForMode(theme),
|
|
39
31
|
'--oui-control-hover-bg': theme.colors.controlHover,
|
|
40
32
|
'--oui-border': theme.colors.border,
|
|
41
33
|
'--oui-border-strong': theme.colors.borderStrong,
|
|
42
34
|
'--oui-text': theme.colors.text,
|
|
43
35
|
'--oui-muted': theme.colors.muted,
|
|
44
|
-
'--oui-soft': theme.colors.
|
|
36
|
+
'--oui-soft': theme.colors.primary.surface,
|
|
45
37
|
'--oui-soft-hover': theme.colors.selected,
|
|
46
|
-
'--oui-
|
|
47
|
-
'--oui-
|
|
48
|
-
'--oui-
|
|
49
|
-
'--oui-
|
|
50
|
-
'--oui-
|
|
51
|
-
'--oui-
|
|
52
|
-
'--oui-
|
|
53
|
-
'--oui-
|
|
54
|
-
'--oui-
|
|
55
|
-
'--oui-
|
|
56
|
-
'--oui-
|
|
57
|
-
'--oui-
|
|
58
|
-
'--oui-
|
|
38
|
+
'--oui-primary-base': theme.colors.primary.base,
|
|
39
|
+
'--oui-primary-text': theme.colors.primary.text,
|
|
40
|
+
'--oui-primary-surface': theme.colors.primary.surface,
|
|
41
|
+
'--oui-primary-border': theme.colors.primary.border,
|
|
42
|
+
'--oui-primary-contrast': theme.colors.primary.contrast,
|
|
43
|
+
'--oui-secondary-base': theme.colors.secondary.base,
|
|
44
|
+
'--oui-secondary-text': theme.colors.secondary.text,
|
|
45
|
+
'--oui-secondary-surface': theme.colors.secondary.surface,
|
|
46
|
+
'--oui-secondary-border': theme.colors.secondary.border,
|
|
47
|
+
'--oui-secondary-contrast': theme.colors.secondary.contrast,
|
|
48
|
+
'--oui-neutral-base': theme.colors.neutral.base,
|
|
49
|
+
'--oui-neutral-text': theme.colors.neutral.text,
|
|
50
|
+
'--oui-neutral-surface': theme.colors.neutral.surface,
|
|
51
|
+
'--oui-neutral-border': theme.colors.neutral.border,
|
|
52
|
+
'--oui-neutral-contrast': theme.colors.neutral.contrast,
|
|
53
|
+
'--oui-success-base': theme.colors.success.base,
|
|
54
|
+
'--oui-success-text': theme.colors.success.text,
|
|
55
|
+
'--oui-success-surface': theme.colors.success.surface,
|
|
56
|
+
'--oui-success-border': theme.colors.success.border,
|
|
57
|
+
'--oui-success-contrast': theme.colors.success.contrast,
|
|
58
|
+
'--oui-warning-base': theme.colors.warning.base,
|
|
59
|
+
'--oui-warning-text': theme.colors.warning.text,
|
|
60
|
+
'--oui-warning-surface': theme.colors.warning.surface,
|
|
61
|
+
'--oui-warning-border': theme.colors.warning.border,
|
|
62
|
+
'--oui-warning-contrast': theme.colors.warning.contrast,
|
|
63
|
+
'--oui-danger-base': theme.colors.danger.base,
|
|
64
|
+
'--oui-danger-text': theme.colors.danger.text,
|
|
65
|
+
'--oui-danger-surface': theme.colors.danger.surface,
|
|
66
|
+
'--oui-danger-border': theme.colors.danger.border,
|
|
67
|
+
'--oui-danger-contrast': theme.colors.danger.contrast,
|
|
68
|
+
'--oui-info-base': theme.colors.info.base,
|
|
69
|
+
'--oui-info-text': theme.colors.info.text,
|
|
70
|
+
'--oui-info-surface': theme.colors.info.surface,
|
|
71
|
+
'--oui-info-border': theme.colors.info.border,
|
|
72
|
+
'--oui-info-contrast': theme.colors.info.contrast,
|
|
59
73
|
'--oui-selected-bg': theme.colors.selected,
|
|
60
74
|
'--oui-disabled': theme.colors.disabled,
|
|
61
75
|
'--oui-overlay-bg': theme.colors.overlay,
|
|
@@ -74,9 +88,9 @@ export function OrcestrThemeProvider({ children, mode: controlledMode, defaultMo
|
|
|
74
88
|
'--oui-section-shadow': theme.shadows.section,
|
|
75
89
|
'--oui-shadow-focus': theme.shadows.focus,
|
|
76
90
|
'--oui-ring': theme.colors.focusRing,
|
|
77
|
-
'--oui-radius': theme.
|
|
78
|
-
'--oui-radius-sm': theme.
|
|
79
|
-
'--oui-radius-xl': theme.
|
|
91
|
+
'--oui-radius': theme.radius.lg,
|
|
92
|
+
'--oui-radius-sm': theme.radius.md,
|
|
93
|
+
'--oui-radius-xl': theme.radius.xl,
|
|
80
94
|
'--oui-space-px': theme.spacing.px,
|
|
81
95
|
'--oui-space-xs': theme.spacing.xs,
|
|
82
96
|
'--oui-space-sm': theme.spacing.sm,
|
|
@@ -90,27 +104,31 @@ export function OrcestrThemeProvider({ children, mode: controlledMode, defaultMo
|
|
|
90
104
|
'--oui-breakpoint-tablet': theme.breakpoints.tablet,
|
|
91
105
|
'--oui-breakpoint-desktop': theme.breakpoints.desktop,
|
|
92
106
|
'--oui-breakpoint-wide': theme.breakpoints.wide,
|
|
93
|
-
'--oui-font-family': theme.
|
|
94
|
-
'--oui-font-family-mono': theme.
|
|
95
|
-
'--oui-title-size': theme.
|
|
96
|
-
'--oui-heading-size': theme.
|
|
97
|
-
'--oui-body-size': theme.
|
|
98
|
-
'--oui-compact-size': theme.
|
|
99
|
-
'--oui-label-size': theme.
|
|
100
|
-
'--oui-line-height': theme.
|
|
101
|
-
'--oui-heading-line-height': theme.
|
|
102
|
-
'--oui-weight-regular': theme.
|
|
103
|
-
'--oui-weight-medium': theme.
|
|
104
|
-
'--oui-weight-bold': theme.
|
|
105
|
-
'--oui-letter-spacing': theme.
|
|
107
|
+
'--oui-font-family': theme.text.family,
|
|
108
|
+
'--oui-font-family-mono': theme.text.mono,
|
|
109
|
+
'--oui-title-size': theme.text.title,
|
|
110
|
+
'--oui-heading-size': theme.text.heading,
|
|
111
|
+
'--oui-body-size': theme.text.body,
|
|
112
|
+
'--oui-compact-size': theme.text.compact,
|
|
113
|
+
'--oui-label-size': theme.text.label,
|
|
114
|
+
'--oui-line-height': theme.text.line,
|
|
115
|
+
'--oui-heading-line-height': theme.text.headingLine,
|
|
116
|
+
'--oui-weight-regular': theme.text.regular,
|
|
117
|
+
'--oui-weight-medium': theme.text.medium,
|
|
118
|
+
'--oui-weight-bold': theme.text.bold,
|
|
119
|
+
'--oui-letter-spacing': theme.text.letterSpacing,
|
|
106
120
|
'--oui-status-neutral': theme.status.neutral.color,
|
|
107
121
|
'--oui-status-neutral-text': theme.status.neutral.text,
|
|
108
122
|
'--oui-status-neutral-soft': theme.status.neutral.soft,
|
|
109
123
|
'--oui-status-neutral-border': theme.status.neutral.border,
|
|
110
|
-
'--oui-status-
|
|
111
|
-
'--oui-status-
|
|
112
|
-
'--oui-status-
|
|
113
|
-
'--oui-status-
|
|
124
|
+
'--oui-status-primary': theme.status.primary.color,
|
|
125
|
+
'--oui-status-primary-text': theme.status.primary.text,
|
|
126
|
+
'--oui-status-primary-soft': theme.status.primary.soft,
|
|
127
|
+
'--oui-status-primary-border': theme.status.primary.border,
|
|
128
|
+
'--oui-status-secondary': theme.status.secondary.color,
|
|
129
|
+
'--oui-status-secondary-text': theme.status.secondary.text,
|
|
130
|
+
'--oui-status-secondary-soft': theme.status.secondary.soft,
|
|
131
|
+
'--oui-status-secondary-border': theme.status.secondary.border,
|
|
114
132
|
'--oui-status-success': theme.status.success.color,
|
|
115
133
|
'--oui-status-success-text': theme.status.success.text,
|
|
116
134
|
'--oui-status-success-soft': theme.status.success.soft,
|
|
@@ -138,11 +156,13 @@ export function OrcestrThemeProvider({ children, mode: controlledMode, defaultMo
|
|
|
138
156
|
'--oui-z-toast': theme.zIndex.toast,
|
|
139
157
|
'--oui-toast-bg': theme.toast.background,
|
|
140
158
|
'--oui-toast-blur': cssBlur(theme.toast.blur),
|
|
141
|
-
'--oui-toast-border-color': theme.toast.borderColor,
|
|
142
159
|
'--oui-toast-shadow': theme.toast.shadow,
|
|
143
160
|
'--oui-toast-animation-duration': theme.toast.animationDuration,
|
|
144
161
|
'--oui-toast-exit-duration': theme.toast.exitDuration,
|
|
145
162
|
'--oui-toast-progress-height': theme.toast.progressHeight,
|
|
163
|
+
'--oui-scrollbar-thumb': theme.scrollbar.thumb,
|
|
164
|
+
'--oui-scrollbar-thumb-hover': theme.scrollbar.thumbHover,
|
|
165
|
+
'--oui-scrollbar-track': theme.scrollbar.track,
|
|
146
166
|
'--oui-state-hover-opacity': theme.states.hoverOpacity,
|
|
147
167
|
'--oui-state-active-opacity': theme.states.activeOpacity,
|
|
148
168
|
'--oui-state-disabled-opacity': theme.states.disabledOpacity,
|
|
@@ -160,9 +180,25 @@ export function OrcestrThemeProvider({ children, mode: controlledMode, defaultMo
|
|
|
160
180
|
'--oui-table-header-height': theme.components.tableHeaderHeight,
|
|
161
181
|
'--oui-field-gap': theme.components.fieldGap,
|
|
162
182
|
'--oui-modal-max-width': theme.components.modalMaxWidth,
|
|
163
|
-
'--oui-pipeline-step-min-width': theme.components.pipelineStepMinWidth,
|
|
164
183
|
}), [theme]);
|
|
165
184
|
const themeStyle = useMemo(() => ({ ...rootStyle, ...style }), [rootStyle, style]);
|
|
185
|
+
const value = useMemo(() => ({
|
|
186
|
+
mode: resolvedMode,
|
|
187
|
+
surface: resolvedSurface,
|
|
188
|
+
theme,
|
|
189
|
+
cssVariables: rootStyle,
|
|
190
|
+
setMode,
|
|
191
|
+
setSurface,
|
|
192
|
+
toggleMode,
|
|
193
|
+
}), [
|
|
194
|
+
resolvedMode,
|
|
195
|
+
resolvedSurface,
|
|
196
|
+
theme,
|
|
197
|
+
rootStyle,
|
|
198
|
+
setMode,
|
|
199
|
+
setSurface,
|
|
200
|
+
toggleMode,
|
|
201
|
+
]);
|
|
166
202
|
useEffect(() => {
|
|
167
203
|
const root = document.documentElement;
|
|
168
204
|
const previousTheme = root.getAttribute('data-oui-theme');
|
|
@@ -200,16 +236,36 @@ function compositeColor(foreground, background) {
|
|
|
200
236
|
const bg = parseCssColor(background);
|
|
201
237
|
if (!fg || !bg)
|
|
202
238
|
return foreground;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
239
|
+
return rgbColor(blendColor(fg, bg));
|
|
240
|
+
}
|
|
241
|
+
function controlBackgroundForMode(theme) {
|
|
242
|
+
if (theme.mode !== 'light')
|
|
243
|
+
return theme.colors.control;
|
|
244
|
+
const control = parseCssColor(theme.colors.control);
|
|
245
|
+
const bg = parseCssColor(theme.colors.bg);
|
|
246
|
+
if (!control || !bg || control.a <= 0)
|
|
247
|
+
return theme.colors.control;
|
|
248
|
+
const visibleControl = blendColor(control, bg);
|
|
249
|
+
return relativeLuminance(visibleControl) < 0.52 ? 'transparent' : theme.colors.control;
|
|
250
|
+
}
|
|
251
|
+
function blendColor(foreground, background) {
|
|
252
|
+
if (foreground.a <= 0)
|
|
253
|
+
return { ...background, a: 1 };
|
|
254
|
+
if (foreground.a >= 1)
|
|
255
|
+
return { ...foreground, a: 1 };
|
|
256
|
+
return {
|
|
257
|
+
r: Math.round(foreground.r * foreground.a + background.r * (1 - foreground.a)),
|
|
258
|
+
g: Math.round(foreground.g * foreground.a + background.g * (1 - foreground.a)),
|
|
259
|
+
b: Math.round(foreground.b * foreground.a + background.b * (1 - foreground.a)),
|
|
211
260
|
a: 1,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function relativeLuminance(color) {
|
|
264
|
+
const [r, g, b] = [color.r, color.g, color.b].map((channel) => {
|
|
265
|
+
const value = channel / 255;
|
|
266
|
+
return value <= 0.03928 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
212
267
|
});
|
|
268
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
213
269
|
}
|
|
214
270
|
function rgbColor(color) {
|
|
215
271
|
return `rgb(${color.r} ${color.g} ${color.b})`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACtB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,6BAA6B,GAAG;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC5C,mBAAmB,EACnB,6BAA6B,CAsBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,6BAA6B,EAK/D,CAAC;
|
|
1
|
+
{"version":3,"file":"defaultTheme.d.ts","sourceRoot":"","sources":["../../src/theme/defaultTheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACtB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,6BAA6B,GAAG;IACxC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC5C,mBAAmB,EACnB,6BAA6B,CAsBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,6BAA6B,EAK/D,CAAC;AAqlBF,wBAAgB,WAAW,CACvB,IAAI,EAAE,gBAAgB,EACtB,OAAO,GAAE,mBAA+B,EACxC,cAAc,CAAC,EAAE,qBAAqB,GACvC,YAAY,CASd;AAED,eAAO,MAAM,SAAS,EAAE,YAAkC,CAAC;AAC3D,eAAO,MAAM,UAAU,EAAE,YAAmC,CAAC"}
|