@brightlocal/ui-components 2.17.1 → 2.19.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 +83 -1
- package/component-meta.json +23 -7
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +23 -2
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +21 -19
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +64 -63
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +2 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +426 -403
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +22 -2
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +93 -72
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +1 -7
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +23 -3
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +44 -42
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +10 -0
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +30 -29
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +5 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +9 -7
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +44 -42
- package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.d.ts +25 -2
- package/dist/hooks/use-prefers-reduced-motion.d.ts.map +1 -1
- package/dist/hooks/use-prefers-reduced-motion.js +17 -11
- package/dist/index.cjs +1 -1
- package/dist/index.js +38 -37
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +13 -2
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +110 -53
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +44 -37
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +26 -25
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +17 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +29 -27
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.d.ts +15 -13
- package/dist/stepper.d.ts.map +1 -1
- package/dist/stepper.js +84 -85
- package/package.json +3 -3
- package/src/blocks/input-list.tsx +8 -1
- package/src/blocks/sidebar.tsx +47 -7
- package/src/components/alert-dialog.tsx +38 -4
- package/src/components/card.tsx +56 -9
- package/src/components/chip.tsx +1 -4
- package/src/components/dialog.tsx +39 -6
- package/src/components/dropdown-menu.tsx +7 -1
- package/src/components/field.tsx +6 -0
- package/src/components/global-layout.tsx +3 -1
- package/src/components/link.tsx +103 -27
- package/src/components/logo.tsx +19 -25
- package/src/components/map.tsx +1 -2
- package/src/components/progress.tsx +12 -6
- package/src/components/sheet.tsx +30 -5
- package/src/components/stepper.tsx +93 -80
- package/src/hooks/use-prefers-reduced-motion.ts +35 -5
package/dist/card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),V=require("react"),u=require("class-variance-authority"),c=require("@brightlocal/ui-components/lib/utils");function O(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const d=O(V),l=d.createContext({flush:!1,density:"default"});function f(a,t){return!a&&(t==="condensed"?"px-3":"px-section-md")}const T=u.cva(["flex","flex-col","rounded-xl","transition-colors","w-full","max-w-[400px]"],{variants:{variant:{filled:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"],"transparent-flush":["bg-transparent","text-foreground"]},density:{default:["gap-8","py-section-md"],condensed:["gap-3","py-3"]}},defaultVariants:{variant:"filled",density:"default"}}),m=d.forwardRef(({className:a,variant:t="filled",density:e="default",dataHook:r,trackingEl:s,trackingLabel:i,maxWidth:o,children:b,style:N,...w},j)=>{const k=t==="transparent-flush";d.useEffect(()=>{process.env.NODE_ENV!=="production"&&o!==void 0&&console.warn('Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").')},[o]);const R=o!==void 0?{maxWidth:typeof o=="number"?`${o}px`:o}:void 0;return n.jsx(l.Provider,{value:{flush:k,density:e},children:n.jsx("div",{ref:j,className:c.cn(T({variant:t,density:e}),a),"data-density":e,"data-hook":r,"data-slot":"card","data-tracking-el":s||`card-${t}`,"data-tracking-label":i,style:{...R,...N},...w,children:b})})});m.displayName="Card";const D=u.cva("@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",{variants:{align:{left:"items-start",center:"justify-items-center text-center",right:"items-start text-right"}},defaultVariants:{align:"left"}}),p=d.forwardRef(({className:a,align:t="left",dataHook:e,...r},s)=>{const{flush:i,density:o}=d.useContext(l);return n.jsx("div",{ref:s,className:c.cn(D({align:t}),f(i,o),a),"data-hook":e,"data-slot":"card-header",...r})});p.displayName="CardHeader";const _=u.cva("font-display font-medium",{variants:{size:{small:"text-base",default:"text-2xl"}},defaultVariants:{size:"default"}}),x=d.forwardRef(({className:a,size:t="default",dataHook:e,...r},s)=>n.jsx("div",{ref:s,className:c.cn(_({size:t}),a),"data-hook":e,"data-slot":"card-title",...r}));x.displayName="CardTitle";const C=d.forwardRef(({className:a,dataHook:t,...e},r)=>n.jsx("div",{ref:r,className:c.cn("text-muted-foreground text-sm leading-normal font-normal",a),"data-hook":t,"data-slot":"card-description",...e}));C.displayName="CardDescription";const g=d.forwardRef(({className:a,dataHook:t,...e},r)=>n.jsx("div",{ref:r,className:c.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),"data-hook":t,"data-slot":"card-action",...e}));g.displayName="CardAction";const y=d.forwardRef(({className:a,children:t,dataHook:e,...r},s)=>{const{flush:i,density:o}=d.useContext(l);return n.jsx("div",{ref:s,className:c.cn(f(i,o),a),"data-hook":e,"data-slot":"card-media",...r,children:n.jsx("div",{className:"overflow-hidden rounded-md","data-slot":"card-media-clip",children:t})})});y.displayName="CardMedia";const h=d.forwardRef(({className:a,dataHook:t,...e},r)=>{const{flush:s,density:i}=d.useContext(l);return n.jsx("div",{ref:r,className:c.cn(f(s,i),a),"data-hook":t,"data-slot":"card-content",...e})});h.displayName="CardContent";const v=d.forwardRef(({className:a,dataHook:t,...e},r)=>{const{flush:s,density:i}=d.useContext(l);return n.jsx("div",{ref:r,className:c.cn("flex items-center",f(s,i),a),"data-hook":t,"data-slot":"card-footer",...e})});v.displayName="CardFooter";exports.Card=m;exports.CardAction=g;exports.CardContent=h;exports.CardDescription=C;exports.CardFooter=v;exports.CardHeader=p;exports.CardMedia=y;exports.CardTitle=x;
|
package/dist/card.d.ts
CHANGED
|
@@ -58,11 +58,31 @@ type CardSubComponentProps = React.ComponentProps<"div"> & {
|
|
|
58
58
|
* Content to render inside the component
|
|
59
59
|
*/
|
|
60
60
|
children?: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* Data hook for automated testing
|
|
63
|
+
* @example "card-header", "card-title"
|
|
64
|
+
*/
|
|
65
|
+
dataHook?: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Alignment variant for CardHeader layout.
|
|
69
|
+
*/
|
|
70
|
+
type CardHeaderAlign = "left" | "center" | "right";
|
|
71
|
+
/**
|
|
72
|
+
* Props for the CardHeader component.
|
|
73
|
+
*/
|
|
74
|
+
type CardHeaderProps = CardSubComponentProps & {
|
|
75
|
+
/**
|
|
76
|
+
* Content alignment within the header.
|
|
77
|
+
* Use `"center"` for status screens with an illustration above heading and description.
|
|
78
|
+
* @default "left"
|
|
79
|
+
*/
|
|
80
|
+
align?: CardHeaderAlign;
|
|
61
81
|
};
|
|
62
82
|
/**
|
|
63
83
|
* Header section of the Card containing title and description.
|
|
64
84
|
*/
|
|
65
|
-
declare const CardHeader: React.ForwardRefExoticComponent<Omit<
|
|
85
|
+
declare const CardHeader: React.ForwardRefExoticComponent<Omit<CardHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
66
86
|
/**
|
|
67
87
|
* Size variant for the CardTitle.
|
|
68
88
|
*/
|
|
@@ -102,5 +122,5 @@ declare const CardContent: React.ForwardRefExoticComponent<Omit<CardSubComponent
|
|
|
102
122
|
*/
|
|
103
123
|
declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
104
124
|
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardMedia, CardContent, };
|
|
105
|
-
export type { CardProps, CardSubComponentProps, CardTitleProps, CardTitleSize, CardVariant, CardDensity, };
|
|
125
|
+
export type { CardProps, CardSubComponentProps, CardHeaderProps, CardHeaderAlign, CardTitleProps, CardTitleSize, CardVariant, CardDensity, };
|
|
106
126
|
//# sourceMappingURL=card.d.ts.map
|
package/dist/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;GAEG;AACH,KAAK,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAE7E;;GAEG;AACH,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WAAW,GACZ,CAAC;AAEF,YAAY,EACV,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,GACZ,CAAC"}
|
package/dist/card.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
3
|
import { cva as u } from "class-variance-authority";
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
4
|
+
import { cn as l } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
const c = d.createContext({ flush: !1, density: "default" });
|
|
6
|
+
function f(t, a) {
|
|
7
7
|
return !t && (a === "condensed" ? "px-3" : "px-section-md");
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const y = u(
|
|
10
10
|
[
|
|
11
11
|
"flex",
|
|
12
12
|
"flex-col",
|
|
@@ -43,39 +43,39 @@ const g = u(
|
|
|
43
43
|
density: "default"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
), v =
|
|
46
|
+
), v = d.forwardRef(
|
|
47
47
|
({
|
|
48
48
|
className: t,
|
|
49
49
|
variant: a = "filled",
|
|
50
50
|
density: e = "default",
|
|
51
|
-
dataHook:
|
|
51
|
+
dataHook: r,
|
|
52
52
|
trackingEl: o,
|
|
53
|
-
trackingLabel:
|
|
54
|
-
maxWidth:
|
|
53
|
+
trackingLabel: i,
|
|
54
|
+
maxWidth: s,
|
|
55
55
|
children: m,
|
|
56
56
|
style: p,
|
|
57
57
|
...x
|
|
58
58
|
}, C) => {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
process.env.NODE_ENV !== "production" &&
|
|
59
|
+
const g = a === "transparent-flush";
|
|
60
|
+
d.useEffect(() => {
|
|
61
|
+
process.env.NODE_ENV !== "production" && s !== void 0 && console.warn(
|
|
62
62
|
'Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").'
|
|
63
63
|
);
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
maxWidth: typeof
|
|
64
|
+
}, [s]);
|
|
65
|
+
const h = s !== void 0 ? {
|
|
66
|
+
maxWidth: typeof s == "number" ? `${s}px` : s
|
|
67
67
|
} : void 0;
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ n(c.Provider, { value: { flush: g, density: e }, children: /* @__PURE__ */ n(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
71
|
ref: C,
|
|
72
|
-
className:
|
|
72
|
+
className: l(y({ variant: a, density: e }), t),
|
|
73
73
|
"data-density": e,
|
|
74
|
-
"data-hook":
|
|
74
|
+
"data-hook": r,
|
|
75
75
|
"data-slot": "card",
|
|
76
76
|
"data-tracking-el": o || `card-${a}`,
|
|
77
|
-
"data-tracking-label":
|
|
78
|
-
style: { ...
|
|
77
|
+
"data-tracking-label": i,
|
|
78
|
+
style: { ...h, ...p },
|
|
79
79
|
...x,
|
|
80
80
|
children: m
|
|
81
81
|
}
|
|
@@ -83,20 +83,35 @@ const g = u(
|
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
v.displayName = "Card";
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
const N = u(
|
|
87
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
|
|
88
|
+
{
|
|
89
|
+
variants: {
|
|
90
|
+
align: {
|
|
91
|
+
left: "items-start",
|
|
92
|
+
center: "justify-items-center text-center",
|
|
93
|
+
right: "items-start text-right"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
defaultVariants: {
|
|
97
|
+
align: "left"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
), w = d.forwardRef(
|
|
101
|
+
({ className: t, align: a = "left", dataHook: e, ...r }, o) => {
|
|
102
|
+
const { flush: i, density: s } = d.useContext(c);
|
|
103
|
+
return /* @__PURE__ */ n(
|
|
90
104
|
"div",
|
|
91
105
|
{
|
|
92
|
-
ref:
|
|
93
|
-
className:
|
|
94
|
-
|
|
95
|
-
|
|
106
|
+
ref: o,
|
|
107
|
+
className: l(
|
|
108
|
+
N({ align: a }),
|
|
109
|
+
f(i, s),
|
|
96
110
|
t
|
|
97
111
|
),
|
|
112
|
+
"data-hook": e,
|
|
98
113
|
"data-slot": "card-header",
|
|
99
|
-
...
|
|
114
|
+
...r
|
|
100
115
|
}
|
|
101
116
|
);
|
|
102
117
|
}
|
|
@@ -112,93 +127,99 @@ const b = u("font-display font-medium", {
|
|
|
112
127
|
defaultVariants: {
|
|
113
128
|
size: "default"
|
|
114
129
|
}
|
|
115
|
-
}),
|
|
116
|
-
({ className: t, size: a = "default",
|
|
130
|
+
}), k = d.forwardRef(
|
|
131
|
+
({ className: t, size: a = "default", dataHook: e, ...r }, o) => /* @__PURE__ */ n(
|
|
117
132
|
"div",
|
|
118
133
|
{
|
|
119
|
-
ref:
|
|
120
|
-
className:
|
|
134
|
+
ref: o,
|
|
135
|
+
className: l(b({ size: a }), t),
|
|
136
|
+
"data-hook": e,
|
|
121
137
|
"data-slot": "card-title",
|
|
122
|
-
...
|
|
138
|
+
...r
|
|
123
139
|
}
|
|
124
140
|
)
|
|
125
141
|
);
|
|
126
|
-
|
|
127
|
-
const R =
|
|
128
|
-
({ className: t,
|
|
142
|
+
k.displayName = "CardTitle";
|
|
143
|
+
const R = d.forwardRef(
|
|
144
|
+
({ className: t, dataHook: a, ...e }, r) => /* @__PURE__ */ n(
|
|
129
145
|
"div",
|
|
130
146
|
{
|
|
131
|
-
ref:
|
|
132
|
-
className:
|
|
147
|
+
ref: r,
|
|
148
|
+
className: l(
|
|
133
149
|
"text-muted-foreground text-sm leading-normal font-normal",
|
|
134
150
|
t
|
|
135
151
|
),
|
|
152
|
+
"data-hook": a,
|
|
136
153
|
"data-slot": "card-description",
|
|
137
|
-
...
|
|
154
|
+
...e
|
|
138
155
|
}
|
|
139
156
|
)
|
|
140
157
|
);
|
|
141
158
|
R.displayName = "CardDescription";
|
|
142
|
-
const V =
|
|
143
|
-
({ className: t,
|
|
159
|
+
const V = d.forwardRef(
|
|
160
|
+
({ className: t, dataHook: a, ...e }, r) => /* @__PURE__ */ n(
|
|
144
161
|
"div",
|
|
145
162
|
{
|
|
146
|
-
ref:
|
|
147
|
-
className:
|
|
163
|
+
ref: r,
|
|
164
|
+
className: l(
|
|
148
165
|
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
149
166
|
t
|
|
150
167
|
),
|
|
168
|
+
"data-hook": a,
|
|
151
169
|
"data-slot": "card-action",
|
|
152
|
-
...
|
|
170
|
+
...e
|
|
153
171
|
}
|
|
154
172
|
)
|
|
155
173
|
);
|
|
156
174
|
V.displayName = "CardAction";
|
|
157
|
-
const T =
|
|
158
|
-
({ className: t, children: a,
|
|
159
|
-
const { flush:
|
|
160
|
-
return /* @__PURE__ */
|
|
175
|
+
const T = d.forwardRef(
|
|
176
|
+
({ className: t, children: a, dataHook: e, ...r }, o) => {
|
|
177
|
+
const { flush: i, density: s } = d.useContext(c);
|
|
178
|
+
return /* @__PURE__ */ n(
|
|
161
179
|
"div",
|
|
162
180
|
{
|
|
163
|
-
ref:
|
|
164
|
-
className:
|
|
181
|
+
ref: o,
|
|
182
|
+
className: l(f(i, s), t),
|
|
183
|
+
"data-hook": e,
|
|
165
184
|
"data-slot": "card-media",
|
|
166
|
-
...
|
|
167
|
-
children: /* @__PURE__ */
|
|
185
|
+
...r,
|
|
186
|
+
children: /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-md", "data-slot": "card-media-clip", children: a })
|
|
168
187
|
}
|
|
169
188
|
);
|
|
170
189
|
}
|
|
171
190
|
);
|
|
172
191
|
T.displayName = "CardMedia";
|
|
173
|
-
const
|
|
174
|
-
({ className: t,
|
|
175
|
-
const { flush:
|
|
176
|
-
return /* @__PURE__ */
|
|
192
|
+
const j = d.forwardRef(
|
|
193
|
+
({ className: t, dataHook: a, ...e }, r) => {
|
|
194
|
+
const { flush: o, density: i } = d.useContext(c);
|
|
195
|
+
return /* @__PURE__ */ n(
|
|
177
196
|
"div",
|
|
178
197
|
{
|
|
179
|
-
ref:
|
|
180
|
-
className:
|
|
198
|
+
ref: r,
|
|
199
|
+
className: l(f(o, i), t),
|
|
200
|
+
"data-hook": a,
|
|
181
201
|
"data-slot": "card-content",
|
|
182
|
-
...
|
|
202
|
+
...e
|
|
183
203
|
}
|
|
184
204
|
);
|
|
185
205
|
}
|
|
186
206
|
);
|
|
187
|
-
|
|
188
|
-
const D =
|
|
189
|
-
({ className: t,
|
|
190
|
-
const { flush:
|
|
191
|
-
return /* @__PURE__ */
|
|
207
|
+
j.displayName = "CardContent";
|
|
208
|
+
const D = d.forwardRef(
|
|
209
|
+
({ className: t, dataHook: a, ...e }, r) => {
|
|
210
|
+
const { flush: o, density: i } = d.useContext(c);
|
|
211
|
+
return /* @__PURE__ */ n(
|
|
192
212
|
"div",
|
|
193
213
|
{
|
|
194
|
-
ref:
|
|
195
|
-
className:
|
|
214
|
+
ref: r,
|
|
215
|
+
className: l(
|
|
196
216
|
"flex items-center",
|
|
197
|
-
|
|
217
|
+
f(o, i),
|
|
198
218
|
t
|
|
199
219
|
),
|
|
220
|
+
"data-hook": a,
|
|
200
221
|
"data-slot": "card-footer",
|
|
201
|
-
...
|
|
222
|
+
...e
|
|
202
223
|
}
|
|
203
224
|
);
|
|
204
225
|
}
|
|
@@ -207,10 +228,10 @@ D.displayName = "CardFooter";
|
|
|
207
228
|
export {
|
|
208
229
|
v as Card,
|
|
209
230
|
V as CardAction,
|
|
210
|
-
|
|
231
|
+
j as CardContent,
|
|
211
232
|
R as CardDescription,
|
|
212
233
|
D as CardFooter,
|
|
213
234
|
w as CardHeader,
|
|
214
235
|
T as CardMedia,
|
|
215
|
-
|
|
236
|
+
k as CardTitle
|
|
216
237
|
};
|
package/dist/chip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("react"),x=require("class-variance-authority"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),q=require("react"),x=require("class-variance-authority"),m=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),o=require("@brightlocal/ui-components/tooltip");function S(s){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>s[n]})}}return e.default=s,Object.freeze(e)}const r=S(q),v=x.cva(["inline-flex","items-center","justify-center","gap-0.5","rounded-full","font-medium","whitespace-nowrap","shrink-0","select-none","bg-secondary","text-foreground","transition-[color,background-color,box-shadow]","duration-150","ease-in-out","hover:bg-secondary/80","focus:outline-none","focus-visible:shadow-default","disabled:pointer-events-none","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:opacity-50"],{variants:{size:{md:["h-7","pl-2.5","pr-1","text-xs"],lg:["h-8","pl-4","pr-2","text-base"]}},defaultVariants:{size:"md"}}),g=x.cva(["inline-flex","items-center","justify-center","rounded-full","cursor-pointer","text-muted-foreground","hover:text-foreground","outline-none","focus-visible:text-foreground","disabled:pointer-events-none","disabled:opacity-50"],{variants:{size:{md:["size-6"],lg:["size-6"]}},defaultVariants:{size:"md"}}),j=r.forwardRef(({className:s,children:e,size:n="md",loading:a=!1,disabled:y=!1,onRemove:w,dataHook:u,trackingEl:l,trackingLabel:T,maxWidth:z=200,loadingLabel:C,removeAriaLabel:p,...k},N)=>{const f=y||a,b=16,i=r.useRef(null),[O,R]=r.useState(!1);r.useEffect(()=>{const c=()=>{i.current&&R(i.current.scrollWidth>i.current.clientWidth)};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[e]);const h=t.jsx("span",{ref:i,className:"truncate","data-slot":"chip-label",style:{maxWidth:z},children:e});return t.jsxs("div",{ref:N,"aria-disabled":f?"true":void 0,className:d.cn(v({size:n}),s),"data-hook":u,"data-slot":"chip","data-tracking-el":l,"data-tracking-label":T,...k,children:[O?t.jsx(o.TooltipProvider,{children:t.jsxs(o.Tooltip,{children:[t.jsx(o.TooltipTrigger,{asChild:!0,children:h}),t.jsx(o.TooltipContent,{dataHook:`${u}-tooltip`,sideOffset:8,children:e})]})}):h,a?t.jsx("span",{"aria-label":C??"Loading",className:d.cn(g({size:n})),"data-slot":"chip-loading",role:"status",children:t.jsx(m.LoaderCircle,{className:"animate-spin",size:b})}):t.jsx("button",{"aria-label":p?p.replace("{name}",typeof e=="string"?e:"chip"):`Remove ${typeof e=="string"?e:"chip"}`,className:d.cn(g({size:n})),"data-slot":"chip-delete","data-tracking-el":l?`${l}-delete`:void 0,disabled:f,tabIndex:-1,type:"button",onClick:w,children:t.jsx(m.X,{size:b})})]})});j.displayName="Chip";exports.Chip=j;exports.chipVariants=v;
|
package/dist/chip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../src/components/chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B;;GAEG;AACH,KAAK,QAAQ,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5B,QAAA,MAAM,YAAY;;8EAyCjB,CAAC;AAkCF;;GAEG;AACH,UAAU,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IACvE;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;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ACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,QAAA,MAAM,IAAI,+FAyGT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/chip.js
CHANGED
|
@@ -133,13 +133,7 @@ const I = h(
|
|
|
133
133
|
className: r(b({ size: a })),
|
|
134
134
|
"data-slot": "chip-loading",
|
|
135
135
|
role: "status",
|
|
136
|
-
children: /* @__PURE__ */ e(
|
|
137
|
-
R,
|
|
138
|
-
{
|
|
139
|
-
className: "animate-spin motion-reduce:animate-none",
|
|
140
|
-
size: u
|
|
141
|
-
}
|
|
142
|
-
)
|
|
136
|
+
children: /* @__PURE__ */ e(R, { className: "animate-spin", size: u })
|
|
143
137
|
}
|
|
144
138
|
) : /* @__PURE__ */ e(
|
|
145
139
|
"button",
|
package/dist/dialog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),w=require("@radix-ui/react-dialog"),R=require("@brightlocal/icons"),r=require("@brightlocal/ui-components/lib/utils");function c(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const s=c(h),l=c(w),g=l.Root;g.displayName="Dialog";const f=s.forwardRef(({dataHook:e,...a},t)=>o.jsx(l.Trigger,{ref:t,"data-slot":"dialog-trigger",...e!=null&&{"data-hook":e},...a}));f.displayName="DialogTrigger";function n({...e}){return o.jsx(l.Portal,{...e})}n.displayName="DialogPortal";const u=s.forwardRef(({...e},a)=>o.jsx(l.Close,{ref:a,"data-slot":"dialog-close",...e}));u.displayName="DialogClose";const d=s.forwardRef(({className:e,...a},t)=>o.jsx(l.Overlay,{ref:t,className:r.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"dialog-overlay",...a}));d.displayName="DialogOverlay";const m=s.forwardRef(({className:e,children:a,dataHook:t,trackingEl:i,trackingLabel:b,closeLabel:j,...N},v)=>o.jsxs(n,{children:[o.jsx(d,{}),o.jsxs(l.Content,{ref:v,className:r.cn("bg-background text-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 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",e),"data-hook":t,"data-slot":"dialog-content","data-tracking-el":i,"data-tracking-label":b,...N,children:[a,o.jsxs(l.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[o.jsx(R.X,{}),o.jsx("span",{className:"sr-only",children:j??"Close"})]})]})]}));m.displayName="DialogContent";const p=s.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:r.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...a}));p.displayName="DialogHeader";const D=s.forwardRef(({className:e,...a},t)=>o.jsx("div",{ref:t,className:r.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...a}));D.displayName="DialogFooter";const x=s.forwardRef(({className:e,dataHook:a,...t},i)=>o.jsx(l.Title,{ref:i,className:r.cn("text-lg leading-none font-semibold",e),"data-hook":a,"data-slot":"dialog-title",...t}));x.displayName="DialogTitle";const y=s.forwardRef(({className:e,dataHook:a,...t},i)=>o.jsx(l.Description,{ref:i,className:r.cn("text-muted-foreground text-sm",e),"data-hook":a,"data-slot":"dialog-description",...t}));y.displayName="DialogDescription";exports.Dialog=g;exports.DialogClose=u;exports.DialogContent=m;exports.DialogDescription=y;exports.DialogFooter=D;exports.DialogHeader=p;exports.DialogOverlay=d;exports.DialogPortal=n;exports.DialogTitle=x;exports.DialogTrigger=f;
|
package/dist/dialog.d.ts
CHANGED
|
@@ -74,16 +74,36 @@ declare const DialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedH
|
|
|
74
74
|
* @description Groups action buttons at the bottom of the dialog
|
|
75
75
|
*/
|
|
76
76
|
declare const DialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
77
|
+
/**
|
|
78
|
+
* Props for the DialogTitle component
|
|
79
|
+
*/
|
|
80
|
+
interface DialogTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {
|
|
81
|
+
/**
|
|
82
|
+
* Data hook for automated testing
|
|
83
|
+
* @example "dialog-title"
|
|
84
|
+
*/
|
|
85
|
+
dataHook?: string;
|
|
86
|
+
}
|
|
77
87
|
/**
|
|
78
88
|
* DialogTitle - The title of the dialog
|
|
79
89
|
* @description Renders an accessible title for the dialog
|
|
80
90
|
*/
|
|
81
|
-
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<
|
|
91
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
92
|
+
/**
|
|
93
|
+
* Props for the DialogDescription component
|
|
94
|
+
*/
|
|
95
|
+
interface DialogDescriptionProps extends React.ComponentProps<typeof DialogPrimitive.Description> {
|
|
96
|
+
/**
|
|
97
|
+
* Data hook for automated testing
|
|
98
|
+
* @example "dialog-description"
|
|
99
|
+
*/
|
|
100
|
+
dataHook?: string;
|
|
101
|
+
}
|
|
82
102
|
/**
|
|
83
103
|
* DialogDescription - The description of the dialog
|
|
84
104
|
* @description Renders an accessible description for the dialog
|
|
85
105
|
*/
|
|
86
|
-
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<
|
|
106
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
87
107
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
88
|
-
export type { DialogContentProps, DialogTriggerProps };
|
|
108
|
+
export type { DialogContentProps, DialogDescriptionProps, DialogTitleProps, DialogTriggerProps, };
|
|
89
109
|
//# sourceMappingURL=dialog.d.ts.map
|
package/dist/dialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D;;;GAGG;AACH,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAGpC;;GAEG;AACH,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,2GAUjB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AAkB,GACnB,CAAC"}
|
package/dist/dialog.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import * as l from "@radix-ui/react-dialog";
|
|
4
4
|
import { X as u } from "@brightlocal/icons";
|
|
5
5
|
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
const D = l.Root;
|
|
7
7
|
D.displayName = "Dialog";
|
|
8
|
-
const x = i.forwardRef(({ dataHook: a, ...
|
|
8
|
+
const x = i.forwardRef(({ dataHook: a, ...o }, e) => /* @__PURE__ */ t(
|
|
9
9
|
l.Trigger,
|
|
10
10
|
{
|
|
11
|
-
ref:
|
|
12
|
-
"data-hook": a,
|
|
11
|
+
ref: e,
|
|
13
12
|
"data-slot": "dialog-trigger",
|
|
14
|
-
...
|
|
13
|
+
...a != null && { "data-hook": a },
|
|
14
|
+
...o
|
|
15
15
|
}
|
|
16
16
|
));
|
|
17
17
|
x.displayName = "DialogTrigger";
|
|
18
|
-
function
|
|
18
|
+
function n({
|
|
19
19
|
...a
|
|
20
20
|
}) {
|
|
21
21
|
return /* @__PURE__ */ t(l.Portal, { ...a });
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
const y = i.forwardRef(({ ...a },
|
|
23
|
+
n.displayName = "DialogPortal";
|
|
24
|
+
const y = i.forwardRef(({ ...a }, o) => /* @__PURE__ */ t(l.Close, { ref: o, "data-slot": "dialog-close", ...a }));
|
|
25
25
|
y.displayName = "DialogClose";
|
|
26
|
-
const
|
|
26
|
+
const g = i.forwardRef(({ className: a, ...o }, e) => /* @__PURE__ */ t(
|
|
27
27
|
l.Overlay,
|
|
28
28
|
{
|
|
29
|
-
ref:
|
|
29
|
+
ref: e,
|
|
30
30
|
className: s(
|
|
31
31
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
32
32
|
a
|
|
33
33
|
),
|
|
34
34
|
"data-slot": "dialog-overlay",
|
|
35
|
-
...
|
|
35
|
+
...o
|
|
36
36
|
}
|
|
37
37
|
));
|
|
38
|
-
|
|
38
|
+
g.displayName = "DialogOverlay";
|
|
39
39
|
const N = i.forwardRef(
|
|
40
40
|
({
|
|
41
41
|
className: a,
|
|
42
|
-
children:
|
|
43
|
-
dataHook:
|
|
44
|
-
trackingEl:
|
|
42
|
+
children: o,
|
|
43
|
+
dataHook: e,
|
|
44
|
+
trackingEl: r,
|
|
45
45
|
trackingLabel: c,
|
|
46
46
|
closeLabel: f,
|
|
47
47
|
...m
|
|
48
|
-
}, p) => /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */ t(
|
|
50
|
-
/* @__PURE__ */
|
|
48
|
+
}, p) => /* @__PURE__ */ d(n, { children: [
|
|
49
|
+
/* @__PURE__ */ t(g, {}),
|
|
50
|
+
/* @__PURE__ */ d(
|
|
51
51
|
l.Content,
|
|
52
52
|
{
|
|
53
53
|
ref: p,
|
|
@@ -55,14 +55,14 @@ const N = i.forwardRef(
|
|
|
55
55
|
"bg-background text-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 border-card-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-xl border p-8 shadow-lg duration-200 sm:max-w-lg",
|
|
56
56
|
a
|
|
57
57
|
),
|
|
58
|
-
"data-hook":
|
|
58
|
+
"data-hook": e,
|
|
59
59
|
"data-slot": "dialog-content",
|
|
60
|
-
"data-tracking-el":
|
|
60
|
+
"data-tracking-el": r,
|
|
61
61
|
"data-tracking-label": c,
|
|
62
62
|
...m,
|
|
63
63
|
children: [
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */
|
|
64
|
+
o,
|
|
65
|
+
/* @__PURE__ */ d(l.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-8 right-8 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0", children: [
|
|
66
66
|
/* @__PURE__ */ t(u, {}),
|
|
67
67
|
/* @__PURE__ */ t("span", { className: "sr-only", children: f ?? "Close" })
|
|
68
68
|
] })
|
|
@@ -72,58 +72,60 @@ const N = i.forwardRef(
|
|
|
72
72
|
] })
|
|
73
73
|
);
|
|
74
74
|
N.displayName = "DialogContent";
|
|
75
|
-
const
|
|
75
|
+
const h = i.forwardRef(({ className: a, ...o }, e) => /* @__PURE__ */ t(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
|
-
ref:
|
|
78
|
+
ref: e,
|
|
79
79
|
className: s("flex flex-col gap-2 text-center sm:text-left", a),
|
|
80
80
|
"data-slot": "dialog-header",
|
|
81
|
-
...
|
|
81
|
+
...o
|
|
82
82
|
}
|
|
83
83
|
));
|
|
84
|
-
|
|
85
|
-
const
|
|
84
|
+
h.displayName = "DialogHeader";
|
|
85
|
+
const b = i.forwardRef(({ className: a, ...o }, e) => /* @__PURE__ */ t(
|
|
86
86
|
"div",
|
|
87
87
|
{
|
|
88
|
-
ref:
|
|
88
|
+
ref: e,
|
|
89
89
|
className: s(
|
|
90
90
|
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
91
91
|
a
|
|
92
92
|
),
|
|
93
93
|
"data-slot": "dialog-footer",
|
|
94
|
-
...
|
|
94
|
+
...o
|
|
95
95
|
}
|
|
96
96
|
));
|
|
97
|
-
|
|
98
|
-
const
|
|
97
|
+
b.displayName = "DialogFooter";
|
|
98
|
+
const v = i.forwardRef(({ className: a, dataHook: o, ...e }, r) => /* @__PURE__ */ t(
|
|
99
99
|
l.Title,
|
|
100
100
|
{
|
|
101
|
-
ref:
|
|
101
|
+
ref: r,
|
|
102
102
|
className: s("text-lg leading-none font-semibold", a),
|
|
103
|
+
"data-hook": o,
|
|
103
104
|
"data-slot": "dialog-title",
|
|
104
105
|
...e
|
|
105
106
|
}
|
|
106
107
|
));
|
|
107
|
-
|
|
108
|
-
const
|
|
108
|
+
v.displayName = "DialogTitle";
|
|
109
|
+
const w = i.forwardRef(({ className: a, dataHook: o, ...e }, r) => /* @__PURE__ */ t(
|
|
109
110
|
l.Description,
|
|
110
111
|
{
|
|
111
|
-
ref:
|
|
112
|
+
ref: r,
|
|
112
113
|
className: s("text-muted-foreground text-sm", a),
|
|
114
|
+
"data-hook": o,
|
|
113
115
|
"data-slot": "dialog-description",
|
|
114
116
|
...e
|
|
115
117
|
}
|
|
116
118
|
));
|
|
117
|
-
|
|
119
|
+
w.displayName = "DialogDescription";
|
|
118
120
|
export {
|
|
119
121
|
D as Dialog,
|
|
120
122
|
y as DialogClose,
|
|
121
123
|
N as DialogContent,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
w as DialogDescription,
|
|
125
|
+
b as DialogFooter,
|
|
126
|
+
h as DialogHeader,
|
|
127
|
+
g as DialogOverlay,
|
|
128
|
+
n as DialogPortal,
|
|
129
|
+
v as DialogTitle,
|
|
128
130
|
x as DialogTrigger
|
|
129
131
|
};
|