@jordan-mace/chaser-design-system 1.2.3 → 1.2.4

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 (299) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +16 -0
  2. package/dist/components/Accordion/Accordion.js +43 -0
  3. package/dist/components/Accordion/index.d.ts +1 -0
  4. package/dist/components/Accordion/index.js +1 -0
  5. package/dist/components/Accordion/styles.css.d.ts +7 -0
  6. package/dist/components/Accordion/styles.css.js +65 -0
  7. package/dist/components/Alert/Alert.d.ts +9 -0
  8. package/dist/components/Alert/Alert.js +8 -0
  9. package/dist/components/Alert/index.d.ts +1 -0
  10. package/dist/components/Alert/index.js +1 -0
  11. package/dist/components/Alert/styles.css.d.ts +4 -0
  12. package/dist/components/Alert/styles.css.js +54 -0
  13. package/dist/components/AspectRatio/AspectRatio.d.ts +9 -0
  14. package/dist/components/AspectRatio/AspectRatio.js +12 -0
  15. package/dist/components/AspectRatio/index.d.ts +2 -0
  16. package/dist/components/AspectRatio/index.js +1 -0
  17. package/dist/components/Avatar/Avatar.d.ts +11 -0
  18. package/dist/components/Avatar/Avatar.js +13 -0
  19. package/dist/components/Avatar/index.d.ts +1 -0
  20. package/dist/components/Avatar/index.js +1 -0
  21. package/dist/components/Avatar/styles.css.d.ts +4 -0
  22. package/dist/components/Avatar/styles.css.js +151 -0
  23. package/dist/components/Badge/Badge.d.ts +11 -0
  24. package/dist/components/Badge/Badge.js +8 -0
  25. package/dist/components/Badge/index.d.ts +2 -0
  26. package/dist/components/Badge/index.js +1 -0
  27. package/dist/components/Badge/styles.css.d.ts +5 -0
  28. package/dist/components/Badge/styles.css.js +77 -0
  29. package/dist/components/Box/Box.d.ts +11 -0
  30. package/dist/components/Box/Box.js +54 -0
  31. package/dist/components/Box/index.d.ts +2 -0
  32. package/dist/components/Box/index.js +1 -0
  33. package/dist/components/Box/reset.css.d.ts +1 -0
  34. package/dist/components/Box/reset.css.js +15 -0
  35. package/dist/components/Breadcrumb/Breadcrumb.d.ts +12 -0
  36. package/dist/components/Breadcrumb/Breadcrumb.js +8 -0
  37. package/dist/components/Breadcrumb/index.d.ts +1 -0
  38. package/dist/components/Breadcrumb/index.js +1 -0
  39. package/dist/components/Breadcrumb/styles.css.d.ts +6 -0
  40. package/dist/components/Breadcrumb/styles.css.js +50 -0
  41. package/dist/components/Button/Button.d.ts +9 -0
  42. package/dist/components/Button/Button.js +8 -0
  43. package/dist/components/Button/index.d.ts +1 -0
  44. package/dist/components/Button/index.js +1 -0
  45. package/dist/components/Button/styles.css.d.ts +2 -0
  46. package/dist/components/Button/styles.css.js +30 -0
  47. package/dist/components/Card/Card.d.ts +8 -0
  48. package/dist/components/Card/Card.js +8 -0
  49. package/dist/components/Card/index.d.ts +1 -0
  50. package/dist/components/Card/index.js +1 -0
  51. package/dist/components/Card/styles.css.d.ts +2 -0
  52. package/dist/components/Card/styles.css.js +25 -0
  53. package/dist/components/Checkbox/Checkbox.d.ts +6 -0
  54. package/dist/components/Checkbox/Checkbox.js +25 -0
  55. package/dist/components/Checkbox/index.d.ts +1 -0
  56. package/dist/components/Checkbox/index.js +1 -0
  57. package/dist/components/Checkbox/styles.css.d.ts +3 -0
  58. package/dist/components/Checkbox/styles.css.js +31 -0
  59. package/dist/components/Collapse/Collapse.d.ts +12 -0
  60. package/dist/components/Collapse/Collapse.js +56 -0
  61. package/dist/components/Collapse/index.d.ts +2 -0
  62. package/dist/components/Collapse/index.js +1 -0
  63. package/dist/components/Collapse/styles.css.d.ts +3 -0
  64. package/dist/components/Collapse/styles.css.js +36 -0
  65. package/dist/components/Combobox/Combobox.d.ts +23 -0
  66. package/dist/components/Combobox/Combobox.js +104 -0
  67. package/dist/components/Combobox/index.d.ts +2 -0
  68. package/dist/components/Combobox/index.js +1 -0
  69. package/dist/components/Combobox/styles.css.d.ts +13 -0
  70. package/dist/components/Combobox/styles.css.js +142 -0
  71. package/dist/components/Container/Container.d.ts +11 -0
  72. package/dist/components/Container/Container.js +21 -0
  73. package/dist/components/Container/index.d.ts +2 -0
  74. package/dist/components/Container/index.js +1 -0
  75. package/dist/components/Divider/Divider.d.ts +9 -0
  76. package/dist/components/Divider/Divider.js +8 -0
  77. package/dist/components/Divider/index.d.ts +2 -0
  78. package/dist/components/Divider/index.js +1 -0
  79. package/dist/components/Divider/styles.css.d.ts +4 -0
  80. package/dist/components/Divider/styles.css.js +41 -0
  81. package/dist/components/Drawer/Drawer.d.ts +16 -0
  82. package/dist/components/Drawer/Drawer.js +65 -0
  83. package/dist/components/Drawer/index.d.ts +2 -0
  84. package/dist/components/Drawer/index.js +1 -0
  85. package/dist/components/Drawer/styles.css.d.ts +8 -0
  86. package/dist/components/Drawer/styles.css.js +125 -0
  87. package/dist/components/DropdownMenu/DropdownMenu.d.ts +23 -0
  88. package/dist/components/DropdownMenu/DropdownMenu.js +43 -0
  89. package/dist/components/DropdownMenu/index.d.ts +2 -0
  90. package/dist/components/DropdownMenu/index.js +1 -0
  91. package/dist/components/DropdownMenu/styles.css.d.ts +9 -0
  92. package/dist/components/DropdownMenu/styles.css.js +93 -0
  93. package/dist/components/EmptyState/EmptyState.d.ts +10 -0
  94. package/dist/components/EmptyState/EmptyState.js +8 -0
  95. package/dist/components/EmptyState/index.d.ts +2 -0
  96. package/dist/components/EmptyState/index.js +1 -0
  97. package/dist/components/EmptyState/styles.css.d.ts +5 -0
  98. package/dist/components/EmptyState/styles.css.js +30 -0
  99. package/dist/components/FileUpload/FileUpload.d.ts +27 -0
  100. package/dist/components/FileUpload/FileUpload.js +102 -0
  101. package/dist/components/FileUpload/index.d.ts +2 -0
  102. package/dist/components/FileUpload/index.js +1 -0
  103. package/dist/components/FileUpload/styles.css.d.ts +19 -0
  104. package/dist/components/FileUpload/styles.css.js +145 -0
  105. package/dist/components/Form/Form.d.ts +7 -0
  106. package/dist/components/Form/Form.js +8 -0
  107. package/dist/components/Form/FormInput.d.ts +5 -0
  108. package/dist/components/Form/FormInput.js +9 -0
  109. package/dist/components/Form/index.d.ts +2 -0
  110. package/dist/components/Form/index.js +2 -0
  111. package/dist/components/Form/styles.css.d.ts +2 -0
  112. package/dist/components/Form/styles.css.js +11 -0
  113. package/dist/components/Grid/Grid.d.ts +13 -0
  114. package/dist/components/Grid/Grid.js +25 -0
  115. package/dist/components/Grid/index.d.ts +2 -0
  116. package/dist/components/Grid/index.js +1 -0
  117. package/dist/components/Icon/Icon.d.ts +12 -0
  118. package/dist/components/Icon/Icon.js +21 -0
  119. package/dist/components/Icon/index.d.ts +1 -0
  120. package/dist/components/Icon/index.js +1 -0
  121. package/dist/components/Icon/styles.css.d.ts +1 -0
  122. package/dist/components/Icon/styles.css.js +9 -0
  123. package/dist/components/Input/Input.d.ts +7 -0
  124. package/dist/components/Input/Input.js +9 -0
  125. package/dist/components/Input/index.d.ts +1 -0
  126. package/dist/components/Input/index.js +1 -0
  127. package/dist/components/Input/styles.css.d.ts +2 -0
  128. package/dist/components/Input/styles.css.js +8 -0
  129. package/dist/components/Kbd/Kbd.d.ts +7 -0
  130. package/dist/components/Kbd/Kbd.js +6 -0
  131. package/dist/components/Kbd/index.d.ts +2 -0
  132. package/dist/components/Kbd/index.js +1 -0
  133. package/dist/components/Kbd/styles.css.d.ts +1 -0
  134. package/dist/components/Kbd/styles.css.js +16 -0
  135. package/dist/components/List/List.d.ts +5 -0
  136. package/dist/components/List/List.js +7 -0
  137. package/dist/components/List/ListItem.d.ts +5 -0
  138. package/dist/components/List/ListItem.js +7 -0
  139. package/dist/components/List/index.d.ts +2 -0
  140. package/dist/components/List/index.js +2 -0
  141. package/dist/components/List/styles.css.d.ts +2 -0
  142. package/dist/components/List/styles.css.js +11 -0
  143. package/dist/components/Modal/Modal.d.ts +13 -0
  144. package/dist/components/Modal/Modal.js +35 -0
  145. package/dist/components/Modal/index.d.ts +2 -0
  146. package/dist/components/Modal/index.js +1 -0
  147. package/dist/components/Modal/styles.css.d.ts +7 -0
  148. package/dist/components/Modal/styles.css.js +92 -0
  149. package/dist/components/Navbar/Navbar.d.ts +6 -0
  150. package/dist/components/Navbar/Navbar.js +8 -0
  151. package/dist/components/Navbar/NavbarItem.d.ts +6 -0
  152. package/dist/components/Navbar/NavbarItem.js +8 -0
  153. package/dist/components/Navbar/index.d.ts +2 -0
  154. package/dist/components/Navbar/index.js +2 -0
  155. package/dist/components/Navbar/styles.css.d.ts +2 -0
  156. package/dist/components/Navbar/styles.css.js +3 -0
  157. package/dist/components/NumberInput/NumberInput.d.ts +20 -0
  158. package/dist/components/NumberInput/NumberInput.js +39 -0
  159. package/dist/components/NumberInput/index.d.ts +2 -0
  160. package/dist/components/NumberInput/index.js +1 -0
  161. package/dist/components/NumberInput/styles.css.d.ts +10 -0
  162. package/dist/components/NumberInput/styles.css.js +117 -0
  163. package/dist/components/Pagination/Pagination.d.ts +10 -0
  164. package/dist/components/Pagination/Pagination.js +47 -0
  165. package/dist/components/Pagination/index.d.ts +2 -0
  166. package/dist/components/Pagination/index.js +1 -0
  167. package/dist/components/Pagination/styles.css.d.ts +4 -0
  168. package/dist/components/Pagination/styles.css.js +44 -0
  169. package/dist/components/Popover/Popover.d.ts +18 -0
  170. package/dist/components/Popover/Popover.js +55 -0
  171. package/dist/components/Popover/index.d.ts +2 -0
  172. package/dist/components/Popover/index.js +1 -0
  173. package/dist/components/Popover/styles.css.d.ts +11 -0
  174. package/dist/components/Popover/styles.css.js +185 -0
  175. package/dist/components/Progress/Progress.d.ts +10 -0
  176. package/dist/components/Progress/Progress.js +9 -0
  177. package/dist/components/Progress/index.d.ts +1 -0
  178. package/dist/components/Progress/index.js +1 -0
  179. package/dist/components/Progress/styles.css.d.ts +4 -0
  180. package/dist/components/Progress/styles.css.js +71 -0
  181. package/dist/components/Radio/Radio.d.ts +16 -0
  182. package/dist/components/Radio/Radio.js +25 -0
  183. package/dist/components/Radio/index.d.ts +1 -0
  184. package/dist/components/Radio/index.js +1 -0
  185. package/dist/components/Radio/styles.css.d.ts +5 -0
  186. package/dist/components/Radio/styles.css.js +42 -0
  187. package/dist/components/ScrollArea/ScrollArea.d.ts +11 -0
  188. package/dist/components/ScrollArea/ScrollArea.js +12 -0
  189. package/dist/components/ScrollArea/index.d.ts +2 -0
  190. package/dist/components/ScrollArea/index.js +1 -0
  191. package/dist/components/ScrollArea/styles.css.d.ts +3 -0
  192. package/dist/components/ScrollArea/styles.css.js +25 -0
  193. package/dist/components/Select/Select.d.ts +13 -0
  194. package/dist/components/Select/Select.js +10 -0
  195. package/dist/components/Select/index.d.ts +1 -0
  196. package/dist/components/Select/index.js +1 -0
  197. package/dist/components/Select/styles.css.d.ts +4 -0
  198. package/dist/components/Select/styles.css.js +82 -0
  199. package/dist/components/Separator/Separator.d.ts +8 -0
  200. package/dist/components/Separator/Separator.js +8 -0
  201. package/dist/components/Separator/index.d.ts +2 -0
  202. package/dist/components/Separator/index.js +1 -0
  203. package/dist/components/Separator/styles.css.d.ts +4 -0
  204. package/dist/components/Separator/styles.css.js +28 -0
  205. package/dist/components/Skeleton/Skeleton.d.ts +14 -0
  206. package/dist/components/Skeleton/Skeleton.js +13 -0
  207. package/dist/components/Skeleton/index.d.ts +2 -0
  208. package/dist/components/Skeleton/index.js +1 -0
  209. package/dist/components/Skeleton/styles.css.d.ts +4 -0
  210. package/dist/components/Skeleton/styles.css.js +56 -0
  211. package/dist/components/Spinner/Spinner.d.ts +10 -0
  212. package/dist/components/Spinner/Spinner.js +8 -0
  213. package/dist/components/Spinner/index.d.ts +2 -0
  214. package/dist/components/Spinner/index.js +1 -0
  215. package/dist/components/Spinner/styles.css.d.ts +4 -0
  216. package/dist/components/Spinner/styles.css.js +55 -0
  217. package/dist/components/Stack/Stack.d.ts +16 -0
  218. package/dist/components/Stack/Stack.js +24 -0
  219. package/dist/components/Stack/index.d.ts +2 -0
  220. package/dist/components/Stack/index.js +1 -0
  221. package/dist/components/Stepper/Stepper.d.ts +18 -0
  222. package/dist/components/Stepper/Stepper.js +25 -0
  223. package/dist/components/Stepper/index.d.ts +2 -0
  224. package/dist/components/Stepper/index.js +1 -0
  225. package/dist/components/Stepper/styles.css.d.ts +14 -0
  226. package/dist/components/Stepper/styles.css.js +104 -0
  227. package/dist/components/Table/Table.d.ts +42 -0
  228. package/dist/components/Table/Table.js +39 -0
  229. package/dist/components/Table/index.d.ts +1 -0
  230. package/dist/components/Table/index.js +1 -0
  231. package/dist/components/Table/styles.css.d.ts +8 -0
  232. package/dist/components/Table/styles.css.js +49 -0
  233. package/dist/components/Tabs/Tabs.d.ts +29 -0
  234. package/dist/components/Tabs/Tabs.js +52 -0
  235. package/dist/components/Tabs/index.d.ts +1 -0
  236. package/dist/components/Tabs/index.js +1 -0
  237. package/dist/components/Tabs/styles.css.d.ts +6 -0
  238. package/dist/components/Tabs/styles.css.js +100 -0
  239. package/dist/components/Tag/Tag.d.ts +16 -0
  240. package/dist/components/Tag/Tag.js +18 -0
  241. package/dist/components/Tag/index.d.ts +1 -0
  242. package/dist/components/Tag/index.js +1 -0
  243. package/dist/components/Tag/styles.css.d.ts +3 -0
  244. package/dist/components/Tag/styles.css.js +93 -0
  245. package/dist/components/Text/Header.d.ts +8 -0
  246. package/dist/components/Text/Header.js +8 -0
  247. package/dist/components/Text/P.d.ts +7 -0
  248. package/dist/components/Text/P.js +8 -0
  249. package/dist/components/Text/index.d.ts +2 -0
  250. package/dist/components/Text/index.js +2 -0
  251. package/dist/components/Text/styles.css.d.ts +2 -0
  252. package/dist/components/Text/styles.css.js +13 -0
  253. package/dist/components/TextArea/TextArea.d.ts +7 -0
  254. package/dist/components/TextArea/TextArea.js +9 -0
  255. package/dist/components/TextArea/index.d.ts +2 -0
  256. package/dist/components/TextArea/index.js +1 -0
  257. package/dist/components/TextArea/styles.css.d.ts +2 -0
  258. package/dist/components/TextArea/styles.css.js +10 -0
  259. package/dist/components/Toast/Toast.d.ts +34 -0
  260. package/dist/components/Toast/Toast.js +177 -0
  261. package/dist/components/Toast/index.d.ts +1 -0
  262. package/dist/components/Toast/index.js +1 -0
  263. package/dist/components/Toast/styles.css.d.ts +21 -0
  264. package/dist/components/Toast/styles.css.js +192 -0
  265. package/dist/components/Toggle/Toggle.d.ts +10 -0
  266. package/dist/components/Toggle/Toggle.js +17 -0
  267. package/dist/components/Toggle/index.d.ts +2 -0
  268. package/dist/components/Toggle/index.js +1 -0
  269. package/dist/components/Toggle/styles.css.d.ts +12 -0
  270. package/dist/components/Toggle/styles.css.js +118 -0
  271. package/dist/components/Tooltip/Tooltip.d.ts +10 -0
  272. package/dist/components/Tooltip/Tooltip.js +16 -0
  273. package/dist/components/Tooltip/index.d.ts +2 -0
  274. package/dist/components/Tooltip/index.js +1 -0
  275. package/dist/components/Tooltip/styles.css.d.ts +8 -0
  276. package/dist/components/Tooltip/styles.css.js +86 -0
  277. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
  278. package/dist/components/VisuallyHidden/VisuallyHidden.js +9 -0
  279. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  280. package/dist/components/VisuallyHidden/index.js +1 -0
  281. package/dist/components/VisuallyHidden/styles.css.d.ts +1 -0
  282. package/dist/components/VisuallyHidden/styles.css.js +12 -0
  283. package/dist/components/index.d.ts +68 -0
  284. package/dist/components/index.js +47 -0
  285. package/dist/index.d.ts +1 -0
  286. package/dist/index.js +1 -0
  287. package/dist/styles/layers.css.d.ts +3 -0
  288. package/dist/styles/layers.css.js +3 -0
  289. package/dist/styles/sprinkles.css.d.ts +241 -0
  290. package/dist/styles/sprinkles.css.js +165 -0
  291. package/dist/styles/theme.css.d.ts +38 -0
  292. package/dist/styles/theme.css.js +51 -0
  293. package/dist/styles/utils.d.ts +2 -0
  294. package/dist/styles/utils.js +7 -0
  295. package/package.json +9 -18
  296. package/dist/index.cjs +0 -4894
  297. package/dist/index.d.cts +0 -1111
  298. package/dist/index.d.mts +0 -1111
  299. package/dist/index.mjs +0 -4812
