@g4rcez/components 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/index.css +21 -1
  2. package/dist/index.js +46 -46
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +5884 -5844
  5. package/dist/index.mjs.map +1 -1
  6. package/dist/index.umd.js +43 -43
  7. package/dist/index.umd.js.map +1 -1
  8. package/dist/preset/src/styles/common.d.ts +1 -1
  9. package/dist/preset/src/styles/common.js +1 -1
  10. package/dist/preset/src/styles/dark.d.ts.map +1 -1
  11. package/dist/preset/src/styles/dark.js +3 -2
  12. package/dist/preset/src/styles/light.d.ts.map +1 -1
  13. package/dist/preset/src/styles/light.js +2 -1
  14. package/dist/preset/src/styles/theme.types.d.ts +1 -0
  15. package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
  16. package/dist/src/components/floating/modal.d.ts.map +1 -1
  17. package/dist/src/components/floating/modal.js +25 -18
  18. package/dist/src/components/form/autocomplete.d.ts.map +1 -1
  19. package/dist/src/components/form/autocomplete.js +3 -3
  20. package/dist/src/components/form/date-picker.d.ts.map +1 -1
  21. package/dist/src/components/form/date-picker.js +1 -1
  22. package/dist/src/components/form/input-field.js +1 -1
  23. package/dist/src/components/form/multi-select.d.ts.map +1 -1
  24. package/dist/src/components/form/multi-select.js +60 -62
  25. package/dist/src/components/form/select.d.ts.map +1 -1
  26. package/dist/src/components/form/select.js +1 -1
  27. package/dist/src/components/form/slider.js +1 -1
  28. package/dist/src/flow/flow.d.ts +7 -7
  29. package/dist/src/flow/flow.d.ts.map +1 -1
  30. package/dist/src/flow/flow.js +3 -3
  31. package/dist/src/hooks/use-form.d.ts +5 -2
  32. package/dist/src/hooks/use-form.d.ts.map +1 -1
  33. package/dist/src/hooks/use-form.js +48 -11
  34. package/dist/src/styles/common.d.ts +1 -1
  35. package/dist/src/styles/common.js +1 -1
  36. package/dist/src/styles/dark.d.ts.map +1 -1
  37. package/dist/src/styles/dark.js +3 -2
  38. package/dist/src/styles/light.d.ts.map +1 -1
  39. package/dist/src/styles/light.js +2 -1
  40. package/dist/src/styles/theme.types.d.ts +1 -0
  41. package/dist/src/styles/theme.types.d.ts.map +1 -1
  42. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import { ZIndex } from "./theme.types";
