@brightlocal/ui-components 2.12.0 → 2.13.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.
Files changed (43) hide show
  1. package/component-meta.json +312 -16
  2. package/dist/blocks/sidebar.cjs +1 -1
  3. package/dist/blocks/sidebar.d.ts +203 -4
  4. package/dist/blocks/sidebar.d.ts.map +1 -1
  5. package/dist/blocks/sidebar.js +667 -393
  6. package/dist/combobox.cjs +3 -3
  7. package/dist/combobox.d.ts +8 -0
  8. package/dist/combobox.d.ts.map +1 -1
  9. package/dist/combobox.js +227 -226
  10. package/dist/dropdown-menu.cjs +1 -1
  11. package/dist/dropdown-menu.js +1 -1
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.js +296 -288
  14. package/dist/list.cjs +1 -1
  15. package/dist/list.d.ts +25 -4
  16. package/dist/list.d.ts.map +1 -1
  17. package/dist/list.js +71 -53
  18. package/dist/popover.cjs +1 -1
  19. package/dist/popover.js +7 -7
  20. package/dist/rating.cjs +1 -1
  21. package/dist/rating.js +13 -13
  22. package/dist/select.cjs +2 -2
  23. package/dist/select.d.ts +10 -2
  24. package/dist/select.d.ts.map +1 -1
  25. package/dist/select.js +36 -30
  26. package/dist/table.cjs +1 -1
  27. package/dist/table.d.ts +14 -0
  28. package/dist/table.d.ts.map +1 -1
  29. package/dist/table.js +57 -39
  30. package/dist/tabs.cjs +1 -1
  31. package/dist/tabs.d.ts +25 -9
  32. package/dist/tabs.d.ts.map +1 -1
  33. package/dist/tabs.js +128 -113
  34. package/package.json +1 -1
  35. package/src/blocks/sidebar.tsx +596 -9
  36. package/src/components/combobox.tsx +10 -0
  37. package/src/components/dropdown-menu.tsx +1 -1
  38. package/src/components/list.tsx +45 -2
  39. package/src/components/popover.tsx +1 -1
  40. package/src/components/rating.tsx +1 -1
  41. package/src/components/select.tsx +24 -2
  42. package/src/components/table.tsx +39 -2
  43. package/src/components/tabs.tsx +195 -146
