@g4rcez/components 0.0.54 → 0.0.56
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/index.css +1 -1
- package/dist/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2968 -2952
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +36 -36
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/core/button.d.ts.map +1 -1
- package/dist/src/components/core/button.js +1 -1
- package/dist/src/components/core/polymorph.d.ts +5 -5
- package/dist/src/components/core/polymorph.d.ts.map +1 -1
- package/dist/src/components/core/polymorph.js +2 -2
- package/dist/src/components/floating/modal.d.ts.map +1 -1
- package/dist/src/components/floating/modal.js +1 -1
- package/dist/src/components/form/autocomplete.d.ts.map +1 -1
- package/dist/src/components/form/autocomplete.js +3 -3
- package/dist/src/components/form/date-picker.d.ts.map +1 -1
- package/dist/src/components/form/date-picker.js +1 -2
- package/dist/src/components/form/file-upload.js +5 -5
- package/dist/src/components/form/free-text.d.ts +12 -0
- package/dist/src/components/form/free-text.d.ts.map +1 -0
- package/dist/src/components/form/free-text.js +40 -0
- package/dist/src/components/form/input-field.d.ts +2 -2
- package/dist/src/components/form/input-field.d.ts.map +1 -1
- package/dist/src/components/form/input.d.ts +3 -7
- package/dist/src/components/form/input.d.ts.map +1 -1
- package/dist/src/components/form/input.js +2 -33
- package/dist/src/components/form/textarea.d.ts +5 -0
- package/dist/src/components/form/textarea.d.ts.map +1 -0
- package/dist/src/components/form/textarea.js +10 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +1 -0
- package/dist/src/components/table/table-lib.d.ts +1 -1
- package/dist/src/lib/dom.d.ts +1 -1
- package/dist/src/lib/dom.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/core/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AC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,GAwB7E,CAAC"}
|
|
@@ -42,5 +42,5 @@ const buttonVariants = cva("relative overflow-hidden inline-flex duration-500 en
|
|
|
42
42
|
});
|
|
43
43
|
export const Button = forwardRef(function Button({ className, icon, loading, theme, type = "button", size, rounded, ...props }, ref) {
|
|
44
44
|
const disabled = loading || props.disabled;
|
|
45
|
-
return (_jsxs(Polymorph, { ...props, ref: ref, type: type, "data-theme": theme, "data-loading": loading,
|
|
45
|
+
return (_jsxs(Polymorph, { ...props, ref: ref, type: type, "data-theme": theme, disabled: disabled, "data-loading": loading, "aria-disabled": disabled, as: props.as ?? "button", "aria-busy": disabled || loading, onClick: disabled ? undefined : props.onClick, className: css(buttonVariants({ size, rounded, theme }), className), children: [icon, props.children] }));
|
|
46
46
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ComponentProps, ElementType, PropsWithChildren } from "react";
|
|
2
2
|
import { Override } from "../../types";
|
|
3
|
-
type Polymorphism<T extends
|
|
3
|
+
type Polymorphism<T extends ElementType> = PropsWithChildren<{
|
|
4
4
|
as?: T;
|
|
5
5
|
}>;
|
|
6
|
-
type Props<T extends
|
|
7
|
-
export type PolymorphicProps<P extends {}, T extends
|
|
8
|
-
export declare const Polymorph:
|
|
6
|
+
type Props<T extends ElementType = ElementType> = Polymorphism<T> & Omit<React.ComponentPropsWithRef<T>, keyof Polymorphism<T>>;
|
|
7
|
+
export type PolymorphicProps<P extends {}, T extends ElementType = ElementType> = Override<Props<T>, P> & Polymorphism<T>;
|
|
8
|
+
export declare const Polymorph: <T extends ElementType>(p: PolymorphicProps<ComponentProps<T>, T>) => React.ReactElement;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=polymorph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAc,WAAW,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,KAAK,YAAY,CAAC,CAAC,SAAS,WAAW,IAAI,iBAAiB,CAAC;IACzD,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,CAAC,CAAC;AAEH,KAAK,KAAK,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhI,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAE1H,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,YAS3F,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
export const Polymorph = forwardRef(function Polymorph({ as, ...props }, ref) {
|
|
3
|
+
export const Polymorph = forwardRef(function Polymorph({ as, children, ...props }, ref) {
|
|
4
4
|
const Component = as || "span";
|
|
5
|
-
return _jsx(Component, { ...props,
|
|
5
|
+
return (_jsx(Component, { ref: ref, ...props, children: children }));
|
|
6
6
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAS,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA2DpC,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC;AAoEF,eAAO,MAAM,KAAK,+EAOf,iBAAiB,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAS,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA2DpC,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC;AAoEF,eAAO,MAAM,KAAK,+EAOf,iBAAiB,CAAC,UAAU,CAAC,4CAuG/B,CAAC"}
|
|
@@ -96,5 +96,5 @@ export const Modal = ({ type: _type = "dialog", resizer = true, overlayClickClos
|
|
|
96
96
|
const onClose = () => props.onChange(false);
|
|
97
97
|
return (_jsxs(Fragment, { children: [props.trigger ? (_jsx(Fragment, { children: props.asChild ? (_jsx(Slot, { ref: refs.setReference, ...getReferenceProps({
|
|
98
98
|
layoutId: props.layoutId,
|
|
99
|
-
}), children: Trigger })) : (_jsx(motion.button, { ref: refs.setReference, ...getReferenceProps(), layoutId: props.layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { presenceAffectsLayout: true, children: props.open ? (_jsx(FloatingOverlay, { lockScroll: true, className: `inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${type === "drawer" ? "" : "grid items-end justify-center lg:items-center"}`, children: _jsx(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, { animate: "enter",
|
|
99
|
+
}), children: Trigger })) : (_jsx(motion.button, { ref: refs.setReference, ...getReferenceProps(), layoutId: props.layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { presenceAffectsLayout: true, children: props.open ? (_jsx(FloatingOverlay, { lockScroll: true, className: `inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${type === "drawer" ? "" : "grid items-end justify-center lg:items-center"}`, children: _jsx(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, { exit: "exit", animate: "enter", initial: "initial", variants: animation, ref: refs.setFloating, "aria-modal": props.open, layoutId: props.layoutId, "aria-labelledby": headingId, "aria-describedby": descriptionId, className: variants({ position, type }), style: type === "drawer" ? { width: value } : { height: value }, ...getFloatingProps(), children: [props.title ? (_jsx("header", { className: "relative w-full", children: props.title ? (_jsx("h2", { className: "border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed", children: props.title })) : null })) : null, _jsx("section", { className: "flex-1 overflow-y-auto px-8 py-1", children: props.children }), props.footer ? (_jsx("footer", { className: "w-full border-t border-floating-border px-8 pt-4", children: props.footer })) : null, closable ? (_jsx("nav", { className: "absolute right-4 top-1 z-floating", children: _jsx("button", { type: "button", onClick: onClose, className: "p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger", children: _jsx(XIcon, {}) }) })) : null, useResizer && resizer ? (_jsx(Draggable, { onChange: props.onChange, parent: refs.floating, position: position, sheet: type === "sheet", value: value })) : null] }) }) })) : null }) })] }));
|
|
100
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AAIzG,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,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+15,11 @@ export const Option = forwardRef(({ selected, active, onClick, option, ...props
|
|
|
15
15
|
if (option.hidden) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
return (_jsx("li", { ...props, ref: ref, role: "option", "aria-selected": active, className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsxs("button", { type: "button", "aria-checked": active, "aria-current": active, "aria-selected": active, onClick: onClick, "data-value": option.value, className: `flex w-full cursor-pointer justify-between p-2 text-left ${active ? "bg-primary-hover text-primary-foreground" : ""} ${selected ? "bg-primary text-primary-foreground" : ""}`, children: [_jsx(Label, { ...props, label: option.label, value: option.value, children: children }), active ? (_jsx("span", { children: _jsx(CheckIcon, { "aria-hidden": true, className: "text-current", absoluteStrokeWidth: true, strokeWidth: 2, size: 22 }) })) : null] }) }));
|
|
18
|
+
return (_jsx("li", { ...props, ref: ref, role: "option", "aria-selected": active, className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsxs("button", { type: "button", "aria-busy": option.disabled, "aria-checked": active, "aria-current": active, "aria-selected": active, onClick: onClick, "data-value": option.value, className: `flex w-full cursor-pointer justify-between p-2 text-left ${active ? "bg-primary-hover text-primary-foreground" : ""} ${selected ? "bg-primary text-primary-foreground" : ""}`, children: [_jsx(Label, { ...props, label: option.label, value: option.value, children: children }), active ? (_jsx("span", { children: _jsx(CheckIcon, { "aria-hidden": true, className: "text-current", absoluteStrokeWidth: true, strokeWidth: 2, size: 22 }) })) : null] }) }));
|
|
19
19
|
});
|
|
20
20
|
const transitionStyles = {
|
|
21
21
|
duration: 300,
|
|
22
|
-
initial: { transform: "scaleY(0)", opacity: 0.
|
|
22
|
+
initial: { transform: "scaleY(0)", opacity: 0.2 },
|
|
23
23
|
open: { transform: "scaleY(1)", opacity: 1 },
|
|
24
24
|
close: { transform: "scaleY(0)", opacity: 0 },
|
|
25
25
|
};
|
|
@@ -73,7 +73,7 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
73
73
|
width: `${w}px`,
|
|
74
74
|
maxWidth: `${w}px`,
|
|
75
75
|
minWidth: "max-content",
|
|
76
|
-
maxHeight: `${Math.min(
|
|
76
|
+
maxHeight: `${Math.min(250, a.availableHeight)}px`,
|
|
77
77
|
});
|
|
78
78
|
},
|
|
79
79
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAG9E,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,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAmC1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/form/date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAG9E,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,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAmC1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA2GtB,CAAC"}
|
|
@@ -43,7 +43,6 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
|
|
|
43
43
|
const [open, setOpen] = useState(false);
|
|
44
44
|
const mask = formatParts(datetimeFormat, fixedDate).flatMap((x) => (Is.keyof(parts, x.type) ? parts[x.type](x.value) : []));
|
|
45
45
|
const placeholder = formatParts(datetimeFormat, fixedDate).reduce((acc, x) => acc + (Is.keyof(placeholders, x.type) ? placeholders[x.type](x.value) : ""), "");
|
|
46
|
-
console.log({ locale, datetimeFormat, placeholder });
|
|
47
46
|
const [value, setValue] = useState(!innerDate
|
|
48
47
|
? ""
|
|
49
48
|
: formatParts(datetimeFormat, innerDate).reduce((acc, x) => acc + (Is.keyof(parts, x.type) ? partValues[x.type](innerDate, x.value) : ""), ""));
|
|
@@ -73,5 +72,5 @@ export const DatePicker = forwardRef(({ date, locale: inputLocal, disabledDate,
|
|
|
73
72
|
};
|
|
74
73
|
const validDate = isValid(innerDate);
|
|
75
74
|
const htmlValue = validDate ? innerDate.toISOString() : undefined;
|
|
76
|
-
return (_jsx(Input, { ...props, mask: mask, value: value, "data-value": htmlValue, "data-target": props.name, className: "uppercase", formNoValidate: !open, placeholder: placeholder, onChange: onChangeDateInput, required: props.required ?? true, error: open ? undefined : props.error, name: undefined, id: undefined, right: _jsxs(Fragment, { children: [_jsx("input", { "data-origin": props.name, defaultValue: htmlValue, form: props.form, hidden: true, id: props.name, name: props.name, ref: externalRef, type: "date" }), _jsx(Dropdown, { open: open, onChange: setOpen, trigger: _jsxs("span", { "aria-labelledby": labelId, children: [_jsx("span", { id: labelId, className: "sr-only", children: translation.datePickerCalendarButtonLabel }), _jsx(CalendarIcon, {})] }), buttonProps: { "aria-describedby": labelId }, children: _jsx(Calendar, { ...props, locale: locale, changeOnlyOnClick: true, markToday: markToday, onChange: onChangeDate, disabledDate: disabledDate, date: validDate ? innerDate : undefined }) })] }) }));
|
|
75
|
+
return (_jsx(Input, { ...props, mask: mask, value: value, "data-value": htmlValue, "data-target": props.name, className: "uppercase", formNoValidate: !open, placeholder: props.placeholder ?? placeholder, onChange: onChangeDateInput, required: props.required ?? true, error: open ? undefined : props.error, name: undefined, id: undefined, right: _jsxs(Fragment, { children: [_jsx("input", { "data-origin": props.name, defaultValue: htmlValue, form: props.form, hidden: true, id: props.name, name: props.name, ref: externalRef, type: "date" }), _jsx(Dropdown, { open: open, onChange: setOpen, trigger: _jsxs("span", { "aria-labelledby": labelId, children: [_jsx("span", { id: labelId, className: "sr-only", children: translation.datePickerCalendarButtonLabel }), _jsx(CalendarIcon, {})] }), buttonProps: { "aria-describedby": labelId }, children: _jsx(Calendar, { ...props, locale: locale, changeOnlyOnClick: true, markToday: markToday, onChange: onChangeDate, disabledDate: disabledDate, date: validDate ? innerDate : undefined }) })] }) }));
|
|
77
76
|
});
|
|
@@ -21,18 +21,18 @@ const FileViewer = (props) => {
|
|
|
21
21
|
setInfo({ url: "", type: props.file.type, size: prettyBytes(props.file.size) });
|
|
22
22
|
}, [props.file]);
|
|
23
23
|
if (info.type === "img") {
|
|
24
|
-
return (_jsxs("div", { className: "flex flex-row
|
|
24
|
+
return (_jsxs("div", { className: "gap-jade-200 flex w-full flex-row items-center justify-between", children: [_jsxs("header", { className: "gap-jade-200 flex flex-row items-center", children: [_jsx("img", { src: info.url, className: "size-jade-500 rounded-jade-xsmall", alt: `Miniatura do arquivo ${props.file.name}` }), _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { children: props.file.name }), _jsx("span", { children: info.size })] })] }), _jsx(Button, { className: "isolate", type: "button", theme: "raw", onClick: (e) => {
|
|
25
25
|
e.stopPropagation();
|
|
26
26
|
props.onDeleteFile?.(props.file);
|
|
27
27
|
}, children: _jsx(Trash2Icon, {}) })] }));
|
|
28
28
|
}
|
|
29
|
-
return (_jsxs("div", { className: "flex flex-row
|
|
29
|
+
return (_jsxs("div", { className: "gap-jade-200 flex w-full flex-row items-center justify-between", children: [_jsxs("header", { className: "flex flex-row items-center gap-4", children: [_jsx(FileIcon, { size: 48 }), _jsxs("div", { className: "flex flex-col items-start justify-start text-left", children: [_jsx("span", { children: props.file.name }), _jsx("span", { children: info.size })] })] }), _jsx(Button, { className: "isolate", type: "button", theme: "raw", onClick: (e) => {
|
|
30
30
|
e.stopPropagation();
|
|
31
31
|
props.onDeleteFile?.(props.file);
|
|
32
32
|
}, children: _jsx(Trash2Icon, { className: "text-danger" }) })] }));
|
|
33
33
|
};
|
|
34
34
|
const DefaultViewer = (props) => {
|
|
35
|
-
return (_jsx("ul", { className: "
|
|
35
|
+
return (_jsx("ul", { className: "space-y-jade-200 w-full", children: props.files.map((file) => {
|
|
36
36
|
return _jsx(FileViewer, { onDeleteFile: props.onDeleteFile, file: file }, file.name);
|
|
37
37
|
}) }));
|
|
38
38
|
};
|
|
@@ -45,7 +45,7 @@ const InteractiveArea = (props) => {
|
|
|
45
45
|
}
|
|
46
46
|
return _jsx(Fragment, { children: props.idle });
|
|
47
47
|
};
|
|
48
|
-
const DefaultIdle = (_jsxs("div", { className: "flex flex-col
|
|
48
|
+
const DefaultIdle = (_jsxs("div", { className: "flex flex-col items-center justify-center gap-4", children: [_jsx(UploadIcon, { size: 64 }), _jsxs("p", { children: ["You can drag your files or", " ", _jsx("button", { className: "text-primary underline", type: "button", children: "drag to here" })] })] }));
|
|
49
49
|
export const FileUpload = ({ idle = DefaultIdle, onDeleteFile, onDrop, ...props }) => {
|
|
50
50
|
const [files, setFiles] = useState([]);
|
|
51
51
|
const drop = (x) => {
|
|
@@ -53,5 +53,5 @@ export const FileUpload = ({ idle = DefaultIdle, onDeleteFile, onDrop, ...props
|
|
|
53
53
|
setFiles(x);
|
|
54
54
|
};
|
|
55
55
|
const { getRootProps, getInputProps, isDragActive } = useDropzone({ onDrop: drop });
|
|
56
|
-
return (_jsxs("div", { ...getRootProps(), "data-active": props.files?.length ? props.files.length > 0 : false, className: "flex
|
|
56
|
+
return (_jsxs("div", { ...getRootProps(), "data-active": props.files?.length ? props.files.length > 0 : false, className: "flex flex-col items-center justify-center rounded-lg border-2 border-card-border p-6 text-foreground data-[active=true]:border-solid data-[active=false]:border-dashed data-[active=true]:bg-card-background", children: [_jsx("input", { ...getInputProps(props), name: props.name, id: props.name }), _jsx(InteractiveArea, { onDeleteFile: onDeleteFile, isDragActive: isDragActive, idle: idle, files: props.files ?? files })] }));
|
|
57
57
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import MaskInput, { InputTypes } from "the-mask-input";
|
|
3
|
+
import { Override } from "../../types";
|
|
4
|
+
import { FeedbackProps, InputFieldProps } from "./input-field";
|
|
5
|
+
type FreeTextTag = "input" | "textarea";
|
|
6
|
+
export type FreeTextProps<T extends FreeTextTag, ExtraProps extends object> = Override<ExtraProps & FeedbackProps, InputFieldProps<T> & Partial<{
|
|
7
|
+
next: string;
|
|
8
|
+
type: InputTypes;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const createFreeText: <T extends FreeTextTag, Html extends HTMLInputElement | HTMLTextAreaElement, Extra extends object>(Element: "input" | "textarea" | typeof MaskInput, defaultProps: FreeTextProps<T, Extra>, register?: (el: Html) => () => void) => React.FC<FreeTextProps<T, Extra>>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=free-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"free-text.d.ts","sourceRoot":"","sources":["../../../../src/components/form/free-text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAC7D,OAAO,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,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,MAAM,IAAI,QAAQ,CAClF,UAAU,GAAG,aAAa,EAC1B,eAAe,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CACnE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,EAAE,IAAI,SAAS,gBAAgB,GAAG,mBAAmB,EAAE,KAAK,SAAS,MAAM,WAClH,OAAO,GAAG,UAAU,GAAG,OAAO,SAAS,gBAClC,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,aAC1B,CAAC,EAAE,EAAE,IAAI,KAAK,MAAM,IAAI,sCAkGtC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useEffect, useRef } from "react";
|
|
4
|
+
import { css, initializeInputDataset, mergeRefs } from "../../lib/dom";
|
|
5
|
+
import { InputField } from "./input-field";
|
|
6
|
+
export const createFreeText = (Element, defaultProps, register) => {
|
|
7
|
+
const FreeText = forwardRef(({ type = "text", feedback = null, info, labelClassName, next, interactive, rightLabel, optionalText, container, hideLeft = false, right, left, error, ...props }, ref) => {
|
|
8
|
+
const Render = Element;
|
|
9
|
+
const id = props.id ?? props.name;
|
|
10
|
+
const inputRef = useRef(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (inputRef.current === null)
|
|
13
|
+
return;
|
|
14
|
+
const input = inputRef.current;
|
|
15
|
+
const focus = initializeInputDataset(inputRef.current);
|
|
16
|
+
const registered = register?.(input);
|
|
17
|
+
const goNextInputImpl = (e) => {
|
|
18
|
+
const event = e;
|
|
19
|
+
if (event.key === "Enter" && input.enterKeyHint === "next") {
|
|
20
|
+
const focusNext = input.getAttribute("data-next");
|
|
21
|
+
if (focusNext) {
|
|
22
|
+
const el = document.getElementById(focusNext);
|
|
23
|
+
if (el) {
|
|
24
|
+
el.focus();
|
|
25
|
+
return void event.preventDefault();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
input.addEventListener("keydown", goNextInputImpl);
|
|
31
|
+
return () => {
|
|
32
|
+
registered?.();
|
|
33
|
+
focus();
|
|
34
|
+
input.removeEventListener("keydown", goNextInputImpl);
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
return (_jsx(InputField, { ...defaultProps, info: info, container: container, error: error, feedback: feedback, hideLeft: hideLeft, left: left, optionalText: optionalText, right: right, rightLabel: rightLabel, interactive: interactive, form: props.form, id: props.name || props.id, name: props.name, labelClassName: labelClassName, title: props.title, placeholder: props.placeholder, required: props.required, children: _jsx(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-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", props.className) }) }));
|
|
38
|
+
});
|
|
39
|
+
return FreeText;
|
|
40
|
+
};
|
|
@@ -10,7 +10,7 @@ export type FeedbackProps = React.PropsWithChildren<Partial<{
|
|
|
10
10
|
reportStatus: boolean;
|
|
11
11
|
}>>;
|
|
12
12
|
export declare const InputFeedback: ({ reportStatus, hideLeft, className, info, children, title }: FeedbackProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export type InputFieldProps<T extends "input" | "select"> = PolymorphicProps<Partial<{
|
|
13
|
+
export type InputFieldProps<T extends "input" | "select" | "textarea"> = PolymorphicProps<Partial<{
|
|
14
14
|
info: Label;
|
|
15
15
|
labelClassName: string;
|
|
16
16
|
error: string;
|
|
@@ -26,5 +26,5 @@ export type InputFieldProps<T extends "input" | "select"> = PolymorphicProps<Par
|
|
|
26
26
|
name: string;
|
|
27
27
|
placeholder: string;
|
|
28
28
|
}>, T>;
|
|
29
|
-
export declare const InputField: <T extends "input" | "select">({ optionalText: _optionalText, left, rightLabel, container, feedback, interactive, right, info, children, error, form, id, labelClassName, name, title, placeholder, hideLeft, required, }: PropsWithChildren<InputFieldProps<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const InputField: <T extends "input" | "select" | "textarea">({ optionalText: _optionalText, left, rightLabel, container, feedback, interactive, right, info, children, error, form, id, labelClassName, name, title, placeholder, hideLeft, required, }: PropsWithChildren<InputFieldProps<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
//# sourceMappingURL=input-field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAC/C,OAAO,CAAC;IACJ,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACzB,CAAC,CACL,CAAC;AAEF,eAAO,MAAM,aAAa,iEAA0E,aAAa,4CA6ChH,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,IAAI,gBAAgB,
|
|
1
|
+
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,KAAK,EA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
|
5
|
-
export
|
|
6
|
-
next?: string;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const Input: React.FC<InputProps>;
|
|
2
|
+
import { FreeTextProps } from "./free-text";
|
|
3
|
+
export type InputProps = FreeTextProps<"input", TheMaskProps>;
|
|
4
|
+
export declare const Input: import("react").FC<FreeTextProps<"input", TheMaskProps>>;
|
|
9
5
|
//# sourceMappingURL=input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/form/input.tsx"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/components/form/input.tsx"],"names":[],"mappings":"AACA,OAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAE9D,eAAO,MAAM,KAAK,0DAAuF,CAAC"}
|
|
@@ -1,35 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useEffect, useRef } from "react";
|
|
4
2
|
import MaskInput from "the-mask-input";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export const Input = forwardRef(({ type = "text", feedback = null, info, labelClassName, next, interactive, rightLabel, optionalText, container, hideLeft = false, right, left, error, ...props }, ref) => {
|
|
8
|
-
const id = props.id ?? props.name;
|
|
9
|
-
const inputRef = useRef(null);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if (inputRef.current === null)
|
|
12
|
-
return;
|
|
13
|
-
const input = inputRef.current;
|
|
14
|
-
const focus = initializeInputDataset(inputRef.current);
|
|
15
|
-
const goNextInputImpl = (e) => {
|
|
16
|
-
const event = e;
|
|
17
|
-
if (event.key === "Enter" && input.enterKeyHint === "next") {
|
|
18
|
-
const focusNext = input.getAttribute("data-next");
|
|
19
|
-
if (focusNext) {
|
|
20
|
-
const el = document.getElementById(focusNext);
|
|
21
|
-
if (el) {
|
|
22
|
-
el.focus();
|
|
23
|
-
return void event.preventDefault();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
input.addEventListener("keydown", goNextInputImpl);
|
|
29
|
-
return () => {
|
|
30
|
-
focus();
|
|
31
|
-
input.removeEventListener("keydown", goNextInputImpl);
|
|
32
|
-
};
|
|
33
|
-
}, []);
|
|
34
|
-
return (_jsx(InputField, { info: info, container: container, error: error, feedback: feedback, hideLeft: hideLeft, left: left, optionalText: optionalText, right: right, rightLabel: rightLabel, interactive: interactive, form: props.form, id: props.name || props.id, name: props.name, labelClassName: labelClassName, title: props.title, placeholder: props.placeholder, required: props.required, children: _jsx(MaskInput, { ...props, type: type, "data-next": next, ref: mergeRefs(ref, inputRef), id: id, name: id, className: css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "group-focus-within:border-primary group-hover:border-primary", props.className) }) }));
|
|
35
|
-
});
|
|
3
|
+
import { createFreeText } from "./free-text";
|
|
4
|
+
export const Input = createFreeText(MaskInput, { type: "text" });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/form/textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAE1D,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAW5C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createFreeText } from "./free-text";
|
|
3
|
+
export const Textarea = createFreeText("textarea", { container: "w-full" }, (textarea) => {
|
|
4
|
+
const adjustHeight = () => {
|
|
5
|
+
textarea.style.height = "auto";
|
|
6
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
7
|
+
};
|
|
8
|
+
textarea.addEventListener("input", adjustHeight);
|
|
9
|
+
return () => textarea.removeEventListener("input", adjustHeight);
|
|
10
|
+
});
|
|
@@ -20,6 +20,7 @@ export * from "./form/date-picker";
|
|
|
20
20
|
export * from "./form/file-upload";
|
|
21
21
|
export * from "./form/form";
|
|
22
22
|
export * from "./form/input";
|
|
23
|
+
export * from "./form/textarea";
|
|
23
24
|
export * from "./form/input-field";
|
|
24
25
|
export * from "./form/radiobox";
|
|
25
26
|
export * from "./form/select";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,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,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -20,6 +20,7 @@ export * from "./form/date-picker";
|
|
|
20
20
|
export * from "./form/file-upload";
|
|
21
21
|
export * from "./form/form";
|
|
22
22
|
export * from "./form/input";
|
|
23
|
+
export * from "./form/textarea";
|
|
23
24
|
export * from "./form/input-field";
|
|
24
25
|
export * from "./form/radiobox";
|
|
25
26
|
export * from "./form/select";
|
|
@@ -113,8 +113,8 @@ export declare const useTablePreferences: <T extends POJO>(name: string, options
|
|
|
113
113
|
cellProps?: React.HTMLAttributes<HTMLTableCellElement> | undefined;
|
|
114
114
|
Element?: ((props: CellPropsElement<T, AllPaths<T, never>>) => React.ReactNode) | undefined;
|
|
115
115
|
}[];
|
|
116
|
-
groups: GroupItem<T>[];
|
|
117
116
|
sorters: Sorter<T>[];
|
|
117
|
+
groups: GroupItem<T>[];
|
|
118
118
|
filters: FilterConfig<T>[];
|
|
119
119
|
pagination: TablePagination | null;
|
|
120
120
|
};
|
package/dist/src/lib/dom.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export declare const dispatchInput: (input: HTMLInputElement | undefined | null,
|
|
|
8
8
|
target: HTMLInputElement | null | undefined;
|
|
9
9
|
currentTarget: HTMLInputElement | null | undefined;
|
|
10
10
|
};
|
|
11
|
-
export declare const initializeInputDataset: (input: HTMLInputElement | HTMLSelectElement) => () => void;
|
|
11
|
+
export declare const initializeInputDataset: (input: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement) => () => void;
|
|
12
12
|
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/lib/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AACxC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAIxE,eAAO,MAAM,SAAS,GACjB,CAA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