@g4rcez/components 3.0.0-0 → 3.0.0

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 (175) hide show
  1. package/dist/components/core/button.d.ts +2 -8
  2. package/dist/components/core/button.d.ts.map +1 -1
  3. package/dist/components/core/button.jsx +11 -18
  4. package/dist/components/core/polymorph.d.ts.map +1 -1
  5. package/dist/components/core/slot.d.ts +1 -1
  6. package/dist/components/core/slot.d.ts.map +1 -1
  7. package/dist/components/core/slot.jsx +28 -35
  8. package/dist/components/core/tag.d.ts +1 -1
  9. package/dist/components/core/tag.d.ts.map +1 -1
  10. package/dist/components/core/tag.jsx +3 -3
  11. package/dist/components/core/typography.d.ts.map +1 -1
  12. package/dist/components/core/typography.jsx +16 -20
  13. package/dist/components/display/alert.d.ts.map +1 -1
  14. package/dist/components/display/alert.jsx +19 -17
  15. package/dist/components/display/calendar.d.ts.map +1 -1
  16. package/dist/components/display/calendar.jsx +6 -8
  17. package/dist/components/display/card.d.ts.map +1 -1
  18. package/dist/components/display/card.jsx +6 -6
  19. package/dist/components/display/empty.jsx +1 -1
  20. package/dist/components/display/notifications.d.ts +2 -0
  21. package/dist/components/display/notifications.d.ts.map +1 -1
  22. package/dist/components/display/notifications.jsx +76 -48
  23. package/dist/components/display/progress.d.ts.map +1 -1
  24. package/dist/components/display/progress.jsx +7 -9
  25. package/dist/components/display/shortcut.jsx +1 -1
  26. package/dist/components/display/skeleton.d.ts.map +1 -1
  27. package/dist/components/display/skeleton.jsx +3 -5
  28. package/dist/components/display/step.d.ts.map +1 -1
  29. package/dist/components/display/step.jsx +27 -27
  30. package/dist/components/display/tabs.d.ts.map +1 -1
  31. package/dist/components/display/tabs.jsx +5 -7
  32. package/dist/components/display/timeline.jsx +1 -1
  33. package/dist/components/floating/command-palette.d.ts +1 -0
  34. package/dist/components/floating/command-palette.d.ts.map +1 -1
  35. package/dist/components/floating/command-palette.jsx +92 -70
  36. package/dist/components/floating/dropdown.d.ts.map +1 -1
  37. package/dist/components/floating/dropdown.jsx +15 -15
  38. package/dist/components/floating/menu.d.ts +2 -2
  39. package/dist/components/floating/menu.jsx +2 -2
  40. package/dist/components/floating/modal.d.ts +20 -53
  41. package/dist/components/floating/modal.d.ts.map +1 -1
  42. package/dist/components/floating/modal.jsx +109 -51
  43. package/dist/components/floating/tooltip.d.ts.map +1 -1
  44. package/dist/components/floating/tooltip.jsx +2 -8
  45. package/dist/components/floating/wizard.d.ts +1 -1
  46. package/dist/components/floating/wizard.d.ts.map +1 -1
  47. package/dist/components/floating/wizard.jsx +50 -53
  48. package/dist/components/form/autocomplete.d.ts.map +1 -1
  49. package/dist/components/form/autocomplete.jsx +42 -38
  50. package/dist/components/form/checkbox.jsx +3 -3
  51. package/dist/components/form/date-picker.d.ts.map +1 -1
  52. package/dist/components/form/date-picker.jsx +14 -14
  53. package/dist/components/form/file-upload.jsx +13 -13
  54. package/dist/components/form/free-text.d.ts.map +1 -1
  55. package/dist/components/form/free-text.jsx +3 -3
  56. package/dist/components/form/input-field.d.ts +3 -2
  57. package/dist/components/form/input-field.d.ts.map +1 -1
  58. package/dist/components/form/input-field.jsx +43 -41
  59. package/dist/components/form/multi-select.d.ts.map +1 -1
  60. package/dist/components/form/multi-select.jsx +56 -56
  61. package/dist/components/form/select.d.ts.map +1 -1
  62. package/dist/components/form/select.jsx +3 -3
  63. package/dist/components/form/slider.d.ts.map +1 -1
  64. package/dist/components/form/slider.jsx +10 -10
  65. package/dist/components/form/switch.jsx +2 -2
  66. package/dist/components/form/transfer-list.jsx +3 -3
  67. package/dist/components/index.d.ts +2 -0
  68. package/dist/components/index.d.ts.map +1 -1
  69. package/dist/components/index.js +2 -0
  70. package/dist/components/page-calendar/calendar-header.d.ts +16 -0
  71. package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
  72. package/dist/components/page-calendar/calendar-header.jsx +81 -0
  73. package/dist/components/page-calendar/day-view.d.ts +12 -0
  74. package/dist/components/page-calendar/day-view.d.ts.map +1 -0
  75. package/dist/components/page-calendar/day-view.jsx +87 -0
  76. package/dist/components/page-calendar/event-pill.d.ts +9 -0
  77. package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
  78. package/dist/components/page-calendar/event-pill.jsx +25 -0
  79. package/dist/components/page-calendar/index.d.ts +4 -0
  80. package/dist/components/page-calendar/index.d.ts.map +1 -0
  81. package/dist/components/page-calendar/index.js +2 -0
  82. package/dist/components/page-calendar/month-view.d.ts +11 -0
  83. package/dist/components/page-calendar/month-view.d.ts.map +1 -0
  84. package/dist/components/page-calendar/month-view.jsx +47 -0
  85. package/dist/components/page-calendar/page-calendar.d.ts +18 -0
  86. package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
  87. package/dist/components/page-calendar/page-calendar.jsx +41 -0
  88. package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
  89. package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
  90. package/dist/components/page-calendar/page-calendar.types.js +1 -0
  91. package/dist/components/page-calendar/page-calendar.utils.d.ts +18 -0
  92. package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
  93. package/dist/components/page-calendar/page-calendar.utils.js +71 -0
  94. package/dist/components/page-calendar/week-view.d.ts +11 -0
  95. package/dist/components/page-calendar/week-view.d.ts.map +1 -0
  96. package/dist/components/page-calendar/week-view.jsx +64 -0
  97. package/dist/components/table/filter.jsx +4 -4
  98. package/dist/components/table/index.d.ts.map +1 -1
  99. package/dist/components/table/index.jsx +10 -10
  100. package/dist/components/table/inner-table.d.ts.map +1 -1
  101. package/dist/components/table/inner-table.jsx +18 -18
  102. package/dist/components/table/metadata.d.ts.map +1 -1
  103. package/dist/components/table/metadata.jsx +29 -30
  104. package/dist/components/table/pagination.jsx +1 -1
  105. package/dist/components/table/row.d.ts.map +1 -1
  106. package/dist/components/table/row.jsx +17 -17
  107. package/dist/components/table/sort.jsx +1 -1
  108. package/dist/components/table/table-lib.d.ts.map +1 -1
  109. package/dist/components/table/table-lib.js +1 -2
  110. package/dist/components/table/thead.d.ts.map +1 -1
  111. package/dist/components/table/thead.jsx +6 -6
  112. package/dist/config/context.d.ts.map +1 -1
  113. package/dist/config/default-translations.d.ts +17 -0
  114. package/dist/config/default-translations.d.ts.map +1 -1
  115. package/dist/config/default-translations.jsx +18 -1
  116. package/dist/constants.d.ts.map +1 -1
  117. package/dist/hooks/use-components-provider.d.ts.map +1 -1
  118. package/dist/hooks/use-components-provider.jsx +4 -1
  119. package/dist/hooks/use-form.d.ts +11 -11
  120. package/dist/hooks/use-form.d.ts.map +1 -1
  121. package/dist/hooks/use-form.js +1 -0
  122. package/dist/hooks/use-input-id.d.ts.map +1 -1
  123. package/dist/hooks/use-is-coarse-device.js +1 -1
  124. package/dist/hooks/use-preferences.d.ts.map +1 -1
  125. package/dist/hooks/use-previous.d.ts.map +1 -1
  126. package/dist/hooks/use-previous.js +1 -0
  127. package/dist/hooks/use-reactive.d.ts.map +1 -1
  128. package/dist/hooks/use-reactive.js +1 -0
  129. package/dist/hooks/use-resize-observer.d.ts.map +1 -1
  130. package/dist/hooks/use-stable-ref.d.ts.map +1 -1
  131. package/dist/hooks/use-stable-ref.js +1 -0
  132. package/dist/hooks/use-swipe.d.ts.map +1 -1
  133. package/dist/hooks/use-swipe.js +1 -0
  134. package/dist/hooks/use-translations.d.ts +17 -0
  135. package/dist/hooks/use-translations.d.ts.map +1 -1
  136. package/dist/index.css +1 -0
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js.map +1 -1
  139. package/dist/index.mjs +13689 -12344
  140. package/dist/index.mjs.map +1 -1
  141. package/dist/index.umd.js +24 -17
  142. package/dist/index.umd.js.map +1 -1
  143. package/dist/lib/dom.d.ts +1 -0
  144. package/dist/lib/dom.d.ts.map +1 -1
  145. package/dist/lib/dom.js +20 -2
  146. package/dist/lib/fns.d.ts.map +1 -1
  147. package/dist/lib/fns.js +2 -2
  148. package/dist/preset/plugin.tailwind.d.ts +9 -0
  149. package/dist/preset/plugin.tailwind.d.ts.map +1 -0
  150. package/dist/preset/plugin.tailwind.js +27 -0
  151. package/dist/preset/preset.tailwind.d.ts +8 -0
  152. package/dist/preset/preset.tailwind.d.ts.map +1 -0
  153. package/dist/preset/preset.tailwind.js +54 -0
  154. package/dist/preset/src/styles/common.d.ts +2 -14
  155. package/dist/preset/src/styles/common.d.ts.map +1 -1
  156. package/dist/preset/src/styles/common.js +1 -0
  157. package/dist/preset/src/styles/dark.d.ts.map +1 -1
  158. package/dist/preset/src/styles/dark.js +119 -114
  159. package/dist/preset/src/styles/light.d.ts.map +1 -1
  160. package/dist/preset/src/styles/light.js +111 -106
  161. package/dist/preset/src/styles/theme.types.d.ts +17 -8
  162. package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
  163. package/dist/styles/common.d.ts +2 -14
  164. package/dist/styles/common.d.ts.map +1 -1
  165. package/dist/styles/common.js +1 -0
  166. package/dist/styles/dark.d.ts.map +1 -1
  167. package/dist/styles/dark.js +119 -114
  168. package/dist/styles/light.d.ts.map +1 -1
  169. package/dist/styles/light.js +111 -106
  170. package/dist/styles/theme.types.d.ts +17 -8
  171. package/dist/styles/theme.types.d.ts.map +1 -1
  172. package/package.json +299 -301
  173. package/dist/preset/tailwindcssv4.d.ts +0 -3
  174. package/dist/preset/tailwindcssv4.d.ts.map +0 -1
  175. package/dist/preset/tailwindcssv4.js +0 -75
