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