@lazar-ui/kit 0.6.0 → 0.6.1

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 (70) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Actions-Cii4AnwJ.mjs +12 -0
  3. package/dist/Actions.css +1 -1
  4. package/dist/Content-1kg0isb_.mjs +12 -0
  5. package/dist/Content.css +1 -1
  6. package/dist/Context-BjkJbHVo.mjs +6 -0
  7. package/dist/Item-CBYGbEHN.mjs +47 -0
  8. package/dist/Item.css +1 -1
  9. package/dist/Panel-B-LZtrGB.mjs +11 -0
  10. package/dist/{Row-C-3TXoDz.mjs → Row-BfI8268z.mjs} +1 -1
  11. package/dist/Separator-FETQ3gHZ.mjs +9 -0
  12. package/dist/Separator.css +1 -0
  13. package/dist/{Tab-CR0KvVaA.mjs → Tab-BfpR10OT.mjs} +10 -11
  14. package/dist/Text-DQPy-DZ5.mjs +46 -0
  15. package/dist/Title-xHMuJWGl.mjs +12 -0
  16. package/dist/accordion.css +1 -1
  17. package/dist/accordion.js +23 -62
  18. package/dist/actions.d.ts +7 -7
  19. package/dist/actions.js +1 -1
  20. package/dist/breadcrumbs.js +1 -1
  21. package/dist/checkbox.css +1 -0
  22. package/dist/checkbox.d.ts +35 -10
  23. package/dist/checkbox.js +40 -2
  24. package/dist/content.d.ts +2 -2
  25. package/dist/content.js +1 -1
  26. package/dist/context.d.ts +7 -34
  27. package/dist/context.js +3 -5
  28. package/dist/dialog.css +1 -1
  29. package/dist/dialog.js +45 -56
  30. package/dist/drawer.js +2 -2
  31. package/dist/empty-state.css +1 -1
  32. package/dist/empty-state.js +48 -29
  33. package/dist/enums-DfSzOa3x.mjs +4 -0
  34. package/dist/enums-OoI2Qgqq.mjs +14 -0
  35. package/dist/{getComponentSlots-DD4iju8N.mjs → getComponentSlots-DwAYUFNk.mjs} +1 -1
  36. package/dist/getDecorationStyle-BCBONKEl.mjs +7 -0
  37. package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
  38. package/dist/item.d.ts +35 -9
  39. package/dist/item.js +1 -1
  40. package/dist/menu.css +1 -1
  41. package/dist/menu.js +83 -44
  42. package/dist/pagination.js +60 -48
  43. package/dist/panel.js +1 -1
  44. package/dist/radio.css +1 -1
  45. package/dist/radio.js +98 -42
  46. package/dist/row.js +1 -1
  47. package/dist/separator.d.ts +1 -21
  48. package/dist/separator.js +2 -22
  49. package/dist/tab.js +1 -1
  50. package/dist/table.js +2 -2
  51. package/dist/tabs.js +34 -31
  52. package/dist/text.js +1 -1
  53. package/dist/title.js +1 -1
  54. package/dist/typography.js +1 -1
  55. package/dist/utils.d.ts +75 -2
  56. package/dist/utils.js +17 -14
  57. package/package.json +1 -1
  58. package/dist/Actions-CEIXfLKN.mjs +0 -26
  59. package/dist/Checkbox-Chfzm1Z9.mjs +0 -46
  60. package/dist/Checkbox.css +0 -1
  61. package/dist/Content-ru2X8iBx.mjs +0 -13
  62. package/dist/Item-JbyvZy05.mjs +0 -66
  63. package/dist/Panel-Q06TIYep.mjs +0 -12
  64. package/dist/Provider-CBfZpO45.mjs +0 -12
  65. package/dist/Text-DiOqZt8E.mjs +0 -49
  66. package/dist/Title-aOeFD24v.mjs +0 -13
  67. package/dist/enums-CiPhZomh.mjs +0 -6
  68. package/dist/isValidReactNode-D1buElhX.mjs +0 -17
  69. package/dist/separator.css +0 -1
  70. package/dist/useTabsContext-DdF09jQq.mjs +0 -11
