@ciridae/ui 1.0.4 → 1.0.9
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 +3 -2
- package/dist/chat/conversation-source.d.ts +1 -3
- package/dist/chat/message-text.js +6 -6
- package/dist/chat/use-chat-conversation.d.ts +7 -2
- package/dist/chat/use-chat-conversation.js +2 -1
- package/dist/components/activity-feed.d.ts +0 -1
- package/dist/components/activity-feed.js +6 -7
- package/dist/components/agent-work.d.ts +5 -1
- package/dist/components/agent-work.js +27 -13
- package/dist/components/app-frame.d.ts +3 -17
- package/dist/components/app-frame.js +11 -30
- package/dist/components/app-navigation.d.ts +5 -6
- package/dist/components/app-navigation.js +70 -40
- package/dist/components/badge.d.ts +0 -4
- package/dist/components/badge.js +17 -27
- package/dist/components/bulk-action-bar.js +2 -2
- package/dist/components/button.js +41 -50
- package/dist/components/calendar.js +5 -8
- package/dist/components/centered-page.js +4 -4
- package/dist/components/chart.js +3 -4
- package/dist/components/chat-client-source.js +55 -34
- package/dist/components/chat-page.js +1 -1
- package/dist/components/chat-sheet.d.ts +30 -20
- package/dist/components/chat-sheet.js +112 -54
- package/dist/components/chat.d.ts +27 -56
- package/dist/components/chat.js +153 -132
- package/dist/components/checkbox-item.js +4 -4
- package/dist/components/checkbox-list.js +6 -6
- package/dist/components/chip.js +2 -2
- package/dist/components/collapsible.js +3 -3
- package/dist/components/color-theme.d.ts +3 -6
- package/dist/components/color-theme.js +10 -11
- package/dist/components/column-settings.js +3 -3
- package/dist/components/command-menu.d.ts +1 -2
- package/dist/components/command-menu.js +56 -77
- package/dist/components/command-palette.js +5 -2
- package/dist/components/copyable-id.js +5 -5
- package/dist/components/data-display.d.ts +1 -7
- package/dist/components/data-display.js +32 -55
- package/dist/components/data-grid.d.ts +4 -7
- package/dist/components/data-grid.js +106 -90
- package/dist/components/date-range-picker.js +4 -5
- package/dist/components/document-viewer.js +23 -23
- package/dist/components/drawer.d.ts +2 -1
- package/dist/components/drawer.js +45 -20
- package/dist/components/dropzone.js +13 -13
- package/dist/components/editable-field.d.ts +2 -7
- package/dist/components/editable-field.js +14 -27
- package/dist/components/email-input.js +2 -3
- package/dist/components/environment-frame.js +7 -7
- package/dist/components/expandable-text.js +2 -2
- package/dist/components/feedback-screenshot.js +7 -7
- package/dist/components/feedback-sheet.js +8 -8
- package/dist/components/filter-bar.js +41 -27
- package/dist/components/form-controls.d.ts +3 -6
- package/dist/components/form-controls.js +15 -22
- package/dist/components/form-layout.d.ts +6 -6
- package/dist/components/form-layout.js +10 -16
- package/dist/components/glass-menu.d.ts +2 -0
- package/dist/components/glass-menu.js +14 -18
- package/dist/components/gradient-edge.d.ts +0 -1
- package/dist/components/gradient-edge.js +8 -9
- package/dist/components/icon.js +1 -1
- package/dist/components/input.js +18 -17
- package/dist/components/keycap.d.ts +2 -6
- package/dist/components/keycap.js +4 -12
- package/dist/components/layout.js +11 -10
- package/dist/components/lightbox.js +8 -8
- package/dist/components/link.js +1 -1
- package/dist/components/locale.d.ts +23 -7
- package/dist/components/locale.js +19 -7
- package/dist/components/log-entry.d.ts +2 -14
- package/dist/components/log-entry.js +11 -22
- package/dist/components/log-list.js +1 -1
- package/dist/components/mention-input.js +13 -14
- package/dist/components/menu.d.ts +7 -4
- package/dist/components/menu.js +23 -10
- package/dist/components/meter.d.ts +2 -3
- package/dist/components/meter.js +12 -16
- package/dist/components/navigation.d.ts +0 -7
- package/dist/components/navigation.js +3 -12
- package/dist/components/notification-tray.js +7 -7
- package/dist/components/overlays.d.ts +5 -2
- package/dist/components/overlays.js +24 -24
- package/dist/components/panel.js +3 -3
- package/dist/components/progress.js +2 -2
- package/dist/components/radio-card.d.ts +1 -1
- package/dist/components/radio-card.js +9 -9
- package/dist/components/record.d.ts +2 -4
- package/dist/components/record.js +19 -32
- package/dist/components/scroll-area.js +10 -10
- package/dist/components/segmented-bar.js +9 -9
- package/dist/components/select.d.ts +3 -5
- package/dist/components/select.js +26 -44
- package/dist/components/settings.js +1 -1
- package/dist/components/shell-skeleton.js +1 -1
- package/dist/components/shell.d.ts +1 -1
- package/dist/components/shell.js +69 -24
- package/dist/components/side-panel.js +3 -3
- package/dist/components/sidebar.d.ts +0 -5
- package/dist/components/sidebar.js +25 -33
- package/dist/components/single-line-text.js +3 -4
- package/dist/components/site-banner.js +4 -4
- package/dist/components/skeleton.js +19 -22
- package/dist/components/skeletons.d.ts +0 -3
- package/dist/components/skeletons.js +5 -10
- package/dist/components/stages.d.ts +6 -3
- package/dist/components/stages.js +77 -105
- package/dist/components/stat-card.d.ts +2 -5
- package/dist/components/stat-card.js +23 -31
- package/dist/components/status-banner.js +6 -6
- package/dist/components/status.js +3 -3
- package/dist/components/steps.js +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs.js +15 -18
- package/dist/components/theme-customizer.d.ts +5 -8
- package/dist/components/theme-customizer.js +9 -41
- package/dist/components/theme-toggle.d.ts +0 -1
- package/dist/components/theme-toggle.js +6 -11
- package/dist/components/toast.d.ts +1 -7
- package/dist/components/toast.js +19 -22
- package/dist/components/user-chip.js +8 -8
- package/dist/components/wizard.js +6 -4
- package/dist/preset.d.ts +1 -2
- package/dist/preset.js +41 -89
- package/dist/styled-system/css/conditions.mjs +1 -1
- package/dist/styled-system/css/css.mjs +1 -1
- package/dist/styled-system/styles.css +820 -1297
- package/dist/styled-system/tokens/index.mjs +78 -1926
- package/dist/styled-system/tokens/tokens.d.ts +18 -33
- package/dist/styled-system/types/conditions.d.ts +0 -74
- package/dist/styled-system/types/prop-type.d.ts +15 -40
- package/dist/styled-system/types/style-props.d.ts +705 -705
- package/dist/theme/color.d.ts +0 -1
- package/dist/theme/color.js +0 -16
- package/dist/theme/derive.d.ts +3 -3
- package/dist/theme/derive.js +9 -32
- package/dist/theme/index.d.ts +1 -2
- package/dist/theme/index.js +3 -5
- package/dist/theme/options.d.ts +2 -4
- package/dist/theme/options.js +0 -1
- package/dist/theme/{palettes.d.ts → palette.d.ts} +12 -23
- package/dist/theme/palette.js +127 -0
- package/dist/theme/tokens.d.ts +8 -13
- package/dist/theme/tokens.js +39 -92
- package/package.json +1 -1
- package/dist/theme/palettes.js +0 -254
package/dist/theme/tokens.js
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { alpha, linearGradient } from "./color.js";
|
|
2
2
|
import { derivePaletteTokens, themedGradient } from "./derive.js";
|
|
3
3
|
import { defaultTheme } from "./options.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ciridaePalette } from "./palette.js";
|
|
5
5
|
/* The two elevations, the same in both themes: a card's, and the softer one a sheet or toast casts. */
|
|
6
6
|
const cardElevation = "0 1px 4px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.03)";
|
|
7
7
|
const softElevation = "0 1px 2px rgba(0,0,0,.04), 0 6px 20px -4px rgba(0,0,0,.05)";
|
|
8
8
|
/**
|
|
9
9
|
* Every token value a theme decides. `createCiridaePreset` bakes these into the stylesheet;
|
|
10
|
-
* `
|
|
10
|
+
* `fontStylesheet` writes the same faces over it at runtime, so the two never drift.
|
|
11
11
|
*/
|
|
12
12
|
export function deriveThemeTokens(theme = {}) {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const { dark, light }
|
|
13
|
+
const palette = derivePaletteTokens(ciridaePalette);
|
|
14
|
+
const { dark, light } = ciridaePalette.greys;
|
|
15
|
+
const mutedTextColor = { base: dark.muted, _light: light.muted };
|
|
16
16
|
const face = (name, opacity) => themedGradient("to bottom", { base: dark.gradients[name], _light: light.gradients[name] }, opacity);
|
|
17
17
|
return {
|
|
18
18
|
colors: {
|
|
19
19
|
...palette.colors,
|
|
20
|
-
// Focus is the palette's focus ring
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// A field's edge once invalid: the palette's red, at full strength in both themes.
|
|
20
|
+
// Focus is the palette's focus ring. Set from the palette, not by reference: Panda renders a
|
|
21
|
+
// reference to a dotted semantic token as an undefined variable.
|
|
22
|
+
"border.focus": ciridaePalette.focusRing,
|
|
23
|
+
// The palette's red at full strength in both themes.
|
|
25
24
|
"border.error": palette.colors["accent.red"],
|
|
26
25
|
"bg.canvas": { base: dark.canvas, _light: light.canvas },
|
|
27
26
|
// The app's main surface and its panels: a translucent lift off the canvas.
|
|
@@ -33,10 +32,7 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
33
32
|
"bg.avatar": { base: dark.avatar, _light: light.avatar },
|
|
34
33
|
// Behind a modal, full screen; the design gives a drawer none.
|
|
35
34
|
"bg.backdrop": { base: alpha(dark.scrim, 0.6), _light: alpha(light.scrim, 0.24) },
|
|
36
|
-
|
|
37
|
-
* The overlays' glass, blurred by the `blurs.*` token of the same name. A popover or menu
|
|
38
|
-
* is one glass face; a modal and a drawer are a glass shell holding a sheet.
|
|
39
|
-
*/
|
|
35
|
+
// A popover or menu is one glass face; a modal and a drawer are a glass shell holding a sheet.
|
|
40
36
|
"bg.popover": { base: alpha(dark.popover, 0.6), _light: alpha(light.popover, 0.33) },
|
|
41
37
|
"bg.modalShell": {
|
|
42
38
|
base: alpha(dark.modalShell, 0.01),
|
|
@@ -51,15 +47,11 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
51
47
|
_light: alpha(light.drawerShell, 0.33),
|
|
52
48
|
},
|
|
53
49
|
"bg.drawerSheet": { base: dark.drawerSheet, _light: alpha(light.drawerSheet, 0.88) },
|
|
54
|
-
// A flat well on the canvas or a sheet
|
|
55
|
-
// 5% in dark, where the raised faces are glass.
|
|
50
|
+
// A flat well on the canvas or a sheet: white at 5% in dark, where the raised faces are glass.
|
|
56
51
|
"bg.field": { base: alpha(dark.wash, 0.05), _light: alpha(light.well, 0.66) },
|
|
57
|
-
//
|
|
58
|
-
// combobox, the sidebar search: the darker well grey in dark, the same grey well as
|
|
59
|
-
// `bg.field` in light.
|
|
52
|
+
// A form field's well: the darker well grey in dark, the same grey well as `bg.field` in light.
|
|
60
53
|
"bg.formField": { base: alpha(dark.well, 0.33), _light: alpha(light.well, 0.66) },
|
|
61
|
-
// A menu's trigger while its menu is open
|
|
62
|
-
// edge's grey as a fill in dark, the field's well in light.
|
|
54
|
+
// A menu's trigger while its menu is open: the canvas edge's grey as a fill in dark, the field's well in light.
|
|
63
55
|
"bg.openTrigger": { base: alpha(dark.border, 0.5), _light: alpha(light.well, 0.66) },
|
|
64
56
|
// A disabled field loses its grey in light and reads as a blank well.
|
|
65
57
|
"bg.fieldDisabled": { base: alpha(dark.well, 0.33), _light: light.knob },
|
|
@@ -71,13 +63,9 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
71
63
|
*/
|
|
72
64
|
"bg.control": { base: alpha(dark.control, 0.5), _light: alpha(light.control, 0.95) },
|
|
73
65
|
"bg.pill": { base: dark.pill, _light: light.pill },
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
* middle of `gradients.selected`. Dark is the button's glass; light is a translucent wash,
|
|
77
|
-
* where the button's `bg.raised` is solid. Hover is the button face.
|
|
78
|
-
*/
|
|
66
|
+
// Flat at the middle of `gradients.selected`. Dark is the button's glass; light is a
|
|
67
|
+
// translucent wash, where the button's `bg.raised` is solid.
|
|
79
68
|
"bg.glass": { base: alpha(dark.glass, 0.1), _light: alpha(light.glass, 0.66) },
|
|
80
|
-
"bg.glassHover": { base: alpha(dark.glass, 0.05), _light: light.raised },
|
|
81
69
|
/*
|
|
82
70
|
* The button face -- secondary, round, destructive's grey siblings: glass over the dark
|
|
83
71
|
* surface, a pale solid in light. Light has no hover; dark lets more surface through.
|
|
@@ -91,11 +79,9 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
91
79
|
// The quieter layer over a hovered field, mark, tab or segment: the ink at 4% in light. Dark
|
|
92
80
|
// draws none there, and lifts the text or the edge instead.
|
|
93
81
|
"bg.controlHover": { base: alpha(dark.wash, 0), _light: alpha(light.wash, 0.04) },
|
|
94
|
-
"bg.pressed": { base: alpha(dark.wash, 0.08), _light: alpha(light.wash, 0.08) },
|
|
95
|
-
// The firmer grey fill a chip or a subtle button wears.
|
|
96
82
|
"bg.fill": { base: alpha(dark.hover, 0.1), _light: alpha(light.hover, 0.08) },
|
|
97
83
|
// A hovered table or list row: a flat wash, so a column of rows reads as one surface rather
|
|
98
|
-
// than a stack of separately lit bands. A selected row takes
|
|
84
|
+
// than a stack of separately lit bands. A selected row takes `bg.selected`.
|
|
99
85
|
"bg.rowHover": { base: alpha(dark.wash, 0.05), _light: alpha(light.wash, 0.04) },
|
|
100
86
|
// A switch's track while off; checked, it takes the green.
|
|
101
87
|
"bg.track": { base: dark.muted, _light: light.secondary },
|
|
@@ -103,25 +89,22 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
103
89
|
"fg.primary": { base: dark.primary, _light: light.primary },
|
|
104
90
|
// Supporting text that still reads: a record's meta line, a part's next step.
|
|
105
91
|
"fg.secondary": { base: dark.secondary, _light: light.secondary },
|
|
106
|
-
"fg.muted":
|
|
107
|
-
// Placeholder and meta text: the
|
|
108
|
-
"fg.subtle":
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
// A label beside its value -- a description list's term, a neutral badge, a stage's meta, a
|
|
112
|
-
// log row's detail: the muted grey in dark, the secondary in light.
|
|
92
|
+
"fg.muted": mutedTextColor,
|
|
93
|
+
// Placeholder and meta text: the same grey as `fg.muted`.
|
|
94
|
+
"fg.subtle": mutedTextColor,
|
|
95
|
+
// Meta, and a fact's label beside its value: the muted grey in dark, the secondary in light.
|
|
96
|
+
// Column heads and stat labels are `fg.primary`, Foundations' type rule.
|
|
113
97
|
"fg.label": { base: dark.muted, _light: light.secondary },
|
|
114
98
|
"fg.archived": { base: alpha(dark.archived, 0.66), _light: alpha(light.archived, 0.66) },
|
|
115
99
|
"border.subtle": { base: dark.line, _light: alpha(light.line, 0.66) },
|
|
116
100
|
"border.control": { base: alpha(dark.border, 0.5), _light: alpha(light.border, 0.66) },
|
|
117
101
|
"border.panel": { base: alpha(dark.border, 1), _light: alpha(light.border, 0.66) },
|
|
118
|
-
"border.card": { base: dark.cardBorder, _light: alpha(light.cardBorder, 0.66) },
|
|
119
|
-
// The edge of what sits on the canvas
|
|
120
|
-
// surface's outline -- darker in light so it holds on the grey.
|
|
102
|
+
"border.card": { base: alpha(dark.cardBorder, 0.66), _light: alpha(light.cardBorder, 0.66) },
|
|
103
|
+
// The edge of what sits on the canvas, darker in light so it holds on the grey.
|
|
121
104
|
"border.canvas": { base: alpha(dark.border, 0.5), _light: alpha(light.mark, 0.33) },
|
|
122
|
-
// A divider or row rule on a card, sheet or drawer, and the drawer shell's glass edge.
|
|
123
105
|
"border.divider": { base: alpha(dark.border, 0.66), _light: alpha(light.border, 0.66) },
|
|
124
|
-
//
|
|
106
|
+
// Gray 66 in both themes, as the Date picker and Help menu kits draw it.
|
|
107
|
+
"border.popover": { base: alpha(dark.border, 0.66), _light: alpha(light.border, 0.66) },
|
|
125
108
|
"border.menuHover": {
|
|
126
109
|
base: alpha(dark.menuHoverBorder, 0.5),
|
|
127
110
|
_light: alpha(light.menuHoverBorder, 0.33),
|
|
@@ -134,7 +117,6 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
134
117
|
"border.glass": { base: alpha(dark.mark, 0.2), _light: alpha(dark.mark, 0.28) },
|
|
135
118
|
// The sidebar's divider.
|
|
136
119
|
"border.hairline": { base: dark.hairline, _light: light.hairline },
|
|
137
|
-
// The grey data marks: a grey series and its swatch, and a part not started yet.
|
|
138
120
|
"chart.neutral": { base: alpha(dark.wash, 0.2), _light: light.secondary },
|
|
139
121
|
"chart.notStarted": { base: alpha(dark.wash, 0.2), _light: alpha(light.mark, 0.33) },
|
|
140
122
|
},
|
|
@@ -147,9 +129,8 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
147
129
|
_light: linearGradient("to bottom", light.gradients.canvas, 1),
|
|
148
130
|
},
|
|
149
131
|
/*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* as white glass falling to the muted grey.
|
|
132
|
+
* Each flat `bg.*` face sits near the middle of its gradient. Dark draws the canvas and panel flat,
|
|
133
|
+
* and the raised, selected and card faces as white glass falling to the muted grey.
|
|
153
134
|
*/
|
|
154
135
|
canvas: face("canvas", { base: 1, _light: 1 }),
|
|
155
136
|
panel: face("panel", { base: 0.66, _light: 0.66 }),
|
|
@@ -160,7 +141,6 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
160
141
|
raised: face("raised", { base: 0.1, _light: 1 }),
|
|
161
142
|
// A hovered toolbar control or round button: the raised face, thinner in dark.
|
|
162
143
|
raisedHover: face("raised", { base: 0.05, _light: 1 }),
|
|
163
|
-
// The toolbar control's tint -- a select, slicer, filter chip, an unticked mark in dark.
|
|
164
144
|
selected: face("selected", { base: 0.1, _light: 0.66 }),
|
|
165
145
|
// A hovered log row: the flat wash in light, and in dark the raised glass at half its
|
|
166
146
|
// strength, as `bg.rowHover` flattens it.
|
|
@@ -222,51 +202,18 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
222
202
|
},
|
|
223
203
|
};
|
|
224
204
|
}
|
|
225
|
-
/* Panda's variable for a token: `colors` + `bg.infoSubtle` -> `--colors-bg.info-subtle`. */
|
|
226
|
-
function tokenVariable(category, name) {
|
|
227
|
-
return `--${category}-${name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* The CSS variables a theme sets under one color theme, named as Panda names them. Written onto
|
|
231
|
-
* the document, they show a theme over a stylesheet built with another, with no rebuild. Names
|
|
232
|
-
* are as `style.setProperty` takes them; in stylesheet text their dots need escaping.
|
|
233
|
-
*/
|
|
234
|
-
export function themeVariables(theme, colorTheme) {
|
|
235
|
-
const tokens = deriveThemeTokens(theme);
|
|
236
|
-
const themed = (value) => (colorTheme === "light" ? value._light : value.base);
|
|
237
|
-
const variables = {};
|
|
238
|
-
// Only what the theme sets, so a palette alone keeps the built faces and fonts alone keep the
|
|
239
|
-
// built colors.
|
|
240
|
-
if (theme.palette !== undefined) {
|
|
241
|
-
for (const [name, value] of Object.entries(tokens.colors))
|
|
242
|
-
variables[tokenVariable("colors", name)] = themed(value);
|
|
243
|
-
for (const [name, value] of Object.entries(tokens.gradients))
|
|
244
|
-
variables[tokenVariable("gradients", name)] = themed(value);
|
|
245
|
-
for (const [name, value] of Object.entries(tokens.shadows))
|
|
246
|
-
variables[tokenVariable("shadows", name)] = themed(value);
|
|
247
|
-
}
|
|
248
|
-
// Display falls back to sans, so setting sans sets both.
|
|
249
|
-
if (theme.fonts?.display ?? theme.fonts?.sans)
|
|
250
|
-
variables[tokenVariable("fonts", "display")] = tokens.fonts.display;
|
|
251
|
-
if (theme.fonts?.sans)
|
|
252
|
-
variables[tokenVariable("fonts", "sans")] = tokens.fonts.sans;
|
|
253
|
-
if (theme.fonts?.mono)
|
|
254
|
-
variables[tokenVariable("fonts", "mono")] = tokens.fonts.mono;
|
|
255
|
-
return variables;
|
|
256
|
-
}
|
|
257
|
-
/* A dot in a variable name is escaped in stylesheet text, as Panda writes `--colors-bg\.canvas`. */
|
|
258
|
-
function declarations(variables) {
|
|
259
|
-
return Object.entries(variables)
|
|
260
|
-
.map(([variable, value]) => `${variable.replace(/\./g, "\\.")}: ${value};`)
|
|
261
|
-
.join("\n");
|
|
262
|
-
}
|
|
263
205
|
/**
|
|
264
|
-
* The
|
|
265
|
-
* built stylesheet's `@layer tokens` blocks, so the page shows the
|
|
206
|
+
* The faces in `fonts` as a stylesheet of the variables Panda names them by. Unlayered, it wins
|
|
207
|
+
* over the built stylesheet's `@layer tokens` blocks, so the page shows the faces with no rebuild.
|
|
208
|
+
* A face left out keeps the built one.
|
|
266
209
|
*/
|
|
267
|
-
export function
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
210
|
+
export function fontStylesheet(fonts) {
|
|
211
|
+
const faces = deriveThemeTokens({ fonts }).fonts;
|
|
212
|
+
const declarations = [
|
|
213
|
+
// Display follows sans, so setting sans sets both.
|
|
214
|
+
...((fonts.display ?? fonts.sans) ? [`--fonts-display: ${faces.display};`] : []),
|
|
215
|
+
...(fonts.sans ? [`--fonts-sans: ${faces.sans};`] : []),
|
|
216
|
+
...(fonts.mono ? [`--fonts-mono: ${faces.mono};`] : []),
|
|
217
|
+
];
|
|
218
|
+
return `:root {\n${declarations.join("\n")}\n}`;
|
|
272
219
|
}
|
package/package.json
CHANGED
package/dist/theme/palettes.js
DELETED
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { lean } from "./color.js";
|
|
2
|
-
export const PALETTE_NAMES = ["ciridae", "ocean", "moss", "violet", "ember"];
|
|
3
|
-
/** The third chart category: no status hue is indigo, so every palette shares this one. */
|
|
4
|
-
export const chartIndigo = { base: "#8A86FF", _light: "#5B56EE" };
|
|
5
|
-
/*
|
|
6
|
-
* The kit's own greys, from the Ciridae OS Figma: each face it paints as a gradient is kept as its
|
|
7
|
-
* two ends and flattened to its middle. A dark card is white glass, washed in at 5%.
|
|
8
|
-
*/
|
|
9
|
-
const ciridaeGreys = {
|
|
10
|
-
dark: {
|
|
11
|
-
canvas: "#141416",
|
|
12
|
-
panel: "#27272A",
|
|
13
|
-
card: "#FFFFFF",
|
|
14
|
-
well: "#1D1D20",
|
|
15
|
-
avatar: "#36363C",
|
|
16
|
-
primary: "#FFFFFF",
|
|
17
|
-
secondary: "#B4B1AC",
|
|
18
|
-
muted: "#827F7A",
|
|
19
|
-
subtle: "#827F7A",
|
|
20
|
-
archived: "#827F7A",
|
|
21
|
-
line: "#36363C",
|
|
22
|
-
border: "#3C3C3C",
|
|
23
|
-
cardBorder: "#3C3C3C",
|
|
24
|
-
mark: "#898887",
|
|
25
|
-
hairline: "#3B342B",
|
|
26
|
-
menuHoverBorder: "#3C3C3C",
|
|
27
|
-
wash: "#FFFFFF",
|
|
28
|
-
shade: "#141416",
|
|
29
|
-
focus: "#827F7A",
|
|
30
|
-
surface: "#27272B",
|
|
31
|
-
control: "#1A1A1C",
|
|
32
|
-
pill: "#1B1B1D",
|
|
33
|
-
glass: "#C1BFBD",
|
|
34
|
-
raised: "#C1BFBD",
|
|
35
|
-
hover: "#C1BFBD",
|
|
36
|
-
knob: "#FFFFFF",
|
|
37
|
-
scrim: "#141416",
|
|
38
|
-
popover: "#141416",
|
|
39
|
-
modalShell: "#FFFFFF",
|
|
40
|
-
modalSheet: "#FFFFFF",
|
|
41
|
-
drawerShell: "#27272A",
|
|
42
|
-
drawerSheet: "#2B2B2D",
|
|
43
|
-
gradients: {
|
|
44
|
-
canvas: ["#141416", "#141416"],
|
|
45
|
-
panel: ["#27272A", "#27272A"],
|
|
46
|
-
raised: ["#FFFFFF", "#827F7A"],
|
|
47
|
-
selected: ["#FFFFFF", "#827F7A"],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
light: {
|
|
51
|
-
canvas: "#E1E1E1",
|
|
52
|
-
panel: "#F8F8F8",
|
|
53
|
-
card: "#FBFBFB",
|
|
54
|
-
well: "#EEEEEE",
|
|
55
|
-
avatar: "#D8D8DE",
|
|
56
|
-
primary: "#2A2A2D",
|
|
57
|
-
secondary: "#7B7B7E",
|
|
58
|
-
muted: "#98989E",
|
|
59
|
-
subtle: "#98989E",
|
|
60
|
-
archived: "#5A5854",
|
|
61
|
-
line: "#CDCDCD",
|
|
62
|
-
border: "#CDCDCD",
|
|
63
|
-
cardBorder: "#CDCDCD",
|
|
64
|
-
mark: "#A7A7A7",
|
|
65
|
-
hairline: "#E0DAD0",
|
|
66
|
-
menuHoverBorder: "#D8D8D8",
|
|
67
|
-
wash: "#2A2A2D",
|
|
68
|
-
shade: "#141416",
|
|
69
|
-
focus: "#6B6A68",
|
|
70
|
-
surface: "#FBFBFC",
|
|
71
|
-
control: "#F2F2F6",
|
|
72
|
-
pill: "#FAFAFB",
|
|
73
|
-
glass: "#F2F2F2",
|
|
74
|
-
raised: "#F3F3F4",
|
|
75
|
-
hover: "#4B4A48",
|
|
76
|
-
knob: "#FBFBFB",
|
|
77
|
-
scrim: "#2A2A2D",
|
|
78
|
-
popover: "#F0F0F0",
|
|
79
|
-
modalShell: "#EEEEEE",
|
|
80
|
-
modalSheet: "#FBFBFB",
|
|
81
|
-
drawerShell: "#F0F0F0",
|
|
82
|
-
drawerSheet: "#FBFBFB",
|
|
83
|
-
gradients: {
|
|
84
|
-
canvas: ["#D8D8D8", "#EBEBEB"],
|
|
85
|
-
panel: ["#F0F0F0", "#FFFFFF"],
|
|
86
|
-
raised: ["#FDFDFD", "#E8E9EA"],
|
|
87
|
-
selected: ["#F8F8F8", "#ECECEC"],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
};
|
|
91
|
-
/*
|
|
92
|
-
* The kit's greys leaned toward a hue per theme; see `lean`. The hue is a mid grey a step or two
|
|
93
|
-
* off neutral: only its lean counts, so the chroma it carries is the chroma the surfaces take on.
|
|
94
|
-
* Text and lines take half of it, so they read near-neutral and the accent carries the palette.
|
|
95
|
-
*/
|
|
96
|
-
function leanedGreys(hue) {
|
|
97
|
-
const leanAll = (greys, toward) => {
|
|
98
|
-
const surface = (grey) => lean(grey, toward, 1);
|
|
99
|
-
const ink = (grey) => lean(grey, toward, 0.5);
|
|
100
|
-
const surfaceGradient = ([from, to]) => [surface(from), surface(to)];
|
|
101
|
-
return {
|
|
102
|
-
canvas: surface(greys.canvas),
|
|
103
|
-
panel: surface(greys.panel),
|
|
104
|
-
card: surface(greys.card),
|
|
105
|
-
well: surface(greys.well),
|
|
106
|
-
avatar: surface(greys.avatar),
|
|
107
|
-
primary: ink(greys.primary),
|
|
108
|
-
secondary: ink(greys.secondary),
|
|
109
|
-
muted: ink(greys.muted),
|
|
110
|
-
subtle: ink(greys.subtle),
|
|
111
|
-
archived: ink(greys.archived),
|
|
112
|
-
line: ink(greys.line),
|
|
113
|
-
border: ink(greys.border),
|
|
114
|
-
cardBorder: ink(greys.cardBorder),
|
|
115
|
-
mark: ink(greys.mark),
|
|
116
|
-
hairline: ink(greys.hairline),
|
|
117
|
-
menuHoverBorder: ink(greys.menuHoverBorder),
|
|
118
|
-
wash: surface(greys.wash),
|
|
119
|
-
shade: surface(greys.shade),
|
|
120
|
-
focus: ink(greys.focus),
|
|
121
|
-
surface: surface(greys.surface),
|
|
122
|
-
control: surface(greys.control),
|
|
123
|
-
pill: surface(greys.pill),
|
|
124
|
-
glass: surface(greys.glass),
|
|
125
|
-
raised: surface(greys.raised),
|
|
126
|
-
hover: surface(greys.hover),
|
|
127
|
-
knob: surface(greys.knob),
|
|
128
|
-
scrim: surface(greys.scrim),
|
|
129
|
-
popover: surface(greys.popover),
|
|
130
|
-
modalShell: surface(greys.modalShell),
|
|
131
|
-
modalSheet: surface(greys.modalSheet),
|
|
132
|
-
drawerShell: surface(greys.drawerShell),
|
|
133
|
-
drawerSheet: surface(greys.drawerSheet),
|
|
134
|
-
gradients: {
|
|
135
|
-
canvas: surfaceGradient(greys.gradients.canvas),
|
|
136
|
-
panel: surfaceGradient(greys.gradients.panel),
|
|
137
|
-
raised: surfaceGradient(greys.gradients.raised),
|
|
138
|
-
selected: surfaceGradient(greys.gradients.selected),
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
return {
|
|
143
|
-
dark: leanAll(ciridaeGreys.dark, hue.base),
|
|
144
|
-
light: leanAll(ciridaeGreys.light, hue._light),
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
/* The kit's own warm glass, which every palette but ember keeps. The flat face is its middle. */
|
|
148
|
-
const amberTint = {
|
|
149
|
-
face: { base: "#FFE6BD", _light: "#F2EFEB" },
|
|
150
|
-
faceGradient: { base: ["#FFFFFF", "#FFCD7B"], _light: ["#FDFDFD", "#E8E2D9"] },
|
|
151
|
-
edge: { base: ["#FFF1C9", "#A47D28"], _light: ["#B5AF87", "#BF8931"] },
|
|
152
|
-
};
|
|
153
|
-
export const palettes = {
|
|
154
|
-
/*
|
|
155
|
-
* The Ciridae OS look: a monochrome primary that inverts with the theme, the kit's warm gold,
|
|
156
|
-
* and a blue focus ring apart from it.
|
|
157
|
-
*/
|
|
158
|
-
ciridae: {
|
|
159
|
-
greys: ciridaeGreys,
|
|
160
|
-
accent: { base: "#D1B778", _light: "#8A6D33" },
|
|
161
|
-
focusRing: { base: "#66B7F1", _light: "#4186B8" },
|
|
162
|
-
primary: { base: "#FFFFFF", _light: "#37373A" },
|
|
163
|
-
primaryGradient: { base: ["#FFFFFF", "#FFFFFF"], _light: ["#57575B", "#171719"] },
|
|
164
|
-
status: {
|
|
165
|
-
green: {
|
|
166
|
-
text: { base: "#45A999", _light: "#488F83" },
|
|
167
|
-
wash: { base: "#45A999", _light: "#3D8B7D" },
|
|
168
|
-
dark: { base: "#45A999", _light: "#698984" },
|
|
169
|
-
},
|
|
170
|
-
red: {
|
|
171
|
-
text: { base: "#F7644F", _light: "#EB442C" },
|
|
172
|
-
dark: { base: "#F7644F", _light: "#986159" },
|
|
173
|
-
},
|
|
174
|
-
yellow: {
|
|
175
|
-
text: { base: "#DFBB65", _light: "#B27D00" },
|
|
176
|
-
icon: { base: "#DFBB65", _light: "#DB972A" },
|
|
177
|
-
},
|
|
178
|
-
blue: { text: { base: "#66B7F1", _light: "#4186B8" } },
|
|
179
|
-
},
|
|
180
|
-
bronze: { base: "#725D42", _light: "#6D6554" },
|
|
181
|
-
tint: amberTint,
|
|
182
|
-
chart: {
|
|
183
|
-
bar: { base: "#66B7F1", _light: "#72BFF6" },
|
|
184
|
-
trend: { base: "#66B7F1", _light: "#4186B8" },
|
|
185
|
-
area: { base: ["#FFFFFF", "#A4D5F8"], _light: ["#60BCFF", "#FFFFFF"] },
|
|
186
|
-
categories: [
|
|
187
|
-
{ base: "#DFBB65", _light: "#F8B853" },
|
|
188
|
-
{ base: "#45A999", _light: "#488F83" },
|
|
189
|
-
chartIndigo,
|
|
190
|
-
{ base: "#F7644F", _light: "#EB442C" },
|
|
191
|
-
],
|
|
192
|
-
progress: { base: ["#A6D6FA", "#4D9CD9"], _light: ["#7AC1F4", "#4186B8"] },
|
|
193
|
-
atRisk: { base: ["#F2D995", "#C99E3E"], _light: ["#F8B853", "#DB972A"] },
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
/* A cool blue, where the primary takes the accent. */
|
|
197
|
-
ocean: {
|
|
198
|
-
greys: leanedGreys({ base: "#7E8084", _light: "#7E8083" }),
|
|
199
|
-
accent: { base: "#7CBCF2", _light: "#295F8C" },
|
|
200
|
-
primary: { base: "#8BC5F4", _light: "#2E6BA2" },
|
|
201
|
-
status: {
|
|
202
|
-
green: { text: { base: "#4EB59D", _light: "#306555" } },
|
|
203
|
-
red: { text: { base: "#F36E5B", _light: "#94423C" } },
|
|
204
|
-
yellow: { text: { base: "#DFBB65", _light: "#695829" } },
|
|
205
|
-
blue: { text: { base: "#7CBCF2", _light: "#295F8C" } },
|
|
206
|
-
},
|
|
207
|
-
bronze: { base: "#6E5F4A", _light: "#6A6356" },
|
|
208
|
-
tint: amberTint,
|
|
209
|
-
},
|
|
210
|
-
/* A quiet green; success stays its own, brighter green. */
|
|
211
|
-
moss: {
|
|
212
|
-
greys: leanedGreys({ base: "#7F827F", _light: "#7F827F" }),
|
|
213
|
-
accent: { base: "#7CC7A8", _light: "#296E56" },
|
|
214
|
-
primary: { base: "#8ACEB2", _light: "#2D775C" },
|
|
215
|
-
status: {
|
|
216
|
-
green: { text: { base: "#5FBF9A", _light: "#2D634F" } },
|
|
217
|
-
red: { text: { base: "#F3705C", _light: "#94423C" } },
|
|
218
|
-
yellow: { text: { base: "#DEB85F", _light: "#695829" } },
|
|
219
|
-
blue: { text: { base: "#6AB4EE", _light: "#315D81" } },
|
|
220
|
-
},
|
|
221
|
-
bronze: { base: "#6E6246", _light: "#6A6354" },
|
|
222
|
-
tint: amberTint,
|
|
223
|
-
},
|
|
224
|
-
/* A soft violet. */
|
|
225
|
-
violet: {
|
|
226
|
-
greys: leanedGreys({ base: "#817F84", _light: "#817F83" }),
|
|
227
|
-
accent: { base: "#B4A8FF", _light: "#5B4BC9" },
|
|
228
|
-
primary: { base: "#BDB2FF", _light: "#5A4BC3" },
|
|
229
|
-
status: {
|
|
230
|
-
green: { text: { base: "#4FB89C", _light: "#316554" } },
|
|
231
|
-
red: { text: { base: "#F76B5A", _light: "#8E433A" } },
|
|
232
|
-
yellow: { text: { base: "#DDB868", _light: "#69582A" } },
|
|
233
|
-
blue: { text: { base: "#6DB5F1", _light: "#325F87" } },
|
|
234
|
-
},
|
|
235
|
-
bronze: { base: "#716046", _light: "#6C6454" },
|
|
236
|
-
tint: amberTint,
|
|
237
|
-
},
|
|
238
|
-
/* A warm terracotta; error keeps to a cooler crimson so the two stay apart. */
|
|
239
|
-
ember: {
|
|
240
|
-
greys: leanedGreys({ base: "#82807D", _light: "#82817E" }),
|
|
241
|
-
accent: { base: "#F3A07A", _light: "#A0492A" },
|
|
242
|
-
primary: { base: "#F5AB88", _light: "#A84E2C" },
|
|
243
|
-
status: {
|
|
244
|
-
green: { text: { base: "#4DB398", _light: "#2F6352" } },
|
|
245
|
-
red: { text: { base: "#F5675F", _light: "#9B3A3F" } },
|
|
246
|
-
yellow: { text: { base: "#E2BD66", _light: "#69582A" } },
|
|
247
|
-
blue: { text: { base: "#6DB5F1", _light: "#325F87" } },
|
|
248
|
-
},
|
|
249
|
-
bronze: { base: "#7A5E3E", _light: "#70624F" },
|
|
250
|
-
tint: {
|
|
251
|
-
face: { base: "#FFE0C5", _light: "#F3EEE9" },
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
};
|