@brightlocal/ui-components 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/list.js CHANGED
@@ -1,9 +1,10 @@
1
- import { jsx as o, jsxs as f, Fragment as p } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as p, Fragment as g } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { cva as g } from "class-variance-authority";
3
+ import { Slot as u } from "@radix-ui/react-slot";
4
+ import { cva as x } from "class-variance-authority";
4
5
  import { cn as l } from "@brightlocal/ui-components/lib/utils";
5
6
  import { Skeleton as m } from "@brightlocal/ui-components/skeleton";
6
- const u = g(
7
+ const N = x(
7
8
  [
8
9
  "flex",
9
10
  "items-center",
@@ -21,125 +22,126 @@ const u = g(
21
22
  variant: {
22
23
  filled: ["bg-card"],
23
24
  outline: ["bg-background", "border", "border-border"],
24
- loading: ["flex-col", "gap-2", "px-0", "pt-0", "pb-2"]
25
+ loading: ["flex-col", "gap-2", "px-0", "pt-0", "pb-3"]
25
26
  }
26
27
  },
27
28
  defaultVariants: {
28
29
  variant: "filled"
29
30
  }
30
31
  }
31
- ), x = i.forwardRef(
32
- ({ className: e, dataHook: t, trackingEl: a, trackingLabel: s, ...r }, d) => /* @__PURE__ */ o(
32
+ ), I = i.forwardRef(
33
+ ({ className: e, dataHook: a, trackingEl: t, trackingLabel: r, ...s }, d) => /* @__PURE__ */ o(
33
34
  "ul",
34
35
  {
35
36
  ref: d,
36
37
  className: l("flex flex-col gap-2", e),
37
- "data-hook": t,
38
+ "data-hook": a,
38
39
  "data-slot": "list",
39
- "data-tracking-el": a,
40
- "data-tracking-label": s,
41
- ...r
40
+ "data-tracking-el": t,
41
+ "data-tracking-label": r,
42
+ ...s
42
43
  }
43
44
  )
44
45
  );
45
- x.displayName = "List";
46
- const N = i.forwardRef(
46
+ I.displayName = "List";
47
+ const b = i.forwardRef(
47
48
  ({
48
- className: e,
49
+ asChild: e = !1,
50
+ className: a,
49
51
  variant: t,
50
- dataHook: a,
52
+ dataHook: r,
51
53
  trackingEl: s,
52
- trackingLabel: r,
53
- children: d,
54
- ...n
55
- }, c) => /* @__PURE__ */ o(
56
- "li",
54
+ trackingLabel: d,
55
+ children: n,
56
+ ...c
57
+ }, f) => /* @__PURE__ */ o(
58
+ e ? u : "li",
57
59
  {
58
- ref: c,
59
- className: l(u({ variant: t }), e),
60
- "data-hook": a,
60
+ ref: f,
61
+ className: l(N({ variant: t }), a),
62
+ "data-hook": r,
61
63
  "data-slot": "item",
62
64
  "data-tracking-el": s,
63
- "data-tracking-label": r,
64
- ...n,
65
- children: t === "loading" ? /* @__PURE__ */ f(p, { children: [
65
+ "data-tracking-label": d,
66
+ ...c,
67
+ children: t === "loading" ? /* @__PURE__ */ p(g, { children: [
66
68
  /* @__PURE__ */ o(m, { className: "h-4 w-full" }),
67
69
  /* @__PURE__ */ o(m, { className: "h-4 w-full" })
68
- ] }) : d
70
+ ] }) : n
69
71
  }
70
72
  )
71
73
  );
72
- N.displayName = "Item";
73
- const I = i.forwardRef(
74
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
74
+ b.displayName = "Item";
75
+ const k = i.forwardRef(
76
+ ({ className: e, ...a }, t) => /* @__PURE__ */ o(
75
77
  "div",
76
78
  {
77
- ref: a,
79
+ ref: t,
78
80
  className: l("shrink-0", e),
79
81
  "data-slot": "item-media",
80
- ...t
82
+ ...a
81
83
  }
82
84
  )
83
85
  );
84
- I.displayName = "ItemMedia";
85
- const b = i.forwardRef(
86
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
86
+ k.displayName = "ItemMedia";
87
+ const w = i.forwardRef(
88
+ ({ className: e, ...a }, t) => /* @__PURE__ */ o(
87
89
  "div",
88
90
  {
89
- ref: a,
91
+ ref: t,
90
92
  className: l("flex flex-1 flex-col gap-1", e),
91
93
  "data-slot": "item-content",
92
- ...t
94
+ ...a
93
95
  }
94
96
  )
95
97
  );
96
- b.displayName = "ItemContent";
97
- const k = i.forwardRef(
98
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
98
+ w.displayName = "ItemContent";
99
+ const y = i.forwardRef(
100
+ ({ className: e, ...a }, t) => /* @__PURE__ */ o(
99
101
  "div",
100
102
  {
101
- ref: a,
103
+ ref: t,
102
104
  className: l("text-foreground text-lg font-medium", e),
103
105
  "data-slot": "item-title",
104
- ...t
106
+ ...a
105
107
  }
106
108
  )
107
109
  );
108
- k.displayName = "ItemTitle";
109
- const w = i.forwardRef(
110
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
110
+ y.displayName = "ItemTitle";
111
+ const h = i.forwardRef(
112
+ ({ className: e, ...a }, t) => /* @__PURE__ */ o(
111
113
  "div",
112
114
  {
113
- ref: a,
115
+ ref: t,
114
116
  className: l("text-muted-foreground text-base", e),
115
117
  "data-slot": "item-description",
116
- ...t
118
+ ...a
117
119
  }
118
120
  )
119
121
  );
120
- w.displayName = "ItemDescription";
121
- const y = i.forwardRef(
122
- ({ className: e, ...t }, a) => /* @__PURE__ */ o(
122
+ h.displayName = "ItemDescription";
123
+ const v = i.forwardRef(
124
+ ({ className: e, ...a }, t) => /* @__PURE__ */ o(
123
125
  "div",
124
126
  {
125
- ref: a,
127
+ ref: t,
126
128
  className: l(
127
129
  "text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",
128
130
  e
129
131
  ),
130
132
  "data-slot": "item-actions",
131
- ...t
133
+ ...a
132
134
  }
133
135
  )
134
136
  );
135
- y.displayName = "ItemActions";
137
+ v.displayName = "ItemActions";
136
138
  export {
137
- N as Item,
138
- y as ItemActions,
139
- b as ItemContent,
140
- w as ItemDescription,
141
- I as ItemMedia,
142
- k as ItemTitle,
143
- x as List,
144
- u as itemVariants
139
+ b as Item,
140
+ v as ItemActions,
141
+ w as ItemContent,
142
+ h as ItemDescription,
143
+ k as ItemMedia,
144
+ y as ItemTitle,
145
+ I as List,
146
+ N as itemVariants
145
147
  };
package/dist/select.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),N=require("@radix-ui/react-select"),i=require("@brightlocal/icons"),k=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils");function q(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const a=q(N);function m({children:e,...r}){return t.jsx(a.Root,{"data-slot":"select",...r,children:e})}m.displayName="Select";function f(e){return t.jsx(a.Group,{"data-slot":"select-group",...e})}f.displayName="SelectGroup";function b(e){return t.jsx(a.Value,{"data-slot":"select-value",...e})}b.displayName="SelectValue";const C=k.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 g({className:e,children:r,placeholder:o,dataHook:l,error:c,...s}){const p=c||s["aria-invalid"]===!0||s["aria-invalid"]==="true",y=s["aria-required"]===!0||s["aria-required"]==="true",j=s["aria-label"]||o||"Select an option",w=p?"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(a.Trigger,{...s,"aria-invalid":p?"true":void 0,"aria-label":j,"aria-required":y?"true":void 0,className:n.cn(C(),w,e),"data-hook":l,"data-slot":"select-trigger",children:[r,t.jsx(a.Icon,{asChild:!0,children:t.jsx(i.ChevronDown,{className:"text-muted-foreground"})})]})}g.displayName="SelectTrigger";function x({className:e,children:r,position:o="popper",...l}){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"),s=o==="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(a.Portal,{children:t.jsxs(a.Content,{className:n.cn(c,s,e),"data-slot":"select-content",position:o,...l,children:[t.jsx(d,{}),t.jsx(a.Viewport,{className:n.cn("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(u,{})]})})}x.displayName="SelectContent";function S({className:e,...r}){return t.jsx(a.Label,{className:n.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}S.displayName="SelectLabel";function v({className:e,children:r,...o}){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(a.Item,{className:n.cn(l,e),"data-slot":"select-item",...o,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(i.Check,{})})}),t.jsx(a.ItemText,{children:r})]})}v.displayName="SelectItem";function h({className:e,...r}){return t.jsx(a.Separator,{className:n.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}h.displayName="SelectSeparator";function d({className:e,...r}){return t.jsx(a.ScrollUpButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(i.ChevronUp,{})})}d.displayName="SelectScrollUpButton";function u({className:e,...r}){return t.jsx(a.ScrollDownButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(i.ChevronDown,{})})}u.displayName="SelectScrollDownButton";exports.Select=m;exports.SelectContent=x;exports.SelectGroup=f;exports.SelectItem=v;exports.SelectLabel=S;exports.SelectScrollDownButton=u;exports.SelectScrollUpButton=d;exports.SelectSeparator=h;exports.SelectTrigger=g;exports.SelectValue=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),N=require("@radix-ui/react-select"),i=require("@brightlocal/icons"),k=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils");function q(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const a=q(N);function m({children:e,...r}){return t.jsx(a.Root,{"data-slot":"select",...r,children:e})}m.displayName="Select";function f(e){return t.jsx(a.Group,{"data-slot":"select-group",...e})}f.displayName="SelectGroup";function b(e){return t.jsx(a.Value,{"data-slot":"select-value",...e})}b.displayName="SelectValue";const C=k.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 g({className:e,children:r,placeholder:o,dataHook:l,error:c,...s}){const p=c||s["aria-invalid"]===!0||s["aria-invalid"]==="true",y=s["aria-required"]===!0||s["aria-required"]==="true",j=s["aria-label"]||o||"Select an option",w=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(a.Trigger,{...s,"aria-invalid":p?"true":void 0,"aria-label":j,"aria-required":y?"true":void 0,className:n.cn(C(),w,e),"data-hook":l,"data-slot":"select-trigger",children:[r,t.jsx(a.Icon,{asChild:!0,children:t.jsx(i.ChevronDown,{className:"text-muted-foreground"})})]})}g.displayName="SelectTrigger";function x({className:e,children:r,position:o="popper",...l}){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"),s=o==="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(a.Portal,{children:t.jsxs(a.Content,{className:n.cn(c,s,e),"data-slot":"select-content",position:o,...l,children:[t.jsx(d,{}),t.jsx(a.Viewport,{className:n.cn("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(u,{})]})})}x.displayName="SelectContent";function S({className:e,...r}){return t.jsx(a.Label,{className:n.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}S.displayName="SelectLabel";function v({className:e,children:r,...o}){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(a.Item,{className:n.cn(l,e),"data-slot":"select-item",...o,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(i.Check,{})})}),t.jsx(a.ItemText,{children:r})]})}v.displayName="SelectItem";function h({className:e,...r}){return t.jsx(a.Separator,{className:n.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}h.displayName="SelectSeparator";function d({className:e,...r}){return t.jsx(a.ScrollUpButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(i.ChevronUp,{})})}d.displayName="SelectScrollUpButton";function u({className:e,...r}){return t.jsx(a.ScrollDownButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(i.ChevronDown,{})})}u.displayName="SelectScrollDownButton";exports.Select=m;exports.SelectContent=x;exports.SelectGroup=f;exports.SelectItem=v;exports.SelectLabel=S;exports.SelectScrollDownButton=u;exports.SelectScrollUpButton=d;exports.SelectSeparator=h;exports.SelectTrigger=g;exports.SelectValue=b;
package/dist/select.js CHANGED
@@ -47,7 +47,7 @@ function k({
47
47
  error: i,
48
48
  ...n
49
49
  }) {
50
- const c = i || n["aria-invalid"] === !0 || n["aria-invalid"] === "true", f = n["aria-required"] === !0 || n["aria-required"] === "true", b = n["aria-label"] || l || "Select an option", g = c ? "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" : "";
50
+ const c = i || n["aria-invalid"] === !0 || n["aria-invalid"] === "true", f = n["aria-required"] === !0 || n["aria-required"] === "true", b = n["aria-label"] || l || "Select an option", g = 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" : "";
51
51
  return /* @__PURE__ */ d(
52
52
  a.Trigger,
53
53
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -161,7 +161,7 @@
161
161
  "sonner": "^2.0.7",
162
162
  "tailwind-merge": "^3.4.0",
163
163
  "vaul": "^1.1.2",
164
- "@brightlocal/icons": "2.0.0"
164
+ "@brightlocal/icons": "2.1.0"
165
165
  },
166
166
  "size-limit": [
167
167
  {