@lazar-ui/kit 0.7.0 → 0.9.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/CHANGELOG.md +12 -0
- package/dist/Alert-BW15jsDc.mjs +20 -0
- package/dist/Flex-DvO3gB0Z.mjs +73 -0
- package/dist/Text-DQPy-DZ5.mjs +46 -0
- package/dist/alert.js +2 -18
- package/dist/css/palettes/indigo.css +23 -23
- package/dist/css/palettes/monochrome.css +23 -23
- package/dist/css/palettes/purple.css +104 -0
- package/dist/css/semantic.css +6 -4
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +30 -29
- package/dist/drop-zone.css +1 -0
- package/dist/drop-zone.d.ts +25 -0
- package/dist/drop-zone.js +50 -0
- package/dist/flex.js +2 -71
- package/dist/lazar-ui-provider.d.ts +1 -1
- package/dist/text.js +6 -48
- package/dist/toast.css +1 -0
- package/dist/toast.d.ts +86 -0
- package/dist/toast.js +86 -0
- package/package.json +1 -1
- /package/dist/{alert.css → Alert.css} +0 -0
- /package/dist/{flex.css → Flex.css} +0 -0
- /package/dist/{text.css → Text.css} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.0] - 2026-07-14
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **DropZone**: add generic drag-and-drop file upload component with `accept` filter, `onFileSelect` callback, drag-over visual states, and click-to-browse via hidden file input. Import: `@lazar-ui/kit/drop-zone`. ([74f8e94](https://github.com/lazar-ui/lazar-ui/commit/74f8e94))
|
|
8
|
+
|
|
9
|
+
## [0.8.0] - 2026-07-10
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- **Toast**: add Toast component — notification system with `ToastProvider` and `useToast` hook. Supports auto-dismiss, max visible toasts, multiple positions, success/error/warning/info variants, and custom duration. ([d506b59](https://github.com/lazar-ui/lazar-ui/commit/d506b59))
|
|
14
|
+
|
|
3
15
|
## [0.7.0] - 2026-07-06
|
|
4
16
|
|
|
5
17
|
### Features
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import s from "clsx";
|
|
3
|
+
import { g as c } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
4
|
+
import './Alert.css';const e = "Alert", _ = "_root_1ibdz_9", v = "_variantDanger_1ibdz_18", l = "_variantInfo_1ibdz_25", m = "_variantSuccess_1ibdz_32", d = "_variantWarning_1ibdz_39", a = {
|
|
5
|
+
root: _,
|
|
6
|
+
variantDanger: v,
|
|
7
|
+
variantInfo: l,
|
|
8
|
+
variantSuccess: m,
|
|
9
|
+
variantWarning: d
|
|
10
|
+
}, g = (n) => {
|
|
11
|
+
const { children: r, variant: t = "info" } = n, o = s(
|
|
12
|
+
a.root,
|
|
13
|
+
c("variant", t, a)
|
|
14
|
+
);
|
|
15
|
+
return /* @__PURE__ */ i("div", { className: o, role: "alert", children: r });
|
|
16
|
+
};
|
|
17
|
+
g.displayName = e;
|
|
18
|
+
export {
|
|
19
|
+
g as A
|
|
20
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import x from "clsx";
|
|
3
|
+
import j from "lodash/camelCase";
|
|
4
|
+
import './Flex.css';const S = "Flex", v = "_root_1mp2w_7", C = "_directionRow_1mp2w_14", F = "_directionColumn_1mp2w_18", h = "_directionRowReverse_1mp2w_22", R = "_directionColumnReverse_1mp2w_26", E = "_alignFlexStart_1mp2w_30", B = "_alignCenter_1mp2w_34", k = "_alignFlexEnd_1mp2w_38", A = "_alignStretch_1mp2w_42", W = "_alignBaseline_1mp2w_46", $ = "_justifyFlexStart_1mp2w_50", N = "_justifyCenter_1mp2w_54", D = "_justifyFlexEnd_1mp2w_58", I = "_justifySpaceBetween_1mp2w_62", L = "_justifySpaceAround_1mp2w_66", M = "_justifySpaceEvenly_1mp2w_70", P = "_fullWidth_1mp2w_74", Y = "_wrap_1mp2w_78", b = "_grow_1mp2w_82", q = "_shrink_1mp2w_86", e = {
|
|
5
|
+
root: v,
|
|
6
|
+
directionRow: C,
|
|
7
|
+
directionColumn: F,
|
|
8
|
+
directionRowReverse: h,
|
|
9
|
+
directionColumnReverse: R,
|
|
10
|
+
alignFlexStart: E,
|
|
11
|
+
alignCenter: B,
|
|
12
|
+
alignFlexEnd: k,
|
|
13
|
+
alignStretch: A,
|
|
14
|
+
alignBaseline: W,
|
|
15
|
+
justifyFlexStart: $,
|
|
16
|
+
justifyCenter: N,
|
|
17
|
+
justifyFlexEnd: D,
|
|
18
|
+
justifySpaceBetween: I,
|
|
19
|
+
justifySpaceAround: L,
|
|
20
|
+
justifySpaceEvenly: M,
|
|
21
|
+
fullWidth: P,
|
|
22
|
+
wrap: Y,
|
|
23
|
+
grow: b,
|
|
24
|
+
shrink: q
|
|
25
|
+
};
|
|
26
|
+
function i(n, t) {
|
|
27
|
+
return e[j(`${n}-${t}`)];
|
|
28
|
+
}
|
|
29
|
+
const z = (n) => {
|
|
30
|
+
const {
|
|
31
|
+
align: t,
|
|
32
|
+
as: _ = "div",
|
|
33
|
+
children: a,
|
|
34
|
+
direction: c = "row",
|
|
35
|
+
fullWidth: p,
|
|
36
|
+
gap: o,
|
|
37
|
+
grow: u,
|
|
38
|
+
id: w,
|
|
39
|
+
justify: l,
|
|
40
|
+
px: s,
|
|
41
|
+
py: r,
|
|
42
|
+
shrink: m,
|
|
43
|
+
style: d,
|
|
44
|
+
wrap: f
|
|
45
|
+
} = n, y = x(
|
|
46
|
+
e.root,
|
|
47
|
+
i("direction", c),
|
|
48
|
+
t != null && i("align", t),
|
|
49
|
+
l != null && i("justify", l),
|
|
50
|
+
f && e.wrap,
|
|
51
|
+
p && e.fullWidth,
|
|
52
|
+
u && e.grow,
|
|
53
|
+
m && e.shrink
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ g(
|
|
56
|
+
_,
|
|
57
|
+
{
|
|
58
|
+
className: y,
|
|
59
|
+
id: w,
|
|
60
|
+
style: {
|
|
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
|
+
...d
|
|
65
|
+
},
|
|
66
|
+
children: a
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
z.displayName = S;
|
|
71
|
+
export {
|
|
72
|
+
z as F
|
|
73
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import j from "react";
|
|
3
|
+
import v from "clsx";
|
|
4
|
+
import { g as w } from "./getDecorationStyle-BCBONKEl.mjs";
|
|
5
|
+
import { g as t } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
6
|
+
import './Text.css';const y = "Text", z = "sm", S = "normal", u = "p", T = "_root_1vl2j_1", p = "_truncate_1vl2j_5", f = "_sizeXs_1vl2j_12", D = "_sizeSm_1vl2j_18", N = "_sizeMd_1vl2j_24", L = "_sizeLg_1vl2j_30", M = "_weightNormal_1vl2j_37", b = "_weightMedium_1vl2j_41", A = "_weightSemibold_1vl2j_45", B = "_weightBold_1vl2j_49", E = "_colorPrimary_1vl2j_54", x = "_colorSecondary_1vl2j_58", P = "_colorTertiary_1vl2j_62", C = "_colorDisabled_1vl2j_66", F = "_colorBrand_1vl2j_70", o = {
|
|
7
|
+
root: T,
|
|
8
|
+
truncate: p,
|
|
9
|
+
sizeXs: f,
|
|
10
|
+
sizeSm: D,
|
|
11
|
+
sizeMd: N,
|
|
12
|
+
sizeLg: L,
|
|
13
|
+
weightNormal: M,
|
|
14
|
+
weightMedium: b,
|
|
15
|
+
weightSemibold: A,
|
|
16
|
+
weightBold: B,
|
|
17
|
+
colorPrimary: E,
|
|
18
|
+
colorSecondary: x,
|
|
19
|
+
colorTertiary: P,
|
|
20
|
+
colorDisabled: C,
|
|
21
|
+
colorBrand: F
|
|
22
|
+
}, I = j.forwardRef((r, s) => {
|
|
23
|
+
const {
|
|
24
|
+
as: l = u,
|
|
25
|
+
children: c,
|
|
26
|
+
color: e,
|
|
27
|
+
size: i = z,
|
|
28
|
+
weight: _ = S,
|
|
29
|
+
truncate: n = !1,
|
|
30
|
+
underline: a,
|
|
31
|
+
strikethrough: m
|
|
32
|
+
} = r, d = w({ strikethrough: m, underline: a }), g = v(
|
|
33
|
+
o.root,
|
|
34
|
+
t("size", i, o),
|
|
35
|
+
t("weight", _, o),
|
|
36
|
+
e && t("color", e, o),
|
|
37
|
+
{
|
|
38
|
+
[o.truncate]: n
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ h(l, { className: g, ref: s, style: d, children: c });
|
|
42
|
+
});
|
|
43
|
+
I.displayName = y;
|
|
44
|
+
export {
|
|
45
|
+
I as T
|
|
46
|
+
};
|
package/dist/alert.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import s from "clsx";
|
|
3
|
-
import { g as c } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
4
|
-
import './alert.css';const e = "Alert", _ = "_root_1ibdz_9", v = "_variantDanger_1ibdz_18", l = "_variantInfo_1ibdz_25", m = "_variantSuccess_1ibdz_32", d = "_variantWarning_1ibdz_39", a = {
|
|
5
|
-
root: _,
|
|
6
|
-
variantDanger: v,
|
|
7
|
-
variantInfo: l,
|
|
8
|
-
variantSuccess: m,
|
|
9
|
-
variantWarning: d
|
|
10
|
-
}, g = (n) => {
|
|
11
|
-
const { children: r, variant: t = "info" } = n, o = s(
|
|
12
|
-
a.root,
|
|
13
|
-
c("variant", t, a)
|
|
14
|
-
);
|
|
15
|
-
return /* @__PURE__ */ i("div", { className: o, role: "alert", children: r });
|
|
16
|
-
};
|
|
17
|
-
g.displayName = e;
|
|
1
|
+
import { A as o } from "./Alert-BW15jsDc.mjs";
|
|
18
2
|
export {
|
|
19
|
-
|
|
3
|
+
o as Alert
|
|
20
4
|
};
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
--lui-palette-brand-hover: #5558e6;
|
|
5
5
|
--lui-palette-brand-secondary: #eef2ff;
|
|
6
6
|
|
|
7
|
-
/* Gray scale */
|
|
8
|
-
--lui-palette-gray-25: #
|
|
9
|
-
--lui-palette-gray-50: #
|
|
10
|
-
--lui-palette-gray-100: #
|
|
11
|
-
--lui-palette-gray-200: #
|
|
12
|
-
--lui-palette-gray-300: #
|
|
13
|
-
--lui-palette-gray-400: #
|
|
14
|
-
--lui-palette-gray-500: #
|
|
15
|
-
--lui-palette-gray-600: #
|
|
16
|
-
--lui-palette-gray-700: #
|
|
17
|
-
--lui-palette-gray-800: #
|
|
18
|
-
--lui-palette-gray-900: #
|
|
7
|
+
/* Gray scale (OKLCH: H=260.29°, uniform L, chroma ramp from original) */
|
|
8
|
+
--lui-palette-gray-25: #f7f8fa;
|
|
9
|
+
--lui-palette-gray-50: #d7dce3;
|
|
10
|
+
--lui-palette-gray-100: #b8bfcb;
|
|
11
|
+
--lui-palette-gray-200: #9aa4b5;
|
|
12
|
+
--lui-palette-gray-300: #7e899c;
|
|
13
|
+
--lui-palette-gray-400: #636f84;
|
|
14
|
+
--lui-palette-gray-500: #4b566a;
|
|
15
|
+
--lui-palette-gray-600: #333f52;
|
|
16
|
+
--lui-palette-gray-700: #1e2839;
|
|
17
|
+
--lui-palette-gray-800: #0a1323;
|
|
18
|
+
--lui-palette-gray-900: #00030e;
|
|
19
19
|
|
|
20
20
|
/* Colors */
|
|
21
21
|
--lui-palette-red-500: #d92d20;
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
--lui-palette-brand-hover: #6366f3;
|
|
40
40
|
--lui-palette-brand-secondary: #1e1b4b;
|
|
41
41
|
|
|
42
|
-
/* Gray scale */
|
|
43
|
-
--lui-palette-gray-25: #
|
|
44
|
-
--lui-palette-gray-50: #
|
|
45
|
-
--lui-palette-gray-100: #
|
|
46
|
-
--lui-palette-gray-200: #
|
|
47
|
-
--lui-palette-gray-300: #
|
|
48
|
-
--lui-palette-gray-400: #
|
|
49
|
-
--lui-palette-gray-500: #
|
|
50
|
-
--lui-palette-gray-600: #
|
|
42
|
+
/* Gray scale (OKLCH: H=285.97°, uniform L, chroma ramp from original) */
|
|
43
|
+
--lui-palette-gray-25: #030304;
|
|
44
|
+
--lui-palette-gray-50: #131315;
|
|
45
|
+
--lui-palette-gray-100: #27272c;
|
|
46
|
+
--lui-palette-gray-200: #3d3d45;
|
|
47
|
+
--lui-palette-gray-300: #55555e;
|
|
48
|
+
--lui-palette-gray-400: #6d6d78;
|
|
49
|
+
--lui-palette-gray-500: #878792;
|
|
50
|
+
--lui-palette-gray-600: #a2a2ad;
|
|
51
51
|
--lui-palette-gray-700: #bebec9;
|
|
52
|
-
--lui-palette-gray-800: #
|
|
53
|
-
--lui-palette-gray-900: #
|
|
52
|
+
--lui-palette-gray-800: #dadae3;
|
|
53
|
+
--lui-palette-gray-900: #f8f8fd;
|
|
54
54
|
|
|
55
55
|
/* Colors */
|
|
56
56
|
--lui-palette-red-500: #f97066;
|
|
@@ -4,18 +4,18 @@
|
|
|
4
4
|
--lui-palette-brand-hover: #292524;
|
|
5
5
|
--lui-palette-brand-secondary: #f5f5f4;
|
|
6
6
|
|
|
7
|
-
/* Gray scale (
|
|
8
|
-
--lui-palette-gray-25: #
|
|
9
|
-
--lui-palette-gray-50: #
|
|
10
|
-
--lui-palette-gray-100: #
|
|
11
|
-
--lui-palette-gray-200: #
|
|
12
|
-
--lui-palette-gray-300: #
|
|
13
|
-
--lui-palette-gray-400: #
|
|
14
|
-
--lui-palette-gray-500: #
|
|
15
|
-
--lui-palette-gray-600: #
|
|
16
|
-
--lui-palette-gray-700: #
|
|
17
|
-
--lui-palette-gray-800: #
|
|
18
|
-
--lui-palette-gray-900: #
|
|
7
|
+
/* Gray scale (OKLCH: H=61.94°, uniform L, chroma ramp from original) */
|
|
8
|
+
--lui-palette-gray-25: #f9f8f7;
|
|
9
|
+
--lui-palette-gray-50: #dddbd9;
|
|
10
|
+
--lui-palette-gray-100: #c2bebb;
|
|
11
|
+
--lui-palette-gray-200: #a8a29e;
|
|
12
|
+
--lui-palette-gray-300: #8d8782;
|
|
13
|
+
--lui-palette-gray-400: #746d68;
|
|
14
|
+
--lui-palette-gray-500: #5a5550;
|
|
15
|
+
--lui-palette-gray-600: #423d3a;
|
|
16
|
+
--lui-palette-gray-700: #2a2725;
|
|
17
|
+
--lui-palette-gray-800: #151311;
|
|
18
|
+
--lui-palette-gray-900: #040302;
|
|
19
19
|
|
|
20
20
|
/* Colors (same as indigo) */
|
|
21
21
|
--lui-palette-red-500: #d92d20;
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
--lui-palette-brand-hover: #e7e5e4;
|
|
40
40
|
--lui-palette-brand-secondary: #292524;
|
|
41
41
|
|
|
42
|
-
/* Gray scale (
|
|
43
|
-
--lui-palette-gray-25: #
|
|
44
|
-
--lui-palette-gray-50: #
|
|
45
|
-
--lui-palette-gray-100: #
|
|
46
|
-
--lui-palette-gray-200: #
|
|
47
|
-
--lui-palette-gray-300: #
|
|
48
|
-
--lui-palette-gray-400: #
|
|
49
|
-
--lui-palette-gray-500: #
|
|
42
|
+
/* Gray scale (OKLCH: H=54.87°, uniform L, chroma ramp from original) */
|
|
43
|
+
--lui-palette-gray-25: #040303;
|
|
44
|
+
--lui-palette-gray-50: #151312;
|
|
45
|
+
--lui-palette-gray-100: #2b2725;
|
|
46
|
+
--lui-palette-gray-200: #423d3a;
|
|
47
|
+
--lui-palette-gray-300: #5a5451;
|
|
48
|
+
--lui-palette-gray-400: #746d69;
|
|
49
|
+
--lui-palette-gray-500: #8e8783;
|
|
50
50
|
--lui-palette-gray-600: #a8a29e;
|
|
51
|
-
--lui-palette-gray-700: #
|
|
52
|
-
--lui-palette-gray-800: #
|
|
53
|
-
--lui-palette-gray-900: #
|
|
51
|
+
--lui-palette-gray-700: #c2bebb;
|
|
52
|
+
--lui-palette-gray-800: #dddbd9;
|
|
53
|
+
--lui-palette-gray-900: #f9f8f7;
|
|
54
54
|
|
|
55
55
|
/* Colors (same as indigo) */
|
|
56
56
|
--lui-palette-red-500: #f97066;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Brand */
|
|
3
|
+
--lui-palette-brand: #8900ff;
|
|
4
|
+
--lui-palette-brand-hover: #ae7cff;
|
|
5
|
+
--lui-palette-brand-secondary: #f3efff;
|
|
6
|
+
|
|
7
|
+
/* Gray scale (OKLCH: H=260.29°→220.6° cyan gradient, uniform L, chroma ramp from original) */
|
|
8
|
+
--lui-palette-gray-25: #f6f8f9;
|
|
9
|
+
--lui-palette-gray-50: #d4dde1;
|
|
10
|
+
--lui-palette-gray-100: #b3c1c8;
|
|
11
|
+
--lui-palette-gray-200: #93a7b2;
|
|
12
|
+
--lui-palette-gray-300: #778c99;
|
|
13
|
+
--lui-palette-gray-400: #5c7282;
|
|
14
|
+
--lui-palette-gray-500: #455869;
|
|
15
|
+
--lui-palette-gray-600: #2f4051;
|
|
16
|
+
--lui-palette-gray-700: #1b2939;
|
|
17
|
+
--lui-palette-gray-800: #091323;
|
|
18
|
+
--lui-palette-gray-900: #00030e;
|
|
19
|
+
|
|
20
|
+
/* Colors */
|
|
21
|
+
--lui-palette-red-500: #f22c2d;
|
|
22
|
+
--lui-palette-red-600: #d92d20;
|
|
23
|
+
--lui-palette-orange-500: #f28f29;
|
|
24
|
+
--lui-palette-orange-600: #b54708;
|
|
25
|
+
--lui-palette-green-500: #11ae5b;
|
|
26
|
+
--lui-palette-green-600: #079455;
|
|
27
|
+
--lui-palette-blue-500: #0089eb;
|
|
28
|
+
--lui-palette-blue-600: #175cd3;
|
|
29
|
+
|
|
30
|
+
/* Neutral */
|
|
31
|
+
--lui-palette-white: #fff;
|
|
32
|
+
--lui-palette-black: #000;
|
|
33
|
+
--lui-palette-overlay: rgb(0, 0, 0 / 0.4);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-theme="dark"] {
|
|
37
|
+
/* Brand */
|
|
38
|
+
--lui-palette-brand: #a262ff;
|
|
39
|
+
--lui-palette-brand-hover: #8900ff;
|
|
40
|
+
--lui-palette-brand-secondary: #361961;
|
|
41
|
+
|
|
42
|
+
/* Gray scale (OKLCH: H=261.11°→220.6° cyan gradient, uniform L, chroma ramp from original) */
|
|
43
|
+
--lui-palette-gray-25: #000211;
|
|
44
|
+
--lui-palette-gray-50: #061427;
|
|
45
|
+
--lui-palette-gray-100: #1a293b;
|
|
46
|
+
--lui-palette-gray-200: #2e4052;
|
|
47
|
+
--lui-palette-gray-300: #42586b;
|
|
48
|
+
--lui-palette-gray-400: #597285;
|
|
49
|
+
--lui-palette-gray-500: #768c9a;
|
|
50
|
+
--lui-palette-gray-600: #95a6b0;
|
|
51
|
+
--lui-palette-gray-700: #b2c2c9;
|
|
52
|
+
--lui-palette-gray-800: #c5e0ec;
|
|
53
|
+
--lui-palette-gray-900: #f4fafc;
|
|
54
|
+
|
|
55
|
+
/* Colors */
|
|
56
|
+
--lui-palette-red-500: #f97066;
|
|
57
|
+
--lui-palette-red-600: #f22c2d;
|
|
58
|
+
--lui-palette-orange-500: #fdb022;
|
|
59
|
+
--lui-palette-orange-600: #f28f29;
|
|
60
|
+
--lui-palette-green-500: #47cd89;
|
|
61
|
+
--lui-palette-green-600: #11ae5b;
|
|
62
|
+
--lui-palette-blue-500: #53b1fd;
|
|
63
|
+
--lui-palette-blue-600: #0089eb;
|
|
64
|
+
|
|
65
|
+
/* Neutral */
|
|
66
|
+
--lui-palette-white: #0f172c;
|
|
67
|
+
--lui-palette-black: #f8fafc;
|
|
68
|
+
--lui-palette-overlay: rgb(0, 0, 0 / 0.6);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-theme="contrast"] {
|
|
72
|
+
/* Brand */
|
|
73
|
+
--lui-palette-brand: #6000b3;
|
|
74
|
+
--lui-palette-brand-hover: #4d008f;
|
|
75
|
+
--lui-palette-brand-secondary: #f3efff;
|
|
76
|
+
|
|
77
|
+
/* Gray scale */
|
|
78
|
+
--lui-palette-gray-25: #fff;
|
|
79
|
+
--lui-palette-gray-50: #f0f0f0;
|
|
80
|
+
--lui-palette-gray-100: #e0e0e0;
|
|
81
|
+
--lui-palette-gray-200: #c0c0c0;
|
|
82
|
+
--lui-palette-gray-300: #808080;
|
|
83
|
+
--lui-palette-gray-400: #606060;
|
|
84
|
+
--lui-palette-gray-500: #404040;
|
|
85
|
+
--lui-palette-gray-600: #202020;
|
|
86
|
+
--lui-palette-gray-700: #101010;
|
|
87
|
+
--lui-palette-gray-800: #080808;
|
|
88
|
+
--lui-palette-gray-900: #000;
|
|
89
|
+
|
|
90
|
+
/* Colors */
|
|
91
|
+
--lui-palette-red-500: #c00;
|
|
92
|
+
--lui-palette-red-600: #900;
|
|
93
|
+
--lui-palette-orange-500: #c60;
|
|
94
|
+
--lui-palette-orange-600: #994d00;
|
|
95
|
+
--lui-palette-green-500: #060;
|
|
96
|
+
--lui-palette-green-600: #004d00;
|
|
97
|
+
--lui-palette-blue-500: #04c;
|
|
98
|
+
--lui-palette-blue-600: #039;
|
|
99
|
+
|
|
100
|
+
/* Neutral */
|
|
101
|
+
--lui-palette-white: #fff;
|
|
102
|
+
--lui-palette-black: #000;
|
|
103
|
+
--lui-palette-overlay: rgb(0, 0, 0 / 0.7);
|
|
104
|
+
}
|
package/dist/css/semantic.css
CHANGED
|
@@ -106,8 +106,10 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
[data-theme="dark"] {
|
|
109
|
-
--lui-color-border-primary: var(--lui-palette-gray-
|
|
110
|
-
--lui-color-border-secondary: var(--lui-palette-gray-
|
|
111
|
-
--lui-color-border-disabled: var(--lui-palette-gray-
|
|
112
|
-
--lui-color-border-disabled-subtle: var(--lui-palette-gray-
|
|
109
|
+
--lui-color-border-primary: var(--lui-palette-gray-300);
|
|
110
|
+
--lui-color-border-secondary: var(--lui-palette-gray-200);
|
|
111
|
+
--lui-color-border-disabled: var(--lui-palette-gray-100);
|
|
112
|
+
--lui-color-border-disabled-subtle: var(--lui-palette-gray-50);
|
|
113
|
+
--lui-color-text-on-brand: var(--lui-palette-black);
|
|
114
|
+
--lui-color-text-on-dark: var(--lui-palette-black);
|
|
113
115
|
}
|
package/dist/dialog.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._root_1fxwu_1{display:flex;gap:var(--dialog-actions-gap)}._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--dialog-underlay: var(--lui-color-background-overlay);--dialog-bg: var(--lui-color-background-primary);--dialog-radius: var(--lui-radius-3);--dialog-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--dialog-padding: var(--lui-space-8);--dialog-gap: var(--lui-space-6);--dialog-header-gap: var(--lui-space-6);--dialog-header-min-height: calc(24px + var(--lui-space-6));--dialog-close-color: var(--lui-palette-gray-400);--dialog-close-padding: var(--lui-space-3);--dialog-actions-padding-top: var(--lui-space-10);--dialog-width-xs: 384px;--dialog-width-sm: 480px;--dialog-width-md: 560px;--dialog-width-lg: 640px;--dialog-title-font-size: var(--lui-font-size-md);--dialog-title-weight: var(--lui-font-weight-semibold);--dialog-title-color: var(--lui-color-text-primary);--dialog-title-font-family: var(--lui-font-family-body);--dialog-title-line-height: var(--line-height-md);--dialog-actions-gap: var(--lui-space-4)}.
|
|
1
|
+
._root_1fxwu_1{display:flex;gap:var(--dialog-actions-gap)}._root_jagsa_1{max-height:100%;overflow-y:auto}:root{--dialog-underlay: var(--lui-color-background-overlay);--dialog-bg: var(--lui-color-background-primary);--dialog-border: var(--lui-color-border-primary);--dialog-radius: var(--lui-radius-3);--dialog-shadow: 0 20px 24px -4px rgb(16 24 40 / .08), 0 8px 8px -4px rgb(16 24 40 / .03);--dialog-padding: var(--lui-space-8);--dialog-gap: var(--lui-space-6);--dialog-header-gap: var(--lui-space-6);--dialog-header-min-height: calc(24px + var(--lui-space-6));--dialog-close-color: var(--lui-palette-gray-400);--dialog-close-padding: var(--lui-space-3);--dialog-actions-padding-top: var(--lui-space-10);--dialog-width-xs: 384px;--dialog-width-sm: 480px;--dialog-width-md: 560px;--dialog-width-lg: 640px;--dialog-title-font-size: var(--lui-font-size-md);--dialog-title-weight: var(--lui-font-weight-semibold);--dialog-title-color: var(--lui-color-text-primary);--dialog-title-font-family: var(--lui-font-family-body);--dialog-title-line-height: var(--line-height-md);--dialog-actions-gap: var(--lui-space-4)}._underlay_19rv4_26{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:var(--dialog-underlay);inset:0;padding:var(--lui-space-4);position:fixed;z-index:1000}._modal_19rv4_35{align-items:center;display:flex;height:100%;justify-content:center}._dialog_19rv4_42{background:var(--dialog-bg);border:1px solid var(--dialog-border);border-radius:var(--dialog-radius);box-shadow:var(--dialog-shadow);display:flex;flex-direction:column;gap:var(--dialog-gap);max-height:100%;padding:var(--dialog-padding);position:relative}._dialog_19rv4_42._sizeXs_19rv4_54{width:var(--dialog-width-xs)}._dialog_19rv4_42._sizeSm_19rv4_57{width:var(--dialog-width-sm)}._dialog_19rv4_42._sizeMd_19rv4_60{width:var(--dialog-width-md)}._dialog_19rv4_42._sizeLg_19rv4_63{width:var(--dialog-width-lg)}._header_19rv4_67{align-items:center;display:flex;flex-shrink:0;gap:var(--dialog-header-gap);min-height:var(--dialog-header-min-height)}._close_19rv4_75{color:var(--dialog-close-color);padding:var(--dialog-close-padding);position:absolute;right:var(--lui-space-4);top:var(--lui-space-4)}._actions_19rv4_83{flex-shrink:0;padding-top:var(--dialog-actions-padding-top)}._body_19rv4_88{flex:1;min-height:0;overflow-y:auto}._root_1ae0y_1{color:var(--dialog-title-color);font-family:var(--dialog-title-font-family);font-size:var(--dialog-title-font-size);font-style:normal;font-weight:var(--dialog-title-weight);line-height:var(--dialog-title-line-height);max-height:100%}
|
package/dist/dialog.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as s, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as N, useMemo as
|
|
3
|
-
import
|
|
2
|
+
import { useRef as N, useMemo as E } from "react";
|
|
3
|
+
import b from "clsx";
|
|
4
4
|
import { useDialog as x, useModalOverlay as M, Overlay as P, UNSAFE_PortalProvider as $ } from "react-aria";
|
|
5
|
-
import { useOverlayTriggerState as
|
|
5
|
+
import { useOverlayTriggerState as j } from "react-stately";
|
|
6
6
|
import { I as R } from "./Icon-DUCBChX2.mjs";
|
|
7
7
|
import { u as X } from "./useLocale-CJh-krrY.mjs";
|
|
8
8
|
import { g as k } from "./getComponentSlots-DwAYUFNk.mjs";
|
|
@@ -22,7 +22,7 @@ const U = "_root_jagsa_1", V = {
|
|
|
22
22
|
return /* @__PURE__ */ s("div", { className: V.root, children: t });
|
|
23
23
|
};
|
|
24
24
|
u.displayName = e.CONTENT;
|
|
25
|
-
const Y = "Dialog", q = [e.ACTIONS, e.CONTENT, e.TITLE], B = "
|
|
25
|
+
const Y = "Dialog", q = [e.ACTIONS, e.CONTENT, e.TITLE], B = "_underlay_19rv4_26", G = "_modal_19rv4_35", H = "_dialog_19rv4_42", J = "_sizeXs_19rv4_54", Q = "_sizeSm_19rv4_57", W = "_sizeMd_19rv4_60", Z = "_sizeLg_19rv4_63", oo = "_header_19rv4_67", so = "_close_19rv4_75", eo = "_actions_19rv4_83", to = "_body_19rv4_88", a = {
|
|
26
26
|
underlay: B,
|
|
27
27
|
modal: G,
|
|
28
28
|
dialog: H,
|
|
@@ -32,44 +32,45 @@ const Y = "Dialog", q = [e.ACTIONS, e.CONTENT, e.TITLE], B = "_underlay_100vj_25
|
|
|
32
32
|
sizeLg: Z,
|
|
33
33
|
header: oo,
|
|
34
34
|
close: so,
|
|
35
|
-
actions: eo
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
actions: eo,
|
|
36
|
+
body: to
|
|
37
|
+
}, v = (o) => {
|
|
38
|
+
const { children: t, container: y, open: l, modal: p = !0, onOpenChange: C, size: f = "md" } = o, h = X(), i = N(null), n = N(null), { dialogProps: z } = x(o, i), c = j({ isOpen: l, onOpenChange: C }), { modalProps: D, underlayProps: O } = M(
|
|
39
|
+
{ isDismissable: !p, isKeyboardDismissDisabled: !1 },
|
|
39
40
|
c,
|
|
40
41
|
n
|
|
41
42
|
), {
|
|
42
43
|
[e.ACTIONS]: d,
|
|
43
44
|
[e.CONTENT]: m,
|
|
44
|
-
[e.TITLE]:
|
|
45
|
-
} =
|
|
46
|
-
|
|
45
|
+
[e.TITLE]: I
|
|
46
|
+
} = E(() => k(t, q), [t]), S = (A) => {
|
|
47
|
+
A.preventDefault(), c.close();
|
|
47
48
|
};
|
|
48
|
-
if (!
|
|
49
|
+
if (!l)
|
|
49
50
|
return null;
|
|
50
|
-
const
|
|
51
|
-
return /* @__PURE__ */ s(P, { portalContainer:
|
|
51
|
+
const L = b(a.dialog, w("size", f, a));
|
|
52
|
+
return /* @__PURE__ */ s(P, { portalContainer: y, children: /* @__PURE__ */ s("div", { className: a.underlay, ...O, children: /* @__PURE__ */ s("div", { className: a.modal, ...D, ref: n, children: /* @__PURE__ */ s($, { getContainer: () => n.current, children: /* @__PURE__ */ _("div", { className: L, ...z, ref: i, children: [
|
|
52
53
|
/* @__PURE__ */ _("div", { className: a.header, children: [
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */ s("button", { "aria-label":
|
|
54
|
+
I,
|
|
55
|
+
/* @__PURE__ */ s("button", { "aria-label": h.Dialog.close, className: a.close, onClick: S, children: /* @__PURE__ */ s(R, { name: "x", size: 16 }) })
|
|
55
56
|
] }),
|
|
56
|
-
m && /* @__PURE__ */ s("div", { children: m }),
|
|
57
|
+
m && /* @__PURE__ */ s("div", { className: a.body, children: m }),
|
|
57
58
|
d && /* @__PURE__ */ s("div", { className: a.actions, children: d })
|
|
58
59
|
] }) }) }) }) });
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
root:
|
|
63
|
-
},
|
|
61
|
+
v.displayName = Y;
|
|
62
|
+
const ao = "_root_1ae0y_1", no = {
|
|
63
|
+
root: ao
|
|
64
|
+
}, T = (o) => {
|
|
64
65
|
const { children: t } = o;
|
|
65
|
-
return /* @__PURE__ */ s("div", { className:
|
|
66
|
+
return /* @__PURE__ */ s("div", { className: no.root, children: t });
|
|
66
67
|
};
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
T.displayName = e.TITLE;
|
|
69
|
+
const r = v;
|
|
70
|
+
r.Actions = g;
|
|
71
|
+
r.Content = u;
|
|
72
|
+
r.Title = T;
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
r as Dialog,
|
|
75
|
+
r as default
|
|
75
76
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._root_p2dbb_2{align-items:center;border:2px dashed var(--lui-color-border-primary);border-radius:var(--lui-radius-2);color:var(--lui-color-text-secondary);cursor:pointer;display:flex;flex-direction:column;font-family:var(--lui-font-family-body);font-size:var(--lui-font-size-sm);gap:var(--lui-space-2);justify-content:center;letter-spacing:normal;line-height:var(--line-height-sm);padding:var(--lui-space-6);transition:border-color .15s,background-color .15s}._root_p2dbb_2:hover{border-color:var(--lui-color-border-focus)}._dragOver_p2dbb_25{background-color:var(--lui-color-bg-secondary);border-color:var(--lui-color-border-focus)}._hiddenInput_p2dbb_31{display:none}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DropZone component. Renders a drag-and-drop area for file uploads.
|
|
5
|
+
* Supports both drag-and-drop and click-to-browse via hidden file input.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <DropZone accept=".json" onFileSelect={handleFile}>
|
|
10
|
+
* Drop JSON file here or click to browse
|
|
11
|
+
* </DropZone>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const DropZone: default_2.FC<IDropZoneProps>;
|
|
15
|
+
|
|
16
|
+
export declare interface IDropZoneProps {
|
|
17
|
+
/** Accepted file types (e.g. ".json,application/json"). */
|
|
18
|
+
accept?: string;
|
|
19
|
+
/** Content rendered inside the drop zone. */
|
|
20
|
+
children?: default_2.ReactNode;
|
|
21
|
+
/** Called when a file is selected via drop or click. */
|
|
22
|
+
onFileSelect: (file: File) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { }
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as h, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _, useRef as b, useCallback as n } from "react";
|
|
3
|
+
import I from "clsx";
|
|
4
|
+
import './drop-zone.css';const O = "DropZone", C = "_root_p2dbb_2", x = "_dragOver_p2dbb_25", N = "_hiddenInput_p2dbb_31", s = {
|
|
5
|
+
root: C,
|
|
6
|
+
dragOver: x,
|
|
7
|
+
hiddenInput: N
|
|
8
|
+
}, k = (l) => {
|
|
9
|
+
const { accept: c, children: p, onFileSelect: r } = l, [i, a] = _(!1), o = b(null), d = n((e) => {
|
|
10
|
+
e.preventDefault(), e.stopPropagation(), a(!0);
|
|
11
|
+
}, []), u = n((e) => {
|
|
12
|
+
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
13
|
+
}, []), f = n(
|
|
14
|
+
(e) => {
|
|
15
|
+
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
16
|
+
const t = e.dataTransfer.files[0];
|
|
17
|
+
t && r(t);
|
|
18
|
+
},
|
|
19
|
+
[r]
|
|
20
|
+
), g = n(() => {
|
|
21
|
+
o.current?.click();
|
|
22
|
+
}, []), v = n(
|
|
23
|
+
(e) => {
|
|
24
|
+
const t = e.target.files?.[0];
|
|
25
|
+
t && (r(t), o.current && (o.current.value = ""));
|
|
26
|
+
},
|
|
27
|
+
[r]
|
|
28
|
+
), D = I(s.root, { [s.dragOver]: i });
|
|
29
|
+
return /* @__PURE__ */ h(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: D,
|
|
33
|
+
"data-testid": "drop-zone",
|
|
34
|
+
onClick: g,
|
|
35
|
+
onDragLeave: u,
|
|
36
|
+
onDragOver: d,
|
|
37
|
+
onDrop: f,
|
|
38
|
+
role: "button",
|
|
39
|
+
tabIndex: 0,
|
|
40
|
+
children: [
|
|
41
|
+
p,
|
|
42
|
+
/* @__PURE__ */ m("input", { accept: c, className: s.hiddenInput, onChange: v, ref: o, type: "file" })
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
k.displayName = O;
|
|
48
|
+
export {
|
|
49
|
+
k as DropZone
|
|
50
|
+
};
|
package/dist/flex.js
CHANGED
|
@@ -1,73 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import x from "clsx";
|
|
3
|
-
import j from "lodash/camelCase";
|
|
4
|
-
import './flex.css';const S = "Flex", v = "_root_1mp2w_7", C = "_directionRow_1mp2w_14", F = "_directionColumn_1mp2w_18", h = "_directionRowReverse_1mp2w_22", R = "_directionColumnReverse_1mp2w_26", E = "_alignFlexStart_1mp2w_30", B = "_alignCenter_1mp2w_34", k = "_alignFlexEnd_1mp2w_38", A = "_alignStretch_1mp2w_42", W = "_alignBaseline_1mp2w_46", $ = "_justifyFlexStart_1mp2w_50", N = "_justifyCenter_1mp2w_54", D = "_justifyFlexEnd_1mp2w_58", I = "_justifySpaceBetween_1mp2w_62", L = "_justifySpaceAround_1mp2w_66", M = "_justifySpaceEvenly_1mp2w_70", P = "_fullWidth_1mp2w_74", Y = "_wrap_1mp2w_78", b = "_grow_1mp2w_82", q = "_shrink_1mp2w_86", e = {
|
|
5
|
-
root: v,
|
|
6
|
-
directionRow: C,
|
|
7
|
-
directionColumn: F,
|
|
8
|
-
directionRowReverse: h,
|
|
9
|
-
directionColumnReverse: R,
|
|
10
|
-
alignFlexStart: E,
|
|
11
|
-
alignCenter: B,
|
|
12
|
-
alignFlexEnd: k,
|
|
13
|
-
alignStretch: A,
|
|
14
|
-
alignBaseline: W,
|
|
15
|
-
justifyFlexStart: $,
|
|
16
|
-
justifyCenter: N,
|
|
17
|
-
justifyFlexEnd: D,
|
|
18
|
-
justifySpaceBetween: I,
|
|
19
|
-
justifySpaceAround: L,
|
|
20
|
-
justifySpaceEvenly: M,
|
|
21
|
-
fullWidth: P,
|
|
22
|
-
wrap: Y,
|
|
23
|
-
grow: b,
|
|
24
|
-
shrink: q
|
|
25
|
-
};
|
|
26
|
-
function i(n, t) {
|
|
27
|
-
return e[j(`${n}-${t}`)];
|
|
28
|
-
}
|
|
29
|
-
const z = (n) => {
|
|
30
|
-
const {
|
|
31
|
-
align: t,
|
|
32
|
-
as: _ = "div",
|
|
33
|
-
children: c,
|
|
34
|
-
direction: a = "row",
|
|
35
|
-
fullWidth: p,
|
|
36
|
-
gap: o,
|
|
37
|
-
grow: u,
|
|
38
|
-
id: w,
|
|
39
|
-
justify: l,
|
|
40
|
-
px: s,
|
|
41
|
-
py: r,
|
|
42
|
-
shrink: m,
|
|
43
|
-
style: d,
|
|
44
|
-
wrap: f
|
|
45
|
-
} = n, y = x(
|
|
46
|
-
e.root,
|
|
47
|
-
i("direction", a),
|
|
48
|
-
t != null && i("align", t),
|
|
49
|
-
l != null && i("justify", l),
|
|
50
|
-
f && e.wrap,
|
|
51
|
-
p && e.fullWidth,
|
|
52
|
-
u && e.grow,
|
|
53
|
-
m && e.shrink
|
|
54
|
-
);
|
|
55
|
-
return /* @__PURE__ */ g(
|
|
56
|
-
_,
|
|
57
|
-
{
|
|
58
|
-
className: y,
|
|
59
|
-
id: w,
|
|
60
|
-
style: {
|
|
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
|
-
...d
|
|
65
|
-
},
|
|
66
|
-
children: c
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
z.displayName = S;
|
|
1
|
+
import { F as r } from "./Flex-DvO3gB0Z.mjs";
|
|
71
2
|
export {
|
|
72
|
-
|
|
3
|
+
r as Flex
|
|
73
4
|
};
|
|
@@ -61,7 +61,7 @@ declare interface IProps extends default_2.PropsWithChildren {
|
|
|
61
61
|
* @example
|
|
62
62
|
* ```tsx
|
|
63
63
|
* import { LazarUiProvider } from '@lazar-ui/kit';
|
|
64
|
-
* import '@lazar-ui/kit/css/palettes/
|
|
64
|
+
* import '@lazar-ui/kit/css/palettes/purple.css';
|
|
65
65
|
* import '@lazar-ui/kit/css/semantic.css';
|
|
66
66
|
*
|
|
67
67
|
* function App() {
|
package/dist/text.js
CHANGED
|
@@ -1,50 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import j from "clsx";
|
|
4
|
-
import { g as D } from "./getDecorationStyle-BCBONKEl.mjs";
|
|
5
|
-
import { g as t } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
6
|
-
import './text.css';const u = "Text", w = "sm", S = "normal", h = "p", M = "_root_1vl2j_1", A = "_truncate_1vl2j_5", L = "_sizeXs_1vl2j_12", z = "_sizeSm_1vl2j_18", N = "_sizeMd_1vl2j_24", b = "_sizeLg_1vl2j_30", p = "_weightNormal_1vl2j_37", B = "_weightMedium_1vl2j_41", R = "_weightSemibold_1vl2j_45", f = "_weightBold_1vl2j_49", I = "_colorPrimary_1vl2j_54", P = "_colorSecondary_1vl2j_58", O = "_colorTertiary_1vl2j_62", U = "_colorDisabled_1vl2j_66", X = "_colorBrand_1vl2j_70", r = {
|
|
7
|
-
root: M,
|
|
8
|
-
truncate: A,
|
|
9
|
-
sizeXs: L,
|
|
10
|
-
sizeSm: z,
|
|
11
|
-
sizeMd: N,
|
|
12
|
-
sizeLg: b,
|
|
13
|
-
weightNormal: p,
|
|
14
|
-
weightMedium: B,
|
|
15
|
-
weightSemibold: R,
|
|
16
|
-
weightBold: f,
|
|
17
|
-
colorPrimary: I,
|
|
18
|
-
colorSecondary: P,
|
|
19
|
-
colorTertiary: O,
|
|
20
|
-
colorDisabled: U,
|
|
21
|
-
colorBrand: X
|
|
22
|
-
}, Y = y.forwardRef((o, e) => {
|
|
23
|
-
const {
|
|
24
|
-
as: l = h,
|
|
25
|
-
children: c,
|
|
26
|
-
color: s,
|
|
27
|
-
size: i = w,
|
|
28
|
-
weight: a = S,
|
|
29
|
-
truncate: n = !1,
|
|
30
|
-
underline: _,
|
|
31
|
-
strikethrough: m
|
|
32
|
-
} = o, d = D({ strikethrough: m, underline: _ }), g = j(
|
|
33
|
-
r.root,
|
|
34
|
-
t("size", i, r),
|
|
35
|
-
t("weight", a, r),
|
|
36
|
-
s && t("color", s, r),
|
|
37
|
-
{
|
|
38
|
-
[r.truncate]: n
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
return /* @__PURE__ */ v(l, { className: g, ref: e, style: d, children: c });
|
|
42
|
-
});
|
|
43
|
-
Y.displayName = u;
|
|
44
|
-
var F = /* @__PURE__ */ ((o) => (o.XS = "xs", o.SM = "sm", o.MD = "md", o.LG = "lg", o))(F || {}), G = /* @__PURE__ */ ((o) => (o.PRIMARY = "primary", o.SECONDARY = "secondary", o.TERTIARY = "tertiary", o.DISABLED = "disabled", o.BRAND = "brand", o))(G || {}), T = /* @__PURE__ */ ((o) => (o.NORMAL = "normal", o.MEDIUM = "medium", o.SEMIBOLD = "semibold", o.BOLD = "bold", o))(T || {});
|
|
1
|
+
import { T as R } from "./Text-DQPy-DZ5.mjs";
|
|
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 || {});
|
|
45
3
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
4
|
+
d as ETextColor,
|
|
5
|
+
a as ETextSize,
|
|
6
|
+
m as ETextWeight,
|
|
7
|
+
R as Text
|
|
50
8
|
};
|
package/dist/toast.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--toast-gap: var(--lui-space-2);--toast-max-width: 400px;--toast-offset: var(--lui-space-4);--toast-z-index: 9999}._root_1eefh_8{display:flex;flex-direction:column;gap:var(--toast-gap);max-width:var(--toast-max-width);position:fixed;z-index:var(--toast-z-index)}._positionBottomLeft_1eefh_17{bottom:var(--toast-offset);left:var(--toast-offset)}._positionBottomRight_1eefh_22{bottom:var(--toast-offset);right:var(--toast-offset)}._positionTopLeft_1eefh_27{left:var(--toast-offset);top:var(--toast-offset)}._positionTopRight_1eefh_32{right:var(--toast-offset);top:var(--toast-offset)}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum EToastPosition {
|
|
4
|
+
BOTTOM_LEFT = "bottomLeft",
|
|
5
|
+
BOTTOM_RIGHT = "bottomRight",
|
|
6
|
+
TOP_LEFT = "topLeft",
|
|
7
|
+
TOP_RIGHT = "topRight"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare enum EToastType {
|
|
11
|
+
ERROR = "error",
|
|
12
|
+
INFO = "info",
|
|
13
|
+
SUCCESS = "success"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare interface IToast {
|
|
17
|
+
id: string;
|
|
18
|
+
message: string;
|
|
19
|
+
type: TToastType;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare interface IToastContext {
|
|
23
|
+
addToast: (message: string, type: TToastType) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare interface IToastProps extends default_2.PropsWithChildren {
|
|
27
|
+
/** Auto-dismiss timeout in milliseconds. Set to 0 to disable. Default: 4000. */
|
|
28
|
+
autoDismissMs?: number;
|
|
29
|
+
/** Maximum number of visible toasts. Oldest are removed first. */
|
|
30
|
+
maxToasts?: number;
|
|
31
|
+
/** Position of the toast container on the screen. Default: 'bottomRight'. */
|
|
32
|
+
position?: TToastPosition;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* ToastProvider — context provider and fixed-position container for toast notifications.
|
|
37
|
+
*
|
|
38
|
+
* Wraps the application and renders a container that displays toast messages
|
|
39
|
+
* triggered via the `useToast` hook. Supports configurable position, auto-dismiss
|
|
40
|
+
* timeout, and maximum number of visible toasts.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <ToastProvider position="bottomRight" autoDismissMs={4000}>
|
|
45
|
+
* <App />
|
|
46
|
+
* </ToastProvider>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* // Disable auto-dismiss and limit to 3 toasts
|
|
52
|
+
* <ToastProvider autoDismissMs={0} maxToasts={3}>
|
|
53
|
+
* <App />
|
|
54
|
+
* </ToastProvider>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const ToastProvider: default_2.FC<IToastProps>;
|
|
58
|
+
|
|
59
|
+
export declare type TToastPosition = `${EToastPosition.BOTTOM_LEFT | EToastPosition.BOTTOM_RIGHT | EToastPosition.TOP_LEFT | EToastPosition.TOP_RIGHT}`;
|
|
60
|
+
|
|
61
|
+
export declare type TToastType = `${EToastType.ERROR | EToastType.INFO | EToastType.SUCCESS}`;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Hook to show toast notifications.
|
|
65
|
+
*
|
|
66
|
+
* Must be used within a `ToastProvider`. Returns an object with a `toast` property
|
|
67
|
+
* containing `success`, `error`, and `info` methods.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```tsx
|
|
71
|
+
* const { toast } = useToast();
|
|
72
|
+
*
|
|
73
|
+
* toast.success('Saved successfully');
|
|
74
|
+
* toast.error('Operation failed');
|
|
75
|
+
* toast.info('Processing...');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function useToast(): {
|
|
79
|
+
toast: {
|
|
80
|
+
error: (message: string) => void;
|
|
81
|
+
info: (message: string) => void;
|
|
82
|
+
success: (message: string) => void;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { }
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsxs as h, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as v, useState as C, useRef as E, useCallback as p, useEffect as N, useContext as B, useMemo as M } from "react";
|
|
3
|
+
import y from "clsx";
|
|
4
|
+
import { A as P } from "./Alert-BW15jsDc.mjs";
|
|
5
|
+
import { B as b } from "./Button-BN85EtaZ.mjs";
|
|
6
|
+
import { F as w } from "./Flex-DvO3gB0Z.mjs";
|
|
7
|
+
import { T as F } from "./Text-DQPy-DZ5.mjs";
|
|
8
|
+
import { g as O } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
9
|
+
import './toast.css';const U = 4e3, j = "bottomRight", g = "Toast", k = 36, z = 11, V = 2, X = {
|
|
10
|
+
error: "danger",
|
|
11
|
+
info: "info",
|
|
12
|
+
success: "success"
|
|
13
|
+
}, Y = "_root_1eefh_8", $ = "_positionBottomLeft_1eefh_17", q = "_positionBottomRight_1eefh_22", G = "_positionTopLeft_1eefh_27", H = "_positionTopRight_1eefh_32", _ = {
|
|
14
|
+
root: Y,
|
|
15
|
+
positionBottomLeft: $,
|
|
16
|
+
positionBottomRight: q,
|
|
17
|
+
positionTopLeft: G,
|
|
18
|
+
positionTopRight: H
|
|
19
|
+
}, x = v(null), I = ({ toast: e, onDismiss: o }) => {
|
|
20
|
+
const l = X[e.type], t = p(() => {
|
|
21
|
+
o(e.id);
|
|
22
|
+
}, [o, e.id]);
|
|
23
|
+
return /* @__PURE__ */ m(P, { variant: l, children: /* @__PURE__ */ h(w, { align: "center", gap: 3, children: [
|
|
24
|
+
/* @__PURE__ */ m(F, { as: "span", color: "primary", size: "sm", children: e.message }),
|
|
25
|
+
/* @__PURE__ */ m(b, { "aria-label": "Dismiss", icon: "x", mode: "text", size: "sm", variant: "secondary", onClick: t })
|
|
26
|
+
] }) });
|
|
27
|
+
};
|
|
28
|
+
I.displayName = `${g}.Item`;
|
|
29
|
+
const J = (e) => {
|
|
30
|
+
const { autoDismissMs: o = U, children: l, maxToasts: t, position: A = j } = e, [D, u] = C([]), i = E(/* @__PURE__ */ new Map()), f = p((s) => {
|
|
31
|
+
const r = i.current.get(s);
|
|
32
|
+
r && (clearTimeout(r), i.current.delete(s)), u((n) => n.filter((c) => c.id !== s));
|
|
33
|
+
}, []), R = p(
|
|
34
|
+
(s, r) => {
|
|
35
|
+
const n = Math.random().toString(k).slice(V, z);
|
|
36
|
+
if (u((c) => {
|
|
37
|
+
const a = [...c, { id: n, message: s, type: r }];
|
|
38
|
+
if (t != null && a.length > t) {
|
|
39
|
+
const L = a.slice(0, a.length - t);
|
|
40
|
+
for (const T of L) {
|
|
41
|
+
const d = i.current.get(T.id);
|
|
42
|
+
d && (clearTimeout(d), i.current.delete(T.id));
|
|
43
|
+
}
|
|
44
|
+
return a.slice(-t);
|
|
45
|
+
}
|
|
46
|
+
return a;
|
|
47
|
+
}), o > 0) {
|
|
48
|
+
const c = setTimeout(() => {
|
|
49
|
+
f(n);
|
|
50
|
+
}, o);
|
|
51
|
+
i.current.set(n, c);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
[o, t, f]
|
|
55
|
+
);
|
|
56
|
+
N(() => {
|
|
57
|
+
const s = i.current;
|
|
58
|
+
return () => {
|
|
59
|
+
s.forEach((r) => clearTimeout(r)), s.clear();
|
|
60
|
+
};
|
|
61
|
+
}, []);
|
|
62
|
+
const S = y(_.root, O("position", A, _));
|
|
63
|
+
return /* @__PURE__ */ h(x.Provider, { value: { addToast: R }, children: [
|
|
64
|
+
l,
|
|
65
|
+
/* @__PURE__ */ m("div", { className: S, children: D.map((s) => /* @__PURE__ */ m(I, { onDismiss: f, toast: s }, s.id)) })
|
|
66
|
+
] });
|
|
67
|
+
};
|
|
68
|
+
J.displayName = g;
|
|
69
|
+
function it() {
|
|
70
|
+
const e = B(x);
|
|
71
|
+
if (!e)
|
|
72
|
+
throw new Error("useToast must be used within a ToastProvider");
|
|
73
|
+
const { addToast: o } = e;
|
|
74
|
+
return { toast: M(
|
|
75
|
+
() => ({
|
|
76
|
+
error: (t) => o(t, "error"),
|
|
77
|
+
info: (t) => o(t, "info"),
|
|
78
|
+
success: (t) => o(t, "success")
|
|
79
|
+
}),
|
|
80
|
+
[o]
|
|
81
|
+
) };
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
J as ToastProvider,
|
|
85
|
+
it as useToast
|
|
86
|
+
};
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|