@frontile/theme 0.18.0-alpha.2 → 0.18.0-alpha.20
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 +22 -23
- package/declarations/colors/config.d.ts +18 -36
- package/declarations/colors/palette-absolute.d.ts +2 -2
- package/declarations/colors/palette.d.ts +1 -1
- package/declarations/colors/semantic.d.ts +4 -0
- package/declarations/colors/types.d.ts +190 -134
- package/declarations/colors/util.d.ts +2 -1
- package/declarations/colors.d.ts +1 -0
- package/declarations/components/accordion.d.ts +308 -0
- package/declarations/components/alert.d.ts +294 -0
- package/declarations/components/avatar.d.ts +9 -7
- package/declarations/components/button.d.ts +131 -48
- package/declarations/components/calendar.d.ts +382 -0
- package/declarations/components/chip.d.ts +79 -42
- package/declarations/components/close-button.d.ts +9 -7
- package/declarations/components/command.d.ts +281 -0
- package/declarations/components/divider.d.ts +9 -7
- package/declarations/components/dropdown.d.ts +11 -9
- package/declarations/components/external-link.d.ts +160 -0
- package/declarations/components/forms/forms-legacy.d.ts +108 -84
- package/declarations/components/forms/forms.d.ts +1040 -159
- package/declarations/components/index.d.ts +11 -0
- package/declarations/components/kbd.d.ts +315 -0
- package/declarations/components/listbox.d.ts +122 -18
- package/declarations/components/notification-card.d.ts +182 -111
- package/declarations/components/notifications-container.d.ts +111 -40
- package/declarations/components/overlays.d.ts +429 -29
- package/declarations/components/pagination.d.ts +359 -0
- package/declarations/components/popover.d.ts +11 -9
- package/declarations/components/progress-bar.d.ts +39 -7
- package/declarations/components/segmented-control.d.ts +463 -0
- package/declarations/components/shared.d.ts +9 -0
- package/declarations/components/skeleton.d.ts +151 -0
- package/declarations/components/spinner.d.ts +19 -7
- package/declarations/components/table.d.ts +17 -9
- package/declarations/components/tabs.d.ts +463 -0
- package/declarations/components/tooltip.d.ts +270 -0
- package/declarations/plugin/default-config.d.ts +18 -36
- package/declarations/tw.d.ts +9 -7
- package/declarations/types.d.ts +18 -1
- package/dist/colors.js +2 -1
- package/dist/colors.js.map +1 -1
- package/dist/index.js +3825 -5
- package/dist/index.js.map +1 -1
- package/dist/overlays-DIZlPzFH.js +654 -0
- package/dist/overlays-DIZlPzFH.js.map +1 -0
- package/dist/plugin.js +60 -85
- package/dist/plugin.js.map +1 -1
- package/dist/util-Dp_dlOPq.js +482 -0
- package/dist/util-Dp_dlOPq.js.map +1 -0
- package/package.json +17 -14
- package/public/fonts/domine-variable.woff2 +0 -0
- package/public/fonts/open-sans-italic-variable.woff2 +0 -0
- package/public/fonts/open-sans-variable.woff2 +0 -0
- package/public/fonts/source-code-pro-italic-variable.woff2 +0 -0
- package/public/fonts/source-code-pro-variable.woff2 +0 -0
- package/src/index.css +64 -15
- package/src/styles/font-faces.css +70 -8
- package/src/styles/theme.css +18 -7
- package/src/styles/typography.css +229 -126
- package/declarations/colors/contrast.d.ts +0 -16
- package/declarations/colors/defaults.d.ts +0 -66
- package/declarations/colors/palette-dark.d.ts +0 -123
- package/declarations/colors/palette-light.d.ts +0 -123
- package/dist/config-4CswsBlg.js +0 -342
- package/dist/config-4CswsBlg.js.map +0 -1
- package/dist/config-B3XkEtHW.js +0 -377
- package/dist/config-B3XkEtHW.js.map +0 -1
- package/dist/config-BpWBpuzR.js +0 -335
- package/dist/config-BpWBpuzR.js.map +0 -1
- package/dist/config-Cle59Y4k.js +0 -523
- package/dist/config-Cle59Y4k.js.map +0 -1
- package/dist/config-D0EoeVzn.js +0 -388
- package/dist/config-D0EoeVzn.js.map +0 -1
- package/dist/config-DBAavoE2.js +0 -336
- package/dist/config-DBAavoE2.js.map +0 -1
- package/dist/config-Oysuq2Z9.js +0 -341
- package/dist/config-Oysuq2Z9.js.map +0 -1
- package/dist/config-PYki2g7N.js +0 -335
- package/dist/config-PYki2g7N.js.map +0 -1
- package/dist/forms-legacy-15iy0KmK.js +0 -1851
- package/dist/forms-legacy-15iy0KmK.js.map +0 -1
- package/dist/forms-legacy-B-L2HELt.js +0 -1881
- package/dist/forms-legacy-B-L2HELt.js.map +0 -1
- package/dist/forms-legacy-BMIAioRi.js +0 -1807
- package/dist/forms-legacy-BMIAioRi.js.map +0 -1
- package/dist/forms-legacy-B_EygtyK.js +0 -1763
- package/dist/forms-legacy-B_EygtyK.js.map +0 -1
- package/dist/forms-legacy-Bg_UoLDR.js +0 -1763
- package/dist/forms-legacy-Bg_UoLDR.js.map +0 -1
- package/dist/forms-legacy-CVLZ-9BG.js +0 -1804
- package/dist/forms-legacy-CVLZ-9BG.js.map +0 -1
- package/dist/forms-legacy-CuFc3hcn.js +0 -1807
- package/dist/forms-legacy-CuFc3hcn.js.map +0 -1
- package/dist/forms-legacy-DiKImAli.js +0 -1809
- package/dist/forms-legacy-DiKImAli.js.map +0 -1
- package/dist/forms-legacy-edWQVbZP.js +0 -1809
- package/dist/forms-legacy-edWQVbZP.js.map +0 -1
- package/dist/index.css +0 -63
- package/dist/semantic-DUv6Lpqq.js +0 -218
- package/dist/semantic-DUv6Lpqq.js.map +0 -1
- package/dist/styles/font-faces.css +0 -26
- package/dist/styles/theme.css +0 -48
- package/dist/styles/typography.css +0 -291
- package/public/fonts/stix-two-text-italic-variable.woff2 +0 -0
- package/public/fonts/stix-two-text-variable.woff2 +0 -0
|
@@ -13,6 +13,7 @@ export type ColorScale = Partial<{
|
|
|
13
13
|
DEFAULT: string;
|
|
14
14
|
}> | string;
|
|
15
15
|
export type BaseColors = {
|
|
16
|
+
background: ColorScale;
|
|
16
17
|
divider: ColorScale;
|
|
17
18
|
focus: ColorScale;
|
|
18
19
|
};
|
|
@@ -20,16 +21,63 @@ export type SemanticBaseColors = {
|
|
|
20
21
|
light: BaseColors;
|
|
21
22
|
dark: BaseColors;
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Semantic color levels are split into two bands that share one emphasis
|
|
26
|
+
* vocabulary but are consumed by different CSS properties. In Tailwind's
|
|
27
|
+
* shared-palette model a token name maps to exactly one color value, so the
|
|
28
|
+
* band a level belongs to is what tells you which property it is meant for:
|
|
29
|
+
* surface-band levels are fills, ink-band levels are legible foregrounds.
|
|
30
|
+
*
|
|
31
|
+
* Every name describes emphasis RANK, never brightness. A level can be dark in
|
|
32
|
+
* light mode and light in dark mode — interaction direction inverts between
|
|
33
|
+
* schemes (light lightens on hover / darkens on press; dark does the reverse)
|
|
34
|
+
* — so a brightness word like "deep" or "light" would be a lie in one theme.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Surface band — fills. Backgrounds and decorative borders for filled/tinted
|
|
38
|
+
* surfaces, ordered low → high emphasis:
|
|
39
|
+
*
|
|
40
|
+
* subtle → muted → soft → mild → DEFAULT → firm
|
|
41
|
+
*
|
|
42
|
+
* `DEFAULT` is the resting fill (the bare `bg-{category}` class); `firm` is the
|
|
43
|
+
* most emphatic fill, e.g. a pressed/active background.
|
|
44
|
+
*/
|
|
45
|
+
export interface SurfaceBand {
|
|
46
|
+
/** Faintest tint — hairline fills, tonal resting backgrounds. */
|
|
24
47
|
subtle: string;
|
|
48
|
+
/** Light tint — hover on tonal fills, chip/close-button backgrounds. */
|
|
25
49
|
muted: string;
|
|
50
|
+
/** Soft fill — the hover step for solid fills. */
|
|
26
51
|
soft: string;
|
|
27
|
-
|
|
52
|
+
/** Between `soft` and `DEFAULT` — a lower-emphasis fill just short of resting. */
|
|
53
|
+
mild: string;
|
|
54
|
+
/** Resting fill — the bare `bg-{category}` / `border-{category}` token. */
|
|
28
55
|
DEFAULT: string;
|
|
56
|
+
/** Most emphatic fill — pressed/active backgrounds. */
|
|
29
57
|
firm: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Ink band — legible foregrounds. Text, and the borders of outlined controls,
|
|
61
|
+
* that must stay readable on the page and on surface-band fills, ordered
|
|
62
|
+
* low → high emphasis:
|
|
63
|
+
*
|
|
64
|
+
* strong → bolder
|
|
65
|
+
*
|
|
66
|
+
* `strong` is the default legible foreground; `bolder` is the highest-emphasis
|
|
67
|
+
* foreground (headings, hover/active text).
|
|
68
|
+
*/
|
|
69
|
+
export interface InkBand {
|
|
70
|
+
/** Default legible foreground — body text, outlined-control text/border. */
|
|
30
71
|
strong: string;
|
|
72
|
+
/** Highest-emphasis foreground — headings, hover/active text. */
|
|
31
73
|
bolder: string;
|
|
32
|
-
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A semantic color category is the union of both bands: fills (surface band)
|
|
77
|
+
* plus legible foregrounds (ink band). See {@link SurfaceBand} and
|
|
78
|
+
* {@link InkBand} for how each level is intended to be consumed.
|
|
79
|
+
*/
|
|
80
|
+
export interface SemanticColorCategory extends SurfaceBand, InkBand {
|
|
33
81
|
}
|
|
34
82
|
/**
|
|
35
83
|
* Optional on-color overrides for semantic color categories.
|
|
@@ -42,60 +90,90 @@ export interface SemanticColorCategory {
|
|
|
42
90
|
* that match your brand or design requirements.
|
|
43
91
|
*
|
|
44
92
|
* @example
|
|
45
|
-
* // Override on-colors for
|
|
93
|
+
* // Override on-colors for primary
|
|
46
94
|
* const colors: Partial<ThemeColors> = {
|
|
47
|
-
*
|
|
95
|
+
* primary: {
|
|
48
96
|
* subtle: '#3b82f6',
|
|
49
|
-
* medium: '#1e40af',
|
|
50
97
|
* DEFAULT: '#1e40af'
|
|
51
98
|
* },
|
|
52
|
-
* 'on-
|
|
99
|
+
* 'on-primary': {
|
|
53
100
|
* subtle: '#ffffff',
|
|
54
|
-
*
|
|
55
|
-
* DEFAULT: '#ffffff'
|
|
101
|
+
* DEFAULT: '#e0f2ff' // Light blue tint instead of pure white
|
|
56
102
|
* }
|
|
57
103
|
* };
|
|
58
104
|
*/
|
|
59
105
|
export interface OnColorCategory {
|
|
60
106
|
subtle?: string;
|
|
107
|
+
muted?: string;
|
|
61
108
|
soft?: string;
|
|
62
|
-
|
|
63
|
-
strong?: string;
|
|
109
|
+
mild?: string;
|
|
64
110
|
DEFAULT?: string;
|
|
111
|
+
firm?: string;
|
|
112
|
+
strong?: string;
|
|
113
|
+
bolder?: string;
|
|
65
114
|
}
|
|
66
115
|
export interface SurfaceOverlay {
|
|
67
116
|
subtle: string;
|
|
68
117
|
soft: string;
|
|
69
|
-
|
|
118
|
+
mild: string;
|
|
119
|
+
firm: string;
|
|
120
|
+
/**
|
|
121
|
+
* Heaviest overlay step (75% in light, 95% in dark).
|
|
122
|
+
*
|
|
123
|
+
* In light mode this is the backdrop tint behind modals and drawers. In dark
|
|
124
|
+
* mode the black scrim is {@link SurfaceLift}'s `strong` instead, because the
|
|
125
|
+
* families mirror each other — pair them as
|
|
126
|
+
* `bg-surface-overlay-strong dark:bg-surface-lift-strong` for a scrim that
|
|
127
|
+
* holds in both schemes.
|
|
128
|
+
*
|
|
129
|
+
* Follows the same darken-in-light / lighten-in-dark direction as
|
|
130
|
+
* `subtle`/`soft`/`mild`/`firm`, just at much higher opacity (75%) so it
|
|
131
|
+
* reads as a deliberate backdrop rather than a hover/elevation hint. A black
|
|
132
|
+
* tint is used in light mode; a black backdrop in dark mode would barely
|
|
133
|
+
* register against an already near-black page, so dark mode lightens
|
|
134
|
+
* (white tint) instead — same visual weight, opposite direction.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* <div className="fixed inset-0 bg-surface-overlay-strong dark:bg-surface-lift-strong">
|
|
138
|
+
*/
|
|
70
139
|
strong: string;
|
|
71
|
-
inverse: {
|
|
72
|
-
subtle: string;
|
|
73
|
-
soft: string;
|
|
74
|
-
medium: string;
|
|
75
|
-
strong: string;
|
|
76
|
-
};
|
|
77
140
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Translucent overlay system that *lightens* in light mode and *darkens* in
|
|
143
|
+
* dark mode — the mirror of {@link SurfaceOverlay}.
|
|
144
|
+
*
|
|
145
|
+
* Where overlay pushes an element down into its background, lift pulls it up
|
|
146
|
+
* off of it: a white veil on a light page, a black veil on a dark one. Use it
|
|
147
|
+
* for frosted/glass panels, sticky headers over content, and any surface that
|
|
148
|
+
* should read as floating above what it covers.
|
|
149
|
+
*
|
|
150
|
+
* Levels run low → high emphasis, same as overlay: `subtle`, `soft`, `mild`,
|
|
151
|
+
* `firm`, `strong`.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* // Frosted sticky header
|
|
155
|
+
* <header className="bg-surface-lift-firm backdrop-blur-md" />
|
|
156
|
+
*/
|
|
157
|
+
export interface SurfaceLift {
|
|
158
|
+
subtle: string;
|
|
159
|
+
soft: string;
|
|
160
|
+
mild: string;
|
|
161
|
+
firm: string;
|
|
162
|
+
/**
|
|
163
|
+
* Heaviest lift step, near-opaque (95%) — a panel lifted essentially clear
|
|
164
|
+
* of the page rather than a veil you see through.
|
|
165
|
+
*
|
|
166
|
+
* Flips with the scheme like every other lift level: white in light mode,
|
|
167
|
+
* black in dark mode. (Overlay's `strong` is the one that does *not* flip.)
|
|
168
|
+
*/
|
|
169
|
+
strong: string;
|
|
91
170
|
}
|
|
92
171
|
/**
|
|
93
172
|
* Surface color system defining background colors for UI containers.
|
|
94
173
|
*
|
|
95
|
-
* Surface tokens organize backgrounds into
|
|
174
|
+
* Surface tokens organize backgrounds into two categories:
|
|
96
175
|
* 1. **Roles**: Component context tokens (where in layout hierarchy)
|
|
97
|
-
* 2. **
|
|
98
|
-
* 3. **Overlay**: Translucent layers for elevation and depth
|
|
176
|
+
* 2. **Overlay**: Translucent layers for elevation and depth
|
|
99
177
|
*/
|
|
100
178
|
export interface SurfaceColors {
|
|
101
179
|
/**
|
|
@@ -115,29 +193,19 @@ export interface SurfaceColors {
|
|
|
115
193
|
* <div className="bg-surface-card hover:bg-surface-overlay-subtle" />
|
|
116
194
|
*
|
|
117
195
|
* // Stacking overlays for depth
|
|
118
|
-
* <div className="bg-surface-
|
|
196
|
+
* <div className="bg-surface-app bg-surface-overlay-soft" />
|
|
119
197
|
*/
|
|
120
198
|
overlay: SurfaceOverlay;
|
|
121
199
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* Foundation for all surface roles, providing a consistent grayscale progression
|
|
125
|
-
* that inverts between themes to support the elevation-luminance principle.
|
|
126
|
-
*
|
|
127
|
-
* Light theme: 0 (white) → 11 (black) - darkening progression
|
|
128
|
-
* Dark theme: 0 (black) → 11 (white) - lightening progression
|
|
200
|
+
* Translucent lift system for elements that float above the page.
|
|
129
201
|
*
|
|
130
|
-
* The
|
|
131
|
-
*
|
|
132
|
-
* surface needs and direct usage.
|
|
202
|
+
* The mirror of {@link overlay}: lightens in light mode, darkens in dark
|
|
203
|
+
* mode. See {@link SurfaceLift}.
|
|
133
204
|
*
|
|
134
205
|
* @example
|
|
135
|
-
*
|
|
136
|
-
* bg-surface-solid-0 // Extreme anchor: white (light) or black (dark)
|
|
137
|
-
* bg-surface-solid-1 // Near-white (light) or near-black (dark)
|
|
138
|
-
* bg-surface-solid-11 // Opposite extreme: black (light) or white (dark)
|
|
206
|
+
* <div className="bg-surface-lift-soft backdrop-blur-sm" />
|
|
139
207
|
*/
|
|
140
|
-
|
|
208
|
+
lift: SurfaceLift;
|
|
141
209
|
/**
|
|
142
210
|
* Root application background layer (hierarchy level 0).
|
|
143
211
|
*
|
|
@@ -188,7 +256,9 @@ export interface SurfaceColors {
|
|
|
188
256
|
* through the elevation-luminance principle.
|
|
189
257
|
*
|
|
190
258
|
* Light: Pure white, creating lifted appearance against gray canvas
|
|
191
|
-
* Dark:
|
|
259
|
+
* Dark: A translucent veil (white @ 7%, the same value as `overlay-subtle`),
|
|
260
|
+
* so content behind it shows through faintly. Where a surface has to stay
|
|
261
|
+
* opaque, use {@link table} — the same color without the transparency.
|
|
192
262
|
*
|
|
193
263
|
* @example
|
|
194
264
|
* // Product card
|
|
@@ -203,141 +273,127 @@ export interface SurfaceColors {
|
|
|
203
273
|
*/
|
|
204
274
|
card: string;
|
|
205
275
|
/**
|
|
206
|
-
*
|
|
276
|
+
* Data table surface (hierarchy level 1).
|
|
207
277
|
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
278
|
+
* The same color as {@link card}, guaranteed opaque. Tables need that
|
|
279
|
+
* guarantee: a sticky header, a frozen row, or a pinned column paints over the
|
|
280
|
+
* rows and columns scrolling beneath it, and anything translucent lets them
|
|
281
|
+
* show through.
|
|
210
282
|
*
|
|
211
|
-
* Light: Pure white,
|
|
212
|
-
* Dark:
|
|
283
|
+
* Light: Pure white, identical to `card`
|
|
284
|
+
* Dark: `gray-900` — the color `card` renders over `canvas`, so the two are
|
|
285
|
+
* indistinguishable on a canvas-backed page
|
|
213
286
|
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
* <nav>...</nav>
|
|
218
|
-
* </aside>
|
|
287
|
+
* For one table on a different background, set `--color-surface-table` on it
|
|
288
|
+
* rather than recolouring the role — it is a plain custom property, and it
|
|
289
|
+
* applies to everything below it.
|
|
219
290
|
*
|
|
220
291
|
* @example
|
|
221
|
-
* //
|
|
222
|
-
* <
|
|
223
|
-
* <h3>Properties</h3>
|
|
224
|
-
* </div>
|
|
292
|
+
* // Sticky table header, which the rows scroll under
|
|
293
|
+
* <thead className="sticky top-0 bg-surface-table">
|
|
225
294
|
*/
|
|
226
|
-
|
|
295
|
+
table: string;
|
|
227
296
|
/**
|
|
228
|
-
*
|
|
297
|
+
* Drawer body surface (hierarchy level 3).
|
|
229
298
|
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
299
|
+
* The scrollable content area of a Drawer, deliberately one step off the
|
|
300
|
+
* drawer's own header and footer bands so the body reads as a distinct
|
|
301
|
+
* region rather than one flat panel.
|
|
232
302
|
*
|
|
233
|
-
* Light:
|
|
234
|
-
* Dark:
|
|
303
|
+
* Light: `gray-50`, a hair off the white footer
|
|
304
|
+
* Dark: `gray-900`, one step above the black footer
|
|
235
305
|
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* <div className="bg-surface-popover rounded-md shadow-lg border border-neutral-subtle">
|
|
239
|
-
* <MenuItem />
|
|
240
|
-
* </div>
|
|
306
|
+
* Opaque in both schemes — a drawer sits over a backdrop, and a translucent
|
|
307
|
+
* body would let the page behind bleed through the content.
|
|
241
308
|
*
|
|
242
309
|
* @example
|
|
243
|
-
* //
|
|
244
|
-
* <div className="bg-surface-
|
|
245
|
-
*
|
|
310
|
+
* // Drawer body
|
|
311
|
+
* <div className="bg-surface-drawer text-on-surface-drawer px-8 py-4">
|
|
312
|
+
* Content
|
|
246
313
|
* </div>
|
|
247
314
|
*/
|
|
248
|
-
|
|
315
|
+
drawer: string;
|
|
249
316
|
/**
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
* Context-adaptive overlay that always darkens relative to its parent surface
|
|
253
|
-
* via alpha compositing. Used for text inputs, search fields, code blocks,
|
|
254
|
-
* and embedded content that should appear recessed.
|
|
317
|
+
* Form control surface for inputs, checkboxes, radios, and similar controls
|
|
318
|
+
* (hierarchy level -1).
|
|
255
319
|
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
320
|
+
* Light: Pure white
|
|
321
|
+
* Dark: Near-black, the darkest step in the neutral scale
|
|
258
322
|
*
|
|
259
323
|
* @example
|
|
260
324
|
* // Text input
|
|
261
|
-
* <input className="bg-surface-
|
|
262
|
-
*
|
|
263
|
-
* @example
|
|
264
|
-
* // Code block
|
|
265
|
-
* <pre className="bg-surface-inset rounded-md p-4">
|
|
266
|
-
* <code>const example = true;</code>
|
|
267
|
-
* </pre>
|
|
268
|
-
*
|
|
269
|
-
* @example
|
|
270
|
-
* // Search field
|
|
271
|
-
* <div className="bg-surface-inset rounded-full px-4 py-2">
|
|
272
|
-
* <input type="search" />
|
|
273
|
-
* </div>
|
|
325
|
+
* <input className="bg-surface-input border border-neutral rounded px-3 py-2" />
|
|
274
326
|
*/
|
|
275
|
-
|
|
327
|
+
input: string;
|
|
276
328
|
/**
|
|
277
|
-
* Modal and
|
|
329
|
+
* Modal, drawer, and popover container surface, highest elevation
|
|
330
|
+
* (hierarchy level 3).
|
|
278
331
|
*
|
|
279
|
-
* Used for modal dialogs, drawers, and other
|
|
280
|
-
* above all other surfaces.
|
|
332
|
+
* Used for modal dialogs, drawers, dropdown menus, and other floating
|
|
333
|
+
* content that appears above all other surfaces. Modals and drawers pair it
|
|
334
|
+
* with a `surface-overlay-strong dark:surface-lift-strong` backdrop to focus
|
|
335
|
+
* attention.
|
|
281
336
|
*
|
|
282
337
|
* Light: Pure white, highest elevation
|
|
283
338
|
* Dark: Medium gray, lightest surface for maximum elevation
|
|
284
339
|
*
|
|
285
340
|
* @example
|
|
286
341
|
* // Modal dialog
|
|
287
|
-
* <div className="bg-surface-
|
|
342
|
+
* <div className="bg-surface-modal rounded-lg shadow-2xl p-6">
|
|
288
343
|
* <h2>Confirm Action</h2>
|
|
289
344
|
* <p>Are you sure?</p>
|
|
290
345
|
* </div>
|
|
291
346
|
*
|
|
292
347
|
* @example
|
|
293
348
|
* // Drawer with backdrop
|
|
294
|
-
* <div className="fixed inset-0 bg-surface-overlay-strong">
|
|
295
|
-
* <aside className="bg-surface-
|
|
349
|
+
* <div className="fixed inset-0 bg-surface-overlay-strong dark:bg-surface-lift-strong">
|
|
350
|
+
* <aside className="bg-surface-modal h-full w-80">
|
|
296
351
|
* <DrawerContent />
|
|
297
352
|
* </aside>
|
|
298
353
|
* </div>
|
|
354
|
+
*
|
|
355
|
+
* @example
|
|
356
|
+
* // Dropdown menu
|
|
357
|
+
* <div className="bg-surface-modal rounded-md shadow-lg border border-neutral-subtle">
|
|
358
|
+
* <MenuItem />
|
|
359
|
+
* </div>
|
|
299
360
|
*/
|
|
300
|
-
|
|
361
|
+
modal: string;
|
|
301
362
|
}
|
|
302
363
|
export interface ThemeColors {
|
|
303
364
|
neutral: SemanticColorCategory;
|
|
304
|
-
|
|
305
|
-
|
|
365
|
+
primary: SemanticColorCategory;
|
|
366
|
+
secondary: SemanticColorCategory;
|
|
367
|
+
tertiary: SemanticColorCategory;
|
|
306
368
|
success: SemanticColorCategory;
|
|
307
369
|
warning: SemanticColorCategory;
|
|
308
370
|
danger: SemanticColorCategory;
|
|
309
371
|
surface: SurfaceColors;
|
|
310
372
|
'on-neutral'?: OnColorCategory;
|
|
311
|
-
'on-
|
|
312
|
-
'on-
|
|
373
|
+
'on-primary'?: OnColorCategory;
|
|
374
|
+
'on-secondary'?: OnColorCategory;
|
|
375
|
+
'on-tertiary'?: OnColorCategory;
|
|
313
376
|
'on-success'?: OnColorCategory;
|
|
314
377
|
'on-warning'?: OnColorCategory;
|
|
315
378
|
'on-danger'?: OnColorCategory;
|
|
316
379
|
/**
|
|
317
|
-
* Optional on-color
|
|
380
|
+
* Optional on-color override for the `surface-input` background.
|
|
381
|
+
*
|
|
382
|
+
* By default, auto-generated for optimal WCAG contrast, same as the other
|
|
383
|
+
* semantic categories.
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* 'on-surface-input': '#111111'
|
|
387
|
+
*/
|
|
388
|
+
'on-surface-input'?: string;
|
|
389
|
+
/**
|
|
390
|
+
* Optional on-color override for the `surface-modal` background.
|
|
318
391
|
*
|
|
319
|
-
*
|
|
392
|
+
* By default, auto-generated for optimal WCAG contrast, same as the other
|
|
393
|
+
* semantic categories.
|
|
320
394
|
*
|
|
321
395
|
* @example
|
|
322
|
-
*
|
|
323
|
-
* 'on-surface-solid': {
|
|
324
|
-
* 0: '#000000', // Text color on surface-solid-0
|
|
325
|
-
* 5: '#ffffff', // Text color on surface-solid-5
|
|
326
|
-
* 11: '#ffffff' // Text color on surface-solid-11
|
|
327
|
-
* }
|
|
396
|
+
* 'on-surface-modal': '#111111'
|
|
328
397
|
*/
|
|
329
|
-
'on-surface-
|
|
330
|
-
0?: string;
|
|
331
|
-
1?: string;
|
|
332
|
-
2?: string;
|
|
333
|
-
3?: string;
|
|
334
|
-
4?: string;
|
|
335
|
-
5?: string;
|
|
336
|
-
6?: string;
|
|
337
|
-
7?: string;
|
|
338
|
-
8?: string;
|
|
339
|
-
9?: string;
|
|
340
|
-
10?: string;
|
|
341
|
-
11?: string;
|
|
342
|
-
};
|
|
398
|
+
'on-surface-modal'?: string;
|
|
343
399
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { parse, wcagContrast } from 'culori';
|
|
1
2
|
declare function swapColorValues<T extends Record<string, unknown>>(colors: T): Record<string, unknown>;
|
|
2
3
|
/**
|
|
3
4
|
* Get optimal contrasting color (black or white) for text on a given background.
|
|
4
5
|
* Uses WCAG contrast ratios to determine which provides better readability.
|
|
5
6
|
*/
|
|
6
7
|
declare function getContrastingColor(backgroundColor: string): string;
|
|
7
|
-
export { swapColorValues, getContrastingColor };
|
|
8
|
+
export { swapColorValues, getContrastingColor, parse, wcagContrast };
|
package/declarations/colors.d.ts
CHANGED