@lazar-ui/kit 0.6.2 → 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 +17 -0
- 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/utils.d.ts +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0] - 2026-07-06
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **Slider**: новый standalone компонент для выбора числового значения из диапазона. Поддерживает controlled/uncontrolled режимы, min/max/step, размеры (sm/md/lg), `showValue` и `disabled`. Использует нативный `<input type="range">` для accessibility.
|
|
8
|
+
- **Select**: добавлен JSX composition mode — теперь можно использовать `<Select.Option>` как дочерние элементы вместо пропа `options`. Поддерживаются те же возможности: value/label, disabled, controlled/uncontrolled.
|
|
9
|
+
- **Table.Row**: добавлен проп `onClick` — обработчик клика по строке таблицы.
|
|
10
|
+
- **Table.Row**: добавлен проп `style` для инлайн-стилей строки.
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **Tabs**: исправлен type error в тесте — использование `ETabsVariant.BUTTONS` вместо строкового литерала.
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
- **rules**: обновлён `.opencode/rules/ui-kit.md` (секция Build, память, тесты).
|
|
19
|
+
|
|
3
20
|
## [0.6.2] - 2026-06-10
|
|
4
21
|
|
|
5
22
|
### Bug Fixes
|
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/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