@companix/uikit 0.0.1 → 0.0.3

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 (254) hide show
  1. package/dist/bundle.es.js +61 -0
  2. package/dist/bundle.es10.js +87 -0
  3. package/dist/bundle.es11.js +75 -0
  4. package/dist/bundle.es12.js +38 -0
  5. package/dist/bundle.es13.js +33 -0
  6. package/dist/bundle.es14.js +18 -0
  7. package/dist/bundle.es15.js +11 -0
  8. package/dist/bundle.es16.js +35 -0
  9. package/dist/bundle.es17.js +27 -0
  10. package/dist/bundle.es18.js +23 -0
  11. package/dist/bundle.es19.js +24 -0
  12. package/dist/bundle.es20.js +15 -0
  13. package/dist/bundle.es21.js +41 -0
  14. package/dist/bundle.es22.js +18 -0
  15. package/dist/bundle.es23.js +36 -0
  16. package/dist/bundle.es24.js +23 -0
  17. package/dist/bundle.es25.js +42 -0
  18. package/dist/bundle.es26.js +114 -0
  19. package/dist/bundle.es27.js +115 -0
  20. package/dist/bundle.es28.js +38 -0
  21. package/dist/bundle.es29.js +13 -0
  22. package/dist/bundle.es3.js +45 -0
  23. package/dist/bundle.es30.js +27 -0
  24. package/dist/bundle.es31.js +38 -0
  25. package/dist/bundle.es35.js +43 -0
  26. package/dist/bundle.es36.js +442 -0
  27. package/dist/bundle.es37.js +24 -0
  28. package/dist/bundle.es38.js +26 -0
  29. package/dist/bundle.es39.js +83 -0
  30. package/dist/bundle.es4.js +14 -0
  31. package/dist/bundle.es40.js +20 -0
  32. package/dist/bundle.es41.js +16 -0
  33. package/dist/bundle.es43.js +7 -0
  34. package/dist/bundle.es44.js +23 -0
  35. package/dist/bundle.es45.js +16 -0
  36. package/dist/bundle.es46.js +72 -0
  37. package/dist/bundle.es47.js +70 -0
  38. package/dist/bundle.es48.js +34 -0
  39. package/dist/bundle.es49.js +70 -0
  40. package/dist/bundle.es5.js +88 -0
  41. package/dist/bundle.es50.js +33 -0
  42. package/dist/bundle.es51.js +78 -0
  43. package/dist/bundle.es52.js +51 -0
  44. package/dist/bundle.es53.js +45 -0
  45. package/dist/bundle.es54.js +40 -0
  46. package/dist/bundle.es55.js +36 -0
  47. package/dist/bundle.es56.js +9 -0
  48. package/dist/bundle.es57.js +9 -0
  49. package/dist/bundle.es58.js +7 -0
  50. package/dist/bundle.es59.js +9 -0
  51. package/dist/bundle.es6.js +87 -0
  52. package/dist/bundle.es60.js +8 -0
  53. package/dist/bundle.es61.js +19 -0
  54. package/dist/bundle.es62.js +15 -0
  55. package/dist/bundle.es63.js +22 -0
  56. package/dist/bundle.es64.js +45 -0
  57. package/dist/bundle.es65.js +28 -0
  58. package/dist/bundle.es66.js +34 -0
  59. package/dist/bundle.es67.js +6 -0
  60. package/dist/bundle.es68.js +12 -0
  61. package/dist/bundle.es69.js +47 -0
  62. package/dist/bundle.es7.js +80 -0
  63. package/dist/bundle.es70.js +11 -0
  64. package/dist/bundle.es71.js +18 -0
  65. package/dist/bundle.es72.js +32 -0
  66. package/dist/bundle.es73.js +35 -0
  67. package/dist/bundle.es74.js +6 -0
  68. package/dist/bundle.es75.js +7 -0
  69. package/dist/bundle.es76.js +7 -0
  70. package/dist/bundle.es77.js +11 -0
  71. package/dist/bundle.es78.js +17 -0
  72. package/dist/bundle.es79.js +7 -0
  73. package/dist/bundle.es8.js +29 -0
  74. package/dist/bundle.es80.js +17 -0
  75. package/dist/bundle.es81.js +25 -0
  76. package/dist/bundle.es9.js +47 -0
  77. package/dist/types/Button/index.d.ts +20 -0
  78. package/dist/types/ButtonGroup/index.d.ts +7 -0
  79. package/dist/types/Checkbox/index.d.ts +10 -0
  80. package/dist/types/Countdown/index.d.ts +7 -0
  81. package/dist/types/DateInput/index.d.ts +13 -0
  82. package/dist/types/DatePicker/Calendar.d.ts +14 -0
  83. package/dist/types/DatePicker/CalendarHeader.d.ts +10 -0
  84. package/dist/types/DatePicker/index.d.ts +12 -0
  85. package/dist/types/Dialog/index.d.ts +12 -0
  86. package/dist/types/DialogAlert/Alert.d.ts +19 -0
  87. package/dist/types/DialogAlert/Viewport.d.ts +8 -0
  88. package/dist/types/DialogAlert/index.d.ts +11 -0
  89. package/dist/types/Drawer/index.d.ts +13 -0
  90. package/dist/types/File/index.d.ts +10 -0
  91. package/dist/types/Form/index.d.ts +17 -0
  92. package/dist/types/Icon/index.d.ts +7 -0
  93. package/dist/types/LoadButton/index.d.ts +5 -0
  94. package/dist/types/NumberInput/index.d.ts +6 -0
  95. package/dist/types/OptionItem/OptionItem.d.ts +7 -0
  96. package/dist/types/OptionItem/OptionsList.d.ts +8 -0
  97. package/dist/types/Popover/index.d.ts +26 -0
  98. package/dist/types/Radio/index.d.ts +20 -0
  99. package/dist/types/Scrollable/ImitateScroll.d.ts +10 -0
  100. package/dist/types/Scrollable/index.d.ts +33 -0
  101. package/dist/types/Select/SelectInput.d.ts +14 -0
  102. package/dist/types/Select/index.d.ts +15 -0
  103. package/dist/types/SelectTags/index.d.ts +15 -0
  104. package/dist/types/Spinner/index.d.ts +8 -0
  105. package/dist/types/Stepper/index.d.ts +8 -0
  106. package/dist/types/Switch/index.d.ts +10 -0
  107. package/dist/types/Tabs/index.d.ts +13 -0
  108. package/dist/types/TextArea/index.d.ts +7 -0
  109. package/dist/types/Toaster/RemoveListener.d.ts +3 -0
  110. package/dist/types/Toaster/Toast.d.ts +9 -0
  111. package/dist/types/Toaster/Viewport.d.ts +13 -0
  112. package/dist/types/Toaster/index.d.ts +15 -0
  113. package/dist/types/Tooltip/index.d.ts +8 -0
  114. package/dist/types/__hooks/use-frooze-closing.d.ts +5 -0
  115. package/dist/types/__hooks/use-loading.d.ts +8 -0
  116. package/dist/types/__hooks/use-local-storage.d.ts +1 -0
  117. package/dist/types/__hooks/use-popover-position.d.ts +8 -0
  118. package/dist/types/__hooks/use-previos.d.ts +2 -0
  119. package/dist/types/__hooks/use-resize.d.ts +3 -0
  120. package/dist/types/__hooks/use-scrollbox.d.ts +7 -0
  121. package/dist/types/__hooks/use-stepper-input.d.ts +13 -0
  122. package/dist/types/__hooks/use-update.d.ts +1 -0
  123. package/dist/types/__hooks/useCalendar.d.ts +17 -0
  124. package/dist/types/__hooks/useCalendarOptions-copy.d.ts +22 -0
  125. package/dist/types/__hooks/useCalendarOptions.d.ts +31 -0
  126. package/dist/types/__libs/calendar.d.ts +25 -0
  127. package/dist/types/__utils/utils.d.ts +25 -0
  128. package/dist/types/index.d.ts +31 -0
  129. package/dist/types/types.d.ts +13 -0
  130. package/dist/uikit.css +1 -0
  131. package/package.json +10 -6
  132. package/.eslintrc +0 -54
  133. package/declaration.d.ts +0 -4
  134. package/index.html +0 -12
  135. package/playground/App.tsx +0 -166
  136. package/playground/Example.tsx +0 -14
  137. package/playground/Test.tsx +0 -44
  138. package/playground/animation-test-1/index.scss +0 -20
  139. package/playground/animation-test-1/index.tsx +0 -17
  140. package/playground/animation-test-2/index.scss +0 -62
  141. package/playground/animation-test-2/index.tsx +0 -32
  142. package/playground/bootstrap.tsx +0 -19
  143. package/playground/buttons/index.tsx +0 -132
  144. package/playground/checkbox/index.tsx +0 -64
  145. package/playground/date-input/index.tsx +0 -45
  146. package/playground/date-picker/index.tsx +0 -41
  147. package/playground/dialog/index.tsx +0 -92
  148. package/playground/dialog-alert/index.tsx +0 -47
  149. package/playground/drawer/index.tsx +0 -55
  150. package/playground/index.css +0 -33
  151. package/playground/index.scss +0 -270
  152. package/playground/input/index.tsx +0 -112
  153. package/playground/number-inputs/index.tsx +0 -50
  154. package/playground/popovers/index.tsx +0 -70
  155. package/playground/radio-group/index.tsx +0 -69
  156. package/playground/select/index.tsx +0 -72
  157. package/playground/select-tags/index.tsx +0 -36
  158. package/playground/styles.scss +0 -2
  159. package/playground/switch/index.tsx +0 -44
  160. package/playground/tabs/index.tsx +0 -16
  161. package/playground/test.scss +0 -0
  162. package/playground/text-area/index.tsx +0 -17
  163. package/playground/text-input/index.tsx +0 -12
  164. package/playground/toaster/index.tsx +0 -156
  165. package/playground/tooltip/index.tsx +0 -26
  166. package/src/Button/Button.scss +0 -128
  167. package/src/Button/index.tsx +0 -72
  168. package/src/ButtonGroup/ButtonGroup.scss +0 -18
  169. package/src/ButtonGroup/index.tsx +0 -20
  170. package/src/Checkbox/Checkbox.scss +0 -115
  171. package/src/Checkbox/index.tsx +0 -46
  172. package/src/Countdown/index.tsx +0 -54
  173. package/src/DateInput/DateInput.scss +0 -11
  174. package/src/DateInput/index.tsx +0 -96
  175. package/src/DatePicker/Calendar.scss +0 -125
  176. package/src/DatePicker/Calendar.tsx +0 -157
  177. package/src/DatePicker/CalendarHeader.tsx +0 -139
  178. package/src/DatePicker/DatePicker.scss +0 -0
  179. package/src/DatePicker/index.tsx +0 -177
  180. package/src/Dialog/Dialog.scss +0 -25
  181. package/src/Dialog/Popup.scss +0 -55
  182. package/src/Dialog/index.tsx +0 -31
  183. package/src/DialogAlert/Alert.scss +0 -52
  184. package/src/DialogAlert/Alert.tsx +0 -78
  185. package/src/DialogAlert/Viewport.tsx +0 -52
  186. package/src/DialogAlert/index.tsx +0 -37
  187. package/src/Drawer/Drawer.scss +0 -112
  188. package/src/Drawer/index.tsx +0 -46
  189. package/src/File/index.tsx +0 -60
  190. package/src/Form/Form.scss +0 -70
  191. package/src/Form/Input.scss +0 -24
  192. package/src/Form/index.tsx +0 -131
  193. package/src/Icon/icon.scss +0 -18
  194. package/src/Icon/index.tsx +0 -43
  195. package/src/LoadButton/index.tsx +0 -17
  196. package/src/NumberInput/index.tsx +0 -74
  197. package/src/OptionItem/Option.scss +0 -89
  198. package/src/OptionItem/OptionItem.tsx +0 -49
  199. package/src/OptionItem/OptionsList.tsx +0 -26
  200. package/src/Popover/Popover.scss +0 -80
  201. package/src/Popover/index.tsx +0 -117
  202. package/src/Radio/Radio.scss +0 -148
  203. package/src/Radio/index.tsx +0 -68
  204. package/src/Scrollable/ImitateScroll.tsx +0 -141
  205. package/src/Scrollable/Scrollable.scss +0 -50
  206. package/src/Scrollable/index.tsx +0 -141
  207. package/src/Select/Select.scss +0 -80
  208. package/src/Select/SelectInput.tsx +0 -131
  209. package/src/Select/index.tsx +0 -134
  210. package/src/SelectTags/SelectTags.scss +0 -66
  211. package/src/SelectTags/index.tsx +0 -192
  212. package/src/Spinner/Spinner.scss +0 -14
  213. package/src/Spinner/index.tsx +0 -19
  214. package/src/Stepper/StepperInput.scss +0 -35
  215. package/src/Stepper/index.tsx +0 -76
  216. package/src/Switch/Switch.scss +0 -102
  217. package/src/Switch/index.tsx +0 -49
  218. package/src/Tabs/Tabs.scss +0 -58
  219. package/src/Tabs/index.tsx +0 -89
  220. package/src/TextArea/TextArea.scss +0 -34
  221. package/src/TextArea/index.tsx +0 -51
  222. package/src/Toaster/RemoveListener.tsx +0 -11
  223. package/src/Toaster/Toast.tsx +0 -69
  224. package/src/Toaster/Toaster.scss +0 -151
  225. package/src/Toaster/Viewport.tsx +0 -117
  226. package/src/Toaster/index.tsx +0 -52
  227. package/src/Tooltip/Tooltip.scss +0 -28
  228. package/src/Tooltip/index.tsx +0 -33
  229. package/src/__hooks/use-frooze-closing.ts +0 -51
  230. package/src/__hooks/use-loading.ts +0 -34
  231. package/src/__hooks/use-local-storage.ts +0 -19
  232. package/src/__hooks/use-popover-position.ts +0 -24
  233. package/src/__hooks/use-previos.ts +0 -25
  234. package/src/__hooks/use-resize.ts +0 -41
  235. package/src/__hooks/use-scrollbox.ts +0 -45
  236. package/src/__hooks/use-stepper-input.ts +0 -82
  237. package/src/__hooks/use-update.ts +0 -19
  238. package/src/__hooks/useCalendar.ts +0 -104
  239. package/src/__hooks/useCalendarOptions-copy.ts +0 -87
  240. package/src/__hooks/useCalendarOptions.ts +0 -68
  241. package/src/__libs/calendar.ts +0 -175
  242. package/src/__utils/utils.ts +0 -137
  243. package/src/css.scss +0 -120
  244. package/src/index.scss +0 -22
  245. package/src/index.ts +0 -36
  246. package/src/mixins.scss +0 -99
  247. package/src/theme.scss +0 -103
  248. package/src/types.ts +0 -14
  249. package/tailwind.config.js +0 -91
  250. package/themes/classic/animations.scss +0 -179
  251. package/themes/classic/classic.scss +0 -493
  252. package/tsconfig.json +0 -27
  253. package/vite.build.ts +0 -35
  254. package/vite.config.ts +0 -33
