@companix/uikit 0.0.34 → 0.0.36

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 (184) hide show
  1. package/package.json +7 -10
  2. package/dist/Avatar/Avatar.scss +0 -64
  3. package/dist/Avatar/helpers.d.ts +0 -10
  4. package/dist/Avatar/index.d.ts +0 -8
  5. package/dist/Avatar/types.d.ts +0 -2
  6. package/dist/Button/Button.scss +0 -128
  7. package/dist/Button/index.d.ts +0 -21
  8. package/dist/ButtonGroup/ButtonGroup.scss +0 -18
  9. package/dist/ButtonGroup/index.d.ts +0 -6
  10. package/dist/Calendar/Calendar.d.ts +0 -14
  11. package/dist/Calendar/Calendar.scss +0 -125
  12. package/dist/Calendar/CalendarHeader.d.ts +0 -10
  13. package/dist/Checkbox/Checkbox.scss +0 -115
  14. package/dist/Checkbox/index.d.ts +0 -10
  15. package/dist/Countdown/index.d.ts +0 -6
  16. package/dist/DateInput/DateInput.scss +0 -11
  17. package/dist/DateInput/index.d.ts +0 -13
  18. package/dist/DatePicker/index.d.ts +0 -9
  19. package/dist/Dialog/Dialog.scss +0 -25
  20. package/dist/Dialog/Popup.scss +0 -55
  21. package/dist/Dialog/index.d.ts +0 -16
  22. package/dist/DialogAlert/Alert.d.ts +0 -19
  23. package/dist/DialogAlert/Alert.scss +0 -52
  24. package/dist/DialogAlert/Viewport.d.ts +0 -8
  25. package/dist/DialogAlert/index.d.ts +0 -11
  26. package/dist/Drawer/Drawer.scss +0 -112
  27. package/dist/Drawer/index.d.ts +0 -13
  28. package/dist/File/index.d.ts +0 -10
  29. package/dist/FormGroup/FormGroup.scss +0 -32
  30. package/dist/FormGroup/index.d.ts +0 -9
  31. package/dist/Icon/icon.scss +0 -18
  32. package/dist/Icon/index.d.ts +0 -6
  33. package/dist/Input/Form.scss +0 -67
  34. package/dist/Input/InlineInput.d.ts +0 -0
  35. package/dist/Input/Input.d.ts +0 -14
  36. package/dist/Input/Input.scss +0 -47
  37. package/dist/Input/InputContainer.d.ts +0 -11
  38. package/dist/Input/InputElement.d.ts +0 -9
  39. package/dist/LoadingButton/index.d.ts +0 -5
  40. package/dist/NumberInput/index.d.ts +0 -23
  41. package/dist/OptionItem/Option.scss +0 -89
  42. package/dist/OptionItem/OptionItem.d.ts +0 -6
  43. package/dist/OptionItem/OptionsList.d.ts +0 -7
  44. package/dist/Popover/Popover.scss +0 -80
  45. package/dist/Popover/index.d.ts +0 -27
  46. package/dist/Progress/Progress.scss +0 -47
  47. package/dist/Progress/index.d.ts +0 -5
  48. package/dist/Radio/Radio.scss +0 -148
  49. package/dist/Radio/index.d.ts +0 -20
  50. package/dist/Scrollable/ImitateScroll.d.ts +0 -10
  51. package/dist/Scrollable/Scrollable.scss +0 -50
  52. package/dist/Scrollable/index.d.ts +0 -33
  53. package/dist/Segments/Segments.scss +0 -57
  54. package/dist/Segments/index.d.ts +0 -11
  55. package/dist/Select/Select.scss +0 -80
  56. package/dist/Select/SelectInput.d.ts +0 -15
  57. package/dist/Select/SelectOptions.d.ts +0 -12
  58. package/dist/Select/SelectRight.d.ts +0 -8
  59. package/dist/Select/index.d.ts +0 -24
  60. package/dist/SelectTags/SelectTags.scss +0 -67
  61. package/dist/SelectTags/index.d.ts +0 -17
  62. package/dist/Spinner/Spinner.scss +0 -14
  63. package/dist/Spinner/index.d.ts +0 -7
  64. package/dist/Switch/Switch.scss +0 -102
  65. package/dist/Switch/index.d.ts +0 -10
  66. package/dist/Tabs/Tabs.scss +0 -58
  67. package/dist/Tabs/index.d.ts +0 -13
  68. package/dist/TextArea/TextArea.scss +0 -34
  69. package/dist/TextArea/index.d.ts +0 -7
  70. package/dist/ThemeProvider/helpers.d.ts +0 -4
  71. package/dist/ThemeProvider/index.d.ts +0 -12
  72. package/dist/ThemeProvider/script.d.ts +0 -8
  73. package/dist/ThemeProvider/types.d.ts +0 -2
  74. package/dist/TimePicker/index.d.ts +0 -10
  75. package/dist/Toaster/Toast.d.ts +0 -15
  76. package/dist/Toaster/Toaster.scss +0 -155
  77. package/dist/Toaster/Viewport.d.ts +0 -13
  78. package/dist/Toaster/index.d.ts +0 -20
  79. package/dist/Tooltip/Tooltip.scss +0 -28
  80. package/dist/Tooltip/index.d.ts +0 -7
  81. package/dist/__helpers/createDialogRegistry.d.ts +0 -26
  82. package/dist/__helpers/createPopoversRegistry.d.ts +0 -19
  83. package/dist/__hooks/use-frooze-closing.d.ts +0 -5
  84. package/dist/__hooks/use-input-padding.d.ts +0 -5
  85. package/dist/__hooks/use-loading.d.ts +0 -8
  86. package/dist/__hooks/use-local-storage.d.ts +0 -1
  87. package/dist/__hooks/use-popover-position.d.ts +0 -8
  88. package/dist/__hooks/use-previos.d.ts +0 -2
  89. package/dist/__hooks/use-resize.d.ts +0 -3
  90. package/dist/__hooks/use-scrollbox.d.ts +0 -7
  91. package/dist/__hooks/use-update.d.ts +0 -1
  92. package/dist/__hooks/useCalendar.d.ts +0 -17
  93. package/dist/__hooks/useCalendarOptions-copy.d.ts +0 -22
  94. package/dist/__hooks/useCalendarOptions.d.ts +0 -31
  95. package/dist/__libs/calendar.d.ts +0 -25
  96. package/dist/__utils/RemoveListener.d.ts +0 -3
  97. package/dist/__utils/utils.d.ts +0 -39
  98. package/dist/bundle.es.js +0 -88
  99. package/dist/bundle.es10.js +0 -82
  100. package/dist/bundle.es11.js +0 -28
  101. package/dist/bundle.es12.js +0 -77
  102. package/dist/bundle.es13.js +0 -43
  103. package/dist/bundle.es14.js +0 -38
  104. package/dist/bundle.es15.js +0 -58
  105. package/dist/bundle.es16.js +0 -23
  106. package/dist/bundle.es17.js +0 -35
  107. package/dist/bundle.es18.js +0 -27
  108. package/dist/bundle.es19.js +0 -47
  109. package/dist/bundle.es2.js +0 -44
  110. package/dist/bundle.es20.js +0 -25
  111. package/dist/bundle.es21.js +0 -31
  112. package/dist/bundle.es22.js +0 -40
  113. package/dist/bundle.es23.js +0 -18
  114. package/dist/bundle.es24.js +0 -36
  115. package/dist/bundle.es25.js +0 -23
  116. package/dist/bundle.es26.js +0 -44
  117. package/dist/bundle.es27.js +0 -118
  118. package/dist/bundle.es28.js +0 -123
  119. package/dist/bundle.es29.js +0 -76
  120. package/dist/bundle.es3.js +0 -4
  121. package/dist/bundle.es30.js +0 -35
  122. package/dist/bundle.es31.js +0 -14
  123. package/dist/bundle.es32.js +0 -88
  124. package/dist/bundle.es33.js +0 -24
  125. package/dist/bundle.es34.js +0 -9
  126. package/dist/bundle.es35.js +0 -37
  127. package/dist/bundle.es36.js +0 -24
  128. package/dist/bundle.es37.js +0 -13
  129. package/dist/bundle.es38.js +0 -27
  130. package/dist/bundle.es39.js +0 -41
  131. package/dist/bundle.es4.js +0 -47
  132. package/dist/bundle.es40.js +0 -53
  133. package/dist/bundle.es41.js +0 -45
  134. package/dist/bundle.es42.js +0 -11
  135. package/dist/bundle.es43.js +0 -27
  136. package/dist/bundle.es44.js +0 -26
  137. package/dist/bundle.es45.js +0 -89
  138. package/dist/bundle.es46.js +0 -20
  139. package/dist/bundle.es47.js +0 -22
  140. package/dist/bundle.es48.js +0 -26
  141. package/dist/bundle.es49.js +0 -41
  142. package/dist/bundle.es5.js +0 -10
  143. package/dist/bundle.es50.js +0 -5
  144. package/dist/bundle.es51.js +0 -7
  145. package/dist/bundle.es52.js +0 -16
  146. package/dist/bundle.es53.js +0 -16
  147. package/dist/bundle.es54.js +0 -5
  148. package/dist/bundle.es55.js +0 -5
  149. package/dist/bundle.es56.js +0 -72
  150. package/dist/bundle.es57.js +0 -70
  151. package/dist/bundle.es58.js +0 -72
  152. package/dist/bundle.es59.js +0 -14
  153. package/dist/bundle.es6.js +0 -13
  154. package/dist/bundle.es60.js +0 -45
  155. package/dist/bundle.es61.js +0 -17
  156. package/dist/bundle.es62.js +0 -34
  157. package/dist/bundle.es63.js +0 -72
  158. package/dist/bundle.es64.js +0 -78
  159. package/dist/bundle.es65.js +0 -51
  160. package/dist/bundle.es66.js +0 -16
  161. package/dist/bundle.es67.js +0 -22
  162. package/dist/bundle.es68.js +0 -4
  163. package/dist/bundle.es69.js +0 -22
  164. package/dist/bundle.es7.js +0 -87
  165. package/dist/bundle.es70.js +0 -4
  166. package/dist/bundle.es71.js +0 -23
  167. package/dist/bundle.es72.js +0 -4
  168. package/dist/bundle.es73.js +0 -22
  169. package/dist/bundle.es74.js +0 -5
  170. package/dist/bundle.es75.js +0 -5
  171. package/dist/bundle.es76.js +0 -16
  172. package/dist/bundle.es77.js +0 -4
  173. package/dist/bundle.es78.js +0 -22
  174. package/dist/bundle.es79.js +0 -4
  175. package/dist/bundle.es8.js +0 -87
  176. package/dist/bundle.es80.js +0 -22
  177. package/dist/bundle.es81.js +0 -4
  178. package/dist/bundle.es9.js +0 -24
  179. package/dist/css-properties.scss +0 -120
  180. package/dist/index.d.ts +0 -77
  181. package/dist/index.scss +0 -28
  182. package/dist/mixins.scss +0 -102
  183. package/dist/theme.scss +0 -101
  184. package/dist/types.d.ts +0 -17
