@companix/uikit 0.0.23 → 0.0.25

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 (69) hide show
  1. package/dist/Button/index.d.ts +1 -0
  2. package/dist/File/index.d.ts +2 -2
  3. package/dist/Progress/Progress.scss +47 -0
  4. package/dist/Progress/index.d.ts +5 -0
  5. package/dist/Toaster/Toast.d.ts +10 -4
  6. package/dist/Toaster/Toaster.scss +6 -2
  7. package/dist/Toaster/Viewport.d.ts +1 -0
  8. package/dist/Toaster/index.d.ts +7 -1
  9. package/dist/bundle.es.js +22 -18
  10. package/dist/bundle.es10.js +1 -1
  11. package/dist/bundle.es11.js +1 -1
  12. package/dist/bundle.es14.js +1 -1
  13. package/dist/bundle.es19.js +1 -1
  14. package/dist/bundle.es2.js +34 -32
  15. package/dist/bundle.es20.js +1 -1
  16. package/dist/bundle.es23.js +1 -1
  17. package/dist/bundle.es24.js +3 -3
  18. package/dist/bundle.es25.js +4 -4
  19. package/dist/bundle.es26.js +2 -2
  20. package/dist/bundle.es27.js +24 -27
  21. package/dist/bundle.es29.js +2 -2
  22. package/dist/bundle.es31.js +6 -10
  23. package/dist/bundle.es32.js +10 -24
  24. package/dist/bundle.es33.js +17 -28
  25. package/dist/bundle.es34.js +43 -20
  26. package/dist/bundle.es35.js +51 -87
  27. package/dist/bundle.es36.js +23 -17
  28. package/dist/bundle.es37.js +87 -20
  29. package/dist/bundle.es38.js +18 -24
  30. package/dist/bundle.es39.js +20 -39
  31. package/dist/bundle.es40.js +24 -3
  32. package/dist/bundle.es41.js +39 -5
  33. package/dist/bundle.es42.js +3 -14
  34. package/dist/bundle.es43.js +5 -14
  35. package/dist/bundle.es44.js +14 -3
  36. package/dist/bundle.es45.js +14 -3
  37. package/dist/bundle.es46.js +3 -70
  38. package/dist/bundle.es47.js +3 -68
  39. package/dist/bundle.es48.js +69 -69
  40. package/dist/bundle.es49.js +67 -11
  41. package/dist/bundle.es50.js +69 -42
  42. package/dist/bundle.es51.js +12 -32
  43. package/dist/bundle.es52.js +42 -67
  44. package/dist/bundle.es53.js +32 -14
  45. package/dist/bundle.es54.js +72 -19
  46. package/dist/bundle.es55.js +20 -2
  47. package/dist/bundle.es56.js +2 -43
  48. package/dist/bundle.es57.js +13 -75
  49. package/dist/bundle.es58.js +20 -49
  50. package/dist/bundle.es59.js +2 -20
  51. package/dist/bundle.es60.js +21 -2
  52. package/dist/bundle.es61.js +2 -21
  53. package/dist/bundle.es62.js +20 -2
  54. package/dist/bundle.es63.js +76 -20
  55. package/dist/bundle.es64.js +49 -2
  56. package/dist/bundle.es65.js +2 -14
  57. package/dist/bundle.es66.js +14 -3
  58. package/dist/bundle.es67.js +1 -1
  59. package/dist/bundle.es68.js +3 -20
  60. package/dist/bundle.es69.js +20 -2
  61. package/dist/bundle.es70.js +2 -20
  62. package/dist/bundle.es71.js +20 -2
  63. package/dist/bundle.es72.js +4 -0
  64. package/dist/bundle.es8.js +4 -4
  65. package/dist/bundle.es9.js +2 -2
  66. package/dist/index.d.ts +2 -0
  67. package/dist/index.scss +1 -0
  68. package/dist/mixins.scss +2 -0
  69. package/package.json +1 -1
@@ -14,6 +14,7 @@ export interface InternButtonProps {
14
14
  text?: React.ReactNode;
15
15
  children?: React.ReactNode;
16
16
  className?: string;
17
+ Component?: React.ElementType;
17
18
  }
