@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/scroll-area.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
3
|
import * as l from "@radix-ui/react-scroll-area";
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
4
|
+
import { cn as b } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
const u = d.forwardRef(
|
|
6
6
|
({
|
|
7
|
-
className:
|
|
7
|
+
className: e,
|
|
8
8
|
children: a,
|
|
9
|
-
dataHook:
|
|
10
|
-
trackingEl:
|
|
11
|
-
trackingLabel:
|
|
12
|
-
scrollOrientation:
|
|
13
|
-
...
|
|
14
|
-
},
|
|
9
|
+
dataHook: t,
|
|
10
|
+
trackingEl: s,
|
|
11
|
+
trackingLabel: c,
|
|
12
|
+
scrollOrientation: i = "vertical",
|
|
13
|
+
...n
|
|
14
|
+
}, f) => /* @__PURE__ */ m(
|
|
15
15
|
l.Root,
|
|
16
16
|
{
|
|
17
|
-
ref:
|
|
18
|
-
className:
|
|
19
|
-
"data-hook":
|
|
17
|
+
ref: f,
|
|
18
|
+
className: b("relative", e),
|
|
19
|
+
"data-hook": t,
|
|
20
20
|
"data-slot": "scroll-area",
|
|
21
|
-
"data-tracking-el":
|
|
22
|
-
"data-tracking-label":
|
|
23
|
-
...
|
|
21
|
+
"data-tracking-el": s,
|
|
22
|
+
"data-tracking-label": c,
|
|
23
|
+
...n,
|
|
24
24
|
children: [
|
|
25
25
|
/* @__PURE__ */ r(
|
|
26
26
|
l.Viewport,
|
|
@@ -31,38 +31,38 @@ const b = d.forwardRef(
|
|
|
31
31
|
children: a
|
|
32
32
|
}
|
|
33
33
|
),
|
|
34
|
-
/* @__PURE__ */ r(
|
|
35
|
-
|
|
34
|
+
/* @__PURE__ */ r(o, {}),
|
|
35
|
+
i === "both" && /* @__PURE__ */ r(o, { orientation: "horizontal" }),
|
|
36
36
|
/* @__PURE__ */ r(l.Corner, {})
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
39
|
)
|
|
40
40
|
);
|
|
41
|
-
|
|
42
|
-
const
|
|
41
|
+
u.displayName = "ScrollArea";
|
|
42
|
+
const o = d.forwardRef(
|
|
43
43
|
({
|
|
44
|
-
className:
|
|
44
|
+
className: e,
|
|
45
45
|
orientation: a = "vertical",
|
|
46
|
-
dataHook:
|
|
47
|
-
trackingEl:
|
|
48
|
-
trackingLabel:
|
|
49
|
-
...
|
|
50
|
-
},
|
|
46
|
+
dataHook: t,
|
|
47
|
+
trackingEl: s,
|
|
48
|
+
trackingLabel: c,
|
|
49
|
+
...i
|
|
50
|
+
}, n) => /* @__PURE__ */ r(
|
|
51
51
|
l.ScrollAreaScrollbar,
|
|
52
52
|
{
|
|
53
|
-
ref:
|
|
54
|
-
className:
|
|
53
|
+
ref: n,
|
|
54
|
+
className: b(
|
|
55
55
|
"duration-fast flex touch-none p-px transition-colors ease-out select-none",
|
|
56
56
|
a === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
57
57
|
a === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
58
|
-
|
|
58
|
+
e
|
|
59
59
|
),
|
|
60
|
-
"data-hook":
|
|
60
|
+
"data-hook": t,
|
|
61
61
|
"data-slot": "scroll-area-scrollbar",
|
|
62
|
-
"data-tracking-el":
|
|
63
|
-
"data-tracking-label":
|
|
62
|
+
"data-tracking-el": s,
|
|
63
|
+
"data-tracking-label": c,
|
|
64
64
|
orientation: a,
|
|
65
|
-
...
|
|
65
|
+
...i,
|
|
66
66
|
children: /* @__PURE__ */ r(
|
|
67
67
|
l.ScrollAreaThumb,
|
|
68
68
|
{
|
|
@@ -73,8 +73,10 @@ const n = d.forwardRef(
|
|
|
73
73
|
}
|
|
74
74
|
)
|
|
75
75
|
);
|
|
76
|
-
|
|
76
|
+
o.displayName = "ScrollAreaScrollbar";
|
|
77
|
+
const S = o;
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
u as ScrollArea,
|
|
80
|
+
o as ScrollAreaScrollbar,
|
|
81
|
+
S as ScrollBar
|
|
80
82
|
};
|
package/dist/select.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,[
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("react"),R=require("@radix-ui/react-select"),v=require("@brightlocal/icons"),_=require("class-variance-authority"),s=require("@brightlocal/ui-components/lib/utils"),D=require("./lib/use-dev-warning.cjs"),B=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock");function y(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const p=y(T),n=y(R);function j({children:t,onClose:r,onOpenChange:a,open:o,defaultOpen:c,...f}){const[i,l]=p.useState(c??!1),u=o!==void 0,d=u?o:i,x=p.useCallback(g=>{u||l(g),a?.(g)},[u,a]),m=p.useRef(r);p.useEffect(()=>{m.current=r},[r]);const b=p.useRef(d);return p.useEffect(()=>{b.current&&!d&&m.current?.(),b.current=d},[d]),p.useEffect(()=>()=>{b.current&&m.current?.()},[]),e.jsx(n.Root,{"data-slot":"select",defaultOpen:c,open:o,onOpenChange:x,...f,children:t})}j.displayName="Select";function w(t){return e.jsx(n.Group,{"data-slot":"select-group",...t})}w.displayName="SelectGroup";function N(t){return e.jsx(n.Value,{"data-slot":"select-value",...t})}N.displayName="SelectValue";const L=_.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-field text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]: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","[&_svg]:pointer-events-none [&_svg]:shrink-0"]);function k({className:t,children:r,placeholder:a,dataHook:o,error:c,selectLabel:f,reserveValues:i,...l}){const u=c||l["aria-invalid"]===!0||l["aria-invalid"]==="true",d=l["aria-required"]===!0||l["aria-required"]==="true",x=l["aria-label"]||f||a||"Select an option",m=u?"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":"";return e.jsxs(n.Trigger,{...l,"aria-invalid":u?"true":void 0,"aria-label":x,"aria-required":d?"true":void 0,className:s.cn(L(),m,t),"data-hook":o,"data-slot":"select-trigger",children:[i?.length?e.jsxs("span",{className:"!grid min-w-0 text-left","data-slot":"select-reserve",children:[i.map((b,g)=>e.jsx("span",{"aria-hidden":"true",className:"invisible col-start-1 row-start-1 truncate",children:b},g)),e.jsx("span",{className:"col-start-1 row-start-1 truncate",children:r})]}):r,e.jsx(n.Icon,{asChild:!0,children:e.jsx(v.ChevronDown,{className:"text-muted-foreground"})})]})}k.displayName="SelectTrigger";function C({className:t,children:r,position:a="popper",maxHeight:o,style:c,...f}){B.useOverlayPointerLock();const i=p.useRef(null);D.useDevWarning(()=>i.current?i.current.querySelectorAll('[data-slot="select-item"]').length>=100:!1,`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
|
|
2
|
+
Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,[r]);const l=s.cn("relative z-50 overflow-hidden","min-w-[8rem]","rounded-md border border-border bg-popover shadow-md","text-popover-foreground","max-h-[var(--radix-select-content-available-height)]","origin-[var(--radix-select-content-transform-origin)]",s.FLOATING_CONTENT_ANIMATION),u=a==="popper"&&s.cn("data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1"),d=o!==void 0?{...c,maxHeight:`min(${o}px, var(--radix-select-content-available-height))`}:c;return e.jsx(n.Portal,{children:e.jsxs(n.Content,{className:s.cn(l,u,t),"data-slot":"select-content",position:a,style:d,...f,children:[e.jsx(S,{}),e.jsx(n.Viewport,{ref:i,className:s.cn("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),e.jsx(h,{})]})})}C.displayName="SelectContent";function O({className:t,...r}){return e.jsx(n.Label,{className:s.cn("text-muted-foreground text-label-sm px-2 py-1.5",t),"data-slot":"select-label",...r})}O.displayName="SelectLabel";function q({className:t,children:r,hint:a,...o}){const c=s.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-label text-popover-foreground","focus:bg-accent focus:text-accent-foreground","hover:bg-accent/50 hover:text-accent-foreground","outline-none focus:outline-none","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0");return e.jsxs(n.Item,{className:s.cn(c,t),"data-slot":"select-item",...o,children:[e.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:e.jsx(n.ItemIndicator,{children:e.jsx(v.Check,{})})}),e.jsx(n.ItemText,{children:r}),a!=null&&e.jsx("span",{className:"text-label-sm text-muted-foreground ml-auto","data-slot":"select-item-hint",children:a})]})}q.displayName="SelectItem";function I({className:t,...r}){return e.jsx(n.Separator,{className:s.cn("bg-border pointer-events-none -mx-1 my-1 h-px",t),"data-slot":"select-separator",...r})}I.displayName="SelectSeparator";function S({className:t,...r}){return e.jsx(n.ScrollUpButton,{className:s.cn("flex cursor-default items-center justify-center py-1",t),"data-slot":"select-scroll-up-button",...r,children:e.jsx(v.ChevronUp,{})})}S.displayName="SelectScrollUpButton";function h({className:t,...r}){return e.jsx(n.ScrollDownButton,{className:s.cn("flex cursor-default items-center justify-center py-1",t),"data-slot":"select-scroll-down-button",...r,children:e.jsx(v.ChevronDown,{})})}h.displayName="SelectScrollDownButton";exports.Select=j;exports.SelectContent=C;exports.SelectGroup=w;exports.SelectItem=q;exports.SelectLabel=O;exports.SelectScrollDownButton=h;exports.SelectScrollUpButton=S;exports.SelectSeparator=I;exports.SelectTrigger=k;exports.SelectValue=N;
|
package/dist/select.d.ts
CHANGED
|
@@ -78,11 +78,21 @@ interface SelectTriggerProps extends React.ComponentProps<typeof SelectPrimitive
|
|
|
78
78
|
* @default "Select an option"
|
|
79
79
|
*/
|
|
80
80
|
selectLabel?: string;
|
|
81
|
+
/**
|
|
82
|
+
* The visible labels this select can show, rendered invisibly inside the
|
|
83
|
+
* trigger so it always reserves the width of the widest one. Keeps the
|
|
84
|
+
* trigger — and the row around it, e.g. a CardToolbar filter row — from
|
|
85
|
+
* resizing and reflowing when the selection changes (DS-989). Include the
|
|
86
|
+
* placeholder if it can be the longest. For long option lists pass just a
|
|
87
|
+
* handful of the longest labels — every entry renders a hidden span.
|
|
88
|
+
* @example <SelectTrigger reserveValues={["All ratings", "4 stars and up"]}>
|
|
89
|
+
*/
|
|
90
|
+
reserveValues?: React.ReactNode[];
|
|
81
91
|
}
|
|
82
92
|
/**
|
|
83
93
|
* SelectTrigger - The button that opens the select dropdown
|
|
84
94
|
*/
|
|
85
|
-
declare function SelectTrigger({ className, children, placeholder, dataHook, error, selectLabel, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
declare function SelectTrigger({ className, children, placeholder, dataHook, error, selectLabel, reserveValues, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
86
96
|
declare namespace SelectTrigger {
|
|
87
97
|
var displayName: string;
|
|
88
98
|
}
|
|
@@ -113,7 +123,18 @@ declare namespace SelectLabel {
|
|
|
113
123
|
* </div>
|
|
114
124
|
* </SelectItem>
|
|
115
125
|
*/
|
|
116
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Props for the SelectItem component.
|
|
128
|
+
*/
|
|
129
|
+
interface SelectItemProps extends React.ComponentProps<typeof SelectPrimitive.Item> {
|
|
130
|
+
/**
|
|
131
|
+
* Secondary hint rendered after the item label (e.g. "Latest").
|
|
132
|
+
* Rendered outside the item's text value, so it shows in the open list
|
|
133
|
+
* but never leaks into the trigger's selected-value rendering.
|
|
134
|
+
*/
|
|
135
|
+
hint?: React.ReactNode;
|
|
136
|
+
}
|
|
137
|
+
declare function SelectItem({ className, children, hint, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
117
138
|
declare namespace SelectItem {
|
|
118
139
|
var displayName: string;
|
|
119
140
|
}
|
|
@@ -139,5 +160,5 @@ declare namespace SelectScrollDownButton {
|
|
|
139
160
|
var displayName: string;
|
|
140
161
|
}
|
|
141
162
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
|
|
142
|
-
export type { SelectContentProps, SelectProps, SelectTriggerProps };
|
|
163
|
+
export type { SelectContentProps, SelectItemProps, SelectProps, SelectTriggerProps, };
|
|
143
164
|
//# sourceMappingURL=select.d.ts.map
|
package/dist/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAe1D,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAChD,OAAO,eAAe,CAAC,IAAI,CAC5B;IACC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,MAAM,CAAC,EACd,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,IAAI,EAAE,QAAQ,EACd,WAAW,EACX,GAAG,KAAK,EACT,EAAE,WAAW,2CAgEb;kBAvEQ,MAAM;;;AA2Ef;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAG1D;kBAJQ,WAAW;;;AAQpB;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAG1D;kBAJQ,WAAW;;;AA8CpB,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"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"}
|
package/dist/select.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { Check as N, ChevronDown as
|
|
1
|
+
import { jsx as e, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import * as a from "@radix-ui/react-select";
|
|
4
|
+
import { Check as N, ChevronDown as x, ChevronUp as w } from "@brightlocal/icons";
|
|
5
5
|
import { cva as k } from "class-variance-authority";
|
|
6
6
|
import { cn as n, FLOATING_CONTENT_ANIMATION as C } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
import { useDevWarning as I } from "./lib/use-dev-warning.js";
|
|
8
8
|
import { useOverlayPointerLock as R } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
|
|
9
9
|
function T({
|
|
10
|
-
children:
|
|
10
|
+
children: t,
|
|
11
11
|
onClose: r,
|
|
12
|
-
onOpenChange:
|
|
13
|
-
open:
|
|
14
|
-
defaultOpen:
|
|
15
|
-
...
|
|
12
|
+
onOpenChange: o,
|
|
13
|
+
open: l,
|
|
14
|
+
defaultOpen: i,
|
|
15
|
+
...p
|
|
16
16
|
}) {
|
|
17
|
-
const [
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
(
|
|
21
|
-
|
|
17
|
+
const [c, s] = m.useState(
|
|
18
|
+
i ?? !1
|
|
19
|
+
), d = l !== void 0, u = d ? l : c, h = m.useCallback(
|
|
20
|
+
(g) => {
|
|
21
|
+
d || s(g), o?.(g);
|
|
22
22
|
},
|
|
23
|
-
[
|
|
24
|
-
),
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
[d, o]
|
|
24
|
+
), f = m.useRef(r);
|
|
25
|
+
m.useEffect(() => {
|
|
26
|
+
f.current = r;
|
|
27
27
|
}, [r]);
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
}, [
|
|
32
|
-
|
|
33
|
-
}, []), /* @__PURE__ */
|
|
34
|
-
|
|
28
|
+
const b = m.useRef(u);
|
|
29
|
+
return m.useEffect(() => {
|
|
30
|
+
b.current && !u && f.current?.(), b.current = u;
|
|
31
|
+
}, [u]), m.useEffect(() => () => {
|
|
32
|
+
b.current && f.current?.();
|
|
33
|
+
}, []), /* @__PURE__ */ e(
|
|
34
|
+
a.Root,
|
|
35
35
|
{
|
|
36
36
|
"data-slot": "select",
|
|
37
|
-
defaultOpen:
|
|
38
|
-
open:
|
|
39
|
-
onOpenChange:
|
|
40
|
-
...
|
|
41
|
-
children:
|
|
37
|
+
defaultOpen: i,
|
|
38
|
+
open: l,
|
|
39
|
+
onOpenChange: h,
|
|
40
|
+
...p,
|
|
41
|
+
children: t
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
T.displayName = "Select";
|
|
46
|
-
function O(
|
|
47
|
-
return /* @__PURE__ */
|
|
46
|
+
function O(t) {
|
|
47
|
+
return /* @__PURE__ */ e(a.Group, { "data-slot": "select-group", ...t });
|
|
48
48
|
}
|
|
49
49
|
O.displayName = "SelectGroup";
|
|
50
|
-
function j(
|
|
51
|
-
return /* @__PURE__ */
|
|
50
|
+
function j(t) {
|
|
51
|
+
return /* @__PURE__ */ e(a.Value, { "data-slot": "select-value", ...t });
|
|
52
52
|
}
|
|
53
53
|
j.displayName = "SelectValue";
|
|
54
54
|
const B = k([
|
|
@@ -59,9 +59,9 @@ const B = k([
|
|
|
59
59
|
"border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
60
60
|
"bg-neutral-50 border-neutral-300",
|
|
61
61
|
"dark:bg-white/5 dark:border-white/15",
|
|
62
|
-
// Typography — text-
|
|
63
|
-
//
|
|
64
|
-
"text-
|
|
62
|
+
// Typography — text-field (DS-992): label-sized like every field value, with
|
|
63
|
+
// the built-in 16px touch bump that keeps iOS Safari from zooming on focus.
|
|
64
|
+
"text-field text-foreground",
|
|
65
65
|
// Text truncation for long content (shadcn default behavior)
|
|
66
66
|
"[&>span]:block [&>span]:truncate",
|
|
67
67
|
// Placeholder state
|
|
@@ -77,50 +77,66 @@ const B = k([
|
|
|
77
77
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
78
78
|
]);
|
|
79
79
|
function L({
|
|
80
|
-
className:
|
|
80
|
+
className: t,
|
|
81
81
|
children: r,
|
|
82
|
-
placeholder:
|
|
83
|
-
dataHook:
|
|
84
|
-
error:
|
|
85
|
-
selectLabel:
|
|
86
|
-
|
|
82
|
+
placeholder: o,
|
|
83
|
+
dataHook: l,
|
|
84
|
+
error: i,
|
|
85
|
+
selectLabel: p,
|
|
86
|
+
reserveValues: c,
|
|
87
|
+
...s
|
|
87
88
|
}) {
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
|
|
89
|
+
const d = i || s["aria-invalid"] === !0 || s["aria-invalid"] === "true", u = s["aria-required"] === !0 || s["aria-required"] === "true", h = s["aria-label"] || p || o || "Select an option", f = d ? "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" : "";
|
|
90
|
+
return /* @__PURE__ */ v(
|
|
91
|
+
a.Trigger,
|
|
91
92
|
{
|
|
92
|
-
...
|
|
93
|
-
"aria-invalid":
|
|
94
|
-
"aria-label":
|
|
93
|
+
...s,
|
|
94
|
+
"aria-invalid": d ? "true" : void 0,
|
|
95
|
+
"aria-label": h,
|
|
95
96
|
"aria-required": u ? "true" : void 0,
|
|
96
|
-
className: n(B(),
|
|
97
|
-
"data-hook":
|
|
97
|
+
className: n(B(), f, t),
|
|
98
|
+
"data-hook": l,
|
|
98
99
|
"data-slot": "select-trigger",
|
|
99
100
|
children: [
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
c?.length ? (
|
|
102
|
+
// The base [&>span]:block would beat .grid on specificity, flowing the
|
|
103
|
+
// sizer spans inline and summing their widths — hence !grid.
|
|
104
|
+
/* @__PURE__ */ v("span", { className: "!grid min-w-0 text-left", "data-slot": "select-reserve", children: [
|
|
105
|
+
c.map((b, g) => /* @__PURE__ */ e(
|
|
106
|
+
"span",
|
|
107
|
+
{
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
className: "invisible col-start-1 row-start-1 truncate",
|
|
110
|
+
children: b
|
|
111
|
+
},
|
|
112
|
+
g
|
|
113
|
+
)),
|
|
114
|
+
/* @__PURE__ */ e("span", { className: "col-start-1 row-start-1 truncate", children: r })
|
|
115
|
+
] })
|
|
116
|
+
) : r,
|
|
117
|
+
/* @__PURE__ */ e(a.Icon, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "text-muted-foreground" }) })
|
|
102
118
|
]
|
|
103
119
|
}
|
|
104
120
|
);
|
|
105
121
|
}
|
|
106
122
|
L.displayName = "SelectTrigger";
|
|
107
123
|
function _({
|
|
108
|
-
className:
|
|
124
|
+
className: t,
|
|
109
125
|
children: r,
|
|
110
|
-
position:
|
|
111
|
-
maxHeight:
|
|
112
|
-
style:
|
|
113
|
-
...
|
|
126
|
+
position: o = "popper",
|
|
127
|
+
maxHeight: l,
|
|
128
|
+
style: i,
|
|
129
|
+
...p
|
|
114
130
|
}) {
|
|
115
131
|
R();
|
|
116
|
-
const
|
|
132
|
+
const c = m.useRef(null);
|
|
117
133
|
I(
|
|
118
|
-
() =>
|
|
134
|
+
() => c.current ? c.current.querySelectorAll('[data-slot="select-item"]').length >= 100 : !1,
|
|
119
135
|
`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
|
|
120
136
|
Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,
|
|
121
137
|
[r]
|
|
122
138
|
);
|
|
123
|
-
const
|
|
139
|
+
const s = n(
|
|
124
140
|
// Base appearance
|
|
125
141
|
"relative z-50 overflow-hidden",
|
|
126
142
|
"min-w-[8rem]",
|
|
@@ -131,52 +147,52 @@ Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,
|
|
|
131
147
|
"origin-[var(--radix-select-content-transform-origin)]",
|
|
132
148
|
// Animations
|
|
133
149
|
C
|
|
134
|
-
),
|
|
150
|
+
), d = o === "popper" && n(
|
|
135
151
|
"data-[side=bottom]:translate-y-1",
|
|
136
152
|
"data-[side=left]:-translate-x-1",
|
|
137
153
|
"data-[side=right]:translate-x-1",
|
|
138
154
|
"data-[side=top]:-translate-y-1"
|
|
139
|
-
),
|
|
140
|
-
...
|
|
141
|
-
maxHeight: `min(${
|
|
142
|
-
} :
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
|
|
155
|
+
), u = l !== void 0 ? {
|
|
156
|
+
...i,
|
|
157
|
+
maxHeight: `min(${l}px, var(--radix-select-content-available-height))`
|
|
158
|
+
} : i;
|
|
159
|
+
return /* @__PURE__ */ e(a.Portal, { children: /* @__PURE__ */ v(
|
|
160
|
+
a.Content,
|
|
145
161
|
{
|
|
146
|
-
className: n(
|
|
162
|
+
className: n(s, d, t),
|
|
147
163
|
"data-slot": "select-content",
|
|
148
|
-
position:
|
|
149
|
-
style:
|
|
150
|
-
...
|
|
164
|
+
position: o,
|
|
165
|
+
style: u,
|
|
166
|
+
...p,
|
|
151
167
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
168
|
+
/* @__PURE__ */ e(S, {}),
|
|
169
|
+
/* @__PURE__ */ e(
|
|
170
|
+
a.Viewport,
|
|
155
171
|
{
|
|
156
|
-
ref:
|
|
172
|
+
ref: c,
|
|
157
173
|
className: n(
|
|
158
174
|
"p-1",
|
|
159
|
-
|
|
175
|
+
o === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
160
176
|
),
|
|
161
177
|
children: r
|
|
162
178
|
}
|
|
163
179
|
),
|
|
164
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ e(y, {})
|
|
165
181
|
]
|
|
166
182
|
}
|
|
167
183
|
) });
|
|
168
184
|
}
|
|
169
185
|
_.displayName = "SelectContent";
|
|
170
186
|
function q({
|
|
171
|
-
className:
|
|
187
|
+
className: t,
|
|
172
188
|
...r
|
|
173
189
|
}) {
|
|
174
|
-
return /* @__PURE__ */
|
|
175
|
-
|
|
190
|
+
return /* @__PURE__ */ e(
|
|
191
|
+
a.Label,
|
|
176
192
|
{
|
|
177
193
|
className: n(
|
|
178
194
|
"text-muted-foreground text-label-sm px-2 py-1.5",
|
|
179
|
-
|
|
195
|
+
t
|
|
180
196
|
),
|
|
181
197
|
"data-slot": "select-label",
|
|
182
198
|
...r
|
|
@@ -184,12 +200,8 @@ function q({
|
|
|
184
200
|
);
|
|
185
201
|
}
|
|
186
202
|
q.displayName = "SelectLabel";
|
|
187
|
-
function D({
|
|
188
|
-
|
|
189
|
-
children: r,
|
|
190
|
-
...l
|
|
191
|
-
}) {
|
|
192
|
-
const s = n(
|
|
203
|
+
function D({ className: t, children: r, hint: o, ...l }) {
|
|
204
|
+
const i = n(
|
|
193
205
|
// Base layout
|
|
194
206
|
"relative flex w-full cursor-default select-none items-center gap-2",
|
|
195
207
|
"rounded py-1.5 pl-2 pr-8",
|
|
@@ -204,66 +216,74 @@ function D({
|
|
|
204
216
|
// Icon styles
|
|
205
217
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
206
218
|
);
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
|
|
219
|
+
return /* @__PURE__ */ v(
|
|
220
|
+
a.Item,
|
|
209
221
|
{
|
|
210
|
-
className: n(
|
|
222
|
+
className: n(i, t),
|
|
211
223
|
"data-slot": "select-item",
|
|
212
224
|
...l,
|
|
213
225
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ e("span", { className: "absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(N, {}) }) }),
|
|
227
|
+
/* @__PURE__ */ e(a.ItemText, { children: r }),
|
|
228
|
+
o != null && /* @__PURE__ */ e(
|
|
229
|
+
"span",
|
|
230
|
+
{
|
|
231
|
+
className: "text-label-sm text-muted-foreground ml-auto",
|
|
232
|
+
"data-slot": "select-item-hint",
|
|
233
|
+
children: o
|
|
234
|
+
}
|
|
235
|
+
)
|
|
216
236
|
]
|
|
217
237
|
}
|
|
218
238
|
);
|
|
219
239
|
}
|
|
220
240
|
D.displayName = "SelectItem";
|
|
221
241
|
function E({
|
|
222
|
-
className:
|
|
242
|
+
className: t,
|
|
223
243
|
...r
|
|
224
244
|
}) {
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
-
|
|
245
|
+
return /* @__PURE__ */ e(
|
|
246
|
+
a.Separator,
|
|
227
247
|
{
|
|
228
|
-
className: n("bg-border pointer-events-none -mx-1 my-1 h-px",
|
|
248
|
+
className: n("bg-border pointer-events-none -mx-1 my-1 h-px", t),
|
|
229
249
|
"data-slot": "select-separator",
|
|
230
250
|
...r
|
|
231
251
|
}
|
|
232
252
|
);
|
|
233
253
|
}
|
|
234
254
|
E.displayName = "SelectSeparator";
|
|
235
|
-
function
|
|
236
|
-
className:
|
|
255
|
+
function S({
|
|
256
|
+
className: t,
|
|
237
257
|
...r
|
|
238
258
|
}) {
|
|
239
|
-
return /* @__PURE__ */
|
|
240
|
-
|
|
259
|
+
return /* @__PURE__ */ e(
|
|
260
|
+
a.ScrollUpButton,
|
|
241
261
|
{
|
|
242
262
|
className: n(
|
|
243
263
|
"flex cursor-default items-center justify-center py-1",
|
|
244
|
-
|
|
264
|
+
t
|
|
245
265
|
),
|
|
246
266
|
"data-slot": "select-scroll-up-button",
|
|
247
267
|
...r,
|
|
248
|
-
children: /* @__PURE__ */
|
|
268
|
+
children: /* @__PURE__ */ e(w, {})
|
|
249
269
|
}
|
|
250
270
|
);
|
|
251
271
|
}
|
|
252
|
-
|
|
272
|
+
S.displayName = "SelectScrollUpButton";
|
|
253
273
|
function y({
|
|
254
|
-
className:
|
|
274
|
+
className: t,
|
|
255
275
|
...r
|
|
256
276
|
}) {
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
277
|
+
return /* @__PURE__ */ e(
|
|
278
|
+
a.ScrollDownButton,
|
|
259
279
|
{
|
|
260
280
|
className: n(
|
|
261
281
|
"flex cursor-default items-center justify-center py-1",
|
|
262
|
-
|
|
282
|
+
t
|
|
263
283
|
),
|
|
264
284
|
"data-slot": "select-scroll-down-button",
|
|
265
285
|
...r,
|
|
266
|
-
children: /* @__PURE__ */
|
|
286
|
+
children: /* @__PURE__ */ e(x, {})
|
|
267
287
|
}
|
|
268
288
|
);
|
|
269
289
|
}
|
|
@@ -275,7 +295,7 @@ export {
|
|
|
275
295
|
D as SelectItem,
|
|
276
296
|
q as SelectLabel,
|
|
277
297
|
y as SelectScrollDownButton,
|
|
278
|
-
|
|
298
|
+
S as SelectScrollUpButton,
|
|
279
299
|
E as SelectSeparator,
|
|
280
300
|
L as SelectTrigger,
|
|
281
301
|
j as SelectValue
|