@@ -0,0 +1,61 @@
1
+ /* empty css */
2
+ import { Button as t } from "./bundle.es3.js";
3
+ import { Spinner as m } from "./bundle.es4.js";
4
+ import { Scrollable as f } from "./bundle.es5.js";
5
+ import { ImitateScroll as l } from "./bundle.es6.js";
6
+ import { Popover as n } from "./bundle.es7.js";
7
+ import { Tooltip as u } from "./bundle.es8.js";
8
+ import { StepperInput as s } from "./bundle.es9.js";
9
+ import { Select as T } from "./bundle.es10.js";
10
+ import { Form as A } from "./bundle.es11.js";
11
+ import { OptionItem as I } from "./bundle.es12.js";
12
+ import { NumberInput as w } from "./bundle.es13.js";
13
+ import { OptionsList as L } from "./bundle.es14.js";
14
+ import { ButtonGroup as h } from "./bundle.es15.js";
15
+ import { Checkbox as v } from "./bundle.es16.js";
16
+ import { Switch as F } from "./bundle.es17.js";
17
+ import { Radio as y } from "./bundle.es18.js";
18
+ import { Drawer as N } from "./bundle.es19.js";
19
+ import { Dialog as j } from "./bundle.es20.js";
20
+ import { AlertDialog as z } from "./bundle.es21.js";
21
+ import { LoadButton as H } from "./bundle.es22.js";
22
+ import { Tabs as K } from "./bundle.es23.js";
23
+ import { Countdown as Q } from "./bundle.es24.js";
24
+ import { TextArea as V } from "./bundle.es25.js";
25
+ import { SelectTags as X } from "./bundle.es26.js";
26
+ import { DatePicker as Z } from "./bundle.es27.js";
27
+ import { FileOverlay as $ } from "./bundle.es28.js";
28
+ import { useLocalStorage as ro } from "./bundle.es29.js";
29
+ import { createAlertAgent as to } from "./bundle.es30.js";
30
+ import { createToaster as mo } from "./bundle.es31.js";
31
+ export {
32
+ z as AlertDialog,
33
+ t as Button,
34
+ h as ButtonGroup,
35
+ v as Checkbox,
36
+ Q as Countdown,
37
+ Z as DatePicker,
38
+ j as Dialog,
39
+ N as Drawer,
40
+ $ as FileOverlay,
41
+ A as Form,
42
+ l as ImitateScroll,
43
+ H as LoadButton,
44
+ w as NumberInput,
45
+ I as OptionItem,
46
+ L as OptionsList,
47
+ n as Popover,
48
+ y as Radio,
49
+ f as Scrollable,
50
+ T as Select,
51
+ X as SelectTags,
52
+ m as Spinner,
53
+ s as StepperInput,
54
+ F as Switch,
55
+ K as Tabs,
56
+ V as TextArea,
57
+ u as Tooltip,
58
+ to as createAlertAgent,
59
+ mo as createToaster,
60
+ ro as useLocalStorage
61
+ };
@@ -0,0 +1,87 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useMemo as E, useEffect as I } from "react";
3
+ import { OptionsList as b } from "./bundle.es14.js";
4
+ import { OptionItem as B } from "./bundle.es12.js";
5
+ import { Popover as F } from "./bundle.es7.js";
6
+ import { useFroozeClosing as z } from "./bundle.es38.js";
7
+ import { SelectInput as D } from "./bundle.es39.js";
8
+ import { useScrollListController as L } from "./bundle.es40.js";
9
+ const y = (c) => {
10
+ const {
11
+ options: e,
12
+ onChange: i,
13
+ minimalOptions: a,
14
+ clearButton: m,
15
+ clearButtonIcon: u,
16
+ matchTarget: f = "width",
17
+ value: l,
18
+ children: n,
19
+ disabled: s,
20
+ ...d
21
+ } = c, p = E(() => {
22
+ const o = e.findIndex((t) => t.value === l);
23
+ return {
24
+ index: o,
25
+ option: e[o]
26
+ };
27
+ }, [e, l]), v = p.option?.value ?? null, { popoverRef: h, froozePopoverPosition: x, handleAnimationEnd: O } = z(), { scrollToElement: C, optionsWrapperRef: g, scrollBoxRef: P } = L(), R = (o, t) => {
28
+ x(), i(o), t();
29
+ }, S = (o) => {
30
+ o.stopPropagation(), i(null);
31
+ }, A = () => {
32
+ p.index !== -1 && C(p.index, !0);
33
+ };
34
+ return /* @__PURE__ */ r(
35
+ F,
36
+ {
37
+ minimal: !0,
38
+ ref: h,
39
+ sideOffset: 0,
40
+ matchTarget: f,
41
+ onAnimationEnd: O,
42
+ onOpenAutoFocus: (o) => o.preventDefault(),
43
+ onCloseAutoFocus: (o) => o.preventDefault(),
44
+ disabled: s,
45
+ content: ({ close: o }) => /* @__PURE__ */ r(
46
+ T,
47
+ {
48
+ options: e,
49
+ active: v,
50
+ scrollboxRef: P,
51
+ optionsWrapperRef: g,
52
+ minimalOptions: a,
53
+ onOpened: A,
54
+ onSelect: (t) => R(t, o)
55
+ }
56
+ ),
57
+ children: n ?? /* @__PURE__ */ r(
58
+ D,
59
+ {
60
+ ...d,
61
+ disabled: s,
62
+ value: p.option?.title ?? "",
63
+ onClear: S,
64
+ clearButton: m,
65
+ clearButtonIcon: u
66
+ }
67
+ )
68
+ }
69
+ );
70
+ }, T = (c) => {
71
+ const { active: e, onOpened: i, scrollboxRef: a, optionsWrapperRef: m, options: u, onSelect: f, minimalOptions: l } = c;
72
+ return I(() => {
73
+ i?.();
74
+ }, []), /* @__PURE__ */ r(b, { scrollboxRef: a, optionsWrapperRef: m, maxHeight: 300, children: u.map((n, s) => /* @__PURE__ */ r(
75
+ B,
76
+ {
77
+ active: e === n.value,
78
+ onClick: () => f?.(n.value),
79
+ minimal: l,
80
+ ...n
81
+ },
82
+ `option-item-${n.value}-${s}`
83
+ )) });
84
+ };
85
+ export {
86
+ y as Select
87
+ };
@@ -0,0 +1,75 @@
1
+ import { jsxs as z, jsx as r } from "react/jsx-runtime";
2
+ import A from "classnames";
3
+ import F from "react-input-mask";
4
+ import { useLayoutAndUpdate as M } from "./bundle.es41.js";
5
+ import { attr as c } from "@companix/utils-browser";
6
+ import { forwardRef as R, useRef as m, useCallback as g } from "react";
7
+ import { mergeRefs as U } from "react-merge-refs";
8
+ const Q = R(
9
+ ({
10
+ required: n,
11
+ size: f,
12
+ fill: a,
13
+ leftElement: e,
14
+ rightElement: u,
15
+ onChange: x,
16
+ onValueChange: $,
17
+ readOnly: b,
18
+ className: I,
19
+ value: N,
20
+ placeholder: W,
21
+ disabled: p,
22
+ mask: y,
23
+ maskChar: C,
24
+ inputRef: L,
25
+ ...j
26
+ }, k) => {
27
+ const s = m(null), l = m(null), d = m(null), q = { Right: l, Left: d }, h = g((t) => {
28
+ if (s.current) {
29
+ const i = s.current.style, o = q[t];
30
+ o.current && o.current.clientWidth ? i[`padding${t}`] !== `${o.current.clientWidth}px` && (i[`padding${t}`] = `${o.current.clientWidth}px`) : i[`padding${t}`] && (i[`padding${t}`] = "");
31
+ }
32
+ }, []);
33
+ M(() => {
34
+ h("Left"), h("Right");
35
+ }, [u, e]);
36
+ const w = g((t) => {
37
+ x?.(t), $?.(t.target.value, t.target);
38
+ }, []);
39
+ return /* @__PURE__ */ z(
40
+ "div",
41
+ {
42
+ ref: k,
43
+ className: A("form", I),
44
+ "data-size": f ?? "md",
45
+ "data-fill": c(a),
46
+ "data-required": c(n),
47
+ "data-disabled": c(p),
48
+ ...j,
49
+ children: [
50
+ e && /* @__PURE__ */ r("span", { ref: d, className: "form-input-base-left-element", children: e }),
51
+ /* @__PURE__ */ r(
52
+ v,
53
+ {
54
+ type: "text",
55
+ ref: U([s, L]),
56
+ className: "form-input form-input-base",
57
+ "aria-disabled": p,
58
+ onChange: w,
59
+ value: N,
60
+ placeholder: W,
61
+ disabled: p,
62
+ readOnly: b,
63
+ maskChar: C,
64
+ mask: y
65
+ }
66
+ ),
67
+ u && /* @__PURE__ */ r("span", { ref: l, className: "form-input-base-right-element", children: u })
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ ), v = R(({ mask: n, maskChar: f, ...a }, e) => n ? /* @__PURE__ */ r(F, { inputRef: e, mask: n, maskChar: f, ...a }) : /* @__PURE__ */ r("input", { ref: e, ...a }));
73
+ export {
74
+ Q as Form
75
+ };
@@ -0,0 +1,38 @@
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import N from "classnames";
3
+ import { Icon as v } from "./bundle.es37.js";
4
+ import { attr as t } from "@companix/utils-browser";
5
+ import { forwardRef as k } from "react";
6
+ import { faCheck as x } from "@fortawesome/free-solid-svg-icons";
7
+ const O = k(
8
+ ({ title: d, icon: n, active: c, label: e, disabled: r, minimal: a, onClick: l, className: m, ...s }, p) => {
9
+ const f = (h) => {
10
+ r || l?.(h);
11
+ };
12
+ return /* @__PURE__ */ i(
13
+ "div",
14
+ {
15
+ ref: p,
16
+ ...s,
17
+ className: N("option", m),
18
+ "data-selected": t(c),
19
+ "data-disabled": t(r),
20
+ "data-minimal": t(a),
21
+ onClick: f,
22
+ children: [
23
+ /* @__PURE__ */ i("div", { className: "option-content", children: [
24
+ n && /* @__PURE__ */ o("div", { className: "option-icon", children: n }),
25
+ /* @__PURE__ */ i("div", { className: "option-content-layout", children: [
26
+ /* @__PURE__ */ o("div", { className: "option-title", children: d }),
27
+ e && /* @__PURE__ */ o("div", { className: "option-label", children: e })
28
+ ] })
29
+ ] }),
30
+ c && !a && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x }) })
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ );
36
+ export {
37
+ O as OptionItem
38
+ };
@@ -0,0 +1,33 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useState as m, useRef as p } from "react";
3
+ import { Form as l } from "./bundle.es11.js";
4
+ const N = ({ value: r, onChange: u, ...e }) => {
5
+ const [, t] = m([]), n = p(o(r));
6
+ return +n.current !== r && (n.current = o(r)), /* @__PURE__ */ f(
7
+ l,
8
+ {
9
+ ...e,
10
+ value: n.current,
11
+ onChange: (i) => {
12
+ const s = i.currentTarget.value.trim();
13
+ if (s === "")
14
+ return n.current = "", u(null);
15
+ if (!(s.startsWith(".") || s.replace(".", "").split("").some((c) => isNaN(parseInt(c))))) {
16
+ if (n.current = a(s.split("")), +n.current === r)
17
+ return t([]);
18
+ u(+n.current);
19
+ }
20
+ }
21
+ }
22
+ );
23
+ }, o = (r) => r === null ? "" : r.toString(), a = (r) => {
24
+ const u = [...r], e = [...r];
25
+ if (e.every((t) => t === "0"))
26
+ return "0";
27
+ for (let t = 0; t < e.length && e[t] === "0"; t++)
28
+ e[t] === "0" && e[t + 1] !== "." && u.shift();
29
+ return u.join("");
30
+ };
31
+ export {
32
+ N as NumberInput
33
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Scrollable as n } from "./bundle.es5.js";
3
+ const s = ({ children: o, maxHeight: t, scrollboxRef: i, optionsWrapperRef: e }) => /* @__PURE__ */ r(
4
+ n,
5
+ {
6
+ ref: i,
7
+ implementation: "inner",
8
+ padding: 10,
9
+ thumbPadding: 3,
10
+ thumbColor: "#0000002b",
11
+ maxHeight: t,
12
+ scrollY: !0,
13
+ children: /* @__PURE__ */ r("div", { className: "option-list", ref: e, children: o })
14
+ }
15
+ );
16
+ export {
17
+ s as OptionsList
18
+ };
@@ -0,0 +1,11 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ /* empty css */
3
+ import { forwardRef as f } from "react";
4
+ import i from "classnames";
5
+ import { attr as a } from "@companix/utils-browser";
6
+ const d = f(
7
+ ({ children: r, className: o, fill: t }, m) => /* @__PURE__ */ p("div", { ref: m, className: i("button-group", o), "data-fill": a(t), children: r })
8
+ );
9
+ export {
10
+ d as ButtonGroup
11
+ };
@@ -0,0 +1,35 @@
1
+ import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-checkbox";
3
+ import { Icon as h } from "./bundle.es37.js";
4
+ import { faCheck as l } from "@fortawesome/free-solid-svg-icons";
5
+ import { useId as n } from "react";
6
+ import { attr as c } from "@companix/utils-browser";
7
+ const u = ({ checked: e, required: m, disabled: r, onCheckedChange: s, size: d, label: a }) => {
8
+ const i = n();
9
+ return /* @__PURE__ */ x(
10
+ "div",
11
+ {
12
+ className: "checkbox",
13
+ "data-size": d ?? "md",
14
+ "data-required": c(m && !e),
15
+ "data-disabled": c(r),
16
+ children: [
17
+ /* @__PURE__ */ o(
18
+ t.Root,
19
+ {
20
+ className: "checkbox-box",
21
+ checked: e,
22
+ onCheckedChange: s,
23
+ disabled: r,
24
+ id: i,
25
+ children: /* @__PURE__ */ o(t.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ o(h, { icon: l, size: "xxxs" }) })
26
+ }
27
+ ),
28
+ a && /* @__PURE__ */ o("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(r), children: a })
29
+ ]
30
+ }
31
+ );
32
+ };
33
+ export {
34
+ u as Checkbox
35
+ };
@@ -0,0 +1,27 @@
1
+ import { jsxs as d, jsx as c } from "react/jsx-runtime";
2
+ import * as r from "@radix-ui/react-switch";
3
+ import { attr as a } from "@companix/utils-browser";
4
+ import { useId as n } from "react";
5
+ const u = (m) => {
6
+ const { checked: e, disabled: s, onCheckedChange: o, uncheckedIcon: i, checkedIcon: t, label: h } = m, l = n();
7
+ return /* @__PURE__ */ d("div", { className: "switch", "data-disabled": a(s), children: [
8
+ /* @__PURE__ */ c(
9
+ r.Root,
10
+ {
11
+ className: "switch-track",
12
+ checked: e,
13
+ onCheckedChange: o,
14
+ disabled: s,
15
+ id: l,
16
+ children: /* @__PURE__ */ d(r.Thumb, { className: "switch-thumb", children: [
17
+ i && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(!e), children: i }),
18
+ t && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(e), children: t })
19
+ ] })
20
+ }
21
+ ),
22
+ h && /* @__PURE__ */ c("label", { className: "switch-label", htmlFor: l, "data-disabled": s, children: h })
23
+ ] });
24
+ };
25
+ export {
26
+ u as Switch
27
+ };
@@ -0,0 +1,23 @@
1
+ import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
+ import { useId as c } from "react";
3
+ import * as d from "@radix-ui/react-radio-group";
4
+ import { attr as i } from "@companix/utils-browser";
5
+ const h = ({ value: t, label: e, size: m = "md", disabled: a, required: s }) => {
6
+ const o = c();
7
+ return /* @__PURE__ */ l(
8
+ "span",
9
+ {
10
+ className: "radio",
11
+ "data-disabled": i(a),
12
+ "data-size": m,
13
+ "data-required": i(s),
14
+ children: [
15
+ /* @__PURE__ */ r(d.Item, { className: "radio-box", value: t, disabled: a, id: o, children: /* @__PURE__ */ r(d.Indicator, { className: "radio-mark" }) }),
16
+ /* @__PURE__ */ r("label", { className: "radio-label", htmlFor: o, "data-disabled": i(a), children: e })
17
+ ]
18
+ }
19
+ );
20
+ };
21
+ export {
22
+ h as Radio
23
+ };
@@ -0,0 +1,24 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import d from "classnames";
3
+ import * as r from "@radix-ui/react-dialog";
4
+ import { VisuallyHidden as n } from "@radix-ui/react-visually-hidden";
5
+ import { varToStyle as c } from "@companix/utils-browser";
6
+ const p = ({ open: i, onOpenChange: t, children: a, size: l, direction: s, className: m }) => /* @__PURE__ */ e(r.Root, { open: i, onOpenChange: t, children: /* @__PURE__ */ o(r.Portal, { children: [
7
+ /* @__PURE__ */ e(r.Overlay, { className: "drawer-overlay" }),
8
+ /* @__PURE__ */ o(
9
+ r.Content,
10
+ {
11
+ style: c({ "--drawer-size": l ?? "50%" }),
12
+ className: d("drawer", m),
13
+ "data-direction": s,
14
+ children: [
15
+ /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(r.Title, {}) }),
16
+ a
17
+ ]
18
+ }
19
+ )
20
+ ] }) });
21
+ p.Close = r.Close;
22
+ export {
23
+ p as Drawer
24
+ };
@@ -0,0 +1,15 @@
1
+ import { jsx as i, jsxs as r } from "react/jsx-runtime";
2
+ import n from "classnames";
3
+ import * as o from "@radix-ui/react-dialog";
4
+ import { VisuallyHidden as p } from "@radix-ui/react-visually-hidden";
5
+ const c = ({ size: e = "s", open: l, onOpenChange: a, children: s, className: t }) => /* @__PURE__ */ i(o.Root, { open: l, onOpenChange: a, children: /* @__PURE__ */ r(o.Portal, { children: [
6
+ /* @__PURE__ */ i(o.Overlay, { className: "popup-overlay dialog-overlay" }),
7
+ /* @__PURE__ */ i(o.Content, { className: "popup-container dialog-container", "data-size": e, children: /* @__PURE__ */ r("div", { className: n("popup dialog", t), children: [
8
+ /* @__PURE__ */ i(p, { children: /* @__PURE__ */ i(o.Title, {}) }),
9
+ s
10
+ ] }) })
11
+ ] }) });
12
+ c.Close = o.Close;
13
+ export {
14
+ c as Dialog
15
+ };
@@ -0,0 +1,41 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import * as r from "@radix-ui/react-alert-dialog";
3
+ /* empty css */
4
+ import { Button as c } from "./bundle.es3.js";
5
+ import { RemoveListener as N } from "./bundle.es43.js";
6
+ import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
7
+ const A = ({
8
+ open: d,
9
+ defaultOpen: p,
10
+ onOpenChange: m,
11
+ onUnMounted: h,
12
+ icon: i,
13
+ title: l,
14
+ description: o,
15
+ cancelDefaultText: n,
16
+ cancel: t,
17
+ disableCancel: v,
18
+ confirm: s
19
+ }) => /* @__PURE__ */ a(r.Root, { open: d, defaultOpen: p, onOpenChange: m, children: [
20
+ /* @__PURE__ */ e(N, { callback: h }),
21
+ /* @__PURE__ */ a(r.Portal, { children: [
22
+ /* @__PURE__ */ e(r.Overlay, { className: "popup-overlay dialog-overlay" }),
23
+ /* @__PURE__ */ e(r.Content, { className: "popup-container dialog-container", children: /* @__PURE__ */ a("div", { className: "popup alert", children: [
24
+ /* @__PURE__ */ a("div", { className: "alert-body", children: [
25
+ i && /* @__PURE__ */ e("span", { className: "alert-icon", children: i }),
26
+ /* @__PURE__ */ a("div", { className: "alert-content", children: [
27
+ l && /* @__PURE__ */ e(r.Title, { className: "alert-title", children: l }),
28
+ !l && /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(r.Title, {}) }),
29
+ o && /* @__PURE__ */ e(r.Description, { className: "alert-description", children: o })
30
+ ] })
31
+ ] }),
32
+ /* @__PURE__ */ a("div", { className: "alert-footer", children: [
33
+ !v && (t?.text || n) && /* @__PURE__ */ e(r.Cancel, { asChild: !0, children: /* @__PURE__ */ e(c, { appearance: "neutral", ...t, text: t?.text ?? n }) }),
34
+ s?.text && /* @__PURE__ */ e(r.Action, { asChild: !0, children: /* @__PURE__ */ e(c, { appearance: "negative", ...s }) })
35
+ ] })
36
+ ] }) })
37
+ ] })
38
+ ] });
39
+ export {
40
+ A as AlertDialog
41
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Button as m } from "./bundle.es3.js";
3
+ import { useLoading as p } from "./bundle.es44.js";
4
+ const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
5
+ const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
6
+ return /* @__PURE__ */ e(
7
+ m,
8
+ {
9
+ appearance: t ? "negative" : r,
10
+ ...i,
11
+ loading: n,
12
+ onClick: a
13
+ }
14
+ );
15
+ };
16
+ export {
17
+ g as LoadButton
18
+ };
@@ -0,0 +1,36 @@
1
+ import { jsx as n, jsxs as T } from "react/jsx-runtime";
2
+ import * as c from "@radix-ui/react-tabs";
3
+ import { useRef as g, useId as p, createContext as v, useState as I, useContext as d, useEffect as R } from "react";
4
+ const l = v({ baseId: "", listRef: {} }), b = (t, e) => `radix-${t}-trigger-${e}`, y = ({ children: t, value: e, onChange: s }) => {
5
+ const r = g(null), o = p();
6
+ return /* @__PURE__ */ n(c.Root, { value: e, onValueChange: s, children: /* @__PURE__ */ n(l.Provider, { value: { baseId: o, listRef: r }, children: /* @__PURE__ */ T(c.List, { className: "tabs", ref: r, children: [
7
+ /* @__PURE__ */ n($, { value: e }),
8
+ t
9
+ ] }) }) });
10
+ }, $ = ({ value: t }) => {
11
+ const [e, s] = I({}), { baseId: r, listRef: o } = d(l);
12
+ return R(() => {
13
+ const a = { observer: null };
14
+ if (o.current) {
15
+ const f = `.tab[id="${b(r, t)}"]`, i = o.current.querySelector(f);
16
+ i != null ? (a.observer = new ResizeObserver(() => {
17
+ const { clientHeight: u, clientWidth: m, offsetLeft: h, offsetTop: x } = i;
18
+ s({
19
+ height: u,
20
+ transform: `translateX(${Math.floor(h)}px) translateY(${Math.floor(x)}px)`,
21
+ width: m
22
+ });
23
+ }), a.observer.observe(i)) : s({ display: "none" });
24
+ }
25
+ return () => {
26
+ a.observer && a.observer.disconnect();
27
+ };
28
+ }, [t]), /* @__PURE__ */ n("div", { className: "tab-indicator-container", style: e, children: /* @__PURE__ */ n("div", { className: "tab-indicator" }) });
29
+ }, C = ({ children: t, value: e, ...s }) => {
30
+ const { baseId: r } = d(l), o = b(r, e);
31
+ return /* @__PURE__ */ n(c.Trigger, { ...s, id: o, className: "tab", value: e, children: t });
32
+ };
33
+ y.Tab = C;
34
+ export {
35
+ y as Tabs
36
+ };
@@ -0,0 +1,23 @@
1
+ import { jsx as d, Fragment as p } from "react/jsx-runtime";
2
+ import { getNextCandleTime as T, sleep as S, getTimes as x } from "@companix/utils-js";
3
+ import { useRef as g, useState as v, useEffect as s } from "react";
4
+ const n = (t) => String(t).padStart(2, "0"), j = ({ expiration: t, separator: m = ":", onExpired: a }) => {
5
+ const e = g(null), [, o] = v([]);
6
+ s(() => {
7
+ const c = Date.now(), f = T(c, "1s") - c;
8
+ return e.current && clearInterval(e.current), S(f).then(() => {
9
+ o([]), e.current = setInterval(() => {
10
+ o([]);
11
+ }, 1e3);
12
+ }), () => {
13
+ e.current && clearInterval(e.current);
14
+ };
15
+ }, [t]);
16
+ const r = t - Date.now(), { hours: i, minutes: u, seconds: l } = x(r);
17
+ return s(() => {
18
+ r <= 0 && (a?.(), e.current && clearInterval(e.current));
19
+ }, [r <= 0]), /* @__PURE__ */ d(p, { children: [n(i), n(u), n(l)].join(m) });
20
+ };
21
+ export {
22
+ j as Countdown
23
+ };
@@ -0,0 +1,42 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { useResizeTextarea as p } from "./bundle.es45.js";
3
+ import { attr as e, callMultiple as x } from "@companix/utils-browser";
4
+ import { useEffect as u } from "react";
5
+ const R = ({
6
+ onResize: s,
7
+ grow: a = !1,
8
+ value: t,
9
+ onChange: i,
10
+ disabled: o,
11
+ required: m,
12
+ rows: l = 2,
13
+ fill: c = !1,
14
+ ...d
15
+ }) => {
16
+ const [n, r] = p(s, a);
17
+ return u(r, [r, t]), /* @__PURE__ */ f(
18
+ "div",
19
+ {
20
+ className: "form form-textarea",
21
+ "data-required": e(m),
22
+ "data-disabled": e(o),
23
+ "data-fill": e(c),
24
+ children: /* @__PURE__ */ f(
25
+ "textarea",
26
+ {
27
+ className: "form-input",
28
+ "data-grow": e(a),
29
+ value: t,
30
+ ref: n,
31
+ rows: l,
32
+ disabled: o,
33
+ onChange: x(i, r),
34
+ ...d
35
+ }
36
+ )
37
+ }
38
+ );
39
+ };
40
+ export {
41
+ R as TextArea
42
+ };