basalt-ui 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +46 -0
- package/README.md +64 -8
- package/agent/rules/basalt-app.md +126 -0
- package/agent/rules/basalt-content.md +3 -1
- package/agent/rules/basalt-tokens.md +14 -5
- package/agent/skills/basalt-app/SKILL.md +28 -7
- package/dist/agent/part-list.d.ts.map +1 -1
- package/dist/agent/part-list.js +17 -7
- package/dist/agent/stick-to-bottom.js +2 -2
- package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
- package/dist/agent-chat/thread-detail-panel.js +37 -33
- package/dist/agent-chat/thread-message.d.ts.map +1 -1
- package/dist/agent-chat/thread-message.js +8 -5
- package/dist/agent-chat/thread-outcome-card.js +3 -3
- package/dist/agent-chat/thread-workspace.js +1 -1
- package/dist/charts/primitives/ChartLegend.js +2 -0
- package/dist/charts/primitives/ChartTooltip.js +2 -1
- package/dist/cli/index.d.ts +29 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +80 -9
- package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
- package/dist/connectivity/connectivity-indicator.js +3 -3
- package/dist/content/article-card.module.css +7 -5
- package/dist/content/article-layout.module.css +16 -12
- package/dist/content/callout.module.css +4 -4
- package/dist/content/code-block.module.css +8 -7
- package/dist/content/guide.module.css +3 -3
- package/dist/content/mermaid.module.css +2 -2
- package/dist/content/prose.module.css +59 -29
- package/dist/content/reading-progress.module.css +2 -0
- package/dist/content/toc.module.css +6 -3
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +10 -2
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +3 -16
- package/dist/dashboard/settings-section.js +2 -2
- package/dist/dashboard/settings-section.module.css +2 -2
- package/dist/dashboard/stat-card.js +2 -1
- package/dist/data/virtual-list.d.ts.map +1 -1
- package/dist/data/virtual-list.js +12 -2
- package/dist/forms/FormErrorSummary.js +2 -2
- package/dist/guard/index.d.ts +20 -4
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +266 -38
- package/dist/guard/types.d.ts +24 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/provider/index.d.ts +30 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +32 -7
- package/dist/provider/lab-theme.d.ts +39 -0
- package/dist/provider/lab-theme.d.ts.map +1 -0
- package/dist/provider/lab-theme.js +52 -0
- package/dist/shell/app-header.module.css +2 -2
- package/dist/shell/app-mobile-nav.module.css +1 -1
- package/dist/shell/app-sidebar-account.d.ts.map +1 -1
- package/dist/shell/app-sidebar-account.js +4 -2
- package/dist/shell/app-sidebar.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +4 -2
- package/dist/shell/app-sidebar.module.css +36 -26
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +11 -4
- package/dist/shell/sidebar-search.module.css +16 -4
- package/dist/styles.css +22 -11
- package/dist/surfaces.d.ts +21 -11
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +10 -3
- package/dist/theme/controls.module.css +1 -1
- package/dist/theme/floating.module.css +1 -1
- package/dist/theme/index.d.ts +116 -11
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +703 -566
- package/dist/theme/nav-link.module.css +1 -1
- package/dist/theme/use-basalt-spacing.d.ts +3 -0
- package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
- package/dist/theme/use-basalt-spacing.js +8 -0
- package/dist/theme-lab/derive-controls.d.ts +13 -0
- package/dist/theme-lab/derive-controls.d.ts.map +1 -0
- package/dist/theme-lab/derive-controls.js +137 -0
- package/dist/theme-lab/derive-state.d.ts +55 -0
- package/dist/theme-lab/derive-state.d.ts.map +1 -0
- package/dist/theme-lab/derive-state.js +81 -0
- package/dist/theme-lab/index.d.ts +12 -2
- package/dist/theme-lab/index.d.ts.map +1 -1
- package/dist/theme-lab/index.js +13 -62
- package/dist/theme-toggle/index.d.ts.map +1 -1
- package/dist/theme-toggle/index.js +3 -2
- package/dist/tokens/derive.d.ts +89 -0
- package/dist/tokens/derive.d.ts.map +1 -0
- package/dist/tokens/derive.js +250 -0
- package/dist/tokens/hct.d.ts +34 -0
- package/dist/tokens/hct.d.ts.map +1 -0
- package/dist/tokens/hct.js +159 -0
- package/dist/tokens/index.d.ts +143 -7
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +322 -48
- package/dist/tokens/palette.d.ts +984 -167
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +617 -119
- package/dist/tokens.css +248 -0
- package/dist/vite-color-mix.d.ts +30 -0
- package/dist/vite-color-mix.d.ts.map +1 -0
- package/dist/vite-color-mix.js +80 -0
- package/dist/vite.d.ts +82 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +312 -0
- package/llms.txt +14 -4
- package/package.json +41 -10
- package/src/agent/part-list.tsx +13 -7
- package/src/agent/stick-to-bottom.tsx +2 -2
- package/src/agent-chat/thread-detail-panel.tsx +13 -10
- package/src/agent-chat/thread-message.tsx +8 -5
- package/src/agent-chat/thread-outcome-card.tsx +2 -2
- package/src/agent-chat/thread-workspace.tsx +2 -2
- package/src/charts/primitives/ChartLegend.tsx +2 -2
- package/src/charts/primitives/ChartTooltip.tsx +2 -2
- package/src/cli/check-theme.test.ts +18 -0
- package/src/cli/index.ts +129 -6
- package/src/cli/tokens-css.test.ts +90 -0
- package/src/connectivity/connectivity-indicator.tsx +8 -2
- package/src/content/article-card.module.css +7 -5
- package/src/content/article-layout.module.css +16 -12
- package/src/content/callout.module.css +4 -4
- package/src/content/code-block.module.css +8 -7
- package/src/content/guide.module.css +3 -3
- package/src/content/mermaid.module.css +2 -2
- package/src/content/prose.module.css +59 -29
- package/src/content/prose.module.css.test.ts +55 -0
- package/src/content/reading-progress.module.css +2 -0
- package/src/content/toc.module.css +6 -3
- package/src/dashboard/delta-badge.tsx +10 -4
- package/src/dashboard/empty-state.tsx +3 -16
- package/src/dashboard/settings-section.module.css +2 -2
- package/src/dashboard/settings-section.tsx +2 -2
- package/src/dashboard/stat-card.tsx +2 -2
- package/src/data/virtual-list.tsx +12 -2
- package/src/forms/FormErrorSummary.tsx +1 -1
- package/src/guard/check-source.test.ts +483 -15
- package/src/guard/index.ts +426 -47
- package/src/guard/types.ts +24 -2
- package/src/index.ts +1 -0
- package/src/provider/index.test.tsx +100 -0
- package/src/provider/index.tsx +79 -7
- package/src/provider/lab-theme.test.ts +147 -0
- package/src/provider/lab-theme.ts +166 -0
- package/src/shell/app-header.module.css +2 -2
- package/src/shell/app-mobile-nav.module.css +1 -1
- package/src/shell/app-sidebar-account.tsx +9 -2
- package/src/shell/app-sidebar.module.css +36 -26
- package/src/shell/app-sidebar.tsx +12 -2
- package/src/shell/index.tsx +14 -3
- package/src/shell/sidebar-search.module.css +16 -4
- package/src/styles.css +22 -11
- package/src/surfaces.ts +24 -10
- package/src/theme/contrast.test.ts +19 -3
- package/src/theme/controls.module.css +1 -1
- package/src/theme/density-option.test.ts +96 -0
- package/src/theme/density-relations.test.ts +428 -0
- package/src/theme/derive-theme.test.ts +101 -0
- package/src/theme/floating.module.css +1 -1
- package/src/theme/fonts-option.test.ts +69 -0
- package/src/theme/index.ts +930 -563
- package/src/theme/nav-link.module.css +1 -1
- package/src/theme/radius-option.test.ts +86 -0
- package/src/theme/radius.test.ts +132 -0
- package/src/theme/spacing.test.ts +432 -0
- package/src/theme/use-basalt-spacing.test.tsx +51 -0
- package/src/theme/use-basalt-spacing.ts +38 -0
- package/src/theme-lab/derive-controls.test.ts +94 -0
- package/src/theme-lab/derive-controls.tsx +227 -0
- package/src/theme-lab/derive-state.test.ts +71 -0
- package/src/theme-lab/derive-state.ts +163 -0
- package/src/theme-lab/index.tsx +29 -68
- package/src/theme-lab/theme-lab.test.ts +4 -18
- package/src/theme-toggle/index.tsx +9 -4
- package/src/tokens/build-fonts-css.test.ts +51 -0
- package/src/tokens/build-radius-css.test.ts +25 -0
- package/src/tokens/density.test.ts +274 -0
- package/src/tokens/derive-radius.test.ts +62 -0
- package/src/tokens/derive.test.ts +30 -0
- package/src/tokens/derive.ts +481 -0
- package/src/tokens/hct.ts +231 -0
- package/src/tokens/index.ts +534 -48
- package/src/tokens/palette.test.ts +114 -0
- package/src/tokens/palette.ts +1118 -180
- package/src/vite-color-mix.test.ts +46 -0
- package/src/vite-color-mix.ts +137 -0
- package/src/vite.test.ts +192 -0
- package/src/vite.ts +502 -1
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--vx-radius-card: 7px;
|
|
3
|
+
--vx-radius-ctrl: 6px;
|
|
4
|
+
--vx-radius-tight: 5px;
|
|
5
|
+
--vx-radius-fine: 4px;
|
|
6
|
+
--vx-radius-floating: 8px;
|
|
7
|
+
--vx-radius-pill: 9999px;
|
|
8
|
+
--vx-space-row-inset-x: 10px;
|
|
9
|
+
--vx-space-row-inset-y: 6px;
|
|
10
|
+
--vx-space-row-line-height: 1.35;
|
|
11
|
+
--vx-space-input-height: 2.625rem;
|
|
12
|
+
--vx-space-control-height: 2.625rem;
|
|
13
|
+
--vx-space-stack-xs: 4px;
|
|
14
|
+
--vx-space-stack-sm: 8px;
|
|
15
|
+
--vx-space-stack-md: 12px;
|
|
16
|
+
--vx-space-stack-lg: 16px;
|
|
17
|
+
--vx-space-stack-xl: 24px;
|
|
18
|
+
--vx-space-sticky-header-clearance: 60px;
|
|
19
|
+
--vx-space-sticky-header-clearance-mobile: 109px;
|
|
20
|
+
--vx-space-nav-icon-gap: 10px;
|
|
21
|
+
--vx-space-sidebar-region-gap: 10px;
|
|
22
|
+
--vx-space-prose-quote-inset-y: 2px;
|
|
23
|
+
--vx-space-prose-quote-indent: 12px;
|
|
24
|
+
--vx-space-prose-inline-code-inset-y: 1.5px;
|
|
25
|
+
--vx-space-prose-inline-code-inset-x: 5px;
|
|
26
|
+
--vx-space-prose-code-block-inset-y: 10px;
|
|
27
|
+
--vx-space-prose-code-block-inset-x: 12px;
|
|
28
|
+
--vx-space-prose-heading-anchor-gap: 6px;
|
|
29
|
+
--vx-space-prose-table-cell-inset-y: 5px;
|
|
30
|
+
--vx-space-prose-table-cell-inset-x: 8px;
|
|
31
|
+
--vx-space-prose-chat-list-gap-bottom: 10px;
|
|
32
|
+
--vx-space-prose-chat-list-indent: 20px;
|
|
33
|
+
--vx-space-prose-chat-list-item-gap: 3px;
|
|
34
|
+
--vx-space-prose-chat-nested-list-gap: 2px;
|
|
35
|
+
--vx-space-prose-chat-heading-gap-top: 14px;
|
|
36
|
+
--vx-space-prose-chat-heading-gap-bottom: 6px;
|
|
37
|
+
--vx-space-prose-article-paragraph-gap: 14px;
|
|
38
|
+
--vx-space-prose-article-list-gap-top: 6px;
|
|
39
|
+
--vx-space-prose-article-list-gap-bottom: 14px;
|
|
40
|
+
--vx-space-prose-article-list-indent: 22px;
|
|
41
|
+
--vx-space-prose-article-h1-gap-top: 6px;
|
|
42
|
+
--vx-space-prose-article-h1-gap-bottom: 14px;
|
|
43
|
+
--vx-space-prose-article-heading-gap-top: 30px;
|
|
44
|
+
--vx-space-prose-article-heading-gap-bottom: 10px;
|
|
45
|
+
--vx-space-prose-article-h2-rule-gap: 6px;
|
|
46
|
+
--vx-space-prose-article-block-gap: 18px;
|
|
47
|
+
--vx-space-article-column-gap: 56px;
|
|
48
|
+
--vx-space-article-toc-rail-width: 220px;
|
|
49
|
+
--vx-space-article-header-gap: 10px;
|
|
50
|
+
--vx-space-article-header-padding-bottom: 20px;
|
|
51
|
+
--vx-space-article-header-margin-bottom: 28px;
|
|
52
|
+
--vx-space-article-meta-row-gap: 6px;
|
|
53
|
+
--vx-space-article-footer-gap: 12px;
|
|
54
|
+
--vx-space-article-footer-margin-top: 40px;
|
|
55
|
+
--vx-space-article-footer-padding-top: 20px;
|
|
56
|
+
--vx-space-article-nav-target-gap: 6px;
|
|
57
|
+
--vx-space-code-block-header-gap: 8px;
|
|
58
|
+
--vx-space-code-block-header-inset-y: 6px;
|
|
59
|
+
--vx-space-code-block-header-inset-right: 10px;
|
|
60
|
+
--vx-space-code-block-content-inset-x: 14px;
|
|
61
|
+
--vx-space-code-block-header-right-gap: 6px;
|
|
62
|
+
--vx-space-code-block-body-inset-y: 10px;
|
|
63
|
+
--vx-space-code-block-floating-copy-offset: 6px;
|
|
64
|
+
--vx-space-callout-inset-y: 10px;
|
|
65
|
+
--vx-space-callout-inset-x: 14px;
|
|
66
|
+
--vx-space-callout-title-row-gap: 8px;
|
|
67
|
+
--vx-space-toc-root-gap: 6px;
|
|
68
|
+
--vx-space-toc-link-inset-y: 4px;
|
|
69
|
+
--vx-space-toc-link-indent: 12px;
|
|
70
|
+
--vx-space-toc-sub-indent: 24px;
|
|
71
|
+
--vx-space-article-card-tags-gap: 4px;
|
|
72
|
+
--vx-space-article-card-tag-inset-y: 1px;
|
|
73
|
+
--vx-space-article-card-tag-inset-x: 6px;
|
|
74
|
+
--vx-space-article-card-meta-gap-top: 2px;
|
|
75
|
+
--vx-space-guide-body-gap-bottom: 8px;
|
|
76
|
+
--vx-space-guide-footer-gap-top: 20px;
|
|
77
|
+
--vx-space-guide-footer-inset-top: 16px;
|
|
78
|
+
--vx-space-sidebar-search-gap: 7px;
|
|
79
|
+
--vx-space-sidebar-search-trigger-height: 32px;
|
|
80
|
+
--vx-space-settings-row-inset-y: 10px;
|
|
81
|
+
--vx-space-settings-row-gap: 16px;
|
|
82
|
+
--vx-space-mermaid-container-inset: 16px;
|
|
83
|
+
--vx-space-sidebar-brand-inset-top: 2px;
|
|
84
|
+
--vx-space-sidebar-brand-inset-x: 7px;
|
|
85
|
+
--vx-space-sidebar-section-gap: 12px;
|
|
86
|
+
--vx-space-sidebar-account-inset-top: 9px;
|
|
87
|
+
--vx-space-sidebar-account-inset-x: 7px;
|
|
88
|
+
--vx-space-sidebar-account-inset-bottom: 2px;
|
|
89
|
+
--vx-space-sidebar-avatar-size: 28px;
|
|
90
|
+
--vx-space-sidebar-section-label-gap: 2px;
|
|
91
|
+
--vx-space-sidebar-child-list-gap-top: 2px;
|
|
92
|
+
--vx-space-sidebar-child-list-gap-bottom: 3px;
|
|
93
|
+
--vx-space-sidebar-child-list-indent: 15px;
|
|
94
|
+
--vx-space-sidebar-child-row-inset-y: 4px;
|
|
95
|
+
--vx-space-sidebar-child-row-indent: 12px;
|
|
96
|
+
--vx-space-app-header-mobile-actions-height: 52px;
|
|
97
|
+
--vx-space-mobile-nav-tab-gap: 3px;
|
|
98
|
+
--vx-space-agent-rail-inset-x: 10px;
|
|
99
|
+
--vx-space-agent-part-gap-top: 6px;
|
|
100
|
+
--vx-space-agent-code-inset: 8px;
|
|
101
|
+
--vx-space-agent-error-inset-y: 8px;
|
|
102
|
+
--vx-space-agent-error-inset-x: 10px;
|
|
103
|
+
--vx-space-agent-scroll-button-gap-top: 8px;
|
|
104
|
+
--vx-space-agent-message-inset-y: 10px;
|
|
105
|
+
--vx-space-agent-message-inset-x: 12px;
|
|
106
|
+
--vx-space-agent-transcript-inset: 16px;
|
|
107
|
+
--vx-space-badge-inset-y: 2px;
|
|
108
|
+
--vx-space-badge-inset-x: 7px;
|
|
109
|
+
--vx-space-stat-card-gap: 8px;
|
|
110
|
+
--vx-space-virtual-row-inset-y: 8px;
|
|
111
|
+
--vx-space-virtual-row-inset-x: 12px;
|
|
112
|
+
--vx-prose-measure: 72ch;
|
|
113
|
+
--vx-fill-gray: #717176;
|
|
114
|
+
--vx-fill-red: #b7514e;
|
|
115
|
+
--vx-fill-pink: #ba4b6c;
|
|
116
|
+
--vx-fill-grape: #9e579c;
|
|
117
|
+
--vx-fill-violet: #9e579c;
|
|
118
|
+
--vx-fill-indigo: #7863bc;
|
|
119
|
+
--vx-fill-cyan: #43769a;
|
|
120
|
+
--vx-fill-teal: #3a7c74;
|
|
121
|
+
--vx-fill-green: #427e3f;
|
|
122
|
+
--vx-fill-lime: #687737;
|
|
123
|
+
--vx-fill-yellow: #8d6c2e;
|
|
124
|
+
--vx-fill-orange: #9a6632;
|
|
125
|
+
--vx-fillHover-gray: color-mix(in srgb, var(--vx-fill-gray) 88%, #000);
|
|
126
|
+
--vx-fillHover-red: color-mix(in srgb, var(--vx-fill-red) 88%, #000);
|
|
127
|
+
--vx-fillHover-pink: color-mix(in srgb, var(--vx-fill-pink) 88%, #000);
|
|
128
|
+
--vx-fillHover-grape: color-mix(in srgb, var(--vx-fill-grape) 88%, #000);
|
|
129
|
+
--vx-fillHover-violet: color-mix(in srgb, var(--vx-fill-violet) 88%, #000);
|
|
130
|
+
--vx-fillHover-indigo: color-mix(in srgb, var(--vx-fill-indigo) 88%, #000);
|
|
131
|
+
--vx-fillHover-cyan: color-mix(in srgb, var(--vx-fill-cyan) 88%, #000);
|
|
132
|
+
--vx-fillHover-teal: color-mix(in srgb, var(--vx-fill-teal) 88%, #000);
|
|
133
|
+
--vx-fillHover-green: color-mix(in srgb, var(--vx-fill-green) 88%, #000);
|
|
134
|
+
--vx-fillHover-lime: color-mix(in srgb, var(--vx-fill-lime) 88%, #000);
|
|
135
|
+
--vx-fillHover-yellow: color-mix(in srgb, var(--vx-fill-yellow) 88%, #000);
|
|
136
|
+
--vx-fillHover-orange: color-mix(in srgb, var(--vx-fill-orange) 88%, #000);
|
|
137
|
+
--vx-text-micro: 11px;
|
|
138
|
+
--vx-text-xs: 12.5px;
|
|
139
|
+
--vx-text-sm: 13.5px;
|
|
140
|
+
--vx-text-md: 15px;
|
|
141
|
+
--vx-text-lg: 16px;
|
|
142
|
+
--vx-text-xl: 18px;
|
|
143
|
+
--vx-text-h2: 21px;
|
|
144
|
+
--vx-text-kpi: 24px;
|
|
145
|
+
--vx-text-h1: 26px;
|
|
146
|
+
--vx-area-top: 22%;
|
|
147
|
+
--vx-area-bottom: 1%;
|
|
148
|
+
--vx-good: color-mix(in srgb, var(--vx-goodSolid) 18%, transparent);
|
|
149
|
+
--vx-goodSoft: color-mix(in srgb, var(--vx-goodSolid) 8%, transparent);
|
|
150
|
+
--vx-bad: color-mix(in srgb, var(--vx-badSolid) 18%, transparent);
|
|
151
|
+
--vx-warn: color-mix(in srgb, var(--vx-warnSolid) 8%, transparent);
|
|
152
|
+
--vx-goodRef: color-mix(in srgb, var(--vx-goodSolid) 30%, transparent);
|
|
153
|
+
--vx-badRef: color-mix(in srgb, var(--vx-badSolid) 30%, transparent);
|
|
154
|
+
--vx-warnRef: color-mix(in srgb, var(--vx-warnSolid) 20%, transparent);
|
|
155
|
+
}
|
|
156
|
+
:root,
|
|
157
|
+
html[data-mantine-color-scheme='dark'] {
|
|
158
|
+
--vx-status-excellent: #43bf4d;
|
|
159
|
+
--vx-status-good: #52c07c;
|
|
160
|
+
--vx-status-warn: #e6a53d;
|
|
161
|
+
--vx-status-bad: #e06761;
|
|
162
|
+
--vx-status-neutral: #a1a1aa;
|
|
163
|
+
--vx-goodSolid: #52c07c;
|
|
164
|
+
--vx-badSolid: #e06761;
|
|
165
|
+
--vx-warnSolid: #e6a53d;
|
|
166
|
+
--vx-neutral: #d4d4d8;
|
|
167
|
+
--vx-line: #e4e4e7;
|
|
168
|
+
--vx-line2: #a1a1aa;
|
|
169
|
+
--vx-axis: rgba(255,255,255,0.6);
|
|
170
|
+
--vx-axisStroke: rgba(255,255,255,0.12);
|
|
171
|
+
--vx-grid: rgba(255,255,255,0.06);
|
|
172
|
+
--vx-crosshair: rgba(255,255,255,0.42);
|
|
173
|
+
--vx-dotStroke: #27272a;
|
|
174
|
+
--vx-tooltipBg: rgba(39,39,42,0.96);
|
|
175
|
+
--vx-tooltipText: rgba(255,255,255,0.88);
|
|
176
|
+
--vx-tooltipMuted: rgba(255,255,255,0.5);
|
|
177
|
+
--vx-tooltipBorder: none;
|
|
178
|
+
--vx-tooltipShadow: 0 2px 8px rgba(0,0,0,0.35);
|
|
179
|
+
--vx-legendText: rgba(255,255,255,0.92);
|
|
180
|
+
--vx-ink: #e5e5e9;
|
|
181
|
+
--vx-ink2: #dddde1;
|
|
182
|
+
--vx-muted: #d4d4d8;
|
|
183
|
+
--vx-faint: #a1a1a4;
|
|
184
|
+
--vx-accent: #a2c3f0;
|
|
185
|
+
--vx-accentHover: #65a2e3;
|
|
186
|
+
--vx-accentFill: #4374a6;
|
|
187
|
+
--vx-accentFillHover: #3c6895;
|
|
188
|
+
--vx-onAccent: #ffffff;
|
|
189
|
+
--vx-divider: color-mix(in srgb, #ffffff 6%, transparent);
|
|
190
|
+
--vx-shadow-card: 0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px color-mix(in srgb, #ffffff 4%, transparent);
|
|
191
|
+
--vx-shadow-ctrl: 0 1px 2px rgba(0,0,0,0.35);
|
|
192
|
+
--vx-shadow-overlay: 0 8px 24px rgba(0,0,0,0.5);
|
|
193
|
+
--vx-surface-bg: #27272a;
|
|
194
|
+
--vx-surface-panel: #2b2b2e;
|
|
195
|
+
--vx-surface-panelHover: #38383b;
|
|
196
|
+
--vx-surface-elevated: #38383b;
|
|
197
|
+
--vx-surface-subtle: #323235;
|
|
198
|
+
--vx-surface-overlay: color-mix(in srgb, #3f3f46 50%, #27272a);
|
|
199
|
+
--vx-surface-field: #27272a;
|
|
200
|
+
--vx-surface-border: #444447;
|
|
201
|
+
--vx-surface-hairline: #4e4e51;
|
|
202
|
+
}
|
|
203
|
+
html[data-mantine-color-scheme='light'] {
|
|
204
|
+
--vx-status-excellent: #29a634;
|
|
205
|
+
--vx-status-good: #327a4d;
|
|
206
|
+
--vx-status-warn: #b07808;
|
|
207
|
+
--vx-status-bad: #b5403d;
|
|
208
|
+
--vx-status-neutral: #71717a;
|
|
209
|
+
--vx-goodSolid: #327a4d;
|
|
210
|
+
--vx-badSolid: #b5403d;
|
|
211
|
+
--vx-warnSolid: #b07808;
|
|
212
|
+
--vx-neutral: #525255;
|
|
213
|
+
--vx-line: #52525c;
|
|
214
|
+
--vx-line2: #71717a;
|
|
215
|
+
--vx-axis: rgba(38, 38, 41, 0.6);
|
|
216
|
+
--vx-axisStroke: rgba(38, 38, 41, 0.12);
|
|
217
|
+
--vx-grid: rgba(38, 38, 41, 0.07);
|
|
218
|
+
--vx-crosshair: rgba(38, 38, 41, 0.32);
|
|
219
|
+
--vx-dotStroke: #ffffff;
|
|
220
|
+
--vx-tooltipBg: #ffffff;
|
|
221
|
+
--vx-tooltipText: rgba(38, 38, 41, 0.88);
|
|
222
|
+
--vx-tooltipMuted: rgba(38, 38, 41, 0.5);
|
|
223
|
+
--vx-tooltipBorder: 1px solid #e4e4e7;
|
|
224
|
+
--vx-tooltipShadow: 0 2px 8px rgba(38, 38, 41, 0.1);
|
|
225
|
+
--vx-legendText: rgba(38, 38, 41, 0.82);
|
|
226
|
+
--vx-ink: #262629;
|
|
227
|
+
--vx-ink2: #404043;
|
|
228
|
+
--vx-muted: #525255;
|
|
229
|
+
--vx-faint: #737376;
|
|
230
|
+
--vx-accent: #4374a6;
|
|
231
|
+
--vx-accentHover: #3c6895;
|
|
232
|
+
--vx-accentFill: #4374a6;
|
|
233
|
+
--vx-accentFillHover: #3c6895;
|
|
234
|
+
--vx-onAccent: #ffffff;
|
|
235
|
+
--vx-divider: color-mix(in srgb, #e5e5e5 65%, transparent);
|
|
236
|
+
--vx-shadow-card: 0 1px 2px rgba(28,25,23,0.05), 0 0 0 1px var(--vx-surface-hairline);
|
|
237
|
+
--vx-shadow-ctrl: 0 1px 2px rgba(28,25,23,0.12);
|
|
238
|
+
--vx-shadow-overlay: 0 8px 24px rgba(28,25,23,0.10);
|
|
239
|
+
--vx-surface-bg: #f2f2f5;
|
|
240
|
+
--vx-surface-panel: #fafafd;
|
|
241
|
+
--vx-surface-panelHover: #ffffff;
|
|
242
|
+
--vx-surface-elevated: #ffffff;
|
|
243
|
+
--vx-surface-subtle: #f4f4f8;
|
|
244
|
+
--vx-surface-overlay: #ffffff;
|
|
245
|
+
--vx-surface-field: #ffffff;
|
|
246
|
+
--vx-surface-border: #e2e2e5;
|
|
247
|
+
--vx-surface-hairline: #eaeaee;
|
|
248
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vite-color-mix.ts — resolves CSS `color-mix(in srgb, A [p%], B [p%])` expressions down to a
|
|
3
|
+
* flat hex string.
|
|
4
|
+
*
|
|
5
|
+
* Why this exists: `SURFACE.bg` in `tokens/palette.ts` holds `color-mix()` expressions (not hex),
|
|
6
|
+
* because the page background is a deliberate mix of two zinc stops. `<meta name="theme-color">`
|
|
7
|
+
* and the web manifest's `theme_color` both require a FLAT color — `color-mix()` cannot appear
|
|
8
|
+
* there — so consumers were hand-approximating the mix and getting it wrong (argo shipped
|
|
9
|
+
* `#EDEFF2`/`#242424`, both incorrect). This resolver computes the exact flat value at build time
|
|
10
|
+
* instead, which is the core value `basaltAppPlugin` (in `./vite.ts`) adds over a hand-authored
|
|
11
|
+
* PWA/head-metadata config.
|
|
12
|
+
*
|
|
13
|
+
* Internal to the `./vite` subpath only — deliberately NOT re-exported from `vite.ts`, so it never
|
|
14
|
+
* becomes part of the published surface (see `scripts/export-surface.json`).
|
|
15
|
+
*
|
|
16
|
+
* Supports: plain hex passthrough (`#rgb` / `#rrggbb`), a small set of trivial named colors, and
|
|
17
|
+
* one or more levels of nested `color-mix(in srgb, A [p%], B [p%])` — sRGB channel lerp on the
|
|
18
|
+
* 0-255 channels, round-half-up. Anything else (other color spaces, non-trivial named colors,
|
|
19
|
+
* `rgb()`/`hsl()` functions) throws a clear error naming the unresolvable input.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Resolves a color-mix expression (or a plain hex / trivial named color) to a flat lowercase hex
|
|
23
|
+
* string. Percentage semantics per CSS `color-mix()`: `A p%` means A contributes `p%`, B
|
|
24
|
+
* contributes `(100 - p)%`; if neither side carries a percentage, the mix is 50/50.
|
|
25
|
+
*
|
|
26
|
+
* @throws {Error} when the input is not hex, a trivial named color, or a `color-mix(in srgb, ...)`
|
|
27
|
+
* expression (e.g. another color space, `rgb()`/`hsl()`, or a non-trivial named color).
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveColorMix(input: string): string;
|
|
30
|
+
//# sourceMappingURL=vite-color-mix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-color-mix.d.ts","sourceRoot":"","sources":["../src/vite-color-mix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAoEH;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAyCrD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const NAMED_COLORS = {
|
|
2
|
+
white: "#ffffff",
|
|
3
|
+
// theme-allow — CSS keyword definition, not a design color
|
|
4
|
+
black: "#000000"
|
|
5
|
+
// theme-allow — CSS keyword definition, not a design color
|
|
6
|
+
};
|
|
7
|
+
function normalizeHex(hex) {
|
|
8
|
+
const body = hex.slice(1);
|
|
9
|
+
const full = body.length === 3 ? body.split("").map((c) => c + c).join("") : body;
|
|
10
|
+
return `#${full.toLowerCase()}`;
|
|
11
|
+
}
|
|
12
|
+
function hexToRgb(hex) {
|
|
13
|
+
const normalized = normalizeHex(hex);
|
|
14
|
+
const value = Number.parseInt(normalized.slice(1), 16);
|
|
15
|
+
return [value >> 16 & 255, value >> 8 & 255, value & 255];
|
|
16
|
+
}
|
|
17
|
+
function channelToHex(channel) {
|
|
18
|
+
return channel.toString(16).padStart(2, "0");
|
|
19
|
+
}
|
|
20
|
+
function rgbToHex(channels) {
|
|
21
|
+
return `#${channelToHex(channels[0])}${channelToHex(channels[1])}${channelToHex(channels[2])}`;
|
|
22
|
+
}
|
|
23
|
+
function splitTopLevel(input) {
|
|
24
|
+
const parts = [];
|
|
25
|
+
let depth = 0;
|
|
26
|
+
let current = "";
|
|
27
|
+
for (const char of input) {
|
|
28
|
+
if (char === "(") depth++;
|
|
29
|
+
if (char === ")") depth--;
|
|
30
|
+
if (char === "," && depth === 0) {
|
|
31
|
+
parts.push(current.trim());
|
|
32
|
+
current = "";
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
current += char;
|
|
36
|
+
}
|
|
37
|
+
parts.push(current.trim());
|
|
38
|
+
return parts;
|
|
39
|
+
}
|
|
40
|
+
function splitColorAndPercent(component) {
|
|
41
|
+
const trimmed = component.trim();
|
|
42
|
+
const match = /^(.+?)\s+(\d+(?:\.\d+)?)%$/.exec(trimmed);
|
|
43
|
+
if (!match) return { color: trimmed, percent: null };
|
|
44
|
+
return { color: match[1].trim(), percent: Number(match[2]) };
|
|
45
|
+
}
|
|
46
|
+
function resolveColorMix(input) {
|
|
47
|
+
const trimmed = input.trim();
|
|
48
|
+
if (/^#[0-9a-fA-F]{3}$/.test(trimmed) || /^#[0-9a-fA-F]{6}$/.test(trimmed)) {
|
|
49
|
+
return normalizeHex(trimmed);
|
|
50
|
+
}
|
|
51
|
+
const named = NAMED_COLORS[trimmed.toLowerCase()];
|
|
52
|
+
if (named !== void 0) return named;
|
|
53
|
+
const mixMatch = /^color-mix\(\s*in\s+srgb\s*,\s*([\s\S]+)\)$/i.exec(trimmed);
|
|
54
|
+
if (!mixMatch) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`Unresolvable color-mix input: "${input}" \u2014 only hex (#rgb/#rrggbb), "white"/"black", and color-mix(in srgb, ...) are supported.`
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const components = splitTopLevel(mixMatch[1]);
|
|
60
|
+
const [colorAComponent, colorBComponent] = components;
|
|
61
|
+
if (components.length !== 2 || colorAComponent === void 0 || colorBComponent === void 0) {
|
|
62
|
+
throw new Error(`Malformed color-mix() expression: "${input}"`);
|
|
63
|
+
}
|
|
64
|
+
const a = splitColorAndPercent(colorAComponent);
|
|
65
|
+
const b = splitColorAndPercent(colorBComponent);
|
|
66
|
+
let percentA;
|
|
67
|
+
if (a.percent !== null) percentA = a.percent;
|
|
68
|
+
else if (b.percent !== null) percentA = 100 - b.percent;
|
|
69
|
+
else percentA = 50;
|
|
70
|
+
const rgbA = hexToRgb(resolveColorMix(a.color));
|
|
71
|
+
const rgbB = hexToRgb(resolveColorMix(b.color));
|
|
72
|
+
const percentB = 100 - percentA;
|
|
73
|
+
const mixed = [0, 1, 2].map(
|
|
74
|
+
(i) => Math.round((rgbA[i] * percentA + rgbB[i] * percentB) / 100)
|
|
75
|
+
);
|
|
76
|
+
return rgbToHex(mixed);
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
resolveColorMix
|
|
80
|
+
};
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UserConfig } from 'vite';
|
|
1
|
+
import type { PluginOption, UserConfig } from 'vite';
|
|
2
2
|
export type BasaltViteOptions = {
|
|
3
3
|
/** Dev server port. Passed with `strictPort: true` so the app fails fast on a busy port. */
|
|
4
4
|
port: number;
|
|
@@ -27,4 +27,85 @@ export type BasaltViteOptions = {
|
|
|
27
27
|
version?: string;
|
|
28
28
|
};
|
|
29
29
|
export declare function basaltViteConfig(opts: BasaltViteOptions): UserConfig;
|
|
30
|
+
export type BasaltAppOptions = {
|
|
31
|
+
/** App display name — used verbatim as the manifest `name` and (unless overridden) OG title. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Short name for home-screen labels. Default: `name`. */
|
|
34
|
+
shortName?: string;
|
|
35
|
+
/** Site-wide description — feeds the `<meta name="description">` and OG/Twitter description. */
|
|
36
|
+
description?: string;
|
|
37
|
+
/**
|
|
38
|
+
* `'auto'` (default) resolves the flat theme-color pair from `SURFACE.bg` (basalt's own page
|
|
39
|
+
* background token, a `color-mix()` expression) via the color-mix resolver — the reason this
|
|
40
|
+
* plugin exists. Pass an explicit `{ light, dark }` pair of already-flat CSS colors to override.
|
|
41
|
+
*/
|
|
42
|
+
themeColor?: 'auto' | {
|
|
43
|
+
light: string;
|
|
44
|
+
dark: string;
|
|
45
|
+
};
|
|
46
|
+
/** Manifest `background_color` + anti-FOUC paint color. Default: the resolved dark theme color. */
|
|
47
|
+
backgroundColor?: string;
|
|
48
|
+
/** Manifest `display` mode. Default: `'standalone'`. */
|
|
49
|
+
display?: 'standalone' | 'minimal-ui' | 'fullscreen' | 'browser';
|
|
50
|
+
/**
|
|
51
|
+
* Manifest `start_url`. Defaults to Vite's resolved `base` (so a non-root deploy — e.g. GitHub
|
|
52
|
+
* Pages' `/repo/` — gets a correct value with zero config). An explicit value is used verbatim:
|
|
53
|
+
* it is NOT re-prefixed with `base`, so pass the fully base-aware path yourself if you set it.
|
|
54
|
+
*/
|
|
55
|
+
startUrl?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Manifest `scope`. Defaults to Vite's resolved `base`. An explicit value is used verbatim (not
|
|
58
|
+
* re-prefixed with `base`) — same rule as `startUrl`.
|
|
59
|
+
*/
|
|
60
|
+
scope?: string;
|
|
61
|
+
/** Manifest `id`. Default: the resolved `startUrl` (default- or explicitly-derived, per above). */
|
|
62
|
+
id?: string;
|
|
63
|
+
/** Icon links + manifest icon paths. `false` skips the head `<link>` icons entirely. */
|
|
64
|
+
icons?: false | {
|
|
65
|
+
dir?: string;
|
|
66
|
+
};
|
|
67
|
+
/** Emits `<meta name="darkreader-lock">` when `'lock'` (default). Pass `false` to omit it. */
|
|
68
|
+
darkreader?: 'lock' | false;
|
|
69
|
+
/** Site-wide SEO metadata — only the keys provided are emitted, no per-page SEO. */
|
|
70
|
+
seo?: {
|
|
71
|
+
url?: string;
|
|
72
|
+
image?: string;
|
|
73
|
+
twitterCard?: 'summary' | 'summary_large_image';
|
|
74
|
+
};
|
|
75
|
+
/** `false` skips manifest generation/serving and the `<link rel="manifest">` tag entirely. */
|
|
76
|
+
manifest?: false;
|
|
77
|
+
/**
|
|
78
|
+
* Opt-in service worker via the optional peer `vite-plugin-pwa`. `true` uses argo-tuned workbox
|
|
79
|
+
* defaults; an object is deep-merged over those defaults. Default `false` (no service worker).
|
|
80
|
+
* Degrades to a one-line console warning (no service worker, no throw) when the peer — plus its
|
|
81
|
+
* non-optional peers `workbox-build` / `workbox-window` — is not installed.
|
|
82
|
+
*/
|
|
83
|
+
serviceWorker?: boolean | Record<string, unknown>;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Generates PWA / favicon / head metadata for a consumer app from one config object — a Vite
|
|
87
|
+
* plugin (well, plugin array — see the service-worker note below) placed in the consumer's own
|
|
88
|
+
* `plugins` array (never returned by `basaltViteConfig`, which stays plugin-free by contract).
|
|
89
|
+
*
|
|
90
|
+
* The core value over hand-authoring this yourself: `themeColor: 'auto'` (the default) derives
|
|
91
|
+
* the flat `<meta name="theme-color">` / manifest `theme_color` pair from basalt's own
|
|
92
|
+
* `SURFACE.bg` design token, so the value tracks the palette instead of being a copied hex that
|
|
93
|
+
* silently rots when the palette is retuned.
|
|
94
|
+
*
|
|
95
|
+
* `SURFACE.bg` is generated by `tokens/derive.ts` and currently resolves to plain hex, which the
|
|
96
|
+
* resolver passes through untouched. It is run through `resolveColorMix` anyway because the token
|
|
97
|
+
* layer has historically expressed surfaces as `color-mix()` and may again — a meta tag and a
|
|
98
|
+
* manifest `theme_color` both need a FLAT color, so the flattening step is the contract this
|
|
99
|
+
* plugin owes its output regardless of which shape the palette hands it.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* // vite.config.ts
|
|
103
|
+
* import { basaltAppPlugin, basaltViteConfig } from 'basalt-ui/vite'
|
|
104
|
+
*
|
|
105
|
+
* export default {
|
|
106
|
+
* ...basaltViteConfig({ port: 5173 }),
|
|
107
|
+
* plugins: [react(), ...basaltAppPlugin({ name: 'Argo' })],
|
|
108
|
+
* }
|
|
109
|
+
*/
|
|
110
|
+
export declare function basaltAppPlugin(options: BasaltAppOptions): PluginOption[];
|
|
30
111
|
//# sourceMappingURL=vite.d.ts.map
|
package/dist/vite.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAA6B,YAAY,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAI/E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,UAAU,CAyEpE;AAgBD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gGAAgG;IAChG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACrD,mGAAmG;IACnG,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,wDAAwD;IACxD,OAAO,CAAC,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,CAAA;IAChE;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mGAAmG;IACnG,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,wFAAwF;IACxF,KAAK,CAAC,EAAE,KAAK,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAChC,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IAC3B,oFAAoF;IACpF,GAAG,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,SAAS,GAAG,qBAAqB,CAAA;KAAE,CAAA;IACvF,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAClD,CAAA;AAuZD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAMzE"}
|