@overdoser/react-toolkit 0.19.0 → 0.21.0

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 (279) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +47 -0
  3. package/components/Accordion/Accordion.js +160 -177
  4. package/components/Accordion/Accordion.module.js +20 -0
  5. package/components/ActionButton/ActionButton.js +155 -209
  6. package/components/ActionButton/ActionButton.module.js +25 -0
  7. package/components/ActionButton/CopyButton.js +52 -64
  8. package/components/Alert/Alert.js +92 -95
  9. package/components/Alert/Alert.module.js +18 -0
  10. package/components/Avatar/Avatar.js +44 -55
  11. package/components/Avatar/Avatar.module.js +23 -0
  12. package/components/Badge/Badge.js +16 -38
  13. package/components/Badge/Badge.module.js +17 -0
  14. package/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  15. package/components/Breadcrumbs/Breadcrumbs.js +52 -48
  16. package/components/Breadcrumbs/Breadcrumbs.module.js +10 -0
  17. package/components/Button/Button.js +35 -57
  18. package/components/Button/Button.module.js +25 -0
  19. package/components/Card/Card.js +94 -131
  20. package/components/Card/Card.module.js +35 -0
  21. package/components/Chart/AreaChart.d.ts +1 -1
  22. package/components/Chart/AreaChart.js +248 -249
  23. package/components/Chart/Axis.d.ts +2 -2
  24. package/components/Chart/Axis.js +34 -43
  25. package/components/Chart/BarChart.d.ts +1 -1
  26. package/components/Chart/BarChart.js +307 -348
  27. package/components/Chart/Chart.module.js +32 -0
  28. package/components/Chart/ChartContainer.js +33 -41
  29. package/components/Chart/ChartLegend.d.ts +1 -1
  30. package/components/Chart/ChartLegend.js +31 -30
  31. package/components/Chart/ChartTooltip.d.ts +1 -1
  32. package/components/Chart/ChartTooltip.js +46 -41
  33. package/components/Chart/LineChart.d.ts +1 -1
  34. package/components/Chart/LineChart.js +220 -232
  35. package/components/Chart/PieChart.d.ts +1 -1
  36. package/components/Chart/PieChart.js +224 -240
  37. package/components/Chart/RadarChart.d.ts +1 -1
  38. package/components/Chart/RadarChart.js +166 -215
  39. package/components/Chart/Sparkline.js +73 -68
  40. package/components/Chart/TradingChart.d.ts +1 -1
  41. package/components/Chart/TradingChart.js +804 -701
  42. package/components/Chart/scales.js +28 -35
  43. package/components/Chart/trading/indicators.js +61 -62
  44. package/components/Chart/trading/period.js +46 -68
  45. package/components/Chart/useChartDimensions.js +30 -22
  46. package/components/Chip/Chip.js +98 -141
  47. package/components/Chip/Chip.module.js +32 -0
  48. package/components/CodeBlock/CodeBlock.js +111 -119
  49. package/components/CodeBlock/CodeBlock.module.js +23 -0
  50. package/components/CommandPalette/CommandPalette.js +387 -392
  51. package/components/CommandPalette/CommandPalette.module.js +28 -0
  52. package/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
  53. package/components/ConfirmDialog/ConfirmDialog.js +184 -199
  54. package/components/ConfirmDialog/ConfirmDialog.module.js +12 -0
  55. package/components/Divider/Divider.js +25 -36
  56. package/components/Divider/Divider.module.js +17 -0
  57. package/components/Draggable/Draggable.d.ts +1 -1
  58. package/components/Draggable/Draggable.js +157 -164
  59. package/components/Draggable/Draggable.module.js +10 -0
  60. package/components/Drawer/Drawer.js +104 -126
  61. package/components/Drawer/Drawer.module.js +66 -0
  62. package/components/Dropdown/Dropdown.js +175 -234
  63. package/components/Dropdown/Dropdown.module.js +29 -0
  64. package/components/Dropdown/DropdownItem.js +55 -58
  65. package/components/Dropdown/DropdownLabel.js +14 -11
  66. package/components/Dropdown/DropdownSeparator.js +12 -10
  67. package/components/Dropdown/dropdownContext.js +4 -5
  68. package/components/Dropdown/useContextMenu.js +27 -17
  69. package/components/Dropzone/Dropzone.js +99 -105
  70. package/components/Dropzone/Dropzone.module.js +12 -0
  71. package/components/EmptyState/EmptyState.js +58 -55
  72. package/components/EmptyState/EmptyState.module.js +14 -0
  73. package/components/Form/Form.d.ts +1 -1
  74. package/components/Form/Form.js +32 -35
  75. package/components/Form/Form.module.js +16 -0
  76. package/components/Form/FormField.d.ts +1 -1
  77. package/components/Form/FormField.js +71 -75
  78. package/components/Form/FormRow.d.ts +1 -1
  79. package/components/Form/FormRow.js +11 -8
  80. package/components/Form/formFieldDefaults.js +4 -5
  81. package/components/ImageViewer/ImageViewer.js +312 -201
  82. package/components/ImageViewer/ImageViewer.module.js +26 -0
  83. package/components/ImageViewer/useZoomPan.js +206 -137
  84. package/components/Kbd/Kbd.js +25 -22
  85. package/components/Kbd/Kbd.module.js +10 -0
  86. package/components/KeyValueList/KeyValueList.js +119 -123
  87. package/components/KeyValueList/KeyValueList.module.js +23 -0
  88. package/components/Link/Link.js +45 -59
  89. package/components/Link/Link.module.js +10 -0
  90. package/components/List/List.js +22 -46
  91. package/components/List/List.module.js +12 -0
  92. package/components/Loader/Loader.js +152 -182
  93. package/components/Loader/Loader.module.js +40 -0
  94. package/components/Modal/Modal.js +93 -105
  95. package/components/Modal/Modal.module.js +18 -0
  96. package/components/PageHeader/PageHeader.js +78 -72
  97. package/components/PageHeader/PageHeader.module.js +23 -0
  98. package/components/Pagination/Pagination.js +63 -84
  99. package/components/Pagination/Pagination.module.js +13 -0
  100. package/components/Pagination/paginationRange.js +15 -22
  101. package/components/Popover/Popover.js +110 -134
  102. package/components/Popover/Popover.module.js +12 -0
  103. package/components/ProgressBar/ProgressBar.d.ts +15 -1
  104. package/components/ProgressBar/ProgressBar.js +57 -90
  105. package/components/ProgressBar/ProgressBar.module.js +29 -0
  106. package/components/RelativeTime/RelativeTime.js +36 -43
  107. package/components/RelativeTime/RelativeTime.module.js +3 -0
  108. package/components/SegmentedControl/SegmentedControl.js +94 -130
  109. package/components/SegmentedControl/SegmentedControl.module.js +21 -0
  110. package/components/Skeleton/Skeleton.js +36 -50
  111. package/components/Skeleton/Skeleton.module.js +15 -0
  112. package/components/Spinner/Spinner.js +25 -25
  113. package/components/Spinner/Spinner.module.js +12 -0
  114. package/components/SplitButton/SplitButton.js +149 -196
  115. package/components/SplitButton/SplitButton.module.js +31 -0
  116. package/components/SplitPane/SplitPane.js +134 -170
  117. package/components/SplitPane/SplitPane.module.js +14 -0
  118. package/components/StatCard/StatCard.js +132 -125
  119. package/components/StatCard/StatCard.module.js +42 -0
  120. package/components/StatusDot/StatusDot.js +28 -39
  121. package/components/StatusDot/StatusDot.module.js +18 -0
  122. package/components/Table/Table.d.ts +41 -16
  123. package/components/Table/Table.js +383 -442
  124. package/components/Table/Table.module.js +42 -0
  125. package/components/Table/index.d.ts +1 -1
  126. package/components/Table/useTableSort.d.ts +1 -1
  127. package/components/Table/useTableSort.js +51 -42
  128. package/components/Tabs/Tabs.js +109 -161
  129. package/components/Tabs/Tabs.module.js +28 -0
  130. package/components/ThemeToggle/ThemeToggle.d.ts +2 -0
  131. package/components/ThemeToggle/ThemeToggle.js +122 -97
  132. package/components/ThemeToggle/ThemeToggle.module.js +13 -0
  133. package/components/Timeline/GanttTimeline.js +357 -318
  134. package/components/Timeline/GanttTimeline.module.js +29 -0
  135. package/components/Timeline/HistoryTimeline.js +486 -450
  136. package/components/Timeline/HistoryTimeline.module.js +31 -0
  137. package/components/Timeline/Timeline.module.js +76 -0
  138. package/components/Timeline/TimelineShared.d.ts +7 -7
  139. package/components/Timeline/TimelineShared.js +288 -279
  140. package/components/Timeline/TraceEventDetails.d.ts +3 -3
  141. package/components/Timeline/TraceEventDetails.js +245 -178
  142. package/components/Timeline/TraceTimeline.js +823 -783
  143. package/components/Timeline/TraceTimeline.module.js +98 -0
  144. package/components/Timeline/historyLayout.js +336 -263
  145. package/components/Timeline/timelineCore.js +208 -183
  146. package/components/Timeline/traceEvent.js +59 -61
  147. package/components/Timeline/traceLayout.js +101 -90
  148. package/components/Timeline/useTimeline.js +76 -79
  149. package/components/Timer/Timer.js +190 -156
  150. package/components/Timer/Timer.module.js +29 -0
  151. package/components/Toast/Toast.d.ts +1 -1
  152. package/components/Toast/Toast.js +128 -128
  153. package/components/Toast/Toast.module.js +37 -0
  154. package/components/Toast/toastStore.js +58 -62
  155. package/components/ToggleIconButton/ToggleIconButton.js +35 -57
  156. package/components/ToggleIconButton/ToggleIconButton.module.js +15 -0
  157. package/components/Tooltip/Tooltip.d.ts +1 -1
  158. package/components/Tooltip/Tooltip.js +76 -85
  159. package/components/Tooltip/Tooltip.module.js +17 -0
  160. package/components/Typography/Typography.js +11 -36
  161. package/components/Typography/Typography.module.js +30 -0
  162. package/components/inputs/Checkbox/Checkbox.js +27 -51
  163. package/components/inputs/Checkbox/Checkbox.module.js +10 -0
  164. package/components/inputs/Checkbox/CheckboxGroup.js +53 -111
  165. package/components/inputs/Checkbox/CheckboxGroup.module.js +17 -0
  166. package/components/inputs/DatePicker/CalendarPanel.d.ts +1 -1
  167. package/components/inputs/DatePicker/CalendarPanel.js +263 -286
  168. package/components/inputs/DatePicker/CalendarPanel.module.js +23 -0
  169. package/components/inputs/DatePicker/DatePicker.js +115 -142
  170. package/components/inputs/DatePicker/DatePicker.module.js +14 -0
  171. package/components/inputs/DatePicker/dateUtils.js +32 -41
  172. package/components/inputs/DateTimePicker/DateTimePicker.js +226 -232
  173. package/components/inputs/DateTimePicker/DateTimePicker.module.js +20 -0
  174. package/components/inputs/DateTimePicker/DateTimeSegments.js +273 -252
  175. package/components/inputs/DateTimePicker/TimeField.d.ts +1 -1
  176. package/components/inputs/DateTimePicker/TimeField.js +131 -132
  177. package/components/inputs/DateTimePicker/timeZoneUtils.js +95 -92
  178. package/components/inputs/Input/Input.js +98 -109
  179. package/components/inputs/Input/Input.module.js +15 -0
  180. package/components/inputs/NumberInput/NumberInput.js +112 -132
  181. package/components/inputs/NumberInput/NumberInput.module.js +14 -0
  182. package/components/inputs/Radio/Radio.js +50 -73
  183. package/components/inputs/Radio/Radio.module.js +9 -0
  184. package/components/inputs/SearchInput/SearchInput.js +98 -115
  185. package/components/inputs/SearchInput/SearchInput.module.js +8 -0
  186. package/components/inputs/Select/Select.js +555 -682
  187. package/components/inputs/Select/Select.module.js +38 -0
  188. package/components/inputs/Slider/Slider.js +97 -128
  189. package/components/inputs/Slider/Slider.module.js +9 -0
  190. package/components/inputs/Switch/Switch.js +11 -8
  191. package/components/inputs/Textarea/Textarea.js +42 -58
  192. package/components/inputs/Textarea/Textarea.module.js +14 -0
  193. package/hooks/useClickOutside.js +17 -14
  194. package/hooks/useDebouncedValue.js +13 -14
  195. package/hooks/useElementSize.js +27 -22
  196. package/hooks/useEscapeLayer.js +28 -29
  197. package/hooks/useFocusTrap.js +27 -38
  198. package/hooks/useKeyboard.js +76 -64
  199. package/hooks/useMediaQuery.js +10 -15
  200. package/hooks/useNow.js +28 -33
  201. package/hooks/usePersistedState.js +98 -91
  202. package/hooks/usePortalPosition.js +25 -19
  203. package/hooks/useResizable.js +106 -104
  204. package/hooks/useTheme.d.ts +2 -2
  205. package/hooks/useTheme.js +28 -25
  206. package/index.css +2 -1
  207. package/index.d.ts +1 -1
  208. package/index.js +97 -215
  209. package/index.layered.css +2 -3
  210. package/llms.txt +9 -6
  211. package/manifest.json +66 -10
  212. package/package.json +1 -1
  213. package/utils/formatBytes.js +29 -13
  214. package/utils/themeScript.d.ts +2 -0
  215. package/utils/themeScript.js +6 -8
  216. package/utils/timeAgo.js +59 -32
  217. package/components/Accordion/Accordion.module.scss.js +0 -36
  218. package/components/ActionButton/ActionButton.module.scss.js +0 -47
  219. package/components/Alert/Alert.module.scss.js +0 -33
  220. package/components/Avatar/Avatar.module.scss.js +0 -43
  221. package/components/Badge/Badge.module.scss.js +0 -31
  222. package/components/Breadcrumbs/Breadcrumbs.module.scss.js +0 -17
  223. package/components/Button/Button.module.scss.js +0 -47
  224. package/components/Card/Card.module.scss.js +0 -60
  225. package/components/Chart/Chart.module.scss.js +0 -61
  226. package/components/Chip/Chip.module.scss.js +0 -59
  227. package/components/CodeBlock/CodeBlock.module.scss.js +0 -43
  228. package/components/CommandPalette/CommandPalette.module.scss.js +0 -49
  229. package/components/ConfirmDialog/ConfirmDialog.module.scss.js +0 -21
  230. package/components/Divider/Divider.module.scss.js +0 -31
  231. package/components/Draggable/Draggable.module.scss.js +0 -17
  232. package/components/Drawer/Drawer.module.scss.js +0 -119
  233. package/components/Dropdown/Dropdown.module.scss.js +0 -53
  234. package/components/Dropzone/Dropzone.module.scss.js +0 -21
  235. package/components/EmptyState/EmptyState.module.scss.js +0 -25
  236. package/components/Form/Form.module.scss.js +0 -29
  237. package/components/ImageViewer/ImageViewer.module.scss.js +0 -47
  238. package/components/Kbd/Kbd.module.scss.js +0 -17
  239. package/components/KeyValueList/KeyValueList.module.scss.js +0 -43
  240. package/components/Link/Link.module.scss.js +0 -16
  241. package/components/List/List.module.scss.js +0 -21
  242. package/components/Loader/Loader.module.scss.js +0 -70
  243. package/components/Modal/Modal.module.scss.js +0 -33
  244. package/components/PageHeader/PageHeader.module.scss.js +0 -43
  245. package/components/Pagination/Pagination.module.scss.js +0 -23
  246. package/components/Popover/Popover.module.scss.js +0 -21
  247. package/components/ProgressBar/ProgressBar.module.scss.js +0 -51
  248. package/components/RelativeTime/RelativeTime.module.scss.js +0 -7
  249. package/components/SegmentedControl/SegmentedControl.module.scss.js +0 -39
  250. package/components/Skeleton/Skeleton.module.scss.js +0 -25
  251. package/components/Spinner/Spinner.module.scss.js +0 -20
  252. package/components/SplitButton/SplitButton.module.scss.js +0 -57
  253. package/components/SplitPane/SplitPane.module.scss.js +0 -25
  254. package/components/StatCard/StatCard.module.scss.js +0 -72
  255. package/components/StatusDot/StatusDot.module.scss.js +0 -32
  256. package/components/Table/Table.module.scss.js +0 -81
  257. package/components/Tabs/Tabs.module.scss.js +0 -53
  258. package/components/ThemeToggle/ThemeToggle.module.scss.js +0 -23
  259. package/components/Timeline/GanttTimeline.module.scss.js +0 -55
  260. package/components/Timeline/HistoryTimeline.module.scss.js +0 -59
  261. package/components/Timeline/Timeline.module.scss.js +0 -141
  262. package/components/Timeline/TraceTimeline.module.scss.js +0 -189
  263. package/components/Timer/Timer.module.scss.js +0 -55
  264. package/components/Toast/Toast.module.scss.js +0 -62
  265. package/components/ToggleIconButton/ToggleIconButton.module.scss.js +0 -27
  266. package/components/Tooltip/Tooltip.module.scss.js +0 -30
  267. package/components/Typography/Typography.module.scss.js +0 -53
  268. package/components/inputs/Checkbox/Checkbox.module.scss.js +0 -17
  269. package/components/inputs/Checkbox/CheckboxGroup.module.scss.js +0 -31
  270. package/components/inputs/DatePicker/CalendarPanel.module.scss.js +0 -41
  271. package/components/inputs/DatePicker/DatePicker.module.scss.js +0 -25
  272. package/components/inputs/DateTimePicker/DateTimePicker.module.scss.js +0 -37
  273. package/components/inputs/Input/Input.module.scss.js +0 -27
  274. package/components/inputs/NumberInput/NumberInput.module.scss.js +0 -25
  275. package/components/inputs/Radio/Radio.module.scss.js +0 -15
  276. package/components/inputs/SearchInput/SearchInput.module.scss.js +0 -13
  277. package/components/inputs/Select/Select.module.scss.js +0 -73
  278. package/components/inputs/Slider/Slider.module.scss.js +0 -15
  279. package/components/inputs/Textarea/Textarea.module.scss.js +0 -25
