@dnanpm/ui-components 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/styles.css CHANGED
@@ -191,20 +191,7 @@ html {
191
191
 
192
192
  scroll-behavior: smooth;
193
193
  }
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 {
194
+ ._box_1wdiz_1 {
208
195
  display: block;
209
196
  padding: var(--spacing-ui-md, 1rem);
210
197
  border-radius: var(--radius-semantic-md, 0.5rem);
@@ -213,19 +200,19 @@ html {
213
200
  }
214
201
 
215
202
  /* Elevation Variants */
216
- ._box--none_5e7g9_23 {
203
+ ._box--none_1wdiz_10 {
217
204
  box-shadow: none;
218
205
  }
219
206
 
220
- ._box--low_5e7g9_27 {
207
+ ._box--low_1wdiz_14 {
221
208
  box-shadow: 0 2px 16px rgba(18, 18, 18, 0.06);
222
209
  }
223
210
 
224
- ._box--high_5e7g9_31 {
211
+ ._box--high_1wdiz_18 {
225
212
  box-shadow: 0 6px 24px rgba(18, 18, 18, 0.08);
226
213
  }
227
214
 
228
- ._box--extraHigh_5e7g9_35 {
215
+ ._box--extraHigh_1wdiz_22 {
229
216
  box-shadow: 0 8px 64px rgba(18, 18, 18, 0.16);
230
217
  }
231
218
  /**
@@ -325,3 +312,245 @@ html {
325
312
  /* Prevent hover effects when loading */
326
313
  background-color: inherit;
327
314
  }
315
+ ._dialog__backdrop_p6ll3_1 {
316
+ position: fixed;
317
+ inset: 0;
318
+ min-height: 100dvh;
319
+ background: rgb(23 23 23 / 0.5);
320
+ backdrop-filter: blur(2px);
321
+ transition:
322
+ opacity 180ms ease,
323
+ backdrop-filter 180ms ease;
324
+
325
+ @supports (-webkit-touch-callout: none) {
326
+ position: absolute;
327
+ }
328
+ }
329
+
330
+ ._dialog__backdrop_p6ll3_1[data-starting-style],
331
+ ._dialog__backdrop_p6ll3_1[data-ending-style] {
332
+ opacity: 0;
333
+ backdrop-filter: blur(0);
334
+ }
335
+
336
+ ._dialog__viewport_p6ll3_22 {
337
+ position: fixed;
338
+ inset: 0;
339
+ display: flex;
340
+ align-items: center;
341
+ justify-content: center;
342
+ padding: 1.5rem;
343
+ }
344
+
345
+ ._dialog__popup_p6ll3_31 {
346
+ box-sizing: border-box;
347
+ position: relative;
348
+ display: flex;
349
+ flex-direction: column;
350
+ width: min(100%, 36rem);
351
+ max-height: min(80vh, 44rem);
352
+ min-height: 0;
353
+ overflow: hidden;
354
+ border-radius: var(--radius-semantic-lg, 0.75rem);
355
+ background-color: var(--colors-primitive-neutral-0, #ffffff);
356
+ color: var(--colors-primitive-neutral-900, #171717);
357
+ outline: 1px solid var(--colors-primitive-neutral-200, #e5e5e5);
358
+ box-shadow:
359
+ 0 24px 48px rgb(23 23 23 / 0.18),
360
+ 0 12px 24px rgb(23 23 23 / 0.08);
361
+ transition:
362
+ opacity 180ms ease,
363
+ transform 180ms ease;
364
+ }
365
+
366
+ ._dialog__popup_p6ll3_31[data-starting-style],
367
+ ._dialog__popup_p6ll3_31[data-ending-style] {
368
+ opacity: 0;
369
+ transform: scale(0.98) translateY(0.5rem);
370
+ }
371
+
372
+ ._dialog__popup--sm_p6ll3_58 {
373
+ width: min(100%, 28rem);
374
+ }
375
+
376
+ ._dialog__popup--md_p6ll3_62 {
377
+ width: min(100%, 36rem);
378
+ }
379
+
380
+ ._dialog__popup--lg_p6ll3_66 {
381
+ width: min(100%, 44rem);
382
+ }
383
+
384
+ ._dialog__header_p6ll3_70 {
385
+ display: flex;
386
+ align-items: flex-start;
387
+ justify-content: space-between;
388
+ gap: 1rem;
389
+ padding: 1.5rem 1.5rem 0;
390
+ }
391
+
392
+ ._dialog__titleGroup_p6ll3_78 {
393
+ display: flex;
394
+ flex: 1 1 auto;
395
+ flex-direction: column;
396
+ gap: 0.5rem;
397
+ }
398
+
399
+ ._dialog__title_p6ll3_78 {
400
+ margin: 0;
401
+ font-family:
402
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
403
+ sans-serif;
404
+ font-size: 1.25rem;
405
+ font-weight: 600;
406
+ line-height: 1.75rem;
407
+ }
408
+
409
+ ._dialog__description_p6ll3_95 {
410
+ margin: 0;
411
+ color: var(--colors-primitive-neutral-600, #525252);
412
+ font-size: 0.95rem;
413
+ line-height: 1.5rem;
414
+ }
415
+
416
+ ._dialog__close_p6ll3_102 {
417
+ display: inline-flex;
418
+ flex: 0 0 auto;
419
+ align-items: center;
420
+ justify-content: center;
421
+ width: 2.5rem;
422
+ height: 2.5rem;
423
+ border: 1px solid var(--colors-primitive-neutral-200, #e5e5e5);
424
+ border-radius: var(--radius-semantic-md, 0.5rem);
425
+ background-color: var(--colors-primitive-neutral-0, #ffffff);
426
+ color: var(--colors-primitive-neutral-600, #525252);
427
+ transition:
428
+ background-color 120ms ease,
429
+ color 120ms ease,
430
+ border-color 120ms ease;
431
+ }
432
+
433
+ ._dialog__close_p6ll3_102:focus-visible {
434
+ outline: 2px solid var(--colors-primitive-utility-focusstrong, #1d4ed8);
435
+ outline-offset: 2px;
436
+ }
437
+
438
+ ._dialog__close_p6ll3_102:hover {
439
+ background-color: var(--colors-primitive-neutral-100, #f5f5f5);
440
+ color: var(--colors-primitive-neutral-900, #171717);
441
+ }
442
+
443
+ ._dialog__closeIcon_p6ll3_129 {
444
+ width: 1.125rem;
445
+ height: 1.125rem;
446
+ }
447
+
448
+ ._dialog__body_p6ll3_134 {
449
+ flex: 1 1 auto;
450
+ min-height: 0;
451
+ overflow: auto;
452
+ padding: 1.25rem 1.5rem;
453
+ color: var(--colors-primitive-neutral-700, #404040);
454
+ font-size: 0.95rem;
455
+ line-height: 1.6rem;
456
+ }
457
+
458
+ ._dialog__footer_p6ll3_144 {
459
+ display: flex;
460
+ flex-wrap: wrap;
461
+ justify-content: flex-end;
462
+ gap: 0.75rem;
463
+ padding: 0 1.5rem 1.5rem;
464
+ }
465
+ ._tooltip__positioner_1h5uw_1 {
466
+ height: var(--positioner-height);
467
+ width: var(--positioner-width);
468
+ max-width: var(--available-width);
469
+ }
470
+
471
+ ._tooltip_1h5uw_1 {
472
+ box-sizing: border-box;
473
+ display: inline-flex;
474
+ align-items: center;
475
+ min-height: 2.25rem;
476
+ max-width: min(20rem, calc(100vw - 1.5rem));
477
+ padding: 0.5rem 0.75rem;
478
+ border-radius: var(--radius-semantic-md, 0.5rem);
479
+ background-color: var(--colors-primitive-neutral-0, #ffffff);
480
+ color: var(--colors-primitive-neutral-900, #171717);
481
+ font-family:
482
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
483
+ sans-serif;
484
+ font-size: 0.8125rem;
485
+ line-height: 1.25rem;
486
+ transform-origin: var(--transform-origin);
487
+ transition:
488
+ opacity 150ms ease,
489
+ transform 150ms ease;
490
+
491
+ @media (prefers-color-scheme: light) {
492
+ outline: 1px solid var(--colors-primitive-neutral-200, #e5e5e5);
493
+ box-shadow:
494
+ 0 12px 24px -12px rgb(23 23 23 / 0.22),
495
+ 0 6px 12px -8px rgb(23 23 23 / 0.14);
496
+ }
497
+
498
+ @media (prefers-color-scheme: dark) {
499
+ outline: 1px solid var(--colors-primitive-neutral-300, #d4d4d4);
500
+ outline-offset: -1px;
501
+ }
502
+ }
503
+
504
+ ._tooltip_1h5uw_1[data-starting-style],
505
+ ._tooltip_1h5uw_1[data-ending-style] {
506
+ opacity: 0;
507
+ transform: scale(0.92);
508
+ }
509
+
510
+ ._tooltip_1h5uw_1[data-instant] {
511
+ transition: none;
512
+ }
513
+
514
+ ._tooltip__content_1h5uw_50 {
515
+ display: inline-flex;
516
+ align-items: center;
517
+ }
518
+
519
+ ._tooltip__arrow_1h5uw_55 {
520
+ display: flex;
521
+ }
522
+
523
+ ._tooltip__arrow_1h5uw_55[data-side='top'] {
524
+ bottom: -8px;
525
+ rotate: 180deg;
526
+ }
527
+
528
+ ._tooltip__arrow_1h5uw_55[data-side='bottom'] {
529
+ top: -8px;
530
+ }
531
+
532
+ ._tooltip__arrow_1h5uw_55[data-side='left'] {
533
+ right: -13px;
534
+ rotate: 90deg;
535
+ }
536
+
537
+ ._tooltip__arrow_1h5uw_55[data-side='right'] {
538
+ left: -13px;
539
+ rotate: -90deg;
540
+ }
541
+
542
+ ._tooltip__arrowFill_1h5uw_78 {
543
+ fill: var(--colors-primitive-neutral-0, #ffffff);
544
+ }
545
+
546
+ ._tooltip__arrowOuterStroke_1h5uw_82 {
547
+ @media (prefers-color-scheme: light) {
548
+ fill: var(--colors-primitive-neutral-200, #e5e5e5);
549
+ }
550
+ }
551
+
552
+ ._tooltip__arrowInnerStroke_1h5uw_88 {
553
+ @media (prefers-color-scheme: dark) {
554
+ fill: var(--colors-primitive-neutral-300, #d4d4d4);
555
+ }
556
+ }
@@ -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,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnanpm/ui-components",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "DNA Design System - React UI Components",
5
5
  "author": "DNA Oy",
6
6
  "license": "ISC",
@@ -16,13 +16,17 @@
16
16
  },
17
17
  "./styles.css": "./dist/styles.css"
18
18
  },
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
19
22
  "files": [
20
23
  "dist"
21
24
  ],
22
25
  "scripts": {
23
26
  "build": "tsc --project tsconfig.build.json && vite build",
24
27
  "dev": "vite build --watch",
25
- "test": "vitest run",
28
+ "gen:component": "plop --plopfile ./scripts/template-generators/plopfile.mjs component",
29
+ "test": "vitest run --coverage",
26
30
  "test:watch": "vitest",
27
31
  "format": "prettier --write .",
28
32
  "format:check": "prettier --check .",
@@ -46,6 +50,10 @@
46
50
  "engines": {
47
51
  "node": ">=24"
48
52
  },
53
+ "dependencies": {
54
+ "clsx": "^2.1.1",
55
+ "@base-ui/react": "^1.3.0"
56
+ },
49
57
  "peerDependencies": {
50
58
  "react": "^18.0.0 || ^19.0.0",
51
59
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -55,22 +63,23 @@
55
63
  "@repo/eslint-config": "workspace:*",
56
64
  "@repo/typescript-config": "workspace:*",
57
65
  "@storybook/react-vite": "^10.3.1",
58
- "@storybook/addon-docs": "^10.3.1",
59
66
  "@testing-library/jest-dom": "^6.6.3",
60
67
  "@testing-library/react": "^16.1.0",
61
68
  "@testing-library/user-event": "^14.5.2",
62
69
  "@types/react": "^19.2.14",
63
70
  "@types/react-dom": "^19.2.3",
64
71
  "@vitejs/plugin-react": "^5.1.4",
72
+ "@vitest/coverage-v8": "^4.1.1",
65
73
  "eslint": "^9.39.2",
66
74
  "jsdom": "^28.1.0",
75
+ "plop": "^4.0.5",
67
76
  "prettier": "^3.8.1",
68
77
  "react": "^19.2.4",
69
78
  "react-dom": "^19.2.4",
70
79
  "typescript": "^5.9.3",
71
80
  "vite": "^7.3.1",
72
81
  "vite-plugin-dts": "^4.5.4",
73
- "vitest": "^4.0.18"
82
+ "vitest": "^4.1.1"
74
83
  },
75
84
  "repository": {
76
85
  "type": "git",
@@ -1,6 +0,0 @@
1
- /**
2
- * Utility function to conditionally join class names.
3
- * A minimal alternative to clsx/classnames without external dependencies.
4
- */
5
- export declare function cn(...inputs: (string | undefined | null | false | Record<string, boolean>)[]): string;
6
- //# sourceMappingURL=cn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,EAAE,CACd,GAAG,MAAM,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,GAC3E,MAAM,CAkBR"}