package/dist/list.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),v=require("@radix-ui/react-slot"),w=require("class-variance-authority"),o=require("@brightlocal/ui-components/lib/utils"),c=require("@brightlocal/ui-components/skeleton");function R(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=R(k),d=w.cva(["flex","items-center","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-200","ease-out"],{variants:{variant:{filled:["bg-card"],outline:["bg-background","border","border-border"],loading:["flex-col","gap-2","px-0","pt-0","pb-3"]}},defaultVariants:{variant:"filled"}}),m=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:n,...r},l)=>s.jsx("ul",{ref:l,className:o.cn("flex flex-col gap-2",e),"data-hook":a,"data-slot":"list","data-tracking-el":t,"data-tracking-label":n,...r}));m.displayName="List";const f=i.forwardRef(({asChild:e=!1,className:a,variant:t,dataHook:n,trackingEl:r,trackingLabel:l,children:I,...j},N)=>{const y=e?v.Slot:"li";return s.jsx(y,{ref:N,className:o.cn(d({variant:t}),a),"data-hook":n,"data-slot":"item","data-tracking-el":r,"data-tracking-label":l,...j,children:t==="loading"?s.jsxs(s.Fragment,{children:[s.jsx(c.Skeleton,{className:"h-4 w-full"}),s.jsx(c.Skeleton,{className:"h-4 w-full"})]}):I})});f.displayName="Item";const u=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("shrink-0",e),"data-slot":"item-media",...a}));u.displayName="ItemMedia";const p=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("flex flex-1 flex-col gap-1",e),"data-slot":"item-content",...a}));p.displayName="ItemContent";const g=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-foreground text-lg font-medium",e),"data-slot":"item-title",...a}));g.displayName="ItemTitle";const x=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground text-base",e),"data-slot":"item-description",...a}));x.displayName="ItemDescription";const b=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",e),"data-slot":"item-actions",...a}));b.displayName="ItemActions";exports.Item=f;exports.ItemActions=b;exports.ItemContent=p;exports.ItemDescription=x;exports.ItemMedia=u;exports.ItemTitle=g;exports.List=m;exports.itemVariants=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),w=require("@radix-ui/react-slot"),R=require("class-variance-authority"),r=require("@brightlocal/ui-components/lib/utils"),c=require("@brightlocal/ui-components/skeleton");function S(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const n=S(k),d=R.cva(["flex","items-center","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-200","ease-out"],{variants:{variant:{default:[],filled:["bg-card"],outline:["bg-background","border","border-border"],loading:["flex-col","gap-2","px-0","pt-0","pb-3"]}},defaultVariants:{variant:"filled"}}),m=n.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,...i},l)=>s.jsx("ul",{ref:l,className:r.cn("flex flex-col gap-2",e),"data-hook":a,"data-slot":"list","data-tracking-el":t,"data-tracking-label":o,...i}));m.displayName="List";const f=n.forwardRef(({asChild:e=!1,className:a,variant:t,dataHook:o,trackingEl:i,trackingLabel:l,children:N,...j},y)=>{const h=e?w.Slot:"li";return s.jsx(h,{ref:y,className:r.cn(d({variant:t}),a),"data-hook":o,"data-slot":"item","data-tracking-el":i,"data-tracking-label":l,...j,children:t==="loading"?s.jsxs(s.Fragment,{children:[s.jsx(c.Skeleton,{className:"h-4 w-full"}),s.jsx(c.Skeleton,{className:"h-4 w-full"})]}):N})});f.displayName="Item";const u=n.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("shrink-0",e),"data-slot":"item-media",...a}));u.displayName="ItemMedia";const p=n.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("flex flex-1 flex-col gap-1",e),"data-slot":"item-content",...a}));p.displayName="ItemContent";const x=n.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("text-foreground text-lg font-medium",e),"data-slot":"item-title",...a}));x.displayName="ItemTitle";const g=n.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("text-muted-foreground text-base",e),"data-slot":"item-description",...a}));g.displayName="ItemDescription";const b=n.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",e),"data-slot":"item-actions",...a}));b.displayName="ItemActions";const I=n.forwardRef(({className:e,dataHook:a,...t},o)=>s.jsx("li",{ref:o,className:r.cn("text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",e),"data-hook":a,"data-slot":"item-subheader",...t}));I.displayName="ItemSubheader";exports.Item=f;exports.ItemActions=b;exports.ItemContent=p;exports.ItemDescription=g;exports.ItemMedia=u;exports.ItemSubheader=I;exports.ItemTitle=x;exports.List=m;exports.itemVariants=d;
package/dist/list.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  declare const itemVariants: (props?: ({
3
- variant?: "filled" | "outline" | "loading" | null | undefined;
3
+ variant?: "default" | "filled" | "outline" | "loading" | null | undefined;
4
4
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
5
  /**
6
6
  * Props for the List root container.
@@ -50,12 +50,13 @@ export type ItemProps = React.ComponentProps<"li"> & {
50
50
  asChild?: boolean;
51
51
  /**
52
52
  * Visual style of the item row.
53
+ * - `default` — plain row without background or border
53
54
  * - `filled` — card background (default)
54
55
  * - `outline` — bordered row on page background
55
56
  * - `loading` — skeleton placeholder
56
57
  * @default "filled"
57
58
  */
58
- variant?: "filled" | "outline" | "loading";
59
+ variant?: "default" | "filled" | "outline" | "loading";
59
60
  /**
60
61
  * Data hook for automated testing.
61
62
  */
@@ -70,7 +71,7 @@ export type ItemProps = React.ComponentProps<"li"> & {
70
71
  trackingLabel?: string;
71
72
  };
72
73
  /**
73
- * Row component within a List. Supports `filled`, `outline`, and `loading` variants.
74
+ * Row component within a List. Supports `default`, `filled`, `outline`, and `loading` variants.
74
75
  * Compose with ItemMedia, ItemContent, ItemTitle, ItemDescription, and ItemActions.
75
76
  */
76
77
  declare const Item: React.ForwardRefExoticComponent<Omit<ItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
@@ -105,5 +106,25 @@ export type ItemActionsProps = React.ComponentProps<"div">;
105
106
  * Right-side slot for action controls such as remove buttons.
106
107
  */
107
108
  declare const ItemActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
108
- export { List, Item, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, itemVariants, };
109
+ /** Props for the ItemSubheader sub-component — section heading within a List. */
110
+ export type ItemSubheaderProps = React.ComponentProps<"li"> & {
111
+ /**
112
+ * Data hook for automated testing.
113
+ */
114
+ dataHook?: string;
115
+ };
116
+ /**
117
+ * Section heading for grouping related items within a List.
118
+ * Renders as a non-interactive `<li>` with muted label styling.
119
+ *
120
+ * @example
121
+ * ```tsx
122
+ * <List dataHook="actions-list">
123
+ * <ItemSubheader>Suggestions</ItemSubheader>
124
+ * <Item variant="default" dataHook="item-1">...</Item>
125
+ * </List>
126
+ * ```
127
+ */
128
+ declare const ItemSubheader: React.ForwardRefExoticComponent<Omit<ItemSubheaderProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
129
+ export { List, Item, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, ItemSubheader, itemVariants, };
109
130
  //# sourceMappingURL=list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/components/list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,QAAA,MAAM,YAAY;;8EAyBjB,CAAC;AAMF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG;IACnD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,IAAI,iGAYT,CAAC;AAOF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG;IACnD;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAC3C;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,IAAI,8FAqCT,CAAC;AAOF,6EAA6E;AAC7E,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEzD;;GAEG;AACH,QAAA,MAAM,SAAS,mKASd,CAAC;AAOF,sFAAsF;AACtF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CA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ACT,WAAW,EACX,SAAS,EACT,eAAe,EACf,WAAW,EACX,aAAa,EACb,YAAY,GACb,CAAC"}
package/dist/list.js CHANGED
@@ -1,8 +1,8 @@
1
- import { jsx as o, jsxs as p, Fragment as g } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { Slot as u } from "@radix-ui/react-slot";
1
+ import { jsx as o, jsxs as p, Fragment as u } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { Slot as g } from "@radix-ui/react-slot";
4
4
  import { cva as x } from "class-variance-authority";
5
- import { cn as l } from "@brightlocal/ui-components/lib/utils";
5
+ import { cn as r } from "@brightlocal/ui-components/lib/utils";
6
6
  import { Skeleton as m } from "@brightlocal/ui-components/skeleton";
7
7
  const N = x(
8
8
  [
@@ -20,6 +20,7 @@ const N = x(
20
20
  {
21
21
  variants: {
22
22
  variant: {
23
+ default: [],
23
24
  filled: ["bg-card"],
24
25
  outline: ["bg-background", "border", "border-border"],
25
26
  loading: ["flex-col", "gap-2", "px-0", "pt-0", "pb-3"]
@@ -29,119 +30,136 @@ const N = x(
29
30
  variant: "filled"
30
31
  }
31
32
  }
32
- ), I = i.forwardRef(
33
- ({ className: e, dataHook: a, trackingEl: t, trackingLabel: r, ...s }, d) => /* @__PURE__ */ o(
33
+ ), b = l.forwardRef(
34
+ ({ className: t, dataHook: a, trackingEl: e, trackingLabel: s, ...i }, d) => /* @__PURE__ */ o(
34
35
  "ul",
35
36
  {
36
37
  ref: d,
37
- className: l("flex flex-col gap-2", e),
38
+ className: r("flex flex-col gap-2", t),
38
39
  "data-hook": a,
39
40
  "data-slot": "list",
40
- "data-tracking-el": t,
41
- "data-tracking-label": r,
42
- ...s
41
+ "data-tracking-el": e,
42
+ "data-tracking-label": s,
43
+ ...i
43
44
  }
44
45
  )
45
46
  );
46
- I.displayName = "List";
47
- const b = i.forwardRef(
47
+ b.displayName = "List";
48
+ const I = l.forwardRef(
48
49
  ({
49
- asChild: e = !1,
50
+ asChild: t = !1,
50
51
  className: a,
51
- variant: t,
52
- dataHook: r,
53
- trackingEl: s,
52
+ variant: e,
53
+ dataHook: s,
54
+ trackingEl: i,
54
55
  trackingLabel: d,
55
56
  children: n,
56
57
  ...c
57
58
  }, f) => /* @__PURE__ */ o(
58
- e ? u : "li",
59
+ t ? g : "li",
59
60
  {
60
61
  ref: f,
61
- className: l(N({ variant: t }), a),
62
- "data-hook": r,
62
+ className: r(N({ variant: e }), a),
63
+ "data-hook": s,
63
64
  "data-slot": "item",
64
- "data-tracking-el": s,
65
+ "data-tracking-el": i,
65
66
  "data-tracking-label": d,
66
67
  ...c,
67
- children: t === "loading" ? /* @__PURE__ */ p(g, { children: [
68
+ children: e === "loading" ? /* @__PURE__ */ p(u, { children: [
68
69
  /* @__PURE__ */ o(m, { className: "h-4 w-full" }),
69
70
  /* @__PURE__ */ o(m, { className: "h-4 w-full" })
70
71
  ] }) : n
71
72
  }
72
73
  )
73
74
  );
74
- b.displayName = "Item";
75
- const k = i.forwardRef(
76
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
75
+ I.displayName = "Item";
76
+ const h = l.forwardRef(
77
+ ({ className: t, ...a }, e) => /* @__PURE__ */ o(
77
78
  "div",
78
79
  {
79
- ref: t,
80
- className: l("shrink-0", e),
80
+ ref: e,
81
+ className: r("shrink-0", t),
81
82
  "data-slot": "item-media",
82
83
  ...a
83
84
  }
84
85
  )
85
86
  );
86
- k.displayName = "ItemMedia";
87
- const w = i.forwardRef(
88
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
87
+ h.displayName = "ItemMedia";
88
+ const k = l.forwardRef(
89
+ ({ className: t, ...a }, e) => /* @__PURE__ */ o(
89
90
  "div",
90
91
  {
91
- ref: t,
92
- className: l("flex flex-1 flex-col gap-1", e),
92
+ ref: e,
93
+ className: r("flex flex-1 flex-col gap-1", t),
93
94
  "data-slot": "item-content",
94
95
  ...a
95
96
  }
96
97
  )
97
98
  );
98
- w.displayName = "ItemContent";
99
- const y = i.forwardRef(
100
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
99
+ k.displayName = "ItemContent";
100
+ const y = l.forwardRef(
101
+ ({ className: t, ...a }, e) => /* @__PURE__ */ o(
101
102
  "div",
102
103
  {
103
- ref: t,
104
- className: l("text-foreground text-lg font-medium", e),
104
+ ref: e,
105
+ className: r("text-foreground text-lg font-medium", t),
105
106
  "data-slot": "item-title",
106
107
  ...a
107
108
  }
108
109
  )
109
110
  );
110
111
  y.displayName = "ItemTitle";
111
- const h = i.forwardRef(
112
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
112
+ const w = l.forwardRef(
113
+ ({ className: t, ...a }, e) => /* @__PURE__ */ o(
113
114
  "div",
114
115
  {
115
- ref: t,
116
- className: l("text-muted-foreground text-base", e),
116
+ ref: e,
117
+ className: r("text-muted-foreground text-base", t),
117
118
  "data-slot": "item-description",
118
119
  ...a
119
120
  }
120
121
  )
121
122
  );
122
- h.displayName = "ItemDescription";
123
- const v = i.forwardRef(
124
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
123
+ w.displayName = "ItemDescription";
124
+ const R = l.forwardRef(
125
+ ({ className: t, ...a }, e) => /* @__PURE__ */ o(
125
126
  "div",
126
127
  {
127
- ref: t,
128
- className: l(
128
+ ref: e,
129
+ className: r(
129
130
  "text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",
130
- e
131
+ t
131
132
  ),
132
133
  "data-slot": "item-actions",
133
134
  ...a
134
135
  }
135
136
  )
136
137
  );
137
- v.displayName = "ItemActions";
138
+ R.displayName = "ItemActions";
139
+ const v = l.forwardRef(
140
+ ({ className: t, dataHook: a, ...e }, s) => /* @__PURE__ */ o(
141
+ "li",
142
+ {
143
+ ref: s,
144
+ className: r(
145
+ "text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",
146
+ t
147
+ ),
148
+ "data-hook": a,
149
+ "data-slot": "item-subheader",
150
+ ...e
151
+ }
152
+ )
153
+ );
154
+ v.displayName = "ItemSubheader";
138
155
  export {
139
- b as Item,
140
- v as ItemActions,
141
- w as ItemContent,
142
- h as ItemDescription,
143
- k as ItemMedia,
156
+ I as Item,
157
+ R as ItemActions,
158
+ k as ItemContent,
159
+ w as ItemDescription,
160
+ h as ItemMedia,
161
+ v as ItemSubheader,
144
162
  y as ItemTitle,
145
- I as List,
163
+ b as List,
146
164
  N as itemVariants
147
165
  };
package/dist/popover.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),v=require("@radix-ui/react-popover"),g=require("@brightlocal/ui-components/lib/utils");function d(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const i=d(u),a=d(v);function s({...o}){return r.jsx(a.Root,{"data-slot":"popover",...o})}s.displayName="Popover";const p=i.forwardRef(({dataHook:o,...t},e)=>r.jsx(a.Trigger,{ref:e,"data-hook":o,"data-slot":"popover-trigger",...t}));p.displayName="PopoverTrigger";const c=i.forwardRef(({className:o,align:t="center",sideOffset:e=4,dataHook:n,...f},m)=>r.jsx(a.Portal,{children:r.jsx(a.Content,{ref:m,align:t,className:g.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",o),"data-hook":n,"data-slot":"popover-content",sideOffset:e,...f})}));c.displayName="PopoverContent";const l=i.forwardRef(({dataHook:o,...t},e)=>r.jsx(a.Anchor,{ref:e,"data-hook":o,"data-slot":"popover-anchor",...t}));l.displayName="PopoverAnchor";exports.Popover=s;exports.PopoverAnchor=l;exports.PopoverContent=c;exports.PopoverTrigger=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),v=require("@radix-ui/react-popover"),g=require("@brightlocal/ui-components/lib/utils");function d(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const i=d(m),a=d(v);function s({...e}){return r.jsx(a.Root,{"data-slot":"popover",...e})}s.displayName="Popover";const p=i.forwardRef(({dataHook:e,...t},o)=>r.jsx(a.Trigger,{ref:o,"data-slot":"popover-trigger",...e!=null&&{"data-hook":e},...t}));p.displayName="PopoverTrigger";const c=i.forwardRef(({className:e,align:t="center",sideOffset:o=4,dataHook:n,...u},f)=>r.jsx(a.Portal,{children:r.jsx(a.Content,{ref:f,align:t,className:g.cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),"data-hook":n,"data-slot":"popover-content",sideOffset:o,...u})}));c.displayName="PopoverContent";const l=i.forwardRef(({dataHook:e,...t},o)=>r.jsx(a.Anchor,{ref:o,"data-hook":e,"data-slot":"popover-anchor",...t}));l.displayName="PopoverAnchor";exports.Popover=s;exports.PopoverAnchor=l;exports.PopoverContent=c;exports.PopoverTrigger=p;
package/dist/popover.js CHANGED
@@ -6,17 +6,17 @@ function m({ ...o }) {
6
6
  return /* @__PURE__ */ a(r.Root, { "data-slot": "popover", ...o });
7
7
  }
8
8
  m.displayName = "Popover";
9
- const f = d.forwardRef(({ dataHook: o, ...t }, e) => /* @__PURE__ */ a(
9
+ const l = d.forwardRef(({ dataHook: o, ...t }, e) => /* @__PURE__ */ a(
10
10
  r.Trigger,
11
11
  {
12
12
  ref: e,
13
- "data-hook": o,
14
13
  "data-slot": "popover-trigger",
14
+ ...o != null && { "data-hook": o },
15
15
  ...t
16
16
  }
17
17
  ));
18
- f.displayName = "PopoverTrigger";
19
- const l = d.forwardRef(
18
+ l.displayName = "PopoverTrigger";
19
+ const f = d.forwardRef(
20
20
  ({ className: o, align: t = "center", sideOffset: e = 4, dataHook: i, ...n }, p) => /* @__PURE__ */ a(r.Portal, { children: /* @__PURE__ */ a(
21
21
  r.Content,
22
22
  {
@@ -33,7 +33,7 @@ const l = d.forwardRef(
33
33
  }
34
34
  ) })
35
35
  );
36
- l.displayName = "PopoverContent";
36
+ f.displayName = "PopoverContent";
37
37
  const c = d.forwardRef(({ dataHook: o, ...t }, e) => /* @__PURE__ */ a(
38
38
  r.Anchor,
39
39
  {
@@ -47,6 +47,6 @@ c.displayName = "PopoverAnchor";
47
47
  export {
48
48
  m as Popover,
49
49
  c as PopoverAnchor,
50
- l as PopoverContent,
51
- f as PopoverTrigger
50
+ f as PopoverContent,
51
+ l as PopoverTrigger
52
52
  };
package/dist/rating.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),j=require("react"),c=require("@brightlocal/icons"),y=require("@brightlocal/ui-components/lib/utils");function R(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const h=R(j),d=h.forwardRef(({value:t,dataHook:a,ariaLabel:e,trackingEl:s,trackingLabel:u,className:g,...m},f)=>{const r=Math.max(0,Math.min(5,t));return l.jsx("div",{ref:f,"aria-label":e?e.replace("{value}",String(r)):`Rating: ${r} out of 5 stars`,className:y.cn("flex items-center gap-0.5",g),"data-hook":a,"data-slot":"rating","data-tracking-el":s,"data-tracking-label":u,role:"img",...m,children:[...Array(5)].map((v,i)=>{const p=i+1,n=r>=p,o=!n&&r>i,b=o?((r-i)*100).toFixed(0):n?"100":"0";return l.jsxs("div",{className:"relative","data-slot":"rating-star",children:[l.jsx(c.StarRating,{className:"fill-muted stroke-muted","data-slot":"rating-star-base"}),(n||o)&&l.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 overflow-hidden","data-slot":"rating-star-fill",style:{width:`${b}%`},children:l.jsx(c.StarRating,{className:"fill-yellow-400 stroke-yellow-400"})})]},i)})})});d.displayName="Rating";exports.Rating=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),c=require("@brightlocal/icons"),R=require("@brightlocal/ui-components/lib/utils");function h(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const y=h(j),d=y.forwardRef(({value:t,dataHook:a,ariaLabel:e,trackingEl:i,trackingLabel:u,className:g,...m},f)=>{const r=Math.max(0,Math.min(5,t));return s.jsx("div",{ref:f,"aria-label":e?e.replace("{value}",String(r)):`Rating: ${r} out of 5 stars`,className:R.cn("flex items-center gap-0.5",g),"data-hook":a,"data-slot":"rating","data-tracking-el":i,"data-tracking-label":u,role:"img",...m,children:[...Array(5)].map((v,l)=>{const p=l+1,n=r>=p,o=!n&&r>l,b=o?((r-l)*100).toFixed(0):n?"100":"0";return s.jsxs("div",{className:"relative","data-slot":"rating-star",children:[s.jsx(c.StarRating,{className:"fill-muted stroke-muted","data-slot":"rating-star-base"}),(n||o)&&s.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 overflow-hidden","data-slot":"rating-star-fill",style:{width:`${b}%`},children:s.jsx(c.StarRating,{})})]},l)})})});d.displayName="Rating";exports.Rating=d;
package/dist/rating.js CHANGED
@@ -1,41 +1,41 @@
1
- import { jsx as e, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
2
  import * as v from "react";
3
- import { StarRating as i } from "@brightlocal/icons";
4
- import { cn as y } from "@brightlocal/ui-components/lib/utils";
3
+ import { StarRating as s } from "@brightlocal/icons";
4
+ import { cn as R } from "@brightlocal/ui-components/lib/utils";
5
5
  const N = v.forwardRef(
6
6
  ({
7
7
  value: o,
8
8
  dataHook: n,
9
- ariaLabel: r,
9
+ ariaLabel: l,
10
10
  trackingEl: d,
11
11
  trackingLabel: c,
12
12
  className: m,
13
13
  ...g
14
14
  }, f) => {
15
15
  const a = Math.max(0, Math.min(5, o));
16
- return /* @__PURE__ */ e(
16
+ return /* @__PURE__ */ r(
17
17
  "div",
18
18
  {
19
19
  ref: f,
20
- "aria-label": r ? r.replace("{value}", String(a)) : `Rating: ${a} out of 5 stars`,
21
- className: y("flex items-center gap-0.5", m),
20
+ "aria-label": l ? l.replace("{value}", String(a)) : `Rating: ${a} out of 5 stars`,
21
+ className: R("flex items-center gap-0.5", m),
22
22
  "data-hook": n,
23
23
  "data-slot": "rating",
24
24
  "data-tracking-el": d,
25
25
  "data-tracking-label": c,
26
26
  role: "img",
27
27
  ...g,
28
- children: [...Array(5)].map((R, t) => {
29
- const p = t + 1, l = a >= p, s = !l && a > t, u = s ? ((a - t) * 100).toFixed(0) : l ? "100" : "0";
28
+ children: [...Array(5)].map((k, t) => {
29
+ const p = t + 1, e = a >= p, i = !e && a > t, u = i ? ((a - t) * 100).toFixed(0) : e ? "100" : "0";
30
30
  return /* @__PURE__ */ h("div", { className: "relative", "data-slot": "rating-star", children: [
31
- /* @__PURE__ */ e(
32
- i,
31
+ /* @__PURE__ */ r(
32
+ s,
33
33
  {
34
34
  className: "fill-muted stroke-muted",
35
35
  "data-slot": "rating-star-base"
36
36
  }
37
37
  ),
38
- (l || s) && /* @__PURE__ */ e(
38
+ (e || i) && /* @__PURE__ */ r(
39
39
  "div",
40
40
  {
41
41
  "aria-hidden": "true",
@@ -44,7 +44,7 @@ const N = v.forwardRef(
44
44
  style: {
45
45
  width: `${u}%`
46
46
  },
47
- children: /* @__PURE__ */ e(i, { className: "fill-yellow-400 stroke-yellow-400" })
47
+ children: /* @__PURE__ */ r(s, {})
48
48
  }
49
49
  )
50
50
  ] }, t);
package/dist/select.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("react"),C=require("@radix-ui/react-select"),c=require("@brightlocal/icons"),D=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),I=require("./lib/use-dev-warning.cjs");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const _=f(q),o=f(C);function b({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}b.displayName="Select";function g(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}g.displayName="SelectGroup";function x(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}x.displayName="SelectValue";const B=D.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]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans 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 v({className:e,children:r,placeholder:a,dataHook:s,error:i,selectLabel:d,...l}){const p=i||l["aria-invalid"]===!0||l["aria-invalid"]==="true",w=l["aria-required"]===!0||l["aria-required"]==="true",N=l["aria-label"]||d||a||"Select an option",k=p?"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 t.jsxs(o.Trigger,{...l,"aria-invalid":p?"true":void 0,"aria-label":N,"aria-required":w?"true":void 0,className:n.cn(B(),k,e),"data-hook":s,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(c.ChevronDown,{className:"text-muted-foreground"})})]})}v.displayName="SelectTrigger";function S({className:e,children:r,position:a="popper",...s}){const i=_.useRef(null);I.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 d=n.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)]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"),l=a==="popper"&&n.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");return t.jsx(o.Portal,{children:t.jsxs(o.Content,{className:n.cn(d,l,e),"data-slot":"select-content",position:a,...s,children:[t.jsx(u,{}),t.jsx(o.Viewport,{ref:i,className:n.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}),t.jsx(m,{})]})})}S.displayName="SelectContent";function h({className:e,...r}){return t.jsx(o.Label,{className:n.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}h.displayName="SelectLabel";function y({className:e,children:r,...a}){const s=n.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 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 t.jsxs(o.Item,{className:n.cn(s,e),"data-slot":"select-item",...a,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(o.ItemIndicator,{children:t.jsx(c.Check,{})})}),t.jsx(o.ItemText,{children:r})]})}y.displayName="SelectItem";function j({className:e,...r}){return t.jsx(o.Separator,{className:n.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}j.displayName="SelectSeparator";function u({className:e,...r}){return t.jsx(o.ScrollUpButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(c.ChevronUp,{})})}u.displayName="SelectScrollUpButton";function m({className:e,...r}){return t.jsx(o.ScrollDownButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(c.ChevronDown,{})})}m.displayName="SelectScrollDownButton";exports.Select=b;exports.SelectContent=S;exports.SelectGroup=g;exports.SelectItem=y;exports.SelectLabel=h;exports.SelectScrollDownButton=m;exports.SelectScrollUpButton=u;exports.SelectSeparator=j;exports.SelectTrigger=v;exports.SelectValue=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("react"),C=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),D=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),I=require("./lib/use-dev-warning.cjs");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const _=g(q),o=g(C);function v({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}v.displayName="Select";function x(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}x.displayName="SelectGroup";function S(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}S.displayName="SelectValue";const B=D.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]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans 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 h({className:e,children:r,placeholder:a,dataHook:l,error:i,selectLabel:u,...s}){const c=i||s["aria-invalid"]===!0||s["aria-invalid"]==="true",m=s["aria-required"]===!0||s["aria-required"]==="true",p=s["aria-label"]||u||a||"Select an option",k=c?"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 t.jsxs(o.Trigger,{...s,"aria-invalid":c?"true":void 0,"aria-label":p,"aria-required":m?"true":void 0,className:n.cn(B(),k,e),"data-hook":l,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(d.ChevronDown,{className:"text-muted-foreground"})})]})}h.displayName="SelectTrigger";function y({className:e,children:r,position:a="popper",maxHeight:l,style:i,...u}){const s=_.useRef(null);I.useDevWarning(()=>s.current?s.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 c=n.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)]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"),m=a==="popper"&&n.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"),p=l!==void 0?{...i,maxHeight:`min(${l}px, var(--radix-select-content-available-height))`}:i;return t.jsx(o.Portal,{children:t.jsxs(o.Content,{className:n.cn(c,m,e),"data-slot":"select-content",position:a,style:p,...u,children:[t.jsx(f,{}),t.jsx(o.Viewport,{ref:s,className:n.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}),t.jsx(b,{})]})})}y.displayName="SelectContent";function j({className:e,...r}){return t.jsx(o.Label,{className:n.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}j.displayName="SelectLabel";function w({className:e,children:r,...a}){const l=n.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 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 t.jsxs(o.Item,{className:n.cn(l,e),"data-slot":"select-item",...a,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(o.ItemIndicator,{children:t.jsx(d.Check,{})})}),t.jsx(o.ItemText,{children:r})]})}w.displayName="SelectItem";function N({className:e,...r}){return t.jsx(o.Separator,{className:n.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}N.displayName="SelectSeparator";function f({className:e,...r}){return t.jsx(o.ScrollUpButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(d.ChevronUp,{})})}f.displayName="SelectScrollUpButton";function b({className:e,...r}){return t.jsx(o.ScrollDownButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(d.ChevronDown,{})})}b.displayName="SelectScrollDownButton";exports.Select=v;exports.SelectContent=y;exports.SelectGroup=x;exports.SelectItem=w;exports.SelectLabel=j;exports.SelectScrollDownButton=b;exports.SelectScrollUpButton=f;exports.SelectSeparator=N;exports.SelectTrigger=h;exports.SelectValue=S;
package/dist/select.d.ts CHANGED
@@ -4,6 +4,14 @@ interface SelectProps extends React.ComponentProps<typeof SelectPrimitive.Root>
4
4
  /** Children to render inside the select */
5
5
  children?: React.ReactNode;
6
6
  }
7
+ interface SelectContentProps extends React.ComponentProps<typeof SelectPrimitive.Content> {
8
+ /**
9
+ * Maximum height of the dropdown in pixels.
10
+ * Constrains the dropdown height and shows scroll indicators when content overflows.
11
+ * The dropdown uses the smaller of this value and the available viewport space.
12
+ */
13
+ maxHeight?: number;
14
+ }
7
15
  /**
8
16
  * Select component for choosing from a list of options.
9
17
  * Wraps Radix UI Select with styling and accessibility features.
@@ -66,7 +74,7 @@ declare namespace SelectTrigger {
66
74
  /**
67
75
  * SelectContent - The dropdown container for select options
68
76
  */
69
- declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
77
+ declare function SelectContent({ className, children, position, maxHeight, style, ...props }: SelectContentProps): import("react/jsx-runtime").JSX.Element;
70
78
  declare namespace SelectContent {
71
79
  var displayName: string;
72
80
  }
@@ -116,5 +124,5 @@ declare namespace SelectScrollDownButton {
116
124
  var displayName: string;
117
125
  }
118
126
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
119
- export type { SelectProps, SelectTriggerProps };
127
+ export type { SelectContentProps, SelectProps, SelectTriggerProps };
120
128
  //# sourceMappingURL=select.d.ts.map
@@ -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;AAW1D,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAChD,OAAO,eAAe,CAAC,IAAI,CAC5B;IACC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,2CAMlD;kBANQ,MAAM;;;AAUf;;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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