@g4rcez/components 2.2.8 → 2.3.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 (126) hide show
  1. package/dist/components/core/button.d.ts.map +1 -1
  2. package/dist/components/core/polymorph.d.ts.map +1 -1
  3. package/dist/components/core/slot.d.ts +1 -1
  4. package/dist/components/core/slot.d.ts.map +1 -1
  5. package/dist/components/core/slot.jsx +28 -35
  6. package/dist/components/core/tag.jsx +1 -1
  7. package/dist/components/core/typography.d.ts.map +1 -1
  8. package/dist/components/core/typography.jsx +16 -20
  9. package/dist/components/display/alert.d.ts.map +1 -1
  10. package/dist/components/display/alert.jsx +22 -24
  11. package/dist/components/display/calendar.d.ts.map +1 -1
  12. package/dist/components/display/calendar.jsx +5 -7
  13. package/dist/components/display/card.d.ts.map +1 -1
  14. package/dist/components/display/card.jsx +5 -5
  15. package/dist/components/display/empty.jsx +1 -1
  16. package/dist/components/display/notifications.d.ts.map +1 -1
  17. package/dist/components/display/notifications.jsx +35 -35
  18. package/dist/components/display/progress.d.ts.map +1 -1
  19. package/dist/components/display/progress.jsx +6 -8
  20. package/dist/components/display/shortcut.jsx +1 -1
  21. package/dist/components/display/skeleton.d.ts.map +1 -1
  22. package/dist/components/display/skeleton.jsx +3 -5
  23. package/dist/components/display/step.d.ts.map +1 -1
  24. package/dist/components/display/step.jsx +27 -27
  25. package/dist/components/display/tabs.d.ts.map +1 -1
  26. package/dist/components/display/tabs.jsx +5 -7
  27. package/dist/components/floating/command-palette.d.ts.map +1 -1
  28. package/dist/components/floating/command-palette.jsx +40 -40
  29. package/dist/components/floating/dropdown.d.ts.map +1 -1
  30. package/dist/components/floating/dropdown.jsx +15 -15
  31. package/dist/components/floating/modal.d.ts.map +1 -1
  32. package/dist/components/floating/modal.jsx +73 -67
  33. package/dist/components/floating/tooltip.d.ts.map +1 -1
  34. package/dist/components/floating/tooltip.jsx +2 -8
  35. package/dist/components/floating/wizard.d.ts +1 -1
  36. package/dist/components/floating/wizard.d.ts.map +1 -1
  37. package/dist/components/floating/wizard.jsx +50 -53
  38. package/dist/components/form/autocomplete.d.ts.map +1 -1
  39. package/dist/components/form/autocomplete.jsx +38 -35
  40. package/dist/components/form/checkbox.jsx +2 -2
  41. package/dist/components/form/date-picker.d.ts.map +1 -1
  42. package/dist/components/form/date-picker.jsx +14 -14
  43. package/dist/components/form/file-upload.jsx +13 -13
  44. package/dist/components/form/free-text.d.ts.map +1 -1
  45. package/dist/components/form/free-text.jsx +2 -2
  46. package/dist/components/form/input-field.d.ts.map +1 -1
  47. package/dist/components/form/input-field.jsx +42 -41
  48. package/dist/components/form/multi-select.d.ts.map +1 -1
  49. package/dist/components/form/multi-select.jsx +56 -56
  50. package/dist/components/form/select.d.ts.map +1 -1
  51. package/dist/components/form/select.jsx +13 -13
  52. package/dist/components/form/slider.d.ts.map +1 -1
  53. package/dist/components/form/slider.jsx +10 -10
  54. package/dist/components/form/transfer-list.jsx +3 -3
  55. package/dist/components/index.d.ts +1 -0
  56. package/dist/components/index.d.ts.map +1 -1
  57. package/dist/components/index.js +1 -0
  58. package/dist/components/page-calendar/calendar-header.d.ts +16 -0
  59. package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
  60. package/dist/components/page-calendar/calendar-header.jsx +81 -0
  61. package/dist/components/page-calendar/day-view.d.ts +12 -0
  62. package/dist/components/page-calendar/day-view.d.ts.map +1 -0
  63. package/dist/components/page-calendar/day-view.jsx +84 -0
  64. package/dist/components/page-calendar/event-pill.d.ts +9 -0
  65. package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
  66. package/dist/components/page-calendar/event-pill.jsx +23 -0
  67. package/dist/components/page-calendar/index.d.ts +4 -0
  68. package/dist/components/page-calendar/index.d.ts.map +1 -0
  69. package/dist/components/page-calendar/index.js +2 -0
  70. package/dist/components/page-calendar/month-view.d.ts +11 -0
  71. package/dist/components/page-calendar/month-view.d.ts.map +1 -0
  72. package/dist/components/page-calendar/month-view.jsx +47 -0
  73. package/dist/components/page-calendar/page-calendar.d.ts +18 -0
  74. package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
  75. package/dist/components/page-calendar/page-calendar.jsx +39 -0
  76. package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
  77. package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
  78. package/dist/components/page-calendar/page-calendar.types.js +1 -0
  79. package/dist/components/page-calendar/page-calendar.utils.d.ts +18 -0
  80. package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
  81. package/dist/components/page-calendar/page-calendar.utils.js +71 -0
  82. package/dist/components/page-calendar/week-view.d.ts +11 -0
  83. package/dist/components/page-calendar/week-view.d.ts.map +1 -0
  84. package/dist/components/page-calendar/week-view.jsx +61 -0
  85. package/dist/components/table/filter.jsx +4 -4
  86. package/dist/components/table/index.d.ts.map +1 -1
  87. package/dist/components/table/index.jsx +10 -10
  88. package/dist/components/table/inner-table.d.ts.map +1 -1
  89. package/dist/components/table/inner-table.jsx +18 -18
  90. package/dist/components/table/metadata.d.ts.map +1 -1
  91. package/dist/components/table/metadata.jsx +29 -30
  92. package/dist/components/table/pagination.jsx +1 -1
  93. package/dist/components/table/row.d.ts.map +1 -1
  94. package/dist/components/table/row.jsx +17 -17
  95. package/dist/components/table/sort.jsx +1 -1
  96. package/dist/components/table/table-lib.d.ts.map +1 -1
  97. package/dist/components/table/table-lib.js +1 -2
  98. package/dist/components/table/thead.d.ts.map +1 -1
  99. package/dist/components/table/thead.jsx +5 -5
  100. package/dist/config/context.d.ts.map +1 -1
  101. package/dist/config/default-translations.d.ts +10 -0
  102. package/dist/config/default-translations.d.ts.map +1 -1
  103. package/dist/config/default-translations.jsx +11 -1
  104. package/dist/constants.d.ts.map +1 -1
  105. package/dist/hooks/use-components-provider.d.ts.map +1 -1
  106. package/dist/hooks/use-components-provider.jsx +2 -2
  107. package/dist/hooks/use-form.d.ts.map +1 -1
  108. package/dist/hooks/use-input-id.d.ts.map +1 -1
  109. package/dist/hooks/use-is-coarse-device.js +1 -1
  110. package/dist/hooks/use-preferences.d.ts.map +1 -1
  111. package/dist/hooks/use-resize-observer.d.ts.map +1 -1
  112. package/dist/hooks/use-translations.d.ts +10 -0
  113. package/dist/hooks/use-translations.d.ts.map +1 -1
  114. package/dist/index.css +1 -1
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js.map +1 -1
  117. package/dist/index.mjs +10121 -9704
  118. package/dist/index.mjs.map +1 -1
  119. package/dist/index.umd.js +14 -14
  120. package/dist/index.umd.js.map +1 -1
  121. package/dist/lib/dom.d.ts.map +1 -1
  122. package/dist/lib/fns.d.ts.map +1 -1
  123. package/dist/lib/fns.js +2 -2
  124. package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
  125. package/dist/styles/theme.types.d.ts.map +1 -1
  126. package/package.json +289 -289