package/dist/radio.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";:root{--radio-bg: var(--lui-color-background-primary);--radio-border: var(--lui-color-border-primary);--radio-checked-bg: var(--lui-color-background-brand);--radio-checked-border: var(--lui-color-background-brand);--radio-dot-color: var(--lui-color-text-on-brand);--radio-disabled-bg: var(--lui-color-background-disabled);--radio-disabled-border: var(--lui-color-border-disabled);--radio-disabled-dot: var(--lui-color-text-disabled);--radio-error-border: var(--lui-color-border-focus-error);--radio-error-checked-bg: var(--lui-color-background-error);--radio-error-checked-border: var(--lui-color-background-error);--radio-radius: var(--lui-radius-full);--radio-hover-border: var(--lui-palette-gray-400);--radio-focus-shadow: 0 0 0 2px var(--lui-palette-brand-secondary);--radio-label-color: var(--lui-color-text-primary);--radio-description-color: var(--lui-color-text-tertiary);--radio-label-font-weight: var(--lui-font-weight-medium);--radio-gap: var(--lui-space-2);--radio-content-gap: 2px;--radio-content-padding-top: 1px;--radio-group-gap: var(--lui-space-2);--radio-transition-duration: .15s;--radio-transition-timing: cubic-bezier(.4, 0, .2, 1)}._root_pott0_33{border:none;display:flex;flex-direction:column;margin:0;padding:0}._root_pott0_33._vertical_pott0_40 ._group_pott0_40{flex-direction:column}._root_pott0_33._horizontal_pott0_43 ._group_pott0_40{flex-direction:row}._group_pott0_40{display:flex;gap:var(--radio-group-gap)}
1
+ @charset "UTF-8";._item_1mf7l_3{align-items:flex-start;cursor:pointer;display:inline-flex;gap:var(--radio-gap);position:relative;-webkit-user-select:none;user-select:none;vertical-align:middle}._item_1mf7l_3._disabled_1mf7l_12{cursor:not-allowed;opacity:.5}._item_1mf7l_3._invalid_1mf7l_17 ._radio_1mf7l_17{border-color:var(--radio-error-border)}._item_1mf7l_3._invalid_1mf7l_17 ._input_1mf7l_20:checked+._radio_1mf7l_17{background-color:var(--radio-error-checked-bg);border-color:var(--radio-error-checked-border)}._input_1mf7l_20{border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}._radio_1mf7l_17{align-items:center;background:var(--radio-bg);border:1px solid var(--radio-border);border-radius:var(--radio-radius);display:flex;flex-shrink:0;justify-content:center;position:relative;transition:background var(--radio-transition-duration) var(--radio-transition-timing),border-color var(--radio-transition-duration) var(--radio-transition-timing)}._radio_1mf7l_17:after{background:var(--radio-dot-color);border-radius:50%;content:"";opacity:0;position:absolute;transition:opacity var(--radio-transition-duration) var(--radio-transition-timing),transform var(--radio-transition-duration) var(--radio-transition-timing)}._content_1mf7l_63{display:flex;flex-direction:column;gap:var(--radio-content-gap);padding-top:var(--radio-content-padding-top)}._label_1mf7l_70{color:var(--radio-label-color);font-weight:var(--radio-label-font-weight)}._description_1mf7l_75{color:var(--radio-description-color);font-weight:var(--lui-font-weight-normal)}._item_1mf7l_3:not(._disabled_1mf7l_12) ._input_1mf7l_20:not(:checked):hover+._radio_1mf7l_17{border-color:var(--radio-hover-border)}._input_1mf7l_20:focus-visible+._radio_1mf7l_17{box-shadow:var(--radio-focus-shadow)}._input_1mf7l_20:checked+._radio_1mf7l_17{background:var(--radio-checked-bg);border-color:var(--radio-checked-border)}._input_1mf7l_20:checked+._radio_1mf7l_17:after{opacity:1}._disabled_1mf7l_12 ._input_1mf7l_20:checked+._radio_1mf7l_17{background:var(--radio-disabled-bg);border-color:var(--radio-disabled-border)}._disabled_1mf7l_12 ._input_1mf7l_20:checked+._radio_1mf7l_17:after{background:var(--radio-disabled-dot)}._disabled_1mf7l_12 ._input_1mf7l_20:not(:checked)+._radio_1mf7l_17{background:var(--radio-disabled-bg);border-color:var(--radio-disabled-border)}._sizeSm_1mf7l_113 ._radio_1mf7l_17{height:16px;width:16px}._sizeSm_1mf7l_113 ._radio_1mf7l_17:after{height:6px;width:6px}._sizeSm_1mf7l_113 ._label_1mf7l_70{font-size:var(--lui-font-size-sm);line-height:var(--line-height-sm)}._sizeSm_1mf7l_113 ._description_1mf7l_75{font-size:var(--lui-font-size-xs);line-height:var(--line-height-xs)}._sizeMd_1mf7l_130 ._radio_1mf7l_17{height:20px;width:20px}._sizeMd_1mf7l_130 ._radio_1mf7l_17:after{height:8px;width:8px}._sizeMd_1mf7l_130 ._label_1mf7l_70{font-size:var(--lui-font-size-md);line-height:var(--line-height-md)}._sizeMd_1mf7l_130 ._description_1mf7l_75{font-size:var(--lui-font-size-sm);line-height:var(--line-height-sm)}._sizeLg_1mf7l_147 ._radio_1mf7l_17{height:24px;width:24px}._sizeLg_1mf7l_147 ._radio_1mf7l_17:after{height:10px;width:10px}._sizeLg_1mf7l_147 ._label_1mf7l_70{font-size:var(--lui-font-size-lg);line-height:var(--line-height-lg)}._sizeLg_1mf7l_147 ._description_1mf7l_75{font-size:var(--lui-font-size-md);line-height:var(--line-height-md)}:root{--radio-bg: var(--lui-color-background-primary);--radio-border: var(--lui-color-border-primary);--radio-checked-bg: var(--lui-color-background-brand);--radio-checked-border: var(--lui-color-background-brand);--radio-dot-color: var(--lui-color-text-on-brand);--radio-disabled-bg: var(--lui-color-background-disabled);--radio-disabled-border: var(--lui-color-border-disabled);--radio-disabled-dot: var(--lui-color-text-disabled);--radio-error-border: var(--lui-color-border-focus-error);--radio-error-checked-bg: var(--lui-color-background-error);--radio-error-checked-border: var(--lui-color-background-error);--radio-radius: var(--lui-radius-full);--radio-hover-border: var(--lui-palette-gray-400);--radio-focus-shadow: 0 0 0 2px var(--lui-palette-brand-secondary);--radio-label-color: var(--lui-color-text-primary);--radio-description-color: var(--lui-color-text-tertiary);--radio-label-font-weight: var(--lui-font-weight-medium);--radio-gap: var(--lui-space-2);--radio-content-gap: 2px;--radio-content-padding-top: 1px;--radio-group-gap: var(--lui-space-2);--radio-transition-duration: .15s;--radio-transition-timing: cubic-bezier(.4, 0, .2, 1)}._root_pott0_33{border:none;display:flex;flex-direction:column;margin:0;padding:0}._root_pott0_33._vertical_pott0_40 ._group_pott0_40{flex-direction:column}._root_pott0_33._horizontal_pott0_43 ._group_pott0_40{flex-direction:row}._group_pott0_40{display:flex;gap:var(--radio-group-gap)}
package/dist/radio.js CHANGED
@@ -1,57 +1,113 @@
1
- import { C as V, D as h, I as M } from "./Item-JbyvZy05.mjs";
2
- import { jsx as s } from "react/jsx-runtime";
3
- import P, { useId as z, useState as A, useCallback as E } from "react";
4
- import T from "clsx";
5
- import { i as b } from "./isValidReactNode-D1buElhX.mjs";
1
+ import { jsx as s, jsxs as z } from "react/jsx-runtime";
2
+ import L, { createContext as S, useContext as E, useId as P, useState as A, useCallback as x, useRef as D } from "react";
3
+ import I from "clsx";
4
+ import { g as T } from "./getVariantClassName-DoCNtwBw.mjs";
5
+ import { i as k } from "./isValidReactNode-CmYwTWCE.mjs";
6
6
  import "lodash/camelCase";
