@g4rcez/components 2.0.16 → 2.0.18

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 (50) hide show
  1. package/dist/components/core/button.d.ts +1 -1
  2. package/dist/components/core/button.d.ts.map +1 -1
  3. package/dist/components/core/polymorph.d.ts +7 -6
  4. package/dist/components/core/polymorph.d.ts.map +1 -1
  5. package/dist/components/core/polymorph.js +1 -2
  6. package/dist/components/core/tag.d.ts +1 -1
  7. package/dist/components/core/tag.d.ts.map +1 -1
  8. package/dist/components/core/tag.js +1 -1
  9. package/dist/components/core/typography.d.ts +24 -0
  10. package/dist/components/core/typography.d.ts.map +1 -0
  11. package/dist/components/core/typography.js +10 -0
  12. package/dist/components/display/alert.d.ts.map +1 -1
  13. package/dist/components/display/alert.js +2 -2
  14. package/dist/components/display/card.d.ts +15 -15
  15. package/dist/components/display/card.d.ts.map +1 -1
  16. package/dist/components/display/card.js +3 -3
  17. package/dist/components/display/skeleton.d.ts +7 -0
  18. package/dist/components/display/skeleton.d.ts.map +1 -1
  19. package/dist/components/display/skeleton.js +10 -1
  20. package/dist/components/display/spinner.d.ts +5 -0
  21. package/dist/components/display/spinner.d.ts.map +1 -0
  22. package/dist/components/display/spinner.js +6 -0
  23. package/dist/components/floating/modal.d.ts +2 -2
  24. package/dist/components/floating/modal.d.ts.map +1 -1
  25. package/dist/components/floating/modal.js +2 -4
  26. package/dist/components/form/date-picker.d.ts.map +1 -1
  27. package/dist/components/form/date-picker.js +5 -3
  28. package/dist/components/form/multi-select.js +1 -1
  29. package/dist/components/form/select.js +1 -1
  30. package/dist/components/table/index.d.ts +2 -0
  31. package/dist/components/table/index.d.ts.map +1 -1
  32. package/dist/components/table/inner-table.d.ts +2 -1
  33. package/dist/components/table/inner-table.d.ts.map +1 -1
  34. package/dist/components/table/inner-table.js +12 -5
  35. package/dist/config/default-translations.d.ts +1 -0
  36. package/dist/config/default-translations.d.ts.map +1 -1
  37. package/dist/config/default-translations.js +1 -0
  38. package/dist/flow/flow.d.ts.map +1 -1
  39. package/dist/flow/flow.js +2 -2
  40. package/dist/hooks/use-translations.d.ts +1 -0
  41. package/dist/hooks/use-translations.d.ts.map +1 -1
  42. package/dist/index.css +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/index.mjs +5635 -5624
  45. package/dist/index.mjs.map +1 -1
  46. package/dist/index.umd.js +53 -53
  47. package/dist/index.umd.js.map +1 -1
  48. package/dist/lib/fns.d.ts.map +1 -1
  49. package/dist/lib/fns.js +16 -9
  50. package/package.json +1 -1
@@ -78,6 +78,6 @@ export type ButtonProps<T extends React.ElementType = "button"> = PropsWithChild
78
78
  * @param ref - Forwarded ref to the button element
79
79
  * @returns A styled button component
80
80
  */
81
- export declare const Button: <T extends React.ElementType = "button">(props: ButtonProps<T>) => React.ReactNode;
81
+ export declare const Button: <T extends React.ElementType = "button">(_: ButtonProps<T>) => React.ReactNode;
82
82
  export {};
83
83
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/core/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCb,CAAC;AAeF,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,iBAAiB,CAC/E,gBAAgB,CAAC,QAAQ,GAAG,OAAO,CAAC;IAChC,oCAAoC;IACpC,IAAI,EAAE,KAAK,CAAC;IACZ,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAA;CACnB,CAAC,EAAE,CAAC,CAAC,CACT,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAwB5F,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/core/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;GAGG;AACH,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCb,CAAC;AAeF,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,iBAAiB,CAC/E,gBAAgB,CAAC,QAAQ,GAAG,OAAO,CAAC;IAChC,oCAAoC;IACpC,IAAI,EAAE,KAAK,CAAC;IACZ,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAA;CACnB,CAAC,EAAE,CAAC,CAAC,CACT,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAwBjF,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import type React from "react";
2
- import { Merge, Override } from "../../types";
3
- type TransformProps<E extends React.ElementType = React.ElementType> = Merge<{
4
- as?: E;
5
- } & React.ComponentPropsWithRef<E>>;
6
- export type PolymorphicProps<P extends object, E extends React.ElementType> = Merge<Override<TransformProps<E>, P>>;
7
- export declare const Polymorph: <E extends React.ElementType = React.ElementType>(props: TransformProps<E>) => React.ReactNode;
2
+ type PropsOf<T extends React.ElementType> = React.ComponentPropsWithoutRef<T>;
3
+ export type PolymorphicProps<Props, T extends React.ElementType> = Props & {
4
+ as?: T;
5
+ } & Omit<PropsOf<T>, keyof Props | "as" | "ref"> & {
6
+ ref?: React.ComponentProps<T>["ref"];
7
+ };
8
+ export declare const Polymorph: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
8
9
  export {};
9
10
  //# sourceMappingURL=polymorph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9C,KAAK,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CACxE;IACI,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CACrC,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAIpH,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAKrG,CAAC"}
1
+ {"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,gBAAgB,CAAC,KAAK,EAAE,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,KAAK,GAAG;IACzE,EAAE,CAAC,EAAE,CAAC,CAAC;CACR,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG;IACjD,GAAG,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,SAAS,kFAKrB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- const defaultElement = "span";
4
3
  export const Polymorph = forwardRef(function InnerPolymorph(props, ref) {
5
- const Element = props.as || defaultElement;
4
+ const Element = props.as || "span";
6
5
  return _jsx(Element, { ref: ref, ...props, as: undefined });
7
6
  });
@@ -30,6 +30,6 @@ export type TagProps<T extends React.ElementType = "span"> = PolymorphicProps<Cv
30
30
  loading: boolean;
31
31
  indicator: Themes;
32
32
  }>, T>;
