@guardian/stand 0.0.10 → 0.0.12

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 (46) hide show
  1. package/README.md +14 -21
  2. package/dist/components/button/Button.cjs +8 -2
  3. package/dist/components/button/Button.js +6 -4
  4. package/dist/components/button/styles.cjs +12 -4
  5. package/dist/components/button/styles.js +11 -1
  6. package/dist/components/byline/Byline.cjs +4 -18
  7. package/dist/components/byline/Preview.cjs +1 -8
  8. package/dist/components/byline/plugins.cjs +3 -13
  9. package/dist/components/icon/Icon.cjs +1 -4
  10. package/dist/components/icon/Icon.js +1 -4
  11. package/dist/components/icon-button/IconButton.cjs +45 -0
  12. package/dist/components/icon-button/IconButton.js +26 -0
  13. package/dist/components/icon-button/styles.cjs +9 -0
  14. package/dist/components/icon-button/styles.js +6 -0
  15. package/dist/components/icon-link-button/IconLinkButton.cjs +42 -0
  16. package/dist/components/icon-link-button/IconLinkButton.js +23 -0
  17. package/dist/components/icon-link-button/styles.cjs +9 -0
  18. package/dist/components/icon-link-button/styles.js +6 -0
  19. package/dist/components/link-button/LinkButton.cjs +8 -2
  20. package/dist/components/link-button/LinkButton.js +7 -5
  21. package/dist/components/user-menu/UserMenu.cjs +1 -8
  22. package/dist/fonts/OpenSans.css +64 -68
  23. package/dist/icon-button.cjs +7 -0
  24. package/dist/icon-button.js +1 -0
  25. package/dist/icon-link-button.cjs +7 -0
  26. package/dist/icon-link-button.js +1 -0
  27. package/dist/styleD/build/css/component/button.css +79 -16
  28. package/dist/styleD/build/css/semantic/typography.css +5 -10
  29. package/dist/styleD/build/typescript/component/button.cjs +208 -16
  30. package/dist/styleD/build/typescript/component/button.js +208 -16
  31. package/dist/types/components/button/Button.d.ts +1 -1
  32. package/dist/types/components/button/styles.d.ts +1 -1
  33. package/dist/types/components/button/types.d.ts +5 -0
  34. package/dist/types/components/icon-button/IconButton.d.ts +2 -0
  35. package/dist/types/components/icon-button/styles.d.ts +522 -0
  36. package/dist/types/components/icon-button/types.d.ts +26 -0
  37. package/dist/types/components/icon-link-button/IconLinkButton.d.ts +2 -0
  38. package/dist/types/components/icon-link-button/styles.d.ts +522 -0
  39. package/dist/types/components/icon-link-button/types.d.ts +26 -0
  40. package/dist/types/components/link-button/LinkButton.d.ts +1 -1
  41. package/dist/types/components/link-button/styles.d.ts +193 -1
  42. package/dist/types/components/link-button/types.d.ts +5 -0
  43. package/dist/types/icon-button.d.ts +20 -0
  44. package/dist/types/icon-link-button.d.ts +20 -0
  45. package/dist/types/styleD/build/typescript/component/button.d.ts +192 -0
  46. package/package.json +19 -3