7
- import './radio.css';const x = (e) => {
8
- const { children: i, name: c, value: t, defaultValue: d, onChange: a, size: r, disabled: m, invalid: u } = e, p = z(), v = c ?? p, o = t !== void 0, [n, g] = A(d), N = o ? t : n, I = E(
9
- (C) => {
10
- o || g(C), a?.(C);
7
+ import './radio.css';const R = S(null), $ = () => {
8
+ const e = E(R);
9
+ if (!e)
10
+ throw new Error("useRadioContext should be used inside Radio component");
11
+ return e;
12
+ }, j = (e) => {
13
+ const { children: n, name: a, value: i, defaultValue: l, onChange: r, size: m, disabled: _, invalid: t } = e, p = P(), v = a ?? p, c = i !== void 0, [d, f] = A(l), g = c ? i : d, N = x(
14
+ (h) => {
15
+ c || f(h), r?.(h);
11
16
  },
12
- [o, a]
17
+ [c, r]
13
18
  );
14
- return /* @__PURE__ */ s(V.Provider, { value: { disabled: m, invalid: u, name: v, onChange: I, size: r, value: N }, children: i });
19
+ return /* @__PURE__ */ s(R.Provider, { value: { disabled: _, invalid: t, name: v, onChange: N, size: m, value: g }, children: n });
20
+ }, b = "Radio", w = "_item_1mf7l_3", B = "_disabled_1mf7l_12", O = "_invalid_1mf7l_17", G = "_radio_1mf7l_17", U = "_input_1mf7l_20", Y = "_content_1mf7l_63", q = "_label_1mf7l_70", F = "_description_1mf7l_75", H = "_sizeSm_1mf7l_113", J = "_sizeMd_1mf7l_130", K = "_sizeLg_1mf7l_147", o = {
21
+ item: w,
22
+ disabled: B,
23
+ invalid: O,
24
+ radio: G,
25
+ input: U,
26
+ content: Y,
27
+ label: q,
28
+ description: F,
29
+ sizeSm: H,
30
+ sizeMd: J,
31
+ sizeLg: K
32
+ }, M = (e) => {
33
+ const { ref: n, children: a, value: i, description: l, disabled: r, onChange: m, ..._ } = e, t = $(), p = D(null), v = t.size ?? "md", c = t.value !== void 0 ? i === t.value : void 0, d = r !== void 0 ? r : t.disabled, f = t.invalid === !0, g = x(
34
+ (u) => {
35
+ p.current = u, typeof n == "function" ? n(u) : n && (n.current = u);
36
+ },
37
+ [n]
38
+ ), N = (u) => {
39
+ t.onChange?.(u.target.value), m?.(u);
40
+ }, h = I(
41
+ o.item,
42
+ T("size", v, o),
43
+ {
44
+ [o.disabled]: d,
45
+ [o.invalid]: f
46
+ }
47
+ );
48
+ return /* @__PURE__ */ z("label", { className: h, children: [
49
+ /* @__PURE__ */ s(
50
+ "input",
51
+ {
52
+ ref: g,
53
+ className: o.input,
54
+ type: "radio",
55
+ checked: c,
56
+ disabled: d,
57
+ "aria-invalid": f || void 0,
58
+ name: t.name,
59
+ value: i,
60
+ onChange: N,
61
+ ..._
62
+ }
63
+ ),
64
+ /* @__PURE__ */ s("span", { className: o.radio, "aria-hidden": "true" }),
65
+ (a || l) && /* @__PURE__ */ z("span", { className: o.content, children: [
66
+ a && /* @__PURE__ */ s("span", { className: o.label, children: a }),
67
+ l && /* @__PURE__ */ s("span", { className: o.description, children: l })
68
+ ] })
69
+ ] });
15
70
  };
16
- var _ = ((e) => (e.ITEM = `${h}.Item`, e))(_ || {}), D = /* @__PURE__ */ ((e) => (e.SM = "sm", e.MD = "md", e.LG = "lg", e))(D || {});
17
- const L = "_root_pott0_33", R = "_vertical_pott0_40", S = "_group_pott0_40", y = "_horizontal_pott0_43", l = {
18
- root: L,
19
- vertical: R,
20
- group: S,
21
- horizontal: y
22
- }, B = [_.ITEM], f = (e) => {
71
+ M.displayName = `${b}.Item`;
72
+ var V = ((e) => (e.ITEM = `${b}.Item`, e))(V || {}), Q = /* @__PURE__ */ ((e) => (e.SM = "sm", e.MD = "md", e.LG = "lg", e))(Q || {});
73
+ const W = "_root_pott0_33", X = "_vertical_pott0_40", Z = "_group_pott0_40", ee = "_horizontal_pott0_43", C = {
74
+ root: W,
75
+ vertical: X,
76
+ group: Z,
77
+ horizontal: ee
78
+ }, te = [V.ITEM], y = (e) => {
23
79
  const {
24
- children: i,
25
- name: c,
26
- value: t,
27
- defaultValue: d,
28
- onChange: a,
29
- vertical: r = !0,
30
- size: m = "md",
31
- disabled: u = !1,
80
+ children: n,
81
+ name: a,
82
+ value: i,
83
+ defaultValue: l,
84
+ onChange: r,
85
+ vertical: m = !0,
86
+ size: _ = "md",
87
+ disabled: t = !1,
32
88
  invalid: p = !1
33
- } = e, v = (n) => b(B, n) ? n : null, o = T(l.root, {
34
- [l.horizontal]: !r,
35
- [l.vertical]: r
89
+ } = e, v = (d) => k(te, d) ? d : null, c = I(C.root, {
90
+ [C.horizontal]: !m,
91
+ [C.vertical]: m
36
92
  });
37
93
  return /* @__PURE__ */ s(
38
- x,
94
+ j,
39
95
  {
40
- name: c,
41
- value: t,
42
- defaultValue: d,
43
- onChange: a,
44
- size: m,
45
- disabled: u,
96
+ name: a,
97
+ value: i,
98
+ defaultValue: l,
99
+ onChange: r,
100
+ size: _,
101
+ disabled: t,
46
102
  invalid: p,
47
- children: /* @__PURE__ */ s("fieldset", { className: o, children: /* @__PURE__ */ s("div", { className: l.group, children: P.Children.map(i, v) }) })
103
+ children: /* @__PURE__ */ s("fieldset", { className: c, children: /* @__PURE__ */ s("div", { className: C.group, children: L.Children.map(n, v) }) })
48
104
  }
49
105
  );
50
106
  };
51
- f.displayName = h;
52
- const O = f;
53
- O.Item = M;
107
+ y.displayName = b;
108
+ const ne = y;
109
+ ne.Item = M;
54
110
  export {
55
- D as ERadioSize,
56
- O as Radio
111
+ Q as ERadioSize,
112
+ ne as Radio
57
113
  };
package/dist/row.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R } from "./Row-C-3TXoDz.mjs";
1
+ import { R } from "./Row-BfI8268z.mjs";
2
2
  export {
3
3
  R as Row
4
4
  };
@@ -1,25 +1,5 @@
1
1
  import { default as default_2 } from 'react';
2
2
 
3
- declare interface IProps {
4
- /** Vertical orientation. Default: `false`. */
5
- vertical?: boolean;
6
- /** CSS colour of the line. Default: `var(--lui-color-border-primary)`. */
7
- color?: string;
8
- /** Removes padding around the line. Default: `false`. */
9
- bleed?: boolean;
10
- }
11
-
12
- /**
13
- * Separator component. Renders a horizontal or vertical dividing line.
14
- *
15
- * @example
16
- * ```tsx
17
- * <Separator />
18
- * <Separator vertical />
19
- * <Separator bleed />
20
- * <Separator vertical bleed color="var(--lui-color-text-success)" />
21
- * ```
22
- */
23
- export declare const Separator: default_2.FC<IProps>;
3
+ export declare const Separator: default_2.FC;
24
4
 
25
5
  export { }
package/dist/separator.js CHANGED
@@ -1,24 +1,4 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import c from "clsx";
3
- import './separator.css';const i = "Separator", _ = "_root_kvseh_5", n = "_vertical_kvseh_14", v = "_bleed_kvseh_21", o = {
4
- root: _,
5
- vertical: n,
6
- bleed: v
7
- }, m = (r) => {
8
- const { vertical: e = !1, color: t, bleed: s = !1 } = r, l = c(
9
- o.root,
10
- e && o.vertical,
11
- s && o.bleed
12
- );
13
- return /* @__PURE__ */ a(
14
- "hr",
15
- {
16
- className: l,
17
- style: { "--separator-color": t ?? "var(--lui-color-border-primary)" }
18
- }
19
- );
20
- };
21
- m.displayName = i;
1
+ import { S as o } from "./Separator-FETQ3gHZ.mjs";
22
2
  export {
23
- m as Separator
3
+ o as Separator
24
4
  };
package/dist/tab.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as r } from "./Tab-CR0KvVaA.mjs";
1
+ import { T as r } from "./Tab-BfpR10OT.mjs";
2
2
  export {
3
3
  r as Tab
4
4
  };
package/dist/table.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { A as d } from "./ActiveFilters-BJojmc-d.mjs";
2
2
  import { C as f } from "./Cell-BPBvEyeL.mjs";
3
- import { R as b } from "./Row-C-3TXoDz.mjs";
3
+ import { R as b } from "./Row-BfI8268z.mjs";
4
4
  import { T as A } from "./Toolbar-BJQy4qFI.mjs";
5
5
  import { jsxs as T, jsx as a } from "react/jsx-runtime";
6
6
  import R from "react";
7
- import { i as t } from "./isValidReactNode-D1buElhX.mjs";
7
+ import { i as t } from "./isValidReactNode-CmYwTWCE.mjs";
8
8
  import "lodash/camelCase";
9
9
  import { E as e } from "./enums-BnuDYTua.mjs";
10
10
  import './table.css';const w = "Table", C = "_wrapper_17sd8_5", _ = "_root_17sd8_11", l = {
package/dist/tabs.js CHANGED
@@ -1,37 +1,40 @@
1
- import { T as v } from "./Tab-CR0KvVaA.mjs";
2
- import { jsx as a, jsxs as T } from "react/jsx-runtime";
3
- import i from "react";
4
- import C from "clsx";
5
- import "./useTabsContext-DdF09jQq.mjs";
6
- import { P as h } from "./Provider-CBfZpO45.mjs";
7
- import { P as b } from "./Panel-Q06TIYep.mjs";
8
- import { i as g } from "./isValidReactNode-D1buElhX.mjs";
9
- import { g as N } from "./getVariantClassName-DoCNtwBw.mjs";
10
- import { E, a as P } from "./enums-CiPhZomh.mjs";
11
- import './tabs.css';const B = "_root_ndfzg_20", x = "_variantDefault_ndfzg_23", z = "_list_ndfzg_23", A = "_variantButtons_ndfzg_32", D = "_panel_ndfzg_45", t = {
12
- root: B,
13
- variantDefault: x,
14
- list: z,
15
- variantButtons: A,
16
- panel: D
17
- }, S = [E.TAB], l = (m) => {
18
- const { defaultActiveIndex: c = 0, children: p, onChange: d, variant: o = P.DEFAULT } = m, s = [], f = C(t.root, N("variant", o, t));
19
- let r = !1;
20
- const _ = (n, u) => {
21
- if (!g(S, n))
1
+ import { T as _ } from "./Tab-BfpR10OT.mjs";
2
+ import { jsx as i, jsxs as C } from "react/jsx-runtime";
3
+ import u, { useState as b, useId as h } from "react";
4
+ import g from "clsx";
5
+ import { C as E, E as I, a as N } from "./enums-OoI2Qgqq.mjs";
6
+ import { P as A } from "./Panel-B-LZtrGB.mjs";
7
+ import { i as P } from "./isValidReactNode-CmYwTWCE.mjs";
8
+ import { g as x } from "./getVariantClassName-DoCNtwBw.mjs";
9
+ import './tabs.css';const v = (a, e, s) => `${a}-${s}-${e}`, B = (a) => {
10
+ const { defaultActiveIndex: e = 0, children: s, onTabChange: l, variant: c } = a, [o, m] = b(e), n = h(), f = (t) => {
11
+ t !== o && (m(t), l && l(t));
12
+ }, r = (t) => v(n, t, "panel"), p = (t) => v(n, t, "tab");
13
+ return /* @__PURE__ */ i(E.Provider, { value: { activeIndex: o, baseId: n, getPanelId: r, getTabId: p, setActiveTab: f, variant: c }, children: s });
14
+ }, z = "_root_ndfzg_20", D = "_variantDefault_ndfzg_23", S = "_list_ndfzg_23", V = "_variantButtons_ndfzg_32", $ = "_panel_ndfzg_45", d = {
15
+ root: z,
16
+ variantDefault: D,
17
+ list: S,
18
+ variantButtons: V,
19
+ panel: $
20
+ }, j = [I.TAB], T = (a) => {
21
+ const { defaultActiveIndex: e = 0, children: s, onChange: l, variant: c = N.DEFAULT } = a, o = [], m = g(d.root, x("variant", c, d));
22
+ let n = !1;
23
+ const f = (r, p) => {
24
+ if (!P(j, r))
22
25
  return null;
23
- const { children: e = null } = n.props;
24
- return s.push(e), e && (r = !0), i.cloneElement(n, { index: u });
26
+ const { children: t = null } = r.props;
27
+ return o.push(t), t && (n = !0), u.cloneElement(r, { index: p });
25
28
  };
26
- return /* @__PURE__ */ a(h, { defaultActiveIndex: c, onTabChange: d, variant: o, children: /* @__PURE__ */ T("div", { className: f, children: [
27
- /* @__PURE__ */ a("div", { className: t.list, children: i.Children.map(p, _) }),
28
- r && /* @__PURE__ */ a("div", { className: t.panel, children: /* @__PURE__ */ a(b, { panels: s }) })
29
+ return /* @__PURE__ */ i(B, { defaultActiveIndex: e, onTabChange: l, variant: c, children: /* @__PURE__ */ C("div", { className: m, children: [
30
+ /* @__PURE__ */ i("div", { className: d.list, children: u.Children.map(s, f) }),
31
+ n && /* @__PURE__ */ i("div", { className: d.panel, children: /* @__PURE__ */ i(A, { panels: o }) })
29
32
  ] }) });
30
33
  };
31
- l.displayName = "Tabs";
32
- const V = l;
33
- V.Tab = v;
34
+ T.displayName = "Tabs";
35
+ const y = T;
36
+ y.Tab = _;
34
37
  export {
35
- P as ETabsVariant,
36
- V as Tabs
38
+ N as ETabsVariant,
39
+ y as Tabs
37
40
  };
package/dist/text.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as R } from "./Text-DiOqZt8E.mjs";
1
+ import { T as R } from "./Text-DQPy-DZ5.mjs";
2
2
  var a = /* @__PURE__ */ ((r) => (r.XS = "xs", r.SM = "sm", r.MD = "md", r.LG = "lg", r))(a || {}), d = /* @__PURE__ */ ((r) => (r.PRIMARY = "primary", r.SECONDARY = "secondary", r.TERTIARY = "tertiary", r.DISABLED = "disabled", r.BRAND = "brand", r))(d || {}), m = /* @__PURE__ */ ((r) => (r.NORMAL = "normal", r.MEDIUM = "medium", r.SEMIBOLD = "semibold", r.BOLD = "bold", r))(m || {});
3
3
  export {
4
4
  d as ETextColor,
package/dist/title.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as r } from "./Title-aOeFD24v.mjs";
1
+ import { T as r } from "./Title-xHMuJWGl.mjs";
2
2
  export {
3
3
  r as Title
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { H as r } from "./Heading-CL47Fqe7.mjs";
2
- import { T as t } from "./Text-DiOqZt8E.mjs";
2
+ import { T as t } from "./Text-DQPy-DZ5.mjs";
3
3
  export {
4
4
  r as Heading,
5
5
  t as Text
package/dist/utils.d.ts CHANGED
@@ -1,5 +1,78 @@
1
- export declare const getPageRange: (current: number, total: number) => TPageItem[];
1
+ import { default as default_2 } from 'react';
2
2
 
3
- export declare type TPageItem = number | 'ellipsis';
3
+ /**
4
+ * Фильтрует массив дочерних React-элементов, оставляя только допустимые компоненты
5
+ * @param children - Дочерние элементы React компонента
6
+ * @param acceptableComponents - Массив или объект с допустимыми подкомпонентами
7
+ * @returns Массив отфильтрованных дочерних элементов
8
+ */
9
+ export declare const filterValidChildren: (children: default_2.ReactNode, acceptableComponents: string | string[]) => default_2.ReactNode[];
10
+
11
+ /**
12
+ * Utility function to get component slots.
13
+ * @param children React children (array of ReactNodes).
14
+ * @param slots Array of slot names.
15
+ * @returns
16
+ */
17
+ export declare const getComponentSlots: <T extends string>(children: default_2.ReactNode, slots: readonly T[]) => IDefaultSlotNode & { [key in T]: default_2.ReactElement; };
18
+
19
+ /**
20
+ * Converts decoration props (`underline`, `strikethrough`) into a `textDecoration` CSS style object.
21
+ *
22
+ * Supports:
23
+ * - `underline: true` → `textDecoration: 'underline'`
24
+ * - `underline: 'dotted'` → `textDecoration: 'underline dotted'`
25
+ * - `strikethrough: true` → `textDecoration: 'line-through'`
26
+ * - Combined: both props produce a space-separated value.
27
+ *
28
+ * @returns A `React.CSSProperties` object with `textDecoration`, or `undefined` if no decoration is set.
29
+ */
30
+ export declare function getDecorationStyle(props: IDecorationProps): default_2.CSSProperties | undefined;
31
+
32
+ /**
33
+ * Utility to get the display name of a react element.
34
+ * @param element react element to get the display name.
35
+ * @returns
36
+ */
37
+ export declare const getReactElementDisplayName: (element: default_2.ReactElement) => string;
38
+
39
+ /**
40
+ * Utility function to get type-safety variant class name selector from CSS module stylesheet.
41
+ * @param prefix prefix for class name (name of variant).
42
+ * @param variant value of variant.
43
+ * @param styles styles of CSS module stylesheet.
44
+ *
45
+ * @example
46
+ * // Check `styles` for existing variant and return value of `styles.sizeMd`.
47
+ * getVariantClassName('size', 'md', styles);
48
+ */
49
+ export declare const getVariantClassName: <P extends string, T extends string>(prefix: P, variant: T, styles: TStyles<`${P}${Capitalize<T>}`>) => string;
50
+
51
+ declare interface IDecorationProps {
52
+ /** Underline decoration: `true` for simple underline, `'dotted'` for dotted underline. */
53
+ underline?: boolean | 'dotted';
54
+ /** Strikethrough decoration. */
55
+ strikethrough?: boolean;
56
+ }
57
+
58
+ declare interface IDefaultSlotNode {
59
+ children: default_2.ReactNode[];
60
+ [key: string]: default_2.ReactNode;
61
+ }
62
+
63
+ /**
64
+ * TypeGuard for checking if a React node is valid.
65
+ * @param name - name of the component
66
+ * @param node - React node.
67
+ * @param logWarning - if true, warning will be logged, otherwise it will be ignored.
68
+ * @returns
69
+ */
70
+ export declare const isValidReactNode: <TProps extends object>(name: string | string[], node: default_2.ReactNode, logWarning?: boolean) => node is default_2.ReactElement<TProps>;
71
+
72
+ /**
73
+ * Record of CSS modules styles for all variants.
74
+ * Must contain styles for all variants.
75
+ */
76
+ declare type TStyles<TProperty extends string = string> = Record<TProperty, string> & Record<string, string>;
4
77
 
5
78
  export { }
package/dist/utils.js CHANGED
@@ -1,17 +1,20 @@
1
- const s = (i, n) => Array.from({ length: n - i + 1 }, (c, l) => i + l), u = (i, n) => {
2
- if (n <= 7)
3
- return s(1, n);
4
- const t = Math.max(i - 1, 1), e = Math.min(i + 1, n), o = t > 2, r = e < n - 1;
5
- if (!o && r) {
6
- const g = Math.min(e + 1, n);
7
- return [...s(1, g), "ellipsis", n];
8
- }
9
- if (o && !r) {
10
- const g = Math.max(t - 1, 1);
11
- return [1, "ellipsis", ...s(g, n)];
12
- }
13
- return [1, "ellipsis", ...s(t, e), "ellipsis", n];
1
+ import a from "react";
2
+ import { i } from "./isValidReactNode-CmYwTWCE.mjs";
3
+ import { g as f } from "./isValidReactNode-CmYwTWCE.mjs";
4
+ import { g as c } from "./getComponentSlots-DwAYUFNk.mjs";
5
+ import { g as x } from "./getDecorationStyle-BCBONKEl.mjs";
6
+ import { g as h } from "./getVariantClassName-DoCNtwBw.mjs";
7
+ const l = (o, r) => {
8
+ const e = [];
9
+ return a.Children.forEach(o, (t) => {
10
+ i(r, t) && e.push(t);
11
+ }), e;
14
12
  };
15
13
  export {
16
- u as getPageRange
14
+ l as filterValidChildren,
15
+ c as getComponentSlots,
16
+ x as getDecorationStyle,
17
+ f as getReactElementDisplayName,
18
+ h as getVariantClassName,
19
+ i as isValidReactNode
17
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazar-ui/kit",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "license": "MIT",
5
5
  "description": "A component library for building admin panels, dashboards, and internal tools.",
6
6
  "homepage": "https://lazar-ui.github.io/docs",
@@ -1,26 +0,0 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import m, { cloneElement as l } from "react";
3
- import { i as p } from "./isValidReactNode-D1buElhX.mjs";
4
- import "lodash/camelCase";
5
- import './Actions.css';const o = "EmptyState";
6
- var e = ((t) => (t.ACTIONS = `${o}.Actions`, t.CONTENT = `${o}.Content`, t))(e || {});
7
- const A = "_actions_dl9xv_1", y = {
8
- actions: A
9
- }, N = ({ children: t }) => {
10
- const n = m.Children.toArray(t), i = n.map((r, a) => {
11
- if (!p("Button", r))
12
- return r;
13
- const s = r.props.variant;
14
- return l(r, {
15
- key: a,
16
- ...s ? {} : { variant: s ?? (a === 0 ? "primary" : "secondary") }
17
- });
18
- });
19
- return n.length === 0 ? null : /* @__PURE__ */ c("div", { className: y.actions, children: i });
20
- };
21
- N.displayName = e.ACTIONS;
22
- export {
23
- N as A,
24
- o as D,
25
- e as E
26
- };
@@ -1,46 +0,0 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import n from "clsx";
3
- import { I as h } from "./Icon-DUCBChX2.mjs";
4
- import { usePopoverContext as m } from "./popover.js";
5
- import { E as b } from "./enums-DUZMBQDd.mjs";
6
- import './Checkbox.css';const k = () => {
7
- const { state: s } = m();
8
- return {
9
- close: () => {
10
- s.close();
11
- }
12
- };
13
- }, _ = "_root_15rud_1", u = "_disabled_15rud_19", x = "_checkbox_15rud_27", C = "_checked_15rud_38", p = "_label_15rud_44", e = {
14
- root: _,
15
- disabled: u,
16
- checkbox: x,
17
- checked: C,
18
- label: p
19
- }, f = (s) => {
20
- const { checked: o, children: r, disabled: c = !1, onCheckedChange: a } = s, { close: l } = k(), d = n(
21
- e.root,
22
- c && e.disabled
23
- );
24
- return /* @__PURE__ */ i(
25
- "div",
26
- {
27
- "aria-checked": o,
28
- "aria-disabled": c,
29
- className: d,
30
- onClick: () => {
31
- c || (a && a(!o), l());
32
- },
33
- role: "menuitemcheckbox",
34
- tabIndex: c ? -1 : 0,
35
- children: [
36
- /* @__PURE__ */ t("span", { className: n(e.checkbox, o && e.checked), children: o && /* @__PURE__ */ t(h, { name: "check", size: 12, strokeWidth: 3 }) }),
37
- /* @__PURE__ */ t("span", { className: e.label, children: r })
38
- ]
39
- }
40
- );
41
- };
42
- f.displayName = b.CHECKBOX;
43
- export {
44
- f as C,
45
- k as u
46
- };
package/dist/Checkbox.css DELETED
@@ -1 +0,0 @@
1
- ._root_15rud_1{align-items:center;border-radius:var(--dropdown-item-radius);cursor:pointer;display:flex;font-size:var(--dropdown-item-font-size);gap:var(--dropdown-item-gap);outline:none;padding:var(--dropdown-item-padding-y) var(--dropdown-item-padding-x);transition:background-color .1s ease;-webkit-user-select:none;user-select:none}._root_15rud_1:hover{background:var(--lui-color-background-secondary)}._root_15rud_1:focus-visible{background:var(--lui-color-background-secondary)}._root_15rud_1._disabled_15rud_19{color:var(--lui-color-text-disabled);cursor:not-allowed}._root_15rud_1._disabled_15rud_19:hover{background:transparent}._checkbox_15rud_27{align-items:center;border:1.5px solid var(--lui-color-border-primary);border-radius:var(--lui-radius-1);display:inline-flex;flex-shrink:0;height:16px;justify-content:center;transition:all .1s ease;width:16px}._checkbox_15rud_27._checked_15rud_38{background:var(--lui-color-background-brand);border-color:var(--lui-color-background-brand);color:var(--lui-color-text-on-brand)}._label_15rud_44{flex:1;overflow:hidden;text-overflow:ellipsis}
@@ -1,13 +0,0 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { Popover as r } from "./popover.js";
3
- import { E as e } from "./enums-DUZMBQDd.mjs";
4
- import './Content.css';const s = "_root_1h0xj_14", m = {
5
- root: s
6
- }, p = (t) => {
7
- const { children: n } = t;
8
- return /* @__PURE__ */ o(r.Content, { padding: !1, children: /* @__PURE__ */ o("div", { className: m.root, children: n }) });
9
- };
10
- p.displayName = e.CONTENT;
11
- export {
12
- p as C
13
- };
@@ -1,66 +0,0 @@
1
- import { jsxs as _, jsx as a } from "react/jsx-runtime";
2
- import { createContext as x, useContext as g, useRef as N, useCallback as R } from "react";
3
- import I from "clsx";
4
- import { g as y } from "./getVariantClassName-DoCNtwBw.mjs";
5
- import './Item.css';const D = x(null), L = () => {
6
- const n = g(D);
7
- if (!n)
8
- throw new Error("useRadioContext should be used inside Radio component");
9
- return n;
10
- }, M = "Radio", S = "_item_1mf7l_3", k = "_disabled_1mf7l_12", j = "_invalid_1mf7l_17", w = "_radio_1mf7l_17", A = "_input_1mf7l_20", E = "_content_1mf7l_63", P = "_label_1mf7l_70", V = "_description_1mf7l_75", Y = "_sizeSm_1mf7l_113", $ = "_sizeMd_1mf7l_130", q = "_sizeLg_1mf7l_147", e = {
11
- item: S,
12
- disabled: k,
13
- invalid: j,
14
- radio: w,
15
- input: A,
16
- content: E,
17
- label: P,
18
- description: V,
19
- sizeSm: Y,
20
- sizeMd: $,
21
- sizeLg: q
22
- }, B = (n) => {
23
- const { ref: i, children: o, value: c, description: l, disabled: d, onChange: u, ...f } = n, s = L(), p = N(null), b = s.size ?? "md", v = s.value !== void 0 ? c === s.value : void 0, r = d !== void 0 ? d : s.disabled, m = s.invalid === !0, h = R(
24
- (t) => {
25
- p.current = t, typeof i == "function" ? i(t) : i && (i.current = t);
26
- },
27
- [i]
28
- ), C = (t) => {
29
- s.onChange?.(t.target.value), u?.(t);
30
- }, z = I(
31
- e.item,
32
- y("size", b, e),
33
- {
34
- [e.disabled]: r,
35
- [e.invalid]: m
36
- }
37
- );
38
- return /* @__PURE__ */ _("label", { className: z, children: [
39
- /* @__PURE__ */ a(
40
- "input",
41
- {
42
- ref: h,
43
- className: e.input,
44
- type: "radio",
45
- checked: v,
46
- disabled: r,
47
- "aria-invalid": m || void 0,
48
- name: s.name,
49
- value: c,
50
- onChange: C,
51
- ...f
52
- }
53
- ),
54
- /* @__PURE__ */ a("span", { className: e.radio, "aria-hidden": "true" }),
55
- (o || l) && /* @__PURE__ */ _("span", { className: e.content, children: [
56
- o && /* @__PURE__ */ a("span", { className: e.label, children: o }),
57
- l && /* @__PURE__ */ a("span", { className: e.description, children: l })
58
- ] })
59
- ] });
60
- };
61
- B.displayName = `${M}.Item`;
62
- export {
63
- D as C,
64
- M as D,
65
- B as I
66
- };