tembro 2.0.5 → 2.0.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/components/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/data-table/data-table-pagination.js +4 -4
- package/dist/components/data-table/data-table.cjs +1 -1
- package/dist/components/data-table/data-table.d.ts +2 -2
- package/dist/components/data-table/data-table.js +2 -1
- package/dist/components/display/carousel.cjs +1 -1
- package/dist/components/display/carousel.d.ts +7 -1
- package/dist/components/display/carousel.js +44 -44
- package/dist/components/display/smart-card.d.ts +1 -1
- package/dist/components/display/status-legend.d.ts +1 -1
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.d.ts +3 -4
- package/dist/components/form/form-input.js +257 -257
- package/dist/components/form/form-select.cjs +1 -1
- package/dist/components/form/form-select.d.ts +2 -2
- package/dist/components/form/form-select.js +6 -6
- package/dist/components/inputs/async-select.d.ts +3 -0
- package/dist/components/inputs/search-input.d.ts +3 -0
- package/dist/components/inputs/simple-select.cjs +1 -1
- package/dist/components/inputs/simple-select.d.ts +10 -32
- package/dist/components/inputs/simple-select.js +5 -101
- package/dist/components/ui/card/index.cjs +1 -1
- package/dist/components/ui/card/index.d.ts +13 -2
- package/dist/components/ui/card/index.js +74 -49
- package/dist/components/ui/input/index.cjs +1 -1
- package/dist/components/ui/input/index.d.ts +8 -0
- package/dist/components/ui/input/index.js +63 -30
- package/dist/components/ui/select/index.cjs +1 -1
- package/dist/components/ui/select/index.d.ts +33 -1
- package/dist/components/ui/select/index.js +154 -48
- package/dist/showcase/create-demo.cjs +5 -4
- package/dist/showcase/create-demo.js +2 -2
- package/dist/showcase/premium/data-table/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table/showcase.js +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.js +3 -1
- package/dist/showcase/premium/select/mock.cjs +8 -9
- package/dist/showcase/premium/select/mock.js +1 -1
- package/dist/showcase/premium/select/showcase.cjs +1 -1
- package/dist/showcase/premium/select/showcase.js +76 -86
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +78 -74
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +91 -87
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +1 -1
- package/packages/cli/vendor/src/components/data-table/data-table-pagination.tsx +7 -7
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +21 -20
- package/packages/cli/vendor/src/components/display/carousel.tsx +18 -6
- package/packages/cli/vendor/src/components/display/smart-card.tsx +1 -1
- package/packages/cli/vendor/src/components/display/status-legend.tsx +1 -1
- package/packages/cli/vendor/src/components/form/form-input.tsx +9 -12
- package/packages/cli/vendor/src/components/form/form-select.tsx +4 -4
- package/packages/cli/vendor/src/components/inputs/async-select.tsx +11 -8
- package/packages/cli/vendor/src/components/inputs/search-input.tsx +5 -2
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +20 -190
- package/packages/cli/vendor/src/components/ui/card/index.tsx +95 -25
- package/packages/cli/vendor/src/components/ui/input/index.tsx +98 -0
- package/packages/cli/vendor/src/components/ui/select/index.tsx +227 -34
- package/packages/cli/vendor/src/showcase/create-demo.tsx +16 -15
- package/packages/cli/vendor/src/showcase/premium/data-table/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/data-table-parts/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/select/mock.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/select/showcase.tsx +13 -21
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +7 -8
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +5 -6
- package/packages/cli/vendor/src/showcase/tembro-registry.json +1 -1
- package/registry.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ui/select/index.cjs"),t=require("../inputs/async-select.cjs"),n=require("./form-field-shell.cjs");let r=require("react/jsx-runtime"),i=require("react-hook-form");function a(e){return{label:e.label,description:e.description,required:e.required,className:e.className,htmlFor:e.name,layout:e.layout,descriptionPosition:e.descriptionPosition,labelAction:e.labelAction,requiredIndicator:e.requiredIndicator,errorIcon:e.errorIcon,showErrorIcon:e.showErrorIcon,disabled:e.disabled,readOnly:e.readOnly,labelClassName:e.labelClassName,labelRowClassName:e.labelRowClassName,descriptionClassName:e.descriptionClassName,errorClassName:e.errorClassName,contentClassName:e.contentClassName}}function o(o){let s=a(o),c=o.kind??`simple`,l=o.fieldClassName??`w-full`;return(0,r.jsx)(i.Controller,{control:o.control,name:o.name,render:({field:i,fieldState:a})=>{let u=a.error?.message,d=n.resolveFormFieldIds(`${o.name}`,{description:o.description,error:u});if(c===`async`){let{control:e,name:a,label:c,description:f,required:p,className:m,layout:h,descriptionPosition:g,labelAction:_,requiredIndicator:v,errorIcon:y,showErrorIcon:b,disabled:x,readOnly:S,labelClassName:C,labelRowClassName:w,descriptionClassName:T,errorClassName:E,contentClassName:D,fieldClassName:O,emptyValue:k,kind:A,onValueChange:j,...M}=o;return(0,r.jsx)(n.FormFieldShell,{...s,labelId:d.labelId,descriptionId:d.descriptionId,errorId:d.errorId,error:u,children:(0,r.jsx)(t.AsyncSelect,{...M,value:i.value==null||i.value===``?void 0:String(i.value),disabled:x||S,"aria-describedby":d.describedBy,"aria-errormessage":u?d.errorId:void 0,onValueChange:(e,t)=>{i.onChange(e??k),j?.(e,t)},triggerClassName:O??l})})}let{control:f,name:p,label:m,description:h,required:g,className:_,layout:v,descriptionPosition:y,labelAction:b,requiredIndicator:x,errorIcon:S,showErrorIcon:C,disabled:w,readOnly:T,labelClassName:E,labelRowClassName:D,descriptionClassName:O,errorClassName:k,contentClassName:A,fieldClassName:j,emptyValue:M,kind:N,onValueChange:P,...F}=o;return(0,r.jsx)(n.FormFieldShell,{...s,labelId:d.labelId,descriptionId:d.descriptionId,errorId:d.errorId,error:u,children:(0,r.jsx)(e.Select,{...F,value:i.value==null?void 0:String(i.value),disabled:w||T,"aria-describedby":d.describedBy,"aria-errormessage":u?d.errorId:void 0,onValueChange:e=>{i.onChange(e||M),P?.(e)},triggerClassName:j??l})})}})}exports.FormSelect=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Control, type FieldPath, type FieldValues } from "react-hook-form";
|
|
2
2
|
import { type AsyncSelectOption, type AsyncSelectProps } from "@/components/inputs/async-select";
|
|
3
|
-
import { type
|
|
3
|
+
import { type SelectProps } from "@/components/ui/select";
|
|
4
4
|
import { type FormFieldShellControlProps } from "@/components/form/form-field-shell";
|
|
5
5
|
export type FormSelectKind = "simple" | "async";
|
|
6
6
|
type FormSelectBaseProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = FormFieldShellControlProps & {
|
|
@@ -8,7 +8,7 @@ type FormSelectBaseProps<TFieldValues extends FieldValues, TName extends FieldPa
|
|
|
8
8
|
name: TName;
|
|
9
9
|
fieldClassName?: string;
|
|
10
10
|
};
|
|
11
|
-
export type FormSimpleSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<
|
|
11
|
+
export type FormSimpleSelectProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<SelectProps, "children" | "value" | "onValueChange" | "disabled"> & FormSelectBaseProps<TFieldValues, TName> & {
|
|
12
12
|
kind?: "simple";
|
|
13
13
|
emptyValue?: unknown;
|
|
14
14
|
onValueChange?: (value: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Select as e } from "../ui/select/index.js";
|
|
2
|
+
import { AsyncSelect as t } from "../inputs/async-select.js";
|
|
3
3
|
import { FormFieldShell as n, resolveFormFieldIds as r } from "./form-field-shell.js";
|
|
4
4
|
import { jsx as i } from "react/jsx-runtime";
|
|
5
5
|
import { Controller as a } from "react-hook-form";
|
|
@@ -37,14 +37,14 @@ function s(s) {
|
|
|
37
37
|
error: d
|
|
38
38
|
});
|
|
39
39
|
if (l === "async") {
|
|
40
|
-
let { control:
|
|
40
|
+
let { control: e, name: r, label: o, description: l, required: p, className: m, layout: h, descriptionPosition: g, labelAction: _, requiredIndicator: v, errorIcon: y, showErrorIcon: b, disabled: x, readOnly: S, labelClassName: C, labelRowClassName: w, descriptionClassName: T, errorClassName: E, contentClassName: D, fieldClassName: O, emptyValue: k, kind: A, onValueChange: j, ...M } = s;
|
|
41
41
|
return /* @__PURE__ */ i(n, {
|
|
42
42
|
...c,
|
|
43
43
|
labelId: f.labelId,
|
|
44
44
|
descriptionId: f.descriptionId,
|
|
45
45
|
errorId: f.errorId,
|
|
46
46
|
error: d,
|
|
47
|
-
children: /* @__PURE__ */ i(
|
|
47
|
+
children: /* @__PURE__ */ i(t, {
|
|
48
48
|
...M,
|
|
49
49
|
value: a.value == null || a.value === "" ? void 0 : String(a.value),
|
|
50
50
|
disabled: x || S,
|
|
@@ -64,9 +64,9 @@ function s(s) {
|
|
|
64
64
|
descriptionId: f.descriptionId,
|
|
65
65
|
errorId: f.errorId,
|
|
66
66
|
error: d,
|
|
67
|
-
children: /* @__PURE__ */ i(
|
|
67
|
+
children: /* @__PURE__ */ i(e, {
|
|
68
68
|
...I,
|
|
69
|
-
value: a.value == null ?
|
|
69
|
+
value: a.value == null ? void 0 : String(a.value),
|
|
70
70
|
disabled: T || E,
|
|
71
71
|
"aria-describedby": f.describedBy,
|
|
72
72
|
"aria-errormessage": d ? f.errorId : void 0,
|
|
@@ -114,5 +114,8 @@ export type AsyncMultiSelectProps<TValue extends string = string, TData = unknow
|
|
|
114
114
|
invalid?: boolean;
|
|
115
115
|
};
|
|
116
116
|
declare function AsyncSelect<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>>(props: AsyncSelectProps<TValue, TData, TOption> | AsyncSelectMultiModeProps<TValue, TData, TOption>): React.JSX.Element;
|
|
117
|
+
/**
|
|
118
|
+
* @deprecated Prefer `AsyncSelect` with `isMulti` for new usage.
|
|
119
|
+
*/
|
|
117
120
|
declare function AsyncMultiSelect<TValue extends string = string, TData = unknown, TOption extends AsyncSelectOption<TValue, TData> = AsyncSelectOption<TValue, TData>>({ className, value, selectedOptions, onValueChange, loadOptions, loadSelectedOptions, defaultOptions, disabled, clearable, cacheOptions, cacheTtl, closeOnSelect, debounceMs, minSearchLength, maxSelected, maxVisibleTags, showSelectAll, labels, renderOption, renderValue, renderTag, renderLoading, renderEmpty, renderError, renderMinSearch, renderMaxSelected, onCreateOption, createOptionLabel, showCreateOption, showSelectedDescription, triggerClassName, contentClassName, searchClassName, optionClassName, tagClassName, invalid, ...props }: AsyncMultiSelectProps<TValue, TData, TOption>): React.JSX.Element;
|
|
118
121
|
export { AsyncSelect, AsyncMultiSelect };
|
|
@@ -11,5 +11,8 @@ export type SearchInputProps = Omit<ClearableInputProps, "leadingIcon" | "type"
|
|
|
11
11
|
onValueChange?: (value: string) => void;
|
|
12
12
|
onDebouncedValueChange?: (value: string) => void;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Prefer `Input` with `type="search"` and search-related props for new usage.
|
|
16
|
+
*/
|
|
14
17
|
declare const SearchInput: React.ForwardRefExoticComponent<Omit<SearchInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
15
18
|
export { SearchInput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../ui/select/index.cjs");let t=require("react/jsx-runtime");function n(n){return(0,t.jsx)(e.Select,{...n})}exports.SimpleSelect=n;
|
|
@@ -1,35 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
description?: React.ReactNode;
|
|
8
|
-
keywords?: string[];
|
|
9
|
-
};
|
|
10
|
-
export type SimpleSelectProps = Omit<React.ComponentProps<typeof Select>, "value" | "onValueChange"> & {
|
|
11
|
-
value?: string;
|
|
12
|
-
onValueChange?: (value: string | undefined) => void;
|
|
1
|
+
import { type SelectOption, type SelectProps } from "@/components/ui/select";
|
|
2
|
+
export type SimpleSelectOption = SelectOption;
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Prefer `Select` with `options` for new usage.
|
|
5
|
+
*/
|
|
6
|
+
export type SimpleSelectProps = Omit<SelectProps, "children"> & {
|
|
13
7
|
options: SimpleSelectOption[];
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
searchPlaceholder?: string;
|
|
16
|
-
emptyLabel?: React.ReactNode;
|
|
17
|
-
clearLabel?: string;
|
|
18
|
-
size?: "sm" | "default" | "lg";
|
|
19
|
-
clearable?: boolean;
|
|
20
|
-
searchable?: boolean;
|
|
21
|
-
loading?: boolean;
|
|
22
|
-
loadingLabel?: React.ReactNode;
|
|
23
|
-
disabled?: boolean;
|
|
24
|
-
showSelectedDescription?: boolean;
|
|
25
|
-
triggerClassName?: string;
|
|
26
|
-
contentClassName?: string;
|
|
27
|
-
itemClassName?: string;
|
|
28
|
-
searchClassName?: string;
|
|
29
|
-
renderOption?: (option: SimpleSelectOption, state: {
|
|
30
|
-
selected: boolean;
|
|
31
|
-
}) => React.ReactNode;
|
|
32
|
-
invalid?: boolean;
|
|
33
8
|
};
|
|
34
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Prefer `Select` with `options` for new usage.
|
|
11
|
+
*/
|
|
12
|
+
declare function SimpleSelect(props: SimpleSelectProps): import("react").JSX.Element;
|
|
35
13
|
export { SimpleSelect };
|
|
@@ -1,104 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import * as s from "react";
|
|
4
|
-
import { CheckIcon as c, LoaderCircleIcon as l, SearchIcon as u, XIcon as d } from "lucide-react";
|
|
5
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
1
|
+
import { Select as e } from "../ui/select/index.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
6
3
|
//#region src/components/inputs/simple-select.tsx
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
return n ? [
|
|
10
|
-
typeof e.label == "string" || typeof e.label == "number" ? String(e.label) : e.value,
|
|
11
|
-
e.value,
|
|
12
|
-
...e.keywords ?? []
|
|
13
|
-
].join(" ").toLowerCase().includes(n) : !0;
|
|
14
|
-
}
|
|
15
|
-
function h({ value: h, onValueChange: g, options: _, placeholder: v = "Select", searchPlaceholder: y = "Search options...", emptyLabel: b = "No options found", clearLabel: x = "Clear selection", size: S = "default", clearable: C = !1, searchable: w = !1, loading: T = !1, loadingLabel: E = "Loading options...", disabled: D = !1, showSelectedDescription: O = !0, triggerClassName: k, contentClassName: A, itemClassName: j, searchClassName: M, renderOption: N, invalid: P, onOpenChange: F, ...I }) {
|
|
16
|
-
let [L, R] = s.useState(""), z = _.find((e) => e.value === h), B = _.filter((e) => m(e, L));
|
|
17
|
-
return /* @__PURE__ */ p(n, {
|
|
18
|
-
value: h,
|
|
19
|
-
onValueChange: (e) => g?.(e),
|
|
20
|
-
disabled: D || T,
|
|
21
|
-
onOpenChange: (e, t) => {
|
|
22
|
-
e || R(""), F?.(e, t);
|
|
23
|
-
},
|
|
24
|
-
...I,
|
|
25
|
-
children: [/* @__PURE__ */ p(a, {
|
|
26
|
-
size: S,
|
|
27
|
-
"aria-invalid": P || void 0,
|
|
28
|
-
className: e("w-full", k),
|
|
29
|
-
children: [
|
|
30
|
-
/* @__PURE__ */ f(o, {
|
|
31
|
-
placeholder: v,
|
|
32
|
-
children: z ? /* @__PURE__ */ p("span", {
|
|
33
|
-
className: "flex min-w-0 flex-col items-start",
|
|
34
|
-
children: [/* @__PURE__ */ f("span", {
|
|
35
|
-
className: "truncate",
|
|
36
|
-
children: z.label
|
|
37
|
-
}), O && z.description ? /* @__PURE__ */ f("span", {
|
|
38
|
-
className: "truncate text-[11px] font-medium text-muted-foreground",
|
|
39
|
-
children: z.description
|
|
40
|
-
}) : null]
|
|
41
|
-
}) : null
|
|
42
|
-
}),
|
|
43
|
-
T ? /* @__PURE__ */ f(l, { className: "size-4 animate-spin text-muted-foreground" }) : null,
|
|
44
|
-
C && h && !D && !T ? /* @__PURE__ */ f("span", {
|
|
45
|
-
role: "button",
|
|
46
|
-
tabIndex: 0,
|
|
47
|
-
"aria-label": x,
|
|
48
|
-
className: "ml-1 rounded-[var(--radius-sm)] border border-border/65 p-1 text-muted-foreground transition-colors hover:border-border hover:bg-muted/55 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
49
|
-
onClick: (e) => {
|
|
50
|
-
e.preventDefault(), t(e), g?.(void 0);
|
|
51
|
-
},
|
|
52
|
-
onMouseDown: t,
|
|
53
|
-
onDoubleClick: t,
|
|
54
|
-
onKeyDown: (e) => {
|
|
55
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), g?.(void 0));
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ f(d, { className: "size-3.5" })
|
|
58
|
-
}) : null
|
|
59
|
-
]
|
|
60
|
-
}), /* @__PURE__ */ p(r, {
|
|
61
|
-
className: e("w-(--anchor-width)", A),
|
|
62
|
-
children: [w ? /* @__PURE__ */ p("div", {
|
|
63
|
-
"data-slot": "select-search",
|
|
64
|
-
className: "sticky top-0 z-10 mb-1 flex items-center gap-2 rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-popover px-2.5 py-2 text-sm",
|
|
65
|
-
children: [/* @__PURE__ */ f(u, { className: "size-4 text-muted-foreground" }), /* @__PURE__ */ f("input", {
|
|
66
|
-
value: L,
|
|
67
|
-
onChange: (e) => R(e.target.value),
|
|
68
|
-
placeholder: y,
|
|
69
|
-
className: e("min-w-0 flex-1 bg-transparent outline-none placeholder:text-muted-foreground", M)
|
|
70
|
-
})]
|
|
71
|
-
}) : null, T ? /* @__PURE__ */ p("div", {
|
|
72
|
-
"data-slot": "select-state",
|
|
73
|
-
className: "flex items-center gap-2 rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_55%)] px-3 py-2.5 text-sm text-muted-foreground",
|
|
74
|
-
children: [/* @__PURE__ */ f(l, { className: "size-4 animate-spin" }), E]
|
|
75
|
-
}) : B.length === 0 ? /* @__PURE__ */ f("div", {
|
|
76
|
-
"data-slot": "select-state",
|
|
77
|
-
className: "rounded-[var(--radius-md)] border border-[color:var(--aui-card-border,var(--border))] bg-[color:color-mix(in_oklch,var(--muted),transparent_55%)] px-3 py-2.5 text-sm text-muted-foreground",
|
|
78
|
-
children: b
|
|
79
|
-
}) : B.map((t) => {
|
|
80
|
-
let n = t.value === h;
|
|
81
|
-
return /* @__PURE__ */ f(i, {
|
|
82
|
-
value: t.value,
|
|
83
|
-
disabled: t.disabled,
|
|
84
|
-
className: e("rounded-[var(--radius-md)]", j),
|
|
85
|
-
children: N ? N(t, { selected: n }) : /* @__PURE__ */ p("span", {
|
|
86
|
-
className: "flex min-w-0 flex-1 flex-col",
|
|
87
|
-
children: [/* @__PURE__ */ p("span", {
|
|
88
|
-
className: "flex min-w-0 items-center gap-2",
|
|
89
|
-
children: [/* @__PURE__ */ f("span", {
|
|
90
|
-
className: "truncate",
|
|
91
|
-
children: t.label
|
|
92
|
-
}), n ? /* @__PURE__ */ f(c, { className: "ml-auto size-3.5 text-primary" }) : null]
|
|
93
|
-
}), t.description && /* @__PURE__ */ f("span", {
|
|
94
|
-
className: "truncate text-xs text-muted-foreground",
|
|
95
|
-
children: t.description
|
|
96
|
-
})]
|
|
97
|
-
})
|
|
98
|
-
}, t.value);
|
|
99
|
-
})]
|
|
100
|
-
})]
|
|
101
|
-
});
|
|
4
|
+
function n(n) {
|
|
5
|
+
return /* @__PURE__ */ t(e, { ...n });
|
|
102
6
|
}
|
|
103
7
|
//#endregion
|
|
104
|
-
export {
|
|
8
|
+
export { n as SimpleSelect };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("class-variance-authority"),i=require("react/jsx-runtime");var a=(0,r.cva)(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-[var(--aui-card-radius,var(--radius-xl))] border py-(--card-spacing) text-sm text-card-foreground transition-[background-color,border-color,box-shadow,transform,opacity] [--card-spacing:--spacing(5)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 *:[img:first-child]:rounded-t-[var(--aui-card-radius,var(--radius-xl))] *:[img:last-child]:rounded-b-[var(--aui-card-radius,var(--radius-xl))]`,{variants:{variant:{default:``,elevated:``,outline:``,soft:``,ghost:`border-transparent bg-transparent shadow-none ring-0`},size:{sm:`[--card-spacing:--spacing(4)] data-[has-footer=true]:pb-0`,default:`[--card-spacing:--spacing(5)]`,lg:`[--card-spacing:--spacing(6)]`},density:{compact:`text-xs`,default:`text-sm`,comfortable:`text-base`},tone:{neutral:``,info:``,success:``,warning:``,danger:``},interactive:{true:`cursor-pointer focus-visible:outline-none focus-visible:ring-0`,false:``},selected:{true:``,false:``},disabled:{true:`pointer-events-none opacity-55`,false:``}},defaultVariants:{variant:`default`,size:`default`,density:`default`,tone:`neutral`,interactive:!1,selected:!1,disabled:!1}});function o(e){return e.eyebrow!=null||e.title!=null||e.description!=null||e.badge!=null||e.action!=null||e.media!=null||e.content!=null||e.footer!=null}function s({className:e,variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_,tabIndex:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("class-variance-authority"),i=require("react/jsx-runtime");var a=(0,r.cva)(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-[var(--aui-card-radius,var(--radius-xl))] border py-(--card-spacing) text-sm text-card-foreground transition-[background-color,border-color,box-shadow,transform,opacity] [--card-spacing:--spacing(5)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 *:[img:first-child]:rounded-t-[var(--aui-card-radius,var(--radius-xl))] *:[img:last-child]:rounded-b-[var(--aui-card-radius,var(--radius-xl))]`,{variants:{variant:{default:``,elevated:``,outline:``,soft:``,ghost:`border-transparent bg-transparent shadow-none ring-0`},size:{sm:`[--card-spacing:--spacing(4)] data-[has-footer=true]:pb-0`,default:`[--card-spacing:--spacing(5)]`,lg:`[--card-spacing:--spacing(6)]`},density:{compact:`text-xs`,default:`text-sm`,comfortable:`text-base`},tone:{neutral:``,info:``,success:``,warning:``,danger:``},interactive:{true:`cursor-pointer focus-visible:outline-none focus-visible:ring-0`,false:``},selected:{true:``,false:``},disabled:{true:`pointer-events-none opacity-55`,false:``}},defaultVariants:{variant:`default`,size:`default`,density:`default`,tone:`neutral`,interactive:!1,selected:!1,disabled:!1}});function o(e){return e.eyebrow!=null||e.title!=null||e.description!=null||e.badge!=null||e.action!=null||e.media!=null||e.content!=null||e.footer!=null}function s({className:e,variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_,orientation:v=`vertical`,mediaPosition:y=`start`,mediaAspect:b=`auto`,padding:x=`default`,tabIndex:S,eyebrow:C,title:w,description:T,badge:E,action:D,media:O,content:k,footer:A,mediaClassName:j,bodyClassName:M,headerClassName:N,eyebrowClassName:P,titleClassName:F,descriptionClassName:I,contentClassName:L,footerClassName:R,children:z,...B}){let V=o({eyebrow:C,title:w,description:T,badge:E,action:D,media:O,content:k,footer:A}),H=k??z,U=C!=null||w!=null||T!=null||E!=null||D!=null,W=A!=null,G=O?(0,i.jsx)(`div`,{"data-slot":`card-media`,"data-media-position":y,"data-media-aspect":b,className:t.cn(`overflow-hidden`,v===`horizontal`?`shrink-0 self-stretch`:``,b===`square`&&(v===`horizontal`?`w-40`:`aspect-square`),b===`video`&&(v===`horizontal`?`w-56`:`aspect-video`),b===`poster`&&(v===`horizontal`?`w-36`:`aspect-[3/4]`),b===`wide`&&(v===`horizontal`?`w-72`:`aspect-[16/7]`),j),children:O}):null,K={none:``,sm:`px-4`,default:`px-(--card-spacing)`,lg:`px-6`},q={none:``,sm:`pb-4`,default:``,lg:`pb-6`};return(0,i.jsx)(`div`,{"data-slot":`card`,"data-surface":V||void 0,"data-size":r??`default`,"data-variant":n??`default`,"data-tone":m??`neutral`,"data-density":s??`default`,"data-interactive":h||void 0,"data-selected":g||void 0,"data-disabled":_||void 0,"data-has-footer":W||void 0,"data-orientation":v,"data-padding":x,"aria-disabled":_||void 0,tabIndex:h&&!_?S??0:S,className:t.cn(a({variant:n,size:r,density:s,tone:m,interactive:h,selected:g,disabled:_}),v===`horizontal`&&`flex-row py-0`,h&&`hover:border-[color:var(--aui-control-hover-border,var(--ring))] hover:shadow-[var(--aui-card-shadow-hover,var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08)))]`,g&&`border-[color:var(--aui-control-border-strong,var(--ring))] shadow-[var(--aui-card-shadow-hover,var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08)))]`,e),...B,children:V?(0,i.jsxs)(i.Fragment,{children:[y===`start`?G:null,(0,i.jsxs)(`div`,{"data-slot":`card-body`,className:t.cn(`flex min-w-0 flex-1 flex-col`,v===`horizontal`?`py-(--card-spacing)`:``,q[x],M),children:[U?(0,i.jsxs)(c,{className:t.cn(K[x],N),children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[C==null?null:(0,i.jsx)(`div`,{className:t.cn(`text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/80`,P),children:C}),w==null?null:(0,i.jsx)(l,{className:F,children:w}),T==null?null:(0,i.jsx)(u,{className:I,children:T})]}),E!=null||D!=null?(0,i.jsxs)(d,{className:`flex items-center gap-2`,children:[E,D]}):null]}):null,H==null?null:(0,i.jsx)(f,{className:t.cn(K[x],L),children:H}),W?(0,i.jsx)(p,{className:t.cn(K[x],R),children:A}):null]}),y===`end`?G:null]}):z})}function c({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-header`,className:t.cn(`group/card-header @container/card-header grid auto-rows-min items-start gap-1.5 rounded-t-[var(--aui-card-radius,var(--radius-xl))] px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...n})}function l({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-title`,className:t.cn(`font-heading text-[1.05rem] leading-snug font-semibold tracking-tight group-data-[size=sm]/card:text-sm group-data-[size=lg]/card:text-xl`,e),...n})}function u({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-description`,className:t.cn(`text-sm leading-6 text-muted-foreground`,e),...n})}function d({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-action`,className:t.cn(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,e),...n})}function f({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-content`,className:t.cn(`px-(--card-spacing)`,e),...n})}function p({className:e,...n}){return(0,i.jsx)(`div`,{"data-slot":`card-footer`,className:t.cn(`flex items-center rounded-b-[var(--aui-card-radius,var(--radius-xl))] border-t border-border/60 bg-muted/22 p-(--card-spacing)`,e),...n})}exports.Card=s,exports.CardAction=d,exports.CardContent=f,exports.CardDescription=u,exports.CardFooter=p,exports.CardHeader=c,exports.CardTitle=l,exports.cardVariants=a;
|
|
@@ -18,14 +18,25 @@ type CardSurfaceSlots = {
|
|
|
18
18
|
media?: React.ReactNode;
|
|
19
19
|
content?: React.ReactNode;
|
|
20
20
|
footer?: React.ReactNode;
|
|
21
|
+
mediaClassName?: string;
|
|
22
|
+
bodyClassName?: string;
|
|
21
23
|
headerClassName?: string;
|
|
24
|
+
eyebrowClassName?: string;
|
|
22
25
|
titleClassName?: string;
|
|
23
26
|
descriptionClassName?: string;
|
|
24
27
|
contentClassName?: string;
|
|
25
28
|
footerClassName?: string;
|
|
26
29
|
};
|
|
27
|
-
export type
|
|
28
|
-
|
|
30
|
+
export type CardOrientation = "vertical" | "horizontal";
|
|
31
|
+
export type CardMediaAspect = "auto" | "square" | "video" | "poster" | "wide";
|
|
32
|
+
export type CardPadding = "none" | "sm" | "default" | "lg";
|
|
33
|
+
export type CardProps = Omit<React.ComponentProps<"div">, keyof CardSurfaceSlots> & VariantProps<typeof cardVariants> & CardSurfaceSlots & {
|
|
34
|
+
orientation?: CardOrientation;
|
|
35
|
+
mediaPosition?: "start" | "end";
|
|
36
|
+
mediaAspect?: CardMediaAspect;
|
|
37
|
+
padding?: CardPadding;
|
|
38
|
+
};
|
|
39
|
+
declare function Card({ className, variant, size, density, tone, interactive, selected, disabled, orientation, mediaPosition, mediaAspect, padding, tabIndex, eyebrow, title, description, badge, action, media, content, footer, mediaClassName, bodyClassName, headerClassName, eyebrowClassName, titleClassName, descriptionClassName, contentClassName, footerClassName, children, ...props }: CardProps): React.JSX.Element;
|
|
29
40
|
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
30
41
|
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
31
42
|
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -55,20 +55,36 @@ var a = t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded
|
|
|
55
55
|
function o(e) {
|
|
56
56
|
return e.eyebrow != null || e.title != null || e.description != null || e.badge != null || e.action != null || e.media != null || e.content != null || e.footer != null;
|
|
57
57
|
}
|
|
58
|
-
function s({ className: t, variant: s, size: m, density: h, tone: g, interactive: _, selected: v, disabled: y,
|
|
59
|
-
let
|
|
60
|
-
eyebrow:
|
|
61
|
-
title:
|
|
62
|
-
description:
|
|
63
|
-
badge:
|
|
64
|
-
action:
|
|
65
|
-
media:
|
|
66
|
-
content:
|
|
67
|
-
footer:
|
|
68
|
-
}),
|
|
58
|
+
function s({ className: t, variant: s, size: m, density: h, tone: g, interactive: _, selected: v, disabled: y, orientation: b = "vertical", mediaPosition: x = "start", mediaAspect: S = "auto", padding: C = "default", tabIndex: w, eyebrow: T, title: E, description: D, badge: O, action: k, media: A, content: j, footer: M, mediaClassName: N, bodyClassName: P, headerClassName: F, eyebrowClassName: I, titleClassName: L, descriptionClassName: R, contentClassName: z, footerClassName: B, children: V, ...H }) {
|
|
59
|
+
let U = o({
|
|
60
|
+
eyebrow: T,
|
|
61
|
+
title: E,
|
|
62
|
+
description: D,
|
|
63
|
+
badge: O,
|
|
64
|
+
action: k,
|
|
65
|
+
media: A,
|
|
66
|
+
content: j,
|
|
67
|
+
footer: M
|
|
68
|
+
}), W = j ?? V, G = T != null || E != null || D != null || O != null || k != null, K = M != null, q = A ? /* @__PURE__ */ r("div", {
|
|
69
|
+
"data-slot": "card-media",
|
|
70
|
+
"data-media-position": x,
|
|
71
|
+
"data-media-aspect": S,
|
|
72
|
+
className: e("overflow-hidden", b === "horizontal" ? "shrink-0 self-stretch" : "", S === "square" && (b === "horizontal" ? "w-40" : "aspect-square"), S === "video" && (b === "horizontal" ? "w-56" : "aspect-video"), S === "poster" && (b === "horizontal" ? "w-36" : "aspect-[3/4]"), S === "wide" && (b === "horizontal" ? "w-72" : "aspect-[16/7]"), N),
|
|
73
|
+
children: A
|
|
74
|
+
}) : null, J = {
|
|
75
|
+
none: "",
|
|
76
|
+
sm: "px-4",
|
|
77
|
+
default: "px-(--card-spacing)",
|
|
78
|
+
lg: "px-6"
|
|
79
|
+
}, Y = {
|
|
80
|
+
none: "",
|
|
81
|
+
sm: "pb-4",
|
|
82
|
+
default: "",
|
|
83
|
+
lg: "pb-6"
|
|
84
|
+
};
|
|
69
85
|
return /* @__PURE__ */ r("div", {
|
|
70
86
|
"data-slot": "card",
|
|
71
|
-
"data-surface":
|
|
87
|
+
"data-surface": U || void 0,
|
|
72
88
|
"data-size": m ?? "default",
|
|
73
89
|
"data-variant": s ?? "default",
|
|
74
90
|
"data-tone": g ?? "neutral",
|
|
@@ -76,9 +92,11 @@ function s({ className: t, variant: s, size: m, density: h, tone: g, interactive
|
|
|
76
92
|
"data-interactive": _ || void 0,
|
|
77
93
|
"data-selected": v || void 0,
|
|
78
94
|
"data-disabled": y || void 0,
|
|
79
|
-
"data-has-footer":
|
|
95
|
+
"data-has-footer": K || void 0,
|
|
96
|
+
"data-orientation": b,
|
|
97
|
+
"data-padding": C,
|
|
80
98
|
"aria-disabled": y || void 0,
|
|
81
|
-
tabIndex: _ && !y ?
|
|
99
|
+
tabIndex: _ && !y ? w ?? 0 : w,
|
|
82
100
|
className: e(a({
|
|
83
101
|
variant: s,
|
|
84
102
|
size: m,
|
|
@@ -87,42 +105,49 @@ function s({ className: t, variant: s, size: m, density: h, tone: g, interactive
|
|
|
87
105
|
interactive: _,
|
|
88
106
|
selected: v,
|
|
89
107
|
disabled: y
|
|
90
|
-
}), t),
|
|
91
|
-
...
|
|
92
|
-
children:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
108
|
+
}), b === "horizontal" && "flex-row py-0", _ && "hover:border-[color:var(--aui-control-hover-border,var(--ring))] hover:shadow-[var(--aui-card-shadow-hover,var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08)))]", v && "border-[color:var(--aui-control-border-strong,var(--ring))] shadow-[var(--aui-card-shadow-hover,var(--aui-card-shadow,0_12px_32px_rgba(15,23,42,0.08)))]", t),
|
|
109
|
+
...H,
|
|
110
|
+
children: U ? /* @__PURE__ */ i(n, { children: [
|
|
111
|
+
x === "start" ? q : null,
|
|
112
|
+
/* @__PURE__ */ i("div", {
|
|
113
|
+
"data-slot": "card-body",
|
|
114
|
+
className: e("flex min-w-0 flex-1 flex-col", b === "horizontal" ? "py-(--card-spacing)" : "", Y[C], P),
|
|
115
|
+
children: [
|
|
116
|
+
G ? /* @__PURE__ */ i(c, {
|
|
117
|
+
className: e(J[C], F),
|
|
118
|
+
children: [/* @__PURE__ */ i("div", {
|
|
119
|
+
className: "min-w-0 space-y-1",
|
|
120
|
+
children: [
|
|
121
|
+
T == null ? null : /* @__PURE__ */ r("div", {
|
|
122
|
+
className: e("text-[11px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/80", I),
|
|
123
|
+
children: T
|
|
124
|
+
}),
|
|
125
|
+
E == null ? null : /* @__PURE__ */ r(l, {
|
|
126
|
+
className: L,
|
|
127
|
+
children: E
|
|
128
|
+
}),
|
|
129
|
+
D == null ? null : /* @__PURE__ */ r(u, {
|
|
130
|
+
className: R,
|
|
131
|
+
children: D
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
}), O != null || k != null ? /* @__PURE__ */ i(d, {
|
|
135
|
+
className: "flex items-center gap-2",
|
|
136
|
+
children: [O, k]
|
|
137
|
+
}) : null]
|
|
138
|
+
}) : null,
|
|
139
|
+
W == null ? null : /* @__PURE__ */ r(f, {
|
|
140
|
+
className: e(J[C], z),
|
|
141
|
+
children: W
|
|
142
|
+
}),
|
|
143
|
+
K ? /* @__PURE__ */ r(p, {
|
|
144
|
+
className: e(J[C], B),
|
|
145
|
+
children: M
|
|
146
|
+
}) : null
|
|
147
|
+
]
|
|
120
148
|
}),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
children: O
|
|
124
|
-
}) : null
|
|
125
|
-
] }) : P
|
|
149
|
+
x === "end" ? q : null
|
|
150
|
+
] }) : V
|
|
126
151
|
});
|
|
127
152
|
}
|
|
128
153
|
function c({ className: t, ...n }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./primitive.cjs"),r=require("./group.cjs"),i=require("../../inputs/input-decorator.cjs"),a=require("../../inputs/clearable-input.cjs"),o=require("../../inputs/date-input.cjs"),s=require("../../inputs/date-range-input.cjs"),c=require("../../inputs/money-input.cjs"),l=require("../../inputs/masked-input.cjs"),u=require("../../inputs/number-input.cjs"),d=require("../../inputs/password-input.cjs"),f=require("../../inputs/phone-input.cjs"),p=require("../../inputs/quantity-input.cjs"),m=require("../../inputs/search-input.cjs");let h=require("react");h=e.__toESM(h,1);let g=require("react/jsx-runtime");function _(e){return typeof e==`string`?e.length:typeof e==`number`?String(e).length:Array.isArray(e)?e.join(``).length:0}var
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../lib/utils.cjs"),n=require("./primitive.cjs"),r=require("./group.cjs"),i=require("../../inputs/input-decorator.cjs"),a=require("../../inputs/clearable-input.cjs"),o=require("../../inputs/date-input.cjs"),s=require("../../inputs/date-range-input.cjs"),c=require("../../inputs/money-input.cjs"),l=require("../../inputs/masked-input.cjs"),u=require("../../inputs/number-input.cjs"),d=require("../../inputs/password-input.cjs"),f=require("../../inputs/phone-input.cjs"),p=require("../../inputs/quantity-input.cjs"),m=require("../../inputs/search-input.cjs");let h=require("react");h=e.__toESM(h,1);let g=require("react/jsx-runtime");function _(e){return typeof e==`string`?e.length:typeof e==`number`?String(e).length:Array.isArray(e)?e.join(``).length:0}function v(e){return e.type===`search`||e.searchIcon!==void 0||e.loading!==void 0||e.loadingLabel!==void 0||e.resultCount!==void 0||e.shortcut!==void 0||e.debounceMs!==void 0||e.showMetaOnClear!==void 0||e.onDebouncedValueChange!==void 0}var y=h.forwardRef((e,r)=>{let y=e.kind??`text`;if(y===`search`)return(0,g.jsx)(m.SearchInput,{ref:r,...e});if(y===`password`)return(0,g.jsx)(d.PasswordInput,{ref:r,...e});if(y===`number`)return(0,g.jsx)(u.NumberInput,{ref:r,...e});if(y===`phone`)return(0,g.jsx)(f.PhoneInput,{ref:r,...e});if(y===`money`)return(0,g.jsx)(c.MoneyInput,{ref:r,...e});if(y===`quantity`)return(0,g.jsx)(p.QuantityInput,{ref:r,...e});if(y===`masked`)return(0,g.jsx)(l.MaskedInput,{ref:r,...e});if(y===`date`)return(0,g.jsx)(o.DateInput,{ref:r,...e});if(y===`date-range`)return(0,g.jsx)(s.DateRangeInput,{...e});if(y===`clearable`)return(0,g.jsx)(a.ClearableInput,{ref:r,...e});let b=e;if(v(b)){let{leading:e,searchIcon:n,helperText:i,errorText:a,showCharacterCount:o,countFormatter:s,helperClassName:c,inputClassName:l,...u}=b,d=Array.isArray(b.value)?b.value.join(` `):b.value==null||typeof b.value==`string`||typeof b.value==`number`?b.value:String(b.value),f=Array.isArray(b.defaultValue)?b.defaultValue.join(` `):b.defaultValue==null||typeof b.defaultValue==`string`||typeof b.defaultValue==`number`?b.defaultValue:String(b.defaultValue),p=(0,g.jsx)(m.SearchInput,{ref:r,searchIcon:n??e,inputClassName:l,...u,value:d,defaultValue:f});if(!i&&!a&&!o)return p;let h=_(b.value??b.defaultValue);return(0,g.jsxs)(`div`,{"data-slot":`input-field`,className:`grid gap-1.5`,children:[p,(0,g.jsxs)(`div`,{"data-slot":`input-meta`,className:`flex items-start justify-between gap-3 px-1`,children:[(0,g.jsx)(`div`,{"data-slot":`input-helper`,className:t.cn(`min-w-0 text-xs leading-5`,a?`text-destructive`:`text-muted-foreground`,c),children:a??i}),o?(0,g.jsx)(`div`,{"data-slot":`input-count`,className:t.cn(`shrink-0 text-[11px] font-medium tabular-nums`,a?`text-destructive`:`text-muted-foreground`),children:s?.(h,b.maxLength)??(typeof b.maxLength==`number`?`${h}/${b.maxLength}`:h)}):null]})]})}let{value:x,defaultValue:S,leading:C,trailing:w,trailingAction:T,clearable:E=!1,onValueChange:D,onClear:O,clearLabel:k,clearOnEscape:A,focusAfterClear:j,replaceTrailingWhenClear:M,helperText:N,errorText:P,showCharacterCount:F=!1,countFormatter:I,wrapperClassName:L,inputClassName:R,helperClassName:z,leadingPointerEvents:ee=!1,trailingPointerEvents:B=!0,onChange:V,maxLength:H,className:U,...W}=b,G=x!==void 0,[K,q]=h.useState(()=>_(S)),J=G?_(x):K,Y=P??N,X=P?`text-destructive`:`text-muted-foreground`,Z=e=>{G||q(e.target.value.length),V?.(e)},Q=e=>{Z(e),D?.(e.target.value)},$=E?(0,g.jsx)(a.ClearableInput,{ref:r,value:x,defaultValue:x===void 0?S:void 0,type:W.type??`text`,leadingIcon:C,trailing:w,trailingAction:T,clearable:E,onChange:Z,onValueChange:D,onClear:O,clearLabel:k,clearOnEscape:A,focusAfterClear:j,replaceTrailingWhenClear:M,wrapperClassName:L,inputClassName:R,className:U,maxLength:H,...W}):C||w||T?(0,g.jsx)(i.InputDecorator,{ref:r,value:x??void 0,defaultValue:x===void 0?S:void 0,type:W.type??`text`,leading:C,trailing:w,trailingAction:T,leadingPointerEvents:ee,trailingPointerEvents:B,wrapperClassName:L,inputClassName:R,className:U,onChange:Q,maxLength:H,...W}):(0,g.jsx)(n.InputPrimitive,{ref:r,value:x??void 0,defaultValue:x===void 0?S:void 0,type:W.type??`text`,className:t.cn(R,U),onChange:Q,maxLength:H,...W});return!Y&&!F?$:(0,g.jsxs)(`div`,{"data-slot":`input-field`,className:`grid gap-1.5`,children:[$,(0,g.jsxs)(`div`,{"data-slot":`input-meta`,className:`flex items-start justify-between gap-3 px-1`,children:[(0,g.jsx)(`div`,{"data-slot":`input-helper`,className:t.cn(`min-w-0 text-xs leading-5`,X,z),children:Y}),F?(0,g.jsx)(`div`,{"data-slot":`input-count`,className:t.cn(`shrink-0 text-[11px] font-medium tabular-nums`,P?`text-destructive`:`text-muted-foreground`),children:I?.(J,H)??(typeof H==`number`?`${J}/${H}`:J)}):null]})]})});y.displayName=`Input`,exports.Input=y,exports.InputGroup=r.InputGroup,exports.InputGroupAddon=r.InputGroupAddon,exports.InputGroupButton=r.InputGroupButton,exports.InputGroupInput=r.InputGroupInput,exports.InputGroupText=r.InputGroupText,exports.InputGroupTextarea=r.InputGroupTextarea;
|
|
@@ -16,6 +16,7 @@ export type InputTextProps = Omit<InputPrimitiveProps, "value"> & {
|
|
|
16
16
|
kind?: "text";
|
|
17
17
|
value?: string | number | readonly string[] | null;
|
|
18
18
|
onValueChange?: (value: string) => void;
|
|
19
|
+
onDebouncedValueChange?: (value: string) => void;
|
|
19
20
|
leading?: React.ReactNode;
|
|
20
21
|
trailing?: React.ReactNode;
|
|
21
22
|
trailingAction?: React.ReactNode;
|
|
@@ -34,6 +35,13 @@ export type InputTextProps = Omit<InputPrimitiveProps, "value"> & {
|
|
|
34
35
|
helperClassName?: string;
|
|
35
36
|
leadingPointerEvents?: boolean;
|
|
36
37
|
trailingPointerEvents?: boolean;
|
|
38
|
+
searchIcon?: React.ReactNode;
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
loadingLabel?: string;
|
|
41
|
+
resultCount?: number;
|
|
42
|
+
shortcut?: React.ReactNode;
|
|
43
|
+
debounceMs?: number;
|
|
44
|
+
showMetaOnClear?: boolean;
|
|
37
45
|
};
|
|
38
46
|
export type InputClearableProps = Omit<ClearableInputProps, "kind"> & {
|
|
39
47
|
kind: "clearable";
|