@lazar-ui/kit 0.2.0 → 0.2.3
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 +29 -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 +16 -3
- package/dist/config-provider.js +0 -14
package/dist/error-boundary.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as o, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import './error-boundary.css';const
|
|
2
|
+
import n from "react";
|
|
3
|
+
import './error-boundary.css';const i = "ErrorBoundary", a = "_root_n01v7_1", c = "_title_n01v7_10", h = "_description_n01v7_18", e = {
|
|
4
4
|
root: a,
|
|
5
5
|
title: c,
|
|
6
|
-
description:
|
|
6
|
+
description: h
|
|
7
7
|
};
|
|
8
|
-
class u extends
|
|
9
|
-
static displayName =
|
|
8
|
+
class u extends n.Component {
|
|
9
|
+
static displayName = i;
|
|
10
10
|
constructor(r) {
|
|
11
|
-
super(r), this.state = {
|
|
11
|
+
super(r), this.state = { error: null, hasError: !1 };
|
|
12
12
|
}
|
|
13
13
|
static getDerivedStateFromError(r) {
|
|
14
|
-
return {
|
|
14
|
+
return { error: r, hasError: !0 };
|
|
15
15
|
}
|
|
16
16
|
componentDidCatch(r, t) {
|
|
17
17
|
this.props.onError?.(r, t);
|
|
@@ -20,13 +20,13 @@ class u extends i.Component {
|
|
|
20
20
|
this.props.resetKey !== void 0 && this.props.resetKey !== r.resetKey && this.handleReset();
|
|
21
21
|
}
|
|
22
22
|
handleReset = () => {
|
|
23
|
-
this.setState({
|
|
23
|
+
this.setState({ error: null, hasError: !1 });
|
|
24
24
|
};
|
|
25
25
|
render() {
|
|
26
26
|
if (!this.state.hasError)
|
|
27
27
|
return this.props.children;
|
|
28
28
|
const { fallback: r } = this.props, { error: t } = this.state;
|
|
29
|
-
return r !== void 0 ? typeof r == "function" ? r(
|
|
29
|
+
return r !== void 0 && this.state.error !== null ? typeof r == "function" ? r(this.state.error, this.handleReset) : r : /* @__PURE__ */ o("div", { className: e.root, children: [
|
|
30
30
|
/* @__PURE__ */ s("h3", { className: e.title, children: "Something went wrong" }),
|
|
31
31
|
/* @__PURE__ */ s("p", { className: e.description, children: t?.message ?? "An unexpected error occurred." })
|
|
32
32
|
] });
|
package/dist/flex.js
CHANGED
|
@@ -36,8 +36,8 @@ const z = (n) => {
|
|
|
36
36
|
gap: o,
|
|
37
37
|
grow: u,
|
|
38
38
|
id: w,
|
|
39
|
-
justify:
|
|
40
|
-
px:
|
|
39
|
+
justify: l,
|
|
40
|
+
px: s,
|
|
41
41
|
py: r,
|
|
42
42
|
shrink: m,
|
|
43
43
|
style: d,
|
|
@@ -46,7 +46,7 @@ const z = (n) => {
|
|
|
46
46
|
e.root,
|
|
47
47
|
i("direction", a),
|
|
48
48
|
t != null && i("align", t),
|
|
49
|
-
|
|
49
|
+
l != null && i("justify", l),
|
|
50
50
|
f && e.wrap,
|
|
51
51
|
p && e.fullWidth,
|
|
52
52
|
u && e.grow,
|
|
@@ -58,9 +58,9 @@ const z = (n) => {
|
|
|
58
58
|
className: y,
|
|
59
59
|
id: w,
|
|
60
60
|
style: {
|
|
61
|
-
"--flex-gap": o != null ? `var(--space-${o})` : void 0,
|
|
62
|
-
"--flex-px":
|
|
63
|
-
"--flex-py": r != null ? `var(--space-${r})` : void 0,
|
|
61
|
+
"--flex-gap": o != null ? `var(--lui-space-${o})` : void 0,
|
|
62
|
+
"--flex-px": s != null ? `var(--lui-space-${s})` : void 0,
|
|
63
|
+
"--flex-py": r != null ? `var(--lui-space-${r})` : void 0,
|
|
64
64
|
...d
|
|
65
65
|
},
|
|
66
66
|
children: _
|
package/dist/form-field.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--formfield-gap: var(--space-1)}.
|
|
1
|
+
:root{--formfield-gap: var(--lui-space-1)}._root_1vp6v_5{display:flex;flex-direction:column;gap:var(--lui-space-1)}._label_1vp6v_11{color:var(--lui-color-text-primary);font-size:var(--lui-font-size-sm);font-weight:var(--lui-font-weight-medium);line-height:var(--line-height-sm)}._required_1vp6v_18{color:var(--lui-color-text-error)}._error_1vp6v_22{color:var(--lui-color-text-error);font-size:var(--lui-font-size-xs);line-height:var(--line-height-xs);margin:0}
|
package/dist/form-field.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { c as n } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
-
import './form-field.css';const d = "FormField",
|
|
4
|
-
root:
|
|
5
|
-
label:
|
|
3
|
+
import './form-field.css';const d = "FormField", _ = "_root_1vp6v_5", m = "_label_1vp6v_11", p = "_required_1vp6v_18", v = "_error_1vp6v_22", r = {
|
|
4
|
+
root: _,
|
|
5
|
+
label: m,
|
|
6
6
|
required: p,
|
|
7
|
-
error:
|
|
8
|
-
},
|
|
9
|
-
const { children:
|
|
7
|
+
error: v
|
|
8
|
+
}, u = (a) => {
|
|
9
|
+
const { children: t, error: e, label: o, required: c = !1 } = a, i = n(r.root);
|
|
10
10
|
return /* @__PURE__ */ l("div", { className: i, children: [
|
|
11
11
|
o && /* @__PURE__ */ l("label", { className: r.label, children: [
|
|
12
12
|
o,
|
|
13
|
-
|
|
13
|
+
c && /* @__PURE__ */ s("span", { className: r.required, "aria-hidden": "true", children: " *" })
|
|
14
14
|
] }),
|
|
15
|
-
|
|
15
|
+
t,
|
|
16
16
|
e && /* @__PURE__ */ s("p", { className: r.error, role: "alert", children: e })
|
|
17
17
|
] });
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
u.displayName = d;
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
u as FormField
|
|
22
22
|
};
|
package/dist/icon.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Icon component. Renders a Lucide SVG icon by name.
|
|
5
|
+
* Supports sizing, coloring, and custom stroke width.
|
|
6
|
+
* Returns `null` for unknown icon names.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Icon name="search" />
|
|
11
|
+
* <Icon name="user" size={24} color="red" />
|
|
12
|
+
* <Icon name="x" ariaLabel="Close" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare const Icon: default_2.FC<IIconProps>;
|
|
16
|
+
|
|
17
|
+
export declare interface IIconProps {
|
|
18
|
+
/** Icon name. Full list: https://lucide.dev/icons */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Icon size (px). Default: 16. */
|
|
21
|
+
size?: number;
|
|
22
|
+
/** Stroke color. Default: 'currentColor'. */
|
|
23
|
+
color?: string;
|
|
24
|
+
/** Stroke width. Default: 2. */
|
|
25
|
+
strokeWidth?: number;
|
|
26
|
+
/** Semantic aria-label. Default: name. */
|
|
27
|
+
ariaLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { }
|
package/dist/icon.js
ADDED
package/dist/input.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--input-bg: var(--color-background-
|
|
1
|
+
:root{--input-bg: var(--lui-color-background-secondary);--input-bg-hover: var(--lui-color-background-secondary);--input-border: var(--lui-color-border-primary);--input-border-hover: var(--lui-color-text-tertiary);--input-border-focus: var(--lui-color-border-focus);--input-border-error: var(--lui-color-border-focus-error);--input-text: var(--lui-color-text-primary);--input-text-disabled: var(--lui-color-text-disabled);--input-placeholder: var(--lui-color-text-tertiary);--input-icon: var(--lui-color-text-tertiary);--input-radius: var(--lui-radius-1);--input-shadow: var(--lui-shadow-xs);--input-gap: var(--lui-space-2)}._root_1k18n_17{align-items:center;background:var(--input-bg);border:1px solid var(--input-border);border-radius:var(--input-radius);box-shadow:var(--input-shadow);display:inline-flex;gap:var(--input-gap);position:relative;transition:border-color .15s,box-shadow .15s;width:100%}._root_1k18n_17:hover{border-color:var(--input-border-hover)}._root_1k18n_17:focus-within{border-color:var(--input-border-focus);box-shadow:0 0 0 1px var(--input-border-focus)}._root_1k18n_17._invalid_1k18n_36{border-color:var(--input-border-error)}._root_1k18n_17._invalid_1k18n_36:focus-within{box-shadow:0 0 0 1px var(--input-border-error)}._root_1k18n_17._disabled_1k18n_42{background:var(--lui-color-background-disabled);border-color:var(--lui-color-border-disabled);box-shadow:none;cursor:not-allowed}._root_1k18n_17._disabled_1k18n_42:hover{border-color:var(--lui-color-border-disabled)}._root_1k18n_17._disabled_1k18n_42:focus-within{border-color:var(--lui-color-border-disabled);box-shadow:none}._sizeSm_1k18n_56{padding:var(--lui-space-1) var(--lui-space-2)}._sizeMd_1k18n_60{padding:var(--lui-space-2) var(--lui-space-3)}._sizeLg_1k18n_64{padding:var(--lui-space-3) var(--lui-space-4)}._control_1k18n_68{background:none;border:none;color:var(--input-text);flex:1;font-family:inherit;font-size:inherit;line-height:inherit;min-width:0;outline:none;padding:0}._control_1k18n_68::placeholder{color:var(--input-placeholder)}._control_1k18n_68:disabled{color:var(--input-text-disabled);cursor:not-allowed}._control_1k18n_68:disabled::placeholder{color:var(--input-text-disabled)}._control_1k18n_68[type=number]::-webkit-outer-spin-button,._control_1k18n_68[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}._control_1k18n_68[type=number]{appearance:textfield}._before_1k18n_99,._after_1k18n_100{align-items:center;color:var(--input-icon);display:flex;flex-shrink:0;line-height:0}._togglePassword_1k18n_108{align-items:center;background:none;border:none;color:var(--input-icon);cursor:pointer;display:flex;flex-shrink:0;line-height:0;padding:0}._togglePassword_1k18n_108:hover{color:var(--lui-color-text-secondary)}._sizeSm_1k18n_56 ._control_1k18n_68{font-size:var(--lui-font-size-sm);line-height:var(--line-height-sm)}._sizeSm_1k18n_56 ._before_1k18n_99,._sizeSm_1k18n_56 ._after_1k18n_100,._sizeSm_1k18n_56 ._togglePassword_1k18n_108{height:14px;width:14px}._sizeMd_1k18n_60 ._control_1k18n_68{font-size:var(--lui-font-size-md);line-height:var(--line-height-md)}._sizeMd_1k18n_60 ._before_1k18n_99,._sizeMd_1k18n_60 ._after_1k18n_100,._sizeMd_1k18n_60 ._togglePassword_1k18n_108{height:16px;width:16px}._sizeLg_1k18n_64 ._control_1k18n_68{font-size:var(--lui-font-size-lg);line-height:var(--line-height-lg)}._sizeLg_1k18n_64 ._before_1k18n_99,._sizeLg_1k18n_64 ._after_1k18n_100,._sizeLg_1k18n_64 ._togglePassword_1k18n_108{height:18px;width:18px}
|
package/dist/input.js
CHANGED
|
@@ -1,147 +1,120 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import { useState as g, useCallback as
|
|
4
|
-
import { g as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { jsxs as y, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as v } from "./clsx-OuTLNxxd.mjs";
|
|
3
|
+
import { useState as g, useCallback as N } from "react";
|
|
4
|
+
import { g as U } from "./getVariantClassName-D7Nhpuec.mjs";
|
|
5
|
+
import { I as f } from "./Icon-flib0kme.mjs";
|
|
6
|
+
import { u as E } from "./useLocale-DdHNhmvT.mjs";
|
|
7
|
+
import './input.css';const m = {
|
|
7
8
|
INPUT: "Input",
|
|
8
9
|
INPUT_EMAIL: "InputEmail",
|
|
9
10
|
INPUT_NUMBER: "InputNumber",
|
|
10
11
|
INPUT_PASSWORD: "InputPassword",
|
|
11
12
|
INPUT_PHONE: "InputPhone"
|
|
12
|
-
},
|
|
13
|
-
root:
|
|
14
|
-
invalid:
|
|
15
|
-
disabled:
|
|
16
|
-
sizeSm:
|
|
17
|
-
sizeMd:
|
|
18
|
-
sizeLg:
|
|
19
|
-
control:
|
|
13
|
+
}, S = "_root_1k18n_17", C = "_invalid_1k18n_36", M = "_disabled_1k18n_42", T = "_sizeSm_1k18n_56", B = "_sizeMd_1k18n_60", L = "_sizeLg_1k18n_64", x = "_control_1k18n_68", A = "_before_1k18n_99", O = "_after_1k18n_100", $ = "_togglePassword_1k18n_108", l = {
|
|
14
|
+
root: S,
|
|
15
|
+
invalid: C,
|
|
16
|
+
disabled: M,
|
|
17
|
+
sizeSm: T,
|
|
18
|
+
sizeMd: B,
|
|
19
|
+
sizeLg: L,
|
|
20
|
+
control: x,
|
|
20
21
|
before: A,
|
|
21
|
-
after:
|
|
22
|
-
togglePassword:
|
|
23
|
-
}, d = (
|
|
24
|
-
const { ref:
|
|
22
|
+
after: O,
|
|
23
|
+
togglePassword: $
|
|
24
|
+
}, d = (n) => {
|
|
25
|
+
const { ref: e, invalid: s = !1, size: a = "md", before: r, after: t, className: i, onChange: c, onBlur: u, onFocus: _, ...p } = n, w = v(
|
|
25
26
|
l.root,
|
|
26
|
-
|
|
27
|
+
U("size", a, l),
|
|
27
28
|
{
|
|
28
|
-
[l.disabled]:
|
|
29
|
-
[l.invalid]:
|
|
29
|
+
[l.disabled]: p.disabled === !0,
|
|
30
|
+
[l.invalid]: s
|
|
30
31
|
},
|
|
31
32
|
i
|
|
32
|
-
),
|
|
33
|
-
c?.(
|
|
33
|
+
), z = (k) => {
|
|
34
|
+
c?.(k.target.value);
|
|
34
35
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
36
|
+
return /* @__PURE__ */ y("div", { className: w, children: [
|
|
37
|
+
r && /* @__PURE__ */ o("span", { className: l.before, children: r }),
|
|
38
|
+
/* @__PURE__ */ o("input", { ref: e, className: l.control, onChange: z, onBlur: u, onFocus: _, ...p }),
|
|
39
|
+
t && /* @__PURE__ */ o("span", { className: l.after, children: t })
|
|
39
40
|
] });
|
|
40
41
|
};
|
|
41
|
-
d.displayName =
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
d: "M2 3c0-.6.4-1 1-1h1.5a1 1 0 01.9.6l.7 1.5a1 1 0 01-.1 1.1L5 6a8.6 8.6 0 004 4l1-1a1 1 0 011.1-.2l1.5.7a1 1 0 01.6.9V13a1 1 0 01-1 1C6.5 14 2 9.5 2 3z",
|
|
46
|
-
fill: "currentColor"
|
|
47
|
-
}
|
|
48
|
-
) }), $ = () => /* @__PURE__ */ e("svg", { width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
|
49
|
-
"path",
|
|
50
|
-
{
|
|
51
|
-
d: "M2 4a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2H4a2 2 0 01-2-2V4zm2 0l4 3 4-3m0 8V6.5L8 9.5 4 6.5V12",
|
|
52
|
-
fill: "currentColor"
|
|
53
|
-
}
|
|
54
|
-
) }), D = () => /* @__PURE__ */ e("svg", { width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
|
55
|
-
"path",
|
|
56
|
-
{
|
|
57
|
-
d: "M8 3C4.5 3 1.5 5.5 0 8c1.5 2.5 4.5 5 8 5s6.5-2.5 8-5c-1.5-2.5-4.5-5-8-5zm0 8a3 3 0 110-6 3 3 0 010 6zm0-1.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z",
|
|
58
|
-
fill: "currentColor"
|
|
59
|
-
}
|
|
60
|
-
) }), H = () => /* @__PURE__ */ e("svg", { width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e(
|
|
61
|
-
"path",
|
|
62
|
-
{
|
|
63
|
-
d: "M3.5 2L14 12.5M6.5 5.5A3 3 0 0010 9m4.5-1A9.5 9.5 0 0014 8c-1.5-2.5-4.5-5-8-5-.7 0-1.4.1-2 .3m-2.6 1.2C.8 5.2 0 8 0 8c1.5 2.5 4.5 5 8 5 1.5 0 2.9-.4 4.1-1",
|
|
64
|
-
stroke: "currentColor",
|
|
65
|
-
strokeWidth: "1.5",
|
|
66
|
-
strokeLinecap: "round",
|
|
67
|
-
fill: "none"
|
|
68
|
-
}
|
|
69
|
-
) });
|
|
70
|
-
function R(o) {
|
|
71
|
-
const s = o.replace(/\D/g, "").slice(0, 11);
|
|
72
|
-
if (!s)
|
|
42
|
+
d.displayName = m.INPUT;
|
|
43
|
+
function D(n) {
|
|
44
|
+
const e = n.replace(/\D/g, "").slice(0, 11);
|
|
45
|
+
if (!e)
|
|
73
46
|
return "";
|
|
74
|
-
let
|
|
75
|
-
return
|
|
47
|
+
let s = "+7";
|
|
48
|
+
return e.length > 1 && (s += ` (${e.slice(1, 4)}`), e.length >= 4 && (s += `) ${e.slice(4, 7)}`), e.length >= 7 && (s += `-${e.slice(7, 9)}`), e.length >= 9 && (s += `-${e.slice(9, 11)}`), s;
|
|
76
49
|
}
|
|
77
|
-
function
|
|
78
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(
|
|
50
|
+
function R(n) {
|
|
51
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n);
|
|
79
52
|
}
|
|
80
|
-
const
|
|
81
|
-
const { ref:
|
|
82
|
-
(
|
|
83
|
-
c(!0),
|
|
53
|
+
const I = (n) => {
|
|
54
|
+
const { ref: e, before: s, onBlur: a, invalid: r, ...t } = n, [i, c] = g(!1), u = N(
|
|
55
|
+
(p) => {
|
|
56
|
+
c(!0), a?.(p);
|
|
84
57
|
},
|
|
85
|
-
[
|
|
86
|
-
),
|
|
87
|
-
return /* @__PURE__ */
|
|
58
|
+
[a]
|
|
59
|
+
), _ = r || i && t.value != null && !R(t.value);
|
|
60
|
+
return /* @__PURE__ */ o(
|
|
88
61
|
d,
|
|
89
62
|
{
|
|
90
|
-
ref:
|
|
63
|
+
ref: e,
|
|
91
64
|
type: "email",
|
|
92
|
-
before:
|
|
93
|
-
invalid:
|
|
94
|
-
onBlur:
|
|
95
|
-
...
|
|
65
|
+
before: s ?? /* @__PURE__ */ o(f, { name: "mail", size: 16 }),
|
|
66
|
+
invalid: _,
|
|
67
|
+
onBlur: u,
|
|
68
|
+
...t
|
|
96
69
|
}
|
|
97
70
|
);
|
|
98
71
|
};
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const { ref:
|
|
102
|
-
return /* @__PURE__ */
|
|
72
|
+
I.displayName = m.INPUT_EMAIL;
|
|
73
|
+
const P = (n) => {
|
|
74
|
+
const { ref: e, ...s } = n;
|
|
75
|
+
return /* @__PURE__ */ o(d, { ref: e, type: "number", inputMode: "numeric", ...s });
|
|
103
76
|
};
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
const { ref:
|
|
107
|
-
return /* @__PURE__ */
|
|
77
|
+
P.displayName = m.INPUT_NUMBER;
|
|
78
|
+
const b = (n) => {
|
|
79
|
+
const { ref: e, after: s, ...a } = n, r = E(), [t, i] = g(!1), c = N(() => i((u) => !u), []);
|
|
80
|
+
return /* @__PURE__ */ o(
|
|
108
81
|
d,
|
|
109
82
|
{
|
|
110
|
-
ref:
|
|
111
|
-
type:
|
|
112
|
-
after:
|
|
83
|
+
ref: e,
|
|
84
|
+
type: t ? "text" : "password",
|
|
85
|
+
after: s ?? /* @__PURE__ */ o(
|
|
113
86
|
"button",
|
|
114
87
|
{
|
|
115
88
|
type: "button",
|
|
116
89
|
className: l.togglePassword,
|
|
117
90
|
onClick: c,
|
|
118
91
|
tabIndex: -1,
|
|
119
|
-
"aria-label":
|
|
120
|
-
children:
|
|
92
|
+
"aria-label": t ? r.input.passwordHide : r.input.passwordShow,
|
|
93
|
+
children: t ? /* @__PURE__ */ o(f, { name: "eyeOff", size: 16 }) : /* @__PURE__ */ o(f, { name: "eye", size: 16 })
|
|
121
94
|
}
|
|
122
95
|
),
|
|
123
|
-
...
|
|
96
|
+
...a
|
|
124
97
|
}
|
|
125
98
|
);
|
|
126
99
|
};
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
const { ref:
|
|
100
|
+
b.displayName = m.INPUT_PASSWORD;
|
|
101
|
+
const h = (n) => {
|
|
102
|
+
const { ref: e, before: s, onChange: a, ...r } = n, t = N(
|
|
130
103
|
(i) => {
|
|
131
|
-
const c =
|
|
132
|
-
|
|
104
|
+
const c = D(i);
|
|
105
|
+
a?.(c);
|
|
133
106
|
},
|
|
134
|
-
[
|
|
107
|
+
[a]
|
|
135
108
|
);
|
|
136
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ o(d, { ref: e, type: "tel", before: s ?? /* @__PURE__ */ o(f, { name: "phone", size: 16 }), onChange: t, ...r });
|
|
137
110
|
};
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
Email:
|
|
141
|
-
Number:
|
|
142
|
-
Password:
|
|
143
|
-
Phone:
|
|
111
|
+
h.displayName = m.INPUT_PHONE;
|
|
112
|
+
const q = Object.assign(d, {
|
|
113
|
+
Email: I,
|
|
114
|
+
Number: P,
|
|
115
|
+
Password: b,
|
|
116
|
+
Phone: h
|
|
144
117
|
});
|
|
145
118
|
export {
|
|
146
|
-
|
|
119
|
+
q as Input
|
|
147
120
|
};
|
|
@@ -1,37 +1,5 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Root provider that sets color scheme and locale for all UI Kit components.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* import { ConfigProvider } from '@lazar-ui/kit';
|
|
9
|
-
* import '@lazar-ui/kit/css/palettes/indigo.css';
|
|
10
|
-
* import '@lazar-ui/kit/css/semantic.css';
|
|
11
|
-
*
|
|
12
|
-
* function App() {
|
|
13
|
-
* return (
|
|
14
|
-
* <ConfigProvider theme="light" locale="en">
|
|
15
|
-
* <YourApp />
|
|
16
|
-
* </ConfigProvider>
|
|
17
|
-
* );
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```tsx
|
|
23
|
-
* // With custom locale and theme target
|
|
24
|
-
* <ConfigProvider
|
|
25
|
-
* theme="dark"
|
|
26
|
-
* locale={{ dialog: { close: 'Закрыть' } }}
|
|
27
|
-
* themeTarget={document.getElementById('root')}
|
|
28
|
-
* >
|
|
29
|
-
* <YourApp />
|
|
30
|
-
* </ConfigProvider>
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
export declare const ConfigProvider: default_2.FC<IProps>;
|
|
34
|
-
|
|
35
3
|
export declare interface IConfigContext {
|
|
36
4
|
theme: TTheme;
|
|
37
5
|
locale: ILocaleMessages;
|
|
@@ -67,11 +35,43 @@ declare interface IProps extends default_2.PropsWithChildren {
|
|
|
67
35
|
locale?: TLocale;
|
|
68
36
|
}
|
|
69
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Root provider that sets color scheme and locale for all Lazar UI Kit components.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { LazarUiProvider } from '@lazar-ui/kit';
|
|
44
|
+
* import '@lazar-ui/kit/css/palettes/indigo.css';
|
|
45
|
+
* import '@lazar-ui/kit/css/semantic.css';
|
|
46
|
+
*
|
|
47
|
+
* function App() {
|
|
48
|
+
* return (
|
|
49
|
+
* <LazarUiProvider theme="light" locale="en">
|
|
50
|
+
* <YourApp />
|
|
51
|
+
* </LazarUiProvider>
|
|
52
|
+
* );
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```tsx
|
|
58
|
+
* // With custom locale and theme target
|
|
59
|
+
* <LazarUiProvider
|
|
60
|
+
* theme="dark"
|
|
61
|
+
* locale={{ dialog: { close: 'Закрыть' } }}
|
|
62
|
+
* themeTarget={document.getElementById('root')}
|
|
63
|
+
* >
|
|
64
|
+
* <YourApp />
|
|
65
|
+
* </LazarUiProvider>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare const LazarUiProvider: default_2.FC<IProps>;
|
|
69
|
+
|
|
70
70
|
export declare type TLocale = Partial<ILocaleMessages> | 'en' | 'ru';
|
|
71
71
|
|
|
72
72
|
export declare type TTheme = 'light' | 'dark' | 'contrast';
|
|
73
73
|
|
|
74
|
-
export declare const
|
|
74
|
+
export declare const useLazarUiContext: () => IConfigContext;
|
|
75
75
|
|
|
76
76
|
export declare const useLocale: () => ILocaleMessages;
|
|
77
77
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { C as t } from "./useLocale-DdHNhmvT.mjs";
|
|
2
|
+
import { L as u, u as x } from "./useLocale-DdHNhmvT.mjs";
|
|
3
|
+
import { useContext as o } from "react";
|
|
4
|
+
const i = () => {
|
|
5
|
+
const r = o(t);
|
|
6
|
+
if (!r)
|
|
7
|
+
throw new Error("useLazarUiContext must be used within a LazarUiProvider");
|
|
8
|
+
return r;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
u as LazarUiProvider,
|
|
12
|
+
i as useLazarUiContext,
|
|
13
|
+
x as useLocale
|
|
14
|
+
};
|
package/dist/menu.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
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}:root{--dropdown-min-width: 160px;--dropdown-item-padding-x: var(--lui-space-3);--dropdown-item-padding-y: var(--lui-space-2);--dropdown-item-gap: var(--lui-space-2);--dropdown-item-radius: var(--lui-radius-1);--dropdown-item-font-size: var(--lui-font-size-sm);--dropdown-item-icon-size: 16px;--dropdown-separator-margin: var(--lui-space-1) var(--lui-space-2);--dropdown-group-label-padding: var(--lui-space-2) var(--lui-space-3);--dropdown-group-label-font-size: var(--lui-font-size-xs)}._root_1h0xj_14{min-width:var(--dropdown-min-width);padding:var(--lui-space-1)}._root_dtqrm_1{padding-bottom:var(--lui-space-1);padding-top:var(--lui-space-1)}._root_dtqrm_1+._root_dtqrm_1{border-top:1px solid var(--lui-color-border-primary)}._label_dtqrm_9{color:var(--lui-color-text-tertiary);font-size:var(--dropdown-group-label-font-size);font-weight:var(--lui-font-weight-medium);padding:var(--dropdown-group-label-padding);text-transform:uppercase}._root_5s7ps_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_5s7ps_1:hover{background:var(--lui-color-background-secondary)}._root_5s7ps_1:focus-visible{background:var(--lui-color-background-secondary)}._root_5s7ps_1._disabled_5s7ps_19{color:var(--lui-color-text-disabled);cursor:not-allowed}._root_5s7ps_1._disabled_5s7ps_19:hover{background:transparent}._root_5s7ps_1._danger_5s7ps_26{color:var(--lui-color-background-error)}._root_5s7ps_1._danger_5s7ps_26:hover{background:color-mix(in sRGB,var(--lui-color-background-error) 8%,transparent)}._icon_5s7ps_33{align-items:center;color:var(--lui-color-text-tertiary);display:inline-flex;flex-shrink:0;height:var(--dropdown-item-icon-size);justify-content:center;width:var(--dropdown-item-icon-size)}._label_5s7ps_43{flex:1;overflow:hidden;text-overflow:ellipsis}._root_16pgq_1{background:var(--lui-color-border-primary);border:none;height:1px;margin:var(--dropdown-separator-margin)}
|
package/dist/menu.d.ts
CHANGED
|
@@ -48,8 +48,8 @@ declare interface IProps_5 {
|
|
|
48
48
|
disabled?: boolean;
|
|
49
49
|
/** Whether the item is in danger state (e.g. delete action). */
|
|
50
50
|
danger?: boolean;
|
|
51
|
-
/** Optional icon before the label. */
|
|
52
|
-
icon?:
|
|
51
|
+
/** Optional icon name before the label. */
|
|
52
|
+
icon?: string;
|
|
53
53
|
}
|
|
54
54
|
export { IProps_5 as IItemProps }
|
|
55
55
|
export { IProps_5 as IMenuItemProps }
|
|
@@ -74,7 +74,7 @@ export declare const Menu: TMenuCompoundComponent;
|
|
|
74
74
|
* <Button>Actions</Button>
|
|
75
75
|
* </Menu.Trigger>
|
|
76
76
|
* <Menu.Content>
|
|
77
|
-
* <Menu.Item icon=
|
|
77
|
+
* <Menu.Item icon="edit">Edit</Menu.Item>
|
|
78
78
|
* <Menu.Item danger>Delete</Menu.Item>
|
|
79
79
|
* </Menu.Content>
|
|
80
80
|
* </Menu>
|