@dnanpm/ui-components 0.5.0 → 0.6.0

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 (66) hide show
  1. package/README.md +3 -1
  2. package/dist/components/Accordion/Accordion.css +4 -4
  3. package/dist/components/Accordion/Accordion.module.css.cjs +3 -3
  4. package/dist/components/Accordion/Accordion.module.css.js +3 -3
  5. package/dist/components/AccordionItem/AccordionItem.css +18 -18
  6. package/dist/components/AccordionItem/AccordionItem.module.css.cjs +11 -11
  7. package/dist/components/AccordionItem/AccordionItem.module.css.js +11 -11
  8. package/dist/components/Breadcrumb/Breadcrumb.css +11 -12
  9. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +6 -6
  10. package/dist/components/Breadcrumb/Breadcrumb.module.css.js +6 -6
  11. package/dist/components/Button/Button.cjs +3 -1
  12. package/dist/components/Button/Button.cjs.map +1 -1
  13. package/dist/components/Button/Button.css +33 -33
  14. package/dist/components/Button/Button.d.ts.map +1 -1
  15. package/dist/components/Button/Button.js +3 -1
  16. package/dist/components/Button/Button.js.map +1 -1
  17. package/dist/components/Button/Button.module.css.cjs +11 -11
  18. package/dist/components/Button/Button.module.css.js +11 -11
  19. package/dist/components/Hero/Hero.cjs +29 -38
  20. package/dist/components/Hero/Hero.cjs.map +1 -1
  21. package/dist/components/Hero/Hero.css +64 -60
  22. package/dist/components/Hero/Hero.d.ts.map +1 -1
  23. package/dist/components/Hero/Hero.js +29 -38
  24. package/dist/components/Hero/Hero.js.map +1 -1
  25. package/dist/components/Hero/Hero.module.css.cjs +20 -19
  26. package/dist/components/Hero/Hero.module.css.cjs.map +1 -1
  27. package/dist/components/Hero/Hero.module.css.js +20 -19
  28. package/dist/components/Hero/Hero.module.css.js.map +1 -1
  29. package/dist/components/Hero/Hero.types.d.ts +1 -5
  30. package/dist/components/Hero/Hero.types.d.ts.map +1 -1
  31. package/dist/components/Hero/Hero.utils.cjs +2 -1
  32. package/dist/components/Hero/Hero.utils.cjs.map +1 -1
  33. package/dist/components/Hero/Hero.utils.d.ts.map +1 -1
  34. package/dist/components/Hero/Hero.utils.js +2 -1
  35. package/dist/components/Hero/Hero.utils.js.map +1 -1
  36. package/dist/components/IconButton/IconButton.cjs +21 -5
  37. package/dist/components/IconButton/IconButton.cjs.map +1 -1
  38. package/dist/components/IconButton/IconButton.css +87 -83
  39. package/dist/components/IconButton/IconButton.d.ts +1 -1
  40. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  41. package/dist/components/IconButton/IconButton.js +22 -6
  42. package/dist/components/IconButton/IconButton.js.map +1 -1
  43. package/dist/components/IconButton/IconButton.module.css.cjs +9 -10
  44. package/dist/components/IconButton/IconButton.module.css.cjs.map +1 -1
  45. package/dist/components/IconButton/IconButton.module.css.js +9 -10
  46. package/dist/components/IconButton/IconButton.module.css.js.map +1 -1
  47. package/dist/components/IconButton/IconButton.types.d.ts +15 -10
  48. package/dist/components/IconButton/IconButton.types.d.ts.map +1 -1
  49. package/dist/components/IconButton/index.d.ts +1 -1
  50. package/dist/components/IconButton/index.d.ts.map +1 -1
  51. package/dist/components/Label/Label.css +13 -8
  52. package/dist/components/Label/Label.module.css.cjs +7 -7
  53. package/dist/components/Label/Label.module.css.js +7 -7
  54. package/dist/components/Notification/Notification.css +14 -14
  55. package/dist/components/Notification/Notification.module.css.cjs +9 -9
  56. package/dist/components/Notification/Notification.module.css.js +9 -9
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.d.ts.map +1 -1
  59. package/dist/styles/utils/elevation.css +20 -17
  60. package/dist/styles/utils/elevation.module.css.cjs +4 -4
  61. package/dist/styles/utils/elevation.module.css.js +4 -4
  62. package/dist/styles/utils/focus.css +14 -14
  63. package/dist/styles/utils/focus.module.css.cjs +3 -3
  64. package/dist/styles/utils/focus.module.css.js +3 -3
  65. package/dist/styles.css +117 -85
  66. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
