@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.
- package/dist/components/core/button.d.ts.map +1 -1
- package/dist/components/core/polymorph.d.ts.map +1 -1
- package/dist/components/core/slot.d.ts +1 -1
- package/dist/components/core/slot.d.ts.map +1 -1
- package/dist/components/core/slot.jsx +28 -35
- package/dist/components/core/tag.jsx +1 -1
- package/dist/components/core/typography.d.ts.map +1 -1
- package/dist/components/core/typography.jsx +16 -20
- package/dist/components/display/alert.d.ts.map +1 -1
- package/dist/components/display/alert.jsx +22 -24
- package/dist/components/display/calendar.d.ts.map +1 -1
- package/dist/components/display/calendar.jsx +5 -7
- package/dist/components/display/card.d.ts.map +1 -1
- package/dist/components/display/card.jsx +5 -5
- package/dist/components/display/empty.jsx +1 -1
- package/dist/components/display/notifications.d.ts.map +1 -1
- package/dist/components/display/notifications.jsx +35 -35
- package/dist/components/display/progress.d.ts.map +1 -1
- package/dist/components/display/progress.jsx +6 -8
- package/dist/components/display/shortcut.jsx +1 -1
- package/dist/components/display/skeleton.d.ts.map +1 -1
- package/dist/components/display/skeleton.jsx +3 -5
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/step.jsx +27 -27
- package/dist/components/display/tabs.d.ts.map +1 -1
- package/dist/components/display/tabs.jsx +5 -7
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/command-palette.jsx +40 -40
- package/dist/components/floating/dropdown.d.ts.map +1 -1
- package/dist/components/floating/dropdown.jsx +15 -15
- package/dist/components/floating/modal.d.ts.map +1 -1
- package/dist/components/floating/modal.jsx +73 -67
- package/dist/components/floating/tooltip.d.ts.map +1 -1
- package/dist/components/floating/tooltip.jsx +2 -8
- package/dist/components/floating/wizard.d.ts +1 -1
- package/dist/components/floating/wizard.d.ts.map +1 -1
- package/dist/components/floating/wizard.jsx +50 -53
- package/dist/components/form/autocomplete.d.ts.map +1 -1
- package/dist/components/form/autocomplete.jsx +38 -35
- package/dist/components/form/checkbox.jsx +2 -2
- package/dist/components/form/date-picker.d.ts.map +1 -1
- package/dist/components/form/date-picker.jsx +14 -14
- package/dist/components/form/file-upload.jsx +13 -13
- package/dist/components/form/free-text.d.ts.map +1 -1
- package/dist/components/form/free-text.jsx +2 -2
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input-field.jsx +42 -41
- package/dist/components/form/multi-select.d.ts.map +1 -1
- package/dist/components/form/multi-select.jsx +56 -56
- package/dist/components/form/select.d.ts.map +1 -1
- package/dist/components/form/select.jsx +13 -13
- package/dist/components/form/slider.d.ts.map +1 -1
- package/dist/components/form/slider.jsx +10 -10
- package/dist/components/form/transfer-list.jsx +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/page-calendar/calendar-header.d.ts +16 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -0
- package/dist/components/page-calendar/calendar-header.jsx +81 -0
- package/dist/components/page-calendar/day-view.d.ts +12 -0
- package/dist/components/page-calendar/day-view.d.ts.map +1 -0
- package/dist/components/page-calendar/day-view.jsx +84 -0
- package/dist/components/page-calendar/event-pill.d.ts +9 -0
- package/dist/components/page-calendar/event-pill.d.ts.map +1 -0
- package/dist/components/page-calendar/event-pill.jsx +23 -0
- package/dist/components/page-calendar/index.d.ts +4 -0
- package/dist/components/page-calendar/index.d.ts.map +1 -0
- package/dist/components/page-calendar/index.js +2 -0
- package/dist/components/page-calendar/month-view.d.ts +11 -0
- package/dist/components/page-calendar/month-view.d.ts.map +1 -0
- package/dist/components/page-calendar/month-view.jsx +47 -0
- package/dist/components/page-calendar/page-calendar.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.jsx +39 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.types.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.types.js +1 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts +18 -0
- package/dist/components/page-calendar/page-calendar.utils.d.ts.map +1 -0
- package/dist/components/page-calendar/page-calendar.utils.js +71 -0
- package/dist/components/page-calendar/week-view.d.ts +11 -0
- package/dist/components/page-calendar/week-view.d.ts.map +1 -0
- package/dist/components/page-calendar/week-view.jsx +61 -0
- package/dist/components/table/filter.jsx +4 -4
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/components/table/index.jsx +10 -10
- package/dist/components/table/inner-table.d.ts.map +1 -1
- package/dist/components/table/inner-table.jsx +18 -18
- package/dist/components/table/metadata.d.ts.map +1 -1
- package/dist/components/table/metadata.jsx +29 -30
- package/dist/components/table/pagination.jsx +1 -1
- package/dist/components/table/row.d.ts.map +1 -1
- package/dist/components/table/row.jsx +17 -17
- package/dist/components/table/sort.jsx +1 -1
- package/dist/components/table/table-lib.d.ts.map +1 -1
- package/dist/components/table/table-lib.js +1 -2
- package/dist/components/table/thead.d.ts.map +1 -1
- package/dist/components/table/thead.jsx +5 -5
- package/dist/config/context.d.ts.map +1 -1
- package/dist/config/default-translations.d.ts +10 -0
- package/dist/config/default-translations.d.ts.map +1 -1
- package/dist/config/default-translations.jsx +11 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/hooks/use-components-provider.jsx +2 -2
- package/dist/hooks/use-form.d.ts.map +1 -1
- package/dist/hooks/use-input-id.d.ts.map +1 -1
- package/dist/hooks/use-is-coarse-device.js +1 -1
- package/dist/hooks/use-preferences.d.ts.map +1 -1
- package/dist/hooks/use-resize-observer.d.ts.map +1 -1
- package/dist/hooks/use-translations.d.ts +10 -0
- package/dist/hooks/use-translations.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10121 -9704
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +14 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/dom.d.ts.map +1 -1
- package/dist/lib/fns.d.ts.map +1 -1
- package/dist/lib/fns.js +2 -2
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/styles/theme.types.d.ts.map +1 -1
- 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 ===
|
|
16
|
+
if (typeof element === "string") {
|
|
17
17
|
return document.querySelector(element);
|
|
18
18
|
}
|
|
19
|
-
if (
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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;
|
|
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="
|
|
25
|
-
|
|
26
|
-
|
|
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", [
|
|
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: [
|
|
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 &&
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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("
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
270
|
-
|
|
272
|
+
<Label {...props} label={option.label} value={option.value} children={children}/>
|
|
273
|
+
</button>);
|
|
271
274
|
}}/>
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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,
|
|
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 (
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
|
51
|
-
return (<li className="flex flex-row
|
|
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
|
|
54
|
-
<button type="button" onClick={onViewFile} className="
|
|
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
|
|
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="
|
|
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
|
|
67
|
-
<button onClick={onDeleteFile} type="button" className="flex
|
|
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
|
|
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
|
|
82
|
-
<div className="flex flex-col
|
|
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
|
|
85
|
+
<div className="my-4 flex flex-col items-center gap-1">
|
|
86
86
|
<p>{t.uploadIdle}</p>
|
|
87
|
-
<button className="
|
|
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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@ 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
|
-
|
|
38
|
-
|
|
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,
|
|
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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AC,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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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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