@@ -1,26 +0,0 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as m, useCallback as i } from "react";
3
- import c from "react-input-mask";
4
- const I = m(
5
- ({ mask: r, maskChar: f = "_", onChange: n, onValueChange: o, ...a }, e) => {
6
- const p = i(
7
- (t) => {
8
- n?.(t), o?.(t.target.value, t.target);
9
- },
10
- [n, o]
11
- );
12
- return r ? /* @__PURE__ */ u(
13
- c,
14
- {
15
- inputRef: e,
16
- mask: r,
17
- maskChar: f,
18
- onChange: p,
19
- ...a
20
- }
21
- ) : /* @__PURE__ */ u("input", { ref: e, ...a, onChange: p });
22
- }
23
- );
24
- export {
25
- I as InputElement
26
- };
@@ -1,41 +0,0 @@
1
- import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
- import h from "classnames";
3
- import { attr as e } from "@companix/utils-browser";
4
- import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es66.js";
6
- const v = x(
7
- ({
8
- required: s,
9
- disabled: t,
10
- size: i,
11
- fill: d,
12
- leftElement: r,
13
- rightElement: a,
14
- className: f,
15
- inputRef: m,
16
- children: n,
17
- ...p
18
- }, c) => {
19
- const { leftRef: l, rightRef: u } = N(m, [r, a]);
20
- return /* @__PURE__ */ b(
21
- "div",
22
- {
23
- ref: c,
24
- className: h("form", f),
25
- "data-size": i ?? "md",
26
- "data-fill": e(d),
27
- "data-required": e(s),
28
- "data-disabled": e(t),
29
- ...p,
30
- children: [
31
- r && /* @__PURE__ */ o("span", { ref: l, className: "form-input-base-left-element", children: r }),
32
- n,
33
- a && /* @__PURE__ */ o("span", { ref: u, className: "form-input-base-right-element", children: a })
34
- ]
35
- }
36
- );
37
- }
38
- );
39
- export {
40
- v as InputContainer
41
- };
@@ -1,10 +0,0 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import a from "classnames";
4
- import { attr as i } from "@companix/utils-browser";
5
- const c = p(
6
- ({ children: r, className: o, fill: t }, m) => /* @__PURE__ */ f("div", { ref: m, className: a("button-group", o), "data-fill": i(t), children: r })
7
- );
8
- export {
9
- c as ButtonGroup
10
- };
@@ -1,5 +0,0 @@
1
- import { __require as r } from "./bundle.es67.js";
2
- var a = /* @__PURE__ */ r();
3
- export {
4
- a as f
5
- };
@@ -1,7 +0,0 @@
1
- import { useEffect as r } from "react";
2
- const n = ({ callback: e }) => (r(() => () => {
3
- e?.();
4
- }, []), null);
5
- export {
6
- n as RemoveListener
7
- };
@@ -1,16 +0,0 @@
1
- import { useState as e } from "react";
2
- const d = ({ onClick: t }) => {
3
- const [a, s] = e({ isLoading: !1, isError: !1 });
4
- return { ...a, handleClick: (r) => {
5
- a.isLoading || t(() => {
6
- s({ isLoading: !0, isError: !1 });
7
- }, r).then(() => {
8
- s({ isLoading: !1, isError: !1 });
9
- }).catch(() => {
10
- s({ isLoading: !1, isError: !0 });
11
- });
12
- } };
13
- };
14
- export {
15
- d as useLoading
16
- };
@@ -1,16 +0,0 @@
1
- import { useRef as i, useCallback as o } from "react";
2
- const f = (e, s) => {
3
- const r = i(null), c = i(void 0), n = o(
4
- (t) => {
5
- s && t.offsetParent && (t.style.height = "", t.style.height = `${t.scrollHeight}px`, t.scrollHeight !== c.current && e && (e(t), c.current = t.scrollHeight));
6
- },
7
- [s, e]
8
- ), l = o(() => {
9
- const t = r.current;
10
- t && n(t);
11
- }, [r, n]);
12
- return [r, l];
13
- };
14
- export {
15
- f as useResizeTextarea
16
- };
@@ -1,5 +0,0 @@
1
- import { __require as r } from "./bundle.es69.js";
2
- var e = /* @__PURE__ */ r();
3
- export {
4
- e as f
5
- };
@@ -1,5 +0,0 @@
1
- import { __require as r } from "./bundle.es71.js";
2
- var o = /* @__PURE__ */ r();
3
- export {
4
- o as f
5
- };
@@ -1,72 +0,0 @@
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.es58.js";
3
- import { CalendarHeader as F } from "./bundle.es64.js";
4
- import { useCalendar as j } from "./bundle.es65.js";
5
- import { attr as m } from "@companix/utils-browser";
6
- import { isSameDate as f } from "./bundle.es57.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
- };
@@ -1,70 +0,0 @@
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
- };
@@ -1,72 +0,0 @@
1
- import { clamp as m } from "@companix/utils-browser";
2
- import { formatTime as i } from "@companix/utils-js";
3
- const g = (n, r) => new Date(r, n, 0).getDate(), u = (n, r) => new Date(r, n - 1, 1).getDay(), D = (n) => n === 0 ? 6 : n - 1, d = (n) => new Array(n).fill(0), T = (n) => ({
4
- day: n.getDate(),
5
- month: n.getMonth() + 1,
6
- year: n.getFullYear()
7
- }), p = ({ min: n, max: r }) => (t) => {
8
- if (n.year === t.year) {
9
- if (t.month !== 0 && t.month < n.month)
10
- return t.month = 0, t.day = 0, t;
11
- if (t.month === n.month && t.day < n.day && t.day !== 0)
12
- return t.day = 0, t;
13
- }
14
- if (r.year === t.year) {
15
- if (t.month !== 0 && t.month > r.month)
16
- return t.month = 0, t.day = 0, t;
17
- if (t.month === r.month && t.day > r.day && t.day !== 0)
18
- return t.day = 0, t;
19
- }
20
- }, A = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"], M = [
21
- "Январь",
22
- "Февраль",
23
- "Март",
24
- "Апрель",
25
- "Май",
26
- "Июнь",
27
- "Июль",
28
- "Август",
29
- "Сентябрь",
30
- "Октябрь",
31
- "Ноябрь",
32
- "Декабрь"
33
- ], c = 9999, a = 100, w = (n, r) => {
34
- const t = [], o = m(n - r, a, c), e = m(n + r, a, c);
35
- for (let s = o; s <= e; s++)
36
- t.push({ title: String(s).padStart(4, "0"), value: s });
37
- return t;
38
- }, F = (n) => {
39
- const r = [], t = new Intl.DateTimeFormat(n, {
40
- month: "long"
41
- });
42
- for (let o = 0; o < 12; o++)
43
- r.push({
44
- title: t.format(new Date(2023, o, 15)),
45
- value: o
46
- });
47
- return r;
48
- }, Y = (n, r) => r.reduce((t, o) => t.replaceAll(o, ""), n.trim()), E = ({ hours: n, minutes: r }, t = ":") => [i(n), i(r)].join(t), h = (n, r = ":") => {
49
- const [t, o] = [i(n.hours), i(n.minutes)], e = [t, o].join(r);
50
- return { title: e, value: e, hours: t, minutes: o };
51
- }, _ = (n, r = ":") => {
52
- const t = { minutes: -n, hours: 0 };
53
- return Array.from({ length: 1440 / n }).map(() => (t.minutes += n, t.minutes === 60 && (t.minutes = 0, t.hours++), h(t, r)));
54
- };
55
- export {
56
- c as DEFAULT_MAX_YEAR,
57
- a as DEFAULT_MIN_YEAR,
58
- M as DefaultMonths,
59
- E as convertTimeToOption,
60
- p as createDateValidation,
61
- d as createVoids,
62
- T as dateToFormat,
63
- D as getDayIndex,
64
- u as getFirstDay,
65
- g as getMonthMaxDay,
66
- F as getMonths,
67
- h as getTimeValue,
68
- _ as getTimesOptions,
69
- w as getYears,
70
- Y as removeDigits,
71
- A as weeks
72
- };
@@ -1,14 +0,0 @@
1
- import { jsxs as a, Fragment as l, jsx as o } from "react/jsx-runtime";
2
- import { f as i } from "./bundle.es55.js";
3
- import { f as m } from "./bundle.es54.js";
4
- import { Icon as e } from "./bundle.es33.js";
5
- const C = (s) => {
6
- const { clearButton: n, clearButtonIcon: t, value: c, onClear: r } = s;
7
- return /* @__PURE__ */ a(l, { children: [
8
- n && c && /* @__PURE__ */ o("button", { className: "select-close-button", onClick: r, children: t ?? /* @__PURE__ */ o(e, { className: "select-close-icon", icon: i.faClose, size: "xxxs" }) }),
9
- /* @__PURE__ */ o(e, { className: "expand-icon select-expand", icon: m.faChevronDown, size: "xxxs" })
10
- ] });
11
- };
12
- export {
13
- C as SelectRightElements
14
- };
@@ -1,13 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import n from "classnames";
3
- const d = ({ size: r = 40, className: t, width: e = 2, color: i = "inherit" }) => /* @__PURE__ */ o(
4
- "div",
5
- {
6
- style: { width: `${r}px`, height: `${r}px`, color: i, borderWidth: `${e}px` },
7
- className: n("spinner-border", t),
8
- role: "status"
9
- }
10
- );
11
- export {
12
- d as Spinner
13
- };
@@ -1,45 +0,0 @@
1
- import { DefaultMonths as f, getMonthMaxDay as i } from "./bundle.es58.js";
2
- import { useMemo as s } from "react";
3
- import { range as l } from "@companix/utils-js";
4
- const p = { day: 31, month: 12, year: 2050 }, u = { day: 1, month: 1, year: 1900 }, I = ({ min: t = u, max: e = p, now: r }) => {
5
- const h = s(() => l(e.year, t.year).map((n) => ({
6
- title: n.toString(),
7
- value: n
8
- })), [e.year, t.year]), d = s(() => {
9
- const n = f.map((o, a) => ({
10
- title: o,
11
- value: a + 1
12
- }));
13
- if (t.month && r.year === t.year) {
14
- const o = n.findIndex(({ value: a }) => a === t.month);
15
- n.splice(0, o);
16
- }
17
- if (e.month && r.year === e.year) {
18
- const o = n.findIndex(({ value: a }) => a === e.month);
19
- n.splice(o + 1, n.length);
20
- }
21
- return n;
22
- }, [r.year, t.year, t.month, e.year, e.month]), c = s(() => {
23
- if (r.month === 0)
24
- return [];
25
- const n = i(r.month, r.year), o = Array.from({ length: n }, (a, y) => ({
26
- title: `${y + 1}`,
27
- value: y + 1
28
- }));
29
- if (t.day && r.month === t.month && r.year === t.year) {
30
- const a = o.findIndex(({ value: y }) => y === t.day);
31
- o.splice(0, a);
32
- }
33
- if (e.day && r.month === e.month && r.year === e.year) {
34
- const a = o.findIndex(({ value: y }) => y === e.day);
35
- o.splice(a + 1, o.length);
36
- }
37
- return o;
38
- }, [r.month, r.year, t, e]);
39
- return { years: h, months: d, days: c };
40
- };
41
- export {
42
- p as defaultMax,
43
- u as defaultMin,
44
- I as useCalendarOptions
45
- };
@@ -1,17 +0,0 @@
1
- const r = (e, o) => {
2
- let t;
3
- try {
4
- t = localStorage.getItem(e) || void 0;
5
- } catch {
6
- }
7
- return t ?? o;
8
- }, m = (e) => (e || (e = window.matchMedia("(prefers-color-scheme: dark)")), e.matches ? "dark" : "light"), s = (e) => {
9
- const [o, t] = ["theme-light", "theme-dark"];
10
- let c = e;
11
- e === "system" && (c = m()), document.documentElement.classList.remove(o, t), document.documentElement.classList.add(c === "dark" ? t : o), document.documentElement.style.colorScheme = c;
12
- };
13
- export {
14
- r as getColorScheme,
15
- m as getSystemColorScheme,
16
- s as updateDOM
17
- };
@@ -1,34 +0,0 @@
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.es22.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
- };
@@ -1,72 +0,0 @@
1
- import { jsxs as y, jsx as I } from "react/jsx-runtime";
2
- import { forwardRef as $, useState as b, useMemo as C, useImperativeHandle as w, useCallback as P, createElement as j } from "react";
3
- import * as c from "@radix-ui/react-toast";
4
- import { customCSS as k } from "@companix/utils-browser";
5
- import { Toast as E } from "./bundle.es40.js";
6
- var u = /* @__PURE__ */ ((r) => (r["top-center"] = "up", r["top-left"] = "left", r["top-right"] = "right", r["bottom-center"] = "down", r["bottom-left"] = "left", r["bottom-right"] = "right", r))(u || {});
7
- const M = $((r, h) => {
8
- const { side: l = "top", align: f = "center", gap: d = 14, duration: g, swipeThreshold: x, closeIcon: T } = r, [i, p] = b([]), a = C(() => ({}), []);
9
- w(
10
- h,
11
- () => ({
12
- showToast: (t) => {
13
- p((o) => {
14
- const e = [...o], n = o.findIndex((s) => s.id === t.id);
15
- return n === -1 ? e.push(t) : e[n] = t, e;
16
- });
17
- }
18
- }),
19
- []
20
- );
21
- const m = P((t) => {
22
- t.forEach(({ id: o }, e) => {
23
- let n = 0;
24
- for (let s = e + 1; s < t.length; s++)
25
- a[t[s].id] && (n += a[t[s].id].clientHeight + d);
26
- a[o] && a[o].style.setProperty("--offset", `${n}px`);
27
- });
28
- }, []), v = (t) => {
29
- p((o) => {
30
- const e = [...o], n = e.findIndex((s) => s.id === t);
31
- return n !== -1 && e.splice(n, 1), e;
32
- });
33
- };
34
- return /* @__PURE__ */ y(
35
- c.Provider,
36
- {
37
- swipeThreshold: x,
38
- swipeDirection: u[`${l}-${f}`],
39
- children: [
40
- i.map(({ id: t, ...o }) => /* @__PURE__ */ j(
41
- E,
42
- {
43
- ...o,
44
- id: t,
45
- key: `toaster-${t}`,
46
- duration: o.duration ?? g,
47
- closeIcon: T,
48
- onInitialized: (e) => {
49
- a[t] = e, m(i);
50
- },
51
- onClosing: () => {
52
- delete a[t], m(i);
53
- },
54
- onClosed: () => v(t)
55
- }
56
- )),
57
- /* @__PURE__ */ I(
58
- c.Viewport,
59
- {
60
- "data-side": l,
61
- "data-align": f,
62
- className: "toaster-viewport",
63
- style: k({ "--toasters-gap": `${d}px` })
64
- }
65
- )
66
- ]
67
- }
68
- );
69
- });
70
- export {
71
- M as Viewport
72
- };
@@ -1,78 +0,0 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { useCallback as h, useMemo as d } from "react";
3
- import { Select as p } from "./bundle.es12.js";
4
- import { getMonths as Y, getYears as k, DEFAULT_MAX_YEAR as u, DEFAULT_MIN_YEAR as g } from "./bundle.es58.js";
5
- import { Icon as C } from "./bundle.es33.js";
6
- import { f as z } from "./bundle.es74.js";
7
- import { f as L } from "./bundle.es75.js";
8
- import { setMonth as R, setYear as T } from "./bundle.es57.js";
9
- const S = ({
10
- viewDate: n,
11
- onChange: m,
12
- isMonthDisabled: a,
13
- isYearDisabled: c,
14
- onNextMonth: v,
15
- onPrevMonth: x
16
- }) => {
17
- const r = n.getFullYear(), e = n.getMonth(), i = "ru", N = h(
18
- (t) => {
19
- m(R(n, t));
20
- },
21
- [m, n]
22
- ), E = h(
23
- (t) => {
24
- m(T(n, t));
25
- },
26
- [m, n]
27
- ), M = d(() => Y(i).map((t) => ({
28
- ...t,
29
- className: "capitalize",
30
- disabled: a && a(t.value)
31
- })), [i, a]), A = d(() => k(r, 100).map((t) => ({
32
- ...t,
33
- disabled: c && c(t.value)
34
- })), [r, c]);
35
- let l = e === 11 && r === u;
36
- a && !l && (l = a(
37
- e === 11 ? 0 : e + 1,
38
- e === 11 ? Math.min(r + 1, u) : r
39
- ));
40
- let s = e === 0 && r === g;
41
- return a && !s && (s = a(
42
- e === 0 ? 11 : e - 1,
43
- e === 0 ? Math.max(r - 1, g) : r
44
- )), /* @__PURE__ */ f("div", { className: "calendar-header", children: [
45
- !s && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: x, children: /* @__PURE__ */ o(C, { icon: L.faChevronLeft }) }),
46
- /* @__PURE__ */ f("div", { className: "calendar-pickers", children: [
47
- /* @__PURE__ */ o(
48
- p,
49
- {
50
- fill: !0,
51
- options: A,
52
- size: "sm",
53
- value: r,
54
- minimalOptions: !0,
55
- matchTarget: "min-width",
56
- onChange: (t) => E(t)
57
- }
58
- ),
59
- /* @__PURE__ */ o(
60
- p,
61
- {
62
- fill: !0,
63
- options: M,
64
- size: "sm",
65
- className: "capitalize",
66
- value: e,
67
- minimalOptions: !0,
68
- matchTarget: "min-width",
69
- onChange: (t) => N(t)
70
- }
71
- )
72
- ] }),
73
- !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: v, children: /* @__PURE__ */ o(C, { icon: z.faChevronRight }) })
74
- ] });
75
- };
76
- export {
77
- S as CalendarHeader
78
- };