33
- export declare const Tag: <T extends React.ElementType = "span">(props: TagProps<T>) => any;
33
+ export declare const Tag: <T extends React.ElementType = "span">(_: TagProps<T>) => any;
34
34
  export {};
35
35
  //# sourceMappingURL=tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../src/components/core/tag.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE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,OAAO,QAAQ,CAAC,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,EAC5F,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAkBnE,CAAC"}
@@ -44,5 +44,5 @@ const tagVariants = cva("inline-flex rounded-pill gap-1.5 border-0 items-center
44
44
  defaultVariants: { theme: "primary", size: "default" },
45
45
  });
46
46
  export const Tag = forwardRef(function Tag({ className, indicator = undefined, icon, loading, theme, size, ...props }, ref) {
47
- return (_jsxs(Polymorph, { ...props, ref: ref, "data-theme": theme, "data-component": "tag", as: props.as ?? "span", className: css(tagVariants({ size, theme }), className), children: [indicator ? _jsx("span", { "aria-hidden": "true", className: indicatorVariant({ theme: indicator }) }) : null, icon, props.children] }));
47
+ return (_jsxs(Polymorph, { ...props, ref: ref, "data-theme": theme, "data-component": "tag", as: props.as ?? "span", className: css(tagVariants({ size, theme: loading ? "loading" : theme }), className), children: [indicator ? _jsx("span", { "aria-hidden": "true", className: indicatorVariant({ theme: indicator }) }) : null, icon, props.children] }));
48
48
  });
@@ -0,0 +1,24 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import React, { type ComponentProps } from "react";
3
+ import { Label } from "../../types";
4
+ export declare const Paragraph: (props: ComponentProps<"p">) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const Description: (props: ComponentProps<"p">) => import("react/jsx-runtime").JSX.Element;
6
+ export type InfoProps = {
7
+ info?: Label;
8
+ label: Label;
9
+ row?: boolean;
10
+ disabled?: Label;
11
+ className?: string;
12
+ infoDescription?: string;
13
+ };
14
+ export declare const Info: (props: React.PropsWithChildren<InfoProps>) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const PageTitle: (props: PropsWithChildren<{
16
+ title: string;
17
+ }>) => import("react/jsx-runtime").JSX.Element;
18
+ type PageHeaderProps = {
19
+ title: string;
20
+ description: Label;
21
+ };
22
+ export declare const PageHeader: (props: PropsWithChildren<PageHeaderProps>) => import("react/jsx-runtime").JSX.Element;
23
+ export {};
24
+ //# sourceMappingURL=typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/components/core/typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAY,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,CAAC,GAAG,CAAC,4CAEnD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,OAAO,cAAc,CAAC,GAAG,CAAC,4CAErD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,4CAS7D,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,4CAKpE,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,KAAK,CAAC;CACtB,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,OAAO,iBAAiB,CAAC,eAAe,CAAC,4CAWnE,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment } from "react";
3
+ import { css } from "../../lib/dom";
4
+ export const Paragraph = (props) => (_jsx("p", { ...props, className: css("text-base leading-snug", props.className) }));
5
+ export const Description = (props) => (_jsx("p", { ...props, className: css("mb-kilo text-sm text-secondary", props.className) }));
6
+ export const Info = (props) => (_jsx("div", { className: css(`flex ${props.row ? "flex-row items-center" : "flex-col"} gap-1`, props.className), children: _jsxs(Fragment, { children: [_jsx("span", { className: "text-sm font-medium tracking-wide", children: props.row ? `${props.label}:` : props.label }), _jsx("span", { className: `w-fit ${props.disabled ? "text-disabled" : ""} ${props.row ? "text-base" : "text-lg"}`, children: props.children })] }) }));
7
+ export const PageTitle = (props) => (_jsxs("div", { children: [_jsx("h2", { className: "text-3xl font-bold typography tracking-wide", children: props.title }), _jsx("p", { className: "text-secondary typography", children: props.children })] }));
8
+ export const PageHeader = (props) => {
9
+ return (_jsxs("header", { className: "flex flex-row flex-wrap justify-between items-center gap-mega", children: [_jsx("div", { children: _jsx(PageTitle, { title: props.title, children: props.description }) }), _jsx("div", { className: "flex gap-kilo items-center", children: props.children })] }));
10
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAahE,KAAK,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,4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,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACF,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GA6CxE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cva } from "class-variance-authority";
4
- import { motion } from "motion/react";
4
+ import { AnimatePresence, motion } from "motion/react";
5
5
  import { CheckCircleIcon, InfoIcon, TriangleAlertIcon, XIcon } from "lucide-react";
6
6
  import { forwardRef } from "react";
7
7
  import { css } from "../../lib/dom";
@@ -33,5 +33,5 @@ const alertVariants = cva("p-4 w-full block border relative rounded-lg text-sm",
33
33
  });
