@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,91 @@
1
+ @layer dna-design-system {/**
2
+ * Notification Component Styles
3
+ *
4
+ * Design tokens are consumed via CSS custom properties (variables).
5
+ * These variables come from @dnanpm/design-tokens package.
6
+ */
7
+
8
+ ._notification_1glup_8 {
9
+ display: flex;
10
+ align-items: center;
11
+ gap: var(--spacing-ui-md);
12
+ padding-right: var(--spacing-ui-lg);
13
+ border: 2px solid var(--notification-color);
14
+ border-radius: var(--radius-semantic-sm);
15
+ overflow: clip;
16
+ }
17
+
18
+ /* Variant colors */
19
+ ._notification--info_1glup_19 {
20
+ --notification-color: var(--colors-semantic-status-info);
21
+ }
22
+
23
+ ._notification--success_1glup_23 {
24
+ --notification-color: var(--colors-semantic-status-success);
25
+ }
26
+
27
+ ._notification--warning_1glup_27 {
28
+ --notification-color: var(--colors-semantic-status-warning);
29
+ }
30
+
31
+ ._notification--error_1glup_31 {
32
+ --notification-color: var(--colors-semantic-status-error);
33
+ }
34
+
35
+ /* Icon container */
36
+ ._notification__icon-container_1glup_36 {
37
+ /* The colored area size should be 48x48px on one line content, so we adjust padding based on whether the border is present or not */
38
+ --_icon-padding-with-border: 10px;
39
+ --_icon-padding-without-border: 12px;
40
+
41
+ flex: 0 0 auto;
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ align-self: stretch;
46
+ padding: var(--_icon-padding-with-border) var(--_icon-padding-without-border)
47
+ var(--_icon-padding-with-border) var(--_icon-padding-with-border);
48
+ background-color: var(--notification-color);
49
+ color: var(--colors-semantic-foreground-inverse);
50
+ }
51
+
52
+ ._notification__icon_1glup_36 {
53
+ width: 24px;
54
+ height: 24px;
55
+ flex: 0 0 auto;
56
+ }
57
+
58
+ /* Content */
59
+ ._notification__content_1glup_59 {
60
+ flex: 1 1 auto;
61
+ min-width: 0;
62
+ padding: var(--spacing-ui-xs) 0;
63
+ font-size: 1rem;
64
+ line-height: 1.5;
65
+ color: var(--colors-semantic-foreground-default);
66
+ text-wrap: pretty;
67
+ }
68
+
69
+ /* Close button */
70
+ ._notification__close_1glup_70 {
71
+ flex: 0 0 auto;
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+ width: 32px;
76
+ height: 32px;
77
+ padding: 0;
78
+ /* Negative margin to offset the button's size and maintain consistent spacing with the content */
79
+ margin: 0 calc(var(--spacing-ui-xxs) * -1);
80
+ border: none;
81
+ border-radius: var(--radius-semantic-sm);
82
+ background: none;
83
+ color: var(--colors-semantic-foreground-default);
84
+ cursor: pointer;
85
+ }
86
+
87
+ ._notification__close_1glup_70 svg {
88
+ width: 24px;
89
+ height: 24px;
90
+ }
91
+ }
@@ -0,0 +1,3 @@
1
+ import { NotificationProps } from './Notification.types';
2
+ export declare const Notification: import('react').ForwardRefExoticComponent<NotificationProps & import('react').RefAttributes<HTMLDivElement>>;
3
+ //# sourceMappingURL=Notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,sBAAsB,CAAC;AAgBnF,eAAO,MAAM,YAAY,8GAsCvB,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Error, Warning, Check, Info, Close } from "@dnanpm/icons";
4
+ import focusStyles from "../../styles/utils/focus.module.css.js";
5
+ import styles from "./Notification.module.css.js";
6
+ import { cn } from "../../utils/cn/cn.js";
7
+ const variantIcons = {
8
+ info: Info,
9
+ success: Check,
10
+ warning: Warning,
11
+ error: Error
12
+ };
13
+ const variantRoles = {
14
+ info: "status",
15
+ success: "status",
16
+ warning: "alert",
17
+ error: "alert"
18
+ };
19
+ const Notification = forwardRef(function Notification2({
20
+ variant,
21
+ children,
22
+ closable = false,
23
+ onClose,
24
+ closeLabel = "Sulje ilmoitus",
25
+ className,
26
+ ...props
27
+ }, ref) {
28
+ const Icon = variantIcons[variant];
29
+ const role = variantRoles[variant];
30
+ return /* @__PURE__ */ jsxs(
31
+ "div",
32
+ {
33
+ ref,
34
+ role,
35
+ className: cn(styles.notification, styles[`notification--${variant}`], className),
36
+ ...props,
37
+ children: [
38
+ /* @__PURE__ */ jsx("div", { className: styles["notification__icon-container"], children: /* @__PURE__ */ jsx(Icon, { className: styles.notification__icon, "aria-hidden": "true" }) }),
39
+ /* @__PURE__ */ jsx("div", { className: styles.notification__content, children }),
40
+ closable && /* @__PURE__ */ jsx(
41
+ "button",
42
+ {
43
+ type: "button",
44
+ className: cn(styles.notification__close, focusStyles.focusable),
45
+ onClick: onClose,
46
+ "aria-label": closeLabel,
47
+ children: /* @__PURE__ */ jsx(Close, { "aria-hidden": "true" })
48
+ }
49
+ )
50
+ ]
51
+ }
52
+ );
53
+ });
54
+ Notification.displayName = "Notification";
55
+ export {
56
+ Notification
57
+ };
58
+ //# sourceMappingURL=Notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.js","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import { forwardRef, type ComponentType, type SVGProps } from 'react';\nimport { Check, Close, Error as ErrorIcon, Info, Warning } from '@dnanpm/icons';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport styles from './Notification.module.css';\nimport type { NotificationProps, NotificationVariant } from './Notification.types';\n\nconst variantIcons: Record<NotificationVariant, ComponentType<SVGProps<SVGSVGElement>>> = {\n info: Info,\n success: Check,\n warning: Warning,\n error: ErrorIcon,\n};\n\nconst variantRoles: Record<NotificationVariant, 'status' | 'alert'> = {\n info: 'status',\n success: 'status',\n warning: 'alert',\n error: 'alert',\n};\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(function Notification(\n {\n variant,\n children,\n closable = false,\n onClose,\n closeLabel = 'Sulje ilmoitus',\n className,\n ...props\n },\n ref,\n) {\n const Icon = variantIcons[variant];\n const role = variantRoles[variant];\n\n return (\n <div\n ref={ref}\n role={role}\n className={cn(styles.notification, styles[`notification--${variant}`], className)}\n {...props}\n >\n <div className={styles['notification__icon-container']}>\n <Icon className={styles.notification__icon} aria-hidden=\"true\" />\n </div>\n <div className={styles.notification__content}>{children}</div>\n {closable && (\n <button\n type=\"button\"\n className={cn(styles.notification__close, focusStyles.focusable)}\n onClick={onClose}\n aria-label={closeLabel}\n >\n <Close aria-hidden=\"true\" />\n </button>\n )}\n </div>\n );\n});\n\nNotification.displayName = 'Notification';\n"],"names":["ErrorIcon","Notification"],"mappings":";;;;;;AAOA,MAAM,eAAoF;AAAA,EACtF,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAOA;AACX;AAEA,MAAM,eAAgE;AAAA,EAClE,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX;AAEO,MAAM,eAAe,WAA8C,SAASC,cAC/E;AAAA,EACI;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,GAAG;AACP,GACA,KACF;AACE,QAAM,OAAO,aAAa,OAAO;AACjC,QAAM,OAAO,aAAa,OAAO;AAEjC,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA;AAAA,MACA,WAAW,GAAG,OAAO,cAAc,OAAO,iBAAiB,OAAO,EAAE,GAAG,SAAS;AAAA,MAC/E,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAA,oBAAC,OAAA,EAAI,WAAW,OAAO,8BAA8B,GACjD,UAAA,oBAAC,MAAA,EAAK,WAAW,OAAO,oBAAoB,eAAY,OAAA,CAAO,GACnE;AAAA,QACA,oBAAC,OAAA,EAAI,WAAW,OAAO,uBAAwB,UAAS;AAAA,QACvD,YACG;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,MAAK;AAAA,YACL,WAAW,GAAG,OAAO,qBAAqB,YAAY,SAAS;AAAA,YAC/D,SAAS;AAAA,YACT,cAAY;AAAA,YAEZ,UAAA,oBAAC,OAAA,EAAM,eAAY,OAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9B;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAED,aAAa,cAAc;"}
@@ -0,0 +1,24 @@
1
+ require('./Notification.css');
2
+ "use strict";
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
+ const notification = "_notification_1glup_8";
5
+ const notification__icon = "_notification__icon_1glup_36";
6
+ const notification__content = "_notification__content_1glup_59";
7
+ const notification__close = "_notification__close_1glup_70";
8
+ const styles = {
9
+ notification,
10
+ "notification--info": "_notification--info_1glup_19",
11
+ "notification--success": "_notification--success_1glup_23",
12
+ "notification--warning": "_notification--warning_1glup_27",
13
+ "notification--error": "_notification--error_1glup_31",
14
+ "notification__icon-container": "_notification__icon-container_1glup_36",
15
+ notification__icon,
16
+ notification__content,
17
+ notification__close
18
+ };
19
+ exports.default = styles;
20
+ exports.notification = notification;
21
+ exports.notification__close = notification__close;
22
+ exports.notification__content = notification__content;
23
+ exports.notification__icon = notification__icon;
24
+ //# sourceMappingURL=Notification.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import './Notification.css';
2
+ const notification = "_notification_1glup_8";
3
+ const notification__icon = "_notification__icon_1glup_36";
4
+ const notification__content = "_notification__content_1glup_59";
5
+ const notification__close = "_notification__close_1glup_70";
6
+ const styles = {
7
+ notification,
8
+ "notification--info": "_notification--info_1glup_19",
9
+ "notification--success": "_notification--success_1glup_23",
10
+ "notification--warning": "_notification--warning_1glup_27",
11
+ "notification--error": "_notification--error_1glup_31",
12
+ "notification__icon-container": "_notification__icon-container_1glup_36",
13
+ notification__icon,
14
+ notification__content,
15
+ notification__close
16
+ };
17
+ export {
18
+ styles as default,
19
+ notification,
20
+ notification__close,
21
+ notification__content,
22
+ notification__icon
23
+ };
24
+ //# sourceMappingURL=Notification.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -0,0 +1,40 @@
1
+ import type * as React from 'react';
2
+ export type NotificationVariant = 'info' | 'success' | 'warning' | 'error';
3
+ interface NotificationBaseProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
4
+ /**
5
+ * Visual variant determining the color and icon.
6
+ */
7
+ readonly variant: NotificationVariant;
8
+ /**
9
+ * Notification message content.
10
+ */
11
+ readonly children: React.ReactNode;
12
+ }
13
+ interface NotificationClosableProps extends NotificationBaseProps {
14
+ /**
15
+ * Whether to show the close button.
16
+ */
17
+ readonly closable: true;
18
+ /**
19
+ * Callback fired when the close button is clicked.
20
+ * Required when `closable` is true.
21
+ * The consuming application is responsible for handling dismiss logic.
22
+ */
23
+ readonly onClose: () => void;
24
+ /**
25
+ * Accessible label for the close button.
26
+ */
27
+ readonly closeLabel?: string;
28
+ }
29
+ interface NotificationStaticProps extends NotificationBaseProps {
30
+ /**
31
+ * Whether to show the close button.
32
+ * @default false
33
+ */
34
+ readonly closable?: false;
35
+ readonly onClose?: never;
36
+ readonly closeLabel?: never;
37
+ }
38
+ export type NotificationProps = NotificationClosableProps | NotificationStaticProps;
39
+ export {};
40
+ //# sourceMappingURL=Notification.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.types.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/Notification.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3E,UAAU,qBAAsB,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC3F;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CACtC;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC7D;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,UAAU,uBAAwB,SAAQ,qBAAqB;IAC3D;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;CAC/B;AAED,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Notification } from './Notification';
2
+ export type { NotificationProps, NotificationVariant } from './Notification.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Notification/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,61 @@
1
+ /* DNA Text font definition */
2
+ @font-face {
3
+ font-family: 'DNA Text';
4
+ font-style: normal;
5
+ font-weight: 400;
6
+ font-display: swap;
7
+ src:
8
+ url('https://www.dna.fi/fonts/DNAText-Regular.woff2') format('woff2'),
9
+ url('https://www.dna.fi/fonts/DNAText-Regular.woff') format('woff');
10
+ }
11
+
12
+ @font-face {
13
+ font-family: 'DNA Text';
14
+ font-style: normal;
15
+ font-weight: 500;
16
+ font-display: swap;
17
+ src:
18
+ url('https://www.dna.fi/fonts/DNAText-Medium.woff2') format('woff2'),
19
+ url('https://www.dna.fi/fonts/DNAText-Medium.woff') format('woff');
20
+ }
21
+
22
+ @font-face {
23
+ font-family: 'DNA Text';
24
+ font-style: normal;
25
+ font-weight: 700;
26
+ font-display: swap;
27
+ src:
28
+ url('https://www.dna.fi/fonts/DNAText-Bold.woff2') format('woff2'),
29
+ url('https://www.dna.fi/fonts/DNAText-Bold.woff') format('woff');
30
+ }
31
+
32
+ /* DNA Heading font definition */
33
+ @font-face {
34
+ font-family: 'DNA Heading';
35
+ font-style: normal;
36
+ font-weight: 600;
37
+ font-display: swap;
38
+ src:
39
+ url('https://www.dna.fi/fonts/DNAHeading-DemiBold.woff2') format('woff2'),
40
+ url('https://www.dna.fi/fonts/DNAHeading-DemiBold.woff') format('woff');
41
+ }
42
+
43
+ @font-face {
44
+ font-family: 'DNA Heading';
45
+ font-style: normal;
46
+ font-weight: 700;
47
+ font-display: swap;
48
+ src:
49
+ url('https://www.dna.fi/fonts/DNAHeading-Bold.woff2') format('woff2'),
50
+ url('https://www.dna.fi/fonts/DNAHeading-Bold.woff') format('woff');
51
+ }
52
+
53
+ @font-face {
54
+ font-family: 'DNA Heading';
55
+ font-style: normal;
56
+ font-weight: 900;
57
+ font-display: swap;
58
+ src:
59
+ url('https://www.dna.fi/fonts/DNAHeading-Black.woff2') format('woff2'),
60
+ url('https://www.dna.fi/fonts/DNAHeading-Black.woff') format('woff');
61
+ }
package/dist/index.cjs CHANGED
@@ -1,97 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- function cn(...inputs) {
6
- const classes = [];
7
- for (const input of inputs) {
8
- if (!input) continue;
9
- if (typeof input === "string") {
10
- classes.push(input);
11
- } else if (typeof input === "object") {
12
- for (const [key, value] of Object.entries(input)) {
13
- if (value) {
14
- classes.push(key);
15
- }
16
- }
17
- }
18
- }
19
- return classes.join(" ");
20
- }
21
- const box = "_box_5e7g9_14";
22
- const styles$1 = {
23
- box,
24
- "box--none": "_box--none_5e7g9_23",
25
- "box--low": "_box--low_5e7g9_27",
26
- "box--high": "_box--high_5e7g9_31",
27
- "box--extraHigh": "_box--extraHigh_5e7g9_35"
28
- };
29
- const Box = react.forwardRef(
30
- ({ as: Component = "div", elevation = "none", children, className, ...props }, ref) => {
31
- const classes = cn(styles$1.box, styles$1[`box--${elevation}`], className);
32
- return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: classes, ...props, children });
33
- }
34
- );
35
- Box.displayName = "Box";
36
- const button = "_button_1p878_15";
37
- const styles = {
38
- button,
39
- "button--primary": "_button--primary_1p878_45",
40
- "button--secondary": "_button--secondary_1p878_58",
41
- "button--default": "_button--default_1p878_73",
42
- "button--small": "_button--small_1p878_77",
43
- "button--fullWidth": "_button--fullWidth_1p878_84",
44
- "button--loading": "_button--loading_1p878_89"
45
- };
46
- const Button = react.forwardRef(
47
- (props, ref) => {
48
- const {
49
- as = "button",
50
- variant = "primary",
51
- size = "default",
52
- fullWidth = false,
53
- loading = false,
54
- children,
55
- className,
56
- ...restProps
57
- } = props;
58
- const classes = cn(
59
- styles.button,
60
- styles[`button--${variant}`],
61
- styles[`button--${size}`],
62
- {
63
- [styles["button--fullWidth"]]: fullWidth,
64
- [styles["button--loading"]]: loading
65
- },
66
- className
67
- );
68
- const content = loading ? "Loading..." : children;
69
- if (as === "a") {
70
- return /* @__PURE__ */ jsxRuntime.jsx(
71
- "a",
72
- {
73
- ref,
74
- className: classes,
75
- ...restProps,
76
- children: content
77
- }
78
- );
79
- }
80
- return /* @__PURE__ */ jsxRuntime.jsx(
81
- "button",
82
- {
83
- ref,
84
- type: "button",
85
- className: classes,
86
- ...restProps,
87
- disabled: loading || restProps.disabled,
88
- children: content
89
- }
90
- );
91
- }
92
- );
93
- Button.displayName = "Button";
94
- exports.Box = Box;
95
- exports.Button = Button;
96
- exports.cn = cn;
3
+ ;/* empty css */
4
+ const Accordion = require("./components/Accordion/Accordion.cjs");
5
+ const AccordionItem = require("./components/AccordionItem/AccordionItem.cjs");
6
+ const Breadcrumb = require("./components/Breadcrumb/Breadcrumb.cjs");
7
+ const Label = require("./components/Label/Label.cjs");
8
+ const Notification = require("./components/Notification/Notification.cjs");
9
+ const cn = require("./utils/cn/cn.cjs");
10
+ exports.Accordion = Accordion.Accordion;
11
+ exports.AccordionItem = AccordionItem.AccordionItem;
12
+ exports.Breadcrumb = Breadcrumb.Breadcrumb;
13
+ exports.Label = Label.Label;
14
+ exports.Notification = Notification.Notification;
15
+ exports.cn = cn.cn;
97
16
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/utils/cn.ts","../src/components/Box/Box.tsx","../src/components/Button/Button.tsx"],"sourcesContent":["/**\n * Utility function to conditionally join class names.\n * A minimal alternative to clsx/classnames without external dependencies.\n */\nexport function cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === 'string') {\n classes.push(input);\n } else if (typeof input === 'object') {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n}\n","/**\n * Box Component\n *\n * A versatile container component with elevation (shadow) variants.\n * Can be rendered as any HTML element using the polymorphic `as` prop.\n *\n * Features:\n * - Polymorphic: Render as any element (div, section, article, etc.)\n * - Elevation: Four shadow depth levels (none, low, high, extraHigh)\n * - Ref forwarding supported\n * - Uses design tokens for consistent shadows\n *\n * @example\n * // Basic box with no elevation\n * <Box>Content</Box>\n *\n * // Box with elevation\n * <Box elevation=\"high\">Elevated content</Box>\n *\n * // Box as section element\n * <Box as=\"section\" elevation=\"low\">Section content</Box>\n */\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { BoxProps } from './Box.types';\nimport styles from './Box.module.css';\n\nexport const Box = forwardRef<HTMLElement, BoxProps>(\n ({ as: Component = 'div', elevation = 'none', children, className, ...props }, ref) => {\n const classes = cn(styles.box, styles[`box--${elevation}`], className);\n\n return (\n <Component ref={ref} className={classes} {...props}>\n {children}\n </Component>\n );\n },\n);\n\nBox.displayName = 'Box';\n","/**\n * Button Component\n *\n * This component demonstrates both approaches for using design tokens:\n * 1. CSS Variables: Used in Button.module.css (e.g., var(--colors-primitive-pink-500))\n * 2. JavaScript Imports: Available for programmatic use\n *\n * Features:\n * - Polymorphic: Can render as button or anchor (link)\n * - Variants: primary, secondary\n * - Sizes: default, small\n * - States: loading, disabled\n * - Layout: fullWidth option\n * - Ref forwarding supported\n *\n * @example\n * // Basic button\n * <Button variant=\"primary\">Click me</Button>\n *\n * // As link\n * <Button as=\"a\" href=\"/path\">Navigate</Button>\n *\n * // Loading state\n * <Button loading>Processing...</Button>\n */\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport styles from './Button.module.css';\n\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (props, ref) => {\n const {\n as = 'button',\n variant = 'primary',\n size = 'default',\n fullWidth = false,\n loading = false,\n children,\n className,\n ...restProps\n } = props;\n\n const classes = cn(\n styles.button,\n styles[`button--${variant}`],\n styles[`button--${size}`],\n {\n [styles['button--fullWidth']]: fullWidth,\n [styles['button--loading']]: loading,\n },\n className,\n );\n\n const content = loading ? 'Loading...' : children;\n\n if (as === 'a') {\n return (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n className={classes}\n {...(restProps as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {content}\n </a>\n );\n }\n\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n className={classes}\n {...(restProps as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n disabled={\n loading || (restProps as React.ButtonHTMLAttributes<HTMLButtonElement>).disabled\n }\n >\n {content}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n"],"names":["forwardRef","styles","jsx"],"mappings":";;;;AAIO,SAAS,MACT,QACG;AACN,QAAM,UAAoB,CAAA;AAE1B,aAAW,SAAS,QAAQ;AACxB,QAAI,CAAC,MAAO;AAEZ,QAAI,OAAO,UAAU,UAAU;AAC3B,cAAQ,KAAK,KAAK;AAAA,IACtB,WAAW,OAAO,UAAU,UAAU;AAClC,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC9C,YAAI,OAAO;AACP,kBAAQ,KAAK,GAAG;AAAA,QACpB;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAEA,SAAO,QAAQ,KAAK,GAAG;AAC3B;;;;;;;;;ACIO,MAAM,MAAMA,MAAAA;AAAAA,EACf,CAAC,EAAE,IAAI,YAAY,OAAO,YAAY,QAAQ,UAAU,WAAW,GAAG,MAAA,GAAS,QAAQ;AACnF,UAAM,UAAU,GAAGC,SAAO,KAAKA,SAAO,QAAQ,SAAS,EAAE,GAAG,SAAS;AAErE,0CACK,WAAA,EAAU,KAAU,WAAW,SAAU,GAAG,OACxC,UACL;AAAA,EAER;AACJ;AAEA,IAAI,cAAc;;;;;;;;;;;ACTX,MAAM,SAASD,MAAAA;AAAAA,EAClB,CAAC,OAAO,QAAQ;AACZ,UAAM;AAAA,MACF,KAAK;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACH;AAEJ,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,MACP,OAAO,WAAW,OAAO,EAAE;AAAA,MAC3B,OAAO,WAAW,IAAI,EAAE;AAAA,MACxB;AAAA,QACI,CAAC,OAAO,mBAAmB,CAAC,GAAG;AAAA,QAC/B,CAAC,OAAO,iBAAiB,CAAC,GAAG;AAAA,MAAA;AAAA,MAEjC;AAAA,IAAA;AAGJ,UAAM,UAAU,UAAU,eAAe;AAEzC,QAAI,OAAO,KAAK;AACZ,aACIE,2BAAAA;AAAAA,QAAC;AAAA,QAAA;AAAA,UACG;AAAA,UACA,WAAW;AAAA,UACV,GAAI;AAAA,UAEJ,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGb;AAEA,WACIA,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACG;AAAA,QACA,MAAK;AAAA,QACL,WAAW;AAAA,QACV,GAAI;AAAA,QACL,UACI,WAAY,UAA4D;AAAA,QAG3E,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGb;AACJ;AAEA,OAAO,cAAc;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,13 @@
1
- export { Box } from './components/Box';
2
- export { Button } from './components/Button';
3
- export type { BoxProps, BoxElevation } from './components/Box';
4
- export type { ButtonProps } from './components/Button';
5
- export { cn } from './utils/cn';
1
+ export { Accordion } from './components/Accordion';
2
+ export { AccordionItem } from './components/AccordionItem';
3
+ export { Breadcrumb } from './components/Breadcrumb';
4
+ export { Notification } from './components/Notification';
5
+ export { Label } from './components/Label';
6
+ export type { AccordionProps } from './components/Accordion';
7
+ export type { AccordionItemProps } from './components/AccordionItem';
8
+ export type { BreadcrumbItem, BreadcrumbLinkProps, BreadcrumbProps } from './components/Breadcrumb';
9
+ export type { NotificationProps, NotificationVariant } from './components/Notification';
10
+ export type { LabelProps, LabelVariant } from './components/Label';
11
+ export { cn } from './utils';
12
+ export type { CnDictionary, CnInput } from './utils';
6
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAG5B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAG5B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACpG,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACxF,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,97 +1,16 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- function cn(...inputs) {
4
- const classes = [];
5
- for (const input of inputs) {
6
- if (!input) continue;
7
- if (typeof input === "string") {
8
- classes.push(input);
9
- } else if (typeof input === "object") {
10
- for (const [key, value] of Object.entries(input)) {
11
- if (value) {
12
- classes.push(key);
13
- }
14
- }
15
- }
16
- }
17
- return classes.join(" ");
18
- }
19
- const box = "_box_5e7g9_14";
20
- const styles$1 = {
21
- box,
22
- "box--none": "_box--none_5e7g9_23",
23
- "box--low": "_box--low_5e7g9_27",
24
- "box--high": "_box--high_5e7g9_31",
25
- "box--extraHigh": "_box--extraHigh_5e7g9_35"
26
- };
27
- const Box = forwardRef(
28
- ({ as: Component = "div", elevation = "none", children, className, ...props }, ref) => {
29
- const classes = cn(styles$1.box, styles$1[`box--${elevation}`], className);
30
- return /* @__PURE__ */ jsx(Component, { ref, className: classes, ...props, children });
31
- }
32
- );
33
- Box.displayName = "Box";
34
- const button = "_button_1p878_15";
35
- const styles = {
36
- button,
37
- "button--primary": "_button--primary_1p878_45",
38
- "button--secondary": "_button--secondary_1p878_58",
39
- "button--default": "_button--default_1p878_73",
40
- "button--small": "_button--small_1p878_77",
41
- "button--fullWidth": "_button--fullWidth_1p878_84",
42
- "button--loading": "_button--loading_1p878_89"
43
- };
44
- const Button = forwardRef(
45
- (props, ref) => {
46
- const {
47
- as = "button",
48
- variant = "primary",
49
- size = "default",
50
- fullWidth = false,
51
- loading = false,
52
- children,
53
- className,
54
- ...restProps
55
- } = props;
56
- const classes = cn(
57
- styles.button,
58
- styles[`button--${variant}`],
59
- styles[`button--${size}`],
60
- {
61
- [styles["button--fullWidth"]]: fullWidth,
62
- [styles["button--loading"]]: loading
63
- },
64
- className
65
- );
66
- const content = loading ? "Loading..." : children;
67
- if (as === "a") {
68
- return /* @__PURE__ */ jsx(
69
- "a",
70
- {
71
- ref,
72
- className: classes,
73
- ...restProps,
74
- children: content
75
- }
76
- );
77
- }
78
- return /* @__PURE__ */ jsx(
79
- "button",
80
- {
81
- ref,
82
- type: "button",
83
- className: classes,
84
- ...restProps,
85
- disabled: loading || restProps.disabled,
86
- children: content
87
- }
88
- );
89
- }
90
- );
91
- Button.displayName = "Button";
1
+ /* empty css */
2
+ import { Accordion } from "./components/Accordion/Accordion.js";
3
+ import { AccordionItem } from "./components/AccordionItem/AccordionItem.js";
4
+ import { Breadcrumb } from "./components/Breadcrumb/Breadcrumb.js";
5
+ import { Label } from "./components/Label/Label.js";
6
+ import { Notification } from "./components/Notification/Notification.js";
7
+ import { cn } from "./utils/cn/cn.js";
92
8
  export {
93
- Box,
94
- Button,
9
+ Accordion,
10
+ AccordionItem,
11
+ Breadcrumb,
12
+ Label,
13
+ Notification,
95
14
  cn
96
15
  };
97
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils/cn.ts","../src/components/Box/Box.tsx","../src/components/Button/Button.tsx"],"sourcesContent":["/**\n * Utility function to conditionally join class names.\n * A minimal alternative to clsx/classnames without external dependencies.\n */\nexport function cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === 'string') {\n classes.push(input);\n } else if (typeof input === 'object') {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n}\n","/**\n * Box Component\n *\n * A versatile container component with elevation (shadow) variants.\n * Can be rendered as any HTML element using the polymorphic `as` prop.\n *\n * Features:\n * - Polymorphic: Render as any element (div, section, article, etc.)\n * - Elevation: Four shadow depth levels (none, low, high, extraHigh)\n * - Ref forwarding supported\n * - Uses design tokens for consistent shadows\n *\n * @example\n * // Basic box with no elevation\n * <Box>Content</Box>\n *\n * // Box with elevation\n * <Box elevation=\"high\">Elevated content</Box>\n *\n * // Box as section element\n * <Box as=\"section\" elevation=\"low\">Section content</Box>\n */\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport { BoxProps } from './Box.types';\nimport styles from './Box.module.css';\n\nexport const Box = forwardRef<HTMLElement, BoxProps>(\n ({ as: Component = 'div', elevation = 'none', children, className, ...props }, ref) => {\n const classes = cn(styles.box, styles[`box--${elevation}`], className);\n\n return (\n <Component ref={ref} className={classes} {...props}>\n {children}\n </Component>\n );\n },\n);\n\nBox.displayName = 'Box';\n","/**\n * Button Component\n *\n * This component demonstrates both approaches for using design tokens:\n * 1. CSS Variables: Used in Button.module.css (e.g., var(--colors-primitive-pink-500))\n * 2. JavaScript Imports: Available for programmatic use\n *\n * Features:\n * - Polymorphic: Can render as button or anchor (link)\n * - Variants: primary, secondary\n * - Sizes: default, small\n * - States: loading, disabled\n * - Layout: fullWidth option\n * - Ref forwarding supported\n *\n * @example\n * // Basic button\n * <Button variant=\"primary\">Click me</Button>\n *\n * // As link\n * <Button as=\"a\" href=\"/path\">Navigate</Button>\n *\n * // Loading state\n * <Button loading>Processing...</Button>\n */\n\nimport { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport type { ButtonProps } from './Button.types';\nimport styles from './Button.module.css';\n\nexport const Button = forwardRef<HTMLButtonElement | HTMLAnchorElement, ButtonProps>(\n (props, ref) => {\n const {\n as = 'button',\n variant = 'primary',\n size = 'default',\n fullWidth = false,\n loading = false,\n children,\n className,\n ...restProps\n } = props;\n\n const classes = cn(\n styles.button,\n styles[`button--${variant}`],\n styles[`button--${size}`],\n {\n [styles['button--fullWidth']]: fullWidth,\n [styles['button--loading']]: loading,\n },\n className,\n );\n\n const content = loading ? 'Loading...' : children;\n\n if (as === 'a') {\n return (\n <a\n ref={ref as React.Ref<HTMLAnchorElement>}\n className={classes}\n {...(restProps as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n >\n {content}\n </a>\n );\n }\n\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n className={classes}\n {...(restProps as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n disabled={\n loading || (restProps as React.ButtonHTMLAttributes<HTMLButtonElement>).disabled\n }\n >\n {content}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n"],"names":["styles"],"mappings":";;AAIO,SAAS,MACT,QACG;AACN,QAAM,UAAoB,CAAA;AAE1B,aAAW,SAAS,QAAQ;AACxB,QAAI,CAAC,MAAO;AAEZ,QAAI,OAAO,UAAU,UAAU;AAC3B,cAAQ,KAAK,KAAK;AAAA,IACtB,WAAW,OAAO,UAAU,UAAU;AAClC,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAC9C,YAAI,OAAO;AACP,kBAAQ,KAAK,GAAG;AAAA,QACpB;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAEA,SAAO,QAAQ,KAAK,GAAG;AAC3B;;;;;;;;;ACIO,MAAM,MAAM;AAAA,EACf,CAAC,EAAE,IAAI,YAAY,OAAO,YAAY,QAAQ,UAAU,WAAW,GAAG,MAAA,GAAS,QAAQ;AACnF,UAAM,UAAU,GAAGA,SAAO,KAAKA,SAAO,QAAQ,SAAS,EAAE,GAAG,SAAS;AAErE,+BACK,WAAA,EAAU,KAAU,WAAW,SAAU,GAAG,OACxC,UACL;AAAA,EAER;AACJ;AAEA,IAAI,cAAc;;;;;;;;;;;ACTX,MAAM,SAAS;AAAA,EAClB,CAAC,OAAO,QAAQ;AACZ,UAAM;AAAA,MACF,KAAK;AAAA,MACL,UAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACH;AAEJ,UAAM,UAAU;AAAA,MACZ,OAAO;AAAA,MACP,OAAO,WAAW,OAAO,EAAE;AAAA,MAC3B,OAAO,WAAW,IAAI,EAAE;AAAA,MACxB;AAAA,QACI,CAAC,OAAO,mBAAmB,CAAC,GAAG;AAAA,QAC/B,CAAC,OAAO,iBAAiB,CAAC,GAAG;AAAA,MAAA;AAAA,MAEjC;AAAA,IAAA;AAGJ,UAAM,UAAU,UAAU,eAAe;AAEzC,QAAI,OAAO,KAAK;AACZ,aACI;AAAA,QAAC;AAAA,QAAA;AAAA,UACG;AAAA,UACA,WAAW;AAAA,UACV,GAAI;AAAA,UAEJ,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAGb;AAEA,WACI;AAAA,MAAC;AAAA,MAAA;AAAA,QACG;AAAA,QACA,MAAK;AAAA,QACL,WAAW;AAAA,QACV,GAAI;AAAA,QACL,UACI,WAAY,UAA4D;AAAA,QAG3E,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGb;AACJ;AAEA,OAAO,cAAc;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,28 @@
1
+ @layer dna-design-system {/*
2
+ * TODO: Replace local variables (_elevation-semantic-low, high and extra-high)
3
+ * with official design tokens once elevation tokens are added to the design token set
4
+ */
5
+
6
+ ._elevationLow_1rmn9_6 {
7
+ --_elevation-semantic-low: 0px 2px 16px 0px rgba(18, 18, 18, 0.06);
8
+ --_elevation-style: var(--_elevation-semantic-low);
9
+ }
10
+
11
+ ._elevationHigh_1rmn9_11 {
12
+ --_elevation-semantic-high: 0px 4px 24px 0px rgba(18, 18, 18, 0.08);
13
+ --_elevation-style: var(--_elevation-semantic-high);
14
+ }
15
+
16
+ ._elevationExtraHigh_1rmn9_16 {
17
+ --_elevation-semantic-extra-high: 0px 8px 64px 0px rgba(18, 18, 18, 0.16);
18
+ --_elevation-style: var(--_elevation-semantic-extra-high);
19
+ }
20
+
21
+ ._elevationLow_1rmn9_6,
22
+ ._elevationHigh_1rmn9_11,
23
+ ._elevationExtraHigh_1rmn9_16 {
24
+ border: var(--borderwidth-semantic-xs) solid var(--colors-semantic-border-neutral-base);
25
+ box-shadow: var(--_elevation-style);
26
+ border-radius: var(--radius-semantic-md);
27
+ }
28
+ }