laif-ds 0.1.57 → 0.1.59

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 (35) hide show
  1. package/dist/_virtual/index.js +5 -2
  2. package/dist/_virtual/index3.js +2 -5
  3. package/dist/_virtual/index4.js +5 -2
  4. package/dist/_virtual/index5.js +5 -5
  5. package/dist/_virtual/index6.js +2 -5
  6. package/dist/_virtual/index7.js +2 -5
  7. package/dist/_virtual/index8.js +5 -2
  8. package/dist/components/ui/app-select.js +36 -31
  9. package/dist/components/ui/date-picker.js +44 -32
  10. package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
  11. package/dist/index.d.ts +7 -3
  12. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -29
  13. package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
  14. package/dist/node_modules/cmdk/dist/index.js +2 -2
  15. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +259 -0
  16. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
  17. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
  18. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
  19. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
  20. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +51 -0
  21. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  22. package/dist/node_modules/react-is/index.js +1 -1
  23. package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
  24. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  25. package/dist/node_modules/unified/lib/index.js +1 -1
  26. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  27. package/dist/node_modules/vaul/dist/index.js +1 -1
  28. package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +262 -0
  29. package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
  30. package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
  31. package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
  32. package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
  33. package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +51 -0
  34. package/dist/styles.v3.css +1 -1
  35. package/package.json +28 -28
@@ -1,3 +1,6 @@
1
1
  "use client";
2
- import { __require as e } from "../node_modules/react-is/index.js";
3
- e();
2
+ import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
3
+ var i = r();
4
+ export {
5
+ i as s
6
+ };
@@ -1,6 +1,3 @@
1
1
  "use client";
2
- import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
3
- var i = r();
4
- export {
5
- i as s
6
- };
2
+ import { __require as e } from "../node_modules/react-is/index.js";
3
+ e();
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
+ var t = e();
5
+ const a = /* @__PURE__ */ r(t);
3
6
  export {
4
- e as __module
7
+ a as default
5
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
- var t = e();
5
- const a = /* @__PURE__ */ r(t);
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
6
6
  export {
7
- a as default
7
+ x as default
8
8
  };
@@ -1,8 +1,5 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as r } from "../node_modules/extend/index.js";
4
- var t = r();
5
- const x = /* @__PURE__ */ e(t);
2
+ var e = { exports: {} };
6
3
  export {
7
- x as default
4
+ e as __module
8
5
  };
@@ -1,8 +1,5 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/classnames/index.js";
4
- var s = e();
5
- const o = /* @__PURE__ */ r(s);
2
+ var e = {};
6
3
  export {
7
- o as default
4
+ e as __exports
8
5
  };
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = {};
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/classnames/index.js";
4
+ var s = e();
5
+ const o = /* @__PURE__ */ r(s);
3
6
  export {
4
- e as __exports
7
+ o as default
5
8
  };
@@ -1,37 +1,42 @@
1
1
  "use client";