@@ -1,133 +1,133 @@
1
- import { jsx as e, jsxs as g, Fragment as L } from "react/jsx-runtime";
2
- import { useSyncExternalStore as M, useState as b, useEffect as p, useRef as R, useCallback as x } from "react";
3
- import { createPortal as N } from "react-dom";
4
- import n from "clsx";
5
- import t from "./Toast.module.scss.js";
6
- import { subscribeToasts as C, getToasts as B, getServerToasts as y, configureToasts as S, registerProvider as j, dismissToast as T, addToast as A, dismissAllToasts as z } from "./toastStore.js";
7
- const E = Object.assign((c) => A(c), {
8
- dismiss: T,
9
- dismissAll: z
1
+ import e from "./Toast.module.js";
2
+ import { addToast as t, configureToasts as n, dismissAllToasts as r, dismissToast as i, getServerToasts as a, getToasts as o, registerProvider as s, subscribeToasts as c } from "./toastStore.js";
3
+ import { useCallback as l, useEffect as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
4
+ import m from "clsx";
5
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
6
+ import { createPortal as v } from "react-dom";
7
+ // src/components/Toast/Toast.tsx
8
+ var y = Object.assign((e) => t(e), {
9
+ dismiss: i,
10
+ dismissAll: r
10
11
  });
11
- function _() {
12
- return { toast: E, dismiss: T, dismissAll: z };
12
+ function b() {
13
+ return {
14
+ toast: y,
15
+ dismiss: i,
16
+ dismissAll: r
17
+ };
13
18
  }
14
- function $({
15
- children: c,
16
- position: u = "top-right",
17
- duration: m = 5e3,
18
- max: a = 5,
19
- classes: i
20
- }) {
21
- const l = M(C, B, y), r = u.startsWith("top"), [v, f] = b(!1);
22
- p(() => f(!0), []), p(() => {
23
- S({ duration: m, max: a });
24
- }, [m, a]), p(() => j(), []);
25
- const s = r ? [...l].reverse() : l, d = v && typeof document < "u" ? N(
26
- /* @__PURE__ */ e(
27
- "div",
28
- {
29
- className: n(t.viewport, t[`pos_${u}`], i?.viewport),
30
- role: "region",
31
- "aria-label": "Notifications",
32
- children: s.map((o) => /* @__PURE__ */ e(
33
- k,
34
- {
35
- record: o,
36
- exiting: o.exiting,
37
- isTop: r,
38
- onDismiss: T,
39
- classes: i
40
- },
41
- o.id
42
- ))
43
- }
44
- ),
45
- document.body
46
- ) : null;
47
- return /* @__PURE__ */ g(L, { children: [
48
- c,
49
- d
50
- ] });
19
+ function x({ children: t, position: r = "top-right", duration: l = 5e3, max: d = 5, classes: y }) {
20
+ let b = p(c, o, a), x = r.startsWith("top"), [S, w] = f(!1);
21
+ u(() => w(!0), []), u(() => {
22
+ n({
23
+ duration: l,
24
+ max: d
25
+ });
26
+ }, [l, d]), u(() => s(), []);
27
+ let T = x ? [...b].reverse() : b, E = S && typeof document < "u" ? v(/* @__PURE__ */ g("div", {
28
+ className: m(e.viewport, e[`pos_${r}`], y?.viewport),
29
+ role: "region",
30
+ "aria-label": "Notifications",
31
+ children: T.map((e) => /* @__PURE__ */ g(C, {
32
+ record: e,
33
+ exiting: e.exiting,
34
+ isTop: x,
35
+ onDismiss: i,
36
+ classes: y
37
+ }, e.id))
38
+ }), document.body) : null;
39
+ return /* @__PURE__ */ _(h, { children: [t, E] });
51
40
  }
52
- const P = {
53
- neutral: null,
54
- info: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e(
55
- "path",
56
- {
57
- fillRule: "evenodd",
58
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",
59
- clipRule: "evenodd"
60
- }
61
- ) }),
62
- success: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e(
63
- "path",
64
- {
65
- fillRule: "evenodd",
66
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",
67
- clipRule: "evenodd"
68
- }
69
- ) }),
70
- warning: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e(
71
- "path",
72
- {
73
- fillRule: "evenodd",
74
- d: "M8.26 3.1c.77-1.33 2.71-1.33 3.48 0l5.58 9.67c.77 1.33-.19 3-1.74 3H4.42c-1.55 0-2.51-1.67-1.74-3L8.26 3.1zM10 7a1 1 0 011 1v3a1 1 0 11-2 0V8a1 1 0 011-1zm0 7a1 1 0 100-2 1 1 0 000 2z",
75
- clipRule: "evenodd"
76
- }
77
- ) }),
78
- danger: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e(
79
- "path",
80
- {
81
- fillRule: "evenodd",
82
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 00-1.4-1.4L10 8.6 8.7 7.3z",
83
- clipRule: "evenodd"
84
- }
85
- ) })
41
+ var S = {
42
+ neutral: null,
43
+ info: /* @__PURE__ */ g("svg", {
44
+ viewBox: "0 0 20 20",
45
+ fill: "currentColor",
46
+ "aria-hidden": "true",
47
+ children: /* @__PURE__ */ g("path", {
48
+ fillRule: "evenodd",
49
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",
50
+ clipRule: "evenodd"
51
+ })
52
+ }),
53
+ success: /* @__PURE__ */ g("svg", {
54
+ viewBox: "0 0 20 20",
55
+ fill: "currentColor",
56
+ "aria-hidden": "true",
57
+ children: /* @__PURE__ */ g("path", {
58
+ fillRule: "evenodd",
59
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",
60
+ clipRule: "evenodd"
61
+ })
62
+ }),
63
+ warning: /* @__PURE__ */ g("svg", {
64
+ viewBox: "0 0 20 20",
65
+ fill: "currentColor",
66
+ "aria-hidden": "true",
67
+ children: /* @__PURE__ */ g("path", {
68
+ fillRule: "evenodd",
69
+ d: "M8.26 3.1c.77-1.33 2.71-1.33 3.48 0l5.58 9.67c.77 1.33-.19 3-1.74 3H4.42c-1.55 0-2.51-1.67-1.74-3L8.26 3.1zM10 7a1 1 0 011 1v3a1 1 0 11-2 0V8a1 1 0 011-1zm0 7a1 1 0 100-2 1 1 0 000 2z",
70
+ clipRule: "evenodd"
71
+ })
72
+ }),
73
+ danger: /* @__PURE__ */ g("svg", {
74
+ viewBox: "0 0 20 20",
75
+ fill: "currentColor",
76
+ "aria-hidden": "true",
77
+ children: /* @__PURE__ */ g("path", {
78
+ fillRule: "evenodd",
79
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 00-1.4-1.4L10 8.6 8.7 7.3z",
80
+ clipRule: "evenodd"
81
+ })
82
+ })
86
83
  };