@@ -2,12 +2,15 @@
2
2
  import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useClick, useDismiss, useFloating, useInteractions, useRole, } from "@floating-ui/react";
3
3
  import { cva } from "class-variance-authority";
4
4
  import { XIcon } from "lucide-react";
5
- import { motion, MotionConfig, useMotionValue, animate } from "motion/react";
5
+ import { AnimatePresence, motion, MotionConfig, useMotionValue, animate, } from "motion/react";
6
6
  import { Slot } from "../core/slot";
7
- import React, { forwardRef, Fragment, useEffect, useId, useImperativeHandle, useRef } from "react";
7
+ import React, { forwardRef, Fragment, useEffect, useId, useImperativeHandle, useRef, useState, useCallback, } from "react";
8
8
  import { useMediaQuery } from "../../hooks/use-media-query";
9
9
  import { css, mergeRefs } from "../../lib/dom";
10
10
  import { useFloatingRef } from "../../hooks/use-floating-ref";
11
+ import { Button } from "../core/button";
12
+ const ConfirmContext = React.createContext(async () => false);
13
+ export const useConfirm = () => React.useContext(ConfirmContext);
11
14
  const animationDuration = "500ms";
12
15
  const drawerLeft = {
13
16
  exit: { x: ["0%", "-30%"], opacity: 0, animationDuration },
@@ -76,13 +79,13 @@ const Draggable = (props) => {
76
79
  return props.value.set(value);
77
80
  }
78
81
  };
