@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.
@@ -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, disabled);
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, hover);
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, active);
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, hover);
67
+ @include mixins.use-styles(option, hovered);
68
68
  }
69
69
 
70
70
  &:active {
71
- @include mixins.use-styles(option, active);
71
+ @include mixins.use-styles(option, pressed);
72
72
  }
73
73
  }
74
74
 
@@ -49,8 +49,9 @@
49
49
  height: 20px;
50
50
  margin: 5px;
51
51
  width: 20px;
52
- box-shadow: 1px 1px 6px rgba(17, 20, 24, 0.2);
53
52
  margin-top: -14px;
53
+
54
+ @include mixins.use-styles(popover, arrow);
54
55
  }
55
56
  }
56
57
 
@@ -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, hover);
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, active);
24
+ @include mixins.use-styles(radio, box, pressed);
25
25
  }
26
26
  }
27
27
 
@@ -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, hover);
45
+ @include mixins.use-styles(segment-control, option, hovered);
46
46
  }
47
47
 
48
48
  &:active {
49
- @include mixins.use-styles(segment-control, option, active);
49
+ @include mixins.use-styles(segment-control, option, pressed);
50
50
  }
51
51
  }
52
52
 
@@ -73,10 +73,11 @@
73
73
  padding: 0px var(--form_space, 0);
74
74
  height: 100%;
75
75
  outline: none;
76
- color: var(--select_clean_color);
76
+
77
+ @include mixins.use-styles(select, tools);
77
78
 
78
79
  &:hover {
79
- color: var(--select_clean_hover_color);
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, expand);
97
+ @include mixins.use-styles(select, tools);
97
98
  }
98
99
 
99
100
  .form {
@@ -9,8 +9,8 @@
9
9
  padding-left: var(--form_space, 0);
10
10
  }
11
11
 
12
- &-empty {
13
- @include mixins.use-styles(tag, empty);
12
+ &-noneresults {
13
+ @include mixins.use-styles(tag, noneresults);
14
14
  }
15
15
 
16
16
  &-container {
@@ -49,10 +49,10 @@
49
49
  }
50
50
 
51
51
  &:not([data-disabled]):not([data-state='active']):hover {
52
- @include mixins.use-styles(tab, hover);
52
+ @include mixins.use-styles(tab, hovered);
53
53
  }
54
54
 
55
55
  &[data-state='active'] {
56
- @include mixins.use-styles(tab, active);
56
+ @include mixins.use-styles(tab, pressed);
57
57
  }
58
58
  }
@@ -1,39 +1,40 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import { useId as p } from "react";
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 q = (t) => {
6
- const { options: m, value: a, onChange: r, disabled: d, required: e, size: n } = t;
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: d,
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: (i) => r(i),
16
- children: m.map((i, c) => /* @__PURE__ */ o(
17
- h,
16
+ onValueChange: (d) => r(d),
17
+ children: m.map((d, u) => /* @__PURE__ */ o(
18
+ f,
18
19
  {
19
- ...i,
20
+ ...d,
20
21
  size: n,
21
- disabled: d,
22
+ disabled: i,
22
23
  required: e && !a
23
24
  },
24
- `radio-${i.value}-${c}`
25
+ `radio-${d.value}-${u}`
25
26
  ))
26
27
  }
27
28
  );
28
- }, h = ({ value: t, label: m, size: a = "md", disabled: r, required: d }) => {
29
- const e = p();
30
- return /* @__PURE__ */ u(
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(d),
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
- h as Radio,
46
- q as RadioGroup
46
+ f as Radio,
47
+ R as RadioGroup
47
48
  };
@@ -1,18 +1,18 @@
1
- import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
- import { useMemo as k, useEffect as C } from "react";
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 = (n) => {
9
- const { onOptionsLoaded: e, useOptions: s = b, options: o } = n, t = s();
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 && e?.(t.options);
11
+ t.options.length > 0 && n?.(t.options);
12
12
  }, [t.options]), o ? { options: o, isLoading: !1 } : t;
13
- }, H = (n) => {
13
+ }, H = (e) => {
14
14
  const {
15
- isActive: e,
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
- ...a
28
- } = n, { emptyText: x, options: m, isLoading: g } = I(a), v = k(() => r && !l ? m.filter(r) : m, [m, r, l]);
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: e,
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 = (n) => {
44
+ }, N = (e) => {
45
45
  const {
46
- isActive: e,
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
- } = n;
56
+ } = e;
57
57
  C(() => {
58
- s?.(p.findIndex(({ value: c }) => e(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__ */ y(T, { scrollboxRef: t, optionsWrapperRef: d, maxHeight: 300, children: [
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-empty", children: u }),
75
- p.map(({ title: c, value: a, className: x, icon: m, disabled: g, label: v }, h) => /* @__PURE__ */ i(
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: e(a),
79
- onClick: () => f?.(a),
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: m
85
+ icon: a
86
86
  },
87
87
  `select-option-${h}`
88
88
  )),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.1.05",
3
+ "version": "0.1.07",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",