@lazar-ui/kit 0.6.2 → 0.8.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 +23 -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/flex.js +2 -71
- package/dist/select.d.ts +45 -3
- package/dist/select.js +103 -81
- package/dist/slider.css +1 -0
- package/dist/slider.d.ts +50 -0
- package/dist/slider.js +72 -0
- package/dist/table.d.ts +4 -0
- package/dist/table.js +29 -29
- package/dist/text.d.ts +15 -15
- 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/dist/utils.d.ts +4 -4
- 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,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.0] - 2026-07-10
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **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))
|
|
8
|
+
|
|
9
|
+
## [0.7.0] - 2026-07-06
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- **Slider**: новый standalone компонент для выбора числового значения из диапазона. Поддерживает controlled/uncontrolled режимы, min/max/step, размеры (sm/md/lg), `showValue` и `disabled`. Использует нативный `<input type="range">` для accessibility.
|
|
14
|
+
- **Select**: добавлен JSX composition mode — теперь можно использовать `<Select.Option>` как дочерние элементы вместо пропа `options`. Поддерживаются те же возможности: value/label, disabled, controlled/uncontrolled.
|
|
15
|
+
- **Table.Row**: добавлен проп `onClick` — обработчик клика по строке таблицы.
|
|
16
|
+
- **Table.Row**: добавлен проп `style` для инлайн-стилей строки.
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **Tabs**: исправлен type error в тесте — использование `ETabsVariant.BUTTONS` вместо строкового литерала.
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
- **rules**: обновлён `.opencode/rules/ui-kit.md` (секция Build, память, тесты).
|
|
25
|
+
|
|
3
26
|
## [0.6.2] - 2026-06-10
|
|
4
27
|
|
|
5
28
|
### Bug Fixes
|
|
@@ -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
|
};
|
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
|
};
|
package/dist/select.d.ts
CHANGED
|
@@ -15,9 +15,23 @@ export declare interface ISelectOption {
|
|
|
15
15
|
disabled?: boolean;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export declare interface ISelectOptionProps {
|
|
19
|
+
/** Option value. */
|
|
20
|
+
value: string;
|
|
21
|
+
/** Whether the option is disabled. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Option label (display text). */
|
|
24
|
+
children: default_2.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
export declare interface ISelectProps {
|
|
19
|
-
/**
|
|
20
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Array of options to display in the dropdown.
|
|
30
|
+
*
|
|
31
|
+
* Use this for props-driven mode.
|
|
32
|
+
* For JSX composition mode, pass `<Select.Option>` children instead.
|
|
33
|
+
*/
|
|
34
|
+
options?: ISelectOption[];
|
|
21
35
|
/** Currently selected value(s). For single select — string, for multiple — string[]. */
|
|
22
36
|
value?: string | string[];
|
|
23
37
|
/** Callback when selection changes. */
|
|
@@ -34,8 +48,16 @@ export declare interface ISelectProps {
|
|
|
34
48
|
clearable?: boolean;
|
|
35
49
|
/** Whether the select is in an invalid state. */
|
|
36
50
|
invalid?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* JSX composition children.
|
|
53
|
+
* When provided with `<SelectOption>` elements, they are used
|
|
54
|
+
* as the option data source instead of the `options` prop.
|
|
55
|
+
*/
|
|
56
|
+
children?: default_2.ReactNode;
|
|
37
57
|
}
|
|
38
58
|
|
|
59
|
+
export declare const Select: TSelectCompoundComponent;
|
|
60
|
+
|
|
39
61
|
/**
|
|
40
62
|
* Select component. A dropdown selector built on top of Popover.
|
|
41
63
|
*
|
|
@@ -57,7 +79,27 @@ export declare interface ISelectProps {
|
|
|
57
79
|
* />
|
|
58
80
|
* ```
|
|
59
81
|
*/
|
|
60
|
-
|
|
82
|
+
declare const Select_2: default_2.FC<ISelectProps>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Select Option sub-component for JSX composition mode.
|
|
86
|
+
*
|
|
87
|
+
* Used as `<Select.Option>` child of `<Select>`.
|
|
88
|
+
* Acts as a data carrier — does not render any DOM itself.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* <Select value={val} onChange={setVal}>
|
|
93
|
+
* <Select.Option value="1">Option 1</Select.Option>
|
|
94
|
+
* <Select.Option value="2" disabled>Option 2</Select.Option>
|
|
95
|
+
* </Select>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
declare const SelectOption: default_2.FC<ISelectOptionProps>;
|
|
99
|
+
|
|
100
|
+
declare type TSelectCompoundComponent = typeof Select_2 & {
|
|
101
|
+
Option: typeof SelectOption;
|
|
102
|
+
};
|
|
61
103
|
|
|
62
104
|
export declare type TSelectSize = `${ESelectSize.SM | ESelectSize.MD | ESelectSize.LG}`;
|
|
63
105
|
|
package/dist/select.js
CHANGED
|
@@ -1,121 +1,139 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { I as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { u as
|
|
7
|
-
import { g as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { jsxs as p, jsx as o, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import F, { useState as R, useMemo as U, useCallback as v } from "react";
|
|
3
|
+
import m from "clsx";
|
|
4
|
+
import { I as S } from "./Icon-DUCBChX2.mjs";
|
|
5
|
+
import { Popover as C } from "./popover.js";
|
|
6
|
+
import { u as V } from "./useLocale-CJh-krrY.mjs";
|
|
7
|
+
import { g as W } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
8
|
+
import { i as Y } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
9
|
+
import './select.css';const O = "Select", $ = "bottom start";
|
|
10
|
+
var k = /* @__PURE__ */ ((c) => (c.OPTION = "Select.Option", c))(k || {});
|
|
11
|
+
const q = "_root_t7wta_7", G = "_disabled_t7wta_28", H = "_invalid_t7wta_35", J = "_sizeSm_t7wta_39", K = "_sizeMd_t7wta_45", Q = "_sizeLg_t7wta_51", X = "_displayText_t7wta_57", Z = "_displayTextPlaceholder_t7wta_64", ee = "_indicators_t7wta_68", te = "_clearButton_t7wta_74", oe = "_chevron_t7wta_92", se = "_optionsList_t7wta_103", ae = "_noOptions_t7wta_112", le = "_option_t7wta_103", ne = "_optionSelected_t7wta_132", ie = "_optionDisabled_t7wta_138", ce = "_optionLabel_t7wta_146", re = "_checkbox_t7wta_153", de = "_checkboxChecked_t7wta_165", t = {
|
|
12
|
+
root: q,
|
|
13
|
+
disabled: G,
|
|
14
|
+
invalid: H,
|
|
15
|
+
sizeSm: J,
|
|
16
|
+
sizeMd: K,
|
|
17
|
+
sizeLg: Q,
|
|
18
|
+
displayText: X,
|
|
19
|
+
displayTextPlaceholder: Z,
|
|
20
|
+
indicators: ee,
|
|
21
|
+
clearButton: te,
|
|
22
|
+
chevron: oe,
|
|
23
|
+
optionsList: se,
|
|
24
|
+
noOptions: ae,
|
|
25
|
+
option: le,
|
|
26
|
+
optionSelected: ne,
|
|
27
|
+
optionDisabled: ie,
|
|
28
|
+
optionLabel: ce,
|
|
29
|
+
checkbox: re,
|
|
30
|
+
checkboxChecked: de
|
|
31
|
+
}, L = (c) => {
|
|
29
32
|
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
children: b,
|
|
34
|
+
clearable: y = !1,
|
|
35
|
+
disabled: r = !1,
|
|
36
|
+
invalid: w = !1,
|
|
37
|
+
multiple: a = !1,
|
|
38
|
+
onChange: l,
|
|
39
|
+
options: u,
|
|
40
|
+
placeholder: z,
|
|
41
|
+
size: P = "md",
|
|
38
42
|
value: n
|
|
39
|
-
} =
|
|
43
|
+
} = c, [E, N] = R(!1), f = V(), _ = U(() => {
|
|
44
|
+
if (!b)
|
|
45
|
+
return u ?? [];
|
|
46
|
+
const e = [], s = [k.OPTION];
|
|
47
|
+
return F.Children.forEach(b, (x) => {
|
|
48
|
+
if (Y(s, x, !1)) {
|
|
49
|
+
const d = x, i = d.props.children, D = typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : "";
|
|
50
|
+
e.push({
|
|
51
|
+
disabled: d.props.disabled,
|
|
52
|
+
label: D,
|
|
53
|
+
value: d.props.value
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}), e.length > 0 ? e : u ?? [];
|
|
57
|
+
}, [b, u]), h = a ? _.filter((e) => n?.includes(e.value)) : _.filter((e) => e.value === n), g = h.length > 0 ? h.map((e) => e.label).join(", ") : z ?? f.Select.placeholder, I = v(
|
|
40
58
|
(e) => {
|
|
41
|
-
if (!e.disabled &&
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
|
|
59
|
+
if (!e.disabled && l)
|
|
60
|
+
if (a) {
|
|
61
|
+
const s = n ?? [], d = s.includes(e.value) ? s.filter((i) => i !== e.value) : [...s, e.value];
|
|
62
|
+
l(d);
|
|
45
63
|
} else
|
|
46
|
-
|
|
64
|
+
l(e.value), N(!1);
|
|
47
65
|
},
|
|
48
|
-
[
|
|
49
|
-
),
|
|
66
|
+
[a, l, n]
|
|
67
|
+
), M = v(
|
|
50
68
|
(e) => {
|
|
51
|
-
e.stopPropagation(),
|
|
69
|
+
e.stopPropagation(), l && l(a ? [] : "");
|
|
52
70
|
},
|
|
53
|
-
[
|
|
54
|
-
),
|
|
55
|
-
(e) =>
|
|
56
|
-
[
|
|
57
|
-
),
|
|
71
|
+
[a, l]
|
|
72
|
+
), A = v(
|
|
73
|
+
(e) => a ? n?.includes(e) ?? !1 : n === e,
|
|
74
|
+
[a, n]
|
|
75
|
+
), B = m(
|
|
58
76
|
t.root,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
77
|
+
W("size", P, t),
|
|
78
|
+
r && t.disabled,
|
|
79
|
+
w && t.invalid
|
|
62
80
|
);
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ p(C, { onOpenChange: N, open: E, placement: $, children: [
|
|
82
|
+
/* @__PURE__ */ o(C.Trigger, { children: /* @__PURE__ */ p(
|
|
65
83
|
"div",
|
|
66
84
|
{
|
|
67
|
-
"aria-disabled":
|
|
68
|
-
"aria-invalid":
|
|
69
|
-
className:
|
|
85
|
+
"aria-disabled": r,
|
|
86
|
+
"aria-invalid": w,
|
|
87
|
+
className: B,
|
|
70
88
|
role: "combobox",
|
|
71
|
-
tabIndex:
|
|
72
|
-
onClick:
|
|
89
|
+
tabIndex: r ? -1 : 0,
|
|
90
|
+
onClick: r ? (e) => e.stopPropagation() : void 0,
|
|
73
91
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
92
|
+
/* @__PURE__ */ o("span", { className: m(t.displayText, !h.length && t.displayTextPlaceholder), children: g }),
|
|
93
|
+
/* @__PURE__ */ p("span", { className: t.indicators, children: [
|
|
94
|
+
y && h.length > 0 && !r && /* @__PURE__ */ o(
|
|
77
95
|
"button",
|
|
78
96
|
{
|
|
79
|
-
"aria-label":
|
|
97
|
+
"aria-label": f.Select.clear,
|
|
80
98
|
className: t.clearButton,
|
|
81
|
-
onClick:
|
|
99
|
+
onClick: M,
|
|
82
100
|
tabIndex: -1,
|
|
83
101
|
type: "button",
|
|
84
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ o(S, { name: "x", size: 14 })
|
|
85
103
|
}
|
|
86
104
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ o("span", { className: t.chevron, children: /* @__PURE__ */ o(S, { name: "chevron-down", size: 16 }) })
|
|
88
106
|
] })
|
|
89
107
|
]
|
|
90
108
|
}
|
|
91
109
|
) }),
|
|
92
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ o(C.Content, { padding: !1, children: /* @__PURE__ */ p(
|
|
93
111
|
"ul",
|
|
94
112
|
{
|
|
95
|
-
"aria-label":
|
|
113
|
+
"aria-label": g,
|
|
96
114
|
className: t.optionsList,
|
|
97
115
|
role: "listbox",
|
|
98
116
|
children: [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
return /* @__PURE__ */
|
|
117
|
+
_.length === 0 && /* @__PURE__ */ o("li", { className: t.noOptions, children: f.Select.noOptions }),
|
|
118
|
+
_.map((e) => {
|
|
119
|
+
const s = A(e.value);
|
|
120
|
+
return /* @__PURE__ */ p(
|
|
103
121
|
"li",
|
|
104
122
|
{
|
|
105
123
|
"aria-disabled": e.disabled,
|
|
106
|
-
"aria-selected":
|
|
107
|
-
className:
|
|
124
|
+
"aria-selected": s,
|
|
125
|
+
className: m(
|
|
108
126
|
t.option,
|
|
109
|
-
|
|
127
|
+
s && t.optionSelected,
|
|
110
128
|
e.disabled && t.optionDisabled
|
|
111
129
|
),
|
|
112
130
|
onClick: () => {
|
|
113
|
-
|
|
131
|
+
I(e);
|
|
114
132
|
},
|
|
115
133
|
role: "option",
|
|
116
134
|
children: [
|
|
117
|
-
|
|
118
|
-
/* @__PURE__ */
|
|
135
|
+
a && /* @__PURE__ */ o("span", { className: m(t.checkbox, s && t.checkboxChecked), children: s && /* @__PURE__ */ o(S, { name: "check", size: 12, strokeWidth: 3 }) }),
|
|
136
|
+
/* @__PURE__ */ o("span", { className: t.optionLabel, children: e.label })
|
|
119
137
|
]
|
|
120
138
|
},
|
|
121
139
|
e.value
|
|
@@ -126,7 +144,11 @@ import './select.css';const I = "Select", M = "bottom start", A = "_root_t7wta_7
|
|
|
126
144
|
) })
|
|
127
145
|
] });
|
|
128
146
|
};
|
|
129
|
-
|
|
147
|
+
L.displayName = O;
|
|
148
|
+
const T = ({ children: c }) => /* @__PURE__ */ o(j, { children: c });
|
|
149
|
+
T.displayName = `${O}.Option`;
|
|
150
|
+
const pe = L;
|
|
151
|
+
pe.Option = T;
|
|
130
152
|
export {
|
|
131
|
-
|
|
153
|
+
pe as Select
|
|
132
154
|
};
|
package/dist/slider.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--slider-track-height: 6px;--slider-track-radius: var(--lui-radius-full);--slider-track-background: var(--lui-palette-gray-200);--slider-range-background: var(--lui-palette-brand);--slider-thumb-size: 18px;--slider-thumb-background: var(--lui-palette-white);--slider-thumb-border-color: var(--lui-palette-brand);--slider-thumb-border-width: 2px;--slider-thumb-shadow: var(--lui-shadow-xs);--slider-value-font-size: var(--lui-font-size-md);--slider-value-line-height: var(--line-height-md);--slider-value-color: var(--lui-color-text-primary);--slider-gap: var(--lui-space-2);--slider-transition-duration: .15s;--slider-transition-timing: cubic-bezier(.4, 0, .2, 1)}._root_16h6h_24{align-items:center;display:inline-flex;gap:var(--slider-gap);width:100%}._root_16h6h_24._disabled_16h6h_31{cursor:not-allowed;opacity:.5;pointer-events:none}._container_16h6h_37{flex:1;height:var(--slider-thumb-size);min-width:120px;position:relative}._input_16h6h_45{cursor:pointer;height:100%;left:0;margin:0;opacity:0;padding:0;position:absolute;top:0;width:100%;z-index:1}._track_16h6h_58{background:var(--slider-track-background);border-radius:var(--slider-track-radius);height:var(--slider-track-height);left:0;position:absolute;right:0;top:50%;transform:translateY(-50%)}._range_16h6h_69{background:var(--slider-range-background);border-radius:var(--slider-track-radius);height:100%;left:0;position:absolute;top:0;transition:background var(--slider-transition-duration) var(--slider-transition-timing)}._thumb_16h6h_79{background:var(--slider-thumb-background);border:var(--slider-thumb-border-width) solid var(--slider-thumb-border-color);border-radius:50%;box-shadow:var(--slider-thumb-shadow);height:var(--slider-thumb-size);position:absolute;top:50%;transform:translate(-50%,-50%);transition:border-color var(--slider-transition-duration) var(--slider-transition-timing),box-shadow var(--slider-transition-duration) var(--slider-transition-timing),transform var(--slider-transition-duration) var(--slider-transition-timing);width:var(--slider-thumb-size)}._input_16h6h_45:focus-visible~._track_16h6h_58 ._thumb_16h6h_79{box-shadow:0 0 0 2px var(--lui-color-background-primary),0 0 0 4px var(--lui-color-border-focus)}._input_16h6h_45:not(:disabled):hover~._track_16h6h_58 ._thumb_16h6h_79{transform:translate(-50%,-50%) scale(1.1)}._input_16h6h_45:not(:disabled):active~._track_16h6h_58 ._thumb_16h6h_79{transform:translate(-50%,-50%) scale(.95)}._input_16h6h_45:disabled~._track_16h6h_58{background:var(--lui-palette-gray-100)}._input_16h6h_45:disabled~._track_16h6h_58 ._range_16h6h_69{background:var(--lui-palette-gray-300)}._input_16h6h_45:disabled~._track_16h6h_58 ._thumb_16h6h_79{border-color:var(--lui-palette-gray-300)}._value_16h6h_120{color:var(--slider-value-color);flex-shrink:0;font-size:var(--slider-value-font-size);line-height:var(--slider-value-line-height);min-width:3ch;text-align:right;-webkit-user-select:none;user-select:none}._sizeSm_16h6h_131{--slider-track-height: 4px;--slider-thumb-size: 14px;--slider-thumb-border-width: 2px;--slider-value-font-size: var(--lui-font-size-sm);--slider-value-line-height: var(--line-height-sm)}._sizeMd_16h6h_140{--slider-track-height: 6px;--slider-thumb-size: 18px;--slider-thumb-border-width: 2px;--slider-value-font-size: var(--lui-font-size-md);--slider-value-line-height: var(--line-height-md)}._sizeLg_16h6h_149{--slider-track-height: 8px;--slider-thumb-size: 22px;--slider-thumb-border-width: 3px;--slider-value-font-size: var(--lui-font-size-lg);--slider-value-line-height: var(--line-height-lg)}
|
package/dist/slider.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare enum ESliderSize {
|
|
4
|
+
SM = "sm",
|
|
5
|
+
MD = "md",
|
|
6
|
+
LG = "lg"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare interface ISliderProps {
|
|
10
|
+
/** Current value. Default: 0. */
|
|
11
|
+
value?: number;
|
|
12
|
+
/** Default value for uncontrolled mode. */
|
|
13
|
+
defaultValue?: number;
|
|
14
|
+
/** Callback when value changes. */
|
|
15
|
+
onChange?: (value: number) => void;
|
|
16
|
+
/** Minimum value. Default: 0. */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** Maximum value. Default: 100. */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** Step increment. Default: 1. */
|
|
21
|
+
step?: number;
|
|
22
|
+
/** Size. Default: 'md'. */
|
|
23
|
+
size?: TSliderSize;
|
|
24
|
+
/** Disables the slider. */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Whether to show the value label next to the slider. Default: false. */
|
|
27
|
+
showValue?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Slider component. Renders a range slider for selecting a numeric value.
|
|
32
|
+
*
|
|
33
|
+
* Supports controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) modes.
|
|
34
|
+
* Uses a hidden native `<input type="range">` for accessibility and keyboard interaction.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Slider />
|
|
39
|
+
* <Slider defaultValue={50} />
|
|
40
|
+
* <Slider value={75} onChange={(v) => setValue(v)} />
|
|
41
|
+
* <Slider min={0} max={10} step={2} />
|
|
42
|
+
* <Slider size="lg" showValue />
|
|
43
|
+
* <Slider disabled />
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const Slider: default_2.FC<ISliderProps>;
|
|
47
|
+
|
|
48
|
+
export declare type TSliderSize = `${ESliderSize.SM | ESliderSize.MD | ESliderSize.LG}`;
|
|
49
|
+
|
|
50
|
+
export { }
|
package/dist/slider.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useMemo as C, useCallback as S } from "react";
|
|
3
|
+
import x from "clsx";
|
|
4
|
+
import { g as k } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
5
|
+
import './slider.css';const y = "Slider", M = "_root_16h6h_24", w = "_disabled_16h6h_31", L = "_container_16h6h_37", j = "_input_16h6h_45", A = "_track_16h6h_58", I = "_range_16h6h_69", $ = "_thumb_16h6h_79", D = "_value_16h6h_120", E = "_sizeSm_16h6h_131", P = "_sizeMd_16h6h_140", Y = "_sizeLg_16h6h_149", e = {
|
|
6
|
+
root: M,
|
|
7
|
+
disabled: w,
|
|
8
|
+
container: L,
|
|
9
|
+
input: j,
|
|
10
|
+
track: A,
|
|
11
|
+
range: I,
|
|
12
|
+
thumb: $,
|
|
13
|
+
value: D,
|
|
14
|
+
sizeSm: E,
|
|
15
|
+
sizeMd: P,
|
|
16
|
+
sizeLg: Y
|
|
17
|
+
}, q = (d) => {
|
|
18
|
+
const {
|
|
19
|
+
value: r,
|
|
20
|
+
defaultValue: _ = 0,
|
|
21
|
+
disabled: o = !1,
|
|
22
|
+
max: t = 100,
|
|
23
|
+
min: s = 0,
|
|
24
|
+
onChange: c,
|
|
25
|
+
showValue: m = !1,
|
|
26
|
+
size: v = "md",
|
|
27
|
+
step: g = 1
|
|
28
|
+
} = d, l = r !== void 0, [p, N] = V(_);
|
|
29
|
+
let a;
|
|
30
|
+
l ? a = r : a = p;
|
|
31
|
+
const h = C(() => t === s ? 0 : (a - s) / (t - s) * 100, [a, s, t]), b = S(
|
|
32
|
+
(z) => {
|
|
33
|
+
const u = Number(z.target.value);
|
|
34
|
+
l || N(u), c?.(u);
|
|
35
|
+
},
|
|
36
|
+
[l, c]
|
|
37
|
+
), f = x(
|
|
38
|
+
e.root,
|
|
39
|
+
k("size", v, e),
|
|
40
|
+
o && e.disabled
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ i("div", { className: f, children: [
|
|
43
|
+
/* @__PURE__ */ i("div", { className: e.container, children: [
|
|
44
|
+
/* @__PURE__ */ n(
|
|
45
|
+
"input",
|
|
46
|
+
{
|
|
47
|
+
"aria-valuemax": t,
|
|
48
|
+
"aria-valuemin": s,
|
|
49
|
+
"aria-valuenow": a,
|
|
50
|
+
className: e.input,
|
|
51
|
+
disabled: o,
|
|
52
|
+
max: t,
|
|
53
|
+
min: s,
|
|
54
|
+
onChange: b,
|
|
55
|
+
role: "slider",
|
|
56
|
+
step: g,
|
|
57
|
+
type: "range",
|
|
58
|
+
value: a
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ i("div", { className: e.track, "aria-hidden": "true", children: [
|
|
62
|
+
/* @__PURE__ */ n("div", { className: e.range, style: { width: `${h}%` } }),
|
|
63
|
+
/* @__PURE__ */ n("div", { className: e.thumb, style: { left: `${h}%` } })
|
|
64
|
+
] })
|
|
65
|
+
] }),
|
|
66
|
+
m && /* @__PURE__ */ n("span", { className: e.value, children: a })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
q.displayName = y;
|
|
70
|
+
export {
|
|
71
|
+
q as Slider
|
|
72
|
+
};
|
package/dist/table.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ declare interface IProps_2 extends default_2.PropsWithChildren {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
declare interface IProps_3 extends default_2.PropsWithChildren {
|
|
53
|
+
/** Click handler for the row. */
|
|
54
|
+
onClick?: default_2.MouseEventHandler<HTMLTableRowElement>;
|
|
55
|
+
/** Inline styles. */
|
|
56
|
+
style?: default_2.CSSProperties;
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
declare interface IProps_4 extends default_2.PropsWithChildren {
|
package/dist/table.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
1
|
+
import { jsxs as h, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import b, { useCallback as p } from "react";
|
|
3
3
|
import { B as u } from "./Button-BN85EtaZ.mjs";
|
|
4
|
-
import { C as
|
|
5
|
-
import { u as
|
|
6
|
-
import
|
|
4
|
+
import { C as y } from "./Chip-CmsNZTlz.mjs";
|
|
5
|
+
import { u as L } from "./useLocale-CJh-krrY.mjs";
|
|
6
|
+
import R from "clsx";
|
|
7
7
|
import { g as w } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
8
8
|
import { i } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
9
9
|
import "lodash/camelCase";
|
|
10
10
|
import './table.css';const v = "Table.ActiveFilters", x = "_root_4qb7d_5", $ = {
|
|
11
11
|
root: x
|
|
12
12
|
}, g = (t) => {
|
|
13
|
-
const { filters:
|
|
14
|
-
(
|
|
15
|
-
r(
|
|
13
|
+
const { filters: l, onClearAll: e, onRemove: r } = t, s = L(), o = p(
|
|
14
|
+
(n) => () => {
|
|
15
|
+
r(n);
|
|
16
16
|
},
|
|
17
17
|
[r]
|
|
18
18
|
), m = p(() => {
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
e?.();
|
|
20
|
+
}, [e]);
|
|
21
|
+
return l.length === 0 ? null : /* @__PURE__ */ h("div", { className: $.root, children: [
|
|
22
|
+
l.map((n) => /* @__PURE__ */ h(y, { onDelete: o(n.key), children: [
|
|
23
|
+
n.label,
|
|
24
24
|
": ",
|
|
25
|
-
|
|
26
|
-
] },
|
|
27
|
-
|
|
25
|
+
n.value
|
|
26
|
+
] }, n.key)),
|
|
27
|
+
e && /* @__PURE__ */ c(u, { mode: "text", size: "sm", onClick: m, children: s.Table.ActiveFilters.clearAll })
|
|
28
28
|
] });
|
|
29
29
|
};
|
|
30
30
|
g.displayName = v;
|
|
31
|
-
var
|
|
31
|
+
var a = /* @__PURE__ */ ((t) => (t.CELL = "Table.Cell", t.ROW = "Table.Row", t.TOOLBAR = "Table.Toolbar", t))(a || {});
|
|
32
32
|
const O = "_root_lmxwt_8", k = "_header_lmxwt_17", B = "_alignLeft_lmxwt_21", F = "_alignRight_lmxwt_24", D = "_alignCenter_lmxwt_27", _ = {
|
|
33
33
|
root: O,
|
|
34
34
|
header: k,
|
|
@@ -36,36 +36,36 @@ const O = "_root_lmxwt_8", k = "_header_lmxwt_17", B = "_alignLeft_lmxwt_21", F
|
|
|
36
36
|
alignRight: F,
|
|
37
37
|
alignCenter: D
|
|
38
38
|
}, A = (t) => {
|
|
39
|
-
const { align:
|
|
40
|
-
[_.header]:
|
|
39
|
+
const { align: l = "left", as: e = "td", children: r, title: s, width: o } = t, m = R(_.root, w("align", l, _), {
|
|
40
|
+
[_.header]: e === "th"
|
|
41
41
|
});
|
|
42
|
-
return /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ c(e, { className: m, title: s, width: o, children: r });
|
|
43
43
|
};
|
|
44
|
-
A.displayName =
|
|
44
|
+
A.displayName = a.CELL;
|
|
45
45
|
const E = "_root_t4731_5", I = {
|
|
46
46
|
root: E
|
|
47
47
|
}, T = (t) => {
|
|
48
|
-
const { children: e } = t,
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
const { children: l, onClick: e, style: r } = t, s = (o) => i(a.CELL, o) ? o : null;
|
|
49
|
+
return /* @__PURE__ */ c("tr", { className: I.root, onClick: e, style: r, children: b.Children.map(l, s) });
|
|
50
50
|
};
|
|
51
|
-
T.displayName =
|
|
51
|
+
T.displayName = a.ROW;
|
|
52
52
|
const M = "Table.Toolbar", P = "_root_d4szt_6", W = {
|
|
53
53
|
root: P
|
|
54
54
|
}, f = (t) => {
|
|
55
|
-
const { children:
|
|
56
|
-
return /* @__PURE__ */
|
|
55
|
+
const { children: l } = t;
|
|
56
|
+
return /* @__PURE__ */ c("div", { className: W.root, children: l });
|
|
57
57
|
};
|
|
58
58
|
f.displayName = M;
|
|
59
59
|
const Y = "Table", j = "_wrapper_17sd8_5", z = "_root_17sd8_11", C = {
|
|
60
60
|
wrapper: j,
|
|
61
61
|
root: z
|
|
62
62
|
}, N = (t) => {
|
|
63
|
-
const { children:
|
|
64
|
-
(
|
|
65
|
-
),
|
|
63
|
+
const { children: l } = t, e = b.Children.toArray(l), r = e.find(
|
|
64
|
+
(o) => i(a.TOOLBAR, o, !1)
|
|
65
|
+
), s = e.filter((o) => !i(a.TOOLBAR, o, !1)).filter((o) => i(a.ROW, o, !0));
|
|
66
66
|
return /* @__PURE__ */ h("div", { className: C.wrapper, children: [
|
|
67
67
|
r,
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ c("table", { className: C.root, children: /* @__PURE__ */ c("tbody", { children: s }) })
|
|
69
69
|
] });
|
|
70
70
|
};
|
|
71
71
|
N.displayName = Y;
|
package/dist/text.d.ts
CHANGED
|
@@ -23,41 +23,41 @@ export declare enum ETextWeight {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export declare interface ITextProps extends default_2.PropsWithChildren {
|
|
26
|
-
/** HTML
|
|
26
|
+
/** HTML tag for rendering the root element. Defaults to `p`. */
|
|
27
27
|
as?: TTextTag;
|
|
28
|
-
/**
|
|
28
|
+
/** Text size. Defaults to `sm`. */
|
|
29
29
|
size?: TTextSize;
|
|
30
|
-
/**
|
|
30
|
+
/** Font weight. Defaults to `normal`. */
|
|
31
31
|
weight?: TTextWeight;
|
|
32
|
-
/**
|
|
32
|
+
/** Text color from the design system. If not provided — uses inherited color. */
|
|
33
33
|
color?: TTextColor;
|
|
34
|
-
/**
|
|
34
|
+
/** Truncate text with ellipsis (single line, `text-overflow: ellipsis`). */
|
|
35
35
|
truncate?: boolean;
|
|
36
|
-
/**
|
|
36
|
+
/** Underline: `true` for regular underline, `'dotted'` for dotted underline. */
|
|
37
37
|
underline?: boolean | 'dotted';
|
|
38
|
-
/**
|
|
38
|
+
/** Strikethrough text (`text-decoration: line-through`). */
|
|
39
39
|
strikethrough?: boolean;
|
|
40
|
-
/** Ref
|
|
40
|
+
/** Ref on the root element. */
|
|
41
41
|
ref?: default_2.Ref<HTMLElement>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Text —
|
|
45
|
+
* Text — component for displaying body text.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* Supports sizes from 12px (xs) to 16px (lg), various font weights,
|
|
48
|
+
* and colors from the design system. Suitable for paragraphs, labels, annotations.
|
|
49
49
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
50
|
+
* Unlike Heading, Text does not have built-in bold styling —
|
|
51
|
+
* weight is controlled by the `weight` prop.
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* ```tsx
|
|
55
|
-
* <Text size="lg" weight="medium"
|
|
55
|
+
* <Text size="lg" weight="medium">Body text</Text>
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
58
58
|
* @example
|
|
59
59
|
* ```tsx
|
|
60
|
-
* <Text size="xs" color="secondary" as="span"
|
|
60
|
+
* <Text size="xs" color="secondary" as="span">Annotation</Text>
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
declare const Text_2: default_2.ForwardRefExoticComponent<Omit<ITextProps, "ref"> & default_2.RefAttributes<HTMLElement>>;
|
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/dist/utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @param children -
|
|
6
|
-
* @param acceptableComponents -
|
|
7
|
-
* @returns
|
|
4
|
+
* Filters an array of React children, keeping only valid components
|
|
5
|
+
* @param children - React component children
|
|
6
|
+
* @param acceptableComponents - Array or object of acceptable sub-components
|
|
7
|
+
* @returns Array of filtered children
|
|
8
8
|
*/
|
|
9
9
|
export declare const filterValidChildren: (children: default_2.ReactNode, acceptableComponents: string | string[]) => default_2.ReactNode[];
|
|
10
10
|
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|