package/dist/index.mjs DELETED
@@ -1,4812 +0,0 @@
1
- import clsx from "clsx";
2
- import { createGlobalTheme, globalStyle, keyframes, style, styleVariants } from "@vanilla-extract/css";
3
- import { createSprinkles, defineProperties } from "@vanilla-extract/sprinkles";
4
- import React, { createContext, forwardRef, useCallback, useContext, useEffect, useId, useRef, useState } from "react";
5
- import { createPortal } from "react-dom";
6
-
7
- //#region src/styles/layers.css.ts
8
- const themeLayer = "theme";
9
- const componentsLayer = "components";
10
-
11
- //#endregion
12
- //#region src/styles/sprinkles.css.ts
13
- const space = {
14
- none: 0,
15
- small: "4px",
16
- medium: "8px",
17
- large: "16px",
18
- auto: "auto"
19
- };
20
- const responsiveProperties = defineProperties({
21
- "@layer": componentsLayer,
22
- conditions: {
23
- mobile: {},
24
- tablet: { "@media": "screen and (min-width: 768px)" },
25
- desktop: { "@media": "screen and (min-width: 1024px)" }
26
- },
27
- defaultCondition: "mobile",
28
- responsiveArray: [
29
- "mobile",
30
- "tablet",
31
- "desktop"
32
- ],
33
- properties: {
34
- display: [
35
- "none",
36
- "flex",
37
- "block",
38
- "inline"
39
- ],
40
- width: [
41
- "auto",
42
- "100%",
43
- "50%",
44
- "25%"
45
- ],
46
- height: [
47
- "auto",
48
- "100%",
49
- "50%",
50
- "25%"
51
- ],
52
- flexDirection: ["row", "column"],
53
- justifyContent: [
54
- "stretch",
55
- "flex-start",
56
- "center",
57
- "flex-end",
58
- "space-around",
59
- "space-between"
60
- ],
61
- alignItems: [
62
- "stretch",
63
- "flex-start",
64
- "center",
65
- "flex-end"
66
- ],
67
- paddingTop: space,
68
- paddingBottom: space,
69
- paddingLeft: space,
70
- paddingRight: space,
71
- marginLeft: space,
72
- marginRight: space,
73
- marginTop: space,
74
- marginBottom: space,
75
- borderLeft: space,
76
- borderRight: space,
77
- borderTop: space,
78
- borderBottom: space,
79
- borderRadius: space,
80
- gap: space
81
- },
82
- shorthands: {
83
- padding: [
84
- "paddingTop",
85
- "paddingBottom",
86
- "paddingLeft",
87
- "paddingRight"
88
- ],
89
- border: [
90
- "borderTop",
91
- "borderRight",
92
- "borderBottom",
93
- "borderLeft"
94
- ],
95
- paddingX: ["paddingLeft", "paddingRight"],
96
- paddingY: ["paddingTop", "paddingBottom"],
97
- marginX: ["marginLeft", "marginRight"],
98
- marginY: ["marginTop", "marginBottom"],
99
- placeItems: ["justifyContent", "alignItems"]
100
- }
101
- });
102
- const colors = {
103
- "c1-50": "#F5FAFE",
104
- "c1-100": "#DDEEFD",
105
- "c1-150": "#BFDFFC",
106
- "c1-200": "#A6D3FC",
107
- "c1-250": "#88C4FC",
108
- "c1-300": "#6EB7FC",
109
- "c1-350": "#54ABFC",
110
- "c1-400": "#349CFE",
111
- "c1-450": "#1A90FF",
112
- "c1-500": "#0181F9",
113
- "c1-550": "#0374DD",
114
- "c1-600": "#0464BE",
115
- "c1-650": "#0457A4",
116
- "c1-700": "#054A8A",
117
- "c1-750": "#043A6C",
118
- "c1-800": "#042D53",
119
- "c1-850": "#031D35",
120
- "c1-900": "#02101D",
121
- "c2-50": "#F5FCFE",
122
- "c2-100": "#DDF6FD",
123
- "c2-150": "#BFEFFC",
124
- "c2-200": "#A6E9FC",
125
- "c2-250": "#88E3FC",
126
- "c2-300": "#6EDDFC",
127
- "c2-350": "#54D8FC",
128
- "c2-400": "#34D2FE",
129
- "c2-450": "#1ACDFF",
130
- "c2-500": "#01C3F9",
131
- "c2-550": "#03AEDD",
132
- "c2-600": "#0496BE",
133
- "c2-650": "#0481A4",
134
- "c2-700": "#056D8A",
135
- "c2-750": "#04556C",
136
- "c2-800": "#044253",
137
- "c2-850": "#032A35",
138
- "c2-900": "#02171D",
139
- "c3-50": "#F5F9FE",
140
- "c3-100": "#DDEBFD",
141
- "c3-150": "#C0DAFC",
142
- "c3-200": "#A7CCFB",
143
- "c3-250": "#89BAFB",
144
- "c3-300": "#70ACFB",
145
- "c3-350": "#569DFB",
146
- "c3-400": "#368CFC",
147
- "c3-450": "#1C7DFD",
148
- "c3-500": "#046DF6",
149
- "c3-550": "#0662DB",
150
- "c3-600": "#0655BC",
151
- "c3-650": "#064AA2",
152
- "c3-700": "#063F88",
153
- "c3-750": "#06316B",
154
- "c3-800": "#052652",
155
- "c3-850": "#031935",
156
- "c3-900": "#020E1C",
157
- "c4-50": "#F8FAFB",
158
- "c4-100": "#E8ECF3",
159
- "c4-150": "#D4DBE8",
160
- "c4-200": "#C3CDDF",
161
- "c4-250": "#AFBDD5",
162
- "c4-300": "#9DAFCD",
163
- "c4-350": "#8DA1C4",
164
- "c4-400": "#7790BB",
165
- "c4-450": "#6682B2",
166
- "c4-500": "#5472A6",
167
- "c4-550": "#4C6794",
168
- "c4-600": "#425980",
169
- "c4-650": "#3A4D6E",
170
- "c4-700": "#31415E",
171
- "c4-750": "#273449",
172
- "c4-800": "#1E2838",
173
- "c4-850": "#141A24",
174
- "c4-900": "#0B0E14",
175
- "c5-50": "#FAFAFA",
176
- "c5-100": "#EDECEE",
177
- "c5-150": "#DDDCE0",
178
- "c5-200": "#D0CED4",
179
- "c5-250": "#C0BEC6",
180
- "c5-300": "#B3B0BA",
181
- "c5-350": "#A5A2AE",
182
- "c5-400": "#9692A0",
183
- "c5-450": "#898494",
184
- "c5-500": "#797486",
185
- "c5-550": "#6D6878",
186
- "c5-600": "#5E5A68",
187
- "c5-650": "#514E5A",
188
- "c5-700": "#45424C",
189
- "c5-750": "#37353B",
190
- "c5-800": "#2A292E",
191
- "c5-850": "#1B1A1E",
192
- "c5-900": "#0F0E10"
193
- };
194
- const colorProperties = defineProperties({
195
- conditions: {
196
- lightMode: {},
197
- darkMode: { "@media": "(prefers-color-scheme: dark)" }
198
- },
199
- defaultCondition: "lightMode",
200
- properties: {
201
- color: colors,
202
- background: colors
203
- }
204
- });
205
- const sprinkles = createSprinkles(responsiveProperties, colorProperties);
206
-
207
- //#endregion
208
- //#region src/styles/theme.css.ts
209
- globalStyle("@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@500;600;700&display=swap\");", {});
210
- globalStyle("body", { fontFamily: "'Inter', sans-serif" });
211
- globalStyle("h1, h2, h3, h4, h5, h6", { fontFamily: "'Poppins', sans-serif" });
212
- const vars = createGlobalTheme(":root", {
213
- "@layer": themeLayer,
214
- colors: {
215
- textPrimary: colors["c5-800"],
216
- textSecondary: colors["c5-500"],
217
- textDisabled: colors["c5-350"],
218
- buttonTextPrimary: colors["c1-50"],
219
- buttonTextSecondary: colors["c1-900"],
220
- buttonBackgroundPrimary: colors["c1-600"],
221
- buttonBackgroundFocusedPrimary: colors["c1-500"],
222
- buttonBackgroundFocusedSecondary: colors["c1-100"],
223
- buttonBackgroundSecondary: colors["c1-200"],
224
- borderDefault: colors["c4-200"],
225
- borderMuted: colors["c4-100"],
226
- backgroundDefault: colors["c4-50"],
227
- backgroundMuted: colors["c4-50"],
228
- alertSuccessBackground: colors["c2-50"],
229
- alertSuccessBorder: colors["c2-500"],
230
- alertSuccessText: colors["c2-800"],
231
- alertWarningBackground: colors["c3-50"],
232
- alertWarningBorder: colors["c3-500"],
233
- alertWarningText: colors["c3-800"],
234
- alertErrorBackground: colors["c4-50"],
235
- alertErrorBorder: colors["c4-500"],
236
- alertErrorText: colors["c4-800"],
237
- alertInfoBackground: colors["c1-50"],
238
- alertInfoBorder: colors["c1-500"],
239
- alertInfoText: colors["c1-800"],
240
- inputBackground: colors["c4-50"],
241
- inputBorder: colors["c4-200"],
242
- inputBorderFocused: colors["c1-500"],
243
- inputPlaceholder: colors["c5-350"],
244
- listBorder: colors["c4-100"]
245
- },
246
- fontFamily: {
247
- body: "'Inter', sans-serif",
248
- heading: "'Poppins', sans-serif"
249
- }
250
- });
251
-
252
- //#endregion
253
- //#region src/styles/utils.ts
254
- const styleWithLayer = (rule) => style({ "@layer": { [componentsLayer]: rule } });
255
-
256
- //#endregion
257
- //#region src/components/Button/styles.css.ts
258
- const buttonVariants = styleVariants({
259
- primary: {
260
- backgroundColor: vars.colors.buttonBackgroundPrimary,
261
- color: vars.colors.buttonTextPrimary,
262
- ":focus-visible": { backgroundColor: vars.colors.buttonBackgroundFocusedPrimary },
263
- ":hover": { backgroundColor: vars.colors.buttonBackgroundFocusedPrimary }
264
- },
265
- secondary: {
266
- backgroundColor: vars.colors.buttonBackgroundSecondary,
267
- color: vars.colors.buttonTextSecondary,
268
- ":focus-visible": { backgroundColor: vars.colors.buttonBackgroundFocusedSecondary },
269
- ":hover": { backgroundColor: vars.colors.buttonBackgroundFocusedSecondary }
270
- }
271
- });
272
- const button = styleWithLayer({
273
- padding: "1rem",
274
- borderRadius: "1rem",
275
- border: 0
276
- });
277
-
278
- //#endregion
279
- //#region src/components/Box/reset.css.ts
280
- const reset = style({ "@layer": { [componentsLayer]: {
281
- margin: 0,
282
- padding: 0,
283
- border: 0,
284
- boxSizing: "border-box",
285
- fontSize: "100%",
286
- font: "inherit",
287
- verticalAlign: "baseline"
288
- } } });
289
-
290
- //#endregion
291
- //#region src/components/Box/Box.tsx
292
- const Box = forwardRef((props, ref) => {
293
- const { as: Component = "div", className, children, ...rest } = props;
294
- const sprinkleProps = {};
295
- const otherProps = { ref };
296
- const sprinkleKeys = new Set([
297
- "display",
298
- "width",
299
- "height",
300
- "flexDirection",
301
- "justifyContent",
302
- "alignItems",
303
- "paddingTop",
304
- "paddingBottom",
305
- "paddingLeft",
306
- "paddingRight",
307
- "marginLeft",
308
- "marginRight",
309
- "marginTop",
310
- "marginBottom",
311
- "borderLeft",
312
- "borderRight",
313
- "borderTop",
314
- "borderBottom",
315
- "borderRadius",
316
- "gap",
317
- "padding",
318
- "border",
319
- "paddingX",
320
- "paddingY",
321
- "marginX",
322
- "marginY",
323
- "placeItems",
324
- "color",
325
- "background"
326
- ]);
327
- Object.entries(rest).forEach(([key, value]) => {
328
- if (sprinkleKeys.has(key)) sprinkleProps[key] = value;
329
- else otherProps[key] = value;
330
- });
331
- return React.createElement(Component, {
332
- className: clsx(reset, sprinkles(sprinkleProps), className),
333
- ...otherProps
334
- }, children);
335
- });
336
- Box.displayName = "Box";
337
-
338
- //#endregion
339
- //#region src/components/Button/Button.tsx
340
- const Button = ({ label, ...props }) => {
341
- return /* @__PURE__ */ React.createElement(Box, {
342
- as: "button",
343
- borderRadius: "large",
344
- width: props.fullWidth ? "100%" : void 0,
345
- className: clsx(buttonVariants[props.variant], button, props.className),
346
- ...props
347
- }, props.children || label);
348
- };
349
-
350
- //#endregion
351
- //#region src/components/List/styles.css.ts
352
- const list = style({
353
- listStyle: "none",
354
- padding: 0,
355
- margin: 0
356
- });
357
- const listItem = style({
358
- padding: "0.5rem 0",
359
- borderBottom: `1px solid ${vars.colors.listBorder}`
360
- });
361
-
362
- //#endregion
363
- //#region src/components/List/List.tsx
364
- const List = ({ children }) => {
365
- return /* @__PURE__ */ React.createElement(Box, {
366
- as: "ul",
367
- className: list
368
- }, children);
369
- };
370
-
371
- //#endregion
372
- //#region src/components/List/ListItem.tsx
373
- const ListItem = ({ children }) => {
374
- return /* @__PURE__ */ React.createElement(Box, {
375
- as: "li",
376
- className: listItem
377
- }, children);
378
- };
379
-
380
- //#endregion
381
- //#region src/components/Input/styles.css.ts
382
- const inputStyle = styleWithLayer({
383
- padding: "0.5rem 1rem",
384
- borderRadius: "0.5rem"
385
- });
386
- const label$1 = styleWithLayer({ paddingRight: "0.5rem" });
387
-
388
- //#endregion
389
- //#region src/components/Text/styles.css.ts
390
- const text = style({
391
- color: vars.colors.textPrimary,
392
- fontFamily: vars.fontFamily.body,
393
- lineHeight: "24px"
394
- });
395
- const heading = style({
396
- color: vars.colors.textPrimary,
397
- fontFamily: vars.fontFamily.heading,
398
- lineHeight: "32px",
399
- fontWeight: "700"
400
- });
401
-
402
- //#endregion
403
- //#region src/components/Input/Input.tsx
404
- const Input = (props) => {
405
- return /* @__PURE__ */ React.createElement(Box, {
406
- display: "flex",
407
- flexDirection: {
408
- mobile: "column",
409
- tablet: "row"
410
- },
411
- gap: "small"
412
- }, props.label && /* @__PURE__ */ React.createElement(Box, {
413
- as: "label",
414
- className: clsx(text, label$1),
415
- marginX: {
416
- mobile: "auto",
417
- tablet: "none"
418
- },
419
- marginY: {
420
- mobile: "none",
421
- tablet: "auto"
422
- },
423
- htmlFor: props.id
424
- }, props.label), /* @__PURE__ */ React.createElement(Box, {
425
- as: "input",
426
- className: clsx(inputStyle, props.className),
427
- width: props.fullWidth ? "100%" : void 0,
428
- ...props
429
- }));
430
- };
431
-
432
- //#endregion
433
- //#region src/components/Form/styles.css.ts
434
- const formStyle = styleWithLayer({
435
- display: "grid",
436
- gridTemplateRows: "min-content 1fr min-content"
437
- });
438
- const formInputStyle = styleWithLayer({
439
- display: "flex",
440
- flexDirection: "row",
441
- justifyContent: "space-between",
442
- alignItems: "center"
443
- });
444
-
445
- //#endregion
446
- //#region src/components/Form/Form.tsx
447
- const Form = (props) => {
448
- return /* @__PURE__ */ React.createElement(Box, {
449
- as: "form",
450
- gap: "medium",
451
- paddingX: "large",
452
- className: clsx(formStyle, props.className),
453
- ...props
454
- }, props.children);
455
- };
456
-
457
- //#endregion
458
- //#region src/components/Form/FormInput.tsx
459
- const FormInput = (props) => {
460
- return /* @__PURE__ */ React.createElement(Box, {
461
- as: Input,
462
- padding: "small",
463
- className: clsx(formInputStyle, props.className),
464
- label: props.label,
465
- ...props
466
- });
467
- };
468
-
469
- //#endregion
470
- //#region src/components/Navbar/styles.css.ts
471
- const navbarStyle = styleWithLayer({});
472
- const navbarItemStyle = styleWithLayer({});
473
-
474
- //#endregion
475
- //#region src/components/Navbar/Navbar.tsx
476
- const Navbar = (props) => {
477
- return /* @__PURE__ */ React.createElement(Box, {
478
- as: "nav",
479
- width: "100%",
480
- display: "flex",
481
- flexDirection: "row",
482
- gap: "medium",
483
- className: clsx(navbarStyle, props.className),
484
- ...props
485
- });
486
- };
487
-
488
- //#endregion
489
- //#region src/components/Navbar/NavbarItem.tsx
490
- const NavbarItem = (props) => {
491
- return /* @__PURE__ */ React.createElement(Box, {
492
- as: "div",
493
- className: clsx(navbarItemStyle, props.className),
494
- ...props
495
- });
496
- };
497
-
498
- //#endregion
499
- //#region src/components/Card/styles.css.ts
500
- const cardVariants = styleVariants({
501
- elevated: {
502
- backgroundColor: vars.colors.backgroundDefault,
503
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",
504
- border: "none"
505
- },
506
- outlined: {
507
- backgroundColor: vars.colors.backgroundDefault,
508
- border: `1px solid ${vars.colors.borderDefault}`,
509
- boxShadow: "none"
510
- },
511
- filled: {
512
- backgroundColor: vars.colors.backgroundMuted,
513
- border: "none",
514
- boxShadow: "none"
515
- }
516
- });
517
- const card = styleWithLayer({
518
- display: "block",
519
- position: "relative",
520
- transition: "all 0.2s ease-in-out"
521
- });
522
-
523
- //#endregion
524
- //#region src/components/Card/Card.tsx
525
- const Card = ({ variant = "elevated", padding = "medium", ...props }) => {
526
- return /* @__PURE__ */ React.createElement(Box, {
527
- as: "div",
528
- borderRadius: "large",
529
- padding: padding !== "none" ? padding : void 0,
530
- className: clsx(cardVariants[variant], card, props.className),
531
- ...props
532
- }, props.children);
533
- };
534
-
535
- //#endregion
536
- //#region src/components/Alert/styles.css.ts
537
- const alertVariants = styleVariants({
538
- success: {
539
- backgroundColor: vars.colors.alertSuccessBackground,
540
- borderLeftColor: vars.colors.alertSuccessBorder,
541
- color: vars.colors.alertSuccessText
542
- },
543
- warning: {
544
- backgroundColor: vars.colors.alertWarningBackground,
545
- borderLeftColor: vars.colors.alertWarningBorder,
546
- color: vars.colors.alertWarningText
547
- },
548
- error: {
549
- backgroundColor: vars.colors.alertErrorBackground,
550
- borderLeftColor: vars.colors.alertErrorBorder,
551
- color: vars.colors.alertErrorText
552
- },
553
- info: {
554
- backgroundColor: vars.colors.alertInfoBackground,
555
- borderLeftColor: vars.colors.alertInfoBorder,
556
- color: vars.colors.alertInfoText
557
- }
558
- });
559
- const alert = styleWithLayer({
560
- padding: "1rem",
561
- borderLeft: "4px solid",
562
- borderRadius: "0.5rem",
563
- display: "flex",
564
- alignItems: "flex-start",
565
- gap: "0.5rem",
566
- fontFamily: vars.fontFamily.body,
567
- fontSize: "0.875rem",
568
- lineHeight: "1.5"
569
- });
570
- const alertContent = styleWithLayer({ flex: 1 });
571
- const alertDismissButton = styleWithLayer({
572
- background: "none",
573
- border: "none",
574
- padding: "0.25rem",
575
- cursor: "pointer",
576
- borderRadius: "0.25rem",
577
- display: "flex",
578
- alignItems: "center",
579
- justifyContent: "center",
580
- opacity: .7,
581
- transition: "opacity 0.2s ease-in-out",
582
- ":hover": { opacity: 1 }
583
- });
584
-
585
- //#endregion
586
- //#region src/components/Alert/Alert.tsx
587
- const Alert = ({ severity = "info", dismissible = false, onDismiss, children, ...props }) => {
588
- return /* @__PURE__ */ React.createElement(Box, {
589
- as: "div",
590
- role: "alert",
591
- className: clsx(alert, alertVariants[severity], props.className),
592
- ...props
593
- }, /* @__PURE__ */ React.createElement(Box, {
594
- as: "div",
595
- className: alertContent
596
- }, children), dismissible && onDismiss && /* @__PURE__ */ React.createElement(Box, {
597
- as: "button",
598
- className: alertDismissButton,
599
- onClick: onDismiss,
600
- "aria-label": "Dismiss alert",
601
- type: "button"
602
- }, "×"));
603
- };
604
-
605
- //#endregion
606
- //#region src/components/Text/P.tsx
607
- const P = (props) => {
608
- return /* @__PURE__ */ React.createElement(Box, {
609
- as: "p",
610
- className: clsx(props.className, text)
611
- }, props.children);
612
- };
613
-
614
- //#endregion
615
- //#region src/components/Text/Header.tsx
616
- const Header = ({ variant, children, className }) => {
617
- return /* @__PURE__ */ React.createElement(Box, {
618
- as: variant,
619
- className: clsx(className, text, heading)
620
- }, children);
621
- };
622
-
623
- //#endregion
624
- //#region src/components/Modal/styles.css.ts
625
- const modalVariants = styleVariants({
626
- small: { maxWidth: "400px" },
627
- medium: { maxWidth: "600px" },
628
- large: { maxWidth: "800px" },
629
- full: { maxWidth: "95vw" }
630
- });
631
- const modal = styleWithLayer({
632
- background: vars.colors.backgroundDefault,
633
- borderRadius: "0.75rem",
634
- boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
635
- border: "1px solid var(--modal-border, transparent)",
636
- color: vars.colors.textPrimary,
637
- fontFamily: vars.fontFamily.body,
638
- maxWidth: "90vw",
639
- maxHeight: "90vh",
640
- flexDirection: "column",
641
- overflow: "hidden",
642
- selectors: {
643
- "&:not([open])": { display: "none" },
644
- "[open] &": { display: "flex" },
645
- "&::backdrop": { backgroundColor: "rgba(0, 0, 0, 0.5)" }
646
- }
647
- });
648
- const modalHeader = styleWithLayer({
649
- padding: "1.25rem",
650
- borderBottom: `1px solid ${vars.colors.borderMuted}`,
651
- display: "flex",
652
- alignItems: "center",
653
- justifyContent: "space-between",
654
- gap: "1rem"
655
- });
656
- const modalTitle = styleWithLayer({
657
- fontFamily: vars.fontFamily.heading,
658
- fontSize: "1.25rem",
659
- fontWeight: "600",
660
- color: vars.colors.textPrimary,
661
- margin: 0
662
- });
663
- const modalCloseButton = styleWithLayer({
664
- background: "none",
665
- border: "none",
666
- padding: "0.5rem",
667
- cursor: "pointer",
668
- borderRadius: "0.375rem",
669
- display: "flex",
670
- alignItems: "center",
671
- justifyContent: "center",
672
- color: vars.colors.textSecondary,
673
- fontSize: "1.5rem",
674
- lineHeight: "1",
675
- transition: "background-color 0.2s ease-in-out, color 0.2s ease-in-out",
676
- selectors: {
677
- "&:hover": {
678
- backgroundColor: vars.colors.borderMuted,
679
- color: vars.colors.textPrimary
680
- },
681
- "&:focus-visible": {
682
- outline: "2px solid var(--modal-focus-ring, currentColor)",
683
- outlineOffset: "2px"
684
- }
685
- }
686
- });
687
- const modalBody = styleWithLayer({
688
- padding: "1.25rem",
689
- overflowY: "auto",
690
- flex: 1
691
- });
692
- const modalFooter = styleWithLayer({
693
- padding: "1.25rem",
694
- borderTop: `1px solid ${vars.colors.borderMuted}`,
695
- display: "flex",
696
- gap: "0.75rem",
697
- justifyContent: "flex-end",
698
- alignItems: "center"
699
- });
700
-
701
- //#endregion
702
- //#region src/components/Modal/Modal.tsx
703
- const Modal = ({ isOpen, onClose, title, size = "medium", children, footer, showCloseButton = true, ...props }) => {
704
- const dialogRef = useRef(null);
705
- useEffect(() => {
706
- const dialog = dialogRef.current;
707
- if (!dialog) return;
708
- if (isOpen) {
709
- dialog.showModal();
710
- dialog.classList.add("open");
711
- } else {
712
- dialog.close();
713
- dialog.classList.remove("open");
714
- }
715
- const handleClose = () => {
716
- onClose();
717
- };
718
- dialog.addEventListener("close", handleClose);
719
- return () => {
720
- dialog.removeEventListener("close", handleClose);
721
- };
722
- }, [isOpen, onClose]);
723
- return /* @__PURE__ */ React.createElement(Box, {
724
- as: "dialog",
725
- ref: dialogRef,
726
- className: clsx(modal, modalVariants[size]),
727
- onClick: (e) => {
728
- if (e.target === dialogRef.current) onClose();
729
- },
730
- ...props
731
- }, title && /* @__PURE__ */ React.createElement(Box, {
732
- as: "div",
733
- className: modalHeader
734
- }, /* @__PURE__ */ React.createElement(Box, {
735
- as: "h2",
736
- className: modalTitle
737
- }, title), showCloseButton && /* @__PURE__ */ React.createElement(Box, {
738
- as: "button",
739
- className: modalCloseButton,
740
- onClick: onClose,
741
- "aria-label": "Close modal",
742
- type: "button"
743
- }, "×")), /* @__PURE__ */ React.createElement(Box, {
744
- as: "div",
745
- className: modalBody
746
- }, children), footer && /* @__PURE__ */ React.createElement(Box, {
747
- as: "div",
748
- className: modalFooter
749
- }, footer));
750
- };
751
-
752
- //#endregion
753
- //#region src/components/Badge/styles.css.ts
754
- const badgeVariants = styleVariants({
755
- default: {
756
- backgroundColor: vars.colors.borderDefault,
757
- color: vars.colors.textPrimary
758
- },
759
- success: {
760
- backgroundColor: vars.colors.alertSuccessBackground,
761
- color: vars.colors.alertSuccessText,
762
- border: `1px solid ${vars.colors.alertSuccessBorder}`
763
- },
764
- warning: {
765
- backgroundColor: vars.colors.alertWarningBackground,
766
- color: vars.colors.alertWarningText,
767
- border: `1px solid ${vars.colors.alertWarningBorder}`
768
- },
769
- error: {
770
- backgroundColor: vars.colors.alertErrorBackground,
771
- color: vars.colors.alertErrorText,
772
- border: `1px solid ${vars.colors.alertErrorBorder}`
773
- },
774
- info: {
775
- backgroundColor: vars.colors.alertInfoBackground,
776
- color: vars.colors.alertInfoText,
777
- border: `1px solid ${vars.colors.alertInfoBorder}`
778
- }
779
- });
780
- const badgeSizes = styleVariants({
781
- small: {
782
- fontSize: "0.7rem",
783
- padding: "0.125rem 0.375rem",
784
- borderRadius: "0.25rem"
785
- },
786
- medium: {
787
- fontSize: "0.75rem",
788
- padding: "0.25rem 0.5rem",
789
- borderRadius: "0.375rem"
790
- },
791
- large: {
792
- fontSize: "0.875rem",
793
- padding: "0.375rem 0.625rem",
794
- borderRadius: "0.5rem"
795
- }
796
- });
797
- const badge = styleWithLayer({
798
- display: "inline-flex",
799
- alignItems: "center",
800
- justifyContent: "center",
801
- fontWeight: "500",
802
- whiteSpace: "nowrap",
803
- fontFamily: vars.fontFamily.body,
804
- transition: "background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out"
805
- });
806
- const badgeDot = styleWithLayer({
807
- width: "0.5rem",
808
- height: "0.5rem",
809
- borderRadius: "50%",
810
- display: "inline-block",
811
- padding: 0,
812
- minWidth: "auto"
813
- });
814
- const badgeDotSizes = styleVariants({
815
- small: {
816
- width: "0.375rem",
817
- height: "0.375rem"
818
- },
819
- medium: {
820
- width: "0.5rem",
821
- height: "0.5rem"
822
- },
823
- large: {
824
- width: "0.625rem",
825
- height: "0.625rem"
826
- }
827
- });
828
-
829
- //#endregion
830
- //#region src/components/Badge/Badge.tsx
831
- const Badge = ({ variant = "default", size = "medium", dot = false, children, ...props }) => {
832
- return /* @__PURE__ */ React.createElement(Box, {
833
- as: "span",
834
- className: clsx(badge, badgeVariants[variant], dot ? badgeDot : badgeSizes[size], dot && badgeDotSizes[size], props.className),
835
- ...props
836
- }, dot ? null : children);
837
- };
838
-
839
- //#endregion
840
- //#region src/components/Divider/styles.css.ts
841
- const dividerOrientations = styleVariants({
842
- horizontal: {
843
- width: "100%",
844
- height: "1px",
845
- borderTop: `1px solid ${vars.colors.borderMuted}`
846
- },
847
- vertical: {
848
- width: "1px",
849
- height: "100%",
850
- borderLeft: `1px solid ${vars.colors.borderMuted}`
851
- }
852
- });
853
- const dividerSizes = styleVariants({
854
- small: { margin: "0.5rem 0" },
855
- medium: { margin: "1rem 0" },
856
- large: { margin: "1.5rem 0" }
857
- });
858
- const divider = styleWithLayer({
859
- border: "none",
860
- flexShrink: 0
861
- });
862
- const dividerVerticalSizes = styleVariants({
863
- small: { margin: "0 0.5rem" },
864
- medium: { margin: "0 1rem" },
865
- large: { margin: "0 1.5rem" }
866
- });
867
-
868
- //#endregion
869
- //#region src/components/Divider/Divider.tsx
870
- const Divider = ({ orientation = "horizontal", size = "medium", ...props }) => {
871
- return /* @__PURE__ */ React.createElement(Box, {
872
- as: "hr",
873
- className: clsx(divider, dividerOrientations[orientation], orientation === "vertical" ? dividerVerticalSizes[size] : dividerSizes[size], props.className),
874
- role: "separator",
875
- "aria-orientation": orientation,
876
- ...props
877
- });
878
- };
879
-
880
- //#endregion
881
- //#region src/components/Spinner/styles.css.ts
882
- const spin = keyframes({
883
- "0%": { transform: "rotate(0deg)" },
884
- "100%": { transform: "rotate(360deg)" }
885
- });
886
- const spinnerColors = styleVariants({
887
- primary: {
888
- borderColor: vars.colors.borderDefault,
889
- borderTopColor: vars.colors.buttonBackgroundPrimary
890
- },
891
- secondary: {
892
- borderColor: vars.colors.borderDefault,
893
- borderTopColor: vars.colors.buttonBackgroundSecondary
894
- },
895
- success: {
896
- borderColor: vars.colors.borderDefault,
897
- borderTopColor: vars.colors.alertSuccessBorder
898
- },
899
- warning: {
900
- borderColor: vars.colors.borderDefault,
901
- borderTopColor: vars.colors.alertWarningBorder
902
- },
903
- error: {
904
- borderColor: vars.colors.borderDefault,
905
- borderTopColor: vars.colors.alertErrorBorder
906
- },
907
- info: {
908
- borderColor: vars.colors.borderDefault,
909
- borderTopColor: vars.colors.alertInfoBorder
910
- }
911
- });
912
- const spinnerSizes = styleVariants({
913
- small: {
914
- width: "1rem",
915
- height: "1rem",
916
- borderWidth: "2px"
917
- },
918
- medium: {
919
- width: "1.5rem",
920
- height: "1.5rem",
921
- borderWidth: "3px"
922
- },
923
- large: {
924
- width: "2rem",
925
- height: "2rem",
926
- borderWidth: "4px"
927
- }
928
- });
929
- const spinner = style({
930
- borderRadius: "50%",
931
- borderStyle: "solid",
932
- animation: `${spin} 1s linear infinite`,
933
- display: "inline-block"
934
- });
935
-
936
- //#endregion
937
- //#region src/components/Spinner/Spinner.tsx
938
- const Spinner = ({ color = "primary", size = "medium", role = "status", ...props }) => {
939
- return /* @__PURE__ */ React.createElement(Box, {
940
- as: "div",
941
- className: clsx(spinner, spinnerColors[color], spinnerSizes[size], props.className),
942
- role,
943
- "aria-label": "Loading",
944
- ...props
945
- });
946
- };
947
-
948
- //#endregion
949
- //#region src/components/Tooltip/styles.css.ts
950
- const tooltipPositions = styleVariants({
951
- top: {
952
- bottom: "100%",
953
- marginBottom: "0.25rem",
954
- left: "50%",
955
- transform: "translateX(-50%)"
956
- },
957
- bottom: {
958
- top: "100%",
959
- marginTop: "0.25rem",
960
- left: "50%",
961
- transform: "translateX(-50%)"
962
- },
963
- left: {
964
- right: "100%",
965
- marginRight: "0.25rem",
966
- top: "50%",
967
- transform: "translateY(-50%)"
968
- },
969
- right: {
970
- left: "100%",
971
- marginLeft: "0.25rem",
972
- top: "50%",
973
- transform: "translateY(-50%)"
974
- }
975
- });
976
- const tooltipContainer = styleWithLayer({
977
- position: "relative",
978
- display: "inline-flex"
979
- });
980
- const tooltipContent = styleWithLayer({
981
- position: "absolute",
982
- backgroundColor: vars.colors.textPrimary,
983
- color: vars.colors.backgroundDefault,
984
- padding: "0.375rem 0.75rem",
985
- borderRadius: "0.375rem",
986
- fontSize: "0.75rem",
987
- whiteSpace: "nowrap",
988
- zIndex: 1001,
989
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.15)",
990
- opacity: 0,
991
- visibility: "hidden",
992
- transition: "opacity 0.2s ease-in-out, visibility 0.2s ease-in-out",
993
- pointerEvents: "none",
994
- selectors: { "&[data-visible=\"true\"]": {
995
- opacity: 1,
996
- visibility: "visible"
997
- } }
998
- });
999
- const tooltipArrow = styleWithLayer({
1000
- position: "absolute",
1001
- width: "0",
1002
- height: "0",
1003
- borderStyle: "solid",
1004
- borderWidth: "0.25rem",
1005
- borderColor: "transparent"
1006
- });
1007
- const tooltipArrowTop = styleWithLayer({
1008
- bottom: "-0.25rem",
1009
- left: "50%",
1010
- transform: "translateX(-50%)",
1011
- borderTopColor: vars.colors.textPrimary
1012
- });
1013
- const tooltipArrowBottom = styleWithLayer({
1014
- top: "-0.25rem",
1015
- left: "50%",
1016
- transform: "translateX(-50%)",
1017
- borderBottomColor: vars.colors.textPrimary
1018
- });
1019
- const tooltipArrowLeft = styleWithLayer({
1020
- right: "-0.25rem",
1021
- top: "50%",
1022
- transform: "translateY(-50%)",
1023
- borderLeftColor: vars.colors.textPrimary
1024
- });
1025
- const tooltipArrowRight = styleWithLayer({
1026
- left: "-0.25rem",
1027
- top: "50%",
1028
- transform: "translateY(-50%)",
1029
- borderRightColor: vars.colors.textPrimary
1030
- });
1031
-
1032
- //#endregion
1033
- //#region src/components/Tooltip/Tooltip.tsx
1034
- const Tooltip = ({ content, position = "top", showArrow = true, children, ...props }) => {
1035
- const [isVisible, setIsVisible] = useState(false);
1036
- const arrowStyle = {
1037
- top: position === "bottom" ? tooltipArrowBottom : void 0,
1038
- bottom: position === "top" ? tooltipArrowTop : void 0,
1039
- left: position === "right" ? tooltipArrowLeft : void 0,
1040
- right: position === "left" ? tooltipArrowRight : void 0
1041
- };
1042
- return /* @__PURE__ */ React.createElement(Box, {
1043
- as: "div",
1044
- className: clsx(tooltipContainer, props.className),
1045
- onMouseEnter: () => setIsVisible(true),
1046
- onMouseLeave: () => setIsVisible(false),
1047
- onFocus: () => setIsVisible(true),
1048
- onBlur: () => setIsVisible(false),
1049
- ...props
1050
- }, children, /* @__PURE__ */ React.createElement(Box, {
1051
- as: "div",
1052
- className: clsx(tooltipContent, tooltipPositions[position]),
1053
- "data-visible": isVisible,
1054
- role: "tooltip"
1055
- }, showArrow && /* @__PURE__ */ React.createElement(Box, {
1056
- as: "span",
1057
- className: clsx(tooltipArrow, arrowStyle.top, arrowStyle.bottom, arrowStyle.left, arrowStyle.right)
1058
- }), content));
1059
- };
1060
-
1061
- //#endregion
1062
- //#region src/components/Toggle/styles.css.ts
1063
- const toggleSizes = styleVariants({
1064
- small: {
1065
- width: "1.5rem",
1066
- height: "0.75rem"
1067
- },
1068
- medium: {
1069
- width: "2rem",
1070
- height: "1rem"
1071
- },
1072
- large: {
1073
- width: "2.5rem",
1074
- height: "1.25rem"
1075
- }
1076
- });
1077
- const toggleLabel = styleWithLayer({
1078
- display: "inline-flex",
1079
- alignItems: "center",
1080
- cursor: "pointer"
1081
- });
1082
- const toggle = styleWithLayer({
1083
- position: "relative",
1084
- display: "inline-flex",
1085
- alignItems: "center",
1086
- selectors: { "&:has(input:disabled)": {
1087
- cursor: "not-allowed",
1088
- opacity: .5
1089
- } }
1090
- });
1091
- const toggleInput = styleWithLayer({
1092
- position: "absolute",
1093
- opacity: 0,
1094
- width: 0,
1095
- height: 0,
1096
- cursor: "pointer"
1097
- });
1098
- const toggleTrack = styleWithLayer({
1099
- borderRadius: "9999px",
1100
- transition: "background-color 0.2s ease-in-out",
1101
- backgroundColor: vars.colors.borderDefault,
1102
- position: "relative",
1103
- display: "inline-flex",
1104
- alignItems: "center",
1105
- cursor: "pointer",
1106
- selectors: { "&:hover": { backgroundColor: vars.colors.borderMuted } }
1107
- });
1108
- const toggleTrackChecked = styleWithLayer({
1109
- backgroundColor: vars.colors.buttonBackgroundPrimary,
1110
- selectors: { "&:hover": { backgroundColor: vars.colors.buttonBackgroundFocusedPrimary } }
1111
- });
1112
- const toggleTrackUnchecked = styleWithLayer({ backgroundColor: vars.colors.borderDefault });
1113
- const toggleThumb = styleWithLayer({
1114
- borderRadius: "50%",
1115
- backgroundColor: vars.colors.backgroundDefault,
1116
- position: "absolute",
1117
- transition: "transform 0.2s ease-in-out, background-color 0.2s ease-in-out",
1118
- top: "50%",
1119
- left: "0",
1120
- transform: "translateY(-50%)"
1121
- });
1122
- const toggleThumbSizes = styleVariants({
1123
- small: {
1124
- width: "0.5rem",
1125
- height: "0.5rem"
1126
- },
1127
- medium: {
1128
- width: "0.75rem",
1129
- height: "0.75rem"
1130
- },
1131
- large: {
1132
- width: "1rem",
1133
- height: "1rem"
1134
- }
1135
- });
1136
- const toggleThumbChecked = styleWithLayer({
1137
- transform: "translateY(-50%) translateX(1.25rem)",
1138
- backgroundColor: vars.colors.backgroundDefault,
1139
- selectors: {
1140
- "[data-size=\"small\"] &": { transform: "translateY(-50%) translateX(1rem)" },
1141
- "[data-size=\"large\"] &": { transform: "translateY(-50%) translateX(1.5rem)" }
1142
- }
1143
- });
1144
- const toggleThumbUnchecked = styleWithLayer({
1145
- transform: "translateY(-50%) translateX(0)",
1146
- backgroundColor: vars.colors.backgroundDefault
1147
- });
1148
- const toggleFocusRing = styleWithLayer({
1149
- position: "absolute",
1150
- inset: "-0.25rem",
1151
- borderRadius: "0.5rem",
1152
- pointerEvents: "none",
1153
- opacity: 0,
1154
- transition: "opacity 0.2s ease-in-out",
1155
- boxShadow: `0 0 0 3px ${vars.colors.buttonBackgroundPrimary}`,
1156
- selectors: { "[data-focused=\"true\"] &": { opacity: 1 } }
1157
- });
1158
-
1159
- //#endregion
1160
- //#region src/components/Toggle/Toggle.tsx
1161
- const Toggle = ({ checked = false, onChange, size = "medium", label, disabled = false, id, ...props }) => {
1162
- const [isFocused, setIsFocused] = useState(false);
1163
- const generatedId = useId();
1164
- const toggleId = id || `toggle-${generatedId}`;
1165
- const handleChange = (e) => {
1166
- if (!disabled && onChange) onChange(e.target.checked);
1167
- };
1168
- return /* @__PURE__ */ React.createElement(Box, {
1169
- as: "div",
1170
- className: toggle
1171
- }, /* @__PURE__ */ React.createElement(Box, {
1172
- as: "label",
1173
- htmlFor: toggleId,
1174
- className: toggleLabel
1175
- }, /* @__PURE__ */ React.createElement(Box, {
1176
- as: "input",
1177
- type: "checkbox",
1178
- id: toggleId,
1179
- checked,
1180
- onChange: handleChange,
1181
- disabled,
1182
- className: toggleInput,
1183
- onFocus: () => setIsFocused(true),
1184
- onBlur: () => setIsFocused(false),
1185
- "aria-checked": checked,
1186
- role: "switch",
1187
- ...props
1188
- }), /* @__PURE__ */ React.createElement(Box, {
1189
- as: "span",
1190
- className: clsx(toggleTrack, toggleSizes[size], checked ? toggleTrackChecked : toggleTrackUnchecked),
1191
- "data-size": size
1192
- }, /* @__PURE__ */ React.createElement(Box, {
1193
- as: "span",
1194
- className: clsx(toggleThumb, toggleThumbSizes[size], checked ? toggleThumbChecked : toggleThumbUnchecked)
1195
- })), /* @__PURE__ */ React.createElement(Box, {
1196
- as: "span",
1197
- className: toggleFocusRing,
1198
- "data-focused": isFocused,
1199
- "aria-hidden": "true"
1200
- })), label && /* @__PURE__ */ React.createElement(Box, {
1201
- as: "span",
1202
- marginLeft: "small"
1203
- }, label));
1204
- };
1205
-
1206
- //#endregion
1207
- //#region src/components/Checkbox/styles.css.ts
1208
- const checkboxContainer = styleWithLayer({
1209
- display: "flex",
1210
- alignItems: "center",
1211
- gap: "8px",
1212
- cursor: "pointer",
1213
- userSelect: "none"
1214
- });
1215
- const checkboxInput = style({
1216
- width: "18px",
1217
- height: "18px",
1218
- border: `2px solid ${vars.colors.borderDefault}`,
1219
- borderRadius: "4px",
1220
- cursor: "pointer",
1221
- accentColor: vars.colors.buttonBackgroundPrimary,
1222
- ":focus-visible": {
1223
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1224
- outlineOffset: "2px"
1225
- },
1226
- ":disabled": {
1227
- cursor: "not-allowed",
1228
- opacity: .5
1229
- }
1230
- });
1231
- const checkboxLabel = styleWithLayer({
1232
- fontFamily: vars.fontFamily.body,
1233
- fontSize: "14px",
1234
- color: vars.colors.textPrimary
1235
- });
1236
-
1237
- //#endregion
1238
- //#region src/components/Checkbox/Checkbox.tsx
1239
- const Checkbox = forwardRef(({ label, className, indeterminate, ...props }, ref) => {
1240
- const inputRef = useRef(null);
1241
- const combinedRef = (node) => {
1242
- if (typeof ref === "function") ref(node);
1243
- else if (ref) ref.current = node;
1244
- inputRef.current = node;
1245
- };
1246
- useEffect(() => {
1247
- if (inputRef.current) inputRef.current.indeterminate = !!indeterminate;
1248
- }, [indeterminate]);
1249
- return /* @__PURE__ */ React.createElement(Box, {
1250
- as: "label",
1251
- className: clsx(checkboxContainer, className),
1252
- display: "flex",
1253
- alignItems: "center",
1254
- gap: "small",
1255
- cursor: "pointer",
1256
- style: { userSelect: "none" }
1257
- }, /* @__PURE__ */ React.createElement(Box, {
1258
- as: "input",
1259
- type: "checkbox",
1260
- ref: combinedRef,
1261
- className: checkboxInput,
1262
- style: {
1263
- width: "18px",
1264
- height: "18px"
1265
- },
1266
- ...props
1267
- }), label && /* @__PURE__ */ React.createElement(Box, {
1268
- as: "span",
1269
- className: checkboxLabel
1270
- }, label));
1271
- });
1272
- Checkbox.displayName = "Checkbox";
1273
-
1274
- //#endregion
1275
- //#region src/components/Radio/styles.css.ts
1276
- const radioContainer = styleWithLayer({
1277
- display: "flex",
1278
- alignItems: "center",
1279
- gap: "8px",
1280
- cursor: "pointer",
1281
- userSelect: "none"
1282
- });
1283
- const radioInput = style({
1284
- width: "18px",
1285
- height: "18px",
1286
- border: `2px solid ${vars.colors.borderDefault}`,
1287
- borderRadius: "50%",
1288
- cursor: "pointer",
1289
- accentColor: vars.colors.buttonBackgroundPrimary,
1290
- ":focus-visible": {
1291
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1292
- outlineOffset: "2px"
1293
- },
1294
- ":disabled": {
1295
- cursor: "not-allowed",
1296
- opacity: .5
1297
- }
1298
- });
1299
- const radioLabel = styleWithLayer({
1300
- fontFamily: vars.fontFamily.body,
1301
- fontSize: "14px",
1302
- color: vars.colors.textPrimary
1303
- });
1304
- const radioGroup = styleWithLayer({
1305
- display: "flex",
1306
- flexDirection: "column",
1307
- gap: "8px"
1308
- });
1309
- const radioGroupHorizontal = styleWithLayer({
1310
- display: "flex",
1311
- flexDirection: "row",
1312
- gap: "16px",
1313
- flexWrap: "wrap"
1314
- });
1315
-
1316
- //#endregion
1317
- //#region src/components/Radio/Radio.tsx
1318
- const RadioContext = createContext({});
1319
- const Radio = forwardRef(({ label, className, value, ...props }, ref) => {
1320
- const context = useContext(RadioContext);
1321
- const name = context.name || props.name;
1322
- const isChecked = context.value === value;
1323
- const handleChange = () => {
1324
- if (context.onChange) context.onChange(value);
1325
- };
1326
- return /* @__PURE__ */ React.createElement(Box, {
1327
- as: "label",
1328
- className: clsx(radioContainer, className),
1329
- display: "flex",
1330
- alignItems: "center",
1331
- gap: "small",
1332
- cursor: "pointer",
1333
- style: { userSelect: "none" }
1334
- }, /* @__PURE__ */ React.createElement(Box, {
1335
- as: "input",
1336
- type: "radio",
1337
- ref,
1338
- name,
1339
- value,
1340
- checked: isChecked,
1341
- onChange: handleChange,
1342
- className: radioInput,
1343
- ...props
1344
- }), label && /* @__PURE__ */ React.createElement(Box, {
1345
- as: "span",
1346
- className: radioLabel
1347
- }, label));
1348
- });
1349
- Radio.displayName = "Radio";
1350
- const RadioGroup = ({ children, name, value, onChange, layout = "vertical", className }) => {
1351
- return /* @__PURE__ */ React.createElement(RadioContext.Provider, { value: {
1352
- name,
1353
- value,
1354
- onChange
1355
- } }, /* @__PURE__ */ React.createElement(Box, { className: clsx(layout === "horizontal" ? radioGroupHorizontal : radioGroup, className) }, children));
1356
- };
1357
- const RadioComponent = Object.assign(Radio, { Group: RadioGroup });
1358
-
1359
- //#endregion
1360
- //#region src/components/Select/styles.css.ts
1361
- const selectContainer = styleWithLayer({ width: "100%" });
1362
- const select = styleVariants({
1363
- default: {
1364
- width: "100%",
1365
- padding: "0.75rem 1rem",
1366
- fontSize: "14px",
1367
- fontFamily: vars.fontFamily.body,
1368
- color: vars.colors.textPrimary,
1369
- backgroundColor: vars.colors.inputBackground,
1370
- border: `1px solid ${vars.colors.inputBorder}`,
1371
- borderRadius: "8px",
1372
- cursor: "pointer",
1373
- outline: "none",
1374
- appearance: "none",
1375
- backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23252525' d='M6 8L1 3h10z'/%3E%3C/svg%3E")`,
1376
- backgroundRepeat: "no-repeat",
1377
- backgroundPosition: "right 12px center",
1378
- transition: "border-color 0.2s ease",
1379
- "::placeholder": { color: vars.colors.inputPlaceholder },
1380
- ":focus-visible": {
1381
- outline: `2px solid ${vars.colors.inputBorderFocused}`,
1382
- outlineOffset: "2px"
1383
- },
1384
- ":hover:not(:disabled)": { borderColor: vars.colors.inputBorderFocused },
1385
- ":disabled": {
1386
- cursor: "not-allowed",
1387
- opacity: .5,
1388
- backgroundColor: vars.colors.backgroundMuted
1389
- }
1390
- },
1391
- error: {
1392
- width: "100%",
1393
- padding: "0.75rem 1rem",
1394
- fontSize: "14px",
1395
- fontFamily: vars.fontFamily.body,
1396
- color: vars.colors.textPrimary,
1397
- backgroundColor: vars.colors.inputBackground,
1398
- border: `1px solid ${vars.colors.alertErrorBorder}`,
1399
- borderRadius: "8px",
1400
- cursor: "pointer",
1401
- outline: "none",
1402
- appearance: "none",
1403
- backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23252525' d='M6 8L1 3h10z'/%3E%3C/svg%3E")`,
1404
- backgroundRepeat: "no-repeat",
1405
- backgroundPosition: "right 12px center",
1406
- transition: "border-color 0.2s ease",
1407
- "::placeholder": { color: vars.colors.inputPlaceholder },
1408
- ":focus-visible": {
1409
- outline: `2px solid ${vars.colors.alertErrorBorder}`,
1410
- outlineOffset: "2px"
1411
- },
1412
- ":hover:not(:disabled)": { borderColor: vars.colors.alertErrorBorder },
1413
- ":disabled": {
1414
- cursor: "not-allowed",
1415
- opacity: .5,
1416
- backgroundColor: vars.colors.backgroundMuted
1417
- }
1418
- }
1419
- });
1420
- const selectLabel = styleWithLayer({
1421
- display: "block",
1422
- fontSize: "14px",
1423
- fontWeight: "500",
1424
- color: vars.colors.textPrimary,
1425
- marginBottom: "8px"
1426
- });
1427
- const selectWrapper = styleWithLayer({ width: "100%" });
1428
-
1429
- //#endregion
1430
- //#region src/components/Select/Select.tsx
1431
- const Select = forwardRef(({ label, options, error = false, fullWidth = true, className, ...props }, ref) => {
1432
- return /* @__PURE__ */ React.createElement(Box, {
1433
- className: selectWrapper,
1434
- width: "100%"
1435
- }, label && /* @__PURE__ */ React.createElement(Box, {
1436
- as: "label",
1437
- className: selectLabel,
1438
- display: "block",
1439
- fontSize: "14px",
1440
- fontWeight: "500",
1441
- color: "c5-700",
1442
- marginBottom: "small"
1443
- }, label), /* @__PURE__ */ React.createElement(Box, {
1444
- as: "select",
1445
- ref,
1446
- className: clsx(select[error ? "error" : "default"], className),
1447
- width: fullWidth ? "100%" : void 0,
1448
- ...props
1449
- }, options.map((option) => /* @__PURE__ */ React.createElement("option", {
1450
- key: option.value,
1451
- value: option.value,
1452
- disabled: option.disabled
1453
- }, option.label))));
1454
- });
1455
- Select.displayName = "Select";
1456
-
1457
- //#endregion
1458
- //#region src/components/Tabs/styles.css.ts
1459
- const tabsContainer = styleWithLayer({ width: "100%" });
1460
- const tabsList = styleWithLayer({
1461
- display: "flex",
1462
- gap: "4px",
1463
- borderBottom: `2px solid ${vars.colors.borderDefault}`,
1464
- fontFamily: vars.fontFamily.body
1465
- });
1466
- const tabsListHorizontal = styleWithLayer({
1467
- flexDirection: "row",
1468
- overflowX: "auto"
1469
- });
1470
- const tabsListVertical = styleWithLayer({
1471
- flexDirection: "column",
1472
- borderBottom: "none",
1473
- borderRight: `2px solid ${vars.colors.borderDefault}`
1474
- });
1475
- const tabItem = styleVariants({
1476
- base: {
1477
- padding: "0.75rem 1.5rem",
1478
- fontSize: "14px",
1479
- fontWeight: "500",
1480
- color: vars.colors.textSecondary,
1481
- cursor: "pointer",
1482
- border: "none",
1483
- backgroundColor: "transparent",
1484
- whiteSpace: "nowrap",
1485
- transition: "all 0.2s ease",
1486
- ":focus-visible": {
1487
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1488
- outlineOffset: "2px"
1489
- },
1490
- ":hover:not(:disabled)": {
1491
- color: vars.colors.textPrimary,
1492
- backgroundColor: vars.colors.backgroundMuted
1493
- },
1494
- ":disabled": {
1495
- cursor: "not-allowed",
1496
- opacity: .5
1497
- }
1498
- },
1499
- active: {
1500
- padding: "0.75rem 1.5rem",
1501
- fontSize: "14px",
1502
- fontWeight: "500",
1503
- color: vars.colors.buttonBackgroundPrimary,
1504
- cursor: "pointer",
1505
- border: "none",
1506
- backgroundColor: "transparent",
1507
- whiteSpace: "nowrap",
1508
- transition: "all 0.2s ease",
1509
- borderBottom: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1510
- marginBottom: "-2px",
1511
- ":focus-visible": {
1512
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1513
- outlineOffset: "2px"
1514
- },
1515
- ":hover:not(:disabled)": { backgroundColor: vars.colors.backgroundMuted },
1516
- ":disabled": {
1517
- cursor: "not-allowed",
1518
- opacity: .5
1519
- }
1520
- },
1521
- verticalActive: {
1522
- padding: "0.75rem 1.5rem",
1523
- fontSize: "14px",
1524
- fontWeight: "500",
1525
- color: vars.colors.buttonBackgroundPrimary,
1526
- cursor: "pointer",
1527
- border: "none",
1528
- backgroundColor: "transparent",
1529
- whiteSpace: "nowrap",
1530
- transition: "all 0.2s ease",
1531
- borderRight: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1532
- marginRight: "-2px",
1533
- ":focus-visible": {
1534
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1535
- outlineOffset: "2px"
1536
- },
1537
- ":hover:not(:disabled)": { backgroundColor: vars.colors.backgroundMuted },
1538
- ":disabled": {
1539
- cursor: "not-allowed",
1540
- opacity: .5
1541
- }
1542
- }
1543
- });
1544
- const tabContent = styleWithLayer({
1545
- padding: "1.5rem 0",
1546
- fontFamily: vars.fontFamily.body,
1547
- fontSize: "14px",
1548
- color: vars.colors.textPrimary
1549
- });
1550
-
1551
- //#endregion
1552
- //#region src/components/Tabs/Tabs.tsx
1553
- const TabsContext = createContext({
1554
- activeTab: "",
1555
- setActiveTab: () => {}
1556
- });
1557
- const Tabs = ({ children, defaultValue = "", orientation = "horizontal", className, onChange }) => {
1558
- const [activeTab, setActiveTab] = useState(defaultValue);
1559
- const handleTabChange = (value) => {
1560
- setActiveTab(value);
1561
- if (onChange) onChange(value);
1562
- };
1563
- return /* @__PURE__ */ React.createElement(TabsContext.Provider, { value: {
1564
- activeTab,
1565
- setActiveTab: handleTabChange,
1566
- orientation
1567
- } }, /* @__PURE__ */ React.createElement(Box, {
1568
- className: clsx(tabsContainer, className),
1569
- width: "100%"
1570
- }, children));
1571
- };
1572
- const TabList = ({ children, className }) => {
1573
- const { orientation } = useContext(TabsContext);
1574
- return /* @__PURE__ */ React.createElement(Box, {
1575
- as: "div",
1576
- role: "tablist",
1577
- className: clsx(tabsList, orientation === "vertical" ? tabsListVertical : tabsListHorizontal, className)
1578
- }, children);
1579
- };
1580
- const Tab = ({ value, children, disabled = false, className }) => {
1581
- const { activeTab, setActiveTab, orientation } = useContext(TabsContext);
1582
- const isActive = activeTab === value;
1583
- const handleClick = () => {
1584
- if (!disabled) setActiveTab(value);
1585
- };
1586
- return /* @__PURE__ */ React.createElement(Box, {
1587
- as: "button",
1588
- role: "tab",
1589
- "aria-selected": isActive,
1590
- disabled,
1591
- onClick: handleClick,
1592
- className: clsx(tabItem[orientation === "vertical" ? isActive ? "verticalActive" : "base" : isActive ? "active" : "base"], className)
1593
- }, children);
1594
- };
1595
- const TabPanel = ({ value, children, className }) => {
1596
- const { activeTab } = useContext(TabsContext);
1597
- if (!(activeTab === value)) return null;
1598
- return /* @__PURE__ */ React.createElement(Box, {
1599
- as: "div",
1600
- role: "tabpanel",
1601
- className: clsx(tabContent, className)
1602
- }, children);
1603
- };
1604
- const TabsComponent = Object.assign(Tabs, {
1605
- List: TabList,
1606
- Tab,
1607
- Panel: TabPanel
1608
- });
1609
-
1610
- //#endregion
1611
- //#region src/components/Avatar/styles.css.ts
1612
- const avatar = styleVariants({
1613
- base: {
1614
- display: "inline-flex",
1615
- alignItems: "center",
1616
- justifyContent: "center",
1617
- backgroundColor: vars.colors.backgroundMuted,
1618
- color: vars.colors.textPrimary,
1619
- fontFamily: vars.fontFamily.body,
1620
- fontWeight: "500",
1621
- overflow: "hidden",
1622
- userSelect: "none",
1623
- textDecoration: "none",
1624
- ":focus-visible": {
1625
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1626
- outlineOffset: "2px"
1627
- }
1628
- },
1629
- small: {
1630
- display: "inline-flex",
1631
- alignItems: "center",
1632
- justifyContent: "center",
1633
- backgroundColor: vars.colors.backgroundMuted,
1634
- color: vars.colors.textPrimary,
1635
- fontFamily: vars.fontFamily.body,
1636
- fontWeight: "500",
1637
- overflow: "hidden",
1638
- userSelect: "none",
1639
- textDecoration: "none",
1640
- width: "24px",
1641
- height: "24px",
1642
- fontSize: "12px",
1643
- borderRadius: "12px",
1644
- ":focus-visible": {
1645
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1646
- outlineOffset: "2px"
1647
- }
1648
- },
1649
- medium: {
1650
- display: "inline-flex",
1651
- alignItems: "center",
1652
- justifyContent: "center",
1653
- backgroundColor: vars.colors.backgroundMuted,
1654
- color: vars.colors.textPrimary,
1655
- fontFamily: vars.fontFamily.body,
1656
- fontWeight: "500",
1657
- overflow: "hidden",
1658
- userSelect: "none",
1659
- textDecoration: "none",
1660
- width: "32px",
1661
- height: "32px",
1662
- fontSize: "14px",
1663
- borderRadius: "16px",
1664
- ":focus-visible": {
1665
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1666
- outlineOffset: "2px"
1667
- }
1668
- },
1669
- large: {
1670
- display: "inline-flex",
1671
- alignItems: "center",
1672
- justifyContent: "center",
1673
- backgroundColor: vars.colors.backgroundMuted,
1674
- color: vars.colors.textPrimary,
1675
- fontFamily: vars.fontFamily.body,
1676
- fontWeight: "500",
1677
- overflow: "hidden",
1678
- userSelect: "none",
1679
- textDecoration: "none",
1680
- width: "40px",
1681
- height: "40px",
1682
- fontSize: "16px",
1683
- borderRadius: "20px",
1684
- ":focus-visible": {
1685
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1686
- outlineOffset: "2px"
1687
- }
1688
- },
1689
- xlarge: {
1690
- display: "inline-flex",
1691
- alignItems: "center",
1692
- justifyContent: "center",
1693
- backgroundColor: vars.colors.backgroundMuted,
1694
- color: vars.colors.textPrimary,
1695
- fontFamily: vars.fontFamily.body,
1696
- fontWeight: "500",
1697
- overflow: "hidden",
1698
- userSelect: "none",
1699
- textDecoration: "none",
1700
- width: "64px",
1701
- height: "64px",
1702
- fontSize: "24px",
1703
- borderRadius: "32px",
1704
- ":focus-visible": {
1705
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1706
- outlineOffset: "2px"
1707
- }
1708
- }
1709
- });
1710
- const avatarImage = style({
1711
- width: "100%",
1712
- height: "100%",
1713
- objectFit: "cover"
1714
- });
1715
- const avatarWithImage = styleVariants({
1716
- small: {
1717
- width: "24px",
1718
- height: "24px",
1719
- borderRadius: "12px",
1720
- overflow: "hidden",
1721
- ":focus-visible": {
1722
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1723
- outlineOffset: "2px"
1724
- }
1725
- },
1726
- medium: {
1727
- width: "32px",
1728
- height: "32px",
1729
- borderRadius: "16px",
1730
- overflow: "hidden",
1731
- ":focus-visible": {
1732
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1733
- outlineOffset: "2px"
1734
- }
1735
- },
1736
- large: {
1737
- width: "40px",
1738
- height: "40px",
1739
- borderRadius: "20px",
1740
- overflow: "hidden",
1741
- ":focus-visible": {
1742
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1743
- outlineOffset: "2px"
1744
- }
1745
- },
1746
- xlarge: {
1747
- width: "64px",
1748
- height: "64px",
1749
- borderRadius: "32px",
1750
- overflow: "hidden",
1751
- ":focus-visible": {
1752
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1753
- outlineOffset: "2px"
1754
- }
1755
- }
1756
- });
1757
- const avatarWrapper = styleWithLayer({ display: "inline-flex" });
1758
-
1759
- //#endregion
1760
- //#region src/components/Avatar/Avatar.tsx
1761
- const Avatar = ({ alt, className, src, size = "medium", children, fallback }) => {
1762
- const sizeClass = avatar[size];
1763
- if (src) return /* @__PURE__ */ React.createElement(Box, {
1764
- className: clsx(avatarWrapper, className),
1765
- display: "inline"
1766
- }, /* @__PURE__ */ React.createElement(Box, {
1767
- as: "img",
1768
- src,
1769
- alt: alt || "Avatar",
1770
- className: clsx(avatarWithImage[size], avatarImage)
1771
- }));
1772
- const initials = children || fallback;
1773
- return /* @__PURE__ */ React.createElement(Box, {
1774
- className: clsx(sizeClass, className),
1775
- role: "img",
1776
- "aria-label": alt
1777
- }, initials);
1778
- };
1779
-
1780
- //#endregion
1781
- //#region src/components/Tag/styles.css.ts
1782
- const tag = styleVariants({
1783
- base: {
1784
- display: "inline-flex",
1785
- alignItems: "center",
1786
- padding: "4px 12px",
1787
- fontSize: "12px",
1788
- fontWeight: "500",
1789
- fontFamily: vars.fontFamily.body,
1790
- borderRadius: "16px",
1791
- transition: "all 0.2s ease"
1792
- },
1793
- default: {
1794
- display: "inline-flex",
1795
- alignItems: "center",
1796
- padding: "4px 12px",
1797
- fontSize: "12px",
1798
- fontWeight: "500",
1799
- fontFamily: vars.fontFamily.body,
1800
- color: vars.colors.textPrimary,
1801
- backgroundColor: vars.colors.backgroundMuted,
1802
- borderRadius: "16px",
1803
- transition: "all 0.2s ease"
1804
- },
1805
- primary: {
1806
- display: "inline-flex",
1807
- alignItems: "center",
1808
- padding: "4px 12px",
1809
- fontSize: "12px",
1810
- fontWeight: "500",
1811
- fontFamily: vars.fontFamily.body,
1812
- color: vars.colors.buttonTextPrimary,
1813
- backgroundColor: vars.colors.buttonBackgroundPrimary,
1814
- borderRadius: "16px",
1815
- transition: "all 0.2s ease"
1816
- },
1817
- success: {
1818
- display: "inline-flex",
1819
- alignItems: "center",
1820
- padding: "4px 12px",
1821
- fontSize: "12px",
1822
- fontWeight: "500",
1823
- fontFamily: vars.fontFamily.body,
1824
- color: vars.colors.alertSuccessText,
1825
- backgroundColor: vars.colors.alertSuccessBackground,
1826
- borderRadius: "16px",
1827
- transition: "all 0.2s ease"
1828
- },
1829
- warning: {
1830
- display: "inline-flex",
1831
- alignItems: "center",
1832
- padding: "4px 12px",
1833
- fontSize: "12px",
1834
- fontWeight: "500",
1835
- fontFamily: vars.fontFamily.body,
1836
- color: vars.colors.alertWarningText,
1837
- backgroundColor: vars.colors.alertWarningBackground,
1838
- borderRadius: "16px",
1839
- transition: "all 0.2s ease"
1840
- },
1841
- error: {
1842
- display: "inline-flex",
1843
- alignItems: "center",
1844
- padding: "4px 12px",
1845
- fontSize: "12px",
1846
- fontWeight: "500",
1847
- fontFamily: vars.fontFamily.body,
1848
- color: vars.colors.alertErrorText,
1849
- backgroundColor: vars.colors.alertErrorBackground,
1850
- borderRadius: "16px",
1851
- transition: "all 0.2s ease"
1852
- }
1853
- });
1854
- const removeButton = style({
1855
- cursor: "pointer",
1856
- marginLeft: "8px",
1857
- display: "flex",
1858
- alignItems: "center",
1859
- justifyContent: "center",
1860
- color: vars.colors.textSecondary,
1861
- fontSize: "16px",
1862
- lineHeight: "1",
1863
- ":hover": { color: vars.colors.textPrimary }
1864
- });
1865
- const tagGroup = styleWithLayer({
1866
- display: "flex",
1867
- flexWrap: "wrap",
1868
- gap: "8px"
1869
- });
1870
-
1871
- //#endregion
1872
- //#region src/components/Tag/Tag.tsx
1873
- const Tag = ({ children, variant = "default", onRemove, removable = false, className }) => {
1874
- return /* @__PURE__ */ React.createElement(Box, {
1875
- as: "span",
1876
- className: clsx(tag[variant], className),
1877
- display: "inline",
1878
- alignItems: "center"
1879
- }, children, removable && /* @__PURE__ */ React.createElement(Box, {
1880
- as: "span",
1881
- onClick: onRemove,
1882
- className: removeButton,
1883
- role: "button",
1884
- tabIndex: 0,
1885
- "aria-label": "Remove tag",
1886
- onKeyDown: (e) => {
1887
- if (e.key === "Enter" || e.key === " ") onRemove?.();
1888
- }
1889
- }, "×"));
1890
- };
1891
- const TagGroup = ({ children, className }) => {
1892
- return /* @__PURE__ */ React.createElement(Box, {
1893
- className: clsx(tagGroup, className),
1894
- display: "flex",
1895
- gap: "small",
1896
- style: { flexWrap: "wrap" }
1897
- }, children);
1898
- };
1899
- const TagComponent = Object.assign(Tag, { Group: TagGroup });
1900
-
1901
- //#endregion
1902
- //#region src/components/Breadcrumb/styles.css.ts
1903
- const breadcrumb = styleWithLayer({
1904
- display: "flex",
1905
- alignItems: "center",
1906
- gap: "4px",
1907
- fontFamily: vars.fontFamily.body,
1908
- fontSize: "14px"
1909
- });
1910
- const breadcrumbList = style({
1911
- display: "flex",
1912
- alignItems: "center",
1913
- listStyle: "none",
1914
- margin: 0,
1915
- padding: 0,
1916
- gap: "4px"
1917
- });
1918
- const breadcrumbItem = style({
1919
- display: "flex",
1920
- alignItems: "center"
1921
- });
1922
- const breadcrumbLink = style({
1923
- display: "inline-flex",
1924
- alignItems: "center",
1925
- color: vars.colors.textSecondary,
1926
- textDecoration: "none",
1927
- fontSize: "14px",
1928
- ":hover": {
1929
- color: vars.colors.buttonBackgroundPrimary,
1930
- textDecoration: "underline"
1931
- },
1932
- ":focus-visible": {
1933
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
1934
- outlineOffset: "2px",
1935
- borderRadius: "4px"
1936
- }
1937
- });
1938
- const breadcrumbSeparator = style({
1939
- color: vars.colors.textDisabled,
1940
- fontSize: "12px",
1941
- userSelect: "none"
1942
- });
1943
- const breadcrumbCurrent = style({
1944
- display: "inline-flex",
1945
- alignItems: "center",
1946
- color: vars.colors.textPrimary,
1947
- fontSize: "14px",
1948
- fontWeight: "500"
1949
- });
1950
-
1951
- //#endregion
1952
- //#region src/components/Breadcrumb/Breadcrumb.tsx
1953
- const Breadcrumb = ({ items, className, separator = "/" }) => {
1954
- return /* @__PURE__ */ React.createElement(Box, {
1955
- as: "nav",
1956
- "aria-label": "Breadcrumb",
1957
- className: clsx(breadcrumb, className),
1958
- display: "flex",
1959
- alignItems: "center",
1960
- gap: "small",
1961
- fontSize: "14px"
1962
- }, /* @__PURE__ */ React.createElement(Box, {
1963
- as: "ol",
1964
- className: breadcrumbList,
1965
- display: "flex",
1966
- alignItems: "center",
1967
- style: { listStyle: "none" },
1968
- margin: "none",
1969
- padding: "none",
1970
- gap: "small"
1971
- }, items.map((item, index) => /* @__PURE__ */ React.createElement(Box, {
1972
- as: "li",
1973
- key: index,
1974
- className: breadcrumbItem,
1975
- display: "flex",
1976
- alignItems: "center"
1977
- }, item.href && !item.current ? /* @__PURE__ */ React.createElement(Box, {
1978
- as: "a",
1979
- href: item.href,
1980
- className: breadcrumbLink,
1981
- display: "inline",
1982
- alignItems: "center",
1983
- color: "c5-600",
1984
- fontSize: "14px",
1985
- textDecoration: "none"
1986
- }, item.label) : /* @__PURE__ */ React.createElement(Box, {
1987
- as: "span",
1988
- className: breadcrumbCurrent,
1989
- display: "inline",
1990
- alignItems: "center",
1991
- color: "c5-700",
1992
- fontSize: "14px",
1993
- fontWeight: "500"
1994
- }, item.label), index < items.length - 1 && /* @__PURE__ */ React.createElement(Box, {
1995
- as: "span",
1996
- className: breadcrumbSeparator,
1997
- color: "c5-500",
1998
- fontSize: "12px",
1999
- style: { userSelect: "none" }
2000
- }, separator)))));
2001
- };
2002
-
2003
- //#endregion
2004
- //#region src/components/Accordion/styles.css.ts
2005
- const accordion = styleWithLayer({
2006
- width: "100%",
2007
- fontFamily: vars.fontFamily.body
2008
- });
2009
- const accordionItem = style({
2010
- width: "100%",
2011
- marginBottom: "4px",
2012
- border: `1px solid ${vars.colors.borderDefault}`,
2013
- borderRadius: "8px",
2014
- overflow: "hidden"
2015
- });
2016
- const accordionHeader = style({
2017
- width: "100%",
2018
- display: "flex",
2019
- alignItems: "center",
2020
- justifyContent: "space-between",
2021
- padding: "12px 16px",
2022
- backgroundColor: vars.colors.backgroundMuted,
2023
- cursor: "pointer",
2024
- userSelect: "none",
2025
- fontSize: "14px",
2026
- fontWeight: "500",
2027
- color: vars.colors.textPrimary,
2028
- transition: "background-color 0.2s ease",
2029
- ":hover": { backgroundColor: vars.colors.backgroundDefault },
2030
- ":focus-visible": {
2031
- outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
2032
- outlineOffset: "-2px"
2033
- }
2034
- });
2035
- const accordionContent = styleVariants({
2036
- collapsed: {
2037
- display: "none",
2038
- padding: "0 16px",
2039
- fontSize: "14px",
2040
- color: vars.colors.textPrimary,
2041
- backgroundColor: vars.colors.backgroundDefault
2042
- },
2043
- expanded: {
2044
- display: "block",
2045
- padding: "12px 16px",
2046
- fontSize: "14px",
2047
- color: vars.colors.textPrimary,
2048
- backgroundColor: vars.colors.backgroundDefault,
2049
- animation: "slideDown 0.2s ease"
2050
- }
2051
- });
2052
- const accordionIcon = style({
2053
- fontSize: "12px",
2054
- transition: "transform 0.2s ease",
2055
- display: "flex",
2056
- alignItems: "center",
2057
- justifyContent: "center"
2058
- });
2059
- const accordionIconExpanded = style({ transform: "rotate(180deg)" });
2060
- const accordionGroup = styleWithLayer({ width: "100%" });
2061
-
2062
- //#endregion
2063
- //#region src/components/Accordion/Accordion.tsx
2064
- const AccordionContext = createContext({
2065
- allowMultiple: false,
2066
- expandedItems: /* @__PURE__ */ new Set(),
2067
- toggleItem: () => {}
2068
- });
2069
- const Accordion = ({ children, allowMultiple = false, className }) => {
2070
- const [expandedItems, setExpandedItems] = useState(/* @__PURE__ */ new Set());
2071
- const toggleItem = (value) => {
2072
- setExpandedItems((prev) => {
2073
- const newSet = new Set(prev);
2074
- if (newSet.has(value)) newSet.delete(value);
2075
- else if (allowMultiple) newSet.add(value);
2076
- else return new Set([value]);
2077
- return newSet;
2078
- });
2079
- };
2080
- return /* @__PURE__ */ React.createElement(AccordionContext.Provider, { value: {
2081
- allowMultiple,
2082
- expandedItems,
2083
- toggleItem
2084
- } }, /* @__PURE__ */ React.createElement(Box, {
2085
- className: clsx(accordionGroup, className),
2086
- width: "100%"
2087
- }, children));
2088
- };
2089
- const AccordionItem = ({ value, title, children, className }) => {
2090
- const { expandedItems, toggleItem } = useContext(AccordionContext);
2091
- const isExpanded = expandedItems.has(value);
2092
- const toggleExpanded = useCallback(() => {
2093
- toggleItem(value);
2094
- }, [value, toggleItem]);
2095
- return /* @__PURE__ */ React.createElement(Box, {
2096
- as: "div",
2097
- className: clsx(accordionItem, className),
2098
- width: "100%",
2099
- marginBottom: "small",
2100
- border: "small",
2101
- borderRadius: "large",
2102
- overflow: "hidden"
2103
- }, /* @__PURE__ */ React.createElement(Box, {
2104
- as: "button",
2105
- onClick: toggleExpanded,
2106
- className: accordionHeader,
2107
- display: "flex",
2108
- alignItems: "center",
2109
- justifyContent: "space-between",
2110
- padding: "small",
2111
- cursor: "pointer",
2112
- style: { userSelect: "none" },
2113
- fontSize: "14px",
2114
- fontWeight: "500",
2115
- color: "c5-700",
2116
- "aria-expanded": isExpanded,
2117
- "aria-controls": `accordion-content-${value}`
2118
- }, /* @__PURE__ */ React.createElement(Box, { as: "span" }, title), /* @__PURE__ */ React.createElement(Box, {
2119
- as: "span",
2120
- className: clsx(accordionIcon, isExpanded && accordionIconExpanded),
2121
- fontSize: "12px",
2122
- display: "flex",
2123
- alignItems: "center",
2124
- justifyContent: "center",
2125
- "aria-hidden": "true"
2126
- }, "▼")), /* @__PURE__ */ React.createElement(Box, {
2127
- as: "div",
2128
- id: `accordion-content-${value}`,
2129
- className: clsx(accordionContent[isExpanded ? "expanded" : "collapsed"]),
2130
- padding: "small",
2131
- fontSize: "14px",
2132
- color: "c5-700",
2133
- role: "region"
2134
- }, children));
2135
- };
2136
- const AccordionComponent = Object.assign(Accordion, { Item: AccordionItem });
2137
-
2138
- //#endregion
2139
- //#region src/components/Progress/styles.css.ts
2140
- const progress = styleWithLayer({ width: "100%" });
2141
- const progressBar = styleVariants({
2142
- default: {
2143
- width: "100%",
2144
- height: "8px",
2145
- backgroundColor: vars.colors.backgroundMuted,
2146
- borderRadius: "4px",
2147
- overflow: "hidden"
2148
- },
2149
- success: {
2150
- width: "100%",
2151
- height: "8px",
2152
- backgroundColor: vars.colors.alertSuccessBackground,
2153
- borderRadius: "4px",
2154
- overflow: "hidden"
2155
- },
2156
- warning: {
2157
- width: "100%",
2158
- height: "8px",
2159
- backgroundColor: vars.colors.alertWarningBackground,
2160
- borderRadius: "4px",
2161
- overflow: "hidden"
2162
- },
2163
- error: {
2164
- width: "100%",
2165
- height: "8px",
2166
- backgroundColor: vars.colors.alertErrorBackground,
2167
- borderRadius: "4px",
2168
- overflow: "hidden"
2169
- }
2170
- });
2171
- const progressFill = styleVariants({
2172
- default: {
2173
- height: "100%",
2174
- borderRadius: "4px",
2175
- transition: "width 0.3s ease",
2176
- backgroundColor: vars.colors.buttonBackgroundPrimary
2177
- },
2178
- success: {
2179
- height: "100%",
2180
- borderRadius: "4px",
2181
- transition: "width 0.3s ease",
2182
- backgroundColor: vars.colors.alertSuccessBorder
2183
- },
2184
- warning: {
2185
- height: "100%",
2186
- borderRadius: "4px",
2187
- transition: "width 0.3s ease",
2188
- backgroundColor: vars.colors.alertWarningBorder
2189
- },
2190
- error: {
2191
- height: "100%",
2192
- borderRadius: "4px",
2193
- transition: "width 0.3s ease",
2194
- backgroundColor: vars.colors.alertErrorBorder
2195
- }
2196
- });
2197
- const progressLabel = styleWithLayer({
2198
- display: "flex",
2199
- justifyContent: "space-between",
2200
- fontSize: "12px",
2201
- fontWeight: "500",
2202
- color: vars.colors.textSecondary,
2203
- marginBottom: "4px",
2204
- fontFamily: vars.fontFamily.body
2205
- });
2206
-
2207
- //#endregion
2208
- //#region src/components/Progress/Progress.tsx
2209
- const Progress = ({ value, max = 100, label, showPercentage = false, variant = "default", className }) => {
2210
- const percentage = Math.min(Math.max(value / max * 100, 0), 100);
2211
- return /* @__PURE__ */ React.createElement(Box, {
2212
- className: clsx(progress, className),
2213
- width: "100%"
2214
- }, (label || showPercentage) && /* @__PURE__ */ React.createElement(Box, {
2215
- className: progressLabel,
2216
- display: "flex",
2217
- justifyContent: "space-between",
2218
- fontSize: "12px",
2219
- fontWeight: "500",
2220
- color: "c5-600",
2221
- marginBottom: "small",
2222
- fontFamily: "body"
2223
- }, label && /* @__PURE__ */ React.createElement(Box, { as: "span" }, label), showPercentage && /* @__PURE__ */ React.createElement(Box, { as: "span" }, percentage, "%")), /* @__PURE__ */ React.createElement(Box, {
2224
- as: "div",
2225
- className: progressBar[variant],
2226
- role: "progressbar",
2227
- "aria-valuenow": value,
2228
- "aria-valuemin": 0,
2229
- "aria-valuemax": max
2230
- }, /* @__PURE__ */ React.createElement(Box, {
2231
- as: "div",
2232
- className: progressFill[variant],
2233
- style: { width: `${percentage}%` },
2234
- role: "presentation"
2235
- })));
2236
- };
2237
-
2238
- //#endregion
2239
- //#region src/components/Icon/styles.css.ts
2240
- const icon = styleWithLayer({
2241
- display: "inline-flex",
2242
- alignItems: "center",
2243
- justifyContent: "center",
2244
- fontSize: "16px",
2245
- lineHeight: "1",
2246
- userSelect: "none"
2247
- });
2248
-
2249
- //#endregion
2250
- //#region src/components/Icon/Icon.tsx
2251
- const IconComponent = ({ name, children, className, color }) => {
2252
- const displayContent = children || (name ? {
2253
- check: "✓",
2254
- error: "✗",
2255
- warning: "⚠",
2256
- info: "i",
2257
- success: "✓",
2258
- close: "×"
2259
- }[name] : void 0);
2260
- if (!displayContent) return null;
2261
- return /* @__PURE__ */ React.createElement(Box, {
2262
- as: "span",
2263
- className: clsx(icon, className),
2264
- style: { color },
2265
- "aria-hidden": "true"
2266
- }, displayContent);
2267
- };
2268
- IconComponent.displayName = "Icon";
2269
-
2270
- //#endregion
2271
- //#region src/components/Toast/styles.css.ts
2272
- const slideInRight = keyframes({
2273
- "0%": {
2274
- transform: "translateX(100%)",
2275
- opacity: "0"
2276
- },
2277
- "100%": {
2278
- transform: "translateX(0)",
2279
- opacity: "1"
2280
- }
2281
- });
2282
- const slideInLeft = keyframes({
2283
- "0%": {
2284
- transform: "translateX(-100%)",
2285
- opacity: "0"
2286
- },
2287
- "100%": {
2288
- transform: "translateX(0)",
2289
- opacity: "1"
2290
- }
2291
- });
2292
- const slideInTop = keyframes({
2293
- "0%": {
2294
- transform: "translateY(-100%)",
2295
- opacity: "0"
2296
- },
2297
- "100%": {
2298
- transform: "translateY(0)",
2299
- opacity: "1"
2300
- }
2301
- });
2302
- const slideOutRight = keyframes({
2303
- "0%": {
2304
- transform: "translateX(0)",
2305
- opacity: "1"
2306
- },
2307
- "100%": {
2308
- transform: "translateX(100%)",
2309
- opacity: "0"
2310
- }
2311
- });
2312
- const slideOutLeft = keyframes({
2313
- "0%": {
2314
- transform: "translateX(0)",
2315
- opacity: "1"
2316
- },
2317
- "100%": {
2318
- transform: "translateX(-100%)",
2319
- opacity: "0"
2320
- }
2321
- });
2322
- const slideInBottom = keyframes({
2323
- "0%": {
2324
- transform: "translateY(100%)",
2325
- opacity: "0"
2326
- },
2327
- "100%": {
2328
- transform: "translateY(0)",
2329
- opacity: "1"
2330
- }
2331
- });
2332
- const slideOutBottom = keyframes({
2333
- "0%": {
2334
- transform: "translateY(0)",
2335
- opacity: "1"
2336
- },
2337
- "100%": {
2338
- transform: "translateY(100%)",
2339
- opacity: "0"
2340
- }
2341
- });
2342
- const fadeIn$2 = keyframes({
2343
- "0%": { opacity: "0" },
2344
- "100%": { opacity: "1" }
2345
- });
2346
- const fadeOut = keyframes({
2347
- "0%": { opacity: "1" },
2348
- "100%": { opacity: "0" }
2349
- });
2350
- const fadeOutSuccess = keyframes({
2351
- "0%": { opacity: "1" },
2352
- "100%": { opacity: "0" }
2353
- });
2354
- const fadeOutError = keyframes({
2355
- "0%": { opacity: "1" },
2356
- "100%": { opacity: "0" }
2357
- });
2358
- const fadeOutWarning = keyframes({
2359
- "0%": { opacity: "1" },
2360
- "100%": { opacity: "0" }
2361
- });
2362
- const fadeOutInfo = keyframes({
2363
- "0%": { opacity: "1" },
2364
- "100%": { opacity: "0" }
2365
- });
2366
- const slideOut = keyframes({
2367
- "0%": {
2368
- transform: "translateX(0)",
2369
- opacity: "1"
2370
- },
2371
- "100%": {
2372
- transform: "translateX(100%)",
2373
- opacity: "0"
2374
- }
2375
- });
2376
- const toastContainer = style({
2377
- position: "fixed",
2378
- zIndex: "9999",
2379
- pointerEvents: "none"
2380
- });
2381
- const toastWrapper = styleVariants({
2382
- topLeft: {
2383
- position: "fixed",
2384
- top: "16px",
2385
- left: "16px",
2386
- zIndex: "9999"
2387
- },
2388
- topCenter: {
2389
- position: "fixed",
2390
- top: "16px",
2391
- left: "50%",
2392
- transform: "translateX(-50%)",
2393
- zIndex: "9999"
2394
- },
2395
- topRight: {
2396
- position: "fixed",
2397
- top: "16px",
2398
- right: "16px",
2399
- zIndex: "9999"
2400
- },
2401
- bottomLeft: {
2402
- position: "fixed",
2403
- bottom: "16px",
2404
- left: "16px",
2405
- zIndex: "9999"
2406
- },
2407
- bottomCenter: {
2408
- position: "fixed",
2409
- bottom: "16px",
2410
- left: "50%",
2411
- transform: "translateX(-50%)",
2412
- zIndex: "9999"
2413
- },
2414
- bottomRight: {
2415
- position: "fixed",
2416
- bottom: "16px",
2417
- right: "16px",
2418
- zIndex: "9999"
2419
- }
2420
- });
2421
- const toastItem = style({
2422
- width: "300px",
2423
- pointerEvents: "auto",
2424
- marginBottom: "8px"
2425
- });
2426
- const toastCloseButton = style({
2427
- background: "none",
2428
- border: "none",
2429
- cursor: "pointer",
2430
- padding: "0",
2431
- display: "flex",
2432
- alignItems: "center",
2433
- justifyContent: "center",
2434
- color: vars.colors.textSecondary,
2435
- fontSize: "16px",
2436
- lineHeight: "1",
2437
- ":hover": { color: vars.colors.textPrimary }
2438
- });
2439
- const toastProgressBarContainer = style({
2440
- position: "absolute",
2441
- left: 0,
2442
- right: 0,
2443
- bottom: 0,
2444
- height: "3px",
2445
- backgroundColor: "rgba(0, 0, 0, 0.1)",
2446
- borderRadius: "0 0 4px 4px",
2447
- overflow: "hidden"
2448
- });
2449
- const toastProgressBar = style({
2450
- height: "100%",
2451
- borderRadius: "0 0 4px 4px",
2452
- transition: "width 0.1s linear",
2453
- animation: `progressBar 0.3s ease ${fadeIn$2} forwards`
2454
- });
2455
- const toastContent = styleWithLayer({
2456
- flex: 1,
2457
- minWidth: 0
2458
- });
2459
-
2460
- //#endregion
2461
- //#region src/components/Toast/Toast.tsx
2462
- const ToastContext = createContext({
2463
- addToast: () => "",
2464
- removeToast: () => {},
2465
- handleDismissAll: () => {},
2466
- handleResumeAll: () => {}
2467
- });
2468
- const getFadeOutForVariant = (variant) => {
2469
- return {
2470
- success: fadeOutSuccess,
2471
- error: fadeOutError,
2472
- warning: fadeOutWarning,
2473
- info: fadeOutInfo
2474
- }[variant] || fadeOutInfo;
2475
- };
2476
- const positionToClassKey = {
2477
- "top-left": "topLeft",
2478
- "top-center": "topCenter",
2479
- "top-right": "topRight",
2480
- "bottom-left": "bottomLeft",
2481
- "bottom-center": "bottomCenter",
2482
- "bottom-right": "bottomRight"
2483
- };
2484
- const ToastProvider = ({ children, position = "top-right", maxVisible = 5, stacking = "stack" }) => {
2485
- const [toasts, setToasts] = useState([]);
2486
- const [pauseId, setPauseId] = useState(null);
2487
- const timeoutsRef = useRef(/* @__PURE__ */ new Map());
2488
- const pauseTimeoutRef = useRef(null);
2489
- const toastsRef = useRef([]);
2490
- useEffect(() => {
2491
- toastsRef.current = toasts;
2492
- }, [toasts]);
2493
- const removeToastInternal = useCallback((id) => {
2494
- setToasts((prev) => {
2495
- const toast = prev.find((t) => t.id === id);
2496
- if (toast) toast.options.onClose?.();
2497
- return prev.filter((t) => t.id !== id);
2498
- });
2499
- const timeout = timeoutsRef.current.get(id);
2500
- if (timeout) {
2501
- clearTimeout(timeout);
2502
- timeoutsRef.current.delete(id);
2503
- }
2504
- }, []);
2505
- const addToast = useCallback((message, variant = "info", options = {}) => {
2506
- const id = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
2507
- const duration = options.duration ?? 5e3;
2508
- const startTime = Date.now();
2509
- const newToast = {
2510
- id,
2511
- message,
2512
- variant,
2513
- options: {
2514
- ...options,
2515
- duration,
2516
- position: options.position ?? position
2517
- },
2518
- startTime,
2519
- paused: false,
2520
- duration
2521
- };
2522
- setToasts((prev) => {
2523
- if (stacking === "replace") return [newToast];
2524
- return [...prev.filter((t) => {
2525
- return Date.now() - t.startTime < (t.options.duration ?? 5e3);
2526
- }), newToast].slice(-maxVisible);
2527
- });
2528
- const timeoutId = setTimeout(() => {
2529
- removeToastInternal(id);
2530
- }, duration);
2531
- timeoutsRef.current.set(id, timeoutId);
2532
- return id;
2533
- }, [
2534
- maxVisible,
2535
- stacking,
2536
- position,
2537
- removeToastInternal
2538
- ]);
2539
- const dismissInternal = useCallback((id) => {
2540
- if (!toastsRef.current.find((t) => t.id === id)) return;
2541
- setToasts((prev) => prev.map((t) => {
2542
- if (t.id === id) return {
2543
- ...t,
2544
- paused: true
2545
- };
2546
- return t;
2547
- }));
2548
- if (pauseTimeoutRef.current) clearTimeout(pauseTimeoutRef.current);
2549
- setPauseId(id);
2550
- pauseTimeoutRef.current = setTimeout(() => {
2551
- setPauseId(null);
2552
- removeToastInternal(id);
2553
- }, 500);
2554
- const timeout = timeoutsRef.current.get(id);
2555
- if (timeout) {
2556
- clearTimeout(timeout);
2557
- timeoutsRef.current.delete(id);
2558
- }
2559
- }, [removeToastInternal]);
2560
- const dismissAllInternal = useCallback(() => {
2561
- setPauseId("all");
2562
- toastsRef.current.forEach((toast) => {
2563
- const timeout = timeoutsRef.current.get(toast.id);
2564
- if (timeout) {
2565
- clearTimeout(timeout);
2566
- timeoutsRef.current.delete(toast.id);
2567
- }
2568
- });
2569
- }, []);
2570
- const resumeAllInternal = useCallback(() => {
2571
- setPauseId(null);
2572
- toastsRef.current.forEach((toast) => {
2573
- if (toast.paused && toast.duration > 500) {
2574
- const timeout = setTimeout(() => {
2575
- removeToastInternal(toast.id);
2576
- }, toast.duration - (Date.now() - toast.startTime));
2577
- timeoutsRef.current.set(toast.id, timeout);
2578
- }
2579
- });
2580
- }, [removeToastInternal]);
2581
- useEffect(() => {
2582
- return () => {
2583
- timeoutsRef.current.forEach((timeout) => clearTimeout(timeout));
2584
- if (pauseTimeoutRef.current) clearTimeout(pauseTimeoutRef.current);
2585
- };
2586
- }, []);
2587
- const value = {
2588
- addToast,
2589
- removeToast: removeToastInternal,
2590
- handleDismissAll: dismissAllInternal,
2591
- handleResumeAll: resumeAllInternal
2592
- };
2593
- return /* @__PURE__ */ React.createElement(ToastContext.Provider, { value }, children, /* @__PURE__ */ React.createElement(ToastContainer, {
2594
- toasts,
2595
- position,
2596
- pauseId,
2597
- onDismiss: dismissInternal,
2598
- onDismissAll: dismissAllInternal,
2599
- onResumeAll: resumeAllInternal
2600
- }));
2601
- };
2602
- const ToastContainer = ({ toasts, position, pauseId, onDismiss, onDismissAll, onResumeAll }) => {
2603
- const [container, setContainer] = useState(null);
2604
- useEffect(() => {
2605
- const existingContainer = document.getElementById("toast-container");
2606
- if (existingContainer) setContainer(existingContainer);
2607
- else {
2608
- const el = document.createElement("div");
2609
- el.id = "toast-container";
2610
- document.body.appendChild(el);
2611
- setContainer(el);
2612
- }
2613
- }, []);
2614
- if (!container) return null;
2615
- return createPortal(/* @__PURE__ */ React.createElement("div", {
2616
- className: clsx(toastContainer, toastWrapper[positionToClassKey[position]]),
2617
- onMouseEnter: onDismissAll,
2618
- onMouseLeave: onResumeAll
2619
- }, toasts.map((toast) => {
2620
- const elapsed = Date.now() - toast.startTime;
2621
- const progress = (toast.duration - elapsed) / toast.duration * 100;
2622
- const fadeOutAnimation = getFadeOutForVariant(toast.variant);
2623
- return /* @__PURE__ */ React.createElement("div", {
2624
- key: toast.id,
2625
- className: toastItem,
2626
- style: {
2627
- opacity: toast.paused || pauseId !== null ? .7 : 1,
2628
- animation: `${slideInRight} 0.2s ease, 0.2s ease ${fadeOutAnimation} forwards`
2629
- },
2630
- onMouseEnter: () => onDismiss(toast.id)
2631
- }, /* @__PURE__ */ React.createElement("div", { className: toastContent }, /* @__PURE__ */ React.createElement(IconComponent, { name: toast.variant === "success" ? "check" : toast.variant === "error" ? "error" : "info" }), /* @__PURE__ */ React.createElement("span", { style: { marginLeft: "8px" } }, toast.message), toast.options.closable !== false && /* @__PURE__ */ React.createElement("button", {
2632
- type: "button",
2633
- className: toastCloseButton,
2634
- onClick: () => onDismiss(toast.id),
2635
- "aria-label": "Close toast"
2636
- }, /* @__PURE__ */ React.createElement(IconComponent, { name: "close" })), toast.duration > 0 && /* @__PURE__ */ React.createElement("div", { className: toastProgressBarContainer }, /* @__PURE__ */ React.createElement("div", {
2637
- className: toastProgressBar,
2638
- style: { width: `${progress}%` }
2639
- }))));
2640
- })), container);
2641
- };
2642
- const useToast = () => {
2643
- return useContext(ToastContext);
2644
- };
2645
- const Toast = ({ message, variant = "info", options, className }) => {
2646
- return null;
2647
- };
2648
- Toast.displayName = "Toast";
2649
-
2650
- //#endregion
2651
- //#region src/components/Table/styles.css.ts
2652
- const table = styleWithLayer({
2653
- width: "100%",
2654
- borderCollapse: "collapse",
2655
- borderSpacing: 0,
2656
- fontFamily: vars.fontFamily.body
2657
- });
2658
- const thead = styleWithLayer({
2659
- backgroundColor: vars.colors.backgroundDefault,
2660
- borderBottom: `2px solid ${vars.colors.borderDefault}`
2661
- });
2662
- const tbody = styleWithLayer({ backgroundColor: "transparent" });
2663
- const tfoot = styleWithLayer({
2664
- backgroundColor: vars.colors.backgroundMuted,
2665
- borderTop: `2px solid ${vars.colors.borderDefault}`,
2666
- fontWeight: "bold"
2667
- });
2668
- const tr = styleVariants({
2669
- default: {
2670
- borderBottom: `1px solid ${vars.colors.borderMuted}`,
2671
- ":hover": { backgroundColor: vars.colors.backgroundMuted }
2672
- },
2673
- striped: { borderBottom: `1px solid ${vars.colors.borderMuted}` }
2674
- });
2675
- const th = styleWithLayer({
2676
- padding: "12px 16px",
2677
- textAlign: "left",
2678
- fontWeight: "600",
2679
- color: vars.colors.textPrimary,
2680
- whiteSpace: "nowrap"
2681
- });
2682
- const td = styleWithLayer({
2683
- padding: "12px 16px",
2684
- color: vars.colors.textPrimary,
2685
- borderBottom: `1px solid ${vars.colors.borderMuted}`
2686
- });
2687
- const tableContainer = styleWithLayer({
2688
- overflowX: "auto",
2689
- border: `1px solid ${vars.colors.borderDefault}`,
2690
- borderRadius: "8px"
2691
- });
2692
-
2693
- //#endregion
2694
- //#region src/components/Table/Table.tsx
2695
- const TableContext = createContext({});
2696
- const TableComponent = ({ children, className, striped = false, containerClassName }) => {
2697
- return /* @__PURE__ */ React.createElement(TableContext.Provider, { value: { striped } }, /* @__PURE__ */ React.createElement(Box, {
2698
- className: clsx(tableContainer, containerClassName),
2699
- width: "100%"
2700
- }, /* @__PURE__ */ React.createElement(Box, {
2701
- as: "table",
2702
- className: clsx(table, className)
2703
- }, children)));
2704
- };
2705
- const Thead = ({ children, className }) => {
2706
- return /* @__PURE__ */ React.createElement(Box, {
2707
- as: "thead",
2708
- className: clsx(thead, className)
2709
- }, children);
2710
- };
2711
- const Tbody = ({ children, className }) => {
2712
- return /* @__PURE__ */ React.createElement(Box, {
2713
- as: "tbody",
2714
- className: clsx(tbody, className)
2715
- }, children);
2716
- };
2717
- const Tfoot = ({ children, className }) => {
2718
- return /* @__PURE__ */ React.createElement(Box, {
2719
- as: "tfoot",
2720
- className: clsx(tfoot, className)
2721
- }, children);
2722
- };
2723
- const Tr = ({ children, className }) => {
2724
- const { striped } = useContext(TableContext);
2725
- return /* @__PURE__ */ React.createElement(Box, {
2726
- as: "tr",
2727
- className: clsx(tr[striped ? "striped" : "default"], className)
2728
- }, children);
2729
- };
2730
- const Th = ({ children, className }) => {
2731
- return /* @__PURE__ */ React.createElement(Box, {
2732
- as: "th",
2733
- className: clsx(th, className)
2734
- }, children);
2735
- };
2736
- const Td = ({ children, className, colSpan, rowSpan }) => {
2737
- return /* @__PURE__ */ React.createElement(Box, {
2738
- as: "td",
2739
- className: clsx(td, className),
2740
- colSpan,
2741
- rowSpan
2742
- }, children);
2743
- };
2744
- const Table = Object.assign(TableComponent, {
2745
- Thead,
2746
- Tbody,
2747
- Tfoot,
2748
- Tr,
2749
- Th,
2750
- Td
2751
- });
2752
-
2753
- //#endregion
2754
- //#region src/components/TextArea/styles.css.ts
2755
- const textAreaStyle = styleWithLayer({
2756
- padding: "0.5rem 1rem",
2757
- borderRadius: "0.5rem",
2758
- minHeight: "100px",
2759
- resize: "vertical"
2760
- });
2761
- const label = styleWithLayer({ paddingRight: "0.5rem" });
2762
-
2763
- //#endregion
2764
- //#region src/components/TextArea/TextArea.tsx
2765
- const TextArea = (props) => {
2766
- return /* @__PURE__ */ React.createElement(Box, {
2767
- display: "flex",
2768
- flexDirection: {
2769
- mobile: "column",
2770
- tablet: "row"
2771
- },
2772
- gap: "small"
2773
- }, props.label && /* @__PURE__ */ React.createElement(Box, {
2774
- as: "label",
2775
- className: clsx(text, label),
2776
- marginX: {
2777
- mobile: "auto",
2778
- tablet: "none"
2779
- },
2780
- marginY: {
2781
- mobile: "none",
2782
- tablet: "auto"
2783
- },
2784
- htmlFor: props.id
2785
- }, props.label), /* @__PURE__ */ React.createElement(Box, {
2786
- as: "textarea",
2787
- className: clsx(textAreaStyle, props.className),
2788
- width: props.fullWidth ? "100%" : void 0,
2789
- ...props
2790
- }));
2791
- };
2792
-
2793
- //#endregion
2794
- //#region src/components/Pagination/styles.css.ts
2795
- const paginationContainer = styleWithLayer({
2796
- display: "flex",
2797
- alignItems: "center",
2798
- gap: "0.5rem"
2799
- });
2800
- const pageButton = styleWithLayer({
2801
- padding: "0.5rem 0.75rem",
2802
- borderRadius: "0.5rem",
2803
- border: `1px solid ${vars.colors.borderDefault}`,
2804
- backgroundColor: "transparent",
2805
- cursor: "pointer",
2806
- minWidth: "2.5rem",
2807
- display: "flex",
2808
- alignItems: "center",
2809
- justifyContent: "center",
2810
- ":disabled": {
2811
- cursor: "not-allowed",
2812
- opacity: .5
2813
- }
2814
- });
2815
- const pageButtonVariants = styleVariants({
2816
- default: {
2817
- color: vars.colors.textPrimary,
2818
- ":hover": { backgroundColor: vars.colors.buttonBackgroundSecondary }
2819
- },
2820
- active: {
2821
- backgroundColor: vars.colors.buttonBackgroundPrimary,
2822
- color: vars.colors.buttonTextPrimary,
2823
- borderColor: vars.colors.buttonBackgroundPrimary,
2824
- ":hover": { backgroundColor: vars.colors.buttonBackgroundFocusedPrimary }
2825
- }
2826
- });
2827
- const ellipsis = styleWithLayer({
2828
- padding: "0.5rem",
2829
- color: vars.colors.textPrimary,
2830
- userSelect: "none"
2831
- });
2832
-
2833
- //#endregion
2834
- //#region src/components/Pagination/Pagination.tsx
2835
- const Pagination = ({ currentPage, totalPages, onPageChange, siblingCount = 1, showFirstLast = true, showPrevNext = true }) => {
2836
- const generatePageNumbers = () => {
2837
- const pages = [];
2838
- const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
2839
- const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
2840
- const shouldShowLeftEllipsis = leftSiblingIndex > 2;
2841
- const shouldShowRightEllipsis = rightSiblingIndex < totalPages - 1;
2842
- if (totalPages <= 7) for (let i = 1; i <= totalPages; i++) pages.push(i);
2843
- else {
2844
- pages.push(1);
2845
- if (shouldShowLeftEllipsis) pages.push("left-ellipsis");
2846
- else if (currentPage > 3) for (let i = 2; i < leftSiblingIndex; i++) pages.push(i);
2847
- for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) if (i !== 1 && i !== totalPages) pages.push(i);
2848
- if (shouldShowRightEllipsis) pages.push("right-ellipsis");
2849
- else if (currentPage < totalPages - 2) for (let i = rightSiblingIndex + 1; i < totalPages; i++) pages.push(i);
2850
- pages.push(totalPages);
2851
- }
2852
- return pages;
2853
- };
2854
- const pages = generatePageNumbers();
2855
- return /* @__PURE__ */ React.createElement(Box, { className: paginationContainer }, showFirstLast && /* @__PURE__ */ React.createElement(Box, {
2856
- as: "button",
2857
- className: clsx(pageButton, pageButtonVariants.default),
2858
- onClick: () => onPageChange(1),
2859
- disabled: currentPage === 1
2860
- }, "<<"), showPrevNext && /* @__PURE__ */ React.createElement(Box, {
2861
- as: "button",
2862
- className: clsx(pageButton, pageButtonVariants.default),
2863
- onClick: () => onPageChange(currentPage - 1),
2864
- disabled: currentPage === 1
2865
- }, "<"), pages.map((page, index) => typeof page === "number" ? /* @__PURE__ */ React.createElement(Box, {
2866
- key: `page-${page}`,
2867
- as: "button",
2868
- className: clsx(pageButton, page === currentPage ? pageButtonVariants.active : pageButtonVariants.default),
2869
- onClick: () => onPageChange(page)
2870
- }, page) : /* @__PURE__ */ React.createElement(Box, {
2871
- key: `${page}-${index}`,
2872
- className: ellipsis
2873
- }, "...")), showPrevNext && /* @__PURE__ */ React.createElement(Box, {
2874
- as: "button",
2875
- className: clsx(pageButton, pageButtonVariants.default),
2876
- onClick: () => onPageChange(currentPage + 1),
2877
- disabled: currentPage === totalPages
2878
- }, ">"), showFirstLast && /* @__PURE__ */ React.createElement(Box, {
2879
- as: "button",
2880
- className: clsx(pageButton, pageButtonVariants.default),
2881
- onClick: () => onPageChange(totalPages),
2882
- disabled: currentPage === totalPages
2883
- }, ">>"));
2884
- };
2885
-
2886
- //#endregion
2887
- //#region src/components/Skeleton/styles.css.ts
2888
- const shimmer = keyframes({
2889
- "0%": { backgroundPosition: "-200% 0" },
2890
- "100%": { backgroundPosition: "200% 0" }
2891
- });
2892
- const pulse = keyframes({
2893
- "0%, 100%": { opacity: 1 },
2894
- "50%": { opacity: .5 }
2895
- });
2896
- const skeletonVariants = styleVariants({
2897
- text: { borderRadius: "0.25rem" },
2898
- circle: { borderRadius: "50%" },
2899
- rectangle: { borderRadius: "0.5rem" }
2900
- });
2901
- const skeletonSizes = styleVariants({
2902
- small: { height: "1rem" },
2903
- medium: { height: "1.5rem" },
2904
- large: { height: "2rem" }
2905
- });
2906
- const skeletonAnimation = styleVariants({
2907
- shimmer: {
2908
- background: `linear-gradient(
2909
- 90deg,
2910
- ${vars.colors.borderMuted} 25%,
2911
- ${vars.colors.borderDefault} 50%,
2912
- ${vars.colors.borderMuted} 75%
2913
- )`,
2914
- backgroundSize: "200% 100%",
2915
- animation: `${shimmer} 1.5s ease-in-out infinite`
2916
- },
2917
- pulse: {
2918
- backgroundColor: vars.colors.borderMuted,
2919
- animation: `${pulse} 2s ease-in-out infinite`
2920
- },
2921
- none: { backgroundColor: vars.colors.borderMuted }
2922
- });
2923
- const skeleton = styleWithLayer({
2924
- width: "100%",
2925
- display: "inline-block"
2926
- });
2927
-
2928
- //#endregion
2929
- //#region src/components/Skeleton/Skeleton.tsx
2930
- const Skeleton = ({ variant = "text", size = "medium", animation = "shimmer", width, height, count = 1, className, ...props }) => {
2931
- const style = {
2932
- width,
2933
- height
2934
- };
2935
- const skeletons = Array.from({ length: count }, (_, index) => /* @__PURE__ */ React.createElement(Box, {
2936
- key: index,
2937
- as: "span",
2938
- className: clsx(skeleton, skeletonVariants[variant], skeletonSizes[size], skeletonAnimation[animation], className),
2939
- style,
2940
- "aria-hidden": "true",
2941
- ...props
2942
- }));
2943
- return /* @__PURE__ */ React.createElement(Box, {
2944
- display: "flex",
2945
- flexDirection: "column",
2946
- gap: "small"
2947
- }, skeletons);
2948
- };
2949
-
2950
- //#endregion
2951
- //#region src/components/Drawer/styles.css.ts
2952
- const slideInFromLeft = keyframes({
2953
- from: { transform: "translateX(-100%)" },
2954
- to: { transform: "translateX(0)" }
2955
- });
2956
- const slideInFromRight = keyframes({
2957
- from: { transform: "translateX(100%)" },
2958
- to: { transform: "translateX(0)" }
2959
- });
2960
- const slideInFromTop = keyframes({
2961
- from: { transform: "translateY(-100%)" },
2962
- to: { transform: "translateY(0)" }
2963
- });
2964
- const slideInFromBottom = keyframes({
2965
- from: { transform: "translateY(100%)" },
2966
- to: { transform: "translateY(0)" }
2967
- });
2968
- const fadeIn$1 = keyframes({
2969
- from: { opacity: 0 },
2970
- to: { opacity: 1 }
2971
- });
2972
- const drawerPositionVariants = styleVariants({
2973
- left: {
2974
- top: 0,
2975
- left: 0,
2976
- bottom: 0,
2977
- width: "var(--drawer-width, 300px)",
2978
- maxWidth: "100vw",
2979
- animation: `${slideInFromLeft} 0.3s ease-out`
2980
- },
2981
- right: {
2982
- top: 0,
2983
- right: 0,
2984
- bottom: 0,
2985
- width: "var(--drawer-width, 300px)",
2986
- maxWidth: "100vw",
2987
- animation: `${slideInFromRight} 0.3s ease-out`
2988
- },
2989
- top: {
2990
- top: 0,
2991
- left: 0,
2992
- right: 0,
2993
- height: "var(--drawer-height, 300px)",
2994
- maxHeight: "100vh",
2995
- animation: `${slideInFromTop} 0.3s ease-out`
2996
- },
2997
- bottom: {
2998
- bottom: 0,
2999
- left: 0,
3000
- right: 0,
3001
- height: "var(--drawer-height, 300px)",
3002
- maxHeight: "100vh",
3003
- animation: `${slideInFromBottom} 0.3s ease-out`
3004
- }
3005
- });
3006
- const drawerOverlay = styleWithLayer({
3007
- position: "fixed",
3008
- inset: 0,
3009
- backgroundColor: "rgba(0, 0, 0, 0.5)",
3010
- animation: `${fadeIn$1} 0.2s ease-out`,
3011
- zIndex: 40
3012
- });
3013
- const drawer = styleWithLayer({
3014
- position: "fixed",
3015
- background: vars.colors.backgroundDefault,
3016
- boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
3017
- zIndex: 50,
3018
- display: "flex",
3019
- flexDirection: "column",
3020
- overflow: "hidden"
3021
- });
3022
- const drawerHeader = styleWithLayer({
3023
- padding: "1.25rem",
3024
- borderBottom: `1px solid ${vars.colors.borderMuted}`,
3025
- display: "flex",
3026
- alignItems: "center",
3027
- justifyContent: "space-between",
3028
- gap: "1rem"
3029
- });
3030
- const drawerTitle = styleWithLayer({
3031
- fontFamily: vars.fontFamily.heading,
3032
- fontSize: "1.25rem",
3033
- fontWeight: "600",
3034
- color: vars.colors.textPrimary,
3035
- margin: 0
3036
- });
3037
- const drawerCloseButton = styleWithLayer({
3038
- background: "none",
3039
- border: "none",
3040
- padding: "0.5rem",
3041
- cursor: "pointer",
3042
- borderRadius: "0.375rem",
3043
- display: "flex",
3044
- alignItems: "center",
3045
- justifyContent: "center",
3046
- color: vars.colors.textSecondary,
3047
- fontSize: "1.5rem",
3048
- lineHeight: "1",
3049
- transition: "background-color 0.2s ease-in-out, color 0.2s ease-in-out",
3050
- selectors: {
3051
- "&:hover": {
3052
- backgroundColor: vars.colors.borderMuted,
3053
- color: vars.colors.textPrimary
3054
- },
3055
- "&:focus-visible": {
3056
- outline: "2px solid var(--drawer-focus-ring, currentColor)",
3057
- outlineOffset: "2px"
3058
- }
3059
- }
3060
- });
3061
- const drawerBody = styleWithLayer({
3062
- padding: "1.25rem",
3063
- overflowY: "auto",
3064
- flex: 1
3065
- });
3066
- const drawerFooter = styleWithLayer({
3067
- padding: "1.25rem",
3068
- borderTop: `1px solid ${vars.colors.borderMuted}`,
3069
- display: "flex",
3070
- gap: "0.75rem",
3071
- justifyContent: "flex-end",
3072
- alignItems: "center"
3073
- });
3074
-
3075
- //#endregion
3076
- //#region src/components/Drawer/Drawer.tsx
3077
- const sizeMap$1 = {
3078
- left: {
3079
- small: "250px",
3080
- medium: "350px",
3081
- large: "450px",
3082
- full: "100vw"
3083
- },
3084
- right: {
3085
- small: "250px",
3086
- medium: "350px",
3087
- large: "450px",
3088
- full: "100vw"
3089
- },
3090
- top: {
3091
- small: "200px",
3092
- medium: "300px",
3093
- large: "400px",
3094
- full: "100vh"
3095
- },
3096
- bottom: {
3097
- small: "200px",
3098
- medium: "300px",
3099
- large: "400px",
3100
- full: "100vh"
3101
- }
3102
- };
3103
- const Drawer = ({ isOpen, onClose, title, position = "right", size = "medium", children, footer, showCloseButton = true, closeOnOverlayClick = true, className, ...props }) => {
3104
- useEffect(() => {
3105
- if (isOpen) document.body.style.overflow = "hidden";
3106
- else document.body.style.overflow = "";
3107
- return () => {
3108
- document.body.style.overflow = "";
3109
- };
3110
- }, [isOpen]);
3111
- useEffect(() => {
3112
- const handleEscape = (e) => {
3113
- if (e.key === "Escape" && isOpen) onClose();
3114
- };
3115
- document.addEventListener("keydown", handleEscape);
3116
- return () => document.removeEventListener("keydown", handleEscape);
3117
- }, [isOpen, onClose]);
3118
- if (!isOpen) return null;
3119
- const dimensionStyle = {
3120
- ["--drawer-width"]: ["left", "right"].includes(position) ? sizeMap$1[position][size] : void 0,
3121
- ["--drawer-height"]: ["top", "bottom"].includes(position) ? sizeMap$1[position][size] : void 0
3122
- };
3123
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, {
3124
- className: drawerOverlay,
3125
- onClick: closeOnOverlayClick ? onClose : void 0,
3126
- "aria-hidden": "true"
3127
- }), /* @__PURE__ */ React.createElement(Box, {
3128
- as: "div",
3129
- role: "dialog",
3130
- "aria-modal": "true",
3131
- className: clsx(drawer, drawerPositionVariants[position], className),
3132
- style: dimensionStyle,
3133
- ...props
3134
- }, title && /* @__PURE__ */ React.createElement(Box, {
3135
- as: "div",
3136
- className: drawerHeader
3137
- }, /* @__PURE__ */ React.createElement(Box, {
3138
- as: "h2",
3139
- className: drawerTitle
3140
- }, title), showCloseButton && /* @__PURE__ */ React.createElement(Box, {
3141
- as: "button",
3142
- className: drawerCloseButton,
3143
- onClick: onClose,
3144
- "aria-label": "Close drawer",
3145
- type: "button"
3146
- }, "×")), /* @__PURE__ */ React.createElement(Box, {
3147
- as: "div",
3148
- className: drawerBody
3149
- }, children), footer && /* @__PURE__ */ React.createElement(Box, {
3150
- as: "div",
3151
- className: drawerFooter
3152
- }, footer)));
3153
- };
3154
-
3155
- //#endregion
3156
- //#region src/components/DropdownMenu/styles.css.ts
3157
- const dropdownMenuContainer = styleWithLayer({
3158
- position: "relative",
3159
- display: "inline-block"
3160
- });
3161
- const dropdownMenuTrigger = styleWithLayer({
3162
- cursor: "pointer",
3163
- userSelect: "none"
3164
- });
3165
- const dropdownMenuContent = styleWithLayer({
3166
- position: "absolute",
3167
- backgroundColor: vars.colors.backgroundDefault,
3168
- border: `1px solid ${vars.colors.borderDefault}`,
3169
- borderRadius: "0.5rem",
3170
- boxShadow: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
3171
- minWidth: "160px",
3172
- zIndex: 50,
3173
- overflow: "hidden",
3174
- marginTop: "0.25rem"
3175
- });
3176
- const dropdownMenuPositionVariants = styleVariants({
3177
- bottomLeft: {
3178
- top: "100%",
3179
- left: 0
3180
- },
3181
- bottomRight: {
3182
- top: "100%",
3183
- right: 0
3184
- },
3185
- topLeft: {
3186
- bottom: "100%",
3187
- left: 0,
3188
- marginTop: 0,
3189
- marginBottom: "0.25rem"
3190
- },
3191
- topRight: {
3192
- bottom: "100%",
3193
- right: 0,
3194
- marginTop: 0,
3195
- marginBottom: "0.25rem"
3196
- }
3197
- });
3198
- const dropdownMenuItem = styleWithLayer({
3199
- padding: "0.75rem 1rem",
3200
- cursor: "pointer",
3201
- display: "flex",
3202
- alignItems: "center",
3203
- gap: "0.5rem",
3204
- fontSize: "14px",
3205
- color: vars.colors.textPrimary,
3206
- transition: "background-color 0.15s ease",
3207
- ":hover": { backgroundColor: vars.colors.backgroundMuted },
3208
- ":focus-visible": {
3209
- outline: "none",
3210
- backgroundColor: vars.colors.backgroundMuted
3211
- }
3212
- });
3213
- const dropdownMenuItemVariants = styleVariants({
3214
- default: {},
3215
- destructive: {
3216
- color: vars.colors.alertErrorText,
3217
- ":hover": { backgroundColor: vars.colors.alertErrorBackground }
3218
- },
3219
- disabled: {
3220
- opacity: .5,
3221
- cursor: "not-allowed",
3222
- ":hover": { backgroundColor: "transparent" }
3223
- }
3224
- });
3225
- const dropdownMenuSeparator = styleWithLayer({
3226
- height: "1px",
3227
- backgroundColor: vars.colors.borderMuted,
3228
- margin: "0.5rem 0"
3229
- });
3230
- const dropdownMenuGroup = styleWithLayer({ padding: "0.5rem 0" });
3231
- const dropdownMenuLabel = styleWithLayer({
3232
- padding: "0.5rem 1rem",
3233
- fontSize: "12px",
3234
- fontWeight: "600",
3235
- color: vars.colors.textSecondary,
3236
- textTransform: "uppercase",
3237
- letterSpacing: "0.05em"
3238
- });
3239
-
3240
- //#endregion
3241
- //#region src/components/DropdownMenu/DropdownMenu.tsx
3242
- const DropdownMenu = ({ trigger, items = [], groups = [], position = "bottomLeft", closeOnItemClick = true, className, ...props }) => {
3243
- const [isOpen, setIsOpen] = useState(false);
3244
- const containerRef = useRef(null);
3245
- useEffect(() => {
3246
- const handleClickOutside = (event) => {
3247
- if (containerRef.current && !containerRef.current.contains(event.target)) setIsOpen(false);
3248
- };
3249
- if (isOpen) document.addEventListener("mousedown", handleClickOutside);
3250
- return () => {
3251
- document.removeEventListener("mousedown", handleClickOutside);
3252
- };
3253
- }, [isOpen]);
3254
- useEffect(() => {
3255
- const handleEscape = (e) => {
3256
- if (e.key === "Escape" && isOpen) setIsOpen(false);
3257
- };
3258
- document.addEventListener("keydown", handleEscape);
3259
- return () => document.removeEventListener("keydown", handleEscape);
3260
- }, [isOpen]);
3261
- const handleItemClick = (item) => {
3262
- if (item.disabled || item.variant === "disabled") return;
3263
- item.onClick?.();
3264
- if (closeOnItemClick) setIsOpen(false);
3265
- };
3266
- const renderItem = (item, index) => /* @__PURE__ */ React.createElement(Box, {
3267
- key: index,
3268
- as: "button",
3269
- className: clsx(dropdownMenuItem, dropdownMenuItemVariants[item.disabled || item.variant === "disabled" ? "disabled" : item.variant || "default"]),
3270
- onClick: () => handleItemClick(item),
3271
- disabled: item.disabled || item.variant === "disabled",
3272
- role: "menuitem",
3273
- type: "button"
3274
- }, item.icon && /* @__PURE__ */ React.createElement("span", null, item.icon), item.label);
3275
- const renderGroup = (group, index) => /* @__PURE__ */ React.createElement(Box, {
3276
- key: index,
3277
- className: dropdownMenuGroup,
3278
- role: "group"
3279
- }, group.label && /* @__PURE__ */ React.createElement(Box, {
3280
- as: "div",
3281
- className: dropdownMenuLabel,
3282
- role: "presentation"
3283
- }, group.label), group.items.map((item, itemIndex) => renderItem(item, itemIndex)));
3284
- return /* @__PURE__ */ React.createElement(Box, {
3285
- ref: containerRef,
3286
- className: clsx(dropdownMenuContainer, className),
3287
- ...props
3288
- }, /* @__PURE__ */ React.createElement(Box, {
3289
- className: dropdownMenuTrigger,
3290
- onClick: () => setIsOpen(!isOpen),
3291
- "aria-expanded": isOpen,
3292
- "aria-haspopup": "true"
3293
- }, trigger), isOpen && /* @__PURE__ */ React.createElement(Box, {
3294
- className: clsx(dropdownMenuContent, dropdownMenuPositionVariants[position]),
3295
- role: "menu",
3296
- "aria-orientation": "vertical"
3297
- }, items.length > 0 && /* @__PURE__ */ React.createElement(Box, { className: dropdownMenuGroup }, items.map((item, index) => renderItem(item, index))), groups.map((group, index) => /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, index > 0 && /* @__PURE__ */ React.createElement(Box, {
3298
- as: "div",
3299
- className: dropdownMenuSeparator,
3300
- role: "separator"
3301
- }), renderGroup(group, index)))));
3302
- };
3303
-
3304
- //#endregion
3305
- //#region src/components/Popover/styles.css.ts
3306
- const fadeIn = keyframes({
3307
- from: {
3308
- opacity: 0,
3309
- transform: "scale(0.95)"
3310
- },
3311
- to: {
3312
- opacity: 1,
3313
- transform: "scale(1)"
3314
- }
3315
- });
3316
- const popoverContainer = styleWithLayer({
3317
- position: "relative",
3318
- display: "inline-block"
3319
- });
3320
- const popoverTrigger = styleWithLayer({ cursor: "pointer" });
3321
- const popoverContent = styleWithLayer({
3322
- position: "absolute",
3323
- backgroundColor: vars.colors.backgroundDefault,
3324
- border: `1px solid ${vars.colors.borderDefault}`,
3325
- borderRadius: "0.75rem",
3326
- boxShadow: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
3327
- zIndex: 50,
3328
- padding: "1rem",
3329
- minWidth: "200px",
3330
- maxWidth: "400px",
3331
- animation: `${fadeIn} 0.15s ease-out`
3332
- });
3333
- const popoverPositionVariants = styleVariants({
3334
- top: {
3335
- bottom: "100%",
3336
- left: "50%",
3337
- transform: "translateX(-50%)",
3338
- marginBottom: "0.5rem"
3339
- },
3340
- bottom: {
3341
- top: "100%",
3342
- left: "50%",
3343
- transform: "translateX(-50%)",
3344
- marginTop: "0.5rem"
3345
- },
3346
- left: {
3347
- right: "100%",
3348
- top: "50%",
3349
- transform: "translateY(-50%)",
3350
- marginRight: "0.5rem"
3351
- },
3352
- right: {
3353
- left: "100%",
3354
- top: "50%",
3355
- transform: "translateY(-50%)",
3356
- marginLeft: "0.5rem"
3357
- },
3358
- topLeft: {
3359
- bottom: "100%",
3360
- right: 0,
3361
- marginBottom: "0.5rem"
3362
- },
3363
- topRight: {
3364
- bottom: "100%",
3365
- left: 0,
3366
- marginBottom: "0.5rem"
3367
- },
3368
- bottomLeft: {
3369
- top: "100%",
3370
- right: 0,
3371
- marginTop: "0.5rem"
3372
- },
3373
- bottomRight: {
3374
- top: "100%",
3375
- left: 0,
3376
- marginTop: "0.5rem"
3377
- }
3378
- });
3379
- const popoverArrow = styleWithLayer({
3380
- position: "absolute",
3381
- width: "8px",
3382
- height: "8px",
3383
- backgroundColor: vars.colors.backgroundDefault,
3384
- border: `1px solid ${vars.colors.borderDefault}`,
3385
- transform: "rotate(45deg)"
3386
- });
3387
- const popoverArrowPositionVariants = styleVariants({
3388
- top: {
3389
- bottom: "-5px",
3390
- left: "50%",
3391
- transform: "translateX(-50%) rotate(45deg)",
3392
- borderTop: "none",
3393
- borderLeft: "none"
3394
- },
3395
- bottom: {
3396
- top: "-5px",
3397
- left: "50%",
3398
- transform: "translateX(-50%) rotate(45deg)",
3399
- borderBottom: "none",
3400
- borderRight: "none"
3401
- },
3402
- left: {
3403
- right: "-5px",
3404
- top: "50%",
3405
- transform: "translateY(-50%) rotate(45deg)",
3406
- borderLeft: "none",
3407
- borderBottom: "none"
3408
- },
3409
- right: {
3410
- left: "-5px",
3411
- top: "50%",
3412
- transform: "translateY(-50%) rotate(45deg)",
3413
- borderRight: "none",
3414
- borderTop: "none"
3415
- },
3416
- topLeft: {
3417
- bottom: "-5px",
3418
- right: "1rem",
3419
- transform: "rotate(45deg)",
3420
- borderTop: "none",
3421
- borderLeft: "none"
3422
- },
3423
- topRight: {
3424
- bottom: "-5px",
3425
- left: "1rem",
3426
- transform: "rotate(45deg)",
3427
- borderTop: "none",
3428
- borderLeft: "none"
3429
- },
3430
- bottomLeft: {
3431
- top: "-5px",
3432
- right: "1rem",
3433
- transform: "rotate(45deg)",
3434
- borderBottom: "none",
3435
- borderRight: "none"
3436
- },
3437
- bottomRight: {
3438
- top: "-5px",
3439
- left: "1rem",
3440
- transform: "rotate(45deg)",
3441
- borderBottom: "none",
3442
- borderRight: "none"
3443
- }
3444
- });
3445
- const popoverHeader = styleWithLayer({
3446
- display: "flex",
3447
- alignItems: "center",
3448
- justifyContent: "space-between",
3449
- marginBottom: "0.75rem",
3450
- paddingBottom: "0.75rem",
3451
- borderBottom: `1px solid ${vars.colors.borderMuted}`
3452
- });
3453
- const popoverTitle = styleWithLayer({
3454
- fontFamily: vars.fontFamily.heading,
3455
- fontSize: "1rem",
3456
- fontWeight: "600",
3457
- color: vars.colors.textPrimary,
3458
- margin: 0
3459
- });
3460
- const popoverCloseButton = styleWithLayer({
3461
- background: "none",
3462
- border: "none",
3463
- padding: "0.25rem",
3464
- cursor: "pointer",
3465
- borderRadius: "0.25rem",
3466
- display: "flex",
3467
- alignItems: "center",
3468
- justifyContent: "center",
3469
- color: vars.colors.textSecondary,
3470
- fontSize: "1.25rem",
3471
- lineHeight: "1",
3472
- marginLeft: "0.5rem",
3473
- transition: "background-color 0.2s ease-in-out, color 0.2s ease-in-out",
3474
- ":hover": {
3475
- backgroundColor: vars.colors.borderMuted,
3476
- color: vars.colors.textPrimary
3477
- }
3478
- });
3479
- const popoverBody = styleWithLayer({
3480
- fontSize: "14px",
3481
- color: vars.colors.textPrimary,
3482
- lineHeight: "1.5"
3483
- });
3484
- const popoverFooter = styleWithLayer({
3485
- display: "flex",
3486
- gap: "0.5rem",
3487
- justifyContent: "flex-end",
3488
- marginTop: "0.75rem",
3489
- paddingTop: "0.75rem",
3490
- borderTop: `1px solid ${vars.colors.borderMuted}`
3491
- });
3492
-
3493
- //#endregion
3494
- //#region src/components/Popover/Popover.tsx
3495
- const Popover = ({ trigger, children, position = "bottom", title, footer, showArrow = true, triggerType = "click", closeOnClickOutside = true, closeOnEscape = true, defaultOpen = false, onOpenChange, className, ...props }) => {
3496
- const [isOpen, setIsOpen] = useState(defaultOpen);
3497
- const containerRef = useRef(null);
3498
- useEffect(() => {
3499
- onOpenChange?.(isOpen);
3500
- }, [isOpen, onOpenChange]);
3501
- useEffect(() => {
3502
- if (!closeOnClickOutside) return;
3503
- const handleClickOutside = (event) => {
3504
- if (containerRef.current && !containerRef.current.contains(event.target)) setIsOpen(false);
3505
- };
3506
- if (isOpen) document.addEventListener("mousedown", handleClickOutside);
3507
- return () => {
3508
- document.removeEventListener("mousedown", handleClickOutside);
3509
- };
3510
- }, [isOpen, closeOnClickOutside]);
3511
- useEffect(() => {
3512
- if (!closeOnEscape) return;
3513
- const handleEscape = (e) => {
3514
- if (e.key === "Escape" && isOpen) setIsOpen(false);
3515
- };
3516
- document.addEventListener("keydown", handleEscape);
3517
- return () => document.removeEventListener("keydown", handleEscape);
3518
- }, [isOpen, closeOnEscape]);
3519
- const handleTriggerClick = () => {
3520
- if (triggerType === "click") setIsOpen(!isOpen);
3521
- };
3522
- const handleTriggerMouseEnter = () => {
3523
- if (triggerType === "hover") setIsOpen(true);
3524
- };
3525
- const handleTriggerMouseLeave = () => {
3526
- if (triggerType === "hover") setIsOpen(false);
3527
- };
3528
- return /* @__PURE__ */ React.createElement(Box, {
3529
- ref: containerRef,
3530
- className: clsx(popoverContainer, className),
3531
- onMouseEnter: handleTriggerMouseEnter,
3532
- onMouseLeave: handleTriggerMouseLeave,
3533
- ...props
3534
- }, /* @__PURE__ */ React.createElement(Box, {
3535
- className: popoverTrigger,
3536
- onClick: handleTriggerClick,
3537
- "aria-expanded": isOpen
3538
- }, trigger), isOpen && /* @__PURE__ */ React.createElement(Box, {
3539
- className: clsx(popoverContent, popoverPositionVariants[position]),
3540
- role: "dialog",
3541
- "aria-modal": "false"
3542
- }, showArrow && /* @__PURE__ */ React.createElement(Box, {
3543
- as: "span",
3544
- className: clsx(popoverArrow, popoverArrowPositionVariants[position])
3545
- }), (title || triggerType === "click") && /* @__PURE__ */ React.createElement(Box, {
3546
- as: "div",
3547
- className: popoverHeader
3548
- }, title && /* @__PURE__ */ React.createElement(Box, {
3549
- as: "h3",
3550
- className: popoverTitle
3551
- }, title), triggerType === "click" && /* @__PURE__ */ React.createElement(Box, {
3552
- as: "button",
3553
- className: popoverCloseButton,
3554
- onClick: () => setIsOpen(false),
3555
- "aria-label": "Close popover",
3556
- type: "button"
3557
- }, "×")), /* @__PURE__ */ React.createElement(Box, {
3558
- as: "div",
3559
- className: popoverBody
3560
- }, children), footer && /* @__PURE__ */ React.createElement(Box, {
3561
- as: "div",
3562
- className: popoverFooter
3563
- }, footer)));
3564
- };
3565
-
3566
- //#endregion
3567
- //#region src/components/Stepper/styles.css.ts
3568
- const stepperContainer = styleWithLayer({
3569
- display: "flex",
3570
- alignItems: "flex-start",
3571
- width: "100%"
3572
- });
3573
- const stepperHorizontal = styleWithLayer({
3574
- flexDirection: "row",
3575
- justifyContent: "space-between"
3576
- });
3577
- const stepperVertical = styleWithLayer({
3578
- flexDirection: "column",
3579
- gap: "1rem"
3580
- });
3581
- const step = styleWithLayer({
3582
- display: "flex",
3583
- flexDirection: "column",
3584
- alignItems: "center",
3585
- position: "relative",
3586
- flex: 1
3587
- });
3588
- const stepVertical = styleWithLayer({
3589
- flexDirection: "row",
3590
- alignItems: "flex-start",
3591
- gap: "1rem"
3592
- });
3593
- const stepIndicator = styleWithLayer({
3594
- width: "2.5rem",
3595
- height: "2.5rem",
3596
- borderRadius: "50%",
3597
- display: "flex",
3598
- alignItems: "center",
3599
- justifyContent: "center",
3600
- fontWeight: "600",
3601
- fontSize: "14px",
3602
- transition: "all 0.3s ease",
3603
- zIndex: 1
3604
- });
3605
- const stepIndicatorVariants = styleVariants({
3606
- pending: {
3607
- backgroundColor: vars.colors.borderMuted,
3608
- color: vars.colors.textSecondary,
3609
- border: `2px solid ${vars.colors.borderMuted}`
3610
- },
3611
- current: {
3612
- backgroundColor: vars.colors.buttonBackgroundPrimary,
3613
- color: vars.colors.buttonTextPrimary,
3614
- border: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
3615
- boxShadow: `0 0 0 4px ${vars.colors.alertInfoBackground}`
3616
- },
3617
- completed: {
3618
- backgroundColor: vars.colors.alertSuccessBorder,
3619
- color: vars.colors.buttonTextPrimary,
3620
- border: `2px solid ${vars.colors.alertSuccessBorder}`
3621
- }
3622
- });
3623
- const stepContent = styleWithLayer({
3624
- display: "flex",
3625
- flexDirection: "column",
3626
- alignItems: "center",
3627
- marginTop: "0.5rem",
3628
- textAlign: "center"
3629
- });
3630
- const stepContentVertical = styleWithLayer({
3631
- alignItems: "flex-start",
3632
- marginTop: 0,
3633
- textAlign: "left"
3634
- });
3635
- const stepTitle = styleWithLayer({
3636
- fontFamily: vars.fontFamily.heading,
3637
- fontSize: "14px",
3638
- fontWeight: "600",
3639
- color: vars.colors.textPrimary,
3640
- margin: 0
3641
- });
3642
- const stepDescription = styleWithLayer({
3643
- fontSize: "12px",
3644
- color: vars.colors.textSecondary,
3645
- marginTop: "0.25rem",
3646
- maxWidth: "200px"
3647
- });
3648
- const stepConnector = styleWithLayer({
3649
- position: "absolute",
3650
- top: "1.25rem",
3651
- left: "calc(50% + 1.5rem)",
3652
- right: "calc(-50% + 1.5rem)",
3653
- height: "2px",
3654
- backgroundColor: vars.colors.borderMuted,
3655
- zIndex: 0
3656
- });
3657
- const stepConnectorCompleted = styleWithLayer({ backgroundColor: vars.colors.alertSuccessBorder });
3658
- const stepConnectorVertical = styleWithLayer({
3659
- position: "absolute",
3660
- top: "2.5rem",
3661
- left: "1.25rem",
3662
- width: "2px",
3663
- height: "calc(100% + 1rem)",
3664
- backgroundColor: vars.colors.borderMuted,
3665
- zIndex: 0
3666
- });
3667
-
3668
- //#endregion
3669
- //#region src/components/Stepper/Stepper.tsx
3670
- const Stepper = ({ steps, currentStep = 0, orientation = "horizontal", showConnectors = true, onStepClick, clickable = false, className, ...props }) => {
3671
- const getStepStatus = (index) => {
3672
- if (index < currentStep) return "completed";
3673
- if (index === currentStep) return "current";
3674
- return "pending";
3675
- };
3676
- const handleStepClick = (index) => {
3677
- if (clickable && onStepClick) onStepClick(index);
3678
- };
3679
- return /* @__PURE__ */ React.createElement(Box, {
3680
- className: clsx(stepperContainer, orientation === "horizontal" ? stepperHorizontal : stepperVertical, className),
3681
- role: "list",
3682
- "aria-label": "Step progress",
3683
- ...props
3684
- }, steps.map((stepItem, index) => {
3685
- const status = stepItem.status || getStepStatus(index);
3686
- const isLast = index === steps.length - 1;
3687
- const isCompleted = status === "completed";
3688
- return /* @__PURE__ */ React.createElement(Box, {
3689
- key: index,
3690
- className: clsx(step, orientation === "vertical" && stepVertical),
3691
- role: "listitem",
3692
- "aria-current": status === "current" ? "step" : void 0
3693
- }, showConnectors && !isLast && orientation === "horizontal" && /* @__PURE__ */ React.createElement(Box, {
3694
- className: clsx(stepConnector, isCompleted && stepConnectorCompleted),
3695
- "aria-hidden": "true"
3696
- }), showConnectors && !isLast && orientation === "vertical" && /* @__PURE__ */ React.createElement(Box, {
3697
- className: stepConnectorVertical,
3698
- style: { backgroundColor: isCompleted ? void 0 : void 0 },
3699
- "aria-hidden": "true"
3700
- }), /* @__PURE__ */ React.createElement(Box, {
3701
- className: clsx(stepIndicator, stepIndicatorVariants[status]),
3702
- onClick: () => handleStepClick(index),
3703
- style: { cursor: clickable ? "pointer" : "default" },
3704
- "aria-label": `Step ${index + 1}: ${stepItem.title}`
3705
- }, status === "completed" ? "✓" : index + 1), /* @__PURE__ */ React.createElement(Box, { className: clsx(stepContent, orientation === "vertical" && stepContentVertical) }, /* @__PURE__ */ React.createElement(Box, {
3706
- as: "h4",
3707
- className: stepTitle
3708
- }, stepItem.title), stepItem.description && /* @__PURE__ */ React.createElement(Box, {
3709
- as: "p",
3710
- className: stepDescription
3711
- }, stepItem.description)));
3712
- }));
3713
- };
3714
-
3715
- //#endregion
3716
- //#region src/components/Combobox/styles.css.ts
3717
- const comboboxContainer = styleWithLayer({
3718
- position: "relative",
3719
- width: "100%"
3720
- });
3721
- const comboboxInput = styleWithLayer({
3722
- width: "100%",
3723
- padding: "0.75rem 2.5rem 0.75rem 1rem",
3724
- fontSize: "14px",
3725
- fontFamily: vars.fontFamily.body,
3726
- color: vars.colors.textPrimary,
3727
- backgroundColor: vars.colors.inputBackground,
3728
- border: `1px solid ${vars.colors.inputBorder}`,
3729
- borderRadius: "8px",
3730
- outline: "none",
3731
- transition: "border-color 0.2s ease",
3732
- "::placeholder": { color: vars.colors.inputPlaceholder },
3733
- ":focus-visible": {
3734
- outline: `2px solid ${vars.colors.inputBorderFocused}`,
3735
- outlineOffset: "2px"
3736
- },
3737
- ":hover": { borderColor: vars.colors.inputBorderFocused },
3738
- selectors: {
3739
- "&:disabled": {
3740
- cursor: "not-allowed",
3741
- opacity: .5,
3742
- backgroundColor: vars.colors.backgroundMuted
3743
- },
3744
- "&:disabled:hover": { borderColor: vars.colors.inputBorder }
3745
- }
3746
- });
3747
- const comboboxInputVariants = styleVariants({
3748
- default: {},
3749
- error: {
3750
- border: `1px solid ${vars.colors.alertErrorBorder}`,
3751
- ":focus-visible": { outline: `2px solid ${vars.colors.alertErrorBorder}` },
3752
- ":hover": { borderColor: vars.colors.alertErrorBorder }
3753
- }
3754
- });
3755
- const comboboxLabel = styleWithLayer({
3756
- display: "block",
3757
- fontSize: "14px",
3758
- fontWeight: "500",
3759
- color: vars.colors.textPrimary,
3760
- marginBottom: "8px"
3761
- });
3762
- const comboboxDropdown = styleWithLayer({
3763
- position: "absolute",
3764
- top: "100%",
3765
- left: 0,
3766
- right: 0,
3767
- backgroundColor: vars.colors.backgroundDefault,
3768
- border: `1px solid ${vars.colors.borderDefault}`,
3769
- borderRadius: "8px",
3770
- boxShadow: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
3771
- maxHeight: "200px",
3772
- overflowY: "auto",
3773
- zIndex: 50,
3774
- marginTop: "4px"
3775
- });
3776
- const comboboxOption = styleWithLayer({
3777
- padding: "0.75rem 1rem",
3778
- cursor: "pointer",
3779
- fontSize: "14px",
3780
- color: vars.colors.textPrimary,
3781
- transition: "background-color 0.15s ease",
3782
- ":hover": { backgroundColor: vars.colors.backgroundMuted },
3783
- ":focus-visible": {
3784
- outline: "none",
3785
- backgroundColor: vars.colors.backgroundMuted
3786
- }
3787
- });
3788
- const comboboxOptionSelected = styleWithLayer({
3789
- backgroundColor: vars.colors.buttonBackgroundPrimary,
3790
- color: vars.colors.buttonTextPrimary,
3791
- ":hover": { backgroundColor: vars.colors.buttonBackgroundFocusedPrimary }
3792
- });
3793
- const comboboxOptionDisabled = styleWithLayer({
3794
- opacity: .5,
3795
- cursor: "not-allowed",
3796
- ":hover": { backgroundColor: "transparent" }
3797
- });
3798
- const comboboxClearButton = styleWithLayer({
3799
- position: "absolute",
3800
- right: "2.5rem",
3801
- top: "50%",
3802
- transform: "translateY(-50%)",
3803
- background: "none",
3804
- border: "none",
3805
- cursor: "pointer",
3806
- padding: "0.25rem",
3807
- color: vars.colors.textSecondary,
3808
- fontSize: "16px",
3809
- display: "flex",
3810
- alignItems: "center",
3811
- justifyContent: "center",
3812
- ":hover": { color: vars.colors.textPrimary }
3813
- });
3814
- const comboboxArrow = styleWithLayer({
3815
- position: "absolute",
3816
- right: "0.75rem",
3817
- top: "50%",
3818
- transform: "translateY(-50%)",
3819
- pointerEvents: "none",
3820
- color: vars.colors.textSecondary
3821
- });
3822
- const comboboxNoResults = styleWithLayer({
3823
- padding: "0.75rem 1rem",
3824
- fontSize: "14px",
3825
- color: vars.colors.textSecondary,
3826
- textAlign: "center"
3827
- });
3828
- const comboboxHint = styleWithLayer({
3829
- fontSize: "12px",
3830
- color: vars.colors.textSecondary,
3831
- marginTop: "4px"
3832
- });
3833
- const comboboxErrorMessage = styleWithLayer({
3834
- fontSize: "12px",
3835
- color: vars.colors.alertErrorText,
3836
- marginTop: "4px"
3837
- });
3838
-
3839
- //#endregion
3840
- //#region src/components/Combobox/Combobox.tsx
3841
- const defaultFilterFn = (option, inputValue) => {
3842
- return option.label.toLowerCase().includes(inputValue.toLowerCase());
3843
- };
3844
- const Combobox = ({ label, options, value, onChange, onInputChange, placeholder = "Search...", hint, error = false, errorMessage, fullWidth = true, clearable = true, disabled = false, filterFn = defaultFilterFn, className, ...props }) => {
3845
- const [inputValue, setInputValue] = useState("");
3846
- const [isOpen, setIsOpen] = useState(false);
3847
- const [highlightedIndex, setHighlightedIndex] = useState(-1);
3848
- const containerRef = useRef(null);
3849
- const inputRef = useRef(null);
3850
- const selectedOption = options.find((opt) => opt.value === value);
3851
- useEffect(() => {
3852
- if (selectedOption) setInputValue(selectedOption.label);
3853
- else if (!isOpen) setInputValue("");
3854
- }, [selectedOption, isOpen]);
3855
- const filteredOptions = options.filter((option) => filterFn(option, inputValue));
3856
- useEffect(() => {
3857
- const handleClickOutside = (event) => {
3858
- if (containerRef.current && !containerRef.current.contains(event.target)) {
3859
- setIsOpen(false);
3860
- if (selectedOption) setInputValue(selectedOption.label);
3861
- else setInputValue("");
3862
- }
3863
- };
3864
- document.addEventListener("mousedown", handleClickOutside);
3865
- return () => document.removeEventListener("mousedown", handleClickOutside);
3866
- }, [selectedOption]);
3867
- const handleInputChange = (e) => {
3868
- const newValue = e.target.value;
3869
- setInputValue(newValue);
3870
- setIsOpen(true);
3871
- setHighlightedIndex(-1);
3872
- onInputChange?.(newValue);
3873
- if (!newValue) onChange?.("", null);
3874
- };
3875
- const handleOptionClick = (option) => {
3876
- if (option.disabled) return;
3877
- setInputValue(option.label);
3878
- setIsOpen(false);
3879
- onChange?.(option.value, option);
3880
- };
3881
- const handleClear = (e) => {
3882
- e.stopPropagation();
3883
- setInputValue("");
3884
- setIsOpen(false);
3885
- onChange?.("", null);
3886
- inputRef.current?.focus();
3887
- };
3888
- const handleKeyDown = (e) => {
3889
- if (disabled) return;
3890
- switch (e.key) {
3891
- case "ArrowDown":
3892
- e.preventDefault();
3893
- if (!isOpen) setIsOpen(true);
3894
- setHighlightedIndex((prev) => prev < filteredOptions.length - 1 ? prev + 1 : prev);
3895
- break;
3896
- case "ArrowUp":
3897
- e.preventDefault();
3898
- setHighlightedIndex((prev) => prev > 0 ? prev - 1 : prev);
3899
- break;
3900
- case "Enter":
3901
- e.preventDefault();
3902
- if (isOpen && highlightedIndex >= 0 && filteredOptions[highlightedIndex]) handleOptionClick(filteredOptions[highlightedIndex]);
3903
- else setIsOpen(!isOpen);
3904
- break;
3905
- case "Escape":
3906
- setIsOpen(false);
3907
- if (selectedOption) setInputValue(selectedOption.label);
3908
- else setInputValue("");
3909
- break;
3910
- }
3911
- };
3912
- const displayValue = selectedOption && !isOpen ? selectedOption.label : inputValue;
3913
- return /* @__PURE__ */ React.createElement(Box, {
3914
- className: comboboxContainer,
3915
- ref: containerRef,
3916
- width: fullWidth ? "100%" : void 0
3917
- }, label && /* @__PURE__ */ React.createElement(Box, {
3918
- as: "label",
3919
- className: comboboxLabel
3920
- }, label), /* @__PURE__ */ React.createElement(Box, { position: "relative" }, /* @__PURE__ */ React.createElement(Box, {
3921
- as: "input",
3922
- ref: inputRef,
3923
- type: "text",
3924
- value: displayValue,
3925
- onChange: handleInputChange,
3926
- onKeyDown: handleKeyDown,
3927
- onFocus: () => setIsOpen(true),
3928
- placeholder,
3929
- disabled,
3930
- className: clsx(comboboxInput, comboboxInputVariants[error ? "error" : "default"], className),
3931
- role: "combobox",
3932
- "aria-expanded": isOpen,
3933
- "aria-autocomplete": "list",
3934
- "aria-controls": isOpen ? "combobox-listbox" : void 0,
3935
- "aria-activedescendant": highlightedIndex >= 0 ? `option-${filteredOptions[highlightedIndex]?.value}` : void 0,
3936
- ...props
3937
- }), clearable && inputValue && !disabled && /* @__PURE__ */ React.createElement(Box, {
3938
- as: "button",
3939
- className: comboboxClearButton,
3940
- onClick: handleClear,
3941
- type: "button",
3942
- "aria-label": "Clear selection"
3943
- }, "×"), /* @__PURE__ */ React.createElement(Box, {
3944
- className: comboboxArrow,
3945
- "aria-hidden": "true"
3946
- }, /* @__PURE__ */ React.createElement("svg", {
3947
- width: "12",
3948
- height: "12",
3949
- viewBox: "0 0 12 12",
3950
- fill: "currentColor"
3951
- }, /* @__PURE__ */ React.createElement("path", { d: "M6 8L1 3h10z" })))), isOpen && /* @__PURE__ */ React.createElement(Box, {
3952
- as: "ul",
3953
- id: "combobox-listbox",
3954
- className: comboboxDropdown,
3955
- role: "listbox"
3956
- }, filteredOptions.length === 0 ? /* @__PURE__ */ React.createElement(Box, {
3957
- as: "li",
3958
- className: comboboxNoResults
3959
- }, "No results found") : filteredOptions.map((option, index) => /* @__PURE__ */ React.createElement(Box, {
3960
- key: option.value,
3961
- as: "li",
3962
- id: `option-${option.value}`,
3963
- className: clsx(comboboxOption, option.value === value && comboboxOptionSelected, option.disabled && comboboxOptionDisabled),
3964
- onClick: () => handleOptionClick(option),
3965
- role: "option",
3966
- "aria-selected": option.value === value,
3967
- "aria-disabled": option.disabled,
3968
- style: { backgroundColor: index === highlightedIndex ? "var(--highlight-color, #f3f4f6)" : void 0 }
3969
- }, option.label))), error && errorMessage && /* @__PURE__ */ React.createElement(Box, {
3970
- as: "div",
3971
- className: comboboxErrorMessage,
3972
- role: "alert"
3973
- }, errorMessage), hint && !error && /* @__PURE__ */ React.createElement(Box, {
3974
- as: "div",
3975
- className: comboboxHint
3976
- }, hint));
3977
- };
3978
-
3979
- //#endregion
3980
- //#region src/components/NumberInput/styles.css.ts
3981
- const numberInputContainer = styleWithLayer({
3982
- position: "relative",
3983
- display: "flex",
3984
- alignItems: "center",
3985
- width: "100%"
3986
- });
3987
- const numberInput = styleWithLayer({
3988
- width: "100%",
3989
- padding: "0.75rem 2.5rem",
3990
- fontSize: "14px",
3991
- fontFamily: vars.fontFamily.body,
3992
- color: vars.colors.textPrimary,
3993
- backgroundColor: vars.colors.inputBackground,
3994
- border: `1px solid ${vars.colors.inputBorder}`,
3995
- borderRadius: "8px",
3996
- outline: "none",
3997
- textAlign: "center",
3998
- transition: "border-color 0.2s ease",
3999
- "::placeholder": { color: vars.colors.inputPlaceholder },
4000
- ":focus-visible": {
4001
- outline: `2px solid ${vars.colors.inputBorderFocused}`,
4002
- outlineOffset: "2px"
4003
- },
4004
- ":hover": { borderColor: vars.colors.inputBorderFocused },
4005
- selectors: {
4006
- "&:disabled": {
4007
- cursor: "not-allowed",
4008
- opacity: .5,
4009
- backgroundColor: vars.colors.backgroundMuted
4010
- },
4011
- "&:disabled:hover": { borderColor: vars.colors.inputBorder }
4012
- }
4013
- });
4014
- const numberInputVariants = styleVariants({
4015
- default: {},
4016
- error: {
4017
- border: `1px solid ${vars.colors.alertErrorBorder}`,
4018
- ":focus-visible": { outline: `2px solid ${vars.colors.alertErrorBorder}` },
4019
- ":hover": { borderColor: vars.colors.alertErrorBorder }
4020
- }
4021
- });
4022
- const numberInputLabel = styleWithLayer({
4023
- display: "block",
4024
- fontSize: "14px",
4025
- fontWeight: "500",
4026
- color: vars.colors.textPrimary,
4027
- marginBottom: "8px"
4028
- });
4029
- const numberInputStepper = styleWithLayer({
4030
- position: "absolute",
4031
- display: "flex",
4032
- flexDirection: "column",
4033
- right: "0.5rem",
4034
- top: "50%",
4035
- transform: "translateY(-50%)",
4036
- gap: "2px"
4037
- });
4038
- const numberInputStepperLeft = styleWithLayer({
4039
- left: "0.5rem",
4040
- right: "auto"
4041
- });
4042
- const numberInputButton = styleWithLayer({
4043
- width: "1.5rem",
4044
- height: "1.25rem",
4045
- display: "flex",
4046
- alignItems: "center",
4047
- justifyContent: "center",
4048
- backgroundColor: vars.colors.buttonBackgroundSecondary,
4049
- border: `1px solid ${vars.colors.borderDefault}`,
4050
- borderRadius: "4px",
4051
- cursor: "pointer",
4052
- fontSize: "12px",
4053
- color: vars.colors.buttonTextSecondary,
4054
- transition: "all 0.15s ease",
4055
- padding: 0,
4056
- ":hover": { backgroundColor: vars.colors.buttonBackgroundFocusedSecondary },
4057
- ":active": { transform: "scale(0.95)" },
4058
- selectors: {
4059
- "&:disabled": {
4060
- cursor: "not-allowed",
4061
- opacity: .5
4062
- },
4063
- "&:disabled:hover": { backgroundColor: vars.colors.buttonBackgroundSecondary }
4064
- }
4065
- });
4066
- const numberInputWrapper = styleWithLayer({ width: "100%" });
4067
- const numberInputHint = styleWithLayer({
4068
- fontSize: "12px",
4069
- color: vars.colors.textSecondary,
4070
- marginTop: "4px"
4071
- });
4072
- const numberInputErrorMessage = styleWithLayer({
4073
- fontSize: "12px",
4074
- color: vars.colors.alertErrorText,
4075
- marginTop: "4px"
4076
- });
4077
-
4078
- //#endregion
4079
- //#region src/components/NumberInput/NumberInput.tsx
4080
- const NumberInput = ({ label, value, onChange, min = -Infinity, max = Infinity, step = 1, stepperPosition = "right", placeholder = "0", hint, error = false, errorMessage, fullWidth = true, disabled = false, allowEmpty = true, className, ...props }) => {
4081
- const handleChange = (e) => {
4082
- const inputValue = e.target.value;
4083
- if (inputValue === "") {
4084
- if (allowEmpty) onChange?.("");
4085
- else onChange?.(0);
4086
- return;
4087
- }
4088
- const numValue = parseFloat(inputValue);
4089
- if (!isNaN(numValue)) onChange?.(Math.min(Math.max(numValue, min), max));
4090
- };
4091
- const increment = useCallback(() => {
4092
- const currentValue = typeof value === "number" ? value : 0;
4093
- const newValue = Math.min(currentValue + step, max);
4094
- onChange?.(newValue);
4095
- }, [
4096
- value,
4097
- step,
4098
- max,
4099
- onChange
4100
- ]);
4101
- const decrement = useCallback(() => {
4102
- const currentValue = typeof value === "number" ? value : 0;
4103
- const newValue = Math.max(currentValue - step, min);
4104
- onChange?.(newValue);
4105
- }, [
4106
- value,
4107
- step,
4108
- min,
4109
- onChange
4110
- ]);
4111
- const isIncrementDisabled = disabled || typeof value === "number" && value >= max;
4112
- const isDecrementDisabled = disabled || typeof value === "number" && value <= min;
4113
- const displayValue = value === "" ? "" : value;
4114
- return /* @__PURE__ */ React.createElement(Box, {
4115
- className: numberInputWrapper,
4116
- width: fullWidth ? "100%" : void 0
4117
- }, label && /* @__PURE__ */ React.createElement(Box, {
4118
- as: "label",
4119
- className: numberInputLabel
4120
- }, label), /* @__PURE__ */ React.createElement(Box, { className: numberInputContainer }, /* @__PURE__ */ React.createElement(Box, {
4121
- as: "input",
4122
- type: "number",
4123
- value: displayValue,
4124
- onChange: handleChange,
4125
- min,
4126
- max,
4127
- step,
4128
- placeholder,
4129
- disabled,
4130
- className: clsx(numberInput, numberInputVariants[error ? "error" : "default"], className),
4131
- ...props
4132
- }), /* @__PURE__ */ React.createElement(Box, { className: clsx(numberInputStepper, stepperPosition === "left" && numberInputStepperLeft) }, /* @__PURE__ */ React.createElement(Box, {
4133
- as: "button",
4134
- className: numberInputButton,
4135
- onClick: increment,
4136
- disabled: isIncrementDisabled,
4137
- type: "button",
4138
- "aria-label": "Increase value"
4139
- }, "+"), /* @__PURE__ */ React.createElement(Box, {
4140
- as: "button",
4141
- className: numberInputButton,
4142
- onClick: decrement,
4143
- disabled: isDecrementDisabled,
4144
- type: "button",
4145
- "aria-label": "Decrease value"
4146
- }, "−"))), error && errorMessage && /* @__PURE__ */ React.createElement(Box, {
4147
- as: "div",
4148
- className: numberInputErrorMessage,
4149
- role: "alert"
4150
- }, errorMessage), hint && !error && /* @__PURE__ */ React.createElement(Box, {
4151
- as: "div",
4152
- className: numberInputHint
4153
- }, hint));
4154
- };
4155
-
4156
- //#endregion
4157
- //#region src/components/FileUpload/styles.css.ts
4158
- const fileUploadContainer = styleWithLayer({ width: "100%" });
4159
- const fileUploadDropzone = styleWithLayer({
4160
- border: `2px dashed ${vars.colors.borderDefault}`,
4161
- borderRadius: "12px",
4162
- padding: "2rem",
4163
- textAlign: "center",
4164
- cursor: "pointer",
4165
- transition: "all 0.2s ease",
4166
- backgroundColor: vars.colors.backgroundMuted,
4167
- ":hover": {
4168
- borderColor: vars.colors.inputBorderFocused,
4169
- backgroundColor: vars.colors.alertInfoBackground
4170
- }
4171
- });
4172
- const fileUploadDropzoneVariants = styleVariants({
4173
- default: {},
4174
- dragOver: {
4175
- borderColor: vars.colors.buttonBackgroundPrimary,
4176
- backgroundColor: vars.colors.alertInfoBackground,
4177
- borderStyle: "solid"
4178
- },
4179
- error: {
4180
- borderColor: vars.colors.alertErrorBorder,
4181
- backgroundColor: vars.colors.alertErrorBackground
4182
- },
4183
- disabled: {
4184
- cursor: "not-allowed",
4185
- opacity: .6,
4186
- ":hover": {
4187
- borderColor: vars.colors.borderDefault,
4188
- backgroundColor: vars.colors.backgroundMuted
4189
- }
4190
- }
4191
- });
4192
- const fileUploadLabel = styleWithLayer({
4193
- display: "block",
4194
- fontSize: "14px",
4195
- fontWeight: "500",
4196
- color: vars.colors.textPrimary,
4197
- marginBottom: "8px"
4198
- });
4199
- const fileUploadText = styleWithLayer({
4200
- fontSize: "14px",
4201
- color: vars.colors.textSecondary,
4202
- marginTop: "0.5rem"
4203
- });
4204
- const fileUploadHint = styleWithLayer({
4205
- fontSize: "12px",
4206
- color: vars.colors.textSecondary,
4207
- marginTop: "0.5rem"
4208
- });
4209
- const fileUploadInput = styleWithLayer({ display: "none" });
4210
- const fileUploadList = styleWithLayer({
4211
- marginTop: "1rem",
4212
- display: "flex",
4213
- flexDirection: "column",
4214
- gap: "0.75rem"
4215
- });
4216
- const fileUploadItem = styleWithLayer({
4217
- display: "flex",
4218
- alignItems: "center",
4219
- gap: "0.75rem",
4220
- padding: "0.75rem",
4221
- backgroundColor: vars.colors.backgroundDefault,
4222
- border: `1px solid ${vars.colors.borderMuted}`,
4223
- borderRadius: "8px"
4224
- });
4225
- const fileUploadItemInfo = styleWithLayer({
4226
- flex: 1,
4227
- minWidth: 0
4228
- });
4229
- const fileUploadItemName = styleWithLayer({
4230
- fontSize: "14px",
4231
- fontWeight: "500",
4232
- color: vars.colors.textPrimary,
4233
- whiteSpace: "nowrap",
4234
- overflow: "hidden",
4235
- textOverflow: "ellipsis"
4236
- });
4237
- const fileUploadItemSize = styleWithLayer({
4238
- fontSize: "12px",
4239
- color: vars.colors.textSecondary,
4240
- marginTop: "2px"
4241
- });
4242
- const fileUploadItemProgress = styleWithLayer({
4243
- flex: 1,
4244
- maxWidth: "200px"
4245
- });
4246
- const fileUploadRemoveButton = styleWithLayer({
4247
- background: "none",
4248
- border: "none",
4249
- cursor: "pointer",
4250
- padding: "0.25rem",
4251
- color: vars.colors.textSecondary,
4252
- fontSize: "18px",
4253
- display: "flex",
4254
- alignItems: "center",
4255
- justifyContent: "center",
4256
- borderRadius: "4px",
4257
- transition: "all 0.15s ease",
4258
- ":hover": {
4259
- color: vars.colors.alertErrorText,
4260
- backgroundColor: vars.colors.alertErrorBackground
4261
- }
4262
- });
4263
- const fileUploadError = styleWithLayer({
4264
- fontSize: "12px",
4265
- color: vars.colors.alertErrorText,
4266
- marginTop: "0.5rem"
4267
- });
4268
- const fileUploadIcon = styleWithLayer({
4269
- fontSize: "24px",
4270
- color: vars.colors.textSecondary
4271
- });
4272
- const fileUploadProgressBar = styleWithLayer({
4273
- width: "100%",
4274
- height: "4px",
4275
- backgroundColor: vars.colors.borderMuted,
4276
- borderRadius: "2px",
4277
- overflow: "hidden",
4278
- marginTop: "0.5rem"
4279
- });
4280
- const fileUploadProgressFill = styleWithLayer({
4281
- height: "100%",
4282
- backgroundColor: vars.colors.buttonBackgroundPrimary,
4283
- transition: "width 0.3s ease"
4284
- });
4285
- const fileUploadProgressFillVariants = styleVariants({
4286
- uploading: { backgroundColor: vars.colors.buttonBackgroundPrimary },
4287
- success: { backgroundColor: vars.colors.alertSuccessBorder },
4288
- error: { backgroundColor: vars.colors.alertErrorBorder }
4289
- });
4290
-
4291
- //#endregion
4292
- //#region src/components/FileUpload/FileUpload.tsx
4293
- const formatFileSize = (bytes) => {
4294
- if (bytes === 0) return "0 Bytes";
4295
- const k = 1024;
4296
- const sizes = [
4297
- "Bytes",
4298
- "KB",
4299
- "MB",
4300
- "GB"
4301
- ];
4302
- const i = Math.floor(Math.log(bytes) / Math.log(k));
4303
- return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
4304
- };
4305
- const FileUpload = ({ label, files = [], onFilesChange, onFileAdd, onFileRemove, accept, multiple = false, maxFileSize, maxFiles, disabled = false, dropzoneText = "Drag and drop files here, or click to browse", hint, showProgress = true, className, ...props }) => {
4306
- const [isDragOver, setIsDragOver] = useState(false);
4307
- const [error, setError] = useState(null);
4308
- const inputRef = useRef(null);
4309
- const validateFile = (file) => {
4310
- if (maxFileSize && file.size > maxFileSize) return `File size exceeds ${formatFileSize(maxFileSize)}`;
4311
- if (accept) {
4312
- if (!accept.split(",").map((type) => type.trim()).some((type) => {
4313
- if (type.includes("*")) return file.type.startsWith(type.replace("/*", ""));
4314
- return file.type === type || file.name.endsWith(type);
4315
- })) return `File type not accepted. Allowed: ${accept}`;
4316
- }
4317
- return null;
4318
- };
4319
- const handleFiles = useCallback((fileList) => {
4320
- if (!fileList || disabled) return;
4321
- const newFiles = [];
4322
- const errors = [];
4323
- Array.from(fileList).forEach((file) => {
4324
- const validationError = validateFile(file);
4325
- if (validationError) errors.push(`${file.name}: ${validationError}`);
4326
- else newFiles.push(file);
4327
- });
4328
- if (maxFiles && files.length + newFiles.length > maxFiles) {
4329
- errors.push(`Maximum ${maxFiles} files allowed`);
4330
- newFiles.splice(maxFiles - files.length);
4331
- }
4332
- if (errors.length > 0) setError(errors.join(", "));
4333
- else setError(null);
4334
- if (newFiles.length > 0) onFileAdd?.(newFiles);
4335
- }, [
4336
- disabled,
4337
- files.length,
4338
- maxFileSize,
4339
- maxFiles,
4340
- accept,
4341
- onFileAdd
4342
- ]);
4343
- const handleDragOver = (e) => {
4344
- e.preventDefault();
4345
- if (!disabled) setIsDragOver(true);
4346
- };
4347
- const handleDragLeave = (e) => {
4348
- e.preventDefault();
4349
- setIsDragOver(false);
4350
- };
4351
- const handleDrop = (e) => {
4352
- e.preventDefault();
4353
- setIsDragOver(false);
4354
- handleFiles(e.dataTransfer.files);
4355
- };
4356
- const handleClick = () => {
4357
- if (!disabled) inputRef.current?.click();
4358
- };
4359
- const handleInputChange = (e) => {
4360
- handleFiles(e.target.files);
4361
- e.target.value = "";
4362
- };
4363
- const handleRemove = (fileId) => {
4364
- onFileRemove?.(fileId);
4365
- };
4366
- const getVariant = () => {
4367
- if (disabled) return "disabled";
4368
- if (error) return "error";
4369
- if (isDragOver) return "dragOver";
4370
- return "default";
4371
- };
4372
- return /* @__PURE__ */ React.createElement(Box, {
4373
- className: clsx(fileUploadContainer, className),
4374
- ...props
4375
- }, label && /* @__PURE__ */ React.createElement(Box, {
4376
- as: "label",
4377
- className: fileUploadLabel
4378
- }, label), /* @__PURE__ */ React.createElement(Box, {
4379
- as: "div",
4380
- className: clsx(fileUploadDropzone, fileUploadDropzoneVariants[getVariant()]),
4381
- onDragOver: handleDragOver,
4382
- onDragLeave: handleDragLeave,
4383
- onDrop: handleDrop,
4384
- onClick: handleClick,
4385
- role: "button",
4386
- tabIndex: disabled ? -1 : 0,
4387
- "aria-disabled": disabled
4388
- }, /* @__PURE__ */ React.createElement(Box, {
4389
- className: fileUploadIcon,
4390
- "aria-hidden": "true"
4391
- }, /* @__PURE__ */ React.createElement("svg", {
4392
- width: "48",
4393
- height: "48",
4394
- viewBox: "0 0 24 24",
4395
- fill: "none",
4396
- stroke: "currentColor",
4397
- strokeWidth: "2"
4398
- }, /* @__PURE__ */ React.createElement("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }), /* @__PURE__ */ React.createElement("polyline", { points: "17,8 12,3 7,8" }), /* @__PURE__ */ React.createElement("line", {
4399
- x1: "12",
4400
- y1: "3",
4401
- x2: "12",
4402
- y2: "15"
4403
- }))), /* @__PURE__ */ React.createElement(Box, {
4404
- as: "p",
4405
- className: fileUploadText
4406
- }, dropzoneText), hint && /* @__PURE__ */ React.createElement(Box, {
4407
- as: "p",
4408
- className: fileUploadHint
4409
- }, hint), /* @__PURE__ */ React.createElement(Box, {
4410
- as: "input",
4411
- ref: inputRef,
4412
- type: "file",
4413
- className: fileUploadInput,
4414
- onChange: handleInputChange,
4415
- accept,
4416
- multiple,
4417
- disabled,
4418
- "aria-label": "File upload input"
4419
- })), error && /* @__PURE__ */ React.createElement(Box, {
4420
- as: "p",
4421
- className: fileUploadError,
4422
- role: "alert"
4423
- }, error), files.length > 0 && /* @__PURE__ */ React.createElement(Box, {
4424
- as: "ul",
4425
- className: fileUploadList,
4426
- "aria-label": "Uploaded files"
4427
- }, files.map((file) => /* @__PURE__ */ React.createElement(Box, {
4428
- key: file.id,
4429
- as: "li",
4430
- className: fileUploadItem
4431
- }, /* @__PURE__ */ React.createElement(Box, { className: fileUploadItemInfo }, /* @__PURE__ */ React.createElement(Box, {
4432
- as: "p",
4433
- className: fileUploadItemName,
4434
- title: file.name
4435
- }, file.name), /* @__PURE__ */ React.createElement(Box, {
4436
- as: "p",
4437
- className: fileUploadItemSize
4438
- }, formatFileSize(file.size), file.status === "uploading" && showProgress && " • Uploading...", file.status === "success" && " • Complete", file.status === "error" && file.errorMessage && ` • ${file.errorMessage}`), showProgress && file.status === "uploading" && /* @__PURE__ */ React.createElement(Box, { className: fileUploadProgressBar }, /* @__PURE__ */ React.createElement(Box, {
4439
- className: clsx(fileUploadProgressFill, fileUploadProgressFillVariants[file.status]),
4440
- style: { width: `${file.progress}%` }
4441
- }))), /* @__PURE__ */ React.createElement(Box, {
4442
- as: "button",
4443
- className: fileUploadRemoveButton,
4444
- onClick: () => handleRemove(file.id),
4445
- type: "button",
4446
- "aria-label": `Remove ${file.name}`
4447
- }, "×")))));
4448
- };
4449
-
4450
- //#endregion
4451
- //#region src/components/Stack/Stack.tsx
4452
- const alignMap = {
4453
- start: "flex-start",
4454
- center: "center",
4455
- end: "flex-end",
4456
- stretch: "stretch"
4457
- };
4458
- const justifyMap = {
4459
- start: "flex-start",
4460
- center: "center",
4461
- end: "flex-end",
4462
- between: "space-between",
4463
- around: "space-around",
4464
- evenly: "space-evenly"
4465
- };
4466
- const Stack = forwardRef(({ direction = "column", align, justify, gap, wrap, children, className, style, ...rest }, ref) => {
4467
- const alignItems = align ? alignMap[align] : void 0;
4468
- const justifyContent = justify ? justifyMap[justify] : void 0;
4469
- return /* @__PURE__ */ React.createElement(Box, {
4470
- ref,
4471
- display: "flex",
4472
- flexDirection: direction,
4473
- alignItems,
4474
- justifyContent,
4475
- gap,
4476
- className,
4477
- style: {
4478
- flexWrap: wrap ? "wrap" : void 0,
4479
- ...style
4480
- },
4481
- ...rest
4482
- }, children);
4483
- });
4484
- Stack.displayName = "Stack";
4485
-
4486
- //#endregion
4487
- //#region src/components/Grid/Grid.tsx
4488
- const gapMap = {
4489
- none: "0",
4490
- small: "0.5rem",
4491
- medium: "1rem",
4492
- large: "2rem"
4493
- };
4494
- const Grid = forwardRef(({ columns, gap = "medium", minChildWidth, children, className, style }, ref) => {
4495
- const gridStyle = {
4496
- display: "grid",
4497
- gap: gapMap[gap]
4498
- };
4499
- if (minChildWidth) gridStyle.gridTemplateColumns = `repeat(auto-fit, minmax(${minChildWidth}, 1fr))`;
4500
- else if (columns) gridStyle.gridTemplateColumns = `repeat(${columns}, 1fr)`;
4501
- return /* @__PURE__ */ React.createElement(Box, {
4502
- ref,
4503
- className,
4504
- style: {
4505
- ...gridStyle,
4506
- ...style
4507
- }
4508
- }, children);
4509
- });
4510
- Grid.displayName = "Grid";
4511
-
4512
- //#endregion
4513
- //#region src/components/Container/Container.tsx
4514
- const sizeMap = {
4515
- sm: "640px",
4516
- md: "768px",
4517
- lg: "1024px",
4518
- xl: "1280px",
4519
- full: "100%"
4520
- };
4521
- const Container = forwardRef(({ size = "lg", centerContent = true, children, className, style }, ref) => {
4522
- const containerStyle = {
4523
- maxWidth: sizeMap[size],
4524
- marginLeft: centerContent ? "auto" : void 0,
4525
- marginRight: centerContent ? "auto" : void 0
4526
- };
4527
- return /* @__PURE__ */ React.createElement(Box, {
4528
- ref,
4529
- width: "100%",
4530
- className,
4531
- style: {
4532
- ...containerStyle,
4533
- ...style
4534
- }
4535
- }, children);
4536
- });
4537
- Container.displayName = "Container";
4538
-
4539
- //#endregion
4540
- //#region src/components/AspectRatio/AspectRatio.tsx
4541
- const AspectRatio = forwardRef(({ ratio = "1/1", children, ...props }, ref) => {
4542
- const aspectRatio = typeof ratio === "number" ? ratio : ratio;
4543
- return /* @__PURE__ */ React.createElement(Box, {
4544
- ref,
4545
- position: "relative",
4546
- style: {
4547
- aspectRatio,
4548
- overflow: "hidden"
4549
- },
4550
- ...props
4551
- }, /* @__PURE__ */ React.createElement(Box, {
4552
- position: "absolute",
4553
- width: "100%",
4554
- height: "100%",
4555
- display: "flex",
4556
- alignItems: "center",
4557
- justifyContent: "center"
4558
- }, children));
4559
- });
4560
- AspectRatio.displayName = "AspectRatio";
4561
-
4562
- //#endregion
4563
- //#region src/components/Collapse/styles.css.ts
4564
- const collapseIn = keyframes({
4565
- from: {
4566
- height: 0,
4567
- opacity: 0
4568
- },
4569
- to: {
4570
- height: "auto",
4571
- opacity: 1
4572
- }
4573
- });
4574
- const collapseOut = keyframes({
4575
- from: {
4576
- height: "auto",
4577
- opacity: 1
4578
- },
4579
- to: {
4580
- height: 0,
4581
- opacity: 0
4582
- }
4583
- });
4584
- const collapseContainer = styleWithLayer({ overflow: "hidden" });
4585
- const collapseContent = styleWithLayer({ width: "100%" });
4586
- const collapseAnimation = styleVariants({
4587
- in: { animation: `${collapseIn} 0.3s ease-out forwards` },
4588
- out: { animation: `${collapseOut} 0.3s ease-out forwards` }
4589
- });
4590
-
4591
- //#endregion
4592
- //#region src/components/Collapse/Collapse.tsx
4593
- const Collapse = ({ isOpen, children, animation = "both", duration = 300, className, onAnimationEnd }) => {
4594
- const [height, setHeight] = useState(isOpen ? void 0 : 0);
4595
- const [isAnimating, setIsAnimating] = useState(false);
4596
- const contentRef = useRef(null);
4597
- useEffect(() => {
4598
- if (isOpen) {
4599
- setIsAnimating(true);
4600
- if (contentRef.current) setHeight(contentRef.current.scrollHeight);
4601
- } else {
4602
- setIsAnimating(true);
4603
- setHeight(0);
4604
- }
4605
- }, [isOpen]);
4606
- const handleTransitionEnd = () => {
4607
- setIsAnimating(false);
4608
- if (isOpen) setHeight(void 0);
4609
- onAnimationEnd?.();
4610
- };
4611
- const getAnimationStyles = () => {
4612
- const baseStyles = {
4613
- transition: `height ${duration}ms ease-out, opacity ${duration}ms ease-out`,
4614
- height: height !== void 0 ? `${height}px` : void 0,
4615
- opacity: isOpen || isAnimating ? 1 : 0
4616
- };
4617
- if (animation === "height") return {
4618
- ...baseStyles,
4619
- transition: `height ${duration}ms ease-out`,
4620
- opacity: 1
4621
- };
4622
- if (animation === "opacity") return {
4623
- ...baseStyles,
4624
- transition: `opacity ${duration}ms ease-out`,
4625
- height: void 0
4626
- };
4627
- return baseStyles;
4628
- };
4629
- if (!isOpen && !isAnimating && animation !== "opacity") return null;
4630
- return /* @__PURE__ */ React.createElement(Box, {
4631
- className: clsx(collapseContainer, className),
4632
- style: getAnimationStyles(),
4633
- onTransitionEnd: handleTransitionEnd,
4634
- "aria-hidden": !isOpen
4635
- }, /* @__PURE__ */ React.createElement(Box, {
4636
- ref: contentRef,
4637
- className: collapseContent
4638
- }, children));
4639
- };
4640
-
4641
- //#endregion
4642
- //#region src/components/VisuallyHidden/styles.css.ts
4643
- const visuallyHidden = styleWithLayer({
4644
- position: "absolute",
4645
- width: "1px",
4646
- height: "1px",
4647
- padding: 0,
4648
- margin: "-1px",
4649
- overflow: "hidden",
4650
- clip: "rect(0, 0, 0, 0)",
4651
- whiteSpace: "nowrap",
4652
- border: 0
4653
- });
4654
-
4655
- //#endregion
4656
- //#region src/components/VisuallyHidden/VisuallyHidden.tsx
4657
- const VisuallyHidden = ({ children, as: Component = "span", className, ...props }) => {
4658
- return React.createElement(Component, {
4659
- className: visuallyHidden,
4660
- ...props
4661
- }, children);
4662
- };
4663
-
4664
- //#endregion
4665
- //#region src/components/EmptyState/styles.css.ts
4666
- const emptyState = styleWithLayer({
4667
- display: "flex",
4668
- flexDirection: "column",
4669
- alignItems: "center",
4670
- justifyContent: "center",
4671
- padding: "2rem",
4672
- textAlign: "center"
4673
- });
4674
- const emptyStateIcon = styleWithLayer({
4675
- fontSize: "48px",
4676
- marginBottom: "1rem",
4677
- color: vars.colors.textSecondary
4678
- });
4679
- const emptyStateTitle = styleWithLayer({
4680
- fontSize: "18px",
4681
- fontWeight: "600",
4682
- color: vars.colors.textPrimary,
4683
- margin: "0 0 0.5rem 0"
4684
- });
4685
- const emptyStateDescription = styleWithLayer({
4686
- fontSize: "14px",
4687
- color: vars.colors.textSecondary,
4688
- margin: "0 0 1rem 0",
4689
- maxWidth: "400px"
4690
- });
4691
- const emptyStateAction = styleWithLayer({ marginTop: "0.5rem" });
4692
-
4693
- //#endregion
4694
- //#region src/components/EmptyState/EmptyState.tsx
4695
- const EmptyState = ({ icon, title, description, action, className }) => {
4696
- return /* @__PURE__ */ React.createElement(Box, {
4697
- className: clsx(emptyState, className),
4698
- role: "status"
4699
- }, icon && /* @__PURE__ */ React.createElement(Box, {
4700
- className: emptyStateIcon,
4701
- "aria-hidden": "true"
4702
- }, icon), title && /* @__PURE__ */ React.createElement(Box, {
4703
- as: "h3",
4704
- className: emptyStateTitle
4705
- }, title), description && /* @__PURE__ */ React.createElement(Box, {
4706
- as: "p",
4707
- className: emptyStateDescription
4708
- }, description), action && /* @__PURE__ */ React.createElement(Box, { className: emptyStateAction }, action));
4709
- };
4710
-
4711
- //#endregion
4712
- //#region src/components/Separator/styles.css.ts
4713
- const separator = styleWithLayer({
4714
- border: "none",
4715
- margin: 0,
4716
- flexShrink: 0
4717
- });
4718
- const separatorOrientation = styleVariants({
4719
- horizontal: {
4720
- width: "100%",
4721
- height: "1px",
4722
- backgroundColor: vars.colors.borderDefault
4723
- },
4724
- vertical: {
4725
- width: "1px",
4726
- height: "100%",
4727
- backgroundColor: vars.colors.borderDefault
4728
- }
4729
- });
4730
- const separatorSize = styleVariants({
4731
- small: {},
4732
- medium: {},
4733
- large: {}
4734
- });
4735
- const separatorDecorative = styleWithLayer({ backgroundColor: vars.colors.borderMuted });
4736
-
4737
- //#endregion
4738
- //#region src/components/Separator/Separator.tsx
4739
- const Separator = ({ orientation = "horizontal", decorative = false, className, ...props }) => {
4740
- return /* @__PURE__ */ React.createElement(Box, {
4741
- as: "hr",
4742
- className: clsx(separator, separatorOrientation[orientation], className),
4743
- "aria-hidden": decorative,
4744
- ...props
4745
- });
4746
- };
4747
-
4748
- //#endregion
4749
- //#region src/components/ScrollArea/styles.css.ts
4750
- const scrollArea = styleWithLayer({
4751
- overflow: "auto",
4752
- scrollbarWidth: "thin",
4753
- scrollbarColor: `${vars.colors.borderDefault} ${vars.colors.backgroundMuted}`
4754
- });
4755
- const scrollAreaOrientation = styleVariants({
4756
- vertical: {
4757
- overflowX: "hidden",
4758
- overflowY: "auto"
4759
- },
4760
- horizontal: {
4761
- overflowX: "auto",
4762
- overflowY: "hidden"
4763
- },
4764
- both: { overflow: "auto" }
4765
- });
4766
- const scrollAreaViewport = styleWithLayer({
4767
- width: "100%",
4768
- height: "100%"
4769
- });
4770
-
4771
- //#endregion
4772
- //#region src/components/ScrollArea/ScrollArea.tsx
4773
- const ScrollArea = ({ children, orientation = "vertical", maxHeight, maxWidth, className, ...props }) => {
4774
- const style = {
4775
- maxHeight,
4776
- maxWidth
4777
- };
4778
- return /* @__PURE__ */ React.createElement(Box, {
4779
- className: clsx(scrollArea, scrollAreaOrientation[orientation], className),
4780
- style,
4781
- ...props
4782
- }, /* @__PURE__ */ React.createElement(Box, { className: scrollAreaViewport }, children));
4783
- };
4784
-
4785
- //#endregion
4786
- //#region src/components/Kbd/styles.css.ts
4787
- const kbd = styleWithLayer({
4788
- display: "inline-block",
4789
- padding: "0.125rem 0.375rem",
4790
- fontFamily: "monospace",
4791
- fontSize: "0.85em",
4792
- fontWeight: "600",
4793
- lineHeight: "1.5",
4794
- color: vars.colors.textPrimary,
4795
- backgroundColor: vars.colors.backgroundMuted,
4796
- border: `1px solid ${vars.colors.borderDefault}`,
4797
- borderRadius: "4px",
4798
- boxShadow: "0 2px 0 rgba(0, 0, 0, 0.1)",
4799
- whiteSpace: "nowrap"
4800
- });
4801
-
4802
- //#endregion
4803
- //#region src/components/Kbd/Kbd.tsx
4804
- const Kbd = ({ children, className, ...props }) => {
4805
- return /* @__PURE__ */ React.createElement("kbd", {
4806
- className: `${kbd} ${className || ""}`,
4807
- ...props
4808
- }, children);
4809
- };
4810
-
4811
- //#endregion
4812
- export { AccordionComponent as Accordion, Alert, AspectRatio, Avatar, Badge, Box, Breadcrumb, Button, Card, Checkbox, Collapse, Combobox, Container, Divider, Drawer, DropdownMenu, EmptyState, FileUpload, Form, FormInput, Grid, Header, IconComponent as Icon, Input, Kbd, List, ListItem, Modal, Navbar, NavbarItem, NumberInput, P, Pagination, Popover, Progress, RadioComponent as Radio, ScrollArea, Select, Separator, Skeleton, Spinner, Stack, Stepper, Table, TabsComponent as Tabs, TagComponent as Tag, TextArea, Toast, ToastProvider, Toggle, Tooltip, VisuallyHidden, useToast };