@dnanpm/ui-components 0.0.4 → 0.1.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 (132) hide show
  1. package/README.md +14 -17
  2. package/dist/components/Accordion/Accordion.cjs +26 -0
  3. package/dist/components/Accordion/Accordion.cjs.map +1 -0
  4. package/dist/components/Accordion/Accordion.css +19 -0
  5. package/dist/components/Accordion/Accordion.d.ts +3 -0
  6. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  7. package/dist/components/Accordion/Accordion.js +26 -0
  8. package/dist/components/Accordion/Accordion.js.map +1 -0
  9. package/dist/components/Accordion/Accordion.module.css.cjs +12 -0
  10. package/dist/components/Accordion/Accordion.module.css.cjs.map +1 -0
  11. package/dist/components/Accordion/Accordion.module.css.js +12 -0
  12. package/dist/components/Accordion/Accordion.module.css.js.map +1 -0
  13. package/dist/components/Accordion/Accordion.types.d.ts +21 -0
  14. package/dist/components/Accordion/Accordion.types.d.ts.map +1 -0
  15. package/dist/components/Accordion/Accordion.utils.cjs +8 -0
  16. package/dist/components/Accordion/Accordion.utils.cjs.map +1 -0
  17. package/dist/components/Accordion/Accordion.utils.d.ts +8 -0
  18. package/dist/components/Accordion/Accordion.utils.d.ts.map +1 -0
  19. package/dist/components/Accordion/Accordion.utils.js +8 -0
  20. package/dist/components/Accordion/Accordion.utils.js.map +1 -0
  21. package/dist/components/Accordion/index.d.ts +3 -0
  22. package/dist/components/Accordion/index.d.ts.map +1 -0
  23. package/dist/components/AccordionItem/AccordionItem.cjs +57 -0
  24. package/dist/components/AccordionItem/AccordionItem.cjs.map +1 -0
  25. package/dist/components/AccordionItem/AccordionItem.css +128 -0
  26. package/dist/components/AccordionItem/AccordionItem.d.ts +3 -0
  27. package/dist/components/AccordionItem/AccordionItem.d.ts.map +1 -0
  28. package/dist/components/AccordionItem/AccordionItem.js +57 -0
  29. package/dist/components/AccordionItem/AccordionItem.js.map +1 -0
  30. package/dist/components/AccordionItem/AccordionItem.module.css.cjs +17 -0
  31. package/dist/components/AccordionItem/AccordionItem.module.css.cjs.map +1 -0
  32. package/dist/components/AccordionItem/AccordionItem.module.css.js +18 -0
  33. package/dist/components/AccordionItem/AccordionItem.module.css.js.map +1 -0
  34. package/dist/components/AccordionItem/AccordionItem.types.d.ts +32 -0
  35. package/dist/components/AccordionItem/AccordionItem.types.d.ts.map +1 -0
  36. package/dist/components/AccordionItem/index.d.ts +3 -0
  37. package/dist/components/AccordionItem/index.d.ts.map +1 -0
  38. package/dist/components/Breadcrumb/Breadcrumb.cjs +73 -0
  39. package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -0
  40. package/dist/components/Breadcrumb/Breadcrumb.css +72 -0
  41. package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
  42. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -0
  43. package/dist/components/Breadcrumb/Breadcrumb.js +73 -0
  44. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  45. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +25 -0
  46. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs.map +1 -0
  47. package/dist/components/Breadcrumb/Breadcrumb.module.css.js +25 -0
  48. package/dist/components/Breadcrumb/Breadcrumb.module.css.js.map +1 -0
  49. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +46 -0
  50. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts.map +1 -0
  51. package/dist/components/Breadcrumb/index.d.ts +3 -0
  52. package/dist/components/Breadcrumb/index.d.ts.map +1 -0
  53. package/dist/components/Label/Label.cjs +20 -0
  54. package/dist/components/Label/Label.cjs.map +1 -0
  55. package/dist/components/Label/Label.css +40 -0
  56. package/dist/components/Label/Label.d.ts +3 -0
  57. package/dist/components/Label/Label.d.ts.map +1 -0
  58. package/dist/components/Label/Label.js +20 -0
  59. package/dist/components/Label/Label.js.map +1 -0
  60. package/dist/components/Label/Label.module.css.cjs +16 -0
  61. package/dist/components/Label/Label.module.css.cjs.map +1 -0
  62. package/dist/components/Label/Label.module.css.js +16 -0
  63. package/dist/components/Label/Label.module.css.js.map +1 -0
  64. package/dist/components/Label/Label.types.d.ts +28 -0
  65. package/dist/components/Label/Label.types.d.ts.map +1 -0
  66. package/dist/components/Label/index.d.ts +3 -0
  67. package/dist/components/Label/index.d.ts.map +1 -0
  68. package/dist/components/Notification/Notification.cjs +58 -0
  69. package/dist/components/Notification/Notification.cjs.map +1 -0
  70. package/dist/components/Notification/Notification.css +91 -0
  71. package/dist/components/Notification/Notification.d.ts +3 -0
  72. package/dist/components/Notification/Notification.d.ts.map +1 -0
  73. package/dist/components/Notification/Notification.js +58 -0
  74. package/dist/components/Notification/Notification.js.map +1 -0
  75. package/dist/components/Notification/Notification.module.css.cjs +24 -0
  76. package/dist/components/Notification/Notification.module.css.cjs.map +1 -0
  77. package/dist/components/Notification/Notification.module.css.js +24 -0
  78. package/dist/components/Notification/Notification.module.css.js.map +1 -0
  79. package/dist/components/Notification/Notification.types.d.ts +40 -0
  80. package/dist/components/Notification/Notification.types.d.ts.map +1 -0
  81. package/dist/components/Notification/index.d.ts +3 -0
  82. package/dist/components/Notification/index.d.ts.map +1 -0
  83. package/dist/font-definitions.css +61 -0
  84. package/dist/index.cjs +13 -94
  85. package/dist/index.cjs.map +1 -1
  86. package/dist/index.d.ts +12 -5
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +12 -93
  89. package/dist/index.js.map +1 -1
  90. package/dist/styles/utils/elevation.css +28 -0
  91. package/dist/styles/utils/elevation.module.css.cjs +10 -0
  92. package/dist/styles/utils/elevation.module.css.cjs.map +1 -0
  93. package/dist/styles/utils/elevation.module.css.js +10 -0
  94. package/dist/styles/utils/elevation.module.css.js.map +1 -0
  95. package/dist/styles/utils/focus.css +59 -0
  96. package/dist/styles/utils/focus.module.css.cjs +16 -0
  97. package/dist/styles/utils/focus.module.css.cjs.map +1 -0
  98. package/dist/styles/utils/focus.module.css.js +16 -0
  99. package/dist/styles/utils/focus.module.css.js.map +1 -0
  100. package/dist/styles/utils/text-decoration.css +7 -0
  101. package/dist/styles/utils/text-decoration.module.css.cjs +10 -0
  102. package/dist/styles/utils/text-decoration.module.css.cjs.map +1 -0
  103. package/dist/styles/utils/text-decoration.module.css.js +10 -0
  104. package/dist/styles/utils/text-decoration.module.css.js.map +1 -0
  105. package/dist/styles.css +50 -119
  106. package/dist/utils/cn/cn.cjs +8 -0
  107. package/dist/utils/cn/cn.cjs.map +1 -0
  108. package/dist/utils/cn/cn.d.ts +16 -0
  109. package/dist/utils/cn/cn.d.ts.map +1 -0
  110. package/dist/utils/cn/cn.js +8 -0
  111. package/dist/utils/cn/cn.js.map +1 -0
  112. package/dist/utils/cn/index.d.ts +3 -0
  113. package/dist/utils/cn/index.d.ts.map +1 -0
  114. package/dist/utils/index.d.ts +1 -0
  115. package/dist/utils/index.d.ts.map +1 -1
  116. package/package.json +16 -5
  117. package/dist/components/Box/Box.d.ts +0 -24
  118. package/dist/components/Box/Box.d.ts.map +0 -1
  119. package/dist/components/Box/Box.types.d.ts +0 -24
  120. package/dist/components/Box/Box.types.d.ts.map +0 -1
  121. package/dist/components/Box/index.d.ts +0 -3
  122. package/dist/components/Box/index.d.ts.map +0 -1
  123. package/dist/components/Button/Button.d.ts +0 -3
  124. package/dist/components/Button/Button.d.ts.map +0 -1
  125. package/dist/components/Button/Button.types.d.ts +0 -51
  126. package/dist/components/Button/Button.types.d.ts.map +0 -1
  127. package/dist/components/Button/index.d.ts +0 -3
  128. package/dist/components/Button/index.d.ts.map +0 -1
  129. package/dist/components/index.d.ts +0 -3
  130. package/dist/components/index.d.ts.map +0 -1
  131. package/dist/utils/cn.d.ts +0 -6
  132. package/dist/utils/cn.d.ts.map +0 -1