@@ -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-none 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-floating-background border-floating-border">
140
- {element && (<FloatingArrow ref={arrowRef} context={context} className="fill-floating-background stroke-floating-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="ghost-muted" 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,yGAyWxB,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"}
@@ -21,9 +21,9 @@ const transitionStyles = {
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 max-h-96 rounded-lg">
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);
@@ -74,7 +77,7 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
74
77
  whileElementsMounted: autoUpdate,
75
78
  middleware: [
76
79
  offset(4),
77
- autoPlacement({ allowedPlacements: ['top-start', 'bottom-start'], alignment: "start" }),
80
+ autoPlacement({ allowedPlacements: ["top-start", "bottom-start"], alignment: "start" }),
78
81
  size({
79
82
  padding: 10,
80
83
  elementContext: "reference",
@@ -177,19 +180,19 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
177
180
  const shadowId = `${id}-shadow`;
178
181
  const isEmpty = displayList.length === 0;
179
182
  const isTopPlacement = placement === "top" || placement === "top-start";
180
- 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">
181
- {right}
182
- <button type="button" className="p-2 transition-colors md:p-1 link:text-primary" onClick={onCaretDownClick}>
183
- <ChevronDown size={20}/>
184
- <span className="sr-only">{translation.inputCaretDown}</span>
185
- </button>
186
- {value ? (<button type="button" onClick={onClose} className="p-2 transition-colors md:p-1 link:text-danger">
187
- <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">
188
- <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"/>
189
- </svg>
190
- </button>) : null}
191
- </span>}>
192
- <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({
193
196
  ...props,
194
197
  onFocus,
195
198
  pattern,
@@ -231,13 +234,13 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
231
234
  }
232
235
  },
233
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)}/>
234
- <input id={id} name={id} type="hidden" data-origin={id} ref={externalRef} required={required} defaultValue={props.value || value || undefined}/>
235
- <FloatingPortal preserveTabOrder>
236
- {open ? (<FloatingFocusManager modal guards returnFocus={false} context={context} initialFocus={-1} visuallyHiddenDismiss>
237
- <motion.div {...getFloatingProps({
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({
238
241
  ref: mergeRefs(removeScrollRef, refs.setFloating),
239
242
  style: { ...transitions.styles, left: x, top: y ?? 0, position: strategy, height: "auto" },
240
- })} 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 origin-[top_center] 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={() => {
241
244
  if (!open)
242
245
  return setH(0);
243
246
  const ul = refs.floating.current;
@@ -245,12 +248,12 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
245
248
  const sum = (li ? li.getBoundingClientRect().height : MIN_SIZE) * displayList.length;
246
249
  return flushSync(() => setH(sum + 2));
247
250
  }}>
248
- {isEmpty ? (<div role="option" className="w-full border-b border-tooltip-border">
249
- <span className="flex justify-between p-2 w-full text-left text-disabled">
250
- {emptyMessage || translation.autocompleteEmpty}
251
- </span>
252
- </div>) : null}
253
- <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) => {
254
257
  const Label = option.Render ?? Frag;
255
258
  const active = value === option.value || value === option.label;
256
259
  const selected = index === i;
@@ -266,11 +269,11 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
266
269
  onClick: () => onSelect(option, i),
267
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" : ""}`,
268
271
  })}>
269
- <Label {...props} label={option.label} value={option.value} children={children}/>
270
- </button>);
272
+ <Label {...props} label={option.label} value={option.value} children={children}/>
273
+ </button>);
271
274
  }}/>
