@brightlocal/ui-components 3.0.0 → 3.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 +7 -1
- package/component-meta.json +749 -53
- package/deprecations.json +114 -4
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +74 -61
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +50 -57
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.d.ts +36 -0
- package/dist/button-group.d.ts.map +1 -0
- package/dist/button-group.js +47 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +105 -7
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +198 -101
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +270 -24
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +497 -322
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +38 -4
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +95 -81
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +251 -225
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +201 -23
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +712 -568
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +13 -5
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +54 -53
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +79 -52
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +105 -13
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +146 -129
- package/dist/grid.d.ts +26 -3
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +594 -553
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +45 -15
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +31 -30
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/empty-chip.cjs +1 -0
- package/dist/lib/empty-chip.d.ts +4 -0
- package/dist/lib/empty-chip.d.ts.map +1 -0
- package/dist/lib/empty-chip.js +13 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +3 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +57 -57
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +15 -6
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +38 -36
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +24 -3
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +130 -110
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.d.ts +13 -0
- package/dist/typography-heading.d.ts.map +1 -1
- package/dist/typography-heading.js +32 -21
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +15 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +35 -24
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +17 -24
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/accordion.tsx +82 -27
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/button-group.tsx +112 -0
- package/src/components/button.tsx +1 -1
- package/src/components/card.tsx +249 -27
- package/src/components/chart.tsx +586 -53
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +83 -10
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +56 -4
- package/src/components/data-table.tsx +842 -199
- package/src/components/date-picker.tsx +18 -7
- package/src/components/field.tsx +81 -12
- package/src/components/global-layout.tsx +176 -38
- package/src/components/grid.tsx +34 -3
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +56 -22
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/pagination.tsx +10 -3
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/scroll-area.tsx +23 -10
- package/src/components/select.tsx +65 -11
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-heading.tsx +24 -0
- package/src/components/typography-text.tsx +27 -3
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +6 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/empty-chip.ts +24 -0
- package/src/lib/utils.ts +1 -0
package/dist/checkbox.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 c=require("react/jsx-runtime"),g=require("react"),m=require("@radix-ui/react-checkbox"),p=require("@brightlocal/icons"),v=require("class-variance-authority"),y=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),n=v.cva(["size-[18px] shrink-0 self-start mt-0.5","bg-background peer border border-ring dark:bg-input/30 rounded-xs transition-colors duration-fast ease-out 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-destructive-40","focus-visible:border-destructive-40 focus-visible:shadow-destructive"]}},defaultVariants:{error:!1}}),d=o.forwardRef(({className:e,disabled:r=!1,error:t,dataHook:a,trackingEl:u,trackingLabel:l,id:b,...f},k)=>{const h=o.useId(),x=b||h;return c.jsx(i.Root,{ref:k,"aria-invalid":t?"true":void 0,className:y.cn(n({error:t}),e),"data-hook":a,"data-slot":"checkbox","data-tracking-el":u,"data-tracking-label":l,disabled:r,id:x,...f,children:c.jsx(i.Indicator,{className:"flex items-center justify-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(p.Check,{})})})});d.displayName="Checkbox";exports.Checkbox=d;exports.checkboxVariants=n;
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ export interface CheckboxProps extends Omit<React.ComponentProps<typeof Checkbox
|
|
|
15
15
|
trackingLabel?: string;
|
|
16
16
|
}
|
|
17
17
|
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
-
export { Checkbox };
|
|
18
|
+
export { Checkbox, checkboxVariants };
|
|
19
19
|
//# sourceMappingURL=checkbox.d.ts.map
|
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,CAA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A,MAAM,QAAQ,sGAuCb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/checkbox.js
CHANGED
package/dist/chip.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 a=require("react/jsx-runtime"),R=require("react"),y=require("class-variance-authority"),I=require("@brightlocal/icons"),b=require("@brightlocal/ui-components/lib/utils"),_=require("@brightlocal/ui-components/spinner"),l=require("@brightlocal/ui-components/tooltip");function $(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>s[t]})}}return e.default=s,Object.freeze(e)}const c=$(R),v=y.cva(["inline-flex","items-center","justify-center","gap-0.5","rounded-full","whitespace-nowrap","shrink-0","select-none","bg-secondary","text-foreground","transition-[color,background-color,box-shadow]","duration-fast","ease-out","hover:bg-secondary/80","outline-none","focus-visible:shadow-default","disabled:pointer-events-none","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:opacity-50"],{variants:{size:{md:["h-7","pl-2.5","pr-1","text-label-sm"],lg:["h-8","pl-4","pr-2","text-label"]}},defaultVariants:{size:"md"}}),x=y.cva(["inline-flex","items-center","justify-center","rounded-full","cursor-pointer","text-muted-foreground","hover:text-foreground","outline-none","focus-visible:text-foreground","disabled:pointer-events-none","disabled:opacity-50"],{variants:{size:{md:["size-6"],lg:["size-6"]}},defaultVariants:{size:"md"}}),j=c.forwardRef(({className:s,children:e,size:t="md",loading:i=!1,disabled:w=!1,onRemove:d,dataHook:h,trackingEl:u,trackingLabel:k,maxWidth:T=200,loadingLabel:D,removeAriaLabel:m,removableAriaLabel:z,onKeyDown:S,...q},C)=>{const p=w||i,N=t==="lg"?16:14,f=typeof e=="string"||typeof e=="number"?String(e):"chip",o=d!==void 0&&!p,O=n=>{S?.(n),!(n.defaultPrevented||!o)&&(n.key==="Backspace"||n.key==="Delete")&&(n.preventDefault(),d(n))},r=c.useRef(null),[V,P]=c.useState(!1);c.useEffect(()=>{const n=()=>{r.current&&P(r.current.scrollWidth>r.current.clientWidth)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]);const g=a.jsx("span",{ref:r,className:"truncate","data-slot":"chip-label",style:{maxWidth:T},children:e});return a.jsxs("div",{ref:C,"aria-disabled":p?"true":void 0,"aria-label":o?(z??"{name}, press Delete to remove").replace("{name}",f):void 0,className:b.cn(v({size:t}),s),"data-hook":h,"data-slot":"chip","data-tracking-el":u,"data-tracking-label":k,role:o?"group":void 0,tabIndex:o?0:void 0,onKeyDown:O,...q,children:[V?a.jsx(l.TooltipProvider,{children:a.jsxs(l.Tooltip,{children:[a.jsx(l.TooltipTrigger,{asChild:!0,children:g}),a.jsx(l.TooltipContent,{dataHook:`${h}-tooltip`,sideOffset:8,children:e})]})}):g,i?a.jsx("span",{"aria-label":D??"Loading",className:b.cn(x({size:t})),"data-slot":"chip-loading",role:"status",children:a.jsx(_.Spinner,{size:t==="lg"?"md":"sm"})}):a.jsx("button",{"aria-label":m?m.replace("{name}",f):`Remove ${f}`,className:b.cn(x({size:t})),"data-slot":"chip-delete","data-tracking-el":u?`${u}-delete`:void 0,disabled:p,tabIndex:-1,type:"button",onClick:d,children:a.jsx(I.X,{size:N})})]})});j.displayName="Chip";exports.Chip=j;exports.chipVariants=v;
|
package/dist/chip.d.ts
CHANGED
|
@@ -3,6 +3,21 @@ import * as React from "react";
|
|
|
3
3
|
* Chip size options
|
|
4
4
|
*/
|
|
5
5
|
type ChipSize = "md" | "lg";
|
|
6
|
+
/**
|
|
7
|
+
* The event a chip removal hands to `onRemove`: a mouse event from the
|
|
8
|
+
* delete button, or a keyboard event from Backspace/Delete on the chip root.
|
|
9
|
+
*/
|
|
10
|
+
type ChipRemoveEvent = React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLDivElement>;
|
|
11
|
+
/**
|
|
12
|
+
* Removal callback. Declared with the bivariance hack — the same shape React
|
|
13
|
+
* uses for its own event handlers — so handlers annotated against the
|
|
14
|
+
* pre-keyboard, mouse-only contract
|
|
15
|
+
* (`(event: React.MouseEvent<HTMLButtonElement>) => void`) stay assignable
|
|
16
|
+
* under strict function-parameter checking (DS-949).
|
|
17
|
+
*/
|
|
18
|
+
type ChipRemoveHandler = {
|
|
19
|
+
bivarianceHack(event: ChipRemoveEvent): void;
|
|
20
|
+
}["bivarianceHack"];
|
|
6
21
|
declare const chipVariants: (props?: ({
|
|
7
22
|
size?: "md" | "lg" | null | undefined;
|
|
8
23
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -30,9 +45,10 @@ interface ChipProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
|
30
45
|
*/
|
|
31
46
|
disabled?: boolean;
|
|
32
47
|
/**
|
|
33
|
-
* Callback when delete button
|
|
48
|
+
* Callback when the chip is removed — via the delete button (click) or
|
|
49
|
+
* the keyboard (Backspace/Delete while the chip is focused).
|
|
34
50
|
*/
|
|
35
|
-
onRemove?:
|
|
51
|
+
onRemove?: ChipRemoveHandler;
|
|
36
52
|
/**
|
|
37
53
|
* Data hook for automated testing (required)
|
|
38
54
|
*/
|
|
@@ -57,16 +73,34 @@ interface ChipProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
|
57
73
|
loadingLabel?: string;
|
|
58
74
|
/**
|
|
59
75
|
* Accessible label for the remove button.
|
|
60
|
-
* Supports `{name}` placeholder for interpolation.
|
|
76
|
+
* Supports `{name}` placeholder for interpolation. The default `{name}` is
|
|
77
|
+
* derived from string or number children; for a JSX label, pass this prop
|
|
78
|
+
* with the resolved name.
|
|
61
79
|
* @default "Remove {name}"
|
|
62
80
|
*/
|
|
63
81
|
removeAriaLabel?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Accessible label for the chip itself while it is keyboard-removable
|
|
84
|
+
* (focusable, with the Backspace/Delete removal hint).
|
|
85
|
+
* Supports `{name}` placeholder for interpolation. The default `{name}` is
|
|
86
|
+
* derived from string or number children; for a JSX label, pass this prop
|
|
87
|
+
* with the resolved name.
|
|
88
|
+
* @default "{name}, press Delete to remove"
|
|
89
|
+
*/
|
|
90
|
+
removableAriaLabel?: string;
|
|
64
91
|
}
|
|
65
92
|
/**
|
|
66
93
|
* Chip component for displaying removable tags or selections.
|
|
67
94
|
* Used for filter selections, tag lists, and multi-select values.
|
|
95
|
+
*
|
|
96
|
+
* A removable chip is a single tab stop: the chip itself takes focus and
|
|
97
|
+
* Backspace/Delete removes it (DS-949). The delete button stays mouse-only
|
|
98
|
+
* (`tabIndex={-1}`) so each chip costs one tab stop, not two. When a removal
|
|
99
|
+
* unmounts the focused chip, the consumer hands focus onward per the
|
|
100
|
+
* Filtering pattern's cascade: source control → filter trigger → results
|
|
101
|
+
* region — never `<body>`.
|
|
68
102
|
*/
|
|
69
103
|
declare const Chip: React.ForwardRefExoticComponent<Omit<ChipProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
70
104
|
export { Chip, chipVariants };
|
|
71
|
-
export type { ChipProps, ChipSize };
|
|
105
|
+
export type { ChipProps, ChipRemoveEvent, ChipRemoveHandler, ChipSize };
|
|
72
106
|
//# sourceMappingURL=chip.d.ts.map
|
package/dist/chip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../src/components/chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;GAEG;AACH,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5B,QAAA,MAAM,YAAY;;8EA2CjB,CAAC;AAkCF;;GAEG;AACH,UAAU,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EA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ACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,IAAI,+FA4IT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/chip.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { cva as v } from "class-variance-authority";
|
|
4
4
|
import { X as R } from "@brightlocal/icons";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Spinner as
|
|
7
|
-
import { TooltipProvider as
|
|
8
|
-
const
|
|
5
|
+
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { Spinner as $ } from "@brightlocal/ui-components/spinner";
|
|
7
|
+
import { TooltipProvider as B, Tooltip as K, TooltipTrigger as L, TooltipContent as P } from "@brightlocal/ui-components/tooltip";
|
|
8
|
+
const W = v(
|
|
9
9
|
[
|
|
10
10
|
// Base styles
|
|
11
11
|
"inline-flex",
|
|
@@ -26,7 +26,7 @@ const I = b(
|
|
|
26
26
|
// Hover state
|
|
27
27
|
"hover:bg-secondary/80",
|
|
28
28
|
// Focus state - direct focus on chip (for keyboard navigation)
|
|
29
|
-
"
|
|
29
|
+
"outline-none",
|
|
30
30
|
"focus-visible:shadow-default",
|
|
31
31
|
// Disabled state
|
|
32
32
|
"disabled:pointer-events-none",
|
|
@@ -48,7 +48,7 @@ const I = b(
|
|
|
48
48
|
size: "md"
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
),
|
|
51
|
+
), g = v(
|
|
52
52
|
[
|
|
53
53
|
// Base styles
|
|
54
54
|
"inline-flex",
|
|
@@ -78,90 +78,104 @@ const I = b(
|
|
|
78
78
|
size: "md"
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
),
|
|
81
|
+
), E = n.forwardRef(
|
|
82
82
|
({
|
|
83
|
-
className:
|
|
84
|
-
children:
|
|
83
|
+
className: y,
|
|
84
|
+
children: a,
|
|
85
85
|
size: o = "md",
|
|
86
|
-
loading:
|
|
87
|
-
disabled:
|
|
88
|
-
onRemove:
|
|
89
|
-
dataHook:
|
|
90
|
-
trackingEl:
|
|
91
|
-
trackingLabel:
|
|
92
|
-
maxWidth:
|
|
93
|
-
loadingLabel:
|
|
94
|
-
removeAriaLabel:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
loading: u = !1,
|
|
87
|
+
disabled: x = !1,
|
|
88
|
+
onRemove: s,
|
|
89
|
+
dataHook: f,
|
|
90
|
+
trackingEl: l,
|
|
91
|
+
trackingLabel: w,
|
|
92
|
+
maxWidth: k = 200,
|
|
93
|
+
loadingLabel: T,
|
|
94
|
+
removeAriaLabel: m,
|
|
95
|
+
removableAriaLabel: z,
|
|
96
|
+
onKeyDown: D,
|
|
97
|
+
...C
|
|
98
|
+
}, N) => {
|
|
99
|
+
const d = x || u, j = o === "lg" ? 16 : 14, c = typeof a == "string" || typeof a == "number" ? String(a) : "chip", i = s !== void 0 && !d, S = (e) => {
|
|
100
|
+
D?.(e), !(e.defaultPrevented || !i) && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), s(e));
|
|
101
|
+
}, r = n.useRef(null), [V, I] = n.useState(!1);
|
|
102
|
+
n.useEffect(() => {
|
|
103
|
+
const e = () => {
|
|
104
|
+
r.current && I(
|
|
105
|
+
r.current.scrollWidth > r.current.clientWidth
|
|
102
106
|
);
|
|
103
107
|
};
|
|
104
|
-
return
|
|
105
|
-
}, [
|
|
106
|
-
const
|
|
108
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
109
|
+
}, [a]);
|
|
110
|
+
const b = /* @__PURE__ */ t(
|
|
107
111
|
"span",
|
|
108
112
|
{
|
|
109
|
-
ref:
|
|
113
|
+
ref: r,
|
|
110
114
|
className: "truncate",
|
|
111
115
|
"data-slot": "chip-label",
|
|
112
|
-
style: { maxWidth:
|
|
113
|
-
children:
|
|
116
|
+
style: { maxWidth: k },
|
|
117
|
+
children: a
|
|
114
118
|
}
|
|
115
119
|
);
|
|
116
|
-
return
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
120
|
+
return (
|
|
121
|
+
/* Keyboard removal lives on the chip root: when removable it carries
|
|
122
|
+
role="group" and tabIndex=0 below — the rule can't see the
|
|
123
|
+
conditional role. */
|
|
124
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
125
|
+
/* @__PURE__ */ h(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref: N,
|
|
129
|
+
"aria-disabled": d ? "true" : void 0,
|
|
130
|
+
"aria-label": i ? (z ?? "{name}, press Delete to remove").replace(
|
|
131
|
+
"{name}",
|
|
132
|
+
c
|
|
133
|
+
) : void 0,
|
|
134
|
+
className: p(W({ size: o }), y),
|
|
135
|
+
"data-hook": f,
|
|
136
|
+
"data-slot": "chip",
|
|
137
|
+
"data-tracking-el": l,
|
|
138
|
+
"data-tracking-label": w,
|
|
139
|
+
role: i ? "group" : void 0,
|
|
140
|
+
tabIndex: i ? 0 : void 0,
|
|
141
|
+
onKeyDown: S,
|
|
142
|
+
...C,
|
|
143
|
+
children: [
|
|
144
|
+
V ? /* @__PURE__ */ t(B, { children: /* @__PURE__ */ h(K, { children: [
|
|
145
|
+
/* @__PURE__ */ t(L, { asChild: !0, children: b }),
|
|
146
|
+
/* @__PURE__ */ t(P, { dataHook: `${f}-tooltip`, sideOffset: 8, children: a })
|
|
147
|
+
] }) }) : b,
|
|
148
|
+
u ? /* @__PURE__ */ t(
|
|
149
|
+
"span",
|
|
150
|
+
{
|
|
151
|
+
"aria-label": T ?? "Loading",
|
|
152
|
+
className: p(g({ size: o })),
|
|
153
|
+
"data-slot": "chip-loading",
|
|
154
|
+
role: "status",
|
|
155
|
+
children: /* @__PURE__ */ t($, { size: o === "lg" ? "md" : "sm" })
|
|
156
|
+
}
|
|
157
|
+
) : /* @__PURE__ */ t(
|
|
158
|
+
"button",
|
|
159
|
+
{
|
|
160
|
+
"aria-label": m ? m.replace("{name}", c) : `Remove ${c}`,
|
|
161
|
+
className: p(g({ size: o })),
|
|
162
|
+
"data-slot": "chip-delete",
|
|
163
|
+
"data-tracking-el": l ? `${l}-delete` : void 0,
|
|
164
|
+
disabled: d,
|
|
165
|
+
tabIndex: -1,
|
|
166
|
+
type: "button",
|
|
167
|
+
onClick: s,
|
|
168
|
+
children: /* @__PURE__ */ t(R, { size: j })
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
)
|
|
160
174
|
);
|
|
161
175
|
}
|
|
162
176
|
);
|
|
163
|
-
|
|
177
|
+
E.displayName = "Chip";
|
|
164
178
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
179
|
+
E as Chip,
|
|
180
|
+
W as chipVariants
|
|
167
181
|
};
|
package/dist/combobox.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),ie=require("react"),Y=require("@brightlocal/icons"),ce=require("@tanstack/react-virtual"),le=require("class-variance-authority"),B=require("cmdk"),q=require("@brightlocal/ui-components/lib/utils"),H=require("@brightlocal/ui-components/lib/use-dev-warning"),J=require("@brightlocal/ui-components/popover"),$=require("@brightlocal/ui-components/command"),ue=require("@brightlocal/ui-components/spinner");function de(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=de(ie),Q=t.createContext(null),X=t.createContext(null);function z(){const e=t.useContext(Q);if(!e)throw new Error("Combobox components must be used within a <Combobox>");return e}function fe({value:e,onValueChange:r,open:n,onOpenChange:o,onClose:i,shouldFilter:f=!0,disabled:l=!1,itemToStringValue:d,children:m}){const[v,E]=t.useState(""),[x,b]=t.useState(!1),[S,R]=t.useState(()=>new Map),[C,L]=t.useState(""),[V,w]=t.useState(void 0),y=e!==void 0,D=n!==void 0,j=y?e:v,k=D?n:x,M=t.useCallback(g=>{g||L(""),D||b(g),o?.(g)},[D,o]),p=t.useCallback(g=>{y||E(g),r?.(g)},[y,r]),I=t.useRef(i);t.useEffect(()=>{I.current=i},[i]);const F=t.useRef(k);t.useEffect(()=>{F.current&&!k&&I.current?.(),F.current=k},[k]),t.useEffect(()=>()=>{F.current&&I.current?.()},[]);const u=t.useRef(new Map),P=t.useRef(!1),A=t.useRef(!0);t.useEffect(()=>()=>{A.current=!1},[]);const O=t.useCallback(()=>{P.current||(P.current=!0,queueMicrotask(()=>{P.current=!1,A.current&&R(new Map(u.current))}))},[]),T=t.useCallback((g,s)=>{u.current.get(g)!==s&&(u.current.set(g,s),O())},[O]),_=t.useCallback(g=>{for(const[s,c]of g)u.current.set(s,c);R(new Map(u.current))},[]),W=t.useRef(j);t.useLayoutEffect(()=>{W.current=j},[j]);const G=t.useCallback(g=>{g!==W.current&&u.current.has(g)&&(u.current.delete(g),O())},[O]),U=t.useMemo(()=>d?(g,s,c)=>B.defaultFilter(d(g),s,c):B.defaultFilter,[d]),K=t.useMemo(()=>({open:k,setOpen:M,value:j,onValueChange:p,shouldFilter:f,disabled:l,itemLabels:S,registerItem:T,registerItemsSync:_,unregisterItem:G,itemToStringValue:d,filterFn:U,searchValue:C,setSearchValue:L,activeDescendantId:V,setActiveDescendantId:w}),[k,M,j,p,f,l,S,T,_,G,d,U,C,V,w]);return a.jsx(Q.Provider,{value:K,children:a.jsx(J.Popover,{open:k,onOpenChange:M,children:m})})}const be=le.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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),ie=require("react"),Y=require("@brightlocal/icons"),ce=require("@tanstack/react-virtual"),le=require("class-variance-authority"),B=require("cmdk"),q=require("@brightlocal/ui-components/lib/utils"),H=require("@brightlocal/ui-components/lib/use-dev-warning"),J=require("@brightlocal/ui-components/popover"),$=require("@brightlocal/ui-components/command"),ue=require("@brightlocal/ui-components/spinner");function de(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=de(ie),Q=t.createContext(null),X=t.createContext(null);function z(){const e=t.useContext(Q);if(!e)throw new Error("Combobox components must be used within a <Combobox>");return e}function fe({value:e,onValueChange:r,open:n,onOpenChange:o,onClose:i,shouldFilter:f=!0,disabled:l=!1,itemToStringValue:d,children:m}){const[v,E]=t.useState(""),[x,b]=t.useState(!1),[S,R]=t.useState(()=>new Map),[C,L]=t.useState(""),[V,w]=t.useState(void 0),y=e!==void 0,D=n!==void 0,j=y?e:v,k=D?n:x,M=t.useCallback(g=>{g||L(""),D||b(g),o?.(g)},[D,o]),p=t.useCallback(g=>{y||E(g),r?.(g)},[y,r]),I=t.useRef(i);t.useEffect(()=>{I.current=i},[i]);const F=t.useRef(k);t.useEffect(()=>{F.current&&!k&&I.current?.(),F.current=k},[k]),t.useEffect(()=>()=>{F.current&&I.current?.()},[]);const u=t.useRef(new Map),P=t.useRef(!1),A=t.useRef(!0);t.useEffect(()=>()=>{A.current=!1},[]);const O=t.useCallback(()=>{P.current||(P.current=!0,queueMicrotask(()=>{P.current=!1,A.current&&R(new Map(u.current))}))},[]),T=t.useCallback((g,s)=>{u.current.get(g)!==s&&(u.current.set(g,s),O())},[O]),_=t.useCallback(g=>{for(const[s,c]of g)u.current.set(s,c);R(new Map(u.current))},[]),W=t.useRef(j);t.useLayoutEffect(()=>{W.current=j},[j]);const G=t.useCallback(g=>{g!==W.current&&u.current.has(g)&&(u.current.delete(g),O())},[O]),U=t.useMemo(()=>d?(g,s,c)=>B.defaultFilter(d(g),s,c):B.defaultFilter,[d]),K=t.useMemo(()=>({open:k,setOpen:M,value:j,onValueChange:p,shouldFilter:f,disabled:l,itemLabels:S,registerItem:T,registerItemsSync:_,unregisterItem:G,itemToStringValue:d,filterFn:U,searchValue:C,setSearchValue:L,activeDescendantId:V,setActiveDescendantId:w}),[k,M,j,p,f,l,S,T,_,G,d,U,C,V,w]);return a.jsx(Q.Provider,{value:K,children:a.jsx(J.Popover,{open:k,onOpenChange:M,children:m})})}const be=le.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-field text-foreground","data-[placeholder=true]:text-muted-foreground","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","transition-[background-color,border-color,box-shadow] duration-fast ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"]),Z=t.forwardRef(({className:e,dataHook:r,error:n,trackingEl:o,trackingLabel:i,children:f,...l},d)=>{const{open:m,disabled:v,value:E}=z(),x=t.useId(),b=!E,S=n||l["aria-invalid"]===!0||l["aria-invalid"]==="true";return a.jsx(J.PopoverTrigger,{asChild:!0,children:a.jsxs("button",{ref:d,"aria-controls":m?x:void 0,"aria-expanded":m,"aria-haspopup":"listbox","aria-invalid":S?"true":void 0,className:q.cn(be(),S&&"border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive",e),"data-hook":r,"data-placeholder":b,"data-slot":"combobox-trigger","data-state":m?"open":"closed","data-tracking-el":o||"combobox-trigger","data-tracking-label":i,disabled:v||l.disabled,role:"combobox",type:"button",...l,children:[f,a.jsx(Y.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});Z.displayName="ComboboxTrigger";function me(e){return e!=null&&typeof e=="object"&&"value"in e&&typeof e.value=="string"}function ee(e,r,n){if(r)return{getValue:r,getLabel:n??r,hasDistinctLabel:!!n};const o=e[0];if(!me(o))return null;const i=d=>d.value,f="label"in o&&typeof o.label=="string";return{getValue:i,getLabel:n??(f?d=>String(d.label):i),hasDistinctLabel:f||!!n}}function pe({placeholder:e,className:r,displayValue:n,items:o,getItemValue:i,getItemLabel:f}){const{value:l,itemLabels:d}=z(),m=t.useMemo(()=>o?ee(o,i,f):null,[o,i,f]);H.useDevWarning(()=>!!o&&o.length>0&&!m,"ComboboxValue: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",[o,m]);const v=t.useMemo(()=>!o||!m?null:new Map(o.map(x=>[m.getValue(x),m.getLabel(x)])),[o,m]),E=l?v?.get(l)||d.get(l)||n?.(l)||l:e;return a.jsx("span",{className:q.cn("text-field overflow-hidden text-ellipsis whitespace-nowrap",r),"data-slot":"combobox-value",children:E})}function xe({dataHook:e,className:r,children:n,align:o="start",side:i="bottom",sideOffset:f,avoidCollisions:l,hideList:d=!1,ariaLabel:m}){const{open:v,shouldFilter:E,filterFn:x,itemToStringValue:b}=z(),[S,R]=t.useState(null),C=t.useRef(null),L=t.useCallback(w=>{if(C.current?.(),C.current=null,!w)return;let y=!1;const D=p=>{y||(p==="top"||p==="bottom")&&(y=!0,j.disconnect(),R(p))},j=new MutationObserver(()=>{D(w.getAttribute("data-side"))});j.observe(w,{attributes:!0,attributeFilter:["data-side"]});let k=0,M=0;k=requestAnimationFrame(()=>{M=requestAnimationFrame(()=>{D(w.getAttribute("data-side"))})}),C.current=()=>{y=!0,j.disconnect(),cancelAnimationFrame(k),cancelAnimationFrame(M)}},[]);t.useEffect(()=>{if(!v){C.current?.(),C.current=null;const w=setTimeout(()=>R(null),150);return()=>clearTimeout(w)}},[v]);const V=b?x:void 0;return a.jsx(J.PopoverContent,{ref:L,align:o,"aria-label":m??"Options",avoidCollisions:l,className:q.cn("flex max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)] flex-col overflow-hidden p-0",r),collisionPadding:4,"data-slot":"combobox-popover",side:S??i,sideOffset:f,children:a.jsx($.Command,{className:q.cn("min-h-0 flex-1 border-0 shadow-none","[&_[data-slot='command-input-wrapper']]:shrink-0",d&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:e||"combobox-command",filter:V,shouldFilter:E,children:n})})}const te=t.forwardRef(({debounceMs:e,onValueChange:r,...n},o)=>{const{setSearchValue:i,shouldFilter:f,activeDescendantId:l}=z(),d=t.useRef(void 0);H.useDevWarning(()=>!!(e&&e>0&&f),`debounceMs is set on <ComboboxInput> but shouldFilter is true (default).
|
|
2
2
|
Debounce is designed for async/server-driven search where the consumer controls the items list.
|
|
3
3
|
Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs for client-side filtering.`,[e,f]),H.useDevWarning(()=>!!(e&&e>0&&n.value!==void 0),"debounceMs is set on <ComboboxInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",[e,n.value]),t.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]);const m=t.useCallback(v=>{i(v),e&&e>0?(clearTimeout(d.current),d.current=setTimeout(()=>{r?.(v)},e)):r?.(v)},[e,r,i]);return a.jsx($.CommandInput,{ref:o,"aria-activedescendant":l,"data-slot":"combobox-input",onValueChange:m,...n})});te.displayName="ComboboxInput";const oe=t.forwardRef(({className:e,...r},n)=>a.jsx($.CommandList,{ref:n,className:q.cn("scrollbar min-h-0 flex-1",e),"data-slot":"combobox-list",...r}));oe.displayName="ComboboxList";function ge({items:e,getItemValue:r,getItemLabel:n,getItemKeywords:o,estimateSize:i=36,overscan:f=5,children:l,renderEmpty:d,className:m,dataHook:v},E){const x=t.useMemo(()=>ee(e,r,n),[e,r,n]),b=t.useMemo(()=>x?.getValue??(s=>{if(typeof s=="string"||typeof s=="number")return String(s);throw new Error("[BrightLocal DS] ComboboxVirtualList: `getItemValue` is required for non-primitive items without a `value` property.")}),[x]),S=t.useMemo(()=>x?.getLabel??b,[x,b]);H.useDevWarning(()=>!x&&e.length>0,"ComboboxVirtualList: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",[x,e.length]);const R=t.useRef(null),{value:C,onValueChange:L,setOpen:V,shouldFilter:w,searchValue:y,filterFn:D,setActiveDescendantId:j,registerItemsSync:k,unregisterItem:M}=z(),[p,I]=t.useState(0),F=t.useId();t.useImperativeHandle(E,()=>R.current,[]),t.useLayoutEffect(()=>{const s=e.map(c=>[b(c),S(c)]);return k(s),()=>{for(const c of e)M(b(c))}},[e,b,S,k,M]);const u=t.useMemo(()=>{if(!w||!y.trim())return e;const s=[];for(const c of e){let h=x?.hasDistinctLabel?B.defaultFilter(S(c),y):D(b(c),y);if(o)for(const N of o(c))h=Math.max(h,B.defaultFilter(N,y));h>0&&s.push({item:c,score:h})}return s.sort((c,h)=>h.score-c.score),s.map(c=>c.item)},[e,w,y,b,S,o,D,x?.hasDistinctLabel]),P=ce.useVirtualizer({count:u.length,getScrollElement:()=>R.current,estimateSize:()=>i,overscan:f}),A=p>=0&&p<u.length?b(u[p]):null;t.useEffect(()=>{I(0)},[y,u.length]);const O=t.useRef(!1);t.useEffect(()=>{if(O.current||!C)return;const s=u.findIndex(c=>b(c)===C);s>=0&&(I(s),P.scrollToIndex(s,{align:"center"}),O.current=!0)},[C,u,b,P]);const T=t.useRef(!1);t.useEffect(()=>{T.current&&p>=0&&p<u.length&&P.scrollToIndex(p,{align:"auto"}),T.current=!1},[p,u.length,P]),t.useEffect(()=>{const s=R.current?.closest('[data-slot="combobox-command"]');if(!s)return;const c=h=>{switch(h.key){case"ArrowDown":h.preventDefault(),h.stopPropagation(),T.current=!0,I(N=>N<u.length-1?N+1:N);break;case"ArrowUp":h.preventDefault(),h.stopPropagation(),T.current=!0,I(N=>N>0?N-1:N);break;case"Enter":if(h.preventDefault(),h.stopPropagation(),p>=0&&p<u.length){const N=b(u[p]);L(N===C?"":N),V(!1)}break;case"Home":h.preventDefault(),h.stopPropagation(),T.current=!0,I(0);break;case"End":h.preventDefault(),h.stopPropagation(),T.current=!0,I(u.length-1);break}};return s.addEventListener("keydown",c,{capture:!0}),()=>s.removeEventListener("keydown",c,{capture:!0})},[u,p,C,L,V,b]);const _=t.useMemo(()=>{const s=new Map;return u.forEach((c,h)=>{s.set(b(c),h)}),s},[u,b]),W=t.useCallback(s=>{const c=_.get(s);c!==void 0&&I(c)},[_]),G=t.useCallback(s=>(_.get(s)??0)+1,[_]),U=u.length,K=t.useMemo(()=>({activeValue:A,onItemPointerMove:W,idPrefix:F,filteredCount:U,getItemPosition:G}),[A,W,F,U,G]),g=A!=null?`${F}item-${A}`:void 0;return t.useEffect(()=>(j(g),()=>j(void 0)),[g,j]),u.length===0?a.jsx("div",{ref:R,className:q.cn("scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",m),"data-hook":v,"data-slot":"combobox-virtual-list",role:"listbox",children:d}):a.jsx(X.Provider,{value:K,children:a.jsx("div",{ref:R,className:q.cn("scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",m),"data-hook":v,"data-slot":"combobox-virtual-list",role:"listbox",children:a.jsx("div",{className:"relative w-full",style:{height:`${P.getTotalSize()}px`},children:P.getVirtualItems().map(s=>a.jsx("div",{ref:P.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":s.index,style:{transform:`translateY(${s.start}px)`},children:l(u[s.index],s.index,y)},s.key))})})})}const he=t.forwardRef(ge),re=t.forwardRef((e,r)=>a.jsx($.CommandEmpty,{ref:r,"data-slot":"combobox-empty",...e}));re.displayName="ComboboxEmpty";const ne=t.forwardRef(({children:e,...r},n)=>{const o=t.useRef(null);return H.useDevWarning(()=>o.current?o.current.querySelectorAll('[data-slot="combobox-item"]').length>=100:!1,`ComboboxGroup contains 100+ items. Use <ComboboxVirtualList> for large datasets to avoid DOM bloat and slow renders.
|
|
4
4
|
Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox"`,[e]),a.jsx($.CommandGroup,{ref:i=>{o.current=i,typeof n=="function"?n(i):n&&(n.current=i)},"data-slot":"combobox-group",...r,children:e})});ne.displayName="ComboboxGroup";function ve(e,r,n){if(!r||!r.trim())return e;const o=new RegExp(`(${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),i=e.split(o);return a.jsx("span",{children:i.map((f,l)=>l%2===1?a.jsx("span",{className:n,children:f},l):a.jsx(t.Fragment,{children:f},l))})}const se=t.forwardRef(({value:e,label:r,dataHook:n,children:o,className:i,highlight:f,highlightClassName:l,keywords:d,onSelect:m,...v},E)=>{const{value:x,onValueChange:b,setOpen:S,registerItem:R,unregisterItem:C}=z(),L=t.useContext(X),V=x===e,w=t.useMemo(()=>r||(typeof o=="string"?o:typeof o=="number"?String(o):e),[r,o,e]),y=t.useRef(R),D=t.useRef(C);t.useEffect(()=>{y.current=R,D.current=C},[R,C]);const j=!!L;t.useEffect(()=>{if(!j)return y.current(e,w),()=>D.current(e)},[e,w,j]);const k=()=>{b(e===x?"":e),S(!1),m?.(e)},M=()=>f&&typeof o=="string"?ve(o,f,l||"text-label font-semibold"):o;if(L){const p=L.activeValue===e,I=!!v.disabled;return a.jsxs("div",{ref:E,"aria-disabled":I||void 0,"aria-posinset":L.getItemPosition(e),"aria-selected":V,"aria-setsize":L.filteredCount,className:q.cn("data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground text-label relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 outline-hidden select-none","[&_svg]:pointer-events-none [&_svg]:shrink-0",I&&"pointer-events-none opacity-50",i),"data-highlighted":p||void 0,"data-hook":n,"data-slot":"combobox-item",id:`${L.idPrefix}item-${e}`,role:"option",tabIndex:-1,onClick:I?void 0:k,onKeyDown:I?void 0:F=>{(F.key==="Enter"||F.key===" ")&&k()},onPointerMove:I?void 0:()=>L.onItemPointerMove(e),children:[M(),V&&a.jsx(Y.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})}return a.jsxs($.CommandItem,{ref:E,className:q.cn("justify-between",i),"data-slot":"combobox-item",dataHook:n,keywords:d?[w,...d]:[w],value:e,onSelect:k,...v,children:[M(),V&&a.jsx(Y.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});se.displayName="ComboboxItem";const ae=t.forwardRef((e,r)=>a.jsx($.CommandSeparator,{ref:r,"data-slot":"combobox-separator",...e}));ae.displayName="ComboboxSeparator";function Ce({className:e,children:r,loadingText:n}){return a.jsx("div",{"aria-live":"polite",className:q.cn("text-body-sm text-muted-foreground relative flex items-center justify-center gap-2 py-6","animate-entrance-fade flash-delay",e),"data-slot":"combobox-loading",role:"status",children:r||a.jsxs(a.Fragment,{children:[a.jsx(ue.Spinner,{size:"md"}),a.jsx("span",{className:"sr-only",children:n??"Loading suggestions"})]})})}exports.Combobox=fe;exports.ComboboxContent=xe;exports.ComboboxEmpty=re;exports.ComboboxGroup=ne;exports.ComboboxInput=te;exports.ComboboxItem=se;exports.ComboboxList=oe;exports.ComboboxLoading=Ce;exports.ComboboxSeparator=ae;exports.ComboboxTrigger=Z;exports.ComboboxValue=pe;exports.ComboboxVirtualList=he;
|
package/dist/combobox.js
CHANGED
|
@@ -129,7 +129,7 @@ const me = oe([
|
|
|
129
129
|
"bg-neutral-50 shadow-xs",
|
|
130
130
|
"dark:bg-white/5 dark:border-white/15",
|
|
131
131
|
// Typography
|
|
132
|
-
"text-
|
|
132
|
+
"text-field text-foreground",
|
|
133
133
|
// Placeholder state
|
|
134
134
|
"data-[placeholder=true]:text-muted-foreground",
|
|
135
135
|
// Focus state
|
|
@@ -235,7 +235,7 @@ function $e({
|
|
|
235
235
|
"span",
|
|
236
236
|
{
|
|
237
237
|
className: T(
|
|
238
|
-
"text-
|
|
238
|
+
"text-field overflow-hidden text-ellipsis whitespace-nowrap",
|
|
239
239
|
r
|
|
240
240
|
),
|
|
241
241
|
"data-slot": "combobox-value",
|
package/dist/command.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),Z=require("react"),w=require("cmdk"),ee=require("@tanstack/react-virtual"),_=require("@brightlocal/icons"),te=require("@brightlocal/ui-components/button"),N=require("@brightlocal/ui-components/lib/utils"),ae=require("@brightlocal/ui-components/lib/use-dev-warning");function oe(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(o,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return o.default=t,Object.freeze(o)}const e=oe(Z),A=e.createContext({searchValue:"",setSearchValue:()=>{},activeDescendantId:void 0,setActiveDescendantId:()=>{},listboxId:void 0,setListboxId:()=>{}}),G=e.forwardRef(({className:t,dataHook:o,trackingEl:a,trackingLabel:n,...r},l)=>{const[h,x]=e.useState(""),[y,R]=e.useState(void 0),[I,C]=e.useState(void 0),v=e.useMemo(()=>({searchValue:h,setSearchValue:x,activeDescendantId:y,setActiveDescendantId:R,listboxId:I,setListboxId:C}),[h,y,I]);return s.jsx(A.Provider,{value:v,children:s.jsx(w.Command,{ref:l,className:N.cn("bg-popover text-popover-foreground flex w-full flex-col overflow-hidden rounded-lg border shadow-md",t),"data-hook":o,"data-slot":"command","data-tracking-el":a,"data-tracking-label":n,...r})})});G.displayName="Command";const H=e.forwardRef(({className:t,dataHook:o,trackingEl:a,trackingLabel:n,value:r,onValueChange:l,onClear:h,debounceMs:x,clearSearchAriaLabel:y,...R},I)=>{const C=e.useRef(null),[v,b]=e.useState(""),d=e.useRef(void 0),{setSearchValue:j,activeDescendantId:g,listboxId:u}=e.useContext(A);e.useImperativeHandle(I,()=>C.current,[]),ae.useDevWarning(()=>!!(x&&x>0&&r!==void 0),"debounceMs is set on <CommandInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",[x,r]),e.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),e.useEffect(()=>{const f=C.current;f&&(u&&f.setAttribute("aria-controls",u),g?f.setAttribute("aria-activedescendant",g):f.removeAttribute("aria-activedescendant"))});const S=r!==void 0,E=S?r:v,L=String(E).length>0,V=f=>{S||b(f),j(f),x&&x>0?(clearTimeout(d.current),d.current=setTimeout(()=>{l?.(f)},x)):l?.(f)},m=()=>{S||b(""),j(""),clearTimeout(d.current),l?.(""),h?.(),C.current?.focus()};return s.jsxs("div",{className:"border-base-border flex h-12 items-center gap-2 self-stretch border-b px-3","data-hook":o,"data-slot":"command-input-wrapper",children:[s.jsx(_.Search,{className:"shrink-0 opacity-50"}),s.jsx(w.Command.Input,{ref:C,className:N.cn("placeholder:text-muted-foreground text-body flex w-full bg-transparent outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),"data-slot":"command-input","data-tracking-el":a,"data-tracking-label":n,value:E,onValueChange:V,...R}),L&&s.jsx(te.Button,{"aria-label":y??"Clear search",className:"text-muted-foreground hover:text-foreground size-6 p-0",dataHook:"command-input-clear",variant:"ghost",onClick:m,children:s.jsx(_.X,{})})]})});H.displayName="CommandInput";const B=e.forwardRef(({className:t,dataHook:o,...a},n)=>s.jsx(w.Command.List,{ref:n,className:N.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),"data-hook":o,"data-slot":"command-list",...a}));B.displayName="CommandList";const F=e.forwardRef(({dataHook:t,...o},a)=>{const n=e.useCallback(r=>{r?.setAttribute("role","option"),typeof a=="function"?a(r):a&&(a.current=r)},[a]);return s.jsx(w.Command.Empty,{ref:n,"aria-disabled":"true","aria-selected":"false",className:"text-body-sm py-6 text-center","data-hook":t,"data-slot":"command-empty",...o})});F.displayName="CommandEmpty";const W=e.forwardRef(({className:t,dataHook:o,...a},n)=>s.jsx(w.Command.Group,{ref:n,className:N.cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-label-sm overflow-hidden px-2 py-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",t),"data-hook":o,"data-slot":"command-group",...a}));W.displayName="CommandGroup";const K=e.forwardRef(({className:t,dataHook:o,...a},n)=>s.jsx(w.Command.Separator,{ref:n,className:N.cn("bg-border -mx-1 h-px",t),"data-hook":o,"data-slot":"command-separator",...a}));K.displayName="CommandSeparator";const U=e.forwardRef(({className:t,dataHook:o,trackingEl:a,trackingLabel:n,selected:r,children:l,...h},x)=>s.jsxs(w.Command.Item,{ref:x,className:N.cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",t),"data-hook":o,"data-selected-item":r||void 0,"data-slot":"command-item","data-tracking-el":a,"data-tracking-label":n,...h,children:[l,r&&s.jsx(_.Check,{className:"text-foreground ml-auto"})]}));U.displayName="CommandItem";const X=e.forwardRef(({className:t,dataHook:o,trackingEl:a,trackingLabel:n,...r},l)=>s.jsx("span",{ref:l,className:N.cn("text-muted-foreground text-body-xs ml-auto",t),"data-hook":o,"data-slot":"command-shortcut","data-tracking-el":a,"data-tracking-label":n,...r}));X.displayName="CommandShortcut";const Y=e.createContext(null);function ne({items:t,getItemValue:o,getItemLabel:a,getItemKeywords:n,estimateSize:r=44,overscan:l=5,children:h,renderEmpty:x,"aria-label":y,className:R,dataHook:I},C){const v=e.useRef(null),{searchValue:b,setActiveDescendantId:d,setListboxId:j}=e.useContext(A),[g,u]=e.useState(0),S=e.useId(),E=e.useId(),L=e.useRef(new Map);e.useImperativeHandle(C,()=>v.current,[]);const V=e.useMemo(()=>a??o,[a,o]),m=e.useMemo(()=>{if(!b.trim())return t;const c=[];for(const p of t){let i=w.defaultFilter(V(p),b);if(n)for(const k of n(p))i=Math.max(i,w.defaultFilter(k,b));i>0&&c.push({item:p,score:i})}return c.sort((p,i)=>i.score-p.score),c.map(p=>p.item)},[t,b,V,n]),f=ee.useVirtualizer({count:m.length,getScrollElement:()=>v.current,estimateSize:()=>r,overscan:l}),D=g>=0&&g<m.length?o(m[g]):null;e.useEffect(()=>{u(0)},[b,m.length]);const P=e.useRef(!1);e.useEffect(()=>{P.current&&g>=0&&g<m.length&&f.scrollToIndex(g,{align:"auto"}),P.current=!1},[g,m.length,f]),e.useEffect(()=>{const c=v.current?.closest('[data-slot="command"]');if(!c)return;const p=i=>{switch(i.key){case"ArrowDown":i.preventDefault(),i.stopPropagation(),P.current=!0,u(k=>k<m.length-1?k+1:k);break;case"ArrowUp":i.preventDefault(),i.stopPropagation(),P.current=!0,u(k=>k>0?k-1:k);break;case"Enter":{i.preventDefault(),i.stopPropagation(),D!=null&&L.current.get(D)?.();break}case"Home":i.preventDefault(),i.stopPropagation(),P.current=!0,u(0);break;case"End":i.preventDefault(),i.stopPropagation(),P.current=!0,u(m.length-1);break}};return c.addEventListener("keydown",p,{capture:!0}),()=>c.removeEventListener("keydown",p,{capture:!0})},[m,D]);const M=e.useMemo(()=>{const c=new Map;return m.forEach((p,i)=>{c.set(o(p),i)}),c},[m,o]),T=e.useCallback(c=>{const p=M.get(c);p!==void 0&&u(p)},[M]),q=e.useCallback(c=>(M.get(c)??0)+1,[M]),z=m.length,Q=e.useMemo(()=>({activeValue:D,onItemPointerMove:T,idPrefix:S,filteredCount:z,getItemPosition:q,onSelectCallbacks:L}),[D,T,S,z,q]),O=D!=null?`${S}item-${D}`:void 0;e.useEffect(()=>(d(O),()=>d(void 0)),[O,d]),e.useEffect(()=>(j(E),()=>j(void 0)),[E,j]);const $=N.cn("scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",R);return m.length===0?s.jsx("div",{ref:v,"aria-label":y,className:$,"data-hook":I,"data-slot":"command-virtual-list",id:E,role:"listbox",tabIndex:-1,children:x}):s.jsx(Y.Provider,{value:Q,children:s.jsx("div",{ref:v,"aria-label":y,className:$,"data-hook":I,"data-slot":"command-virtual-list",id:E,role:"listbox",tabIndex:-1,children:s.jsx("div",{className:"relative w-full",style:{height:`${f.getTotalSize()}px`},children:f.getVirtualItems().map(c=>s.jsx("div",{ref:f.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":c.index,style:{transform:`translateY(${c.start}px)`},children:h(m[c.index],c.index,b)},c.key))})})})}const re=e.forwardRef(ne),J=e.forwardRef(({value:t,dataHook:o,trackingEl:a,trackingLabel:n,selected:r,disabled:l,onSelect:h,children:x,className:y,onClick:R,onKeyDown:I,onPointerMove:C,...v},b)=>{const d=e.useContext(Y),j=d?.activeValue===t,g=e.useRef(h);return e.useEffect(()=>{g.current=h}),e.useEffect(()=>{if(d)return d.onSelectCallbacks.current.set(t,()=>g.current?.()),()=>{d.onSelectCallbacks.current.delete(t)}},[t,d]),s.jsxs("div",{ref:b,...v,"aria-disabled":l||void 0,"aria-posinset":d?.getItemPosition(t),"aria-selected":r||void 0,"aria-setsize":d?.filteredCount,className:N.cn("data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 outline-hidden select-none","[&_svg]:pointer-events-none [&_svg]:shrink-0",l&&"pointer-events-none opacity-50",y),"data-highlighted":j||void 0,"data-hook":o,"data-selected-item":r||void 0,"data-slot":"command-virtual-item","data-tracking-el":a,"data-tracking-label":n,id:d?`${d.idPrefix}item-${t}`:void 0,role:"option",tabIndex:-1,onClick:l?void 0:u=>{h?.(),R?.(u)},onKeyDown:l?void 0:u=>{(u.key==="Enter"||u.key===" ")&&h?.(),I?.(u)},onPointerMove:l?void 0:u=>{d?.onItemPointerMove(t),C?.(u)},children:[x,r&&s.jsx(_.Check,{className:"text-foreground ml-auto"})]})});J.displayName="CommandVirtualItem";exports.Command=G;exports.CommandEmpty=F;exports.CommandGroup=W;exports.CommandInput=H;exports.CommandItem=U;exports.CommandList=B;exports.CommandSeparator=K;exports.CommandShortcut=X;exports.CommandVirtualItem=J;exports.CommandVirtualList=re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),Z=require("react"),N=require("cmdk"),ee=require("@tanstack/react-virtual"),_=require("@brightlocal/icons"),te=require("@brightlocal/ui-components/button"),y=require("@brightlocal/ui-components/lib/utils"),ae=require("@brightlocal/ui-components/lib/use-dev-warning"),oe=require("./lib/empty-chip.cjs");function ne(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(a,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return a.default=t,Object.freeze(a)}const e=ne(Z),A=e.createContext({searchValue:"",setSearchValue:()=>{},activeDescendantId:void 0,setActiveDescendantId:()=>{},listboxId:void 0,setListboxId:()=>{}}),G=e.forwardRef(({className:t,dataHook:a,trackingEl:o,trackingLabel:n,...i},s)=>{const[p,u]=e.useState(""),[I,S]=e.useState(void 0),[w,b]=e.useState(void 0),v=e.useMemo(()=>({searchValue:p,setSearchValue:u,activeDescendantId:I,setActiveDescendantId:S,listboxId:w,setListboxId:b}),[p,I,w]);return r.jsx(A.Provider,{value:v,children:r.jsx(N.Command,{ref:s,className:y.cn("bg-popover text-popover-foreground flex w-full flex-col overflow-hidden rounded-lg border shadow-md",t),"data-hook":a,"data-slot":"command","data-tracking-el":o,"data-tracking-label":n,...i})})});G.displayName="Command";const H=e.forwardRef(({className:t,dataHook:a,trackingEl:o,trackingLabel:n,value:i,onValueChange:s,onClear:p,debounceMs:u,clearSearchAriaLabel:I,...S},w)=>{const b=e.useRef(null),[v,C]=e.useState(""),d=e.useRef(void 0),{setSearchValue:j,activeDescendantId:g,listboxId:m}=e.useContext(A);e.useImperativeHandle(w,()=>b.current,[]),ae.useDevWarning(()=>!!(u&&u>0&&i!==void 0),"debounceMs is set on <CommandInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",[u,i]),e.useEffect(()=>()=>{d.current&&clearTimeout(d.current)},[]),e.useEffect(()=>{const x=b.current;x&&(m&&x.setAttribute("aria-controls",m),g?x.setAttribute("aria-activedescendant",g):x.removeAttribute("aria-activedescendant"))});const R=i!==void 0,E=R?i:v,L=String(E).length>0,V=x=>{R||C(x),j(x),u&&u>0?(clearTimeout(d.current),d.current=setTimeout(()=>{s?.(x)},u)):s?.(x)},f=()=>{R||C(""),j(""),clearTimeout(d.current),s?.(""),p?.(),b.current?.focus()};return r.jsxs("div",{className:"border-base-border flex h-12 items-center gap-2 self-stretch border-b px-3","data-hook":a,"data-slot":"command-input-wrapper",children:[r.jsx(_.Search,{className:"shrink-0 opacity-50"}),r.jsx(N.Command.Input,{ref:b,className:y.cn("placeholder:text-muted-foreground text-field flex w-full bg-transparent outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),"data-slot":"command-input","data-tracking-el":o,"data-tracking-label":n,value:E,onValueChange:V,...S}),L&&r.jsx(te.Button,{"aria-label":I??"Clear search",className:"text-muted-foreground hover:text-foreground size-6 p-0",dataHook:"command-input-clear",variant:"ghost",onClick:f,children:r.jsx(_.X,{})})]})});H.displayName="CommandInput";const B=e.forwardRef(({className:t,dataHook:a,...o},n)=>r.jsx(N.Command.List,{ref:n,className:y.cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),"data-hook":a,"data-slot":"command-list",...o}));B.displayName="CommandList";const F=e.forwardRef(({children:t,dataHook:a,description:o,icon:n,...i},s)=>{const p=e.useCallback(u=>{u?.setAttribute("role","option"),typeof s=="function"?s(u):s&&(s.current=u)},[s]);return r.jsx(N.Command.Empty,{ref:p,"aria-disabled":"true","aria-selected":"false",className:"text-body-sm py-6 text-center","data-hook":a,"data-slot":"command-empty",...i,children:n||o?r.jsxs("div",{className:"flex flex-col items-center gap-1 px-4",children:[n?r.jsx("span",{"aria-hidden":"true",className:y.cn(oe.emptyChipStyles(),"mb-1"),"data-slot":"command-empty-icon",children:n}):null,r.jsx("p",{"data-slot":"command-empty-message",children:t}),o?r.jsx("p",{className:"text-muted-foreground","data-slot":"command-empty-description",children:o}):null]}):t})});F.displayName="CommandEmpty";const W=e.forwardRef(({className:t,dataHook:a,...o},n)=>r.jsx(N.Command.Group,{ref:n,className:y.cn("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-label-sm overflow-hidden px-2 py-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5",t),"data-hook":a,"data-slot":"command-group",...o}));W.displayName="CommandGroup";const K=e.forwardRef(({className:t,dataHook:a,...o},n)=>r.jsx(N.Command.Separator,{ref:n,className:y.cn("bg-border -mx-1 h-px",t),"data-hook":a,"data-slot":"command-separator",...o}));K.displayName="CommandSeparator";const U=e.forwardRef(({className:t,dataHook:a,trackingEl:o,trackingLabel:n,selected:i,children:s,...p},u)=>r.jsxs(N.Command.Item,{ref:u,className:y.cn("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:text-muted-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",t),"data-hook":a,"data-selected-item":i||void 0,"data-slot":"command-item","data-tracking-el":o,"data-tracking-label":n,...p,children:[s,i&&r.jsx(_.Check,{className:"text-foreground ml-auto"})]}));U.displayName="CommandItem";const X=e.forwardRef(({className:t,dataHook:a,trackingEl:o,trackingLabel:n,...i},s)=>r.jsx("span",{ref:s,className:y.cn("text-muted-foreground text-body-xs ml-auto",t),"data-hook":a,"data-slot":"command-shortcut","data-tracking-el":o,"data-tracking-label":n,...i}));X.displayName="CommandShortcut";const Y=e.createContext(null);function re({items:t,getItemValue:a,getItemLabel:o,getItemKeywords:n,estimateSize:i=44,overscan:s=5,children:p,renderEmpty:u,"aria-label":I,className:S,dataHook:w},b){const v=e.useRef(null),{searchValue:C,setActiveDescendantId:d,setListboxId:j}=e.useContext(A),[g,m]=e.useState(0),R=e.useId(),E=e.useId(),L=e.useRef(new Map);e.useImperativeHandle(b,()=>v.current,[]);const V=e.useMemo(()=>o??a,[o,a]),f=e.useMemo(()=>{if(!C.trim())return t;const c=[];for(const h of t){let l=N.defaultFilter(V(h),C);if(n)for(const k of n(h))l=Math.max(l,N.defaultFilter(k,C));l>0&&c.push({item:h,score:l})}return c.sort((h,l)=>l.score-h.score),c.map(h=>h.item)},[t,C,V,n]),x=ee.useVirtualizer({count:f.length,getScrollElement:()=>v.current,estimateSize:()=>i,overscan:s}),D=g>=0&&g<f.length?a(f[g]):null;e.useEffect(()=>{m(0)},[C,f.length]);const P=e.useRef(!1);e.useEffect(()=>{P.current&&g>=0&&g<f.length&&x.scrollToIndex(g,{align:"auto"}),P.current=!1},[g,f.length,x]),e.useEffect(()=>{const c=v.current?.closest('[data-slot="command"]');if(!c)return;const h=l=>{switch(l.key){case"ArrowDown":l.preventDefault(),l.stopPropagation(),P.current=!0,m(k=>k<f.length-1?k+1:k);break;case"ArrowUp":l.preventDefault(),l.stopPropagation(),P.current=!0,m(k=>k>0?k-1:k);break;case"Enter":{l.preventDefault(),l.stopPropagation(),D!=null&&L.current.get(D)?.();break}case"Home":l.preventDefault(),l.stopPropagation(),P.current=!0,m(0);break;case"End":l.preventDefault(),l.stopPropagation(),P.current=!0,m(f.length-1);break}};return c.addEventListener("keydown",h,{capture:!0}),()=>c.removeEventListener("keydown",h,{capture:!0})},[f,D]);const M=e.useMemo(()=>{const c=new Map;return f.forEach((h,l)=>{c.set(a(h),l)}),c},[f,a]),q=e.useCallback(c=>{const h=M.get(c);h!==void 0&&m(h)},[M]),T=e.useCallback(c=>(M.get(c)??0)+1,[M]),z=f.length,Q=e.useMemo(()=>({activeValue:D,onItemPointerMove:q,idPrefix:R,filteredCount:z,getItemPosition:T,onSelectCallbacks:L}),[D,q,R,z,T]),O=D!=null?`${R}item-${D}`:void 0;e.useEffect(()=>(d(O),()=>d(void 0)),[O,d]),e.useEffect(()=>(j(E),()=>j(void 0)),[E,j]);const $=y.cn("scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",S);return f.length===0?r.jsx("div",{ref:v,"aria-label":I,className:$,"data-hook":w,"data-slot":"command-virtual-list",id:E,role:"listbox",tabIndex:-1,children:u}):r.jsx(Y.Provider,{value:Q,children:r.jsx("div",{ref:v,"aria-label":I,className:$,"data-hook":w,"data-slot":"command-virtual-list",id:E,role:"listbox",tabIndex:-1,children:r.jsx("div",{className:"relative w-full",style:{height:`${x.getTotalSize()}px`},children:x.getVirtualItems().map(c=>r.jsx("div",{ref:x.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":c.index,style:{transform:`translateY(${c.start}px)`},children:p(f[c.index],c.index,C)},c.key))})})})}const se=e.forwardRef(re),J=e.forwardRef(({value:t,dataHook:a,trackingEl:o,trackingLabel:n,selected:i,disabled:s,onSelect:p,children:u,className:I,onClick:S,onKeyDown:w,onPointerMove:b,...v},C)=>{const d=e.useContext(Y),j=d?.activeValue===t,g=e.useRef(p);return e.useEffect(()=>{g.current=p}),e.useEffect(()=>{if(d)return d.onSelectCallbacks.current.set(t,()=>g.current?.()),()=>{d.onSelectCallbacks.current.delete(t)}},[t,d]),r.jsxs("div",{ref:C,...v,"aria-disabled":s||void 0,"aria-posinset":d?.getItemPosition(t),"aria-selected":i||void 0,"aria-setsize":d?.filteredCount,className:y.cn("data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground text-label relative flex cursor-default items-center gap-2 rounded-sm px-2 py-3 outline-hidden select-none","[&_svg]:pointer-events-none [&_svg]:shrink-0",s&&"pointer-events-none opacity-50",I),"data-highlighted":j||void 0,"data-hook":a,"data-selected-item":i||void 0,"data-slot":"command-virtual-item","data-tracking-el":o,"data-tracking-label":n,id:d?`${d.idPrefix}item-${t}`:void 0,role:"option",tabIndex:-1,onClick:s?void 0:m=>{p?.(),S?.(m)},onKeyDown:s?void 0:m=>{(m.key==="Enter"||m.key===" ")&&p?.(),w?.(m)},onPointerMove:s?void 0:m=>{d?.onItemPointerMove(t),b?.(m)},children:[u,i&&r.jsx(_.Check,{className:"text-foreground ml-auto"})]})});J.displayName="CommandVirtualItem";exports.Command=G;exports.CommandEmpty=F;exports.CommandGroup=W;exports.CommandInput=H;exports.CommandItem=U;exports.CommandList=B;exports.CommandSeparator=K;exports.CommandShortcut=X;exports.CommandVirtualItem=J;exports.CommandVirtualList=se;
|
package/dist/command.d.ts
CHANGED
|
@@ -81,9 +81,31 @@ export interface CommandEmptyProps extends React.ComponentProps<typeof CommandPr
|
|
|
81
81
|
* Data hook for automated testing
|
|
82
82
|
*/
|
|
83
83
|
dataHook?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Icon shown in the muted chip above the message — the same chip as
|
|
86
|
+
* EmptyState, so the popover form matches the card and page forms
|
|
87
|
+
* (Patterns/Empty States). Decorative; the message carries the state.
|
|
88
|
+
*/
|
|
89
|
+
icon?: React.ReactNode;
|
|
90
|
+
/**
|
|
91
|
+
* One quiet muted line under the message, e.g. "Try a different search."
|
|
92
|
+
*/
|
|
93
|
+
description?: React.ReactNode;
|
|
84
94
|
}
|
|
85
95
|
/**
|
|
86
|
-
* Empty state displayed when no results are found.
|
|
96
|
+
* Empty state displayed when no results are found. Plain `children` render
|
|
97
|
+
* the one-line form; pass `icon` and/or `description` for the compact form
|
|
98
|
+
* the Empty States pattern uses at popover scope — never hand-roll it.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* <CommandEmpty
|
|
103
|
+
* description="Try a different search."
|
|
104
|
+
* icon={<SearchX />}
|
|
105
|
+
* >
|
|
106
|
+
* No locations match “{search}”
|
|
107
|
+
* </CommandEmpty>
|
|
108
|
+
* ```
|
|
87
109
|
*/
|
|
88
110
|
declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<CommandEmptyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
89
111
|
/**
|
package/dist/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAuCnD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,cAAc,CACxD,OAAO,gBAAgB,CACxB;IACC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,OAAO,kGAuCX,CAAC;AAOH;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAC7D,OAAO,gBAAgB,CAAC,KAAK,CAC9B;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,QAAA,MAAM,YAAY,yGA+HjB,CAAC;AAOF;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,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