@andrilla/mado-ui 1.0.9 → 1.0.11
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/client/components/index.js +274 -178
- package/dist/client.js +284 -183
- package/dist/components/checkbox.d.ts +4 -1
- package/dist/components/drop-down.d.ts +6 -6
- package/dist/components/fieldset.d.ts +5 -2
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/human-verification.d.ts +3 -2
- package/dist/components/index.js +274 -178
- package/dist/components/input.d.ts +5 -1
- package/dist/components/select.d.ts +7 -1
- package/dist/components/submit-button.d.ts +2 -1
- package/dist/components/textarea.d.ts +5 -1
- package/dist/components/time.d.ts +3 -6
- package/dist/components/tooltip.d.ts +4 -4
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +14 -1
- package/dist/hooks/use-mobile-device.d.ts +1 -0
- package/dist/index.js +284 -183
- package/package.json +13 -7
|
@@ -749,7 +749,7 @@ function Anchor({ as, className, disabled, href, onClick, target, rel, removeHas
|
|
|
749
749
|
return /* @__PURE__ */ jsx(as || "a", {
|
|
750
750
|
...props,
|
|
751
751
|
"aria-disabled": disabled,
|
|
752
|
-
className: twMerge("
|
|
752
|
+
className: twMerge("inline-block transition-transform duration-300 ease-exponential active:scale-95 pointer-fine:active:scale-95", className, disabled && "pointer-events-none"),
|
|
753
753
|
href,
|
|
754
754
|
target: target || (isExternal ? "_blank" : "_self"),
|
|
755
755
|
onClick: hasHash ? handleClick : onClick,
|
|
@@ -782,9 +782,9 @@ const lineLiftClasses = twJoin([
|
|
|
782
782
|
scaleYClasses,
|
|
783
783
|
"after:origin-bottom after:translate-y-1 after:scale-x-75 active:after:translate-y-0 active:after:scale-x-100 pointer-fine:hover:after:translate-y-0 pointer-fine:hover:after:scale-x-100 pointer-fine:active:after:translate-y-0 pointer-fine:active:after:scale-x-100"
|
|
784
784
|
]);
|
|
785
|
-
const fillClasses = twJoin(baseClasses, "whitespace-nowrap transition-[
|
|
785
|
+
const fillClasses = twJoin(baseClasses, "whitespace-nowrap transition-[scale,color] after:top-1/2 after:h-[calc(100%+.05rem)] after:w-[calc(100%+.25rem)] after:-translate-y-1/2 after:rounded after:ease-exponential active:text-(--text-color) pointer-fine:hover:text-(--text-color) pointer-fine:active:text-(--text-color)");
|
|
786
786
|
const getFillColorTransitionClasses = (theme, customTheme) => {
|
|
787
|
-
let fillColorTransitionClasses = twJoin(fillClasses, "transition-[
|
|
787
|
+
let fillColorTransitionClasses = twJoin(fillClasses, "transition-[scale,color] after:bg-(--theme-color)");
|
|
788
788
|
if (theme === "custom") {
|
|
789
789
|
if (!customTheme || customTheme.themeColor && !customTheme.themeColor.includes("[--theme-color:")) throw new Error("`customTheme.themeColor` must modify the `--theme-color` variable on the ::after pseudo element. Otherwise, please use `customTheme.classes`.");
|
|
790
790
|
fillColorTransitionClasses = customTheme.themeColor ? twMerge(fillColorTransitionClasses, customTheme.themeColor) : twMerge(fillClasses, customTheme.classes);
|
|
@@ -792,7 +792,7 @@ const getFillColorTransitionClasses = (theme, customTheme) => {
|
|
|
792
792
|
return fillColorTransitionClasses;
|
|
793
793
|
};
|
|
794
794
|
const getFillCenterClasses = (theme, customTheme) => {
|
|
795
|
-
let fillCenterColorClasses = twJoin(fillClasses, "after:scale-x-50 after:scale-y-[.25] after:bg-(--theme-color)/0 after:transition-[
|
|
795
|
+
let fillCenterColorClasses = twJoin(fillClasses, "after:scale-x-50 after:scale-y-[.25] after:bg-(--theme-color)/0 after:transition-[scale,background-color] active:after:scale-x-100 active:after:scale-y-100 active:after:bg-(--theme-color) pointer-fine:hover:after:scale-x-100 pointer-fine:hover:after:scale-y-100 pointer-fine:hover:after:bg-(--theme-color) pointer-fine:active:after:scale-x-100 pointer-fine:active:after:scale-y-100 pointer-fine:active:after:bg-(--theme-color)");
|
|
796
796
|
if (theme === "custom") {
|
|
797
797
|
if (customTheme && customTheme.themeColor && !customTheme.themeColor.includes("[--theme-color:")) throw new Error("`customTheme.themeColor` must modify the `--theme-color` variable on the ::after pseudo element. Otherwise, please use `customTheme.classes`.");
|
|
798
798
|
fillCenterColorClasses = customTheme.themeColor ? twMerge(fillCenterColorClasses, customTheme.themeColor) : twMerge(fillClasses, customTheme.classes);
|
|
@@ -959,7 +959,7 @@ function Button({ className, customTheme, gradient = false, padding = "md", roun
|
|
|
959
959
|
getPaddingClasses(),
|
|
960
960
|
getRoundedClasses(),
|
|
961
961
|
getThemeColorVariable(),
|
|
962
|
-
customTheme && customTheme.classes ? customTheme.classes : [gradient ? "bg-linear-to-t from-[color-mix(in_oklch,var(--theme-color),var(--color-black)_20%)] via-(--theme-color) to-[color-mix(in_oklch,var(--theme-color),var(--color-white)_20%)] bg-size-[100%_200%] transition-[
|
|
962
|
+
customTheme && customTheme.classes ? customTheme.classes : [gradient ? "bg-linear-to-t from-[color-mix(in_oklch,var(--theme-color),var(--color-black)_20%)] via-(--theme-color) to-[color-mix(in_oklch,var(--theme-color),var(--color-white)_20%)] bg-size-[100%_200%] transition-[scale,background-position-y] [background-position-y:50%] active:[background-position-y:100%] data-focus:[background-position-y:0%] pointer-fine:hover:[background-position-y:0%] pointer-fine:hover:active:[background-position-y:100%]" : "bg-(--theme-color) transition-[scale,background-color] active:bg-[color-mix(in_oklch,var(--theme-color),var(--color-black)_10%)] data-focus:bg-[color-mix(in_oklch,var(--theme-color),var(--color-white)_10%)] pointer-fine:hover:bg-[color-mix(in_oklch,var(--theme-color),var(--color-white)_10%)] pointer-fine:hover:active:bg-[color-mix(in_oklch,var(--theme-color),var(--color-black)_10%)]", "shadow-(--theme-color)/25"].join(" "),
|
|
963
963
|
className
|
|
964
964
|
]);
|
|
965
965
|
if ("href" in props && !props.as && props.href) return /* @__PURE__ */ jsx(Button$1, {
|
|
@@ -1034,7 +1034,7 @@ function Checkbox({ checkmark, children, className, description, descriptionProp
|
|
|
1034
1034
|
};
|
|
1035
1035
|
return /* @__PURE__ */ jsxs(Field, {
|
|
1036
1036
|
...fieldProps,
|
|
1037
|
-
className: (bag) => twMerge("
|
|
1037
|
+
className: (bag) => twMerge("-mx-1 grid h-fit w-fit gap-1 rounded-md p-1 transition-[background-color] duration-200 ease-exponential corner-super-1.5 hover:bg-neutral-500/10 data-invalid:ring-1 data-invalid:ring-red-500/50", typeof fieldClassName === "function" ? fieldClassName(bag) : fieldClassName),
|
|
1038
1038
|
...hasInteracted && required && !checked ? { "data-invalid": "true" } : {},
|
|
1039
1039
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
1040
1040
|
...inputContainerProps,
|
|
@@ -1043,7 +1043,7 @@ function Checkbox({ checkmark, children, className, description, descriptionProp
|
|
|
1043
1043
|
...props,
|
|
1044
1044
|
...required ? { "aria-required": "true" } : {},
|
|
1045
1045
|
...hasInteracted && required && !checked ? { "aria-invalid": "true" } : {},
|
|
1046
|
-
className: (bag) => twMerge("group/checkbox
|
|
1046
|
+
className: (bag) => twMerge("group/checkbox size-5 shrink-0 cursor-pointer rounded-md border border-neutral-500/50 bg-neutral-100 transition-[background-color] duration-300 ease-exponential [--checkmark-color:var(--base-theme-color--foreground)] [--theme-color:var(--base-theme-color)] corner-super-1.5 focus:ring-3 focus:ring-blue-400 focus:ring-offset-2 focus:ring-offset-(--global-bg) focus:outline-none aria-invalid:border-red-500 data-checked:bg-(--theme-color) dark:bg-neutral-700", typeof className === "function" ? className(bag) : className),
|
|
1047
1047
|
onChange: handleChange,
|
|
1048
1048
|
value,
|
|
1049
1049
|
children: [/* @__PURE__ */ jsx("input", {
|
|
@@ -1059,7 +1059,7 @@ function Checkbox({ checkmark, children, className, description, descriptionProp
|
|
|
1059
1059
|
type: "checkbox",
|
|
1060
1060
|
value
|
|
1061
1061
|
}), checkmark ?? /* @__PURE__ */ jsx(Checkmark, {
|
|
1062
|
-
className: "
|
|
1062
|
+
className: "size-full scale-0 fill-(--checkmark-color) transition-transform duration-300 ease-exponential group-data-checked/checkbox:scale-60",
|
|
1063
1063
|
weight: "bold"
|
|
1064
1064
|
})]
|
|
1065
1065
|
}), /* @__PURE__ */ jsxs(Label, {
|
|
@@ -3971,11 +3971,6 @@ function getWeekdayName(weekday = d) {
|
|
|
3971
3971
|
return weekdayNamesList[weekday.getDay()];
|
|
3972
3972
|
}
|
|
3973
3973
|
//#endregion
|
|
3974
|
-
//#region src/utils/math.ts
|
|
3975
|
-
function easeOutExpo(time, start, end, duration) {
|
|
3976
|
-
return time == duration ? start + end : end * (-Math.pow(2, -10 * time / duration) + 1) + start;
|
|
3977
|
-
}
|
|
3978
|
-
//#endregion
|
|
3979
3974
|
//#region src/components/chevron-up-down-anime.tsx
|
|
3980
3975
|
function ChevronUpDownAnime({ className, isUp = false }) {
|
|
3981
3976
|
const firstLoadRef = useRef(true);
|
|
@@ -4040,7 +4035,7 @@ function DetailsSummary({ arrow = true, children, className, onClick, ...props }
|
|
|
4040
4035
|
function DetailsBody({ children, className, ...props }) {
|
|
4041
4036
|
return /* @__PURE__ */ jsx(DisclosurePanel, {
|
|
4042
4037
|
...props,
|
|
4043
|
-
className: twMerge("grid-rows-1fr transition-rows ease-exponential data-closed:grid-rows-0fr
|
|
4038
|
+
className: twMerge("grid grid-rows-1fr transition-rows duration-500 ease-exponential data-closed:grid-rows-0fr", className),
|
|
4044
4039
|
transition: true,
|
|
4045
4040
|
children: (bag) => /* @__PURE__ */ jsx("div", {
|
|
4046
4041
|
className: "overflow-y-hidden px-2 pbs-3 pbe-1",
|
|
@@ -4061,8 +4056,9 @@ function Details({ as = "div", className, ...props }) {
|
|
|
4061
4056
|
function DropDownButton({ arrow = true, as, children, className, ...props }) {
|
|
4062
4057
|
return /* @__PURE__ */ jsx(MenuButton, {
|
|
4063
4058
|
...props,
|
|
4064
|
-
as
|
|
4065
|
-
className: twJoin("group/button", className),
|
|
4059
|
+
as,
|
|
4060
|
+
className: twJoin("group/button transition-transform duration-300 ease-exponential active:scale-95", className),
|
|
4061
|
+
onClick: () => console.log("here i am"),
|
|
4066
4062
|
children: (bag) => /* @__PURE__ */ jsxs(Fragment, { children: [typeof children === "function" ? children(bag) : children, arrow && (typeof arrow === "boolean" ? /* @__PURE__ */ jsx(ChevronUpDownAnime, {
|
|
4067
4063
|
className: "-mr-1",
|
|
4068
4064
|
isUp: bag.open
|
|
@@ -4095,7 +4091,7 @@ function DropDownItems({ anchor, children, className, containerClassName, style,
|
|
|
4095
4091
|
return /* @__PURE__ */ jsx(MenuItems, {
|
|
4096
4092
|
...props,
|
|
4097
4093
|
anchor: anchorProps,
|
|
4098
|
-
className: twMerge("grid-rows-1fr transition-rows ease-exponential not-data-open:not-data-enter:not-data-leave:grid-rows-0fr data-closed:grid-rows-0fr
|
|
4094
|
+
className: twMerge("grid grid-rows-1fr rounded-xl shadow-xl transition-rows duration-500 ease-exponential not-data-open:not-data-enter:not-data-leave:grid-rows-0fr data-closed:grid-rows-0fr", containerClassName),
|
|
4099
4095
|
static: props.static,
|
|
4100
4096
|
style: {
|
|
4101
4097
|
...style,
|
|
@@ -5939,9 +5935,30 @@ function generateHumanValidationToken() {
|
|
|
5939
5935
|
return char;
|
|
5940
5936
|
}).join("")}_${weekCode}`;
|
|
5941
5937
|
}
|
|
5942
|
-
function HumanVerification({ children = "Verify", className }) {
|
|
5938
|
+
function HumanVerification({ children = "Verify", className, ref }) {
|
|
5943
5939
|
const [dragProgress, setDragProgress] = useState(0);
|
|
5944
5940
|
const submitButtonRef = useRef(null), buttonRef = useRef(null), buttonContainerRef = useRef(null), draggableRef = useRef(null);
|
|
5941
|
+
const resetVerification = useEffectEvent(() => {
|
|
5942
|
+
setDragProgress(0);
|
|
5943
|
+
const draggable = draggableRef.current;
|
|
5944
|
+
if (draggable) {
|
|
5945
|
+
draggable.enable();
|
|
5946
|
+
draggable.setX(0);
|
|
5947
|
+
draggable.refresh();
|
|
5948
|
+
}
|
|
5949
|
+
(buttonRef.current?.closest("form"))?.querySelectorAll("input[name=\"human_verification_token\"]")?.forEach((input) => input.remove());
|
|
5950
|
+
});
|
|
5951
|
+
useEffect(() => {
|
|
5952
|
+
const form = buttonRef.current?.closest("form");
|
|
5953
|
+
if (!form) return;
|
|
5954
|
+
const controller = new AbortController();
|
|
5955
|
+
form.addEventListener("reset", () => {
|
|
5956
|
+
queueMicrotask(() => resetVerification());
|
|
5957
|
+
}, { signal: controller.signal });
|
|
5958
|
+
return () => {
|
|
5959
|
+
controller.abort();
|
|
5960
|
+
};
|
|
5961
|
+
}, []);
|
|
5945
5962
|
const handleTrySubmit = (x) => {
|
|
5946
5963
|
if (x > 239) {
|
|
5947
5964
|
const form = buttonRef.current?.closest("form");
|
|
@@ -6046,7 +6063,10 @@ function HumanVerification({ children = "Verify", className }) {
|
|
|
6046
6063
|
"aria-valuenow": dragProgress,
|
|
6047
6064
|
className: "absolute left-1 z-10 grid aspect-square h-[calc(100%-(var(--spacing)*2))] cursor-grab place-items-center rounded-sm bg-neutral-50 shadow-lg ring ring-neutral-500 focus:ring-3 focus:ring-blue-400 focus:ring-offset-2 focus:ring-offset-neutral-500 focus:outline-none active:cursor-grabbing",
|
|
6048
6065
|
onKeyDown: moveButton,
|
|
6049
|
-
ref:
|
|
6066
|
+
ref: (node) => {
|
|
6067
|
+
buttonRef.current = node;
|
|
6068
|
+
if (ref) ref.current = node;
|
|
6069
|
+
},
|
|
6050
6070
|
role: "slider",
|
|
6051
6071
|
type: "button",
|
|
6052
6072
|
children: /* @__PURE__ */ jsx(ChevronForward, { className: "inline-block h-4 overflow-visible fill-neutral-500 stroke-2" })
|
|
@@ -6177,7 +6197,7 @@ function Input({ children, className, description, descriptionProps: { className
|
|
|
6177
6197
|
}),
|
|
6178
6198
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Input$1, {
|
|
6179
6199
|
...props,
|
|
6180
|
-
className: (bag) => twMerge("
|
|
6200
|
+
className: (bag) => twMerge("w-full rounded-xl border border-neutral-500/50 bg-neutral-100 py-1 pl-2 text-neutral-950 outline-offset-1 outline-blue-400/95 transition-[background-color] duration-300 ease-exponential corner-super-1.5 dark:bg-neutral-700 dark:text-neutral-50", "focus-visible:bg-neutral-50 focus-visible:outline-3 active:bg-neutral-200 dark:focus-visible:bg-neutral-600 dark:active:bg-neutral-800 pointer-fine:hover:bg-neutral-50 pointer-fine:active:bg-neutral-200 dark:pointer-fine:hover:bg-neutral-600 dark:pointer-fine:active:bg-neutral-800", "user-invalid:border-red-500 user-invalid:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-100)_5%)] user-invalid:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-100))] user-invalid:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-100))] dark:user-invalid:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-800)_5%)] dark:user-invalid:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-800))] dark:user-invalid:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-800)_5%)] user-invalid:pointer-fine:hover:bg-[color-mix(in_oklch,var(--color-red-500)_10%,var(--color-neutral-500)_5%)] user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-100))] user-invalid:pointer-fine:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-100))] dark:user-invalid:pointer-fine:hover:bg-[color-mix(in_oklch,var(--color-red-500)_10%,var(--color-neutral-800)_5%)] dark:user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-800)_5%)]", typeof className === "function" ? className(bag) : className),
|
|
6181
6201
|
required
|
|
6182
6202
|
}), children] }),
|
|
6183
6203
|
description && /* @__PURE__ */ jsx(Description, {
|
|
@@ -6189,6 +6209,61 @@ function Input({ children, className, description, descriptionProps: { className
|
|
|
6189
6209
|
});
|
|
6190
6210
|
}
|
|
6191
6211
|
//#endregion
|
|
6212
|
+
//#region src/hooks/create-fast-context.tsx
|
|
6213
|
+
function createFastContext(defaultInitialState) {
|
|
6214
|
+
function useStoreData(initialState = defaultInitialState) {
|
|
6215
|
+
const store = useRef(initialState), get = () => store.current, subscribers = useRef(/* @__PURE__ */ new Set());
|
|
6216
|
+
const set = (value) => {
|
|
6217
|
+
if (typeof value === "function") store.current = value(store.current);
|
|
6218
|
+
else store.current = value;
|
|
6219
|
+
subscribers.current.forEach((callback) => callback());
|
|
6220
|
+
};
|
|
6221
|
+
const subscribe = (callback) => {
|
|
6222
|
+
subscribers.current.add(callback);
|
|
6223
|
+
return () => subscribers.current.delete(callback);
|
|
6224
|
+
};
|
|
6225
|
+
return {
|
|
6226
|
+
get,
|
|
6227
|
+
set,
|
|
6228
|
+
subscribe
|
|
6229
|
+
};
|
|
6230
|
+
}
|
|
6231
|
+
const StoreContext = createContext(null);
|
|
6232
|
+
function Provider({ initialValue = defaultInitialState, ...props }) {
|
|
6233
|
+
return /* @__PURE__ */ jsx(StoreContext.Provider, {
|
|
6234
|
+
value: useStoreData(initialValue),
|
|
6235
|
+
...props
|
|
6236
|
+
});
|
|
6237
|
+
}
|
|
6238
|
+
function useStore(selector, initialValue) {
|
|
6239
|
+
const store = useContext(StoreContext);
|
|
6240
|
+
if (!store) {
|
|
6241
|
+
const selectedValue = selector(initialValue !== void 0 ? initialValue : defaultInitialState);
|
|
6242
|
+
const noOpSet = () => console.warn("Attempting to set store value outside of Provider");
|
|
6243
|
+
return [selectedValue, noOpSet];
|
|
6244
|
+
}
|
|
6245
|
+
return [useSyncExternalStore(store.subscribe, () => selector(store.get()), () => selector(initialValue !== void 0 ? initialValue : defaultInitialState)), store.set];
|
|
6246
|
+
}
|
|
6247
|
+
return {
|
|
6248
|
+
Provider,
|
|
6249
|
+
useStore
|
|
6250
|
+
};
|
|
6251
|
+
}
|
|
6252
|
+
const { Provider, useStore } = createFastContext("incomplete");
|
|
6253
|
+
//#endregion
|
|
6254
|
+
//#region src/hooks/use-mobile-device.ts
|
|
6255
|
+
function useMobileDevice() {
|
|
6256
|
+
const [isMobileDevice, setIsMobileDevice] = useState(false);
|
|
6257
|
+
const onRun = () => {
|
|
6258
|
+
const hasTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0, hasSmallViewport = window.innerWidth < 500;
|
|
6259
|
+
setIsMobileDevice(hasTouch || hasSmallViewport);
|
|
6260
|
+
};
|
|
6261
|
+
useEffect(() => {
|
|
6262
|
+
if (typeof window !== "undefined") onRun();
|
|
6263
|
+
}, []);
|
|
6264
|
+
return isMobileDevice;
|
|
6265
|
+
}
|
|
6266
|
+
//#endregion
|
|
6192
6267
|
//#region src/symbols/xmark.tsx
|
|
6193
6268
|
function Xmark({ weight = "regular", ...props }) {
|
|
6194
6269
|
switch (weight) {
|
|
@@ -6240,58 +6315,16 @@ function Xmark({ weight = "regular", ...props }) {
|
|
|
6240
6315
|
}
|
|
6241
6316
|
}
|
|
6242
6317
|
//#endregion
|
|
6243
|
-
//#region src/hooks/create-fast-context.tsx
|
|
6244
|
-
function createFastContext(defaultInitialState) {
|
|
6245
|
-
function useStoreData(initialState = defaultInitialState) {
|
|
6246
|
-
const store = useRef(initialState), get = () => store.current, subscribers = useRef(/* @__PURE__ */ new Set());
|
|
6247
|
-
const set = (value) => {
|
|
6248
|
-
if (typeof value === "function") store.current = value(store.current);
|
|
6249
|
-
else store.current = value;
|
|
6250
|
-
subscribers.current.forEach((callback) => callback());
|
|
6251
|
-
};
|
|
6252
|
-
const subscribe = (callback) => {
|
|
6253
|
-
subscribers.current.add(callback);
|
|
6254
|
-
return () => subscribers.current.delete(callback);
|
|
6255
|
-
};
|
|
6256
|
-
return {
|
|
6257
|
-
get,
|
|
6258
|
-
set,
|
|
6259
|
-
subscribe
|
|
6260
|
-
};
|
|
6261
|
-
}
|
|
6262
|
-
const StoreContext = createContext(null);
|
|
6263
|
-
function Provider({ initialValue = defaultInitialState, ...props }) {
|
|
6264
|
-
return /* @__PURE__ */ jsx(StoreContext.Provider, {
|
|
6265
|
-
value: useStoreData(initialValue),
|
|
6266
|
-
...props
|
|
6267
|
-
});
|
|
6268
|
-
}
|
|
6269
|
-
function useStore(selector, initialValue) {
|
|
6270
|
-
const store = useContext(StoreContext);
|
|
6271
|
-
if (!store) {
|
|
6272
|
-
const selectedValue = selector(initialValue !== void 0 ? initialValue : defaultInitialState);
|
|
6273
|
-
const noOpSet = () => console.warn("Attempting to set store value outside of Provider");
|
|
6274
|
-
return [selectedValue, noOpSet];
|
|
6275
|
-
}
|
|
6276
|
-
return [useSyncExternalStore(store.subscribe, () => selector(store.get()), () => selector(initialValue !== void 0 ? initialValue : defaultInitialState)), store.set];
|
|
6277
|
-
}
|
|
6278
|
-
return {
|
|
6279
|
-
Provider,
|
|
6280
|
-
useStore
|
|
6281
|
-
};
|
|
6282
|
-
}
|
|
6283
|
-
const { Provider, useStore } = createFastContext("incomplete");
|
|
6284
|
-
//#endregion
|
|
6285
6318
|
//#region src/components/modal.tsx
|
|
6319
|
+
const DRAG_TO_CLOSE_PROGRESS = .5;
|
|
6286
6320
|
const { Provider: ModalControlsProvider, useStore: useModalControls } = createFastContext({
|
|
6321
|
+
closeModal: () => {},
|
|
6322
|
+
dialogPanelRef: { current: null },
|
|
6287
6323
|
isOpen: false,
|
|
6288
6324
|
openModal: () => {},
|
|
6289
|
-
closeModal: () => {},
|
|
6290
6325
|
place: "bottom",
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
enableMouseClose: () => {},
|
|
6294
|
-
dialogPanelRef: { current: null }
|
|
6326
|
+
pseudoContainerRef: { current: null },
|
|
6327
|
+
readyToClose: false
|
|
6295
6328
|
});
|
|
6296
6329
|
function ModalTrigger({ as, onClick, ...props }) {
|
|
6297
6330
|
const ModalTriggerElement = as || Button$1;
|
|
@@ -6315,53 +6348,154 @@ function ModalTitle({ as, ref, ...props }) {
|
|
|
6315
6348
|
});
|
|
6316
6349
|
}
|
|
6317
6350
|
function ModalDialog(props) {
|
|
6318
|
-
const [modalControls] = useModalControls((store) => store);
|
|
6319
|
-
const {
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
enableMouseClose: () => {},
|
|
6326
|
-
enableTouchClose: () => {},
|
|
6327
|
-
dialogPanelRef: { current: null }
|
|
6351
|
+
const [modalControls, setModalControls] = useModalControls((store) => store), isMobileDevice = useMobileDevice();
|
|
6352
|
+
const { className, closeModal, dialogPanelRef, isOpen, place, pseudoContainerRef, readyToClose } = modalControls || {};
|
|
6353
|
+
const [dialogPanelEl, setDialogPanelEl] = useState(null);
|
|
6354
|
+
const [draggableTriggerEl, setDraggableTriggerEl] = useState(null);
|
|
6355
|
+
const setDialogPanelRef = (node) => {
|
|
6356
|
+
setDialogPanelEl(node);
|
|
6357
|
+
if (dialogPanelRef) dialogPanelRef.current = node;
|
|
6328
6358
|
};
|
|
6359
|
+
const setDraggableTriggerRef = (node) => {
|
|
6360
|
+
setDraggableTriggerEl(node);
|
|
6361
|
+
};
|
|
6362
|
+
const readyToCloseRef = useRef(readyToClose);
|
|
6363
|
+
function setUpDraggable({ dialogPanel, draggableTrigger, pseudoContainer }) {
|
|
6364
|
+
createDraggable(dialogPanel, {
|
|
6365
|
+
container: pseudoContainer,
|
|
6366
|
+
containerFriction: .99,
|
|
6367
|
+
onRelease: (draggable) => {
|
|
6368
|
+
if (readyToCloseRef.current) return closeModal?.();
|
|
6369
|
+
if (draggable.y >= 1) {
|
|
6370
|
+
const coord = { yCoord: draggable.y };
|
|
6371
|
+
animate(coord, {
|
|
6372
|
+
yCoord: 0,
|
|
6373
|
+
duration: 500,
|
|
6374
|
+
ease: spring({ duration: 300 }),
|
|
6375
|
+
composition: "blend",
|
|
6376
|
+
onUpdate: () => {
|
|
6377
|
+
draggable.setY(coord.yCoord);
|
|
6378
|
+
}
|
|
6379
|
+
});
|
|
6380
|
+
}
|
|
6381
|
+
},
|
|
6382
|
+
onUpdate: ({ progressY }) => {
|
|
6383
|
+
if (!setModalControls) return;
|
|
6384
|
+
if (progressY >= DRAG_TO_CLOSE_PROGRESS && !readyToCloseRef.current) {
|
|
6385
|
+
readyToCloseRef.current = true;
|
|
6386
|
+
setModalControls((prev) => ({
|
|
6387
|
+
...prev,
|
|
6388
|
+
readyToClose: true
|
|
6389
|
+
}));
|
|
6390
|
+
}
|
|
6391
|
+
if (progressY < DRAG_TO_CLOSE_PROGRESS && readyToCloseRef.current) {
|
|
6392
|
+
readyToCloseRef.current = false;
|
|
6393
|
+
setModalControls((prev) => ({
|
|
6394
|
+
...prev,
|
|
6395
|
+
readyToClose: false
|
|
6396
|
+
}));
|
|
6397
|
+
}
|
|
6398
|
+
},
|
|
6399
|
+
trigger: draggableTrigger
|
|
6400
|
+
});
|
|
6401
|
+
}
|
|
6402
|
+
const onDraggable = useEffectEvent(({ dialogPanel, draggableTrigger }) => {
|
|
6403
|
+
if (!pseudoContainerRef) return;
|
|
6404
|
+
const { top, left, width } = dialogPanel.getBoundingClientRect();
|
|
6405
|
+
pseudoContainerRef.current = document.createElement("div");
|
|
6406
|
+
const pseudoContainer = pseudoContainerRef.current;
|
|
6407
|
+
pseudoContainer.style.position = "fixed";
|
|
6408
|
+
pseudoContainer.style.top = `${top}px`;
|
|
6409
|
+
pseudoContainer.style.left = `${left}px`;
|
|
6410
|
+
pseudoContainer.style.width = `${width}px`;
|
|
6411
|
+
pseudoContainer.style.height = `100dvh`;
|
|
6412
|
+
pseudoContainer.style.zIndex = "-1";
|
|
6413
|
+
pseudoContainer.style.border = "2px solid blue";
|
|
6414
|
+
document.body.appendChild(pseudoContainer);
|
|
6415
|
+
animate(dialogPanel, {
|
|
6416
|
+
...isMobileDevice ? {
|
|
6417
|
+
y: ["100lvh", 0],
|
|
6418
|
+
ease: "outExpo",
|
|
6419
|
+
duration: 500
|
|
6420
|
+
} : { keyframes: [
|
|
6421
|
+
{
|
|
6422
|
+
opacity: [0, 1],
|
|
6423
|
+
scale: [.5, .85],
|
|
6424
|
+
y: ["10rem", "9rem"],
|
|
6425
|
+
ease: "inExpo",
|
|
6426
|
+
duration: 250
|
|
6427
|
+
},
|
|
6428
|
+
{
|
|
6429
|
+
scale: [.85, 1],
|
|
6430
|
+
y: ["9rem", "0rem"],
|
|
6431
|
+
ease: "outExpo",
|
|
6432
|
+
duration: 500
|
|
6433
|
+
},
|
|
6434
|
+
{
|
|
6435
|
+
y: "0px",
|
|
6436
|
+
duration: 0
|
|
6437
|
+
}
|
|
6438
|
+
] },
|
|
6439
|
+
onComplete: () => setUpDraggable({
|
|
6440
|
+
dialogPanel,
|
|
6441
|
+
draggableTrigger,
|
|
6442
|
+
pseudoContainer
|
|
6443
|
+
})
|
|
6444
|
+
});
|
|
6445
|
+
});
|
|
6446
|
+
useEffect(() => {
|
|
6447
|
+
if (isOpen && dialogPanelEl && draggableTriggerEl) onDraggable({
|
|
6448
|
+
dialogPanel: dialogPanelEl,
|
|
6449
|
+
draggableTrigger: draggableTriggerEl
|
|
6450
|
+
});
|
|
6451
|
+
}, [
|
|
6452
|
+
isOpen,
|
|
6453
|
+
dialogPanelEl,
|
|
6454
|
+
draggableTriggerEl
|
|
6455
|
+
]);
|
|
6329
6456
|
return /* @__PURE__ */ jsxs(Dialog, {
|
|
6330
6457
|
open: isOpen,
|
|
6331
|
-
onClose: () =>
|
|
6458
|
+
onClose: closeModal || (() => void 0),
|
|
6332
6459
|
className: ["isolate z-50", place === "bottom" && "after:fixed after:inset-x-0 after:bottom-0 after:-z-10 after:h-16 after:bg-neutral-50 sm:after:hidden"].join(" "),
|
|
6333
6460
|
children: [/* @__PURE__ */ jsx(DialogBackdrop, {
|
|
6334
6461
|
transition: true,
|
|
6335
|
-
|
|
6336
|
-
|
|
6462
|
+
...readyToClose ? { "data-ready": "" } : {},
|
|
6463
|
+
className: "fixed inset-0 cursor-pointer bg-neutral-50/25 backdrop-blur-sm transition-[opacity,background-color,backdrop-filter,-webkit-backdrop-filter] delay-100 duration-750 ease-exponential data-closed:opacity-0 data-ready:bg-neutral-50/5 data-ready:backdrop-blur-[1px] dark:bg-neutral-950/25 dark:data-ready:bg-neutral-950/5",
|
|
6464
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
6337
6465
|
padding: "none",
|
|
6338
6466
|
rounded: "full",
|
|
6339
|
-
className: "group/button fixed top-4 right-4 size-7
|
|
6340
|
-
children: /* @__PURE__ */ jsxs("
|
|
6341
|
-
className: "
|
|
6342
|
-
children: [/* @__PURE__ */
|
|
6343
|
-
className: "
|
|
6344
|
-
children:
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
})
|
|
6349
|
-
})
|
|
6467
|
+
className: "group/button fixed top-4 right-4 grid size-7 grid-cols-[1fr_calc(var(--spacing)*7)] gap-0 transition-[background-color,background-position-y,scale,grid-template-columns] pointer-fine:grid-cols-[0fr_calc(var(--spacing)*7)] pointer-fine:hover:grid-cols-[1fr_calc(var(--spacing)*7)]",
|
|
6468
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
6469
|
+
className: "block overflow-x-hidden text-center text-xs leading-none uppercase",
|
|
6470
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
6471
|
+
className: "ps-2",
|
|
6472
|
+
children: "Close"
|
|
6473
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
6474
|
+
className: "sr-only",
|
|
6475
|
+
children: "Modal"
|
|
6476
|
+
})]
|
|
6477
|
+
}), /* @__PURE__ */ jsx(Xmark, { className: "mx-auto size-3.5 rotate-90 transition-transform duration-300 ease-in-out group-hover/button:rotate-0" })]
|
|
6350
6478
|
})
|
|
6351
6479
|
}), /* @__PURE__ */ jsxs(DialogPanel, {
|
|
6352
|
-
ref:
|
|
6353
|
-
|
|
6354
|
-
|
|
6480
|
+
ref: setDialogPanelRef,
|
|
6481
|
+
className: twMerge("fixed left-1/2 w-screen -translate-x-1/2 bg-neutral-50 px-4 shadow-[0_-15px_50px_-12px] shadow-neutral-950/25 ease-exponential sm:w-[calc(100vw-2rem)] sm:max-w-fit sm:px-6 sm:shadow-2xl lg:px-8 dark:bg-neutral-900", place === "center" ? "top-1/2 -translate-y-1/2 rounded-2xl" : "bottom-0 h-fit max-h-[calc(100dvh-4rem)] translate-y-0 rounded-ss-4xl rounded-se-4xl after:absolute after:inset-x-0 after:-bottom-64 after:h-64 after:bg-inherit sm:top-1/2 sm:bottom-auto sm:-translate-y-1/2 sm:rounded-ee-4xl sm:rounded-es-4xl sm:after:hidden pointer-fine:top-1/2 pointer-fine:bottom-auto pointer-fine:-translate-y-1/2 pointer-fine:rounded-3xl", className),
|
|
6482
|
+
style: isMobileDevice ? void 0 : { opacity: 0 },
|
|
6355
6483
|
children: [/* @__PURE__ */ jsx("button", {
|
|
6356
|
-
className:
|
|
6357
|
-
|
|
6358
|
-
|
|
6484
|
+
className: "absolute inset-x-0 top-0 z-10 flex h-6 cursor-grab items-center justify-center after:h-1 after:w-8 after:rounded-full after:bg-neutral-500/50 after:transition-[scale,background-color] after:duration-500 after:ease-exponential active:cursor-grabbing active:after:scale-x-150 active:after:scale-y-125 active:after:bg-neutral-500 data-ready:after:scale-x-200 data-ready:after:scale-y-200 data-ready:after:bg-(--base-theme-color) pointer-fine:hover:after:scale-x-125 pointer-fine:hover:after:bg-neutral-500/75 pointer-fine:active:after:scale-x-150 pointer-fine:active:after:bg-neutral-500 data-ready:pointer-fine:hover:after:scale-x-200 data-ready:pointer-fine:hover:after:scale-y-200 data-ready:pointer-fine:hover:after:bg-(--base-theme-color) data-ready:pointer-fine:active:after:scale-x-200 data-ready:pointer-fine:active:after:scale-y-200 data-ready:pointer-fine:active:after:bg-(--base-theme-color)",
|
|
6485
|
+
...readyToClose ? { "data-ready": "" } : {},
|
|
6486
|
+
ref: setDraggableTriggerRef,
|
|
6359
6487
|
type: "button",
|
|
6360
6488
|
children: /* @__PURE__ */ jsx("span", {
|
|
6361
6489
|
className: "sr-only",
|
|
6362
6490
|
children: "Drag down to close"
|
|
6363
6491
|
})
|
|
6364
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
6492
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
6493
|
+
className: "overflow-y-scroll",
|
|
6494
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
6495
|
+
...props,
|
|
6496
|
+
className: "py-4 sm:py-6 lg:py-8"
|
|
6497
|
+
})
|
|
6498
|
+
})]
|
|
6365
6499
|
})]
|
|
6366
6500
|
});
|
|
6367
6501
|
}
|
|
@@ -6379,20 +6513,9 @@ function ModalClose({ as, onClick, ...props }) {
|
|
|
6379
6513
|
});
|
|
6380
6514
|
}
|
|
6381
6515
|
function ModalDisplay({ children, className, onClose, onOpen, place = "bottom" }) {
|
|
6382
|
-
const [
|
|
6383
|
-
const onVisible = useEffectEvent(() => {
|
|
6384
|
-
setBodyElement(document.body);
|
|
6385
|
-
});
|
|
6386
|
-
useEffect(() => {
|
|
6387
|
-
if (typeof window !== "undefined") onVisible();
|
|
6388
|
-
}, []);
|
|
6389
|
-
const [, setModalControls] = useModalControls(() => null);
|
|
6516
|
+
const [modalControls, setModalControls] = useModalControls((store) => store), isMobileDevice = useMobileDevice();
|
|
6390
6517
|
const [isOpen, setIsOpen] = useState(false);
|
|
6391
|
-
const
|
|
6392
|
-
x: 0,
|
|
6393
|
-
y: 0
|
|
6394
|
-
}), localDialogPanelRef = useRef(null);
|
|
6395
|
-
const [allowDragClose, setAllowDragClose] = useState(false), [readyToClose, setReadyToClose] = useState(false);
|
|
6518
|
+
const localDialogPanelRef = useRef(null);
|
|
6396
6519
|
const openModal = () => {
|
|
6397
6520
|
setIsOpen((previous) => {
|
|
6398
6521
|
if (previous) return previous;
|
|
@@ -6400,67 +6523,47 @@ function ModalDisplay({ children, className, onClose, onOpen, place = "bottom" }
|
|
|
6400
6523
|
return true;
|
|
6401
6524
|
});
|
|
6402
6525
|
};
|
|
6526
|
+
const closeFunctions = () => {
|
|
6527
|
+
onClose?.();
|
|
6528
|
+
modalControls?.pseudoContainerRef?.current?.remove();
|
|
6529
|
+
setModalControls?.((previous) => ({
|
|
6530
|
+
...previous,
|
|
6531
|
+
pseudoContainerRef: { current: null },
|
|
6532
|
+
readyToClose: false
|
|
6533
|
+
}));
|
|
6534
|
+
};
|
|
6535
|
+
const mobileAnimation = {
|
|
6536
|
+
y: "100%",
|
|
6537
|
+
ease: "outExpo",
|
|
6538
|
+
duration: 500
|
|
6539
|
+
};
|
|
6540
|
+
const desktopAnimation = {
|
|
6541
|
+
opacity: 0,
|
|
6542
|
+
scale: .5,
|
|
6543
|
+
ease: "outExpo",
|
|
6544
|
+
duration: 500
|
|
6545
|
+
};
|
|
6546
|
+
const handleClose = () => {
|
|
6547
|
+
if (!localDialogPanelRef.current) return closeFunctions();
|
|
6548
|
+
animate(localDialogPanelRef.current, {
|
|
6549
|
+
...isMobileDevice ? mobileAnimation : desktopAnimation,
|
|
6550
|
+
composition: "blend",
|
|
6551
|
+
onComplete: closeFunctions
|
|
6552
|
+
});
|
|
6553
|
+
};
|
|
6403
6554
|
const closeModal = () => {
|
|
6404
6555
|
setIsOpen((previous) => {
|
|
6405
6556
|
if (!previous) return previous;
|
|
6406
|
-
|
|
6557
|
+
handleClose();
|
|
6407
6558
|
return false;
|
|
6408
6559
|
});
|
|
6409
6560
|
};
|
|
6410
|
-
const enableClose = (clientX, clientY) => {
|
|
6411
|
-
startDragCoords.current.x = clientX;
|
|
6412
|
-
startDragCoords.current.y = clientY;
|
|
6413
|
-
if (localDialogPanelRef.current) localDialogPanelRef.current.style.transitionDuration = "0s";
|
|
6414
|
-
setAllowDragClose(true);
|
|
6415
|
-
};
|
|
6416
|
-
const enableTouchClose = (e) => {
|
|
6417
|
-
const { touches } = e, { clientY } = touches[0];
|
|
6418
|
-
enableClose(0, clientY);
|
|
6419
|
-
};
|
|
6420
|
-
const enableMouseClose = (e) => {
|
|
6421
|
-
const { clientX, clientY } = e;
|
|
6422
|
-
enableClose(clientX, clientY);
|
|
6423
|
-
};
|
|
6424
|
-
const handleMove = (clientX, clientY) => {
|
|
6425
|
-
if (!localDialogPanelRef.current) return;
|
|
6426
|
-
let deltaX = clientX - startDragCoords.current.x, deltaY = clientY - startDragCoords.current.y;
|
|
6427
|
-
if (deltaX > 0) deltaX = easeOutExpo(Math.abs(deltaX), 0, 25, 5e3);
|
|
6428
|
-
if (deltaX < 0) deltaX = -easeOutExpo(Math.abs(deltaX), 0, 25, 5e3);
|
|
6429
|
-
if (deltaY < 0) deltaY = -easeOutExpo(Math.abs(deltaY), 0, 25, 2e3);
|
|
6430
|
-
if (deltaY >= 100 && !readyToClose) setReadyToClose(true);
|
|
6431
|
-
else if (deltaY < 100 && readyToClose) setReadyToClose(false);
|
|
6432
|
-
const greaterThanMediaSmall = innerWidth > 640;
|
|
6433
|
-
localDialogPanelRef.current.style.translate = `calc(-50% + ${deltaX}px) ${greaterThanMediaSmall ? `calc(-50% + ${deltaY}px)` : `${deltaY}px`}`;
|
|
6434
|
-
};
|
|
6435
|
-
const handleMouseMove = (e) => {
|
|
6436
|
-
if (!allowDragClose) return;
|
|
6437
|
-
const { clientX, clientY } = e;
|
|
6438
|
-
handleMove(clientX, clientY);
|
|
6439
|
-
};
|
|
6440
|
-
const disableDragClose = (clientY) => {
|
|
6441
|
-
const deltaY = clientY - startDragCoords.current.y;
|
|
6442
|
-
if (localDialogPanelRef.current) localDialogPanelRef.current.style.transitionDuration = "";
|
|
6443
|
-
if (deltaY >= 100) {
|
|
6444
|
-
closeModal();
|
|
6445
|
-
setReadyToClose(false);
|
|
6446
|
-
} else setTimeout(() => {
|
|
6447
|
-
if (localDialogPanelRef.current) localDialogPanelRef.current.style.removeProperty("translate");
|
|
6448
|
-
}, 50);
|
|
6449
|
-
};
|
|
6450
|
-
const disableMouseDragClose = (e) => {
|
|
6451
|
-
if (allowDragClose) setAllowDragClose(false);
|
|
6452
|
-
const { clientY } = e;
|
|
6453
|
-
disableDragClose(clientY);
|
|
6454
|
-
};
|
|
6455
6561
|
useEffect(() => {
|
|
6456
6562
|
setModalControls?.((previous) => ({
|
|
6457
6563
|
...previous,
|
|
6458
6564
|
isOpen,
|
|
6459
|
-
readyToClose,
|
|
6460
6565
|
place,
|
|
6461
6566
|
className,
|
|
6462
|
-
enableMouseClose,
|
|
6463
|
-
enableTouchClose,
|
|
6464
6567
|
openModal,
|
|
6465
6568
|
closeModal,
|
|
6466
6569
|
dialogPanelRef: localDialogPanelRef
|
|
@@ -6468,20 +6571,12 @@ function ModalDisplay({ children, className, onClose, onOpen, place = "bottom" }
|
|
|
6468
6571
|
}, [
|
|
6469
6572
|
className,
|
|
6470
6573
|
closeModal,
|
|
6471
|
-
enableMouseClose,
|
|
6472
|
-
enableTouchClose,
|
|
6473
6574
|
isOpen,
|
|
6474
6575
|
openModal,
|
|
6475
6576
|
place,
|
|
6476
|
-
readyToClose,
|
|
6477
6577
|
setModalControls
|
|
6478
6578
|
]);
|
|
6479
|
-
return /* @__PURE__ */
|
|
6480
|
-
ref: dragMoveBoxRef,
|
|
6481
|
-
className: "fixed inset-0 z-99 h-dvh w-screen bg-transparent active:cursor-grabbing pointer-coarse:hidden",
|
|
6482
|
-
onMouseMove: handleMouseMove,
|
|
6483
|
-
onMouseUp: disableMouseDragClose
|
|
6484
|
-
}), bodyElement), children] });
|
|
6579
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
6485
6580
|
}
|
|
6486
6581
|
function Modal(props) {
|
|
6487
6582
|
return /* @__PURE__ */ jsx(ModalControlsProvider, { children: /* @__PURE__ */ jsx(ModalDisplay, { ...props }) });
|
|
@@ -6565,7 +6660,7 @@ function SelectOption({ children, className, name, ...props }) {
|
|
|
6565
6660
|
className: `mr-3 before:absolute before:-left-3 before:content-[',_']`,
|
|
6566
6661
|
children: name
|
|
6567
6662
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
6568
|
-
className: twMerge("
|
|
6663
|
+
className: twMerge("flex cursor-pointer items-center gap-2 rounded-lg px-2 py-1 transition-[background-color] duration-200 ease-exponential select-none [--theme-color:var(--base-theme-color)] corner-super-1.5 group-disabled/option:opacity-50 group-data-focus/option:bg-(--theme-color)/15 group-data-selected/option:cursor-default group-data-selected/option:text-(--theme-color) group-data-focus/option:group-data-selected/option:bg-transparent dark:group-data-focus/option:bg-(--theme-color)/15", className),
|
|
6569
6664
|
children: [/* @__PURE__ */ jsx(Checkmark, { className: "invisible size-3.5 group-data-selected/option:visible" }), typeof children === "function" ? children(bag) : children]
|
|
6570
6665
|
})
|
|
6571
6666
|
});
|
|
@@ -6621,7 +6716,7 @@ function Select({ buttonProps, children, className, description, descriptionProp
|
|
|
6621
6716
|
onChange: handleChange,
|
|
6622
6717
|
children: [/* @__PURE__ */ jsxs(ListboxButton, {
|
|
6623
6718
|
...buttonProps,
|
|
6624
|
-
className: (bag) => twMerge("
|
|
6719
|
+
className: (bag) => twMerge("inline-block w-full overflow-clip rounded-xl border border-neutral-500/50 bg-neutral-100 py-1 pr-4.5 pl-2 text-left text-neutral-950 outline-offset-1 outline-blue-400/95 transition-[background-color] duration-300 ease-exponential corner-super-1.5 dark:bg-neutral-700 dark:text-neutral-50", "focus:outline-3 focus-visible:bg-neutral-50 focus-visible:outline-3 active:bg-neutral-200 dark:focus-visible:bg-neutral-600 dark:active:bg-neutral-800 pointer-fine:hover:bg-neutral-50 pointer-fine:active:bg-neutral-200 dark:pointer-fine:hover:bg-neutral-600 dark:pointer-fine:active:bg-neutral-800", "data-invalid:border-red-500 data-invalid:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-100)_5%)] data-invalid:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-100))] data-invalid:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-100))] dark:data-invalid:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-800)_5%)] dark:data-invalid:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-800))] dark:data-invalid:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-800)_5%)] data-invalid:pointer-fine:hover:bg-[color-mix(in_oklch,var(--color-red-500)_10%,var(--color-neutral-500)_5%)] data-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-100))] data-invalid:pointer-fine:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-100))] dark:data-invalid:pointer-fine:hover:bg-[color-mix(in_oklch,var(--color-red-500)_10%,var(--color-neutral-800)_5%)] dark:data-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-800))] dark:data-invalid:pointer-fine:active:bg-[color-mix(in_oklch,var(--color-red-500)_5%,var(--color-neutral-800)_5%)]", typeof className === "function" ? className(bag) : className),
|
|
6625
6720
|
ref: listboxButtonRef,
|
|
6626
6721
|
children: [
|
|
6627
6722
|
/* @__PURE__ */ jsx("input", {
|
|
@@ -6649,7 +6744,7 @@ function Select({ buttonProps, children, className, description, descriptionProp
|
|
|
6649
6744
|
}), /* @__PURE__ */ jsx(ListboxOptions, {
|
|
6650
6745
|
...optionsProps,
|
|
6651
6746
|
anchor: anchor || "bottom start",
|
|
6652
|
-
className: (bag) => twMerge("
|
|
6747
|
+
className: (bag) => twMerge("z-50 w-(--button-width) origin-top rounded-xl border border-neutral-500/50 bg-neutral-50/95 p-1 backdrop-blur-sm backdrop-brightness-110 transition-[opacity,scale,translate] duration-300 ease-exponential [--anchor-gap:--spacing(1)] corner-super-1.5 focus:outline-none data-closed:-translate-y-0.5 data-closed:scale-y-0 data-closed:opacity-0 data-[anchor*=top]:origin-bottom dark:bg-neutral-800/95", typeof optionsClassName === "function" ? optionsClassName(bag) : optionsClassName),
|
|
6653
6748
|
transition: transition || true,
|
|
6654
6749
|
children
|
|
6655
6750
|
})]
|
|
@@ -6745,15 +6840,15 @@ function SubmitButton({ children, className, customTheme, error, formStatus = "r
|
|
|
6745
6840
|
}),
|
|
6746
6841
|
"\xA0",
|
|
6747
6842
|
/* @__PURE__ */ jsx(CircleFill, {
|
|
6748
|
-
className: "animate-wave
|
|
6843
|
+
className: "size-2 animate-wave",
|
|
6749
6844
|
weight: "black"
|
|
6750
6845
|
}),
|
|
6751
6846
|
/* @__PURE__ */ jsx(CircleFill, {
|
|
6752
|
-
className: "animate-wave animation-delay-100
|
|
6847
|
+
className: "size-2 animate-wave animation-delay-100",
|
|
6753
6848
|
weight: "black"
|
|
6754
6849
|
}),
|
|
6755
6850
|
/* @__PURE__ */ jsx(CircleFill, {
|
|
6756
|
-
className: "animate-wave animation-delay-200
|
|
6851
|
+
className: "size-2 animate-wave animation-delay-200",
|
|
6757
6852
|
weight: "black"
|
|
6758
6853
|
}),
|
|
6759
6854
|
"\xA0"
|
|
@@ -6854,7 +6949,7 @@ function Textarea({ children, className, description, descriptionProps: { classN
|
|
|
6854
6949
|
}),
|
|
6855
6950
|
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(Textarea$1, {
|
|
6856
6951
|
...props,
|
|
6857
|
-
className: (bag) => twMerge("
|
|
6952
|
+
className: (bag) => twMerge("w-full rounded-xl border border-neutral-500/50 bg-neutral-100 py-1 pl-2 text-neutral-950 outline-offset-1 outline-blue-400/95 transition-[background-color] duration-300 ease-exponential corner-super-1.5 dark:bg-neutral-700 dark:text-neutral-50", "focus-visible:bg-neutral-50 focus-visible:outline-3 active:bg-neutral-200 dark:focus-visible:bg-neutral-600 dark:active:bg-neutral-800 pointer-fine:hover:bg-neutral-50 pointer-fine:active:bg-neutral-200 dark:pointer-fine:hover:bg-neutral-600 dark:pointer-fine:active:bg-neutral-800", "user-invalid:border-red-500 user-invalid:bg-[color-mix(in_oklch,var(--color-red-500)_20%,var(--color-neutral-100))] user-invalid:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-100))] user-invalid:active:bg-[color-mix(in_oklch,var(--color-red-500)_25%,var(--color-neutral-100))] dark:user-invalid:bg-[color-mix(in_oklch,var(--color-red-500)_20%,var(--color-neutral-800))] dark:user-invalid:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-800))] dark:user-invalid:active:bg-[color-mix(in_oklch,var(--color-red-500)_25%,var(--color-neutral-800))] user-invalid:pointer-fine:hover:bg-[color-mix(in_oklch,var(--color-red-500)_10%,var(--color-neutral-100))] user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-100))] user-invalid:pointer-fine:active:bg-[color-mix(in_oklch,var(--color-red-500)_25%,var(--color-neutral-100))] dark:user-invalid:pointer-fine:hover:bg-[color-mix(in_oklch,var(--color-red-500)_10%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:focus-visible:bg-[color-mix(in_oklch,var(--color-red-500)_1%,var(--color-neutral-800))] dark:user-invalid:pointer-fine:active:bg-[color-mix(in_oklch,var(--color-red-500)_25%,var(--color-neutral-800))]", resizeClassName, typeof className === "function" ? className(bag) : className),
|
|
6858
6953
|
required
|
|
6859
6954
|
}), children] }),
|
|
6860
6955
|
description && /* @__PURE__ */ jsx(Description, {
|
|
@@ -8587,6 +8682,8 @@ function TooltipPanel({ as, children, className, style, onMouseEnter, onMouseLea
|
|
|
8587
8682
|
};
|
|
8588
8683
|
return /* @__PURE__ */ jsxs(TooltipPanelElement, {
|
|
8589
8684
|
...props,
|
|
8685
|
+
"aria-live": isPositioned ? "assertive" : "off",
|
|
8686
|
+
className: twMerge("absolute top-0 left-0 z-50 w-max rounded-md bg-neutral-50 px-2 py-1 text-sm text-neutral-950 opacity-0 shadow-lg outline-1 outline-neutral-400 data-portal:fixed data-ready:animate-fade-in dark:bg-neutral-800 dark:text-neutral-50 dark:shadow-none dark:-outline-offset-1 dark:outline-neutral-600", className),
|
|
8590
8687
|
ref: (node) => {
|
|
8591
8688
|
if (node && typeof node.querySelector === "function") {
|
|
8592
8689
|
refs?.setFloating(node);
|
|
@@ -8596,7 +8693,6 @@ function TooltipPanel({ as, children, className, style, onMouseEnter, onMouseLea
|
|
|
8596
8693
|
}
|
|
8597
8694
|
}
|
|
8598
8695
|
},
|
|
8599
|
-
className: twMerge("data-ready:animate-fade-in absolute top-0 left-0 z-50 w-max rounded-md bg-neutral-50 px-2 py-1 text-sm text-neutral-950 opacity-0 shadow-lg outline-1 outline-neutral-400 data-portal:fixed dark:bg-neutral-800 dark:text-neutral-50 dark:shadow-none dark:-outline-offset-1 dark:outline-neutral-600", className),
|
|
8600
8696
|
style: {
|
|
8601
8697
|
...style,
|
|
8602
8698
|
...floatingStyles,
|
|
@@ -8607,7 +8703,7 @@ function TooltipPanel({ as, children, className, style, onMouseEnter, onMouseLea
|
|
|
8607
8703
|
onMouseLeave: handleMouseLeave,
|
|
8608
8704
|
onTouchStart: handleTouchStart,
|
|
8609
8705
|
role: "tooltip",
|
|
8610
|
-
...isPositioned ? { "data-ready":
|
|
8706
|
+
...isPositioned ? { "data-ready": "" } : {},
|
|
8611
8707
|
children: [children, contextArrow && /* @__PURE__ */ jsx(ArrowSvg, {
|
|
8612
8708
|
className: twMerge("absolute", arrowLocationClasses, contextArrowClassName),
|
|
8613
8709
|
style: arrowStyles,
|