@companix/uikit 0.0.11 → 0.0.14

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.
Files changed (42) hide show
  1. package/dist/DatePicker/index.d.ts +0 -1
  2. package/dist/Input/index.d.ts +1 -1
  3. package/dist/Select/SelectInput.d.ts +1 -0
  4. package/dist/Select/index.d.ts +2 -5
  5. package/dist/SelectTags/index.d.ts +1 -0
  6. package/dist/TextArea/index.d.ts +2 -1
  7. package/dist/__hooks/use-loading.d.ts +2 -2
  8. package/dist/bundle.es.js +12 -10
  9. package/dist/bundle.es10.js +1 -1
  10. package/dist/bundle.es14.js +1 -1
  11. package/dist/bundle.es19.js +1 -1
  12. package/dist/bundle.es20.js +1 -1
  13. package/dist/bundle.es23.js +17 -15
  14. package/dist/bundle.es24.js +38 -36
  15. package/dist/bundle.es25.js +3 -3
  16. package/dist/bundle.es27.js +11 -10
  17. package/dist/bundle.es28.js +10 -24
  18. package/dist/bundle.es29.js +17 -28
  19. package/dist/bundle.es30.js +32 -20
  20. package/dist/bundle.es31.js +24 -81
  21. package/dist/bundle.es32.js +83 -18
  22. package/dist/bundle.es33.js +17 -13
  23. package/dist/bundle.es34.js +14 -22
  24. package/dist/bundle.es35.js +22 -5
  25. package/dist/bundle.es36.js +5 -21
  26. package/dist/bundle.es37.js +13 -13
  27. package/dist/bundle.es38.js +13 -69
  28. package/dist/bundle.es39.js +68 -66
  29. package/dist/bundle.es40.js +67 -31
  30. package/dist/bundle.es41.js +23 -59
  31. package/dist/bundle.es42.js +67 -30
  32. package/dist/bundle.es43.js +30 -74
  33. package/dist/bundle.es44.js +71 -45
  34. package/dist/bundle.es45.js +47 -41
  35. package/dist/bundle.es46.js +45 -0
  36. package/dist/bundle.es8.js +50 -54
  37. package/dist/bundle.es9.js +1 -1
  38. package/dist/index.d.ts +1 -0
  39. package/dist/index.scss +1 -1
  40. package/package.json +1 -1
  41. /package/dist/{FormLabel/FormLabel.scss → FormGroup/FormGroup.scss} +0 -0
  42. /package/dist/{FormLabel → FormGroup}/index.d.ts +0 -0
