@hellboy/ds 0.1.2 → 0.2.7

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 (298) hide show
  1. package/README.md +568 -71
  2. package/{src/style/components/badge → dist/components}/badge.css +9 -25
  3. package/dist/components/badge.d.mts +12 -0
  4. package/dist/components/badge.d.ts +12 -0
  5. package/dist/components/badge.js +42 -0
  6. package/dist/components/badge.mjs +15 -0
  7. package/dist/components/banner.css +280 -0
  8. package/dist/components/banner.d.mts +12 -0
  9. package/dist/components/banner.d.ts +12 -0
  10. package/dist/components/banner.js +184 -0
  11. package/dist/components/banner.mjs +147 -0
  12. package/dist/components/button-group.css +289 -0
  13. package/dist/components/button-group.d.mts +81 -0
  14. package/dist/components/button-group.d.ts +81 -0
  15. package/dist/components/button-group.js +180 -0
  16. package/dist/components/button-group.mjs +143 -0
  17. package/{src/style/components/button → dist/components}/button.css +59 -62
  18. package/dist/components/button.d.mts +57 -0
  19. package/dist/components/button.d.ts +57 -0
  20. package/dist/components/button.js +129 -0
  21. package/dist/components/button.mjs +92 -0
  22. package/{src/style/components/card → dist/components}/card.css +9 -30
  23. package/dist/components/card.d.mts +31 -0
  24. package/dist/components/card.d.ts +31 -0
  25. package/dist/components/card.js +59 -0
  26. package/dist/components/card.mjs +32 -0
  27. package/{src/style → dist}/components/checkbox.css +51 -43
  28. package/dist/components/checkbox.d.mts +31 -0
  29. package/dist/components/checkbox.d.ts +31 -0
  30. package/dist/components/checkbox.js +130 -0
  31. package/dist/components/checkbox.mjs +93 -0
  32. package/{src/style/components/code-block → dist/components}/code-block.css +3 -7
  33. package/dist/components/code-block.d.mts +24 -0
  34. package/dist/components/code-block.d.ts +24 -0
  35. package/dist/components/code-block.js +43 -0
  36. package/dist/components/code-block.mjs +16 -0
  37. package/dist/components/color-control.css +285 -0
  38. package/dist/components/color-control.d.mts +5 -0
  39. package/dist/components/color-control.d.ts +5 -0
  40. package/dist/components/color-control.js +534 -0
  41. package/dist/components/color-control.mjs +497 -0
  42. package/dist/components/dialog.css +930 -0
  43. package/dist/components/dialog.d.mts +32 -0
  44. package/dist/components/dialog.d.ts +32 -0
  45. package/dist/components/dialog.js +1111 -0
  46. package/dist/components/dialog.mjs +1074 -0
  47. package/dist/components/divider.css +356 -0
  48. package/dist/components/divider.d.mts +32 -0
  49. package/dist/components/divider.d.ts +32 -0
  50. package/dist/components/divider.js +344 -0
  51. package/dist/components/divider.mjs +307 -0
  52. package/{src/style/components/drag-handle → dist/components}/drag-handle.css +3 -18
  53. package/dist/components/drag-handle.d.mts +11 -0
  54. package/dist/components/drag-handle.d.ts +11 -0
  55. package/dist/components/drag-handle.js +103 -0
  56. package/dist/components/drag-handle.mjs +66 -0
  57. package/dist/components/drawer.css +1027 -0
  58. package/dist/components/drawer.d.mts +14 -0
  59. package/dist/components/drawer.d.ts +14 -0
  60. package/dist/components/drawer.js +1072 -0
  61. package/dist/components/drawer.mjs +1035 -0
  62. package/dist/components/floating-bar.css +17 -0
  63. package/dist/components/floating-bar.d.mts +25 -0
  64. package/dist/components/floating-bar.d.ts +25 -0
  65. package/dist/components/floating-bar.js +52 -0
  66. package/dist/components/floating-bar.mjs +25 -0
  67. package/dist/components/footer.css +40 -0
  68. package/dist/components/footer.d.mts +8 -0
  69. package/dist/components/footer.d.ts +8 -0
  70. package/dist/components/footer.js +44 -0
  71. package/dist/components/footer.mjs +17 -0
  72. package/dist/components/grid.css +47 -0
  73. package/dist/components/grid.d.mts +27 -0
  74. package/dist/components/grid.d.ts +27 -0
  75. package/dist/components/grid.js +52 -0
  76. package/dist/components/grid.mjs +25 -0
  77. package/dist/components/header.css +1075 -0
  78. package/dist/components/header.d.mts +35 -0
  79. package/dist/components/header.d.ts +35 -0
  80. package/dist/components/header.js +1402 -0
  81. package/dist/components/header.mjs +1365 -0
  82. package/dist/components/hero.css +121 -0
  83. package/dist/components/hero.d.mts +111 -0
  84. package/dist/components/hero.d.ts +111 -0
  85. package/dist/components/hero.js +285 -0
  86. package/dist/components/hero.mjs +248 -0
  87. package/{src/style/components/icons → dist/components}/icons.css +14 -15
  88. package/dist/components/icons.d.mts +104 -0
  89. package/dist/components/icons.d.ts +104 -0
  90. package/dist/components/icons.js +239 -0
  91. package/dist/components/icons.mjs +203 -0
  92. package/{src/style/components/input → dist/components}/input.css +189 -102
  93. package/dist/components/input.d.mts +114 -0
  94. package/dist/components/input.d.ts +114 -0
  95. package/dist/components/input.js +926 -0
  96. package/dist/components/input.mjs +879 -0
  97. package/dist/components/layout.css +551 -0
  98. package/dist/components/layout.d.mts +16 -0
  99. package/dist/components/layout.d.ts +16 -0
  100. package/dist/components/layout.js +387 -0
  101. package/dist/components/layout.mjs +352 -0
  102. package/{src/style/components/list → dist/components}/list.css +47 -41
  103. package/dist/components/list.d.mts +46 -0
  104. package/dist/components/list.d.ts +46 -0
  105. package/dist/components/list.js +124 -0
  106. package/dist/components/list.mjs +96 -0
  107. package/dist/components/navbar.css +706 -0
  108. package/dist/components/navbar.d.mts +56 -0
  109. package/dist/components/navbar.d.ts +56 -0
  110. package/dist/components/navbar.js +994 -0
  111. package/dist/components/navbar.mjs +952 -0
  112. package/{src/style/components/page-index → dist/components}/page-index.css +2 -47
  113. package/dist/components/page-index.d.mts +25 -0
  114. package/dist/components/page-index.d.ts +25 -0
  115. package/dist/components/page-index.js +239 -0
  116. package/dist/components/page-index.mjs +202 -0
  117. package/{src/style/components/page → dist/components}/page.css +4 -15
  118. package/dist/components/page.d.mts +30 -0
  119. package/dist/components/page.d.ts +30 -0
  120. package/dist/components/page.js +40 -0
  121. package/dist/components/page.mjs +13 -0
  122. package/dist/components/popover.css +87 -0
  123. package/dist/components/popover.d.mts +22 -0
  124. package/dist/components/popover.d.ts +22 -0
  125. package/dist/components/popover.js +243 -0
  126. package/dist/components/popover.mjs +206 -0
  127. package/{src/style → dist}/components/radio.css +8 -51
  128. package/dist/components/radio.d.mts +59 -0
  129. package/dist/components/radio.d.ts +59 -0
  130. package/dist/components/radio.js +133 -0
  131. package/dist/components/radio.mjs +95 -0
  132. package/dist/components/section.css +993 -0
  133. package/dist/components/section.d.mts +33 -0
  134. package/dist/components/section.d.ts +33 -0
  135. package/dist/components/section.js +1401 -0
  136. package/dist/components/section.mjs +1364 -0
  137. package/dist/components/select.css +391 -0
  138. package/dist/components/select.d.mts +63 -0
  139. package/dist/components/select.d.ts +63 -0
  140. package/dist/components/select.js +452 -0
  141. package/dist/components/select.mjs +415 -0
  142. package/{src/style/components/slider → dist/components}/slider.css +55 -33
  143. package/dist/components/slider.d.mts +69 -0
  144. package/dist/components/slider.d.ts +69 -0
  145. package/dist/components/slider.js +254 -0
  146. package/dist/components/slider.mjs +217 -0
  147. package/dist/components/switch.css +1081 -0
  148. package/dist/components/switch.d.mts +33 -0
  149. package/dist/components/switch.d.ts +33 -0
  150. package/dist/components/switch.js +1092 -0
  151. package/dist/components/switch.mjs +1055 -0
  152. package/{src/style/components/table → dist/components}/table.css +3 -28
  153. package/dist/components/table.d.mts +42 -0
  154. package/dist/components/table.d.ts +42 -0
  155. package/dist/components/table.js +108 -0
  156. package/dist/components/table.mjs +76 -0
  157. package/dist/components/tag.css +97 -0
  158. package/dist/components/tag.d.mts +12 -0
  159. package/dist/components/tag.d.ts +12 -0
  160. package/dist/components/tag.js +42 -0
  161. package/dist/components/tag.mjs +15 -0
  162. package/dist/components/textarea.css +1359 -0
  163. package/dist/components/textarea.d.mts +84 -0
  164. package/dist/components/textarea.d.ts +84 -0
  165. package/dist/components/textarea.js +1962 -0
  166. package/dist/components/textarea.mjs +1924 -0
  167. package/{src/style/components/theme-control → dist/components}/theme-control.css +3 -7
  168. package/dist/components/theme-control.d.mts +9 -0
  169. package/dist/components/theme-control.d.ts +9 -0
  170. package/dist/components/theme-control.js +235 -0
  171. package/dist/components/theme-control.mjs +200 -0
  172. package/{src/style/components/tooltip → dist/components}/tooltip.css +5 -13
  173. package/dist/components/tooltip.d.mts +12 -0
  174. package/dist/components/tooltip.d.ts +12 -0
  175. package/dist/components/tooltip.js +200 -0
  176. package/dist/components/tooltip.mjs +163 -0
  177. package/dist/icons-Czahnf-r.d.mts +15 -0
  178. package/dist/icons-Czahnf-r.d.ts +15 -0
  179. package/dist/index.css +2915 -2068
  180. package/dist/index.d.mts +144 -721
  181. package/dist/index.d.ts +144 -721
  182. package/dist/index.js +4076 -2282
  183. package/dist/index.mjs +4132 -2366
  184. package/dist/theme.css +34 -34
  185. package/package.json +27 -8
  186. package/dist/index.css.map +0 -1
  187. package/dist/index.js.map +0 -1
  188. package/dist/index.mjs.map +0 -1
  189. package/hellboy-ds-0.1.2.tgz +0 -0
  190. package/src/components/badge/Badge.tsx +0 -29
  191. package/src/components/badge/index.ts +0 -1
  192. package/src/components/banner/Banner.tsx +0 -48
  193. package/src/components/banner/banner.css +0 -44
  194. package/src/components/banner/index.ts +0 -1
  195. package/src/components/button/button.tsx +0 -127
  196. package/src/components/button/index.ts +0 -1
  197. package/src/components/card/card.tsx +0 -57
  198. package/src/components/card/index.ts +0 -1
  199. package/src/components/checkbox/Checkbox.tsx +0 -98
  200. package/src/components/checkbox/index.ts +0 -1
  201. package/src/components/code-block/code-block.tsx +0 -44
  202. package/src/components/code-block/index.ts +0 -1
  203. package/src/components/color-control/color-control.tsx +0 -322
  204. package/src/components/color-control/index.ts +0 -1
  205. package/src/components/drag-handle/DragHandle.tsx +0 -78
  206. package/src/components/drag-handle/index.ts +0 -1
  207. package/src/components/drawer/drawer.tsx +0 -82
  208. package/src/components/drawer/index.ts +0 -1
  209. package/src/components/floating-bar/floating-bar.tsx +0 -52
  210. package/src/components/floating-bar/index.ts +0 -2
  211. package/src/components/footer/footer.tsx +0 -28
  212. package/src/components/footer/index.ts +0 -1
  213. package/src/components/grid/Grid.tsx +0 -53
  214. package/src/components/grid/index.ts +0 -1
  215. package/src/components/header/header.tsx +0 -57
  216. package/src/components/header/index.ts +0 -1
  217. package/src/components/icons/icons.tsx +0 -44
  218. package/src/components/icons/index.ts +0 -1
  219. package/src/components/index.ts +0 -29
  220. package/src/components/input/DatePicker.tsx +0 -133
  221. package/src/components/input/Input.tsx +0 -220
  222. package/src/components/input/InputDate.tsx +0 -10
  223. package/src/components/input/InputDateTime.tsx +0 -10
  224. package/src/components/input/InputEmail.tsx +0 -10
  225. package/src/components/input/InputField.tsx +0 -137
  226. package/src/components/input/InputNumber.tsx +0 -10
  227. package/src/components/input/InputPassword.tsx +0 -10
  228. package/src/components/input/InputSearch.tsx +0 -10
  229. package/src/components/input/InputTel.tsx +0 -10
  230. package/src/components/input/InputText.tsx +0 -10
  231. package/src/components/input/InputTime.tsx +0 -10
  232. package/src/components/input/InputUrl.tsx +0 -10
  233. package/src/components/input/TimePicker.tsx +0 -151
  234. package/src/components/input/index.ts +0 -11
  235. package/src/components/layout/Layout.tsx +0 -244
  236. package/src/components/layout/index.ts +0 -1
  237. package/src/components/list/List.tsx +0 -159
  238. package/src/components/list/index.ts +0 -1
  239. package/src/components/navbar/MenuCategory.tsx +0 -20
  240. package/src/components/navbar/MenuGroup.tsx +0 -288
  241. package/src/components/navbar/MenuItem.tsx +0 -65
  242. package/src/components/navbar/Navbar.tsx +0 -23
  243. package/src/components/navbar/index.ts +0 -4
  244. package/src/components/page/index.ts +0 -1
  245. package/src/components/page/page.tsx +0 -46
  246. package/src/components/page-index/PageIndex.tsx +0 -275
  247. package/src/components/page-index/index.ts +0 -1
  248. package/src/components/popover/index.ts +0 -1
  249. package/src/components/popover/popover.tsx +0 -199
  250. package/src/components/radio/Radio.tsx +0 -176
  251. package/src/components/radio/index.ts +0 -1
  252. package/src/components/section/index.ts +0 -1
  253. package/src/components/section/section.tsx +0 -66
  254. package/src/components/select/Select.tsx +0 -212
  255. package/src/components/select/index.ts +0 -1
  256. package/src/components/slider/Slider.tsx +0 -267
  257. package/src/components/slider/index.ts +0 -1
  258. package/src/components/switch/index.ts +0 -1
  259. package/src/components/switch/switch.tsx +0 -99
  260. package/src/components/table/Table.tsx +0 -147
  261. package/src/components/table/index.ts +0 -1
  262. package/src/components/theme-control/index.ts +0 -1
  263. package/src/components/theme-control/theme-control.tsx +0 -78
  264. package/src/components/tooltip/index.ts +0 -1
  265. package/src/components/tooltip/tooltip.tsx +0 -207
  266. package/src/contexts/NavbarTooltipContext.tsx +0 -48
  267. package/src/contexts/index.ts +0 -1
  268. package/src/foundations/motion.md +0 -136
  269. package/src/index.ts +0 -40
  270. package/src/style/_shared/field.css +0 -69
  271. package/src/style/components/color-control/color-control.css +0 -126
  272. package/src/style/components/drawer/drawer.css +0 -210
  273. package/src/style/components/floating-bar/floating-bar.css +0 -39
  274. package/src/style/components/footer/footer.css +0 -108
  275. package/src/style/components/grid/grid.css +0 -33
  276. package/src/style/components/header/header.css +0 -44
  277. package/src/style/components/layout/layout.css +0 -205
  278. package/src/style/components/navbar/navbar.css +0 -342
  279. package/src/style/components/popover/popover.css +0 -44
  280. package/src/style/components/section/section.css +0 -67
  281. package/src/style/components/select/select.css +0 -143
  282. package/src/style/components/switch/switch.css +0 -267
  283. package/src/style/foundations/global.css +0 -316
  284. package/src/style/foundations/motion.css +0 -164
  285. package/src/style/foundations/spacing.css +0 -51
  286. package/src/style/foundations/typography.css +0 -39
  287. package/src/style/foundations/z-index.css +0 -81
  288. package/src/style/modes/dark.css +0 -146
  289. package/src/style/modes/light.css +0 -147
  290. package/src/style/semantic.css +0 -52
  291. package/src/style/styles.css +0 -51
  292. package/src/style/themes/theme.json +0 -37
  293. package/src/utils/README.md +0 -305
  294. package/src/utils/USER_PREFERENCES.md +0 -558
  295. package/src/utils/theme.ts +0 -127
  296. package/src/utils/user-preferences.ts +0 -577
  297. package/tsconfig.json +0 -25
  298. package/tsup.config.ts +0 -52
