@dnanpm/ui-components 0.9.0 → 0.10.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 (240) hide show
  1. package/README.md +13 -0
  2. package/dist/components/Accordion/Accordion.css +5 -1
  3. package/dist/components/AccordionItem/AccordionItem.cjs +4 -4
  4. package/dist/components/AccordionItem/AccordionItem.cjs.map +1 -1
  5. package/dist/components/AccordionItem/AccordionItem.css +4 -1
  6. package/dist/components/AccordionItem/AccordionItem.d.ts.map +1 -1
  7. package/dist/components/AccordionItem/AccordionItem.js +2 -2
  8. package/dist/components/AccordionItem/AccordionItem.js.map +1 -1
  9. package/dist/components/Avatar/Avatar.cjs +83 -0
  10. package/dist/components/Avatar/Avatar.cjs.map +1 -0
  11. package/dist/components/Avatar/Avatar.css +188 -0
  12. package/dist/components/Avatar/Avatar.d.ts +3 -0
  13. package/dist/components/Avatar/Avatar.d.ts.map +1 -0
  14. package/dist/components/Avatar/Avatar.js +83 -0
  15. package/dist/components/Avatar/Avatar.js.map +1 -0
  16. package/dist/components/Avatar/Avatar.module.css.cjs +40 -0
  17. package/dist/components/Avatar/Avatar.module.css.cjs.map +1 -0
  18. package/dist/components/Avatar/Avatar.module.css.js +40 -0
  19. package/dist/components/Avatar/Avatar.module.css.js.map +1 -0
  20. package/dist/components/Avatar/Avatar.types.d.ts +66 -0
  21. package/dist/components/Avatar/Avatar.types.d.ts.map +1 -0
  22. package/dist/components/Avatar/Avatar.utils.cjs +17 -0
  23. package/dist/components/Avatar/Avatar.utils.cjs.map +1 -0
  24. package/dist/components/Avatar/Avatar.utils.d.ts +6 -0
  25. package/dist/components/Avatar/Avatar.utils.d.ts.map +1 -0
  26. package/dist/components/Avatar/Avatar.utils.js +17 -0
  27. package/dist/components/Avatar/Avatar.utils.js.map +1 -0
  28. package/dist/components/Avatar/index.d.ts +3 -0
  29. package/dist/components/Avatar/index.d.ts.map +1 -0
  30. package/dist/components/Breadcrumb/Breadcrumb.cjs +9 -12
  31. package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
  32. package/dist/components/Breadcrumb/Breadcrumb.css +16 -16
  33. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  34. package/dist/components/Breadcrumb/Breadcrumb.js +2 -5
  35. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  36. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +5 -8
  37. package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs.map +1 -1
  38. package/dist/components/Breadcrumb/Breadcrumb.module.css.js +5 -8
  39. package/dist/components/Breadcrumb/Breadcrumb.module.css.js.map +1 -1
  40. package/dist/components/Button/Button.cjs +29 -3
  41. package/dist/components/Button/Button.cjs.map +1 -1
  42. package/dist/components/Button/Button.css +78 -31
  43. package/dist/components/Button/Button.d.ts +1 -1
  44. package/dist/components/Button/Button.d.ts.map +1 -1
  45. package/dist/components/Button/Button.js +28 -2
  46. package/dist/components/Button/Button.js.map +1 -1
  47. package/dist/components/Button/Button.module.css.cjs +19 -11
  48. package/dist/components/Button/Button.module.css.cjs.map +1 -1
  49. package/dist/components/Button/Button.module.css.js +19 -11
  50. package/dist/components/Button/Button.module.css.js.map +1 -1
  51. package/dist/components/Button/Button.types.d.ts +20 -3
  52. package/dist/components/Button/Button.types.d.ts.map +1 -1
  53. package/dist/components/Button/index.d.ts +1 -1
  54. package/dist/components/Button/index.d.ts.map +1 -1
  55. package/dist/components/ButtonCard/ButtonCard.cjs +19 -14
  56. package/dist/components/ButtonCard/ButtonCard.cjs.map +1 -1
  57. package/dist/components/ButtonCard/ButtonCard.css +63 -20
  58. package/dist/components/ButtonCard/ButtonCard.d.ts +2 -1
  59. package/dist/components/ButtonCard/ButtonCard.d.ts.map +1 -1
  60. package/dist/components/ButtonCard/ButtonCard.js +17 -12
  61. package/dist/components/ButtonCard/ButtonCard.js.map +1 -1
  62. package/dist/components/ButtonCard/ButtonCard.module.css.cjs +14 -12
  63. package/dist/components/ButtonCard/ButtonCard.module.css.cjs.map +1 -1
  64. package/dist/components/ButtonCard/ButtonCard.module.css.js +14 -12
  65. package/dist/components/ButtonCard/ButtonCard.module.css.js.map +1 -1
  66. package/dist/components/ButtonCard/ButtonCard.types.d.ts +3 -2
  67. package/dist/components/ButtonCard/ButtonCard.types.d.ts.map +1 -1
  68. package/dist/components/Checkbox/Checkbox.cjs +105 -0
  69. package/dist/components/Checkbox/Checkbox.cjs.map +1 -0
  70. package/dist/components/Checkbox/Checkbox.css +323 -0
  71. package/dist/components/Checkbox/Checkbox.d.ts +3 -0
  72. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  73. package/dist/components/Checkbox/Checkbox.js +105 -0
  74. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  75. package/dist/components/Checkbox/Checkbox.module.css.cjs +35 -0
  76. package/dist/components/Checkbox/Checkbox.module.css.cjs.map +1 -0
  77. package/dist/components/Checkbox/Checkbox.module.css.js +35 -0
  78. package/dist/components/Checkbox/Checkbox.module.css.js.map +1 -0
  79. package/dist/components/Checkbox/Checkbox.types.d.ts +47 -0
  80. package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -0
  81. package/dist/components/Checkbox/index.d.ts +3 -0
  82. package/dist/components/Checkbox/index.d.ts.map +1 -0
  83. package/dist/components/ContentCard/ContentCard.cjs +8 -7
  84. package/dist/components/ContentCard/ContentCard.cjs.map +1 -1
  85. package/dist/components/ContentCard/ContentCard.css +39 -34
  86. package/dist/components/ContentCard/ContentCard.d.ts.map +1 -1
  87. package/dist/components/ContentCard/ContentCard.js +3 -2
  88. package/dist/components/ContentCard/ContentCard.js.map +1 -1
  89. package/dist/components/ContentCard/ContentCard.module.css.cjs +18 -18
  90. package/dist/components/ContentCard/ContentCard.module.css.js +18 -18
  91. package/dist/components/ContentCard/ContentCard.types.d.ts +2 -1
  92. package/dist/components/ContentCard/ContentCard.types.d.ts.map +1 -1
  93. package/dist/components/Drawer/Drawer.cjs +15 -7
  94. package/dist/components/Drawer/Drawer.cjs.map +1 -1
  95. package/dist/components/Drawer/Drawer.css +48 -45
  96. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  97. package/dist/components/Drawer/Drawer.js +12 -4
  98. package/dist/components/Drawer/Drawer.js.map +1 -1
  99. package/dist/components/Drawer/Drawer.module.css.cjs +16 -16
  100. package/dist/components/Drawer/Drawer.module.css.js +16 -16
  101. package/dist/components/Footer/Footer.cjs +8 -9
  102. package/dist/components/Footer/Footer.cjs.map +1 -1
  103. package/dist/components/Footer/Footer.css +87 -83
  104. package/dist/components/Footer/Footer.d.ts.map +1 -1
  105. package/dist/components/Footer/Footer.js +1 -2
  106. package/dist/components/Footer/Footer.js.map +1 -1
  107. package/dist/components/Footer/Footer.module.css.cjs +39 -39
  108. package/dist/components/Footer/Footer.module.css.js +39 -39
  109. package/dist/components/FunctionButton/FunctionButton.cjs +2 -2
  110. package/dist/components/FunctionButton/FunctionButton.cjs.map +1 -1
  111. package/dist/components/FunctionButton/FunctionButton.css +5 -1
  112. package/dist/components/FunctionButton/FunctionButton.js +1 -1
  113. package/dist/components/FunctionButton/FunctionButton.js.map +1 -1
  114. package/dist/components/Hero/Hero.cjs +30 -27
  115. package/dist/components/Hero/Hero.cjs.map +1 -1
  116. package/dist/components/Hero/Hero.css +49 -44
  117. package/dist/components/Hero/Hero.d.ts +1 -1
  118. package/dist/components/Hero/Hero.d.ts.map +1 -1
  119. package/dist/components/Hero/Hero.js +30 -27
  120. package/dist/components/Hero/Hero.js.map +1 -1
  121. package/dist/components/Hero/Hero.module.css.cjs +18 -18
  122. package/dist/components/Hero/Hero.module.css.js +18 -18
  123. package/dist/components/Hero/Hero.types.d.ts +2 -6
  124. package/dist/components/Hero/Hero.types.d.ts.map +1 -1
  125. package/dist/components/IconButton/IconButton.cjs +3 -4
  126. package/dist/components/IconButton/IconButton.cjs.map +1 -1
  127. package/dist/components/IconButton/IconButton.css +5 -1
  128. package/dist/components/IconButton/IconButton.d.ts.map +1 -1
  129. package/dist/components/IconButton/IconButton.js +1 -2
  130. package/dist/components/IconButton/IconButton.js.map +1 -1
  131. package/dist/components/Label/Label.css +5 -1
  132. package/dist/components/MainNavigation/MainNavigation.cjs +216 -162
  133. package/dist/components/MainNavigation/MainNavigation.cjs.map +1 -1
  134. package/dist/components/MainNavigation/MainNavigation.css +206 -183
  135. package/dist/components/MainNavigation/MainNavigation.d.ts +1 -1
  136. package/dist/components/MainNavigation/MainNavigation.d.ts.map +1 -1
  137. package/dist/components/MainNavigation/MainNavigation.js +177 -123
  138. package/dist/components/MainNavigation/MainNavigation.js.map +1 -1
  139. package/dist/components/MainNavigation/MainNavigation.module.css.cjs +80 -78
  140. package/dist/components/MainNavigation/MainNavigation.module.css.cjs.map +1 -1
  141. package/dist/components/MainNavigation/MainNavigation.module.css.js +80 -78
  142. package/dist/components/MainNavigation/MainNavigation.module.css.js.map +1 -1
  143. package/dist/components/MainNavigation/MainNavigation.types.d.ts +0 -13
  144. package/dist/components/MainNavigation/MainNavigation.types.d.ts.map +1 -1
  145. package/dist/components/MainNavigation/MainNavigation.utils.cjs +8 -4
  146. package/dist/components/MainNavigation/MainNavigation.utils.cjs.map +1 -1
  147. package/dist/components/MainNavigation/MainNavigation.utils.d.ts +1 -0
  148. package/dist/components/MainNavigation/MainNavigation.utils.d.ts.map +1 -1
  149. package/dist/components/MainNavigation/MainNavigation.utils.js +8 -4
  150. package/dist/components/MainNavigation/MainNavigation.utils.js.map +1 -1
  151. package/dist/components/Modal/Modal.cjs +14 -6
  152. package/dist/components/Modal/Modal.cjs.map +1 -1
  153. package/dist/components/Modal/Modal.css +44 -40
  154. package/dist/components/Modal/Modal.d.ts.map +1 -1
  155. package/dist/components/Modal/Modal.js +12 -4
  156. package/dist/components/Modal/Modal.js.map +1 -1
  157. package/dist/components/Modal/Modal.module.css.cjs +18 -18
  158. package/dist/components/Modal/Modal.module.css.js +18 -18
  159. package/dist/components/Notification/Notification.cjs +3 -2
  160. package/dist/components/Notification/Notification.cjs.map +1 -1
  161. package/dist/components/Notification/Notification.css +16 -11
  162. package/dist/components/Notification/Notification.d.ts.map +1 -1
  163. package/dist/components/Notification/Notification.js +2 -1
  164. package/dist/components/Notification/Notification.js.map +1 -1
  165. package/dist/components/Notification/Notification.module.css.cjs +9 -9
  166. package/dist/components/Notification/Notification.module.css.js +9 -9
  167. package/dist/components/Pagination/Pagination.cjs +142 -0
  168. package/dist/components/Pagination/Pagination.cjs.map +1 -0
  169. package/dist/components/Pagination/Pagination.css +256 -0
  170. package/dist/components/Pagination/Pagination.d.ts +3 -0
  171. package/dist/components/Pagination/Pagination.d.ts.map +1 -0
  172. package/dist/components/Pagination/Pagination.js +142 -0
  173. package/dist/components/Pagination/Pagination.js.map +1 -0
  174. package/dist/components/Pagination/Pagination.module.css.cjs +34 -0
  175. package/dist/components/Pagination/Pagination.module.css.cjs.map +1 -0
  176. package/dist/components/Pagination/Pagination.module.css.js +34 -0
  177. package/dist/components/Pagination/Pagination.module.css.js.map +1 -0
  178. package/dist/components/Pagination/Pagination.types.d.ts +20 -0
  179. package/dist/components/Pagination/Pagination.types.d.ts.map +1 -0
  180. package/dist/components/Pagination/Pagination.utils.cjs +76 -0
  181. package/dist/components/Pagination/Pagination.utils.cjs.map +1 -0
  182. package/dist/components/Pagination/Pagination.utils.d.ts +21 -0
  183. package/dist/components/Pagination/Pagination.utils.d.ts.map +1 -0
  184. package/dist/components/Pagination/Pagination.utils.js +76 -0
  185. package/dist/components/Pagination/Pagination.utils.js.map +1 -0
  186. package/dist/components/Pagination/index.d.ts +3 -0
  187. package/dist/components/Pagination/index.d.ts.map +1 -0
  188. package/dist/components/Pictograph/Pictograph.css +5 -1
  189. package/dist/components/Pictograph/PictographItem.css +5 -1
  190. package/dist/components/Quote/Quote.css +5 -1
  191. package/dist/components/Spinner/Spinner.css +5 -1
  192. package/dist/design-tokens/dist/tokens.cjs +5 -0
  193. package/dist/design-tokens/dist/tokens.cjs.map +1 -0
  194. package/dist/design-tokens/dist/tokens.js +5 -0
  195. package/dist/design-tokens/dist/tokens.js.map +1 -0
  196. package/dist/index.cjs +6 -0
  197. package/dist/index.cjs.map +1 -1
  198. package/dist/index.d.ts +7 -1
  199. package/dist/index.d.ts.map +1 -1
  200. package/dist/index.js +6 -0
  201. package/dist/index.js.map +1 -1
  202. package/dist/styles/utilities.css +6 -0
  203. package/dist/styles/utils/elevation.css +35 -26
  204. package/dist/styles/utils/focus.css +63 -68
  205. package/dist/styles/utils/index.cjs +33 -0
  206. package/dist/styles/utils/index.cjs.map +1 -0
  207. package/dist/styles/utils/index.d.ts +20 -0
  208. package/dist/styles/utils/index.d.ts.map +1 -0
  209. package/dist/styles/utils/index.js +33 -0
  210. package/dist/styles/utils/index.js.map +1 -0
  211. package/dist/styles/utils/overlay.css +35 -27
  212. package/dist/styles/utils/text-decoration.css +20 -12
  213. package/dist/styles.css +27 -3
  214. package/dist/utils/index.d.ts +1 -0
  215. package/dist/utils/index.d.ts.map +1 -1
  216. package/dist/utils/isRenderable/index.d.ts +2 -0
  217. package/dist/utils/isRenderable/index.d.ts.map +1 -0
  218. package/dist/utils/isRenderable/isRenderable.cjs +5 -0
  219. package/dist/utils/isRenderable/isRenderable.cjs.map +1 -0
  220. package/dist/utils/isRenderable/isRenderable.d.ts +4 -0
  221. package/dist/utils/isRenderable/isRenderable.d.ts.map +1 -0
  222. package/dist/utils/isRenderable/isRenderable.js +5 -0
  223. package/dist/utils/isRenderable/isRenderable.js.map +1 -0
  224. package/package.json +12 -4
  225. package/dist/styles/utils/elevation.module.css.cjs +0 -16
  226. package/dist/styles/utils/elevation.module.css.cjs.map +0 -1
  227. package/dist/styles/utils/elevation.module.css.js +0 -16
  228. package/dist/styles/utils/elevation.module.css.js.map +0 -1
  229. package/dist/styles/utils/focus.module.css.cjs +0 -16
  230. package/dist/styles/utils/focus.module.css.cjs.map +0 -1
  231. package/dist/styles/utils/focus.module.css.js +0 -16
  232. package/dist/styles/utils/focus.module.css.js.map +0 -1
  233. package/dist/styles/utils/overlay.module.css.cjs +0 -13
  234. package/dist/styles/utils/overlay.module.css.cjs.map +0 -1
  235. package/dist/styles/utils/overlay.module.css.js +0 -13
  236. package/dist/styles/utils/overlay.module.css.js.map +0 -1
  237. package/dist/styles/utils/text-decoration.module.css.cjs +0 -13
  238. package/dist/styles/utils/text-decoration.module.css.cjs.map +0 -1
  239. package/dist/styles/utils/text-decoration.module.css.js +0 -13
  240. package/dist/styles/utils/text-decoration.module.css.js.map +0 -1