@@ -0,0 +1,45 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-toast";
3
+ import { attr as C } from "@companix/utils-browser";
4
+ import { useState as h, useRef as v, useEffect as N, useLayoutEffect as x } from "react";
5
+ import { RemoveListener as R } from "./bundle.es36.js";
6
+ const E = (i) => {
7
+ const [c, l] = h(!1), o = v(null), {
8
+ appearance: d = "neutral",
9
+ icon: r,
10
+ title: a,
11
+ description: s,
12
+ duration: m,
13
+ closeIcon: u,
14
+ onRemoving: p,
15
+ onRemoved: f,
16
+ onInitialized: L
17
+ } = i;
18
+ return N(() => {
19
+ l(!0);
20
+ }, []), x(() => {
21
+ o.current && L(o.current);
22
+ }, []), /* @__PURE__ */ n(
23
+ t.Root,
24
+ {
25
+ ref: o,
26
+ "data-expanded": !0,
27
+ "data-appearance": d,
28
+ "data-mounted": C(c),
29
+ className: "toaster",
30
+ duration: m,
31
+ children: [
32
+ /* @__PURE__ */ e(R, { callback: f }),
33
+ r && /* @__PURE__ */ e("div", { className: "toaster-icon", children: r }),
34
+ /* @__PURE__ */ n("div", { className: "toaster-content", children: [
35
+ a && /* @__PURE__ */ e(t.Title, { className: "toaster-title", children: a }),
36
+ s && /* @__PURE__ */ e(t.Description, { className: "toaster-description", children: s })
37
+ ] }),
38
+ /* @__PURE__ */ e(t.Close, { className: "toaster-close", onClick: p, children: u ?? /* @__PURE__ */ e("svg", { viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M2.96967 2.96967C3.26256 2.67678 3.73744 2.67678 4.03033 2.96967L8 6.939L11.9697 2.96967C12.2626 2.67678 12.7374 2.67678 13.0303 2.96967C13.3232 3.26256 13.3232 3.73744 13.0303 4.03033L9.061 8L13.0303 11.9697C13.2966 12.2359 13.3208 12.6526 13.1029 12.9462L13.0303 13.0303C12.7374 13.3232 12.2626 13.3232 11.9697 13.0303L8 9.061L4.03033 13.0303C3.73744 13.3232 3.26256 13.3232 2.96967 13.0303C2.67678 12.7374 2.67678 12.2626 2.96967 11.9697L6.939 8L2.96967 4.03033C2.7034 3.76406 2.6792 3.3474 2.89705 3.05379L2.96967 2.96967Z" }) }) })
39
+ ]
40
+ }
41
+ );
42
+ };
43
+ export {
44
+ E as Toast
45
+ };
@@ -1,87 +1,83 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useMemo as E, useEffect as I } from "react";
3
- import { OptionsList as b } from "./bundle.es12.js";
4
- import { OptionItem as B } from "./bundle.es10.js";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as S, useEffect as A } from "react";
3
+ import { OptionsList as E } from "./bundle.es12.js";
4
+ import { OptionItem as b } from "./bundle.es10.js";
5
5
  import { Popover as F } from "./bundle.es6.js";
6
- import { useFroozeClosing as z } from "./bundle.es30.js";
7
- import { SelectInput as D } from "./bundle.es31.js";
8
- import { useScrollListController as L } from "./bundle.es32.js";
9
- const y = (c) => {
6
+ import { useFroozeClosing as I } from "./bundle.es31.js";
7
+ import { SelectInput as z } from "./bundle.es32.js";
8
+ import { useScrollListController as D } from "./bundle.es33.js";
9
+ const M = (c) => {
10
10
  const {
11
11
  options: e,
12
- onChange: i,
12
+ onChange: l,
13
+ value: s,
13
14
  minimalOptions: a,
14
- clearButton: m,
15
- clearButtonIcon: u,
16
- matchTarget: f = "width",
17
- value: l,
18
- children: n,
19
- disabled: s,
20
- ...d
21
- } = c, p = E(() => {
22
- const o = e.findIndex((t) => t.value === l);
15
+ matchTarget: m = "width",
16
+ children: u,
17
+ disabled: p,
18
+ ...n
19
+ } = c, t = S(() => {
20
+ const o = e.findIndex((r) => r.value === s);
23
21
  return {
24
22
  index: o,
25
23
  option: e[o]
26
24
  };
27
- }, [e, l]), v = p.option?.value ?? null, { popoverRef: h, froozePopoverPosition: x, handleAnimationEnd: O } = z(), { scrollToElement: C, optionsWrapperRef: g, scrollBoxRef: P } = L(), R = (o, t) => {
28
- x(), i(o), t();
29
- }, S = (o) => {
30
- o.stopPropagation(), i(null);
31
- }, A = () => {
32
- p.index !== -1 && C(p.index, !0);
25
+ }, [e, s]), f = t.option?.value ?? null, { popoverRef: d, froozePopoverPosition: v, handleAnimationEnd: h } = I(), { scrollToElement: x, optionsWrapperRef: O, scrollBoxRef: C } = D(), g = (o, r) => {
26
+ v(), l(o), r();
27
+ }, P = (o) => {
28
+ o.stopPropagation(), l(null);
29
+ }, R = () => {
30
+ t.index !== -1 && x(t.index, !0);
33
31
  };
34
- return /* @__PURE__ */ r(
32
+ return /* @__PURE__ */ i(
35
33
  F,
36
34
  {
37
35
  minimal: !0,
38
- ref: h,
36
+ ref: d,
39
37
  sideOffset: 0,
40
- matchTarget: f,
41
- onAnimationEnd: O,
38
+ matchTarget: m,
39
+ onAnimationEnd: h,
42
40
  onOpenAutoFocus: (o) => o.preventDefault(),
43
41
  onCloseAutoFocus: (o) => o.preventDefault(),
44
- disabled: s,
45
- content: ({ close: o }) => /* @__PURE__ */ r(
46
- T,
42
+ disabled: p,
43
+ content: ({ close: o }) => /* @__PURE__ */ i(
44
+ L,
47
45
  {
48
46
  options: e,
49
- active: v,
50
- scrollboxRef: P,
51
- optionsWrapperRef: g,
47
+ active: f,
48
+ scrollboxRef: C,
49
+ optionsWrapperRef: O,
52
50
  minimalOptions: a,
53
- onOpened: A,
54
- onSelect: (t) => R(t, o)
51
+ onOpened: R,
52
+ onSelect: (r) => g(r, o)
55
53
  }
56
54
  ),
57
- children: n ?? /* @__PURE__ */ r(
58
- D,
55
+ children: u ?? /* @__PURE__ */ i(
56
+ z,
59
57
  {
60
- ...d,
61
- disabled: s,
62
- value: p.option?.title ?? "",
63
- onClear: S,
64
- clearButton: m,
65
- clearButtonIcon: u
58
+ ...n,
59
+ disabled: p,
60
+ value: t.option?.title ?? "",
61
+ onClear: P
66
62
  }
67
63
  )
68
64
  }
69
65
  );
70
- }, T = (c) => {
71
- const { active: e, onOpened: i, scrollboxRef: a, optionsWrapperRef: m, options: u, onSelect: f, minimalOptions: l } = c;
72
- return I(() => {
73
- i?.();
74
- }, []), /* @__PURE__ */ r(b, { scrollboxRef: a, optionsWrapperRef: m, maxHeight: 300, children: u.map((n, s) => /* @__PURE__ */ r(
75
- B,
66
+ }, L = (c) => {
67
+ const { active: e, onOpened: l, scrollboxRef: s, optionsWrapperRef: a, options: m, onSelect: u, minimalOptions: p } = c;
68
+ return A(() => {
69
+ l?.();
70
+ }, []), /* @__PURE__ */ i(E, { scrollboxRef: s, optionsWrapperRef: a, maxHeight: 300, children: m.map((n, t) => /* @__PURE__ */ i(
71
+ b,
76
72
  {
77
73
  active: e === n.value,
78
- onClick: () => f?.(n.value),
79
- minimal: l,
74
+ onClick: () => u?.(n.value),
75
+ minimal: p,
80
76
  ...n
81
77
  },
82
- `option-item-${n.value}-${s}`
78
+ `option-item-${n.value}-${t}`
83
79
  )) });
84
80
  };
85
81
  export {
86
- y as Select
82
+ M as Select
87
83
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs as z, jsx as n } from "react/jsx-runtime";
2
2
  import A from "classnames";
3
3
  import M from "react-input-mask";
4
- import { useLayoutAndUpdate as U } from "./bundle.es33.js";
4
+ import { useLayoutAndUpdate as U } from "./bundle.es34.js";
5
5
  import { attr as c } from "@companix/utils-browser";
6
6
  import { forwardRef as R, useRef as l, useCallback as g } from "react";
7
7
  import { mergeRefs as v } from "react-merge-refs";
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { TextArea } from './TextArea';
23
23
  export { SelectTags } from './SelectTags';
24
24
  export { DatePicker } from './DatePicker';
25
25
  export { FileOverlay } from './File';
26
+ export { FormGroup } from './FormGroup';
26
27
  export * from './__hooks/use-local-storage';
27
28
  export { createAlertAgent } from './DialogAlert';
28
29
  export { createToaster } from './Toaster';
package/dist/index.scss CHANGED
@@ -23,4 +23,4 @@
23
23
  @use './Spinner/Spinner.scss';
24
24
  @use './ButtonGroup/ButtonGroup.scss';
25
25
  @use './Scrollable/Scrollable.scss';
26
- @use './FormLabel/FormLabel.scss';
26
+ @use './FormGroup/FormGroup.scss';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.0.11",
3
+ "version": "0.0.14",
4
4
  "module": "./dist/bundle.es.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
File without changes