@companix/uikit 0.1.2 → 0.1.4

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 (52) hide show
  1. package/dist/Table/index.d.ts +11 -0
  2. package/dist/bundle.es.js +63 -61
  3. package/dist/bundle.es10.js +1 -1
  4. package/dist/bundle.es13.js +4 -4
  5. package/dist/bundle.es14.js +3 -3
  6. package/dist/bundle.es15.js +2 -2
  7. package/dist/bundle.es17.js +1 -1
  8. package/dist/bundle.es24.js +1 -1
  9. package/dist/bundle.es25.js +1 -1
  10. package/dist/bundle.es26.js +1 -1
  11. package/dist/bundle.es27.js +1 -1
  12. package/dist/bundle.es29.js +1 -1
  13. package/dist/bundle.es30.js +4 -4
  14. package/dist/bundle.es31.js +2 -2
  15. package/dist/bundle.es34.js +2 -2
  16. package/dist/bundle.es40.js +1 -1
  17. package/dist/bundle.es42.js +7 -35
  18. package/dist/bundle.es43.js +33 -20
  19. package/dist/bundle.es44.js +21 -10
  20. package/dist/bundle.es45.js +10 -11
  21. package/dist/bundle.es46.js +11 -13
  22. package/dist/bundle.es47.js +13 -13
  23. package/dist/bundle.es48.js +13 -30
  24. package/dist/bundle.es49.js +29 -25
  25. package/dist/bundle.es50.js +17 -29
  26. package/dist/bundle.es51.js +36 -48
  27. package/dist/bundle.es52.js +49 -50
  28. package/dist/bundle.es53.js +51 -8
  29. package/dist/bundle.es54.js +8 -26
  30. package/dist/bundle.es55.js +27 -5
  31. package/dist/bundle.es56.js +5 -66
  32. package/dist/bundle.es57.js +66 -23
  33. package/dist/bundle.es58.js +22 -23
  34. package/dist/bundle.es59.js +24 -88
  35. package/dist/bundle.es60.js +88 -18
  36. package/dist/bundle.es61.js +17 -92
  37. package/dist/bundle.es62.js +92 -73
  38. package/dist/bundle.es63.js +73 -23
  39. package/dist/bundle.es64.js +20 -35
  40. package/dist/bundle.es65.js +37 -68
  41. package/dist/bundle.es66.js +68 -9
  42. package/dist/bundle.es67.js +10 -42
  43. package/dist/bundle.es68.js +42 -14
  44. package/dist/bundle.es69.js +15 -32
  45. package/dist/bundle.es70.js +23 -61
  46. package/dist/bundle.es71.js +69 -13
  47. package/dist/bundle.es72.js +2 -2
  48. package/dist/bundle.es73.js +2 -2
  49. package/dist/bundle.es74.js +12 -12
  50. package/dist/bundle.es75.js +16 -0
  51. package/dist/index.d.ts +2 -0
  52. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ export interface TableProps<T> {
2
+ header: {
3
+ content: React.ReactNode;
4
+ style?: React.CSSProperties;
5
+ }[];
6
+ items: T[];
7
+ getItemLayout: (item: T) => React.ReactNode[];
8
+ onRowClick?: (item: T) => void;
9
+ className?: string;
10
+ }
11
+ export declare const Table: <T>({ header, items, getItemLayout, className, onRowClick }: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
package/dist/bundle.es.js CHANGED
@@ -2,14 +2,14 @@ import { Avatar as o } from "./bundle.es2.js";
2
2
  import { avatarSizes as p } from "./bundle.es3.js";
3
3
  import { getBadgeIconSizeByImageBaseSize as a, getFallbackIconSizeByImageBaseSize as x, getInitialsFontSize as f } from "./bundle.es4.js";
4
4
  import { Button as s } from "./bundle.es5.js";
5
- import { ButtonGroup as c } from "./bundle.es6.js";
5
+ 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
9
  import { Segments as B } from "./bundle.es10.js";
10
10
  import { Popover as y } from "./bundle.es11.js";
11
- import { Tooltip as k } from "./bundle.es12.js";
12
- import { Select as v } from "./bundle.es13.js";
11
+ import { Tooltip as T } from "./bundle.es12.js";
12
+ import { Select as b } 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
15
  import { OptionItem as w } from "./bundle.es16.js";
@@ -29,108 +29,110 @@ import { TextArea as me } from "./bundle.es29.js";
29
29
  import { DatePicker as xe } from "./bundle.es30.js";
30
30
  import { DateInput as ie } from "./bundle.es31.js";
31
31
  import { FileOverlay as ne } from "./bundle.es32.js";
32
- import { FormGroup as le } from "./bundle.es33.js";
32
+ 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
36
  import { Skeleton as Pe } from "./bundle.es37.js";
37
37
  import { Blank as Ie } from "./bundle.es38.js";
38
- import { ProgressRing as Te } from "./bundle.es39.js";
39
- import { WriteBar as be } from "./bundle.es40.js";
38
+ import { ProgressRing as ke } from "./bundle.es39.js";
39
+ import { WriteBar as ve } from "./bundle.es40.js";
40
40
  import { DropArea as Oe, DropAreaProvider as Re, useDragEnter as ze } from "./bundle.es41.js";
41
- import { ThemeProvider as Ce, useTheme as Le } from "./bundle.es42.js";
42
- import { ColorSchemeScript as Fe, colorSchemeScript as Ne } from "./bundle.es43.js";
43
- import { useLocalStorage as We } from "./bundle.es44.js";
44
- import { useBooleanState as Ee } from "./bundle.es45.js";
45
- import { useResizeTextarea as qe } from "./bundle.es46.js";
46
- import { useLoading as Je } from "./bundle.es47.js";
47
- import { NowContextProvider as Qe, useNow as Ue } from "./bundle.es48.js";
48
- import { createAlertAgent as Xe } from "./bundle.es49.js";
49
- import { createToaster as _e } from "./bundle.es50.js";
50
- import { Toast as er } from "./bundle.es51.js";
51
- import { DialogShell as or, DrawerShell as tr, createPopupRegistry as pr, usePopup as mr } from "./bundle.es52.js";
52
- import { createPopoversRegistry as xr } from "./bundle.es53.js";
53
- import { createScope as ir, createStaticScope as sr } from "./bundle.es54.js";
54
- import { RemoveListener as cr } from "./bundle.es55.js";
55
- import { MONDAY as Sr, addMonths as ur, createDayDisableChecker as gr, endOfDay as Dr, endOfWeek as dr, isDayMinMaxRestricted as hr, isSameDate as Br, setMonth as Pr, setYear as yr, startOfDay as Ir, startOfWeek as kr, subMonths as Tr, useDayDisableCheker as vr } from "./bundle.es56.js";
41
+ import { Table as Ce } from "./bundle.es42.js";
42
+ import { ThemeProvider as Me, useTheme as Fe } from "./bundle.es43.js";
43
+ import { ColorSchemeScript as Ge, colorSchemeScript as We } from "./bundle.es44.js";
44
+ import { useLocalStorage as Ee } from "./bundle.es45.js";
45
+ import { useBooleanState as qe } from "./bundle.es46.js";
46
+ import { useResizeTextarea as Je } from "./bundle.es47.js";
47
+ import { useLoading as Qe } from "./bundle.es48.js";
48
+ import { NowContextProvider as Ve, useNow as Xe } from "./bundle.es49.js";
49
+ import { createAlertAgent as _e } from "./bundle.es50.js";
50
+ import { createToaster as er } from "./bundle.es51.js";
51
+ import { Toast as or } from "./bundle.es52.js";
52
+ import { DialogShell as pr, DrawerShell as mr, createPopupRegistry as ar, usePopup as xr } from "./bundle.es53.js";
53
+ import { createPopoversRegistry as ir } from "./bundle.es54.js";
54
+ import { createScope as nr, createStaticScope as lr } from "./bundle.es55.js";
55
+ import { RemoveListener as Sr } from "./bundle.es56.js";
56
+ import { MONDAY as gr, addMonths as Dr, createDayDisableChecker as dr, endOfDay as hr, endOfWeek as Br, isDayMinMaxRestricted as Pr, isSameDate as yr, setMonth as Ir, setYear as Tr, startOfDay as kr, startOfWeek as br, subMonths as vr, useDayDisableCheker as Ar } from "./bundle.es57.js";
56
57
  export {
57
58
  Z as AlertDialog,
58
59
  o as Avatar,
59
60
  Ie as Blank,
60
61
  s as Button,
61
- c as ButtonGroup,
62
+ l as ButtonGroup,
62
63
  G as Checkbox,
63
- Fe as ColorSchemeScript,
64
+ Ge as ColorSchemeScript,
64
65
  te as Countdown,
65
66
  ie as DateInput,
66
67
  xe as DatePicker,
67
68
  Q as Dialog,
68
- or as DialogShell,
69
+ pr as DialogShell,
69
70
  J as Drawer,
70
- tr as DrawerShell,
71
+ mr as DrawerShell,
71
72
  Oe as DropArea,
72
73
  Re as DropAreaProvider,
73
74
  ne as FileOverlay,
74
- le as FormGroup,
75
+ ce as FormGroup,
75
76
  De as Icon,
76
77
  d as ImitateScroll,
77
78
  R as Input,
78
79
  $ as LoadingButton,
79
- Sr as MONDAY,
80
- Qe as NowContextProvider,
80
+ gr as MONDAY,
81
+ Ve as NowContextProvider,
81
82
  L as NumberInput,
82
83
  w as OptionItem,
83
84
  F as OptionsList,
84
85
  y as Popover,
85
86
  V as PopupLayout,
86
87
  he as ProgressBar,
87
- Te as ProgressRing,
88
+ ke as ProgressRing,
88
89
  j as Radio,
89
90
  q as RadioGroup,
90
- cr as RemoveListener,
91
+ Sr as RemoveListener,
91
92
  g as Scrollable,
92
93
  B as Segments,
93
- v as Select,
94
+ b as Select,
94
95
  A as SelectTags,
95
96
  Pe as Skeleton,
96
97
  S as Spinner,
97
98
  Y as Switch,
99
+ Ce as Table,
98
100
  re as Tabs,
99
101
  me as TextArea,
100
- Ce as ThemeProvider,
102
+ Me as ThemeProvider,
101
103
  ue as TimePicker,
102
- er as Toast,
103
- k as Tooltip,
104
- be as WriteBar,
105
- ur as addMonths,
104
+ or as Toast,
105
+ T as Tooltip,
106
+ ve as WriteBar,
107
+ Dr as addMonths,
106
108
  p as avatarSizes,
107
- Ne as colorSchemeScript,
108
- Xe as createAlertAgent,
109
- gr as createDayDisableChecker,
110
- xr as createPopoversRegistry,
111
- pr as createPopupRegistry,
112
- ir as createScope,
113
- sr as createStaticScope,
114
- _e as createToaster,
115
- Dr as endOfDay,
116
- dr as endOfWeek,
109
+ We as colorSchemeScript,
110
+ _e as createAlertAgent,
111
+ dr as createDayDisableChecker,
112
+ ir as createPopoversRegistry,
113
+ ar as createPopupRegistry,
114
+ nr as createScope,
115
+ lr as createStaticScope,
116
+ er as createToaster,
117
+ hr as endOfDay,
118
+ Br as endOfWeek,
117
119
  a as getBadgeIconSizeByImageBaseSize,
118
120
  x as getFallbackIconSizeByImageBaseSize,
119
121
  f as getInitialsFontSize,
120
- hr as isDayMinMaxRestricted,
121
- Br as isSameDate,
122
- Pr as setMonth,
123
- yr as setYear,
124
- Ir as startOfDay,
125
- kr as startOfWeek,
126
- Tr as subMonths,
127
- Ee as useBooleanState,
128
- vr as useDayDisableCheker,
122
+ Pr as isDayMinMaxRestricted,
123
+ yr as isSameDate,
124
+ Ir as setMonth,
125
+ Tr as setYear,
126
+ kr as startOfDay,
127
+ br as startOfWeek,
128
+ vr as subMonths,
129
+ qe as useBooleanState,
130
+ Ar as useDayDisableCheker,
129
131
  ze as useDragEnter,
130
- Je as useLoading,
131
- We as useLocalStorage,
132
- Ue as useNow,
133
- mr as usePopup,
134
- qe as useResizeTextarea,
135
- Le as useTheme
132
+ Qe as useLoading,
133
+ Ee as useLocalStorage,
134
+ Xe as useNow,
135
+ xr as usePopup,
136
+ Je as useResizeTextarea,
137
+ Fe as useTheme
136
138
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import { makeTabId as c, useTabSlider as i } from "./bundle.es57.js";
2
+ import { makeTabId as c, useTabSlider as i } from "./bundle.es58.js";
3
3
  import { attr as o } from "@companix/utils-browser";
4
4
  import { useRef as u, useId as f } from "react";
5
5
  const h = ({ value: s, onChange: t, options: a }) => {
@@ -1,10 +1,10 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { useRef as L, useMemo as j, useImperativeHandle as k } from "react";
3
3
  import { Popover as q } from "./bundle.es11.js";
4
- import { useFroozeClosing as w } from "./bundle.es58.js";
5
- import { SelectInput as H } from "./bundle.es59.js";
6
- import { useScrollListController as M } from "./bundle.es60.js";
7
- import { OptionsPopover as N } from "./bundle.es61.js";
4
+ import { useFroozeClosing as w } from "./bundle.es59.js";
5
+ import { SelectInput as H } from "./bundle.es60.js";
6
+ import { useScrollListController as M } from "./bundle.es61.js";
7
+ import { OptionsPopover as N } from "./bundle.es62.js";
8
8
  import { mergeRefs as W } from "react-merge-refs";
9
9
  const Z = (t) => {
10
10
  const {
@@ -3,12 +3,12 @@ import { mergeRefs as T } from "react-merge-refs";
3
3
  import { useState as M, useRef as h, useMemo as j } from "react";
4
4
  import { matchPattern as q } from "@companix/utils-js";
5
5
  import { faXmark as V, faChevronDown as $ } from "@companix/icons-solid";
6
- import { useFroozeClosing as B } from "./bundle.es58.js";
6
+ import { useFroozeClosing as B } from "./bundle.es59.js";
7
7
  import { Popover as L } from "./bundle.es11.js";
8
8
  import { Icon as g } from "./bundle.es35.js";
9
9
  import { attr as l, getActiveElementByAnotherElement as X, contains as G } from "@companix/utils-browser";
10
- import { OptionsPopover as H } from "./bundle.es61.js";
11
- import { arrays as v } from "./bundle.es62.js";
10
+ import { OptionsPopover as H } from "./bundle.es62.js";
11
+ import { arrays as v } from "./bundle.es63.js";
12
12
  const ne = (r) => {
13
13
  const {
14
14
  closeAfterSelect: C,
@@ -1,8 +1,8 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { forwardRef as b, useRef as R } from "react";
3
3
  import { mergeRefs as c } from "react-merge-refs";
4
- import { InputElement as x } from "./bundle.es63.js";
5
- import { InputContainer as I } from "./bundle.es64.js";
4
+ import { InputElement as x } from "./bundle.es64.js";
5
+ import { InputContainer as I } from "./bundle.es65.js";
6
6
  import g from "classnames";
7
7
  const N = b(
8
8
  ({
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import C from "classnames";
3
3
  import { forwardRef as j, useRef as w } from "react";
4
4
  import { mergeRefs as y } from "react-merge-refs";
5
- import { InputContainer as F } from "./bundle.es64.js";
5
+ import { InputContainer as F } from "./bundle.es65.js";
6
6
  import { NumericFormat as V } from "react-number-format";
7
7
  const D = j(
8
8
  ({
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
2
  import f from "classnames";
3
3
  import * as o from "@radix-ui/react-dialog";
4
4
  import { VisuallyHidden as l } from "@radix-ui/react-visually-hidden";
5
- import { RemoveListener as u } from "./bundle.es55.js";
5
+ import { RemoveListener as u } from "./bundle.es56.js";
6
6
  const v = (i) => {
7
7
  const { open: t, onOpenChange: s, children: a, onClosed: c, disableEsc: p, overlay: n = {}, content: m = {} } = i, d = (h) => {
8
8
  p && h.preventDefault();
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-alert-dialog";
3
3
  import { Button as c } from "./bundle.es5.js";
4
- import { RemoveListener as N } from "./bundle.es55.js";
4
+ import { RemoveListener as N } from "./bundle.es56.js";
5
5
  import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
6
6
  const C = ({
7
7
  open: d,
@@ -1,6 +1,6 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { Button as p } from "./bundle.es5.js";
3
- import { useLoading as s } from "./bundle.es47.js";
3
+ import { useLoading as s } from "./bundle.es48.js";
4
4
  const l = ({
5
5
  onClick: o,
6
6
  appearance: r = "primary",
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
- import { useTabSlider as b, makeTabId as l } from "./bundle.es57.js";
2
+ import { useTabSlider as b, makeTabId as l } from "./bundle.es58.js";
3
3
  import * as n from "@radix-ui/react-tabs";
4
4
  import { useRef as m, useId as f, createContext as T, useContext as c } from "react";
5
5
  const o = T({ baseId: "", containerRef: {} }), u = ({ children: s, value: e, onChange: r }) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import u from "classnames";
3
- import { useResizeTextarea as z } from "./bundle.es46.js";
3
+ import { useResizeTextarea as z } from "./bundle.es47.js";
4
4
  import { attr as e, callMultiple as R } from "@companix/utils-browser";
5
5
  import { useEffect as T } from "react";
6
6
  import { mergeRefs as g } from "react-merge-refs";
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
2
2
  import { Popover as T } from "./bundle.es11.js";
3
3
  import { Input as w } from "./bundle.es15.js";
4
4
  import { useState as A, useRef as j } from "react";
5
- import { Calendar as E } from "./bundle.es65.js";
6
- import { useDayDisableCheker as N } from "./bundle.es56.js";
5
+ import { Calendar as E } from "./bundle.es66.js";
6
+ import { useDayDisableCheker as N } from "./bundle.es57.js";
7
7
  import { getNum as h, formatTime as v } from "@companix/utils-js";
8
- import { removeDigits as O } from "./bundle.es62.js";
9
- import { SelectRightElements as Y } from "./bundle.es66.js";
8
+ import { removeDigits as O } from "./bundle.es63.js";
9
+ import { SelectRightElements as Y } from "./bundle.es67.js";
10
10
  const i = {
11
11
  char: "-",
12
12
  toString: (e) => {
@@ -1,8 +1,8 @@
1
1
  import { jsxs as D, jsx as h } from "react/jsx-runtime";
2
2
  import { useMemo as M, useEffect as C } from "react";
3
3
  import { Select as c } from "./bundle.es13.js";
4
- import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es62.js";
5
- import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es67.js";
4
+ import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es63.js";
5
+ import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es68.js";
6
6
  const B = ({
7
7
  min: o = j,
8
8
  max: e = N,
@@ -1,8 +1,8 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
2
  import { useRef as b, useMemo as I, useState as E, useCallback as A } from "react";
3
3
  import { getNum as S } from "@companix/utils-js";
4
- import { getTimesOptions as W, getTimeValue as q, removeDigits as w, convertTimeToOption as y } from "./bundle.es62.js";
5
- import { SelectRightElements as z } from "./bundle.es66.js";
4
+ import { getTimesOptions as W, getTimeValue as q, removeDigits as w, convertTimeToOption as y } from "./bundle.es63.js";
5
+ import { SelectRightElements as z } from "./bundle.es67.js";
6
6
  import { Select as F } from "./bundle.es13.js";
7
7
  import { Input as G } from "./bundle.es15.js";
8
8
  const o = {
@@ -2,7 +2,7 @@ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import d from "classnames";
3
3
  import { Spinner as F } from "./bundle.es7.js";
4
4
  import { Icon as G } from "./bundle.es35.js";
5
- import { useResizeTextarea as H } from "./bundle.es46.js";
5
+ import { useResizeTextarea as H } from "./bundle.es47.js";
6
6
  import { callMultiple as J, attr as K } from "@companix/utils-browser";
7
7
  import { mergeRefs as L } from "react-merge-refs";
8
8
  import { useEffect as O } from "react";
@@ -1,37 +1,9 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useState as h, useEffect as c, createContext as f, useContext as w } from "react";
3
- import { getColorScheme as v, updateDOM as m } from "./bundle.es68.js";
4
- const i = f({
5
- setColorScheme: () => {
6
- }
7
- }), y = () => w(i), p = (d) => {
8
- const { defaultColorScheme: o = "system", storageKey: n = "theme", children: l } = d, [r, a] = h(() => v(n, o)), s = (e) => {
9
- a(e), localStorage.setItem(n, e);
10
- };
11
- return c(() => {
12
- const e = window ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
13
- if (!e)
14
- return;
15
- const t = () => {
16
- r === "system" && m("system");
17
- };
18
- return e.addEventListener?.("change", t), t(), () => {
19
- e.removeEventListener?.("change", t);
20
- };
21
- }, [r]), c(() => {
22
- if (!window)
23
- return;
24
- const e = (t) => {
25
- t.key === n && (t.newValue ? a(t.newValue) : s(o));
26
- };
27
- return window.addEventListener("storage", e), () => {
28
- window.removeEventListener("storage", e);
29
- };
30
- }, [s, o]), c(() => {
31
- m(r);
32
- }, [r]), /* @__PURE__ */ u(i.Provider, { value: { colorScheme: r, setColorScheme: s }, children: l });
33
- };
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ const b = ({ header: c, items: e, getItemLayout: d, className: o, onRowClick: h }) => /* @__PURE__ */ i("table", { className: o, children: [
3
+ /* @__PURE__ */ r("colgroup", { children: c.map(({ style: l }, t) => /* @__PURE__ */ r("col", { style: l }, `colgroup-col-${t}`)) }),
4
+ /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: c.map(({ content: l }, t) => /* @__PURE__ */ r("th", { children: l }, `header-th-${t}`)) }) }),
5
+ /* @__PURE__ */ r("tbody", { children: e.map((l, t) => /* @__PURE__ */ r("tr", { onClick: () => h?.(l), children: d(l).map((n, a) => /* @__PURE__ */ r("td", { children: n }, `table-td-${t}-${a}`)) }, `table-tr-${t}`)) })
6
+ ] });
34
7
  export {
35
- p as ThemeProvider,
36
- y as useTheme
8
+ b as Table
37
9
  };
@@ -1,24 +1,37 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { memo as n } from "react";
3
- const i = n(({ storageKey: t, defaultColorScheme: o }) => /* @__PURE__ */ l(
4
- "script",
5
- {
6
- suppressHydrationWarning: !0,
7
- dangerouslySetInnerHTML: {
8
- __html: `(${a.toString()})("${t}", "${o}")`
9
- }
10
- }
11
- )), a = (t, o) => {
12
- const [r, c] = ["theme-light", "theme-dark"];
13
- try {
14
- let e = localStorage.getItem(t) || o;
15
- e === "system" && (e = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
16
- const s = e === "dark" ? c : r;
17
- document.documentElement.classList.remove(r, c), document.documentElement.classList.add(s), document.documentElement.style.colorScheme = e;
18
- } catch {
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { useState as h, useEffect as c, createContext as f, useContext as w } from "react";
3
+ import { getColorScheme as v, updateDOM as m } from "./bundle.es69.js";
4
+ const i = f({
5
+ setColorScheme: () => {
19
6
  }
7
+ }), y = () => w(i), p = (d) => {
8
+ const { defaultColorScheme: o = "system", storageKey: n = "theme", children: l } = d, [r, a] = h(() => v(n, o)), s = (e) => {
9
+ a(e), localStorage.setItem(n, e);
10
+ };
11
+ return c(() => {
12
+ const e = window ? window.matchMedia("(prefers-color-scheme: dark)") : void 0;
13
+ if (!e)
14
+ return;
15
+ const t = () => {
16
+ r === "system" && m("system");
17
+ };
18
+ return e.addEventListener?.("change", t), t(), () => {
19
+ e.removeEventListener?.("change", t);
20
+ };
21
+ }, [r]), c(() => {
22
+ if (!window)
23
+ return;
24
+ const e = (t) => {
25
+ t.key === n && (t.newValue ? a(t.newValue) : s(o));
26
+ };
27
+ return window.addEventListener("storage", e), () => {
28
+ window.removeEventListener("storage", e);
29
+ };
30
+ }, [s, o]), c(() => {
31
+ m(r);
32
+ }, [r]), /* @__PURE__ */ u(i.Provider, { value: { colorScheme: r, setColorScheme: s }, children: l });
20
33
  };
21
34
  export {
22
- i as ColorSchemeScript,
23
- a as colorSchemeScript
35
+ p as ThemeProvider,
36
+ y as useTheme
24
37
  };
@@ -1,13 +1,24 @@
1
- import { useState as s, useEffect as c } from "react";
2
- const l = (e, a) => {
3
- const [t, o] = s(() => {
4
- 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];
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { memo as n } from "react";
3
+ const i = n(({ storageKey: t, defaultColorScheme: o }) => /* @__PURE__ */ l(
4
+ "script",
5
+ {
6
+ suppressHydrationWarning: !0,
7
+ dangerouslySetInnerHTML: {
8
+ __html: `(${a.toString()})("${t}", "${o}")`
9
+ }
10
+ }
11
+ )), a = (t, o) => {
12
+ const [r, c] = ["theme-light", "theme-dark"];
13
+ try {
14
+ let e = localStorage.getItem(t) || o;
15
+ e === "system" && (e = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
16
+ const s = e === "dark" ? c : r;
17
+ document.documentElement.classList.remove(r, c), document.documentElement.classList.add(s), document.documentElement.style.colorScheme = e;
18
+ } catch {
19
+ }
10
20
  };
11
21
  export {
12
- l as useLocalStorage
22
+ i as ColorSchemeScript,
23
+ a as colorSchemeScript
13
24
  };
@@ -1,14 +1,13 @@
1
- import { useState as r, useCallback as t } from "react";
2
- const f = (s = !1) => {
3
- const [o, e] = r(s), a = t(() => {
4
- e(!0);
5
- }, []), l = t(() => {
6
- e(!1);
7
- }, []), u = t(() => {
8
- e((n) => !n);
9
- }, []);
10
- return [o, a, l, u];
1
+ import { useState as s, useEffect as c } from "react";
2
+ const l = (e, a) => {
3
+ const [t, o] = s(() => {
4
+ 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];
11
10
  };
12
11
  export {
13
- f as useBooleanState
12
+ l as useLocalStorage
14
13
  };
@@ -1,16 +1,14 @@
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];
1
+ import { useState as r, useCallback as t } from "react";
2
+ const f = (s = !1) => {
3
+ const [o, e] = r(s), a = t(() => {
4
+ e(!0);
5
+ }, []), l = t(() => {
6
+ e(!1);
7
+ }, []), u = t(() => {
8
+ e((n) => !n);
9
+ }, []);
10
+ return [o, a, l, u];
13
11
  };
14
12
  export {
15
- f as useResizeTextarea
13
+ f as useBooleanState
16
14
  };
@@ -1,16 +1,16 @@
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
- } };
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
13
  };
14
14
  export {
15
- d as useLoading
15
+ f as useResizeTextarea
16
16
  };
@@ -1,33 +1,16 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { useState as w, useEffect as i, useRef as d, useCallback as f, createContext as C, useContext as b } from "react";
3
- const k = 6e4, a = C(null), g = ({ children: t }) => {
4
- const r = d(/* @__PURE__ */ new Map()), s = f(
5
- (e, c) => {
6
- let n = r.current.get(e);
7
- return n || (n = {
8
- intervalId: window.setInterval(() => {
9
- const o = Date.now();
10
- n?.callbacks.forEach((l) => l(o));
11
- }, e),
12
- callbacks: /* @__PURE__ */ new Set()
13
- }, r.current.set(e, n)), n.callbacks.add(c), () => {
14
- const o = r.current.get(e);
15
- o && (o.callbacks.delete(c), o.callbacks.size === 0 && (window.clearInterval(o.intervalId), r.current.delete(e)));
16
- };
17
- },
18
- []
19
- );
20
- return /* @__PURE__ */ u(a.Provider, { value: s, children: t });
21
- }, x = () => {
22
- const t = b(a);
23
- if (t === null)
24
- throw new Error("NowContextProvider is not provided");
25
- return t;
26
- }, p = (t = k) => {
27
- const [r, s] = w(() => Date.now()), e = x();
28
- return i(() => e(t, s), [t, e]), r;
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
+ } };
29
13
  };
30
14
  export {
31
- g as NowContextProvider,
32
- p as useNow
15
+ d as useLoading
33
16
  };