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