@lazar-ui/kit 0.3.0 → 0.5.0

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.
package/dist/select.js CHANGED
@@ -1,9 +1,9 @@
1
- import { jsxs as c, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
2
2
  import { useState as P, useCallback as h } from "react";
3
3
  import p from "clsx";
4
4
  import { I as m } from "./Icon-DsTlU3j3.mjs";
5
5
  import { Popover as b } from "./popover.js";
6
- import { u as O } from "./useLocale-DdHNhmvT.mjs";
6
+ import { u as O } from "./useLocale-CJh-krrY.mjs";
7
7
  import { g as D } from "./getVariantClassName-D7Nhpuec.mjs";
8
8
  import './select.css';const I = "Select", M = "bottom start", A = "_root_t7wta_7", B = "_disabled_t7wta_28", E = "_invalid_t7wta_35", j = "_sizeSm_t7wta_39", F = "_sizeMd_t7wta_45", U = "_sizeLg_t7wta_51", V = "_displayText_t7wta_57", W = "_displayTextPlaceholder_t7wta_64", Y = "_indicators_t7wta_68", q = "_clearButton_t7wta_74", G = "_chevron_t7wta_92", H = "_optionsList_t7wta_103", J = "_noOptions_t7wta_112", K = "_option_t7wta_103", Q = "_optionSelected_t7wta_132", R = "_optionDisabled_t7wta_138", X = "_optionLabel_t7wta_146", Z = "_checkbox_t7wta_153", $ = "_checkboxChecked_t7wta_165", t = {
9
9
  root: A,
@@ -30,38 +30,38 @@ import './select.css';const I = "Select", M = "bottom start", A = "_root_t7wta_7
30
30
  clearable: w = !1,
31
31
  disabled: i = !1,
32
32
  invalid: u = !1,
33
- multiple: a = !1,
33
+ multiple: s = !1,
34
34
  onChange: o,
35
35
  options: d,
36
36
  placeholder: k,
37
- size: C = "md",
37
+ size: S = "md",
38
38
  value: n
39
- } = v, [g, x] = P(!1), _ = O(), r = a ? d.filter((e) => n?.includes(e.value)) : d.filter((e) => e.value === n), f = r.length > 0 ? r.map((e) => e.label).join(", ") : k ?? _.select.placeholder, L = h(
39
+ } = v, [C, x] = P(!1), _ = O(), r = s ? d.filter((e) => n?.includes(e.value)) : d.filter((e) => e.value === n), f = r.length > 0 ? r.map((e) => e.label).join(", ") : k ?? _.Select.placeholder, g = h(
40
40
  (e) => {
41
41
  if (!e.disabled && o)
42
- if (a) {
42
+ if (s) {
43
43
  const l = n ?? [], y = l.includes(e.value) ? l.filter((T) => T !== e.value) : [...l, e.value];
44
44
  o(y);
45
45
  } else
46
46
  o(e.value), x(!1);
47
47
  },
48
- [a, o, n]
49
- ), N = h(
48
+ [s, o, n]
49
+ ), L = h(
50
50
  (e) => {
51
- e.stopPropagation(), o && o(a ? [] : "");
51
+ e.stopPropagation(), o && o(s ? [] : "");
52
52
  },
53
- [a, o]
54
- ), S = h(
55
- (e) => a ? n?.includes(e) ?? !1 : n === e,
56
- [a, n]
53
+ [s, o]
54
+ ), N = h(
55
+ (e) => s ? n?.includes(e) ?? !1 : n === e,
56
+ [s, n]
57
57
  ), z = p(
58
58
  t.root,
59
- D("size", C, t),
59
+ D("size", S, t),
60
60
  i && t.disabled,
61
61
  u && t.invalid
62
62
  );
63
- return /* @__PURE__ */ c(b, { onOpenChange: x, open: g, placement: M, children: [
64
- /* @__PURE__ */ s(b.Trigger, { children: /* @__PURE__ */ c(
63
+ return /* @__PURE__ */ c(b, { onOpenChange: x, open: C, placement: M, children: [
64
+ /* @__PURE__ */ a(b.Trigger, { children: /* @__PURE__ */ c(
65
65
  "div",
66
66
  {
67
67
  "aria-disabled": i,
@@ -71,34 +71,34 @@ import './select.css';const I = "Select", M = "bottom start", A = "_root_t7wta_7
71
71
  tabIndex: i ? -1 : 0,
72
72
  onClick: i ? (e) => e.stopPropagation() : void 0,
73
73
  children: [
74
- /* @__PURE__ */ s("span", { className: p(t.displayText, !r.length && t.displayTextPlaceholder), children: f }),
74
+ /* @__PURE__ */ a("span", { className: p(t.displayText, !r.length && t.displayTextPlaceholder), children: f }),
75
75
  /* @__PURE__ */ c("span", { className: t.indicators, children: [
76
- w && r.length > 0 && !i && /* @__PURE__ */ s(
76
+ w && r.length > 0 && !i && /* @__PURE__ */ a(
77
77
  "button",
78
78
  {
79
- "aria-label": _.select.clear,
79
+ "aria-label": _.Select.clear,
80
80
  className: t.clearButton,
81
- onClick: N,
81
+ onClick: L,
82
82
  tabIndex: -1,
83
83
  type: "button",
84
- children: /* @__PURE__ */ s(m, { name: "x", size: 14 })
84
+ children: /* @__PURE__ */ a(m, { name: "x", size: 14 })
85
85
  }
86
86
  ),
87
- /* @__PURE__ */ s("span", { className: t.chevron, children: /* @__PURE__ */ s(m, { name: "chevron-down", size: 16 }) })
87
+ /* @__PURE__ */ a("span", { className: t.chevron, children: /* @__PURE__ */ a(m, { name: "chevron-down", size: 16 }) })
88
88
  ] })
89
89
  ]
90
90
  }
91
91
  ) }),
92
- /* @__PURE__ */ s(b.Content, { padding: !1, children: /* @__PURE__ */ c(
92
+ /* @__PURE__ */ a(b.Content, { padding: !1, children: /* @__PURE__ */ c(
93
93
  "ul",
94
94
  {
95
95
  "aria-label": f,
96
96
  className: t.optionsList,
97
97
  role: "listbox",
98
98
  children: [
99
- d.length === 0 && /* @__PURE__ */ s("li", { className: t.noOptions, children: _.select.noOptions }),
99
+ d.length === 0 && /* @__PURE__ */ a("li", { className: t.noOptions, children: _.Select.noOptions }),
100
100
  d.map((e) => {
101
- const l = S(e.value);
101
+ const l = N(e.value);
102
102
  return /* @__PURE__ */ c(
103
103
  "li",
104
104
  {
@@ -110,12 +110,12 @@ import './select.css';const I = "Select", M = "bottom start", A = "_root_t7wta_7
110
110
  e.disabled && t.optionDisabled
111
111
  ),
112
112
  onClick: () => {
113
- L(e);
113
+ g(e);
114
114
  },
115
115
  role: "option",
116
116
  children: [
117
- a && /* @__PURE__ */ s("span", { className: p(t.checkbox, l && t.checkboxChecked), children: l && /* @__PURE__ */ s(m, { name: "check", size: 12, strokeWidth: 3 }) }),
118
- /* @__PURE__ */ s("span", { className: t.optionLabel, children: e.label })
117
+ s && /* @__PURE__ */ a("span", { className: p(t.checkbox, l && t.checkboxChecked), children: l && /* @__PURE__ */ a(m, { name: "check", size: 12, strokeWidth: 3 }) }),
118
+ /* @__PURE__ */ a("span", { className: t.optionLabel, children: e.label })
119
119
  ]
120
120
  },
121
121
  e.value
package/dist/table.css CHANGED
@@ -1 +1 @@
1
- :root{--cell-bg-header: var(--lui-color-background-tertiary);--cell-border-header: var(--lui-color-border-secondary);--cell-padding: var(--lui-space-3) var(--lui-space-4);--cell-max-width: 200px}._root_lmxwt_8{background-color:transparent;border-bottom:1px solid var(--lui-color-border-primary);max-width:var(--cell-max-width);overflow:hidden;padding:var(--cell-padding);text-overflow:ellipsis;white-space:nowrap}._root_lmxwt_8._header_lmxwt_17{background-color:var(--cell-bg-header);border-bottom:2px solid var(--cell-border-header)}._root_lmxwt_8._alignLeft_lmxwt_21{text-align:left}._root_lmxwt_8._alignRight_lmxwt_24{text-align:right}._root_lmxwt_8._alignCenter_lmxwt_27{text-align:center}:root{--table-bg-stripe: var(--lui-color-background-secondary)}._root_t4731_5{background-color:var(--lui-color-background-primary);border-bottom:1px solid var(--lui-color-border-primary);transition:background-color .2s}._root_t4731_5:nth-child(odd){background-color:var(--table-bg-stripe)}._root_t4731_5:hover{background-color:var(--lui-color-background-brand-secondary)}:root{--table-font-size: var(--lui-font-size-md)}._root_k8vfx_5{border-collapse:collapse;font-size:var(--table-font-size);table-layout:fixed;width:100%}
1
+ :root{--active-filters-gap: var(--lui-space-2)}._root_4qb7d_5{align-items:center;display:flex;flex-wrap:wrap;gap:var(--active-filters-gap)}:root{--cell-bg-header: var(--lui-color-background-tertiary);--cell-border-header: var(--lui-color-border-secondary);--cell-padding: var(--lui-space-3) var(--lui-space-4);--cell-max-width: 200px}._root_lmxwt_8{background-color:transparent;border-bottom:1px solid var(--lui-color-border-primary);max-width:var(--cell-max-width);overflow:hidden;padding:var(--cell-padding);text-overflow:ellipsis;white-space:nowrap}._root_lmxwt_8._header_lmxwt_17{background-color:var(--cell-bg-header);border-bottom:2px solid var(--cell-border-header)}._root_lmxwt_8._alignLeft_lmxwt_21{text-align:left}._root_lmxwt_8._alignRight_lmxwt_24{text-align:right}._root_lmxwt_8._alignCenter_lmxwt_27{text-align:center}:root{--table-bg-stripe: var(--lui-color-background-secondary)}._root_t4731_5{background-color:var(--lui-color-background-primary);border-bottom:1px solid var(--lui-color-border-primary);transition:background-color .2s}._root_t4731_5:nth-child(odd){background-color:var(--table-bg-stripe)}._root_t4731_5:hover{background-color:var(--lui-color-background-brand-secondary)}:root{--toolbar-gap: var(--lui-space-3);--toolbar-padding: var(--lui-space-3) 0}._root_d4szt_6{align-items:center;display:flex;gap:var(--toolbar-gap);padding:var(--toolbar-padding)}:root{--table-font-size: var(--lui-font-size-md)}._wrapper_17sd8_5{display:flex;flex-direction:column;gap:var(--lui-space-4)}._root_17sd8_11{border-collapse:collapse;font-size:var(--table-font-size);table-layout:fixed;width:100%}
package/dist/table.d.ts CHANGED
@@ -1,12 +1,44 @@
1
1
  import { default as default_2 } from 'react';
2
2
 
3
+ /**
4
+ * Table.ActiveFilters — displays active filter chips with individual remove buttons
5
+ * and an optional "Clear all" button.
6
+ *
7
+ * Returns `null` when there are no active filters.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <Table.ActiveFilters
12
+ * filters={[
13
+ * { key: 'status', label: 'Status', value: 'Active' },
14
+ * { key: 'role', label: 'Role', value: 'Admin' },
15
+ * ]}
16
+ * onRemove={(key) => console.log('remove', key)}
17
+ * onClearAll={() => console.log('clear all')}
18
+ * />
19
+ * ```
20
+ */
21
+ declare const ActiveFilters: default_2.FC<IProps>;
22
+
3
23
  /**
4
24
  * Table cell. Must be used as a child of `<Table.Row>`.
5
25
  * Supports text alignment and header styling via `as="th"`.
6
26
  */
7
- declare const Cell: default_2.FC<IProps>;
27
+ declare const Cell: default_2.FC<IProps_2>;
28
+
29
+ export declare interface IFilterItem {
30
+ key: string;
31
+ label: string;
32
+ value: string;
33
+ }
8
34
 
9
- declare interface IProps extends default_2.PropsWithChildren {
35
+ declare interface IProps {
36
+ filters: IFilterItem[];
37
+ onRemove: (key: string) => void;
38
+ onClearAll?: () => void;
39
+ }
40
+
41
+ declare interface IProps_2 extends default_2.PropsWithChildren {
10
42
  /** Text alignment. */
11
43
  align?: 'left' | 'center' | 'right';
12
44
  /** HTML tag: `'td'` (default) or `'th'`. */
@@ -17,7 +49,10 @@ declare interface IProps extends default_2.PropsWithChildren {
17
49
  width?: string;
18
50
  }
19
51
 
20
- declare interface IProps_2 extends default_2.PropsWithChildren {
52
+ declare interface IProps_3 extends default_2.PropsWithChildren {
53
+ }
54
+
55
+ declare interface IProps_4 extends default_2.PropsWithChildren {
21
56
  }
22
57
 
23
58
  export declare interface ITableProps extends default_2.PropsWithChildren {
@@ -27,34 +62,49 @@ export declare interface ITableProps extends default_2.PropsWithChildren {
27
62
  * Table row. Must be used as a child of `<Table>`.
28
63
  * Accepts `<Table.Cell>` children.
29
64
  */
30
- declare const Row: default_2.FC<IProps_2>;
65
+ declare const Row: default_2.FC<IProps_3>;
31
66
 
32
67
  export declare const Table: TTableCompoundComponent;
33
68
 
34
69
  /**
35
70
  * Table container. Renders an HTML `<table>` with striped rows and hover effects.
36
71
  *
72
+ * Supports an optional `<Table.Toolbar>` child rendered above the table.
37
73
  * Uses compound component pattern via `<Table.Row>` and `<Table.Cell>`.
38
74
  *
39
75
  * @example
40
76
  * ```tsx
41
77
  * <Table>
78
+ * <Table.Toolbar>
79
+ * <Input placeholder="Search..." />
80
+ * </Table.Toolbar>
42
81
  * <Table.Row>
43
82
  * <Table.Cell as="th">Name</Table.Cell>
44
- * <Table.Cell as="th">Role</Table.Cell>
45
- * </Table.Row>
46
- * <Table.Row>
47
- * <Table.Cell>John</Table.Cell>
48
- * <Table.Cell>Developer</Table.Cell>
49
83
  * </Table.Row>
50
84
  * </Table>
51
85
  * ```
52
86
  */
53
87
  declare const Table_2: default_2.FC<ITableProps>;
54
88
 
89
+ /**
90
+ * Table.Toolbar — a simple flex-wrapper that sits above the Table
91
+ * and contains arbitrary controls (inputs, buttons, filters, etc.).
92
+ *
93
+ * @example
94
+ * ```tsx
95
+ * <Table.Toolbar>
96
+ * <Input placeholder="Search..." />
97
+ * <Button>Export</Button>
98
+ * </Table.Toolbar>
99
+ * ```
100
+ */
101
+ declare const Toolbar: default_2.FC<IProps_4>;
102
+
55
103
  declare type TTableCompoundComponent = typeof Table_2 & {
104
+ ActiveFilters: typeof ActiveFilters;
56
105
  Cell: typeof Cell;
57
106
  Row: typeof Row;
107
+ Toolbar: typeof Toolbar;
58
108
  };
59
109
 
60
110
  export { }
package/dist/table.js CHANGED
@@ -1,40 +1,79 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import p from "clsx";
3
- import s from "react";
4
- import { g as f } from "./getVariantClassName-D7Nhpuec.mjs";
1
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
+ import T, { useCallback as p } from "react";
3
+ import { B as u } from "./Button-BYnrV9av.mjs";
4
+ import { C as L } from "./Chip-DLfYGIQG.mjs";
5
+ import { u as y } from "./useLocale-CJh-krrY.mjs";
6
+ import R from "clsx";
7
+ import { g as w } from "./getVariantClassName-D7Nhpuec.mjs";
5
8
  import { i } from "./isValidReactNode-CmYwTWCE.mjs";
6
9
  import "./camelCase-PtIYufW8.mjs";
7
- import './table.css';var n = /* @__PURE__ */ ((t) => (t.CELL = "Table.Cell", t.ROW = "Table.Row", t))(n || {});
8
- const u = "_root_lmxwt_8", L = "_header_lmxwt_17", N = "_alignLeft_lmxwt_21", R = "_alignRight_lmxwt_24", w = "_alignCenter_lmxwt_27", a = {
9
- root: u,
10
- header: L,
11
- alignLeft: N,
12
- alignRight: R,
13
- alignCenter: w
14
- }, c = (t) => {
15
- const { align: r = "left", as: e = "td", children: o, title: g, width: h } = t, C = p(a.root, f("align", r, a), {
16
- [a.header]: e === "th"
10
+ import './table.css';const $ = "Table.ActiveFilters", v = "_root_4qb7d_5", x = {
11
+ root: v
12
+ }, b = (t) => {
13
+ const { filters: e, onClearAll: o, onRemove: r } = t, c = y(), l = p(
14
+ (a) => () => {
15
+ r(a);
16
+ },
17
+ [r]
18
+ ), m = p(() => {
19
+ o?.();
20
+ }, [o]);
21
+ return e.length === 0 ? null : /* @__PURE__ */ h("div", { className: x.root, children: [
22
+ e.map((a) => /* @__PURE__ */ h(L, { onDelete: l(a.key), children: [
23
+ a.label,
24
+ ": ",
25
+ a.value
26
+ ] }, a.key)),
27
+ o && /* @__PURE__ */ n(u, { mode: "text", size: "sm", onClick: m, children: c.Table.ActiveFilters.clearAll })
28
+ ] });
29
+ };
30
+ b.displayName = $;
31
+ var s = /* @__PURE__ */ ((t) => (t.CELL = "Table.Cell", t.ROW = "Table.Row", t.TOOLBAR = "Table.Toolbar", t))(s || {});
32
+ const O = "_root_lmxwt_8", k = "_header_lmxwt_17", B = "_alignLeft_lmxwt_21", F = "_alignRight_lmxwt_24", D = "_alignCenter_lmxwt_27", _ = {
33
+ root: O,
34
+ header: k,
35
+ alignLeft: B,
36
+ alignRight: F,
37
+ alignCenter: D
38
+ }, g = (t) => {
39
+ const { align: e = "left", as: o = "td", children: r, title: c, width: l } = t, m = R(_.root, w("align", e, _), {
40
+ [_.header]: o === "th"
17
41
  });
18
- return /* @__PURE__ */ l(e, { className: C, title: g, width: h, children: o });
42
+ return /* @__PURE__ */ n(o, { className: m, title: c, width: l, children: r });
43
+ };
44
+ g.displayName = s.CELL;
45
+ const E = "_root_t4731_5", I = {
46
+ root: E
47
+ }, A = (t) => {
48
+ const { children: e } = t, o = (r) => i(s.CELL, r) ? r : null;
49
+ return /* @__PURE__ */ n("tr", { className: I.root, children: T.Children.map(e, o) });
19
50
  };
20
- c.displayName = n.CELL;
21
- const x = "_root_t4731_5", T = {
22
- root: x
23
- }, m = (t) => {
24
- const { children: r } = t, e = (o) => i(n.CELL, o) ? o : null;
25
- return /* @__PURE__ */ l("tr", { className: T.root, children: s.Children.map(r, e) });
51
+ A.displayName = s.ROW;
52
+ const M = "Table.Toolbar", P = "_root_d4szt_6", W = {
53
+ root: P
54
+ }, f = (t) => {
55
+ const { children: e } = t;
56
+ return /* @__PURE__ */ n("div", { className: W.root, children: e });
26
57
  };
27
- m.displayName = n.ROW;
28
- const b = "Table", y = "_root_k8vfx_5", $ = {
29
- root: y
30
- }, d = (t) => {
31
- const { children: r } = t, e = (o) => i(n.ROW, o) ? o : null;
32
- return /* @__PURE__ */ l("table", { className: $.root, children: /* @__PURE__ */ l("tbody", { children: s.Children.map(r, e) }) });
58
+ f.displayName = M;
59
+ const Y = "Table", j = "_wrapper_17sd8_5", z = "_root_17sd8_11", C = {
60
+ wrapper: j,
61
+ root: z
62
+ }, N = (t) => {
63
+ const { children: e } = t, o = T.Children.toArray(e), r = o.find(
64
+ (l) => i(s.TOOLBAR, l, !1)
65
+ ), c = o.filter((l) => !i(s.TOOLBAR, l, !1)).filter((l) => i(s.ROW, l, !0));
66
+ return /* @__PURE__ */ h("div", { className: C.wrapper, children: [
67
+ r,
68
+ /* @__PURE__ */ n("table", { className: C.root, children: /* @__PURE__ */ n("tbody", { children: c }) })
69
+ ] });
33
70
  };
34
- d.displayName = b;
35
- const _ = d;
36
- _.Cell = c;
37
- _.Row = m;
71
+ N.displayName = Y;
72
+ const d = N;
73
+ d.ActiveFilters = b;
74
+ d.Cell = g;
75
+ d.Row = A;
76
+ d.Toolbar = f;
38
77
  export {
39
- _ as Table
78
+ d as Table
40
79
  };
@@ -0,0 +1,106 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { createContext as u, useMemo as l, useEffect as g, useContext as f } from "react";
3
+ const c = u(null), a = {
4
+ Chip: {
5
+ remove: "Remove"
6
+ },
7
+ Dialog: {
8
+ close: "Close"
9
+ },
10
+ Drawer: {
11
+ Header: {
12
+ close: "Close"
13
+ }
14
+ },
15
+ Input: {
16
+ Password: {
17
+ passwordHide: "Hide password",
18
+ passwordShow: "Show password"
19
+ }
20
+ },
21
+ Pagination: {
22
+ Item: {
23
+ page: "Page {page}"
24
+ },
25
+ items: "items",
26
+ label: "Pagination",
27
+ next: "Next page",
28
+ of: "of",
29
+ prev: "Previous page"
30
+ },
31
+ Select: {
32
+ clear: "Clear",
33
+ noOptions: "No options",
34
+ placeholder: "Select..."
35
+ },
36
+ Table: {
37
+ ActiveFilters: {
38
+ clearAll: "Clear all",
39
+ remove: "Remove filter:"
40
+ }
41
+ }
42
+ }, v = {
43
+ Chip: {
44
+ remove: "Удалить"
45
+ },
46
+ Dialog: {
47
+ close: "Закрыть"
48
+ },
49
+ Drawer: {
50
+ Header: {
51
+ close: "Закрыть"
52
+ }
53
+ },
54
+ Input: {
55
+ Password: {
56
+ passwordHide: "Скрыть пароль",
57
+ passwordShow: "Показать пароль"
58
+ }
59
+ },
60
+ Pagination: {
61
+ Item: {
62
+ page: "Страница {page}"
63
+ },
64
+ items: "элементов",
65
+ label: "Пагинация",
66
+ next: "Следующая страница",
67
+ of: "из",
68
+ prev: "Предыдущая страница"
69
+ },
70
+ Select: {
71
+ clear: "Очистить",
72
+ noOptions: "Нет вариантов",
73
+ placeholder: "Выберите..."
74
+ },
75
+ Table: {
76
+ ActiveFilters: {
77
+ clearAll: "Очистить всё",
78
+ remove: "Удалить фильтр:"
79
+ }
80
+ }
81
+ }, w = { en: a, ru: v }, i = (e, n) => {
82
+ const t = { ...e };
83
+ for (const s of Object.keys(n)) {
84
+ const o = n[s], r = e[s];
85
+ o && typeof o == "object" && !Array.isArray(o) && r && typeof r == "object" && !Array.isArray(r) ? t[s] = i(
86
+ r,
87
+ o
88
+ ) : o !== void 0 && (t[s] = o);
89
+ }
90
+ return t;
91
+ }, h = (e) => l(() => e ? typeof e == "string" ? w[e] ?? a : i(a, e) : a, [e]), C = (e) => {
92
+ const { children: n, theme: t = "light", locale: s, themeTarget: o } = e, r = h(s);
93
+ g(() => {
94
+ const d = o ?? document.documentElement;
95
+ d.dataset.theme = t;
96
+ }, [t, o]);
97
+ const p = l(() => ({ locale: r, theme: t }), [t, r]);
98
+ return /* @__PURE__ */ m(c.Provider, { value: p, children: n });
99
+ };
100
+ C.displayName = "LazarUiProvider";
101
+ const y = () => f(c)?.locale ?? a;
102
+ export {
103
+ c as C,
104
+ C as L,
105
+ y as u
106
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazar-ui/kit",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
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",
@@ -38,7 +38,7 @@
38
38
  "build": "vite build",
39
39
  "check-types": "tsc --noEmit",
40
40
  "clean": "rm -rf node_modules",
41
- "dev": "npm run watch:tsm",
41
+ "dev": "",
42
42
  "lint": "eslint src --max-warnings 100 || true",
43
43
  "lint:styles": "stylelint \"src/components/**/*.scss\"",
44
44
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
@@ -48,9 +48,7 @@
48
48
  "gen:component:ai": "node scripts/generate-component.mjs",
49
49
  "test": "vitest run",
50
50
  "test:coverage": "vitest run --coverage",
51
- "test:watch": "vitest",
52
- "tsm": "typed-scss-modules src",
53
- "watch:tsm": "typed-scss-modules src --watch"
51
+ "test:watch": "vitest"
54
52
  },
55
53
  "devDependencies": {
56
54
  "@repo/eslint-config": "*",
package/dist/button.css DELETED
@@ -1 +0,0 @@
1
- :root{--button-bg: var(--lui-color-background-brand);--button-bg-hover: var(--lui-color-background-brand-hover);--button-text: var(--lui-color-text-on-brand);--button-bg-secondary: var(--lui-color-background-primary);--button-text-secondary: var(--lui-color-text-secondary);--button-bg-secondary-hover: var(--lui-color-background-secondary);--button-bg-danger: var(--lui-color-background-error);--button-text-danger: var(--lui-color-text-on-brand);--button-bg-danger-hover: var(--lui-color-background-error-hover);--button-bg-disabled: var(--lui-color-background-disabled);--button-text-disabled: var(--lui-color-text-disabled);--button-border-disabled: var(--lui-color-border-disabled);--button-focus-ring: var(--lui-color-border-focus);--button-focus-ring-error: var(--lui-color-border-focus-error);--button-radius: var(--lui-radius-2);--button-border: var(--lui-color-border-primary);--button-shadow: var(--lui-shadow-xs)}._root_26zpg_21{align-items:center;border:1px solid var(--button-border);border-radius:var(--button-radius);box-shadow:var(--button-shadow);display:flex;flex-direction:row;justify-content:center;outline-offset:2px;transition:background-color .2s,color .2s}._root_26zpg_21._modeFilled_26zpg_32._variantPrimary_26zpg_32{background:var(--button-bg);color:var(--button-text)}._root_26zpg_21._modeFilled_26zpg_32._variantPrimary_26zpg_32._pressed_26zpg_36,._root_26zpg_21._modeFilled_26zpg_32._variantPrimary_26zpg_32:active,._root_26zpg_21._modeFilled_26zpg_32._variantPrimary_26zpg_32:hover{background:var(--button-bg-hover)}._root_26zpg_21._modeFilled_26zpg_32._variantPrimary_26zpg_32:focus-visible{outline:2px solid var(--button-focus-ring)}._root_26zpg_21._modeFilled_26zpg_32._variantSecondary_26zpg_42{background:var(--button-bg-secondary);color:var(--button-text-secondary)}._root_26zpg_21._modeFilled_26zpg_32._variantSecondary_26zpg_42:active,._root_26zpg_21._modeFilled_26zpg_32._variantSecondary_26zpg_42._pressed_26zpg_36,._root_26zpg_21._modeFilled_26zpg_32._variantSecondary_26zpg_42:hover{background:var(--button-bg-secondary-hover)}._root_26zpg_21._modeFilled_26zpg_32._variantSecondary_26zpg_42:focus-visible{outline:2px solid var(--button-focus-ring)}._root_26zpg_21._modeFilled_26zpg_32._variantDanger_26zpg_52{background:var(--button-bg-danger);color:var(--button-text-danger)}._root_26zpg_21._modeFilled_26zpg_32._variantDanger_26zpg_52:active,._root_26zpg_21._modeFilled_26zpg_32._variantDanger_26zpg_52._pressed_26zpg_36,._root_26zpg_21._modeFilled_26zpg_32._variantDanger_26zpg_52:hover{background:var(--button-bg-danger-hover)}._root_26zpg_21._modeFilled_26zpg_32._variantDanger_26zpg_52:focus-visible{outline:2px solid var(--button-focus-ring-error)}._root_26zpg_21._modeFilled_26zpg_32:disabled,._root_26zpg_21._modeFilled_26zpg_32._disabled_26zpg_62{background:var(--button-bg-disabled);border-color:var(--button-border-disabled);color:var(--button-text-disabled);cursor:not-allowed;pointer-events:none}._root_26zpg_21._modeOutlined_26zpg_69{background:transparent;box-shadow:none}._root_26zpg_21._modeOutlined_26zpg_69._variantPrimary_26zpg_32{border-color:var(--lui-color-background-brand);color:var(--lui-color-background-brand)}._root_26zpg_21._modeOutlined_26zpg_69._variantPrimary_26zpg_32:hover{background:var(--lui-color-background-brand-secondary)}._root_26zpg_21._modeOutlined_26zpg_69._variantSecondary_26zpg_42{color:var(--lui-color-text-secondary)}._root_26zpg_21._modeOutlined_26zpg_69._variantSecondary_26zpg_42:hover{background:var(--lui-color-background-secondary)}._root_26zpg_21._modeOutlined_26zpg_69._variantDanger_26zpg_52{border-color:var(--lui-color-background-error);color:var(--lui-color-background-error)}._root_26zpg_21._modeOutlined_26zpg_69._variantDanger_26zpg_52:hover{background:var(--lui-color-background-error);color:var(--lui-color-text-on-brand)}._root_26zpg_21._modeText_26zpg_94{background:transparent;border-color:transparent;box-shadow:none}._root_26zpg_21._modeText_26zpg_94._variantPrimary_26zpg_32{color:var(--lui-color-background-brand)}._root_26zpg_21._modeText_26zpg_94._variantPrimary_26zpg_32:hover{background:var(--lui-color-background-brand-secondary)}._root_26zpg_21._modeText_26zpg_94._variantSecondary_26zpg_42{color:var(--lui-color-text-secondary)}._root_26zpg_21._modeText_26zpg_94._variantSecondary_26zpg_42:hover{background:var(--lui-color-background-secondary)}._root_26zpg_21._modeText_26zpg_94._variantDanger_26zpg_52{color:var(--lui-color-background-error)}._root_26zpg_21._modeText_26zpg_94._variantDanger_26zpg_52:hover{background:var(--lui-color-background-error);color:var(--lui-color-text-on-brand)}._root_26zpg_21._fullWidth_26zpg_118{width:100%}._root_26zpg_21._sizeSm_26zpg_121{font-size:var(--lui-font-size-sm);font-weight:var(--lui-font-weight-semibold);gap:var(--lui-space-1);line-height:var(--line-height-sm);padding:var(--lui-space-1) var(--lui-space-3)}._root_26zpg_21._sizeMd_26zpg_128{font-size:var(--lui-font-size-sm);font-weight:var(--lui-font-weight-semibold);gap:var(--lui-space-1);line-height:var(--line-height-sm);padding:var(--lui-space-2) var(--lui-space-4)}._root_26zpg_21._sizeLg_26zpg_135{font-size:var(--lui-font-size-md);font-weight:var(--lui-font-weight-semibold);gap:var(--lui-space-2);line-height:var(--line-height-md);padding:var(--lui-space-3) var(--lui-space-4)}._icon_26zpg_143{align-items:center;display:flex;flex:0 0 20px;height:20px;justify-content:center;width:20px}
@@ -1,70 +0,0 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { createContext as g, useMemo as i, useEffect as u, useContext as m } from "react";
3
- const c = g(null), n = {
4
- dialog: {
5
- close: "Close"
6
- },
7
- input: {
8
- passwordHide: "Hide password",
9
- passwordShow: "Show password"
10
- },
11
- pagination: {
12
- next: "Next page",
13
- page: "Page {page}",
14
- pagination: "Pagination",
15
- prev: "Previous page"
16
- },
17
- select: {
18
- clear: "Clear",
19
- noOptions: "No options",
20
- placeholder: "Select..."
21
- }
22
- }, f = {
23
- dialog: {
24
- close: "Закрыть"
25
- },
26
- input: {
27
- passwordHide: "Скрыть пароль",
28
- passwordShow: "Показать пароль"
29
- },
30
- pagination: {
31
- next: "Следующая страница",
32
- page: "Страница {page}",
33
- pagination: "Пагинация",
34
- prev: "Предыдущая страница"
35
- },
36
- select: {
37
- clear: "Очистить",
38
- noOptions: "Нет вариантов",
39
- placeholder: "Выберите..."
40
- }
41
- }, h = { en: n, ru: f }, x = (e) => i(() => {
42
- if (!e)
43
- return n;
44
- if (typeof e == "string")
45
- return h[e] ?? n;
46
- const r = { ...n };
47
- for (const t of Object.keys(e)) {
48
- const o = e[t];
49
- o && typeof o == "object" && !Array.isArray(o) && (r[t] = {
50
- ...r[t],
51
- ...o
52
- });
53
- }
54
- return r;
55
- }, [e]), w = (e) => {
56
- const { children: r, theme: t = "light", locale: o, themeTarget: s } = e, a = x(o);
57
- u(() => {
58
- const d = s ?? document.documentElement;
59
- d.dataset.theme = t;
60
- }, [t, s]);
61
- const p = i(() => ({ locale: a, theme: t }), [t, a]);
62
- return /* @__PURE__ */ l(c.Provider, { value: p, children: r });
63
- };
64
- w.displayName = "LazarUiProvider";
65
- const y = () => m(c)?.locale ?? n;
66
- export {
67
- c as C,
68
- w as L,
69
- y as u
70
- };