79
- return (<motion.button draggable dragListener dragMomentum type="button" animate={false} dragElastic={0} dragPropagation initial={false} onDrag={onDrag} dragSnapToOrigin dragDirectionLock drag={props.sheet ? "y" : "x"} dragConstraints={dragConstraints} whileDrag={{ cursor: "grabbing" }} className={css("absolute rounded-lg isolate z-calendar", props.sheet ? "cursor-row-resize" : "cursor-col-resize bg-floating-border", props.sheet
82
+ return (<motion.button draggable dragListener dragMomentum type="button" animate={false} dragElastic={0} dragPropagation initial={false} onDrag={onDrag} dragSnapToOrigin dragDirectionLock drag={props.sheet ? "y" : "x"} dragConstraints={dragConstraints} whileDrag={{ cursor: "grabbing" }} className={css("absolute isolate z-calendar rounded-lg", props.sheet ? "cursor-row-resize" : "cursor-col-resize bg-floating-border", props.sheet
80
83
  ? "top-1 flex h-3 w-full justify-center py-2"
81
84
  : props.position === "left"
82
85
  ? "right-5 top-1/2 h-10 w-2"
83
86
  : "left-2 top-1/2 h-10 w-2")}>
84
- {props.sheet ? <div className="w-1/4 h-2 rounded-lg bg-floating-border"/> : null}
85
- </motion.button>);
87
+ {props.sheet ? <div className="h-2 w-1/4 rounded-lg bg-floating-border"/> : null}
88
+ </motion.button>);
86
89
  };
87
90
  const positions = { drawer: "right", sheet: "none", dialog: "none" };
88
91
  const fetchPosition = (isDesktop, forceType, propsType, propsPosition) => {
@@ -126,7 +129,10 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
126
129
  sheetY.set(undefined);
127
130
  }, [type, floatingSize, sheetY]);
128
131
  const onClose = () => onChange(false);
129
- useImperativeHandle(externalRef, () => ({ context: floating.context, floating: removeScrollRef.current }), [floating.context, removeScrollRef]);
132
+ useImperativeHandle(externalRef, () => ({ context: floating.context, floating: removeScrollRef.current }), [
133
+ floating.context,
134
+ removeScrollRef,
135
+ ]);
130
136
  const onDragHeader = (_, info) => {
131
137
  const div = floating.refs.floating.current;
132
138
  const rect = div.getBoundingClientRect();
@@ -142,33 +148,37 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
142
148
  onChange?.(false);
143
149
  return setTimeout(() => floatingSize.set(undefined), 350);
144
150
  };
145
- const draggableMotionProps = type === "sheet" ? {
146
- drag: "y",
147
- animate: false,
148
- dragElastic: 0,
149
- initial: false,
150
- dragConstraints,
151
- draggable: true,
152
- dragListener: true,
153
- dragMomentum: true,
154
- onDrag: onDragHeader,
155
- dragPropagation: true,
156
- dragSnapToOrigin: true,
157
- dragDirectionLock: true,
158
- whileDrag: { cursor: "grabbing" },
159
- } : { animate: animated, initial: false };
151
+ const draggableMotionProps = type === "sheet"
152
+ ? {
153
+ drag: "y",
154
+ animate: false,
155
+ dragElastic: 0,
156
+ initial: false,
157
+ dragConstraints,
158
+ draggable: true,
159
+ dragListener: true,
160
+ dragMomentum: true,
161
+ onDrag: onDragHeader,
162
+ dragPropagation: true,
163
+ dragSnapToOrigin: true,
164
+ dragDirectionLock: true,
165
+ whileDrag: { cursor: "grabbing" },
166
+ }
167
+ : { animate: animated, initial: false };
160
168
  const scrollInitial = useMotionValue(undefined);
161
169
  const scroll = useMotionValue(undefined);
162
170
  const Component = asChild ? Slot : motion.button;