@@ -0,0 +1,1072 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/components/drawer/index.ts
31
+ var drawer_exports = {};
32
+ __export(drawer_exports, {
33
+ Drawer: () => Drawer
34
+ });
35
+ module.exports = __toCommonJS(drawer_exports);
36
+
37
+ // src/components/drawer/drawer.tsx
38
+ var import_react15 = require("@ariakit/react");
39
+
40
+ // src/components/button/button.tsx
41
+ var import_react2 = __toESM(require("react"));
42
+ var import_react3 = require("@ariakit/react");
43
+
44
+ // src/components/icons/icons.tsx
45
+ var import_react = require("@iconify/react");
46
+ var import_jsx_runtime = require("react/jsx-runtime");
47
+ var Icon = ({ name, size = 24, className, loading = false, ...rest }) => {
48
+ const iconName = name.includes(":") ? name : `heroicons:${name}`;
49
+ const classes = ["icon", className].filter(Boolean).join(" ");
50
+ if (loading) {
51
+ const style = { width: size, height: size };
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ "span",
54
+ {
55
+ className: `${classes} icon--skeleton`,
56
+ style,
57
+ "aria-hidden": rest["aria-label"] ? "false" : "true",
58
+ ...rest["aria-label"] ? { "aria-label": rest["aria-label"] } : {}
59
+ }
60
+ );
61
+ }
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ import_react.Icon,
64
+ {
65
+ icon: iconName,
66
+ width: size,
67
+ height: size,
68
+ className: classes,
69
+ ...rest
70
+ }
71
+ );
72
+ };
73
+
74
+ // src/components/icons/iconConstants.ts
75
+ var INPUT_TYPE_ICONS = {
76
+ // Standard HTML input types
77
+ email: "envelope-solid",
78
+ password: "lock-closed-solid",
79
+ search: "magnifying-glass-solid",
80
+ date: "calendar-days-solid",
81
+ time: "clock-solid",
82
+ "datetime-local": "calendar-days-solid",
83
+ tel: "phone-solid",
84
+ url: "link-solid",
85
+ number: "hashtag-solid",
86
+ // Additional semantic types
87
+ username: "user-solid",
88
+ name: "user-solid",
89
+ firstname: "user-solid",
90
+ lastname: "user-solid",
91
+ address: "map-pin-solid",
92
+ city: "building-solid",
93
+ state: "map-solid",
94
+ zip: "map-pin-solid",
95
+ "zip-code": "map-pin-solid",
96
+ country: "globe-americas-solid",
97
+ creditcard: "credit-card-solid",
98
+ card: "credit-card-solid",
99
+ cvv: "lock-closed-solid",
100
+ expiry: "calendar-days-solid",
101
+ "expiration-date": "calendar-days-solid",
102
+ // File and media types
103
+ file: "document-solid",
104
+ image: "photo-solid",
105
+ video: "video-camera-solid",
106
+ audio: "microphone-solid",
107
+ // Communication
108
+ message: "chat-bubble-left-solid",
109
+ comment: "chat-bubble-left-solid",
110
+ feedback: "chat-bubble-left-solid",
111
+ // Actions and states
112
+ submit: "paper-airplane-solid",
113
+ send: "paper-airplane-solid",
114
+ save: "floppy-disk-solid",
115
+ edit: "pencil-solid",
116
+ delete: "trash-solid",
117
+ remove: "x-mark-solid",
118
+ add: "plus-solid",
119
+ create: "plus-solid",
120
+ upload: "arrow-up-tray-solid",
121
+ download: "arrow-down-tray-solid",
122
+ refresh: "arrow-path-solid",
123
+ reload: "arrow-path-solid",
124
+ settings: "cog-solid",
125
+ config: "cog-solid",
126
+ filter: "funnel-solid",
127
+ sort: "bars-arrow-up-solid"
128
+ };
129
+ var ACTION_ICONS = {
130
+ close: "x-mark-solid",
131
+ back: "arrow-left-solid",
132
+ forward: "arrow-right-solid",
133
+ up: "arrow-up-solid",
134
+ down: "arrow-down-solid",
135
+ expand: "chevron-down-solid",
136
+ collapse: "chevron-up-solid",
137
+ menu: "bars-3-solid",
138
+ more: "ellipsis-horizontal-solid",
139
+ check: "check-solid",
140
+ cross: "x-mark-solid",
141
+ plus: "plus-solid",
142
+ minus: "minus-solid",
143
+ search: "magnifying-glass-solid",
144
+ clear: "x-mark-solid",
145
+ loading: "arrow-path-solid",
146
+ error: "exclamation-triangle-solid",
147
+ warning: "exclamation-triangle-solid",
148
+ info: "information-circle-solid",
149
+ success: "check-circle-solid"
150
+ };
151
+
152
+ // src/components/button/button.tsx
153
+ var import_jsx_runtime2 = require("react/jsx-runtime");
154
+ var Button = import_react2.default.forwardRef(
155
+ ({
156
+ variant = "primary",
157
+ size = "md",
158
+ children,
159
+ isLoading = false,
160
+ disabled = false,
161
+ fullWidth = false,
162
+ startIcon,
163
+ endIcon,
164
+ iconOnly = false,
165
+ href,
166
+ active = false,
167
+ className,
168
+ onClick,
169
+ ...props
170
+ }, ref) => {
171
+ const buttonClasses = [
172
+ "btn",
173
+ `btn--${variant}`,
174
+ `btn--${size}`,
175
+ fullWidth && "btn--full-width",
176
+ iconOnly && "btn--icon-only",
177
+ active && "btn--active",
178
+ className
179
+ ].filter(Boolean).join(" ");
180
+ const iconSize = size === "xs" ? 14 : size === "sm" ? 16 : size === "lg" ? 24 : 20;
181
+ const buttonContent = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
182
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "btn__spinner" }),
183
+ startIcon && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "btn__icon-placeholder", style: { width: iconSize, height: iconSize } }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { name: startIcon, size: iconSize, className: "btn__icon" })),
184
+ !iconOnly && children,
185
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { name: endIcon, size: iconSize, className: "btn__icon" })
186
+ ] });
187
+ const handleClick = (e) => {
188
+ if (href && !isLoading && !disabled) {
189
+ window.location.href = href;
190
+ }
191
+ onClick?.(e);
192
+ };
193
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
194
+ import_react3.Button,
195
+ {
196
+ ref,
197
+ disabled: disabled || isLoading,
198
+ className: buttonClasses,
199
+ onClick: handleClick,
200
+ ...props,
201
+ children: buttonContent
202
+ }
203
+ );
204
+ }
205
+ );
206
+ Button.displayName = "Button";
207
+
208
+ // src/components/_shared/Backdrop.tsx
209
+ var React2 = __toESM(require("react"));
210
+ var import_jsx_runtime3 = require("react/jsx-runtime");
211
+ var Backdrop = React2.forwardRef(
212
+ ({ className = "", blur = true, style, ...props }, ref) => {
213
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
214
+ "div",
215
+ {
216
+ ref,
217
+ className: `backdrop ${blur ? "backdrop--blur" : ""} ${className}`,
218
+ style,
219
+ "aria-hidden": "true",
220
+ ...props
221
+ }
222
+ );
223
+ }
224
+ );
225
+ Backdrop.displayName = "Backdrop";
226
+
227
+ // src/components/_shared/Thumb.tsx
228
+ var import_jsx_runtime4 = require("react/jsx-runtime");
229
+
230
+ // src/components/_shared/HeadingAnchor.tsx
231
+ var import_react14 = require("react");
232
+
233
+ // src/components/dialog/Dialog.tsx
234
+ var React3 = __toESM(require("react"));
235
+ var import_react_dom = require("react-dom");
236
+ var import_jsx_runtime5 = require("react/jsx-runtime");
237
+
238
+ // src/components/input/InputText.tsx
239
+ var import_react4 = __toESM(require("react"));
240
+
241
+ // src/components/input/Input.tsx
242
+ var React8 = __toESM(require("react"));
243
+
244
+ // src/components/input/InputField.tsx
245
+ var React4 = __toESM(require("react"));
246
+ var import_jsx_runtime6 = require("react/jsx-runtime");
247
+ var InputField = React4.forwardRef(
248
+ ({
249
+ type = "text",
250
+ label,
251
+ helperText,
252
+ error,
253
+ icon,
254
+ iconRight,
255
+ fullWidth = false,
256
+ size = "md",
257
+ className = "",
258
+ disabled,
259
+ id,
260
+ onRightIconClick,
261
+ ...props
262
+ }, ref) => {
263
+ const inputId = id || `input-${React4.useId()}`;
264
+ const containerClasses = [
265
+ "input-container",
266
+ fullWidth && "input-container--full-width",
267
+ className
268
+ ].filter(Boolean).join(" ");
269
+ const inputClasses = [
270
+ "input",
271
+ `input--${size}`,
272
+ error && "input--error",
273
+ disabled && "input--disabled",
274
+ icon && "input--has-icon-left",
275
+ iconRight && "input--has-icon-right"
276
+ ].filter(Boolean).join(" ");
277
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: containerClasses, children: [
278
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: inputId, className: "input__label", children: label }),
279
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "input__wrapper", children: [
280
+ icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "input__icon input__icon--left", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: icon, size: 16 }) }),
281
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
282
+ "input",
283
+ {
284
+ ref,
285
+ type,
286
+ id: inputId,
287
+ className: inputClasses,
288
+ disabled,
289
+ ...props
290
+ }
291
+ ),
292
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
293
+ "button",
294
+ {
295
+ type: "button",
296
+ className: "input__icon input__icon--right",
297
+ onClick: onRightIconClick,
298
+ tabIndex: -1,
299
+ "aria-label": "Icon action",
300
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: iconRight, size: 16 })
301
+ }
302
+ )
303
+ ] }),
304
+ error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "input__message input__message--error", children: error }),
305
+ helperText && !error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "input__message", children: helperText })
306
+ ] });
307
+ }
308
+ );
309
+
310
+ // src/components/popover/popover.tsx
311
+ var React5 = __toESM(require("react"));
312
+ var ReactDOM = __toESM(require("react-dom"));
313
+ var import_jsx_runtime7 = require("react/jsx-runtime");
314
+ var Popover = ({
315
+ trigger,
316
+ children,
317
+ isOpen,
318
+ onToggle,
319
+ placement = "bottom",
320
+ align = "start",
321
+ offset = 8,
322
+ flip = true,
323
+ closeOnEscape = true,
324
+ closeOnClickOutside = true
325
+ }) => {
326
+ const [internalOpen, setInternalOpen] = React5.useState(false);
327
+ const triggerRef = React5.useRef(null);
328
+ const popoverRef = React5.useRef(null);
329
+ const [popoverStyle, setPopoverStyle] = React5.useState({});
330
+ const [resolvedPlacement, setResolvedPlacement] = React5.useState(placement);
331
+ const isControlled = isOpen !== void 0;
332
+ const open = isControlled ? isOpen : internalOpen;
333
+ const toggle = React5.useCallback(() => {
334
+ if (isControlled) {
335
+ onToggle?.();
336
+ } else {
337
+ setInternalOpen((prev) => !prev);
338
+ }
339
+ }, [isControlled, onToggle]);
340
+ React5.useEffect(() => {
341
+ const handleClickOutside = (event) => {
342
+ if (closeOnClickOutside && triggerRef.current && !triggerRef.current.contains(event.target) && popoverRef.current && !popoverRef.current.contains(event.target)) {
343
+ toggle();
344
+ }
345
+ };
346
+ if (open) {
347
+ document.addEventListener("mousedown", handleClickOutside);
348
+ }
349
+ return () => {
350
+ document.removeEventListener("mousedown", handleClickOutside);
351
+ };
352
+ }, [open, toggle, closeOnClickOutside]);
353
+ React5.useEffect(() => {
354
+ const handleEscapeKey = (event) => {
355
+ if (closeOnEscape && event.key === "Escape" && open) {
356
+ toggle();
357
+ }
358
+ };
359
+ if (open) {
360
+ document.addEventListener("keydown", handleEscapeKey);
361
+ }
362
+ return () => {
363
+ document.removeEventListener("keydown", handleEscapeKey);
364
+ };
365
+ }, [open, toggle, closeOnEscape]);
366
+ React5.useEffect(() => {
367
+ if (!open || !triggerRef.current || !popoverRef.current) {
368
+ return;
369
+ }
370
+ const updatePosition = () => {
371
+ if (!triggerRef.current || !popoverRef.current) {
372
+ return;
373
+ }
374
+ const triggerRect = triggerRef.current.getBoundingClientRect();
375
+ const popoverRect = popoverRef.current.getBoundingClientRect();
376
+ const viewportWidth = window.innerWidth;
377
+ const viewportHeight = window.innerHeight;
378
+ const spaceTop = triggerRect.top;
379
+ const spaceBottom = viewportHeight - triggerRect.bottom;
380
+ const spaceLeft = triggerRect.left;
381
+ const spaceRight = viewportWidth - triggerRect.right;
382
+ let finalPlacement = placement;
383
+ if (flip) {
384
+ if (placement === "right" && spaceRight < popoverRect.width + offset) {
385
+ finalPlacement = spaceLeft >= popoverRect.width + offset ? "left" : "bottom";
386
+ } else if (placement === "left" && spaceLeft < popoverRect.width + offset) {
387
+ finalPlacement = spaceRight >= popoverRect.width + offset ? "right" : "bottom";
388
+ } else if (placement === "bottom" && spaceBottom < popoverRect.height + offset) {
389
+ finalPlacement = spaceTop >= popoverRect.height + offset ? "top" : "bottom";
390
+ } else if (placement === "top" && spaceTop < popoverRect.height + offset) {
391
+ finalPlacement = spaceBottom >= popoverRect.height + offset ? "bottom" : "top";
392
+ }
393
+ }
394
+ setResolvedPlacement(finalPlacement);
395
+ const newStyle = {
396
+ position: "fixed",
397
+ zIndex: "var(--z-popover)",
398
+ opacity: 1,
399
+ visibility: "visible",
400
+ pointerEvents: "auto"
401
+ };
402
+ const getAlignmentOffset = () => {
403
+ let alignmentOffset = 0;
404
+ if (finalPlacement === "left" || finalPlacement === "right") {
405
+ switch (align) {
406
+ case "center":
407
+ alignmentOffset = (triggerRect.height - popoverRect.height) / 2;
408
+ break;
409
+ case "end":
410
+ alignmentOffset = triggerRect.height - popoverRect.height;
411
+ break;
412
+ case "start":
413
+ default:
414
+ alignmentOffset = 0;
415
+ }
416
+ } else {
417
+ switch (align) {
418
+ case "center":
419
+ alignmentOffset = (triggerRect.width - popoverRect.width) / 2;
420
+ break;
421
+ case "end":
422
+ alignmentOffset = triggerRect.width - popoverRect.width;
423
+ break;
424
+ case "start":
425
+ default:
426
+ alignmentOffset = 0;
427
+ }
428
+ }
429
+ return alignmentOffset;
430
+ };
431
+ switch (finalPlacement) {
432
+ case "right":
433
+ newStyle.top = triggerRect.top + getAlignmentOffset();
434
+ newStyle.left = triggerRect.right + offset;
435
+ break;
436
+ case "left":
437
+ newStyle.top = triggerRect.top + getAlignmentOffset();
438
+ newStyle.left = triggerRect.left - popoverRect.width - offset;
439
+ break;
440
+ case "top":
441
+ newStyle.top = triggerRect.top - popoverRect.height - offset;
442
+ newStyle.left = triggerRect.left + getAlignmentOffset();
443
+ break;
444
+ case "bottom":
445
+ default:
446
+ newStyle.top = triggerRect.bottom + offset;
447
+ newStyle.left = triggerRect.left + getAlignmentOffset();
448
+ }
449
+ if (typeof newStyle.left === "number") {
450
+ if (newStyle.left + popoverRect.width > viewportWidth - offset) {
451
+ newStyle.left = viewportWidth - popoverRect.width - offset;
452
+ }
453
+ if (newStyle.left < offset) {
454
+ newStyle.left = offset;
455
+ }
456
+ }
457
+ if (typeof newStyle.top === "number") {
458
+ if (newStyle.top + popoverRect.height > viewportHeight - offset) {
459
+ newStyle.top = viewportHeight - popoverRect.height - offset;
460
+ }
461
+ if (newStyle.top < offset) {
462
+ newStyle.top = offset;
463
+ }
464
+ }
465
+ setPopoverStyle(newStyle);
466
+ };
467
+ requestAnimationFrame(updatePosition);
468
+ window.addEventListener("resize", updatePosition);
469
+ window.addEventListener("scroll", updatePosition, true);
470
+ return () => {
471
+ window.removeEventListener("resize", updatePosition);
472
+ window.removeEventListener("scroll", updatePosition, true);
473
+ };
474
+ }, [open, placement, align, offset, flip]);
475
+ const handleTriggerClick = React5.useCallback(() => {
476
+ toggle();
477
+ }, [toggle]);
478
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
480
+ "div",
481
+ {
482
+ ref: triggerRef,
483
+ onClick: handleTriggerClick,
484
+ style: { display: "inline-block", position: "relative" },
485
+ children: React5.isValidElement(trigger) ? React5.cloneElement(trigger, {
486
+ onClick: (e) => {
487
+ e.stopPropagation();
488
+ handleTriggerClick();
489
+ trigger.props?.onClick?.(e);
490
+ }
491
+ }) : trigger
492
+ }
493
+ ),
494
+ open && ReactDOM.createPortal(
495
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
496
+ "div",
497
+ {
498
+ ref: popoverRef,
499
+ className: `popover popover--${resolvedPlacement}`,
500
+ style: {
501
+ ...popoverStyle,
502
+ // Start with opacity 0 and visibility hidden to prevent initial flash
503
+ opacity: popoverStyle.top !== void 0 ? 1 : 0,
504
+ visibility: popoverStyle.top !== void 0 ? "visible" : "hidden"
505
+ },
506
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "popover__content", children })
507
+ }
508
+ ),
509
+ document.body
510
+ )
511
+ ] });
512
+ };
513
+
514
+ // src/components/input/DatePicker.tsx
515
+ var React6 = __toESM(require("react"));
516
+ var import_jsx_runtime8 = require("react/jsx-runtime");
517
+ var MONTHS = [
518
+ "January",
519
+ "February",
520
+ "March",
521
+ "April",
522
+ "May",
523
+ "June",
524
+ "July",
525
+ "August",
526
+ "September",
527
+ "October",
528
+ "November",
529
+ "December"
530
+ ];
531
+ var DAYS_OF_WEEK = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
532
+ var DatePicker = ({ value, onChange, disabled }) => {
533
+ const parseDate = (dateStr) => {
534
+ if (!dateStr) {
535
+ const today = /* @__PURE__ */ new Date();
536
+ return { year: today.getFullYear(), month: today.getMonth(), day: today.getDate() };
537
+ }
538
+ const [year, month, day] = dateStr.split("-").map(Number);
539
+ return { year, month: month - 1, day };
540
+ };
541
+ const { year: initialYear, month: initialMonth, day: selectedDay } = parseDate(value);
542
+ const [currentYear, setCurrentYear] = React6.useState(initialYear);
543
+ const [currentMonth, setCurrentMonth] = React6.useState(initialMonth);
544
+ const getDaysInMonth = (year, month) => {
545
+ return new Date(year, month + 1, 0).getDate();
546
+ };
547
+ const getFirstDayOfMonth = (year, month) => {
548
+ return new Date(year, month, 1).getDay();
549
+ };
550
+ const handleDateSelect = (day) => {
551
+ if (disabled) return;
552
+ const formattedDate = `${currentYear}-${String(currentMonth + 1).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
553
+ onChange(formattedDate);
554
+ };
555
+ const handlePrevMonth = () => {
556
+ if (currentMonth === 0) {
557
+ setCurrentMonth(11);
558
+ setCurrentYear(currentYear - 1);
559
+ } else {
560
+ setCurrentMonth(currentMonth - 1);
561
+ }
562
+ };
563
+ const handleNextMonth = () => {
564
+ if (currentMonth === 11) {
565
+ setCurrentMonth(0);
566
+ setCurrentYear(currentYear + 1);
567
+ } else {
568
+ setCurrentMonth(currentMonth + 1);
569
+ }
570
+ };
571
+ const daysInMonth = getDaysInMonth(currentYear, currentMonth);
572
+ const firstDay = getFirstDayOfMonth(currentYear, currentMonth);
573
+ const days = [
574
+ ...Array(firstDay).fill(null),
575
+ ...Array.from({ length: daysInMonth }, (_, i) => i + 1)
576
+ ];
577
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "date-picker", children: [
578
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "date-picker__header", children: [
579
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
580
+ "button",
581
+ {
582
+ type: "button",
583
+ className: "date-picker__nav",
584
+ onClick: handlePrevMonth,
585
+ disabled,
586
+ "aria-label": "Previous month",
587
+ children: "\u2039"
588
+ }
589
+ ),
590
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "date-picker__title", children: [
591
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
592
+ "select",
593
+ {
594
+ className: "date-picker__select",
595
+ value: currentMonth,
596
+ onChange: (e) => setCurrentMonth(Number(e.target.value)),
597
+ disabled,
598
+ children: MONTHS.map((month, idx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: idx, children: month }, month))
599
+ }
600
+ ),
601
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
602
+ "select",
603
+ {
604
+ className: "date-picker__select",
605
+ value: currentYear,
606
+ onChange: (e) => setCurrentYear(Number(e.target.value)),
607
+ disabled,
608
+ children: Array.from({ length: 100 }, (_, i) => currentYear - 50 + i).map((year) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: year, children: year }, year))
609
+ }
610
+ )
611
+ ] }),
612
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
613
+ "button",
614
+ {
615
+ type: "button",
616
+ className: "date-picker__nav",
617
+ onClick: handleNextMonth,
618
+ disabled,
619
+ "aria-label": "Next month",
620
+ children: "\u203A"
621
+ }
622
+ )
623
+ ] }),
624
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "date-picker__weekdays", children: DAYS_OF_WEEK.map((day) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "date-picker__weekday", children: day }, day)) }),
625
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "date-picker__days", children: days.map((day, idx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
626
+ "button",
627
+ {
628
+ type: "button",
629
+ className: `date-picker__day ${day === selectedDay ? "date-picker__day--selected" : ""} ${!day ? "date-picker__day--empty" : ""}`,
630
+ onClick: () => day && handleDateSelect(day),
631
+ disabled: !day || disabled,
632
+ children: day || ""
633
+ },
634
+ idx
635
+ )) })
636
+ ] });
637
+ };
638
+
639
+ // src/components/input/TimePicker.tsx
640
+ var React7 = __toESM(require("react"));
641
+ var import_jsx_runtime9 = require("react/jsx-runtime");
642
+ var parseTime = (timeStr) => {
643
+ if (!timeStr) return { hours: 0, minutes: 0, seconds: 0, milliseconds: 0 };
644
+ const parts = timeStr.split(":");
645
+ const hours = parseInt(parts[0] || "0", 10);
646
+ const minutes = parseInt(parts[1] || "0", 10);
647
+ const secondsParts = (parts[2] || "0").split(".");
648
+ const seconds = parseInt(secondsParts[0] || "0", 10);
649
+ const milliseconds = parseInt(secondsParts[1] || "0", 10);
650
+ return { hours, minutes, seconds, milliseconds };
651
+ };
652
+ var TimeColumn = ({
653
+ label,
654
+ value,
655
+ max,
656
+ field,
657
+ step,
658
+ disabled,
659
+ onChange
660
+ }) => {
661
+ const items = Array.from({ length: Math.floor(max / step) + 1 }, (_, i) => i * step);
662
+ const columnRef = React7.useRef(null);
663
+ React7.useEffect(() => {
664
+ if (columnRef.current) {
665
+ const selected = columnRef.current.querySelector(".time-picker__item--selected");
666
+ if (selected) {
667
+ selected.scrollIntoView({ block: "center", behavior: "smooth" });
668
+ }
669
+ }
670
+ }, [value]);
671
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "time-picker__column", children: [
672
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "time-picker__label", children: label }),
673
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "time-picker__scroll scrollable", ref: columnRef, children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
674
+ "button",
675
+ {
676
+ type: "button",
677
+ className: `time-picker__item ${item === value ? "time-picker__item--selected" : ""}`,
678
+ onClick: () => onChange(field, item),
679
+ disabled,
680
+ children: String(item).padStart(field === "milliseconds" ? 3 : 2, "0")
681
+ },
682
+ item
683
+ )) })
684
+ ] });
685
+ };
686
+ var TimePicker = ({
687
+ value,
688
+ onChange,
689
+ disabled,
690
+ showMilliseconds = false,
691
+ minuteStep = 1
692
+ }) => {
693
+ const [internalTime, setInternalTime] = React7.useState(value);
694
+ React7.useEffect(() => {
695
+ setInternalTime(value);
696
+ }, [value]);
697
+ const { hours, minutes, seconds, milliseconds } = parseTime(internalTime);
698
+ const handleChange = (field, newValue) => {
699
+ if (disabled) return;
700
+ const currentParsed = parseTime(internalTime);
701
+ const updated = { ...currentParsed, [field]: newValue };
702
+ let formattedTime = `${String(updated.hours).padStart(2, "0")}:${String(updated.minutes).padStart(2, "0")}:${String(updated.seconds).padStart(2, "0")}`;
703
+ if (showMilliseconds && updated.milliseconds > 0) {
704
+ formattedTime += `.${String(updated.milliseconds).padStart(3, "0")}`;
705
+ }
706
+ setInternalTime(formattedTime);
707
+ onChange(formattedTime);
708
+ };
709
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "time-picker", children: [
710
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
711
+ TimeColumn,
712
+ {
713
+ label: "Hours",
714
+ value: hours,
715
+ max: 23,
716
+ field: "hours",
717
+ step: 1,
718
+ disabled,
719
+ onChange: handleChange
720
+ }
721
+ ),
722
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
723
+ TimeColumn,
724
+ {
725
+ label: "Minutes",
726
+ value: minutes,
727
+ max: 59,
728
+ field: "minutes",
729
+ step: minuteStep,
730
+ disabled,
731
+ onChange: handleChange
732
+ }
733
+ ),
734
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
735
+ TimeColumn,
736
+ {
737
+ label: "Seconds",
738
+ value: seconds,
739
+ max: 59,
740
+ field: "seconds",
741
+ step: 1,
742
+ disabled,
743
+ onChange: handleChange
744
+ }
745
+ ),
746
+ showMilliseconds && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
747
+ TimeColumn,
748
+ {
749
+ label: "ms",
750
+ value: milliseconds,
751
+ max: 999,
752
+ field: "milliseconds",
753
+ step: 1,
754
+ disabled,
755
+ onChange: handleChange
756
+ }
757
+ )
758
+ ] });
759
+ };
760
+
761
+ // src/components/input/Input.tsx
762
+ var import_jsx_runtime10 = require("react/jsx-runtime");
763
+ var TYPE_ICON_MAP = INPUT_TYPE_ICONS;
764
+ var formatDisplayValue = (val, inputType) => {
765
+ if (!val) return "";
766
+ if (inputType === "date") {
767
+ const [year, month, day] = val.split("-");
768
+ return `${day}/${month}/${year}`;
769
+ }
770
+ if (inputType === "time") {
771
+ return val;
772
+ }
773
+ if (inputType === "datetime-local") {
774
+ const [datePart, timePart] = val.split("T");
775
+ if (datePart && timePart) {
776
+ const [year, month, day] = datePart.split("-");
777
+ return `${day}/${month}/${year} ${timePart}`;
778
+ }
779
+ return val;
780
+ }
781
+ return val;
782
+ };
783
+ var Input = React8.forwardRef(
784
+ ({
785
+ type = "text",
786
+ label,
787
+ helperText,
788
+ error,
789
+ icon,
790
+ fullWidth = false,
791
+ size = "md",
792
+ className = "",
793
+ disabled,
794
+ id,
795
+ showMilliseconds = false,
796
+ minuteStep = 1,
797
+ showClear = true,
798
+ ...props
799
+ }, ref) => {
800
+ const [showPassword, setShowPassword] = React8.useState(false);
801
+ const [showDateTimePicker, setShowDateTimePicker] = React8.useState(false);
802
+ const inputRef = React8.useRef(null);
803
+ const leftIcon = icon || TYPE_ICON_MAP[type];
804
+ const isPasswordType = type === "password";
805
+ const actualType = isPasswordType && showPassword ? "text" : type !== "date" && type !== "time" && type !== "datetime-local" ? type : "text";
806
+ const isDateTimeType = type === "date" || type === "time" || type === "datetime-local";
807
+ const isSearchType = type === "search";
808
+ const hasValue = props.value && String(props.value).length > 0;
809
+ const rightIconName = isPasswordType ? showPassword ? "heroicons:eye-slash-solid" : "heroicons:eye-solid" : isDateTimeType ? "heroicons:chevron-down-solid" : isSearchType && hasValue && showClear ? ACTION_ICONS.clear : void 0;
810
+ const handleRightIconClick = () => {
811
+ if (isPasswordType) {
812
+ setShowPassword(!showPassword);
813
+ } else if (isDateTimeType) {
814
+ setShowDateTimePicker(!showDateTimePicker);
815
+ } else if (isSearchType && hasValue && showClear) {
816
+ if (props.onChange) {
817
+ props.onChange({ target: { value: "" } });
818
+ }
819
+ }
820
+ };
821
+ const handleDateTimeChange = (newValue) => {
822
+ if (props.onChange) {
823
+ props.onChange({ target: { value: newValue } });
824
+ }
825
+ };
826
+ if (!isDateTimeType) {
827
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
828
+ InputField,
829
+ {
830
+ ref: ref || inputRef,
831
+ type: actualType,
832
+ label,
833
+ helperText,
834
+ error,
835
+ icon: leftIcon,
836
+ iconRight: rightIconName,
837
+ onRightIconClick: handleRightIconClick,
838
+ fullWidth,
839
+ size,
840
+ className,
841
+ disabled,
842
+ id,
843
+ ...props
844
+ }
845
+ );
846
+ }
847
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `input-container ${fullWidth ? "input-container--full-width" : ""} ${className}`.trim(), children: [
848
+ label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id, className: "input__label", children: label }),
849
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
850
+ Popover,
851
+ {
852
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
853
+ InputField,
854
+ {
855
+ ref: ref || inputRef,
856
+ type: "text",
857
+ icon: leftIcon,
858
+ iconRight: rightIconName,
859
+ onRightIconClick: () => setShowDateTimePicker(!showDateTimePicker),
860
+ fullWidth,
861
+ size,
862
+ disabled,
863
+ id,
864
+ value: formatDisplayValue(String(props.value || ""), type),
865
+ placeholder: props.placeholder,
866
+ readOnly: true
867
+ }
868
+ ),
869
+ isOpen: showDateTimePicker,
870
+ onToggle: () => setShowDateTimePicker(!showDateTimePicker),
871
+ placement: "bottom",
872
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: "1rem" }, children: [
873
+ (type === "date" || type === "datetime-local") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
874
+ DatePicker,
875
+ {
876
+ value: String(props.value || "").split("T")[0],
877
+ onChange: (newDate) => {
878
+ if (type === "datetime-local") {
879
+ const time = String(props.value || "").split("T")[1] || "00:00:00";
880
+ handleDateTimeChange(`${newDate}T${time}`);
881
+ } else {
882
+ handleDateTimeChange(newDate);
883
+ setShowDateTimePicker(false);
884
+ }
885
+ },
886
+ disabled
887
+ }
888
+ ),
889
+ (type === "time" || type === "datetime-local") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
890
+ TimePicker,
891
+ {
892
+ value: String(props.value || "").split("T")[1] || "00:00:00",
893
+ onChange: (newTime) => {
894
+ if (type === "datetime-local") {
895
+ const date = String(props.value || "").split("T")[0] || (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
896
+ handleDateTimeChange(`${date}T${newTime}`);
897
+ } else {
898
+ handleDateTimeChange(newTime);
899
+ }
900
+ },
901
+ disabled,
902
+ showMilliseconds,
903
+ minuteStep
904
+ }
905
+ )
906
+ ] })
907
+ }
908
+ ),
909
+ error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "input__message input__message--error", children: error }),
910
+ helperText && !error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "input__message", children: helperText })
911
+ ] });
912
+ }
913
+ );
914
+ Input.displayName = "Input";
915
+
916
+ // src/components/input/InputText.tsx
917
+ var import_jsx_runtime11 = require("react/jsx-runtime");
918
+ var InputText = import_react4.default.forwardRef((props, ref) => {
919
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Input, { ref, ...props, type: "text" });
920
+ });
921
+ InputText.displayName = "InputText";
922
+
923
+ // src/components/input/InputEmail.tsx
924
+ var import_react5 = __toESM(require("react"));
925
+ var import_jsx_runtime12 = require("react/jsx-runtime");
926
+ var InputEmail = import_react5.default.forwardRef((props, ref) => {
927
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Input, { ref, ...props, type: "email" });
928
+ });
929
+ InputEmail.displayName = "InputEmail";
930
+
931
+ // src/components/input/InputPassword.tsx
932
+ var import_react6 = __toESM(require("react"));
933
+ var import_jsx_runtime13 = require("react/jsx-runtime");
934
+ var InputPassword = import_react6.default.forwardRef((props, ref) => {
935
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Input, { ref, ...props, type: "password" });
936
+ });
937
+ InputPassword.displayName = "InputPassword";
938
+
939
+ // src/components/input/InputSearch.tsx
940
+ var import_react7 = __toESM(require("react"));
941
+ var import_jsx_runtime14 = require("react/jsx-runtime");
942
+ var InputSearch = import_react7.default.forwardRef((props, ref) => {
943
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Input, { ref, ...props, type: "search" });
944
+ });
945
+ InputSearch.displayName = "InputSearch";
946
+
947
+ // src/components/input/InputTel.tsx
948
+ var import_react8 = __toESM(require("react"));
949
+ var import_jsx_runtime15 = require("react/jsx-runtime");
950
+ var InputTel = import_react8.default.forwardRef((props, ref) => {
951
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Input, { ref, ...props, type: "tel" });
952
+ });
953
+ InputTel.displayName = "InputTel";
954
+
955
+ // src/components/input/InputUrl.tsx
956
+ var import_react9 = __toESM(require("react"));
957
+ var import_jsx_runtime16 = require("react/jsx-runtime");
958
+ var InputUrl = import_react9.default.forwardRef((props, ref) => {
959
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Input, { ref, ...props, type: "url" });
960
+ });
961
+ InputUrl.displayName = "InputUrl";
962
+
963
+ // src/components/input/InputNumber.tsx
964
+ var import_react10 = __toESM(require("react"));
965
+ var import_jsx_runtime17 = require("react/jsx-runtime");
966
+ var InputNumber = import_react10.default.forwardRef((props, ref) => {
967
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Input, { ref, ...props, type: "number" });
968
+ });
969
+ InputNumber.displayName = "InputNumber";
970
+
971
+ // src/components/input/InputDate.tsx
972
+ var import_react11 = __toESM(require("react"));
973
+ var import_jsx_runtime18 = require("react/jsx-runtime");
974
+ var InputDate = import_react11.default.forwardRef((props, ref) => {
975
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Input, { ref, ...props, type: "date" });
976
+ });
977
+ InputDate.displayName = "InputDate";
978
+
979
+ // src/components/input/InputTime.tsx
980
+ var import_react12 = __toESM(require("react"));
981
+ var import_jsx_runtime19 = require("react/jsx-runtime");
982
+ var InputTime = import_react12.default.forwardRef((props, ref) => {
983
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Input, { ref, ...props, type: "time" });
984
+ });
985
+ InputTime.displayName = "InputTime";
986
+
987
+ // src/components/input/InputDateTime.tsx
988
+ var import_react13 = __toESM(require("react"));
989
+ var import_jsx_runtime20 = require("react/jsx-runtime");
990
+ var InputDateTime = import_react13.default.forwardRef((props, ref) => {
991
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Input, { ref, ...props, type: "datetime-local" });
992
+ });
993
+ InputDateTime.displayName = "InputDateTime";
994
+
995
+ // src/components/tooltip/tooltip.tsx
996
+ var React19 = __toESM(require("react"));
997
+ var ReactDOM2 = __toESM(require("react-dom"));
998
+ var import_jsx_runtime21 = require("react/jsx-runtime");
999
+
1000
+ // src/components/_shared/HeadingAnchor.tsx
1001
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1002
+
1003
+ // src/components/drawer/drawer.tsx
1004
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1005
+ var Drawer = ({
1006
+ children,
1007
+ title,
1008
+ placement = "right",
1009
+ size = "400px",
1010
+ store,
1011
+ ...props
1012
+ }) => {
1013
+ const sizeValue = typeof size === "number" ? `${size}px` : size;
1014
+ const getDrawerStyles = () => {
1015
+ const baseStyles = {
1016
+ zIndex: 1e3
1017
+ };
1018
+ switch (placement) {
1019
+ case "top":
1020
+ return {
1021
+ ...baseStyles,
1022
+ height: sizeValue
1023
+ };
1024
+ case "bottom":
1025
+ return {
1026
+ ...baseStyles,
1027
+ height: sizeValue
1028
+ };
1029
+ case "left":
1030
+ return {
1031
+ ...baseStyles,
1032
+ width: sizeValue
1033
+ };
1034
+ case "right":
1035
+ default:
1036
+ return {
1037
+ ...baseStyles,
1038
+ width: sizeValue
1039
+ };
1040
+ }
1041
+ };
1042
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1043
+ import_react15.Dialog,
1044
+ {
1045
+ store,
1046
+ ...props,
1047
+ className: `drawer drawer--${placement}`,
1048
+ style: getDrawerStyles(),
1049
+ backdrop: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Backdrop, {}),
1050
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "drawer__content", children: [
1051
+ title && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "drawer__header", children: [
1052
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react15.DialogHeading, { className: "drawer__title", children: title }),
1053
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1054
+ Button,
1055
+ {
1056
+ variant: "ghost",
1057
+ startIcon: ACTION_ICONS.close,
1058
+ iconOnly: true,
1059
+ onClick: store.hide,
1060
+ "aria-label": "Close drawer"
1061
+ }
1062
+ )
1063
+ ] }),
1064
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "drawer__body scrollable", children })
1065
+ ] })
1066
+ }
1067
+ );
1068
+ };
1069
+ // Annotate the CommonJS export names for ESM import in node:
1070
+ 0 && (module.exports = {
1071
+ Drawer
1072
+ });