@companix/uikit 0.1.5 → 0.1.7
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/dist/Button/Button.scss +3 -1
- package/dist/Checkbox/Checkbox.scss +2 -2
- package/dist/OptionItem/Option.scss +2 -2
- package/dist/Popover/Popover.scss +2 -1
- package/dist/Radio/Radio.scss +2 -2
- package/dist/Radio/index.d.ts +1 -0
- package/dist/Segments/Segments.scss +2 -2
- package/dist/Select/Select.scss +4 -3
- package/dist/SelectTags/SelectTags.scss +2 -2
- package/dist/Tabs/Tabs.scss +2 -2
- package/dist/bundle.es21.js +19 -18
- package/dist/bundle.es62.js +20 -20
- package/package.json +1 -1
package/dist/Button/Button.scss
CHANGED
|
@@ -12,11 +12,13 @@
|
|
|
12
12
|
|
|
13
13
|
&:hover {
|
|
14
14
|
@include mixins.use-styles(button, $appearance, $mode, hovered);
|
|
15
|
+
z-index: 1;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
&[data-active],
|
|
18
19
|
&:active {
|
|
19
20
|
@include mixins.use-styles(button, $appearance, $mode, pressed);
|
|
21
|
+
z-index: 2;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
&[data-loading] {
|
|
@@ -28,7 +30,7 @@
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
&[disabled] {
|
|
31
|
-
@include mixins.use-styles(button, $appearance, $mode,
|
|
33
|
+
@include mixins.use-styles(button, $appearance, $mode, disable);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
&:not([data-disabled]):not([data-required]):hover {
|
|
12
12
|
.checkbox-box[data-state='unchecked'] {
|
|
13
|
-
@include mixins.use-styles(checkbox, box,
|
|
13
|
+
@include mixins.use-styles(checkbox, box, hovered);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&:not([data-disabled]):not([data-required]):active {
|
|
18
18
|
.checkbox-box[data-state='unchecked'] {
|
|
19
|
-
@include mixins.use-styles(checkbox, box,
|
|
19
|
+
@include mixins.use-styles(checkbox, box, pressed);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
cursor: pointer;
|
|
65
65
|
|
|
66
66
|
&:hover {
|
|
67
|
-
@include mixins.use-styles(option,
|
|
67
|
+
@include mixins.use-styles(option, hovered);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&:active {
|
|
71
|
-
@include mixins.use-styles(option,
|
|
71
|
+
@include mixins.use-styles(option, pressed);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
package/dist/Radio/Radio.scss
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
&:not([data-required]):not([data-disabled]):hover {
|
|
17
17
|
.radio-box[data-state='unchecked'] {
|
|
18
|
-
@include mixins.use-styles(radio, box,
|
|
18
|
+
@include mixins.use-styles(radio, box, hovered);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
&:not([data-required]):not([data-disabled]):active {
|
|
23
23
|
.radio-box[data-state='unchecked'] {
|
|
24
|
-
@include mixins.use-styles(radio, box,
|
|
24
|
+
@include mixins.use-styles(radio, box, pressed);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
package/dist/Radio/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface RadioGroupProps<T> {
|
|
|
8
8
|
value: T | null;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
required?: boolean;
|
|
11
|
+
className?: string;
|
|
11
12
|
size?: 'sm' | 'md';
|
|
12
13
|
}
|
|
13
14
|
export declare const RadioGroup: <T extends string>(props: RadioGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
|
|
43
43
|
&:not([data-selected]) {
|
|
44
44
|
&:hover {
|
|
45
|
-
@include mixins.use-styles(segment-control, option,
|
|
45
|
+
@include mixins.use-styles(segment-control, option, hovered);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&:active {
|
|
49
|
-
@include mixins.use-styles(segment-control, option,
|
|
49
|
+
@include mixins.use-styles(segment-control, option, pressed);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
package/dist/Select/Select.scss
CHANGED
|
@@ -73,10 +73,11 @@
|
|
|
73
73
|
padding: 0px var(--form_space, 0);
|
|
74
74
|
height: 100%;
|
|
75
75
|
outline: none;
|
|
76
|
-
|
|
76
|
+
|
|
77
|
+
@include mixins.use-styles(select, tools);
|
|
77
78
|
|
|
78
79
|
&:hover {
|
|
79
|
-
|
|
80
|
+
@include mixins.use-styles(select, tools, hovered);
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
|
|
94
95
|
.expand-icon {
|
|
95
96
|
transition: transform 0.2s;
|
|
96
|
-
@include mixins.use-styles(select,
|
|
97
|
+
@include mixins.use-styles(select, tools);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
.form {
|
package/dist/Tabs/Tabs.scss
CHANGED
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&:not([data-disabled]):not([data-state='active']):hover {
|
|
52
|
-
@include mixins.use-styles(tab,
|
|
52
|
+
@include mixins.use-styles(tab, hovered);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
&[data-state='active'] {
|
|
56
|
-
@include mixins.use-styles(tab,
|
|
56
|
+
@include mixins.use-styles(tab, pressed);
|
|
57
57
|
}
|
|
58
58
|
}
|
package/dist/bundle.es21.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import h from "classnames";
|
|
3
|
+
import { useId as N } from "react";
|
|
3
4
|
import * as l from "@radix-ui/react-radio-group";
|
|
4
5
|
import { attr as s } from "@companix/utils-browser";
|
|
5
|
-
const
|
|
6
|
-
const { options: m, value: a, onChange: r, disabled:
|
|
6
|
+
const R = (t) => {
|
|
7
|
+
const { options: m, value: a, onChange: r, disabled: i, required: e, size: n, className: c } = t;
|
|
7
8
|
return /* @__PURE__ */ o(
|
|
8
9
|
l.Root,
|
|
9
10
|
{
|
|
10
|
-
className: "radio-group",
|
|
11
|
-
disabled:
|
|
11
|
+
className: h("radio-group", c),
|
|
12
|
+
disabled: i,
|
|
12
13
|
"data-required": s(e && !a),
|
|
13
14
|
"data-v": a,
|
|
14
15
|
value: a,
|
|
15
|
-
onValueChange: (
|
|
16
|
-
children: m.map((
|
|
17
|
-
|
|
16
|
+
onValueChange: (d) => r(d),
|
|
17
|
+
children: m.map((d, u) => /* @__PURE__ */ o(
|
|
18
|
+
f,
|
|
18
19
|
{
|
|
19
|
-
...
|
|
20
|
+
...d,
|
|
20
21
|
size: n,
|
|
21
|
-
disabled:
|
|
22
|
+
disabled: i,
|
|
22
23
|
required: e && !a
|
|
23
24
|
},
|
|
24
|
-
`radio-${
|
|
25
|
+
`radio-${d.value}-${u}`
|
|
25
26
|
))
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
|
-
},
|
|
29
|
-
const e =
|
|
30
|
-
return /* @__PURE__ */
|
|
29
|
+
}, f = ({ value: t, label: m, size: a = "md", disabled: r, required: i }) => {
|
|
30
|
+
const e = N();
|
|
31
|
+
return /* @__PURE__ */ p(
|
|
31
32
|
"span",
|
|
32
33
|
{
|
|
33
34
|
className: "radio",
|
|
34
35
|
"data-disabled": s(r),
|
|
35
36
|
"data-size": a,
|
|
36
|
-
"data-required": s(
|
|
37
|
+
"data-required": s(i),
|
|
37
38
|
children: [
|
|
38
39
|
/* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
|
|
39
40
|
/* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
|
|
@@ -42,6 +43,6 @@ const q = (t) => {
|
|
|
42
43
|
);
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
f as Radio,
|
|
47
|
+
R as RadioGroup
|
|
47
48
|
};
|
package/dist/bundle.es62.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as i, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as y, useEffect as C } from "react";
|
|
3
3
|
import { Spinner as P } from "./bundle.es7.js";
|
|
4
4
|
import { OptionItem as L } from "./bundle.es16.js";
|
|
5
5
|
import { OptionsList as T } from "./bundle.es18.js";
|
|
6
6
|
import { Icon as R } from "./bundle.es35.js";
|
|
7
7
|
import { faPlus as S } from "@companix/icons-solid";
|
|
8
|
-
const b = () => ({ isLoading: !1, options: [] }), I = (
|
|
9
|
-
const { onOptionsLoaded:
|
|
8
|
+
const b = () => ({ isLoading: !1, options: [] }), I = (e) => {
|
|
9
|
+
const { onOptionsLoaded: n, useOptions: s = b, options: o } = e, t = s();
|
|
10
10
|
return C(() => {
|
|
11
|
-
t.options.length > 0 &&
|
|
11
|
+
t.options.length > 0 && n?.(t.options);
|
|
12
12
|
}, [t.options]), o ? { options: o, isLoading: !1 } : t;
|
|
13
|
-
}, H = (
|
|
13
|
+
}, H = (e) => {
|
|
14
14
|
const {
|
|
15
|
-
isActive:
|
|
15
|
+
isActive: n,
|
|
16
16
|
emptyText: s,
|
|
17
17
|
isLoading: o,
|
|
18
18
|
scrollboxRef: t,
|
|
@@ -24,13 +24,13 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
24
24
|
filterOptions: r,
|
|
25
25
|
disableFiltering: l,
|
|
26
26
|
close: c,
|
|
27
|
-
...
|
|
28
|
-
} =
|
|
27
|
+
...m
|
|
28
|
+
} = e, { emptyText: x, options: a, isLoading: g } = I(m), v = y(() => r && !l ? a.filter(r) : a, [a, r, l]);
|
|
29
29
|
return g ?? o ? /* @__PURE__ */ i("div", { className: "select-popover-loading", children: /* @__PURE__ */ i(P, { size: 24 }) }) : /* @__PURE__ */ i(
|
|
30
30
|
N,
|
|
31
31
|
{
|
|
32
32
|
options: v,
|
|
33
|
-
isActive:
|
|
33
|
+
isActive: n,
|
|
34
34
|
emptyText: x ?? s,
|
|
35
35
|
scrollboxRef: t,
|
|
36
36
|
optionsWrapperRef: d,
|
|
@@ -41,9 +41,9 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
41
41
|
close: c
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
}, N = (
|
|
44
|
+
}, N = (e) => {
|
|
45
45
|
const {
|
|
46
|
-
isActive:
|
|
46
|
+
isActive: n,
|
|
47
47
|
onOpened: s,
|
|
48
48
|
addOption: o,
|
|
49
49
|
scrollboxRef: t,
|
|
@@ -53,9 +53,9 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
53
53
|
minimalOptions: O,
|
|
54
54
|
emptyText: u = "Ничего не найдено",
|
|
55
55
|
close: r
|
|
56
|
-
} =
|
|
56
|
+
} = e;
|
|
57
57
|
C(() => {
|
|
58
|
-
s?.(p.findIndex(({ value: c }) =>
|
|
58
|
+
s?.(p.findIndex(({ value: c }) => n(c)));
|
|
59
59
|
}, []);
|
|
60
60
|
const l = o ? /* @__PURE__ */ i(
|
|
61
61
|
L,
|
|
@@ -69,20 +69,20 @@ const b = () => ({ isLoading: !1, options: [] }), I = (n) => {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
) : void 0;
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ k(T, { scrollboxRef: t, optionsWrapperRef: d, maxHeight: 300, children: [
|
|
73
73
|
(o?.position === void 0 || o?.position === "first") && l,
|
|
74
|
-
p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-
|
|
75
|
-
p.map(({ title: c, value:
|
|
74
|
+
p.length === 0 && !o && /* @__PURE__ */ i("div", { className: "select-tags-noneresults", children: u }),
|
|
75
|
+
p.map(({ title: c, value: m, className: x, icon: a, disabled: g, label: v }, h) => /* @__PURE__ */ i(
|
|
76
76
|
L,
|
|
77
77
|
{
|
|
78
|
-
active:
|
|
79
|
-
onClick: () => f?.(
|
|
78
|
+
active: n(m),
|
|
79
|
+
onClick: () => f?.(m),
|
|
80
80
|
minimal: O,
|
|
81
81
|
disabled: g,
|
|
82
82
|
className: x,
|
|
83
83
|
title: c,
|
|
84
84
|
label: v,
|
|
85
|
-
icon:
|
|
85
|
+
icon: a
|
|
86
86
|
},
|
|
87
87
|
`select-option-${h}`
|
|
88
88
|
)),
|