@antadesign/anta 0.1.1-dev.1 → 0.1.1-dev.2

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.
@@ -0,0 +1,329 @@
1
+ :root, .light {
2
+ --sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
3
+ --monospace: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
4
+
5
+ font-size: 15px;
6
+ font-weight: 390;
7
+ font-feature-settings: 'ss02' on, 'ss05' on;
8
+
9
+ /* Colors imported from Figma library "Anta 0.2" → "Dynamic colors" collection.
10
+ Each token is declared twice: hex first, oklch second. Browsers that don't
11
+ understand oklch() ignore the second declaration. See FIGMA.md for the
12
+ full extraction procedure (figma.variables Plugin API + alias resolution). */
13
+
14
+ /* Backgrounds — light, neutral */
15
+ --bg-base: #fbfafb; --bg-base: oklch(0.986 0.002 326);
16
+ --bg-pane: #f6f4f6; --bg-pane: oklch(0.969 0.003 326);
17
+ --bg-block: #f1eff1; --bg-block: oklch(0.954 0.003 326);
18
+ --bg-spot: #ece9ec; --bg-spot: oklch(0.937 0.005 326);
19
+ --bg-section: #ffffff; --bg-section: oklch(1.000 0.000 90);
20
+
21
+ /* Backgrounds — light, Brand */
22
+ --bg-base-brand: #fcfcfe; --bg-base-brand: oklch(0.992 0.003 286);
23
+ --bg-pane-brand: #f7f6fd; --bg-pane-brand: oklch(0.976 0.009 293);
24
+ --bg-block-brand: #efeefc; --bg-block-brand: oklch(0.954 0.019 289);
25
+ --bg-spot-brand: #e9e5fa; --bg-spot-brand: oklch(0.931 0.028 295);
26
+
27
+ /* Backgrounds — light, Success */
28
+ --bg-base-success: #f7fcf9; --bg-base-success: oklch(0.986 0.007 160);
29
+ --bg-pane-success: #ecf9f0; --bg-pane-success: oklch(0.970 0.018 156);
30
+ --bg-block-success: #e2f5e8; --bg-block-success: oklch(0.953 0.026 156);
31
+ --bg-spot-success: #d9f2e0; --bg-spot-success: oklch(0.938 0.036 154);
32
+
33
+ /* Backgrounds — light, Critical */
34
+ --bg-base-critical: #fefbfb; --bg-base-critical: oklch(0.990 0.003 17);
35
+ --bg-pane-critical: #fdf2f2; --bg-pane-critical: oklch(0.970 0.012 17);
36
+ --bg-block-critical: #fcebeb; --bg-block-critical: oklch(0.954 0.019 17);
37
+ --bg-spot-critical: #fae5e5; --bg-spot-critical: oklch(0.939 0.023 18);
38
+
39
+ /* Backgrounds — light, Warning */
40
+ --bg-base-warning: #fefbf6; --bg-base-warning: oklch(0.989 0.007 81);
41
+ --bg-pane-warning: #fcf4e8; --bg-pane-warning: oklch(0.970 0.018 78);
42
+ --bg-block-warning: #fbeeda; --bg-block-warning: oklch(0.954 0.030 79);
43
+ --bg-spot-warning: #f9e7cd; --bg-spot-warning: oklch(0.936 0.040 77);
44
+
45
+ /* Backgrounds — light, Info */
46
+ --bg-base-info: #fbfcfe; --bg-base-info: oklch(0.991 0.003 265);
47
+ --bg-pane-info: #f2f7fd; --bg-pane-info: oklch(0.974 0.010 253);
48
+ --bg-block-info: #e9f3fb; --bg-block-info: oklch(0.959 0.015 242);
49
+ --bg-spot-info: #e1eefa; --bg-spot-info: oklch(0.943 0.021 246);
50
+
51
+ /* Text — light, neutral */
52
+ --text-1: #050306; --text-1: oklch(0.105 0.013 316);
53
+ --text-2: #302b31; --text-2: oklch(0.297 0.013 321);
54
+ --text-3: #635b65; --text-3: oklch(0.482 0.019 319);
55
+ --text-4: #878089; --text-4: oklch(0.609 0.016 319);
56
+ --text-5: #9f99a1; --text-5: oklch(0.691 0.013 318);
57
+ --text-white: #ffffff; --text-white: oklch(1.000 0.000 90);
58
+
59
+ /* Text — light, Brand */
60
+ --text-1-brand: #2e1e7b; --text-1-brand: oklch(0.324 0.148 282);
61
+ --text-2-brand: #483493; --text-2-brand: oklch(0.405 0.149 287);
62
+ --text-3-brand: #483493cc; --text-3-brand: oklch(0.405 0.149 287 / 0.80);
63
+ --text-4-brand: #48349399; --text-4-brand: oklch(0.405 0.149 287 / 0.60);
64
+ --text-5-brand: #48349366; --text-5-brand: oklch(0.405 0.149 287 / 0.40);
65
+
66
+ /* Text — light, Success */
67
+ --text-1-success: #004618; --text-1-success: oklch(0.344 0.099 148);
68
+ --text-2-success: #1f5c31; --text-2-success: oklch(0.424 0.094 150);
69
+ --text-3-success: #1f5c31cc; --text-3-success: oklch(0.424 0.094 150 / 0.80);
70
+ --text-4-success: #1f5c3199; --text-4-success: oklch(0.424 0.094 150 / 0.60);
71
+ --text-5-success: #1f5c3166; --text-5-success: oklch(0.424 0.094 150 / 0.40);
72
+
73
+ /* Text — light, Critical */
74
+ --text-1-critical: #8f1014; --text-1-critical: oklch(0.416 0.159 27);
75
+ --text-2-critical: #a01c1c; --text-2-critical: oklch(0.458 0.167 27);
76
+ --text-3-critical: #a01c1ccc; --text-3-critical: oklch(0.458 0.167 27 / 0.80);
77
+ --text-4-critical: #a01c1c99; --text-4-critical: oklch(0.458 0.167 27 / 0.60);
78
+ --text-5-critical: #a01c1c66; --text-5-critical: oklch(0.458 0.167 27 / 0.40);
79
+
80
+ /* Text — light, Warning */
81
+ --text-1-warning: #7f410b; --text-1-warning: oklch(0.445 0.105 54);
82
+ --text-2-warning: #995200; --text-2-warning: oklch(0.513 0.122 59);
83
+ --text-3-warning: #995200cc; --text-3-warning: oklch(0.513 0.122 59 / 0.80);
84
+ --text-4-warning: #99520099; --text-4-warning: oklch(0.513 0.122 59 / 0.60);
85
+ --text-5-warning: #99520066; --text-5-warning: oklch(0.513 0.122 59 / 0.40);
86
+
87
+ /* Text — light, Info */
88
+ --text-1-info: #003969; --text-1-info: oklch(0.341 0.099 251);
89
+ --text-2-info: #175082; --text-2-info: oklch(0.422 0.101 249);
90
+ --text-3-info: #175082cc; --text-3-info: oklch(0.422 0.101 249 / 0.80);
91
+ --text-4-info: #175082b2; --text-4-info: oklch(0.422 0.101 249 / 0.70);
92
+ --text-5-info: #17508280; --text-5-info: oklch(0.422 0.101 249 / 0.50);
93
+
94
+ /* Borders — light, neutral */
95
+ --border-1: #ece9ec; --border-1: oklch(0.937 0.005 326);
96
+ --border-2: #e0dce0; --border-2: oklch(0.899 0.007 326);
97
+ --border-3: #d4ced4; --border-3: oklch(0.858 0.010 326);
98
+ --border-4: #c1b9c1; --border-4: oklch(0.795 0.014 326);
99
+ --border-5: #938d96; --border-5: oklch(0.651 0.015 315);
100
+
101
+ /* Borders — light, Brand */
102
+ --border-1-brand: #e9e5fa; --border-1-brand: oklch(0.931 0.028 295);
103
+ --border-2-brand: #ddd8f8; --border-2-brand: oklch(0.896 0.044 293);
104
+ --border-3-brand: #d2cbf6; --border-3-brand: oklch(0.862 0.060 293);
105
+ --border-4-brand: #bcb1f1; --border-4-brand: oklch(0.792 0.090 292);
106
+ --border-5-brand: #9081df; --border-5-brand: oklch(0.657 0.137 289);
107
+
108
+ /* Borders — light, Success */
109
+ --border-1-success: #d9f2e0; --border-1-success: oklch(0.938 0.036 154);
110
+ --border-2-success: #c6ecd1; --border-2-success: oklch(0.909 0.054 154);
111
+ --border-3-success: #b3e5c2; --border-3-success: oklch(0.878 0.071 154);
112
+ --border-4-success: #88d7a0; --border-4-success: oklch(0.813 0.110 153);
113
+ --border-5-success: #44c169; --border-5-success: oklch(0.721 0.167 150);
114
+
115
+ /* Borders — light, Critical */
116
+ --border-1-critical: #fae5e5; --border-1-critical: oklch(0.939 0.023 18);
117
+ --border-2-critical: #f7d4d4; --border-2-critical: oklch(0.899 0.039 18);
118
+ --border-3-critical: #f4c2c2; --border-3-critical: oklch(0.858 0.057 18);
119
+ --border-4-critical: #efa4a4; --border-4-critical: oklch(0.791 0.089 19);
120
+ --border-5-critical: #e56c6c; --border-5-critical: oklch(0.676 0.151 22);
121
+
122
+ /* Borders — light, Warning */
123
+ --border-1-warning: #f9e7cd; --border-1-warning: oklch(0.936 0.040 77);
124
+ --border-2-warning: #f6dbb1; --border-2-warning: oklch(0.903 0.062 79);
125
+ --border-3-warning: #f3cc91; --border-3-warning: oklch(0.865 0.087 78);
126
+ --border-4-warning: #edb25a; --border-4-warning: oklch(0.801 0.125 75);
127
+ --border-5-warning: #d88118; --border-5-warning: oklch(0.682 0.149 63);
128
+
129
+ /* Borders — light, Info */
130
+ --border-1-info: #e1eefa; --border-1-info: oklch(0.943 0.021 246);
131
+ --border-2-info: #cfe3f7; --border-2-info: oklch(0.907 0.035 248);
132
+ --border-3-info: #bad6f3; --border-3-info: oklch(0.865 0.050 249);
133
+ --border-4-info: #93c5ec; --border-4-info: oklch(0.802 0.076 242);
134
+ --border-5-info: #56a1e1; --border-5-info: oklch(0.688 0.121 246);
135
+
136
+ /* Prose link colors — used by <a-text> for priorities 1 & 2 and by
137
+ consumers wiring their own prose contexts. */
138
+ --link-color: oklch(0.50 0.20 248.58);
139
+ --link-color-hover: oklch(0.55 0.23 246.95);
140
+ }
141
+
142
+ h1, h2, h3, h4, h5, h6 {
143
+ font-weight: 600;
144
+ }
145
+
146
+ strong {
147
+ font-weight: 600;
148
+ }
149
+
150
+ /* Prose lists (ul, ol) get a tight 3ch left padding so markers hug the
151
+ text, and items get a small bottom margin so consecutive ones breathe.
152
+ Markers are toned all the way down to --text-5 since they are visual
153
+ scaffolding, not content. */
154
+ ul, ol {
155
+ padding-left: 3ch;
156
+ }
157
+ :is(ul, ol) > li {
158
+ margin-bottom: 0.5em;
159
+ }
160
+ :is(ul, ol) > li::marker {
161
+ color: var(--text-5);
162
+ }
163
+
164
+ /* `<menu>` is for command/option lists, not prose. By default browsers
165
+ render it like a `<ul>` (disc markers, 40px padding); we strip all of
166
+ that so it's a clean semantic container ready to be styled. */
167
+ menu {
168
+ list-style: none;
169
+ padding: 0;
170
+ margin: 0;
171
+ }
172
+ menu > li {
173
+ margin: 0;
174
+ }
175
+
176
+ /* Global link defaults. Hairline underline at 75% alpha; underline goes
177
+ to currentColor (100%) and 1px on hover. Color comes from --link-color
178
+ tokens, which auto-flip in dark mode. Components or specific contexts
179
+ (nav, headings, buttons) should override as needed. */
180
+ a, a:link, a:visited {
181
+ color: var(--link-color);
182
+ text-decoration: underline;
183
+ text-decoration-style: solid;
184
+ text-decoration-color: color-mix(in oklch, currentColor 75%, transparent);
185
+ text-decoration-thickness: 0.5px;
186
+ text-underline-offset: 3px;
187
+ }
188
+ a:hover {
189
+ color: var(--link-color-hover);
190
+ /* Underline color set to the hover token directly (rather than
191
+ `currentColor`) so it repaints in lockstep with `color` — a few
192
+ browsers latch onto the old currentColor value otherwise. */
193
+ text-decoration-color: var(--link-color-hover);
194
+ text-decoration-thickness: 1px;
195
+ }
196
+ a:active {
197
+ text-decoration-color: color-mix(in oklch, currentColor 75%, transparent);
198
+ }
199
+
200
+ .dark {
201
+ font-weight: 350;
202
+
203
+ /* Backgrounds — dark, neutral */
204
+ --bg-base: #100e11; --bg-base: oklch(0.168 0.007 315);
205
+ --bg-pane: #1d1a1e; --bg-pane: oklch(0.223 0.009 318);
206
+ --bg-block: #272329; --bg-block: oklch(0.263 0.012 315);
207
+ --bg-spot: #302b31; --bg-spot: oklch(0.297 0.013 321);
208
+ --bg-section: #171519; --bg-section: oklch(0.200 0.008 308);
209
+
210
+ /* Backgrounds — dark, Brand */
211
+ --bg-base-brand: #0f0c1d; --bg-base-brand: oklch(0.168 0.035 290);
212
+ --bg-pane-brand: #16122b; --bg-pane-brand: oklch(0.202 0.049 289);
213
+ --bg-block-brand: #1c1736; --bg-block-brand: oklch(0.229 0.058 288);
214
+ --bg-spot-brand: #201b3e; --bg-spot-brand: oklch(0.248 0.064 287);
215
+
216
+ /* Backgrounds — dark, Success */
217
+ --bg-base-success: #05140a; --bg-base-success: oklch(0.173 0.030 154);
218
+ --bg-pane-success: #081f0f; --bg-pane-success: oklch(0.215 0.043 151);
219
+ --bg-block-success: #0c2814; --bg-block-success: oklch(0.249 0.051 150);
220
+ --bg-spot-success: #0d2b16; --bg-spot-success: oklch(0.260 0.053 151);
221
+
222
+ /* Backgrounds — dark, Critical */
223
+ --bg-base-critical: #1f0506; --bg-base-critical: oklch(0.166 0.047 21);
224
+ --bg-pane-critical: #33090a; --bg-pane-critical: oklch(0.218 0.067 23);
225
+ --bg-block-critical: #400d0e; --bg-block-critical: oklch(0.251 0.079 24);
226
+ --bg-spot-critical: #471011; --bg-spot-critical: oklch(0.270 0.084 24);
227
+
228
+ /* Backgrounds — dark, Warning */
229
+ --bg-base-warning: #160d04; --bg-base-warning: oklch(0.168 0.025 69);
230
+ --bg-pane-warning: #241506; --bg-pane-warning: oklch(0.212 0.036 65);
231
+ --bg-block-warning: #2b1908; --bg-block-warning: oklch(0.233 0.040 62);
232
+ --bg-spot-warning: #311d0a; --bg-spot-warning: oklch(0.252 0.044 62);
233
+
234
+ /* Backgrounds — dark, Info */
235
+ --bg-base-info: #04111f; --bg-base-info: oklch(0.174 0.036 250);
236
+ --bg-pane-info: #071b2c; --bg-pane-info: oklch(0.216 0.043 247);
237
+ --bg-block-info: #092034; --bg-block-info: oklch(0.237 0.048 248);
238
+ --bg-spot-info: #0d273e; --bg-spot-info: oklch(0.265 0.054 248);
239
+
240
+ /* Text — dark, neutral */
241
+ --text-1: #ece9ec; --text-1: oklch(0.937 0.005 326);
242
+ --text-2: #c1b9c1; --text-2: oklch(0.795 0.014 326);
243
+ --text-3: #9f99a1; --text-3: oklch(0.691 0.013 318);
244
+ --text-4: #776e77; --text-4: oklch(0.549 0.018 326);
245
+ --text-5: #635b65; --text-5: oklch(0.482 0.019 319);
246
+ --text-white: #ffffff; --text-white: oklch(1.000 0.000 90);
247
+
248
+ /* Text — dark, Brand */
249
+ --text-1-brand: #c5baff; --text-1-brand: oklch(0.822 0.097 291);
250
+ --text-2-brand: #ada0ee; --text-2-brand: oklch(0.746 0.111 291);
251
+ --text-3-brand: #ada0eecc; --text-3-brand: oklch(0.746 0.111 291 / 0.80);
252
+ --text-4-brand: #ada0ee99; --text-4-brand: oklch(0.746 0.111 291 / 0.60);
253
+ --text-5-brand: #ada0ee66; --text-5-brand: oklch(0.746 0.111 291 / 0.40);
254
+
255
+ /* Text — dark, Success */
256
+ --text-1-success: #9ddeb1; --text-1-success: oklch(0.845 0.091 154);
257
+ --text-2-success: #74cd8e; --text-2-success: oklch(0.776 0.125 152);
258
+ --text-3-success: #71d08ecc; --text-3-success: oklch(0.782 0.131 152 / 0.80);
259
+ --text-4-success: #71d08e99; --text-4-success: oklch(0.782 0.131 152 / 0.60);
260
+ --text-5-success: #71d08e66; --text-5-success: oklch(0.782 0.131 152 / 0.40);
261
+
262
+ /* Text — dark, Critical */
263
+ --text-1-critical: #ffabac; --text-1-critical: oklch(0.823 0.099 19);
264
+ --text-2-critical: #e78e90; --text-2-critical: oklch(0.740 0.108 19);
265
+ --text-3-critical: #e49091cc; --text-3-critical: oklch(0.740 0.102 19 / 0.80);
266
+ --text-4-critical: #e4909199; --text-4-critical: oklch(0.740 0.102 19 / 0.60);
267
+ --text-5-critical: #e4909166; --text-5-critical: oklch(0.740 0.102 19 / 0.40);
268
+
269
+ /* Text — dark, Warning */
270
+ --text-1-warning: #f0bf75; --text-1-warning: oklch(0.833 0.108 77);
271
+ --text-2-warning: #e1a452; --text-2-warning: oklch(0.761 0.122 72);
272
+ --text-3-warning: #e9a135cc; --text-3-warning: oklch(0.762 0.145 73 / 0.80);
273
+ --text-4-warning: #e9a13599; --text-4-warning: oklch(0.762 0.145 73 / 0.60);
274
+ --text-5-warning: #e9a13566; --text-5-warning: oklch(0.762 0.145 73 / 0.40);
275
+
276
+ /* Text — dark, Info */
277
+ --text-1-info: #9ed2ff; --text-1-info: oklch(0.844 0.083 245);
278
+ --text-2-info: #7db6e8; --text-2-info: oklch(0.756 0.094 246);
279
+ --text-3-info: #7db6e8cc; --text-3-info: oklch(0.756 0.094 246 / 0.80);
280
+ --text-4-info: #7db6e899; --text-4-info: oklch(0.756 0.094 246 / 0.60);
281
+ --text-5-info: #7db6e866; --text-5-info: oklch(0.756 0.094 246 / 0.40);
282
+
283
+ /* Borders — dark, neutral */
284
+ --border-1: #272329; --border-1: oklch(0.263 0.012 315);
285
+ --border-2: #3e3941; --border-2: oklch(0.353 0.015 313);
286
+ --border-3: #49424c; --border-3: oklch(0.390 0.019 316);
287
+ --border-4: #534c57; --border-4: oklch(0.427 0.020 313);
288
+ --border-5: #776e77; --border-5: oklch(0.549 0.018 326);
289
+
290
+ /* Borders — dark, Brand */
291
+ --border-1-brand: #251f47; --border-1-brand: oklch(0.269 0.072 287);
292
+ --border-2-brand: #2d2556; --border-2-brand: oklch(0.302 0.085 288);
293
+ --border-3-brand: #483493; --border-3-brand: oklch(0.405 0.149 287);
294
+ --border-4-brand: #503cb4; --border-4-brand: oklch(0.453 0.181 284);
295
+ --border-5-brand: #7460d7; --border-5-brand: oklch(0.569 0.175 287);
296
+
297
+ /* Borders — dark, Success */
298
+ --border-1-success: #0f321a; --border-1-success: oklch(0.284 0.060 151);
299
+ --border-2-success: #12391e; --border-2-success: oklch(0.309 0.065 151);
300
+ --border-3-success: #1f5c31; --border-3-success: oklch(0.424 0.094 150);
301
+ --border-4-success: #226737; --border-4-success: oklch(0.458 0.103 150);
302
+ --border-5-success: #329550; --border-5-success: oklch(0.595 0.138 150);
303
+
304
+ /* Borders — dark, Critical */
305
+ --border-1-critical: #531314; --border-1-critical: oklch(0.298 0.095 24);
306
+ --border-2-critical: #5d1819; --border-2-critical: oklch(0.325 0.100 24);
307
+ --border-3-critical: #a01c1c; --border-3-critical: oklch(0.458 0.167 27);
308
+ --border-4-critical: #b02120; --border-4-critical: oklch(0.492 0.179 27);
309
+ --border-5-critical: #de4545; --border-5-critical: oklch(0.610 0.190 25);
310
+
311
+ /* Borders — dark, Warning */
312
+ --border-1-warning: #37200b; --border-1-warning: oklch(0.269 0.048 61);
313
+ --border-2-warning: #3e250e; --border-2-warning: oklch(0.291 0.052 61);
314
+ --border-3-warning: #6a3b0c; --border-3-warning: oklch(0.403 0.087 60);
315
+ --border-4-warning: #7f410b; --border-4-warning: oklch(0.445 0.105 54);
316
+ --border-5-warning: #ae6613; --border-5-warning: oklch(0.579 0.127 62);
317
+
318
+ /* Borders — dark, Info */
319
+ --border-1-info: #0e2b44; --border-1-info: oklch(0.281 0.058 248);
320
+ --border-2-info: #12324f; --border-2-info: oklch(0.309 0.064 249);
321
+ --border-3-info: #175082; --border-3-info: oklch(0.422 0.101 249);
322
+ --border-4-info: #1a5b93; --border-4-info: oklch(0.461 0.111 249);
323
+ --border-5-info: #2686d9; --border-5-info: oklch(0.608 0.152 250);
324
+
325
+ /* Prose link colors — dark mode */
326
+ --link-color: oklch(0.72 0.15 248.65);
327
+ --link-color-hover: oklch(0.78 0.16 247.58);
328
+ }
329
+
@@ -1 +1,9 @@
1
1
  export declare function hasChildren(children: React.ReactNode): boolean;