163
171
  return (<Fragment>
164
- {trigger ? (<Component ref={floating.refs.setReference} {...interactions.getReferenceProps()} layoutId={layoutId} type="button">
165
- {Trigger}
166
- </Component>) : null}
167
- <FloatingPortal preserveTabOrder root={root}>
168
- {open ? (<FloatingOverlay lockScroll className={css("inset-0 flex isolate bg-floating-overlay/70 z-overlay h-dvh overflow-clip!", type === "drawer" ? "" : "items-start justify-center lg:p-10 pt-10", overlayClassName)}>
169
- <MotionConfig reducedMotion={animated ? "user" : "always"}>
170
- <FloatingFocusManager guards modal closeOnFocusOut={closeOnFocusOut} context={floating.context}>
171
- <motion.div {...props} {...(title
172
+ {trigger ? (<Component ref={floating.refs.setReference} {...interactions.getReferenceProps()} layoutId={layoutId} type="button">
173
+ {Trigger}
174
+ </Component>) : null}
175
+ <MotionConfig reducedMotion={animated ? "user" : "always"}>
176
+ <FloatingPortal preserveTabOrder root={root}>
177
+ <AnimatePresence mode="wait" propagate>
178
+ {open ? (<FloatingOverlay lockScroll className={css("inset-0 isolate z-overlay flex h-[100dvh] !overflow-clip bg-floating-overlay/80", type === "drawer" ? "" : "items-start justify-center pt-10 lg:p-10", overlayClassName)}>
179
+ <FloatingFocusManager guards modal closeOnFocusOut={closeOnFocusOut} context={floating.context}>
180
+ <AnimatePresence propagate>
181
+ <motion.div {...props} {...(title
172
182
  ? {
173
183
  "aria-labelledby": headingId,
174
184
  "aria-describedby": descriptionId,
@@ -178,20 +188,21 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
178
188
  ref: mergeRefs(floating.refs.setFloating, removeScrollRef),
179
189
  className: css(variants({ position, type }), className, "isolate overscroll-contain"),
180
190
  })} exit="exit" layout={true} animate="enter" initial="initial" layoutId={layoutId} variants={animation} data-component="modal" style={type === "drawer" ? { width: floatingSize } : { height: floatingSize, y: sheetY }}>
181
- {useResizer && resizer ? (<Draggable onChange={onChange} value={floatingSize} sheet={type === "sheet"} position={position} parent={floating.refs.floating}/>) : null}
182
- {title ? (<motion.header {...draggableMotionProps} className="relative w-full isolate">
183
- {title ? (<h2 id={headingId} className="block px-8 pb-2 text-3xl font-medium leading-relaxed border-b select-text border-floating-border">
184
- {title}
185
- </h2>) : null}
186
- </motion.header>) : null}
187
- <motion.section ref={innerContent} data-component="modal-body" className={css("flex-1 select-text overflow-y-auto px-8 py-1", bodyClassName)} onTouchEnd={async () => {
191
+ {useResizer && resizer ? (<Draggable onChange={onChange} value={floatingSize} sheet={type === "sheet"} position={position} parent={floating.refs.floating}/>) : null}
192
+ {title ? (<motion.header {...draggableMotionProps} className="relative isolate w-full">
193
+ {title ? (<h2 id={headingId} className="block select-text border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed">
194
+ {title}
195
+ </h2>) : null}
196
+ </motion.header>) : null}
197
+ <motion.section ref={innerContent} data-component="modal-body" className={css("flex-1 select-text overflow-y-auto px-8 py-1", bodyClassName)} onTouchEnd={async () => {
188
198
  scroll.set(undefined);
189
199
  scrollInitial.set(undefined);
190
200
  if (isDragging.current) {
191
201
  const currentY = sheetY.get() || 0;
192
202
  const threshold = window.innerHeight * 0.2;
193
203
  if (currentY > threshold) {
194
- await animate(sheetY, window.innerHeight, { duration: 0.2, ease: "easeIn" }).finished;
204
+ await animate(sheetY, window.innerHeight, { duration: 0.2, ease: "easeIn" })
205
+ .finished;
195
206
  onChange(false);
196
207
  }
197
208
  else {
@@ -224,18 +235,65 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
224
235
  }
225
236
  scroll.set(y);
226
237
  }}>
227
- {children}
228
- </motion.section>
229
- {footer ? (<footer className="px-8 pt-4 w-full border-t select-text border-floating-border">{footer}</footer>) : null}
230
- {closable ? (<nav className="absolute top-1 right-4 z-floating">
231
- <button type="button" onClick={onClose} className="p-1 opacity-70 transition-colors hover:opacity-100 hover:text-danger focus:text-danger">
232
- <XIcon />
233
- </button>
234
- </nav>) : null}
235
- </motion.div>
236
- </FloatingFocusManager>
237
- </MotionConfig>
238
- </FloatingOverlay>) : null}
239
- </FloatingPortal>
240
- </Fragment>);
238
+ {children}
239
+ </motion.section>
240
+ {footer ? (<footer className="w-full select-text border-t border-floating-border px-8 pt-4">{footer}</footer>) : null}
241
+ {closable ? (<nav className="absolute right-4 top-1 z-floating">
242
+ <button type="button" onClick={onClose} className="p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger">
243
+ <XIcon />
244
+ </button>
245
+ </nav>) : null}
246
+ </motion.div>
247
+ </AnimatePresence>
248
+ </FloatingFocusManager>
249
+ </FloatingOverlay>) : null}
250
+ </AnimatePresence>
251
+ </FloatingPortal>
252
+ </MotionConfig>
253
+ </Fragment>);
241
254
  });
255
+ let confirmGlobal = async (options) => {
256
+ if (typeof window !== "undefined") {
257
+ console.warn("ConfirmationProvider is not mounted");
258
+ }
259
+ return false;
260
+ };
261
+ Modal.confirm = (options) => confirmGlobal(options);
262
+ export const ModalConfirmProvider = ({ children }) => {
263
+ const [open, setOpen] = useState(false);
264
+ const [options, setOptions] = useState({});
265
+ const [resolve, setResolve] = useState(() => { });
266
+ const confirmAction = useCallback((opts) => {
267
+ setOptions(opts);
268
+ setOpen(true);
269
+ return new Promise((res) => {
270
+ setResolve(() => res);
271
+ });
272
+ }, []);
273
+ useEffect(() => {
274
+ confirmGlobal = confirmAction;
275
+ }, [confirmAction]);
276
+ const onConfirm = () => {
277
+ setOpen(false);
278
+ const value = options.confirm?.value ?? true;
279
+ resolve(value ?? true);
280
+ };
281
+ const onCancel = () => {
282
+ setOpen(false);
283
+ const value = options.cancel?.value ?? false;
284
+ resolve(value ?? false);
285
+ };
286
+ return (<ConfirmContext.Provider value={confirmAction}>
287
+ {children}
288
+ <Modal open={open} type="dialog" closable={false} onChange={setOpen} overlayClickClose={false} title={options.title || "Confirmation"} className="container max-w-dialog lg:max-w-96" footer={<div className="flex justify-end gap-2">
289
+ <Button theme={options.cancel?.theme || "ghost-muted"} onClick={onCancel}>
290
+ {options.cancel?.text || "Cancel"}
291
+ </Button>
292
+ <Button theme={options.confirm?.theme || "primary"} onClick={onConfirm}>
293
+ {options.confirm?.text || "Confirm"}
294
+ </Button>
295
+ </div>}>
296
+ <div className="py-2 text-foreground">{options.description}</div>
297
+ </Modal>
298
+ </ConfirmContext.Provider>);
299
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAQH,KAAK,SAAS,EAWjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,EAAa,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAI9E,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E;IACI,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,SAAS,aAAa,GAAG,MAAM,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAyF9E,CAAC"}
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAQH,KAAK,SAAS,EAWjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,EAAa,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAI9E,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E;IACI,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,SAAS,aAAa,GAAG,MAAM,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAmF9E,CAAC"}
@@ -18,13 +18,7 @@ export const Tooltip = forwardRef(function Tooltip({ as, open, title, children,
18
18
  open: innerOpen,
19
19
  whileElementsMounted: autoUpdate,
20
20
  onOpenChange: open ? undefined : toggleBoth,
21
- middleware: [
22
- shift(),
23
- offset(5),
24
- autoPlacement(),
25
- arrow({ padding: 5, element: arrowRef }),
26
- flip({ fallbackAxisSideDirection: "start" }),
27
- ],
21
+ middleware: [shift(), offset(5), autoPlacement(), arrow({ padding: 5, element: arrowRef }), flip({ fallbackAxisSideDirection: "start" })],
28
22
  });
29
23
  const dismiss = useDismiss(context, { enabled });
30
24
  const role = useRole(context, { role: "tooltip", enabled });
@@ -55,7 +49,7 @@ export const Tooltip = forwardRef(function Tooltip({ as, open, title, children,
55
49
  {title}
56
50
  </Component>
57
51
  {innerOpen && (<FloatingPortal>
58
- <Polymorph {...getFloatingProps()} ref={refs.setFloating} style={floatingStyles} className="p-3 rounded-lg border isolate z-tooltip border-tooltip-border bg-tooltip-background text-tooltip-foreground shadow-shadow-floating">
52
+ <Polymorph {...getFloatingProps()} ref={refs.setFloating} style={floatingStyles} className="isolate z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-shadow-floating">
59
53
  <FloatingArrow ref={arrowRef} context={context} strokeWidth={0.1} className="fill-tooltip-background stroke-tooltip-border"/>
60
54
  {children}
61
55
  </Polymorph>
@@ -22,5 +22,5 @@ export type WizardProps = {
22
22
  previous?: string;
23
23
  };
24
24
  };
25
- export declare const Wizard: ({ steps, active, onClose, onFinish, onChange, labels: labelsProp, }: WizardProps) => React.JSX.Element | null;
25
+ export declare const Wizard: ({ steps, active, onClose, onFinish, onChange, labels: labelsProp }: WizardProps) => React.JSX.Element | null;
26
26
  //# sourceMappingURL=wizard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../../../src/components/floating/wizard.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAgF,MAAM,OAAO,CAAC;AAOrG,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/E,CAAC;AAiBF,eAAO,MAAM,MAAM,GAAI,qEAOpB,WAAW,6BAgMb,CAAC"}
1
+ {"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../../../src/components/floating/wizard.tsx"],"names":[],"mappings":"AACA,OAAO,EAOH,SAAS,EAKZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAgF,MAAM,OAAO,CAAC;AAOrG,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACjF,CAAC;AAiBF,eAAO,MAAM,MAAM,GAAI,oEAAiG,WAAW,6BAgLlI,CAAC"}
@@ -13,15 +13,15 @@ const getRect = (element) => {
13
13
  return element.getBoundingClientRect();
14
14
  };
15
15
  const resolveElement = (element) => {
16
- if (typeof element === 'string') {
16
+ if (typeof element === "string") {
17
17
  return document.querySelector(element);
18
18
  }
19
- if ('current' in element) {
19
+ if ("current" in element) {
20
20
  return element.current;
21
21
  }
22
22
  return element;
23
23
  };
24
- export const Wizard = ({ steps, active = false, onClose = noop, onFinish = noop, onChange = noop, labels: labelsProp, }) => {
24
+ export const Wizard = ({ steps, active = false, onClose = noop, onFinish = noop, onChange = noop, labels: labelsProp }) => {
25
25
  const translation = useTranslations();
26
26
  const [index, setIndex] = useState(0);
27
27
  const currentStep = steps[index];
@@ -40,14 +40,9 @@ export const Wizard = ({ steps, active = false, onClose = noop, onFinish = noop,
40
40
  open: active && isOverlayReady,
41
41
  placement: currentStep?.side || "bottom",
42
42
  whileElementsMounted: autoUpdate,
43
- middleware: [
44
- offset(10),
45
- flip(),
46
- shift(),
47
- arrow({ element: arrowRef }),
48
- ],
43
+ middleware: [offset(10), flip(), shift(), arrow({ element: arrowRef })],
49
44
  });
50
- const { getFloatingProps } = useInteractions([useRole(context),]);
45
+ const { getFloatingProps } = useInteractions([useRole(context)]);
51
46
  useEffect(() => {
52
47
  if (active) {
53
48
  setIndex(0);
@@ -114,51 +109,53 @@ export const Wizard = ({ steps, active = false, onClose = noop, onFinish = noop,
114
109
  const hasNext = index < steps.length - 1;
115
110
  const hasPrevious = index > 0;
116
111
  return (<FloatingPortal>
117
- <div className="fixed inset-0 pointer-events-none z-wizard">
118
- <svg className="absolute inset-0 w-full h-full fill-current text-floating-overlay/70" xmlns="http://www.w3.org/2000/svg">
119
- <defs>
120
- <mask id="driver-mask">
121
- <rect x="0" y="0" width="100%" height="100%" fill="white"/>
122
- <motion.rect rx="4" fill="black" initial={false} onAnimationComplete={() => setIsOverlayReady(true)} transition={{ type: "spring", duration: 0.5, ease: "easeInOut" }} animate={{
112
+ <div className="pointer-events-none fixed inset-0 z-wizard">
113
+ <svg className="absolute inset-0 h-full w-full fill-current text-floating-overlay/70" xmlns="http://www.w3.org/2000/svg">
114
+ <defs>
115
+ <mask id="driver-mask">
116
+ <rect x="0" y="0" width="100%" height="100%" fill="white"/>
117
+ <motion.rect rx="4" fill="black" initial={false} onAnimationComplete={() => setIsOverlayReady(true)} transition={{ type: "spring", duration: 0.5, ease: "easeInOut" }} animate={{
123
118
  x: rect.left - 5,
124
119
  y: rect.top - 5,
125
120
  width: rect.width + 10,
126
- height: rect.height + 10
121
+ height: rect.height + 10,
127
122
  }}/>
128
- </mask>
129
- </defs>
130
- <rect x="0" y="0" width="100%" height="100%" mask="url(#driver-mask)" className="pointer-events-auto"/>
131
- </svg>
132
- <AnimatePresence mode="wait">
133
- {currentStep && isOverlayReady && (<div {...getFloatingProps()} ref={refs.setFloating} style={element ? floatingStyles : {
134
- position: "fixed",
135
- top: "50%",
136
- left: "50%",
137
- transform: "translate(-50%, -50%)"
138
- }} className="outline-hidden pointer-events-auto">
139
- <motion.div transition={{ duration: 0.2 }} exit={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} initial={{ opacity: 0, scale: 0.9 }} className="flex flex-col gap-3 p-4 w-80 max-w-sm rounded-lg border shadow-lg bg-card-background border-card-border">
140
- {element && (<FloatingArrow ref={arrowRef} context={context} className="fill-card-background stroke-card-border"/>)}
141
- {currentStep.title && (<h3>{currentStep.title}</h3>)}
142
- {currentStep.description && (<Fragment>{currentStep.description}</Fragment>)}
143
- <div className="flex justify-between items-center pt-2 mt-2 border-t border-floating-border">
144
- <Button theme="raw" size="small" onClick={onClose} className="text-xs text-muted-foreground hover:text-foreground">
145
- {labels.skip}
146
- </Button>
147
- <div className="flex gap-2">
148
- {hasPrevious && (<Button size="small" theme="neutral" onClick={handlePrevious}>
149
- {labels.previous}
150
- </Button>)}
151
- <Button size="small" onClick={handleNext}>
152
- {hasNext ? labels.next : labels.finish}
153
- </Button>
154
- </div>
155
- </div>
156
- <div className="absolute top-2 right-2 text-xs text-muted-foreground">
157
- {index + 1} / {steps.length}
158
- </div>
159
- </motion.div>
160
- </div>)}
161
- </AnimatePresence>
162
- </div>
163
- </FloatingPortal>);
123
+ </mask>
124
+ </defs>
125
+ <rect x="0" y="0" width="100%" height="100%" mask="url(#driver-mask)" className="pointer-events-auto"/>
126
+ </svg>
127
+ <AnimatePresence mode="wait">
128
+ {currentStep && isOverlayReady && (<div {...getFloatingProps()} ref={refs.setFloating} style={element
129
+ ? floatingStyles
130
+ : {
131
+ position: "fixed",
132
+ top: "50%",
133
+ left: "50%",
134
+ transform: "translate(-50%, -50%)",
135
+ }} className="pointer-events-auto outline-none">
136
+ <motion.div transition={{ duration: 0.2 }} exit={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} initial={{ opacity: 0, scale: 0.9 }} className="flex w-80 max-w-sm flex-col gap-3 rounded-lg border border-floating-border bg-floating-background p-4 shadow-lg">
137
+ {element && (<FloatingArrow ref={arrowRef} context={context} className="fill-floating-background stroke-floating-border"/>)}
138
+ {currentStep.title && <h3>{currentStep.title}</h3>}
139
+ {currentStep.description && <Fragment>{currentStep.description}</Fragment>}
140
+ <div className="mt-2 flex items-center justify-between border-t border-floating-border pt-2">
141
+ <Button theme="raw" size="small" onClick={onClose} className="text-xs text-muted-foreground hover:text-foreground">
142
+ {labels.skip}
143
+ </Button>
144
+ <div className="flex gap-2">
145
+ {hasPrevious && (<Button size="small" theme="ghost-muted" onClick={handlePrevious}>
146
+ {labels.previous}
147
+ </Button>)}
148
+ <Button size="small" onClick={handleNext}>
149
+ {hasNext ? labels.next : labels.finish}
150
+ </Button>
151
+ </div>
152
+ </div>
153
+ <div className="absolute right-2 top-2 text-xs text-muted-foreground">
154
+ {index + 1} / {steps.length}
155
+ </div>
156
+ </motion.div>
157
+ </div>)}
158
+ </AnimatePresence>
159
+ </div>
160
+ </FloatingPortal>);
164
161
  };
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,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;IACxE,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;CAClC,CAAC;AAiCF,eAAO,MAAM,YAAY,yGA0WxB,CAAC"}
1
+ {"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,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;AA6BF,eAAO,MAAM,YAAY,yGA+WxB,CAAC"}
@@ -15,15 +15,15 @@ import { InputField } from "./input-field";
15
15
  const Frag = (props) => <Fragment>{props.children}</Fragment>;
16
16
  const transitionStyles = {
17
17
  duration: 200,
18
- initial: { transform: "scaleY(0)", opacity: 0.2 },
19
18
  open: { transform: "scaleY(1)", opacity: 1 },
20
19
  close: { transform: "scaleY(0)", opacity: 0 },
20
+ initial: { transform: "scaleY(0)", opacity: 0.2 },
21
21
  };
22
22
  const emptyRef = [];
23
23
  const List = forwardRef(function VirtualList(props, ref) {
24
- return (<motion.ul {...props} ref={ref} className="overscroll-contain w-full rounded-lg h-96">
25
- <AnimatePresence>{props.children}</AnimatePresence>
26
- </motion.ul>);
24
+ return (<motion.ul {...props} ref={ref} className="max-h-96 w-full overscroll-contain rounded-lg">
25
+ <AnimatePresence>{props.children}</AnimatePresence>
26
+ </motion.ul>);
27
27
  });
28
28
  const Item = forwardRef(function VirtualItem({ item, context, ...props }, ref) {
29
29
  return <motion.li {...props} ref={ref} className="first:rounded-t-lg last:rounded-t-lg"/>;
@@ -56,7 +56,10 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
56
56
  : options;
57
57
  const openDropdown = () => flushSync(() => setOpen(true));
58
58
  const list = shadow
59
- ? fzf(innerOptions, "value", [{ key: "value", value: shadow }, { key: "label", value: shadow }])
59
+ ? fzf(innerOptions, "value", [
60
+ { key: "value", value: shadow },
61
+ { key: "label", value: shadow },
62
+ ])
60
63
  : innerOptions;
61
64
  const setClosed = () => {
62
65
  setOpen(false);
@@ -70,10 +73,11 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
70
73
  open,
71
74
  transform: true,
72
75
  onOpenChange: setOpen,
76
+ placement: "bottom-start",
73
77
  whileElementsMounted: autoUpdate,
74
78
  middleware: [
75
79
  offset(4),
76
- autoPlacement({ allowedPlacements: ['top-start', 'bottom-start'], alignment: "start" }),
80
+ autoPlacement({ allowedPlacements: ["top-start", "bottom-start"], alignment: "start" }),
77
81
  size({
78
82
  padding: 10,
79
83
  elementContext: "reference",
@@ -83,7 +87,7 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
83
87
  const DEFAULT_SIZE = getRemainingSize(refs.reference.current, window.innerHeight);
84
88
  const maxH = Math.min(fullSize < MIN_SIZE ? DEFAULT_SIZE : fullSize, DEFAULT_SIZE, args.availableHeight);
85
89
  const size = displayList.length === 0 ? MIN_SIZE : Math.min(maxH, DEFAULT_SIZE, fullSize);
86
- const mw = `${fieldset.current.getBoundingClientRect().width}px`;
90
+ const mw = `${fieldset.current?.getBoundingClientRect().width || DEFAULT_SIZE}px`;
87
91
  Object.assign(args.elements.floating.style, { width: mw, maxWidth: mw, height: size });
88
92
  },
89
93
  }),
@@ -176,19 +180,19 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
176
180
  const shadowId = `${id}-shadow`;
177
181
  const isEmpty = displayList.length === 0;
178
182
  const isTopPlacement = placement === "top" || placement === "top-start";
179
- return (<InputField {...props} left={left} error={error} ref={fieldset} form={props.form} loading={loading} name={props.name} feedback={open && (isTopPlacement) ? props.title : feedback} hideLeft={hideLeft} required={required} title={props.title} container={container} rightLabel={rightLabel} interactive={interactive} id={shadowId} optionalText={optionalText} componentName="autocomplete" labelClassName={labelClassName} placeholder={props.placeholder} right={<span className="flex gap-0.5 items-center">
180
- {right}
181
- <button type="button" className="p-2 transition-colors md:p-1 link:text-primary" onClick={onCaretDownClick}>
182
- <ChevronDown size={20}/>
183
- <span className="sr-only">{translation.inputCaretDown}</span>
184
- </button>
185
- {value ? (<button type="button" onClick={onClose} className="p-2 transition-colors md:p-1 link:text-danger">
186
- <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
187
- <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"/>
188
- </svg>
189
- </button>) : null}
190
- </span>}>
191
- <input data-shadow="true" {...getReferenceProps({
183
+ return (<InputField {...props} left={left} error={error} ref={fieldset} form={props.form} loading={loading} name={props.name} feedback={open && isTopPlacement ? props.title : feedback} hideLeft={hideLeft} required={required} title={props.title} container={container} rightLabel={rightLabel} interactive={interactive} id={shadowId} optionalText={optionalText} componentName="autocomplete" labelClassName={labelClassName} placeholder={props.placeholder} right={<span className="flex items-center gap-0.5">
184
+ {right}
185
+ <button type="button" className="p-2 transition-colors link:text-primary md:p-1" onClick={onCaretDownClick}>
186
+ <ChevronDown size={20}/>
187
+ <span className="sr-only">{translation.inputCaretDown}</span>
188
+ </button>
189
+ {value ? (<button type="button" onClick={onClose} className="p-2 transition-colors link:text-danger md:p-1">
190
+ <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
191
+ <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"/>
192
+ </svg>
193
+ </button>) : null}
194
+ </span>}>
195
+ <input data-shadow="true" {...getReferenceProps({
192
196
  ...props,
193
197
  onFocus,
194
198
  pattern,
@@ -229,14 +233,14 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
229
233
  }
230
234
  }
231
235
  },
232
- })} data-value={value} data-error={!!error} data-name={id} data-target={id} required={required} value={open ? shadow : options.length === 0 ? "" : 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-hidden 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)}/>
233
- <input id={id} name={id} type="hidden" data-origin={id} ref={externalRef} required={required} defaultValue={props.value || value || undefined}/>
234
- <FloatingPortal preserveTabOrder>
235
- {open ? (<FloatingFocusManager modal guards returnFocus={false} context={context} initialFocus={-1} visuallyHiddenDismiss>
236
- <motion.div {...getFloatingProps({
236
+ })} data-value={value} data-error={!!error} data-name={id} data-target={id} required={required} value={open ? shadow : options.length === 0 ? "" : 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)}/>
237
+ <input id={id} name={id} type="hidden" data-origin={id} ref={externalRef} required={required} defaultValue={props.value || value || undefined}/>
238
+ <FloatingPortal preserveTabOrder>
239
+ {open ? (<FloatingFocusManager modal guards returnFocus={false} context={context} initialFocus={-1} visuallyHiddenDismiss>
240
+ <motion.div {...getFloatingProps({
237
241
  ref: mergeRefs(removeScrollRef, refs.setFloating),
238
242
  style: { ...transitions.styles, left: x, top: y ?? 0, position: strategy, height: "auto" },
239
- })} initial={false} data-floating="true" animate={{ height: isEmpty ? "auto" : h }} className={css("overscroll-contain p-0 m-0 max-h-80 list-none rounded-t-lg rounded-b-lg border ease-in-out isolate z-floating border-floating-border bg-floating-background text-foreground shadow-floating", isTopPlacement ? "origin-[bottom_center]" : "origin-[top_center]")} onAnimationComplete={() => {
243
+ })} initial={false} data-floating="true" animate={{ height: isEmpty ? "auto" : h }} className={css("shadow-floating 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 ease-in-out", isTopPlacement ? "origin-[bottom_center]" : "origin-[top_center]")} onAnimationComplete={() => {
240
244
  if (!open)
241
245
  return setH(0);
242
246
  const ul = refs.floating.current;
@@ -244,12 +248,12 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
244
248
  const sum = (li ? li.getBoundingClientRect().height : MIN_SIZE) * displayList.length;
245
249
  return flushSync(() => setH(sum + 2));
246
250
  }}>
247
- {isEmpty ? (<div role="option" className="w-full border-b border-tooltip-border">
248
- <span className="flex justify-between p-2 w-full text-left text-disabled">
249
- {emptyMessage || translation.autocompleteEmpty}
250
- </span>
251
- </div>) : null}
252
- <Virtuoso overscan={40} ref={virtuoso} hidden={isEmpty} data={displayList} style={{ height: h }} defaultItemHeight={MIN_SIZE} components={components} scrollerRef={(e) => void (scroller.current = e)} className="overscroll-contain p-0 max-h-full rounded-lg border-floating bg-floating-background text-foreground" itemContent={(i, option) => {
251
+ {isEmpty ? (<div role="option" className="w-full border-b border-tooltip-border">
252
+ <span className="flex w-full justify-between p-2 text-left text-disabled">
253
+ {emptyMessage || translation.autocompleteEmpty}
254
+ </span>
255
+ </div>) : null}
256
+ <Virtuoso overscan={40} ref={virtuoso} hidden={isEmpty} data={displayList} style={{ height: h }} defaultItemHeight={MIN_SIZE} components={components} scrollerRef={(e) => void (scroller.current = e)} className="border-floating max-h-full overscroll-contain rounded-lg bg-floating-background p-0 text-foreground" itemContent={(i, option) => {
253
257
  const Label = option.Render ?? Frag;
254
258
  const active = value === option.value || value === option.label;
255
259
  const selected = index === i;
@@ -265,11 +269,11 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
265
269
  onClick: () => onSelect(option, i),
266
270
  className: `cursor-pointer min-h-10 hover:bg-floating-hover w-full p-2 text-left ${active ? "bg-primary-hover text-primary-foreground" : ""} ${selected ? "bg-floating-hover text-floating-foreground" : ""}`,
267
271
  })}>
268
- <Label {...props} label={option.label} value={option.value} children={children}/>
269
- </button>);
272
+ <Label {...props} label={option.label} value={option.value} children={children}/>
273
+ </button>);
270
274
  }}/>
271
- </motion.div>
272
- </FloatingFocusManager>) : null}
273
- </FloatingPortal>
274
- </InputField>);
275
+ </motion.div>
276
+ </FloatingFocusManager>) : null}
277
+ </FloatingPortal>
278
+ </InputField>);
275
279
  });
@@ -3,10 +3,10 @@ import { css } from "../../lib/dom";
3
3
  export const Checkbox = forwardRef(({ children, asTask = false, labelClassName, loading, error, className = "", size, container, ...props }, ref) => {
4
4
  const d = props.disabled || loading;
5
5
  return (<label aria-disabled={d} data-disabled={d} data-task={asTask} data-component="checkbox" className={css("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed", asTask ? "group-checkbox-checked:line-through" : "", container)}>
6
- <input {...props} ref={ref} disabled={d} type="checkbox" data-task={asTask} className={css("form-checkbox mr-2 inline-block size-4 appearance-none rounded-sm border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed", className)}/>
6
+ <input {...props} ref={ref} disabled={d} type="checkbox" data-task={asTask} className={css("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed", className)}/>
7
7
  {children}
8
8
  <span data-name="checkbox-label" className={css("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden", labelClassName)}>
9
- {error}
10
- </span>
9
+ {error}
10
+ </span>
11
11
  </label>);
12
12
  });
@@ -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,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;CACzB,CAAC,EAAE,UAAU,CAAC,CAAA;AAkDf,eAAO,MAAM,UAAU,uGA+HtB,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,CAC9B,QAAQ,CACJ,UAAU,EACV,aAAa,GAAG;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B,CACJ,EACD,UAAU,CACb,CAAC;AAkDF,eAAO,MAAM,UAAU,uGAoItB,CAAC"}