@g4rcez/components 2.1.1 → 3.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/button.jsx +2 -2
- package/dist/components/display/calendar.jsx +1 -1
- package/dist/components/display/progress.jsx +4 -4
- package/dist/components/display/skeleton.d.ts.map +1 -1
- package/dist/components/display/skeleton.jsx +2 -2
- package/dist/components/display/step.d.ts.map +1 -1
- package/dist/components/display/tabs.jsx +1 -1
- package/dist/components/floating/command-palette.d.ts +2 -2
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/command-palette.jsx +13 -8
- package/dist/components/floating/menu.jsx +2 -2
- package/dist/components/floating/modal.jsx +1 -1
- package/dist/components/floating/wizard.jsx +1 -1
- package/dist/components/form/autocomplete.d.ts.map +1 -1
- package/dist/components/form/autocomplete.jsx +11 -12
- package/dist/components/form/checkbox.jsx +1 -1
- package/dist/components/form/free-text.jsx +1 -1
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input-field.jsx +39 -39
- package/dist/components/form/multi-select.jsx +2 -2
- package/dist/components/form/select.jsx +1 -1
- package/dist/components/form/slider.jsx +1 -1
- package/dist/components/form/switch.jsx +2 -2
- package/dist/components/table/inner-table.jsx +1 -1
- package/dist/components/table/metadata.jsx +2 -2
- package/dist/components/table/row.jsx +1 -1
- package/dist/components/table/thead.jsx +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3976 -3972
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +12 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/preset/tailwindcssv4.d.ts +3 -0
- package/dist/preset/tailwindcssv4.d.ts.map +1 -0
- package/dist/preset/tailwindcssv4.js +75 -0
- package/package.json +10 -4
- package/dist/flow/flow.d.ts +0 -25
- package/dist/flow/flow.d.ts.map +0 -1
- package/dist/flow/flow.jsx +0 -111
- package/dist/index.css +0 -1
- package/dist/preset/plugin.tailwind.d.ts +0 -9
- package/dist/preset/plugin.tailwind.d.ts.map +0 -1
- package/dist/preset/plugin.tailwind.js +0 -27
- package/dist/preset/preset.tailwind.d.ts +0 -8
- package/dist/preset/preset.tailwind.d.ts.map +0 -1
- package/dist/preset/preset.tailwind.js +0 -54
|
@@ -16,7 +16,7 @@ const variants = {
|
|
|
16
16
|
tiny: "h-6 px-2 py-1 text-sm",
|
|
17
17
|
},
|
|
18
18
|
rounded: {
|
|
19
|
-
rough: "rounded-
|
|
19
|
+
rough: "rounded-xs",
|
|
20
20
|
squared: "rounded-none",
|
|
21
21
|
default: "rounded-button",
|
|
22
22
|
circle: "rounded-full aspect-square",
|
|
@@ -47,7 +47,7 @@ const variants = {
|
|
|
47
47
|
* Handles all visual states and variants of the button component
|
|
48
48
|
* @internal
|
|
49
49
|
*/
|
|
50
|
-
const buttonVariants = cva("relative overflow-hidden inline-flex duration-500 enabled:hover:bg-opacity-70 enabled:focus:bg-opacity-70 data-[loading=true]:opacity-30 data-[loading=true]:animate-pulse gap-1.5 items-center justify-center align-middle cursor-pointer whitespace-nowrap font-medium transition-colors ease-in disabled:cursor-not-allowed disabled:bg-opacity-40 disabled:text-opacity-80 focus-visible:outline-
|
|
50
|
+
const buttonVariants = cva("relative overflow-hidden inline-flex duration-500 enabled:hover:bg-opacity-70 enabled:focus:bg-opacity-70 data-[loading=true]:opacity-30 data-[loading=true]:animate-pulse gap-1.5 items-center justify-center align-middle cursor-pointer whitespace-nowrap font-medium transition-colors ease-in disabled:cursor-not-allowed disabled:bg-opacity-40 disabled:text-opacity-80 focus-visible:outline-hidden focus-visible:ring-4 focus-visible:ring-ring", {
|
|
51
51
|
variants,
|
|
52
52
|
defaultVariants: { theme: "main", size: "default", rounded: "default" },
|
|
53
53
|
});
|
|
@@ -243,7 +243,7 @@ export const Calendar = ({ RenderOnDay, changeOnlyOnClick = false, labelRange, d
|
|
|
243
243
|
};
|
|
244
244
|
return (<MotionConfig transition={transition}>
|
|
245
245
|
<div ref={root} data-component="calendar" onTouchEnd={swipe.onTouchEnd} onTouchStart={swipe.onTouchStart} className={css("relative overflow-hidden", Is.function(styles?.calendar) ? styles?.calendar(allDaysOfMonth) : styles?.calendar)}>
|
|
246
|
-
<div className="flex flex-col justify-center rounded text-center">
|
|
246
|
+
<div className="flex flex-col justify-center rounded-sm text-center">
|
|
247
247
|
<AnimatePresence initial={false} mode="popLayout" custom={state.direction} onExitComplete={dispatch.onExitComplete}>
|
|
248
248
|
<motion.div key={monthString} initial="enter" animate="middle" exit="exit">
|
|
249
249
|
<header className="relative flex justify-between">
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Is } from "sidekicker";
|
|
2
|
-
import { Progress as
|
|
2
|
+
import { Progress as ProgressBar } from "@base-ui/react/progress";
|
|
3
3
|
import { css } from "../../lib/dom";
|
|
4
4
|
export const Progress = (props) => {
|
|
5
|
-
return (<
|
|
6
|
-
<
|
|
5
|
+
return (<ProgressBar.Root max={props.max} value={props.percent ?? null} style={{ transform: "translateZ(0)", }} className={css("overflow-hidden relative w-full rounded-full h-6 bg-background", props.container)}>
|
|
6
|
+
<ProgressBar.Indicator style={{ transform: Is.number(props.percent) ? `translateX(-${100 - props.percent}%)` : undefined }} className={css("bg-primary transition-transform ease-in-out size-full duration-500", props.className)}/>
|
|
7
7
|
{Is.number(props.percent)
|
|
8
8
|
? <p className={css("flex absolute inset-0 justify-center items-center w-full font-semibold tabular-nums text-primary-foreground", props.textClassName)}>
|
|
9
9
|
{props.label ? props.label : `${props.percent} %`}
|
|
10
10
|
</p>
|
|
11
11
|
: null}
|
|
12
|
-
</
|
|
12
|
+
</ProgressBar.Root>);
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/display/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAU,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIvE,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../src/components/display/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAU,KAAK,WAAW,EAAE,MAAM,OAAO,CAAC;AAIvE,eAAO,MAAM,YAAY,mBAAoE,CAAC;AAE9F,eAAO,MAAM,QAAQ,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,sBAE9F,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,sBAUvE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useRef } from "react";
|
|
2
2
|
import { css } from "../../lib/dom";
|
|
3
3
|
import { Polymorph } from "../core/polymorph";
|
|
4
|
-
export const SkeletonCell = <div className="w-10/12 h-6 rounded animate-pulse bg-muted"/>;
|
|
5
|
-
export const Skeleton = (props) => (<Polymorph {...props} as={props.as || "span"} className={css("block rounded h-8 w-32 animate-pulse bg-muted", props.className)}/>);
|
|
4
|
+
export const SkeletonCell = <div className="w-10/12 h-6 rounded-sm animate-pulse bg-muted"/>;
|
|
5
|
+
export const Skeleton = (props) => (<Polymorph {...props} as={props.as || "span"} className={css("block rounded-sm h-8 w-32 animate-pulse bg-muted", props.className)}/>);
|
|
6
6
|
export const SkeletonList = (props) => {
|
|
7
7
|
const items = useRef(Array.from({ length: props.rows }).map((_, i) => {
|
|
8
8
|
const rand = Math.max(100, Math.random() * 99);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/components/display/step.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../../src/components/display/step.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAA2C,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAEnI,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAMpC,KAAK,gBAAgB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA+BlH,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAiCF,eAAO,MAAM,cAAc,+BAAgC,CAAC;AAE5D,eAAO,MAAM,IAAI,GAAI,gEAAgE,SAAS,sBA0F7F,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,iBAAiB,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,sBA0BrF,CAAC"}
|
|
@@ -74,7 +74,7 @@ export const Tabs = (props) => {
|
|
|
74
74
|
};
|
|
75
75
|
return (<Context.Provider value={active}>
|
|
76
76
|
<Card className={props.className} container={css("pt-0 max-w-full w-full min-w-0", props.container)} header={<header className="overflow-x-auto relative mb-2">
|
|
77
|
-
<div className="absolute bottom-0 w-full h-
|
|
77
|
+
<div className="absolute bottom-0 w-full h-px bg-card-border"/>
|
|
78
78
|
<nav className="min-w-0">
|
|
79
79
|
<ul onKeyDown={onKeyDown} ref={ref} className="flex overflow-x-auto flex-1 justify-start w-0 min-w-full">
|
|
80
80
|
{items.map((x) => {
|
|
@@ -4,12 +4,12 @@ import { Label } from "../../types";
|
|
|
4
4
|
type ViewProps = {
|
|
5
5
|
text: string;
|
|
6
6
|
};
|
|
7
|
-
type CommandItem<T extends string, P extends object> = {
|
|
7
|
+
type CommandItem<T extends string, P extends object> = P & {
|
|
8
8
|
type: T;
|
|
9
9
|
hint?: string | string[];
|
|
10
10
|
Icon?: React.ReactElement;
|
|
11
11
|
enabled?: ((props: ViewProps) => boolean) | boolean;
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
type View = string | ((props: ViewProps) => string);
|
|
14
14
|
type CommandShortcutItem = CommandItem<"shortcut", {
|
|
15
15
|
title: View;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/floating/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAmE,MAAM,OAAO,CAAC;AAQxF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/floating/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAmE,MAAM,OAAO,CAAC;AAQxF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;IACzD,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC;CACrD,CAAC;AAEF,KAAK,IAAI,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;AAEpD,KAAK,mBAAmB,GAAG,WAAW,CACpC,UAAU,EACV;IACE,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,IAAI,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;QAClC,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC;KAC/D,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CACF,CAAC;AAEF,KAAK,gBAAgB,GAAG,WAAW,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AA8CtE,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;KAAE,CAAC,CAAC;CACjF,CAAC;AAsBF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,sBA6KxD,CAAC"}
|
|
@@ -121,7 +121,7 @@ export const CommandPalette = (props) => {
|
|
|
121
121
|
}, [bindKey, commands, props, valueRef]);
|
|
122
122
|
const Icon = props.Icon ?? FilterIcon;
|
|
123
123
|
return (<Fragment>
|
|
124
|
-
<Modal ref={ref} animated={false} closable={false} open={props.open} overlayClickClose ariaTitle="Command palette" bodyClassName="px-0 py-0 pt-0" data-component="command-palette" onChange={props.onChangeVisibility} className="container relative py-0 md:max-w-
|
|
124
|
+
<Modal ref={ref} animated={false} closable={false} open={props.open} overlayClickClose ariaTitle="Command palette" bodyClassName="px-0 py-0 pt-0" data-component="command-palette" onChange={props.onChangeVisibility} className="container relative py-0 md:max-w-(--breakpoint-sm) lg:max-w-(--breakpoint-md) overflow-clip">
|
|
125
125
|
<header className="flex sticky top-0 items-center w-full h-12 border-b overflow-clip isolate z-floating border-floating-border bg-floating-background">
|
|
126
126
|
<div className="flex justify-center items-center size-10">
|
|
127
127
|
{props.Icon ? <Icon Default={FilterIcon} text={value} size={16}/> : <FilterIcon size={16}/>}
|
|
@@ -129,7 +129,17 @@ export const CommandPalette = (props) => {
|
|
|
129
129
|
</div>
|
|
130
130
|
<input {...getReferenceProps({
|
|
131
131
|
ref: root.refs.setReference,
|
|
132
|
-
|
|
132
|
+
onKeyDown: (e) => {
|
|
133
|
+
const item = Is.number(activeIndex) ? displayItems[activeIndex] : null;
|
|
134
|
+
if (item) {
|
|
135
|
+
const key = e.key;
|
|
136
|
+
if (key === "Enter") {
|
|
137
|
+
if (item.type === "shortcut")
|
|
138
|
+
item.action({ event: e, text: value, setOpen: props.onChangeVisibility, });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
})} autoFocus value={value} data-combikeysbypass="true" placeholder="Search for..." onChange={(e) => setValue(e.target.value)} className="items-center py-2 px-2 pb-2 w-full h-12 text-lg text-left bg-transparent outline-hidden"/>
|
|
133
143
|
</header>
|
|
134
144
|
{props.loading ? (<ul role="listbox" data-component="command-palette-list" className="flex overflow-y-auto flex-col gap-1 px-2 my-2 w-full max-h-96 origin-[top_center]">
|
|
135
145
|
<div className="px-2 pt-2 pb-1 h-10">{translations.commandPaletteLoading}</div>
|
|
@@ -146,13 +156,8 @@ export const CommandPalette = (props) => {
|
|
|
146
156
|
onClick(e) {
|
|
147
157
|
e.preventDefault();
|
|
148
158
|
props.onChangeVisibility(false);
|
|
149
|
-
root.refs.domReference.current?.focus();
|
|
150
159
|
if (item.type === "shortcut")
|
|
151
|
-
item.action({
|
|
152
|
-
event: e,
|
|
153
|
-
setOpen: props.onChangeVisibility,
|
|
154
|
-
text: value,
|
|
155
|
-
});
|
|
160
|
+
item.action({ event: e, text: value, setOpen: props.onChangeVisibility, });
|
|
156
161
|
},
|
|
157
162
|
})} item={item} text={value} active={activeIndex === index} key={`${id}-${item.type}-${index}`}/>))}
|
|
158
163
|
{displayItems.length === 1 ? (<div className={css("flex items-center justify-between rounded-lg p-2 text-secondary")}>
|
|
@@ -5,7 +5,7 @@ import { ChevronRightIcon } from "lucide-react";
|
|
|
5
5
|
import React, { createContext, Fragment, useContext, useEffect, useRef, useState } from "react";
|
|
6
6
|
import { FLOATING_DELAY, TYPEAHEAD_RESET_DELAY } from "../../constants";
|
|
7
7
|
import { css, mergeRefs } from "../../lib/dom";
|
|
8
|
-
const menuItemClassName = (highlight = "") => css("w-full min-w-36 outline-
|
|
8
|
+
const menuItemClassName = (highlight = "") => css("w-full min-w-36 outline-hidden p-2.5 items-center flex justify-between text-left", "hover:bg-primary focus:bg-primary aria-expanded:opacity-80", "focus:text-primary-foreground hover:text-primary-foreground", "first-of-type:rounded-t-lg last-of-type:rounded-b-lg", "disabled:opacity-40 disabled:cursor-not-allowed", highlight);
|
|
9
9
|
const MenuContext = createContext({
|
|
10
10
|
isOpen: false,
|
|
11
11
|
activeIndex: null,
|
|
@@ -111,7 +111,7 @@ const MenuComponent = React.forwardRef(({ children, FloatingComponent = "div", h
|
|
|
111
111
|
<FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>
|
|
112
112
|
{isOpen && (<FloatingPortal>
|
|
113
113
|
<FloatingFocusManager context={context} modal={false} initialFocus={isNested ? -1 : 0} returnFocus={isParent ? restoreFocus : !isNested}>
|
|
114
|
-
<FloatingComponent {...getFloatingProps()} ref={refs.setFloating} style={{ ...props.style, ...floatingStyles }} className={css("isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-
|
|
114
|
+
<FloatingComponent {...getFloatingProps()} ref={refs.setFloating} style={{ ...props.style, ...floatingStyles }} className={css("isolate z-tooltip flex max-h-80 flex-col items-start overflow-y-auto rounded-lg border border-floating-border bg-floating-background text-left shadow-shadow-floating outline-hidden", floatingClassName)}>
|
|
115
115
|
{children}
|
|
116
116
|
</FloatingComponent>
|
|
117
117
|
</FloatingFocusManager>
|
|
@@ -165,7 +165,7 @@ export const Modal = forwardRef(({ open, title, footer, asChild, trigger, childr
|
|
|
165
165
|
{Trigger}
|
|
166
166
|
</Component>) : null}
|
|
167
167
|
<FloatingPortal preserveTabOrder root={root}>
|
|
168
|
-
{open ? (<FloatingOverlay lockScroll className={css("inset-0 flex isolate bg-floating-overlay/70 z-overlay h-
|
|
168
|
+
{open ? (<FloatingOverlay lockScroll className={css("inset-0 flex isolate bg-floating-overlay/70 z-overlay h-dvh overflow-clip!", type === "drawer" ? "" : "items-start justify-center lg:p-10 pt-10", overlayClassName)}>
|
|
169
169
|
<MotionConfig reducedMotion={animated ? "user" : "always"}>
|
|
170
170
|
<FloatingFocusManager guards modal closeOnFocusOut={closeOnFocusOut} context={floating.context}>
|
|
171
171
|
<motion.div {...props} {...(title
|
|
@@ -135,7 +135,7 @@ export const Wizard = ({ steps, active = false, onClose = noop, onFinish = noop,
|
|
|
135
135
|
top: "50%",
|
|
136
136
|
left: "50%",
|
|
137
137
|
transform: "translate(-50%, -50%)"
|
|
138
|
-
}} className="outline-
|
|
138
|
+
}} className="outline-hidden pointer-events-auto">
|
|
139
139
|
<motion.div transition={{ duration: 0.2 }} exit={{ opacity: 0, scale: 0.9 }} animate={{ opacity: 1, scale: 1 }} initial={{ opacity: 0, scale: 0.9 }} className="flex flex-col gap-3 p-4 w-80 max-w-sm rounded-lg border shadow-lg bg-card-background border-card-border">
|
|
140
140
|
{element && (<FloatingArrow ref={arrowRef} context={context} className="fill-card-background stroke-card-border"/>)}
|
|
141
141
|
{currentStep.title && (<h3>{currentStep.title}</h3>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AASzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CAClC,CAAC;AAiCF,eAAO,MAAM,YAAY,yGA0WxB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { autoUpdate, FloatingFocusManager, FloatingPortal, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTransitionStyles, } from "@floating-ui/react";
|
|
2
|
+
import { autoPlacement, autoUpdate, FloatingFocusManager, FloatingPortal, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole, useTransitionStyles, } from "@floating-ui/react";
|
|
3
3
|
import { ChevronDown } from "lucide-react";
|
|
4
4
|
import { AnimatePresence, motion } from "motion/react";
|
|
5
5
|
import React, { forwardRef, Fragment, useEffect, useRef, useState } from "react";
|
|
@@ -14,14 +14,14 @@ import { fzf } from "../../lib/fzf";
|
|
|
14
14
|
import { InputField } from "./input-field";
|
|
15
15
|
const Frag = (props) => <Fragment>{props.children}</Fragment>;
|
|
16
16
|
const transitionStyles = {
|
|
17
|
-
duration:
|
|
17
|
+
duration: 200,
|
|
18
18
|
initial: { transform: "scaleY(0)", opacity: 0.2 },
|
|
19
19
|
open: { transform: "scaleY(1)", opacity: 1 },
|
|
20
20
|
close: { transform: "scaleY(0)", opacity: 0 },
|
|
21
21
|
};
|
|
22
22
|
const emptyRef = [];
|
|
23
23
|
const List = forwardRef(function VirtualList(props, ref) {
|
|
24
|
-
return (<motion.ul {...props} ref={ref} className="overscroll-contain w-full rounded-lg">
|
|
24
|
+
return (<motion.ul {...props} ref={ref} className="overscroll-contain w-full rounded-lg h-96">
|
|
25
25
|
<AnimatePresence>{props.children}</AnimatePresence>
|
|
26
26
|
</motion.ul>);
|
|
27
27
|
});
|
|
@@ -66,14 +66,14 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
66
66
|
const pattern = dynamicOption
|
|
67
67
|
? undefined
|
|
68
68
|
: `^(${options.map((x) => `${safeRegex(x.value)}${x.label ? "|" + safeRegex(x.label) : ""}`).join("|")})$`;
|
|
69
|
-
const { x, y, strategy, refs, context } = useFloating({
|
|
69
|
+
const { x, y, strategy, refs, context, placement } = useFloating({
|
|
70
70
|
open,
|
|
71
71
|
transform: true,
|
|
72
72
|
onOpenChange: setOpen,
|
|
73
|
-
placement: "bottom-start",
|
|
74
73
|
whileElementsMounted: autoUpdate,
|
|
75
74
|
middleware: [
|
|
76
75
|
offset(4),
|
|
76
|
+
autoPlacement({ allowedPlacements: ['top-start', 'bottom-start'], alignment: "start" }),
|
|
77
77
|
size({
|
|
78
78
|
padding: 10,
|
|
79
79
|
elementContext: "reference",
|
|
@@ -175,7 +175,8 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
175
175
|
const id = props.id || props.name;
|
|
176
176
|
const shadowId = `${id}-shadow`;
|
|
177
177
|
const isEmpty = displayList.length === 0;
|
|
178
|
-
|
|
178
|
+
const isTopPlacement = placement === "top" || placement === "top-start";
|
|
179
|
+
return (<InputField {...props} left={left} error={error} ref={fieldset} form={props.form} loading={loading} name={props.name} feedback={open && (isTopPlacement) ? props.title : feedback} hideLeft={hideLeft} required={required} title={props.title} container={container} rightLabel={rightLabel} interactive={interactive} id={shadowId} optionalText={optionalText} componentName="autocomplete" labelClassName={labelClassName} placeholder={props.placeholder} right={<span className="flex gap-0.5 items-center">
|
|
179
180
|
{right}
|
|
180
181
|
<button type="button" className="p-2 transition-colors md:p-1 link:text-primary" onClick={onCaretDownClick}>
|
|
181
182
|
<ChevronDown size={20}/>
|
|
@@ -228,29 +229,27 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
},
|
|
231
|
-
})} data-value={value} data-error={!!error} data-name={id} data-target={id} required={required} value={open ? shadow : options.length === 0 ? "" : label || value} aria-autocomplete="list" autoComplete="off" className={css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-
|
|
232
|
+
})} data-value={value} data-error={!!error} data-name={id} data-target={id} required={required} value={open ? shadow : options.length === 0 ? "" : label || value} aria-autocomplete="list" autoComplete="off" className={css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-hidden transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "text-base group-focus-within:border-primary group-hover:border-primary", props.className)}/>
|
|
232
233
|
<input id={id} name={id} type="hidden" data-origin={id} ref={externalRef} required={required} defaultValue={props.value || value || undefined}/>
|
|
233
234
|
<FloatingPortal preserveTabOrder>
|
|
234
235
|
{open ? (<FloatingFocusManager modal guards returnFocus={false} context={context} initialFocus={-1} visuallyHiddenDismiss>
|
|
235
236
|
<motion.div {...getFloatingProps({
|
|
236
237
|
ref: mergeRefs(removeScrollRef, refs.setFloating),
|
|
237
238
|
style: { ...transitions.styles, left: x, top: y ?? 0, position: strategy, height: "auto" },
|
|
238
|
-
})} initial={false} data-floating="true" animate={{ height: isEmpty ? "auto" : h }} className="overscroll-contain p-0 m-0 max-h-80 list-none rounded-t-lg rounded-b-lg border ease-in-out isolate z-floating
|
|
239
|
+
})} initial={false} data-floating="true" animate={{ height: isEmpty ? "auto" : h }} className={css("overscroll-contain p-0 m-0 max-h-80 list-none rounded-t-lg rounded-b-lg border ease-in-out isolate z-floating border-floating-border bg-floating-background text-foreground shadow-floating", isTopPlacement ? "origin-[bottom_center]" : "origin-[top_center]")} onAnimationComplete={() => {
|
|
239
240
|
if (!open)
|
|
240
241
|
return setH(0);
|
|
241
242
|
const ul = refs.floating.current;
|
|
242
243
|
const li = ul.querySelectorAll("li").item(0);
|
|
243
244
|
const sum = (li ? li.getBoundingClientRect().height : MIN_SIZE) * displayList.length;
|
|
244
|
-
return flushSync(() => setH(sum +
|
|
245
|
+
return flushSync(() => setH(sum + 2));
|
|
245
246
|
}}>
|
|
246
247
|
{isEmpty ? (<div role="option" className="w-full border-b border-tooltip-border">
|
|
247
248
|
<span className="flex justify-between p-2 w-full text-left text-disabled">
|
|
248
249
|
{emptyMessage || translation.autocompleteEmpty}
|
|
249
250
|
</span>
|
|
250
251
|
</div>) : null}
|
|
251
|
-
<Virtuoso overscan={40} ref={virtuoso} hidden={isEmpty} data={displayList}
|
|
252
|
-
// style={{ height: h - 10 }}
|
|
253
|
-
defaultItemHeight={MIN_SIZE} components={components} scrollerRef={(e) => void (scroller.current = e)} className="overscroll-contain p-0 max-h-full rounded-lg border-floating bg-floating-background text-foreground" itemContent={(i, option) => {
|
|
252
|
+
<Virtuoso overscan={40} ref={virtuoso} hidden={isEmpty} data={displayList} style={{ height: h }} defaultItemHeight={MIN_SIZE} components={components} scrollerRef={(e) => void (scroller.current = e)} className="overscroll-contain p-0 max-h-full rounded-lg border-floating bg-floating-background text-foreground" itemContent={(i, option) => {
|
|
254
253
|
const Label = option.Render ?? Frag;
|
|
255
254
|
const active = value === option.value || value === option.label;
|
|
256
255
|
const selected = index === i;
|
|
@@ -3,7 +3,7 @@ import { css } from "../../lib/dom";
|
|
|
3
3
|
export const Checkbox = forwardRef(({ children, asTask = false, labelClassName, loading, error, className = "", size, container, ...props }, ref) => {
|
|
4
4
|
const d = props.disabled || loading;
|
|
5
5
|
return (<label aria-disabled={d} data-disabled={d} data-task={asTask} data-component="checkbox" className={css("group flex w-fit flex-wrap items-center font-normal data-[disabled=true]:cursor-not-allowed", asTask ? "group-checkbox-checked:line-through" : "", container)}>
|
|
6
|
-
<input {...props} ref={ref} disabled={d} type="checkbox" data-task={asTask} className={css("form-checkbox mr-2 inline-block size-4 appearance-none rounded border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed", className)}/>
|
|
6
|
+
<input {...props} ref={ref} disabled={d} type="checkbox" data-task={asTask} className={css("form-checkbox mr-2 inline-block size-4 appearance-none rounded-sm border-card-border bg-origin-border text-primary focus:ring-primary disabled:opacity-70 group-aria-disabled:cursor-not-allowed", className)}/>
|
|
7
7
|
{children}
|
|
8
8
|
<span data-name="checkbox-label" className={css("min-w-full flex-1 text-xs text-danger empty:mt-0 empty:hidden", labelClassName)}>
|
|
9
9
|
{error}
|
|
@@ -34,7 +34,7 @@ export const createFreeText = (Element, elementName, defaultProps, register) =>
|
|
|
34
34
|
};
|
|
35
35
|
}, []);
|
|
36
36
|
return (<InputField {...defaultProps} info={info} left={left} error={error} right={right} loading={loading} form={props.form} name={props.name} feedback={feedback} hideLeft={hideLeft} title={props.title} container={css(container, defaultProps.container)} rightLabel={rightLabel} disabled={props.disabled} interactive={interactive} required={props.required} componentName={elementName} id={props.name || props.id} optionalText={optionalText} labelClassName={labelClassName} placeholder={props.placeholder}>
|
|
37
|
-
<Render {...defaultProps} {...props} id={id} name={id} type={type} data-next={next} aria-busy={props.disabled} aria-disabled={props.disabled} aria-readonly={props.readOnly} ref={mergeRefs(ref, inputRef)} className={css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-base text-foreground", "outline-
|
|
37
|
+
<Render {...defaultProps} {...props} id={id} name={id} type={type} data-next={next} aria-busy={props.disabled} aria-disabled={props.disabled} aria-readonly={props.readOnly} ref={mergeRefs(ref, inputRef)} className={css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-base text-foreground", "outline-hidden transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "resize-y group-focus-within:border-primary group-hover:border-primary", "disabled:cursor-not-allowed disabled:text-disabled", props.className)}/>
|
|
38
38
|
</InputField>);
|
|
39
39
|
});
|
|
40
40
|
return FreeText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"input-field.d.ts","sourceRoot":"","sources":["../../../src/components/form/input-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAwB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI5E,OAAO,EAAE,KAAK,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CACjD,OAAO,CAAC;IACN,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC,CACH,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,kEAA0E,aAAa,sBA0CpH,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,IAAI,gBAAgB,CACvF,OAAO,CACL,QAAQ,CACN,aAAa,EACb;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB,CACF,CACF,EACD,CAAC,CACF,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,SAAS,OAAO,GAAG,QAAQ,GAAG,UAAU,EAAE,KAAK,EAAE,iBAAiB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,YA6EpH,CAAC"}
|
|
@@ -5,23 +5,23 @@ import { useTranslations } from "../../hooks/use-translations";
|
|
|
5
5
|
import { useTweaks } from "../../hooks/use-tweaks";
|
|
6
6
|
import { css } from "../../lib/dom";
|
|
7
7
|
import { Tooltip } from "../floating/tooltip";
|
|
8
|
-
export const InputFeedback = ({ reportStatus, id, hideLeft = false, className, info, children, title }) => (<span className={css("w-full justify-between", hideLeft && children === null ? "hidden" : "flex", className)}>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
export const InputFeedback = ({ reportStatus, id, hideLeft = false, className, info, children, title }) => (<span className={css("max-w-full justify-between w-fit", hideLeft && children === null ? "hidden" : "flex", className)}>
|
|
9
|
+
{hideLeft ? null : (<span className="flex flex-1 gap-1 items-center transition-colors group-disabled:text-disabled group-error:text-danger group-hover:text-primary group-focus-within:text-primary">
|
|
10
|
+
{title}
|
|
11
|
+
{reportStatus || info ? (<span className="flex gap-1 justify-center items-center">
|
|
12
|
+
{info ? (<Tooltip as="button" type="button" aria-label={typeof info === "string" ? info : undefined} aria-describedby={typeof info === "string" ? undefined : id ? `tooltip-info-content-${id}` : undefined} title={<span className="cursor-help">
|
|
13
|
+
<InfoIcon className="aspect-square size-3" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
|
|
14
|
+
</span>}>
|
|
15
|
+
<div id={id ? `tooltip-info-content-${id}` : undefined} className="w-full max-w-48 whitespace-break-spaces wrap-break-word">{info}</div>
|
|
16
|
+
</Tooltip>) : null}
|
|
17
|
+
{reportStatus ? (<span className="flex items-center h-3 min-w-6">
|
|
18
|
+
<CheckCircle className="hidden opacity-0 transition-opacity aspect-square size-3 group-assert:block group-assert:text-success group-assert:opacity-100" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
|
|
19
|
+
<XCircle className="hidden opacity-0 transition-opacity aspect-square size-3 group-error:block group-error:opacity-100" aria-hidden="true" size={16} strokeWidth={1} absoluteStrokeWidth/>
|
|
20
|
+
</span>) : null}
|
|
21
|
+
</span>) : null}
|
|
22
|
+
</span>)}
|
|
23
|
+
{children}
|
|
24
|
+
</span>);
|
|
25
25
|
export const InputField = forwardRef(({ optionalText: _optionalText, left, rightLabel, container, feedback, interactive, right, info, children, error, form, id, labelClassName = "", name, title, componentName, placeholder, hideLeft = false, required, disabled, reportStatus, }, ref) => {
|
|
26
26
|
const tweaks = useTweaks();
|
|
27
27
|
const reportStatusDefault = reportStatus !== undefined ? reportStatus : tweaks.input.iconFeedback;
|
|
@@ -29,26 +29,26 @@ export const InputField = forwardRef(({ optionalText: _optionalText, left, right
|
|
|
29
29
|
const translation = useTranslations();
|
|
30
30
|
const optionalText = _optionalText ?? translation.inputOptionalLabel;
|
|
31
31
|
return (<fieldset ref={ref} form={form} disabled={disabled} data-error={!!error} aria-disabled={disabled} data-component={componentName} data-interactive={!!interactive} className={css("group flex min-h-0 max-w-full min-w-0 flex-col items-start", container)}>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
<label form={form} htmlFor={ID} className="inline-flex relative flex-row flex-wrap gap-1 justify-between w-full max-w-full text-sm transition-colors cursor-text empty:hidden text-field-label group-disabled:cursor-not-allowed group-error:text-danger">
|
|
33
|
+
<InputFeedback info={info} hideLeft={hideLeft} reportStatus={reportStatusDefault} title={title} placeholder={placeholder}>
|
|
34
|
+
{optionalText || rightLabel ? (<Fragment>
|
|
35
|
+
{!required ? (<span aria-disabled={disabled} className="text-opacity-70 transition-colors aria-disabled:text-disabled group-hover:text-primary group-focus-within:text-primary">
|
|
36
|
+
{optionalText}
|
|
37
|
+
</span>) : null}
|
|
38
|
+
{rightLabel ? <Fragment>{rightLabel}</Fragment> : null}
|
|
39
|
+
</Fragment>) : null}
|
|
40
|
+
</InputFeedback>
|
|
41
|
+
<div className={`group relative flex w-full flex-row flex-nowrap items-center gap-x-2 gap-y-1 rounded-md border border-input-border bg-transparent transition-colors group-hover:border-primary group-disabled:border-disabled group-error:border-danger ${labelClassName}`}>
|
|
42
|
+
{left ? <span className="flex flex-nowrap gap-1 pl-2 whitespace-nowrap">{left}</span> : null}
|
|
43
|
+
{children}
|
|
44
|
+
{right ? <span className="flex flex-nowrap gap-2 pr-2 whitespace-nowrap">{right}</span> : null}
|
|
45
|
+
</div>
|
|
46
|
+
</label>
|
|
47
|
+
<p className="mt-input-gap hidden whitespace-pre-wrap text-wrap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):invalid[data-initialized=true]]:flex group-error:flex group-error:text-danger">
|
|
48
|
+
{error}
|
|
49
|
+
</p>
|
|
50
|
+
<p className="mt-input-gap text-xs empty:mt-0 empty:hidden group-has-[input:not(:focus):valid[data-initialized=true]]:block group-assert:block group-error:hidden">
|
|
51
|
+
{feedback}
|
|
52
|
+
</p>
|
|
53
|
+
</fieldset>);
|
|
54
54
|
});
|
|
@@ -231,7 +231,7 @@ export const MultiSelect = forwardRef(({ left, error, right, options, container,
|
|
|
231
231
|
id: `${id}-shadow`,
|
|
232
232
|
name: `${id}-shadow`,
|
|
233
233
|
ref: refs.setReference,
|
|
234
|
-
})} tabIndex={0} role="button" data-name={id} data-target={id} data-shadow="true" data-error={!!error} aria-autocomplete="list" data-value={values.join(",")} className={css("input text-base placeholder-input-mask group h-input-height w-full", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-
|
|
234
|
+
})} tabIndex={0} role="button" data-name={id} data-target={id} data-shadow="true" data-error={!!error} aria-autocomplete="list" data-value={values.join(",")} className={css("input text-base placeholder-input-mask group h-input-height w-full", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-hidden transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "group-focus-within:border-primary group-hover:border-primary", "flex flex-row items-center gap-2 whitespace-nowrap text-left", "max-w-full overflow-x-auto truncate text-ellipsis", props.className)}>
|
|
235
235
|
{values.length > 0 ? null : <li className="text-input-placeholder">{props.placeholder}</li>}
|
|
236
236
|
<OverflowControl label={selectedLabel}>{tags}</OverflowControl>
|
|
237
237
|
</ul>
|
|
@@ -249,7 +249,7 @@ export const MultiSelect = forwardRef(({ left, error, right, options, container,
|
|
|
249
249
|
height: h - (values.length === 0 ? 65 : 30),
|
|
250
250
|
},
|
|
251
251
|
})} data-floating="true" className="overscroll-contain p-0 m-0 w-full max-h-96 list-none rounded-t-lg rounded-b-lg border shadow-floating isolate z-floating origin-[top_center] border-floating-border bg-floating-background text-foreground">
|
|
252
|
-
<input autoFocus value={shadow} onChange={onChange} title={props.title} placeholder={translation.multiSelectInnerPlaceholder} className="flex-1 mb-1 w-full h-10 bg-transparent rounded border-b transition-colors outline-
|
|
252
|
+
<input autoFocus value={shadow} onChange={onChange} title={props.title} placeholder={translation.multiSelectInnerPlaceholder} className="flex-1 mb-1 w-full h-10 bg-transparent rounded-sm border-b transition-colors outline-hidden focus:ring-2 focus:ring-inset input placeholder-input-mask group border-input-border px-input-x py-input-y focus:ring-primary" onKeyDown={(event) => {
|
|
253
253
|
if (event.key === "ArrowDown") {
|
|
254
254
|
let next = index + 1;
|
|
255
255
|
if (next > displayList.length - 1)
|
|
@@ -32,7 +32,7 @@ export const Select = forwardRef(({ required = true, options, info, selectContai
|
|
|
32
32
|
<span className="sr-only">{translation.inputCaretDown}</span>
|
|
33
33
|
</button>
|
|
34
34
|
</label>}>
|
|
35
|
-
<select {...props} id={id} name={id} required={required} ref={mergeRefs(ref, inputRef)} data-selected={!!props.value || false} title={typeof props.title === "string" ? props.title : undefined} className={css("input select group text-base h-10 w-full flex-1 appearance-none rounded-md", "bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder", "outline-
|
|
35
|
+
<select {...props} id={id} name={id} required={required} ref={mergeRefs(ref, inputRef)} data-selected={!!props.value || false} title={typeof props.title === "string" ? props.title : undefined} className={css("input select group text-base h-10 w-full flex-1 appearance-none rounded-md", "bg-transparent px-2 py-1 text-foreground placeholder-input-placeholder", "outline-hidden transition-colors group-error:text-danger group-error:placeholder-input-mask-error", "data-[selected=false]:text-input-placeholder", props.className)}>
|
|
36
36
|
<option value="" disabled hidden>
|
|
37
37
|
{props.placeholder}
|
|
38
38
|
</option>
|
|
@@ -25,7 +25,7 @@ const Thumb = (props) => {
|
|
|
25
25
|
observer.observe(html, { attributeFilter: ["aria-valuenow"] });
|
|
26
26
|
return () => observer.disconnect();
|
|
27
27
|
}, []);
|
|
28
|
-
return (<Tooltip title="" ref={ref} as={Base.Thumb} enabled={props.tooltip} className="block rounded-full focus-within:border-primary focus-within::scale-105 bg-input-switch size-5 cursor-grab border-2 border-input-border shadow-shadow-floating focus-within:outline active:cursor-grabbing">
|
|
28
|
+
return (<Tooltip title="" ref={ref} as={Base.Thumb} enabled={props.tooltip} className="block rounded-full focus-within:border-primary focus-within::scale-105 bg-input-switch size-5 cursor-grab border-2 border-input-border shadow-shadow-floating focus-within:outline-solid active:cursor-grabbing">
|
|
29
29
|
{float}
|
|
30
30
|
</Tooltip>);
|
|
31
31
|
};
|
|
@@ -34,8 +34,8 @@ export const Switch = forwardRef(({ children, loading, container, error, ...prop
|
|
|
34
34
|
return (<fieldset className={css("flex flex-col flex-wrap justify-center", container)} data-component="switch" disabled={props.disabled || loading}>
|
|
35
35
|
<span className="flex flex-row flex-wrap items-center">
|
|
36
36
|
<input {...props} hidden ref={innerRef} type="checkbox" checked={checked} id={props.id || id} data-trigger="change" data-checked={checked} disabled={props.disabled || loading} onChange={(e) => setInnerChecked(e.target.checked)}/>
|
|
37
|
-
<button type="button" role="switch" onClick={onCheck} aria-checked={checked} data-checked={checked} aria-labelledby={`${id}-label`} disabled={props.disabled || loading} className="relative inline-flex h-6 w-11
|
|
38
|
-
<span aria-hidden="true" data-checked={checked} className="inline-block aspect-square size-5 transform rounded-full shadow ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"/>
|
|
37
|
+
<button type="button" role="switch" onClick={onCheck} aria-checked={checked} data-checked={checked} aria-labelledby={`${id}-label`} disabled={props.disabled || loading} className="relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-300 ease-in-out focus:outline-hidden focus:ring-2 focus:ring-primary focus:ring-offset-2 data-[checked=false]:bg-input-switch-bg data-[checked=true]:bg-primary">
|
|
38
|
+
<span aria-hidden="true" data-checked={checked} className="inline-block aspect-square size-5 transform rounded-full shadow-sm ring-0 transition duration-300 ease-in-out data-[checked=false]:translate-x-0 data-[checked=true]:translate-x-5 data-[checked=false]:bg-disabled data-[checked=true]:bg-input-switch"/>
|
|
39
39
|
</button>
|
|
40
40
|
<label htmlFor={props.id || id} className="ml-3 inline-block text-sm" id={`${id}-label`}>
|
|
41
41
|
<span className="font-medium text-foreground">{children}</span>
|
|
@@ -35,7 +35,7 @@ const TFoot = React.forwardRef((props, ref) => {
|
|
|
35
35
|
return (<tfoot {...props} ref={ref} className="bg-card-background">
|
|
36
36
|
<tr role="row" className="bg-card-background">
|
|
37
37
|
<td colSpan={999} className="px-2 h-14 bg-card-background">
|
|
38
|
-
<span className="block w-full h-2 rounded opacity-60 animate-pulse bg-foreground"/>
|
|
38
|
+
<span className="block w-full h-2 rounded-sm opacity-60 animate-pulse bg-foreground"/>
|
|
39
39
|
</td>
|
|
40
40
|
</tr>
|
|
41
41
|
</tfoot>);
|
|
@@ -15,7 +15,7 @@ export const Metadata = (props) => (<header className="mb-1 min-w-full">
|
|
|
15
15
|
<Group rows={props.rows} groups={props.groups} setGroups={props.setGroups} options={props.options} cols={props.cols}/>
|
|
16
16
|
</span>
|
|
17
17
|
</div>
|
|
18
|
-
<ul className="flex flex-row flex-wrap flex-1
|
|
18
|
+
<ul className="flex flex-row flex-wrap flex-1 grow gap-4 items-center w-full md:justify-end">
|
|
19
19
|
{props.filters.map((x) => (<li key={`filter-table-${x.id}`} className="flex gap-1 items-center py-0.5 px-4 rounded-xl border border-card-border">
|
|
20
20
|
<span>
|
|
21
21
|
<span className="inline-block mr-2 rounded-full size-3 aspect-square bg-primary" aria-hidden="true"/>
|
|
@@ -25,7 +25,7 @@ export const Metadata = (props) => (<header className="mb-1 min-w-full">
|
|
|
25
25
|
<span aria-hidden="true" className="invisible p-0 whitespace-pre">
|
|
26
26
|
{x.value || " "}
|
|
27
27
|
</span>
|
|
28
|
-
<input type={x.type} value={x.value} className="absolute left-0 top-0 m-0 inline-block w-full bg-transparent p-0 placeholder-primary/70 outline-
|
|
28
|
+
<input type={x.type} value={x.value} className="absolute left-0 top-0 m-0 inline-block w-full bg-transparent p-0 placeholder-primary/70 outline-hidden [appearance:textfield] empty:after:text-primary/70 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" onChange={(e) => {
|
|
29
29
|
const value = valueFromType(e.target);
|
|
30
30
|
props.setFilters((prev) => prev.map((item) => x.id === item.id
|
|
31
31
|
? { ...item, value, } : item));
|
|
@@ -42,7 +42,7 @@ export const Row = (index, row, context) => {
|
|
|
42
42
|
const className = col.cellProps?.className || "";
|
|
43
43
|
const exposeAside = colIndex === 0 && context.Aside && loading === false;
|
|
44
44
|
const Aside = context.Aside;
|
|
45
|
-
return (<td {...col.cellProps} role="cell" data-matrix={matrix} key={`accessor-${index}-${colIndex}`} className={`typography group-table-cell p-
|
|
45
|
+
return (<td {...col.cellProps} role="cell" data-matrix={matrix} key={`accessor-${index}-${colIndex}`} className={`typography group-table-cell p-(--table-cell-padding) whitespace-pre-wrap flex flex-col md:table-cell border-b border md:border-l-transparent md:border-b-0 border-y border-collapse border-table-border md:border-r md:last:border-r-transparent ${className}`}>
|
|
46
46
|
{exposeAside ? (<RowAside>
|
|
47
47
|
<Aside col={col} row={row} rowIndex={index}/>
|
|
48
48
|
</RowAside>) : null}
|
|
@@ -42,7 +42,7 @@ const HeaderChild = (props) => {
|
|
|
42
42
|
const ariaSort = !ownSorter?.type ? "none" : ownSorter.type === Order.Asc ? "ascending" : "descending";
|
|
43
43
|
const label = getLabel(props.header);
|
|
44
44
|
return (<Reorder.Item {...props.header.thProps} as="th" ref={dragRef} initial={false} dragSnapToOrigin dragDirectionLock role="columnheader" aria-sort={ariaSort} value={props.header} aria-busy={props.loading} data-tableheader={props.header.id} whileDrag={{ cursor: "grabbing" }} className={`relative md:h-14 typography min-w-0 cursor-grab font-medium ${props.header.thProps?.className ?? ""}`}>
|
|
45
|
-
<span className={`flex h-full items-center justify-between bg-table-header p-
|
|
45
|
+
<span className={`flex h-full items-center justify-between bg-table-header p-(--table-cell-padding) ${props.isLast ? "rounded-tr-lg" : ""} ${props.index === 0 ? "rounded-tl-lg" : ""}`}>
|
|
46
46
|
<span className="flex gap-1 items-center">
|
|
47
47
|
{props.inlineFilter && defaultAllowFilter ? (<Dropdown arrow trigger={<span>
|
|
48
48
|
<span id={`${props.header.id}-filter-dropdown-button`} className="sr-only">
|
|
@@ -69,7 +69,7 @@ const HeaderChild = (props) => {
|
|
|
69
69
|
{props.inlineSorter && defaultAllowSort ? (<SorterHead col={props.header} setSorters={props.setSorters} sorters={props.sorters}/>) : null}
|
|
70
70
|
</span>
|
|
71
71
|
</span>
|
|
72
|
-
{props.isLast ? null : (<motion.button drag="x" draggable dragListener dragMomentum type="button" animate={false} dragElastic={0} dragPropagation initial={false} dragSnapToOrigin dragDirectionLock data-type="resizer" title={props.header.id} dragConstraints={dragConstraints} className="block absolute top-0 h-full hover:w-1.5 active:w-1.5 -right-[0.5px] z-calendar w-
|
|
72
|
+
{props.isLast ? null : (<motion.button drag="x" draggable dragListener dragMomentum type="button" animate={false} dragElastic={0} dragPropagation initial={false} dragSnapToOrigin dragDirectionLock data-type="resizer" title={props.header.id} dragConstraints={dragConstraints} className="block absolute top-0 h-full hover:w-1.5 active:w-1.5 -right-[0.5px] z-calendar w-px cursor-col-resize bg-transparent hover:bg-primary active:bg-primary" onClick={(e) => void e.currentTarget.focus()} onKeyDown={(e) => {
|
|
73
73
|
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
74
74
|
if (th.current === null)
|
|
75
75
|
return;
|