2
2
  export declare const rounded: {
3
- readonly button: "0.4rem";
3
+ readonly button: "0.55rem";
4
4
  readonly pill: "2rem";
5
5
  readonly card: "0.75rem";
6
6
  readonly full: "9999px";
@@ -1,5 +1,5 @@
1
1
  export var rounded = {
2
- button: "0.4rem",
2
+ button: "0.55rem",
3
3
  pill: "2rem",
4
4
  card: "0.75rem",
5
5
  full: "9999px",
@@ -1 +1 @@
1
- {"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../../src/styles/dark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,UAAU,EAAE,YA2MxB,CAAC"}
1
+ {"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../../src/styles/dark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,UAAU,EAAE,YA4MxB,CAAC"}
@@ -5,7 +5,7 @@ export var DARK_THEME = {
5
5
  rounded: rounded,
6
6
  spacing: spacing,
7
7
  shadow: {
8
- floating: "rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 5px 12px",
8
+ floating: "0 1px 1px 0 rgb(0 0 0 / 0.02)",
9
9
  },
10
10
  colors: {
11
11
  foreground: "hsla(210, 50%, 98%)",
@@ -66,6 +66,7 @@ export var DARK_THEME = {
66
66
  "mask-error": "hsla(0, 94%, 81%)",
67
67
  "switch-bg": "hsla(0, 0%, 9%)",
68
68
  switch: "hsla(0, 0%, 100%)",
69
+ slider: "hsla(0, 0%, 100%)",
69
70
  },
70
71
  card: {
71
72
  muted: "hsla(0, 0%, 22%)",
@@ -168,7 +169,7 @@ export var DARK_THEME = {
168
169
  warn: {
169
170
  bg: "hsla(28,33%,9%)",
170
171
  border: "hsla(29,65%,12%)",
171
- text: "hsla(27,100%,78%)"
172
+ text: "hsla(27,100%,78%)",
172
173
  },
173
174
  info: {
174
175
  text: "hsla(253,100%,83%)",
@@ -1 +1 @@
1
- {"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../../src/styles/light.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,YA2MzB,CAAC"}
1
+ {"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../../src/styles/light.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,YA4MzB,CAAC"}
@@ -4,7 +4,7 @@ export var LIGHT_THEME = {
4
4
  spacing: spacing,
5
5
  name: "light",
6
6
  shadow: {
7
- floating: "rgba(50, 50, 50, 0.1) 0px 0px 0px 1px, rgba(50, 50, 50, 0.1) 0px 3px 6px, rgba(50, 50, 50, 0.1) 0px 2px 3px",
7
+ floating: "0 1px 1px 0 rgb(0 0 0 / 0.02)",
8
8
  },
9
9
  zIndex: zIndex,
10
10
  colors: {
@@ -66,6 +66,7 @@ export var LIGHT_THEME = {
66
66
  "mask-error": "hsla(0, 94%, 81%)",
67
67
  "switch-bg": "hsla(0, 0%, 45%)",
68
68
  switch: "hsla(0, 0%, 100%)",
69
+ slider: "hsla(0, 0%, 100%)",
69
70
  },
70
71
  card: {
71
72
  muted: "hsla(210, 25%, 94%)",
@@ -84,6 +84,7 @@ export type DesignTokens = {
84
84
  "mask-error": string;
85
85
  "switch-bg": string;
86
86
  switch: string;
87
+ slider: string;
87
88
  };
88
89
  };
89
90
  };
@@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AAC;IAC7B,OAAO,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;CAChC,CAAC,CACH,CAAC;AAyEF,KAAK,QAAQ,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAA;CAAE,CAAC;AAI/D,eAAO,MAAM,KAAK;WAlGN,KAAK;gBAAc,MAAM;;UAC3B,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;;;;eAnBqB,MAAM;YAAU,KAAK;;UAClE,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;;;2CAwQjC,CAAC"}
1
+ {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,YAAY,EASpB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAmB,eAAe,EAAqE,MAAM,cAAc,CAAC;AACnI,OAAO,KAAkH,MAAM,OAAO,CAAC;AAIvI,OAAO,EAAE,KAAK,EAAO,QAAQ,EAAE,MAAM,aAAa,CAAC;AAInD,MAAM,MAAM,SAAS,GAAG,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E,OAAO,KAAK,IAAI;;YAE1B,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;;;;eAnBe,MAAM;YAAU,KAAK;;UAChE,OAAO;cACH,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI;;YAE1B,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;;;2CAuRzC,CAAC"}
@@ -75,7 +75,7 @@ const Draggable = (props) => {
75
75
  ? "top-1 flex h-3 w-full justify-center py-2"
76
76
  : props.position === "left"
77
77
  ? "right-5 top-1/2 h-10 w-2"
78
- : "left-2 top-1/2 h-10 w-2"), children: props.sheet ? _jsx("div", { className: "w-1/4 h-2 rounded-lg bg-floating-border" }) : null }));
78
+ : "left-2 top-1/2 h-10 w-2"), children: props.sheet ? _jsx("div", { className: "h-2 w-1/4 rounded-lg bg-floating-border" }) : null }));
79
79
  };
80
80
  const positions = { drawer: "right", sheet: "none", dialog: "none" };
81
81
  const fetchPosition = (isDesktop, forceType, propsType, propsPosition) => {
@@ -86,7 +86,6 @@ const fetchPosition = (isDesktop, forceType, propsType, propsPosition) => {
86
86
  };
87
87
  const noop = [];
88
88
  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) => {
89
- const Render = animated ? motion.div : "div";
90
89
  const removeScrollRef = useRemoveScroll(open, "block-only");
91
90
  const headingId = useId();
92
91
  const descriptionId = useId();
@@ -129,25 +128,30 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
129
128
  return floatingSize.set(result);
130
129
  }
131
130
  };