@@ -0,0 +1,522 @@
1
+ import type { ButtonTheme } from '../button/styles';
2
+ export type IconButtonTheme = ButtonTheme;
3
+ export declare const defaultIconButtonTheme: ButtonTheme;
4
+ export declare const iconButtonStyles: (theme: {
5
+ shared: {
6
+ display: string;
7
+ '-webkit-appearance': string;
8
+ 'text-align': string;
9
+ 'box-shadow': string;
10
+ cursor: string;
11
+ 'justify-content': string;
12
+ 'align-items': string;
13
+ 'text-decoration': string;
14
+ ':disabled': {
15
+ cursor: string;
16
+ };
17
+ ':focus-visible': {
18
+ outline: string;
19
+ 'outline-offset': string;
20
+ };
21
+ };
22
+ 'emphasised-primary': {
23
+ shared: {
24
+ color: string;
25
+ backgroundColor: string;
26
+ borderRadius: string;
27
+ border: string;
28
+ ':hover': {
29
+ backgroundColor: string;
30
+ border: string;
31
+ };
32
+ ':active': {
33
+ backgroundColor: string;
34
+ border: string;
35
+ };
36
+ ':disabled': {
37
+ color: string;
38
+ backgroundColor: string;
39
+ border: string;
40
+ };
41
+ };
42
+ xs: {
43
+ height: string;
44
+ padding: {
45
+ top: string;
46
+ right: string;
47
+ bottom: string;
48
+ left: string;
49
+ withIcon: {
50
+ iconLeft: {
51
+ left: string;
52
+ };
53
+ };
54
+ };
55
+ typography: {
56
+ font: string;
57
+ letterSpacing: string;
58
+ fontWidth: number;
59
+ };
60
+ icon: {
61
+ size: string;
62
+ gap: string;
63
+ };
64
+ iconButton: {
65
+ width: string;
66
+ };
67
+ };
68
+ sm: {
69
+ height: string;
70
+ padding: {
71
+ top: string;
72
+ right: string;
73
+ bottom: string;
74
+ left: string;
75
+ withIcon: {
76
+ iconLeft: {
77
+ left: string;
78
+ };
79
+ };
80
+ };
81
+ typography: {
82
+ font: string;
83
+ letterSpacing: string;
84
+ fontWidth: number;
85
+ };
86
+ icon: {
87
+ size: string;
88
+ gap: string;
89
+ };
90
+ iconButton: {
91
+ width: string;
92
+ };
93
+ };
94
+ md: {
95
+ height: string;
96
+ padding: {
97
+ top: string;
98
+ right: string;
99
+ bottom: string;
100
+ left: string;
101
+ withIcon: {
102
+ iconLeft: {
103
+ left: string;
104
+ };
105
+ };
106
+ };
107
+ typography: {
108
+ font: string;
109
+ letterSpacing: string;
110
+ fontWidth: number;
111
+ };
112
+ icon: {
113
+ size: string;
114
+ gap: string;
115
+ };
116
+ iconButton: {
117
+ width: string;
118
+ };
119
+ };
120
+ lg: {
121
+ height: string;
122
+ padding: {
123
+ top: string;
124
+ right: string;
125
+ bottom: string;
126
+ left: string;
127
+ withIcon: {
128
+ iconLeft: {
129
+ left: string;
130
+ };
131
+ };
132
+ };
133
+ typography: {
134
+ font: string;
135
+ letterSpacing: string;
136
+ fontWidth: number;
137
+ };
138
+ icon: {
139
+ size: string;
140
+ gap: string;
141
+ };
142
+ iconButton: {
143
+ width: string;
144
+ };
145
+ };
146
+ };
147
+ 'emphasised-secondary': {
148
+ shared: {
149
+ color: string;
150
+ backgroundColor: string;
151
+ borderRadius: string;
152
+ border: string;
153
+ ':hover': {
154
+ backgroundColor: string;
155
+ border: string;
156
+ };
157
+ ':active': {
158
+ backgroundColor: string;
159
+ border: string;
160
+ };
161
+ ':disabled': {
162
+ color: string;
163
+ backgroundColor: string;
164
+ border: string;
165
+ };
166
+ };
167
+ xs: {
168
+ height: string;
169
+ padding: {
170
+ top: string;
171
+ right: string;
172
+ bottom: string;
173
+ left: string;
174
+ withIcon: {
175
+ iconLeft: {
176
+ left: string;
177
+ };
178
+ };
179
+ };
180
+ typography: {
181
+ font: string;
182
+ letterSpacing: string;
183
+ fontWidth: number;
184
+ };
185
+ icon: {
186
+ size: string;
187
+ gap: string;
188
+ };
189
+ iconButton: {
190
+ width: string;
191
+ };
192
+ };
193
+ sm: {
194
+ height: string;
195
+ padding: {
196
+ top: string;
197
+ right: string;
198
+ bottom: string;
199
+ left: string;
200
+ withIcon: {
201
+ iconLeft: {
202
+ left: string;
203
+ };
204
+ };
205
+ };
206
+ typography: {
207
+ font: string;
208
+ letterSpacing: string;
209
+ fontWidth: number;
210
+ };
211
+ icon: {
212
+ size: string;
213
+ gap: string;
214
+ };
215
+ iconButton: {
216
+ width: string;
217
+ };
218
+ };
219
+ md: {
220
+ height: string;
221
+ padding: {
222
+ top: string;
223
+ right: string;
224
+ bottom: string;
225
+ left: string;
226
+ withIcon: {
227
+ iconLeft: {
228
+ left: string;
229
+ };
230
+ };
231
+ };
232
+ typography: {
233
+ font: string;
234
+ letterSpacing: string;
235
+ fontWidth: number;
236
+ };
237
+ icon: {
238
+ size: string;
239
+ gap: string;
240
+ };
241
+ iconButton: {
242
+ width: string;
243
+ };
244
+ };
245
+ lg: {
246
+ height: string;
247
+ padding: {
248
+ top: string;
249
+ right: string;
250
+ bottom: string;
251
+ left: string;
252
+ withIcon: {
253
+ iconLeft: {
254
+ left: string;
255
+ };
256
+ };
257
+ };
258
+ typography: {
259
+ font: string;
260
+ letterSpacing: string;
261
+ fontWidth: number;
262
+ };
263
+ icon: {
264
+ size: string;
265
+ gap: string;
266
+ };
267
+ iconButton: {
268
+ width: string;
269
+ };
270
+ };
271
+ };
272
+ 'neutral-primary': {
273
+ shared: {
274
+ color: string;
275
+ backgroundColor: string;
276
+ borderRadius: string;
277
+ border: string;
278
+ ':hover': {
279
+ backgroundColor: string;
280
+ border: string;
281
+ };
282
+ ':active': {
283
+ backgroundColor: string;
284
+ border: string;
285
+ };
286
+ ':disabled': {
287
+ color: string;
288
+ backgroundColor: string;
289
+ border: string;
290
+ };
291
+ };
292
+ xs: {
293
+ height: string;
294
+ padding: {
295
+ top: string;
296
+ right: string;
297
+ bottom: string;
298
+ left: string;
299
+ withIcon: {
300
+ iconLeft: {
301
+ left: string;
302
+ };
303
+ };
304
+ };
305
+ typography: {
306
+ font: string;
307
+ letterSpacing: string;
308
+ fontWidth: number;
309
+ };
310
+ icon: {
311
+ size: string;
312
+ gap: string;
313
+ };
314
+ iconButton: {
315
+ width: string;
316
+ };
317
+ };
318
+ sm: {
319
+ height: string;
320
+ padding: {
321
+ top: string;
322
+ right: string;
323
+ bottom: string;
324
+ left: string;
325
+ withIcon: {
326
+ iconLeft: {
327
+ left: string;
328
+ };
329
+ };
330
+ };
331
+ typography: {
332
+ font: string;
333
+ letterSpacing: string;
334
+ fontWidth: number;
335
+ };
336
+ icon: {
337
+ size: string;
338
+ gap: string;
339
+ };
340
+ iconButton: {
341
+ width: string;
342
+ };
343
+ };
344
+ md: {
345
+ height: string;
346
+ padding: {
347
+ top: string;
348
+ right: string;
349
+ bottom: string;
350
+ left: string;
351
+ withIcon: {
352
+ iconLeft: {
353
+ left: string;
354
+ };
355
+ };
356
+ };
357
+ typography: {
358
+ font: string;
359
+ letterSpacing: string;
360
+ fontWidth: number;
361
+ };
362
+ icon: {
363
+ size: string;
364
+ gap: string;
365
+ };
366
+ iconButton: {
367
+ width: string;
368
+ };
369
+ };
370
+ lg: {
371
+ height: string;
372
+ padding: {
373
+ top: string;
374
+ right: string;
375
+ bottom: string;
376
+ left: string;
377
+ withIcon: {
378
+ iconLeft: {
379
+ left: string;
380
+ };
381
+ };
382
+ };
383
+ typography: {
384
+ font: string;
385
+ letterSpacing: string;
386
+ fontWidth: number;
387
+ };
388
+ icon: {
389
+ size: string;
390
+ gap: string;
391
+ };
392
+ iconButton: {
393
+ width: string;
394
+ };
395
+ };
396
+ };
397
+ 'neutral-secondary': {
398
+ shared: {
399
+ color: string;
400
+ backgroundColor: string;
401
+ borderRadius: string;
402
+ border: string;
403
+ ':hover': {
404
+ backgroundColor: string;
405
+ border: string;
406
+ };
407
+ ':active': {
408
+ backgroundColor: string;
409
+ border: string;
410
+ };
411
+ ':disabled': {
412
+ color: string;
413
+ backgroundColor: string;
414
+ border: string;
415
+ };
416
+ };
417
+ xs: {
418
+ height: string;
419
+ padding: {
420
+ top: string;
421
+ right: string;
422
+ bottom: string;
423
+ left: string;
424
+ withIcon: {
425
+ iconLeft: {
426
+ left: string;
427
+ };
428
+ };
429
+ };
430
+ typography: {
431
+ font: string;
432
+ letterSpacing: string;
433
+ fontWidth: number;
434
+ };
435
+ icon: {
436
+ size: string;
437
+ gap: string;
438
+ };
439
+ iconButton: {
440
+ width: string;
441
+ };
442
+ };
443
+ sm: {
444
+ height: string;
445
+ padding: {
446
+ top: string;
447
+ right: string;
448
+ bottom: string;
449
+ left: string;
450
+ withIcon: {
451
+ iconLeft: {
452
+ left: string;
453
+ };
454
+ };
455
+ };
456
+ typography: {
457
+ font: string;
458
+ letterSpacing: string;
459
+ fontWidth: number;
460
+ };
461
+ icon: {
462
+ size: string;
463
+ gap: string;
464
+ };
465
+ iconButton: {
466
+ width: string;
467
+ };
468
+ };
469
+ md: {
470
+ height: string;
471
+ padding: {
472
+ top: string;
473
+ right: string;
474
+ bottom: string;
475
+ left: string;
476
+ withIcon: {
477
+ iconLeft: {
478
+ left: string;
479
+ };
480
+ };
481
+ };
482
+ typography: {
483
+ font: string;
484
+ letterSpacing: string;
485
+ fontWidth: number;
486
+ };
487
+ icon: {
488
+ size: string;
489
+ gap: string;
490
+ };
491
+ iconButton: {
492
+ width: string;
493
+ };
494
+ };
495
+ lg: {
496
+ height: string;
497
+ padding: {
498
+ top: string;
499
+ right: string;
500
+ bottom: string;
501
+ left: string;
502
+ withIcon: {
503
+ iconLeft: {
504
+ left: string;
505
+ };
506
+ };
507
+ };
508
+ typography: {
509
+ font: string;
510
+ letterSpacing: string;
511
+ fontWidth: number;
512
+ };
513
+ icon: {
514
+ size: string;
515
+ gap: string;
516
+ };
517
+ iconButton: {
518
+ width: string;
519
+ };
520
+ };
521
+ };
522
+ }, { size, variant }: Required<Pick<import("../button/types").ButtonProps, "size" | "variant">>, hasIcon?: boolean, isIconButton?: boolean) => import("@emotion/react").SerializedStyles;
@@ -0,0 +1,26 @@
1
+ import type { ButtonProps as RACButtonProps } from 'react-aria-components';
2
+ import type { DefaultPropsWithChildren } from '../../util/types';
3
+ import type { IconProps, MaterialSymbol } from '../icon/types';
4
+ import type { IconButtonTheme } from './styles';
5
+ export interface IconButtonProps extends DefaultPropsWithChildren<IconButtonTheme, RACButtonProps['className'], IconProps['children']>, Omit<RACButtonProps, 'children'> {
6
+ /**
7
+ * Size variant of the avatar
8
+ */
9
+ size?: keyof Omit<IconButtonTheme['emphasised-primary'], 'shared'>;
10
+ /**
11
+ * Variant of the button
12
+ */
13
+ variant?: keyof Omit<IconButtonTheme, 'shared'>;
14
+ /**
15
+ * Alternative to using the `children` prop for rendering Material Symbol icons,
16
+ * you can use the `symbol` prop to specify the icon by its symbol name.
17
+ * This is a convenience for font icons, allowing you to simply provide the symbol name in a type-safe way without needing to pass it as a child string.
18
+ * For example, instead of `<Icon>home</Icon>`, you can use `<Icon symbol="home" />`.
19
+ * This prop is mutually exclusive with `children` when rendering font icons, and takes precedence over `children` if both are provided.
20
+ */
21
+ symbol?: MaterialSymbol;
22
+ /**
23
+ * Accessible label for the icon button. Required for accessibility.
24
+ */
25
+ ariaLabel: string;
26
+ }
@@ -0,0 +1,2 @@
1
+ import type { IconLinkButtonProps } from './types';
2
+ export declare function IconLinkButton({ variant, size, symbol, ariaLabel, theme, cssOverrides, ...props }: IconLinkButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;