@@ -9,35 +9,36 @@
9
9
  * These variables come from @dnanpm/design-tokens package.
10
10
  */
11
11
 
12
- ._notification_m746g_8 {
12
+ ._notification_1m544_8 {
13
13
  display: flex;
14
14
  align-items: center;
15
15
  gap: var(--spacing-space-16);
16
16
  padding-right: var(--spacing-space-20);
17
17
  border: 2px solid var(--notification-color);
18
18
  border-radius: var(--radius-semantic-sm);
19
+ background-color: var(--color-semantic-surface-base);
19
20
  overflow: clip;
20
21
  }
21
22
 
22
23
  /* Variant colors */
23
- ._notification--info_m746g_19 {
24
+ ._notification--info_1m544_20 {
24
25
  --notification-color: var(--color-semantic-status-info);
25
26
  }
26
27
 
27
- ._notification--success_m746g_23 {
28
+ ._notification--success_1m544_24 {
28
29
  --notification-color: var(--color-semantic-status-success);
29
30
  }
30
31
 
31
- ._notification--warning_m746g_27 {
32
+ ._notification--warning_1m544_28 {
32
33
  --notification-color: var(--color-semantic-status-warning);
33
34
  }
34
35
 
35
- ._notification--error_m746g_31 {
36
+ ._notification--error_1m544_32 {
36
37
  --notification-color: var(--color-semantic-status-error);
37
38
  }
38
39
 
39
40
  /* Icon container */
40
- ._notification__icon-container_m746g_36 {
41
+ ._notification__icon-container_1m544_37 {
41
42
  /* The colored area size should be 48x48px on one line content, so we adjust padding based on whether the border is present or not */
42
43
  --_icon-padding-with-border: 10px;
43
44
  --_icon-padding-without-border: 12px;
@@ -53,14 +54,14 @@
53
54
  color: var(--color-semantic-foreground-inverse);
54
55
  }
55
56
 
56
- ._notification__icon_m746g_36 {
57
+ ._notification__icon_1m544_37 {
57
58
  width: 24px;
58
59
  height: 24px;
59
60
  flex: 0 0 auto;
60
61
  }
61
62
 
62
63
  /* Content */
63
- ._notification__content_m746g_59 {
64
+ ._notification__content_1m544_60 {
64
65
  flex: 1 1 auto;
65
66
  min-width: 0;
66
67
  padding: var(--spacing-space-8) 0;
@@ -70,7 +71,7 @@
70
71
  }
71
72
 
72
73
  /* Close button */
73
- ._notification__close_m746g_69 {
74
+ ._notification__close_1m544_70 {
74
75
  flex: 0 0 auto;
75
76
  display: flex;
76
77
  align-items: center;
@@ -87,7 +88,11 @@
87
88
  cursor: pointer;
88
89
  }
89
90
 
90
- ._notification__close_m746g_69 svg {
91
+ ._notification__close_1m544_70 svg {
91
92
  width: 24px;
92
93
  height: 24px;
93
- } }
94
+ }
95
+
96
+ /**
97
+ * Do not edit directly, this file was auto-generated.
98
+ */ }
@@ -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,GAAI,gFAS1B,iBAAiB,4CA2BnB,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,4CA4BnB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { Error, Warning, Check, Info, Close } from "@dnanpm/icons";
3
- import focusStyles from "../../styles/utils/focus.module.css.js";
3
+ import { focusStyles } from "../../styles/utils/index.js";
4
4
  import styles from "./Notification.module.css.js";
5
5
  import { cn } from "../../utils/cn/cn.js";
6
6
  const variantIcons = {
@@ -31,6 +31,7 @@ const Notification = ({
31
31
  "div",
32
32
  {
33
33
  ...props,
34
+ "data-color-scheme": "light",
34
35
  ref,
35
36
  role,
36
37
  className: cn(styles.notification, styles[`notification--${variant}`], className),
@@ -1 +1 @@
1
- {"version":3,"file":"Notification.js","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":["ErrorIcon"],"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,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,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,WAAW,GAAG,OAAO,cAAc,OAAO,iBAAiB,OAAO,EAAE,GAAG,SAAS;AAAA,MAEhF,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;"}
1
+ {"version":3,"file":"Notification.js","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';\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 data-color-scheme=\"light\"\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":["ErrorIcon"],"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,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,SACI;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,qBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA,WAAW,GAAG,OAAO,cAAc,OAAO,iBAAiB,OAAO,EAAE,GAAG,SAAS;AAAA,MAEhF,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;"}
@@ -1,17 +1,17 @@
1
1
  require('./Notification.css');
2
2
  "use strict";
3
3
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
4
- const notification = "_notification_m746g_8";
5
- const notification__icon = "_notification__icon_m746g_36";
6
- const notification__content = "_notification__content_m746g_59";
7
- const notification__close = "_notification__close_m746g_69";
4
+ const notification = "_notification_1m544_8";
5
+ const notification__icon = "_notification__icon_1m544_37";
6
+ const notification__content = "_notification__content_1m544_60";
7
+ const notification__close = "_notification__close_1m544_70";
8
8
  const styles = {
9
9
  notification,
10
- "notification--info": "_notification--info_m746g_19",
11
- "notification--success": "_notification--success_m746g_23",
12
- "notification--warning": "_notification--warning_m746g_27",
13
- "notification--error": "_notification--error_m746g_31",
14
- "notification__icon-container": "_notification__icon-container_m746g_36",
10
+ "notification--info": "_notification--info_1m544_20",
11
+ "notification--success": "_notification--success_1m544_24",
12
+ "notification--warning": "_notification--warning_1m544_28",
13
+ "notification--error": "_notification--error_1m544_32",
14
+ "notification__icon-container": "_notification__icon-container_1m544_37",
15
15
  notification__icon,
16
16
  notification__content,
17
17
  notification__close
@@ -1,15 +1,15 @@
1
1
  import './Notification.css';
2
- const notification = "_notification_m746g_8";
3
- const notification__icon = "_notification__icon_m746g_36";
4
- const notification__content = "_notification__content_m746g_59";
5
- const notification__close = "_notification__close_m746g_69";
2
+ const notification = "_notification_1m544_8";
3
+ const notification__icon = "_notification__icon_1m544_37";
4
+ const notification__content = "_notification__content_1m544_60";
5
+ const notification__close = "_notification__close_1m544_70";
6
6
  const styles = {
7
7
  notification,
8
- "notification--info": "_notification--info_m746g_19",
9
- "notification--success": "_notification--success_m746g_23",
10
- "notification--warning": "_notification--warning_m746g_27",
11
- "notification--error": "_notification--error_m746g_31",
12
- "notification__icon-container": "_notification__icon-container_m746g_36",
8
+ "notification--info": "_notification--info_1m544_20",
9
+ "notification--success": "_notification--success_1m544_24",
10
+ "notification--warning": "_notification--warning_1m544_28",
11
+ "notification--error": "_notification--error_1m544_32",
12
+ "notification__icon-container": "_notification__icon-container_1m544_37",
13
13
  notification__icon,
14
14
  notification__content,
15
15
  notification__close
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const icons = require("@dnanpm/icons");
5
+ const react = require("react");
6
+ const index = require("../../styles/utils/index.cjs");
7
+ const Pagination_utils = require("./Pagination.utils.cjs");
8
+ const Pagination_module = require("./Pagination.module.css.cjs");
9
+ const cn = require("../../utils/cn/cn.cjs");
10
+ const defaultPageLabel = (page) => `Sivu ${page}`;
11
+ const defaultAnnouncement = (page, total) => `Sivu ${page} / ${total}`;
12
+ const Pagination = ({
13
+ currentPage,
14
+ totalPages,
15
+ onPageChange,
16
+ showPreviousNext = true,
17
+ previousPageLabel = "Edellinen sivu",
18
+ nextPageLabel = "Seuraava sivu",
19
+ formatPageLabel = defaultPageLabel,
20
+ formatPageAnnouncement = defaultAnnouncement,
21
+ className,
22
+ "aria-label": ariaLabel,
23
+ "aria-labelledby": ariaLabelledBy,
24
+ onFocusCapture,
25
+ onBlurCapture,
26
+ ref,
27
+ ...props
28
+ }) => {
29
+ Pagination_utils.validatePages(currentPage, totalPages);
30
+ const currentButton = react.useRef(null);
31
+ const focusedButton = react.useRef(null);
32
+ const [announcement, setAnnouncement] = react.useState({
33
+ page: currentPage,
34
+ empty: totalPages === 0,
35
+ text: ""
36
+ });
37
+ if (announcement.page !== currentPage || announcement.empty !== (totalPages === 0)) {
38
+ setAnnouncement({
39
+ page: currentPage,
40
+ empty: totalPages === 0,
41
+ text: totalPages > 0 && !announcement.empty && announcement.page !== currentPage ? formatPageAnnouncement(currentPage, totalPages) : ""
42
+ });
43
+ }
44
+ react.useLayoutEffect(() => {
45
+ const focused = focusedButton.current;
46
+ if (focused && (!focused.isConnected || focused.disabled) && (document.activeElement === document.body || document.activeElement === focused)) {
47
+ currentButton.current?.focus();
48
+ }
49
+ }, [currentPage, totalPages, showPreviousNext]);
50
+ if (totalPages === 0) return null;
51
+ const requestPage = (page) => {
52
+ if (page !== currentPage) onPageChange(page);
53
+ };
54
+ const buttonClass = cn.cn(Pagination_module.default.pagination__button, index.focusStyles.focusable);
55
+ return /* @__PURE__ */ jsxRuntime.jsxs(
56
+ "nav",
57
+ {
58
+ ref,
59
+ className: cn.cn(Pagination_module.default.pagination, className),
60
+ "aria-label": ariaLabel ?? (ariaLabelledBy ? void 0 : "Sivutus"),
61
+ "aria-labelledby": ariaLabelledBy,
62
+ onFocusCapture: (event) => {
63
+ if (event.target instanceof HTMLButtonElement) focusedButton.current = event.target;
64
+ onFocusCapture?.(event);
65
+ },
66
+ onBlurCapture: (event) => {
67
+ const button = focusedButton.current;
68
+ const focusLeftPagination = event.relatedTarget ? !event.currentTarget.contains(event.relatedTarget) : button?.isConnected && !button.disabled;
69
+ if (focusLeftPagination) {
70
+ focusedButton.current = null;
71
+ }
72
+ onBlurCapture?.(event);
73
+ },
74
+ ...props,
75
+ children: [
76
+ /* @__PURE__ */ jsxRuntime.jsxs(
77
+ "ul",
78
+ {
79
+ className: cn.cn(
80
+ Pagination_module.default.pagination__list,
81
+ Pagination_module.default[`pagination__list--${Pagination_utils.getPageWidth(totalPages)}`],
82
+ { [Pagination_module.default["pagination__list--arrows"]]: showPreviousNext }
83
+ ),
84
+ children: [
85
+ showPreviousNext && /* @__PURE__ */ jsxRuntime.jsx("li", { className: Pagination_module.default.pagination__arrow, children: /* @__PURE__ */ jsxRuntime.jsx(
86
+ "button",
87
+ {
88
+ type: "button",
89
+ className: buttonClass,
90
+ "aria-label": previousPageLabel,
91
+ disabled: currentPage === 1,
92
+ onClick: () => requestPage(currentPage - 1),
93
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronLeftFilled, { "aria-hidden": "true", size: "16" })
94
+ }
95
+ ) }),
96
+ Pagination_utils.getPageCandidates(currentPage, totalPages).map(({ item, budgets }) => /* @__PURE__ */ jsxRuntime.jsx(
97
+ "li",
98
+ {
99
+ className: cn.cn(
100
+ Pagination_module.default.pagination__item,
101
+ {
102
+ [Pagination_module.default["pagination__item--current"]]: item.kind === "page" && item.page === currentPage
103
+ },
104
+ budgets.map((budget) => Pagination_module.default[`pagination__item--${budget}`])
105
+ ),
106
+ "aria-hidden": item.kind === "gap" ? true : void 0,
107
+ children: item.kind === "page" ? /* @__PURE__ */ jsxRuntime.jsx(
108
+ "button",
109
+ {
110
+ type: "button",
111
+ ref: item.page === currentPage ? currentButton : void 0,
112
+ className: buttonClass,
113
+ "aria-label": formatPageLabel(item.page),
114
+ "aria-current": item.page === currentPage ? "page" : void 0,
115
+ onClick: () => requestPage(item.page),
116
+ children: item.page
117
+ }
118
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: Pagination_module.default.pagination__gap, children: /* @__PURE__ */ jsxRuntime.jsx(icons.MoreFilled, { "aria-hidden": "true", size: "16" }) })
119
+ },
120
+ item.key
121
+ )),
122
+ showPreviousNext && /* @__PURE__ */ jsxRuntime.jsx("li", { className: Pagination_module.default.pagination__arrow, children: /* @__PURE__ */ jsxRuntime.jsx(
123
+ "button",
124
+ {
125
+ type: "button",
126
+ className: buttonClass,
127
+ "aria-label": nextPageLabel,
128
+ disabled: currentPage === totalPages,
129
+ onClick: () => requestPage(currentPage + 1),
130
+ children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightFilled, { "aria-hidden": "true", size: "16" })
131
+ }
132
+ ) })
133
+ ]
134
+ }
135
+ ),
136
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: Pagination_module.default["pagination__sr-only"], "aria-live": "polite", "aria-atomic": "true", children: announcement.text })
137
+ ]
138
+ }
139
+ );
140
+ };
141
+ exports.Pagination = Pagination;
142
+ //# sourceMappingURL=Pagination.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.cjs","sources":["../../../src/components/Pagination/Pagination.tsx"],"sourcesContent":["import { ChevronLeftFilled, ChevronRightFilled, MoreFilled } from '@dnanpm/icons';\nimport { useLayoutEffect, useRef, useState } from 'react';\nimport { cn } from '../../utils/cn';\nimport { focusStyles } from '../../styles/utils';\nimport type { PaginationProps } from './Pagination.types';\nimport { getPageCandidates, getPageWidth, validatePages } from './Pagination.utils';\nimport styles from './Pagination.module.css';\n\nconst defaultPageLabel = (page: number) => `Sivu ${page}`;\nconst defaultAnnouncement = (page: number, total: number) => `Sivu ${page} / ${total}`;\n\nexport const Pagination = ({\n currentPage,\n totalPages,\n onPageChange,\n showPreviousNext = true,\n previousPageLabel = 'Edellinen sivu',\n nextPageLabel = 'Seuraava sivu',\n formatPageLabel = defaultPageLabel,\n formatPageAnnouncement = defaultAnnouncement,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n onFocusCapture,\n onBlurCapture,\n ref,\n ...props\n}: PaginationProps) => {\n validatePages(currentPage, totalPages);\n const currentButton = useRef<HTMLButtonElement>(null);\n const focusedButton = useRef<HTMLButtonElement | null>(null);\n const [announcement, setAnnouncement] = useState({\n page: currentPage,\n empty: totalPages === 0,\n text: '',\n });\n\n if (announcement.page !== currentPage || announcement.empty !== (totalPages === 0)) {\n setAnnouncement({\n page: currentPage,\n empty: totalPages === 0,\n text:\n totalPages > 0 && !announcement.empty && announcement.page !== currentPage\n ? formatPageAnnouncement(currentPage, totalPages)\n : '',\n });\n }\n\n useLayoutEffect(() => {\n const focused = focusedButton.current;\n if (\n focused &&\n (!focused.isConnected || focused.disabled) &&\n (document.activeElement === document.body || document.activeElement === focused)\n ) {\n currentButton.current?.focus();\n }\n }, [currentPage, totalPages, showPreviousNext]);\n\n if (totalPages === 0) return null;\n\n const requestPage = (page: number) => {\n if (page !== currentPage) onPageChange(page);\n };\n const buttonClass = cn(styles.pagination__button, focusStyles.focusable);\n\n return (\n <nav\n ref={ref}\n className={cn(styles.pagination, className)}\n aria-label={ariaLabel ?? (ariaLabelledBy ? undefined : 'Sivutus')}\n aria-labelledby={ariaLabelledBy}\n onFocusCapture={(event) => {\n if (event.target instanceof HTMLButtonElement) focusedButton.current = event.target;\n onFocusCapture?.(event);\n }}\n onBlurCapture={(event) => {\n const button = focusedButton.current;\n const focusLeftPagination = event.relatedTarget\n ? !event.currentTarget.contains(event.relatedTarget)\n : button?.isConnected && !button.disabled;\n\n if (focusLeftPagination) {\n focusedButton.current = null;\n }\n onBlurCapture?.(event);\n }}\n {...props}\n >\n <ul\n className={cn(\n styles.pagination__list,\n styles[`pagination__list--${getPageWidth(totalPages)}`],\n { [styles['pagination__list--arrows']]: showPreviousNext },\n )}\n >\n {showPreviousNext && (\n <li className={styles.pagination__arrow}>\n <button\n type=\"button\"\n className={buttonClass}\n aria-label={previousPageLabel}\n disabled={currentPage === 1}\n onClick={() => requestPage(currentPage - 1)}\n >\n <ChevronLeftFilled aria-hidden=\"true\" size=\"16\" />\n </button>\n </li>\n )}\n {getPageCandidates(currentPage, totalPages).map(({ item, budgets }) => (\n <li\n key={item.key}\n className={cn(\n styles.pagination__item,\n {\n [styles['pagination__item--current']]:\n item.kind === 'page' && item.page === currentPage,\n },\n budgets.map((budget) => styles[`pagination__item--${budget}`]),\n )}\n aria-hidden={item.kind === 'gap' ? true : undefined}\n >\n {item.kind === 'page' ? (\n <button\n type=\"button\"\n ref={item.page === currentPage ? currentButton : undefined}\n className={buttonClass}\n aria-label={formatPageLabel(item.page)}\n aria-current={item.page === currentPage ? 'page' : undefined}\n onClick={() => requestPage(item.page)}\n >\n {item.page}\n </button>\n ) : (\n <span className={styles.pagination__gap}>\n <MoreFilled aria-hidden=\"true\" size=\"16\" />\n </span>\n )}\n </li>\n ))}\n {showPreviousNext && (\n <li className={styles.pagination__arrow}>\n <button\n type=\"button\"\n className={buttonClass}\n aria-label={nextPageLabel}\n disabled={currentPage === totalPages}\n onClick={() => requestPage(currentPage + 1)}\n >\n <ChevronRightFilled aria-hidden=\"true\" size=\"16\" />\n </button>\n </li>\n )}\n </ul>\n <span className={styles['pagination__sr-only']} aria-live=\"polite\" aria-atomic=\"true\">\n {announcement.text}\n </span>\n </nav>\n );\n};\n"],"names":["validatePages","useRef","useState","useLayoutEffect","cn","styles","focusStyles","jsxs","getPageWidth","jsx","ChevronLeftFilled","getPageCandidates","MoreFilled","ChevronRightFilled"],"mappings":"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"}
@@ -0,0 +1,256 @@
1
+ @layer dds-base, dds-components;@layer dds-components { @layer fallback, components; }@layer dds-components.components{._pagination_1w4hz_1 {
2
+ container: pagination / inline-size;
3
+ width: 100%;
4
+ min-width: 0;
5
+ font: var(--typography-label-lg);
6
+ }
7
+
8
+ ._pagination__list_1w4hz_8 {
9
+ --_pagination-3: flex;
10
+ --_pagination-cell: var(--spacing-space-40);
11
+
12
+ display: flex;
13
+ flex-wrap: wrap;
14
+ align-items: center;
15
+ gap: var(--spacing-space-8);
16
+ margin: 0;
17
+ padding: 0;
18
+ list-style: none;
19
+ }
20
+
21
+ ._pagination__list--wide_1w4hz_21 {
22
+ --_pagination-cell: var(--spacing-space-64);
23
+ }
24
+
25
+ ._pagination__list--arrows_1w4hz_25 {
26
+ --_pagination-3: initial;
27
+
28
+ flex-wrap: nowrap;
29
+ }
30
+
31
+ ._pagination__item_1w4hz_31,
32
+ ._pagination__arrow_1w4hz_32 {
33
+ flex: 0 0 auto;
34
+ margin: 0;
35
+ padding: 0;
36
+ }
37
+
38
+ ._pagination__item_1w4hz_31 {
39
+ display: var(
40
+ --_pagination-member-3,
41
+ var(--_pagination-member-5, var(--_pagination-member-7, var(--_pagination-member-9, none)))
42
+ );
43
+ }
44
+
45
+ ._pagination__item--3_1w4hz_45 {
46
+ --_pagination-member-3: var(--_pagination-3);
47
+ }
48
+
49
+ ._pagination__item--5_1w4hz_49 {
50
+ --_pagination-member-5: var(--_pagination-5);
51
+ }
52
+
53
+ ._pagination__item--7_1w4hz_53 {
54
+ --_pagination-member-7: var(--_pagination-7);
55
+ }
56
+
57
+ ._pagination__item--9_1w4hz_57 {
58
+ --_pagination-member-9: var(--_pagination-9);
59
+ }
60
+
61
+ /* Each query budget reserves one extra cell for a number focused before a resize. */
62
+ ._pagination__item_1w4hz_31:focus-within,
63
+ ._pagination__item--current_1w4hz_63 {
64
+ display: flex;
65
+ }
66
+
67
+ ._pagination__button_1w4hz_67,
68
+ ._pagination__gap_1w4hz_68 {
69
+ box-sizing: border-box;
70
+ display: inline-flex;
71
+ flex: 0 0 auto;
72
+ align-items: center;
73
+ justify-content: center;
74
+ min-width: var(--_pagination-cell);
75
+ min-height: var(--spacing-space-40);
76
+ font: inherit;
77
+ font-variant-numeric: tabular-nums;
78
+ white-space: nowrap;
79
+ }
80
+
81
+ ._pagination__button_1w4hz_67 {
82
+ appearance: none;
83
+ padding: var(--spacing-space-8);
84
+ border: var(--borderwidth-semantic-xs) solid var(--color-semantic-border-neutral-mid);
85
+ border-radius: var(--radius-semantic-sm);
86
+ background: var(--color-semantic-surface-base);
87
+ color: var(--color-semantic-foreground-default);
88
+ cursor: pointer;
89
+
90
+ &:hover,
91
+ &:focus-visible {
92
+ background: var(--color-semantic-surface-neutral-mid);
93
+ }
94
+
95
+ &[aria-current='page'] {
96
+ border-color: transparent;
97
+ background: var(--color-semantic-interactive-primary-default);
98
+ color: var(--color-semantic-foreground-inverse);
99
+
100
+ &:hover,
101
+ &:focus-visible,
102
+ &:active {
103
+ background: var(--color-semantic-interactive-primary-hover);
104
+ }
105
+ }
106
+
107
+ &:disabled {
108
+ background: var(--color-semantic-interactive-neutral-disabled);
109
+ color: var(--color-semantic-foreground-muted);
110
+ cursor: default;
111
+ }
112
+
113
+ & > svg {
114
+ width: var(--spacing-space-16);
115
+ height: var(--spacing-space-16);
116
+ }
117
+ }
118
+
119
+ ._pagination__arrow_1w4hz_32 ._pagination__button_1w4hz_67 {
120
+ min-width: var(--spacing-space-40);
121
+ }
122
+
123
+ ._pagination__gap_1w4hz_68 {
124
+ color: var(--color-semantic-foreground-default);
125
+
126
+ & > svg {
127
+ width: var(--spacing-space-16);
128
+ height: var(--spacing-space-16);
129
+ }
130
+ }
131
+
132
+ @scope ([data-color-scheme='dark']) to ([data-color-scheme='light']) {
133
+ ._pagination__gap_1w4hz_68 {
134
+ color: var(--color-semantic-foreground-inverse);
135
+ }
136
+ }
137
+
138
+ /* Thresholds include 8px gaps, 8px focus clearance, arrows, and one spare page cell. */
139
+ @container pagination (width >= 17.5em) {
140
+ ._pagination__list--normal_1w4hz_140._pagination__list--arrows_1w4hz_25 {
141
+ --_pagination-3: flex;
142
+ }
143
+ }
144
+
145
+ @container pagination (width >= 18em) {
146
+ ._pagination__list--normal_1w4hz_140:not(._pagination__list--arrows_1w4hz_25) {
147
+ --_pagination-3: initial;
148
+ --_pagination-5: flex;
149
+ }
150
+ }
151
+
152
+ @container pagination (width >= 23.5em) {
153
+ ._pagination__list--wide_1w4hz_21._pagination__list--arrows_1w4hz_25 {
154
+ --_pagination-3: flex;
155
+ }
156
+ }
157
+
158
+ @container pagination (width >= 24em) {
159
+ ._pagination__list--normal_1w4hz_140._pagination__list--arrows_1w4hz_25 {
160
+ --_pagination-3: initial;
161
+ --_pagination-5: flex;
162
+ }
163
+
164
+ ._pagination__list--normal_1w4hz_140:not(._pagination__list--arrows_1w4hz_25) {
165
+ --_pagination-5: initial;
166
+ --_pagination-7: flex;
167
+ }
168
+ }
169
+
170
+ @container pagination (width >= 27em) {
171
+ ._pagination__list--wide_1w4hz_21:not(._pagination__list--arrows_1w4hz_25) {
172
+ --_pagination-3: initial;
173
+ --_pagination-5: flex;
174
+ }
175
+ }
176
+
177
+ @container pagination (width >= 30em) {
178
+ ._pagination__list--normal_1w4hz_140._pagination__list--arrows_1w4hz_25 {
179
+ --_pagination-5: initial;
180
+ --_pagination-7: flex;
181
+ }
182
+
183
+ ._pagination__list--normal_1w4hz_140:not(._pagination__list--arrows_1w4hz_25) {
184
+ --_pagination-7: initial;
185
+ --_pagination-9: flex;
186
+ }
187
+ }
188
+
189
+ @container pagination (width >= 33em) {
190
+ ._pagination__list--wide_1w4hz_21._pagination__list--arrows_1w4hz_25 {
191
+ --_pagination-3: initial;
192
+ --_pagination-5: flex;
193
+ }
194
+ }
195
+
196
+ @container pagination (width >= 36em) {
197
+ ._pagination__list--normal_1w4hz_140._pagination__list--arrows_1w4hz_25 {
198
+ --_pagination-7: initial;
199
+ --_pagination-9: flex;
200
+ }
201
+
202
+ ._pagination__list--wide_1w4hz_21:not(._pagination__list--arrows_1w4hz_25) {
203
+ --_pagination-5: initial;
204
+ --_pagination-7: flex;
205
+ }
206
+ }
207
+
208
+ @container pagination (width >= 42em) {
209
+ ._pagination__list--wide_1w4hz_21._pagination__list--arrows_1w4hz_25 {
210
+ --_pagination-5: initial;
211
+ --_pagination-7: flex;
212
+ }
213
+ }
214
+
215
+ @container pagination (width >= 45em) {
216
+ ._pagination__list--wide_1w4hz_21:not(._pagination__list--arrows_1w4hz_25) {
217
+ --_pagination-7: initial;
218
+ --_pagination-9: flex;
219
+ }
220
+ }
221
+
222
+ @container pagination (width >= 51em) {
223
+ ._pagination__list--wide_1w4hz_21._pagination__list--arrows_1w4hz_25 {
224
+ --_pagination-7: initial;
225
+ --_pagination-9: flex;
226
+ }
227
+ }
228
+
229
+ ._pagination__sr-only_1w4hz_229 {
230
+ position: absolute;
231
+ width: 1px;
232
+ height: 1px;
233
+ padding: 0;
234
+ margin: -1px;
235
+ overflow: hidden;
236
+ white-space: nowrap;
237
+ border: 0;
238
+ clip: rect(0, 0, 0, 0);
239
+ }
240
+
241
+ @media (forced-colors: active) {
242
+ ._pagination__button_1w4hz_67[aria-current='page'] {
243
+ border-color: Highlight;
244
+ background: Highlight;
245
+ color: HighlightText;
246
+ }
247
+
248
+ ._pagination__button_1w4hz_67:disabled {
249
+ border-color: GrayText;
250
+ color: GrayText;
251
+ }
252
+ }
253
+
254
+ /**
255
+ * Do not edit directly, this file was auto-generated.
256
+ */ }
@@ -0,0 +1,3 @@
1
+ import { PaginationProps } from './Pagination.types';
2
+ export declare const Pagination: ({ currentPage, totalPages, onPageChange, showPreviousNext, previousPageLabel, nextPageLabel, formatPageLabel, formatPageAnnouncement, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, onFocusCapture, onBlurCapture, ref, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
3
+ //# sourceMappingURL=Pagination.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../src/components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAO1D,eAAO,MAAM,UAAU,GAAI,6PAgBxB,eAAe,mDAoIjB,CAAC"}