@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,72 @@
1
+ import { jsxs as D, jsx as t } from "react/jsx-runtime";
2
+ import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es50.js";
3
+ import { CalendarHeader as F } from "./bundle.es51.js";
4
+ import { useCalendar as j } from "./bundle.es52.js";
5
+ import { attr as m } from "@companix/utils-browser";
6
+ import { isSameDate as f } from "./bundle.es47.js";
7
+ import { useLayoutEffect as I } from "react";
8
+ const T = ({ disablePickers: c, value: e, onChange: i, ...l }) => {
9
+ const {
10
+ viewDate: n,
11
+ setViewDate: r,
12
+ setNextMonth: N,
13
+ setPrevMonth: x,
14
+ isMonthDisabled: M,
15
+ isYearDisabled: v,
16
+ isDayDisabled: w
17
+ } = j(l);
18
+ I(() => {
19
+ e && r(e);
20
+ }, [e]);
21
+ const o = $(n), h = n.getMonth(), y = n.getFullYear(), C = /* @__PURE__ */ new Date();
22
+ return /* @__PURE__ */ D("div", { className: "calendar", children: [
23
+ /* @__PURE__ */ t(
24
+ F,
25
+ {
26
+ viewDate: n,
27
+ onChange: r,
28
+ onNextMonth: N,
29
+ onPrevMonth: x,
30
+ disablePickers: c,
31
+ isMonthDisabled: M,
32
+ isYearDisabled: v
33
+ }
34
+ ),
35
+ /* @__PURE__ */ t("div", { className: "calendar-names", children: g.map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-name", children: d }, `week-name-${a}`)) }),
36
+ /* @__PURE__ */ D("div", { className: "calendar-days", children: [
37
+ p(b(u(o.month, o.year))).map((d, a) => /* @__PURE__ */ t("div", { className: "calendar-day", "data-void": !0 }, `void-${d}-${a}`)),
38
+ p(k(o.month, o.year)).map((d, a) => {
39
+ const s = new Date(y, h, a + 1);
40
+ return /* @__PURE__ */ t(
41
+ P,
42
+ {
43
+ day: a + 1,
44
+ disabled: w(s),
45
+ selected: !!(e && f(e, s)),
46
+ today: f(s, C),
47
+ onSelect: () => i?.(s)
48
+ },
49
+ `date-${d}-${y}-${h}-${a}`
50
+ );
51
+ })
52
+ ] })
53
+ ] });
54
+ }, P = ({ day: c, disabled: e, selected: i, today: l, onSelect: n }) => {
55
+ const r = () => {
56
+ e || n?.();
57
+ };
58
+ return /* @__PURE__ */ t(
59
+ "div",
60
+ {
61
+ className: "calendar-day",
62
+ "data-disabled": m(e),
63
+ "data-selected": m(i),
64
+ "data-today": m(l),
65
+ onClick: r,
66
+ children: /* @__PURE__ */ t("span", { className: "calendar-day-number", children: c })
67
+ }
68
+ );
69
+ };
70
+ export {
71
+ T as Calendar
72
+ };
@@ -0,0 +1,70 @@
1
+ import { useMemo as D, useCallback as c } from "react";
2
+ function l(e, t) {
3
+ return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
4
+ }
5
+ function f(e) {
6
+ const t = new Date(e);
7
+ return t.setHours(0, 0, 0, 0), t;
8
+ }
9
+ function h(e) {
10
+ const t = new Date(e);
11
+ return t.setHours(23, 59, 59, 999), t;
12
+ }
13
+ function M(e, t = {}) {
14
+ const { min: n, max: r, withTime: s = !1 } = t;
15
+ return !s && (n && l(e, n) || r && l(e, r)) ? !1 : !!(n && e < n || r && e > r);
16
+ }
17
+ function m(e, t) {
18
+ const n = new Date(e);
19
+ if (!t)
20
+ return n;
21
+ const r = n.getDate(), s = new Date(e);
22
+ s.setMonth(n.getMonth() + t + 1, 0);
23
+ const a = s.getDate();
24
+ return r >= a ? s : (n.setFullYear(s.getFullYear(), s.getMonth(), r), n);
25
+ }
26
+ function F(e, t) {
27
+ return m(e, -1);
28
+ }
29
+ function g(e) {
30
+ const t = new Date(e), n = new Date(t);
31
+ return n.setFullYear(t.getFullYear(), t.getMonth() + 1, 0), n.setHours(0, 0, 0, 0), n.getDate();
32
+ }
33
+ function Y(e, t) {
34
+ const n = new Date(e);
35
+ return n.setFullYear(t), n;
36
+ }
37
+ function y(e, t) {
38
+ const n = new Date(e), r = n.getFullYear(), s = n.getDate(), a = new Date(e);
39
+ a.setFullYear(r, t, 15), a.setHours(0, 0, 0, 0);
40
+ const u = g(a);
41
+ return n.setMonth(t, Math.min(s, u)), n;
42
+ }
43
+ const w = (e) => {
44
+ const { disableFuture: t, disablePast: n, maxDateTime: r, minDateTime: s, shouldDisableDate: a } = e;
45
+ return (u, i) => {
46
+ const o = /* @__PURE__ */ new Date();
47
+ return a ? a(u) : t ? f(u) > o : n ? h(u) < o : s || r ? M(u, { min: s, max: r, withTime: i }) : !1;
48
+ };
49
+ }, d = (e) => {
50
+ const t = D(() => w(e), [
51
+ e.disableFuture,
52
+ e.disablePast,
53
+ e.shouldDisableDate,
54
+ e.minDateTime,
55
+ e.maxDateTime
56
+ ]);
57
+ return c(t, [t]);
58
+ };
59
+ export {
60
+ m as addMonths,
61
+ w as createDayDisableChecker,
62
+ h as endOfDay,
63
+ M as isDayMinMaxRestricted,
64
+ l as isSameDate,
65
+ y as setMonth,
66
+ Y as setYear,
67
+ f as startOfDay,
68
+ F as subMonths,
69
+ d as useDayDisableCheker
70
+ };
@@ -0,0 +1,34 @@
1
+ import { jsx as s, Fragment as p } from "react/jsx-runtime";
2
+ import { forwardRef as f, useState as u, useImperativeHandle as c } from "react";
3
+ import { AlertDialog as x } from "./bundle.es21.js";
4
+ const g = f((a, l) => {
5
+ const [i, n] = u([]);
6
+ c(
7
+ l,
8
+ () => ({
9
+ showAlert: (e) => {
10
+ n((t) => [...t, e]);
11
+ }
12
+ }),
13
+ []
14
+ );
15
+ const d = (e) => {
16
+ n((t) => {
17
+ const r = [...t], o = r.findIndex((m) => m.id === e);
18
+ return o !== -1 && r.splice(o, 1), r;
19
+ });
20
+ };
21
+ return /* @__PURE__ */ s(p, { children: i.map(({ id: e, ...t }) => /* @__PURE__ */ s(
22
+ x,
23
+ {
24
+ defaultOpen: !0,
25
+ onUnMounted: () => d(e),
26
+ ...a,
27
+ ...t
28
+ },
29
+ `alert-${e}`
30
+ )) });
31
+ });
32
+ export {
33
+ g as Viewport
34
+ };
@@ -0,0 +1,70 @@
1
+ import { jsxs as T, jsx as $ } from "react/jsx-runtime";
2
+ import { forwardRef as b, useState as I, useMemo as P, useImperativeHandle as R, useCallback as j, createElement as k } from "react";
3
+ import * as c from "@radix-ui/react-toast";
4
+ import { varToStyle as w } from "@companix/utils-browser";
5
+ import { Toast as C } from "./bundle.es53.js";
6
+ var g = /* @__PURE__ */ ((e) => (e["top-center"] = "up", e["top-left"] = "left", e["top-right"] = "right", e["bottom-center"] = "down", e["bottom-left"] = "left", e["bottom-right"] = "right", e))(g || {});
7
+ const M = b((e, h) => {
8
+ const { side: f = "top", align: i = "center", gap: m = 14, duration: u, swipeThreshold: v, closeIcon: x } = e, [l, p] = I([]), o = P(() => ({}), []);
9
+ R(
10
+ h,
11
+ () => ({
12
+ addToast: (t) => {
13
+ p((r) => [...r, t]);
14
+ }
15
+ }),
16
+ []
17
+ );
18
+ const d = j((t) => {
19
+ t.forEach(({ id: r }, a) => {
20
+ let s = 0;
21
+ for (let n = a + 1; n < t.length; n++)
22
+ o[t[n].id] && (s += o[t[n].id].clientHeight + m);
23
+ o[r] && o[r].style.setProperty("--offset", `${s}px`);
24
+ });
25
+ }, []), y = (t) => {
26
+ p((r) => {
27
+ const a = [...r], s = a.findIndex((n) => n.id === t);
28
+ return s !== -1 && a.splice(s, 1), a;
29
+ });
30
+ };
31
+ return /* @__PURE__ */ T(
32
+ c.Provider,
33
+ {
34
+ duration: u,
35
+ swipeThreshold: v,
36
+ swipeDirection: g[`${f}-${i}`],
37
+ children: [
38
+ l.map(({ id: t, ...r }) => /* @__PURE__ */ k(
39
+ C,
40
+ {
41
+ ...r,
42
+ key: `toaster-${t}`,
43
+ closeIcon: x,
44
+ onInitialized: (a) => {
45
+ o[t] = a, d(l);
46
+ },
47
+ onRemoving: () => {
48
+ delete o[t], d(l);
49
+ },
50
+ onRemoved: () => {
51
+ o[t] && delete o[t], y(t);
52
+ }
53
+ }
54
+ )),
55
+ /* @__PURE__ */ $(
56
+ c.Viewport,
57
+ {
58
+ "data-side": f,
59
+ "data-align": i,
60
+ className: "toaster-viewport",
61
+ style: w({ "--toasters-gap": `${m}px` })
62
+ }
63
+ )
64
+ ]
65
+ }
66
+ );
67
+ });
68
+ export {
69
+ M as Viewport
70
+ };
@@ -0,0 +1,88 @@
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ /* empty css */
3
+ import I from "classnames";
4
+ import { forwardRef as S } from "react";
5
+ import { varToStyle as r, px as i } from "@companix/utils-browser";
6
+ const E = S((t, c) => {
7
+ let {
8
+ interactionKind: m = "static",
9
+ thumbPos: g = "center",
10
+ thumbPadding: l = 4,
11
+ heightAuto: s,
12
+ scrollX: h,
13
+ className: p,
14
+ scrollY: n,
15
+ onWheel: b,
16
+ maxHeight: d,
17
+ onScroll: f,
18
+ thumbColor: u,
19
+ children: w
20
+ } = t;
21
+ const x = (() => {
22
+ if (t.implementation === "edge") {
23
+ l = 0;
24
+ const { padding: o, scrollbarWidth: e } = t;
25
+ return {
26
+ ...r({ "--scrollbar-width": i(e) }),
27
+ padding: `0px ${o - e}px 0px ${o}px`
28
+ };
29
+ }
30
+ if (t.implementation === "outer") {
31
+ const { shadowPadding: o = 0, noneCorrect: e, scrollbarWidth: a } = t;
32
+ return window.IS_MOBILE ? {
33
+ padding: o,
34
+ margin: -o
35
+ } : {
36
+ ...r({ "--scrollbar-width": i(a) }),
37
+ padding: o,
38
+ margin: -o,
39
+ marginRight: e ? void 0 : `calc(-${a}px - ${o}px)`,
40
+ marginBottom: 0
41
+ };
42
+ }
43
+ if (t.implementation === "inner") {
44
+ const { padding: o } = t;
45
+ return window.IS_MOBILE ? {
46
+ [n ? "paddingLeft" : "paddingTop"]: o,
47
+ [n ? "paddingRight" : "paddingBottom"]: o
48
+ } : {
49
+ [n ? "paddingLeft" : "paddingTop"]: o,
50
+ ...r({ "--scrollbar-width": i(o) })
51
+ };
52
+ }
53
+ return {};
54
+ })();
55
+ return /* @__PURE__ */ v(
56
+ "div",
57
+ {
58
+ ref: c,
59
+ onWheel: b,
60
+ onScroll: f,
61
+ onMouseDown: (o) => {
62
+ o.preventDefault();
63
+ },
64
+ style: {
65
+ ...x,
66
+ ...t.style,
67
+ maxHeight: d ? i(d) : void 0,
68
+ ...r({ "--thumb-padding": i(l) }),
69
+ ...r({ "--thumb-color": u ?? "#c1c2c8bd" })
70
+ },
71
+ className: I(
72
+ !window.IS_MOBILE && "scrollable",
73
+ p,
74
+ s ? "" : "h-full",
75
+ {
76
+ "overflow-y-scroll": n,
77
+ "overflow-x-scroll": h,
78
+ "scrollable-hover-interaction": m === "hover",
79
+ "scrollable-border-position": g === "border"
80
+ }
81
+ ),
82
+ children: w
83
+ }
84
+ );
85
+ });
86
+ export {
87
+ E as Scrollable
88
+ };
@@ -0,0 +1,33 @@
1
+ import { clamp as a } from "@companix/utils-browser";
2
+ const D = (t, e) => new Date(e, t, 0).getDate(), g = (t, e) => new Date(e, t - 1, 1).getDay(), i = (t) => t === 0 ? 6 : t - 1, u = (t) => new Array(t).fill(0), h = (t) => ({
3
+ day: t.getDate(),
4
+ month: t.getMonth() + 1,
5
+ year: t.getFullYear()
6
+ }), y = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], s = 9999, c = 100, f = (t, e) => {
7
+ const o = [], n = a(t - e, c, s), l = a(t + e, c, s);
8
+ for (let r = n; r <= l; r++)
9
+ o.push({ title: String(r).padStart(4, "0"), value: r });
10
+ return o;
11
+ }, p = (t) => {
12
+ const e = [], o = new Intl.DateTimeFormat(t, {
13
+ month: "long"
14
+ });
15
+ for (let n = 0; n < 12; n++)
16
+ e.push({
17
+ title: o.format(new Date(2023, n, 15)),
18
+ value: n
19
+ });
20
+ return e;
21
+ };
22
+ export {
23
+ s as DEFAULT_MAX_YEAR,
24
+ c as DEFAULT_MIN_YEAR,
25
+ u as createVoids,
26
+ h as dateToFormat,
27
+ i as getDayIndex,
28
+ g as getFirstDay,
29
+ D as getMonthMaxDay,
30
+ p as getMonths,
31
+ f as getYears,
32
+ y as weeks
33
+ };
@@ -0,0 +1,78 @@
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import { useCallback as u, useMemo as h } from "react";
3
+ /* empty css */
4
+ import { Select as p } from "./bundle.es10.js";
5
+ import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es50.js";
6
+ import { Icon as C } from "./bundle.es37.js";
7
+ import { faChevronLeft as E, faChevronRight as T } from "@fortawesome/free-solid-svg-icons";
8
+ import { setMonth as _, setYear as F } from "./bundle.es47.js";
9
+ const S = ({
10
+ viewDate: n,
11
+ onChange: c,
12
+ isMonthDisabled: a,
13
+ isYearDisabled: m,
14
+ onNextMonth: N,
15
+ onPrevMonth: v
16
+ }) => {
17
+ const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
18
+ (t) => {
19
+ c(_(n, t));
20
+ },
21
+ [c, n]
22
+ ), x = u(
23
+ (t) => {
24
+ c(F(n, t));
25
+ },
26
+ [c, n]
27
+ ), A = h(() => k(s).map((t) => ({
28
+ ...t,
29
+ className: "capitalize",
30
+ disabled: a && a(t.value)
31
+ })), [s, a]), Y = h(() => z(e, 100).map((t) => ({
32
+ ...t,
33
+ disabled: m && m(t.value)
34
+ })), [e, m]);
35
+ let l = r === 11 && e === f;
36
+ a && !l && (l = a(
37
+ r === 11 ? 0 : r + 1,
38
+ r === 11 ? Math.min(e + 1, f) : e
39
+ ));
40
+ let i = r === 0 && e === g;
41
+ return a && !i && (i = a(
42
+ r === 0 ? 11 : r - 1,
43
+ r === 0 ? Math.max(e - 1, g) : e
44
+ )), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
45
+ !i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
46
+ /* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
47
+ /* @__PURE__ */ o(
48
+ p,
49
+ {
50
+ fill: !0,
51
+ options: Y,
52
+ size: "sm",
53
+ value: e,
54
+ minimalOptions: !0,
55
+ matchTarget: "min-width",
56
+ onChange: (t) => x(t || 0)
57
+ }
58
+ ),
59
+ /* @__PURE__ */ o(
60
+ p,
61
+ {
62
+ fill: !0,
63
+ options: A,
64
+ size: "sm",
65
+ className: "capitalize",
66
+ value: r,
67
+ minimalOptions: !0,
68
+ matchTarget: "min-width",
69
+ onChange: (t) => M(t || 0)
70
+ }
71
+ )
72
+ ] }),
73
+ !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
74
+ ] });
75
+ };
76
+ export {
77
+ S as CalendarHeader
78
+ };
@@ -0,0 +1,51 @@
1
+ import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es47.js";
2
+ import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es50.js";
3
+ import { useState as U, useCallback as M } from "react";
4
+ const X = ({
5
+ value: p,
6
+ disablePast: r,
7
+ disableFuture: c,
8
+ shouldDisableDate: E,
9
+ minDateTime: l,
10
+ maxDateTime: s
11
+ }) => {
12
+ const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
13
+ u(L(e));
14
+ }, [e]), C = M(() => {
15
+ u(N(e, 1));
16
+ }, [e]), D = R({
17
+ disableFuture: c,
18
+ disablePast: r,
19
+ shouldDisableDate: E,
20
+ minDateTime: l,
21
+ maxDateTime: s
22
+ }), k = M(
23
+ (o, t) => {
24
+ const n = /* @__PURE__ */ new Date();
25
+ t = t || e.getFullYear();
26
+ const h = l ? l.getMonth() : 0, Y = s ? s.getMonth() : 11, F = l?.getFullYear() || w, f = s?.getFullYear() || A;
27
+ let g = t >= F && t <= f ? t === F && h > o || t === f && o > Y : !0;
28
+ return c && (g = g || (t === n.getFullYear() ? o > n.getMonth() : t > n.getFullYear())), r && (g = g || (t === n.getFullYear() ? o < n.getMonth() : t < n.getFullYear())), g;
29
+ },
30
+ [c, r, e, l, s]
31
+ ), v = M(
32
+ (o) => {
33
+ const t = /* @__PURE__ */ new Date(), n = l?.getFullYear() || w, h = s?.getFullYear() || A;
34
+ let Y = n > o || o > h;
35
+ return c && (Y = Y || o > t.getFullYear()), r && (Y = Y || o < t.getFullYear()), Y;
36
+ },
37
+ [c, r, l, s]
38
+ );
39
+ return {
40
+ viewDate: e,
41
+ setViewDate: u,
42
+ setPrevMonth: _,
43
+ setNextMonth: C,
44
+ isDayDisabled: D,
45
+ isMonthDisabled: k,
46
+ isYearDisabled: v
47
+ };
48
+ };
49
+ export {
50
+ X as useCalendar
51
+ };
@@ -0,0 +1,45 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-toast";
3
+ import { attr as C } from "@companix/utils-browser";
4
+ import { useState as h, useRef as v, useEffect as N, useLayoutEffect as x } from "react";
5
+ import { RemoveListener as R } from "./bundle.es43.js";
6
+ const E = (i) => {
7
+ const [c, l] = h(!1), o = v(null), {
8
+ appearance: d = "neutral",
9
+ icon: r,
10
+ title: a,
11
+ description: s,
12
+ duration: m,
13
+ closeIcon: u,
14
+ onRemoving: p,
15
+ onRemoved: f,
16
+ onInitialized: L
17
+ } = i;
18
+ return N(() => {
19
+ l(!0);
20
+ }, []), x(() => {
21
+ o.current && L(o.current);
22
+ }, []), /* @__PURE__ */ n(
23
+ t.Root,
24
+ {
25
+ ref: o,
26
+ "data-expanded": !0,
27
+ "data-appearance": d,
28
+ "data-mounted": C(c),
29
+ className: "toaster",
30
+ duration: m,
31
+ children: [
32
+ /* @__PURE__ */ e(R, { callback: f }),
33
+ r && /* @__PURE__ */ e("div", { className: "toaster-icon", children: r }),
34
+ /* @__PURE__ */ n("div", { className: "toaster-content", children: [
35
+ a && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: a }),
36
+ s && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: s })
37
+ ] }),
38
+ /* @__PURE__ */ e(t.Close, { className: "toaster-close", onClick: p, children: u ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) })
39
+ ]
40
+ }
41
+ );
42
+ };
43
+ export {
44
+ E as Toast
45
+ };
@@ -0,0 +1,40 @@
1
+ import { getOwnerWindow as l } from "./bundle.es62.js";
2
+ import { focusWithoutScrolling as f } from "./bundle.es64.js";
3
+ import { isFocusable as p } from "./bundle.es72.js";
4
+ import "react";
5
+ function E(t) {
6
+ let e = t;
7
+ return e.nativeEvent = t, e.isDefaultPrevented = () => e.defaultPrevented, e.isPropagationStopped = () => e.cancelBubble, e.persist = () => {
8
+ }, e;
9
+ }
10
+ function P(t, e) {
11
+ Object.defineProperty(t, "target", {
12
+ value: e
13
+ }), Object.defineProperty(t, "currentTarget", {
14
+ value: e
15
+ });
16
+ }
17
+ function L(t) {
18
+ for (; t && !p(t); ) t = t.parentElement;
19
+ let e = l(t), n = e.document.activeElement;
20
+ if (!n || n === t) return;
21
+ let o = !1, i = (r) => {
22
+ (r.target === n || o) && r.stopImmediatePropagation();
23
+ }, c = (r) => {
24
+ (r.target === n || o) && (r.stopImmediatePropagation(), !t && !o && (o = !0, f(n), a()));
25
+ }, u = (r) => {
26
+ (r.target === t || o) && r.stopImmediatePropagation();
27
+ }, s = (r) => {
28
+ (r.target === t || o) && (r.stopImmediatePropagation(), o || (o = !0, f(n), a()));
29
+ };
30
+ e.addEventListener("blur", i, !0), e.addEventListener("focusout", c, !0), e.addEventListener("focusin", s, !0), e.addEventListener("focus", u, !0);
31
+ let a = () => {
32
+ cancelAnimationFrame(d), e.removeEventListener("blur", i, !0), e.removeEventListener("focusout", c, !0), e.removeEventListener("focusin", s, !0), e.removeEventListener("focus", u, !0), o = !1;
33
+ }, d = requestAnimationFrame(a);
34
+ return a;
35
+ }
36
+ export {
37
+ E as createSyntheticEvent,
38
+ L as preventFocus,
39
+ P as setEventTarget
40
+ };
@@ -0,0 +1,36 @@
1
+ import { getOwnerDocument as i } from "./bundle.es62.js";
2
+ import { runAfterTransition as f } from "./bundle.es73.js";
3
+ import { isIOS as o } from "./bundle.es69.js";
4
+ let l = "default", s = "", n = /* @__PURE__ */ new WeakMap();
5
+ function m(e) {
6
+ if (o()) {
7
+ if (l === "default") {
8
+ const t = i(e);
9
+ s = t.documentElement.style.webkitUserSelect, t.documentElement.style.webkitUserSelect = "none";
10
+ }
11
+ l = "disabled";
12
+ } else if (e instanceof HTMLElement || e instanceof SVGElement) {
13
+ let t = "userSelect" in e.style ? "userSelect" : "webkitUserSelect";
14
+ n.set(e, e.style[t]), e.style[t] = "none";
15
+ }
16
+ }
17
+ function $(e) {
18
+ if (o()) {
19
+ if (l !== "disabled") return;
20
+ l = "restoring", setTimeout(() => {
21
+ f(() => {
22
+ if (l === "restoring") {
23
+ const t = i(e);
24
+ t.documentElement.style.webkitUserSelect === "none" && (t.documentElement.style.webkitUserSelect = s || ""), s = "", l = "default";
25
+ }
26
+ });
27
+ }, 300);
28
+ } else if ((e instanceof HTMLElement || e instanceof SVGElement) && e && n.has(e)) {
29
+ let t = n.get(e), c = "userSelect" in e.style ? "userSelect" : "webkitUserSelect";
30
+ e.style[c] === "none" && (e.style[c] = t), e.getAttribute("style") === "" && e.removeAttribute("style"), n.delete(e);
31
+ }
32
+ }
33
+ export {
34
+ m as disableTextSelection,
35
+ $ as restoreTextSelection
36
+ };
@@ -0,0 +1,9 @@
1
+ import e from "react";
2
+ const t = e.createContext({
3
+ register: () => {
4
+ }
5
+ });
6
+ t.displayName = "PressResponderContext";
7
+ export {
8
+ t as PressResponderContext
9
+ };
@@ -0,0 +1,9 @@
1
+ import { _ as s } from "./bundle.es74.js";
2
+ import { _ as a } from "./bundle.es75.js";
3
+ function p(_, r) {
4
+ var t = a(_, r, "get");
5
+ return s(_, t);
6
+ }
7
+ export {
8
+ p as _
9
+ };
@@ -0,0 +1,7 @@
1
+ import { _ as t } from "./bundle.es76.js";
2
+ function a(_, e, i) {
3
+ t(_, e), e.set(_, i);
4
+ }
5
+ export {
6
+ a as _
7
+ };
@@ -0,0 +1,9 @@
1
+ import { _ as a } from "./bundle.es77.js";
2
+ import { _ as o } from "./bundle.es75.js";
3
+ function i(s, r, _) {
4
+ var t = o(s, r, "set");
5
+ return a(s, t, _), _;
6
+ }
7
+ export {
8
+ i as _
9
+ };