@@ -0,0 +1,10 @@
1
+ require('./elevation.css');
2
+ "use strict";
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
+ const elevationLow = "_elevationLow_1rmn9_6";
5
+ const elevationStyles = {
6
+ elevationLow
7
+ };
8
+ exports.default = elevationStyles;
9
+ exports.elevationLow = elevationLow;
10
+ //# sourceMappingURL=elevation.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevation.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import './elevation.css';
2
+ const elevationLow = "_elevationLow_1rmn9_6";
3
+ const elevationStyles = {
4
+ elevationLow
5
+ };
6
+ export {
7
+ elevationStyles as default,
8
+ elevationLow
9
+ };
10
+ //# sourceMappingURL=elevation.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elevation.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,59 @@
1
+ @layer dna-design-system {._focusable_1cr46_1 {
2
+ /* Marker class for shared focus treatment */
3
+ }
4
+
5
+ ._focusable_1cr46_1:focus {
6
+ outline-color: transparent;
7
+ }
8
+
9
+ ._focusable_1cr46_1:focus-visible {
10
+ /* Transparent outline ensures a visible ring fallback in forced colors. */
11
+ outline: 2px solid transparent;
12
+ outline-offset: 2px;
13
+ box-shadow:
14
+ 0 0 0 2px var(--colors-semantic-utility-focus-soft),
15
+ 0 0 0 4px var(--colors-semantic-utility-focus-strong);
16
+ }
17
+
18
+ @media (forced-colors: active) {
19
+ ._focusable_1cr46_1:focus-visible {
20
+ outline-color: Highlight;
21
+ box-shadow: none;
22
+ }
23
+ }
24
+
25
+ ._focusableInset_1cr46_25 {
26
+ /* Marker class for inset focus treatment (ring stays inside the element boundary) */
27
+ }
28
+
29
+ ._focusableInset_1cr46_25:focus {
30
+ outline-color: transparent;
31
+ }
32
+
33
+ ._focusableInset_1cr46_25:focus-visible {
34
+ outline: 2px solid transparent;
35
+ box-shadow:
36
+ inset 0 0 0 2px var(--colors-semantic-utility-focus-strong),
37
+ inset 0 0 0 4px var(--colors-semantic-utility-focus-soft);
38
+ }
39
+
40
+ @media (forced-colors: active) {
41
+ ._focusableInset_1cr46_25:focus-visible {
42
+ outline-color: Highlight;
43
+ box-shadow: none;
44
+ }
45
+ }
46
+
47
+ ._focusClipGuard_1cr46_47 {
48
+ /*
49
+ * Prevents focus rings from being clipped when the container uses overflow: hidden.
50
+ *
51
+ * Usage:
52
+ * - Apply this class to the clipping container.
53
+ * - Override --focus-clip-guard-bleed-inline when a component needs a custom bleed amount.
54
+ */
55
+ --focus-clip-guard-bleed-inline: var(--spacing-ui-xxs);
56
+ margin-inline: calc(var(--focus-clip-guard-bleed-inline) * -1);
57
+ padding-inline: var(--focus-clip-guard-bleed-inline);
58
+ }
59
+ }
@@ -0,0 +1,16 @@
1
+ require('./focus.css');
2
+ "use strict";
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
+ const focusable = "_focusable_1cr46_1";
5
+ const focusableInset = "_focusableInset_1cr46_25";
6
+ const focusClipGuard = "_focusClipGuard_1cr46_47";
7
+ const focusStyles = {
8
+ focusable,
9
+ focusableInset,
10
+ focusClipGuard
11
+ };
12
+ exports.default = focusStyles;
13
+ exports.focusClipGuard = focusClipGuard;
14
+ exports.focusable = focusable;
15
+ exports.focusableInset = focusableInset;
16
+ //# sourceMappingURL=focus.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -0,0 +1,16 @@
1
+ import './focus.css';
2
+ const focusable = "_focusable_1cr46_1";
3
+ const focusableInset = "_focusableInset_1cr46_25";
4
+ const focusClipGuard = "_focusClipGuard_1cr46_47";
5
+ const focusStyles = {
6
+ focusable,
7
+ focusableInset,
8
+ focusClipGuard
9
+ };
10
+ export {
11
+ focusStyles as default,
12
+ focusClipGuard,
13
+ focusable,
14
+ focusableInset
15
+ };
16
+ //# sourceMappingURL=focus.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ @layer dna-design-system {._underlineLink_1nw3t_1 {
2
+ text-decoration: underline;
3
+ text-underline-offset: 0.2em;
4
+ text-decoration-skip-ink: auto;
5
+ text-decoration-thickness: from-font;
6
+ }
7
+ }
@@ -0,0 +1,10 @@
1
+ require('./text-decoration.css');
2
+ "use strict";
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
+ const underlineLink = "_underlineLink_1nw3t_1";
5
+ const textDecorationStyles = {
6
+ underlineLink
7
+ };
8
+ exports.default = textDecorationStyles;
9
+ exports.underlineLink = underlineLink;
10
+ //# sourceMappingURL=text-decoration.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-decoration.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import './text-decoration.css';
2
+ const underlineLink = "_underlineLink_1nw3t_1";
3
+ const textDecorationStyles = {
4
+ underlineLink
5
+ };
6
+ export {
7
+ textDecorationStyles as default,
8
+ underlineLink
9
+ };
10
+ //# sourceMappingURL=text-decoration.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-decoration.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/dist/styles.css CHANGED
@@ -1,3 +1,5 @@
1
+ @layer dna-design-system {
2
+
1
3
  /**
2
4
  * Do not edit directly, this file was auto-generated.
3
5
  */
@@ -181,6 +183,15 @@
181
183
  --borderwidth-primitive-size5: 5px;
182
184
  --borderwidth-primitive-size6: 6px;
183
185
  }