132
- const animationProps = animated && type === "sheet" ? {
131
+ const commonAnimated = {
132
+ layoutId,
133
133
  layout: true,
134
134
  exit: "exit",
135
- dragListener: true,
136
- dragMomentum: true,
137
135
  animate: "enter",
138
- dragElastic: 0,
139
- dragPropagation: true,
140
- onDrag: onDrag,
141
- dragSnapToOrigin: true,
142
- dragDirectionLock: true,
143
136
  initial: "initial",
144
- layoutId,
145
137
  variants: animation,
146
- drag: type === "sheet" ? "y" : "x",
147
- draggable: type === "sheet",
148
- dragConstraints,
149
- } : {};
150
- 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, { children: _jsx(AnimatePresence, { mode: "wait", presenceAffectsLayout: true, 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(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: floating.context, children: _jsxs(Render, { ...props, ...animationProps, ...(title
138
+ };
139
+ const animationProps = animated && type === "sheet"
140
+ ? {
141
+ dragElastic: 0,
142
+ onDrag: onDrag,
143
+ dragConstraints,
144
+ ...commonAnimated,
145
+ dragListener: true,
146
+ dragMomentum: true,
147
+ dragPropagation: true,
148
+ dragSnapToOrigin: true,
149
+ dragDirectionLock: true,
150
+ draggable: type === "sheet",
151
+ drag: type === "sheet" ? "y" : "x",
152
+ }
153
+ : commonAnimated;
154
+ 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, { mode: "wait", propagate: true, presenceAffectsLayout: true, 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(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: floating.context, children: _jsxs(motion.div, { ...props, ...animationProps, ...(title
151
155
  ? {
152
156
  "aria-labelledby": headingId,
153
157
  "aria-describedby": descriptionId,
@@ -155,6 +159,9 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
155
159
  : { "aria-label": ariaTitle }), ...interactions.getFloatingProps({
156
160
  "aria-modal": open,
157
161
  ref: mergeRefs(floating.refs.setFloating, removeScrollRef),
158
- className: css(variants({ position, type }), className, "overscroll-contain"),
159
- }), "data-component": "modal", style: type === "drawer" ? { width: floatingSize } : { height: floatingSize }, children: [title ? (_jsx("header", { className: "relative w-full", children: title ? (_jsx("h2", { id: headingId, className: "px-8 pb-2 text-3xl font-medium leading-relaxed border-b select-text border-floating-border", children: title })) : null })) : null, _jsx("section", { className: css("flex-1 overflow-y-auto px-8 select-text py-1", bodyClassName), children: children }), footer ? _jsx("footer", { className: "px-8 pt-4 w-full border-t select-text border-floating-border", children: footer }) : null, closable ? (_jsx("nav", { className: "absolute top-1 right-4 z-floating", children: _jsx("button", { type: "button", onClick: onClose, className: "p-1 opacity-70 transition-colors hover:opacity-100 hover:text-danger focus:text-danger", children: _jsx(XIcon, {}) }) })) : null, useResizer && resizer ? (_jsx(Draggable, { onChange: onChange, value: floatingSize, sheet: type === "sheet", position: position, parent: floating.refs.floating })) : null] }) }) })) : null }) })] }));
162
+ className: css(variants({
163
+ position,
164
+ type,
165
+ }), className, "overscroll-contain"),
166
+ }), "data-component": "modal", style: type === "drawer" ? { width: floatingSize } : { height: floatingSize }, children: [title ? (_jsx("header", { className: "relative w-full", children: title ? (_jsx("h2", { id: headingId, className: "select-text border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed", children: title })) : null })) : null, _jsx("section", { className: css("flex-1 select-text overflow-y-auto px-8 py-1", bodyClassName), children: children }), footer ? (_jsx("footer", { className: "w-full select-text border-t border-floating-border px-8 pt-4", children: footer })) : null, closable ? (_jsx("nav", { className: "absolute right-4 top-1 z-floating", children: _jsx("button", { type: "button", onClick: onClose, className: "p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger", children: _jsx(XIcon, {}) }) })) : null, useResizer && resizer ? (_jsx(Draggable, { onChange: onChange, value: floatingSize, sheet: type === "sheet", position: position, parent: floating.refs.floating })) : null] }) }) })) : null }, headingId) })] }));
160
167
  });
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AAQzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAiCF,eAAO,MAAM,YAAY,yGAkWxB,CAAC"}
1
+ {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AASzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAiCF,eAAO,MAAM,YAAY,yGAkWxB,CAAC"}
@@ -11,8 +11,8 @@ import { useRemoveScroll } from "../../hooks/use-remove-scroll";
11
11
  import { useTranslations } from "../../hooks/use-translations";
12
12
  import { css, dispatchInput, getRemainingSize, initializeInputDataset, mergeRefs } from "../../lib/dom";
13
13
  import { safeRegex } from "../../lib/fns";
14
- import { InputField } from "./input-field";
15
14
  import { fzf } from "../../lib/fzf";
15
+ import { InputField } from "./input-field";
16
16
  const Frag = (props) => _jsx(Fragment, { children: props.children });
17
17
  const transitionStyles = {
18
18
  duration: 300,
@@ -121,7 +121,7 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
121
121
  return;
122
122
  const s = getRemainingSize(inputRef.current, window.innerHeight);
123
123
  setTimeout(() => setH(Math.min(s, displayList.length * MIN_SIZE)), 100);
124
- }, [shadow, open, refs.reference]);
124
+ }, [shadow, open, refs.reference, displayList.length]);
125
125
  useEffect(() => {
126
126
  const input = refs.reference.current;
127
127
  if (!input)
@@ -213,7 +213,7 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
213
213
  }
214
214
  }
215
215
  },
216
- }), "data-value": value, "data-error": !!error, "data-name": id, "data-target": id, required: required, value: open ? shadow : label || value, "aria-autocomplete": "list", autoComplete: "off", className: css("input placeholder-input-mask group h-input-height w-full flex-1", "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 text-base", props.className) }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || value || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingFocusManager, { modal: true, guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs(motion.div, { ...getFloatingProps({
216
+ }), "data-value": value, "data-error": !!error, "data-name": id, "data-target": id, required: required, value: open ? shadow : label || value, "aria-autocomplete": "list", autoComplete: "off", className: css("input placeholder-input-mask group h-input-height w-full flex-1", "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", "text-base group-focus-within:border-primary group-hover:border-primary", props.className) }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || value || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingFocusManager, { modal: true, guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs(motion.div, { ...getFloatingProps({
217
217
  ref: mergeRefs(removeScrollRef, refs.setFloating),
218
218
  style: { ...transitions.styles, left: x, top: y ?? 0, position: strategy },
219
219
  }), initial: false, "data-floating": "true", animate: { height: isEmpty ? "auto" : h }, className: "isolate z-floating m-0 max-h-80 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating ease-in-out", onAnimationComplete: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,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,CAAC,EAAE,UAAU,CAAC,CAAC;AAmCpF,eAAO,MAAM,UAAU,uGA4GtB,CAAC"}
1
+ {"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,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,CAAC,EAAE,UAAU,CAAC,CAAC;AAmCpF,eAAO,MAAM,UAAU,uGA2GtB,CAAC"}
@@ -74,5 +74,5 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
74
74
  };
75
75
  const validDate = isValid(innerDate);
76
76
  const htmlValue = validDate ? innerDate.toISOString() : undefined;
77
- return (_jsx(Input, { ...props, mask: mask, value: value, id: undefined, name: undefined, className: "uppercase", "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, trigger: _jsxs("span", { "aria-labelledby": labelId, children: [_jsx("span", { id: labelId, className: "sr-only", children: translation.datePickerCalendarButtonLabel }), _jsx(CalendarIcon, {})] }), buttonProps: { "aria-describedby": labelId }, children: _jsx(Calendar, { ...props, locale: locale, changeOnlyOnClick: true, markToday: markToday, onChange: onChangeDate, disabledDate: disabledDate, date: validDate ? innerDate : undefined }) })] }) }));
77
+ 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, trigger: _jsxs("span", { "aria-labelledby": labelId, children: [_jsx("span", { id: labelId, className: "sr-only", children: translation.datePickerCalendarButtonLabel }), _jsx(CalendarIcon, {})] }), buttonProps: { "aria-describedby": labelId }, children: _jsx(Calendar, { ...props, locale: locale, changeOnlyOnClick: true, markToday: markToday, onChange: onChangeDate, disabledDate: disabledDate, date: validDate ? innerDate : undefined }) })] }) }));
78
78
  });