- @layer dds-components {._focusable_ikczm_1 {
1
+ @layer dds-components {._focusable_azt70_1 {
2
2
  /* Marker class for shared focus treatment */
3
3
  }
4
4
 
5
- ._focusable_ikczm_1:focus {
5
+ ._focusable_azt70_1:focus {
6
6
  outline-color: transparent;
7
7
  }
8
8
 
9
- ._focusable_ikczm_1:focus-visible {
9
+ ._focusable_azt70_1:focus-visible {
10
10
  /* Transparent outline ensures a visible ring fallback in forced colors. */
11
11
  outline: 2px solid transparent;
12
12
  outline-offset: 2px;
@@ -16,21 +16,21 @@
16
16
  }
17
17
 
18
18
  @media (forced-colors: active) {
19
- ._focusable_ikczm_1:focus-visible {
19
+ ._focusable_azt70_1:focus-visible {
20
20
  outline-color: Highlight;
21
21
  box-shadow: none;
22
22
  }
23
23
  }
24
24
 
25
- ._focusableInset_ikczm_25 {
25
+ ._focusableInset_azt70_25 {
26
26
  /* Marker class for inset focus treatment (ring stays inside the element boundary) */
27
27
  }
28
28
 
29
- ._focusableInset_ikczm_25:focus {
29
+ ._focusableInset_azt70_25:focus {
30
30
  outline-color: transparent;
31
31
  }
32
32
 
33
- ._focusableInset_ikczm_25:focus-visible {
33
+ ._focusableInset_azt70_25:focus-visible {
34
34
  outline: 2px solid transparent;
35
35
  box-shadow:
36
36
  inset 0 0 0 2px var(--color-semantic-utility-focus-strong),
@@ -38,34 +38,34 @@
38
38
  }
39
39
 
40
40
  @media (forced-colors: active) {
41
- ._focusableInset_ikczm_25:focus-visible {
41
+ ._focusableInset_azt70_25:focus-visible {
42
42
  outline-color: Highlight;
43
43
  box-shadow: none;
44
44
  }
45
45
  }
46
46
 
47
47
  @scope ([data-color-scheme='dark']) to ([data-color-scheme='light']) {
48
- ._focusable_ikczm_1:focus-visible {
48
+ ._focusable_azt70_1:focus-visible {
49
49
  box-shadow:
50
50
  0 0 0 2px var(--color-semantic-utility-focus-strong),
51
51
  0 0 0 4px var(--color-semantic-utility-focus-soft);
52
52
  }
53
53
 
54
- ._focusableInset_ikczm_25:focus-visible {
54
+ ._focusableInset_azt70_25:focus-visible {
55
55
  box-shadow:
56
56
  inset 0 0 0 2px var(--color-semantic-utility-focus-soft),
57
57
  inset 0 0 0 4px var(--color-semantic-utility-focus-strong);
58
58
  }
59
59
 
60
60
  @media (forced-colors: active) {
61
- ._focusable_ikczm_1:focus-visible,
62
- ._focusableInset_ikczm_25:focus-visible {
61
+ ._focusable_azt70_1:focus-visible,
62
+ ._focusableInset_azt70_25:focus-visible {
63
63
  box-shadow: none;
64
64
  }
65
65
  }
66
66
  }
67
67
 
68
- ._focusClipGuard_ikczm_68 {
68
+ ._focusClipGuard_azt70_68 {
69
69
  /*
70
70
  * Prevents focus rings from being clipped when the container uses overflow: hidden.
71
71
  *
@@ -73,7 +73,7 @@
73
73
  * - Apply this class to the clipping container.
74
74
  * - Override --focus-clip-guard-bleed-inline when a component needs a custom bleed amount.
75
75
  */
76
- --focus-clip-guard-bleed-inline: var(--spacing-ui-xxs);
76
+ --focus-clip-guard-bleed-inline: var(--spacing-space-4);
77
77
  margin-inline: calc(var(--focus-clip-guard-bleed-inline) * -1);
78
78
  padding-inline: var(--focus-clip-guard-bleed-inline);
79
79
  }
@@ -1,9 +1,9 @@
1
1
  require('./focus.css');
2
2
  "use strict";
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
- const focusable = "_focusable_ikczm_1";
5
- const focusableInset = "_focusableInset_ikczm_25";
6
- const focusClipGuard = "_focusClipGuard_ikczm_68";
4
+ const focusable = "_focusable_azt70_1";
5
+ const focusableInset = "_focusableInset_azt70_25";
6
+ const focusClipGuard = "_focusClipGuard_azt70_68";
7
7
  const focusStyles = {
8
8
  focusable,
9
9
  focusableInset,
@@ -1,7 +1,7 @@
1
1
  import './focus.css';
2
- const focusable = "_focusable_ikczm_1";
3
- const focusableInset = "_focusableInset_ikczm_25";
4
- const focusClipGuard = "_focusClipGuard_ikczm_68";
2
+ const focusable = "_focusable_azt70_1";
3
+ const focusableInset = "_focusableInset_azt70_25";
4
+ const focusClipGuard = "_focusClipGuard_azt70_68";
5
5
  const focusStyles = {
6
6
  focusable,
7
7
  focusableInset,
package/dist/styles.css CHANGED
@@ -90,23 +90,6 @@
90
90
  --color-semantic-interactive-auxiliary-focus: #ffb557;
91
91
  --color-semantic-interactive-auxiliary-active: #ffdbad;
92
92
  --color-semantic-interactive-auxiliary-disabled: rgba(255, 219, 173, 0.3);
93
- --spacing-ui-md: 16px;
94
- --spacing-ui-lg: 20px;
95
- --spacing-ui-sm: 12px;
96
- --spacing-ui-xl: 24px;
97
- --spacing-ui-xs: 8px;
98
- --spacing-ui-xxs: 4px;
99
- --spacing-ui-xxl: 32px;
100
- --spacing-ui-none: 0px;
101
- --spacing-ui-xxxl: 40px;
102
- --spacing-layout-none: 0px;
103
- --spacing-layout-xxs: 16px;
104
- --spacing-layout-xs: 32px;
105
- --spacing-layout-sm: 48px;
106
- --spacing-layout-md: 64px;
107
- --spacing-layout-lg: 80px;
108
- --spacing-layout-xl: 96px;
109
- --spacing-layout-xxl: 112px;
110
93
  --radius-semantic-none: 0px;
111
94
  --radius-semantic-sm: 4px;
112
95
  --radius-semantic-md: 8px;
@@ -119,6 +102,23 @@
119
102
  --borderwidth-semantic-xl: 5px;
120
103
  --borderwidth-semantic-xxl: 6px;
121
104
  --borderwidth-semantic-sm: 2px;
105
+ --spacing-space-0: 0px;
106
+ --spacing-space-4: 4px;
107
+ --spacing-space-8: 8px;
108
+ --spacing-space-12: 12px;
109
+ --spacing-space-16: 16px;
110
+ --spacing-space-20: 20px;
111
+ --spacing-space-24: 24px;
112
+ --spacing-space-32: 32px;
113
+ --spacing-space-40: 40px;
114
+ --spacing-space-48: 48px;
115
+ --spacing-space-64: 64px;
116
+ --spacing-space-80: 80px;
117
+ --spacing-space-96: 96px;
118
+ --spacing-space-112: 112px;
119
+ --spacing-space-128: 128px;
120
+ --spacing-space-144: 144px;
121
+ --spacing-space-160: 160px;
122
122
  --typography-font-size-heading-xxl: 48px;
123
123
  --typography-font-size-heading-xl: 40px;
124
124
  --typography-font-size-heading-lg: 34px;
@@ -136,7 +136,7 @@
136
136
  --typography-font-weight-black: 900;
137
137
  --typography-font-weight-demi-bold: 600;
138
138
  --typography-line-height-xs: 1;
139
- --typography-line-height-sm: 1.1;
139
+ --typography-line-height-sm: 1.15;
140
140
  --typography-line-height-md: 1.25;
141
141
  --typography-line-height-lg: 1.5;
142
142
  --typography-letter-spacing-tight: -0.02em;
@@ -144,130 +144,158 @@
144
144
  --typography-letter-spacing-wide: 0.02em;
145
145
  --typography-font-family-heading: DNA Heading;
146
146
  --typography-font-family-text: DNA Text;
147
+ --elevation-semantic-elevation-low-color: rgba(18, 18, 18, 0.06);
148
+ --elevation-semantic-elevation-low-offset-x: 0px;
149
+ --elevation-semantic-elevation-low-offset-y: 2px;
150
+ --elevation-semantic-elevation-low-blur: 16px;
151
+ --elevation-semantic-elevation-low-spread: 0px;
152
+ --elevation-semantic-elevation-medium-color: rgba(18, 18, 18, 0.08);
153
+ --elevation-semantic-elevation-medium-offset-x: 0px;
154
+ --elevation-semantic-elevation-medium-offset-y: 4px;
155
+ --elevation-semantic-elevation-medium-blur: 24px;
156
+ --elevation-semantic-elevation-medium-spread: 0px;
157
+ --elevation-semantic-elevation-high-color: rgba(18, 18, 18, 0.16);
158
+ --elevation-semantic-elevation-high-offset-x: 0px;
159
+ --elevation-semantic-elevation-high-offset-y: 8px;
160
+ --elevation-semantic-elevation-high-blur: 64px;
161
+ --elevation-semantic-elevation-high-spread: 0px;
147
162
  }
148
163
  }
149
164
 
150
165
  @layer dds-base {
151
166
 
152
- *,
153
- *::before,
154
- *::after {
155
- box-sizing: border-box;
156
- }
157
-
158
- html {
159
- font-synthesis: none;
160
- text-rendering: optimizeLegibility;
161
- -webkit-font-smoothing: antialiased;
162
- -moz-osx-font-smoothing: grayscale;
163
- -webkit-text-size-adjust: 100%;
164
-
165
- scroll-behavior: smooth;
166
- }
167
- html,
168
- body {
169
- margin: 0;
170
- padding: 0;
171
- }
167
+ /* ==========================================================================
168
+ Extended typography tokens (hand-authored, CSS only)
172
169
 
173
- img,
174
- picture,
175
- svg,
176
- video {
177
- display: block;
178
- max-width: 100%;
179
- }
180
- }
170
+ Figma is the single source of truth for the generated tokens in tokens.css,
171
+ and that output is kept 1-1 with the Figma export. The variables below cannot
172
+ be expressed in Figma, so they are authored here instead:
181
173
 
182
- @layer dds-base {
174
+ - font shorthand presets compose values across token categories
175
+ (font-weight + font-size/line-height + font-family)
176
+ - heading presets use clamp() for fluid typography
177
+ - font-family tokens in Figma hold only the primary family, without fallbacks
183
178
 
184
- /* ==========================================================================
185
- Typography shorthand variables
179
+ These are additive: they never redeclare a variable emitted by tokens.css.
180
+ They are delivered as CSS custom properties only — the values are CSS
181
+ expressions with no meaningful JavaScript equivalent — so unlike the
182
+ generated tokens there is no JS counterpart.
186
183
 
187
- Each variable holds a complete CSS font shorthand value:
188
- weight size/line-height family
184
+ Requires tokens.css, which defines the referenced font-size, font-weight,
185
+ line-height and font-family variables.
189
186
 
190
187
  Usage: font: var(--typography-heading-xxl);
191
-
192
- Figma doesn't support composing typography tokens from multiple
193
- design token categories, so we need to define these shorthands in CSS.
194
- This also allows us to use the clamp() function for fluid typography,
195
- which isn't possible to do in Figma tokens.
196
188
  ========================================================================== */
197
189
 
198
190
  :root {
199
- /* Font-family with fallbacks — Figma tokens only contain the primary font name,
200
- so we override here to add the full fallback stack for CSS. */
201
- --typography-font-family-heading: 'DNA Heading', 'Helvetica Neue', Helvetica, Arial, sans-serif;
202
- --typography-font-family-text: 'DNA Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
191
+ /* Full family stacks. Primary family comes from the Figma token. */
192
+ --typography-font-family-heading-with-fallback:
193
+ var(--typography-font-family-heading), 'Helvetica Neue', Helvetica, Arial, sans-serif;
194
+ --typography-font-family-text-with-fallback:
195
+ var(--typography-font-family-text), 'Helvetica Neue', Helvetica, Arial, sans-serif;
203
196
 
204
197
  /* Headings */
205
198
  --typography-heading-xxl: var(--typography-font-weight-black)
206
199
  clamp(2.25rem, 2rem + 1.25cqw, 3rem)/var(--typography-line-height-sm)
207
- var(--typography-font-family-heading);
200
+ var(--typography-font-family-heading-with-fallback);
208
201
  --typography-heading-xl: var(--typography-font-weight-black)
209
202
  clamp(2rem, 1.833rem + 0.833cqw, 2.5rem)/var(--typography-line-height-sm)
210
- var(--typography-font-family-heading);
203
+ var(--typography-font-family-heading-with-fallback);
211
204
  --typography-heading-lg: var(--typography-font-weight-black)
212
205
  clamp(1.625rem, 1.458rem + 0.833cqw, 2.125rem)/var(--typography-line-height-sm)
213
- var(--typography-font-family-heading);
206
+ var(--typography-font-family-heading-with-fallback);
214
207
  --typography-heading-md: var(--typography-font-weight-bold)
215
208
  clamp(1.375rem, 1.25rem + 0.625cqw, 1.75rem)/var(--typography-line-height-md)
216
- var(--typography-font-family-heading);
209
+ var(--typography-font-family-heading-with-fallback);
217
210
  --typography-heading-sm: var(--typography-font-weight-bold)
218
211
  clamp(1.25rem, 1.167rem + 0.417cqw, 1.5rem)/var(--typography-line-height-md)
219
- var(--typography-font-family-text);
212
+ var(--typography-font-family-text-with-fallback);
220
213
  --typography-heading-xs: var(--typography-font-weight-bold)
221
214
  clamp(1.125rem, 1.083rem + 0.208cqw, 1.25rem)/var(--typography-line-height-md)
222
- var(--typography-font-family-text);
215
+ var(--typography-font-family-text-with-fallback);
223
216
  --typography-heading-xxs: var(--typography-font-weight-bold)
224
217
  clamp(1.0625rem, 1.042rem + 0.104cqw, 1.125rem)/var(--typography-line-height-md)
225
- var(--typography-font-family-text);
218
+ var(--typography-font-family-text-with-fallback);
226
219
 
227
220
  /* Body */
228
221
  --typography-body-lg: var(--typography-font-weight-regular)
229
222
  clamp(1.125rem, 1.083rem + 0.208cqw, 1.25rem)/var(--typography-line-height-lg)
230
- var(--typography-font-family-text);
223
+ var(--typography-font-family-text-with-fallback);
231
224
  --typography-body-lg-medium: var(--typography-font-weight-medium)
232
225
  clamp(1.125rem, 1.083rem + 0.208cqw, 1.25rem)/var(--typography-line-height-lg)
233
- var(--typography-font-family-text);
226
+ var(--typography-font-family-text-with-fallback);
234
227
  --typography-body-md: var(--typography-font-weight-regular)
235
228
  var(--typography-font-size-text-md)/var(--typography-line-height-lg)
236
- var(--typography-font-family-text);
229
+ var(--typography-font-family-text-with-fallback);
237
230
  --typography-body-md-medium: var(--typography-font-weight-medium)
238
231
  var(--typography-font-size-text-md)/var(--typography-line-height-lg)
239
- var(--typography-font-family-text);
232
+ var(--typography-font-family-text-with-fallback);
240
233
  --typography-body-md-bold: var(--typography-font-weight-bold)
241
234
  var(--typography-font-size-text-md)/var(--typography-line-height-lg)
242
- var(--typography-font-family-text);
235
+ var(--typography-font-family-text-with-fallback);
243
236
  --typography-body-sm: var(--typography-font-weight-regular)
244
237
  var(--typography-font-size-text-sm)/var(--typography-line-height-lg)
245
- var(--typography-font-family-text);
238
+ var(--typography-font-family-text-with-fallback);
246
239
  --typography-body-sm-medium: var(--typography-font-weight-medium)
247
240
  var(--typography-font-size-text-sm)/var(--typography-line-height-lg)
248
- var(--typography-font-family-text);
241
+ var(--typography-font-family-text-with-fallback);
249
242
  --typography-body-xs: var(--typography-font-weight-medium)
250
243
  var(--typography-font-size-text-xs)/var(--typography-line-height-lg)
251
- var(--typography-font-family-text);
244
+ var(--typography-font-family-text-with-fallback);
252
245
 
253
246
  /* Labels */
254
247
  --typography-label-lg: var(--typography-font-weight-medium)
255
- var(--typography-font-size-text-md)/var(--typography-line-height-xs)
256
- var(--typography-font-family-text);
248
+ var(--typography-font-size-text-md)/var(--typography-line-height-sm)
249
+ var(--typography-font-family-text-with-fallback);
257
250
  --typography-label-lg-bold: var(--typography-font-weight-bold)
258
- var(--typography-font-size-text-md)/var(--typography-line-height-xs)
259
- var(--typography-font-family-text);
251
+ var(--typography-font-size-text-md)/var(--typography-line-height-sm)
252
+ var(--typography-font-family-text-with-fallback);
260
253
  --typography-label-md: var(--typography-font-weight-medium)
261
- var(--typography-font-size-text-sm)/var(--typography-line-height-xs)
262
- var(--typography-font-family-text);
254
+ var(--typography-font-size-text-sm)/var(--typography-line-height-sm)
255
+ var(--typography-font-family-text-with-fallback);
263
256
  --typography-label-md-bold: var(--typography-font-weight-bold)
264
- var(--typography-font-size-text-sm)/var(--typography-line-height-xs)
265
- var(--typography-font-family-text);
257
+ var(--typography-font-size-text-sm)/var(--typography-line-height-sm)
258
+ var(--typography-font-family-text-with-fallback);
266
259
  --typography-label-sm: var(--typography-font-weight-medium)
267
- var(--typography-font-size-text-xs)/var(--typography-line-height-xs)
268
- var(--typography-font-family-text);
260
+ var(--typography-font-size-text-xs)/var(--typography-line-height-sm)
261
+ var(--typography-font-family-text-with-fallback);
262
+ }
263
+ }
264
+
265
+ @layer dds-base {
266
+
267
+ *,
268
+ *::before,
269
+ *::after {
270
+ box-sizing: border-box;
271
+ }
272
+
273
+ html {
274
+ font-synthesis: none;
275
+ text-rendering: optimizeLegibility;
276
+ -webkit-font-smoothing: antialiased;
277
+ -moz-osx-font-smoothing: grayscale;
278
+ -webkit-text-size-adjust: 100%;
279
+
280
+ scroll-behavior: smooth;
281
+ }
282
+ html,
283
+ body {
284
+ margin: 0;
285
+ padding: 0;
269
286
  }
270
287
 
288
+ img,
289
+ picture,
290
+ svg,
291
+ video {
292
+ display: block;
293
+ max-width: 100%;
294
+ }
295
+ }
296
+
297
+ @layer dds-base {
298
+
271
299
  /* ==========================================================================
272
300
  Base typography styles
273
301
 
@@ -276,6 +304,10 @@ video {
276
304
  properties are set consistently, and they can be overridden by utility
277
305
  classes for specific use cases.
278
306
 
307
+ The font shorthand presets used here (--typography-heading-*,
308
+ --typography-body-*, --typography-label-*) ship from
309
+ '@dnanpm/design-tokens/css/typography'.
310
+
279
311
  ========================================================================== */
280
312
 
281
313
  html {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnanpm/ui-components",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "DNA Design System - React UI Components",
5
5
  "author": "DNA Oy",
6
6
  "license": "ISC",