@g4rcez/components 0.0.71 → 0.0.73
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 +53 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7018 -6946
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +50 -50
- package/dist/index.umd.js.map +1 -1
- package/dist/preset/preset.tailwind.js +3 -3
- package/dist/preset/src/styles/dark.d.ts.map +1 -1
- package/dist/preset/src/styles/dark.js +16 -1
- package/dist/preset/src/styles/light.d.ts.map +1 -1
- package/dist/preset/src/styles/light.js +16 -1
- package/dist/preset/src/styles/theme.types.d.ts +3 -1
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/preset.tailwind.js +3 -3
- package/dist/src/components/core/button.d.ts +2 -2
- package/dist/src/components/core/button.d.ts.map +1 -1
- package/dist/src/components/core/button.js +4 -3
- package/dist/src/components/core/polymorph.d.ts +9 -8
- package/dist/src/components/core/polymorph.d.ts.map +1 -1
- package/dist/src/components/core/polymorph.js +4 -3
- package/dist/src/components/core/tag.d.ts +2 -2
- package/dist/src/components/core/tag.d.ts.map +1 -1
- package/dist/src/components/core/tag.js +3 -1
- package/dist/src/components/display/calendar.d.ts.map +1 -1
- package/dist/src/components/display/calendar.js +1 -1
- package/dist/src/components/display/step.d.ts +2 -2
- package/dist/src/components/display/step.d.ts.map +1 -1
- package/dist/src/components/display/step.js +7 -7
- package/dist/src/components/display/tabs.d.ts.map +1 -1
- package/dist/src/components/display/tabs.js +3 -3
- package/dist/src/components/floating/menu.d.ts.map +1 -1
- package/dist/src/components/floating/menu.js +19 -16
- package/dist/src/components/floating/modal.d.ts +11 -8
- package/dist/src/components/floating/modal.d.ts.map +1 -1
- package/dist/src/components/floating/modal.js +8 -8
- package/dist/src/components/floating/tooltip.d.ts +7 -5
- package/dist/src/components/floating/tooltip.d.ts.map +1 -1
- package/dist/src/components/floating/tooltip.js +16 -6
- package/dist/src/components/form/autocomplete.d.ts.map +1 -1
- package/dist/src/components/form/autocomplete.js +25 -14
- package/dist/src/components/form/input-field.js +1 -1
- package/dist/src/components/form/multi-combobox.d.ts.map +1 -1
- package/dist/src/components/form/multi-combobox.js +5 -4
- package/dist/src/components/form/switch.js +2 -2
- package/dist/src/components/form/task-list.js +3 -3
- package/dist/src/components/table/index.js +3 -3
- package/dist/src/components/table/table-lib.d.ts.map +1 -1
- package/dist/src/components/table/table-lib.js +9 -2
- package/dist/src/hooks/use-components-provider.d.ts +8 -2
- package/dist/src/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/src/hooks/use-components-provider.js +6 -2
- package/dist/src/lib/fns.d.ts +2 -0
- package/dist/src/lib/fns.d.ts.map +1 -1
- package/dist/src/lib/fns.js +2 -0
- package/dist/src/styles/dark.d.ts.map +1 -1
- package/dist/src/styles/dark.js +16 -1
- package/dist/src/styles/light.d.ts.map +1 -1
- package/dist/src/styles/light.js +16 -1
- package/dist/src/styles/theme.types.d.ts +3 -1
- package/dist/src/styles/theme.types.d.ts.map +1 -1
- package/dist/src/types.d.ts +2 -2
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/hooks/use-callback-ref.d.ts +0 -3
- package/dist/src/hooks/use-callback-ref.d.ts.map +0 -1
- package/dist/src/hooks/use-callback-ref.js +0 -8
- package/dist/src/hooks/use-mutable-state.d.ts +0 -2
- package/dist/src/hooks/use-mutable-state.d.ts.map +0 -1
- package/dist/src/hooks/use-mutable-state.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/modal.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAmB,eAAe,EAAqE,MAAM,cAAc,CAAC;AAEnI,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAAS,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA2D9C,MAAM,MAAM,UAAU,GAAG,QAAQ,CAC/B,eAAe,CAAC,KAAK,CAAC,EACtB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,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,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CACF,CAAC;AAoEF,eAAO,MAAM,KAAK,0MAkBf,iBAAiB,CAAC,UAAU,CAAC,4CAyG/B,CAAC"}
|
|
@@ -78,24 +78,24 @@ const Draggable = (props) => {
|
|
|
78
78
|
: "left-2 top-1/2 h-10 w-2"), children: props.sheet ? _jsx("div", { className: "h-2 w-1/4 rounded-lg bg-floating-border" }) : null }));
|
|
79
79
|
};
|
|
80
80
|
const positions = { drawer: "right", sheet: "none", dialog: "none" };
|
|
81
|
-
export const Modal = ({
|
|
81
|
+
export const Modal = ({ open, title, footer, asChild, trigger, children, layoutId, onChange, className, resizer = true, closable = true, forceType = false, overlayClassName = "", type: _type = "dialog", position: propsPosition, overlayClickClose = false, ...props }) => {
|
|
82
82
|
const headingId = useId();
|
|
83
83
|
const descriptionId = useId();
|
|
84
84
|
const isDesktop = useMediaQuery("(min-width: 64rem)");
|
|
85
85
|
const useResizer = _type !== "dialog";
|
|
86
|
-
const position = isDesktop ? (_type === "drawer" ?
|
|
86
|
+
const position = isDesktop ? (_type === "drawer" ? propsPosition : positions[_type]) : forceType ? positions[_type] : positions.sheet;
|
|
87
87
|
const func = isDesktop ? animations[_type] : forceType ? animations[_type] : animations.sheet;
|
|
88
88
|
const animation = typeof func === "function" ? func(position) : func;
|
|
89
89
|
const type = isDesktop ? _type : forceType ? _type : "sheet";
|
|
90
|
-
const { refs, context } = useFloating({ open:
|
|
90
|
+
const { refs, context } = useFloating({ open: open, onOpenChange: onChange });
|
|
91
91
|
const click = useClick(context);
|
|
92
92
|
const role = useRole(context);
|
|
93
93
|
const dismiss = useDismiss(context, { escapeKey: true, referencePress: true, outsidePress: overlayClickClose });
|
|
94
94
|
const { getReferenceProps, getFloatingProps } = useInteractions([click, role, dismiss]);
|
|
95
|
-
const Trigger =
|
|
95
|
+
const Trigger = trigger;
|
|
96
96
|
const value = useMotionValue(undefined);
|
|
97
|
-
const onClose = () =>
|
|
98
|
-
return (_jsxs(Fragment, { children: [
|
|
99
|
-
layoutId:
|
|
100
|
-
}), children: Trigger })) : (_jsx(motion.button, { ref: refs.setReference, ...getReferenceProps(), layoutId:
|
|
97
|
+
const onClose = () => onChange(false);
|
|
98
|
+
return (_jsxs(Fragment, { children: [trigger ? (_jsx(Fragment, { children: asChild ? (_jsx(Slot, { ref: refs.setReference, ...getReferenceProps({
|
|
99
|
+
layoutId: layoutId,
|
|
100
|
+
}), children: Trigger })) : (_jsx(motion.button, { ref: refs.setReference, ...getReferenceProps(), layoutId: layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { mode: "wait", presenceAffectsLayout: true, children: open ? (_jsx(RemoveScroll, { enabled: true, forwardProps: true, removeScrollBar: true, inert: true, noIsolation: true, children: _jsx(FloatingOverlay, { lockScroll: true, className: css(`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${type === "drawer" ? "" : "flex items-start justify-center p-10"}`, overlayClassName), children: _jsx(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, { ...props, exit: "exit", animate: "enter", initial: "initial", variants: animation, "data-component": "modal", ref: refs.setFloating, "aria-modal": open, layoutId: layoutId, "aria-labelledby": headingId, "aria-describedby": descriptionId, className: css(variants({ position, type }), className), style: type === "drawer" ? { width: value } : { height: value }, ...getFloatingProps(), children: [title ? (_jsx("header", { className: "relative w-full", children: title ? (_jsx("h2", { className: "border-b border-floating-border px-8 pb-2 text-3xl font-medium leading-relaxed", children: title })) : null })) : null, _jsx("section", { className: "flex-1 overflow-y-auto px-8 py-1", children: children }), footer ? _jsx("footer", { className: "w-full border-t border-floating-border px-8 pt-4", children: footer }) : null, closable ? (_jsx("nav", { className: "absolute right-4 top-1 z-floating", children: _jsx("button", { type: "button", onClick: onClose, className: "p-1 opacity-70 transition-colors hover:text-danger hover:opacity-100 focus:text-danger", children: _jsx(XIcon, {}) }) })) : null, useResizer && resizer ? (_jsx(Draggable, { onChange: onChange, parent: refs.floating, position: position, sheet: type === "sheet", value: value })) : null] }) }) }) })) : null }) })] }));
|
|
101
101
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { type Placement } from "@floating-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { PolymorphicProps } from "../../components/core/polymorph";
|
|
4
|
-
import { ComponentLike, Label
|
|
5
|
-
export type TooltipProps<T extends
|
|
4
|
+
import { ComponentLike, Label } from "../../types";
|
|
5
|
+
export type TooltipProps<T extends React.ElementType = "span"> = PolymorphicProps<{
|
|
6
6
|
title: Label;
|
|
7
|
-
|
|
7
|
+
open?: boolean;
|
|
8
8
|
focus?: boolean;
|
|
9
|
+
hover?: boolean;
|
|
9
10
|
enabled?: boolean;
|
|
10
11
|
popover?: boolean;
|
|
11
12
|
placement?: Placement;
|
|
12
13
|
followCursor?: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
onChange?: (b: boolean) => void;
|
|
15
|
+
}, T>;
|
|
16
|
+
export declare const Tooltip: <T extends ComponentLike = "span">({ as, title, children, placement, open, focus, hover, enabled, popover, followCursor, onChange, ...props }: TooltipProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAQH,KAAK,SAAS,EAWjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAgD,MAAM,OAAO,CAAC;AACrE,OAAO,EAAa,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAG9E,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CAC7E;IACI,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC,EACD,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,aAAa,uHAa5C,YAAY,CAAC,CAAC,CAAC,4CAsEjB,CAAC"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { arrow, autoUpdate, flip, FloatingArrow, FloatingPortal, offset, safePolygon, shift, useClick, useClientPoint, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole, } from "@floating-ui/react";
|
|
4
|
-
import { Fragment, useRef, useState } from "react";
|
|
4
|
+
import { Fragment, useEffect, useRef, useState } from "react";
|
|
5
5
|
import { Polymorph } from "../../components/core/polymorph";
|
|
6
6
|
import { FLOATING_DELAY } from "../../constants";
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import { noop } from "../../lib/fns";
|
|
8
|
+
export const Tooltip = ({ as, title, children, placement, open, focus = true, hover = true, enabled = true, popover = true, followCursor = false, onChange = noop, ...props }) => {
|
|
9
|
+
const [innerOpen, setInnerOpen] = useState(open ?? false);
|
|
9
10
|
const arrowRef = useRef(null);
|
|
10
11
|
const Component = as || "span";
|
|
12
|
+
const toggleBoth = (b) => {
|
|
13
|
+
setInnerOpen(b);
|
|
14
|
+
onChange?.(b);
|
|
15
|
+
};
|
|
11
16
|
const { refs, floatingStyles, context } = useFloating({
|
|
12
|
-
open,
|
|
17
|
+
open: innerOpen,
|
|
13
18
|
placement,
|
|
14
19
|
transform: true,
|
|
15
20
|
strategy: "absolute",
|
|
16
|
-
onOpenChange: setOpen,
|
|
17
21
|
whileElementsMounted: autoUpdate,
|
|
22
|
+
onOpenChange: open ? undefined : toggleBoth,
|
|
18
23
|
middleware: [
|
|
19
24
|
shift(),
|
|
20
25
|
offset(5),
|
|
@@ -44,5 +49,10 @@ export const Tooltip = ({ as, title, children, placement, focus = true, hover =
|
|
|
44
49
|
hover ? hoverController : undefined,
|
|
45
50
|
popover ? clickController : undefined,
|
|
46
51
|
]);
|
|
47
|
-
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (open === undefined)
|
|
54
|
+
return setInnerOpen(false);
|
|
55
|
+
return setInnerOpen(open);
|
|
56
|
+
}, [open]);
|
|
57
|
+
return (_jsxs(Fragment, { children: [_jsx(Component, { ref: refs.setReference, ...getReferenceProps(props), children: title }), innerOpen && (_jsx(FloatingPortal, { preserveTabOrder: true, children: _jsxs(Polymorph, { ...getFloatingProps(), ref: refs.setFloating, style: floatingStyles, className: "isolate z-tooltip rounded-lg border border-tooltip-border bg-tooltip-background p-3 text-tooltip-foreground shadow-lg", children: [_jsx(FloatingArrow, { ref: arrowRef, context: context, strokeWidth: 0.1, className: "fill-tooltip-background stroke-tooltip-border" }), children] }) }))] }));
|
|
48
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AAMzG,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;
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AAMzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAiCF,eAAO,MAAM,YAAY,yGAgWxB,CAAC"}
|
|
@@ -27,13 +27,14 @@ const Item = forwardRef(function VirtualItem({ item, context, ...props }, ref) {
|
|
|
27
27
|
return _jsx(motion.li, { ...props, ref: ref, className: "first:rounded-t-lg last:rounded-t-lg" });
|
|
28
28
|
});
|
|
29
29
|
const components = { List, Item };
|
|
30
|
-
const DEFAULT_SIZE =
|
|
30
|
+
const DEFAULT_SIZE = 320;
|
|
31
|
+
const MIN_SIZE = 40;
|
|
31
32
|
export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedback = null, labelClassName, emptyMessage, interactive, rightLabel, optionalText, container, hideLeft = false, right, left, error, required = false, ...props }, externalRef) => {
|
|
32
33
|
const fieldset = useRef(null);
|
|
33
34
|
const virtuoso = useRef(null);
|
|
34
35
|
const defaults = props.value ?? props.defaultValue ?? "";
|
|
35
36
|
const translation = useTranslations();
|
|
36
|
-
const [h, setH] = useState(
|
|
37
|
+
const [h, setH] = useState(() => Math.min(DEFAULT_SIZE, MIN_SIZE * options.length));
|
|
37
38
|
const [open, setOpen] = useState(false);
|
|
38
39
|
const [shadow, setShadow] = useState("");
|
|
39
40
|
const [value, setValue] = useState(defaults);
|
|
@@ -51,19 +52,24 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
51
52
|
]
|
|
52
53
|
: options;
|
|
53
54
|
const list = new Fuzzy(innerOptions, ["value", "label"], fuzzyOptions).search(shadow);
|
|
55
|
+
const setClosed = () => {
|
|
56
|
+
setOpen(false);
|
|
57
|
+
setH(0);
|
|
58
|
+
};
|
|
59
|
+
const displayList = list.filter((x) => x.hidden !== true);
|
|
54
60
|
const pattern = dynamicOption
|
|
55
61
|
? undefined
|
|
56
62
|
: `^(${options.map((x) => `${safeRegex(x.value)}${x.label ? "|" + safeRegex(x.label) : ""}`).join("|")})$`;
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (!open)
|
|
59
|
-
setH(0);
|
|
60
|
-
}, [open]);
|
|
61
63
|
useEffect(() => {
|
|
62
64
|
if (props.value) {
|
|
63
65
|
const item = options.find((x) => x.value === props.value);
|
|
64
66
|
setValue(item?.label ?? props.value);
|
|
65
67
|
}
|
|
66
68
|
}, [props.value]);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!open)
|
|
71
|
+
setH(0);
|
|
72
|
+
}, [open]);
|
|
67
73
|
useEffect(() => {
|
|
68
74
|
if (!open)
|
|
69
75
|
return;
|
|
@@ -94,12 +100,17 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
94
100
|
const w = fieldset.current?.getBoundingClientRect().width;
|
|
95
101
|
const ul = a.elements.floating.querySelector("ul");
|
|
96
102
|
const fullSize = ul?.getBoundingClientRect().height || 0;
|
|
97
|
-
const maxH = Math.min(fullSize <
|
|
98
|
-
flushSync(() => setTimeout(() =>
|
|
103
|
+
const maxH = Math.min(fullSize < MIN_SIZE ? DEFAULT_SIZE : fullSize, DEFAULT_SIZE);
|
|
104
|
+
flushSync(() => setTimeout(() => {
|
|
105
|
+
const currentH = ul?.getBoundingClientRect().height ?? 0;
|
|
106
|
+
if (currentH < MIN_SIZE)
|
|
107
|
+
return void setH(maxH);
|
|
108
|
+
return void setH(Math.min(currentH, DEFAULT_SIZE));
|
|
109
|
+
}, 50));
|
|
99
110
|
Object.assign(a.elements.floating.style, {
|
|
100
111
|
width: `${w}px`,
|
|
101
112
|
maxWidth: `${w}px`,
|
|
102
|
-
maxHeight: `${
|
|
113
|
+
maxHeight: `${DEFAULT_SIZE}`,
|
|
103
114
|
});
|
|
104
115
|
},
|
|
105
116
|
}),
|
|
@@ -141,7 +152,7 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
141
152
|
if (props.onChange)
|
|
142
153
|
props.onChange(event);
|
|
143
154
|
setLabel(opt.label ?? "");
|
|
144
|
-
|
|
155
|
+
setClosed();
|
|
145
156
|
setShadow("");
|
|
146
157
|
setIndex(i);
|
|
147
158
|
};
|
|
@@ -168,10 +179,10 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
168
179
|
setValue("");
|
|
169
180
|
setLabel("");
|
|
170
181
|
dispatchInput(refs.reference.current, "");
|
|
171
|
-
|
|
182
|
+
setClosed();
|
|
172
183
|
};
|
|
173
184
|
const id = props.id || props.name;
|
|
174
|
-
return (_jsxs(InputField, { ...props, left: left, error: error, ref: fieldset, form: props.form, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, componentName: "autocomplete", labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("span", { className: "flex items-center gap-0.5", children: [_jsxs("button", { type: "button", className: "transition-colors link:text-primary", onClick: onCaretDownClick, children: [_jsx(ChevronDown, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] }), value ? (_jsx("button", { type: "button", onClick: onClose, className: "transition-colors link:text-danger", children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })) : null] }), children: [_jsx("input", { "data-shadow": "true", ...getReferenceProps({
|
|
185
|
+
return (_jsxs(InputField, { ...props, left: left, error: error, ref: fieldset, form: props.form, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, componentName: "autocomplete", labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("span", { className: "flex items-center gap-0.5", children: [_jsxs("button", { type: "button", className: "p-2 transition-colors link:text-primary md:p-1", onClick: onCaretDownClick, children: [_jsx(ChevronDown, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] }), value ? (_jsx("button", { type: "button", onClick: onClose, className: "p-2 transition-colors link:text-danger md:p-1", children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })) : null] }), children: [_jsx("input", { "data-shadow": "true", ...getReferenceProps({
|
|
175
186
|
...props,
|
|
176
187
|
onChange,
|
|
177
188
|
onFocus,
|
|
@@ -197,7 +208,7 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
197
208
|
}
|
|
198
209
|
if (event.key === "Escape") {
|
|
199
210
|
event.currentTarget.blur();
|
|
200
|
-
return
|
|
211
|
+
return setClosed();
|
|
201
212
|
}
|
|
202
213
|
if (event.key === "Enter") {
|
|
203
214
|
if (index !== null && list[index]) {
|
|
@@ -218,7 +229,7 @@ export const Autocomplete = forwardRef(({ options, dynamicOption = false, feedba
|
|
|
218
229
|
left: (x ?? 0) + (!!value ? 26 : 18),
|
|
219
230
|
top: y ?? 0,
|
|
220
231
|
},
|
|
221
|
-
}), "data-floating": "true", className: "z-floating m-0 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating", children: [list.length === 0 ? (_jsx("li", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, _jsx(Virtuoso, { data:
|
|
232
|
+
}), "data-floating": "true", className: "isolate z-floating m-0 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating", children: [list.length === 0 ? (_jsx("li", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, _jsx(Virtuoso, { ref: virtuoso, data: displayList, components: components, hidden: displayList.length === 0, className: "rounded-lg border-floating-border bg-floating-background p-0 text-foreground", style: { height: h }, itemContent: (i, option) => {
|
|
222
233
|
const Label = option.Render ?? Frag;
|
|
223
234
|
const active = value === option.value || value === option.label;
|
|
224
235
|
const selected = index === i;
|
|
@@ -8,7 +8,7 @@ import { Tooltip } from "../floating/tooltip";
|
|
|
8
8
|
export const InputFeedback = ({ reportStatus, hideLeft = false, className, info, children, title }) => (_jsxs("div", { className: css("w-full justify-between", hideLeft && children === null ? "hidden" : "flex", className), children: [hideLeft ? null : (_jsxs("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", children: [title, reportStatus || info ? (_jsxs("span", { className: "flex items-center justify-center gap-1", children: [info ? (_jsx(Tooltip, { as: "button", type: "button", title: _jsxs("span", { className: "cursor-help", children: [_jsx("span", { className: "sr-only", children: info }), _jsx(InfoIcon, { className: "aspect-square size-3", "aria-hidden": "true", size: 16, strokeWidth: 1, absoluteStrokeWidth: true })] }), children: _jsx("div", { className: "w-full max-w-48 whitespace-break-spaces break-words", children: info }) })) : null, reportStatus ? (_jsxs(Fragment, { children: [_jsx(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: true }), _jsx(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: true })] })) : null] })) : null] })), children] }));
|
|
9
9
|
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, }, ref) => {
|
|
10
10
|
const tweaks = useTweaks();
|
|
11
|
-
const reportStatusDefault = reportStatus !== undefined ? reportStatus : tweaks.
|
|
11
|
+
const reportStatusDefault = reportStatus !== undefined ? reportStatus : tweaks.input.iconFeedback;
|
|
12
12
|
const ID = id ?? name;
|
|
13
13
|
const translation = useTranslations();
|
|
14
14
|
const optionalText = _optionalText ?? translation.inputOptionalLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/multi-combobox.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA6F,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-combobox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/multi-combobox.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAQlH,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,qBAAqB,GAAG,CAChC,CAAC,EAAE,QAAQ,CACP,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,EACnC;IACI,MAAM,EAAE,WAAW,GACf,QAAQ,CACJ,gBAAgB,EAChB;QACI,KAAK,EAAE,MAAM,EAAE,CAAC;KACnB,CACJ,CAAC;CACT,CACJ,KACA,IAAI,CAAC;AAEV,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAEtF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CACrC,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,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACrC,CACJ,CAAC;AA0DF,eAAO,MAAM,aAAa,0GAyWzB,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { Virtuoso } from "react-virtuoso";
|
|
|
10
10
|
import { useTranslations } from "../../hooks/use-components-provider";
|
|
11
11
|
import { Dict } from "../../lib/dict";
|
|
12
12
|
import { css, dispatchInput, initializeInputDataset } from "../../lib/dom";
|
|
13
|
+
import { noop } from "../../lib/fns";
|
|
13
14
|
import { Tag } from "../core/tag";
|
|
14
15
|
import { Checkbox } from "./checkbox";
|
|
15
16
|
import { InputField } from "./input-field";
|
|
@@ -48,7 +49,6 @@ const OverflowControl = (props) => {
|
|
|
48
49
|
}, [countable]);
|
|
49
50
|
return (_jsx("span", { ref: ref, className: "flex flex-nowrap gap-x-2", children: !normalView ? (props.children) : (_jsxs(Tag, { size: "small", "data-multicounter": "true", children: [countable, " ", translate.multiComboboxSelectedLabel] })) }));
|
|
50
51
|
};
|
|
51
|
-
const noop = () => { };
|
|
52
52
|
export const MultiCombobox = forwardRef(({ left, error, right, options, container, rightLabel, interactive, emptyMessage, optionalText, selectedLabel, labelClassName, feedback = null, hideLeft = false, required = false, dynamicOption = false, ...props }, externalRef) => {
|
|
53
53
|
const map = useMemo(() => new Dict(options.map((x) => [x.value, x])), [options]);
|
|
54
54
|
const fieldset = useRef(null);
|
|
@@ -184,6 +184,7 @@ export const MultiCombobox = forwardRef(({ left, error, right, options, containe
|
|
|
184
184
|
};
|
|
185
185
|
const id = props.id || props.name;
|
|
186
186
|
const tags = value.map((x) => (_jsx(Tag, { size: "small", children: x.label ?? x.value }, `multicombobox-${x.value}-x`)));
|
|
187
|
+
const displayList = list.filter((x) => x.hidden !== true);
|
|
187
188
|
return (_jsxs(InputField, { ...props, left: left, error: error, ref: fieldset, form: props.form, name: props.name, feedback: feedback, hideLeft: hideLeft, required: required, title: props.title, container: container, rightLabel: rightLabel, interactive: interactive, id: props.name || props.id, optionalText: optionalText, componentName: "autocomplete", labelClassName: labelClassName, placeholder: props.placeholder, right: _jsxs("span", { className: "flex items-center gap-0.5", children: [_jsxs("button", { type: "button", className: "transition-colors link:text-primary", onClick: onCaretDownClick, children: [_jsx(ChevronDown, { size: 20 }), _jsx("span", { className: "sr-only", children: translation.inputCaretDown })] }), value ? (_jsx("button", { type: "button", onClick: onClose, className: "transition-colors link:text-danger", children: _jsx("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd" }) }) })) : null] }), children: [_jsx("button", { ...getReferenceProps({
|
|
188
189
|
...props,
|
|
189
190
|
onFocus,
|
|
@@ -198,7 +199,7 @@ export const MultiCombobox = forwardRef(({ left, error, right, options, containe
|
|
|
198
199
|
left: (x ?? 0) + (!!value ? 26 : 18),
|
|
199
200
|
top: y ?? 0,
|
|
200
201
|
},
|
|
201
|
-
}), "data-floating": "true", className: "z-floating m-0 w-full origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating", children: [_jsx("input", { autoFocus: true, value: shadow, onChange: onChange, title: props.title, placeholder: translation.multiComboboxInnerPlaceholder, onKeyDown: (event) => {
|
|
202
|
+
}), "data-floating": "true", className: "isolate z-floating m-0 w-full origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating", children: [_jsx("input", { autoFocus: true, value: shadow, onChange: onChange, title: props.title, placeholder: translation.multiComboboxInnerPlaceholder, onKeyDown: (event) => {
|
|
202
203
|
if (event.key === "ArrowDown") {
|
|
203
204
|
let next = index + 1;
|
|
204
205
|
if (next > list.length - 1)
|
|
@@ -227,7 +228,7 @@ export const MultiCombobox = forwardRef(({ left, error, right, options, containe
|
|
|
227
228
|
return onSelect(list[0], 0);
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
|
-
}, className: "input placeholder-input-mask group mb-1 h-10 w-full flex-1 border-b border-input-border bg-transparent px-input-x py-input-y outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary" }), list.length === 0 ? (_jsx("li", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, _jsx(Virtuoso, { data:
|
|
231
|
+
}, className: "input placeholder-input-mask group mb-1 h-10 w-full flex-1 border-b border-input-border bg-transparent px-input-x py-input-y outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary" }), list.length === 0 ? (_jsx("li", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, _jsx(Virtuoso, { ref: virtuoso, data: displayList, components: components, hidden: displayList.length === 0, style: { height: value.size === 0 ? h - 49 : h - 86 }, className: "border-floating-border bg-floating-background p-0 text-foreground", itemContent: (i, option) => {
|
|
231
232
|
const Label = option.Render ?? Frag;
|
|
232
233
|
const active = value.has(option.value) || value.has(option.label ?? "");
|
|
233
234
|
const selected = index === i;
|
|
@@ -241,6 +242,6 @@ export const MultiCombobox = forwardRef(({ left, error, right, options, containe
|
|
|
241
242
|
"aria-selected": active,
|
|
242
243
|
"aria-busy": option.disabled,
|
|
243
244
|
onClick: () => onSelect(option, i),
|
|
244
|
-
}), className: `
|
|
245
|
+
}), className: `w-full cursor-pointer p-2 text-left hover:bg-floating-hover focus:bg-floating-hover ${active || selected ? "bg-floating-hover text-floating-foreground" : ""}`, children: _jsx(Checkbox, { onChange: noop, checked: active, "aria-checked": active, onClick: (e) => void (e.stopPropagation(), e.preventDefault()), children: _jsx(Label, { ...props, label: option.label, value: option.value, children: children }) }) }));
|
|
245
246
|
} }), value.size === 0 ? null : (_jsx("div", { className: "sticky bottom-0 flex w-full flex-nowrap items-center gap-2 overflow-x-auto rounded-b-lg bg-floating-background p-2", children: tags }))] }) })) : null })] }));
|
|
246
247
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
5
5
|
import { css } from "../../lib/dom";
|
|
6
6
|
export const Switch = forwardRef(({ children, container, error, ...props }, ref) => {
|
|
7
7
|
const id = useId();
|
|
8
8
|
const [innerChecked, setInnerChecked] = useState(props.checked ?? false);
|
|
9
9
|
const checked = innerChecked;
|
|
10
10
|
const innerRef = useRef(null);
|
|
11
|
-
const stableOnChange =
|
|
11
|
+
const stableOnChange = useStableRef(props.onChange);
|
|
12
12
|
useImperativeHandle(ref, () => innerRef.current);
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
if (innerRef.current !== null) {
|
|
@@ -10,11 +10,11 @@ export const TaskList = (props) => {
|
|
|
10
10
|
return;
|
|
11
11
|
const handler = (e) => {
|
|
12
12
|
const input = e.target;
|
|
13
|
-
const items = Array.from(container.querySelectorAll("input"));
|
|
14
|
-
const allTaskChecked = items.every((el) => el.checked
|
|
13
|
+
const items = Array.from(container.querySelectorAll("input[data-task=true]"));
|
|
14
|
+
const allTaskChecked = items.every((el) => el.checked);
|
|
15
15
|
const index = items.indexOf(input);
|
|
16
16
|
if (allTaskChecked && index !== -1) {
|
|
17
|
-
animate("input", { scale: [1, 1.35, 1], rotate: [0,
|
|
17
|
+
animate("input", { scale: [1, 1.35, 1], rotate: [0, 20, -20, 0] }, {
|
|
18
18
|
duration: 0.5,
|
|
19
19
|
delay: stagger(0.075, { from: index }),
|
|
20
20
|
});
|
|
@@ -6,7 +6,7 @@ import React, { createContext, Fragment, useContext, useEffect, useMemo, useRef,
|
|
|
6
6
|
import { TableVirtuoso } from "react-virtuoso";
|
|
7
7
|
import { Is } from "sidekicker";
|
|
8
8
|
import { useReducer } from "use-typed-reducer";
|
|
9
|
-
import {
|
|
9
|
+
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
10
10
|
import { path } from "../../lib/fns";
|
|
11
11
|
import { Empty } from "../display/empty";
|
|
12
12
|
import { Metadata } from "./metadata";
|
|
@@ -61,8 +61,8 @@ const emptyRows = [{}];
|
|
|
61
61
|
const InnerTable = ({ cols, filters, setCols, sorters, setFilters, setSorters, onScrollEnd, border = false, pagination = null, useControl = false, ...props }) => {
|
|
62
62
|
const ref = useRef(null);
|
|
63
63
|
const [showLoadingFooter, setShowLoadingFooter] = useState(false);
|
|
64
|
-
const onScrollEndRef =
|
|
65
|
-
const loadingMoreRef =
|
|
64
|
+
const onScrollEndRef = useStableRef(onScrollEnd);
|
|
65
|
+
const loadingMoreRef = useStableRef(props.loadingMore);
|
|
66
66
|
const rows = useMemo(() => {
|
|
67
67
|
if (props.loading)
|
|
68
68
|
return loadingArray;
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IAAI,YAAY,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,IAAI;;;;;;;;;mEArDtC,KAAK,CAAC,SAAS;GA2D9D,CAAC;AA0BF,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,IAAI,QAAQ,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,YAAW,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;uEArFnE,KAAK,CAAC,SAAS;;;;;gBAgC/C,eAAe,GAAG,IAAI;CA6ErC,CAAC"}
|
|
@@ -27,10 +27,16 @@ const noop = {};
|
|
|
27
27
|
const mergeCols = (cols, saved) => {
|
|
28
28
|
if (!Array.isArray(saved))
|
|
29
29
|
return cols;
|
|
30
|
+
const savedSet = new Set(saved.map((x) => x.id));
|
|
31
|
+
if (!cols.every((x) => savedSet.has(x.id))) {
|
|
32
|
+
return cols;
|
|
33
|
+
}
|
|
30
34
|
const map = new Map(cols.map((x) => [x.id, x]));
|
|
31
|
-
return saved.map((mock) => {
|
|
35
|
+
return saved.map((mock, index) => {
|
|
32
36
|
const original = map.get(mock.id);
|
|
33
|
-
|
|
37
|
+
if (original === undefined)
|
|
38
|
+
return cols[index];
|
|
39
|
+
return original;
|
|
34
40
|
});
|
|
35
41
|
};
|
|
36
42
|
export const useTablePreferences = (name, cols, options = noop) => {
|
|
@@ -49,6 +55,7 @@ export const useTablePreferences = (name, cols, options = noop) => {
|
|
|
49
55
|
LocalStorage.set(`@components/table-${prev.name}`, result);
|
|
50
56
|
return result;
|
|
51
57
|
};
|
|
58
|
+
intercept(get.state());
|
|
52
59
|
return {
|
|
53
60
|
set: (getters) => intercept(getters),
|
|
54
61
|
};
|
|
@@ -51,12 +51,16 @@ declare const defaultTranslations: {
|
|
|
51
51
|
calendarFromDate: string;
|
|
52
52
|
calendarToDate: string;
|
|
53
53
|
calendarToday: string;
|
|
54
|
+
calendarBackMonth: string;
|
|
55
|
+
calendarNextMonth: string;
|
|
54
56
|
multiComboboxSelectedLabel: string;
|
|
55
57
|
multiComboboxInnerPlaceholder: string;
|
|
56
58
|
};
|
|
57
59
|
export type Translations = typeof defaultTranslations;
|
|
58
|
-
type Tweaks = {
|
|
59
|
-
|
|
60
|
+
export type Tweaks = {
|
|
61
|
+
input: {
|
|
62
|
+
iconFeedback: boolean;
|
|
63
|
+
};
|
|
60
64
|
};
|
|
61
65
|
type ContextProps = Partial<{
|
|
62
66
|
tweaks: Partial<Tweaks>;
|
|
@@ -116,6 +120,8 @@ export declare const useTranslations: () => {
|
|
|
116
120
|
calendarFromDate: string;
|
|
117
121
|
calendarToDate: string;
|
|
118
122
|
calendarToday: string;
|
|
123
|
+
calendarBackMonth: string;
|
|
124
|
+
calendarNextMonth: string;
|
|
119
125
|
multiComboboxSelectedLabel: string;
|
|
120
126
|
multiComboboxInnerPlaceholder: string;
|
|
121
127
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-components-provider.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-components-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA2B,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use-components-provider.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-components-provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA2B,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Today: "Today",
|
|
49
|
+
calendarBackMonth: "Back month",
|
|
50
|
+
calendarNextMonth: "Next month",
|
|
49
51
|
multiComboboxSelectedLabel: "Selected",
|
|
50
52
|
multiComboboxInnerPlaceholder: "Search...",
|
|
51
53
|
};
|
|
52
54
|
const defaultTweaks = {
|
|
53
|
-
|
|
55
|
+
input: {
|
|
56
|
+
iconFeedback: true,
|
|
57
|
+
},
|
|
54
58
|
};
|
|
55
59
|
const Context = createContext({
|
|
56
60
|
tweaks: defaultTweaks,
|
|
@@ -62,7 +66,7 @@ export const ComponentsProvider = (props) => {
|
|
|
62
66
|
const memoMap = useMemo(() => ({
|
|
63
67
|
locale: props.locale,
|
|
64
68
|
tweaks: { ...defaultTweaks, ...props.tweaks },
|
|
65
|
-
|
|
69
|
+
parser: props.parser || parsers.hsla,
|
|
66
70
|
map: { ...defaultTranslations, ...props.map },
|
|
67
71
|
}), [props]);
|
|
68
72
|
return _jsx(Context.Provider, { value: memoMap, children: props.children });
|
package/dist/src/lib/fns.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export declare const path: <T extends {}, K extends AllPaths<T>>(obj: T, path: K
|
|
|
4
4
|
export declare const isSsr: () => boolean;
|
|
5
5
|
export declare const safeRegex: (string: string) => string;
|
|
6
6
|
export declare const splitInto: <T extends unknown>(array: T[], size: number) => T[][];
|
|
7
|
+
export declare const negate: (b: boolean) => boolean;
|
|
8
|
+
export declare const noop: () => void;
|
|
7
9
|
//# sourceMappingURL=fns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../../src/lib/fns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,eAAO,MAAM,IAAI,QAAO,MAUvB,CAAC;AAUF,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAGxE,CAAC;AAEF,eAAO,MAAM,KAAK,eAAsC,CAAC;AAEzD,eAAO,MAAM,SAAS,WAAY,MAAM,WAAkD,CAAC;AAE3F,eAAO,MAAM,SAAS,GAAI,CAAC,yBAAqB,CAAC,EAAE,QAAQ,MAAM,UAQhE,CAAC"}
|
|
1
|
+
{"version":3,"file":"fns.d.ts","sourceRoot":"","sources":["../../../src/lib/fns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,eAAO,MAAM,IAAI,QAAO,MAUvB,CAAC;AAUF,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAGxE,CAAC;AAEF,eAAO,MAAM,KAAK,eAAsC,CAAC;AAEzD,eAAO,MAAM,SAAS,WAAY,MAAM,WAAkD,CAAC;AAE3F,eAAO,MAAM,SAAS,GAAI,CAAC,yBAAqB,CAAC,EAAE,QAAQ,MAAM,UAQhE,CAAC;AAEF,eAAO,MAAM,MAAM,MAAO,OAAO,YAAO,CAAC;AAEzC,eAAO,MAAM,IAAI,YAAW,CAAC"}
|
package/dist/src/lib/fns.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../src/styles/dark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../../src/styles/dark.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,UAAU,EAAE,YAyMxB,CAAC"}
|
package/dist/src/styles/dark.js
CHANGED
|
@@ -9,6 +9,7 @@ export const DARK_THEME = {
|
|
|
9
9
|
colors: {
|
|
10
10
|
foreground: "hsla(210, 50%, 98%)",
|
|
11
11
|
background: "hsla(0, 0%, 9%)",
|
|
12
|
+
muted: "hsla(0, 0%, 12%)",
|
|
12
13
|
disabled: "hsla(240, 4%, 33%)",
|
|
13
14
|
emphasis: {
|
|
14
15
|
foreground: "hsla(251, 91%, 95%)",
|
|
@@ -65,8 +66,9 @@ export const DARK_THEME = {
|
|
|
65
66
|
switch: "hsla(0, 0%, 100%)",
|
|
66
67
|
},
|
|
67
68
|
card: {
|
|
68
|
-
|
|
69
|
+
muted: "hsla(0, 0%, 22%)",
|
|
69
70
|
border: "hsla(240, 7%, 27%)",
|
|
71
|
+
background: "hsla(0, 0%, 15%)",
|
|
70
72
|
},
|
|
71
73
|
floating: {
|
|
72
74
|
foreground: "hsla(210, 40%, 98%)",
|
|
@@ -108,6 +110,10 @@ export const DARK_THEME = {
|
|
|
108
110
|
text: "hsla(2,100%,90%)",
|
|
109
111
|
bg: "hsla(5,62%,23%)",
|
|
110
112
|
},
|
|
113
|
+
muted: {
|
|
114
|
+
text: "hsla(0, 100%, 100%)",
|
|
115
|
+
bg: "hsla(0, 0%, 12%)",
|
|
116
|
+
},
|
|
111
117
|
neutral: {
|
|
112
118
|
text: "hsla(200,98%,60%)",
|
|
113
119
|
bg: "hsla(200,28%,19%)",
|
|
@@ -146,6 +152,10 @@ export const DARK_THEME = {
|
|
|
146
152
|
text: "hsla(216,10%,90%)",
|
|
147
153
|
bg: "hsla(214,7%,19%)",
|
|
148
154
|
},
|
|
155
|
+
muted: {
|
|
156
|
+
text: "hsla(0, 100%, 100%)",
|
|
157
|
+
bg: "hsla(0, 0%, 12%)",
|
|
158
|
+
},
|
|
149
159
|
},
|
|
150
160
|
alert: {
|
|
151
161
|
primary: {
|
|
@@ -183,6 +193,11 @@ export const DARK_THEME = {
|
|
|
183
193
|
bg: "hsla(220,6%,10%)",
|
|
184
194
|
border: "hsla(214,7%,19%)",
|
|
185
195
|
},
|
|
196
|
+
muted: {
|
|
197
|
+
bg: "hsla(0, 0%, 12%)",
|
|
198
|
+
border: "hsla(0, 0%, 40%)",
|
|
199
|
+
text: "hsla(0, 100%, 100%)",
|
|
200
|
+
},
|
|
186
201
|
},
|
|
187
202
|
},
|
|
188
203
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../src/styles/light.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../../src/styles/light.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAO,MAAM,WAAW,EAAE,YAyMzB,CAAC"}
|