@g4rcez/components 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +44 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7514 -7500
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +44 -44
- package/dist/index.umd.js.map +1 -1
- package/dist/preset/src/styles/common.js +1 -1
- package/dist/src/components/core/button.d.ts +41 -11
- package/dist/src/components/core/button.d.ts.map +1 -1
- package/dist/src/components/core/button.js +36 -35
- package/dist/src/components/core/polymorph.d.ts +5 -7
- package/dist/src/components/core/polymorph.d.ts.map +1 -1
- package/dist/src/components/core/tag.d.ts +22 -6
- package/dist/src/components/core/tag.d.ts.map +1 -1
- package/dist/src/components/core/tag.js +21 -20
- package/dist/src/components/display/alert.d.ts +15 -7
- package/dist/src/components/display/alert.d.ts.map +1 -1
- package/dist/src/components/display/alert.js +12 -11
- package/dist/src/components/floating/menu.d.ts +2 -2
- package/dist/src/components/floating/modal.js +3 -3
- package/dist/src/components/form/autocomplete.d.ts.map +1 -1
- package/dist/src/components/form/autocomplete.js +41 -56
- package/dist/src/components/form/multi-select.d.ts.map +1 -1
- package/dist/src/components/form/multi-select.js +60 -50
- package/dist/src/hooks/use-remove-scroll.d.ts +3 -1
- package/dist/src/hooks/use-remove-scroll.d.ts.map +1 -1
- package/dist/src/hooks/use-remove-scroll.js +37 -13
- package/dist/src/lib/dom.d.ts +1 -0
- package/dist/src/lib/dom.d.ts.map +1 -1
- package/dist/src/lib/dom.js +4 -0
- package/dist/src/styles/common.js +1 -1
- package/dist/src/types.d.ts +3 -0
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +10 -12
|
@@ -1,16 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { type Label } from "../../types";
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { CvaVariants, type Label } from "../../types";
|
|
4
3
|
import { PolymorphicProps } from "./polymorph";
|
|
5
|
-
declare const
|
|
6
|
-
size
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
declare const variants: {
|
|
5
|
+
size: {
|
|
6
|
+
icon: string;
|
|
7
|
+
big: string;
|
|
8
|
+
default: string;
|
|
9
|
+
min: string;
|
|
10
|
+
small: string;
|
|
11
|
+
};
|
|
12
|
+
rounded: {
|
|
13
|
+
rough: string;
|
|
14
|
+
squared: string;
|
|
15
|
+
default: string;
|
|
16
|
+
circle: string;
|
|
17
|
+
};
|
|
18
|
+
theme: {
|
|
19
|
+
raw: string;
|
|
20
|
+
disabled: string;
|
|
21
|
+
loading: string;
|
|
22
|
+
main: string;
|
|
23
|
+
info: string;
|
|
24
|
+
warn: string;
|
|
25
|
+
muted: string;
|
|
26
|
+
danger: string;
|
|
27
|
+
neutral: string;
|
|
28
|
+
primary: string;
|
|
29
|
+
success: string;
|
|
30
|
+
secondary: string;
|
|
31
|
+
"ghost-info": string;
|
|
32
|
+
"ghost-warn": string;
|
|
33
|
+
"ghost-danger": string;
|
|
34
|
+
"ghost-primary": string;
|
|
35
|
+
"ghost-success": string;
|
|
36
|
+
"ghost-secondary": string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
type Variants = CvaVariants<typeof variants>;
|
|
40
|
+
export type ButtonProps<T extends React.ElementType = "button"> = PropsWithChildren<PolymorphicProps<Variants & Partial<{
|
|
11
41
|
icon: Label;
|
|
12
42
|
loading: boolean;
|
|
13
|
-
}>, T
|
|
14
|
-
export declare const Button: <T extends React.ElementType = "button">(props: ButtonProps<T>) =>
|
|
43
|
+
}>, T>>;
|
|
44
|
+
export declare const Button: <T extends React.ElementType = "button">(props: ButtonProps<T>) => React.ReactNode;
|
|
15
45
|
export {};
|
|
16
46
|
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/core/button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/core/button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCb,CAAC;AAUF,KAAK,QAAQ,GAAG,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE7C,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,IAAI,iBAAiB,CAC/E,gBAAgB,CAAC,QAAQ,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,EAAE,CAAC,CAAC,CAC7E,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAwB5F,CAAC"}
|
|
@@ -3,42 +3,43 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { css } from "../../lib/dom";
|
|
5
5
|
import { Polymorph } from "./polymorph";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
circle: "rounded-full aspect-square",
|
|
20
|
-
},
|
|
21
|
-
theme: {
|
|
22
|
-
raw: "",
|
|
23
|
-
disabled: "bg-disabled opacity-70",
|
|
24
|
-
loading: "animate-pulse bg-disabled",
|
|
25
|
-
main: "bg-primary text-primary-foreground",
|
|
26
|
-
info: "bg-button-info-bg text-button-info-text",
|
|
27
|
-
warn: "bg-button-warn-bg text-button-warn-text",
|
|
28
|
-
muted: "bg-button-muted-bg text-button-muted-text",
|
|
29
|
-
danger: "bg-button-danger-bg text-button-danger-text",
|
|
30
|
-
neutral: "bg-transparent border-2 border-card-border",
|
|
31
|
-
primary: "bg-button-primary-bg text-button-primary-text",
|
|
32
|
-
success: "bg-button-success-bg text-button-success-text",
|
|
33
|
-
secondary: "bg-button-secondary-bg text-button-secondary-text",
|
|
34
|
-
"ghost-info": "bg-transparent hover:bg-info/20 border border-info text-info",
|
|
35
|
-
"ghost-warn": "bg-transparent hover:bg-warn/20 border border-warn text-warn",
|
|
36
|
-
"ghost-danger": "bg-transparent hover:bg-danger/20 border border-danger text-danger",
|
|
37
|
-
"ghost-primary": "bg-transparent hover:bg-primary/20 border border-primary text-primary",
|
|
38
|
-
"ghost-success": "bg-transparent hover:bg-success/20 border border-success text-success",
|
|
39
|
-
"ghost-secondary": "bg-transparent hover:bg-secondary/20 border border-secondary text-secondary",
|
|
40
|
-
},
|
|
6
|
+
const variants = {
|
|
7
|
+
size: {
|
|
8
|
+
icon: "p-1",
|
|
9
|
+
big: "h-12 px-6 py-4",
|
|
10
|
+
default: "h-10 px-4 py-2",
|
|
11
|
+
min: "h-7 px-3 py-1 text-sm",
|
|
12
|
+
small: "h-8 px-4 py-2 text-sm",
|
|
13
|
+
},
|
|
14
|
+
rounded: {
|
|
15
|
+
rough: "rounded-sm",
|
|
16
|
+
squared: "rounded-none",
|
|
17
|
+
default: "rounded-button",
|
|
18
|
+
circle: "rounded-full aspect-square",
|
|
41
19
|
},
|
|
20
|
+
theme: {
|
|
21
|
+
raw: "",
|
|
22
|
+
disabled: "bg-disabled opacity-70",
|
|
23
|
+
loading: "animate-pulse bg-disabled",
|
|
24
|
+
main: "bg-primary text-primary-foreground",
|
|
25
|
+
info: "bg-button-info-bg text-button-info-text",
|
|
26
|
+
warn: "bg-button-warn-bg text-button-warn-text",
|
|
27
|
+
muted: "bg-button-muted-bg text-button-muted-text",
|
|
28
|
+
danger: "bg-button-danger-bg text-button-danger-text",
|
|
29
|
+
neutral: "bg-transparent border-2 border-card-border",
|
|
30
|
+
primary: "bg-button-primary-bg text-button-primary-text",
|
|
31
|
+
success: "bg-button-success-bg text-button-success-text",
|
|
32
|
+
secondary: "bg-button-secondary-bg text-button-secondary-text",
|
|
33
|
+
"ghost-info": "bg-transparent hover:bg-info/20 border border-info text-info",
|
|
34
|
+
"ghost-warn": "bg-transparent hover:bg-warn/20 border border-warn text-warn",
|
|
35
|
+
"ghost-danger": "bg-transparent hover:bg-danger/20 border border-danger text-danger",
|
|
36
|
+
"ghost-primary": "bg-transparent hover:bg-primary/20 border border-primary text-primary",
|
|
37
|
+
"ghost-success": "bg-transparent hover:bg-success/20 border border-success text-success",
|
|
38
|
+
"ghost-secondary": "bg-transparent hover:bg-secondary/20 border border-secondary text-secondary",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
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-none focus-visible:ring-4 focus-visible:ring-ring", {
|
|
42
|
+
variants,
|
|
42
43
|
defaultVariants: { theme: "main", size: "default", rounded: "default" },
|
|
43
44
|
});
|
|
44
45
|
export const Button = forwardRef(function Button({ className, icon, loading, theme, type = "button", size, rounded, ...props }, ref) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import {
|
|
3
|
-
type TransformProps<E extends React.ElementType = React.ElementType> = {
|
|
2
|
+
import { Merge, Override } from "../../types";
|
|
3
|
+
type TransformProps<E extends React.ElementType = React.ElementType> = Merge<{
|
|
4
4
|
as?: E;
|
|
5
|
-
}
|
|
6
|
-
export type PolymorphicProps<P extends
|
|
7
|
-
|
|
8
|
-
declare const defaultElement = "span";
|
|
9
|
-
export declare const Polymorph: <E extends React.ElementType = typeof defaultElement>(props: InnerPolymorphicProps<E>) => React.ReactElement | null;
|
|
5
|
+
} & React.ComponentPropsWithRef<E>>;
|
|
6
|
+
export type PolymorphicProps<P extends object, E extends React.ElementType> = Override<TransformProps<E>, P>;
|
|
7
|
+
export declare const Polymorph: <E extends React.ElementType = React.ElementType>(props: TransformProps<E>) => React.ReactNode;
|
|
10
8
|
export {};
|
|
11
9
|
//# sourceMappingURL=polymorph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"polymorph.d.ts","sourceRoot":"","sources":["../../../../src/components/core/polymorph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9C,KAAK,cAAc,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC;IACzE,EAAE,CAAC,EAAE,CAAC,CAAA;CACT,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpC,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAI7G,eAAO,MAAM,SAAS,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAKrG,CAAC"}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Label } from "../../types";
|
|
3
|
+
import { CvaVariants, Label } from "../../types";
|
|
4
4
|
import { PolymorphicProps } from "./polymorph";
|
|
5
5
|
declare const indicatorVariant: (props?: ({
|
|
6
6
|
theme?: "info" | "warn" | "muted" | "danger" | "primary" | "success" | "secondary" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
-
declare const
|
|
9
|
-
size
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
declare const variants: {
|
|
9
|
+
readonly size: {
|
|
10
|
+
readonly icon: "p-1";
|
|
11
|
+
readonly big: "h-12 px-6 py-4";
|
|
12
|
+
readonly default: "h-8 px-4 py-2";
|
|
13
|
+
readonly small: "h-6 p-2 px-3 text-sm";
|
|
14
|
+
};
|
|
15
|
+
readonly theme: {
|
|
16
|
+
readonly primary: "bg-tag-primary-bg text-tag-primary-text";
|
|
17
|
+
readonly danger: "bg-tag-danger-bg text-tag-danger-text";
|
|
18
|
+
readonly info: "bg-tag-info-bg text-tag-info-text";
|
|
19
|
+
readonly success: "bg-tag-success-bg text-tag-success-text";
|
|
20
|
+
readonly secondary: "bg-tag-secondary-bg text-tag-secondary-text";
|
|
21
|
+
readonly warn: "bg-tag-warn-bg text-tag-warn-text";
|
|
22
|
+
readonly muted: "bg-tag-muted-bg text-tag-muted-text";
|
|
23
|
+
readonly neutral: "bg-transparent border border-card-border";
|
|
24
|
+
readonly disabled: "bg-disabled duration-700 opacity-70";
|
|
25
|
+
readonly loading: "animate-pulse bg-disabled duration-700 opacity-70";
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export type TagProps<T extends React.ElementType = "span"> = PolymorphicProps<CvaVariants<typeof variants> & Partial<{
|
|
13
29
|
icon: Label;
|
|
14
30
|
loading: boolean;
|
|
15
31
|
indicator: VariantProps<typeof indicatorVariant>["theme"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/components/core/tag.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,QAAA,MAAM,gBAAgB;;mFAYpB,CAAC;AAEH,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;CAmBJ,CAAC;AAOX,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,IAAI,gBAAgB,CACzE,WAAW,CAAC,OAAO,QAAQ,CAAC,GACxB,OAAO,CAAC;IACJ,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC;CAC7D,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,GAkB9E,CAAC"}
|
|
@@ -16,27 +16,28 @@ const indicatorVariant = cva("size-2.5 aspect-square rounded-full border-0", {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
loading: "animate-pulse bg-disabled duration-700 opacity-70",
|
|
38
|
-
},
|
|
19
|
+
const variants = {
|
|
20
|
+
size: {
|
|
21
|
+
icon: "p-1",
|
|
22
|
+
big: "h-12 px-6 py-4",
|
|
23
|
+
default: "h-8 px-4 py-2",
|
|
24
|
+
small: "h-6 p-2 px-3 text-sm",
|
|
25
|
+
},
|
|
26
|
+
theme: {
|
|
27
|
+
primary: "bg-tag-primary-bg text-tag-primary-text",
|
|
28
|
+
danger: "bg-tag-danger-bg text-tag-danger-text",
|
|
29
|
+
info: "bg-tag-info-bg text-tag-info-text",
|
|
30
|
+
success: "bg-tag-success-bg text-tag-success-text",
|
|
31
|
+
secondary: "bg-tag-secondary-bg text-tag-secondary-text",
|
|
32
|
+
warn: "bg-tag-warn-bg text-tag-warn-text",
|
|
33
|
+
muted: "bg-tag-muted-bg text-tag-muted-text",
|
|
34
|
+
neutral: "bg-transparent border border-card-border",
|
|
35
|
+
disabled: "bg-disabled duration-700 opacity-70",
|
|
36
|
+
loading: "animate-pulse bg-disabled duration-700 opacity-70",
|
|
39
37
|
},
|
|
38
|
+
};
|
|
39
|
+
const tagVariants = cva("inline-flex rounded-pill gap-1.5 border-2 border-transparent items-center justify-center align-middle whitespace-nowrap", {
|
|
40
|
+
variants,
|
|
40
41
|
defaultVariants: { theme: "primary", size: "default" },
|
|
41
42
|
});
|
|
42
43
|
export const Tag = forwardRef(function Tag({ className, indicator = undefined, icon, loading, theme, size, ...props }, ref) {
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import { type VariantProps } from "class-variance-authority";
|
|
2
1
|
import { HTMLMotionProps } from "motion/react";
|
|
3
2
|
import React, { PropsWithChildren } from "react";
|
|
3
|
+
import { CvaVariants } from "../../types";
|
|
4
4
|
import { PolymorphicProps } from "../core/polymorph";
|
|
5
5
|
type CollapseProps = HTMLMotionProps<"section"> & {
|
|
6
6
|
open: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const Collapse: (props: PropsWithChildren<CollapseProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare const
|
|
10
|
-
theme
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
declare const themeVariants: {
|
|
10
|
+
theme: {
|
|
11
|
+
primary: string;
|
|
12
|
+
danger: string;
|
|
13
|
+
info: string;
|
|
14
|
+
success: string;
|
|
15
|
+
secondary: string;
|
|
16
|
+
warn: string;
|
|
17
|
+
neutral: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type AlertProps<T extends React.ElementType = "div"> = PolymorphicProps<CvaVariants<typeof themeVariants> & Partial<{
|
|
15
21
|
open?: boolean;
|
|
22
|
+
container: string;
|
|
23
|
+
Icon: React.ReactElement;
|
|
16
24
|
onClose: (nextState: boolean) => void;
|
|
17
25
|
}>, T>;
|
|
18
26
|
export declare const Alert: <T extends React.ElementType = "div">(props: AlertProps<T>) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/display/alert.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/display/alert.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAU,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAahE,KAAK,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,4CAiB/D,CAAC;AAEF,QAAA,MAAM,aAAa;;;;;;;;;;CAUlB,CAAC;AAOF,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,IAAI,gBAAgB,CAC1E,WAAW,CAAC,OAAO,aAAa,CAAC,GAC7B,OAAO,CAAC;IACJ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,EACN,CAAC,CACJ,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,CAAC,CAAC,SAAS,KAAK,CAAC,WAAW,GAAG,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GA2CxE,CAAC"}
|
|
@@ -16,18 +16,19 @@ const transition = {
|
|
|
16
16
|
ease: [0.04, 0.62, 0.23, 0.98],
|
|
17
17
|
};
|
|
18
18
|
export const Collapse = (props) => (_jsx(motion.div, { ...props, layout: true, layoutRoot: true, layoutScroll: true, initial: false, variants: variants, exit: variants.false, transition: transition, "aria-hidden": !props.open, "data-component": "collapse", animate: props.open.toString(), className: css("aria-hidden:pointer-events-none", props.className), children: props.children }));
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
neutral: "bg-transparent border border-card-border text-alert-primary-text",
|
|
29
|
-
},
|
|
19
|
+
const themeVariants = {
|
|
20
|
+
theme: {
|
|
21
|
+
primary: "bg-alert-primary-bg text-alert-primary-text border-alert-primary-border",
|
|
22
|
+
danger: "bg-alert-danger-bg text-alert-danger-text border-alert-danger-border",
|
|
23
|
+
info: "bg-alert-info-bg text-alert-info-text border-alert-info-border",
|
|
24
|
+
success: "bg-alert-success-bg text-alert-success-text border-alert-success-border",
|
|
25
|
+
secondary: "bg-alert-secondary-bg text-alert-secondary-text border-alert-secondary-border",
|
|
26
|
+
warn: "bg-alert-warn-bg text-alert-warn-text border-alert-warn-border",
|
|
27
|
+
neutral: "bg-transparent border border-card-border text-alert-primary-text",
|
|
30
28
|
},
|
|
29
|
+
};
|
|
30
|
+
const alertVariants = cva("p-4 w-full block border relative rounded-lg text-sm", {
|
|
31
|
+
variants: themeVariants,
|
|
31
32
|
defaultVariants: { theme: "neutral" },
|
|
32
33
|
});
|
|
33
34
|
export const Alert = forwardRef(function Alert({ className, theme, Icon, onClose, open = true, ...props }, ref) {
|
|
@@ -21,7 +21,7 @@ type MenuItemProps = {
|
|
|
21
21
|
Right?: React.FC<LucideProps>;
|
|
22
22
|
};
|
|
23
23
|
export declare const MenuItem: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof MenuItemProps> & MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
-
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "
|
|
24
|
+
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "open" | "hover" | "asChild" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
25
25
|
hover: boolean;
|
|
26
26
|
open?: boolean;
|
|
27
27
|
nested: boolean;
|
|
@@ -32,7 +32,7 @@ export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.Deta
|
|
|
32
32
|
FloatingComponent: React.ElementType;
|
|
33
33
|
} & {
|
|
34
34
|
label: string;
|
|
35
|
-
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "
|
|
35
|
+
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "open" | "hover" | "asChild" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
36
36
|
hover: boolean;
|
|
37
37
|
open?: boolean;
|
|
38
38
|
nested: boolean;
|
|
@@ -8,7 +8,7 @@ import { AnimatePresence, motion, useMotionValue } from "motion/react";
|
|
|
8
8
|
import { Fragment, useId } from "react";
|
|
9
9
|
import { useMediaQuery } from "../../hooks/use-media-query";
|
|
10
10
|
import { useRemoveScroll } from "../../hooks/use-remove-scroll";
|
|
11
|
-
import { css } from "../../lib/dom";
|
|
11
|
+
import { css, mergeRefs } from "../../lib/dom";
|
|
12
12
|
const animationDuration = "600ms";
|
|
13
13
|
const drawerLeft = {
|
|
14
14
|
exit: { translateX: ["0%", "-30%"], opacity: 0, animationDuration },
|
|
@@ -86,7 +86,7 @@ const fetchPosition = (isDesktop, forceType, propsType, propsPosition) => {
|
|
|
86
86
|
return forceType ? positions[type] : positions.sheet;
|
|
87
87
|
};
|
|
88
88
|
export const Modal = ({ open, title, footer, asChild, trigger, children, layoutId, onChange, className, resizer = true, closable = true, forceType = false, overlayClassName = "", type: _type = "dialog", position: propsPosition, overlayClickClose = false, ariaTitle, ...props }) => {
|
|
89
|
-
useRemoveScroll(open);
|
|
89
|
+
const removeScrollRef = useRemoveScroll(open, "overflow-hidden");
|
|
90
90
|
const headingId = useId();
|
|
91
91
|
const descriptionId = useId();
|
|
92
92
|
const isDesktop = useMediaQuery("(min-width: 64rem)");
|
|
@@ -103,7 +103,7 @@ export const Modal = ({ open, title, footer, asChild, trigger, children, layoutI
|
|
|
103
103
|
const Trigger = trigger;
|
|
104
104
|
const floatingSize = useMotionValue(undefined);
|
|
105
105
|
const onClose = () => onChange(false);
|
|
106
|
-
return (_jsxs(Fragment, { children: [trigger ? (_jsx(Fragment, { children: asChild ? (_jsx(Slot, { ref: refs.setReference, ...getReferenceProps({ layoutId: layoutId }), children: Trigger })) : (_jsx(motion.button, { ref: refs.setReference, ...getReferenceProps(), layoutId: layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { mode: "wait", presenceAffectsLayout: true, children: open ? (_jsx(FloatingOverlay, { lockScroll: false, className: css(`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${type === "drawer" ? "" : "flex items-start justify-center p-10"}`, overlayClassName), children: _jsx(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, { ...props, exit: "exit", animate: "enter", initial: "initial", variants: animation, "data-component": "modal", ref: refs.setFloating,
|
|
106
|
+
return (_jsxs(Fragment, { children: [trigger ? (_jsx(Fragment, { children: asChild ? (_jsx(Slot, { ref: refs.setReference, ...getReferenceProps({ layoutId: layoutId }), children: Trigger })) : (_jsx(motion.button, { ref: refs.setReference, ...getReferenceProps(), layoutId: layoutId, type: "button", children: Trigger })) })) : null, _jsx(FloatingPortal, { children: _jsx(AnimatePresence, { mode: "wait", presenceAffectsLayout: true, children: open ? (_jsx(FloatingOverlay, { lockScroll: false, className: css(`inset-0 isolate z-overlay h-[100dvh] !overflow-clip bg-floating-overlay/70 ${type === "drawer" ? "" : "flex items-start justify-center p-10"}`, overlayClassName), children: _jsx(FloatingFocusManager, { visuallyHiddenDismiss: true, modal: true, closeOnFocusOut: true, context: context, children: _jsxs(motion.div, { ...props, exit: "exit", animate: "enter", "aria-modal": open, initial: "initial", layoutId: layoutId, variants: animation, "data-component": "modal", ref: mergeRefs(refs.setFloating, removeScrollRef), className: css(variants({ position, type }), className), style: type === "drawer" ? { width: floatingSize } : { height: floatingSize }, ...(title
|
|
107
107
|
? {
|
|
108
108
|
"aria-labelledby": headingId,
|
|
109
109
|
"aria-describedby": descriptionId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoF,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/form/autocomplete.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAoF,MAAM,OAAO,CAAC;AAQzG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,qBAAqB,EAAE,CAAC;CACpC,CAAC;AAmCF,eAAO,MAAM,YAAY,yGA4VxB,CAAC"}
|
|
@@ -8,8 +8,9 @@ import { forwardRef, Fragment, useEffect, useRef, useState } from "react";
|
|
|
8
8
|
import { flushSync } from "react-dom";
|
|
9
9
|
import { Virtuoso } from "react-virtuoso";
|
|
10
10
|
import { Is } from "sidekicker";
|
|
11
|
+
import { useRemoveScroll } from "../../hooks/use-remove-scroll";
|
|
11
12
|
import { useTranslations } from "../../hooks/use-translations";
|
|
12
|
-
import { css, dispatchInput, initializeInputDataset } from "../../lib/dom";
|
|
13
|
+
import { css, dispatchInput, getRemainingSize, initializeInputDataset, mergeRefs } from "../../lib/dom";
|
|
13
14
|
import { safeRegex } from "../../lib/fns";
|
|
14
15
|
import { InputField } from "./input-field";
|
|
15
16
|
const Frag = (props) => _jsx(Fragment, { children: props.children });
|
|
@@ -22,20 +23,20 @@ const transitionStyles = {
|
|
|
22
23
|
const fuzzyOptions = { caseSensitive: false, sort: false };
|
|
23
24
|
const emptyRef = [];
|
|
24
25
|
const List = forwardRef(function VirtualList(props, ref) {
|
|
25
|
-
return (_jsx(motion.ul, { ...props, ref: ref, className: "w-full rounded-lg border-b border-tooltip-border last:border-transparent", children: _jsx(AnimatePresence, { children: props.children }) }));
|
|
26
|
+
return (_jsx(motion.ul, { ...props, ref: ref, className: "w-full overscroll-contain rounded-lg border-b border-tooltip-border last:border-transparent", children: _jsx(AnimatePresence, { children: props.children }) }));
|
|
26
27
|
});
|
|
27
28
|
const Item = forwardRef(function VirtualItem({ item, context, ...props }, ref) {
|
|
28
29
|
return _jsx(motion.li, { ...props, ref: ref, className: "first:rounded-t-lg last:rounded-t-lg" });
|
|
29
30
|
});
|
|
30
31
|
const components = { List, Item };
|
|
31
|
-
const DEFAULT_SIZE = 320;
|
|
32
32
|
const MIN_SIZE = 40;
|
|
33
33
|
export const Autocomplete = forwardRef(({ left, error, right, loading, options, container, rightLabel, interactive, emptyMessage, optionalText, labelClassName, feedback = null, hideLeft = false, required = false, dynamicOption = false, ...props }, externalRef) => {
|
|
34
|
+
const scroller = useRef(null);
|
|
34
35
|
const fieldset = useRef(null);
|
|
35
36
|
const virtuoso = useRef(null);
|
|
36
37
|
const defaults = props.value ?? props.defaultValue ?? "";
|
|
37
38
|
const translation = useTranslations();
|
|
38
|
-
const [h, setH] = useState(() => Math.min(
|
|
39
|
+
const [h, setH] = useState(() => Math.min(320, MIN_SIZE * options.length));
|
|
39
40
|
const [open, setOpen] = useState(false);
|
|
40
41
|
const [shadow, setShadow] = useState("");
|
|
41
42
|
const [value, setValue] = useState(defaults);
|
|
@@ -53,6 +54,7 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
53
54
|
]
|
|
54
55
|
: options;
|
|
55
56
|
const list = new Fuzzy(innerOptions, ["value", "label"], fuzzyOptions).search(shadow);
|
|
57
|
+
const removeScrollRef = useRemoveScroll(open, "block-only");
|
|
56
58
|
const setClosed = () => {
|
|
57
59
|
setOpen(false);
|
|
58
60
|
setH(0);
|
|
@@ -61,35 +63,10 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
61
63
|
const pattern = dynamicOption
|
|
62
64
|
? undefined
|
|
63
65
|
: `^(${options.map((x) => `${safeRegex(x.value)}${x.label ? "|" + safeRegex(x.label) : ""}`).join("|")})$`;
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
if (props.value) {
|
|
66
|
-
const item = options.find((x) => x.value === props.value);
|
|
67
|
-
setValue(item?.label ?? props.value);
|
|
68
|
-
}
|
|
69
|
-
}, [props.value]);
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
if (!open)
|
|
72
|
-
setH(0);
|
|
73
|
-
}, [open]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (!open)
|
|
76
|
-
return;
|
|
77
|
-
const ul = refs.floating;
|
|
78
|
-
if (ul.current === null)
|
|
79
|
-
return;
|
|
80
|
-
let size = 0;
|
|
81
|
-
const items = Array.from(ul.current.querySelectorAll("li")).slice(0, Math.min(displayList.length, 10));
|
|
82
|
-
items.forEach((x) => {
|
|
83
|
-
const rect = x.getBoundingClientRect();
|
|
84
|
-
size += rect.height;
|
|
85
|
-
});
|
|
86
|
-
const s = Math.min(size, DEFAULT_SIZE);
|
|
87
|
-
setH(s);
|
|
88
|
-
}, [shadow, open]);
|
|
89
66
|
const { x, y, strategy, refs, context } = useFloating({
|
|
90
67
|
open,
|
|
91
68
|
transform: true,
|
|
92
|
-
|
|
69
|
+
placement: "bottom-start",
|
|
93
70
|
onOpenChange: setOpen,
|
|
94
71
|
whileElementsMounted: autoUpdate,
|
|
95
72
|
middleware: [
|
|
@@ -97,22 +74,14 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
97
74
|
size({
|
|
98
75
|
padding: 10,
|
|
99
76
|
elementContext: "reference",
|
|
100
|
-
apply(
|
|
101
|
-
const
|
|
102
|
-
const ul = a.elements.floating.querySelector("ul");
|
|
77
|
+
apply(args) {
|
|
78
|
+
const ul = args.elements.floating.querySelector("ul");
|
|
103
79
|
const fullSize = ul?.getBoundingClientRect().height || 0;
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return void setH(Math.min(currentH, DEFAULT_SIZE));
|
|
110
|
-
}, 50));
|
|
111
|
-
Object.assign(a.elements.floating.style, {
|
|
112
|
-
width: `${w}px`,
|
|
113
|
-
maxWidth: `${w}px`,
|
|
114
|
-
maxHeight: `${DEFAULT_SIZE}`,
|
|
115
|
-
});
|
|
80
|
+
const DEFAULT_SIZE = getRemainingSize(refs.reference.current, window.innerHeight);
|
|
81
|
+
const maxH = Math.min(fullSize < MIN_SIZE ? DEFAULT_SIZE : fullSize, DEFAULT_SIZE, args.availableHeight);
|
|
82
|
+
const size = displayList.length === 0 ? MIN_SIZE : Math.min(maxH, DEFAULT_SIZE, fullSize);
|
|
83
|
+
const mw = `${fieldset.current.getBoundingClientRect().width}px`;
|
|
84
|
+
Object.assign(args.elements.floating.style, { width: mw, maxWidth: mw, height: size });
|
|
116
85
|
},
|
|
117
86
|
}),
|
|
118
87
|
],
|
|
@@ -132,9 +101,23 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
132
101
|
focusItemOnOpen: "auto",
|
|
133
102
|
openOnArrowKeyDown: true,
|
|
134
103
|
scrollItemIntoView: true,
|
|
135
|
-
// onNavigate: (n) => setIndex((prev) => n ?? prev)
|
|
136
104
|
}),
|
|
137
105
|
]);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (props.value) {
|
|
108
|
+
const item = options.find((x) => x.value === props.value);
|
|
109
|
+
setValue(item?.label ?? props.value);
|
|
110
|
+
}
|
|
111
|
+
}, [props.value]);
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (!open)
|
|
114
|
+
return setH(0);
|
|
115
|
+
const inputRef = refs.reference;
|
|
116
|
+
if (inputRef.current === null)
|
|
117
|
+
return;
|
|
118
|
+
const s = getRemainingSize(inputRef.current, window.innerHeight);
|
|
119
|
+
setTimeout(() => setH(Math.min(s, displayList.length * MIN_SIZE)), 100);
|
|
120
|
+
}, [shadow, open, refs.reference]);
|
|
138
121
|
useEffect(() => {
|
|
139
122
|
const input = refs.reference.current;
|
|
140
123
|
if (!input)
|
|
@@ -226,15 +209,17 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
226
209
|
}
|
|
227
210
|
}
|
|
228
211
|
},
|
|
229
|
-
}), "data-value": value, "data-error": !!error, "data-name": id, "data-target": id, required: required, value: open ? shadow : label || value, "aria-autocomplete": "list", autoComplete: "off", className: css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "group-focus-within:border-primary group-hover:border-primary", props.className) }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || value || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingFocusManager, { guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs(motion.
|
|
230
|
-
ref: refs.setFloating,
|
|
231
|
-
style: {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
212
|
+
}), "data-value": value, "data-error": !!error, "data-name": id, "data-target": id, required: required, value: open ? shadow : label || value, "aria-autocomplete": "list", autoComplete: "off", className: css("input placeholder-input-mask group h-input-height w-full flex-1", "rounded-md bg-transparent px-input-x py-input-y text-foreground", "outline-none transition-colors focus:ring-2 focus:ring-inset focus:ring-primary", "group-error:text-danger group-error:placeholder-input-mask-error", "group-focus-within:border-primary group-hover:border-primary", props.className) }), _jsx("input", { id: id, name: id, type: "hidden", "data-origin": id, ref: externalRef, required: required, defaultValue: props.value || value || undefined }), _jsx(FloatingPortal, { preserveTabOrder: true, children: open ? (_jsx(FloatingFocusManager, { modal: true, guards: true, returnFocus: false, context: context, initialFocus: -1, visuallyHiddenDismiss: true, children: _jsxs(motion.div, { ...getFloatingProps({
|
|
213
|
+
ref: mergeRefs(removeScrollRef, refs.setFloating),
|
|
214
|
+
style: { ...transitions.styles, left: x, top: y ?? 0, position: strategy },
|
|
215
|
+
}), initial: false, "data-floating": "true", animate: { height: isEmpty ? "auto" : h }, className: "isolate z-floating m-0 max-h-80 origin-[top_center] list-none overscroll-contain rounded-b-lg rounded-t-lg border border-floating-border bg-floating-background p-0 text-foreground shadow-floating ease-in-out", onAnimationComplete: () => {
|
|
216
|
+
if (!open)
|
|
217
|
+
return setH(0);
|
|
218
|
+
const ul = refs.floating.current;
|
|
219
|
+
const li = ul.querySelectorAll("li").item(0);
|
|
220
|
+
const sum = (li ? li.getBoundingClientRect().height : MIN_SIZE) * displayList.length;
|
|
221
|
+
return flushSync(() => setH(sum + 2));
|
|
222
|
+
}, children: [isEmpty ? (_jsx("div", { role: "option", className: "w-full border-b border-tooltip-border last:border-transparent", children: _jsx("span", { className: "flex w-full justify-between p-2 text-left text-disabled", children: emptyMessage || translation.autocompleteEmpty }) })) : null, _jsx(Virtuoso, { overscan: 40, ref: virtuoso, hidden: isEmpty, data: displayList, style: { height: h }, defaultItemHeight: MIN_SIZE, components: components, scrollerRef: (e) => void (scroller.current = e), className: "max-h-80 overscroll-contain rounded-lg border-floating-border bg-floating-background p-0 text-foreground", itemContent: (i, option) => {
|
|
238
223
|
const Label = option.Render ?? Frag;
|
|
239
224
|
const active = value === option.value || value === option.label;
|
|
240
225
|
const selected = index === i;
|
|
@@ -248,7 +233,7 @@ export const Autocomplete = forwardRef(({ left, error, right, loading, options,
|
|
|
248
233
|
"aria-selected": active,
|
|
249
234
|
"aria-busy": option.disabled,
|
|
250
235
|
onClick: () => onSelect(option, i),
|
|
251
|
-
className: `cursor-pointer w-full p-2 text-left ${active ? "bg-primary-hover text-primary-foreground" : ""} ${selected ? "bg-floating-hover text-floating-foreground" : ""}`,
|
|
236
|
+
className: `cursor-pointer min-h-10 hover:bg-floating-hover w-full p-2 text-left ${active ? "bg-primary-hover text-primary-foreground" : ""} ${selected ? "bg-floating-hover text-floating-foreground" : ""}`,
|
|
252
237
|
}), children: _jsx(Label, { ...props, label: option.label, value: option.value, children: children }) }));
|
|
253
238
|
} })] }) })) : null })] }));
|
|
254
239
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA6F,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../../src/components/form/multi-select.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAQlH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CACnC,eAAe,CAAC,OAAO,CAAC,EACxB;IACI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACjD,CACJ,CAAC;AA4DF,eAAO,MAAM,WAAW,wGAsZvB,CAAC"}
|