2
+ /**
3
+ * `HTMLElement` in browsers, a noop class in Node/Worker environments.
4
+ * Use this as the base for custom element classes so importing the
5
+ * module in a non-DOM environment doesn't throw on `extends HTMLElement`.
6
+ * Instantiation in non-DOM environments still fails, but no consumer
7
+ * should be doing that.
8
+ */
9
+ export declare const HTMLElementBase: typeof HTMLElement;
@@ -1,6 +1,9 @@
1
1
  function hasChildren(children) {
2
2
  return Array.isArray(children) ? children.length > 0 : children != null;
3
3
  }
4
+ const HTMLElementBase = typeof HTMLElement !== "undefined" ? HTMLElement : class {
5
+ };
4
6
  export {
7
+ HTMLElementBase,
5
8
  hasChildren
6
9
  };
@@ -0,0 +1,40 @@
1
+ import type { BaseProps } from "../general_types";
2
+ import type { IconShape } from '../elements/a-icon.shapes';
3
+ export interface IconProps extends BaseProps {
4
+ /** Which icon to render. The set of valid shapes comes from Anta's
5
+ * built-in icons plus any consumer-generated shapes (via the
6
+ * `IconShapes` interface module augmentation). */
7
+ shape: IconShape;
8
+ /** Width and height in pixels. Defaults to `16`. */
9
+ size?: number;
10
+ /** Accessible name for the icon. When set, the wrapper exposes
11
+ * `role="img"` and `aria-label={label}` so screen readers announce
12
+ * the icon. When omitted (the default), the icon is treated as
13
+ * decorative — `aria-hidden="true"` is applied so it doesn't add
14
+ * noise alongside neighbouring text. */
15
+ label?: string;
16
+ }
17
+ /**
18
+ * Renders an `<a-icon>` web component. Color follows `currentColor`;
19
+ * size is set via the `size` prop (defaults to 16).
20
+ *
21
+ * Requires `@antadesign/anta/elements` to be imported (client-side only)
22
+ * to register the underlying custom element and load the icon
23
+ * stylesheets.
24
+ *
25
+ * @example Decorative icon paired with text — no label needed
26
+ * ```tsx
27
+ * <button>
28
+ * <Icon shape="trash" />
29
+ * Delete
30
+ * </button>
31
+ * ```
32
+ *
33
+ * @example Meaningful icon-only control — pass a label
34
+ * ```tsx
35
+ * <button aria-label="Delete">
36
+ * <Icon shape="trash" label="Delete" />
37
+ * </button>
38
+ * ```
39
+ */
40
+ export declare const Icon: ({ shape, size, label, className, style, ...rest }: IconProps) => any;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "@antadesign/anta/jsx-runtime";
2
+ const Icon = ({ shape, size, label, className, style, ...rest }) => {
3
+ const sizedStyle = size != null ? { ...style, ["--icon-size"]: `${size}px` } : style;
4
+ const a11y = label != null ? { role: "img", "aria-label": label } : { "aria-hidden": "true" };
5
+ return /* @__PURE__ */ jsx(
6
+ "a-icon",
7
+ {
8
+ shape,
9
+ class: className,
10
+ style: sizedStyle,
11
+ ...a11y,
12
+ ...rest
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ Icon
18
+ };
@@ -1,12 +1,41 @@
1
1
  import type { BaseProps } from "../general_types";
2
- interface ProgressProps extends BaseProps {
3
- /** Current progress. Negative values are clamped to 0. */
2
+ export interface ProgressProps extends BaseProps {
3
+ /** Current progress value. Negative values are clamped to 0. */
4
4
  value: number;
5
- /** Upper bound of the range. Defaults to 100. Negative values are clamped to 0. */
5
+ /** Upper bound of the range. Defaults to 100. */
6
6
  max?: number;
7
+ /** Color variant. `'info'` applies a blue tint. */
7
8
  tone?: 'neutral' | 'info';
9
+ /** Text label displayed after the percentage. */
8
10
  label?: string;
11
+ /** Right-aligned hint text (e.g. "3 of 7"). */
9
12
  hint?: string;
10
13
  }
14
+ /**
15
+ * Progress indicator for displaying task completion.
16
+ *
17
+ * Renders an `<a-progress>` web component with an optional label area
18
+ * showing percentage, text label, and hint.
19
+ *
20
+ * Requires `@antadesign/anta/elements` to be imported (client-side only)
21
+ * to register the underlying custom element.
22
+ *
23
+ * @example Basic usage
24
+ * ```tsx
25
+ * import { Progress } from '@antadesign/anta'
26
+ * import '@antadesign/anta/elements'
27
+ *
28
+ * <Progress value={60} />
29
+ * ```
30
+ *
31
+ * @example With label and hint
32
+ * ```tsx
33
+ * <Progress value={42} label="Uploading files..." hint="3 of 7" />
34
+ * ```
35
+ *
36
+ * @example Info tone
37
+ * ```tsx
38
+ * <Progress value={75} tone="info" label="Processing" />
39
+ * ```
40
+ */
11
41
  export declare const Progress: ({ value, max, tone, label, hint, className, children, ...rest }: ProgressProps) => any;
12
- export {};
@@ -2,12 +2,17 @@ import { jsx, jsxs } from "@antadesign/anta/jsx-runtime";
2
2
  import { hasChildren } from "../anta_helpers";
3
3
  const Progress = ({ value, max = 100, tone, label, hint, className, children, ...rest }) => {
4
4
  const percent = max > 0 ? Math.round(Math.min(100, Math.max(0, value / max * 100))) : 0;
5
+ const ariaLabel = [label, `${percent}%`, hint].filter(Boolean).join(" \xB7 ") || void 0;
5
6
  return /* @__PURE__ */ jsx(
6
7
  "a-progress",
7
8
  {
8
9
  value,
9
10
  max,
10
11
  tone,
12
+ role: "progressbar",
13
+ "aria-valuenow": value,
14
+ "aria-valuemax": max,
15
+ "aria-label": ariaLabel,
11
16
  class: className,
12
17
  ...rest,
13
18
  children: hasChildren(children) ? children : /* @__PURE__ */ jsxs("a-progress-label", { children: [
@@ -0,0 +1,42 @@
1
+ import type { BaseProps } from "../general_types";
2
+ export interface TextProps extends BaseProps {
3
+ /** Visual priority. Maps to text-1..text-5. Defaults to 'primary' (text-1). */
4
+ priority?: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
5
+ /** Color tint. Applies the matching `--text-{N}-{tone}` palette. */
6
+ tone?: 'brand' | 'success' | 'critical' | 'warning' | 'info';
7
+ /** Render as inline-block instead of the default block element. */
8
+ inline?: boolean;
9
+ /** Truncate with a trailing ellipsis. `true` (or `1`) clamps to a
10
+ * single line; any integer ≥ 2 clamps to that many lines. Uses the
11
+ * `-webkit-line-clamp` technique, supported in all major browsers
12
+ * (Firefox 68+, Chrome, Safari, Edge). */
13
+ truncate?: boolean | number;
14
+ /** Show a fade hint and chevron over the truncated text and let the
15
+ * user expand it by clicking the chevron region or pressing Enter
16
+ * while the chevron has keyboard focus. Only takes effect together
17
+ * with `truncate`. */
18
+ expandable?: boolean;
19
+ }
20
+ /**
21
+ * Block-level text container with priority and tone support.
22
+ *
23
+ * Renders an `<a-text>` web component that scopes its descendants'
24
+ * color hierarchy. Links nested inside follow the design system's
25
+ * priority-aware link styling. Pass `inline` for an inline-block
26
+ * variant, `truncate` for ellipsis truncation, and `expandable`
27
+ * (combined with `truncate`) to let the user reveal the full text.
28
+ *
29
+ * Requires `@antadesign/anta/elements` to be imported (client-side only)
30
+ * to register the underlying custom element.
31
+ *
32
+ * @example Basic usage
33
+ * ```tsx
34
+ * <Text priority="secondary">Secondary emphasis</Text>
35
+ * ```
36
+ *
37
+ * @example Expandable truncated text
38
+ * ```tsx
39
+ * <Text truncate={3} expandable>…long paragraph…</Text>
40
+ * ```
41
+ */
42
+ export declare const Text: ({ priority, tone, inline, truncate, expandable, className, style, children, ...rest }: TextProps) => any;
@@ -0,0 +1,22 @@
1
+ import { jsx } from "@antadesign/anta/jsx-runtime";
2
+ const Text = ({ priority, tone, inline, truncate, expandable, className, style, children, ...rest }) => {
3
+ const lineCount = typeof truncate === "number" ? truncate : truncate ? 1 : null;
4
+ const computedStyle = lineCount != null ? { ...style, ["--line-clamp"]: lineCount } : style;
5
+ return /* @__PURE__ */ jsx(
6
+ "a-text",
7
+ {
8
+ priority,
9
+ tone,
10
+ inline: inline ? "" : void 0,
11
+ truncate: lineCount != null ? String(lineCount) : void 0,
12
+ expandable: expandable && truncate ? "" : void 0,
13
+ class: className,
14
+ style: computedStyle,
15
+ ...rest,
16
+ children
17
+ }
18
+ );
19
+ };
20
+ export {
21
+ Text
22
+ };
@@ -0,0 +1,6 @@
1
+ /*
2
+ * All Text layout — including truncation, the expandable fade mask,
3
+ * and the chevron button — lives in the <a-text> web component's
4
+ * shadow DOM. This module is reserved for any future JSX-driven
5
+ * conditional styles.
6
+ */
@@ -0,0 +1,16 @@
1
+ a-icon {
2
+ display: inline-block;
3
+ vertical-align: middle;
4
+ width: var(--icon-size, 16px);
5
+ height: var(--icon-size, 16px);
6
+ flex-shrink: 0;
7
+ background-color: currentColor;
8
+ -webkit-mask-image: var(--icon);
9
+ mask-image: var(--icon);
10
+ -webkit-mask-position: center;
11
+ mask-position: center;
12
+ -webkit-mask-repeat: no-repeat;
13
+ mask-repeat: no-repeat;
14
+ -webkit-mask-size: contain;
15
+ mask-size: contain;
16
+ }
@@ -0,0 +1,12 @@
1
+ import { HTMLElementBase } from '../anta_helpers';
2
+ /**
3
+ * `<a-icon shape="…">` — pure declarative icon element.
4
+ *
5
+ * No shadow DOM and no JS state. Styling is driven entirely by external
6
+ * CSS: the base rule (`a-icon.css`) sets up the mask compositing, and
7
+ * the per-shape rules (`a-icon.shapes.css`, generated) supply the
8
+ * `--icon` URL. Color follows `currentColor`.
9
+ */
10
+ export declare class AIconElement extends HTMLElementBase {
11
+ }
12
+ export declare function register_a_icon(): void;
@@ -0,0 +1,13 @@
1
+ import { HTMLElementBase } from "../anta_helpers";
2
+ class AIconElement extends HTMLElementBase {
3
+ }
4
+ function register_a_icon() {
5
+ if (typeof customElements === "undefined") return;
6
+ if (!customElements.get("a-icon")) {
7
+ customElements.define("a-icon", AIconElement);
8
+ }
9
+ }
10
+ export {
11
+ AIconElement,
12
+ register_a_icon
13
+ };