@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,1401 @@
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/section/index.ts
31
+ var section_exports = {};
32
+ __export(section_exports, {
33
+ Section: () => Section
34
+ });
35
+ module.exports = __toCommonJS(section_exports);
36
+
37
+ // src/components/_shared/Backdrop.tsx
38
+ var React = __toESM(require("react"));
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ var Backdrop = React.forwardRef(
41
+ ({ className = "", blur = true, style, ...props }, ref) => {
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ "div",
44
+ {
45
+ ref,
46
+ className: `backdrop ${blur ? "backdrop--blur" : ""} ${className}`,
47
+ style,
48
+ "aria-hidden": "true",
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+ );
54
+ Backdrop.displayName = "Backdrop";
55
+
56
+ // src/components/icons/icons.tsx
57
+ var import_react = require("@iconify/react");
58
+ var import_jsx_runtime2 = require("react/jsx-runtime");
59
+ var Icon = ({ name, size = 24, className, loading = false, ...rest }) => {
60
+ const iconName = name.includes(":") ? name : `heroicons:${name}`;
61
+ const classes = ["icon", className].filter(Boolean).join(" ");
62
+ if (loading) {
63
+ const style = { width: size, height: size };
64
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
65
+ "span",
66
+ {
67
+ className: `${classes} icon--skeleton`,
68
+ style,
69
+ "aria-hidden": rest["aria-label"] ? "false" : "true",
70
+ ...rest["aria-label"] ? { "aria-label": rest["aria-label"] } : {}
71
+ }
72
+ );
73
+ }
74
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
75
+ import_react.Icon,
76
+ {
77
+ icon: iconName,
78
+ width: size,
79
+ height: size,
80
+ className: classes,
81
+ ...rest
82
+ }
83
+ );
84
+ };
85
+
86
+ // src/components/icons/iconConstants.ts
87
+ var INPUT_TYPE_ICONS = {
88
+ // Standard HTML input types
89
+ email: "envelope-solid",
90
+ password: "lock-closed-solid",
91
+ search: "magnifying-glass-solid",
92
+ date: "calendar-days-solid",
93
+ time: "clock-solid",
94
+ "datetime-local": "calendar-days-solid",
95
+ tel: "phone-solid",
96
+ url: "link-solid",
97
+ number: "hashtag-solid",
98
+ // Additional semantic types
99
+ username: "user-solid",
100
+ name: "user-solid",
101
+ firstname: "user-solid",
102
+ lastname: "user-solid",
103
+ address: "map-pin-solid",
104
+ city: "building-solid",
105
+ state: "map-solid",
106
+ zip: "map-pin-solid",
107
+ "zip-code": "map-pin-solid",
108
+ country: "globe-americas-solid",
109
+ creditcard: "credit-card-solid",
110
+ card: "credit-card-solid",
111
+ cvv: "lock-closed-solid",
112
+ expiry: "calendar-days-solid",
113
+ "expiration-date": "calendar-days-solid",
114
+ // File and media types
115
+ file: "document-solid",
116
+ image: "photo-solid",
117
+ video: "video-camera-solid",
118
+ audio: "microphone-solid",
119
+ // Communication
120
+ message: "chat-bubble-left-solid",
121
+ comment: "chat-bubble-left-solid",
122
+ feedback: "chat-bubble-left-solid",
123
+ // Actions and states
124
+ submit: "paper-airplane-solid",
125
+ send: "paper-airplane-solid",
126
+ save: "floppy-disk-solid",
127
+ edit: "pencil-solid",
128
+ delete: "trash-solid",
129
+ remove: "x-mark-solid",
130
+ add: "plus-solid",
131
+ create: "plus-solid",
132
+ upload: "arrow-up-tray-solid",
133
+ download: "arrow-down-tray-solid",
134
+ refresh: "arrow-path-solid",
135
+ reload: "arrow-path-solid",
136
+ settings: "cog-solid",
137
+ config: "cog-solid",
138
+ filter: "funnel-solid",
139
+ sort: "bars-arrow-up-solid"
140
+ };
141
+ var ACTION_ICONS = {
142
+ close: "x-mark-solid",
143
+ back: "arrow-left-solid",
144
+ forward: "arrow-right-solid",
145
+ up: "arrow-up-solid",
146
+ down: "arrow-down-solid",
147
+ expand: "chevron-down-solid",
148
+ collapse: "chevron-up-solid",
149
+ menu: "bars-3-solid",
150
+ more: "ellipsis-horizontal-solid",
151
+ check: "check-solid",
152
+ cross: "x-mark-solid",
153
+ plus: "plus-solid",
154
+ minus: "minus-solid",
155
+ search: "magnifying-glass-solid",
156
+ clear: "x-mark-solid",
157
+ loading: "arrow-path-solid",
158
+ error: "exclamation-triangle-solid",
159
+ warning: "exclamation-triangle-solid",
160
+ info: "information-circle-solid",
161
+ success: "check-circle-solid"
162
+ };
163
+
164
+ // src/components/_shared/Thumb.tsx
165
+ var import_jsx_runtime3 = require("react/jsx-runtime");
166
+
167
+ // src/components/_shared/HeadingAnchor.tsx
168
+ var import_react14 = require("react");
169
+
170
+ // src/components/dialog/Dialog.tsx
171
+ var React3 = __toESM(require("react"));
172
+ var import_react_dom = require("react-dom");
173
+
174
+ // src/components/button/button.tsx
175
+ var import_react2 = __toESM(require("react"));
176
+ var import_react3 = require("@ariakit/react");
177
+ var import_jsx_runtime4 = require("react/jsx-runtime");
178
+ var Button = import_react2.default.forwardRef(
179
+ ({
180
+ variant = "primary",
181
+ size = "md",
182
+ children,
183
+ isLoading = false,
184
+ disabled = false,
185
+ fullWidth = false,
186
+ startIcon,
187
+ endIcon,
188
+ iconOnly = false,
189
+ href,
190
+ active = false,
191
+ className,
192
+ onClick,
193
+ ...props
194
+ }, ref) => {
195
+ const buttonClasses = [
196
+ "btn",
197
+ `btn--${variant}`,
198
+ `btn--${size}`,
199
+ fullWidth && "btn--full-width",
200
+ iconOnly && "btn--icon-only",
201
+ active && "btn--active",
202
+ className
203
+ ].filter(Boolean).join(" ");
204
+ const iconSize = size === "xs" ? 14 : size === "sm" ? 16 : size === "lg" ? 24 : 20;
205
+ const buttonContent = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
206
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "btn__spinner" }),
207
+ startIcon && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "btn__icon-placeholder", style: { width: iconSize, height: iconSize } }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: startIcon, size: iconSize, className: "btn__icon" })),
208
+ !iconOnly && children,
209
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: endIcon, size: iconSize, className: "btn__icon" })
210
+ ] });
211
+ const handleClick = (e) => {
212
+ if (href && !isLoading && !disabled) {
213
+ window.location.href = href;
214
+ }
215
+ onClick?.(e);
216
+ };
217
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
218
+ import_react3.Button,
219
+ {
220
+ ref,
221
+ disabled: disabled || isLoading,
222
+ className: buttonClasses,
223
+ onClick: handleClick,
224
+ ...props,
225
+ children: buttonContent
226
+ }
227
+ );
228
+ }
229
+ );
230
+ Button.displayName = "Button";
231
+
232
+ // src/components/dialog/Dialog.tsx
233
+ var import_jsx_runtime5 = require("react/jsx-runtime");
234
+ var Dialog = ({
235
+ open,
236
+ onClose,
237
+ title,
238
+ children,
239
+ size = "md",
240
+ footer,
241
+ showCloseButton = true,
242
+ closeOnBackdropClick = true,
243
+ closeOnEscape = true,
244
+ className = "",
245
+ ariaLabel,
246
+ ariaDescribedBy
247
+ }) => {
248
+ const dialogRef = React3.useRef(null);
249
+ React3.useEffect(() => {
250
+ if (!open || !closeOnEscape) return;
251
+ const handleEscape = (e) => {
252
+ if (e.key === "Escape") {
253
+ onClose();
254
+ }
255
+ };
256
+ document.addEventListener("keydown", handleEscape);
257
+ return () => document.removeEventListener("keydown", handleEscape);
258
+ }, [open, closeOnEscape, onClose]);
259
+ React3.useEffect(() => {
260
+ if (open) {
261
+ const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
262
+ document.body.style.overflow = "hidden";
263
+ document.body.style.paddingRight = `${scrollbarWidth}px`;
264
+ } else {
265
+ document.body.style.overflow = "";
266
+ document.body.style.paddingRight = "";
267
+ }
268
+ return () => {
269
+ document.body.style.overflow = "";
270
+ document.body.style.paddingRight = "";
271
+ };
272
+ }, [open]);
273
+ React3.useEffect(() => {
274
+ if (!open || !dialogRef.current) return;
275
+ const dialog = dialogRef.current;
276
+ const focusableElements = dialog.querySelectorAll(
277
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
278
+ );
279
+ const firstElement = focusableElements[0];
280
+ const lastElement = focusableElements[focusableElements.length - 1];
281
+ const handleTab = (e) => {
282
+ if (e.key !== "Tab") return;
283
+ if (e.shiftKey) {
284
+ if (document.activeElement === firstElement) {
285
+ e.preventDefault();
286
+ lastElement?.focus();
287
+ }
288
+ } else {
289
+ if (document.activeElement === lastElement) {
290
+ e.preventDefault();
291
+ firstElement?.focus();
292
+ }
293
+ }
294
+ };
295
+ dialog.addEventListener("keydown", handleTab);
296
+ firstElement?.focus();
297
+ return () => {
298
+ dialog.removeEventListener("keydown", handleTab);
299
+ };
300
+ }, [open]);
301
+ const handleBackdropClick = (e) => {
302
+ if (closeOnBackdropClick && e.target === e.currentTarget) {
303
+ onClose();
304
+ }
305
+ };
306
+ if (!open) return null;
307
+ const dialogContent = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dialog__portal", children: [
308
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Backdrop, { onClick: handleBackdropClick, "data-enter": "" }),
309
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
310
+ "div",
311
+ {
312
+ ref: dialogRef,
313
+ className: `dialog dialog--${size} ${className}`,
314
+ role: "dialog",
315
+ "aria-modal": "true",
316
+ "aria-label": ariaLabel || title,
317
+ "aria-describedby": ariaDescribedBy,
318
+ children: [
319
+ (title || showCloseButton) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dialog__header", children: [
320
+ title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { className: "dialog__title", children: title }),
321
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
322
+ Button,
323
+ {
324
+ variant: "ghost",
325
+ className: "dialog__close",
326
+ startIcon: ACTION_ICONS.close,
327
+ iconOnly: true,
328
+ onClick: onClose,
329
+ "aria-label": "Close dialog"
330
+ }
331
+ )
332
+ ] }),
333
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dialog__content scrollable", children }),
334
+ footer && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dialog__footer", children: footer })
335
+ ]
336
+ }
337
+ )
338
+ ] });
339
+ return (0, import_react_dom.createPortal)(dialogContent, document.body);
340
+ };
341
+
342
+ // src/components/input/InputText.tsx
343
+ var import_react4 = __toESM(require("react"));
344
+
345
+ // src/components/input/Input.tsx
346
+ var React8 = __toESM(require("react"));
347
+
348
+ // src/components/input/InputField.tsx
349
+ var React4 = __toESM(require("react"));
350
+ var import_jsx_runtime6 = require("react/jsx-runtime");
351
+ var InputField = React4.forwardRef(
352
+ ({
353
+ type = "text",
354
+ label,
355
+ helperText,
356
+ error,
357
+ icon,
358
+ iconRight,
359
+ fullWidth = false,
360
+ size = "md",
361
+ className = "",
362
+ disabled,
363
+ id,
364
+ onRightIconClick,
365
+ ...props
366
+ }, ref) => {
367
+ const inputId = id || `input-${React4.useId()}`;
368
+ const containerClasses = [
369
+ "input-container",
370
+ fullWidth && "input-container--full-width",
371
+ className
372
+ ].filter(Boolean).join(" ");
373
+ const inputClasses = [
374
+ "input",
375
+ `input--${size}`,
376
+ error && "input--error",
377
+ disabled && "input--disabled",
378
+ icon && "input--has-icon-left",
379
+ iconRight && "input--has-icon-right"
380
+ ].filter(Boolean).join(" ");
381
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: containerClasses, children: [
382
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: inputId, className: "input__label", children: label }),
383
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "input__wrapper", children: [
384
+ 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 }) }),
385
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
386
+ "input",
387
+ {
388
+ ref,
389
+ type,
390
+ id: inputId,
391
+ className: inputClasses,
392
+ disabled,
393
+ ...props
394
+ }
395
+ ),
396
+ iconRight && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
397
+ "button",
398
+ {
399
+ type: "button",
400
+ className: "input__icon input__icon--right",
401
+ onClick: onRightIconClick,
402
+ tabIndex: -1,
403
+ "aria-label": "Icon action",
404
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: iconRight, size: 16 })
405
+ }
406
+ )
407
+ ] }),
408
+ error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "input__message input__message--error", children: error }),
409
+ helperText && !error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "input__message", children: helperText })
410
+ ] });
411
+ }
412
+ );
413
+
414
+ // src/components/popover/popover.tsx
415
+ var React5 = __toESM(require("react"));
416
+ var ReactDOM = __toESM(require("react-dom"));
417
+ var import_jsx_runtime7 = require("react/jsx-runtime");
418
+ var Popover = ({
419
+ trigger,
420
+ children,
421
+ isOpen,
422
+ onToggle,
423
+ placement = "bottom",
424
+ align = "start",
425
+ offset = 8,
426
+ flip = true,
427
+ closeOnEscape = true,
428
+ closeOnClickOutside = true
429
+ }) => {
430
+ const [internalOpen, setInternalOpen] = React5.useState(false);
431
+ const triggerRef = React5.useRef(null);
432
+ const popoverRef = React5.useRef(null);
433
+ const [popoverStyle, setPopoverStyle] = React5.useState({});
434
+ const [resolvedPlacement, setResolvedPlacement] = React5.useState(placement);
435
+ const isControlled = isOpen !== void 0;
436
+ const open = isControlled ? isOpen : internalOpen;
437
+ const toggle = React5.useCallback(() => {
438
+ if (isControlled) {
439
+ onToggle?.();
440
+ } else {
441
+ setInternalOpen((prev) => !prev);
442
+ }
443
+ }, [isControlled, onToggle]);
444
+ React5.useEffect(() => {
445
+ const handleClickOutside = (event) => {
446
+ if (closeOnClickOutside && triggerRef.current && !triggerRef.current.contains(event.target) && popoverRef.current && !popoverRef.current.contains(event.target)) {
447
+ toggle();
448
+ }
449
+ };
450
+ if (open) {
451
+ document.addEventListener("mousedown", handleClickOutside);
452
+ }
453
+ return () => {
454
+ document.removeEventListener("mousedown", handleClickOutside);
455
+ };
456
+ }, [open, toggle, closeOnClickOutside]);
457
+ React5.useEffect(() => {
458
+ const handleEscapeKey = (event) => {
459
+ if (closeOnEscape && event.key === "Escape" && open) {
460
+ toggle();
461
+ }
462
+ };
463
+ if (open) {
464
+ document.addEventListener("keydown", handleEscapeKey);
465
+ }
466
+ return () => {
467
+ document.removeEventListener("keydown", handleEscapeKey);
468
+ };
469
+ }, [open, toggle, closeOnEscape]);
470
+ React5.useEffect(() => {
471
+ if (!open || !triggerRef.current || !popoverRef.current) {
472
+ return;
473
+ }
474
+ const updatePosition = () => {
475
+ if (!triggerRef.current || !popoverRef.current) {
476
+ return;
477
+ }
478
+ const triggerRect = triggerRef.current.getBoundingClientRect();
479
+ const popoverRect = popoverRef.current.getBoundingClientRect();
480
+ const viewportWidth = window.innerWidth;
481
+ const viewportHeight = window.innerHeight;
482
+ const spaceTop = triggerRect.top;
483
+ const spaceBottom = viewportHeight - triggerRect.bottom;
484
+ const spaceLeft = triggerRect.left;
485
+ const spaceRight = viewportWidth - triggerRect.right;
486
+ let finalPlacement = placement;
487
+ if (flip) {
488
+ if (placement === "right" && spaceRight < popoverRect.width + offset) {
489
+ finalPlacement = spaceLeft >= popoverRect.width + offset ? "left" : "bottom";
490
+ } else if (placement === "left" && spaceLeft < popoverRect.width + offset) {
491
+ finalPlacement = spaceRight >= popoverRect.width + offset ? "right" : "bottom";
492
+ } else if (placement === "bottom" && spaceBottom < popoverRect.height + offset) {
493
+ finalPlacement = spaceTop >= popoverRect.height + offset ? "top" : "bottom";
494
+ } else if (placement === "top" && spaceTop < popoverRect.height + offset) {
495
+ finalPlacement = spaceBottom >= popoverRect.height + offset ? "bottom" : "top";
496
+ }
497
+ }
498
+ setResolvedPlacement(finalPlacement);
499
+ const newStyle = {
500
+ position: "fixed",
501
+ zIndex: "var(--z-popover)",
502
+ opacity: 1,
503
+ visibility: "visible",
504
+ pointerEvents: "auto"
505
+ };
506
+ const getAlignmentOffset = () => {
507
+ let alignmentOffset = 0;
508
+ if (finalPlacement === "left" || finalPlacement === "right") {
509
+ switch (align) {
510
+ case "center":
511
+ alignmentOffset = (triggerRect.height - popoverRect.height) / 2;
512
+ break;
513
+ case "end":
514
+ alignmentOffset = triggerRect.height - popoverRect.height;
515
+ break;
516
+ case "start":
517
+ default:
518
+ alignmentOffset = 0;
519
+ }
520
+ } else {
521
+ switch (align) {
522
+ case "center":
523
+ alignmentOffset = (triggerRect.width - popoverRect.width) / 2;
524
+ break;
525
+ case "end":
526
+ alignmentOffset = triggerRect.width - popoverRect.width;
527
+ break;
528
+ case "start":
529
+ default:
530
+ alignmentOffset = 0;
531
+ }
532
+ }
533
+ return alignmentOffset;
534
+ };
535
+ switch (finalPlacement) {
536
+ case "right":
537
+ newStyle.top = triggerRect.top + getAlignmentOffset();
538
+ newStyle.left = triggerRect.right + offset;
539
+ break;
540
+ case "left":
541
+ newStyle.top = triggerRect.top + getAlignmentOffset();
542
+ newStyle.left = triggerRect.left - popoverRect.width - offset;
543
+ break;
544
+ case "top":
545
+ newStyle.top = triggerRect.top - popoverRect.height - offset;
546
+ newStyle.left = triggerRect.left + getAlignmentOffset();
547
+ break;
548
+ case "bottom":
549
+ default:
550
+ newStyle.top = triggerRect.bottom + offset;
551
+ newStyle.left = triggerRect.left + getAlignmentOffset();
552
+ }
553
+ if (typeof newStyle.left === "number") {
554
+ if (newStyle.left + popoverRect.width > viewportWidth - offset) {
555
+ newStyle.left = viewportWidth - popoverRect.width - offset;
556
+ }
557
+ if (newStyle.left < offset) {
558
+ newStyle.left = offset;
559
+ }
560
+ }
561
+ if (typeof newStyle.top === "number") {
562
+ if (newStyle.top + popoverRect.height > viewportHeight - offset) {
563
+ newStyle.top = viewportHeight - popoverRect.height - offset;
564
+ }
565
+ if (newStyle.top < offset) {
566
+ newStyle.top = offset;
567
+ }
568
+ }
569
+ setPopoverStyle(newStyle);
570
+ };
571
+ requestAnimationFrame(updatePosition);
572
+ window.addEventListener("resize", updatePosition);
573
+ window.addEventListener("scroll", updatePosition, true);
574
+ return () => {
575
+ window.removeEventListener("resize", updatePosition);
576
+ window.removeEventListener("scroll", updatePosition, true);
577
+ };
578
+ }, [open, placement, align, offset, flip]);
579
+ const handleTriggerClick = React5.useCallback(() => {
580
+ toggle();
581
+ }, [toggle]);
582
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
583
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
584
+ "div",
585
+ {
586
+ ref: triggerRef,
587
+ onClick: handleTriggerClick,
588
+ style: { display: "inline-block", position: "relative" },
589
+ children: React5.isValidElement(trigger) ? React5.cloneElement(trigger, {
590
+ onClick: (e) => {
591
+ e.stopPropagation();
592
+ handleTriggerClick();
593
+ trigger.props?.onClick?.(e);
594
+ }
595
+ }) : trigger
596
+ }
597
+ ),
598
+ open && ReactDOM.createPortal(
599
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
600
+ "div",
601
+ {
602
+ ref: popoverRef,
603
+ className: `popover popover--${resolvedPlacement}`,
604
+ style: {
605
+ ...popoverStyle,
606
+ // Start with opacity 0 and visibility hidden to prevent initial flash
607
+ opacity: popoverStyle.top !== void 0 ? 1 : 0,
608
+ visibility: popoverStyle.top !== void 0 ? "visible" : "hidden"
609
+ },
610
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "popover__content", children })
611
+ }
612
+ ),
613
+ document.body
614
+ )
615
+ ] });
616
+ };
617
+
618
+ // src/components/input/DatePicker.tsx
619
+ var React6 = __toESM(require("react"));
620
+ var import_jsx_runtime8 = require("react/jsx-runtime");
621
+ var MONTHS = [
622
+ "January",
623
+ "February",
624
+ "March",
625
+ "April",
626
+ "May",
627
+ "June",
628
+ "July",
629
+ "August",
630
+ "September",
631
+ "October",
632
+ "November",
633
+ "December"
634
+ ];
635
+ var DAYS_OF_WEEK = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
636
+ var DatePicker = ({ value, onChange, disabled }) => {
637
+ const parseDate = (dateStr) => {
638
+ if (!dateStr) {
639
+ const today = /* @__PURE__ */ new Date();
640
+ return { year: today.getFullYear(), month: today.getMonth(), day: today.getDate() };
641
+ }
642
+ const [year, month, day] = dateStr.split("-").map(Number);
643
+ return { year, month: month - 1, day };
644
+ };
645
+ const { year: initialYear, month: initialMonth, day: selectedDay } = parseDate(value);
646
+ const [currentYear, setCurrentYear] = React6.useState(initialYear);
647
+ const [currentMonth, setCurrentMonth] = React6.useState(initialMonth);
648
+ const getDaysInMonth = (year, month) => {
649
+ return new Date(year, month + 1, 0).getDate();
650
+ };
651
+ const getFirstDayOfMonth = (year, month) => {
652
+ return new Date(year, month, 1).getDay();
653
+ };
654
+ const handleDateSelect = (day) => {
655
+ if (disabled) return;
656
+ const formattedDate = `${currentYear}-${String(currentMonth + 1).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
657
+ onChange(formattedDate);
658
+ };
659
+ const handlePrevMonth = () => {
660
+ if (currentMonth === 0) {
661
+ setCurrentMonth(11);
662
+ setCurrentYear(currentYear - 1);
663
+ } else {
664
+ setCurrentMonth(currentMonth - 1);
665
+ }
666
+ };
667
+ const handleNextMonth = () => {
668
+ if (currentMonth === 11) {
669
+ setCurrentMonth(0);
670
+ setCurrentYear(currentYear + 1);
671
+ } else {
672
+ setCurrentMonth(currentMonth + 1);
673
+ }
674
+ };
675
+ const daysInMonth = getDaysInMonth(currentYear, currentMonth);
676
+ const firstDay = getFirstDayOfMonth(currentYear, currentMonth);
677
+ const days = [
678
+ ...Array(firstDay).fill(null),
679
+ ...Array.from({ length: daysInMonth }, (_, i) => i + 1)
680
+ ];
681
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "date-picker", children: [
682
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "date-picker__header", children: [
683
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
684
+ "button",
685
+ {
686
+ type: "button",
687
+ className: "date-picker__nav",
688
+ onClick: handlePrevMonth,
689
+ disabled,
690
+ "aria-label": "Previous month",
691
+ children: "\u2039"
692
+ }
693
+ ),
694
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "date-picker__title", children: [
695
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
696
+ "select",
697
+ {
698
+ className: "date-picker__select",
699
+ value: currentMonth,
700
+ onChange: (e) => setCurrentMonth(Number(e.target.value)),
701
+ disabled,
702
+ children: MONTHS.map((month, idx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: idx, children: month }, month))
703
+ }
704
+ ),
705
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
706
+ "select",
707
+ {
708
+ className: "date-picker__select",
709
+ value: currentYear,
710
+ onChange: (e) => setCurrentYear(Number(e.target.value)),
711
+ disabled,
712
+ children: Array.from({ length: 100 }, (_, i) => currentYear - 50 + i).map((year) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: year, children: year }, year))
713
+ }
714
+ )
715
+ ] }),
716
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
717
+ "button",
718
+ {
719
+ type: "button",
720
+ className: "date-picker__nav",
721
+ onClick: handleNextMonth,
722
+ disabled,
723
+ "aria-label": "Next month",
724
+ children: "\u203A"
725
+ }
726
+ )
727
+ ] }),
728
+ /* @__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)) }),
729
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "date-picker__days", children: days.map((day, idx) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
730
+ "button",
731
+ {
732
+ type: "button",
733
+ className: `date-picker__day ${day === selectedDay ? "date-picker__day--selected" : ""} ${!day ? "date-picker__day--empty" : ""}`,
734
+ onClick: () => day && handleDateSelect(day),
735
+ disabled: !day || disabled,
736
+ children: day || ""
737
+ },
738
+ idx
739
+ )) })
740
+ ] });
741
+ };
742
+
743
+ // src/components/input/TimePicker.tsx
744
+ var React7 = __toESM(require("react"));
745
+ var import_jsx_runtime9 = require("react/jsx-runtime");
746
+ var parseTime = (timeStr) => {
747
+ if (!timeStr) return { hours: 0, minutes: 0, seconds: 0, milliseconds: 0 };
748
+ const parts = timeStr.split(":");
749
+ const hours = parseInt(parts[0] || "0", 10);
750
+ const minutes = parseInt(parts[1] || "0", 10);
751
+ const secondsParts = (parts[2] || "0").split(".");
752
+ const seconds = parseInt(secondsParts[0] || "0", 10);
753
+ const milliseconds = parseInt(secondsParts[1] || "0", 10);
754
+ return { hours, minutes, seconds, milliseconds };
755
+ };
756
+ var TimeColumn = ({
757
+ label,
758
+ value,
759
+ max,
760
+ field,
761
+ step,
762
+ disabled,
763
+ onChange
764
+ }) => {
765
+ const items = Array.from({ length: Math.floor(max / step) + 1 }, (_, i) => i * step);
766
+ const columnRef = React7.useRef(null);
767
+ React7.useEffect(() => {
768
+ if (columnRef.current) {
769
+ const selected = columnRef.current.querySelector(".time-picker__item--selected");
770
+ if (selected) {
771
+ selected.scrollIntoView({ block: "center", behavior: "smooth" });
772
+ }
773
+ }
774
+ }, [value]);
775
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "time-picker__column", children: [
776
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "time-picker__label", children: label }),
777
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "time-picker__scroll scrollable", ref: columnRef, children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
778
+ "button",
779
+ {
780
+ type: "button",
781
+ className: `time-picker__item ${item === value ? "time-picker__item--selected" : ""}`,
782
+ onClick: () => onChange(field, item),
783
+ disabled,
784
+ children: String(item).padStart(field === "milliseconds" ? 3 : 2, "0")
785
+ },
786
+ item
787
+ )) })
788
+ ] });
789
+ };
790
+ var TimePicker = ({
791
+ value,
792
+ onChange,
793
+ disabled,
794
+ showMilliseconds = false,
795
+ minuteStep = 1
796
+ }) => {
797
+ const [internalTime, setInternalTime] = React7.useState(value);
798
+ React7.useEffect(() => {
799
+ setInternalTime(value);
800
+ }, [value]);
801
+ const { hours, minutes, seconds, milliseconds } = parseTime(internalTime);
802
+ const handleChange = (field, newValue) => {
803
+ if (disabled) return;
804
+ const currentParsed = parseTime(internalTime);
805
+ const updated = { ...currentParsed, [field]: newValue };
806
+ let formattedTime = `${String(updated.hours).padStart(2, "0")}:${String(updated.minutes).padStart(2, "0")}:${String(updated.seconds).padStart(2, "0")}`;
807
+ if (showMilliseconds && updated.milliseconds > 0) {
808
+ formattedTime += `.${String(updated.milliseconds).padStart(3, "0")}`;
809
+ }
810
+ setInternalTime(formattedTime);
811
+ onChange(formattedTime);
812
+ };
813
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "time-picker", children: [
814
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
815
+ TimeColumn,
816
+ {
817
+ label: "Hours",
818
+ value: hours,
819
+ max: 23,
820
+ field: "hours",
821
+ step: 1,
822
+ disabled,
823
+ onChange: handleChange
824
+ }
825
+ ),
826
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
827
+ TimeColumn,
828
+ {
829
+ label: "Minutes",
830
+ value: minutes,
831
+ max: 59,
832
+ field: "minutes",
833
+ step: minuteStep,
834
+ disabled,
835
+ onChange: handleChange
836
+ }
837
+ ),
838
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
839
+ TimeColumn,
840
+ {
841
+ label: "Seconds",
842
+ value: seconds,
843
+ max: 59,
844
+ field: "seconds",
845
+ step: 1,
846
+ disabled,
847
+ onChange: handleChange
848
+ }
849
+ ),
850
+ showMilliseconds && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
851
+ TimeColumn,
852
+ {
853
+ label: "ms",
854
+ value: milliseconds,
855
+ max: 999,
856
+ field: "milliseconds",
857
+ step: 1,
858
+ disabled,
859
+ onChange: handleChange
860
+ }
861
+ )
862
+ ] });
863
+ };
864
+
865
+ // src/components/input/Input.tsx
866
+ var import_jsx_runtime10 = require("react/jsx-runtime");
867
+ var TYPE_ICON_MAP = INPUT_TYPE_ICONS;
868
+ var formatDisplayValue = (val, inputType) => {
869
+ if (!val) return "";
870
+ if (inputType === "date") {
871
+ const [year, month, day] = val.split("-");
872
+ return `${day}/${month}/${year}`;
873
+ }
874
+ if (inputType === "time") {
875
+ return val;
876
+ }
877
+ if (inputType === "datetime-local") {
878
+ const [datePart, timePart] = val.split("T");
879
+ if (datePart && timePart) {
880
+ const [year, month, day] = datePart.split("-");
881
+ return `${day}/${month}/${year} ${timePart}`;
882
+ }
883
+ return val;
884
+ }
885
+ return val;
886
+ };
887
+ var Input = React8.forwardRef(
888
+ ({
889
+ type = "text",
890
+ label,
891
+ helperText,
892
+ error,
893
+ icon,
894
+ fullWidth = false,
895
+ size = "md",
896
+ className = "",
897
+ disabled,
898
+ id,
899
+ showMilliseconds = false,
900
+ minuteStep = 1,
901
+ showClear = true,
902
+ ...props
903
+ }, ref) => {
904
+ const [showPassword, setShowPassword] = React8.useState(false);
905
+ const [showDateTimePicker, setShowDateTimePicker] = React8.useState(false);
906
+ const inputRef = React8.useRef(null);
907
+ const leftIcon = icon || TYPE_ICON_MAP[type];
908
+ const isPasswordType = type === "password";
909
+ const actualType = isPasswordType && showPassword ? "text" : type !== "date" && type !== "time" && type !== "datetime-local" ? type : "text";
910
+ const isDateTimeType = type === "date" || type === "time" || type === "datetime-local";
911
+ const isSearchType = type === "search";
912
+ const hasValue = props.value && String(props.value).length > 0;
913
+ const rightIconName = isPasswordType ? showPassword ? "heroicons:eye-slash-solid" : "heroicons:eye-solid" : isDateTimeType ? "heroicons:chevron-down-solid" : isSearchType && hasValue && showClear ? ACTION_ICONS.clear : void 0;
914
+ const handleRightIconClick = () => {
915
+ if (isPasswordType) {
916
+ setShowPassword(!showPassword);
917
+ } else if (isDateTimeType) {
918
+ setShowDateTimePicker(!showDateTimePicker);
919
+ } else if (isSearchType && hasValue && showClear) {
920
+ if (props.onChange) {
921
+ props.onChange({ target: { value: "" } });
922
+ }
923
+ }
924
+ };
925
+ const handleDateTimeChange = (newValue) => {
926
+ if (props.onChange) {
927
+ props.onChange({ target: { value: newValue } });
928
+ }
929
+ };
930
+ if (!isDateTimeType) {
931
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
932
+ InputField,
933
+ {
934
+ ref: ref || inputRef,
935
+ type: actualType,
936
+ label,
937
+ helperText,
938
+ error,
939
+ icon: leftIcon,
940
+ iconRight: rightIconName,
941
+ onRightIconClick: handleRightIconClick,
942
+ fullWidth,
943
+ size,
944
+ className,
945
+ disabled,
946
+ id,
947
+ ...props
948
+ }
949
+ );
950
+ }
951
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `input-container ${fullWidth ? "input-container--full-width" : ""} ${className}`.trim(), children: [
952
+ label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id, className: "input__label", children: label }),
953
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
954
+ Popover,
955
+ {
956
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
957
+ InputField,
958
+ {
959
+ ref: ref || inputRef,
960
+ type: "text",
961
+ icon: leftIcon,
962
+ iconRight: rightIconName,
963
+ onRightIconClick: () => setShowDateTimePicker(!showDateTimePicker),
964
+ fullWidth,
965
+ size,
966
+ disabled,
967
+ id,
968
+ value: formatDisplayValue(String(props.value || ""), type),
969
+ placeholder: props.placeholder,
970
+ readOnly: true
971
+ }
972
+ ),
973
+ isOpen: showDateTimePicker,
974
+ onToggle: () => setShowDateTimePicker(!showDateTimePicker),
975
+ placement: "bottom",
976
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: "1rem" }, children: [
977
+ (type === "date" || type === "datetime-local") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
978
+ DatePicker,
979
+ {
980
+ value: String(props.value || "").split("T")[0],
981
+ onChange: (newDate) => {
982
+ if (type === "datetime-local") {
983
+ const time = String(props.value || "").split("T")[1] || "00:00:00";
984
+ handleDateTimeChange(`${newDate}T${time}`);
985
+ } else {
986
+ handleDateTimeChange(newDate);
987
+ setShowDateTimePicker(false);
988
+ }
989
+ },
990
+ disabled
991
+ }
992
+ ),
993
+ (type === "time" || type === "datetime-local") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
994
+ TimePicker,
995
+ {
996
+ value: String(props.value || "").split("T")[1] || "00:00:00",
997
+ onChange: (newTime) => {
998
+ if (type === "datetime-local") {
999
+ const date = String(props.value || "").split("T")[0] || (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
1000
+ handleDateTimeChange(`${date}T${newTime}`);
1001
+ } else {
1002
+ handleDateTimeChange(newTime);
1003
+ }
1004
+ },
1005
+ disabled,
1006
+ showMilliseconds,
1007
+ minuteStep
1008
+ }
1009
+ )
1010
+ ] })
1011
+ }
1012
+ ),
1013
+ error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "input__message input__message--error", children: error }),
1014
+ helperText && !error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "input__message", children: helperText })
1015
+ ] });
1016
+ }
1017
+ );
1018
+ Input.displayName = "Input";
1019
+
1020
+ // src/components/input/InputText.tsx
1021
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1022
+ var InputText = import_react4.default.forwardRef((props, ref) => {
1023
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Input, { ref, ...props, type: "text" });
1024
+ });
1025
+ InputText.displayName = "InputText";
1026
+
1027
+ // src/components/input/InputEmail.tsx
1028
+ var import_react5 = __toESM(require("react"));
1029
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1030
+ var InputEmail = import_react5.default.forwardRef((props, ref) => {
1031
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Input, { ref, ...props, type: "email" });
1032
+ });
1033
+ InputEmail.displayName = "InputEmail";
1034
+
1035
+ // src/components/input/InputPassword.tsx
1036
+ var import_react6 = __toESM(require("react"));
1037
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1038
+ var InputPassword = import_react6.default.forwardRef((props, ref) => {
1039
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Input, { ref, ...props, type: "password" });
1040
+ });
1041
+ InputPassword.displayName = "InputPassword";
1042
+
1043
+ // src/components/input/InputSearch.tsx
1044
+ var import_react7 = __toESM(require("react"));
1045
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1046
+ var InputSearch = import_react7.default.forwardRef((props, ref) => {
1047
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Input, { ref, ...props, type: "search" });
1048
+ });
1049
+ InputSearch.displayName = "InputSearch";
1050
+
1051
+ // src/components/input/InputTel.tsx
1052
+ var import_react8 = __toESM(require("react"));
1053
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1054
+ var InputTel = import_react8.default.forwardRef((props, ref) => {
1055
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Input, { ref, ...props, type: "tel" });
1056
+ });
1057
+ InputTel.displayName = "InputTel";
1058
+
1059
+ // src/components/input/InputUrl.tsx
1060
+ var import_react9 = __toESM(require("react"));
1061
+ var import_jsx_runtime16 = require("react/jsx-runtime");
1062
+ var InputUrl = import_react9.default.forwardRef((props, ref) => {
1063
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Input, { ref, ...props, type: "url" });
1064
+ });
1065
+ InputUrl.displayName = "InputUrl";
1066
+
1067
+ // src/components/input/InputNumber.tsx
1068
+ var import_react10 = __toESM(require("react"));
1069
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1070
+ var InputNumber = import_react10.default.forwardRef((props, ref) => {
1071
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Input, { ref, ...props, type: "number" });
1072
+ });
1073
+ InputNumber.displayName = "InputNumber";
1074
+
1075
+ // src/components/input/InputDate.tsx
1076
+ var import_react11 = __toESM(require("react"));
1077
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1078
+ var InputDate = import_react11.default.forwardRef((props, ref) => {
1079
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Input, { ref, ...props, type: "date" });
1080
+ });
1081
+ InputDate.displayName = "InputDate";
1082
+
1083
+ // src/components/input/InputTime.tsx
1084
+ var import_react12 = __toESM(require("react"));
1085
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1086
+ var InputTime = import_react12.default.forwardRef((props, ref) => {
1087
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Input, { ref, ...props, type: "time" });
1088
+ });
1089
+ InputTime.displayName = "InputTime";
1090
+
1091
+ // src/components/input/InputDateTime.tsx
1092
+ var import_react13 = __toESM(require("react"));
1093
+ var import_jsx_runtime20 = require("react/jsx-runtime");
1094
+ var InputDateTime = import_react13.default.forwardRef((props, ref) => {
1095
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Input, { ref, ...props, type: "datetime-local" });
1096
+ });
1097
+ InputDateTime.displayName = "InputDateTime";
1098
+
1099
+ // src/components/tooltip/tooltip.tsx
1100
+ var React19 = __toESM(require("react"));
1101
+ var ReactDOM2 = __toESM(require("react-dom"));
1102
+ var import_jsx_runtime21 = require("react/jsx-runtime");
1103
+ var Tooltip = ({
1104
+ content,
1105
+ children,
1106
+ placement = "top",
1107
+ delay = 0,
1108
+ disabled = false
1109
+ }) => {
1110
+ const [isVisible, setIsVisible] = React19.useState(false);
1111
+ const [tooltipStyle, setTooltipStyle] = React19.useState({});
1112
+ const [resolvedPlacement, setResolvedPlacement] = React19.useState(placement);
1113
+ const triggerRef = React19.useRef(null);
1114
+ const tooltipRef = React19.useRef(null);
1115
+ const timeoutRef = React19.useRef();
1116
+ React19.useEffect(() => {
1117
+ if (!isVisible || !triggerRef.current || !tooltipRef.current) {
1118
+ return;
1119
+ }
1120
+ const updatePosition = () => {
1121
+ if (!triggerRef.current || !tooltipRef.current) {
1122
+ return;
1123
+ }
1124
+ const triggerRect = triggerRef.current.getBoundingClientRect();
1125
+ const tooltipRect = tooltipRef.current.getBoundingClientRect();
1126
+ if (tooltipRect.width === 0 || tooltipRect.height === 0) {
1127
+ setTimeout(updatePosition, 10);
1128
+ return;
1129
+ }
1130
+ const gap = 8;
1131
+ const viewportWidth = window.innerWidth;
1132
+ const viewportHeight = window.innerHeight;
1133
+ const spaceTop = triggerRect.top;
1134
+ const spaceBottom = viewportHeight - triggerRect.bottom;
1135
+ const spaceLeft = triggerRect.left;
1136
+ const spaceRight = viewportWidth - triggerRect.right;
1137
+ let finalPlacement = placement;
1138
+ if (placement === "right" && spaceRight < tooltipRect.width + gap) {
1139
+ finalPlacement = spaceLeft >= tooltipRect.width + gap ? "left" : "bottom";
1140
+ } else if (placement === "left" && spaceLeft < tooltipRect.width + gap) {
1141
+ finalPlacement = spaceRight >= tooltipRect.width + gap ? "right" : "bottom";
1142
+ } else if (placement === "bottom" && spaceBottom < tooltipRect.height + gap) {
1143
+ finalPlacement = spaceTop >= tooltipRect.height + gap ? "top" : "bottom";
1144
+ } else if (placement === "top" && spaceTop < tooltipRect.height + gap) {
1145
+ finalPlacement = spaceBottom >= tooltipRect.height + gap ? "bottom" : "top";
1146
+ }
1147
+ setResolvedPlacement(finalPlacement);
1148
+ const newStyle = {
1149
+ position: "fixed",
1150
+ zIndex: 1e4,
1151
+ opacity: 1,
1152
+ visibility: "visible",
1153
+ pointerEvents: "auto"
1154
+ };
1155
+ switch (finalPlacement) {
1156
+ case "right":
1157
+ newStyle.top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2;
1158
+ newStyle.left = triggerRect.right + gap;
1159
+ break;
1160
+ case "left":
1161
+ newStyle.top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2;
1162
+ newStyle.left = triggerRect.left - tooltipRect.width - gap;
1163
+ break;
1164
+ case "top":
1165
+ newStyle.top = triggerRect.top - tooltipRect.height - gap;
1166
+ newStyle.left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2;
1167
+ break;
1168
+ case "bottom":
1169
+ default:
1170
+ newStyle.top = triggerRect.bottom + gap;
1171
+ newStyle.left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2;
1172
+ }
1173
+ if (newStyle.left < 0) {
1174
+ newStyle.left = 0;
1175
+ } else if (newStyle.left + tooltipRect.width > viewportWidth) {
1176
+ newStyle.left = viewportWidth - tooltipRect.width;
1177
+ }
1178
+ if (newStyle.top < 0) {
1179
+ newStyle.top = 0;
1180
+ } else if (newStyle.top + tooltipRect.height > viewportHeight) {
1181
+ newStyle.top = viewportHeight - tooltipRect.height;
1182
+ }
1183
+ setTooltipStyle(newStyle);
1184
+ };
1185
+ requestAnimationFrame(updatePosition);
1186
+ window.addEventListener("resize", updatePosition);
1187
+ window.addEventListener("scroll", updatePosition, true);
1188
+ return () => {
1189
+ window.removeEventListener("resize", updatePosition);
1190
+ window.removeEventListener("scroll", updatePosition, true);
1191
+ };
1192
+ }, [isVisible, placement]);
1193
+ const handleMouseEnter = () => {
1194
+ if (disabled) return;
1195
+ if (timeoutRef.current) {
1196
+ clearTimeout(timeoutRef.current);
1197
+ }
1198
+ timeoutRef.current = setTimeout(() => {
1199
+ setIsVisible(true);
1200
+ }, delay);
1201
+ };
1202
+ const handleMouseLeave = () => {
1203
+ if (timeoutRef.current) {
1204
+ clearTimeout(timeoutRef.current);
1205
+ }
1206
+ timeoutRef.current = setTimeout(() => {
1207
+ setIsVisible(false);
1208
+ }, 150);
1209
+ };
1210
+ const handleClick = () => {
1211
+ if (timeoutRef.current) {
1212
+ clearTimeout(timeoutRef.current);
1213
+ }
1214
+ setIsVisible(false);
1215
+ };
1216
+ const childElement = React19.Children.only(children);
1217
+ const childWithHandlers = React19.cloneElement(childElement, {
1218
+ ref: triggerRef,
1219
+ onMouseEnter: (e) => {
1220
+ childElement.props?.onMouseEnter?.(e);
1221
+ handleMouseEnter();
1222
+ },
1223
+ onMouseLeave: (e) => {
1224
+ childElement.props?.onMouseLeave?.(e);
1225
+ handleMouseLeave();
1226
+ },
1227
+ onClick: (e) => {
1228
+ childElement.props?.onClick?.(e);
1229
+ handleClick();
1230
+ }
1231
+ });
1232
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
1233
+ childWithHandlers,
1234
+ isVisible && !disabled && ReactDOM2.createPortal(
1235
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1236
+ "div",
1237
+ {
1238
+ ref: tooltipRef,
1239
+ className: `tooltip tooltip--${resolvedPlacement}`,
1240
+ style: {
1241
+ ...tooltipStyle,
1242
+ // Start with opacity 0 and visibility hidden to prevent initial flash
1243
+ opacity: tooltipStyle.top !== void 0 ? 1 : 0,
1244
+ visibility: tooltipStyle.top !== void 0 ? "visible" : "hidden"
1245
+ },
1246
+ onMouseEnter: () => {
1247
+ if (timeoutRef.current) {
1248
+ clearTimeout(timeoutRef.current);
1249
+ }
1250
+ },
1251
+ onMouseLeave: handleMouseLeave,
1252
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "tooltip__content", children: content })
1253
+ }
1254
+ ),
1255
+ document.body
1256
+ )
1257
+ ] });
1258
+ };
1259
+
1260
+ // src/components/_shared/HeadingAnchor.tsx
1261
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1262
+ function generateHeadingId(text) {
1263
+ return text.toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").trim();
1264
+ }
1265
+ var HeadingAnchor = ({
1266
+ title,
1267
+ id: customId,
1268
+ className = "heading-anchor",
1269
+ dialogTitle = "Section Link"
1270
+ }) => {
1271
+ const [isDialogOpen, setIsDialogOpen] = (0, import_react14.useState)(false);
1272
+ const [copySuccess, setCopySuccess] = (0, import_react14.useState)(false);
1273
+ const headingId = (0, import_react14.useMemo)(() => {
1274
+ return customId || generateHeadingId(title);
1275
+ }, [title, customId]);
1276
+ const headingUrl = (0, import_react14.useMemo)(() => {
1277
+ if (typeof window !== "undefined") {
1278
+ const baseUrl = window.location.origin + window.location.pathname;
1279
+ return `${baseUrl}#${headingId}`;
1280
+ }
1281
+ return "";
1282
+ }, [headingId]);
1283
+ const handleHashClick = (e) => {
1284
+ e.preventDefault();
1285
+ setIsDialogOpen(true);
1286
+ setCopySuccess(false);
1287
+ };
1288
+ const handleCopyAndClose = async () => {
1289
+ try {
1290
+ await navigator.clipboard.writeText(headingUrl);
1291
+ setCopySuccess(true);
1292
+ setTimeout(() => {
1293
+ setIsDialogOpen(false);
1294
+ setCopySuccess(false);
1295
+ }, 300);
1296
+ } catch (err) {
1297
+ console.error("Failed to copy:", err);
1298
+ }
1299
+ };
1300
+ const handleCloseDialog = () => {
1301
+ setIsDialogOpen(false);
1302
+ setCopySuccess(false);
1303
+ };
1304
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
1305
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Tooltip, { content: `Copy link to this ${dialogTitle.toLowerCase()}`, placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1306
+ Button,
1307
+ {
1308
+ variant: "ghost",
1309
+ size: "sm",
1310
+ className,
1311
+ onClick: handleHashClick,
1312
+ "aria-label": `Copy link to ${title}`,
1313
+ startIcon: "heroicons:hashtag-16-solid",
1314
+ iconOnly: true
1315
+ }
1316
+ ) }),
1317
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1318
+ Dialog,
1319
+ {
1320
+ open: isDialogOpen,
1321
+ onClose: handleCloseDialog,
1322
+ title: dialogTitle,
1323
+ size: "md",
1324
+ footer: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Button, { variant: "secondary", onClick: handleCloseDialog, children: "Close" }),
1325
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "var(--spacing-4)" }, children: [
1326
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { style: { margin: 0, color: "var(--color-text-secondary)" }, children: [
1327
+ "Copy the link below to share this ",
1328
+ dialogTitle.toLowerCase(),
1329
+ ":"
1330
+ ] }),
1331
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1332
+ InputText,
1333
+ {
1334
+ value: headingUrl,
1335
+ readOnly: true,
1336
+ onClick: (e) => e.currentTarget.select(),
1337
+ style: { fontFamily: "monospace", fontSize: "var(--font-size-sm)" }
1338
+ }
1339
+ ),
1340
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1341
+ Button,
1342
+ {
1343
+ variant: "primary",
1344
+ onClick: handleCopyAndClose,
1345
+ style: { width: "100%" },
1346
+ children: copySuccess ? "Copied! Closing..." : "Copy link and close dialog"
1347
+ }
1348
+ )
1349
+ ] })
1350
+ }
1351
+ )
1352
+ ] });
1353
+ };
1354
+ function useHeadingId(title, customId) {
1355
+ return (0, import_react14.useMemo)(() => {
1356
+ if (customId) return customId;
1357
+ if (typeof title === "string" && title.trim()) {
1358
+ return generateHeadingId(title);
1359
+ }
1360
+ return void 0;
1361
+ }, [title, customId]);
1362
+ }
1363
+
1364
+ // src/components/section/section.tsx
1365
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1366
+ var Section = ({ title, children, size = "md", className }) => {
1367
+ const sectionClasses = [
1368
+ "section",
1369
+ size !== "md" && `section--${size}`,
1370
+ className
1371
+ ].filter(Boolean).join(" ");
1372
+ const sectionId = useHeadingId(title);
1373
+ const titleText = typeof title === "string" ? title : void 0;
1374
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
1375
+ "section",
1376
+ {
1377
+ className: sectionClasses,
1378
+ id: sectionId,
1379
+ "data-section-title": titleText,
1380
+ children: [
1381
+ title && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h2", { className: "section__title", children: [
1382
+ title,
1383
+ sectionId && titleText && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1384
+ HeadingAnchor,
1385
+ {
1386
+ title: titleText,
1387
+ id: sectionId,
1388
+ className: "section__hash-link",
1389
+ dialogTitle: "Section Link"
1390
+ }
1391
+ )
1392
+ ] }),
1393
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "section__content", children })
1394
+ ]
1395
+ }
1396
+ );
1397
+ };
1398
+ // Annotate the CommonJS export names for ESM import in node:
1399
+ 0 && (module.exports = {
1400
+ Section
1401
+ });