@@ -13,5 +13,5 @@ export const InputField = forwardRef(({ optionalText: _optionalText, left, right
13
13
  const ID = id ?? name;
14
14
  const translation = useTranslations();
15
15
  const optionalText = _optionalText ?? translation.inputOptionalLabel;
16
- return (_jsxs("fieldset", { ref: ref, form: form, disabled: disabled, "data-error": !!error, "aria-disabled": disabled, "data-component": componentName, "data-interactive": !!interactive, className: css("group flex min-h-0 max-w-full min-w-0 flex-col items-start", container), children: [_jsxs("label", { form: form, htmlFor: ID, className: "text-field-label max-w-full w-full relative inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger", children: [_jsx(InputFeedback, { info: info, hideLeft: hideLeft, reportStatus: reportStatusDefault, title: title, placeholder: placeholder, children: optionalText || rightLabel ? (_jsxs(Fragment, { children: [!required ? (_jsx("span", { "aria-disabled": disabled, className: "text-opacity-70 aria-disabled:text-disabled", children: optionalText })) : null, rightLabel ? _jsx(Fragment, { children: rightLabel }) : null] })) : null }), _jsxs("div", { className: `group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${labelClassName}`, children: [left ? _jsx("span", { className: "flex flex-nowrap gap-1 whitespace-nowrap pl-2", children: left }) : null, children, right ? _jsx("span", { className: "flex flex-nowrap gap-2 whitespace-nowrap pr-2", children: right }) : null] })] }), _jsx("p", { className: "mt-input-gap hidden whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:flex group-error:flex group-error:text-danger", children: error }), _jsx("p", { className: "mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden", children: feedback })] }));
16
+ return (_jsxs("fieldset", { ref: ref, form: form, disabled: disabled, "data-error": !!error, "aria-disabled": disabled, "data-component": componentName, "data-interactive": !!interactive, className: css("group flex min-h-0 max-w-full min-w-0 flex-col items-start", container), children: [_jsxs("label", { form: form, htmlFor: ID, className: "text-field-label max-w-full w-full relative inline-flex cursor-text flex-row flex-wrap justify-between gap-1 text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger", children: [_jsx(InputFeedback, { info: info, hideLeft: hideLeft, reportStatus: reportStatusDefault, title: title, placeholder: placeholder, children: optionalText || rightLabel ? (_jsxs(Fragment, { children: [!required ? (_jsx("span", { "aria-disabled": disabled, className: "transition-colors text-opacity-70 aria-disabled:text-disabled group-focus-within:text-primary group-hover:text-primary", children: optionalText })) : null, rightLabel ? _jsx(Fragment, { children: rightLabel }) : null] })) : null }), _jsxs("div", { className: `group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${labelClassName}`, children: [left ? _jsx("span", { className: "flex flex-nowrap gap-1 whitespace-nowrap pl-2", children: left }) : null, children, right ? _jsx("span", { className: "flex flex-nowrap gap-2 whitespace-nowrap pr-2", children: right }) : null] })] }), _jsx("p", { className: "mt-input-gap hidden whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:flex group-error:flex group-error:text-danger", children: error }), _jsx("p", { className: "mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden", children: feedback })] }));
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAA6F,MAAM,OAAO,CAAC;AASlH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OA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,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC/C,CACF,CAAC;AA0DF,eAAO,MAAM,WAAW,wGA6ZvB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { autoUpdate, FloatingFocusManager, FloatingPortal, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTransitionStyles, } from "@floating-ui/react";
3
+ import { autoUpdate, FloatingFocusManager, FloatingOverlay, FloatingPortal, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTransitionStyles, } from "@floating-ui/react";
4
4
  import { ChevronDown, XIcon } from "lucide-react";
5
5
  import { AnimatePresence, motion } from "motion/react";
6
6
  import React, { forwardRef, Fragment, useEffect, useMemo, useRef, useState } from "react";
@@ -23,10 +23,9 @@ const transitionStyles = {
23
23
  open: { transform: "scaleY(1)", opacity: 1 },
24
24
  close: { transform: "scaleY(0)", opacity: 0 },
25
25
  };
26
- const fuzzyOptions = { caseSensitive: false, sort: false };
27
26
  const emptyRef = [];
28
27
  const List = forwardRef(function VirtualList(props, ref) {
29
- return (_jsx(motion.ul, { ...props, ref: ref, className: "w-full rounded-b-lg border-b border-tooltip-border last:border-transparent", children: _jsx(AnimatePresence, { children: props.children }) }));
28
+ return (_jsx(motion.ul, { ...props, role: "listbox", ref: ref, className: "w-full rounded-b-lg border-b border-tooltip-border last:border-transparent", children: _jsx(AnimatePresence, { children: props.children }) }));
30
29
  });
31
30
  const Item = forwardRef(function VirtualItem({ item, context, ...props }, ref) {
32
31
  return _jsx(motion.li, { ...props, ref: ref, className: "last:rounded-t-lg" });
@@ -68,7 +67,7 @@ export const MultiSelect = forwardRef(({ left, error, right, options, container,
68
67
  });
69
68
  return d;
70
69
  });
71
- const deriveValue = useMemo(() => Array.from(value.keys()), [value]);
70
+ const values = useMemo(() => Array.from(value.keys()), [value]);
72
71
  const [label, setLabel] = useState(() => {
73
72
  const d = new Set(defaults);
74
73
  return options.reduce((acc, x) => (d.has(x.value) ? [...acc, x.label ?? x.value] : acc), []) ?? defaults;
@@ -203,71 +202,70 @@ export const MultiSelect = forwardRef(({ left, error, right, options, container,
203
202
  e.preventDefault();
204
203
  e.stopPropagation();
205
204
  onSelect(x, i);
206
- setOpen(false);
207
205
  }, children: _jsx(XIcon, { size: 14 }) }), children: x.label ?? x.value }, `MultiSelect-${x.value}-x`)));
208
206
  const scrollableContainerStyle = { height: isEmpty ? "0" : value.size === 0 ? h - 49 : h - 86 };
209
- return (_jsxs(InputField, { ...props, left: left, error: error, ref: fieldset, form: props.form, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, componentName: "autocomplete", labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("span", { className: "flex items-center gap-0.5", children: [right, _jsxs("button", { type: "button", className: "transition-colors link:text-primary", onClick: onCaretDownClick, children: [_jsx(ChevronDown, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] }), value ? (_jsx("button", { type: "button", onClick: onClose, className: "transition-colors link:text-danger", children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })) : null] }), children: [_jsx("li", { ...getReferenceProps({
207
+ return (_jsxs(InputField, { ...props, left: left, error: error, ref: fieldset, form: props.form, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, componentName: "autocomplete", labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("span", { className: "flex items-center gap-0.5", children: [right, _jsxs("button", { type: "button", className: "transition-colors link:text-primary", onClick: onCaretDownClick, children: [_jsx(ChevronDown, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] }), value ? (_jsx("button", { type: "button", onClick: onClose, className: "transition-colors link:text-danger", children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })) : null] }), children: [_jsxs("ul", { ...getReferenceProps({
210
208
  ...props,
211
209
  onFocus,
212
210
  id: `${id}-shadow`,
213
211
  name: `${id}-shadow`,
214
212
  ref: refs.setReference,
215
- }), tabIndex: 0, role: "button", "data-name": id, "data-target": id, "data-shadow": "true", "data-error": !!error, "aria-autocomplete": "list", "data-value": deriveValue.join(","), value: open ? shadow : label || value, 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: _jsx(OverflowControl, { label: selectedLabel, children: tags }) }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || deriveValue || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingFocusManager, { modal: true, guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs("div", { ...getFloatingProps({
216
- ref: refs.setFloating,
217
- style: { ...transitions.styles, top: y ?? 0, position: strategy, left: x },
218
- }), "data-floating": "true", className: "isolate z-floating m-0 max-h-80 w-full origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating", children: [_jsx("input", { autoFocus: true, value: shadow, onChange: onChange, title: props.title, placeholder: translation.multiSelectInnerPlaceholder, onKeyDown: (event) => {
219
- if (event.key === "ArrowDown") {
220
- let next = index + 1;
221
- if (next > displayList.length - 1)
222
- next = 0;
223
- virtuoso.current?.scrollIntoView({ index: next });
224
- return setIndex(next);
225
- }
226
- if (event.key === "ArrowUp") {
227
- let next = index - 1;
228
- if (next < 0)
229
- next = displayList.length - 1;
230
- virtuoso.current?.scrollIntoView({ index: next });
231
- return setIndex(next);
232
- }
233
- if (event.key === "Escape") {
234
- event.currentTarget.blur();
235
- return setOpen(false);
236
- }
237
- if (event.key === "Enter") {
238
- if (index !== null && displayList[index]) {
239
- event.preventDefault();
240
- return onSelect(displayList[index], index);
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({
214
+ ref: refs.setFloating,
215
+ style: { ...transitions.styles, top: y ?? 0, position: strategy, left: x, height: h - (values.length === 0 ? 65 : 30) },
216
+ }), "data-floating": "true", className: "isolate z-floating m-0 max-h-96 w-full origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating", children: [_jsx("input", { autoFocus: true, value: shadow, onChange: onChange, title: props.title, placeholder: translation.multiSelectInnerPlaceholder, className: "input placeholder-input-mask group mb-1 h-10 w-full flex-1 rounded border-b border-input-border bg-transparent px-input-x py-input-y outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", onKeyDown: (event) => {
217
+ if (event.key === "ArrowDown") {
218
+ let next = index + 1;
219
+ if (next > displayList.length - 1)
220
+ next = 0;
221
+ virtuoso.current?.scrollIntoView({ index: next });
222
+ return setIndex(next);
241
223
  }
242
- if (displayList.length === 1) {
243
- event.preventDefault();
244
- return onSelect(displayList[0], 0);
224
+ if (event.key === "ArrowUp") {
225
+ let next = index - 1;
226
+ if (next < 0)
227
+ next = displayList.length - 1;
228
+ virtuoso.current?.scrollIntoView({ index: next });
229
+ return setIndex(next);
245
230
  }
246
- }
247
- }, className: "input placeholder-input-mask group mb-1 h-10 w-full flex-1 border-b border-input-border bg-transparent px-input-x py-input-y outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary" }), isEmpty ? (_jsx("li", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, isEmpty ? null : (_jsx(motion.div, { initial: false, "data-floating": "true", ref: removeScrollRef, animate: { height: isEmpty ? "auto" : h }, style: scrollableContainerStyle, className: "max-h-80 w-full overscroll-contain", onAnimationComplete: () => {
248
- if (!open)
249
- return setH(0);
250
- const ul = refs.floating.current;
251
- const li = ul.querySelectorAll("li").item(0);
252
- const sum = (li ? li.getBoundingClientRect().height : 40) * displayList.length;
253
- return flushSync(() => setH(sum + 2));
254
- }, children: _jsx(Virtuoso, { ref: virtuoso, hidden: isEmpty, data: displayList, components: components, style: scrollableContainerStyle, className: "max-h-80 border-floating-border bg-floating-background p-0 text-foreground", itemContent: (i, option) => {
255
- const Label = option.Render ?? Frag;
256
- const active = value.has(option.value) || value.has(option.label ?? "");
257
- const selected = index === i;
258
- const children = option.label ?? option.value;
259
- return (_jsxs("button", { "data-value": option.value, ...getItemProps({
260
- ref: (node) => void (listRef.current[i] = node),
261
- role: "option",
262
- type: "button",
263
- "aria-checked": active,
264
- "aria-current": active,
265
- "aria-selected": active,
266
- "aria-busy": option.disabled,
267
- onClick: () => onSelect(option, i),
268
- }), className: `flex w-full max-w-full cursor-pointer items-center justify-start p-2 text-left hover:bg-floating-hover focus:bg-floating-hover ${active || selected ? "bg-floating-hover text-floating-foreground" : ""}`, children: [_jsx(Checkbox, { onChange: noop, checked: active, "aria-checked": active, onClick: (e) => {
269
- e.stopPropagation();
270
- onSelect(option, i);
271
- } }), _jsx(Label, { ...props, label: option.label, value: option.value, children: children })] }));
272
- } }) })), value.size === 0 ? null : (_jsx("div", { className: "sticky bottom-0 flex w-full flex-nowrap items-center gap-2 overflow-x-auto rounded-b-lg bg-floating-background p-2", children: tags }))] }) })) : null })] }));
231
+ if (event.key === "Escape") {
232
+ event.currentTarget.blur();
233
+ return setOpen(false);
234
+ }
235
+ if (event.key === "Enter") {
236
+ if (index !== null && displayList[index]) {
237
+ event.preventDefault();
238
+ return onSelect(displayList[index], index);
239
+ }
240
+ if (displayList.length === 1) {
241
+ event.preventDefault();
242
+ return onSelect(displayList[0], 0);
243
+ }
244
+ }
245
+ } }), isEmpty ? (_jsx("li", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, isEmpty ? null : (_jsx(motion.div, { initial: false, "data-floating": "true", ref: removeScrollRef, animate: { height: isEmpty ? "auto" : h }, style: scrollableContainerStyle, className: "max-h-72 w-full overscroll-contain", onAnimationComplete: () => {
246
+ if (!open)
247
+ return setH(0);
248
+ const ul = refs.floating.current;
249
+ const li = ul.querySelectorAll("li").item(0);
250
+ const sum = (li ? li.getBoundingClientRect().height : 40) * displayList.length;
251
+ return flushSync(() => setH(sum + 2));
252
+ }, children: _jsx(Virtuoso, { ref: virtuoso, hidden: isEmpty, data: displayList, components: components, style: scrollableContainerStyle, className: "max-h-72 border-floating-border bg-floating-background p-0 text-foreground", itemContent: (i, option) => {
253
+ const Label = option.Render ?? Frag;
254
+ const active = value.has(option.value) || value.has(option.label ?? "");
255
+ const selected = index === i;
256
+ const children = option.label ?? option.value;
257
+ return (_jsxs("button", { "data-value": option.value, ...getItemProps({
258
+ ref: (node) => void (listRef.current[i] = node),
259
+ role: "option",
260
+ type: "button",
261
+ "aria-checked": active,
262
+ "aria-current": active,
263
+ "aria-selected": active,
264
+ "aria-busy": option.disabled,
265
+ onClick: () => onSelect(option, i),
266
+ }), className: `flex w-full max-w-full cursor-pointer items-center justify-start p-2 text-left hover:bg-floating-hover focus:bg-floating-hover ${active || selected ? "bg-floating-hover text-floating-foreground" : ""}`, children: [_jsx(Checkbox, { onChange: noop, checked: active, "aria-checked": active, onClick: (e) => {
267
+ e.stopPropagation();
268
+ onSelect(option, i);
269
+ } }), _jsx(Label, { ...props, label: option.label, value: option.value, children: children })] }));
270
+ } }) })), value.size === 0 ? null : (_jsx("div", { className: "sticky bottom-0 flex w-full flex-nowrap items-center gap-2 overflow-x-auto rounded-b-lg bg-floating-background p-2", children: tags }))] }) }) })) : null })] }));
273
271
  });
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAGlF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,QAAQ,CAC9B,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAC9B;IACI,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAChD,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAC9B,eAAe,CAAC,QAAQ,CAAC,EACzB;IACI,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CACJ,CAAC;AAEF,eAAO,MAAM,MAAM,oGA2GlB,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAGlF,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,QAAQ,CAC9B,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAC9B;IACI,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAChD,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,QAAQ,CAC9B,eAAe,CAAC,QAAQ,CAAC,EACzB;IACI,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CACJ,CAAC;AAEF,eAAO,MAAM,MAAM,oGAyGlB,CAAC"}
@@ -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, value: props.value, required: required, ref: mergeRefs(ref, inputRef), "data-selected": !!props.value || false, defaultValue: props.value ? undefined : "", 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 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
  });