87
- function k({ record: c, exiting: u, isTop: m, onDismiss: a, classes: i }) {
88
- const { id: l, variant: r, title: v, description: f, duration: s = 0 } = c, d = R(null), o = x(() => {
89
- !s || !Number.isFinite(s) || (d.current = setTimeout(() => a(l), s));
90
- }, [s, l, a]), h = x(() => {
91
- d.current && (clearTimeout(d.current), d.current = null);
92
- }, []);
93
- p(() => (o(), h), [o, h]);
94
- const w = P[r];
95
- return /* @__PURE__ */ g(
96
- "div",
97
- {
98
- className: n(
99
- t.toast,
100
- t[r],
101
- m ? t.fromTop : t.fromBottom,
102
- u && t.leaving,
103
- i?.toast
104
- ),
105
- role: r === "danger" || r === "warning" ? "alert" : "status",
106
- "aria-live": r === "danger" || r === "warning" ? "assertive" : "polite",
107
- onMouseEnter: h,
108
- onMouseLeave: o,
109
- children: [
110
- w && /* @__PURE__ */ e("span", { className: n(t.icon, i?.icon), "aria-hidden": "true", children: w }),
111
- /* @__PURE__ */ g("div", { className: n(t.content, i?.content), children: [
112
- v != null && /* @__PURE__ */ e("div", { className: n(t.title, i?.title), children: v }),
113
- f != null && /* @__PURE__ */ e("div", { className: n(t.description, i?.description), children: f })
114
- ] }),
115
- /* @__PURE__ */ e(
116
- "button",
117
- {
118
- type: "button",
119
- className: n(t.close, i?.close),
120
- onClick: () => a(l),
121
- "aria-label": "Dismiss notification",
122
- children: /* @__PURE__ */ e("svg", { viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ e("path", { d: "M6.3 6.3a1 1 0 011.4 0L10 8.6l2.3-2.3a1 1 0 111.4 1.4L11.4 10l2.3 2.3a1 1 0 01-1.4 1.4L10 11.4l-2.3 2.3a1 1 0 01-1.4-1.4L8.6 10 6.3 7.7a1 1 0 010-1.4z" }) })
123
- }
124
- )
125
- ]
126
- }
127
- );
84
+ function C({ record: t, exiting: n, isTop: r, onDismiss: i, classes: a }) {
85
+ let { id: o, variant: s, title: c, description: f, duration: p = 0 } = t, h = d(null), v = l(() => {
86
+ p && Number.isFinite(p) && (h.current = setTimeout(() => i(o), p));
87
+ }, [
88
+ p,
89
+ o,
90
+ i
91
+ ]), y = l(() => {
92
+ h.current &&= (clearTimeout(h.current), null);
93
+ }, []);
94
+ u(() => (v(), y), [v, y]);
95
+ let b = S[s];
96
+ return /* @__PURE__ */ _("div", {
97
+ className: m(e.toast, e[s], r ? e.fromTop : e.fromBottom, n && e.leaving, a?.toast),
98
+ role: s === "danger" || s === "warning" ? "alert" : "status",
99
+ "aria-live": s === "danger" || s === "warning" ? "assertive" : "polite",
100
+ onMouseEnter: y,
101
+ onMouseLeave: v,
102
+ children: [
103
+ b && /* @__PURE__ */ g("span", {
104
+ className: m(e.icon, a?.icon),
105
+ "aria-hidden": "true",
106
+ children: b
107
+ }),
108
+ /* @__PURE__ */ _("div", {
109
+ className: m(e.content, a?.content),
110
+ children: [c != null && /* @__PURE__ */ g("div", {
111
+ className: m(e.title, a?.title),
112
+ children: c
113
+ }), f != null && /* @__PURE__ */ g("div", {
114
+ className: m(e.description, a?.description),
115
+ children: f
116
+ })]
117
+ }),
118
+ /* @__PURE__ */ g("button", {
119
+ type: "button",
120
+ className: m(e.close, a?.close),
121
+ onClick: () => i(o),
122
+ "aria-label": "Dismiss notification",
123
+ children: /* @__PURE__ */ g("svg", {
124
+ viewBox: "0 0 20 20",
125
+ fill: "currentColor",
126
+ "aria-hidden": "true",
127
+ children: /* @__PURE__ */ g("path", { d: "M6.3 6.3a1 1 0 011.4 0L10 8.6l2.3-2.3a1 1 0 111.4 1.4L11.4 10l2.3 2.3a1 1 0 01-1.4 1.4L10 11.4l-2.3 2.3a1 1 0 01-1.4-1.4L8.6 10 6.3 7.7a1 1 0 010-1.4z" })
128
+ })
129
+ })
130
+ ]
131
+ });
128
132
  }
129
- export {
130
- $ as ToastProvider,
131
- E as toast,
132
- _ as useToast
133
- };
133
+ export { x as ToastProvider, y as toast, b as useToast };
@@ -0,0 +1,37 @@
1
+ // src/components/Toast/Toast.module.scss
2
+ var e = "crk-viewport-2hLMp", t = "crk-pos_top-left-XVZwu", n = "crk-pos_top-center-7zvlQ", r = "crk-pos_top-right-nyzVI", i = "crk-pos_bottom-left-z0yV3", a = "crk-pos_bottom-center-m0ZHE", o = "crk-pos_bottom-right-Fplwy", s = "crk-toast-ngbBR", c = "crk-fromTop-ne93U", l = "crk-crk-toast-in-top-23NC0", u = "crk-fromBottom-Y7KGE", d = "crk-crk-toast-in-bottom-TVVax", f = "crk-leaving-P017e", p = "crk-crk-toast-out-2YmIq", m = "crk-neutral-Fo-jg", h = "crk-info-YHq0a", g = "crk-success-BoQPi", _ = "crk-warning-jpQSP", v = "crk-danger-6qs-8", y = "crk-icon-r-npu", b = "crk-content-puk6Q", x = "crk-title-Iv28R", S = "crk-description-RLU-y", C = "crk-close-gWTNf", w = {
3
+ viewport: e,
4
+ "pos_top-left": "crk-pos_top-left-XVZwu",
5
+ posTopLeft: t,
6
+ "pos_top-center": "crk-pos_top-center-7zvlQ",
7
+ posTopCenter: n,
8
+ "pos_top-right": "crk-pos_top-right-nyzVI",
9
+ posTopRight: r,
10
+ "pos_bottom-left": "crk-pos_bottom-left-z0yV3",
11
+ posBottomLeft: i,
12
+ "pos_bottom-center": "crk-pos_bottom-center-m0ZHE",
13
+ posBottomCenter: a,
14
+ "pos_bottom-right": "crk-pos_bottom-right-Fplwy",
15
+ posBottomRight: o,
16
+ toast: s,
17
+ fromTop: c,
18
+ "crk-toast-in-top": "crk-crk-toast-in-top-23NC0",
19
+ crkToastInTop: l,
20
+ fromBottom: u,
21
+ "crk-toast-in-bottom": "crk-crk-toast-in-bottom-TVVax",
22
+ crkToastInBottom: d,
23
+ leaving: f,
24
+ "crk-toast-out": "crk-crk-toast-out-2YmIq",
25
+ crkToastOut: p,
26
+ neutral: m,
27
+ info: h,
28
+ success: g,
29
+ warning: _,
30
+ danger: v,
31
+ icon: y,
32
+ content: b,
33
+ title: x,
34
+ description: S,
35
+ close: C
36
+ };
37
+ export { C as close, b as content, d as crkToastInBottom, l as crkToastInTop, p as crkToastOut, v as danger, w as default, S as description, u as fromBottom, c as fromTop, y as icon, h as info, f as leaving, m as neutral, a as posBottomCenter, i as posBottomLeft, o as posBottomRight, n as posTopCenter, t as posTopLeft, r as posTopRight, g as success, x as title, s as toast, e as viewport, _ as warning };
@@ -1,62 +1,58 @@
1
- const T = { duration: 5e3, max: 5 }, f = [];
2
- let n = f, r = { ...T }, u = 0, s = 0, d = !1;
3
- const a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
4
- function c() {
5
- for (const t of a) t();
6
- }
7
- function m(t) {
8
- return a.add(t), () => {
9
- a.delete(t);
10
- };
11
- }
12
- function x() {
13
- return n;
14
- }
15
- function v() {
16
- return f;
17
- }
18
- function p(t) {
19
- r = { ...r, ...t };
20
- }
21
- function w() {
22
- return s += 1, () => {
23
- s -= 1;
24
- };
25
- }
26
- function M(t) {
27
- u += 1;
28
- const o = `toast-${u}`, i = {
29
- id: o,
30
- variant: t.variant ?? "neutral",
31
- title: t.title,
32
- description: t.description,
33
- duration: t.duration ?? r.duration,
34
- exiting: !1
35
- };
36
- let e = [...n, i];
37
- return e.length > r.max && (e = e.slice(e.length - r.max)), n = e, c(), s === 0 && !d && typeof console < "u" && (d = !0, console.warn(
38
- "[react-toolkit] toast() was called but no <ToastProvider> is mounted, so nothing will render. Mount <ToastProvider> once near the root of your app."
39
- )), o;
40
- }
41
- function g(t) {
42
- const o = n.find((e) => e.id === t);
43
- if (!o || o.exiting) return;
44
- n = n.map((e) => e.id === t ? { ...e, exiting: !0 } : e), c();
45
- const i = setTimeout(() => {
46
- n = n.filter((e) => e.id !== t), l.delete(t), c();
47
- }, 200);
48
- l.set(t, i);
49
- }
50
- function P() {
51
- for (const t of n) g(t.id);
52
- }
53
- export {
54
- M as addToast,
55
- p as configureToasts,
56
- P as dismissAllToasts,
57
- g as dismissToast,
58
- v as getServerToasts,
59
- x as getToasts,
60
- w as registerProvider,
61
- m as subscribeToasts
62
- };
1
+ // src/components/Toast/toastStore.ts
2
+ var e = {
3
+ duration: 5e3,
4
+ max: 5
5
+ }, t = [], n = t, r = { ...e }, i = 0, a = 0, o = !1, s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map();
6
+ function l() {
7
+ for (let e of s) e();
8
+ }
9
+ function u(e) {
10
+ return s.add(e), () => {
11
+ s.delete(e);
12
+ };
13
+ }
14
+ function d() {
15
+ return n;
16
+ }
17
+ function f() {
18
+ return t;
19
+ }
20
+ function p(e) {
21
+ r = {
22
+ ...r,
23
+ ...e
24
+ };
25
+ }
26
+ function m() {
27
+ return a += 1, () => {
28
+ --a;
29
+ };
30
+ }
31
+ function h(e) {
32
+ i += 1;
33
+ let t = `toast-${i}`, s = {
34
+ id: t,
35
+ variant: e.variant ?? "neutral",
36
+ title: e.title,
37
+ description: e.description,
38
+ duration: e.duration ?? r.duration,
39
+ exiting: !1
40
+ }, c = [...n, s];
41
+ return c.length > r.max && (c = c.slice(c.length - r.max)), n = c, l(), a === 0 && !o && typeof console < "u" && (o = !0, console.warn("[react-toolkit] toast() was called but no <ToastProvider> is mounted, so nothing will render. Mount <ToastProvider> once near the root of your app.")), t;
42
+ }
43
+ function g(e) {
44
+ let t = n.find((t) => t.id === e);
45
+ if (!t || t.exiting) return;
46
+ n = n.map((t) => t.id === e ? {
47
+ ...t,
48
+ exiting: !0
49
+ } : t), l();
50
+ let r = setTimeout(() => {
51
+ n = n.filter((t) => t.id !== e), c.delete(e), l();
52
+ }, 200);
53
+ c.set(e, r);
54
+ }
55
+ function _() {
56
+ for (let e of n) g(e.id);
57
+ }
58
+ export { h as addToast, p as configureToasts, _ as dismissAllToasts, g as dismissToast, f as getServerToasts, d as getToasts, m as registerProvider, u as subscribeToasts };
@@ -1,58 +1,36 @@
1
- import { jsxs as w, jsx as g } from "react/jsx-runtime";
2
- import { forwardRef as H, useState as u } from "react";
1
+ import e from "./ToggleIconButton.module.js";
2
+ import { forwardRef as t, useState as n } from "react";
3
3
  import r from "clsx";
4
- import t from "./ToggleIconButton.module.scss.js";
5
- const R = H(
6
- ({
7
- icon: p,
8
- pressed: n,
9
- defaultPressed: h = !1,
10
- onPressedChange: k,
11
- activeColor: a,
12
- burst: x = !1,
13
- variant: y = "secondary",
14
- size: b = "md",
15
- speed: i = 1,
16
- classes: s,
17
- className: N,
18
- style: c,
19
- disabled: l,
20
- onClick: T,
21
- ...j
22
- }, I) => {
23
- const [P, v] = u(h), [B, C] = u(!1), d = n !== void 0, e = d ? n : P, O = (f) => {
24
- if (T?.(f), l || f.defaultPrevented) return;
25
- const m = !e;
26
- d || v(m), C(!0), k?.(m);
27
- }, o = {};
28
- return a && (o["--crk-toggle-color"] = a), i !== 1 && (o["--crk-toggle-speed"] = i), /* @__PURE__ */ w(
29
- "button",
30
- {
31
- ref: I,
32
- type: "button",
33
- "aria-pressed": e,
34
- "data-pressed": e || void 0,
35
- className: r(
36
- t.root,
37
- t[y],
38
- t[b],
39
- e && B && t.animate,
40
- s?.root,
41
- N
42
- ),
43
- style: Object.keys(o).length > 0 ? { ...c, ...o } : c,
44
- disabled: l,
45
- onClick: O,
46
- ...j,
47
- children: [
48
- x && /* @__PURE__ */ g("span", { className: r(t.burst, s?.burst), "aria-hidden": "true" }),
49
- /* @__PURE__ */ g("span", { className: r(t.icon, s?.icon), "aria-hidden": "true", children: p })
50
- ]
51
- }
52
- );
53
- }
54
- );
55
- R.displayName = "ToggleIconButton";
56
- export {
57
- R as ToggleIconButton
58
- };
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ // src/components/ToggleIconButton/ToggleIconButton.tsx
6
+ var o = t(({ icon: t, pressed: o, defaultPressed: s = !1, onPressedChange: c, activeColor: l, burst: u = !1, variant: d = "secondary", size: f = "md", speed: p = 1, classes: m, className: h, style: g, disabled: _, onClick: v, ...y }, b) => {
7
+ let [x, S] = n(s), [C, w] = n(!1), T = o !== void 0, E = T ? o : x, D = (e) => {
8
+ if (v?.(e), _ || e.defaultPrevented) return;
9
+ let t = !E;
10
+ T || S(t), w(!0), c?.(t);
11
+ }, O = {};
12
+ return l && (O["--crk-toggle-color"] = l), p !== 1 && (O["--crk-toggle-speed"] = p), /* @__PURE__ */ a("button", {
13
+ ref: b,
14
+ type: "button",
15
+ "aria-pressed": E,
16
+ "data-pressed": E || void 0,
17
+ className: r(e.root, e[d], e[f], E && C && e.animate, m?.root, h),
18
+ style: Object.keys(O).length > 0 ? {
19
+ ...g,
20
+ ...O
21
+ } : g,
22
+ disabled: _,
23
+ onClick: D,
24
+ ...y,
25
+ children: [u && /* @__PURE__ */ i("span", {
26
+ className: r(e.burst, m?.burst),
27
+ "aria-hidden": "true"
28
+ }), /* @__PURE__ */ i("span", {
29
+ className: r(e.icon, m?.icon),
30
+ "aria-hidden": "true",
31
+ children: t
32
+ })]
33
+ });
34
+ });
35
+ o.displayName = "ToggleIconButton";
36
+ export { o as ToggleIconButton };
@@ -0,0 +1,15 @@
1
+ // src/components/ToggleIconButton/ToggleIconButton.module.scss
2
+ var e = "crk-root-sK5En", t = "crk-secondary-fbwZs", n = "crk-ghost-MuXFl", r = "crk-sm-96-1z", i = "crk-md-h9veM", a = "crk-lg-sOekJ", o = "crk-icon-TVDmu", s = "crk-animate-qNjdL", c = "crk-crkTogglePop-bVeaK", l = "crk-burst-Wjr-r", u = "crk-crkToggleBurst-HvC9q", d = {
3
+ root: e,
4
+ secondary: t,
5
+ ghost: n,
6
+ sm: r,
7
+ md: i,
8
+ lg: a,
9
+ icon: o,
10
+ animate: s,
11
+ crkTogglePop: c,
12
+ burst: l,
13
+ crkToggleBurst: u
14
+ };
15
+ export { s as animate, l as burst, u as crkToggleBurst, c as crkTogglePop, d as default, n as ghost, o as icon, a as lg, i as md, e as root, t as secondary, r as sm };
@@ -32,7 +32,7 @@ export interface TooltipProps {
32
32
  * <button aria-label="Copy">⧉</button>
33
33
  * </Tooltip>
34
34
  */
35
- export declare function Tooltip({ content, children, placement, delay, closeDelay, disabled, hideArrow, classes, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
35
+ export declare function Tooltip({ content, children, placement, delay, closeDelay, disabled, hideArrow, classes, }: TooltipProps): import("react").JSX.Element;
36
36
  export declare namespace Tooltip {
37
37
  var displayName: string;
38
38
  }