@lazar-ui/kit 0.2.0 → 0.2.2
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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +64 -23
- package/dist/Icon-flib0kme.mjs +684 -0
- package/dist/Icon.css +1 -0
- package/dist/accordion.css +1 -1
- package/dist/accordion.d.ts +59 -9
- package/dist/accordion.js +59 -41
- package/dist/alert.css +1 -1
- package/dist/alert.js +12 -12
- package/dist/avatar.css +1 -1
- package/dist/avatar.d.ts +2 -2
- package/dist/avatar.js +18 -18
- package/dist/badge.css +1 -1
- package/dist/badge.d.ts +3 -3
- package/dist/badge.js +8 -8
- package/dist/breadcrumbs.css +1 -1
- package/dist/breadcrumbs.js +35 -35
- package/dist/button.css +1 -1
- package/dist/button.d.ts +2 -0
- package/dist/button.js +41 -35
- package/dist/card.css +1 -1
- package/dist/card.js +15 -15
- package/dist/checkbox.css +1 -1
- package/dist/checkbox.js +25 -25
- package/dist/css/palettes/indigo.css +75 -75
- package/dist/css/palettes/monochrome.css +75 -75
- package/dist/css/semantic.css +67 -67
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +49 -48
- package/dist/drawer.css +1 -1
- package/dist/drawer.js +65 -64
- package/dist/empty-state.css +1 -1
- package/dist/empty-state.d.ts +1 -1
- package/dist/empty-state.js +27 -26
- package/dist/error-boundary.css +1 -1
- package/dist/error-boundary.js +9 -9
- package/dist/flex.js +6 -6
- package/dist/form-field.css +1 -1
- package/dist/form-field.js +10 -10
- package/dist/icon.d.ts +30 -0
- package/dist/icon.js +4 -0
- package/dist/input.css +1 -1
- package/dist/input.js +76 -103
- package/dist/{config-provider.d.ts → lazar-ui-provider.d.ts} +33 -33
- package/dist/lazar-ui-provider.js +14 -0
- package/dist/menu.css +1 -1
- package/dist/menu.d.ts +3 -3
- package/dist/menu.js +73 -91
- package/dist/pagination.css +1 -1
- package/dist/pagination.js +49 -48
- package/dist/popover.css +1 -1
- package/dist/popover.js +18 -18
- package/dist/select.css +1 -1
- package/dist/select.js +81 -119
- package/dist/separator.css +1 -1
- package/dist/separator.d.ts +2 -2
- package/dist/separator.js +9 -9
- package/dist/skeleton.css +1 -1
- package/dist/skeleton.js +13 -13
- package/dist/spinner.css +1 -1
- package/dist/spinner.d.ts +2 -2
- package/dist/spinner.js +7 -7
- package/dist/switch.css +1 -1
- package/dist/switch.js +15 -15
- package/dist/table.css +1 -1
- package/dist/table.js +23 -23
- package/dist/tabs.css +1 -1
- package/dist/tabs.js +48 -48
- package/dist/textarea.css +1 -1
- package/dist/textarea.js +17 -17
- package/dist/tooltip.css +1 -1
- package/dist/tooltip.js +10 -10
- package/dist/typography.css +1 -0
- package/dist/typography.d.ts +76 -0
- package/dist/typography.js +40 -0
- package/dist/{useLocale-D2Z0JH0l.mjs → useLocale-DdHNhmvT.mjs} +24 -24
- package/package.json +14 -2
- package/dist/config-provider.js +0 -14
package/dist/tabs.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
1
|
+
import { jsx as l, jsxs as z } from "react/jsx-runtime";
|
|
2
2
|
import { c as C } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
-
import m, { createContext as D, useContext as E, useState as L, useId as
|
|
3
|
+
import m, { createContext as D, useContext as E, useState as L, useId as y } from "react";
|
|
4
4
|
import { g as I } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
5
|
-
import { i as
|
|
6
|
-
import './tabs.css';const
|
|
7
|
-
const t = E(
|
|
5
|
+
import { i as U } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
6
|
+
import './tabs.css';const g = D(null), x = () => {
|
|
7
|
+
const t = E(g);
|
|
8
8
|
if (!t)
|
|
9
9
|
throw new Error("useTabsContext should be used inside Tabs component");
|
|
10
10
|
return t;
|
|
11
|
-
},
|
|
12
|
-
const { defaultActiveIndex:
|
|
13
|
-
|
|
14
|
-
}, c = (
|
|
15
|
-
return /* @__PURE__ */ l(
|
|
11
|
+
}, p = (t, n, s) => `${t}-${s}-${n}`, k = (t) => {
|
|
12
|
+
const { defaultActiveIndex: n = 0, children: s, onTabChange: a, variant: o } = t, [r, d] = L(n), i = y(), u = (e) => {
|
|
13
|
+
e !== r && (d(e), a && a(e));
|
|
14
|
+
}, c = (e) => p(i, e, "panel"), v = (e) => p(i, e, "tab");
|
|
15
|
+
return /* @__PURE__ */ l(g.Provider, { value: { activeIndex: r, baseId: i, getPanelId: c, getTabId: v, setActiveTab: u, variant: o }, children: s });
|
|
16
16
|
}, h = "Tabs";
|
|
17
|
-
var
|
|
18
|
-
const
|
|
19
|
-
root:
|
|
20
|
-
disabled:
|
|
21
|
-
variantDefault:
|
|
22
|
-
active:
|
|
23
|
-
variantButtons:
|
|
24
|
-
},
|
|
25
|
-
const { disabled:
|
|
17
|
+
var f = ((t) => (t.PANEL = `${h}.Panel`, t.TAB = `${h}.Tab`, t))(f || {}), A = /* @__PURE__ */ ((t) => (t.BUTTONS = "buttons", t.DEFAULT = "default", t))(A || {});
|
|
18
|
+
const S = "_root_11zii_1", w = "_disabled_11zii_5", O = "_variantDefault_11zii_9", j = "_active_11zii_22", F = "_variantButtons_11zii_26", _ = {
|
|
19
|
+
root: S,
|
|
20
|
+
disabled: w,
|
|
21
|
+
variantDefault: O,
|
|
22
|
+
active: j,
|
|
23
|
+
variantButtons: F
|
|
24
|
+
}, N = (t) => {
|
|
25
|
+
const { disabled: n = !1, label: s, index: a = 0, tabIndex: o = 0 } = t, { activeIndex: r, getPanelId: d, getTabId: i, setActiveTab: u, variant: c } = x(), v = d(a), e = i(a), T = r === a, B = C(_.root, I("variant", c, _), {
|
|
26
26
|
[_.active]: T,
|
|
27
|
-
[_.disabled]:
|
|
27
|
+
[_.disabled]: n
|
|
28
28
|
});
|
|
29
29
|
return /* @__PURE__ */ l(
|
|
30
30
|
"button",
|
|
31
31
|
{
|
|
32
32
|
"aria-selected": T,
|
|
33
33
|
"aria-controls": v,
|
|
34
|
-
"aria-disabled":
|
|
34
|
+
"aria-disabled": n,
|
|
35
35
|
className: B,
|
|
36
|
-
disabled:
|
|
37
|
-
id:
|
|
36
|
+
disabled: n,
|
|
37
|
+
id: e,
|
|
38
38
|
onClick: () => {
|
|
39
|
-
|
|
39
|
+
n || u(a);
|
|
40
40
|
},
|
|
41
41
|
role: "tab",
|
|
42
|
-
tabIndex:
|
|
42
|
+
tabIndex: n ? -1 : o,
|
|
43
43
|
children: s
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
const { panels:
|
|
50
|
-
return /* @__PURE__ */ l("div", { id: o, children:
|
|
47
|
+
N.displayName = `${f.TAB}`;
|
|
48
|
+
const P = (t) => {
|
|
49
|
+
const { panels: n } = t, { activeIndex: s, getPanelId: a } = x(), o = a(s);
|
|
50
|
+
return /* @__PURE__ */ l("div", { id: o, children: n[s] });
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
root:
|
|
55
|
-
variantDefault:
|
|
56
|
-
list:
|
|
57
|
-
variantButtons:
|
|
58
|
-
panel:
|
|
59
|
-
}, G = [
|
|
60
|
-
const { defaultActiveIndex:
|
|
61
|
-
let
|
|
52
|
+
P.displayName = `${f.PANEL}`;
|
|
53
|
+
const M = "_root_ndfzg_20", R = "_variantDefault_ndfzg_23", V = "_list_ndfzg_23", Y = "_variantButtons_ndfzg_32", q = "_panel_ndfzg_45", b = {
|
|
54
|
+
root: M,
|
|
55
|
+
variantDefault: R,
|
|
56
|
+
list: V,
|
|
57
|
+
variantButtons: Y,
|
|
58
|
+
panel: q
|
|
59
|
+
}, G = [f.TAB], $ = (t) => {
|
|
60
|
+
const { defaultActiveIndex: n = 0, children: s, onChange: a, variant: o = A.DEFAULT } = t, r = [], d = C(b.root, I("variant", o, b));
|
|
61
|
+
let i = !1;
|
|
62
62
|
const u = (c, v) => {
|
|
63
|
-
if (!
|
|
63
|
+
if (!U(G, c))
|
|
64
64
|
return null;
|
|
65
|
-
const { children:
|
|
66
|
-
return
|
|
65
|
+
const { children: e = null } = c.props;
|
|
66
|
+
return r.push(e), e && (i = !0), m.cloneElement(c, { index: v });
|
|
67
67
|
};
|
|
68
|
-
return /* @__PURE__ */ l(
|
|
68
|
+
return /* @__PURE__ */ l(k, { defaultActiveIndex: n, onTabChange: a, variant: o, children: /* @__PURE__ */ z("div", { className: d, children: [
|
|
69
69
|
/* @__PURE__ */ l("div", { className: b.list, children: m.Children.map(s, u) }),
|
|
70
|
-
|
|
70
|
+
i && /* @__PURE__ */ l("div", { className: b.panel, children: /* @__PURE__ */ l(P, { panels: r }) })
|
|
71
71
|
] }) });
|
|
72
72
|
};
|
|
73
|
-
|
|
74
|
-
const H =
|
|
75
|
-
H.Tab =
|
|
73
|
+
$.displayName = "Tabs";
|
|
74
|
+
const H = $;
|
|
75
|
+
H.Tab = N;
|
|
76
76
|
export {
|
|
77
|
-
|
|
77
|
+
A as ETabsVariant,
|
|
78
78
|
H as Tabs
|
|
79
79
|
};
|
package/dist/textarea.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--textarea-bg: var(--color-background-primary);--textarea-border: var(--color-border-primary);--textarea-border-hover: var(--color-text-tertiary);--textarea-border-focus: var(--color-border-focus);--textarea-border-error: var(--color-border-focus-error);--textarea-text: var(--color-text-primary);--textarea-text-disabled: var(--color-text-disabled);--textarea-placeholder: var(--color-text-tertiary);--textarea-radius: var(--radius-1);--textarea-shadow: var(--shadow-xs)}.
|
|
1
|
+
:root{--textarea-bg: var(--lui-color-background-primary);--textarea-border: var(--lui-color-border-primary);--textarea-border-hover: var(--lui-color-text-tertiary);--textarea-border-focus: var(--lui-color-border-focus);--textarea-border-error: var(--lui-color-border-focus-error);--textarea-text: var(--lui-color-text-primary);--textarea-text-disabled: var(--lui-color-text-disabled);--textarea-placeholder: var(--lui-color-text-tertiary);--textarea-radius: var(--lui-radius-1);--textarea-shadow: var(--lui-shadow-xs)}._root_n07z1_14{background:var(--textarea-bg);border:1px solid var(--textarea-border);border-radius:var(--textarea-radius);box-shadow:var(--textarea-shadow);color:var(--textarea-text);display:block;font-family:inherit;min-height:80px;outline:none;position:relative;transition:border-color .15s,box-shadow .15s;width:100%}._root_n07z1_14::placeholder{color:var(--textarea-placeholder)}._root_n07z1_14:hover{border-color:var(--textarea-border-hover)}._root_n07z1_14:focus{border-color:var(--textarea-border-focus);box-shadow:0 0 0 1px var(--textarea-border-focus)}._root_n07z1_14:disabled{background:var(--lui-color-background-disabled);border-color:var(--lui-color-border-disabled);box-shadow:none;color:var(--textarea-text-disabled);cursor:not-allowed}._root_n07z1_14:disabled::placeholder{color:var(--textarea-text-disabled)}._root_n07z1_14:disabled:hover{border-color:var(--lui-color-border-disabled)}._root_n07z1_14:disabled:focus{border-color:var(--lui-color-border-disabled);box-shadow:none}._root_n07z1_14._invalid_n07z1_55{border-color:var(--textarea-border-error)}._root_n07z1_14._invalid_n07z1_55:focus{box-shadow:0 0 0 1px var(--textarea-border-error)}._sizeSm_n07z1_63{font-size:var(--lui-font-size-sm);line-height:var(--line-height-sm);padding:var(--lui-space-1) var(--lui-space-2)}._sizeMd_n07z1_69{font-size:var(--lui-font-size-md);line-height:var(--line-height-md);padding:var(--lui-space-2) var(--lui-space-3)}._sizeLg_n07z1_75{font-size:var(--lui-font-size-lg);line-height:var(--line-height-lg);padding:var(--lui-space-3) var(--lui-space-4)}._resizeNone_n07z1_82{resize:none}._resizeVertical_n07z1_86{resize:vertical}._resizeBoth_n07z1_90{resize:both}
|
package/dist/textarea.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { c as g } from "./clsx-OuTLNxxd.mjs";
|
|
3
3
|
import { g as s } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
4
|
-
import './textarea.css';const h = "Textarea", N = "
|
|
4
|
+
import './textarea.css';const h = "Textarea", N = "_root_n07z1_14", v = "_invalid_n07z1_55", x = "_sizeSm_n07z1_63", C = "_sizeMd_n07z1_69", p = "_sizeLg_n07z1_75", f = "_resizeNone_n07z1_82", u = "_resizeVertical_n07z1_86", B = "_resizeBoth_n07z1_90", e = {
|
|
5
5
|
root: N,
|
|
6
6
|
invalid: v,
|
|
7
7
|
sizeSm: x,
|
|
@@ -12,31 +12,31 @@ import './textarea.css';const h = "Textarea", N = "_root_1ntao_14", v = "_invali
|
|
|
12
12
|
resizeBoth: B
|
|
13
13
|
}, L = (o) => {
|
|
14
14
|
const {
|
|
15
|
-
invalid:
|
|
16
|
-
resize:
|
|
17
|
-
rows:
|
|
18
|
-
size:
|
|
19
|
-
onChange:
|
|
20
|
-
onBlur:
|
|
21
|
-
onFocus:
|
|
22
|
-
...
|
|
15
|
+
invalid: n = !1,
|
|
16
|
+
resize: i = "vertical",
|
|
17
|
+
rows: t = 3,
|
|
18
|
+
size: r = "md",
|
|
19
|
+
onChange: a,
|
|
20
|
+
onBlur: z,
|
|
21
|
+
onFocus: _,
|
|
22
|
+
...c
|
|
23
23
|
} = o, l = g(
|
|
24
24
|
e.root,
|
|
25
|
-
s("size",
|
|
26
|
-
s("resize",
|
|
27
|
-
|
|
25
|
+
s("size", r, e),
|
|
26
|
+
s("resize", i, e),
|
|
27
|
+
n && e.invalid
|
|
28
28
|
);
|
|
29
29
|
return /* @__PURE__ */ d(
|
|
30
30
|
"textarea",
|
|
31
31
|
{
|
|
32
|
-
...
|
|
32
|
+
...c,
|
|
33
33
|
className: l,
|
|
34
34
|
onChange: (m) => {
|
|
35
|
-
|
|
35
|
+
a?.(m.target.value);
|
|
36
36
|
},
|
|
37
|
-
onBlur:
|
|
38
|
-
onFocus:
|
|
39
|
-
rows:
|
|
37
|
+
onBlur: z,
|
|
38
|
+
onFocus: _,
|
|
39
|
+
rows: t
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
};
|
package/dist/tooltip.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--tooltip-bg: var(--palette-gray-900);--tooltip-text: var(--palette-white);--tooltip-radius: var(--radius-1);--tooltip-shadow: var(--shadow-sm);--tooltip-padding: var(--space-1) var(--space-2);--tooltip-font-size: var(--font-size-xs);--tooltip-z-index: 1100}.
|
|
1
|
+
:root{--tooltip-bg: var(--lui-palette-gray-900);--tooltip-text: var(--lui-palette-white);--tooltip-radius: var(--lui-radius-1);--tooltip-shadow: var(--lui-shadow-sm);--tooltip-padding: var(--lui-space-1) var(--lui-space-2);--tooltip-font-size: var(--lui-font-size-xs);--tooltip-z-index: 1100}._content_16k4n_11{background:var(--tooltip-bg);border-radius:var(--tooltip-radius);box-shadow:var(--tooltip-shadow);color:var(--tooltip-text);font-size:var(--tooltip-font-size);outline:none;padding:var(--tooltip-padding);position:relative;z-index:var(--tooltip-z-index)}._content_16k4n_11[data-placement*=bottom],._content_16k4n_11[data-placement*=top],._content_16k4n_11[data-placement*=left],._content_16k4n_11[data-placement*=right]{animation:_tooltip-enter_16k4n_1 .15s ease-out}._arrow_16k4n_26{height:0;position:absolute;width:0}._content_16k4n_11[data-placement*=bottom] ._arrow_16k4n_26{border-bottom:6px solid var(--tooltip-bg);border-left:6px solid transparent;border-right:6px solid transparent;margin-left:-6px;top:-6px}._content_16k4n_11[data-placement*=top] ._arrow_16k4n_26{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid var(--tooltip-bg);bottom:-6px;margin-left:-6px}._content_16k4n_11[data-placement*=left] ._arrow_16k4n_26{border-bottom:6px solid transparent;border-left:6px solid var(--tooltip-bg);border-top:6px solid transparent;margin-top:-6px;right:-6px}._content_16k4n_11[data-placement*=right] ._arrow_16k4n_26{border-bottom:6px solid transparent;border-right:6px solid var(--tooltip-bg);border-top:6px solid transparent;left:-6px;margin-top:-6px}@keyframes _tooltip-enter_16k4n_1{0%{opacity:0}to{opacity:1}}
|
package/dist/tooltip.js
CHANGED
|
@@ -2,18 +2,18 @@ import { jsx as m, jsxs as O } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext as $, useContext as D, useRef as p, useId as L, useState as P, useCallback as l, useEffect as A } from "react";
|
|
3
3
|
import { s as F } from "./Overlay-OYo7gW8m.mjs";
|
|
4
4
|
import { $ as M } from "./useOverlayPosition-CK3oEqVS.mjs";
|
|
5
|
-
import './tooltip.css';const
|
|
6
|
-
const e = D(
|
|
5
|
+
import './tooltip.css';const w = $(null), G = w.Provider, E = () => {
|
|
6
|
+
const e = D(w);
|
|
7
7
|
if (!e)
|
|
8
8
|
throw new Error("Sub-component must be used within a Tooltip");
|
|
9
9
|
return e;
|
|
10
10
|
}, T = "Tooltip", S = 500, k = 150, Y = 6;
|
|
11
11
|
var v = ((e) => (e.TRIGGER = `${T}.Trigger`, e.CONTENT = `${T}.Content`, e))(v || {});
|
|
12
|
-
const j = "
|
|
12
|
+
const j = "_content_16k4n_11", H = "_arrow_16k4n_26", I = {
|
|
13
13
|
content: j,
|
|
14
14
|
arrow: H
|
|
15
|
-
},
|
|
16
|
-
const { children: a } = e, { cancelClose: u, close: r, contentId: s, isOpen: c, placement: d, triggerRef: n } =
|
|
15
|
+
}, b = (e) => {
|
|
16
|
+
const { children: a } = e, { cancelClose: u, close: r, contentId: s, isOpen: c, placement: d, triggerRef: n } = E(), o = p(null), {
|
|
17
17
|
arrowProps: f,
|
|
18
18
|
overlayProps: i,
|
|
19
19
|
placement: t
|
|
@@ -28,7 +28,7 @@ const j = "_content_w5bk0_11", H = "_arrow_w5bk0_26", w = {
|
|
|
28
28
|
return c ? /* @__PURE__ */ m(F, { children: /* @__PURE__ */ O(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
|
-
className:
|
|
31
|
+
className: I.content,
|
|
32
32
|
"data-placement": t,
|
|
33
33
|
id: s,
|
|
34
34
|
onMouseEnter: u,
|
|
@@ -37,13 +37,13 @@ const j = "_content_w5bk0_11", H = "_arrow_w5bk0_26", w = {
|
|
|
37
37
|
role: "tooltip",
|
|
38
38
|
...i,
|
|
39
39
|
children: [
|
|
40
|
-
/* @__PURE__ */ m("div", { className:
|
|
40
|
+
/* @__PURE__ */ m("div", { className: I.arrow, ...f }),
|
|
41
41
|
a
|
|
42
42
|
]
|
|
43
43
|
}
|
|
44
44
|
) }) : null;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
b.displayName = v.CONTENT;
|
|
47
47
|
const g = (e) => {
|
|
48
48
|
const { children: a, placement: u = "top", showDelay: r = S, hideDelay: s = k } = e, c = p(null), d = L(), n = p(void 0), o = p(void 0), [f, i] = P(!1), t = l(() => {
|
|
49
49
|
n.current !== void 0 && (clearTimeout(n.current), n.current = void 0), o.current !== void 0 && (clearTimeout(o.current), o.current = void 0);
|
|
@@ -76,7 +76,7 @@ const g = (e) => {
|
|
|
76
76
|
};
|
|
77
77
|
g.displayName = T;
|
|
78
78
|
const C = (e) => {
|
|
79
|
-
const { children: a } = e, { close: u, contentId: r, open: s, openImmediate: c, closeImmediate: d, triggerRef: n } =
|
|
79
|
+
const { children: a } = e, { close: u, contentId: r, open: s, openImmediate: c, closeImmediate: d, triggerRef: n } = E();
|
|
80
80
|
return /* @__PURE__ */ m(
|
|
81
81
|
"span",
|
|
82
82
|
{
|
|
@@ -94,7 +94,7 @@ const C = (e) => {
|
|
|
94
94
|
C.displayName = v.TRIGGER;
|
|
95
95
|
const R = g;
|
|
96
96
|
R.Trigger = C;
|
|
97
|
-
R.Content =
|
|
97
|
+
R.Content = b;
|
|
98
98
|
export {
|
|
99
99
|
R as Tooltip
|
|
100
100
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--typography-headline-lg-size: 18px}._root_wamht_5{font-family:var(--lui-font-family-body);margin:0}._root_wamht_5._truncate_wamht_9{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._variantHeadline_wamht_15._sizeLg_wamht_15{font-size:var(--typography-headline-lg-size);font-weight:var(--lui-font-weight-semibold);letter-spacing:normal;line-height:var(--line-height-lg)}._variantHeadline_wamht_15._sizeXl_wamht_21{font-size:var(--lui-font-size-xl);font-weight:var(--lui-font-weight-semibold);letter-spacing:-.01em;line-height:var(--line-height-xl)}._variantHeadline_wamht_15._sizeXxl_wamht_27{font-size:var(--lui-font-size-2xl);font-weight:var(--lui-font-weight-bold);letter-spacing:-.02em;line-height:var(--line-height-2xl)}._variantBody_wamht_34._sizeXs_wamht_34{font-size:var(--lui-font-size-xs);font-weight:var(--lui-font-weight-normal);letter-spacing:normal;line-height:var(--line-height-xs)}._variantBody_wamht_34._sizeSm_wamht_40{font-size:var(--lui-font-size-sm);font-weight:var(--lui-font-weight-normal);letter-spacing:normal;line-height:var(--line-height-sm)}._variantBody_wamht_34._sizeMd_wamht_46{font-size:var(--lui-font-size-md);font-weight:var(--lui-font-weight-normal);letter-spacing:normal;line-height:var(--line-height-md)}._variantBody_wamht_34._sizeLg_wamht_15{font-size:var(--lui-font-size-lg);font-weight:var(--lui-font-weight-normal);letter-spacing:normal;line-height:var(--line-height-lg)}._variantLabel_wamht_59._sizeXs_wamht_34{font-size:var(--lui-font-size-xs);font-weight:var(--lui-font-weight-medium);letter-spacing:.02em;line-height:var(--line-height-xs)}._variantLabel_wamht_59._sizeSm_wamht_40{font-size:var(--lui-font-size-sm);font-weight:var(--lui-font-weight-medium);letter-spacing:normal;line-height:var(--line-height-sm)}._variantLabel_wamht_59._sizeMd_wamht_46{font-size:var(--lui-font-size-md);font-weight:var(--lui-font-weight-medium);letter-spacing:normal;line-height:var(--line-height-md)}._colorPrimary_wamht_78{color:var(--lui-color-text-primary)}._colorSecondary_wamht_82{color:var(--lui-color-text-secondary)}._colorTertiary_wamht_86{color:var(--lui-color-text-tertiary)}._colorDisabled_wamht_90{color:var(--lui-color-text-disabled)}._colorBrand_wamht_94{color:var(--lui-color-text-link)}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ETypographyColor {
|
|
4
|
+
PRIMARY = "primary",
|
|
5
|
+
SECONDARY = "secondary",
|
|
6
|
+
TERTIARY = "tertiary",
|
|
7
|
+
DISABLED = "disabled",
|
|
8
|
+
BRAND = "brand"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare enum ETypographySize {
|
|
12
|
+
XS = "xs",
|
|
13
|
+
SM = "sm",
|
|
14
|
+
MD = "md",
|
|
15
|
+
LG = "lg",
|
|
16
|
+
XL = "xl",
|
|
17
|
+
XXL = "xxl"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare enum ETypographyVariant {
|
|
21
|
+
HEADLINE = "headline",
|
|
22
|
+
BODY = "body",
|
|
23
|
+
LABEL = "label"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare interface ITypographyProps extends default_2.PropsWithChildren {
|
|
27
|
+
/** HTML tag to render. Defaults: `h2` for headline, `p` for body, `span` for label. */
|
|
28
|
+
as?: TTypographyTag;
|
|
29
|
+
/** Color token variant. */
|
|
30
|
+
color?: TTypographyColor;
|
|
31
|
+
/** Ref to the root element. */
|
|
32
|
+
ref?: default_2.Ref<HTMLElement>;
|
|
33
|
+
/** Typography variant (stylistic group): `headline`, `body`, `label`. */
|
|
34
|
+
variant?: TTypographyVariant;
|
|
35
|
+
/** Typography size. */
|
|
36
|
+
size?: TTypographySize;
|
|
37
|
+
/** Truncate text with ellipsis (single-line). */
|
|
38
|
+
truncate?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare type TTypographyColor = `${ETypographyColor}`;
|
|
42
|
+
|
|
43
|
+
declare type TTypographySize = `${ETypographySize}`;
|
|
44
|
+
|
|
45
|
+
declare type TTypographyTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div';
|
|
46
|
+
|
|
47
|
+
declare type TTypographyVariant = `${ETypographyVariant}`;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Typography component. Renders text with preset combinations of font-size, font-weight, line-height, and letter-spacing.
|
|
51
|
+
*
|
|
52
|
+
* Supports three stylistic groups (`headline`, `body`, `label`) with various sizes.
|
|
53
|
+
* Each combination maps to predefined CSS tokens for consistent typography across the UI.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <Typography variant="headline" size="xl">Headline XL</Typography>
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <Typography variant="body" size="md" color="secondary">
|
|
63
|
+
* Body secondary text
|
|
64
|
+
* </Typography>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <Typography variant="label" size="sm" as="span">
|
|
70
|
+
* Small label
|
|
71
|
+
* </Typography>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const Typography: default_2.FC<ITypographyProps>;
|
|
75
|
+
|
|
76
|
+
export { }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import d from "react";
|
|
2
|
+
import { c as h } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
+
import { g as o } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
4
|
+
import './typography.css';const y = "Typography", z = "_root_wamht_5", w = "_truncate_wamht_9", p = "_variantHeadline_wamht_15", v = "_sizeLg_wamht_15", b = "_sizeXl_wamht_21", g = "_sizeXxl_wamht_27", X = "_variantBody_wamht_34", L = "_sizeXs_wamht_34", S = "_sizeSm_wamht_40", u = "_sizeMd_wamht_46", B = "_variantLabel_wamht_59", M = "_colorPrimary_wamht_78", T = "_colorSecondary_wamht_82", f = "_colorTertiary_wamht_86", x = "_colorDisabled_wamht_90", N = "_colorBrand_wamht_94", a = {
|
|
5
|
+
root: z,
|
|
6
|
+
truncate: w,
|
|
7
|
+
variantHeadline: p,
|
|
8
|
+
sizeLg: v,
|
|
9
|
+
sizeXl: b,
|
|
10
|
+
sizeXxl: g,
|
|
11
|
+
variantBody: X,
|
|
12
|
+
sizeXs: L,
|
|
13
|
+
sizeSm: S,
|
|
14
|
+
sizeMd: u,
|
|
15
|
+
variantLabel: B,
|
|
16
|
+
colorPrimary: M,
|
|
17
|
+
colorSecondary: T,
|
|
18
|
+
colorTertiary: f,
|
|
19
|
+
colorDisabled: x,
|
|
20
|
+
colorBrand: N
|
|
21
|
+
}, D = (s) => {
|
|
22
|
+
const { as: e, children: n, color: t, ref: c, size: i = "sm", truncate: _ = !1, variant: r = "body" } = s, l = e || {
|
|
23
|
+
body: "p",
|
|
24
|
+
headline: "h2",
|
|
25
|
+
label: "span"
|
|
26
|
+
}[r] || "p", m = h(
|
|
27
|
+
a.root,
|
|
28
|
+
o("variant", r, a),
|
|
29
|
+
o("size", i, a),
|
|
30
|
+
t && o("color", t, a),
|
|
31
|
+
{
|
|
32
|
+
[a.truncate]: _
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
return d.createElement(l, { className: m, ref: c }, n);
|
|
36
|
+
};
|
|
37
|
+
D.displayName = y;
|
|
38
|
+
export {
|
|
39
|
+
D as Typography
|
|
40
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const c =
|
|
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
4
|
dialog: {
|
|
5
5
|
close: "Close"
|
|
6
6
|
},
|
|
@@ -19,7 +19,7 @@ const c = l(null), r = {
|
|
|
19
19
|
noOptions: "No options",
|
|
20
20
|
placeholder: "Select..."
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, f = {
|
|
23
23
|
dialog: {
|
|
24
24
|
close: "Закрыть"
|
|
25
25
|
},
|
|
@@ -38,33 +38,33 @@ const c = l(null), r = {
|
|
|
38
38
|
noOptions: "Нет вариантов",
|
|
39
39
|
placeholder: "Выберите..."
|
|
40
40
|
}
|
|
41
|
-
}, h = { en:
|
|
41
|
+
}, h = { en: n, ru: f }, x = (e) => i(() => {
|
|
42
42
|
if (!e)
|
|
43
|
-
return
|
|
43
|
+
return n;
|
|
44
44
|
if (typeof e == "string")
|
|
45
|
-
return h[e] ??
|
|
46
|
-
const
|
|
47
|
-
for (const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
...
|
|
51
|
-
...
|
|
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
52
|
});
|
|
53
53
|
}
|
|
54
|
-
return
|
|
55
|
-
}, [e]),
|
|
56
|
-
const { children:
|
|
54
|
+
return r;
|
|
55
|
+
}, [e]), w = (e) => {
|
|
56
|
+
const { children: r, theme: t = "light", locale: o, themeTarget: s } = e, a = x(o);
|
|
57
57
|
u(() => {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
const p = i(() => ({ locale: a, theme:
|
|
62
|
-
return /* @__PURE__ */
|
|
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
63
|
};
|
|
64
|
-
|
|
65
|
-
const y = () =>
|
|
64
|
+
w.displayName = "LazarUiProvider";
|
|
65
|
+
const y = () => m(c)?.locale ?? n;
|
|
66
66
|
export {
|
|
67
67
|
c as C,
|
|
68
|
-
|
|
68
|
+
w as L,
|
|
69
69
|
y as u
|
|
70
70
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazar-ui/kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "A component library for building admin panels, dashboards, and internal tools.",
|
|
6
|
+
"homepage": "https://lazar-ui.github.io/docs",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/anomalyco/lazar-ui.git",
|
|
10
|
+
"directory": "packages/kit"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/anomalyco/lazar-ui/issues"
|
|
14
|
+
},
|
|
4
15
|
"main": "./dist/index.js",
|
|
5
16
|
"types": "./dist/index.d.ts",
|
|
6
17
|
"publishConfig": {
|
|
@@ -57,7 +68,7 @@
|
|
|
57
68
|
"@vitest/coverage-v8": "^3.2.4",
|
|
58
69
|
"eslint": "^9.39.1",
|
|
59
70
|
"jsdom": "^26.1.0",
|
|
60
|
-
"
|
|
71
|
+
"lucide-react": "^1.17.0",
|
|
61
72
|
"sass": "1.83.4",
|
|
62
73
|
"typed-scss-modules": "^8.1.1",
|
|
63
74
|
"typescript": "5.9.2",
|
|
@@ -69,6 +80,7 @@
|
|
|
69
80
|
"peerDependencies": {
|
|
70
81
|
"clsx": "2.1.1",
|
|
71
82
|
"lodash": "4.17.21",
|
|
83
|
+
"lucide-react": "^1.17.0",
|
|
72
84
|
"react": "^19.2.0",
|
|
73
85
|
"react-aria": "^3.44.0",
|
|
74
86
|
"react-dom": "^19.2.0",
|
package/dist/config-provider.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { C as t } from "./useLocale-D2Z0JH0l.mjs";
|
|
2
|
-
import { a as f, u } from "./useLocale-D2Z0JH0l.mjs";
|
|
3
|
-
import { useContext as e } from "react";
|
|
4
|
-
const i = () => {
|
|
5
|
-
const o = e(t);
|
|
6
|
-
if (!o)
|
|
7
|
-
throw new Error("useConfigContext must be used within a ConfigProvider");
|
|
8
|
-
return o;
|
|
9
|
-
};
|
|
10
|
-
export {
|
|
11
|
-
f as ConfigProvider,
|
|
12
|
-
i as useConfigContext,
|
|
13
|
-
u as useLocale
|
|
14
|
-
};
|