186
+ }
187
+
188
+ @layer dna-design-system {
189
+
190
+ *,
191
+ *::before,
192
+ *::after {
193
+ box-sizing: border-box;
194
+ }
184
195
 
185
196
  html {
186
197
  font-synthesis: none;
@@ -191,137 +202,57 @@ html {
191
202
 
192
203
  scroll-behavior: smooth;
193
204
  }
194
- /**
195
- * Box Component Styles
196
- *
197
- * Design tokens are consumed via CSS custom properties (variables).
198
- * These variables come from @dnanpm/design-tokens package.
199
- *
200
- * Elevation shadows based on DNA Design System specifications:
201
- * - None: No shadow
202
- * - Low: Subtle depth (0 2px 16px rgba(18, 18, 18, 0.06))
203
- * - High: Medium depth (0 6px 24px rgba(18, 18, 18, 0.08))
204
- * - Extra High: Maximum depth (0 8px 64px rgba(18, 18, 18, 0.16))
205
- */
206
-
207
- ._box_5e7g9_14 {
208
- display: block;
209
- padding: var(--spacing-ui-md, 1rem);
210
- border-radius: var(--radius-semantic-md, 0.5rem);
211
- background-color: var(--colors-primitive-neutral-0, #ffffff);
212
- transition: box-shadow 0.2s ease-in-out;
213
- }
214
-
215
- /* Elevation Variants */
216
- ._box--none_5e7g9_23 {
217
- box-shadow: none;
218
- }
219
-
220
- ._box--low_5e7g9_27 {
221
- box-shadow: 0 2px 16px rgba(18, 18, 18, 0.06);
222
- }
223
-
224
- ._box--high_5e7g9_31 {
225
- box-shadow: 0 6px 24px rgba(18, 18, 18, 0.08);
226
- }
227
-
228
- ._box--extraHigh_5e7g9_35 {
229
- box-shadow: 0 8px 64px rgba(18, 18, 18, 0.16);
230
- }
231
- /**
232
- * Button Component Styles
233
- *
234
- * Design tokens are consumed via CSS custom properties (variables).
235
- * These variables come from @dnanpm/design-tokens package.
236
- *
237
- * Examples:
238
- * - Colors: var(--colors-primitive-pink-500)
239
- * - Spacing: var(--spacing-ui-md)
240
- * - Border radius: var(--radius-semantic-md)
241
- *
242
- * Fallback values are defined in src/styles/base.css
243
- */
244
-
245
- ._button_1p878_15 {
246
- display: inline-flex;
247
- align-items: center;
248
- justify-content: center;
249
- height: 2.5rem;
250
- padding: 0 var(--spacing-ui-md, 1rem);
251
- font-family:
252
- -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
253
- sans-serif;
254
- font-size: 0.875rem;
255
- font-weight: 500;
256
- border-radius: var(--radius-semantic-md, 0.5rem);
257
- border: 1px solid transparent;
258
- cursor: pointer;
259
- transition: all 0.15s ease-in-out;
260
- text-decoration: none;
261
- white-space: nowrap;
262
- }
263
-
264
- ._button_1p878_15:focus-visible {
265
- outline: 2px solid var(--colors-primitive-utility-focusstrong, #1d4ed8);
266
- outline-offset: 2px;
267
- }
268
-
269
- ._button_1p878_15:disabled {
270
- opacity: 0.5;
271
- cursor: not-allowed;
272
- }
273
-
274
- /* Button Variants */
275
- ._button--primary_1p878_45 {
276
- background-color: var(--colors-primitive-pink-500, #ec4899);
277
- color: white;
205
+ html,
206
+ body {
207
+ margin: 0;
208
+ padding: 0;
278
209
  }
279
210
 
280
- ._button--primary_1p878_45:hover:not(:disabled) {
281
- background-color: var(--colors-primitive-pink-600, #db2777);
211
+ img,
212
+ picture,
213
+ svg,
214
+ video {
215
+ display: block;
216
+ max-width: 100%;
282
217
  }
283
-
284
- ._button--primary_1p878_45:active:not(:disabled) {
285
- background-color: var(--colors-primitive-pink-400, #f472b6);
286
218
  }
287
219
 
288
- ._button--secondary_1p878_58 {
289
- background-color: var(--colors-primitive-neutral-100, #f5f5f5);
290
- color: var(--colors-primitive-neutral-900, #171717);
291
- border-color: var(--colors-primitive-neutral-300, #d4d4d4);
292
- }
220
+ @layer dna-design-system {
293
221
 
294
- ._button--secondary_1p878_58:hover:not(:disabled) {
295
- background-color: var(--colors-primitive-neutral-200, #e5e5e5);
296
- }
222
+ :root {
223
+ /* Example variables for fonts, these will be replaced with actual design tokens */
224
+ --font-family-text: 'DNA Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
225
+ --font-family-heading: 'DNA Heading', 'Helvetica Neue', Helvetica, Arial, sans-serif;
297
226
 
298
- ._button--secondary_1p878_58:active:not(:disabled) {
299
- background-color: var(--colors-primitive-neutral-300, #d4d4d4);
300
- }
227
+ --font-size-xxs: 0.625rem; /* 10px */
228
+ --font-size-xs: 0.75rem; /* 12px */
229
+ --font-size-sm: 0.875rem; /* 14px */
230
+ --font-size-default: 1rem;
231
+ --font-size-lg: 1.125rem; /* 18px */
232
+ --font-size-xl: 1.25rem; /* 20px */
301
233
 
302
- /* Size Variants */
303
- ._button--default_1p878_73 {
304
- /* Default size (already set in base styles) */
305
- }
234
+ --font-weight-regular: 400;
235
+ --font-weight-medium: 500;
236
+ --font-weight-semi-bold: 600;
237
+ --font-weight-bold: 700;
238
+ --font-weight-black: 900;
306
239
 
307
- ._button--small_1p878_77 {
308
- height: 2rem;
309
- padding: 0 var(--spacing-ui-sm, 0.75rem);
310
- font-size: 0.75rem;
240
+ --line-height-default: 1.25;
241
+ --line-height-text: 1.5;
311
242
  }
312
243
 
313
- /* Layout Modifiers */
314
- ._button--fullWidth_1p878_84 {
315
- width: 100%;
244
+ html {
245
+ font-family: var(--font-family-text);
246
+ font-size: var(--font-size-default);
247
+ line-height: var(--line-height-default);
316
248
  }
317
249
 
318
- /* State Modifiers */
319
- ._button--loading_1p878_89 {
320
- opacity: 0.7;
321
- cursor: wait;
250
+ h1,
251
+ h2,
252
+ h3,
253
+ h4,
254
+ h5,
255
+ h6 {
256
+ text-wrap: balance;
322
257
  }
323
-
324
- ._button--loading_1p878_89:hover {
325
- /* Prevent hover effects when loading */
326
- background-color: inherit;
327
258
  }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const clsx = require("clsx");
4
+ function cn(...inputs) {
5
+ return clsx(...inputs);
6
+ }
7
+ exports.cn = cn;
8
+ //# sourceMappingURL=cn.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.cjs","sources":["../../../src/utils/cn/cn.ts"],"sourcesContent":["import clsx from 'clsx';\n\nexport type CnDictionary = Record<string, boolean | null | undefined>;\n\nexport type CnInput = string | false | null | undefined | CnDictionary | ReadonlyArray<CnInput>;\n\n/**\n * Composes CSS Module class names, optional consumer className values, and conditional maps.\n *\n * Supported inputs:\n * - string class names\n * - object maps where truthy values include the key\n * - nested arrays of supported inputs\n * - falsy values, which are ignored\n *\n * Prefer this utility over direct clsx imports so class name composition stays consistent across\n * the package and can be updated in one place.\n */\nexport function cn(...inputs: CnInput[]): string {\n return clsx(...inputs);\n}\n"],"names":[],"mappings":";;;AAkBO,SAAS,MAAM,QAA2B;AAC7C,SAAO,KAAK,GAAG,MAAM;AACzB;;"}
@@ -0,0 +1,16 @@
1
+ export type CnDictionary = Record<string, boolean | null | undefined>;
2
+ export type CnInput = string | false | null | undefined | CnDictionary | ReadonlyArray<CnInput>;
3
+ /**
4
+ * Composes CSS Module class names, optional consumer className values, and conditional maps.
5
+ *
6
+ * Supported inputs:
7
+ * - string class names
8
+ * - object maps where truthy values include the key
9
+ * - nested arrays of supported inputs
10
+ * - falsy values, which are ignored
11
+ *
12
+ * Prefer this utility over direct clsx imports so class name composition stays consistent across
13
+ * the package and can be updated in one place.
14
+ */
15
+ export declare function cn(...inputs: CnInput[]): string;
16
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../src/utils/cn/cn.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAEtE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAEhG;;;;;;;;;;;GAWG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAE/C"}
@@ -0,0 +1,8 @@
1
+ import clsx from "clsx";
2
+ function cn(...inputs) {
3
+ return clsx(...inputs);
4
+ }
5
+ export {
6
+ cn
7
+ };
8
+ //# sourceMappingURL=cn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.js","sources":["../../../src/utils/cn/cn.ts"],"sourcesContent":["import clsx from 'clsx';\n\nexport type CnDictionary = Record<string, boolean | null | undefined>;\n\nexport type CnInput = string | false | null | undefined | CnDictionary | ReadonlyArray<CnInput>;\n\n/**\n * Composes CSS Module class names, optional consumer className values, and conditional maps.\n *\n * Supported inputs:\n * - string class names\n * - object maps where truthy values include the key\n * - nested arrays of supported inputs\n * - falsy values, which are ignored\n *\n * Prefer this utility over direct clsx imports so class name composition stays consistent across\n * the package and can be updated in one place.\n */\nexport function cn(...inputs: CnInput[]): string {\n return clsx(...inputs);\n}\n"],"names":[],"mappings":";AAkBO,SAAS,MAAM,QAA2B;AAC7C,SAAO,KAAK,GAAG,MAAM;AACzB;"}
@@ -0,0 +1,3 @@
1
+ export { cn } from './cn';
2
+ export type { CnDictionary, CnInput } from './cn';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/cn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { cn } from './cn';
2
+ export type { CnDictionary, CnInput } from './cn/index';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@dnanpm/ui-components",
3
- "version": "0.0.4",
3
+ "version": "0.1.0",
4
4
  "description": "DNA Design System - React UI Components",
5
5
  "author": "DNA Oy",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
+ "sideEffects": [
9
+ "**/*.css"
10
+ ],
8
11
  "main": "./dist/index.cjs",
9
12
  "module": "./dist/index.js",
10
13
  "types": "./dist/index.d.ts",
@@ -14,7 +17,8 @@
14
17
  "import": "./dist/index.js",
15
18
  "require": "./dist/index.cjs"
16
19
  },
17
- "./styles.css": "./dist/styles.css"
20
+ "./styles.css": "./dist/styles.css",
21
+ "./font-definitions.css": "./dist/font-definitions.css"
18
22
  },
19
23
  "files": [
20
24
  "dist"
@@ -22,7 +26,8 @@
22
26
  "scripts": {
23
27
  "build": "tsc --project tsconfig.build.json && vite build",
24
28
  "dev": "vite build --watch",
25
- "test": "vitest run",
29
+ "gen:component": "plop --plopfile ./scripts/template-generators/plopfile.mjs component",
30
+ "test": "vitest run --coverage",
26
31
  "test:watch": "vitest",
27
32
  "format": "prettier --write .",
28
33
  "format:check": "prettier --check .",
@@ -46,6 +51,10 @@
46
51
  "engines": {
47
52
  "node": ">=24"
48
53
  },
54
+ "dependencies": {
55
+ "@dnanpm/icons": "^2.0.17",
56
+ "clsx": "^2.1.1"
57
+ },
49
58
  "peerDependencies": {
50
59
  "react": "^18.0.0 || ^19.0.0",
51
60
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -55,22 +64,24 @@
55
64
  "@repo/eslint-config": "workspace:*",
56
65
  "@repo/typescript-config": "workspace:*",
57
66
  "@storybook/react-vite": "^10.3.1",
58
- "@storybook/addon-docs": "^10.3.1",
59
67
  "@testing-library/jest-dom": "^6.6.3",
60
68
  "@testing-library/react": "^16.1.0",
61
69
  "@testing-library/user-event": "^14.5.2",
62
70
  "@types/react": "^19.2.14",
63
71
  "@types/react-dom": "^19.2.3",
64
72
  "@vitejs/plugin-react": "^5.1.4",
73
+ "@vitest/coverage-v8": "^4.1.1",
65
74
  "eslint": "^9.39.2",
66
75
  "jsdom": "^28.1.0",
76
+ "plop": "^4.0.5",
77
+ "postcss": "^8.5.10",
67
78
  "prettier": "^3.8.1",
68
79
  "react": "^19.2.4",
69
80
  "react-dom": "^19.2.4",
70
81
  "typescript": "^5.9.3",
71
82
  "vite": "^7.3.1",
72
83
  "vite-plugin-dts": "^4.5.4",
73
- "vitest": "^4.0.18"
84
+ "vitest": "^4.1.1"
74
85
  },
75
86
  "repository": {
76
87
  "type": "git",
@@ -1,24 +0,0 @@
1
- /**
2
- * Box Component
3
- *
4
- * A versatile container component with elevation (shadow) variants.
5
- * Can be rendered as any HTML element using the polymorphic `as` prop.
6
- *
7
- * Features:
8
- * - Polymorphic: Render as any element (div, section, article, etc.)
9
- * - Elevation: Four shadow depth levels (none, low, high, extraHigh)
10
- * - Ref forwarding supported
11
- * - Uses design tokens for consistent shadows
12
- *
13
- * @example
14
- * // Basic box with no elevation
15
- * <Box>Content</Box>
16
- *
17
- * // Box with elevation
18
- * <Box elevation="high">Elevated content</Box>
19
- *
20
- * // Box as section element
21
- * <Box as="section" elevation="low">Section content</Box>
22
- */
23
- export declare const Box: import('react').ForwardRefExoticComponent<import('./Box.types').BaseBoxProps & import('react').HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
24
- //# sourceMappingURL=Box.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAOH,eAAO,MAAM,GAAG,0KAUf,CAAC"}
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- export type BoxElevation = 'none' | 'low' | 'high' | 'extraHigh';
3
- export interface BaseBoxProps {
4
- /**
5
- * The element type to render
6
- * @default "div"
7
- */
8
- readonly as?: React.ElementType;
9
- /**
10
- * The elevation level (shadow depth) of the box
11
- * @default "none"
12
- */
13
- readonly elevation?: BoxElevation;
14
- /**
15
- * The content of the box
16
- */
17
- readonly children?: React.ReactNode;
18
- /**
19
- * Custom className to apply to the box
20
- */
21
- readonly className?: string;
22
- }
23
- export type BoxProps = BaseBoxProps & React.HTMLAttributes<HTMLElement>;
24
- //# sourceMappingURL=Box.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Box.types.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,CAAC;AAEjE,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;IAClC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export { Box } from './Box';
2
- export type { BoxProps, BoxElevation } from './Box.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -1,3 +0,0 @@
1
- import { ButtonProps } from './Button.types';
2
- export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
3
- //# sourceMappingURL=Button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,eAAO,MAAM,MAAM,+HAoDlB,CAAC"}
@@ -1,51 +0,0 @@
1
- import * as React from 'react';
2
- interface BaseButtonProps {
3
- /**
4
- * The visual style variant of the button
5
- * @default "primary"
6
- */
7
- readonly variant?: 'primary' | 'secondary';
8
- /**
9
- * The size variant of the button
10
- * @default "default"
11
- */
12
- readonly size?: 'default' | 'small';
13
- /**
14
- * The content of the button
15
- */
16
- readonly children: React.ReactNode;
17
- /**
18
- * Whether the button should take full width
19
- * @default false
20
- */
21
- readonly fullWidth?: boolean;
22
- /**
23
- * Whether the button is in a loading state
24
- * @default false
25
- */
26
- readonly loading?: boolean;
27
- /**
28
- * Custom className to apply to the button
29
- */
30
- readonly className?: string;
31
- }
32
- interface ButtonAsButton extends BaseButtonProps, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'className'> {
33
- /**
34
- * Render as a different element (button or anchor)
35
- * @default "button"
36
- */
37
- readonly as?: 'button';
38
- }
39
- interface ButtonAsAnchor extends BaseButtonProps, Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'className'> {
40
- /**
41
- * Render as a different element (button or anchor)
42
- */
43
- readonly as: 'a';
44
- /**
45
- * The URL to link to (required when as="a")
46
- */
47
- readonly href: string;
48
- }
49
- export type ButtonProps = ButtonAsButton | ButtonAsAnchor;
50
- export {};
51
- //# sourceMappingURL=Button.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,eAAe;IACrB;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,UAAU,cACN,SACI,eAAe,EACf,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACjF;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CAC1B;AAED,UAAU,cACN,SACI,eAAe,EACf,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACjF;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export { Button } from './Button';
2
- export type { ButtonProps } from './Button.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './Box';
2
- export * from './Button';
3
- //# sourceMappingURL=index.d.ts.map