@grafctory/skin 0.0.0-stage → 0.3.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.
Files changed (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +469 -2
  3. package/dist/index.core.d.ts +201 -0
  4. package/dist/index.core.d.ts.map +1 -0
  5. package/dist/index.core.js +17 -0
  6. package/dist/index.core.js.map +1 -0
  7. package/dist/index.css +126 -0
  8. package/dist/index.d.ts +432 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +184 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/markup/alerts.css +83 -0
  13. package/dist/markup/blocks.css +255 -0
  14. package/dist/markup/forms.css +551 -0
  15. package/dist/markup/headings.css +131 -0
  16. package/dist/markup/highlights.css +38 -0
  17. package/dist/markup/inlines.css +183 -0
  18. package/dist/markup/lists.css +206 -0
  19. package/dist/markup/reset.css +38 -0
  20. package/dist/markup/tables.css +78 -0
  21. package/dist/presets/inter.css +194 -0
  22. package/dist/presets/roboto.css +198 -0
  23. package/dist/tokens/borders.css +151 -0
  24. package/dist/tokens/borders.d.ts +57 -0
  25. package/dist/tokens/borders.d.ts.map +1 -0
  26. package/dist/tokens/borders.js +72 -0
  27. package/dist/tokens/borders.js.map +1 -0
  28. package/dist/tokens/colors.css +515 -0
  29. package/dist/tokens/colors.d.ts +171 -0
  30. package/dist/tokens/colors.d.ts.map +1 -0
  31. package/dist/tokens/colors.js +186 -0
  32. package/dist/tokens/colors.js.map +1 -0
  33. package/dist/tokens/elevations.css +110 -0
  34. package/dist/tokens/elevations.d.ts +54 -0
  35. package/dist/tokens/elevations.d.ts.map +1 -0
  36. package/dist/tokens/elevations.js +69 -0
  37. package/dist/tokens/elevations.js.map +1 -0
  38. package/dist/tokens/layers.css +57 -0
  39. package/dist/tokens/layers.d.ts +34 -0
  40. package/dist/tokens/layers.d.ts.map +1 -0
  41. package/dist/tokens/layers.js +49 -0
  42. package/dist/tokens/layers.js.map +1 -0
  43. package/dist/tokens/motions.css +91 -0
  44. package/dist/tokens/motions.d.ts +40 -0
  45. package/dist/tokens/motions.d.ts.map +1 -0
  46. package/dist/tokens/motions.js +55 -0
  47. package/dist/tokens/motions.js.map +1 -0
  48. package/dist/tokens/opacities.css +41 -0
  49. package/dist/tokens/opacities.d.ts +32 -0
  50. package/dist/tokens/opacities.d.ts.map +1 -0
  51. package/dist/tokens/opacities.js +47 -0
  52. package/dist/tokens/opacities.js.map +1 -0
  53. package/dist/tokens/palettes.css +546 -0
  54. package/dist/tokens/palettes.d.ts +140 -0
  55. package/dist/tokens/palettes.d.ts.map +1 -0
  56. package/dist/tokens/palettes.js +155 -0
  57. package/dist/tokens/palettes.js.map +1 -0
  58. package/dist/tokens/scalings.css +81 -0
  59. package/dist/tokens/scalings.d.ts +31 -0
  60. package/dist/tokens/scalings.d.ts.map +1 -0
  61. package/dist/tokens/scalings.js +46 -0
  62. package/dist/tokens/scalings.js.map +1 -0
  63. package/dist/tokens/spacings.css +78 -0
  64. package/dist/tokens/spacings.d.ts +34 -0
  65. package/dist/tokens/spacings.d.ts.map +1 -0
  66. package/dist/tokens/spacings.js +49 -0
  67. package/dist/tokens/spacings.js.map +1 -0
  68. package/dist/tokens/typography.css +156 -0
  69. package/dist/tokens/typography.d.ts +77 -0
  70. package/dist/tokens/typography.d.ts.map +1 -0
  71. package/dist/tokens/typography.js +92 -0
  72. package/dist/tokens/typography.js.map +1 -0
  73. package/dist/tokens/viewports.css +101 -0
  74. package/dist/tokens/viewports.d.ts +75 -0
  75. package/dist/tokens/viewports.d.ts.map +1 -0
  76. package/dist/tokens/viewports.js +90 -0
  77. package/dist/tokens/viewports.js.map +1 -0
  78. package/package.json +87 -4
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Colour tokens.
3
+ *
4
+ * Names the anchors an app supplies its brand through and the roles derived from them, so a rule says which role it
5
+ * paints rather than which colour it uses, and an app retuning the anchors alone carries the whole interface along in
6
+ * either platform colour scheme.
7
+ *
8
+ * @remarks
9
+ *
10
+ * **Contrast** — every role is held to [WCAG 2.2](https://www.w3.org/TR/WCAG22/) AA on the surfaces it is set on:
11
+ * 4.5:1 for [text](https://www.w3.org/TR/WCAG22/#contrast-minimum), and 3:1 for marks, control boundaries and focus
12
+ * rings, as [non-text contrast](https://www.w3.org/TR/WCAG22/#non-text-contrast) requires. A meaning is never told
13
+ * in colour alone, as [use of colour](https://www.w3.org/TR/WCAG22/#use-of-color) requires: a glyph or a word carries
14
+ * it too, for a reader who cannot tell the colours apart or who reads the page through a screen reader.
15
+ *
16
+ * **Colour schemes** — the stylesheet ships each anchor as a `light-dark()` pair, so an interface follows the platform
17
+ * with no work from the app. An app pinning a scheme sets `data-scheme` to `light` or `dark` on any element, and the
18
+ * subtree below it takes that scheme whatever the platform says, which is what lets a dark panel sit on a light page.
19
+ * An app supplying its brand states a value per scheme too, as a single `light-dark()` pair on `:root` that every
20
+ * scheme and every pinned subtree follows, and rechecks that the text roles still hold AA contrast against the page
21
+ * and the striped row in both:
22
+ *
23
+ * ```css
24
+ * :root {
25
+ * --skin--color-subtle: light-dark(#1C275D, #9AB);
26
+ * --skin--color-strong: light-dark(#06C, #4AF);
27
+ * }
28
+ * ```
29
+ *
30
+ * **Accents** — `colorSubtle` is the quieter of the brand pair and `colorStrong` the louder. The pair states an
31
+ * emphasis relative to each other and nothing else: which elements read them, and in which state, is settled by the
32
+ * roles derived from them rather than by the anchors. A brand of any hue or lightness therefore fits by supplying
33
+ * two values; the quieter one is the less saturated, which leaves it free to hold the higher contrast, as it does by
34
+ * default.
35
+ *
36
+ * **Status** — `colorNote`, `colorPass`, `colorFlag`, `colorWarn` and `colorFail` are a five-step scale every
37
+ * meaning a widget carries lands on. `note` is not a milder `pass` but the absence of a verdict, so the scale reads
38
+ * as one unjudged step ahead of a four-step ramp, `pass`, `flag`, `warn` and `fail`, each verdict asking more of the
39
+ * reader than the last. `flag` singles a thing out for attention, where `warn` says that something has gone wrong.
40
+ *
41
+ * Three kinds of meaning share it, and which one a widget carries follows from what the widget is, so no widget
42
+ * carries two: `level` on content, how much attention a passage deserves; `mode` on controls, what activating will
43
+ * do; `status` on reported things, what the system says happened. Each declares `normal` explicitly, and `normal` is
44
+ * not a step: it paints nothing and leaves the ordinary page colours. A widget maps its remaining values onto the
45
+ * steps and states that mapping in its own documentation.
46
+ *
47
+ * How loud a widget appears is a separate axis, its `look`, told in placement, size and weight and never in colour.
48
+ *
49
+ * The five stand apart as anchors rather than derivations of an accent, so a meaning keeps reading as itself
50
+ * whatever an app brands with, and each pairs with a `backgroundColor*` role tinting a notice. A step is never told
51
+ * in colour alone: an icon or a word carries it too, since `pass` and `fail` are the pair that colour vision
52
+ * deficiency collapses most readily, and a reader who cannot tell them apart still reads the icon and the word.
53
+ *
54
+ * **What a status colour may paint** — `colorNote`, `colorPass`, `colorFlag` and `colorFail` hold AA contrast on
55
+ * the page, the striped row and their own tint in both colour schemes, so each paints text, a mark or a fill.
56
+ * `colorWarn` is a gold in both schemes, painting text or a mark on the page and the striped row, or a fill with its
57
+ * message in `colorOver`; it is never set on its own tint, where the light gold falls short.
58
+ *
59
+ * **Status text** — `colorNoteStroke`, `colorPassStroke`, `colorFlagStroke`, `colorWarnStroke` and
60
+ * `colorFailStroke` paint text in the colour of a step. Each is its anchor and holds AA contrast in both colour
61
+ * schemes on the page, the striped row and its step's tint, except `colorWarnStroke`, which falls short on the light
62
+ * caution tint and is never set there. A widget setting a label over any other fill, such as a tint deepened under
63
+ * the pointer, holds it to AA there itself, falling back on the page text, `color`, wherever the stroke falls short.
64
+ *
65
+ * **Text** — `colorLabel` sets secondary text apart from the primary content it accompanies, such as a caption, a
66
+ * subtitle or a list marker, quieter than the copy around it. `colorPlaceholder` stands in for a value not yet given,
67
+ * and sets `small` text apart from prose. `colorEnabled` marks a control that answers and `colorDisabled` one that
68
+ * does not. A control in the enabled colour is never mistaken for a link or for the plain copy around it.
69
+ *
70
+ * Every text role holds AA contrast against the page and the striped row in both colour schemes, and `colorLabel`
71
+ * holds it on the pressed fill of a control too, the deepest surface secondary text is set on. `colorPlaceholder`
72
+ * holds it on the page, the striped row and the edit background, lighter than an entered value but legible; text set
73
+ * in it stays off control fills, where only `colorLabel` holds AA. The one exception is `colorDisabled`, which shares
74
+ * its value with {@link borders `borderColor`}: WCAG exempts a disabled control from the contrast minimum.
75
+ *
76
+ * **Links** — `colorLink` paints a link and `colorLinkHover` a link under the pointer, both in the hue of the subtle
77
+ * accent at a lightness of their own, so a link follows a brand while holding AA contrast whatever the brand supplies.
78
+ *
79
+ * **States** — `colorHover` marks what the pointer is over, `colorPressed` what is being acted on, `colorSelected`
80
+ * what an earlier choice left standing, and `colorFocus` what the keyboard has reached. A state is never told in
81
+ * colour alone: weight, shape or wording carries it too, for a reader who cannot tell the colours apart.
82
+ *
83
+ * The first three answer to the strong accent, so they follow a brand. `colorHover` and `colorPressed` step away
84
+ * from the page in either colour scheme, the press further than the hover, so the two read as rising emphasis. Each
85
+ * of the three pairs with a `backgroundColor*` role for a control filling its whole box rather than colouring its
86
+ * text, and the two are never combined on the same element, which would state the emphasis twice.
87
+ *
88
+ * No base rule paints `colorSelected` or the three state fills: they are reserved for the controls a component
89
+ * library builds on the design system, a tab, a menu item or a toggle filling its box, and the suite holds each to
90
+ * its budget on the surfaces such a control reaches.
91
+ *
92
+ * **Neutral states** — `backgroundColorHoverNeutral` and `backgroundColorPressedNeutral` answer the pointer on a
93
+ * control answering to no accent, such as a borderless button or a tool in a tray. They are translucent, so they
94
+ * deepen whatever surface the control stands on by the same step: a control in a sunken tray changes as visibly as
95
+ * one on the page. The press steps further from the surface than the hover. The text, the label, an enabled
96
+ * control and the focus ring hold their budgets over either state on the page, the stripe, the edit field and the
97
+ * sunken surface. The overlay is not among them, so a control on a menu, a popover or a dialog takes the accent
98
+ * states instead. Like the accent fills, they are painted by no base rule and are reserved for component controls.
99
+ *
100
+ * `colorFocus` carries a value of its own per colour scheme, so that where the keyboard stands is told the same way
101
+ * whatever an app brands with. It holds 3:1 on every surface and tint a ring is drawn against, a pressed fill
102
+ * included, but against no solid fill, whether an accent or a step of the meaning scale: a control filled solid
103
+ * takes its ring outside the fill, offset by the line width, where it holds 3:1 against the page.
104
+ *
105
+ * **Filled caution** — `colorOver` is what text takes over a fill painted in `colorWarn`: the page background, white
106
+ * over the light gold and dark over the dark one. It is not the text over any other step: a fill painted in
107
+ * `colorFail` flips as `colorStrongOver` does, white in the light colour scheme and black in the dark one.
108
+ *
109
+ * **Filled accent** — `colorStrongOver` is what text takes over a fill painted in `colorStrong`. It is white or
110
+ * black, whichever contrasts more with the accent, so a label holds AA contrast whatever accent an app brands with.
111
+ *
112
+ * Neither over colour is read by a base rule, since plain markup paints no filled badge and no filled button: both
113
+ * are reserved for the component library, and the suite holds each to AA contrast on the fill it is named for.
114
+ *
115
+ * **Surfaces** — `backgroundColorEdit` marks a field that takes a value and `backgroundColorStripe` a table row
116
+ * telling itself from its neighbour. A rule paints `background-color` with them rather than retuning
117
+ * `backgroundColor`, which every other colour here stands on. A thing lifted off the page takes an
118
+ * {@link elevations elevation surface} instead.
119
+ *
120
+ * The chart, map and editor colours stand outside this: the {@link palettes heat scale, the series slots, the area
121
+ * classes and the editor colours} keep values of their own, so a rebrand repaints neither what they code nor the
122
+ * content an author coloured with them: a chart, a map and a coloured passage all look the same under any brand.
123
+ *
124
+ * @module colors
125
+ */
126
+ /**
127
+ * The custom property behind every colour token.
128
+ *
129
+ * Narrowed to literals, so the design system contract can name the tokens and the custom properties they resolve to.
130
+ */
131
+ export declare const colors: {
132
+ readonly color: "--skin--color";
133
+ readonly backgroundColor: "--skin--background-color";
134
+ readonly colorSubtle: "--skin--color-subtle";
135
+ readonly colorStrong: "--skin--color-strong";
136
+ readonly colorNote: "--skin--color-note";
137
+ readonly colorPass: "--skin--color-pass";
138
+ readonly colorFlag: "--skin--color-flag";
139
+ readonly colorWarn: "--skin--color-warn";
140
+ readonly colorFail: "--skin--color-fail";
141
+ readonly colorNoteStroke: "--skin--color-note-stroke";
142
+ readonly colorPassStroke: "--skin--color-pass-stroke";
143
+ readonly colorFlagStroke: "--skin--color-flag-stroke";
144
+ readonly colorWarnStroke: "--skin--color-warn-stroke";
145
+ readonly colorFailStroke: "--skin--color-fail-stroke";
146
+ readonly colorLabel: "--skin--color-label";
147
+ readonly colorPlaceholder: "--skin--color-placeholder";
148
+ readonly colorEnabled: "--skin--color-enabled";
149
+ readonly colorDisabled: "--skin--color-disabled";
150
+ readonly colorLink: "--skin--color-link";
151
+ readonly colorLinkHover: "--skin--color-link-hover";
152
+ readonly colorHover: "--skin--color-hover";
153
+ readonly colorPressed: "--skin--color-pressed";
154
+ readonly colorSelected: "--skin--color-selected";
155
+ readonly colorFocus: "--skin--color-focus";
156
+ readonly colorOver: "--skin--color-over";
157
+ readonly colorStrongOver: "--skin--color-strong-over";
158
+ readonly backgroundColorEdit: "--skin--background-color-edit";
159
+ readonly backgroundColorStripe: "--skin--background-color-stripe";
160
+ readonly backgroundColorHover: "--skin--background-color-hover";
161
+ readonly backgroundColorPressed: "--skin--background-color-pressed";
162
+ readonly backgroundColorSelected: "--skin--background-color-selected";
163
+ readonly backgroundColorHoverNeutral: "--skin--background-color-hover-neutral";
164
+ readonly backgroundColorPressedNeutral: "--skin--background-color-pressed-neutral";
165
+ readonly backgroundColorNote: "--skin--background-color-note";
166
+ readonly backgroundColorPass: "--skin--background-color-pass";
167
+ readonly backgroundColorFlag: "--skin--background-color-flag";
168
+ readonly backgroundColorWarn: "--skin--background-color-warn";
169
+ readonly backgroundColorFail: "--skin--background-color-fail";
170
+ };
171
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/tokens/colors.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4HG;AAGH;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDT,CAAC"}
@@ -0,0 +1,186 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Colour tokens.
18
+ *
19
+ * Names the anchors an app supplies its brand through and the roles derived from them, so a rule says which role it
20
+ * paints rather than which colour it uses, and an app retuning the anchors alone carries the whole interface along in
21
+ * either platform colour scheme.
22
+ *
23
+ * @remarks
24
+ *
25
+ * **Contrast** — every role is held to [WCAG 2.2](https://www.w3.org/TR/WCAG22/) AA on the surfaces it is set on:
26
+ * 4.5:1 for [text](https://www.w3.org/TR/WCAG22/#contrast-minimum), and 3:1 for marks, control boundaries and focus
27
+ * rings, as [non-text contrast](https://www.w3.org/TR/WCAG22/#non-text-contrast) requires. A meaning is never told
28
+ * in colour alone, as [use of colour](https://www.w3.org/TR/WCAG22/#use-of-color) requires: a glyph or a word carries
29
+ * it too, for a reader who cannot tell the colours apart or who reads the page through a screen reader.
30
+ *
31
+ * **Colour schemes** — the stylesheet ships each anchor as a `light-dark()` pair, so an interface follows the platform
32
+ * with no work from the app. An app pinning a scheme sets `data-scheme` to `light` or `dark` on any element, and the
33
+ * subtree below it takes that scheme whatever the platform says, which is what lets a dark panel sit on a light page.
34
+ * An app supplying its brand states a value per scheme too, as a single `light-dark()` pair on `:root` that every
35
+ * scheme and every pinned subtree follows, and rechecks that the text roles still hold AA contrast against the page
36
+ * and the striped row in both:
37
+ *
38
+ * ```css
39
+ * :root {
40
+ * --skin--color-subtle: light-dark(#1C275D, #9AB);
41
+ * --skin--color-strong: light-dark(#06C, #4AF);
42
+ * }
43
+ * ```
44
+ *
45
+ * **Accents** — `colorSubtle` is the quieter of the brand pair and `colorStrong` the louder. The pair states an
46
+ * emphasis relative to each other and nothing else: which elements read them, and in which state, is settled by the
47
+ * roles derived from them rather than by the anchors. A brand of any hue or lightness therefore fits by supplying
48
+ * two values; the quieter one is the less saturated, which leaves it free to hold the higher contrast, as it does by
49
+ * default.
50
+ *
51
+ * **Status** — `colorNote`, `colorPass`, `colorFlag`, `colorWarn` and `colorFail` are a five-step scale every
52
+ * meaning a widget carries lands on. `note` is not a milder `pass` but the absence of a verdict, so the scale reads
53
+ * as one unjudged step ahead of a four-step ramp, `pass`, `flag`, `warn` and `fail`, each verdict asking more of the
54
+ * reader than the last. `flag` singles a thing out for attention, where `warn` says that something has gone wrong.
55
+ *
56
+ * Three kinds of meaning share it, and which one a widget carries follows from what the widget is, so no widget
57
+ * carries two: `level` on content, how much attention a passage deserves; `mode` on controls, what activating will
58
+ * do; `status` on reported things, what the system says happened. Each declares `normal` explicitly, and `normal` is
59
+ * not a step: it paints nothing and leaves the ordinary page colours. A widget maps its remaining values onto the
60
+ * steps and states that mapping in its own documentation.
61
+ *
62
+ * How loud a widget appears is a separate axis, its `look`, told in placement, size and weight and never in colour.
63
+ *
64
+ * The five stand apart as anchors rather than derivations of an accent, so a meaning keeps reading as itself
65
+ * whatever an app brands with, and each pairs with a `backgroundColor*` role tinting a notice. A step is never told
66
+ * in colour alone: an icon or a word carries it too, since `pass` and `fail` are the pair that colour vision
67
+ * deficiency collapses most readily, and a reader who cannot tell them apart still reads the icon and the word.
68
+ *
69
+ * **What a status colour may paint** — `colorNote`, `colorPass`, `colorFlag` and `colorFail` hold AA contrast on
70
+ * the page, the striped row and their own tint in both colour schemes, so each paints text, a mark or a fill.
71
+ * `colorWarn` is a gold in both schemes, painting text or a mark on the page and the striped row, or a fill with its
72
+ * message in `colorOver`; it is never set on its own tint, where the light gold falls short.
73
+ *
74
+ * **Status text** — `colorNoteStroke`, `colorPassStroke`, `colorFlagStroke`, `colorWarnStroke` and
75
+ * `colorFailStroke` paint text in the colour of a step. Each is its anchor and holds AA contrast in both colour
76
+ * schemes on the page, the striped row and its step's tint, except `colorWarnStroke`, which falls short on the light
77
+ * caution tint and is never set there. A widget setting a label over any other fill, such as a tint deepened under
78
+ * the pointer, holds it to AA there itself, falling back on the page text, `color`, wherever the stroke falls short.
79
+ *
80
+ * **Text** — `colorLabel` sets secondary text apart from the primary content it accompanies, such as a caption, a
81
+ * subtitle or a list marker, quieter than the copy around it. `colorPlaceholder` stands in for a value not yet given,
82
+ * and sets `small` text apart from prose. `colorEnabled` marks a control that answers and `colorDisabled` one that
83
+ * does not. A control in the enabled colour is never mistaken for a link or for the plain copy around it.
84
+ *
85
+ * Every text role holds AA contrast against the page and the striped row in both colour schemes, and `colorLabel`
86
+ * holds it on the pressed fill of a control too, the deepest surface secondary text is set on. `colorPlaceholder`
87
+ * holds it on the page, the striped row and the edit background, lighter than an entered value but legible; text set
88
+ * in it stays off control fills, where only `colorLabel` holds AA. The one exception is `colorDisabled`, which shares
89
+ * its value with {@link borders `borderColor`}: WCAG exempts a disabled control from the contrast minimum.
90
+ *
91
+ * **Links** — `colorLink` paints a link and `colorLinkHover` a link under the pointer, both in the hue of the subtle
92
+ * accent at a lightness of their own, so a link follows a brand while holding AA contrast whatever the brand supplies.
93
+ *
94
+ * **States** — `colorHover` marks what the pointer is over, `colorPressed` what is being acted on, `colorSelected`
95
+ * what an earlier choice left standing, and `colorFocus` what the keyboard has reached. A state is never told in
96
+ * colour alone: weight, shape or wording carries it too, for a reader who cannot tell the colours apart.
97
+ *
98
+ * The first three answer to the strong accent, so they follow a brand. `colorHover` and `colorPressed` step away
99
+ * from the page in either colour scheme, the press further than the hover, so the two read as rising emphasis. Each
100
+ * of the three pairs with a `backgroundColor*` role for a control filling its whole box rather than colouring its
101
+ * text, and the two are never combined on the same element, which would state the emphasis twice.
102
+ *
103
+ * No base rule paints `colorSelected` or the three state fills: they are reserved for the controls a component
104
+ * library builds on the design system, a tab, a menu item or a toggle filling its box, and the suite holds each to
105
+ * its budget on the surfaces such a control reaches.
106
+ *
107
+ * **Neutral states** — `backgroundColorHoverNeutral` and `backgroundColorPressedNeutral` answer the pointer on a
108
+ * control answering to no accent, such as a borderless button or a tool in a tray. They are translucent, so they
109
+ * deepen whatever surface the control stands on by the same step: a control in a sunken tray changes as visibly as
110
+ * one on the page. The press steps further from the surface than the hover. The text, the label, an enabled
111
+ * control and the focus ring hold their budgets over either state on the page, the stripe, the edit field and the
112
+ * sunken surface. The overlay is not among them, so a control on a menu, a popover or a dialog takes the accent
113
+ * states instead. Like the accent fills, they are painted by no base rule and are reserved for component controls.
114
+ *
115
+ * `colorFocus` carries a value of its own per colour scheme, so that where the keyboard stands is told the same way
116
+ * whatever an app brands with. It holds 3:1 on every surface and tint a ring is drawn against, a pressed fill
117
+ * included, but against no solid fill, whether an accent or a step of the meaning scale: a control filled solid
118
+ * takes its ring outside the fill, offset by the line width, where it holds 3:1 against the page.
119
+ *
120
+ * **Filled caution** — `colorOver` is what text takes over a fill painted in `colorWarn`: the page background, white
121
+ * over the light gold and dark over the dark one. It is not the text over any other step: a fill painted in
122
+ * `colorFail` flips as `colorStrongOver` does, white in the light colour scheme and black in the dark one.
123
+ *
124
+ * **Filled accent** — `colorStrongOver` is what text takes over a fill painted in `colorStrong`. It is white or
125
+ * black, whichever contrasts more with the accent, so a label holds AA contrast whatever accent an app brands with.
126
+ *
127
+ * Neither over colour is read by a base rule, since plain markup paints no filled badge and no filled button: both
128
+ * are reserved for the component library, and the suite holds each to AA contrast on the fill it is named for.
129
+ *
130
+ * **Surfaces** — `backgroundColorEdit` marks a field that takes a value and `backgroundColorStripe` a table row
131
+ * telling itself from its neighbour. A rule paints `background-color` with them rather than retuning
132
+ * `backgroundColor`, which every other colour here stands on. A thing lifted off the page takes an
133
+ * {@link elevations elevation surface} instead.
134
+ *
135
+ * The chart, map and editor colours stand outside this: the {@link palettes heat scale, the series slots, the area
136
+ * classes and the editor colours} keep values of their own, so a rebrand repaints neither what they code nor the
137
+ * content an author coloured with them: a chart, a map and a coloured passage all look the same under any brand.
138
+ *
139
+ * @module colors
140
+ */
141
+ /**
142
+ * The custom property behind every colour token.
143
+ *
144
+ * Narrowed to literals, so the design system contract can name the tokens and the custom properties they resolve to.
145
+ */
146
+ export const colors = {
147
+ color: "--skin--color",
148
+ backgroundColor: "--skin--background-color",
149
+ colorSubtle: "--skin--color-subtle",
150
+ colorStrong: "--skin--color-strong",
151
+ colorNote: "--skin--color-note",
152
+ colorPass: "--skin--color-pass",
153
+ colorFlag: "--skin--color-flag",
154
+ colorWarn: "--skin--color-warn",
155
+ colorFail: "--skin--color-fail",
156
+ colorNoteStroke: "--skin--color-note-stroke",
157
+ colorPassStroke: "--skin--color-pass-stroke",
158
+ colorFlagStroke: "--skin--color-flag-stroke",
159
+ colorWarnStroke: "--skin--color-warn-stroke",
160
+ colorFailStroke: "--skin--color-fail-stroke",
161
+ colorLabel: "--skin--color-label",
162
+ colorPlaceholder: "--skin--color-placeholder",
163
+ colorEnabled: "--skin--color-enabled",
164
+ colorDisabled: "--skin--color-disabled",
165
+ colorLink: "--skin--color-link",
166
+ colorLinkHover: "--skin--color-link-hover",
167
+ colorHover: "--skin--color-hover",
168
+ colorPressed: "--skin--color-pressed",
169
+ colorSelected: "--skin--color-selected",
170
+ colorFocus: "--skin--color-focus",
171
+ colorOver: "--skin--color-over",
172
+ colorStrongOver: "--skin--color-strong-over",
173
+ backgroundColorEdit: "--skin--background-color-edit",
174
+ backgroundColorStripe: "--skin--background-color-stripe",
175
+ backgroundColorHover: "--skin--background-color-hover",
176
+ backgroundColorPressed: "--skin--background-color-pressed",
177
+ backgroundColorSelected: "--skin--background-color-selected",
178
+ backgroundColorHoverNeutral: "--skin--background-color-hover-neutral",
179
+ backgroundColorPressedNeutral: "--skin--background-color-pressed-neutral",
180
+ backgroundColorNote: "--skin--background-color-note",
181
+ backgroundColorPass: "--skin--background-color-pass",
182
+ backgroundColorFlag: "--skin--background-color-flag",
183
+ backgroundColorWarn: "--skin--background-color-warn",
184
+ backgroundColorFail: "--skin--background-color-fail"
185
+ };
186
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../../src/tokens/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4HG;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IAErB,KAAK,EAAE,eAAe;IACtB,eAAe,EAAE,0BAA0B;IAE3C,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,sBAAsB;IAEnC,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;IAE/B,eAAe,EAAE,2BAA2B;IAC5C,eAAe,EAAE,2BAA2B;IAC5C,eAAe,EAAE,2BAA2B;IAC5C,eAAe,EAAE,2BAA2B;IAC5C,eAAe,EAAE,2BAA2B;IAE5C,UAAU,EAAE,qBAAqB;IACjC,gBAAgB,EAAE,2BAA2B;IAC7C,YAAY,EAAE,uBAAuB;IACrC,aAAa,EAAE,wBAAwB;IAEvC,SAAS,EAAE,oBAAoB;IAC/B,cAAc,EAAE,0BAA0B;IAE1C,UAAU,EAAE,qBAAqB;IACjC,YAAY,EAAE,uBAAuB;IACrC,aAAa,EAAE,wBAAwB;IACvC,UAAU,EAAE,qBAAqB;IACjC,SAAS,EAAE,oBAAoB;IAC/B,eAAe,EAAE,2BAA2B;IAE5C,mBAAmB,EAAE,+BAA+B;IACpD,qBAAqB,EAAE,iCAAiC;IAExD,oBAAoB,EAAE,gCAAgC;IACtD,sBAAsB,EAAE,kCAAkC;IAC1D,uBAAuB,EAAE,mCAAmC;IAE5D,2BAA2B,EAAE,wCAAwC;IACrE,6BAA6B,EAAE,0CAA0C;IAEzE,mBAAmB,EAAE,+BAA+B;IACpD,mBAAmB,EAAE,+BAA+B;IACpD,mBAAmB,EAAE,+BAA+B;IACpD,mBAAmB,EAAE,+BAA+B;IACpD,mBAAmB,EAAE,+BAA+B;CAE3C,CAAC"}
@@ -0,0 +1,110 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /*
18
+ * What a thing lifted off the page is painted on: the surface carrying its own background, the shadow setting it apart
19
+ * from what it covers, the blanket dimming the page behind a thing demanding an answer, and the glass gathering
20
+ * floating surfaces, blurring what shows through it. A surface and its shadow are taken together, since a surface
21
+ * without its shadow, or a shadow without its surface, leaves the lift unreadable.
22
+ */
23
+
24
+ @property --skin--background-color-raised {
25
+ syntax: "*";
26
+ inherits: true;
27
+ }
28
+
29
+ @property --skin--background-color-overlay {
30
+ syntax: "*";
31
+ inherits: true;
32
+ }
33
+
34
+ @property --skin--background-color-sunken {
35
+ syntax: "*";
36
+ inherits: true;
37
+ }
38
+
39
+ @property --skin--background-color-blanket {
40
+ syntax: "*";
41
+ inherits: true;
42
+ }
43
+
44
+ @property --skin--background-color-glass {
45
+ syntax: "*";
46
+ inherits: true;
47
+ }
48
+
49
+ /*
50
+ * A faint blur taken alongside the glass, below any step of the spacing ladder: just enough to soften what shows
51
+ * through so it does not compete with the surfaces set on the glass, while staying recognisable as what lies behind.
52
+ */
53
+
54
+ @property --skin--backdrop-filter-glass {
55
+ syntax: "*";
56
+ inherits: true;
57
+ initial-value: blur(0.5px);
58
+ }
59
+
60
+ @property --skin--box-shadow-raised {
61
+ syntax: "*";
62
+ inherits: true;
63
+ }
64
+
65
+ @property --skin--box-shadow-overlay {
66
+ syntax: "*";
67
+ inherits: true;
68
+ }
69
+
70
+ /* The shadow of the one element it is assigned to, set from a step and read by no rule, none if unassigned. */
71
+
72
+ @property --skin--box-shadow {
73
+ syntax: "*";
74
+ inherits: true;
75
+ initial-value: none;
76
+ }
77
+
78
+ /*
79
+ * Every value stands on the page anchors, so one derivation serves both schemes. Lightening the page lifts a surface
80
+ * on a dark scheme and clamps to the page itself on a light scheme whose page is already white, which is why the
81
+ * shadow is what carries the separation there. The first step clears the table stripe, which the dark page reaches
82
+ * at L 0.21: a raised card on a striped row would otherwise have no edge but its shadow. The second stays where the
83
+ * label and the focus ring still hold their budgets on it, at 4.66:1 and 3.33:1 in the dark scheme.
84
+ *
85
+ * The shadows are whole shorthand values rather than colours, so a rule states the lift in one declaration, and they
86
+ * are tinted with the text anchor rather than with black, so a dark scheme casts a shadow that reads against its own
87
+ * page.
88
+ */
89
+
90
+ :root {
91
+
92
+ --skin--background-color-raised: oklch(from var(--skin--background-color) calc(min(1, l + 0.05)) c h);
93
+ --skin--background-color-overlay: oklch(from var(--skin--background-color) calc(min(1, l + 0.08)) c h);
94
+ --skin--background-color-sunken: oklch(from var(--skin--background-color) calc(l - 0.03) c h);
95
+ --skin--background-color-blanket: color-mix(in oklab, var(--skin--color) 50%, transparent);
96
+
97
+ /*
98
+ * A translucent ground a step darker than the page, gathering the surfaces set on it into one group, so it reads
99
+ * against a light page that is already white as much as against a dark one. It carries no text of its own: the
100
+ * surfaces set on it do, and stand out from it in either scheme, being lighter than the page where it is darker.
101
+ * The step is shallow and the ground close to opaque. On the light page the group sits on a pale tray rather than
102
+ * a grey slab, on the dark one on a ground close to black, and what the glass covers only faintly shows through.
103
+ */
104
+
105
+ --skin--background-color-glass: oklch(from var(--skin--background-color) calc(l - 0.1) c h / 0.85);
106
+
107
+ --skin--box-shadow-raised: 0 1px 2px color-mix(in oklab, var(--skin--color) 20%, transparent);
108
+ --skin--box-shadow-overlay: 0 4px 12px color-mix(in oklab, var(--skin--color) 25%, transparent);
109
+
110
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Elevation tokens.
3
+ *
4
+ * Names what a thing lifted off the page is painted on: the surface it carries its own background in, the shadow
5
+ * setting it apart from what it covers, the blanket dimming the page behind a thing demanding an answer, and the glass
6
+ * gathering surfaces that float over the page into one group without a shadow of their own.
7
+ *
8
+ * @remarks
9
+ *
10
+ * **Pairing** — a surface and its shadow are taken together, `backgroundColorRaised` with `boxShadowRaised` and
11
+ * `backgroundColorOverlay` with `boxShadowOverlay`. A surface without its shadow reads as a flat patch of a slightly
12
+ * different colour, and a shadow without its surface lets the page show through wherever the reset hands an element
13
+ * `background-color: inherit`.
14
+ *
15
+ * **Steps** — `backgroundColorRaised` lifts a thing that stays in the flow, a card or a sticky header, and
16
+ * `backgroundColorOverlay` lifts one that leaves it, a menu, a popover or a dialog. `backgroundColorSunken` goes the
17
+ * other way, for a well a thing is dropped into.
18
+ *
19
+ * **Lifting** — `boxShadow` is the shadow of the one element {@link index.css css} assigns it to, set from a step.
20
+ *
21
+ * **White pages** — the surfaces are derived by lightening the page, so on a light scheme whose page is already white
22
+ * they resolve to the page colour itself and the shadow carries the whole separation, while on a dark scheme they
23
+ * lighten as expected. This is what lets one derivation serve both schemes; a design needing a visible card on a light
24
+ * page overrides the page anchor to an off-white rather than the surface.
25
+ *
26
+ * **Blankets** — `backgroundColorBlanket` is a translucent value, so it dims whatever it covers rather than replacing
27
+ * it. It pairs with the {@link layers `zIndexBlanket`} slot, which decides what it covers.
28
+ *
29
+ * **Glass** — `backgroundColorGlass` is a ground a shallow step darker than the page, gathering surfaces that float
30
+ * over the page into one group without a shadow to set them apart, such as a stack of transient notices. It is close
31
+ * to opaque, so what it covers shows through only faintly. It carries no text of its own: the surfaces set on it do,
32
+ * painted with `backgroundColorOverlay`, which stands out from it in either scheme, so their text keeps its contrast
33
+ * whatever the glass lets through. The glass takes `backdropFilterGlass` as its backdrop filter, a faint blur that
34
+ * keeps what shows through from competing with the surfaces gathered on the glass.
35
+ *
36
+ * @module elevations
37
+ */
38
+ /**
39
+ * The custom property behind every elevation token.
40
+ *
41
+ * Narrowed to literals, so the design system contract can name the tokens and the custom properties they resolve to.
42
+ */
43
+ export declare const elevations: {
44
+ readonly backgroundColorRaised: "--skin--background-color-raised";
45
+ readonly backgroundColorOverlay: "--skin--background-color-overlay";
46
+ readonly backgroundColorSunken: "--skin--background-color-sunken";
47
+ readonly backgroundColorBlanket: "--skin--background-color-blanket";
48
+ readonly backgroundColorGlass: "--skin--background-color-glass";
49
+ readonly backdropFilterGlass: "--skin--backdrop-filter-glass";
50
+ readonly boxShadowRaised: "--skin--box-shadow-raised";
51
+ readonly boxShadowOverlay: "--skin--box-shadow-overlay";
52
+ readonly boxShadow: "--skin--box-shadow";
53
+ };
54
+ //# sourceMappingURL=elevations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevations.d.ts","sourceRoot":"","sources":["../../src/tokens/elevations.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;CAab,CAAC"}
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Elevation tokens.
18
+ *
19
+ * Names what a thing lifted off the page is painted on: the surface it carries its own background in, the shadow
20
+ * setting it apart from what it covers, the blanket dimming the page behind a thing demanding an answer, and the glass
21
+ * gathering surfaces that float over the page into one group without a shadow of their own.
22
+ *
23
+ * @remarks
24
+ *
25
+ * **Pairing** — a surface and its shadow are taken together, `backgroundColorRaised` with `boxShadowRaised` and
26
+ * `backgroundColorOverlay` with `boxShadowOverlay`. A surface without its shadow reads as a flat patch of a slightly
27
+ * different colour, and a shadow without its surface lets the page show through wherever the reset hands an element
28
+ * `background-color: inherit`.
29
+ *
30
+ * **Steps** — `backgroundColorRaised` lifts a thing that stays in the flow, a card or a sticky header, and
31
+ * `backgroundColorOverlay` lifts one that leaves it, a menu, a popover or a dialog. `backgroundColorSunken` goes the
32
+ * other way, for a well a thing is dropped into.
33
+ *
34
+ * **Lifting** — `boxShadow` is the shadow of the one element {@link index.css css} assigns it to, set from a step.
35
+ *
36
+ * **White pages** — the surfaces are derived by lightening the page, so on a light scheme whose page is already white
37
+ * they resolve to the page colour itself and the shadow carries the whole separation, while on a dark scheme they
38
+ * lighten as expected. This is what lets one derivation serve both schemes; a design needing a visible card on a light
39
+ * page overrides the page anchor to an off-white rather than the surface.
40
+ *
41
+ * **Blankets** — `backgroundColorBlanket` is a translucent value, so it dims whatever it covers rather than replacing
42
+ * it. It pairs with the {@link layers `zIndexBlanket`} slot, which decides what it covers.
43
+ *
44
+ * **Glass** — `backgroundColorGlass` is a ground a shallow step darker than the page, gathering surfaces that float
45
+ * over the page into one group without a shadow to set them apart, such as a stack of transient notices. It is close
46
+ * to opaque, so what it covers shows through only faintly. It carries no text of its own: the surfaces set on it do,
47
+ * painted with `backgroundColorOverlay`, which stands out from it in either scheme, so their text keeps its contrast
48
+ * whatever the glass lets through. The glass takes `backdropFilterGlass` as its backdrop filter, a faint blur that
49
+ * keeps what shows through from competing with the surfaces gathered on the glass.
50
+ *
51
+ * @module elevations
52
+ */
53
+ /**
54
+ * The custom property behind every elevation token.
55
+ *
56
+ * Narrowed to literals, so the design system contract can name the tokens and the custom properties they resolve to.
57
+ */
58
+ export const elevations = {
59
+ backgroundColorRaised: "--skin--background-color-raised",
60
+ backgroundColorOverlay: "--skin--background-color-overlay",
61
+ backgroundColorSunken: "--skin--background-color-sunken",
62
+ backgroundColorBlanket: "--skin--background-color-blanket",
63
+ backgroundColorGlass: "--skin--background-color-glass",
64
+ backdropFilterGlass: "--skin--backdrop-filter-glass",
65
+ boxShadowRaised: "--skin--box-shadow-raised",
66
+ boxShadowOverlay: "--skin--box-shadow-overlay",
67
+ boxShadow: "--skin--box-shadow"
68
+ };
69
+ //# sourceMappingURL=elevations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevations.js","sourceRoot":"","sources":["../../src/tokens/elevations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IAEzB,qBAAqB,EAAE,iCAAiC;IACxD,sBAAsB,EAAE,kCAAkC;IAC1D,qBAAqB,EAAE,iCAAiC;IACxD,sBAAsB,EAAE,kCAAkC;IAC1D,oBAAoB,EAAE,gCAAgC;IACtD,mBAAmB,EAAE,+BAA+B;IAEpD,eAAe,EAAE,2BAA2B;IAC5C,gBAAgB,EAAE,4BAA4B;IAC9C,SAAS,EAAE,oBAAoB;CAEtB,CAAC"}