@brightlocal/ui-components 0.1.4 → 0.2.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/README.md +2 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +19 -19
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +75 -59
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +241 -191
- package/dist/index.cjs +1 -1
- package/dist/index.js +354 -344
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +5 -0
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +47 -39
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +6 -0
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +79 -76
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +4 -0
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +32 -31
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +4 -0
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +26 -24
- package/dist/logo.cjs +1 -1
- package/dist/logo.js +13 -13
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.d.ts +4 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/radio-group.js +49 -47
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +3 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +57 -56
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +4 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +19 -18
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.d.ts.map +1 -1
- package/dist/toggle.js +17 -17
- package/package.json +1 -1
- package/src/components/checkbox.tsx +4 -5
- package/src/components/combobox.tsx +482 -294
- package/src/components/input-group.tsx +14 -2
- package/src/components/input-otp.tsx +16 -1
- package/src/components/input-password.tsx +6 -1
- package/src/components/input.tsx +11 -3
- package/src/components/logo.tsx +1 -1
- package/src/components/radio-group.tsx +11 -0
- package/src/components/select.tsx +7 -2
- package/src/components/textarea.tsx +12 -5
- package/src/components/toggle.tsx +13 -15
package/README.md
CHANGED
|
@@ -277,10 +277,11 @@ When using these components:
|
|
|
277
277
|
<Field>
|
|
278
278
|
<Label htmlFor="email">Email Address</Label>
|
|
279
279
|
<Input
|
|
280
|
+
dataHook="email-input"
|
|
280
281
|
id="email"
|
|
281
282
|
type="email"
|
|
282
283
|
aria-describedby="email-error"
|
|
283
|
-
|
|
284
|
+
error={hasError}
|
|
284
285
|
/>
|
|
285
286
|
{hasError && (
|
|
286
287
|
<span id="email-error" role="alert">
|
package/dist/checkbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),g=require("react"),m=require("@radix-ui/react-checkbox"),x=require("@brightlocal/icons"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=s(g),i=s(m),y=p.cva(["size-4 shrink-0 self-start","bg-background peer border border-ring dark:bg-input/30 rounded-xs transition-colors outline-none","data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary","focus-visible:border-ring focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50"],{variants:{error:{true:["border-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),g=require("react"),m=require("@radix-ui/react-checkbox"),x=require("@brightlocal/icons"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=s(g),i=s(m),y=p.cva(["size-4 shrink-0 self-start","bg-background peer border border-ring dark:bg-input/30 rounded-xs transition-colors outline-none","data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary","focus-visible:border-ring focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50"],{variants:{error:{true:["border-red-600/40 dark:border-red-400/60","focus-visible:border-destructive focus-visible:shadow-destructive"]}},defaultVariants:{error:!1}}),n=o.forwardRef(({className:e,disabled:r=!1,error:t,dataHook:a,trackingEl:d,trackingLabel:l,id:u,...b},f)=>{const k=o.useId(),h=u||k;return c.jsx(i.Root,{ref:f,"aria-invalid":t?"true":void 0,className:v.cn(y({error:t}),e),"data-hook":a,"data-slot":"checkbox","data-tracking-el":d,"data-tracking-label":l,disabled:r,id:h,...b,children:c.jsx(i.Indicator,{className:"flex items-center justify-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(x.CheckIcon,{className:"size-3.5"})})})});n.displayName="Checkbox";exports.Checkbox=n;
|
package/dist/checkbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,gBAAgB;;8EA4BrB,CAAC;AAEF,MAAM,WAAW,aACf,SACA,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,EACrE,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACrC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,QAAQ,sGAuCb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/checkbox.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { CheckIcon as
|
|
5
|
-
import { cva as
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-checkbox";
|
|
4
|
+
import { CheckIcon as k } from "@brightlocal/icons";
|
|
5
|
+
import { cva as u } from "class-variance-authority";
|
|
6
6
|
import { cn as h } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
const p =
|
|
7
|
+
const p = u(
|
|
8
8
|
[
|
|
9
9
|
// Layout & Size
|
|
10
10
|
"size-4 shrink-0 self-start",
|
|
@@ -21,8 +21,8 @@ const p = k(
|
|
|
21
21
|
variants: {
|
|
22
22
|
error: {
|
|
23
23
|
true: [
|
|
24
|
-
// Error state - red border with 40% opacity
|
|
25
|
-
"border-
|
|
24
|
+
// Error state - red-600 border with 40% opacity (light) / red-400 with 60% opacity (dark)
|
|
25
|
+
"border-red-600/40 dark:border-red-400/60",
|
|
26
26
|
// Error focus state - solid red border with destructive shadow
|
|
27
27
|
"focus-visible:border-destructive focus-visible:shadow-destructive"
|
|
28
28
|
]
|
|
@@ -32,44 +32,44 @@ const p = k(
|
|
|
32
32
|
error: !1
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
),
|
|
35
|
+
), x = a.forwardRef(
|
|
36
36
|
({
|
|
37
37
|
className: o,
|
|
38
38
|
disabled: i = !1,
|
|
39
39
|
error: r,
|
|
40
|
-
dataHook:
|
|
41
|
-
trackingEl:
|
|
40
|
+
dataHook: d,
|
|
41
|
+
trackingEl: s,
|
|
42
42
|
trackingLabel: c,
|
|
43
43
|
id: n,
|
|
44
44
|
...l
|
|
45
45
|
}, b) => {
|
|
46
|
-
const m =
|
|
46
|
+
const m = a.useId(), f = n || m;
|
|
47
47
|
return /* @__PURE__ */ e(
|
|
48
|
-
|
|
48
|
+
t.Root,
|
|
49
49
|
{
|
|
50
50
|
ref: b,
|
|
51
51
|
"aria-invalid": r ? "true" : void 0,
|
|
52
52
|
className: h(p({ error: r }), o),
|
|
53
|
-
"data-hook":
|
|
53
|
+
"data-hook": d,
|
|
54
54
|
"data-slot": "checkbox",
|
|
55
|
-
"data-tracking-el":
|
|
55
|
+
"data-tracking-el": s,
|
|
56
56
|
"data-tracking-label": c,
|
|
57
57
|
disabled: i,
|
|
58
|
-
id:
|
|
58
|
+
id: f,
|
|
59
59
|
...l,
|
|
60
60
|
children: /* @__PURE__ */ e(
|
|
61
|
-
|
|
61
|
+
t.Indicator,
|
|
62
62
|
{
|
|
63
63
|
className: "flex items-center justify-center text-current transition-none",
|
|
64
64
|
"data-slot": "checkbox-indicator",
|
|
65
|
-
children: /* @__PURE__ */ e(
|
|
65
|
+
children: /* @__PURE__ */ e(k, { className: "size-3.5" })
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
|
|
72
|
+
x.displayName = "Checkbox";
|
|
73
73
|
export {
|
|
74
|
-
|
|
74
|
+
x as Checkbox
|
|
75
75
|
};
|
package/dist/combobox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),U=require("react"),I=require("@brightlocal/icons"),V=require("class-variance-authority"),w=require("@brightlocal/ui-components/lib/utils"),S=require("@brightlocal/ui-components/popover"),l=require("@brightlocal/ui-components/command");function $(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const a in o)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(e,a,t.get?t:{enumerable:!0,get:()=>o[a]})}}return e.default=o,Object.freeze(e)}const n=$(U),E=n.createContext(null);function y(){const o=n.useContext(E);if(!o)throw new Error("Combobox components must be used within a <Combobox>");return o}function F({value:o,onValueChange:e,open:a,onOpenChange:t,shouldFilter:s=!0,disabled:c=!1,children:i}){const[f,d]=n.useState(""),[m,g]=n.useState(!1),[x,u]=n.useState(()=>new Map),C=o!==void 0,p=a!==void 0,v=C?o:f,h=p?a:m,j=n.useCallback(b=>{p||g(b),t?.(b)},[p,t]),N=n.useCallback(b=>{C||d(b),e?.(b)},[C,e]),R=n.useCallback((b,L)=>{u(k=>{if(k.get(b)===L)return k;const T=new Map(k);return T.set(b,L),T})},[]),D=n.useMemo(()=>({open:h,setOpen:j,value:v,onValueChange:N,shouldFilter:s,disabled:c,itemLabels:x,registerItem:R}),[h,j,v,N,s,c,x,R]);return r.jsx(E.Provider,{value:D,children:r.jsx(S.Popover,{open:h,onOpenChange:j,children:i})})}const A=V.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","hover:bg-accent","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","disabled:hover:bg-neutral-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4"],{variants:{variant:{default:[]}},defaultVariants:{variant:"default"}}),O=n.forwardRef(({className:o,variant:e,dataHook:a,trackingEl:t,trackingLabel:s,children:c,...i},f)=>{const{open:d,disabled:m,value:g}=y(),x=n.useId(),u=!g;return r.jsx(S.PopoverTrigger,{asChild:!0,children:r.jsxs("button",{ref:f,"aria-controls":d?x:void 0,"aria-expanded":d,"aria-haspopup":"listbox",className:w.cn(A({variant:e}),o),"data-hook":a,"data-placeholder":u,"data-slot":"combobox-trigger","data-state":d?"open":"closed","data-tracking-el":t||"combobox-trigger","data-tracking-label":s,disabled:m||i.disabled,role:"combobox",type:"button",...i,children:[c,r.jsx(I.ChevronsUpDownIcon,{"aria-hidden":"true",className:"text-muted-foreground ml-auto size-4 shrink-0"})]})})});O.displayName="ComboboxTrigger";function H({placeholder:o,className:e}){const{value:a,itemLabels:t}=y(),s=a?t.get(a)||a:o;return r.jsx("span",{className:w.cn("text-foreground overflow-hidden text-sm leading-normal font-medium text-ellipsis whitespace-nowrap",e),"data-slot":"combobox-value",children:s})}function B({dataHook:o,className:e,children:a,align:t="start"}){const{shouldFilter:s}=y();return r.jsx(S.PopoverContent,{align:t,className:w.cn("w-[var(--radix-popover-trigger-width)] p-0",e),"data-slot":"combobox-popover",children:r.jsx(l.Command,{className:"border-0 shadow-none","data-slot":"combobox-command",dataHook:o||"combobox-command",shouldFilter:s,children:a})})}const P=n.forwardRef((o,e)=>r.jsx(l.CommandInput,{ref:e,"data-slot":"combobox-input",...o}));P.displayName="ComboboxInput";const q=n.forwardRef((o,e)=>r.jsx(l.CommandList,{ref:e,"data-slot":"combobox-list",...o}));q.displayName="ComboboxList";const z=n.forwardRef((o,e)=>r.jsx(l.CommandEmpty,{ref:e,"data-slot":"combobox-empty",...o}));z.displayName="ComboboxEmpty";const M=n.forwardRef((o,e)=>r.jsx(l.CommandGroup,{ref:e,"data-slot":"combobox-group",...o}));M.displayName="ComboboxGroup";function J(o,e,a){if(!e||!e.trim())return o;const t=new RegExp(`(${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),s=o.split(t);return r.jsx("span",{children:s.map((c,i)=>i%2===1?r.jsx("span",{className:a,children:c},i):r.jsx(n.Fragment,{children:c},i))})}const _=n.forwardRef(({value:o,label:e,dataHook:a,children:t,className:s,highlight:c,highlightClassName:i,...f},d)=>{const{value:m,onValueChange:g,setOpen:x,registerItem:u}=y(),C=m===o,p=n.useMemo(()=>e||(typeof t=="string"?t:typeof t=="number"?String(t):o),[e,t,o]),v=n.useRef(u);n.useEffect(()=>{v.current=u},[u]),n.useEffect(()=>{v.current(o,p)},[o,p]);const h=()=>{g(o===m?"":o),x(!1)},j=()=>c&&typeof t=="string"?J(t,c,i||"text-sm leading-normal font-semibold"):t;return r.jsxs(l.CommandItem,{ref:d,className:w.cn("justify-between",s),"data-slot":"combobox-item",dataHook:a,value:o,onSelect:h,...f,children:[j(),C&&r.jsx(I.CheckIcon,{"aria-hidden":"true",className:"text-muted-foreground size-4 shrink-0"})]})});_.displayName="ComboboxItem";const G=n.forwardRef((o,e)=>r.jsx(l.CommandSeparator,{ref:e,"data-slot":"combobox-separator",...o}));G.displayName="ComboboxSeparator";function K({className:o,children:e}){return r.jsx("div",{className:w.cn("flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",o),"data-slot":"combobox-loading",children:e||r.jsxs(r.Fragment,{children:[r.jsx(I.LoaderIcon,{"aria-hidden":"true",className:"size-4 animate-spin"}),"Loading..."]})})}exports.Combobox=F;exports.ComboboxContent=B;exports.ComboboxEmpty=z;exports.ComboboxGroup=M;exports.ComboboxInput=P;exports.ComboboxItem=_;exports.ComboboxList=q;exports.ComboboxLoading=K;exports.ComboboxSeparator=G;exports.ComboboxTrigger=O;exports.ComboboxValue=H;
|
package/dist/combobox.d.ts
CHANGED
|
@@ -1,75 +1,91 @@
|
|
|
1
|
-
import { LucideIcon } from '@brightlocal/icons';
|
|
2
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from '../command';
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/** Unique value for the item */
|
|
20
|
-
value: string;
|
|
21
|
-
/** Display label for the item */
|
|
22
|
-
label: string;
|
|
23
|
-
/** Optional group/category for the item */
|
|
24
|
-
group?: string;
|
|
25
|
-
/** Icon component for icon menu item type */
|
|
26
|
-
icon?: LucideIcon;
|
|
27
|
-
/** Avatar image source URL for avatar menu item type */
|
|
28
|
-
avatarSrc?: string;
|
|
29
|
-
/** Avatar fallback text/initials for avatar menu item type */
|
|
30
|
-
avatarFallback?: string;
|
|
4
|
+
export interface ComboboxProps {
|
|
5
|
+
/** Controlled selected value */
|
|
6
|
+
value?: string;
|
|
7
|
+
/** Callback when value changes */
|
|
8
|
+
onValueChange?: (value: string) => void;
|
|
9
|
+
/** Controlled open state */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Callback when open state changes */
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/** Whether to use cmdk's built-in filtering. Set to false for async search. */
|
|
14
|
+
shouldFilter?: boolean;
|
|
15
|
+
/** Disabled state */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Children */
|
|
18
|
+
children: React.ReactNode;
|
|
31
19
|
}
|
|
20
|
+
declare function Combobox({ value: controlledValue, onValueChange: controlledOnValueChange, open: controlledOpen, onOpenChange: controlledOnOpenChange, shouldFilter, disabled, children, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
32
21
|
declare const comboboxTriggerVariants: (props?: ({
|
|
33
|
-
variant?: "default" |
|
|
22
|
+
variant?: "default" | null | undefined;
|
|
34
23
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
35
|
-
interface
|
|
36
|
-
/** Optional id for the combobox trigger, used with FieldLabel htmlFor */
|
|
37
|
-
id?: string;
|
|
24
|
+
export interface ComboboxTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof comboboxTriggerVariants> {
|
|
38
25
|
/** Data hook for automated testing (REQUIRED) */
|
|
39
26
|
dataHook: string;
|
|
27
|
+
/** Accessible label for the combobox trigger. Use either aria-label or aria-labelledby for accessibility. */
|
|
28
|
+
"aria-label"?: string;
|
|
29
|
+
/** ID reference to a label element that provides the accessible name */
|
|
30
|
+
"aria-labelledby"?: string;
|
|
40
31
|
/** Tracking element identifier for analytics */
|
|
41
32
|
trackingEl?: string;
|
|
42
33
|
/** Tracking label for analytics context */
|
|
43
34
|
trackingLabel?: string;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
value?: string;
|
|
48
|
-
/** Callback when selection changes */
|
|
49
|
-
onValueChange?: (value: string) => void;
|
|
35
|
+
}
|
|
36
|
+
declare const ComboboxTrigger: React.ForwardRefExoticComponent<ComboboxTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
export interface ComboboxValueProps {
|
|
50
38
|
/** Placeholder text when no value is selected */
|
|
51
39
|
placeholder?: string;
|
|
52
|
-
/**
|
|
53
|
-
groupLabel?: string;
|
|
54
|
-
/** Disabled state */
|
|
55
|
-
disabled?: boolean;
|
|
56
|
-
/** Empty state message when no results found */
|
|
57
|
-
emptyMessage?: string;
|
|
58
|
-
/** Search placeholder text */
|
|
59
|
-
searchPlaceholder?: string;
|
|
60
|
-
/** Whether to show the avatar */
|
|
61
|
-
showAvatar?: boolean;
|
|
62
|
-
/** Avatar image source URL */
|
|
63
|
-
avatarSrc?: string;
|
|
64
|
-
/** Avatar fallback text/initials */
|
|
65
|
-
avatarFallback?: string;
|
|
66
|
-
/** Custom className for the trigger button */
|
|
40
|
+
/** Custom className */
|
|
67
41
|
className?: string;
|
|
68
|
-
/** Menu item type for dropdown items */
|
|
69
|
-
menuItemType?: ComboboxMenuItemType;
|
|
70
|
-
/** Accessible label for the combobox (used when no visible label is provided) */
|
|
71
|
-
"aria-label"?: string;
|
|
72
42
|
}
|
|
73
|
-
declare
|
|
74
|
-
export
|
|
43
|
+
declare function ComboboxValue({ placeholder, className }: ComboboxValueProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export interface ComboboxContentProps {
|
|
45
|
+
/** Data hook for automated testing */
|
|
46
|
+
dataHook?: string;
|
|
47
|
+
/** Custom className */
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Children */
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
/** Alignment of the popover relative to trigger */
|
|
52
|
+
align?: "start" | "center" | "end";
|
|
53
|
+
}
|
|
54
|
+
declare function ComboboxContent({ dataHook, className, children, align, }: ComboboxContentProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export interface ComboboxInputProps extends React.ComponentProps<typeof CommandInput> {
|
|
56
|
+
/** Current input value. Use for controlled/async search. */
|
|
57
|
+
value?: string;
|
|
58
|
+
/** Called when input value changes. Use to trigger async search requests. */
|
|
59
|
+
onValueChange?: (value: string) => void;
|
|
60
|
+
}
|
|
61
|
+
declare const ComboboxInput: React.ForwardRefExoticComponent<ComboboxInputProps & React.RefAttributes<any>>;
|
|
62
|
+
export type ComboboxListProps = React.ComponentProps<typeof CommandList>;
|
|
63
|
+
declare const ComboboxList: React.ForwardRefExoticComponent<any>;
|
|
64
|
+
export type ComboboxEmptyProps = React.ComponentProps<typeof CommandEmpty>;
|
|
65
|
+
declare const ComboboxEmpty: React.ForwardRefExoticComponent<any>;
|
|
66
|
+
export type ComboboxGroupProps = React.ComponentProps<typeof CommandGroup>;
|
|
67
|
+
declare const ComboboxGroup: React.ForwardRefExoticComponent<any>;
|
|
68
|
+
export interface ComboboxItemProps extends Omit<React.ComponentProps<typeof CommandItem>, "onSelect"> {
|
|
69
|
+
/** The value of the item (required) */
|
|
70
|
+
value: string;
|
|
71
|
+
/** Display label - if not provided, uses children text content */
|
|
72
|
+
label?: string;
|
|
73
|
+
/** Data hook for automated testing */
|
|
74
|
+
dataHook?: string;
|
|
75
|
+
/** Text to highlight in the item (typically the search query) */
|
|
76
|
+
highlight?: string;
|
|
77
|
+
/** Class name for highlighted text */
|
|
78
|
+
highlightClassName?: string;
|
|
79
|
+
}
|
|
80
|
+
declare const ComboboxItem: React.ForwardRefExoticComponent<Omit<ComboboxItemProps, "ref"> & React.RefAttributes<any>>;
|
|
81
|
+
export type ComboboxSeparatorProps = React.ComponentProps<typeof CommandSeparator>;
|
|
82
|
+
declare const ComboboxSeparator: React.ForwardRefExoticComponent<any>;
|
|
83
|
+
export interface ComboboxLoadingProps {
|
|
84
|
+
/** Custom className */
|
|
85
|
+
className?: string;
|
|
86
|
+
/** Children - custom loading content */
|
|
87
|
+
children?: React.ReactNode;
|
|
88
|
+
}
|
|
89
|
+
declare function ComboboxLoading({ className, children }: ComboboxLoadingProps): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
export { Combobox, ComboboxTrigger, ComboboxValue, ComboboxContent, ComboboxInput, ComboboxList, ComboboxEmpty, ComboboxGroup, ComboboxItem, ComboboxSeparator, ComboboxLoading, };
|
|
75
91
|
//# sourceMappingURL=combobox.d.ts.map
|
package/dist/combobox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC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