@@ -25,7 +25,7 @@ const Thumb = (props) => {
25
25
  observer.observe(html, { attributeFilter: ["aria-valuenow"] });
26
26
  return () => observer.disconnect();
27
27
  }, []);
28
- return (_jsx(Tooltip, { title: "", ref: ref, as: RadixSlider.Thumb, enabled: props.tooltip, className: "block size-5 cursor-grab rounded-full border-2 border-card-border bg-card-background shadow active:cursor-grabbing", children: float }));
28
+ return (_jsx(Tooltip, { title: "", ref: ref, as: RadixSlider.Thumb, enabled: props.tooltip, className: "block bg-input-switch size-5 cursor-grab rounded-full border-1 border-input-border shadow active:cursor-grabbing", children: float }));
29
29
  };
30
30
  export const Slider = (props) => {
31
31
  const { tooltip, className, defaultValue, value, ...restProps } = props;
@@ -1,19 +1,19 @@
1
1
  import { type Node } from "@xyflow/react";
2
2
  import { LucideProps } from "lucide-react";
3
3
  import React from "react";
4
- import { Label, Override } from "../types";
5
- export type FlowItem = Override<Node, {
6
- data: CreatableOpts;
7
- }>;
4
+ import { Override } from "../types";
8
5
  export type CreatableOpts = {
9
6
  id: string;
10
7
  type: string;
11
- value: string;
8
+ title: string;
9
+ value?: string;
12
10
  description?: string;
13
- title: string | Label;
14
- Item?: React.FC<FlowItem>;
15
11
  Icon?: React.FC<LucideProps>;
12
+ Item?: React.FC<FlowItem<any>>;
16
13
  };
14
+ export type FlowItem<T extends CreatableOpts = CreatableOpts> = Override<Node, {
15
+ data: T;
16
+ }>;
17
17
  type Props<T extends Node> = {
18
18
  items: T[];
19
19
  parents: CreatableOpts[];
@@ -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,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC;IACtB,IAAI,CAAC,EA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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;AAoJF,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,IAAI,GAAG,IAAI,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,4CAM1D,CAAC"}
@@ -26,7 +26,7 @@ const Handlers = (props) => {
26
26
  return (_jsxs(Fragment, { children: [_jsx(Handle, { id: `${props.id}-handle-top`, type: props.type, position: Position.Top, className: "h-1 w-10 !bg-primary" }), _jsx(Handle, { id: `${props.id}-handle-left`, type: props.type, position: Position.Left, className: "h-4 w-1 !bg-primary" }), _jsx(Handle, { id: `${props.id}-handle-right`, type: props.type, position: Position.Right, className: "h-4 w-1 !bg-primary" }), _jsx(Handle, { id: `${props.id}-handle-bottom`, type: props.type, position: Position.Bottom, className: "h-1 w-10 !bg-primary" })] }));
27
27
  };
28
28
  const Input = memo((node) => {
29
- return (_jsxs("div", { className: css("relative flex min-h-10 min-w-24 items-center justify-center rounded-lg bg-floating-background px-4 py-2 shadow-md", node.selected ? "border-4" : "border", "border-floating-border"), children: [_jsx(Handlers, { id: node.data.id, type: "source" }), node.data.Item ? _jsx(node.data.Item, { ...node }) : _jsx("h3", { className: "text-center", children: node.data.title })] }));
29
+ return (_jsxs("div", { className: css("relative flex border-2 min-h-10 min-w-24 items-center justify-center rounded-lg bg-floating-background px-4 py-2 shadow-md", node.selected ? "border-primary" : "", "border-floating-border"), children: [_jsx(Handlers, { id: node.data.id, type: "source" }), node.data.Item ? _jsx(node.data.Item, { ...node }) : _jsx("h3", { className: "text-center", children: node.data.title })] }));
30
30
  });
31
31
  const Connection = memo((node) => {
32
32
  const { deleteElements } = useReactFlow();
@@ -61,7 +61,7 @@ const AddNodeOnEdgeDrop = (props) => {
61
61
  id,
62
62
  position,
63
63
  type: "output",
64
- data: { ...type, label: type.title },
64
+ data: { ...type, id, label: type.title },
65
65
  };
66
66
  setNodes((prev) => [...prev, newNode]);
67
67
  }, [screenToFlowPosition, setNodes, type]);
@@ -70,6 +70,6 @@ const AddNodeOnEdgeDrop = (props) => {
70
70
  event.dataTransfer.setData("text/plain", JSON.stringify(nodeType));
71
71
  event.dataTransfer.effectAllowed = "move";
72
72
  };
73
- return (_jsxs("div", { className: "relative p-6 w-full bg-card-background", style: { height: 1000 }, ref: reactFlowWrapper, children: [_jsxs(ReactFlow, { fitView: true, ref: ref, edges: edges, nodes: nodes, onDrop: onDrop, nodeOrigin: [0, 0], onConnect: onConnect, onDragOver: onDragOver, className: "bg-background", nodeTypes: nodeTypes, onEdgesChange: onEdgesChange, onNodesChange: onNodesChange, attributionPosition: "top-right", fitViewOptions: { padding: 2 }, onDragStart: onDragStart, colorMode: props.theme ?? "light", children: [_jsx(MiniMap, {}), _jsx(Background, { bgColor: "hsla(var(--floating-background))" }), _jsx(Controls, {})] }), _jsx(Sidebar, { items: props.parents })] }));
73
+ return (_jsxs("div", { className: "relative w-full bg-card-background", style: { height: 1000 }, ref: reactFlowWrapper, children: [_jsxs(ReactFlow, { fitView: true, ref: ref, edges: edges, nodes: nodes, onDrop: onDrop, nodeOrigin: [0, 0], onConnect: onConnect, onDragOver: onDragOver, className: "bg-background", nodeTypes: nodeTypes, onEdgesChange: onEdgesChange, onNodesChange: onNodesChange, attributionPosition: "top-right", fitViewOptions: { padding: 2 }, onDragStart: onDragStart, colorMode: props.theme ?? "dark", children: [_jsx(MiniMap, {}), _jsx(Background, { bgColor: "hsla(var(--floating-background))" }), _jsx(Controls, {})] }), _jsx(Sidebar, { items: props.parents })] }));
74
74
  };
75
75
  export const Flow = (props) => (_jsx(ReactFlowProvider, { fitView: true, initialMaxZoom: 1, children: _jsx(DnDProvider, { children: _jsx(AddNodeOnEdgeDrop, { ...props }) }) }));
@@ -1,7 +1,8 @@
1
1
  import React, { type ComponentProps } from "react";
2
2
  import { type AllPaths } from "sidekicker";
3
3
  import { z } from "zod";
4
- import { AutocompleteProps, CheckboxProps, DatePickerProps, InputProps, SelectProps, SwitchProps, TextareaProps } from "../components";
4
+ import { AutocompleteProps, CheckboxProps, DatePickerProps, InputProps, MultiSelectProps, SelectProps, SwitchProps, TextareaProps } from "../components";
5
+ import { Any, SetState } from "../types";
5
6
  export declare const formToJson: (form: HTMLFormElement) => any;
6
7
  export declare const getSchemaShape: <T extends z.ZodObject<any>>(name: string, schema: T) => T;
7
8
  type CustomOnInvalid = (args: {
@@ -14,6 +15,7 @@ export type UseOnSubmitArgs<T> = {
14
15
  success: boolean;
15
16
  reset: () => void;
16
17
  form: HTMLFormElement;
18
+ setErrors: SetState<Any>;
17
19
  event: React.FormEvent<HTMLFormElement>;
18
20
  errors: Array<{
19
21
  message: string;
@@ -34,7 +36,7 @@ export type UseFormOptions<T> = Partial<{
34
36
  }>;
35
37
  export declare const createFormStorage: (name: string) => Interceptor<any>;
36
38
  export declare const useForm: <T extends z.ZodObject<any>>(schema: T, formName: string, opts?: UseFormOptions<z.infer<T>>) => {
37
- get: (p: AllPaths<z.TypeOf<T>>) => import("..").Any | "";
39
+ get: (p: AllPaths<z.TypeOf<T>>) => Any | "";
38
40
  input: <Props extends InputProps>(name: AllPaths<z.TypeOf<T>>, props?: Props) => Props;
39
41
  state: z.TypeOf<T>;
40
42
  errors: Record<string, any> | null;
@@ -340,6 +342,7 @@ export declare const useForm: <T extends z.ZodObject<any>>(schema: T, formName:
340
342
  };
341
343
  datepicker: <Props extends DatePickerProps>(name: AllPaths<z.TypeOf<T>>, props?: Props) => Props;
342
344
  name: string;
345
+ multiselect: <Props extends MultiSelectProps>(name: AllPaths<z.TypeOf<T>>, props?: Props) => Props;
343
346
  disabled: boolean;
344
347
  };
345
348
  export declare const getJsonForm: <T extends z.ZodObject<any>>(form?: HTMLFormElement | null) => z.infer<T>;