@grafctory/clay-widgets 0.0.0-stage → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +46 -2
- package/dist/content/empty.css +107 -0
- package/dist/content/empty.d.ts +40 -0
- package/dist/content/empty.d.ts.map +1 -0
- package/dist/content/empty.js +42 -0
- package/dist/content/empty.js.map +1 -0
- package/dist/content/heading.css +34 -0
- package/dist/content/heading.d.ts +45 -0
- package/dist/content/heading.d.ts.map +1 -0
- package/dist/content/heading.js +49 -0
- package/dist/content/heading.js.map +1 -0
- package/dist/content/image.css +176 -0
- package/dist/content/image.d.ts +71 -0
- package/dist/content/image.d.ts.map +1 -0
- package/dist/content/image.js +63 -0
- package/dist/content/image.js.map +1 -0
- package/dist/content/infobox.css +186 -0
- package/dist/content/infobox.d.ts +72 -0
- package/dist/content/infobox.d.ts.map +1 -0
- package/dist/content/infobox.js +63 -0
- package/dist/content/infobox.js.map +1 -0
- package/dist/content/pill.css +76 -0
- package/dist/content/pill.d.ts +57 -0
- package/dist/content/pill.d.ts.map +1 -0
- package/dist/content/pill.js +48 -0
- package/dist/content/pill.js.map +1 -0
- package/dist/content/text.css +44 -0
- package/dist/content/text.d.ts +30 -0
- package/dist/content/text.d.ts.map +1 -0
- package/dist/content/text.js +42 -0
- package/dist/content/text.js.map +1 -0
- package/dist/controls/button.css +469 -0
- package/dist/controls/button.d.ts +116 -0
- package/dist/controls/button.d.ts.map +1 -0
- package/dist/controls/button.js +61 -0
- package/dist/controls/button.js.map +1 -0
- package/dist/controls/checkbox.css +23 -0
- package/dist/controls/checkbox.d.ts +54 -0
- package/dist/controls/checkbox.d.ts.map +1 -0
- package/dist/controls/checkbox.js +49 -0
- package/dist/controls/checkbox.js.map +1 -0
- package/dist/controls/choice.css +288 -0
- package/dist/controls/choice.d.ts +63 -0
- package/dist/controls/choice.d.ts.map +1 -0
- package/dist/controls/choice.js +52 -0
- package/dist/controls/choice.js.map +1 -0
- package/dist/controls/fieldset.css +37 -0
- package/dist/controls/fieldset.d.ts +49 -0
- package/dist/controls/fieldset.d.ts.map +1 -0
- package/dist/controls/fieldset.js +51 -0
- package/dist/controls/fieldset.js.map +1 -0
- package/dist/controls/form.css +50 -0
- package/dist/controls/form.d.ts +64 -0
- package/dist/controls/form.d.ts.map +1 -0
- package/dist/controls/form.js +62 -0
- package/dist/controls/form.js.map +1 -0
- package/dist/controls/input.css +57 -0
- package/dist/controls/input.d.ts +120 -0
- package/dist/controls/input.d.ts.map +1 -0
- package/dist/controls/input.js +78 -0
- package/dist/controls/input.js.map +1 -0
- package/dist/controls/label.css +73 -0
- package/dist/controls/label.d.ts +76 -0
- package/dist/controls/label.d.ts.map +1 -0
- package/dist/controls/label.js +73 -0
- package/dist/controls/label.js.map +1 -0
- package/dist/controls/radio.css +23 -0
- package/dist/controls/radio.d.ts +60 -0
- package/dist/controls/radio.d.ts.map +1 -0
- package/dist/controls/radio.js +50 -0
- package/dist/controls/radio.js.map +1 -0
- package/dist/controls/select.css +37 -0
- package/dist/controls/select.d.ts +62 -0
- package/dist/controls/select.d.ts.map +1 -0
- package/dist/controls/select.js +59 -0
- package/dist/controls/select.js.map +1 -0
- package/dist/controls/switch.css +154 -0
- package/dist/controls/switch.d.ts +44 -0
- package/dist/controls/switch.d.ts.map +1 -0
- package/dist/controls/switch.js +48 -0
- package/dist/controls/switch.js.map +1 -0
- package/dist/controls/textarea.css +50 -0
- package/dist/controls/textarea.d.ts +97 -0
- package/dist/controls/textarea.d.ts.map +1 -0
- package/dist/controls/textarea.js +75 -0
- package/dist/controls/textarea.js.map +1 -0
- package/dist/glyphs/icon.core.d.ts +52 -0
- package/dist/glyphs/icon.core.d.ts.map +1 -0
- package/dist/glyphs/icon.core.js +67 -0
- package/dist/glyphs/icon.core.js.map +1 -0
- package/dist/glyphs/icon.css +32 -0
- package/dist/glyphs/icon.d.ts +152 -0
- package/dist/glyphs/icon.d.ts.map +1 -0
- package/dist/glyphs/icon.js +167 -0
- package/dist/glyphs/icon.js.map +1 -0
- package/dist/glyphs/icon.md +76 -0
- package/dist/glyphs/logo.css +73 -0
- package/dist/glyphs/logo.d.ts +27 -0
- package/dist/glyphs/logo.d.ts.map +1 -0
- package/dist/glyphs/logo.js +49 -0
- package/dist/glyphs/logo.js.map +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts/card.css +166 -0
- package/dist/layouts/card.d.ts +69 -0
- package/dist/layouts/card.d.ts.map +1 -0
- package/dist/layouts/card.js +57 -0
- package/dist/layouts/card.js.map +1 -0
- package/dist/layouts/stack.css +58 -0
- package/dist/layouts/stack.d.ts +64 -0
- package/dist/layouts/stack.d.ts.map +1 -0
- package/dist/layouts/stack.js +69 -0
- package/dist/layouts/stack.js.map +1 -0
- package/dist/layouts/strip.css +58 -0
- package/dist/layouts/strip.d.ts +72 -0
- package/dist/layouts/strip.d.ts.map +1 -0
- package/dist/layouts/strip.js +73 -0
- package/dist/layouts/strip.js.map +1 -0
- package/dist/layouts/tabs.core.d.ts +73 -0
- package/dist/layouts/tabs.core.d.ts.map +1 -0
- package/dist/layouts/tabs.core.js +65 -0
- package/dist/layouts/tabs.core.js.map +1 -0
- package/dist/layouts/tabs.css +260 -0
- package/dist/layouts/tabs.d.ts +57 -0
- package/dist/layouts/tabs.d.ts.map +1 -0
- package/dist/layouts/tabs.js +128 -0
- package/dist/layouts/tabs.js.map +1 -0
- package/dist/layouts/tree.css +138 -0
- package/dist/layouts/tree.d.ts +46 -0
- package/dist/layouts/tree.d.ts.map +1 -0
- package/dist/layouts/tree.js +69 -0
- package/dist/layouts/tree.js.map +1 -0
- package/dist/navigation/link.css +229 -0
- package/dist/navigation/link.d.ts +89 -0
- package/dist/navigation/link.d.ts.map +1 -0
- package/dist/navigation/link.js +91 -0
- package/dist/navigation/link.js.map +1 -0
- package/dist/navigation/path.css +122 -0
- package/dist/navigation/path.d.ts +42 -0
- package/dist/navigation/path.d.ts.map +1 -0
- package/dist/navigation/path.js +49 -0
- package/dist/navigation/path.js.map +1 -0
- package/dist/navigation/toc.core.d.ts +111 -0
- package/dist/navigation/toc.core.d.ts.map +1 -0
- package/dist/navigation/toc.core.js +60 -0
- package/dist/navigation/toc.core.js.map +1 -0
- package/dist/navigation/toc.css +53 -0
- package/dist/navigation/toc.d.ts +112 -0
- package/dist/navigation/toc.d.ts.map +1 -0
- package/dist/navigation/toc.js +321 -0
- package/dist/navigation/toc.js.map +1 -0
- package/dist/scopes/guard.css +26 -0
- package/dist/scopes/guard.d.ts +37 -0
- package/dist/scopes/guard.d.ts.map +1 -0
- package/dist/scopes/guard.js +60 -0
- package/dist/scopes/guard.js.map +1 -0
- package/dist/scopes/style.css +26 -0
- package/dist/scopes/style.d.ts +68 -0
- package/dist/scopes/style.d.ts.map +1 -0
- package/dist/scopes/style.js +108 -0
- package/dist/scopes/style.js.map +1 -0
- package/dist/shells/tool.css +778 -0
- package/dist/shells/tool.d.ts +164 -0
- package/dist/shells/tool.d.ts.map +1 -0
- package/dist/shells/tool.js +251 -0
- package/dist/shells/tool.js.map +1 -0
- package/dist/signals/more.css +42 -0
- package/dist/signals/more.d.ts +28 -0
- package/dist/signals/more.d.ts.map +1 -0
- package/dist/signals/more.js +61 -0
- package/dist/signals/more.js.map +1 -0
- package/dist/signals/note.css +221 -0
- package/dist/signals/note.d.ts +83 -0
- package/dist/signals/note.d.ts.map +1 -0
- package/dist/signals/note.js +72 -0
- package/dist/signals/note.js.map +1 -0
- package/dist/signals/toasts.css +463 -0
- package/dist/signals/toasts.d.ts +68 -0
- package/dist/signals/toasts.d.ts.map +1 -0
- package/dist/signals/toasts.js +160 -0
- package/dist/signals/toasts.js.map +1 -0
- package/package.json +331 -4
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 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
|
+
* The colour, the type and the states of a button are the design system's, so the sheet holds only what the widget
|
|
19
|
+
* owes on top of them. The element is a box exactly as large as the control it holds, so the row or the grid around
|
|
20
|
+
* it lays the button out, and offsets it at an edge, as it would a button written by hand.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/* The look of a button stating none, which an area assigns to every button it holds. */
|
|
24
|
+
|
|
25
|
+
@property --clay-button-look {
|
|
26
|
+
syntax: "subtle | normal | strong";
|
|
27
|
+
inherits: true;
|
|
28
|
+
initial-value: normal;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
clay-button {
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* A control is sized by what it carries, so it sits in a line of text as the native element does rather than
|
|
35
|
+
* taking the width of the block around it, which is what the flex row the design system gives every button
|
|
36
|
+
* would otherwise leave it with.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* A flex row takes its baseline from the first thing it carries, which is the glyph where a button is marked with
|
|
43
|
+
* one, so a row of buttons would sit at as many heights as it holds kinds. They line up on their middles instead,
|
|
44
|
+
* which is the one anchor a glyph and a label share.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
vertical-align: middle;
|
|
48
|
+
|
|
49
|
+
& > button {
|
|
50
|
+
|
|
51
|
+
/* The control fills the element, so a row or a grid stretching the element stretches the control along. */
|
|
52
|
+
|
|
53
|
+
flex: auto;
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* A glyph standing alone leaves a box smaller than the minimum a pointer target is held to, so the control is
|
|
58
|
+
* floored at a measure clearing that minimum and centres whatever it carries. The measure rides with the text,
|
|
59
|
+
* as the whole ladder does, so a button set in much smaller text owes a floor of its own.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
justify-content: center;
|
|
63
|
+
|
|
64
|
+
min-width: var(--skin--scaling-150);
|
|
65
|
+
min-height: var(--skin--scaling-150);
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
* The reset hands every box the colour of the one around it, which a translucent cover turns into a second
|
|
69
|
+
* coat: the glyph would take the cover again and stand in a darker square on the fill. What the control carries
|
|
70
|
+
* is left unpainted, so the cover is laid once across the whole of it.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
& > * {
|
|
74
|
+
background-color: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
* A label needs room from the edge of the control it names, or the focus ring and the press target close on the
|
|
81
|
+
* text, while a glyph standing alone is already held clear by the floor above. The element states which of the
|
|
82
|
+
* two it carries, a selector having no way to tell a text node from a mark.
|
|
83
|
+
*/
|
|
84
|
+
|
|
85
|
+
&[labelled] > button {
|
|
86
|
+
|
|
87
|
+
padding-block: var(--skin--spacing-025);
|
|
88
|
+
padding-inline: var(--skin--spacing-050);
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* A glyph is drawn inside a box of its own and leaves a margin within it, so the full padding reads as a wider
|
|
92
|
+
* edge on the side it sits on than on the side the text ends at. A control leading with a mark is pulled in on
|
|
93
|
+
* that side, which leaves the two edges reading as even. A glyph given as text keeps the full padding, as text.
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
&:has(> *) {
|
|
97
|
+
padding-inline-start: var(--skin--spacing-025);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* A mark standing alone sits in the floor above with just enough air all round to read as a fill closing on the
|
|
104
|
+
* glyph rather than as a box drawn around it. The box sizes from its border, so nothing below the floor changes
|
|
105
|
+
* what the control measures, and it keeps the height its neighbours are set at.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
&:not([labelled]) > button {
|
|
109
|
+
padding: var(--skin--spacing-025);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
* How loud the control appears is told in rule, weight and fill, never in hue, which stays with what the control
|
|
114
|
+
* means. The three steps keep the same room, so a row mixing them holds its rhythm and the ladder is read off how
|
|
115
|
+
* the control is drawn rather than off the width of one control against another.
|
|
116
|
+
*
|
|
117
|
+
* The quiet step keeps no rule and reads as part of the text it sits in. The ordinary step is bounded by a rule,
|
|
118
|
+
* which is what tells a control from that text. Once the control is live the rule takes a share of the colour of
|
|
119
|
+
* its mode laid over the fill beneath it, so the rule reads as a deeper edge of that fill rather than as a grey
|
|
120
|
+
* frame drawn around it, while a disabled control keeps the neutral rule the design system draws boundaries with.
|
|
121
|
+
* The loud step is filled solid in the colour of its mode and set in the strong weight, so it stands out as the one
|
|
122
|
+
* control a row is meant to lead with. Its rule is laid in the same box and takes the fill once the control is
|
|
123
|
+
* live, so it keeps the size of its neighbours, while a disabled control keeps the neutral rule.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
&[look="normal"] > button,
|
|
127
|
+
&[look="strong"] > button {
|
|
128
|
+
border: var(--skin--border-width) var(--skin--border-style) var(--skin--border-color);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&[look="normal"] > button:enabled {
|
|
132
|
+
border-color: color-mix(in oklab, var(--clay-button-fill) 35%, transparent);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&[look="strong"] {
|
|
136
|
+
|
|
137
|
+
& > button {
|
|
138
|
+
|
|
139
|
+
font-weight: var(--skin--font-weight-strong);
|
|
140
|
+
|
|
141
|
+
& .lucide {
|
|
142
|
+
stroke-width: var(--skin--stroke-width-strong);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/*
|
|
148
|
+
* A mark beside a label is read at the size of the text it sits in, where the strong stroke closes the
|
|
149
|
+
* counters of the glyph and leaves it heavier than the word it leads. It is drawn lighter, to match the weight
|
|
150
|
+
* of that word, while the mark standing alone keeps the strong stroke whole.
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
&[labelled] > button .lucide {
|
|
154
|
+
stroke-width: calc((var(--skin--stroke-width) + var(--skin--stroke-width-strong)) / 2);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/*
|
|
160
|
+
* What activating the control will do is told in colour, on the five-step scale every meaning in the interface
|
|
161
|
+
* lands on: `safe` takes the unjudged step, `commit`, `publish`, `alert` and `danger` the verdict ramp. Every step
|
|
162
|
+
* is built alike, a tint filling the control and the step's stroke role painting the label, so five controls side
|
|
163
|
+
* by side read as one family and a row of them is ordered by hue alone. A step that shouted past its neighbours
|
|
164
|
+
* would say more about the widget than about the action the reader is about to take.
|
|
165
|
+
*
|
|
166
|
+
* The label takes the stroke role of its step rather than the anchor. In the light scheme the two are one colour
|
|
167
|
+
* for every step, while in the dark scheme each stroke is carried towards the page text and reads lighter than its
|
|
168
|
+
* anchor. A stroke role holds AA on the bare page, so the quiet step drops the fill and keeps the same ink, and on
|
|
169
|
+
* the tint of its step for every step but caution, whose label the rule below darkens to hold AA on its tint.
|
|
170
|
+
*
|
|
171
|
+
* A step paints a control that is live, and one that is not leaves it to the disabled colour the design system
|
|
172
|
+
* greys every control with, which is why each rule is held to `:enabled`.
|
|
173
|
+
*
|
|
174
|
+
* Under the pointer the fill deepens by a share of what the control already carries, and under the press by
|
|
175
|
+
* more again, so the two states are told apart by how far the same colour has travelled rather than by a second
|
|
176
|
+
* colour. A control carrying no step travels along a neutral, and one carrying a step along the step, which is
|
|
177
|
+
* what keeps the colour the reader is following from giving way to the accent an ordinary button answers to. The
|
|
178
|
+
* shares are read off the tints the design system already mixes, so the five move together in either scheme.
|
|
179
|
+
*
|
|
180
|
+
* The neutral pair is the one the design system lays over whatever surface a control stands on, so the gesture
|
|
181
|
+
* reads alike on the page and on the sunken tray. It keeps the label and the focus ring legible everywhere but on
|
|
182
|
+
* an overlay, where a control carrying no step would take the accent states instead.
|
|
183
|
+
*
|
|
184
|
+
* A control carrying no step is set in the subtle accent at every look, at rest and under the gesture alike, so
|
|
185
|
+
* it reads as a control without claiming a meaning: 10.01:1 on the light page and 7.93:1 on the dark one.
|
|
186
|
+
*/
|
|
187
|
+
|
|
188
|
+
&[mode="normal"] > button:enabled {
|
|
189
|
+
|
|
190
|
+
--clay-button-fill: var(--skin--color-subtle);
|
|
191
|
+
--clay-button-ink: color-mix(in oklab, var(--skin--color-subtle) 12%, var(--skin--background-color));
|
|
192
|
+
|
|
193
|
+
color: var(--skin--color-subtle);
|
|
194
|
+
|
|
195
|
+
&:hover {
|
|
196
|
+
background-color: var(--skin--background-color-hover-neutral);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:active {
|
|
200
|
+
background-color: var(--skin--background-color-pressed-neutral);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/*
|
|
206
|
+
* A status button paints its label in the stroke of its step, which holds AA on the step's tint alone: on the fills
|
|
207
|
+
* the pointer and the press deepen it to, the label takes the page text. The caution stroke is never set on its
|
|
208
|
+
* own tint, where it falls to 4.16:1, so the caution label carries it a short way towards the page text at rest,
|
|
209
|
+
* keeping the gold while holding 5.93:1 on the light tint and 5.84:1 on the dark one.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
&[mode="safe"] > button:enabled {
|
|
213
|
+
|
|
214
|
+
--clay-button-fill: var(--skin--color-note);
|
|
215
|
+
--clay-button-ink: var(--skin--background-color-note);
|
|
216
|
+
|
|
217
|
+
color: var(--skin--color-note-stroke);
|
|
218
|
+
background-color: var(--skin--background-color-note);
|
|
219
|
+
|
|
220
|
+
&:hover {
|
|
221
|
+
color: var(--skin--color);
|
|
222
|
+
background-color: color-mix(in oklab, var(--skin--color-note) 12%, var(--skin--background-color-note));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&:active {
|
|
226
|
+
color: var(--skin--color);
|
|
227
|
+
background-color: color-mix(in oklab, var(--skin--color-note) 24%, var(--skin--background-color-note));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&[mode="commit"] > button:enabled {
|
|
233
|
+
|
|
234
|
+
--clay-button-fill: var(--skin--color-pass);
|
|
235
|
+
--clay-button-ink: var(--skin--background-color-pass);
|
|
236
|
+
|
|
237
|
+
color: var(--skin--color-pass-stroke);
|
|
238
|
+
background-color: var(--skin--background-color-pass);
|
|
239
|
+
|
|
240
|
+
&:hover {
|
|
241
|
+
color: var(--skin--color);
|
|
242
|
+
background-color: color-mix(in oklab, var(--skin--color-pass) 12%, var(--skin--background-color-pass));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&:active {
|
|
246
|
+
color: var(--skin--color);
|
|
247
|
+
background-color: color-mix(in oklab, var(--skin--color-pass) 24%, var(--skin--background-color-pass));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&[mode="publish"] > button:enabled {
|
|
253
|
+
|
|
254
|
+
--clay-button-fill: var(--skin--color-flag);
|
|
255
|
+
--clay-button-ink: var(--skin--background-color-flag);
|
|
256
|
+
|
|
257
|
+
color: var(--skin--color-flag-stroke);
|
|
258
|
+
background-color: var(--skin--background-color-flag);
|
|
259
|
+
|
|
260
|
+
&:hover {
|
|
261
|
+
color: var(--skin--color);
|
|
262
|
+
background-color: color-mix(in oklab, var(--skin--color-flag) 12%, var(--skin--background-color-flag));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&:active {
|
|
266
|
+
color: var(--skin--color);
|
|
267
|
+
background-color: color-mix(in oklab, var(--skin--color-flag) 24%, var(--skin--background-color-flag));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&[mode="alert"] > button:enabled {
|
|
273
|
+
|
|
274
|
+
--clay-button-fill: var(--skin--color-warn);
|
|
275
|
+
--clay-button-ink: var(--skin--color-over);
|
|
276
|
+
|
|
277
|
+
color: color-mix(in oklab, var(--skin--color-warn-stroke) 85%, var(--skin--color));
|
|
278
|
+
background-color: var(--skin--background-color-warn);
|
|
279
|
+
|
|
280
|
+
&:hover {
|
|
281
|
+
color: var(--skin--color);
|
|
282
|
+
background-color: color-mix(in oklab, var(--skin--color-warn) 12%, var(--skin--background-color-warn));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&:active {
|
|
286
|
+
color: var(--skin--color);
|
|
287
|
+
background-color: color-mix(in oklab, var(--skin--color-warn) 24%, var(--skin--background-color-warn));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
&[mode="danger"] > button:enabled {
|
|
293
|
+
|
|
294
|
+
--clay-button-fill: var(--skin--color-fail);
|
|
295
|
+
--clay-button-ink: var(--skin--background-color-fail);
|
|
296
|
+
|
|
297
|
+
color: var(--skin--color-fail-stroke);
|
|
298
|
+
background-color: var(--skin--background-color-fail);
|
|
299
|
+
|
|
300
|
+
&:hover {
|
|
301
|
+
color: var(--skin--color);
|
|
302
|
+
background-color: color-mix(in oklab, var(--skin--color-fail) 12%, var(--skin--background-color-fail));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
&:active {
|
|
306
|
+
color: var(--skin--color);
|
|
307
|
+
background-color: color-mix(in oklab, var(--skin--color-fail) 24%, var(--skin--background-color-fail));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/*
|
|
313
|
+
* A live loud control is filled solid, so it reads as a block of ink a row is meant to lead with. The fill is the
|
|
314
|
+
* anchor each mode names above, or the subtle accent where the control carries no step. The label takes the ink
|
|
315
|
+
* paired with the fill, the tint of the same hue, which holds AA in both schemes, 4.56:1 at the worst, over the
|
|
316
|
+
* light green. The light gold falls short of its own tint, at 4.16:1, so caution sets its label in the colour the
|
|
317
|
+
* design system pairs with a solid fill instead, at 4.87:1 light and 5.48:1 dark. The rule takes the fill, keeping
|
|
318
|
+
* the control the size of its neighbours, while a disabled control keeps the neutral rule and the disabled grey.
|
|
319
|
+
*
|
|
320
|
+
* Under the pointer and the press the fill travels towards the page text, further under the press, which only
|
|
321
|
+
* widens the contrast of the label set over it, so the two states never cost the control its legibility.
|
|
322
|
+
*
|
|
323
|
+
* The focus ring is drawn outside the fill, where it meets the page and holds 3:1 in both schemes: the ring the
|
|
324
|
+
* design system draws inside a control would sit on the fill, against which its grey all but disappears.
|
|
325
|
+
*
|
|
326
|
+
* The rules follow the mode rules they override, matching them in specificity and winning by order.
|
|
327
|
+
*/
|
|
328
|
+
|
|
329
|
+
&[look="strong"] > button:enabled {
|
|
330
|
+
|
|
331
|
+
color: var(--clay-button-ink);
|
|
332
|
+
background-color: var(--clay-button-fill);
|
|
333
|
+
border-color: transparent;
|
|
334
|
+
|
|
335
|
+
&:focus-visible {
|
|
336
|
+
outline-offset: var(--skin--border-width);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
&:hover {
|
|
340
|
+
color: var(--clay-button-ink);
|
|
341
|
+
background-color: color-mix(in oklab, var(--clay-button-fill) 80%, var(--skin--color));
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
&:active {
|
|
345
|
+
color: var(--clay-button-ink);
|
|
346
|
+
background-color: color-mix(in oklab, var(--clay-button-fill) 60%, var(--skin--color));
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/*
|
|
352
|
+
* The quiet step keeps the mark and the label at the gap every button sets them apart by, so the two still read
|
|
353
|
+
* as one word once the frame around them is gone. It takes the ink of its mode and neither the fill
|
|
354
|
+
* nor the rule the design system boxes every button with, which is what leaves it reading as part of the text
|
|
355
|
+
* around it where the other two read as controls. The fill still answers the pointer, so the control says as
|
|
356
|
+
* much as its neighbours once the reader reaches it, without ever drawing the frame the other steps are set in.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
&[look="subtle"] > button {
|
|
360
|
+
|
|
361
|
+
column-gap: var(--skin--spacing-050);
|
|
362
|
+
border-style: none;
|
|
363
|
+
|
|
364
|
+
&:enabled {
|
|
365
|
+
background-color: transparent;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/*
|
|
371
|
+
* Caution sets its label in the page text only to keep it off its own tint. With no tint beneath it at rest, the
|
|
372
|
+
* quiet step paints the label in the caution stroke, which holds AA on the bare page in both schemes, at 4.87:1
|
|
373
|
+
* on the light one and 5.48:1 on the dark one, and leaves the page text to the fills of the pointer and the press.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
&[look="subtle"][mode="alert"] > button:enabled:not(:hover, :active) {
|
|
377
|
+
color: var(--skin--color-warn-stroke);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/*
|
|
381
|
+
* A button stating no look of its own takes the one the area around it sets, read off the `--clay-button-look`
|
|
382
|
+
* knob through a style query: a rule has no other way to branch on a value, and the knob inherits, so every
|
|
383
|
+
* button sits inside a container answering for it without a rule declaring one. The attribute has to be absent
|
|
384
|
+
* for the container to have a say, which is why the widget renders it only where the consumer asked for a look,
|
|
385
|
+
* and why each rule here holds itself to a button carrying none, leaving a stated look to the rules above.
|
|
386
|
+
*
|
|
387
|
+
* The declarations are the ones the attribute rules above carry, restated rather than shared: a style query is a
|
|
388
|
+
* conditional group and takes rules of its own, so the two forms of a step cannot be written as one selector.
|
|
389
|
+
*/
|
|
390
|
+
|
|
391
|
+
@container style(--clay-button-look: normal) {
|
|
392
|
+
|
|
393
|
+
&:not([look]) > button {
|
|
394
|
+
|
|
395
|
+
border: var(--skin--border-width) var(--skin--border-style) var(--skin--border-color);
|
|
396
|
+
|
|
397
|
+
&:enabled {
|
|
398
|
+
border-color: color-mix(in oklab, var(--clay-button-fill) 35%, transparent);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
@container style(--clay-button-look: strong) {
|
|
406
|
+
|
|
407
|
+
&:not([look]) {
|
|
408
|
+
|
|
409
|
+
& > button {
|
|
410
|
+
|
|
411
|
+
border: var(--skin--border-width) var(--skin--border-style) var(--skin--border-color);
|
|
412
|
+
font-weight: var(--skin--font-weight-strong);
|
|
413
|
+
|
|
414
|
+
& .lucide {
|
|
415
|
+
stroke-width: var(--skin--stroke-width-strong);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
& > button:enabled {
|
|
421
|
+
|
|
422
|
+
color: var(--clay-button-ink);
|
|
423
|
+
background-color: var(--clay-button-fill);
|
|
424
|
+
border-color: transparent;
|
|
425
|
+
|
|
426
|
+
&:focus-visible {
|
|
427
|
+
outline-offset: var(--skin--border-width);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
&:hover {
|
|
431
|
+
color: var(--clay-button-ink);
|
|
432
|
+
background-color: color-mix(in oklab, var(--clay-button-fill) 80%, var(--skin--color));
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
&:active {
|
|
436
|
+
color: var(--clay-button-ink);
|
|
437
|
+
background-color: color-mix(in oklab, var(--clay-button-fill) 60%, var(--skin--color));
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
&[labelled] > button .lucide {
|
|
443
|
+
stroke-width: calc((var(--skin--stroke-width) + var(--skin--stroke-width-strong)) / 2);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
@container style(--clay-button-look: subtle) {
|
|
451
|
+
|
|
452
|
+
&:not([look]) > button {
|
|
453
|
+
|
|
454
|
+
column-gap: var(--skin--spacing-050);
|
|
455
|
+
border-style: none;
|
|
456
|
+
|
|
457
|
+
&:enabled {
|
|
458
|
+
background-color: transparent;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
&:not([look])[mode="alert"] > button:enabled:not(:hover, :active) {
|
|
464
|
+
color: var(--skin--color-warn-stroke);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action control.
|
|
3
|
+
*
|
|
4
|
+
* Offers the control an action is taken with, shown as a glyph, a label, or both, with the activation, the focus
|
|
5
|
+
* handling and the disabled state the platform already carries on a native button.
|
|
6
|
+
*
|
|
7
|
+
* @module button
|
|
8
|
+
*/
|
|
9
|
+
import { type ComponentChildren, type TargetedMouseEvent } from "preact";
|
|
10
|
+
import "./button.css";
|
|
11
|
+
/**
|
|
12
|
+
* Creates a button.
|
|
13
|
+
*
|
|
14
|
+
* Shows a glyph, a label, or a glyph followed by a label, on a native control, so the button role, the activation by
|
|
15
|
+
* `Enter` and `Space`, the single tab stop, the focus ring and the greyed disabled state come with it rather than
|
|
16
|
+
* having to be asked for. A button states a label, a name or a hint, and the type requires one of them: a glyph
|
|
17
|
+
* standing alone is named by `name` or, failing that, by `title`; a hint offered beside a label or a name speaks to a
|
|
18
|
+
* resting pointer alone and names nothing.
|
|
19
|
+
*
|
|
20
|
+
* The glyph is kept out of the accessibility tree, leaving the label, `name` or `title` to name the control, and
|
|
21
|
+
* the control is drawn at least as large as the smallest target a pointer is asked to hit, label or no label.
|
|
22
|
+
*
|
|
23
|
+
* @param options The widget configuration
|
|
24
|
+
*
|
|
25
|
+
* @returns The button
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/button/ ARIA Authoring Practices: Button Pattern}
|
|
28
|
+
*/
|
|
29
|
+
export declare function Button({ name, controls, disabled, expanded, look, // deliberately left undefaulted, so an unstated look falls through to the one the area assigns
|
|
30
|
+
mode, type, icon, label, title, onClick }: {
|
|
31
|
+
/**
|
|
32
|
+
* The accessible name, required where a glyph stands alone and no `title` names the button; where a label is shown
|
|
33
|
+
* as well, it must include the text of that label, so that a reader asking for the control by what they see
|
|
34
|
+
* reaches it.
|
|
35
|
+
*/
|
|
36
|
+
name?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The id of the region the button shows and hides, which has to be rendered whether shown or not; stated together
|
|
39
|
+
* with `expanded`, making the button a disclosure assistive technology lets the reader follow to the region.
|
|
40
|
+
*/
|
|
41
|
+
controls?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the button is inactive, greyed and out of the tab order like any disabled control; live if omitted.
|
|
44
|
+
*/
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the region the button discloses is on show, announced as the expanded state of the control; stated for a
|
|
48
|
+
* disclosure alone, and left out of any other button, which then announces no such state.
|
|
49
|
+
*/
|
|
50
|
+
expanded?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* How loud the button appears. A `subtle` button has no border and reads as part of the text around it. A `normal`
|
|
53
|
+
* button is bounded by a border. A `strong` button is filled solid in the colour of its `mode`, and its label is
|
|
54
|
+
* set in the strong weight, in a tint of the same hue close to the page colour. What the button means is stated
|
|
55
|
+
* apart, by `mode`, and the look only tells how loudly that meaning is put to the reader of the interface.
|
|
56
|
+
*
|
|
57
|
+
* A button stating nothing takes the look the {@link style!Style styled area} around it assigns as `buttonLook`,
|
|
58
|
+
* which is `normal` where nothing assigns it. Stating a look here answers to that alone, so one loud control in a
|
|
59
|
+
* quietened toolbar stays loud, while every other control in it recedes as the area asks.
|
|
60
|
+
*/
|
|
61
|
+
look?: "subtle" | "normal" | "strong";
|
|
62
|
+
/**
|
|
63
|
+
* What activating the button will do, told in colour on the five-step scale every meaning in the interface lands
|
|
64
|
+
* on: `safe` is the harmless one where another destroys (`note`), `commit` makes a change stick (`pass`), `publish`
|
|
65
|
+
* takes the result out to others, worth a moment's attention but not risky (`flag`), `alert` asks for a second
|
|
66
|
+
* thought (`warn`), `danger` destroys (`fail`), and `normal`, the default, says nothing in particular and takes the
|
|
67
|
+
* subtle accent rather than a step colour. The five steps are built alike: coloured text at the `subtle` look, a
|
|
68
|
+
* tinted fill at the `normal` look, and a solid fill at the `strong` one. None of them shouts past its neighbours,
|
|
69
|
+
* so how loud the button appears stays the business of `look`. A mode is never told in colour alone, so a button
|
|
70
|
+
* carrying one says the same thing in its label or its glyph, for a reader who cannot tell the hues apart.
|
|
71
|
+
*/
|
|
72
|
+
mode?: "normal" | "safe" | "commit" | "publish" | "alert" | "danger";
|
|
73
|
+
/**
|
|
74
|
+
* What the button does to the form it sits in: `submit` sends it, `reset` restores it, and `button`, the default,
|
|
75
|
+
* leaves it alone, so that a button inside a form behaves as one outside it unless asked otherwise.
|
|
76
|
+
*/
|
|
77
|
+
type?: "button" | "submit" | "reset";
|
|
78
|
+
/**
|
|
79
|
+
* The glyph marking the action, shown before the label and hidden from assistive technology unless labelled itself.
|
|
80
|
+
*/
|
|
81
|
+
icon?: ComponentChildren;
|
|
82
|
+
/**
|
|
83
|
+
* The text the button shows, naming it unless `name` does; omitted only where `name` or `title` names the glyph.
|
|
84
|
+
*/
|
|
85
|
+
label?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The hint the platform shows on resting the pointer on the button, such as the shortcut it answers to or what a
|
|
88
|
+
* glyph stands for at greater length than its name; no hint if omitted.
|
|
89
|
+
*
|
|
90
|
+
* Beside a label or a `name` it names nothing. On a glyph standing alone with no `name` it names the button, and is
|
|
91
|
+
* then spoken as a name rather than as an aside, so it states what the button does before any shortcut. Either
|
|
92
|
+
* way it reaches neither a reader who never rests the pointer nor one on a touch screen, so whatever a reader has
|
|
93
|
+
* to take in to use the control belongs in the label or beside it rather than here.
|
|
94
|
+
*/
|
|
95
|
+
title?: string;
|
|
96
|
+
/**
|
|
97
|
+
* What activating the button is handed to, whether the activation comes from a pointer, from `Enter` or from
|
|
98
|
+
* `Space`; a button whose work is done by the form it submits or resets if omitted. The activation event is handed
|
|
99
|
+
* over as it stands, so a handler may read the modifier keys it carries or stop a `submit` or `reset` from
|
|
100
|
+
* reaching the form.
|
|
101
|
+
*
|
|
102
|
+
* @param event The activation event
|
|
103
|
+
*/
|
|
104
|
+
onClick?: (event: TargetedMouseEvent<HTMLButtonElement>) => void;
|
|
105
|
+
} & ({
|
|
106
|
+
name: string;
|
|
107
|
+
} | {
|
|
108
|
+
label: string;
|
|
109
|
+
} | {
|
|
110
|
+
title: string;
|
|
111
|
+
})): import("preact").VNode<{
|
|
112
|
+
labelled: boolean;
|
|
113
|
+
look: "subtle" | "normal" | "strong" | undefined;
|
|
114
|
+
mode: "normal" | "alert" | "safe" | "commit" | "publish" | "danger";
|
|
115
|
+
}>;
|
|
116
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/controls/button.tsx"],"names":[],"mappings":"AAgBA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAiB,KAAK,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACxF,OAAO,cAAc,CAAC;AAGtB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,EAEtB,IAAI,EACJ,QAAQ,EAER,QAAQ,EACR,QAAQ,EAER,IAAI,EAAE,+FAA+F;AACrG,IAAe,EACf,IAAe,EAEf,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,OAAO,EAEP,EAAE;IAEF;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAErC;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IAEpE;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;IAEpC;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAA;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;CAEhE,GAAG,CAAC;IAEJ,IAAI,EAAE,MAAM,CAAA;CAEZ,GAAG;IAEH,KAAK,EAAE,MAAM,CAAA;CAEb,GAAG;IAEH,KAAK,EAAE,MAAM,CAAA;CAEb,CAAC;;;;GAgCD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright © 2026 Metreeca srl
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Action control.
|
|
19
|
+
*
|
|
20
|
+
* Offers the control an action is taken with, shown as a glyph, a label, or both, with the activation, the focus
|
|
21
|
+
* handling and the disabled state the platform already carries on a native button.
|
|
22
|
+
*
|
|
23
|
+
* @module button
|
|
24
|
+
*/
|
|
25
|
+
import { createElement } from "preact";
|
|
26
|
+
import "./button.css";
|
|
27
|
+
/**
|
|
28
|
+
* Creates a button.
|
|
29
|
+
*
|
|
30
|
+
* Shows a glyph, a label, or a glyph followed by a label, on a native control, so the button role, the activation by
|
|
31
|
+
* `Enter` and `Space`, the single tab stop, the focus ring and the greyed disabled state come with it rather than
|
|
32
|
+
* having to be asked for. A button states a label, a name or a hint, and the type requires one of them: a glyph
|
|
33
|
+
* standing alone is named by `name` or, failing that, by `title`; a hint offered beside a label or a name speaks to a
|
|
34
|
+
* resting pointer alone and names nothing.
|
|
35
|
+
*
|
|
36
|
+
* The glyph is kept out of the accessibility tree, leaving the label, `name` or `title` to name the control, and
|
|
37
|
+
* the control is drawn at least as large as the smallest target a pointer is asked to hit, label or no label.
|
|
38
|
+
*
|
|
39
|
+
* @param options The widget configuration
|
|
40
|
+
*
|
|
41
|
+
* @returns The button
|
|
42
|
+
*
|
|
43
|
+
* @see {@link https://www.w3.org/WAI/ARIA/apg/patterns/button/ ARIA Authoring Practices: Button Pattern}
|
|
44
|
+
*/
|
|
45
|
+
export function Button({ name, controls, disabled, expanded, look, // deliberately left undefaulted, so an unstated look falls through to the one the area assigns
|
|
46
|
+
mode = "normal", type = "button", icon, label, title, onClick }) {
|
|
47
|
+
/*
|
|
48
|
+
* The element states what it carries, a stylesheet having no way to tell a label from a glyph standing alone, and
|
|
49
|
+
* the two attributes it is styled by: they sit on the wrapper rather than on the control, so a rule reads them
|
|
50
|
+
* without competing with the states the platform sets on the button itself.
|
|
51
|
+
*
|
|
52
|
+
* A look the consumer leaves out leaves the attribute off the element as well, which is what lets the stylesheet
|
|
53
|
+
* tell a button asking for the ordinary step from one taking whatever look the area around it assigns.
|
|
54
|
+
*/
|
|
55
|
+
return createElement("clay-button", {
|
|
56
|
+
labelled: label !== undefined,
|
|
57
|
+
look,
|
|
58
|
+
mode
|
|
59
|
+
}, _jsxs("button", { disabled: disabled, "aria-label": name, "aria-controls": controls, "aria-expanded": expanded, title: title, type: type, onClick: onClick, children: [icon, label] }));
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/controls/button.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAA0B,aAAa,EAA2B,MAAM,QAAQ,CAAC;AACxF,OAAO,cAAc,CAAC;AAGtB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,MAAM,CAAC,EAEtB,IAAI,EACJ,QAAQ,EAER,QAAQ,EACR,QAAQ,EAER,IAAI,EAAE,+FAA+F;AACrG,IAAI,GAAG,QAAQ,EACf,IAAI,GAAG,QAAQ,EAEf,IAAI,EACJ,KAAK,EACL,KAAK,EAEL,OAAO,EAqGN;IAED;;;;;;;OAOG;IAEH,OAAO,aAAa,CAAC,aAAa,EAAE;QAEnC,QAAQ,EAAE,KAAK,KAAK,SAAS;QAE7B,IAAI;QACJ,IAAI;KAEJ,EAAE,kBAEF,QAAQ,EAAE,QAAQ,gBAEN,IAAI,mBACD,QAAQ,mBACR,QAAQ,EACvB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EAEV,OAAO,EAAE,OAAO,aAEf,IAAI,EAAE,KAAK,IAAU,CAAC,CAAC;AAE1B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 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
|
+
/* A box is drawn as the design system draws every native checkbox, standing wherever the layout places it. */
|
|
18
|
+
|
|
19
|
+
clay-checkbox {
|
|
20
|
+
|
|
21
|
+
display: contents;
|
|
22
|
+
|
|
23
|
+
}
|