@dnanpm/ui-components 0.1.0 → 0.2.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 (107) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Accordion/Accordion.cjs +9 -3
  3. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  4. package/dist/components/Accordion/Accordion.d.ts +1 -1
  5. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  6. package/dist/components/Accordion/Accordion.js +10 -4
  7. package/dist/components/Accordion/Accordion.js.map +1 -1
  8. package/dist/components/Accordion/Accordion.types.d.ts +2 -2
  9. package/dist/components/Accordion/Accordion.types.d.ts.map +1 -1
  10. package/dist/components/AccordionItem/AccordionItem.cjs +43 -43
  11. package/dist/components/AccordionItem/AccordionItem.cjs.map +1 -1
  12. package/dist/components/AccordionItem/AccordionItem.css +19 -19
  13. package/dist/components/AccordionItem/AccordionItem.d.ts +1 -1
  14. package/dist/components/AccordionItem/AccordionItem.d.ts.map +1 -1
  15. package/dist/components/AccordionItem/AccordionItem.js +43 -43
  16. package/dist/components/AccordionItem/AccordionItem.js.map +1 -1
  17. package/dist/components/AccordionItem/AccordionItem.module.css.cjs +11 -11
  18. package/dist/components/AccordionItem/AccordionItem.module.css.js +11 -11
  19. package/dist/components/AccordionItem/AccordionItem.types.d.ts +2 -2
  20. package/dist/components/AccordionItem/AccordionItem.types.d.ts.map +1 -1
  21. package/dist/components/Breadcrumb/Breadcrumb.cjs +4 -5
  22. package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
  23. package/dist/components/Breadcrumb/Breadcrumb.css +15 -14
  24. package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -1
  25. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  26. package/dist/components/Breadcrumb/Breadcrumb.js +4 -5
  27. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  28. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +6 -6
  29. package/dist/components/Breadcrumb/Breadcrumb.module.css.js +6 -6
  30. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +1 -5
  31. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts.map +1 -1
  32. package/dist/components/Button/Button.cjs +104 -0
  33. package/dist/components/Button/Button.cjs.map +1 -0
  34. package/dist/components/Button/Button.css +182 -0
  35. package/dist/components/Button/Button.d.ts +3 -0
  36. package/dist/components/Button/Button.d.ts.map +1 -0
  37. package/dist/components/Button/Button.js +104 -0
  38. package/dist/components/Button/Button.js.map +1 -0
  39. package/dist/components/Button/Button.module.css.cjs +24 -0
  40. package/dist/components/Button/Button.module.css.cjs.map +1 -0
  41. package/dist/components/Button/Button.module.css.js +24 -0
  42. package/dist/components/Button/Button.module.css.js.map +1 -0
  43. package/dist/components/Button/Button.types.d.ts +84 -0
  44. package/dist/components/Button/Button.types.d.ts.map +1 -0
  45. package/dist/components/Button/index.d.ts +3 -0
  46. package/dist/components/Button/index.d.ts.map +1 -0
  47. package/dist/components/ColorScheme/ColorScheme.cjs +9 -0
  48. package/dist/components/ColorScheme/ColorScheme.cjs.map +1 -0
  49. package/dist/components/ColorScheme/ColorScheme.d.ts +3 -0
  50. package/dist/components/ColorScheme/ColorScheme.d.ts.map +1 -0
  51. package/dist/components/ColorScheme/ColorScheme.js +9 -0
  52. package/dist/components/ColorScheme/ColorScheme.js.map +1 -0
  53. package/dist/components/ColorScheme/ColorScheme.types.d.ts +10 -0
  54. package/dist/components/ColorScheme/ColorScheme.types.d.ts.map +1 -0
  55. package/dist/components/ColorScheme/index.d.ts +3 -0
  56. package/dist/components/ColorScheme/index.d.ts.map +1 -0
  57. package/dist/components/Label/Label.cjs +2 -4
  58. package/dist/components/Label/Label.cjs.map +1 -1
  59. package/dist/components/Label/Label.css +15 -17
  60. package/dist/components/Label/Label.d.ts +1 -1
  61. package/dist/components/Label/Label.d.ts.map +1 -1
  62. package/dist/components/Label/Label.js +2 -4
  63. package/dist/components/Label/Label.js.map +1 -1
  64. package/dist/components/Label/Label.module.css.cjs +7 -7
  65. package/dist/components/Label/Label.module.css.js +7 -7
  66. package/dist/components/Label/Label.types.d.ts +1 -5
  67. package/dist/components/Label/Label.types.d.ts.map +1 -1
  68. package/dist/components/Notification/Notification.cjs +5 -6
  69. package/dist/components/Notification/Notification.cjs.map +1 -1
  70. package/dist/components/Notification/Notification.css +18 -19
  71. package/dist/components/Notification/Notification.d.ts +1 -1
  72. package/dist/components/Notification/Notification.d.ts.map +1 -1
  73. package/dist/components/Notification/Notification.js +5 -6
  74. package/dist/components/Notification/Notification.js.map +1 -1
  75. package/dist/components/Notification/Notification.module.css.cjs +9 -9
  76. package/dist/components/Notification/Notification.module.css.js +9 -9
  77. package/dist/components/Notification/Notification.types.d.ts +1 -1
  78. package/dist/components/Notification/Notification.types.d.ts.map +1 -1
  79. package/dist/components/Spinner/Spinner.cjs +62 -0
  80. package/dist/components/Spinner/Spinner.cjs.map +1 -0
  81. package/dist/components/Spinner/Spinner.css +116 -0
  82. package/dist/components/Spinner/Spinner.d.ts +3 -0
  83. package/dist/components/Spinner/Spinner.d.ts.map +1 -0
  84. package/dist/components/Spinner/Spinner.js +62 -0
  85. package/dist/components/Spinner/Spinner.js.map +1 -0
  86. package/dist/components/Spinner/Spinner.module.css.cjs +26 -0
  87. package/dist/components/Spinner/Spinner.module.css.cjs.map +1 -0
  88. package/dist/components/Spinner/Spinner.module.css.js +26 -0
  89. package/dist/components/Spinner/Spinner.module.css.js.map +1 -0
  90. package/dist/components/Spinner/Spinner.types.d.ts +41 -0
  91. package/dist/components/Spinner/Spinner.types.d.ts.map +1 -0
  92. package/dist/components/Spinner/index.d.ts +3 -0
  93. package/dist/components/Spinner/index.d.ts.map +1 -0
  94. package/dist/index.cjs +6 -0
  95. package/dist/index.cjs.map +1 -1
  96. package/dist/index.d.ts +6 -0
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +6 -0
  99. package/dist/index.js.map +1 -1
  100. package/dist/styles/utils/elevation.css +7 -7
  101. package/dist/styles/utils/elevation.module.css.cjs +1 -1
  102. package/dist/styles/utils/elevation.module.css.js +1 -1
  103. package/dist/styles/utils/focus.css +34 -13
  104. package/dist/styles/utils/focus.module.css.cjs +3 -3
  105. package/dist/styles/utils/focus.module.css.js +3 -3
  106. package/dist/styles.css +330 -171
  107. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, MouseEvent, ReactNode, Ref } from 'react';\nimport { cn } from '../../utils/cn';\nimport focusStyles from '../../styles/utils/focus.module.css';\nimport styles from './Button.module.css';\nimport { Spinner } from '../Spinner';\nimport type { ButtonProps } from './Button.types';\n\nexport const Button = ({\n variant = 'primary',\n fullWidth = false,\n size = 'normal',\n loading = false,\n className,\n children,\n ref,\n ...props\n}: ButtonProps) => {\n const isDisabled = 'disabled' in props && props.disabled;\n const isAnchor = 'href' in props && props.href != null;\n\n const classes = cn(\n styles.button,\n styles[`button--${variant}`],\n { [styles['button--full-width']]: fullWidth },\n styles[`button--${size}`],\n focusStyles.focusable,\n { [styles['button--disabled']]: isDisabled },\n { [styles['button--loading']]: loading },\n className,\n );\n\n const content = (\n <>\n <span className={styles.button__content}>{children}</span>\n {loading && (\n <Spinner\n size={size === 'small' ? 'xs' : 's'}\n color=\"inherit\"\n aria-hidden=\"true\"\n aria-label={undefined}\n role=\"presentation\"\n className={styles.button__spinner}\n />\n )}\n </>\n );\n\n if (isAnchor) {\n const { href, renderLink, ...anchorProps } = props as Omit<\n typeof props,\n 'variant' | 'size' | 'loading'\n > & {\n href: string;\n renderLink?: (\n props: AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n children: ReactNode;\n },\n ) => ReactNode;\n };\n\n const {\n disabled: _disabled,\n type: _type,\n name: _name,\n ...safeAnchorProps\n } = anchorProps as typeof anchorProps & {\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n name?: string;\n };\n\n const target = safeAnchorProps.target;\n const rel = safeAnchorProps.rel;\n const shouldHardenRel = target === '_blank';\n const relTokens = new Set((rel ?? '').split(/\\s+/).filter(Boolean));\n\n if (shouldHardenRel) {\n relTokens.add('noopener');\n relTokens.add('noreferrer');\n }\n\n const hardenedRel = relTokens.size > 0 ? Array.from(relTokens).join(' ') : undefined;\n\n const linkProps = {\n ...safeAnchorProps,\n ref: ref as Ref<HTMLAnchorElement>,\n href,\n rel: hardenedRel,\n className: classes,\n 'aria-busy': loading || undefined,\n 'aria-disabled': loading || undefined,\n tabIndex: loading ? -1 : undefined,\n onClick: loading\n ? (e: MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }\n : safeAnchorProps.onClick,\n children: content,\n };\n\n if (renderLink) {\n return <>{renderLink(linkProps)}</>;\n }\n\n return <a {...linkProps} />;\n }\n\n const {\n type = 'button',\n disabled,\n href: _href,\n target: _target,\n rel: _rel,\n renderLink: _renderLink,\n ...buttonProps\n } = props as Omit<typeof props, 'variant' | 'size' | 'loading' | 'href'> & {\n type?: 'button' | 'submit' | 'reset';\n disabled?: boolean;\n href?: string;\n target?: string;\n rel?: string;\n renderLink?: unknown;\n };\n\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type}\n disabled={disabled || loading}\n className={classes}\n aria-busy={loading || undefined}\n {...buttonProps}\n >\n {content}\n </button>\n );\n};\n"],"names":[],"mappings":";;;;;AAOO,MAAM,SAAS,CAAC;AAAA,EACnB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAAmB;AACf,QAAM,aAAa,cAAc,SAAS,MAAM;AAChD,QAAM,WAAW,UAAU,SAAS,MAAM,QAAQ;AAElD,QAAM,UAAU;AAAA,IACZ,OAAO;AAAA,IACP,OAAO,WAAW,OAAO,EAAE;AAAA,IAC3B,EAAE,CAAC,OAAO,oBAAoB,CAAC,GAAG,UAAA;AAAA,IAClC,OAAO,WAAW,IAAI,EAAE;AAAA,IACxB,YAAY;AAAA,IACZ,EAAE,CAAC,OAAO,kBAAkB,CAAC,GAAG,WAAA;AAAA,IAChC,EAAE,CAAC,OAAO,iBAAiB,CAAC,GAAG,QAAA;AAAA,IAC/B;AAAA,EAAA;AAGJ,QAAM,UACF,qBAAA,UAAA,EACI,UAAA;AAAA,IAAA,oBAAC,QAAA,EAAK,WAAW,OAAO,iBAAkB,UAAS;AAAA,IAClD,WACG;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAM,SAAS,UAAU,OAAO;AAAA,QAChC,OAAM;AAAA,QACN,eAAY;AAAA,QACZ,cAAY;AAAA,QACZ,MAAK;AAAA,QACL,WAAW,OAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EACtB,GAER;AAGJ,MAAI,UAAU;AACV,UAAM,EAAE,MAAM,YAAY,GAAG,gBAAgB;AAa7C,UAAM;AAAA,MACF,UAAU;AAAA,MACV,MAAM;AAAA,MACN,MAAM;AAAA,MACN,GAAG;AAAA,IAAA,IACH;AAMJ,UAAM,SAAS,gBAAgB;AAC/B,UAAM,MAAM,gBAAgB;AAC5B,UAAM,kBAAkB,WAAW;AACnC,UAAM,YAAY,IAAI,KAAK,OAAO,IAAI,MAAM,KAAK,EAAE,OAAO,OAAO,CAAC;AAElE,QAAI,iBAAiB;AACjB,gBAAU,IAAI,UAAU;AACxB,gBAAU,IAAI,YAAY;AAAA,IAC9B;AAEA,UAAM,cAAc,UAAU,OAAO,IAAI,MAAM,KAAK,SAAS,EAAE,KAAK,GAAG,IAAI;AAE3E,UAAM,YAAY;AAAA,MACd,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL,WAAW;AAAA,MACX,aAAa,WAAW;AAAA,MACxB,iBAAiB,WAAW;AAAA,MAC5B,UAAU,UAAU,KAAK;AAAA,MACzB,SAAS,UACH,CAAC,MAAqC;AAClC,UAAE,eAAA;AACF,UAAE,gBAAA;AAAA,MACN,IACA,gBAAgB;AAAA,MACtB,UAAU;AAAA,IAAA;AAGd,QAAI,YAAY;AACZ,aAAO,oBAAA,UAAA,EAAG,UAAA,WAAW,SAAS,GAAE;AAAA,IACpC;AAEA,WAAO,oBAAC,KAAA,EAAG,GAAG,UAAA,CAAW;AAAA,EAC7B;AAEA,QAAM;AAAA,IACF,OAAO;AAAA,IACP;AAAA,IACA,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,GAAG;AAAA,EAAA,IACH;AASJ,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW;AAAA,MACX,aAAW,WAAW;AAAA,MACrB,GAAG;AAAA,MAEH,UAAA;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -0,0 +1,24 @@
1
+ require('./Button.css');
2
+ "use strict";
3
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
+ const button = "_button_188fd_1";
5
+ const button__content = "_button__content_188fd_171";
6
+ const button__spinner = "_button__spinner_188fd_179";
7
+ const styles = {
8
+ button,
9
+ "button--full-width": "_button--full-width_188fd_18",
10
+ "button--normal": "_button--normal_188fd_25",
11
+ "button--small": "_button--small_188fd_32",
12
+ "button--primary": "_button--primary_188fd_41",
13
+ "button--secondary": "_button--secondary_188fd_60",
14
+ "button--tertiary": "_button--tertiary_188fd_85",
15
+ "button--disabled": "_button--disabled_188fd_105",
16
+ "button--loading": "_button--loading_188fd_167",
17
+ button__content,
18
+ button__spinner
19
+ };
20
+ exports.button = button;
21
+ exports.button__content = button__content;
22
+ exports.button__spinner = button__spinner;
23
+ exports.default = styles;
24
+ //# sourceMappingURL=Button.module.css.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.module.css.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import './Button.css';
2
+ const button = "_button_188fd_1";
3
+ const button__content = "_button__content_188fd_171";
4
+ const button__spinner = "_button__spinner_188fd_179";
5
+ const styles = {
6
+ button,
7
+ "button--full-width": "_button--full-width_188fd_18",
8
+ "button--normal": "_button--normal_188fd_25",
9
+ "button--small": "_button--small_188fd_32",
10
+ "button--primary": "_button--primary_188fd_41",
11
+ "button--secondary": "_button--secondary_188fd_60",
12
+ "button--tertiary": "_button--tertiary_188fd_85",
13
+ "button--disabled": "_button--disabled_188fd_105",
14
+ "button--loading": "_button--loading_188fd_167",
15
+ button__content,
16
+ button__spinner
17
+ };
18
+ export {
19
+ button,
20
+ button__content,
21
+ button__spinner,
22
+ styles as default
23
+ };
24
+ //# sourceMappingURL=Button.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -0,0 +1,84 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ /**
3
+ * Visual variant of the Button.
4
+ *
5
+ * - `primary` — Filled pink background. Main call-to-action.
6
+ * - `secondary` — Outlined with secondary (plum) border color.
7
+ * - `tertiary` — Filled neutral background with a neutral border.
8
+ */
9
+ export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
10
+ /**
11
+ * Size variant of the Button.
12
+ *
13
+ * - `normal` — 40px height, 16px bold text.
14
+ * - `small` — 32px height, 14px bold text.
15
+ */
16
+ export type ButtonSize = 'normal' | 'small';
17
+ export interface ButtonLinkProps extends ComponentPropsWithRef<'a'> {
18
+ readonly href: string;
19
+ readonly children: ReactNode;
20
+ }
21
+ interface ButtonBaseProps {
22
+ /**
23
+ * Visual variant determining colors and border style.
24
+ * @default 'primary'
25
+ */
26
+ readonly variant?: ButtonVariant;
27
+ /**
28
+ * Whether the button should stretch to fill the available width.
29
+ * @default false
30
+ */
31
+ readonly fullWidth?: boolean;
32
+ /**
33
+ * Size variant controlling height and font size.
34
+ * @default 'normal'
35
+ */
36
+ readonly size?: ButtonSize;
37
+ /**
38
+ * Whether the button is in a loading state.
39
+ * When true, the button content remains visible and a spinner is shown.
40
+ * The button remains non-interactive during loading.
41
+ * @default false
42
+ */
43
+ readonly loading?: boolean;
44
+ }
45
+ export type ButtonAsButton = ButtonBaseProps & Omit<ComponentPropsWithRef<'button'>, keyof ButtonBaseProps> & {
46
+ /** When omitted, the element renders as a `<button>`. */
47
+ readonly href?: never;
48
+ /** Anchor-only props are intentionally unsupported in button mode. */
49
+ readonly target?: never;
50
+ readonly rel?: never;
51
+ readonly renderLink?: never;
52
+ };
53
+ export type ButtonAsAnchor = ButtonBaseProps & Omit<ComponentPropsWithRef<'a'>, keyof ButtonBaseProps> & {
54
+ /** When `href` is provided, the element renders as an `<a>`. */
55
+ readonly href: string;
56
+ /** Button-only props are intentionally unsupported in anchor mode. */
57
+ readonly disabled?: never;
58
+ readonly type?: never;
59
+ readonly name?: never;
60
+ /**
61
+ * Custom render function for the link element. Use this to integrate with
62
+ * client-side routing libraries like Next.js or React Router.
63
+ *
64
+ * @example
65
+ * // Next.js
66
+ * import Link from 'next/link';
67
+ * <Button href="/page" renderLink={(props) => <Link {...props} />}>Navigate</Button>
68
+ *
69
+ * @example
70
+ * // React Router
71
+ * import { Link } from 'react-router-dom';
72
+ * <Button href="/page" renderLink={({ href, ...props }) => <Link to={href} {...props} />}>Navigate</Button>
73
+ */
74
+ readonly renderLink?: (props: ButtonLinkProps) => ReactNode;
75
+ };
76
+ /**
77
+ * Props for the Button component.
78
+ *
79
+ * When `href` is provided the component renders as an `<a>` element;
80
+ * otherwise it renders as a `<button>`.
81
+ */
82
+ export type ButtonProps = ButtonAsButton | ButtonAsAnchor;
83
+ export {};
84
+ //# sourceMappingURL=Button.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.types.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE5C,MAAM,WAAW,eAAgB,SAAQ,qBAAqB,CAAC,GAAG,CAAC;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAChC;AAED,UAAU,eAAe;IACrB;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,GACxC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM,eAAe,CAAC,GAAG;IAC3D,yDAAyD;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;IACxB,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;CAC/B,CAAC;AAEN,MAAM,MAAM,cAAc,GAAG,eAAe,GACxC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE,MAAM,eAAe,CAAC,GAAG;IACtD,gEAAgE;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAC;CAC/D,CAAC;AAEN;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Button } from './Button';
2
+ export type { ButtonProps, ButtonLinkProps, ButtonVariant, ButtonSize } from './Button.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
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,eAAe,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const cn = require("../../utils/cn/cn.cjs");
5
+ const ColorScheme = ({ scheme, className, children, ref, ...props }) => {
6
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, ...props, "data-color-scheme": scheme, className: cn.cn(className), children });
7
+ };
8
+ exports.ColorScheme = ColorScheme;
9
+ //# sourceMappingURL=ColorScheme.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorScheme.cjs","sources":["../../../src/components/ColorScheme/ColorScheme.tsx"],"sourcesContent":["import { cn } from '../../utils/cn';\nimport type { ColorSchemeProps } from './ColorScheme.types';\n\nexport const ColorScheme = ({ scheme, className, children, ref, ...props }: ColorSchemeProps) => {\n return (\n <div ref={ref} {...props} data-color-scheme={scheme} className={cn(className)}>\n {children}\n </div>\n );\n};\n"],"names":["jsx","cn"],"mappings":";;;;AAGO,MAAM,cAAc,CAAC,EAAE,QAAQ,WAAW,UAAU,KAAK,GAAG,YAA8B;AAC7F,SACIA,2BAAAA,IAAC,OAAA,EAAI,KAAW,GAAG,OAAO,qBAAmB,QAAQ,WAAWC,GAAAA,GAAG,SAAS,GACvE,SAAA,CACL;AAER;;"}
@@ -0,0 +1,3 @@
1
+ import { ColorSchemeProps } from './ColorScheme.types';
2
+ export declare const ColorScheme: ({ scheme, className, children, ref, ...props }: ColorSchemeProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=ColorScheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorScheme.d.ts","sourceRoot":"","sources":["../../../src/components/ColorScheme/ColorScheme.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,GAAI,gDAAgD,gBAAgB,4CAM3F,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn/cn.js";
3
+ const ColorScheme = ({ scheme, className, children, ref, ...props }) => {
4
+ return /* @__PURE__ */ jsx("div", { ref, ...props, "data-color-scheme": scheme, className: cn(className), children });
5
+ };
6
+ export {
7
+ ColorScheme
8
+ };
9
+ //# sourceMappingURL=ColorScheme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorScheme.js","sources":["../../../src/components/ColorScheme/ColorScheme.tsx"],"sourcesContent":["import { cn } from '../../utils/cn';\nimport type { ColorSchemeProps } from './ColorScheme.types';\n\nexport const ColorScheme = ({ scheme, className, children, ref, ...props }: ColorSchemeProps) => {\n return (\n <div ref={ref} {...props} data-color-scheme={scheme} className={cn(className)}>\n {children}\n </div>\n );\n};\n"],"names":[],"mappings":";;AAGO,MAAM,cAAc,CAAC,EAAE,QAAQ,WAAW,UAAU,KAAK,GAAG,YAA8B;AAC7F,SACI,oBAAC,OAAA,EAAI,KAAW,GAAG,OAAO,qBAAmB,QAAQ,WAAW,GAAG,SAAS,GACvE,SAAA,CACL;AAER;"}
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ export type ColorSchemeValue = 'light' | 'dark';
3
+ export interface ColorSchemeProps extends ComponentPropsWithRef<'div'> {
4
+ /**
5
+ * The color scheme to apply to children.
6
+ * Components within will adapt their colors accordingly.
7
+ */
8
+ readonly scheme: ColorSchemeValue;
9
+ }
10
+ //# sourceMappingURL=ColorScheme.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorScheme.types.d.ts","sourceRoot":"","sources":["../../../src/components/ColorScheme/ColorScheme.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhD,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IAClE;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;CACrC"}
@@ -0,0 +1,3 @@
1
+ export { ColorScheme } from './ColorScheme';
2
+ export type { ColorSchemeProps, ColorSchemeValue } from './ColorScheme.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ColorScheme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
4
  const Label_module = require("./Label.module.css.cjs");
6
5
  const cn = require("../../utils/cn/cn.cjs");
7
- const Label = react.forwardRef(function Label2({ variant = "default", className, children, ...props }, ref) {
6
+ const Label = ({ variant = "default", className, children, ref, ...props }) => {
8
7
  return /* @__PURE__ */ jsxRuntime.jsx(
9
8
  "span",
10
9
  {
@@ -14,7 +13,6 @@ const Label = react.forwardRef(function Label2({ variant = "default", className,
14
13
  children
15
14
  }
16
15
  );
17
- });
18
- Label.displayName = "Label";
16
+ };
19
17
  exports.Label = Label;
20
18
  //# sourceMappingURL=Label.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.cjs","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport styles from './Label.module.css';\nimport type { LabelProps } from './Label.types';\n\nexport const Label = forwardRef<HTMLSpanElement, LabelProps>(function Label(\n { variant = 'default', className, children, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cn(styles.label, styles[`label--${variant}`], className)}\n {...props}\n >\n {children}\n </span>\n );\n});\n\nLabel.displayName = 'Label';\n"],"names":["forwardRef","Label","jsx","cn","styles"],"mappings":";;;;;;AAKO,MAAM,QAAQA,MAAAA,WAAwC,SAASC,OAClE,EAAE,UAAU,WAAW,WAAW,UAAU,GAAG,MAAA,GAC/C,KACF;AACE,SACIC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA,WAAWC,GAAAA,GAAGC,aAAAA,QAAO,OAAOA,aAAAA,QAAO,UAAU,OAAO,EAAE,GAAG,SAAS;AAAA,MACjE,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGb,CAAC;AAED,MAAM,cAAc;;"}
1
+ {"version":3,"file":"Label.cjs","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import { cn } from '../../utils/cn';\nimport styles from './Label.module.css';\nimport type { LabelProps } from './Label.types';\n\nexport const Label = ({ variant = 'default', className, children, ref, ...props }: LabelProps) => {\n return (\n <span\n ref={ref}\n className={cn(styles.label, styles[`label--${variant}`], className)}\n {...props}\n >\n {children}\n </span>\n );\n};\n"],"names":["jsx","cn","styles"],"mappings":";;;;;AAIO,MAAM,QAAQ,CAAC,EAAE,UAAU,WAAW,WAAW,UAAU,KAAK,GAAG,YAAwB;AAC9F,SACIA,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA,WAAWC,GAAAA,GAAGC,aAAAA,QAAO,OAAOA,aAAAA,QAAO,UAAU,OAAO,EAAE,GAAG,SAAS;AAAA,MACjE,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGb;;"}
@@ -1,40 +1,38 @@
1
- @layer dna-design-system {._label_sogft_1 {
1
+ @layer dna-design-system {._label_1bsev_1 {
2
2
  display: inline-block;
3
3
  max-width: 100%;
4
4
  padding: var(--spacing-ui-xxs) var(--spacing-ui-lg);
5
5
  border-radius: var(--radius-semantic-full);
6
- font-size: 0.875rem;
7
- font-weight: 700;
8
- line-height: 1;
6
+ font: var(--typography-label-md-bold);
9
7
  text-align: center;
10
8
  text-transform: uppercase;
11
9
  white-space: nowrap;
12
10
  overflow: hidden;
13
11
  text-overflow: ellipsis;
14
- color: var(--colors-semantic-foreground-default);
12
+ color: var(--color-semantic-foreground-default);
15
13
  }
16
14
 
17
- ._label--default_sogft_17 {
18
- background-color: var(--colors-semantic-surface-base);
15
+ ._label--default_1bsev_15 {
16
+ background-color: var(--color-semantic-surface-base);
19
17
  }
20
18
 
21
- ._label--campaign_sogft_21 {
22
- background-color: var(--colors-semantic-surface-primary-mid);
19
+ ._label--campaign_1bsev_19 {
20
+ background-color: var(--color-semantic-surface-primary-mid);
23
21
  }
24
22
 
25
- ._label--new_sogft_25 {
26
- background-color: var(--colors-semantic-accent-lemon-500);
23
+ ._label--new_1bsev_23 {
24
+ background-color: var(--color-semantic-accent-lemon-strong);
27
25
  }
28
26
 
29
- ._label--presale_sogft_29 {
30
- background-color: var(--colors-semantic-accent-orange-500);
27
+ ._label--presale_1bsev_27 {
28
+ background-color: var(--color-semantic-accent-orange-strong);
31
29
  }
32
30
 
33
- ._label--soldout_sogft_33 {
34
- background-color: var(--colors-semantic-surface-neutral-strong);
31
+ ._label--soldout_1bsev_31 {
32
+ background-color: var(--color-semantic-surface-neutral-strong);
35
33
  }
36
34
 
37
- ._label--other_sogft_37 {
38
- background-color: var(--colors-semantic-accent-sky-500);
35
+ ._label--other_1bsev_35 {
36
+ background-color: var(--color-semantic-accent-sky-strong);
39
37
  }
40
38
  }
@@ -1,3 +1,3 @@
1
1
  import { LabelProps } from './Label.types';
2
- export declare const Label: import('react').ForwardRefExoticComponent<LabelProps & import('react').RefAttributes<HTMLSpanElement>>;
2
+ export declare const Label: ({ variant, className, children, ref, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=Label.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,KAAK,wGAahB,CAAC"}
1
+ {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,eAAO,MAAM,KAAK,GAAI,iDAA6D,UAAU,4CAU5F,CAAC"}
@@ -1,8 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import styles from "./Label.module.css.js";
4
3
  import { cn } from "../../utils/cn/cn.js";
5
- const Label = forwardRef(function Label2({ variant = "default", className, children, ...props }, ref) {
4
+ const Label = ({ variant = "default", className, children, ref, ...props }) => {
6
5
  return /* @__PURE__ */ jsx(
7
6
  "span",
8
7
  {
@@ -12,8 +11,7 @@ const Label = forwardRef(function Label2({ variant = "default", className, child
12
11
  children
13
12
  }
14
13
  );
15
- });
16
- Label.displayName = "Label";
14
+ };
17
15
  export {
18
16
  Label
19
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { cn } from '../../utils/cn';\nimport styles from './Label.module.css';\nimport type { LabelProps } from './Label.types';\n\nexport const Label = forwardRef<HTMLSpanElement, LabelProps>(function Label(\n { variant = 'default', className, children, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cn(styles.label, styles[`label--${variant}`], className)}\n {...props}\n >\n {children}\n </span>\n );\n});\n\nLabel.displayName = 'Label';\n"],"names":["Label"],"mappings":";;;;AAKO,MAAM,QAAQ,WAAwC,SAASA,OAClE,EAAE,UAAU,WAAW,WAAW,UAAU,GAAG,MAAA,GAC/C,KACF;AACE,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA,WAAW,GAAG,OAAO,OAAO,OAAO,UAAU,OAAO,EAAE,GAAG,SAAS;AAAA,MACjE,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGb,CAAC;AAED,MAAM,cAAc;"}
1
+ {"version":3,"file":"Label.js","sources":["../../../src/components/Label/Label.tsx"],"sourcesContent":["import { cn } from '../../utils/cn';\nimport styles from './Label.module.css';\nimport type { LabelProps } from './Label.types';\n\nexport const Label = ({ variant = 'default', className, children, ref, ...props }: LabelProps) => {\n return (\n <span\n ref={ref}\n className={cn(styles.label, styles[`label--${variant}`], className)}\n {...props}\n >\n {children}\n </span>\n );\n};\n"],"names":[],"mappings":";;;AAIO,MAAM,QAAQ,CAAC,EAAE,UAAU,WAAW,WAAW,UAAU,KAAK,GAAG,YAAwB;AAC9F,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA,WAAW,GAAG,OAAO,OAAO,OAAO,UAAU,OAAO,EAAE,GAAG,SAAS;AAAA,MACjE,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGb;"}
@@ -1,15 +1,15 @@
1
1
  require('./Label.css');
2
2
  "use strict";
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
- const label = "_label_sogft_1";
4
+ const label = "_label_1bsev_1";
5
5
  const styles = {
6
6
  label,
7
- "label--default": "_label--default_sogft_17",
8
- "label--campaign": "_label--campaign_sogft_21",
9
- "label--new": "_label--new_sogft_25",
10
- "label--presale": "_label--presale_sogft_29",
11
- "label--soldout": "_label--soldout_sogft_33",
12
- "label--other": "_label--other_sogft_37"
7
+ "label--default": "_label--default_1bsev_15",
8
+ "label--campaign": "_label--campaign_1bsev_19",
9
+ "label--new": "_label--new_1bsev_23",
10
+ "label--presale": "_label--presale_1bsev_27",
11
+ "label--soldout": "_label--soldout_1bsev_31",
12
+ "label--other": "_label--other_1bsev_35"
13
13
  };
14
14
  exports.default = styles;
15
15
  exports.label = label;
@@ -1,13 +1,13 @@
1
1
  import './Label.css';
2
- const label = "_label_sogft_1";
2
+ const label = "_label_1bsev_1";
3
3
  const styles = {
4
4
  label,
5
- "label--default": "_label--default_sogft_17",
6
- "label--campaign": "_label--campaign_sogft_21",
7
- "label--new": "_label--new_sogft_25",
8
- "label--presale": "_label--presale_sogft_29",
9
- "label--soldout": "_label--soldout_sogft_33",
10
- "label--other": "_label--other_sogft_37"
5
+ "label--default": "_label--default_1bsev_15",
6
+ "label--campaign": "_label--campaign_1bsev_19",
7
+ "label--new": "_label--new_1bsev_23",
8
+ "label--presale": "_label--presale_1bsev_27",
9
+ "label--soldout": "_label--soldout_1bsev_31",
10
+ "label--other": "_label--other_1bsev_35"
11
11
  };
12
12
  export {
13
13
  styles as default,
@@ -10,7 +10,7 @@ import type * as React from 'react';
10
10
  * - `other` — Blue. Indicates anything else, e.g. special technical properties.
11
11
  */
12
12
  export type LabelVariant = 'default' | 'campaign' | 'new' | 'presale' | 'soldout' | 'other';
13
- export interface LabelProps extends React.ComponentPropsWithoutRef<'span'> {
13
+ export interface LabelProps extends React.ComponentPropsWithRef<'span'> {
14
14
  /**
15
15
  * The visible text content of the label.
16
16
  */
@@ -20,9 +20,5 @@ export interface LabelProps extends React.ComponentPropsWithoutRef<'span'> {
20
20
  * @default 'default'
21
21
  */
22
22
  readonly variant?: LabelVariant;
23
- /**
24
- * Custom className to apply to the root element.
25
- */
26
- readonly className?: string;
27
23
  }
28
24
  //# sourceMappingURL=Label.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.types.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5F,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC;IACtE;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC/B"}
1
+ {"version":3,"file":"Label.types.d.ts","sourceRoot":"","sources":["../../../src/components/Label/Label.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5F,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC;IACnE;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;CACnC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
4
  const icons = require("@dnanpm/icons");
6
5
  const focus_module = require("../../styles/utils/focus.module.css.cjs");
7
6
  const Notification_module = require("./Notification.module.css.cjs");
@@ -18,24 +17,25 @@ const variantRoles = {
18
17
  warning: "alert",
19
18
  error: "alert"
20
19
  };
21
- const Notification = react.forwardRef(function Notification2({
20
+ const Notification = ({
22
21
  variant,
23
22
  children,
24
23
  closable = false,
25
24
  onClose,
26
25
  closeLabel = "Sulje ilmoitus",
27
26
  className,
27
+ ref,
28
28
  ...props
29
- }, ref) {
29
+ }) => {
30
30
  const Icon = variantIcons[variant];
31
31
  const role = variantRoles[variant];
32
32
  return /* @__PURE__ */ jsxRuntime.jsxs(
33
33
  "div",
34
34
  {
35
+ ...props,
35
36
  ref,
36
37
  role,
37
38
  className: cn.cn(Notification_module.default.notification, Notification_module.default[`notification--${variant}`], className),
38
- ...props,
39
39
  children: [
40
40
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: Notification_module.default["notification__icon-container"], children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: Notification_module.default.notification__icon, "aria-hidden": "true" }) }),
41
41
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: Notification_module.default.notification__content, children }),
@@ -52,7 +52,6 @@ const Notification = react.forwardRef(function Notification2({
52
52
  ]
53
53
  }
54
54
  );
55
- });
56
- Notification.displayName = "Notification";
55
+ };
57
56
  exports.Notification = Notification;
58
57
  //# sourceMappingURL=Notification.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.cjs","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":["Info","Check","Warning","ErrorIcon","forwardRef","Notification","jsxs","cn","styles","jsx","focusStyles","Close"],"mappings":";;;;;;;;AAOA,MAAM,eAAoF;AAAA,EACtF,MAAMA,MAAAA;AAAAA,EACN,SAASC,MAAAA;AAAAA,EACT,SAASC,MAAAA;AAAAA,EACT,OAAOC,MAAAA;AACX;AAEA,MAAM,eAAgE;AAAA,EAClE,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX;AAEO,MAAM,eAAeC,MAAAA,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,SACIC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACG;AAAA,MACA;AAAA,MACA,WAAWC,GAAAA,GAAGC,oBAAAA,QAAO,cAAcA,oBAAAA,QAAO,iBAAiB,OAAO,EAAE,GAAG,SAAS;AAAA,MAC/E,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAAC,2BAAAA,IAAC,OAAA,EAAI,WAAWD,oBAAAA,QAAO,8BAA8B,GACjD,UAAAC,2BAAAA,IAAC,MAAA,EAAK,WAAWD,4BAAO,oBAAoB,eAAY,OAAA,CAAO,GACnE;AAAA,QACAC,2BAAAA,IAAC,OAAA,EAAI,WAAWD,oBAAAA,QAAO,uBAAwB,UAAS;AAAA,QACvD,YACGC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACG,MAAK;AAAA,YACL,WAAWF,GAAAA,GAAGC,oBAAAA,QAAO,qBAAqBE,aAAAA,QAAY,SAAS;AAAA,YAC/D,SAAS;AAAA,YACT,cAAY;AAAA,YAEZ,UAAAD,2BAAAA,IAACE,MAAAA,OAAA,EAAM,eAAY,OAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9B;AAAA,IAAA;AAAA,EAAA;AAIhB,CAAC;AAED,aAAa,cAAc;;"}
1
+ {"version":3,"file":"Notification.cjs","sources":["../../../src/components/Notification/Notification.tsx"],"sourcesContent":["import type { ComponentType, 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 = ({\n variant,\n children,\n closable = false,\n onClose,\n closeLabel = 'Sulje ilmoitus',\n className,\n ref,\n ...props\n}: NotificationProps) => {\n const Icon = variantIcons[variant];\n const role = variantRoles[variant];\n\n return (\n <div\n {...props}\n ref={ref}\n role={role}\n className={cn(styles.notification, styles[`notification--${variant}`], className)}\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"],"names":["Info","Check","Warning","ErrorIcon","jsxs","cn","styles","jsx","focusStyles","Close"],"mappings":";;;;;;;AAOA,MAAM,eAAoF;AAAA,EACtF,MAAMA,MAAAA;AAAAA,EACN,SAASC,MAAAA;AAAAA,EACT,SAASC,MAAAA;AAAAA,EACT,OAAOC,MAAAA;AACX;AAEA,MAAM,eAAgE;AAAA,EAClE,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACX;AAEO,MAAM,eAAe,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,GAAG;AACP,MAAyB;AACrB,QAAM,OAAO,aAAa,OAAO;AACjC,QAAM,OAAO,aAAa,OAAO;AAEjC,SACIC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAWC,GAAAA,GAAGC,oBAAAA,QAAO,cAAcA,oBAAAA,QAAO,iBAAiB,OAAO,EAAE,GAAG,SAAS;AAAA,MAEhF,UAAA;AAAA,QAAAC,2BAAAA,IAAC,OAAA,EAAI,WAAWD,oBAAAA,QAAO,8BAA8B,GACjD,UAAAC,2BAAAA,IAAC,MAAA,EAAK,WAAWD,4BAAO,oBAAoB,eAAY,OAAA,CAAO,GACnE;AAAA,QACAC,2BAAAA,IAAC,OAAA,EAAI,WAAWD,oBAAAA,QAAO,uBAAwB,UAAS;AAAA,QACvD,YACGC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACG,MAAK;AAAA,YACL,WAAWF,GAAAA,GAAGC,oBAAAA,QAAO,qBAAqBE,aAAAA,QAAY,SAAS;AAAA,YAC/D,SAAS;AAAA,YACT,cAAY;AAAA,YAEZ,UAAAD,2BAAAA,IAACE,MAAAA,OAAA,EAAM,eAAY,OAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,MAC9B;AAAA,IAAA;AAAA,EAAA;AAIhB;;"}
@@ -5,7 +5,7 @@
5
5
  * These variables come from @dnanpm/design-tokens package.
6
6
  */
7
7
 
8
- ._notification_1glup_8 {
8
+ ._notification_5h3rs_8 {
9
9
  display: flex;
10
10
  align-items: center;
11
11
  gap: var(--spacing-ui-md);
@@ -16,24 +16,24 @@
16
16
  }
17
17
 
18
18
  /* Variant colors */
19
- ._notification--info_1glup_19 {
20
- --notification-color: var(--colors-semantic-status-info);
19
+ ._notification--info_5h3rs_19 {
20
+ --notification-color: var(--color-semantic-status-info);
21
21
  }
22
22
 
23
- ._notification--success_1glup_23 {
24
- --notification-color: var(--colors-semantic-status-success);
23
+ ._notification--success_5h3rs_23 {
24
+ --notification-color: var(--color-semantic-status-success);
25
25
  }
26
26
 
27
- ._notification--warning_1glup_27 {
28
- --notification-color: var(--colors-semantic-status-warning);
27
+ ._notification--warning_5h3rs_27 {
28
+ --notification-color: var(--color-semantic-status-warning);
29
29
  }
30
30
 
31
- ._notification--error_1glup_31 {
32
- --notification-color: var(--colors-semantic-status-error);
31
+ ._notification--error_5h3rs_31 {
32
+ --notification-color: var(--color-semantic-status-error);
33
33
  }
34
34
 
35
35
  /* Icon container */
36
- ._notification__icon-container_1glup_36 {
36
+ ._notification__icon-container_5h3rs_36 {
37
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
38
  --_icon-padding-with-border: 10px;
39
39
  --_icon-padding-without-border: 12px;
@@ -46,28 +46,27 @@
46
46
  padding: var(--_icon-padding-with-border) var(--_icon-padding-without-border)
47
47
  var(--_icon-padding-with-border) var(--_icon-padding-with-border);
48
48
  background-color: var(--notification-color);
49
- color: var(--colors-semantic-foreground-inverse);
49
+ color: var(--color-semantic-foreground-inverse);
50
50
  }
51
51
 
52
- ._notification__icon_1glup_36 {
52
+ ._notification__icon_5h3rs_36 {
53
53
  width: 24px;
54
54
  height: 24px;
55
55
  flex: 0 0 auto;
56
56
  }
57
57
 
58
58
  /* Content */
59
- ._notification__content_1glup_59 {
59
+ ._notification__content_5h3rs_59 {
60
60
  flex: 1 1 auto;
61
61
  min-width: 0;
62
62
  padding: var(--spacing-ui-xs) 0;
63
- font-size: 1rem;
64
- line-height: 1.5;
65
- color: var(--colors-semantic-foreground-default);
63
+ font: var(--typography-body-md);
64
+ color: var(--color-semantic-foreground-default);
66
65
  text-wrap: pretty;
67
66
  }
68
67
 
69
68
  /* Close button */
70
- ._notification__close_1glup_70 {
69
+ ._notification__close_5h3rs_69 {
71
70
  flex: 0 0 auto;
72
71
  display: flex;
73
72
  align-items: center;
@@ -80,11 +79,11 @@
80
79
  border: none;
81
80
  border-radius: var(--radius-semantic-sm);
82
81
  background: none;
83
- color: var(--colors-semantic-foreground-default);
82
+ color: var(--color-semantic-foreground-default);
84
83
  cursor: pointer;
85
84
  }
86
85
 
87
- ._notification__close_1glup_70 svg {
86
+ ._notification__close_5h3rs_69 svg {
88
87
  width: 24px;
89
88
  height: 24px;
90
89
  }
@@ -1,3 +1,3 @@
1
1
  import { NotificationProps } from './Notification.types';
2
- export declare const Notification: import('react').ForwardRefExoticComponent<NotificationProps & import('react').RefAttributes<HTMLDivElement>>;
2
+ export declare const Notification: ({ variant, children, closable, onClose, closeLabel, className, ref, ...props }: NotificationProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=Notification.d.ts.map
@@ -1 +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"}
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,GAAI,gFAS1B,iBAAiB,4CA2BnB,CAAC"}