@lazar-ui/kit 0.6.1 → 0.7.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 +32 -0
- package/dist/accordion.css +1 -1
- package/dist/accordion.js +62 -23
- package/dist/dialog.css +1 -1
- package/dist/dialog.js +62 -44
- package/dist/drawer.css +1 -1
- package/dist/drawer.js +93 -72
- package/dist/heading.js +31 -5
- package/dist/input.js +124 -86
- package/dist/menu.css +1 -1
- package/dist/menu.js +81 -63
- package/dist/select.d.ts +45 -3
- package/dist/select.js +103 -81
- package/dist/separator.css +1 -0
- package/dist/separator.d.ts +21 -1
- package/dist/separator.js +22 -2
- package/dist/slider.css +1 -0
- package/dist/slider.d.ts +50 -0
- package/dist/slider.js +72 -0
- package/dist/table.css +1 -1
- package/dist/table.d.ts +4 -0
- package/dist/table.js +74 -25
- package/dist/tabs.css +1 -1
- package/dist/tabs.js +73 -34
- package/dist/text.d.ts +15 -15
- package/dist/text.js +48 -6
- package/dist/utils.d.ts +4 -4
- package/package.json +1 -1
- package/dist/Actions-Cii4AnwJ.mjs +0 -12
- package/dist/Actions.css +0 -1
- package/dist/ActiveFilters-BJojmc-d.mjs +0 -29
- package/dist/ActiveFilters.css +0 -1
- package/dist/Cell-BPBvEyeL.mjs +0 -21
- package/dist/Cell.css +0 -1
- package/dist/Content-1kg0isb_.mjs +0 -12
- package/dist/Content.css +0 -1
- package/dist/Context-BjkJbHVo.mjs +0 -6
- package/dist/Group-DyDpeqOP.mjs +0 -16
- package/dist/Group.css +0 -1
- package/dist/Header-Clhgyr0J.mjs +0 -29
- package/dist/Header.css +0 -1
- package/dist/Heading-CL47Fqe7.mjs +0 -30
- package/dist/InputBase-BHZWQT9-.mjs +0 -46
- package/dist/Item-CBYGbEHN.mjs +0 -47
- package/dist/Item.css +0 -1
- package/dist/Panel-B-LZtrGB.mjs +0 -11
- package/dist/Row-BfI8268z.mjs +0 -15
- package/dist/Row.css +0 -1
- package/dist/Separator-FETQ3gHZ.mjs +0 -9
- package/dist/Separator.css +0 -1
- package/dist/Tab-BfpR10OT.mjs +0 -38
- package/dist/Tab.css +0 -1
- package/dist/Text-DQPy-DZ5.mjs +0 -46
- package/dist/Title-xHMuJWGl.mjs +0 -12
- package/dist/Title.css +0 -1
- package/dist/Toolbar-BJQy4qFI.mjs +0 -11
- package/dist/Toolbar.css +0 -1
- package/dist/Trigger-C_4De6l1.mjs +0 -11
- package/dist/actions.d.ts +0 -13
- package/dist/actions.js +0 -4
- package/dist/active-filters.d.ts +0 -35
- package/dist/active-filters.js +0 -4
- package/dist/cell.d.ts +0 -20
- package/dist/cell.js +0 -4
- package/dist/content.d.ts +0 -8
- package/dist/content.js +0 -4
- package/dist/context.d.ts +0 -17
- package/dist/context.js +0 -5
- package/dist/enums-BnuDYTua.mjs +0 -4
- package/dist/enums-DUZMBQDd.mjs +0 -7
- package/dist/enums-DfSzOa3x.mjs +0 -4
- package/dist/enums-OoI2Qgqq.mjs +0 -14
- package/dist/group.d.ts +0 -12
- package/dist/group.js +0 -4
- package/dist/header.d.ts +0 -21
- package/dist/header.js +0 -4
- package/dist/input-base.d.ts +0 -29
- package/dist/input-base.js +0 -4
- package/dist/item.d.ts +0 -42
- package/dist/item.js +0 -4
- package/dist/panel.d.ts +0 -9
- package/dist/panel.js +0 -4
- package/dist/row.d.ts +0 -12
- package/dist/row.js +0 -4
- package/dist/tab.d.ts +0 -30
- package/dist/tab.js +0 -4
- package/dist/title.d.ts +0 -8
- package/dist/title.js +0 -4
- package/dist/toolbar.d.ts +0 -20
- package/dist/toolbar.js +0 -4
- package/dist/trigger.d.ts +0 -8
- package/dist/trigger.js +0 -4
- package/dist/typography.d.ts +0 -126
- package/dist/typography.js +0 -6
- /package/dist/{Heading.css → heading.css} +0 -0
- /package/dist/{InputBase.css → input.css} +0 -0
- /package/dist/{Text.css → text.css} +0 -0
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
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--separator-color: var(--lui-color-border-primary)}._root_kvseh_5{background:var(--separator-color);border:none;height:1px;margin:0;padding-inline:var(--lui-space-4);width:100%}._vertical_kvseh_14{height:100%;padding-block:var(--lui-space-4);padding-inline:0;width:1px}._bleed_kvseh_21{padding:0}
|
package/dist/separator.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
declare interface IProps {
|
|
4
|
+
/** Vertical orientation. Default: `false`. */
|
|
5
|
+
vertical?: boolean;
|
|
6
|
+
/** CSS colour of the line. Default: `var(--lui-color-border-primary)`. */
|
|
7
|
+
color?: string;
|
|
8
|
+
/** Removes padding around the line. Default: `false`. */
|
|
9
|
+
bleed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Separator component. Renders a horizontal or vertical dividing line.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Separator />
|
|
18
|
+
* <Separator vertical />
|
|
19
|
+
* <Separator bleed />
|
|
20
|
+
* <Separator vertical bleed color="var(--lui-color-text-success)" />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const Separator: default_2.FC<IProps>;
|
|
4
24
|
|
|
5
25
|
export { }
|
package/dist/separator.js
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import c from "clsx";
|
|
3
|
+
import './separator.css';const i = "Separator", _ = "_root_kvseh_5", n = "_vertical_kvseh_14", v = "_bleed_kvseh_21", o = {
|
|
4
|
+
root: _,
|
|
5
|
+
vertical: n,
|
|
6
|
+
bleed: v
|
|
7
|
+
}, m = (r) => {
|
|
8
|
+
const { vertical: e = !1, color: t, bleed: s = !1 } = r, l = c(
|
|
9
|
+
o.root,
|
|
10
|
+
e && o.vertical,
|
|
11
|
+
s && o.bleed
|
|
12
|
+
);
|
|
13
|
+
return /* @__PURE__ */ a(
|
|
14
|
+
"hr",
|
|
15
|
+
{
|
|
16
|
+
className: l,
|
|
17
|
+
style: { "--separator-color": t ?? "var(--lui-color-border-primary)" }
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
m.displayName = i;
|
|
2
22
|
export {
|
|
3
|
-
|
|
23
|
+
m as Separator
|
|
4
24
|
};
|
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.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--table-font-size: var(--lui-font-size-md)}._wrapper_17sd8_5{display:flex;flex-direction:column;gap:var(--lui-space-4)}._root_17sd8_11{border-collapse:collapse;font-size:var(--table-font-size);table-layout:fixed;width:100%}
|
|
1
|
+
:root{--active-filters-gap: var(--lui-space-2)}._root_4qb7d_5{align-items:center;display:flex;flex-wrap:wrap;gap:var(--active-filters-gap)}:root{--cell-bg-header: var(--lui-color-background-tertiary);--cell-border-header: var(--lui-color-border-secondary);--cell-padding: var(--lui-space-3) var(--lui-space-4);--cell-max-width: 200px}._root_lmxwt_8{background-color:transparent;border-bottom:1px solid var(--lui-color-border-primary);max-width:var(--cell-max-width);overflow:hidden;padding:var(--cell-padding);text-overflow:ellipsis;white-space:nowrap}._root_lmxwt_8._header_lmxwt_17{background-color:var(--cell-bg-header);border-bottom:2px solid var(--cell-border-header)}._root_lmxwt_8._alignLeft_lmxwt_21{text-align:left}._root_lmxwt_8._alignRight_lmxwt_24{text-align:right}._root_lmxwt_8._alignCenter_lmxwt_27{text-align:center}:root{--table-bg-stripe: var(--lui-color-background-secondary)}._root_t4731_5{background-color:var(--lui-color-background-primary);border-bottom:1px solid var(--lui-color-border-primary);transition:background-color .2s}._root_t4731_5:nth-child(odd){background-color:var(--table-bg-stripe)}._root_t4731_5:hover{background-color:var(--lui-color-background-brand-secondary)}:root{--toolbar-gap: var(--lui-space-3);--toolbar-padding: var(--lui-space-3) 0}._root_d4szt_6{align-items:center;display:flex;gap:var(--toolbar-gap);padding:var(--toolbar-padding)}:root{--table-font-size: var(--lui-font-size-md)}._wrapper_17sd8_5{display:flex;flex-direction:column;gap:var(--lui-space-4)}._root_17sd8_11{border-collapse:collapse;font-size:var(--table-font-size);table-layout:fixed;width:100%}
|
package/dist/table.d.ts
CHANGED
|
@@ -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,30 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import R from "
|
|
7
|
-
import {
|
|
1
|
+
import { jsxs as h, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import b, { useCallback as p } from "react";
|
|
3
|
+
import { B as u } from "./Button-BN85EtaZ.mjs";
|
|
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
|
+
import { g as w } from "./getVariantClassName-DoCNtwBw.mjs";
|
|
8
|
+
import { i } from "./isValidReactNode-CmYwTWCE.mjs";
|
|
8
9
|
import "lodash/camelCase";
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
import './table.css';const v = "Table.ActiveFilters", x = "_root_4qb7d_5", $ = {
|
|
11
|
+
root: x
|
|
12
|
+
}, g = (t) => {
|
|
13
|
+
const { filters: l, onClearAll: e, onRemove: r } = t, s = L(), o = p(
|
|
14
|
+
(n) => () => {
|
|
15
|
+
r(n);
|
|
16
|
+
},
|
|
17
|
+
[r]
|
|
18
|
+
), m = p(() => {
|
|
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
|
+
": ",
|
|
25
|
+
n.value
|
|
26
|
+
] }, n.key)),
|
|
27
|
+
e && /* @__PURE__ */ c(u, { mode: "text", size: "sm", onClick: m, children: s.Table.ActiveFilters.clearAll })
|
|
20
28
|
] });
|
|
21
29
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
g.displayName = v;
|
|
31
|
+
var a = /* @__PURE__ */ ((t) => (t.CELL = "Table.Cell", t.ROW = "Table.Row", t.TOOLBAR = "Table.Toolbar", t))(a || {});
|
|
32
|
+
const O = "_root_lmxwt_8", k = "_header_lmxwt_17", B = "_alignLeft_lmxwt_21", F = "_alignRight_lmxwt_24", D = "_alignCenter_lmxwt_27", _ = {
|
|
33
|
+
root: O,
|
|
34
|
+
header: k,
|
|
35
|
+
alignLeft: B,
|
|
36
|
+
alignRight: F,
|
|
37
|
+
alignCenter: D
|
|
38
|
+
}, A = (t) => {
|
|
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
|
+
});
|
|
42
|
+
return /* @__PURE__ */ c(e, { className: m, title: s, width: o, children: r });
|
|
43
|
+
};
|
|
44
|
+
A.displayName = a.CELL;
|
|
45
|
+
const E = "_root_t4731_5", I = {
|
|
46
|
+
root: E
|
|
47
|
+
}, T = (t) => {
|
|
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
|
+
};
|
|
51
|
+
T.displayName = a.ROW;
|
|
52
|
+
const M = "Table.Toolbar", P = "_root_d4szt_6", W = {
|
|
53
|
+
root: P
|
|
54
|
+
}, f = (t) => {
|
|
55
|
+
const { children: l } = t;
|
|
56
|
+
return /* @__PURE__ */ c("div", { className: W.root, children: l });
|
|
57
|
+
};
|
|
58
|
+
f.displayName = M;
|
|
59
|
+
const Y = "Table", j = "_wrapper_17sd8_5", z = "_root_17sd8_11", C = {
|
|
60
|
+
wrapper: j,
|
|
61
|
+
root: z
|
|
62
|
+
}, N = (t) => {
|
|
63
|
+
const { children: 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
|
+
return /* @__PURE__ */ h("div", { className: C.wrapper, children: [
|
|
67
|
+
r,
|
|
68
|
+
/* @__PURE__ */ c("table", { className: C.root, children: /* @__PURE__ */ c("tbody", { children: s }) })
|
|
69
|
+
] });
|
|
70
|
+
};
|
|
71
|
+
N.displayName = Y;
|
|
72
|
+
const d = N;
|
|
73
|
+
d.ActiveFilters = g;
|
|
74
|
+
d.Cell = A;
|
|
75
|
+
d.Row = T;
|
|
76
|
+
d.Toolbar = f;
|
|
28
77
|
export {
|
|
29
|
-
|
|
78
|
+
d as Table
|
|
30
79
|
};
|
package/dist/tabs.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--tabs-padding: var(--lui-space-8);--tabs-panel-padding-top: var(--lui-space-10);--tab-text: var(--lui-color-text-secondary);--tab-text-active: var(--lui-color-text-primary);--tab-text-disabled: var(--lui-color-text-disabled);--tab-border-active: var(--lui-palette-gray-900);--tab-bg-buttons: var(--lui-color-background-tertiary);--tab-bg-buttons-active: var(--lui-color-background-brand-secondary);--tab-text-buttons: var(--lui-color-text-quaternary);--tab-text-buttons-active: var(--lui-color-text-primary);--tab-radius-buttons: var(--lui-radius-1);--tab-font-buttons: var(--lui-font-size-md);--tab-gap-buttons: var(--lui-space-3);--tab-padding-y-buttons: var(--lui-space-2);--tab-padding-x-buttons: var(--lui-space-3);--tab-list-gap: var(--lui-space-4)}._root_ndfzg_20{width:auto}._root_ndfzg_20._variantDefault_ndfzg_23 ._list_ndfzg_23:before{border-bottom:1px solid var(--lui-color-border-primary);bottom:0;content:"";left:0;position:absolute;right:0;z-index:0}._root_ndfzg_20._variantButtons_ndfzg_32 ._list_ndfzg_23{align-items:center;gap:var(--tab-list-gap);justify-content:flex-start;padding:var(--tabs-padding)}._list_ndfzg_23{display:flex;overflow-x:auto;position:relative}._panel_ndfzg_45{padding-top:var(--tabs-panel-padding-top);position:relative}@media only screen and (max-width:1023px){._root_ndfzg_20._variantButtons_ndfzg_32{justify-content:start}}
|
|
1
|
+
._root_11zii_1{position:relative;-webkit-user-select:none;user-select:none}._root_11zii_1._disabled_11zii_5{color:var(--tab-text-disabled);cursor:not-allowed}._root_11zii_1._variantDefault_11zii_9{border-bottom:2px solid transparent;color:var(--tab-text);font-size:var(--lui-font-size-md);font-weight:var(--lui-font-weight-medium);line-height:var(--line-height-md);padding:var(--lui-space-3) var(--lui-space-5);transition:border-color .3s,color .3s;white-space:nowrap}._root_11zii_1._variantDefault_11zii_9:focus{border-color:var(--tab-text-active)}._root_11zii_1._variantDefault_11zii_9._active_11zii_22{border-color:var(--tab-border-active);color:var(--tab-text-active)}._root_11zii_1._variantButtons_11zii_26{align-items:center;background:var(--tab-bg-buttons);border-radius:var(--tab-radius-buttons);color:var(--tab-text-buttons);display:flex;flex:1;flex-direction:column;font-size:var(--tab-font-buttons);font-weight:var(--lui-font-weight-medium);gap:var(--tab-gap-buttons);height:64px;justify-content:center;line-height:var(--line-height-md);max-width:320px;padding:var(--tab-padding-y-buttons) var(--tab-padding-x-buttons)}._root_11zii_1._variantButtons_11zii_26:focus{box-shadow:0 0 0 2px #98a2b324}._root_11zii_1._variantButtons_11zii_26._active_11zii_22{background:var(--tab-bg-buttons-active);color:var(--tab-text-buttons-active)}@media only screen and (max-width:1023px){._root_11zii_1._variantButtons_11zii_26{gap:var(--tab-gap-buttons);height:40px;justify-content:center;padding:var(--lui-space-2) var(--lui-space-5);white-space:nowrap}}:root{--tabs-padding: var(--lui-space-8);--tabs-panel-padding-top: var(--lui-space-10);--tab-text: var(--lui-color-text-secondary);--tab-text-active: var(--lui-color-text-primary);--tab-text-disabled: var(--lui-color-text-disabled);--tab-border-active: var(--lui-palette-gray-900);--tab-bg-buttons: var(--lui-color-background-tertiary);--tab-bg-buttons-active: var(--lui-color-background-brand-secondary);--tab-text-buttons: var(--lui-color-text-quaternary);--tab-text-buttons-active: var(--lui-color-text-primary);--tab-radius-buttons: var(--lui-radius-1);--tab-font-buttons: var(--lui-font-size-md);--tab-gap-buttons: var(--lui-space-3);--tab-padding-y-buttons: var(--lui-space-2);--tab-padding-x-buttons: var(--lui-space-3);--tab-list-gap: var(--lui-space-4)}._root_ndfzg_20{width:auto}._root_ndfzg_20._variantDefault_ndfzg_23 ._list_ndfzg_23:before{border-bottom:1px solid var(--lui-color-border-primary);bottom:0;content:"";left:0;position:absolute;right:0;z-index:0}._root_ndfzg_20._variantButtons_ndfzg_32 ._list_ndfzg_23{align-items:center;gap:var(--tab-list-gap);justify-content:flex-start;padding:var(--tabs-padding)}._list_ndfzg_23{display:flex;overflow-x:auto;position:relative}._panel_ndfzg_45{padding-top:var(--tabs-panel-padding-top);position:relative}@media only screen and (max-width:1023px){._root_ndfzg_20._variantButtons_ndfzg_32{justify-content:start}}
|