272
- </motion.div>
273
- </FloatingFocusManager>) : null}
274
- </FloatingPortal>
275
- </InputField>);
275
+ </motion.div>
276
+ </FloatingFocusManager>) : null}
277
+ </FloatingPortal>
278
+ </InputField>);
276
279
  });
@@ -6,7 +6,7 @@ export const Checkbox = forwardRef(({ children, asTask = false, labelClassName,
6
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"}
@@ -35,8 +35,8 @@ const partValues = {
35
35
  };
36
36
  const formatParts = (datetimeFormat, date) => {
37
37
  try {
38
- return datetimeFormat.formatToParts(date).map(x => {
39
- if ((x.type === "literal" && x.value === ", ")) {
38
+ return datetimeFormat.formatToParts(date).map((x) => {
39
+ if (x.type === "literal" && x.value === ", ") {
40
40
  return { type: x.type, value: " " };
41
41
  }
42
42
  return x;
@@ -98,18 +98,18 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
98
98
  };
99
99
  const validDate = isValid(innerDate);
100
100
  const htmlValue = validDate ? innerDate.toISOString() : undefined;
101
- const CalendarComponent = <Calendar {...props} type={type} locale={locale} changeOnlyOnClick markToday={markToday} onChange={onChangeDate} disabledDate={disabledDate} date={validDate ? innerDate : undefined}/>;
101
+ const CalendarComponent = (<Calendar {...props} type={type} locale={locale} changeOnlyOnClick markToday={markToday} onChange={onChangeDate} disabledDate={disabledDate} date={validDate ? innerDate : undefined}/>);
102
102
  return (<Fragment>
103
- <Input {...props} mask={mask} value={value} id={undefined} name={undefined} data-value={htmlValue} formNoValidate={!open} data-target={props.name} data-component="date-picker" onChange={onChangeDateInput} required={props.required ?? true} error={open ? undefined : props.error} placeholder={props.placeholder || translation.datepickerPlaceholder(placeholder)} right={floating ? <Fragment>
104
- <input data-origin={props.name} defaultValue={htmlValue} form={props.form} hidden id={props.name} name={props.name} ref={externalRef} type="date"/>
105
- <Dropdown open={open} onChange={setOpen} buttonProps={{ "aria-describedby": labelId }} trigger={<span aria-labelledby={labelId}>
106
- <span id={labelId} className="sr-only">
107
- {translation.datePickerCalendarButtonLabel}
108
- </span>
109
- <CalendarIcon />
110
- </span>}>
111
- {CalendarComponent}
112
- </Dropdown>
113
- </Fragment> : null}/>
103
+ <Input {...props} mask={mask} value={value} id={undefined} name={undefined} data-value={htmlValue} formNoValidate={!open} data-target={props.name} data-component="date-picker" onChange={onChangeDateInput} required={props.required ?? true} error={open ? undefined : props.error} placeholder={props.placeholder || translation.datepickerPlaceholder(placeholder)} right={floating ? (<Fragment>
104
+ <input data-origin={props.name} defaultValue={htmlValue} form={props.form} hidden id={props.name} name={props.name} ref={externalRef} type="date"/>
105
+ <Dropdown open={open} onChange={setOpen} buttonProps={{ "aria-describedby": labelId }} trigger={<span aria-labelledby={labelId}>
106
+ <span id={labelId} className="sr-only">
107
+ {translation.datePickerCalendarButtonLabel}
108
+ </span>
109
+ <CalendarIcon />
110
+ </span>}>
111
+ {CalendarComponent}
112
+ </Dropdown>
113
+ </Fragment>) : null}/>
114
114
  </Fragment>);
115
115
  });
@@ -47,30 +47,30 @@ const ItemViewer = (props) => {
47
47
  props.onDeleteFile?.(props.file);
48
48
  };
49
49
  const Icon = extensionMap[props.file.name.split(".").at(-1)] ?? FileIcon;
50
- const Element = info.type === "img" ? (<img src={info.url} className="object-contain w-full" alt={props.file.name}/>) : (<Icon strokeWidth={2} absoluteStrokeWidth size={48}/>);
51
- return (<li className="flex flex-row gap-4 justify-between w-full border-b border-card-border last:border-b-transparent">
50
+ const Element = info.type === "img" ? (<img src={info.url} className="w-full object-contain" alt={props.file.name}/>) : (<Icon strokeWidth={2} absoluteStrokeWidth size={48}/>);
51
+ return (<li className="flex w-full flex-row justify-between gap-4 border-b border-card-border last:border-b-transparent">
52
52
  <div className="flex flex-col gap-4">
53
- <div className="flex flex-row gap-4 items-center">
54
- <button type="button" onClick={onViewFile} className="flex overflow-hidden justify-center items-center max-w-16 m-2 size-16">
53
+ <div className="flex flex-row items-center gap-4">
54
+ <button type="button" onClick={onViewFile} className="m-2 flex size-16 max-w-16 items-center justify-center overflow-hidden">
55
55
  {Element}
56
56
  </button>
57
- <div className="flex flex-col justify-start items-start text-left">
57
+ <div className="flex flex-col items-start justify-start text-left">
58
58
  <span>{props.file.name}</span>
59
59
  <span className="text-sm italic">{info.size}</span>
60
60
  </div>
61
61
  </div>
62
- {props.File ? (<div className="flex-1 min-w-full">
62
+ {props.File ? (<div className="min-w-full flex-1">
63
63
  <props.File file={props.file}/>
64
64
  </div>) : null}
65
65
  </div>
66
- <div className="flex justify-start py-4 transition-colors duration-300 ease-linear align-start hover:text-danger-hover">
67
- <button onClick={onDeleteFile} type="button" className="flex justify-center items-center size-6">
66
+ <div className="align-start flex justify-start py-4 transition-colors duration-300 ease-linear hover:text-danger-hover">
67
+ <button onClick={onDeleteFile} type="button" className="flex size-6 items-center justify-center">
68
68
  <XIcon size={16}/>
69
69
  </button>
70
70
  </div>
71
71
  </li>);
72
72
  };
73
- const FilesList = (props) => (<ul className="space-y-8 w-full">
73
+ const FilesList = (props) => (<ul className="w-full space-y-8">
74
74
  {props.files.map((file) => {
75
75
  return <ItemViewer File={props.File} onDeleteFile={props.onDeleteFile} key={file.name} file={file}/>;
76
76
  })}
@@ -78,13 +78,13 @@ const FilesList = (props) => (<ul className="space-y-8 w-full">
78
78
  const Idle = (props) => {
79
79
  const t = useTranslations();
80
80
  const Icon = props.dragging ? FolderOpenIcon : FolderIcon;
81
- return (<div className="flex flex-col justify-center items-center">
82
- <div className="flex flex-col gap-2 justify-center items-center">
81
+ return (<div className="flex flex-col items-center justify-center">
82
+ <div className="flex flex-col items-center justify-center gap-2">
83
83
  <Icon className="text-primary" size={80}/>
84
84
  </div>
85
- <div className="flex flex-col gap-1 items-center my-4">
85
+ <div className="my-4 flex flex-col items-center gap-1">
86
86
  <p>{t.uploadIdle}</p>
87
- <button className="underline text-primary" type="button">
87
+ <button className="text-primary underline" type="button">
88
88
  {t.uploadIdleButton}
89
89
  </button>
90
90
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"free-text.d.ts","sourceRoot":"","sources":["../../../src/components/form/free-text.tsx"],"names":[],"mappings":"AAEA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,KAAK,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;AAExC,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,UAAU,SAAS,GAAG,IAAI,QAAQ,CACjF,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAChF,UAAU,CACX,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,CAAC,IAAI,SAAS,gBAAgB,GAAG,mBAAmB,EAAE,KAAK,SAAS,GAAG,EACtI,SAAS,OAAO,GAAG,UAAU,GAAG,OAAO,SAAS,EAChD,aAAa,OAAO,GAAG,UAAU,EACjC,cAAc,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,EACrC,WAAW,CAAC,EAAE,EAAE,IAAI,KAAK,MAAM,IAAI,4CAyGpC,CAAC"}
1
+ {"version":3,"file":"free-text.d.ts","sourceRoot":"","sources":["../../../src/components/form/free-text.tsx"],"names":[],"mappings":"AAEA,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3E,KAAK,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;AAExC,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,UAAU,SAAS,GAAG,IAAI,QAAQ,CAC/E,eAAe,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,EAChF,UAAU,CACb,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,CAAC,IAAI,SAAS,gBAAgB,GAAG,mBAAmB,EAAE,KAAK,SAAS,GAAG,EACpI,SAAS,OAAO,GAAG,UAAU,GAAG,OAAO,SAAS,EAChD,aAAa,OAAO,GAAG,UAAU,EACjC,cAAc,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,EACrC,WAAW,CAAC,EAAE,EAAE,IAAI,KAAK,MAAM,IAAI,4CAyGtC,CAAC"}
@@ -34,8 +34,8 @@ export const createFreeText = (Element, elementName, defaultProps, register) =>
34
34
  };
35
35
  }, []);
36
36
  return (<InputField {...defaultProps} info={info} left={left} error={error} right={right} form={props.form} loading={loading} name={props.name} feedback={feedback} hideLeft={hideLeft} title={props.title} rightLabel={rightLabel} disabled={props.disabled} hiddenLabel={hiddenLabel} interactive={interactive} required={props.required} componentName={elementName} id={props.name || props.id} optionalText={optionalText} labelClassName={labelClassName} placeholder={props.placeholder} container={css(container, defaultProps.container)}>
37
- <Render {...defaultProps} {...props} id={id} name={id} type={type} data-next={next} aria-busy={props.disabled} aria-disabled={props.disabled} aria-readonly={props.readOnly} ref={mergeRefs(ref, inputRef)} 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-base 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", "resize-y group-focus-within:border-primary group-hover:border-primary", "disabled:cursor-not-allowed disabled:text-disabled", props.className)}/>
38
- </InputField>);
37
+ <Render {...defaultProps} {...props} id={id} name={id} type={type} data-next={next} aria-busy={props.disabled} aria-disabled={props.disabled} aria-readonly={props.readOnly} ref={mergeRefs(ref, inputRef)} 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-base 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", "resize-y group-focus-within:border-primary group-hover:border-primary", "disabled:cursor-not-allowed disabled:text-disabled", props.className)}/>
38
+ </InputField>);
39
39
  });
40
40
  return FreeText;
41
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CACjD,OAAO,CAAC;IACN,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CACH,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,kEAA0E,aAAa,sBA8CpH,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,IAAI,gBAAgB,CACvF,OAAO,CACL,QAAQ,CACN,aAAa,EACb;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CACF,CACF,EACD,CAAC,CACF,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,EAAE,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YA+EpH,CAAC"}
1
+ {"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAC/C,OAAO,CAAC;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACxB,CAAC,CACL,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,kEAA0E,aAAa,sBAmDpH,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,IAAI,gBAAgB,CACrF,OAAO,CACH,QAAQ,CACJ,aAAa,EACb;IACI,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB,CACJ,CACJ,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,EAAE,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YAmFpH,CAAC"}
@@ -6,50 +6,51 @@ import { useTweaks } from "../../hooks/use-tweaks";
6
6
  import { css } from "../../lib/dom";
7
7
  import { Tooltip } from "../floating/tooltip";
8
8
  export const InputFeedback = ({ reportStatus, id, hideLeft = false, className, info, children, title }) => (<span className={css("w-full justify-between", hideLeft && children === null ? "hidden" : "flex", className)}>
9
- {hideLeft ? null : (<span className="flex gap-1 items-center transition-colors group-disabled:text-disabled group-error:text-danger group-hover:text-primary group-focus-within:text-primary">
10
- {title}
11
- {reportStatus || info ? (<span className="flex gap-1 justify-center items-center">
12
- {info ? (<Tooltip as="button" type="button" aria-label={typeof info === "string" ? info : undefined} aria-describedby={typeof info === "string" ? undefined : id ? `tooltip-info-content-${id}` : undefined} title={<span className="cursor-help">
13
- <InfoIcon className="aspect-square size-3" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
14
- </span>}>
15
- <div id={id ? `tooltip-info-content-${id}` : undefined} className="w-full break-words max-w-48 whitespace-break-spaces">{info}</div>
16
- </Tooltip>) : null}
17
- {reportStatus ? (<span className="flex items-center h-3 min-w-6">
18
- <CheckCircle className="hidden opacity-0 transition-opacity aspect-square size-3 group-assert:block group-assert:text-success group-assert:opacity-100" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
19
- <XCircle className="hidden opacity-0 transition-opacity aspect-square size-3 group-error:block group-error:opacity-100" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
20
- </span>) : null}
21
- </span>) : null}
22
- </span>)}
23
- {children}
24
- </span>);
25
- export const InputField = forwardRef(({ optionalText: _optionalText, left, rightLabel, container, feedback, interactive, right, info, children, error, form, id, labelClassName = "", name, title, componentName, placeholder, hideLeft = false, required, disabled, reportStatus, hiddenLabel }, ref) => {
9
+ {hideLeft ? null : (<span className="flex items-center gap-1 transition-colors group-focus-within:text-primary group-hover:text-primary group-disabled:text-disabled group-error:text-danger">
10
+ {title}
11
+ {reportStatus || info ? (<span className="flex items-center justify-center gap-1">
12
+ {info ? (<Tooltip as="button" type="button" aria-label={typeof info === "string" ? info : undefined} aria-describedby={typeof info === "string" ? undefined : id ? `tooltip-info-content-${id}` : undefined} title={<span className="cursor-help">
13
+ <InfoIcon className="aspect-square size-3" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
14
+ </span>}>
15
+ <div id={id ? `tooltip-info-content-${id}` : undefined} className="w-full max-w-48 whitespace-break-spaces break-words">
16
+ {info}
17
+ </div>
18
+ </Tooltip>) : null}
19
+ {reportStatus ? (<span className="flex h-3 min-w-6 items-center">
20
+ <CheckCircle className="hidden aspect-square size-3 opacity-0 transition-opacity group-assert:block group-assert:text-success group-assert:opacity-100" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
21
+ <XCircle className="hidden aspect-square size-3 opacity-0 transition-opacity group-error:block group-error:opacity-100" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
22
+ </span>) : null}
23
+ </span>) : null}
24
+ </span>)}
25
+ {children}
26
+ </span>);
27
+ export const InputField = forwardRef(({ optionalText: _optionalText, left, rightLabel, container, feedback, interactive, right, info, children, error, form, id, labelClassName = "", name, title, componentName, placeholder, hideLeft = false, required, disabled, reportStatus, hiddenLabel, }, ref) => {
26
28
  const tweaks = useTweaks();
27
29
  const reportStatusDefault = reportStatus !== undefined ? reportStatus : tweaks.input.iconFeedback;
28
30
  const ID = id ?? name;
29
31
  const translation = useTranslations();
30
32
  const optionalText = _optionalText ?? translation.inputOptionalLabel;
31
- return (<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)}>
32
- <label form={form} htmlFor={ID} className="inline-flex relative flex-row flex-wrap gap-1 justify-between w-full max-w-full text-sm transition-colors cursor-text empty:hidden text-field-label group-disabled:cursor-not-allowed group-error:text-danger">
33
- {hiddenLabel ? null
34
- : <InputFeedback info={info} hideLeft={hideLeft} reportStatus={reportStatusDefault} title={title} placeholder={placeholder}>
35
- {optionalText || rightLabel ? (<Fragment>
36
- {!required ? (<span aria-disabled={disabled} className="text-opacity-70 transition-colors aria-disabled:text-disabled group-hover:text-primary group-focus-within:text-primary">
37
- {optionalText}
38
- </span>) : null}
39
- {rightLabel ? <Fragment>{rightLabel}</Fragment> : null}
40
- </Fragment>) : null}
41
- </InputFeedback>}
42
- <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}`}>
43
- {left ? <span className="flex flex-nowrap gap-1 pl-2 whitespace-nowrap">{left}</span> : null}
44
- {children}
45
- {right ? <span className="flex flex-nowrap gap-2 pr-2 whitespace-nowrap">{right}</span> : null}
46
- </div>
47
- </label>
48
- <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">
49
- {error}
50
- </p>
51
- <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">
52
- {feedback}
53
- </p>
54
- </fieldset>);
33
+ return (<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 min-w-0 max-w-full flex-col items-start", container)}>
34
+ <label form={form} htmlFor={ID} className="relative inline-flex w-full max-w-full cursor-text flex-row flex-wrap justify-between gap-1 text-field-label text-sm transition-colors empty:hidden group-disabled:cursor-not-allowed group-error:text-danger">
35
+ {hiddenLabel ? null : (<InputFeedback info={info} hideLeft={hideLeft} reportStatus={reportStatusDefault} title={title} placeholder={placeholder}>
36
+ {optionalText || rightLabel ? (<Fragment>
37
+ {!required ? (<span aria-disabled={disabled} className="text-opacity-70 transition-colors group-focus-within:text-primary group-hover:text-primary aria-disabled:text-disabled">
38
+ {optionalText}
39
+ </span>) : null}
40
+ {rightLabel ? <Fragment>{rightLabel}</Fragment> : null}
41
+ </Fragment>) : null}
42
+ </InputFeedback>)}
43
+ <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}`}>
44
+ {left ? <span className="flex flex-nowrap gap-1 whitespace-nowrap pl-2">{left}</span> : null}
45
+ {children}
46
+ {right ? <span className="flex flex-nowrap gap-2 whitespace-nowrap pr-2">{right}</span> : null}
47
+ </div>
48
+ </label>
49
+ <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">
50
+ {error}
51
+ </p>
52
+ <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">
53
+ {feedback}
54
+ </p>
55
+ </fieldset>);
55
56
  });
@@ -1 +1 @@
1
- {"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA6F,MAAM,OAAO,CAAC;AASlH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACrC,eAAe,CAAC,OAAO,CAAC,EACxB;IACE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,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,wGAuavB,CAAC"}
1
+ {"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA6F,MAAM,OAAO,CAAC;AASlH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACnC,eAAe,CAAC,OAAO,CAAC,EACxB;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,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;CACjD,CACJ,CAAC;AA0DF,eAAO,MAAM,WAAW,wGAuavB,CAAC"}