@companix/uikit 0.1.13 → 0.1.14

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.
@@ -1 +1,13 @@
1
- export declare const useLocalStorage: <T>(token: string, defaultValue: T) => [T, React.Dispatch<React.SetStateAction<T>>];
1
+ import { EventEmmiter } from '@companix/utils-js';
2
+ export declare class LocalStorageService<T> {
3
+ emmiter: EventEmmiter<T>;
4
+ constructor(emmiter: EventEmmiter<T>);
5
+ getStorageValue(token: string, defaultValue: T): any;
6
+ setValue(token: string, value: T): void;
7
+ }
8
+ export declare const useLocalStorage: <T>(token: string, defaultValue: T) => readonly [T, (value: T) => void];
9
+ interface LocalStorageProviderProps {
10
+ children: React.ReactNode;
11
+ }
12
+ export declare const LocalStorageProvider: ({ children }: LocalStorageProviderProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
package/dist/bundle.es.js CHANGED
@@ -6,14 +6,14 @@ import { ButtonGroup as l } from "./bundle.es6.js";
6
6
  import { Spinner as S } from "./bundle.es7.js";
7
7
  import { Scrollable as g } from "./bundle.es8.js";
8
8
  import { ImitateScroll as d } from "./bundle.es9.js";
9
- import { Segments as B } from "./bundle.es10.js";
9
+ import { Segments as P } from "./bundle.es10.js";
10
10
  import { Popover as y } from "./bundle.es11.js";
11
11
  import { Tooltip as T } from "./bundle.es12.js";
12
- import { Select as b } from "./bundle.es13.js";
12
+ import { Select as v } from "./bundle.es13.js";
13
13
  import { SelectTags as A } from "./bundle.es14.js";
14
14
  import { Input as R } from "./bundle.es15.js";
15
- import { OptionItem as w } from "./bundle.es16.js";
16
- import { NumberInput as L } from "./bundle.es17.js";
15
+ import { OptionItem as L } from "./bundle.es16.js";
16
+ import { NumberInput as C } from "./bundle.es17.js";
17
17
  import { OptionsList as F } from "./bundle.es18.js";
18
18
  import { Checkbox as G } from "./bundle.es19.js";
19
19
  import { Switch as E } from "./bundle.es20.js";
@@ -33,28 +33,28 @@ import { FormGroup as ce } from "./bundle.es33.js";
33
33
  import { TimePicker as ue } from "./bundle.es34.js";
34
34
  import { Icon as De } from "./bundle.es35.js";
35
35
  import { ProgressBar as he } from "./bundle.es36.js";
36
- import { Skeleton as Pe } from "./bundle.es37.js";
36
+ import { Skeleton as Be } from "./bundle.es37.js";
37
37
  import { Blank as Ie } from "./bundle.es38.js";
38
38
  import { ProgressRing as ke } from "./bundle.es39.js";
39
- import { WriteBar as ve } from "./bundle.es40.js";
39
+ import { WriteBar as be } from "./bundle.es40.js";
40
40
  import { Editor as Oe } from "./bundle.es41.js";
41
- import { DropArea as ze, DropAreaProvider as we, useDragEnter as Ce } from "./bundle.es42.js";
41
+ import { DropArea as ze, DropAreaProvider as Le, useDragEnter as we } from "./bundle.es42.js";
42
42
  import { Table as Me } from "./bundle.es43.js";
43
43
  import { ThemeProvider as Ne, useTheme as Ge } from "./bundle.es44.js";
44
44
  import { ColorSchemeScript as Ee, colorSchemeScript as Ye } from "./bundle.es45.js";
45
- import { useLocalStorage as qe } from "./bundle.es46.js";
46
- import { useBooleanState as Je } from "./bundle.es47.js";
47
- import { useResizeTextarea as Qe } from "./bundle.es48.js";
48
- import { useLoading as Ve } from "./bundle.es49.js";
49
- import { NowContextProvider as Ze, useNow as _e } from "./bundle.es50.js";
50
- import { createAlertAgent as er } from "./bundle.es51.js";
51
- import { createToaster as or } from "./bundle.es52.js";
52
- import { Toast as pr } from "./bundle.es53.js";
53
- import { DialogShell as ar, DrawerShell as xr, createPopupRegistry as fr, usePopup as ir } from "./bundle.es54.js";
54
- import { createPopoversRegistry as nr } from "./bundle.es55.js";
55
- import { createScope as cr, createStaticScope as Sr } from "./bundle.es56.js";
56
- import { RemoveListener as gr } from "./bundle.es57.js";
57
- import { MONDAY as dr, addMonths as hr, createDayDisableChecker as Br, endOfDay as Pr, endOfWeek as yr, isDayMinMaxRestricted as Ir, isSameDate as Tr, setMonth as kr, setYear as br, startOfDay as vr, startOfWeek as Ar, subMonths as Or, useDayDisableCheker as Rr } from "./bundle.es58.js";
45
+ import { LocalStorageProvider as qe, useLocalStorage as He } from "./bundle.es46.js";
46
+ import { useBooleanState as Ke } from "./bundle.es47.js";
47
+ import { useResizeTextarea as Ue } from "./bundle.es48.js";
48
+ import { useLoading as Xe } from "./bundle.es49.js";
49
+ import { NowContextProvider as _e, useNow as $e } from "./bundle.es50.js";
50
+ import { createAlertAgent as rr } from "./bundle.es51.js";
51
+ import { createToaster as tr } from "./bundle.es52.js";
52
+ import { Toast as mr } from "./bundle.es53.js";
53
+ import { DialogShell as xr, DrawerShell as fr, createPopupRegistry as ir, usePopup as sr } from "./bundle.es54.js";
54
+ import { createPopoversRegistry as lr } from "./bundle.es55.js";
55
+ import { createScope as Sr, createStaticScope as ur } from "./bundle.es56.js";
56
+ import { RemoveListener as Dr } from "./bundle.es57.js";
57
+ import { MONDAY as hr, addMonths as Pr, createDayDisableChecker as Br, endOfDay as yr, endOfWeek as Ir, isDayMinMaxRestricted as Tr, isSameDate as kr, setMonth as vr, setYear as br, startOfDay as Ar, startOfWeek as Or, subMonths as Rr, useDayDisableCheker as zr } from "./bundle.es58.js";
58
58
  export {
59
59
  Z as AlertDialog,
60
60
  o as Avatar,
@@ -67,11 +67,11 @@ export {
67
67
  ie as DateInput,
68
68
  xe as DatePicker,
69
69
  Q as Dialog,
70
- ar as DialogShell,
70
+ xr as DialogShell,
71
71
  J as Drawer,
72
- xr as DrawerShell,
72
+ fr as DrawerShell,
73
73
  ze as DropArea,
74
- we as DropAreaProvider,
74
+ Le as DropAreaProvider,
75
75
  Oe as Editor,
76
76
  ne as FileOverlay,
77
77
  ce as FormGroup,
@@ -79,10 +79,11 @@ export {
79
79
  d as ImitateScroll,
80
80
  R as Input,
81
81
  $ as LoadingButton,
82
- dr as MONDAY,
83
- Ze as NowContextProvider,
84
- L as NumberInput,
85
- w as OptionItem,
82
+ qe as LocalStorageProvider,
83
+ hr as MONDAY,
84
+ _e as NowContextProvider,
85
+ C as NumberInput,
86
+ L as OptionItem,
86
87
  F as OptionsList,
87
88
  y as Popover,
88
89
  V as PopupLayout,
@@ -90,12 +91,12 @@ export {
90
91
  ke as ProgressRing,
91
92
  j as Radio,
92
93
  q as RadioGroup,
93
- gr as RemoveListener,
94
+ Dr as RemoveListener,
94
95
  g as Scrollable,
95
- B as Segments,
96
- b as Select,
96
+ P as Segments,
97
+ v as Select,
97
98
  A as SelectTags,
98
- Pe as Skeleton,
99
+ Be as Skeleton,
99
100
  S as Spinner,
100
101
  E as Switch,
101
102
  Me as Table,
@@ -103,38 +104,38 @@ export {
103
104
  me as TextArea,
104
105
  Ne as ThemeProvider,
105
106
  ue as TimePicker,
106
- pr as Toast,
107
+ mr as Toast,
107
108
  T as Tooltip,
108
- ve as WriteBar,
109
- hr as addMonths,
109
+ be as WriteBar,
110
+ Pr as addMonths,
110
111
  p as avatarSizes,
111
112
  Ye as colorSchemeScript,
112
- er as createAlertAgent,
113
+ rr as createAlertAgent,
113
114
  Br as createDayDisableChecker,
114
- nr as createPopoversRegistry,
115
- fr as createPopupRegistry,
116
- cr as createScope,
117
- Sr as createStaticScope,
118
- or as createToaster,
119
- Pr as endOfDay,
120
- yr as endOfWeek,
115
+ lr as createPopoversRegistry,
116
+ ir as createPopupRegistry,
117
+ Sr as createScope,
118
+ ur as createStaticScope,
119
+ tr as createToaster,
120
+ yr as endOfDay,
121
+ Ir as endOfWeek,
121
122
  a as getBadgeIconSizeByImageBaseSize,
122
123
  x as getFallbackIconSizeByImageBaseSize,
123
124
  f as getInitialsFontSize,
124
- Ir as isDayMinMaxRestricted,
125
- Tr as isSameDate,
126
- kr as setMonth,
125
+ Tr as isDayMinMaxRestricted,
126
+ kr as isSameDate,
127
+ vr as setMonth,
127
128
  br as setYear,
128
- vr as startOfDay,
129
- Ar as startOfWeek,
130
- Or as subMonths,
131
- Je as useBooleanState,
132
- Rr as useDayDisableCheker,
133
- Ce as useDragEnter,
134
- Ve as useLoading,
135
- qe as useLocalStorage,
136
- _e as useNow,
137
- ir as usePopup,
138
- Qe as useResizeTextarea,
129
+ Ar as startOfDay,
130
+ Or as startOfWeek,
131
+ Rr as subMonths,
132
+ Ke as useBooleanState,
133
+ zr as useDayDisableCheker,
134
+ we as useDragEnter,
135
+ Xe as useLoading,
136
+ He as useLocalStorage,
137
+ $e as useNow,
138
+ sr as usePopup,
139
+ Ue as useResizeTextarea,
139
140
  Ge as useTheme
140
141
  };
@@ -1,13 +1,52 @@
1
- import { useState as s, useEffect as c } from "react";
2
- const l = (e, a) => {
3
- const [t, o] = s(() => {
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { EventEmmiter as g } from "@companix/utils-js";
3
+ import { useContext as S, createContext as l, useState as f, useEffect as n, useRef as w } from "react";
4
+ const a = l({});
5
+ class d {
6
+ constructor(e) {
7
+ this.emmiter = e;
8
+ }
9
+ getStorageValue(e, t) {
10
+ if (typeof window > "u")
11
+ return t;
4
12
  const r = localStorage.getItem(e);
5
- return r ? JSON.parse(r) : a;
6
- });
7
- return c(() => {
8
- localStorage.setItem(e, JSON.stringify(t));
9
- }, [t]), [t, o];
13
+ return r ? JSON.parse(r) : t;
14
+ }
15
+ setValue(e, t) {
16
+ localStorage.setItem(e, JSON.stringify(t)), this.emmiter.emit(e, t);
17
+ }
18
+ }
19
+ const x = (o, e) => {
20
+ const t = S(a), [r, i] = f(() => t.getStorageValue(o, e));
21
+ n(() => {
22
+ i(t.getStorageValue(o, e));
23
+ }, [o]);
24
+ const c = (s) => {
25
+ t.setValue(o, s);
26
+ };
27
+ return n(() => {
28
+ const s = t.emmiter.subscribe(o, (u) => {
29
+ i(u);
30
+ });
31
+ return () => {
32
+ s();
33
+ };
34
+ }, [o]), [r, c];
35
+ }, y = ({ children: o }) => {
36
+ const e = w(new d(new g()));
37
+ return n(() => {
38
+ if (!window || !e.current)
39
+ return;
40
+ const t = (r) => {
41
+ r.key && e.current.emmiter.store[r.key] && r.newValue && e.current.emmiter.emit(r.key, JSON.parse(r.newValue));
42
+ };
43
+ return window.addEventListener("storage", t), () => {
44
+ window.removeEventListener("storage", t);
45
+ };
46
+ }, []), /* @__PURE__ */ m(a.Provider, { value: e.current, children: o });
10
47
  };
11
48
  export {
12
- l as useLocalStorage
49
+ y as LocalStorageProvider,
50
+ d as LocalStorageService,
51
+ x as useLocalStorage
13
52
  };
@@ -2,7 +2,7 @@ import { jsxs as b, jsx as o } from "react/jsx-runtime";
2
2
  import h from "classnames";
3
3
  import { attr as e } from "@companix/utils-browser";
4
4
  import { forwardRef as x } from "react";
5
- import { useInputPadding as N } from "./bundle.es78.js";
5
+ import { useInputPadding as N } from "./bundle.es76.js";
6
6
  const v = x(
7
7
  ({
8
8
  required: s,
@@ -1,7 +1,7 @@
1
1
  import { jsxs as D, jsx as t } from "react/jsx-runtime";
2
2
  import { dateToFormat as $, weeks as g, createVoids as p, getDayIndex as b, getFirstDay as u, getMonthMaxDay as k } from "./bundle.es64.js";
3
- import { CalendarHeader as F } from "./bundle.es76.js";
4
- import { useCalendar as j } from "./bundle.es77.js";
3
+ import { CalendarHeader as F } from "./bundle.es77.js";
4
+ import { useCalendar as j } from "./bundle.es78.js";
5
5
  import { attr as m } from "@companix/utils-browser";
6
6
  import { isSameDate as f } from "./bundle.es58.js";
7
7
  import { useLayoutEffect as I } from "react";
@@ -1,77 +1,16 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { useCallback as u, useMemo as h } from "react";
3
- import { Select as p } from "./bundle.es13.js";
4
- import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es64.js";
5
- import { Icon as C } from "./bundle.es35.js";
6
- import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
7
- import { setMonth as _, setYear as F } from "./bundle.es58.js";
8
- const y = ({
9
- viewDate: n,
10
- onChange: c,
11
- isMonthDisabled: a,
12
- isYearDisabled: m,
13
- onNextMonth: N,
14
- onPrevMonth: v
15
- }) => {
16
- const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
17
- (t) => {
18
- c(_(n, t));
19
- },
20
- [c, n]
21
- ), x = u(
22
- (t) => {
23
- c(F(n, t));
24
- },
25
- [c, n]
26
- ), A = h(() => k(s).map((t) => ({
27
- ...t,
28
- className: "capitalize",
29
- disabled: a && a(t.value)
30
- })), [s, a]), Y = h(() => z(e, 100).map((t) => ({
31
- ...t,
32
- disabled: m && m(t.value)
33
- })), [e, m]);
34
- let l = r === 11 && e === f;
35
- a && !l && (l = a(
36
- r === 11 ? 0 : r + 1,
37
- r === 11 ? Math.min(e + 1, f) : e
38
- ));
39
- let i = r === 0 && e === g;
40
- return a && !i && (i = a(
41
- r === 0 ? 11 : r - 1,
42
- r === 0 ? Math.max(e - 1, g) : e
43
- )), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
44
- !i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
45
- /* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
46
- /* @__PURE__ */ o(
47
- p,
48
- {
49
- fill: !0,
50
- options: Y,
51
- size: "sm",
52
- value: e,
53
- minimalOptions: !0,
54
- matchTarget: "min-width",
55
- onChange: (t) => x(t)
56
- }
57
- ),
58
- /* @__PURE__ */ o(
59
- p,
60
- {
61
- fill: !0,
62
- options: A,
63
- size: "sm",
64
- className: "capitalize",
65
- value: r,
66
- minimalOptions: !0,
67
- matchTarget: "min-width",
68
- onChange: (t) => M(t)
69
- }
70
- )
71
- ] }),
72
- !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
73
- ] });
1
+ import { useRef as l, useCallback as p } from "react";
2
+ import { useEffectWithLayout as d } from "./bundle.es79.js";
3
+ const g = (r, f) => {
4
+ const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
+ if (r.current) {
6
+ const n = r.current.style, e = o[t];
7
+ e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
8
+ }
9
+ }, []);
10
+ return d(() => {
11
+ u("Left"), u("Right");
12
+ }, f), { rightRef: c, leftRef: i };
74
13
  };
75
14
  export {
76
- y as CalendarHeader
15
+ g as useInputPadding
77
16
  };
@@ -1,51 +1,77 @@
1
- import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es58.js";
2
- import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es64.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
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import { useCallback as u, useMemo as h } from "react";
3
+ import { Select as p } from "./bundle.es13.js";
4
+ import { getMonths as k, getYears as z, DEFAULT_MAX_YEAR as f, DEFAULT_MIN_YEAR as g } from "./bundle.es64.js";
5
+ import { Icon as C } from "./bundle.es35.js";
6
+ import { faChevronLeft as E, faChevronRight as T } from "@companix/icons-solid";
7
+ import { setMonth as _, setYear as F } from "./bundle.es58.js";
8
+ const y = ({
9
+ viewDate: n,
10
+ onChange: c,
11
+ isMonthDisabled: a,
12
+ isYearDisabled: m,
13
+ onNextMonth: N,
14
+ onPrevMonth: v
11
15
  }) => {
12
- const [e, u] = U(p || /* @__PURE__ */ new Date()), _ = M(() => {
13
- u(L(e, 1));
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;
16
+ const e = n.getFullYear(), r = n.getMonth(), s = "ru", M = u(
17
+ (t) => {
18
+ c(_(n, t));
29
19
  },
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;
20
+ [c, n]
21
+ ), x = u(
22
+ (t) => {
23
+ c(F(n, t));
36
24
  },
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
- };
25
+ [c, n]
26
+ ), A = h(() => k(s).map((t) => ({
27
+ ...t,
28
+ className: "capitalize",
29
+ disabled: a && a(t.value)
30
+ })), [s, a]), Y = h(() => z(e, 100).map((t) => ({
31
+ ...t,
32
+ disabled: m && m(t.value)
33
+ })), [e, m]);
34
+ let l = r === 11 && e === f;
35
+ a && !l && (l = a(
36
+ r === 11 ? 0 : r + 1,
37
+ r === 11 ? Math.min(e + 1, f) : e
38
+ ));
39
+ let i = r === 0 && e === g;
40
+ return a && !i && (i = a(
41
+ r === 0 ? 11 : r - 1,
42
+ r === 0 ? Math.max(e - 1, g) : e
43
+ )), /* @__PURE__ */ d("div", { className: "calendar-header", children: [
44
+ !i && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "left", onClick: v, children: /* @__PURE__ */ o(C, { icon: E }) }),
45
+ /* @__PURE__ */ d("div", { className: "calendar-pickers", children: [
46
+ /* @__PURE__ */ o(
47
+ p,
48
+ {
49
+ fill: !0,
50
+ options: Y,
51
+ size: "sm",
52
+ value: e,
53
+ minimalOptions: !0,
54
+ matchTarget: "min-width",
55
+ onChange: (t) => x(t)
56
+ }
57
+ ),
58
+ /* @__PURE__ */ o(
59
+ p,
60
+ {
61
+ fill: !0,
62
+ options: A,
63
+ size: "sm",
64
+ className: "capitalize",
65
+ value: r,
66
+ minimalOptions: !0,
67
+ matchTarget: "min-width",
68
+ onChange: (t) => M(t)
69
+ }
70
+ )
71
+ ] }),
72
+ !l && /* @__PURE__ */ o("button", { className: "calendar-navigation", "data-side": "right", onClick: N, children: /* @__PURE__ */ o(C, { icon: T }) })
73
+ ] });
48
74
  };