2
- import { jsxs as o, jsx as l } from "react/jsx-runtime";
3
- import { Select as n, SelectTrigger as s, SelectValue as u, SelectContent as i, SelectItem as A } from "./select.js";
4
- import { SelectGroup as h, SelectLabel as x, SelectScrollDownButton as B, SelectScrollUpButton as v, SelectSeparator as j } from "./select.js";
5
- function b({
6
- options: t,
7
- placeholder: c,
8
- children: p,
9
- label: r,
10
- className: S,
11
- ...a
2
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
3
+ import { Select as h, SelectTrigger as C, SelectValue as i, SelectContent as B, SelectItem as j } from "./select.js";
4
+ import { SelectGroup as T, SelectLabel as U, SelectScrollDownButton as V, SelectScrollUpButton as b, SelectSeparator as v } from "./select.js";
5
+ function I({
6
+ options: o,
7
+ placeholder: u,
8
+ children: m,
9
+ label: d,
10
+ className: x,
11
+ labelKey: n,
12
+ valueKey: S,
13
+ descriptionKey: a,
14
+ isOptionDisabled: c,
15
+ ...A
12
16
  }) {
13
- return /* @__PURE__ */ o(n, { ...a, label: r, children: [
14
- p || /* @__PURE__ */ l(s, { className: S, children: /* @__PURE__ */ l(u, { placeholder: c }) }),
15
- /* @__PURE__ */ l(i, { children: t.map((e) => /* @__PURE__ */ l(
16
- A,
17
- {
18
- value: String(e.value),
19
- disabled: e.disabled,
20
- children: e.label
21
- },
22
- e.value
23
- )) })
17
+ return /* @__PURE__ */ r(h, { ...A, label: d, children: [
18
+ m || /* @__PURE__ */ t(C, { className: x, children: /* @__PURE__ */ t(i, { placeholder: u }) }),
19
+ /* @__PURE__ */ t(B, { children: o.map((e) => {
20
+ const l = n && S, p = String(l ? e[S] : e.value), g = l ? String(e[n]) : e.label, s = l && a ? String(e[a]) : null, f = l ? (c == null ? void 0 : c(e)) ?? !1 : e.disabled;
21
+ return /* @__PURE__ */ t(j, { value: p, disabled: f, children: /* @__PURE__ */ r("span", { className: "flex flex-col", children: [
22
+ /* @__PURE__ */ t("span", { children: g }),
23
+ s && /* @__PURE__ */ r("span", { className: "text-xs text-muted-foreground text-d-tertiary", children: [
24
+ "- ",
25
+ s
26
+ ] })
27
+ ] }) }, p);
28
+ }) })
24
29
  ] });
25
30
  }
26
31
  export {
27
- b as AppSelect,
28
- i as AppSelectContent,
29
- h as AppSelectGroup,
30
- A as AppSelectItem,
31
- x as AppSelectLabel,
32
- B as AppSelectScrollDownButton,
33
- v as AppSelectScrollUpButton,
34
- j as AppSelectSeparator,
35
- s as AppSelectTrigger,
36
- u as AppSelectValue
32
+ I as AppSelect,
33
+ B as AppSelectContent,
34
+ T as AppSelectGroup,
35
+ j as AppSelectItem,
36
+ U as AppSelectLabel,
37
+ V as AppSelectScrollDownButton,
38
+ b as AppSelectScrollUpButton,
39
+ v as AppSelectSeparator,
40
+ C as AppSelectTrigger,
41
+ i as AppSelectValue
37
42
  };
@@ -1,53 +1,65 @@
1
1
  "use client";
2
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
3
- import * as i from "react";
2
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
3
+ import * as d from "react";
4
4
  import { cn as g } from "../../lib/utils.js";
5
- import { Button as x } from "./button.js";
6
- import { Calendar as h } from "./calendar.js";
7
- import { Popover as P, PopoverTrigger as w, PopoverContent as b } from "./popover.js";
8
- import { formatDate as v } from "../../node_modules/date-fns/format.js";
9
- function k({
10
- value: r,
5
+ import { buttonVariants as x } from "./button.js";
6
+ import { Icon as h } from "./icon.js";
7
+ import { Calendar as v } from "./calendar.js";
8
+ import { Popover as w, PopoverTrigger as P, PopoverContent as b } from "./popover.js";
9
+ import { formatDate as C } from "../../node_modules/date-fns/format.js";
10
+ function E({
11
+ value: n,
11
12
  onChange: a,
12
- placeholder: c = "Seleziona data",
13
- dateFormat: l = "PPP",
13
+ placeholder: l = "Seleziona data",
14
+ dateFormat: m = "PPP",
14
15
  className: f,
15
- buttonVariant: m = "default",
16
+ buttonVariant: u = "default",
16
17
  disabled: t = !1,
17
- size: n = "default"
18
+ size: r = "default"
18
19
  }) {
19
- const [o, d] = i.useState(r);
20
- i.useEffect(() => {
21
- d(r);
22
- }, [r]);
23
- const u = (s) => {
24
- d(s), a && a(s);
20
+ const [o, i] = d.useState(n);
21
+ d.useEffect(() => {
22
+ i(n);
23
+ }, [n]);
24
+ const p = (s) => {
25
+ i(s), a && a(s);
25
26
  };
26
- return /* @__PURE__ */ p(P, { open: t ? !1 : void 0, children: [
27
- /* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
28
- x,
27
+ return /* @__PURE__ */ c(w, { open: t ? !1 : void 0, children: [
28
+ /* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
29
+ "div",
29
30
  {
30
- variant: m,
31
- size: n,
32
31
  className: g(
33
- "border-d-input text-d-foreground hover:bg-d-accent bg-d-transparent ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
32
+ x({ variant: u, size: r }),
33
+ "border-d-input text-d-foreground hover:bg-d-accent bg-d-transparent ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none [&>span]:line-clamp-1",
34
34
  !o && "text-d-muted-foreground",
35
35
  t && "cursor-not-allowed opacity-50",
36
36
  f,
37
- n === "sm" && "text-xs",
38
- n === "lg" && "text-lg"
37
+ r === "sm" && "text-xs",
38
+ r === "lg" && "text-lg"
39
39
  ),
40
- disabled: t,
41
- iconLeft: "Calendar",
42
- children: o ? v(o, l) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground", children: c })
40
+ "aria-disabled": t,
41
+ role: "button",
42
+ tabIndex: t ? -1 : 0,
43
+ onClick: t ? void 0 : () => {
44
+ },
45
+ children: /* @__PURE__ */ c("div", { className: "flex w-full items-center justify-between gap-2", children: [
46
+ /* @__PURE__ */ e(
47
+ h,
48
+ {
49
+ name: "Calendar",
50
+ size: r === "default" ? "md" : r === "sm" ? "xs" : "sm"
51
+ }
52
+ ),
53
+ o ? /* @__PURE__ */ e("span", { children: C(o, m) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground", children: l })
54
+ ] })
43
55
  }
44
56
  ) }),
45
57
  /* @__PURE__ */ e(b, { className: "w-auto p-0", children: /* @__PURE__ */ e(
46
- h,
58
+ v,
47
59
  {
48
60
  mode: "single",
49
61
  selected: o,
50
- onSelect: u,
62
+ onSelect: p,
51
63
  initialFocus: !0,
52
64
  disabled: t
53
65
  }
@@ -55,5 +67,5 @@ function k({
55
67
  ] });
56
68
  }
57
69
  export {
58
- k as DatePicker
70
+ E as DatePicker
59
71
  };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as o, jsxs as M, Fragment as N } from "react/jsx-runtime";
3
3
  import { useContext as R, useRef as a, useState as s, useCallback as k, useMemo as y, useEffect as u } from "react";
4
- import A from "../../../../../_virtual/index7.js";
4
+ import A from "../../../../../_virtual/index8.js";
5
5
  import B from "../../../../../_virtual/debounce.js";
6
6
  import { GanttContext as F } from "../Gantt/GanttContext.js";
7
7
  import { transformData as O } from "../../utils/transformData.js";
package/dist/index.d.ts CHANGED
@@ -133,7 +133,7 @@ export declare interface AppMultipleSelectOption {
133
133
  disabled?: boolean;
134
134
  }
135
135
 
136
- export declare function AppSelect({ options, placeholder, children, label, className, ...props }: AppSelectProps): JSX.Element;
136
+ export declare function AppSelect<T = AppSelectOption>({ options, placeholder, children, label, className, labelKey, valueKey, descriptionKey, isOptionDisabled, ...props }: AppSelectProps<T>): JSX.Element;
137
137
 
138
138
  export declare interface AppSelectOption {
139
139
  value: string | number;
@@ -141,10 +141,14 @@ export declare interface AppSelectOption {
141
141
  disabled?: boolean;
142
142
  }
143
143
 
144
- export declare interface AppSelectProps extends React_2.ComponentProps<typeof Select> {
145
- options: AppSelectOption[];
144
+ export declare interface AppSelectProps<T = AppSelectOption> extends React_2.ComponentProps<typeof Select> {
145
+ options: T[];
146
146
  placeholder?: string;
147
147
  className?: string;
148
+ labelKey?: keyof T;
149
+ valueKey?: keyof T;
150
+ descriptionKey?: keyof T;
151
+ isOptionDisabled?: (option: T) => boolean;
148
152
  }
149
153
 
150
154
  export declare function AppSidebar({ navigation, navigationFooter, versions, defaultVersion, headerContent, footerContent, showRail, linkComponent: LinkComponent, linkProps, ...props }: AppSidebarProps): JSX.Element;
@@ -1,27 +1,27 @@
1
1
  "use client";
2
2
  import * as l from "react";
3
- import { useComposedRefs as y } from "../../react-compose-refs/dist/index.js";
3
+ import { composeRefs as y } from "../../react-compose-refs/dist/index.js";
4
4
  import { jsx as p, Fragment as S } from "react/jsx-runtime";
5
5
  // @__NO_SIDE_EFFECTS__
6
6
  function g(e) {
7
- const t = /* @__PURE__ */ E(e), n = l.forwardRef((o, r) => {
8
- const { children: i, ...c } = o, a = l.Children.toArray(i), s = a.find(C);
9
- if (s) {
10
- const f = s.props.children, m = a.map((u) => u === s ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : u);
11
- return /* @__PURE__ */ p(t, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, m) : null });
7
+ const t = /* @__PURE__ */ E(e), o = l.forwardRef((n, r) => {
8
+ const { children: i, ...a } = n, s = l.Children.toArray(i), c = s.find(C);
9
+ if (c) {
10
+ const f = c.props.children, m = s.map((u) => u === c ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : u);
11
+ return /* @__PURE__ */ p(t, { ...a, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, m) : null });
12
12
  }
13
- return /* @__PURE__ */ p(t, { ...c, ref: r, children: i });
13
+ return /* @__PURE__ */ p(t, { ...a, ref: r, children: i });
14
14
  });
15
- return n.displayName = `${e}.Slot`, n;
15
+ return o.displayName = `${e}.Slot`, o;
16
16
  }
17
- var _ = /* @__PURE__ */ g("Slot");
17
+ var x = /* @__PURE__ */ g("Slot");
18
18
  // @__NO_SIDE_EFFECTS__
19
19
  function E(e) {
20
- const t = l.forwardRef((n, o) => {
21
- const { children: r, ...i } = n, c = l.isValidElement(r) ? b(r) : void 0, a = y(c, o);
20
+ const t = l.forwardRef((o, n) => {
21
+ const { children: r, ...i } = o;
22
22
  if (l.isValidElement(r)) {
23
- const s = R(i, r.props);
24
- return r.type !== l.Fragment && (s.ref = a), l.cloneElement(r, s);
23
+ const a = b(r), s = R(i, r.props);
24
+ return r.type !== l.Fragment && (s.ref = n ? y(n, a) : a), l.cloneElement(r, s);
25
25
  }
26
26
  return l.Children.count(r) > 1 ? l.Children.only(null) : null;
27
27
  });
@@ -29,32 +29,32 @@ function E(e) {
29
29
  }
30
30
  var d = Symbol("radix.slottable");
31
31
  // @__NO_SIDE_EFFECTS__
32
- function x(e) {
33
- const t = ({ children: n }) => /* @__PURE__ */ p(S, { children: n });
32
+ function I(e) {
33
+ const t = ({ children: o }) => /* @__PURE__ */ p(S, { children: o });
34
34
  return t.displayName = `${e}.Slottable`, t.__radixId = d, t;
35
35
  }
36
36
  function C(e) {
37
37
  return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === d;
38
38
  }
39
39
  function R(e, t) {
40
- const n = { ...t };
41
- for (const o in t) {
42
- const r = e[o], i = t[o];
43
- /^on[A-Z]/.test(o) ? r && i ? n[o] = (...a) => {
44
- const s = i(...a);
45
- return r(...a), s;
46
- } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
40
+ const o = { ...t };
41
+ for (const n in t) {
42
+ const r = e[n], i = t[n];
43
+ /^on[A-Z]/.test(n) ? r && i ? o[n] = (...s) => {
44
+ const c = i(...s);
45
+ return r(...s), c;
46
+ } : r && (o[n] = r) : n === "style" ? o[n] = { ...r, ...i } : n === "className" && (o[n] = [r, i].filter(Boolean).join(" "));
47
47
  }
48
- return { ...e, ...n };
48
+ return { ...e, ...o };
49
49
  }
50
50
  function b(e) {
51
- var o, r;
52
- let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
53
- return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
51
+ var n, r;
52
+ let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = t && "isReactWarning" in t && t.isReactWarning;
53
+ return o ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, o = t && "isReactWarning" in t && t.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
54
54
  }
55
55
  export {
56
- _ as Root,
57
- _ as Slot,
56
+ x as Root,
57
+ x as Slot,
58
58
  g as createSlot,
59
- x as createSlottable
59
+ I as createSlottable
60
60
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { s as e } from "../../../../_virtual/index3.js";
2
+ import { s as e } from "../../../../_virtual/index.js";
3
3
  function s() {
4
4
  return e.useSyncExternalStore(
5
5
  r,
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { a as pe } from "./chunk-NZJY6EH4.js";
3
- import { Root as ge, Portal as he, Overlay as be, Content as Ee } from "../../@radix-ui/react-dialog/dist/index.js";
3
+ import { Root as ge, Portal as he, Overlay as be, Content as Ee } from "../node_modules/@radix-ui/react-dialog/dist/index.js";
4
4
  import * as n from "react";
5
- import { Primitive as I } from "../../@radix-ui/react-primitive/dist/index.js";
5
+ import { Primitive as I } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
6
6
  import { useId as K } from "../../@radix-ui/react-id/dist/index.js";
7
7
  import { composeRefs as q } from "../../@radix-ui/react-compose-refs/dist/index.js";
8
8
  var $ = '[cmdk-group=""]', X = '[cmdk-group-items=""]', ye = '[cmdk-group-heading=""]', oe = '[cmdk-item=""]', ie = `${oe}:not([aria-disabled="true"])`, Y = "cmdk-item-select", D = "data-value", Ce = (t, a, r) => pe(t, a, r), ce = n.createContext(void 0), O = () => n.useContext(ce), de = n.createContext(void 0), Z = () => n.useContext(de), se = n.createContext(void 0), fe = n.forwardRef((t, a) => {