34
34
  export const Alert = forwardRef(function Alert({ className, theme, Icon, onClose, open = true, ...props }, ref) {
35
35
  const close = () => onClose?.(false);
36
- return (_jsx("div", { "data-open": !!open, "aria-hidden": !open, "data-component": "alert", className: css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none"), children: _jsx(Collapse, { "data-open": !!open, open: !!open, children: _jsxs(Polymorph, { ...props, ref: ref, role: "alert", "data-theme": theme, as: props.as ?? "div", className: css(alertVariants({ theme }), className), children: [_jsxs("h4", { className: "mb-2 flex items-center gap-2", children: [!Icon && theme === "success" ? _jsx(CheckCircleIcon, { "aria-hidden": "true", size: 20 }) : null, !Icon && theme === "info" ? _jsx(InfoIcon, { "aria-hidden": "true", size: 20 }) : null, !Icon && theme === "danger" ? _jsx(TriangleAlertIcon, { "aria-hidden": "true", size: 20 }) : null, Icon, _jsx("span", { className: "tracking-3 text-balance text-lg font-semibold", children: props.title })] }), props.children, onClose !== undefined && open ? (_jsx("button", { type: "button", onClick: close, className: "absolute right-3 top-3 text-foreground transition-colors duration-300 ease-in-out hover:text-danger", children: _jsx(XIcon, { size: 20 }) })) : null] }) }) }));
36
+ return (_jsx(AnimatePresence, { presenceAffectsLayout: true, propagate: true, mode: "sync", children: open ? _jsx(motion.div, { "data-open": !!open, "aria-hidden": !open, "data-component": "alert", className: css("isolate w-full", open ? "pointer-events-auto" : "pointer-events-none"), children: _jsx(Collapse, { "data-open": !!open, open: !!open, children: _jsxs(Polymorph, { ...props, ref: ref, role: "alert", "data-theme": theme, as: props.as ?? "div", className: css(alertVariants({ theme }), className), children: [_jsxs("h4", { className: "flex gap-2 items-center mb-2", children: [!Icon && theme === "success" ? _jsx(CheckCircleIcon, { "aria-hidden": "true", size: 20 }) : null, !Icon && theme === "info" ? _jsx(InfoIcon, { "aria-hidden": "true", size: 20 }) : null, !Icon && theme === "danger" ? _jsx(TriangleAlertIcon, { "aria-hidden": "true", size: 20 }) : null, Icon, _jsx("span", { className: "text-lg font-semibold tracking-3 text-balance", children: props.title })] }), props.children, onClose !== undefined && open ? (_jsx("button", { type: "button", onClick: close, className: "absolute top-3 right-3 transition-colors duration-300 ease-in-out text-foreground hover:text-danger", children: _jsx(XIcon, { size: 20 }) })) : null] }) }) }) : null }));
37
37
  });
@@ -1,16 +1,16 @@
1
- import React, { PropsWithChildren } from "react";
2
- import { Label, Override } from "../../types";
3
- import { PolymorphicProps } from "../core/polymorph";
4
1
  import { LucideIcon } from "lucide-react";
5
- export type CardProps = PolymorphicProps<Override<React.ComponentProps<"div">, Partial<{
6
- title: Label;
7
- loading: boolean;
8
- container: string;
9
- titleClassName: string;
10
- header: React.ReactElement | null;
11
- }>>, "div">;
2
+ import React, { type PropsWithChildren } from "react";
3
+ import { Label } from "../../types";
4
+ import { PolymorphicProps } from "../core/polymorph";
5
+ export type CardProps<T extends React.ElementType> = PolymorphicProps<{
6
+ title?: Label;
7
+ loading?: boolean;
8
+ container?: string;
9
+ titleClassName?: string;
10
+ header?: React.ReactElement | null;
11
+ }, T>;
12
12
  export declare const Card: {
13
- ({ children, title, titleClassName, as, container, header, className, loading, ...props }: PropsWithChildren<CardProps>): import("react/jsx-runtime").JSX.Element;
13
+ <T extends React.ElementType = "div">({ title, loading, children, as, header, container, titleClassName, ...props }: PropsWithChildren<CardProps<T>>): import("react/jsx-runtime").JSX.Element;
14
14
  Title({ as, titleTag, navTag, children, ...props }: PropsWithChildren<CardHeaderTitleProps>): import("react/jsx-runtime").JSX.Element;
15
15
  };
16
16
  export type CardHeaderTitleProps<T extends React.ElementType = "div"> = PolymorphicProps<{
@@ -18,12 +18,12 @@ export type CardHeaderTitleProps<T extends React.ElementType = "div"> = Polymorp
18
18
  titleTag?: React.ElementType;
19
19
  title: React.ReactElement | string;
20
20
  }, T>;
21
- export declare const StatsCard: (props: PolymorphicProps<{
22
- Icon: LucideIcon;
21
+ export type StatsCardProps = CardProps<React.ElementType> & {
22
+ Icon?: LucideIcon;
23
23
  title: string;
24
24
  value: Label;
25
- href?: string;
26
25
  mark?: string;
27
26
  interactive?: boolean;
28
- }, "div">) => import("react/jsx-runtime").JSX.Element;
27
+ };
28
+ export declare const StatsCard: (props: StatsCardProps) => import("react/jsx-runtime").JSX.Element;
29
29
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/display/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAY,UAAU,EAAE,MAAM,cAAc,CAAC;AAGpD,MAAM,MAAM,SAAS,GAAG,gBAAgB,CACpC,QAAQ,CACJ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,OAAO,CAAC;IACJ,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WAAW,IAAI,gBAAgB,CACjE;IACI,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CACtC,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,IAAI;KAAI,CAAC,SAAS,KAAK,CAAC,WAAW,yFAS7C,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;wDAuC0B,iBAAiB,CAAC,oBAAoB,CAAC;CAXlG,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CACpF;IACI,MAAM,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;CACtC,EACD,CAAC,CACJ,CAAC;AAoBF,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG;IACxD,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CACvF,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,4CAuB9C,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { InfoIcon } from "lucide-react";
2
3
  import { Is } from "sidekicker";
3
4
  import { css } from "../../lib/dom";
4
5
  import { Polymorph } from "../core/polymorph";
5
- import { InfoIcon } from "lucide-react";
6
6
  import { Skeleton } from "./skeleton";
7
- export const Card = ({ children, title, titleClassName = "", as = "div", container = "", header = null, className = "", loading, ...props }) => (_jsxs(Polymorph, { ...props, as: as, "data-component": "card", className: css("flex shadow-shadow-card flex-col gap-4 rounded-card border border-card-border bg-card-background py-4 pb-5", container), children: [title ? (_jsx("header", { "data-component": "card-title", className: css("mb-2 w-full border-b border-card-border px-4 pb-4 text-xl font-medium lg:px-8", titleClassName), children: title })) : (header), _jsx("div", { "data-component": "card-body", className: css("min-w-full px-4 lg:px-8", className), children: loading ? (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Skeleton, { className: "w-full" }), _jsx(Skeleton, { className: "w-8/12" }), _jsx(Skeleton, { className: "w-10/12" }), _jsx(Skeleton, { className: "w-1/2" })] })) : children })] }));
7
+ export const Card = ({ title, loading, children, as, header = null, container = "", titleClassName = "", ...props }) => (_jsxs(Polymorph, { ...props, as: as || "div", "data-component": "card", className: css("flex shadow-shadow-card flex-col gap-4 rounded-card border border-card-border bg-card-background w-full py-4 pb-5", container), children: [title ? (_jsx("header", { "data-component": "card-title", className: css("mb-2 w-full border-b border-card-border px-4 pb-4 text-xl font-medium lg:px-8", titleClassName), children: title })) : (header), _jsx("div", { "data-component": "card-body", className: css("min-w-full px-4 lg:px-8", props.className), children: loading ? (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Skeleton, { className: "w-full" }), _jsx(Skeleton, { className: "w-8/12" }), _jsx(Skeleton, { className: "w-10/12" }), _jsx(Skeleton, { className: "w-1/2" })] })) : children })] }));
8
8
  Card.Title = ({ as, titleTag, navTag, children, ...props }) => {
9
9
  const Component = (as || "div");
10
10
  const Title = (titleTag || "h2");
@@ -14,5 +14,5 @@ Card.Title = ({ as, titleTag, navTag, children, ...props }) => {
14
14
  export const StatsCard = (props) => {
15
15
  const interactive = props.interactive ?? true;
16
16
  const Icon = props.Icon ?? InfoIcon;
17
- return (_jsx(Card, { ...props, title: null, container: "px-0 py-0", className: "flex gap-4 items-center px-0 lg:px-0", children: _jsxs("div", { className: `flex w-full items-center gap-4 rounded-card px-0 lg:px-0 ${interactive ? "transition-colors duration-300 ease-linear hover:bg-primary-hover/10" : ""}`, children: [_jsx("div", { className: css("flex aspect-square h-[stretch] w-20 items-center justify-center rounded-l-card bg-primary p-4 text-primary-foreground", props.mark), children: _jsx(Icon, { size: 48 }) }), _jsxs("div", { className: "flex flex-col gap-2 justify-center py-2", children: [_jsx("p", { className: "text-lg", children: props.title }), _jsx("p", { className: "text-4xl font-bold tracking-wide", children: props.value })] })] }) }));
17
+ return (_jsx(Card, { ...props, title: null, loading: undefined, container: "px-0 py-0", className: "flex gap-4 items-center px-0 lg:px-0", children: _jsxs("div", { className: `flex w-full items-center gap-4 rounded-card px-0 lg:px-0 ${interactive ? "transition-colors duration-300 ease-linear hover:bg-primary-hover/10" : ""}`, children: [_jsx("div", { className: css("flex aspect-square h-[stretch] w-20 items-center justify-center rounded-l-card bg-primary p-4 text-primary-foreground", props.mark), children: _jsx(Icon, { size: 48 }) }), _jsxs("div", { className: "flex flex-col gap-2 justify-center py-2", children: [_jsx("p", { className: "text-lg", children: props.title }), props.loading ? _jsx(Skeleton, { className: "h-10" }) : _jsx("p", { className: "text-4xl font-bold tracking-wide", children: props.value })] })] }) }));
18
18
  };
@@ -1,5 +1,12 @@
1
+ import { CSSProperties, type ElementType } from "react";
1
2
  export declare const SkeletonCell: import("react/jsx-runtime").JSX.Element;
2
3
  export declare const Skeleton: (props: {
3
4
  className?: string;
5
+ as?: ElementType;
6
+ style?: CSSProperties;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const SkeletonList: (props: {
9
+ className?: string;
10
+ rows: number;
4
11
  }) => import("react/jsx-runtime").JSX.Element;
5
12
  //# sourceMappingURL=skeleton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/display/skeleton.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,yCAAiE,CAAC;AAE3F,eAAO,MAAM,QAAQ,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,4CAErD,CAAC"}
1
+ {"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/display/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAU,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIvE,eAAO,MAAM,YAAY,yCAAiE,CAAC;AAE3F,eAAO,MAAM,QAAQ,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,4CAE9F,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,4CAUvE,CAAA"}
@@ -1,4 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from "react";
2
3
  import { css } from "../../lib/dom";
4
+ import { Polymorph } from "../core/polymorph";
3
5
  export const SkeletonCell = _jsx("div", { className: "w-10/12 h-6 rounded animate-pulse bg-muted" });
4
- export const Skeleton = (props) => (_jsx("span", { className: css("block rounded h-8 w-32 animate-pulse bg-muted", props.className) }));
6
+ export const Skeleton = (props) => (_jsx(Polymorph, { ...props, as: props.as || "span", className: css("block rounded h-8 w-32 animate-pulse bg-muted", props.className) }));
7
+ export const SkeletonList = (props) => {
8
+ const items = useRef(Array.from({ length: props.rows }).map((_, i) => {
9
+ const rand = Math.max(100, Math.random() * 99);
10
+ return _jsx(Skeleton, { style: { width: `${rand}%` }, as: "li" }, `skeleton-${rand}-${i}`);
11
+ }));
12
+ return (_jsx("ul", { className: css("flex flex-col gap-6", props.className), children: items.current }));
13
+ };
@@ -0,0 +1,5 @@
1
+ export declare const Spinner: (props: {
2
+ className?: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const Loading: () => import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/display/spinner.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,4CASpD,CAAC;AAEF,eAAO,MAAM,OAAO,+CAMnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { css } from "../../lib/dom";
3
+ export const Spinner = (props) => (_jsx("span", { "aria-busy": "true", "aria-description": "Carregando...", className: css("box-border inline-block aspect-square size-12 animate-spin rounded-full border-4 border-background border-b-primary", props.className) }));
4
+ export const Loading = () => {
5
+ return (_jsx("div", { className: "flex h-full w-full items-center justify-center p-12", children: _jsx(Spinner, {}) }));
6
+ };
@@ -35,7 +35,7 @@ type ModalRef = {
35
35
  context: any;
36
36
  floating: HTMLElement | null;
37
37
  };
38
- export declare const Modal: React.ForwardRefExoticComponent<(Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "type" | "className" | "role" | "onChange" | "layoutId" | "open" | "position" | "resizer" | "asChild" | "closable" | "animated" | "forceType" | "bodyClassName" | "overlayClassName" | "overlayClickClose" | "interactions" | "trigger" | "ariaTitle"> & {
38
+ export declare const Modal: React.ForwardRefExoticComponent<(Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "className" | "role" | "onChange" | "type" | "layoutId" | "open" | "position" | "resizer" | "asChild" | "closable" | "animated" | "forceType" | "bodyClassName" | "overlayClassName" | "overlayClickClose" | "interactions" | "trigger" | "ariaTitle"> & {
39
39
  title: Label;
40
40
  ariaTitle?: string;
41
41
  } & {
@@ -60,7 +60,7 @@ export declare const Modal: React.ForwardRefExoticComponent<(Omit<Omit<HTMLMotio
60
60
  trigger: Label | React.FC<any>;
61
61
  }> & {
62
62
  children?: React.ReactNode | undefined;
63
- }, "ref"> | Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "type" | "className" | "role" | "onChange" | "layoutId" | "open" | "position" | "resizer" | "asChild" | "closable" | "animated" | "forceType" | "bodyClassName" | "overlayClassName" | "overlayClickClose" | "interactions" | "trigger" | "ariaTitle"> & {
63
+ }, "ref"> | Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "className" | "role" | "onChange" | "type" | "layoutId" | "open" | "position" | "resizer" | "asChild" | "closable" | "animated" | "forceType" | "bodyClassName" | "overlayClassName" | "overlayClickClose" | "interactions" | "trigger" | "ariaTitle"> & {
64
64
  ariaTitle: string;
65
65
  title?: Label;
66
66
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AACA,OAAO,EASH,KAAK,YAAY,EACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAmB,eAAe,EAAmF,MAAM,cAAc,CAAC;AAEjJ,OAAO,KAA+G,MAAM,OAAO,CAAC;AAIpI,OAAO,EAAE,KAAK,EAAO,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMnD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAuD9C,MAAM,MAAM,UAAU,GAAG,QAAQ,CAC7B,eAAe,CAAC,KAAK,CAAC,EACtB,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAAG;IAC5E,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,GAAG,OAAO,CAAC;IACR,MAAM,EAAE,KAAK,CAAC;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,CAAC;IACzB,QAAQ,EAAE,cAAc,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CAClC,CAAC,CACL,CAAC;AAgFF,KAAK,QAAQ,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,CAAC;AAI/D,eAAO,MAAM,KAAK;WAzGJ,KAAK;gBAAc,MAAM;;UACzB,OAAO;cACH,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;;YAE9B,KAAK;UACP,SAAS;cACL,OAAO;aACR,OAAO;cACN,MAAM;aACP,OAAO;eACL,MAAM;cACP,OAAO;eACN,OAAO;mBACH,MAAM;sBACH,MAAM;cACd,cAAc;uBACL,OAAO;UACpB,QAAQ,GAAG,SAAS;kBACZ,YAAY,EAAE;aACnB,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC;;;;eAnBmB,MAAM;YAAU,KAAK;;UAChE,OAAO;cACH,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;;YAE9B,KAAK;UACP,SAAS;cACL,OAAO;aACR,OAAO;cACN,MAAM;aACP,OAAO;eACL,MAAM;cACP,OAAO;eACN,OAAO;mBACH,MAAM;sBACH,MAAM;cACd,cAAc;uBACL,OAAO;UACpB,QAAQ,GAAG,SAAS;kBACZ,YAAY,EAAE;aACnB,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC;;;2CA6UrC,CAAC"}
@@ -7,7 +7,6 @@ import { AnimatePresence, motion, MotionConfig, useMotionValue } from "motion/re
7
7
  import { Slot as RadixSlot } from "radix-ui";
8
8
  import { forwardRef, Fragment, useEffect, useId, useImperativeHandle, useRef } from "react";
9
9
  import { useMediaQuery } from "../../hooks/use-media-query";
10
- import { useRemoveScroll } from "../../hooks/use-remove-scroll";
11
10
  import { css, mergeRefs } from "../../lib/dom";
12
11
  const Slot = RadixSlot.Slot;
13
12
  const animationDuration = "500ms";
@@ -94,7 +93,7 @@ const fetchPosition = (isDesktop, forceType, propsType, propsPosition) => {
94
93
  const noop = [];
95
94
  export const Modal = forwardRef(({ open, title, footer, asChild, trigger, children, onChange, ariaTitle, className, bodyClassName, resizer = true, animated = true, closable = true, forceType = false, layoutId = undefined, overlayClassName = "", type: _type = "dialog", position: propsPosition, overlayClickClose = false, role: roleName = "dialog", interactions: outInteractions = noop, ...props }, externalRef) => {
96
95
  const innerContent = useRef(null);
97
- const removeScrollRef = useRemoveScroll(open, "block-only");
96
+ const removeScrollRef = useRef(null);
98
97
  const headingId = useId();
99
98
  const descriptionId = useId();
100
99
  const isDesktop = useMediaQuery("(min-width: 64rem)");
@@ -123,7 +122,6 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
123
122
  const result = Math.abs(v - info.delta.y);
124
123
  const max = window.outerHeight;
125
124
  const screenHeightToClose = calculateClose(max);
126
- console.log({ max, result, v, screenHeightToClose });
127
125
  if (result >= screenHeightToClose)
128
126
  return floatingSize.set(result);
129
127
  if (document.activeElement instanceof HTMLElement) {
@@ -168,7 +166,7 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
168
166
  } : { animate: animated, initial: false };
169
167
  const scrollInitial = useMotionValue(undefined);
170
168
  const scroll = useMotionValue(undefined);
171
- return (_jsxs(Fragment, { children: [trigger ? (_jsx(Fragment, { children: asChild ? (_jsx(Slot, { ref: floating.refs.setReference, ...interactions.getReferenceProps({ layoutId: layoutId }), children: Trigger })) : (_jsx(motion.button, { ref: floating.refs.setReference, ...interactions.getReferenceProps(), layoutId: layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(AnimatePresence, { propagate: true, mode: "wait", initial: false, children: open ? (_jsx(FloatingOverlay, { lockScroll: true, className: css("inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70", type === "drawer" ? "" : "flex items-start justify-center p-10", overlayClassName), children: _jsx(MotionConfig, { reducedMotion: animated ? "user" : "always", children: _jsx(FloatingFocusManager, { guards: true, visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: floating.context, children: _jsxs(motion.div, { ...props, ...(title
169
+ return (_jsxs(Fragment, { children: [trigger ? (_jsx(Fragment, { children: asChild ? (_jsx(Slot, { ref: floating.refs.setReference, ...interactions.getReferenceProps({ layoutId: layoutId }), children: Trigger })) : (_jsx(motion.button, { ref: floating.refs.setReference, ...interactions.getReferenceProps(), layoutId: layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(AnimatePresence, { presenceAffectsLayout: true, propagate: true, mode: "wait", initial: false, children: open ? (_jsx(FloatingOverlay, { lockScroll: true, className: css("inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70", type === "drawer" ? "" : "flex items-start justify-center p-10", overlayClassName), children: _jsx(MotionConfig, { reducedMotion: animated ? "user" : "always", children: _jsx(FloatingFocusManager, { guards: true, visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: floating.context, children: _jsxs(motion.div, { ...props, ...(title
172
170
  ? {
173
171
  "aria-labelledby": headingId,
174
172
  "aria-describedby": descriptionId,
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAY,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAS,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,GAAG;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC,EAAE,UAAU,CAAC,CAAA;AAiDf,eAAO,MAAM,UAAU,uGAyHtB,CAAC"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoE,MAAM,OAAO,CAAC;AAIzF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAY,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAS,UAAU,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,aAAa,GAAG;IACpE,YAAY,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC,EAAE,UAAU,CAAC,CAAA;AAkDf,eAAO,MAAM,UAAU,uGA2HtB,CAAC"}
@@ -57,7 +57,9 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
57
57
  const [innerDate, setInnerDate] = useState(date || undefined);
58
58
  const [open, setOpen] = useState(false);
59
59
  const mask = formatParts(datetimeFormat, fixedDate).flatMap((x) => (Is.keyof(parts, x.type) ? parts[x.type](x.value) : []));
60
- const placeholder = formatParts(datetimeFormat, fixedDate).reduce((acc, x) => acc + (Is.keyof(placeholders, x.type) ? placeholders[x.type](x.value) : ""), "");
60
+ const placeholder = useMemo(() => {
61
+ return formatParts(datetimeFormat, fixedDate).reduce((acc, x) => acc + (Is.keyof(placeholders, x.type) ? placeholders[x.type](x.value) : ""), "");
62
+ }, [datetimeFormat]);
61
63
  const isoDateEffect = date?.toISOString();
62
64
  const [value, setValue] = useState(!innerDate
63
65
  ? ""
@@ -85,7 +87,7 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
85
87
  setInnerDate(date);
86
88
  setValue(format(date, placeholder));
87
89
  }
88
- }, [isoDateEffect]);
90
+ }, [isoDateEffect, placeholder]);
89
91
  const onChangeDate = (d) => {
90
92
  setInnerDate(d);
91
93
  onChange?.(d);
@@ -97,5 +99,5 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
97
99
  };
98
100
  const validDate = isValid(innerDate);
99
101
  const htmlValue = validDate ? innerDate.toISOString() : undefined;
100
- return (_jsx(Input, { ...props, mask: mask, value: value, id: undefined, name: undefined, "data-value": htmlValue, formNoValidate: !open, "data-target": props.name, "data-component": "date-picker", onChange: onChangeDateInput, required: props.required ?? true, error: open ? undefined : props.error, placeholder: props.placeholder || placeholder, right: _jsxs(Fragment, { children: [_jsx("input", { "data-origin": props.name, defaultValue: htmlValue, form: props.form, hidden: true, id: props.name, name: props.name, ref: externalRef, type: "date" }), _jsx(Dropdown, { open: open, onChange: setOpen, buttonProps: { "aria-describedby": labelId }, trigger: _jsxs("span", { "aria-labelledby": labelId, children: [_jsx("span", { id: labelId, className: "sr-only", children: translation.datePickerCalendarButtonLabel }), _jsx(CalendarIcon, {})] }), children: _jsx(Calendar, { ...props, type: type, locale: locale, changeOnlyOnClick: true, markToday: markToday, onChange: onChangeDate, disabledDate: disabledDate, date: validDate ? innerDate : undefined }) })] }) }));
102
+ return (_jsx(Input, { ...props, mask: mask, value: value, id: undefined, name: undefined, "data-value": htmlValue, formNoValidate: !open, "data-target": props.name, "data-component": "date-picker", onChange: onChangeDateInput, required: props.required ?? true, error: open ? undefined : props.error, placeholder: props.placeholder || translation.datepickerPlaceholder(placeholder), right: _jsxs(Fragment, { children: [_jsx("input", { "data-origin": props.name, defaultValue: htmlValue, form: props.form, hidden: true, id: props.name, name: props.name, ref: externalRef, type: "date" }), _jsx(Dropdown, { open: open, onChange: setOpen, buttonProps: { "aria-describedby": labelId }, trigger: _jsxs("span", { "aria-labelledby": labelId, children: [_jsx("span", { id: labelId, className: "sr-only", children: translation.datePickerCalendarButtonLabel }), _jsx(CalendarIcon, {})] }), children: _jsx(Calendar, { ...props, type: type, locale: locale, changeOnlyOnClick: true, markToday: markToday, onChange: onChangeDate, disabledDate: disabledDate, date: validDate ? innerDate : undefined }) })] }) }));
101
103
  });
@@ -210,7 +210,7 @@ export const MultiSelect = forwardRef(({ left, error, right, options, container,
210
210
  id: `${id}-shadow`,
211
211
  name: `${id}-shadow`,
212
212
  ref: refs.setReference,
213
- }), tabIndex: 0, role: "button", "data-name": id, "data-target": id, "data-shadow": "true", "data-error": !!error, "aria-autocomplete": "list", "data-value": values.join(","), className: css("input placeholder-input-mask group h-input-height w-full", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "group-focus-within:border-primary group-hover:border-primary", "flex flex-row items-center gap-2 whitespace-nowrap text-left", "max-w-full overflow-x-auto truncate overflow-ellipsis", props.className), children: [values.length > 0 ? null : _jsx("li", { className: "text-input-placeholder", children: props.placeholder }), _jsx(OverflowControl, { label: selectedLabel, children: tags })] }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || values || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingOverlay, { lockScroll: true, children: _jsx(FloatingFocusManager, { modal: true, guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs("div", { ...getFloatingProps({
213
+ }), tabIndex: 0, role: "button", "data-name": id, "data-target": id, "data-shadow": "true", "data-error": !!error, "aria-autocomplete": "list", "data-value": values.join(","), className: css("input text-base placeholder-input-mask group h-input-height w-full", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "group-focus-within:border-primary group-hover:border-primary", "flex flex-row items-center gap-2 whitespace-nowrap text-left", "max-w-full overflow-x-auto truncate overflow-ellipsis", props.className), children: [values.length > 0 ? null : _jsx("li", { className: "text-input-placeholder", children: props.placeholder }), _jsx(OverflowControl, { label: selectedLabel, children: tags })] }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || values || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingOverlay, { lockScroll: true, children: _jsx(FloatingFocusManager, { modal: true, guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs("div", { ...getFloatingProps({
214
214
  ref: refs.setFloating,
215
215
  style: {
216
216
  ...transitions.styles,
@@ -27,5 +27,5 @@ export const Select = forwardRef(({ required = true, options, info, selectContai
27
27
  };
28
28
  }, []);
29
29
  const onClickLabel = () => inputRef.current?.focus();
30
- return (_jsx(InputField, { info: info, left: left, error: error, form: props.form, loading: loading, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, componentName: "select", rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("label", { htmlFor: id, children: [right, _jsxs("button", { onClick: onClickLabel, type: "button", className: "mt-2 transition-colors hover:text-primary", children: [_jsx(ChevronDownIcon, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] })] }), children: _jsxs("select", { ...props, id: id, name: id, required: required, ref: mergeRefs(ref, inputRef), "data-selected": !!props.value || false, title: typeof props.title === "string" ? props.title : undefined, className: css("input select group h-10 w-full flex-1 appearance-none rounded-md", "bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder", "outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error", "data-[selected=false]:text-input-placeholder", props.className), children: [_jsx("option", { value: "", disabled: true, hidden: true, children: props.placeholder }), options.map((option) => (_createElement("option", { ...option, value: option.value, children: option.label ?? option.value, key: `${id}-select-option-${option.value}` })))] }) }));
30
+ return (_jsx(InputField, { info: info, left: left, error: error, form: props.form, loading: loading, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, componentName: "select", rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("label", { htmlFor: id, children: [right, _jsxs("button", { onClick: onClickLabel, type: "button", className: "mt-2 transition-colors hover:text-primary", children: [_jsx(ChevronDownIcon, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] })] }), children: _jsxs("select", { ...props, id: id, name: id, required: required, ref: mergeRefs(ref, inputRef), "data-selected": !!props.value || false, title: typeof props.title === "string" ? props.title : undefined, className: css("input select group text-base h-10 w-full flex-1 appearance-none rounded-md", "bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder", "outline-none transition-colors group-error:text-danger group-error:placeholder-input-mask-error", "data-[selected=false]:text-input-placeholder", props.className), children: [_jsx("option", { value: "", disabled: true, hidden: true, children: props.placeholder }), options.map((option) => (_createElement("option", { ...option, value: option.value, children: option.label ?? option.value, key: `${id}-select-option-${option.value}` })))] }) }));
31
31
  });
@@ -1,3 +1,4 @@
1
+ import { ComponentProps } from "react";
1
2
  import { Any } from "../../types";
2
3
  import { InnerTableProps } from "./inner-table";
3
4
  import { TableOperationProps } from "./table-lib";
@@ -13,6 +14,7 @@ export type TableProps<T extends Any> = Pick<InnerTableProps<T>, "cols" | "rows"
13
14
  sticky: number | null;
14
15
  onScrollEnd: () => void;
15
16
  getScrollRef?: () => HTMLElement | undefined;
17
+ getRowProps: (row: T) => ComponentProps<"tr">;
16
18
  }>;
17
19
  export declare const Table: <T extends Any>(props: TableProps<T>) => import("react/jsx-runtime").JSX.Element;
18
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAGlC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAyB,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIz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AAC;IACjB,SAAS,EAAE,MAAM,CAAC,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,cAAc,CAAC,IAAI,CAAC,CAAC;CACjD,CACJ,CAAC;AASF,eAAO,MAAM,KAAK,GAAI,CAAC,SAAS,GAAG,EAAE,OAAO,UAAU,CAAC,CAAC,CAAC,4CAgHxD,CAAC"}
@@ -1,4 +1,4 @@
1
- import React, { HTMLAttributes } from "react";
1
+ import React, { ComponentProps, HTMLAttributes } from "react";
2
2
  import { Any } from "../../types";
3
3
  import { OptionProps } from "../form/select";
4
4
  import { FilterConfig } from "./filter";
@@ -22,6 +22,7 @@ export type InnerTableProps<T extends Any> = HTMLAttributes<HTMLTableElement> &
22
22
  filters?: FilterConfig<T>[];
23
23
  Aside?: React.FC<CellAsideElement<T>>;
24
24
  getScrollRef?: () => HTMLElement | undefined;
25
+ getRowProps?: (_: T) => ComponentProps<"tr">;
25
26
  setGroups: React.Dispatch<React.SetStateAction<GroupItem<T>[]>>;
26
27
  };
27
28
  export declare const InnerTable: <T extends Any>({ cols, filters, setCols, sorters, setFilters, setSorters, onScrollEnd, getScrollRef, border, pagination, useControl, ...props }: InnerTableProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"inner-table.d.ts","sourceRoot":"","sources":["../../../src/components/table/inner-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAA2B,cAAc,EAAwC,MAAM,OAAO,CAAC;AAI7G,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AA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B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,EAAE,WAAW,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,WAAW,GAAG,SAAS,CAAC;IAC7C,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,cAAc,CAAC,IAAI,CAAC,CAAC;IAC7C,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACjE,CAAC;AA8FJ,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,GAAG,EAAE,kIAavC,eAAe,CAAC,CAAC,CAAC,4CA0EpB,CAAC"}
@@ -25,7 +25,9 @@ const Thead = React.forwardRef(({ context, ...props }, ref) => {
25
25
  return (_jsx("thead", { ...props, ref: ref, style: style, role: "rowgroup", className: "hidden top-0 bg-transparent md:table-header-group group:sticky" }));
26
26
  });
27
27
  const TRow = React.forwardRef(({ context, item, ...props }, ref) => {
28
- return (_jsx("tr", { ...props, role: "row", ref: ref, className: `group-table-row pb-4 flex h-fit flex-col flex-wrap justify-center gap-1 md:table-row ${props?.className ?? ""}` }));
28
+ const contextProps = context?.getRowProps?.(item);
29
+ const innerProps = { ...props, ...contextProps };
30
+ return (_jsx("tr", { ...innerProps, role: "row", ref: ref, className: `group-table-row pb-4 flex h-fit flex-col flex-wrap justify-center gap-1 md:table-row ${props?.className ?? ""}` }));
29
31
  });
30
32
  const TFoot = React.forwardRef((props, ref) => {
31
33
  if (props.context.loadingMore) {
@@ -34,16 +36,15 @@ const TFoot = React.forwardRef((props, ref) => {
34
36
  return null;
35
37
  });
36
38
  const components = {
39
+ TableRow: TRow,
40
+ TableFoot: TFoot,
37
41
  TableHead: Thead,
38
42
  Table: VirtualTable,
39
43
  TableBody: TableBody,
40
- TableRow: TRow,
41
- TableFoot: TFoot,
42
44
  };
43
45
  const loadingArray = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
44
46
  const EmptyContent = (props) => (_jsx("div", { className: "flex justify-center items-center px-2 w-full h-48", children: props.loading ? SkeletonCell : _jsx(Empty, {}) }));
45
47
  const EmptyCell = () => _jsx(Fragment, {});
46
- const Frag = () => _jsx(Fragment, {});
47
48
  const emptyRows = [];
48
49
  export const InnerTable = ({ cols, filters, setCols, sorters, setFilters, setSorters, onScrollEnd, getScrollRef, border = true, pagination = null, useControl = false, ...props }) => {
49
50
  const ref = useRef(null);
@@ -80,6 +81,12 @@ export const InnerTable = ({ cols, filters, setCols, sorters, setFilters, setSor
80
81
  return () => observer.disconnect();
81
82
  }, [loadingMoreRef, onScrollEndRef]);
82
83
  const empty = rows.length === 0;
83
- const context = { loading: props.loading, loadingMore: props.loadingMore, cols: cols, Aside: props.Aside };
84
+ const context = {
85
+ cols: cols,
86
+ Aside: props.Aside,
87
+ loading: props.loading,
88
+ getRowProps: props.getRowProps,
89
+ loadingMore: props.loadingMore,
90
+ };
84
91
  return (_jsxs("div", { className: "flex relative flex-col w-full whitespace-nowrap rounded-lg group", children: [_jsx(TableVirtuoso, { context: context, components: components, totalCount: rows.length, itemContent: empty ? EmptyCell : Row, data: empty ? emptyRows : rows, useWindowScroll: getScrollRef ? false : true, customScrollParent: getScrollRef ? getScrollRef() : undefined, fixedHeaderContent: () => (_jsx(TableHeader, { headers: cols, filters: filters, setCols: setCols, sorters: sorters, setFilters: setFilters, setSorters: setSorters, loading: !!props.loading, inlineFilter: props.inlineFilter, inlineSorter: props.inlineSorter })) }), empty ? _jsx(EmptyContent, { loading: props.loading }) : null, _jsx("div", { "aria-hidden": "true", ref: ref, className: "w-full h-0.5" }), pagination !== null ? _jsx(Pagination, { ...pagination }) : null] }));
85
92
  };
@@ -63,6 +63,7 @@ export declare const defaultTranslations: {
63
63
  n: number;
64
64
  }) => string;
65
65
  uploadDialogTitle: string;
66
+ datepickerPlaceholder: (_: string) => string;
66
67
  };
67
68
  export type Translations = typeof defaultTranslations;
68
69
  //# sourceMappingURL=default-translations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-translations.d.ts","sourceRoot":"","sources":["../../src/config/default-translations.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAuCQ;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;4BAqB7G;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE;;CAExC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,mBAAmB,CAAC"}
1
+ {"version":3,"file":"default-translations.d.ts","sourceRoot":"","sources":["../../src/config/default-translations.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAuCQ;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;;;;;;;;;;;;;;;4BAqB7G;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE;;+BAGV,MAAM;CACpC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,mBAAmB,CAAC"}
@@ -56,4 +56,5 @@ export const defaultTranslations = {
56
56
  uploadIdleButton: "Choose your files",
57
57
  uploadDragging: (props) => `Dragging ${props.n} ${props.n > 0 ? "files" : "file"}`,
58
58
  uploadDialogTitle: "Details of your file",
59
+ datepickerPlaceholder: (_) => "day/month/year"
59
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/flow/flow.tsx"],"names":[],"mappings":"AACA,OAAO,EAQH,KAAK,IAAI,EAQZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAS,MAAM,cAAc,CAAC;AAClD,OAAO,KAAiH,MAAM,OAAO,CAAC;AAGtI,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,QAAQ,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AA4C5F,KAAK,KAAK,CAAC,CAAC,SAAS,IAAI,IAAI;IACzB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3B,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;CACtC,CAAC;AAyJF,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,IAAI,GA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  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { addEdge, Background, Controls, Handle, Position, ReactFlow, ReactFlowProvider, useEdgesState, useNodesState, useReactFlow, } from "@xyflow/react";
3
+ import { addEdge, Background, Controls, Handle, Position, ReactFlow, ReactFlowProvider, useEdgesState, useNodesState, useReactFlow } from "@xyflow/react";
4
4
  import { XIcon } from "lucide-react";
5
5
  import { createContext, Fragment, memo, useCallback, useContext, useEffect, useRef, useState } from "react";
6
6
  import { css } from "../lib/dom";
@@ -43,7 +43,7 @@ const AddNodeOnEdgeDrop = (props) => {
43
43
  const { screenToFlowPosition } = useReactFlow();
44
44
  useEffect(() => {
45
45
  props.onChange(nodes);
46
- }, [nodes.length, edges.length]);
46
+ }, [nodes, edges]);
47
47
  const onConnect = useCallback((params) => {
48
48
  setEdges((eds) => addEdge({
49
49
  ...params, animated: true, deletable: true, reconnectable: true,
@@ -62,5 +62,6 @@ export declare const useTranslations: () => {
62
62
  n: number;
63
63
  }) => string;
64
64
  uploadDialogTitle: string;
65
+ datepickerPlaceholder: (_: string) => string;
65
66
  };
66
67
  //# sourceMappingURL=use-translations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-translations.d.ts","sourceRoot":"","sources":["../../src/hooks/use-translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAKy2C,CAAC;;;;;;;;;;;;;;;;;;;;;;CADr4C,CAAC"}
1
+ {"version":3,"file":"use-translations.d.ts","sourceRoot":"","sources":["../../src/hooks/use-translations.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAKy2C,CAAC;;;;;;;;;;;;;;;;;;;;;;;CADr4C,CAAC"}