49
75
  export {
50
- X as useCalendar
76
+ y as CalendarHeader
51
77
  };
@@ -1,16 +1,51 @@
1
- import { useRef as l, useCallback as p } from "react";
2
- import { useEffectWithLayout as d } from "./bundle.es79.js";
3
- const g = (r, f) => {
4
- const c = l(null), i = l(null), o = { Right: c, Left: i }, u = p((t) => {
5
- if (r.current) {
6
- const n = r.current.style, e = o[t];
7
- e.current && e.current.clientWidth ? n[`padding${t}`] !== `${e.current.clientWidth}px` && (n[`padding${t}`] = `${e.current.clientWidth}px`) : n[`padding${t}`] && (n[`padding${t}`] = "");
8
- }
9
- }, []);
10
- return d(() => {
11
- u("Left"), u("Right");
12
- }, f), { rightRef: c, leftRef: i };
1
+ import { subMonths as L, addMonths as N, useDayDisableCheker as R } from "./bundle.es58.js";
2
+ import { DEFAULT_MIN_YEAR as w, DEFAULT_MAX_YEAR as A } from "./bundle.es64.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, 1));
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
+ };
13
48
  };
14
49
  export {
15
- g as useInputPadding
50
+ X as useCalendar
16
51
  };
package/dist/index.d.ts CHANGED
@@ -81,7 +81,7 @@ export { Table } from './Table';
81
81
  export type { TableProps } from './Table';
82
82
  export { ThemeProvider, useTheme } from './ThemeProvider';
83
83
  export { ColorSchemeScript, colorSchemeScript } from './ThemeProvider/script';
84
- export { useLocalStorage } from './__hooks/use-local-storage';
84
+ export { useLocalStorage, LocalStorageProvider } from './__hooks/use-local-storage';
85
85
  export { useBooleanState } from './__hooks/use-boolean-state';
86
86
  export { useResizeTextarea } from './__hooks/use-resize';
87
87
  export { useLoading } from './__hooks/use-loading';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",