18
19
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, InternButtonProps {
19
20
  }
@@ -2,9 +2,9 @@ export interface FileOverlayProps {
2
2
  multiple?: true;
3
3
  onChange?: (file: File[]) => void;
4
4
  children: React.ReactNode;
5
- mimes?: string[];
6
5
  disabled?: boolean;
7
6
  className?: string;
7
+ mimes?: ('image' | 'video' | 'audio' | 'text' | 'application')[];
8
8
  }
9
- declare const FileOverlay: ({ onChange, disabled, mimes, children, multiple, className }: FileOverlayProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const FileOverlay: ({ onChange, disabled, children, multiple, mimes, className }: FileOverlayProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export { FileOverlay };
@@ -0,0 +1,47 @@
1
+ @use '../mixins.scss';
2
+
3
+ .progress-bar {
4
+ @include mixins.use-styles(progress);
5
+
6
+ display: block;
7
+ overflow: hidden;
8
+ position: relative;
9
+ border-radius: 100px;
10
+ width: 100%;
11
+
12
+ &-thumb {
13
+ animation: linear-progress-bar-stripes 0.3s linear infinite reverse;
14
+ background: linear-gradient(
15
+ -45deg,
16
+ hsla(0, 0%, 100%, 0.2) 25%,
17
+ transparent 0,
18
+ transparent 50%,
19
+ hsla(0, 0%, 100%, 0.2) 0,
20
+ hsla(0, 0%, 100%, 0.2) 75%,
21
+ transparent 0
22
+ );
23
+ background-size: 30px 30px;
24
+ border-radius: 40px;
25
+ height: 100%;
26
+ position: absolute;
27
+ transition: width 0.2s cubic-bezier(0.4, 1, 0.75, 0.9);
28
+ width: 100%;
29
+
30
+ @include mixins.use-styles(progress, thumb);
31
+
32
+ @each $appearance, $v in mixins.$appearances {
33
+ &[data-appearance='#{$appearance}'] {
34
+ @include mixins.use-styles(progress, thumb, $appearance);
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ @keyframes linear-progress-bar-stripes {
41
+ 0% {
42
+ background-position: 0 0;
43
+ }
44
+ to {
45
+ background-position: 30px 0;
46
+ }
47
+ }
@@ -0,0 +1,5 @@
1
+ export interface ProgressBarProps {
2
+ appearance?: 'primary' | 'neutral' | 'positive' | 'negative';
3
+ value: number;
4
+ }
5
+ export declare const ProgressBar: ({ appearance, value }: ProgressBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,15 @@
1
1
  import { ToastOptions } from '.';
2
2
  interface ToastProps extends ToastOptions {
3
- onRemoved: () => void;
4
- onRemoving: () => void;
3
+ id: string;
4
+ onClosed: () => void;
5
+ onClosing: () => void;
5
6
  onInitialized: (ref: HTMLLIElement) => void;
6
- closeIcon?: React.ReactNode;
7
7
  }
8
- export declare const Toast: (options: ToastProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Toast: {
9
+ (options: ToastProps): import("react/jsx-runtime").JSX.Element;
10
+ Close({ closeIcon, className }?: {
11
+ closeIcon?: React.ReactNode;
12
+ className?: string;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ };
9
15
  export {};
@@ -99,6 +99,7 @@
99
99
  &-content {
100
100
  display: flex;
101
101
  flex-direction: column;
102
+ width: 100%;
102
103
 
103
104
  @include mixins.use-styles(toaster, content);
104
105
  }
@@ -111,11 +112,14 @@
111
112
  @include mixins.use-styles(toaster, description);
112
113
  }
113
114
 
114
- &-close {
115
- cursor: pointer;
115
+ &-close-placement {
116
116
  top: var(--toaster_close_space, 0);
117
117
  right: var(--toaster_close_space, 0);
118
118
  position: absolute;
119
+ }
120
+
121
+ &-close {
122
+ cursor: pointer;
119
123
  transition: color 0.2s;
120
124
 
121
125
  @include mixins.use-styles(toaster, close);
@@ -9,5 +9,6 @@ export interface ViewportProps {
9
9
  }
10
10
  export interface ViewportRef {
11
11
  addToast: (toast: InnerToast) => void;
12
+ updateToast: (toast: InnerToast) => void;
12
13
  }
13
14
  export declare const Viewport: import('react').ForwardRefExoticComponent<ViewportProps & import('react').RefAttributes<ViewportRef>>;
@@ -1,15 +1,21 @@
1
1
  import { ViewportProps } from './Viewport';
2
2
  export interface ToastOptions {
3
+ id?: string;
3
4
  appearance?: 'primary' | 'neutral' | 'positive' | 'negative' | 'warning';
4
5
  icon?: React.ReactNode;
5
6
  title?: React.ReactNode;
6
7
  description?: React.ReactNode;
7
8
  duration?: number;
9
+ closeIcon?: React.ReactNode;
10
+ closable?: boolean;
8
11
  }
9
12
  export interface InnerToast extends ToastOptions {
10
13
  id: string;
11
14
  }
12
15
  export declare const createToaster: (rootProps?: ViewportProps) => {
13
- send: (toast: ToastOptions) => void;
16
+ api: {
17
+ add: (toast: ToastOptions) => string;
18
+ update: (toast: InnerToast) => void;
19
+ };
14
20
  Viewport: (props?: ViewportProps) => import("react/jsx-runtime").JSX.Element;
15
21
  };
package/dist/bundle.es.js CHANGED
@@ -4,14 +4,14 @@ import { Scrollable as x } from "./bundle.es4.js";
4
4
  import { ImitateScroll as a } from "./bundle.es5.js";
5
5
  import { Popover as l } from "./bundle.es6.js";
6
6
  import { Tooltip as c } from "./bundle.es7.js";
7
- import { Select as S } from "./bundle.es8.js";
8
- import { Input as I } from "./bundle.es9.js";
9
- import { OptionItem as g } from "./bundle.es10.js";
7
+ import { Select as s } from "./bundle.es8.js";
8
+ import { Input as T } from "./bundle.es9.js";
9
+ import { OptionItem as I } from "./bundle.es10.js";
10
10
  import { NumberInput as b } from "./bundle.es11.js";
11
11
  import { OptionsList as A } from "./bundle.es12.js";
12
- import { ButtonGroup as w } from "./bundle.es13.js";
13
- import { Checkbox as G } from "./bundle.es14.js";
14
- import { Switch as O } from "./bundle.es15.js";
12
+ import { ButtonGroup as P } from "./bundle.es13.js";
13
+ import { Checkbox as w } from "./bundle.es14.js";
14
+ import { Switch as L } from "./bundle.es15.js";
15
15
  import { Radio as h, RadioGroup as v } from "./bundle.es16.js";
16
16
  import { Drawer as F } from "./bundle.es17.js";
17
17
  import { Dialog as y } from "./bundle.es18.js";
@@ -27,14 +27,16 @@ import { FileOverlay as $ } from "./bundle.es27.js";
27
27
  import { FormGroup as ro } from "./bundle.es28.js";
28
28
  import { TimePicker as to } from "./bundle.es29.js";
29
29
  import { Icon as mo } from "./bundle.es30.js";
30
- import { useLocalStorage as fo } from "./bundle.es31.js";
31
- import { createAlertAgent as io } from "./bundle.es32.js";
32
- import { createToaster as no } from "./bundle.es33.js";
30
+ import { ProgressBar as fo } from "./bundle.es31.js";
31
+ import { useLocalStorage as io } from "./bundle.es32.js";
32
+ import { createAlertAgent as no } from "./bundle.es33.js";
33
+ import { createToaster as uo } from "./bundle.es34.js";
34
+ import { Toast as So } from "./bundle.es35.js";
33
35
  export {
34
36
  j as AlertDialog,
35
37
  e as Button,
36
- w as ButtonGroup,
37
- G as Checkbox,
38
+ P as ButtonGroup,
39
+ w as Checkbox,
38
40
  K as Countdown,
39
41
  Z as DateInput,
40
42
  X as DatePicker,
@@ -44,24 +46,26 @@ export {
44
46
  ro as FormGroup,
45
47
  mo as Icon,
46
48
  a as ImitateScroll,
47
- I as Input,
49
+ T as Input,
48
50
  z as LoadButton,
49
51
  b as NumberInput,
50
- g as OptionItem,
52
+ I as OptionItem,
51
53
  A as OptionsList,
52
54
  l as Popover,
55
+ fo as ProgressBar,
53
56
  h as Radio,
54
57
  v as RadioGroup,
55
58
  x as Scrollable,
56
- S as Select,
59
+ s as Select,
57
60
  V as SelectTags,
58
61
  p as Spinner,
59
- O as Switch,
62
+ L as Switch,
60
63
  H as Tabs,
61
64
  Q as TextArea,
62
65
  to as TimePicker,
66
+ So as Toast,
63
67
  c as Tooltip,
64
- io as createAlertAgent,
65
- no as createToaster,
66
- fo as useLocalStorage
68
+ no as createAlertAgent,
69
+ uo as createToaster,
70
+ io as useLocalStorage
67
71
  };
@@ -3,7 +3,7 @@ import N from "classnames";
3
3
  import { Icon as v } from "./bundle.es30.js";
4
4
  import { attr as t } from "@companix/utils-browser";
5
5
  import { forwardRef as k } from "react";
6
- import { f as x } from "./bundle.es40.js";
6
+ import { f as x } from "./bundle.es42.js";
7
7
  const E = k(
8
8
  ({ title: s, icon: c, active: e, label: n, disabled: a, minimal: r, onClick: d, className: l, ...m }, p) => {
9
9
  const f = (h) => {
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import C from "classnames";
3
3
  import { forwardRef as j, useRef as w } from "react";
4
4
  import { mergeRefs as y } from "react-merge-refs";
5
- import { InputContainer as F } from "./bundle.es39.js";
5
+ import { InputContainer as F } from "./bundle.es41.js";
6
6
  import { NumericFormat as V } from "react-number-format";
7
7
  const D = j(
8
8
  ({
@@ -1,7 +1,7 @@
1
1
  import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-checkbox";
3
3
  import { Icon as h } from "./bundle.es30.js";
4
- import { f as l } from "./bundle.es40.js";
4
+ import { f as l } from "./bundle.es42.js";
5
5
  import { useId as n } from "react";
6
6
  import { attr as c } from "@companix/utils-browser";
7
7
  const N = ({ checked: a, required: s, disabled: r, onCheckedChange: m, size: x, label: e }) => {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-alert-dialog";
3
3
  import { Button as c } from "./bundle.es2.js";
4
- import { RemoveListener as N } from "./bundle.es41.js";
4
+ import { RemoveListener as N } from "./bundle.es43.js";
5
5
  import { VisuallyHidden as u } from "@radix-ui/react-visually-hidden";
6
6
  const C = ({
7
7
  open: d,
@@ -1,41 +1,43 @@
1
- import { jsx as e, jsxs as b, Fragment as h } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as x, Fragment as h } from "react/jsx-runtime";
2
2
  import j from "classnames";
3
3
  import { Spinner as k } from "./bundle.es3.js";
4
- import { forwardRef as v } from "react";
4
+ import { forwardRef as w } from "react";
5
5
  import { attr as r } from "@companix/utils-browser";
6
- const F = v(
6
+ const F = w(
7
7
  ({
8
8
  children: d,
9
- fill: o,
10
- text: m,
11
- active: l,
12
- mode: c = "default",
13
- appearance: f = "neutral",
14
- size: s = "md",
15
- align: p,
16
- icon: n,
17
- loading: a,
18
- className: u,
19
- iconRight: i,
20
- ...t
21
- }, x) => /* @__PURE__ */ e(
22
- "button",
9
+ fill: l,
10
+ text: i,
11
+ active: c,
12
+ mode: f = "default",
13
+ appearance: s = "neutral",
14
+ size: p = "md",
15
+ align: u,
16
+ icon: m,
17
+ loading: t,
18
+ className: b,
19
+ iconRight: n,
20
+ Component: o = "button",
21
+ ...a
22
+ }, v) => /* @__PURE__ */ e(
23
+ o,
23
24
  {
24
- ref: x,
25
- className: j("button", u),
26
- "data-size": s,
27
- "data-loading": r(a),
28
- "data-align": a ? "center" : p ?? (n && i ? "left" : "center"),
29
- "data-appearance": f,
30
- "data-mode": c,
31
- "data-fill": r(o),
32
- "data-active": r(l),
33
- ...t,
34
- onClick: a ?? t.disabled ? void 0 : t.onClick,
35
- children: a ? /* @__PURE__ */ e(k, { size: 14, width: 2 }) : /* @__PURE__ */ b(h, { children: [
36
- n,
37
- (d ?? m) && /* @__PURE__ */ e("span", { className: "button-text", children: m ?? d }),
38
- i
25
+ ref: v,
26
+ className: j("button", b),
27
+ "data-size": p,
28
+ "data-loading": r(t),
29
+ "data-align": t ? "center" : u ?? (m && n ? "left" : "center"),
30
+ "data-appearance": s,
31
+ "data-mode": f,
32
+ "data-fill": r(l),
33
+ "data-active": r(c),
34
+ type: o === "button" ? "button" : void 0,
35
+ ...a,
36
+ onClick: t ?? a.disabled ? void 0 : a.onClick,
37
+ children: t ? /* @__PURE__ */ e(k, { size: 14, width: 2 }) : /* @__PURE__ */ x(h, { children: [
38
+ m,
39
+ (d ?? i) && /* @__PURE__ */ e("span", { className: "button-text", children: i ?? d }),
40
+ n
39
41
  ] })
40
42
  }
41
43
  )
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { Button as m } from "./bundle.es2.js";
3
- import { useLoading as p } from "./bundle.es42.js";
3
+ import { useLoading as p } from "./bundle.es44.js";
4
4
  const g = ({ onClick: o, appearance: r = "primary", ...i }) => {
5
5
  const { isLoading: n, isError: t, handleClick: a } = p({ onClick: o });
6
6
  return /* @__PURE__ */ e(
@@ -1,5 +1,5 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useResizeTextarea as x } from "./bundle.es43.js";
2
+ import { useResizeTextarea as x } from "./bundle.es45.js";
3
3
  import { attr as e, callMultiple as u } from "@companix/utils-browser";
4
4
  import { useEffect as z } from "react";
5
5
  import { mergeRefs as R } from "react-merge-refs";
@@ -1,12 +1,12 @@
1
1
  import { jsx as o, jsxs as l } from "react/jsx-runtime";
2
- import { useFroozeClosing as M } from "./bundle.es34.js";
2
+ import { useFroozeClosing as M } from "./bundle.es36.js";
3
3
  import { Popover as j } from "./bundle.es6.js";
4
4
  import { OptionItem as q } from "./bundle.es10.js";
5
5
  import { OptionsList as V } from "./bundle.es12.js";
6
6
  import { Icon as d } from "./bundle.es30.js";
7
7
  import { useState as B, useRef as h, useMemo as g } from "react";
8
- import { f as H } from "./bundle.es44.js";
9
- import { f as Q } from "./bundle.es45.js";
8
+ import { f as H } from "./bundle.es46.js";
9
+ import { f as Q } from "./bundle.es47.js";
10
10
  import { attr as x, getActiveElementByAnotherElement as G, contains as J } from "@companix/utils-browser";
11
11
  import { mergeRefs as K } from "react-merge-refs";
12
12
  const se = (C) => {
@@ -2,11 +2,11 @@ import { jsx as u } from "react/jsx-runtime";
2
2
  import { Popover as x } from "./bundle.es6.js";
3
3
  import { Input as A } from "./bundle.es9.js";
4
4
  import { useState as M, useRef as j } from "react";
5
- import { Calendar as E } from "./bundle.es46.js";
6
- import { useDayDisableCheker as N } from "./bundle.es47.js";
5
+ import { Calendar as E } from "./bundle.es48.js";
6
+ import { useDayDisableCheker as N } from "./bundle.es49.js";
7
7
  import { getNum as f, formatTime as v } from "@companix/utils-js";
8
- import { removeDigits as O } from "./bundle.es48.js";
9
- import { SelectRightElements as Y } from "./bundle.es49.js";
8
+ import { removeDigits as O } from "./bundle.es50.js";
9
+ import { SelectRightElements as Y } from "./bundle.es51.js";
10
10
  const i = {
11
11
  char: "-",
12
12
  toString: (e) => {
@@ -1,8 +1,8 @@
1
1
  import { jsxs as D, jsx as h } from "react/jsx-runtime";
2
2
  import { useMemo as M, useEffect as C } from "react";
3
3
  import { Select as c } from "./bundle.es8.js";
4
- import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es48.js";
5
- import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es50.js";
4
+ import { createDateValidation as O, getMonthMaxDay as T } from "./bundle.es50.js";
5
+ import { defaultMin as j, defaultMax as N, useCalendarOptions as V } from "./bundle.es52.js";
6
6
  const B = ({
7
7
  min: o = j,
8
8
  max: e = N,
@@ -1,38 +1,35 @@
1
- import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
- import { VisuallyHidden as s } from "@radix-ui/react-visually-hidden";
3
- import { useRef as p } from "react";
4
- const d = ({
5
- onChange: n,
6
- disabled: r,
7
- mimes: l,
8
- children: a,
9
- multiple: i,
10
- className: f
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
+ import { VisuallyHidden as p } from "@radix-ui/react-visually-hidden";
3
+ import { useRef as h, useMemo as m } from "react";
4
+ const j = ({
5
+ onChange: l,
6
+ disabled: n,
7
+ children: o,
8
+ multiple: f,
9
+ mimes: e,
10
+ className: a
11
11
  }) => {
12
- const e = p(null), u = (t) => {
13
- r || (t.target.files && n?.(Array.from(t.target.files)), e.current && (e.current.value = ""));
14
- };
15
- return /* @__PURE__ */ c("label", { className: f, children: [
16
- a,
17
- /* @__PURE__ */ o(s, { asChild: !0, children: /* @__PURE__ */ o(
12
+ const t = h(null), u = (r) => {
13
+ n || (r.target.files && l?.(Array.from(r.target.files)), t.current && (t.current.value = ""));
14
+ }, c = m(() => {
15
+ if (e)
16
+ return e.map((r) => `${r}/*`).join(",");
17
+ }, [e]);
18
+ return /* @__PURE__ */ s("label", { className: a, children: [
19
+ o,
20
+ /* @__PURE__ */ i(p, { asChild: !0, children: /* @__PURE__ */ i(
18
21
  "input",
19
22
  {
20
- ref: e,
21
- hidden: !0,
23
+ ref: t,
22
24
  type: "file",
23
- autoComplete: "off",
24
- autoCapitalize: "none",
25
- autoCorrect: "off",
26
- spellCheck: "false",
27
- "aria-autocomplete": "none",
28
- multiple: i,
29
- accept: (l ?? []).join(", "),
25
+ multiple: f,
26
+ accept: c,
30
27
  onChange: u,
31
- disabled: r
28
+ disabled: n
32
29
  }
33
30
  ) })
34
31
  ] });
35
32
  };
36
33
  export {
37
- d as FileOverlay
34
+ j as FileOverlay
38
35
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as g } from "react/jsx-runtime";
2
2
  import { useRef as _, useMemo as b, useState as P, useEffect as j } from "react";
3
3
  import { getNum as v } from "@companix/utils-js";
4
- import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es48.js";
5
- import { SelectRightElements as w } from "./bundle.es49.js";
4
+ import { getTimesOptions as D, getTimeValue as A, removeDigits as W, convertTimeToOption as q } from "./bundle.es50.js";
5
+ import { SelectRightElements as w } from "./bundle.es51.js";
6
6
  import { Select as y } from "./bundle.es8.js";
7
7
  import { Input as z } from "./bundle.es9.js";
8
8
  const r = {
@@ -1,13 +1,9 @@
1
- import { useState as s, useEffect as c } from "react";
2
- const l = (e, a) => {
3
- const [t, o] = s(() => {
4
- const r = localStorage.getItem(e);
5
- return r ? JSON.parse(r) : a;
6
- });
7
- return c(() => {
8
- localStorage.setItem(e, JSON.stringify(t));
9
- }, [t]), [t, o];
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { clamp as o, pc as p } from "@companix/utils-browser";
3
+ const i = ({ appearance: a = "primary", value: e }) => {
4
+ const s = 100 * o(e, 0, 1);
5
+ return /* @__PURE__ */ r("div", { "aria-valuemax": 100, "aria-valuemin": 0, role: "progressbar", className: "progress-bar", children: /* @__PURE__ */ r("div", { className: "progress-bar-thumb", "data-appearance": a, style: { width: p(s) } }) });
10
6
  };
11
7
  export {
12
- l as useLocalStorage
8
+ i as ProgressBar
13
9
  };
@@ -1,27 +1,13 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { hash as m } from "@companix/utils-js";
3
- import { useRef as n, useMemo as s } from "react";
4
- import { Viewport as u } from "./bundle.es51.js";
5
- const h = (t = {}) => {
6
- const e = {
7
- emit: (r) => {
8
- console.error("uninitialized", r);
9
- }
10
- };
11
- return {
12
- show: (r) => {
13
- e.emit({ ...r, id: m() });
14
- },
15
- Viewport: () => {
16
- const r = n(null);
17
- return s(() => {
18
- e.emit = (o) => {
19
- r.current && r.current.showAlert(o);
20
- };
21
- }, []), /* @__PURE__ */ i(u, { ref: r, ...t });
22
- }
23
- };
1
+ import { useState as s, useEffect as c } from "react";
2
+ const l = (e, a) => {
3
+ const [t, o] = s(() => {
4
+ const r = localStorage.getItem(e);
5
+ return r ? JSON.parse(r) : a;
6
+ });
7
+ return c(() => {
8
+ localStorage.setItem(e, JSON.stringify(t));
9
+ }, [t]), [t, o];
24
10
  };
25
11
  export {
26
- h as createAlertAgent
12
+ l as useLocalStorage
27
13
  };
@@ -1,38 +1,27 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { hash as d } from "@companix/utils-js";
3
- import { Viewport as s } from "./bundle.es52.js";
4
- import { useRef as c, useMemo as l } from "react";
5
- const f = (i = {}) => {
6
- const t = {
7
- emit: (e) => {
8
- console.error("uninitialized", e);
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { hash as m } from "@companix/utils-js";
3
+ import { useRef as n, useMemo as s } from "react";
4
+ import { Viewport as u } from "./bundle.es53.js";
5
+ const h = (t = {}) => {
6
+ const e = {
7
+ emit: (r) => {
8
+ console.error("uninitialized", r);
9
9
  }
10
10
  };
11
11
  return {
12
- send: (e) => {
13
- t.emit({ ...e, id: d() });
12
+ show: (r) => {
13
+ e.emit({ ...r, id: m() });
14
14
  },
15
- Viewport: (e = {}) => {
16
- const n = c(null);
17
- return l(() => {
18
- t.emit = (r) => {
19
- n.current && n.current.addToast(r);
15
+ Viewport: () => {
16
+ const r = n(null);
17
+ return s(() => {
18
+ e.emit = (o) => {
19
+ r.current && r.current.showAlert(o);
20
20
  };
21
- }, []), /* @__PURE__ */ a(
22
- s,
23
- {
24
- ref: n,
25
- align: e.align ?? i.align,
26
- closeIcon: e.closeIcon ?? i.closeIcon,
27
- duration: e.duration ?? i.duration,
28
- gap: e.gap ?? i.gap,
29
- side: e.side ?? i.side,
30
- swipeThreshold: e.swipeThreshold ?? i.swipeThreshold
31
- }
32
- );
21
+ }, []), /* @__PURE__ */ i(u, { ref: r, ...t });
33
22
  }
34
23
  };
35
24
  };
36
25
  export {
37
- f as createToaster
26
+ h as createAlertAgent
38
27
  };