@brightlocal/ui-components 3.4.0 → 3.5.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/AI_USAGE.md +22 -3
- package/README.md +177 -109
- package/component-meta.json +1061 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +13 -2
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +4 -3
- package/dist/banner.cjs +1 -1
- package/dist/banner.d.ts +47 -11
- package/dist/banner.d.ts.map +1 -1
- package/dist/banner.js +156 -79
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +40 -5
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +59 -52
- package/dist/blocks/input-list.d.ts +1 -0
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +12 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +64 -63
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +47 -43
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +12 -0
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +115 -97
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -10
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +281 -296
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +430 -343
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -2
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +212 -207
- package/dist/count-indicator.cjs +1 -0
- package/dist/count-indicator.d.ts +85 -0
- package/dist/count-indicator.d.ts.map +1 -0
- package/dist/count-indicator.js +72 -0
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +101 -11
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +593 -523
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +26 -3
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +62 -47
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +8 -4
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +37 -38
- package/dist/file-upload.cjs +1 -0
- package/dist/file-upload.d.ts +546 -0
- package/dist/file-upload.d.ts.map +1 -0
- package/dist/file-upload.js +1103 -0
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +7 -2
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +52 -52
- package/dist/hooks/use-file-dropzone.cjs +1 -0
- package/dist/hooks/use-file-dropzone.d.ts +75 -0
- package/dist/hooks/use-file-dropzone.d.ts.map +1 -0
- package/dist/hooks/use-file-dropzone.js +133 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +29 -16
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +153 -36
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +676 -640
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +30 -1
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +131 -115
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +37 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +131 -114
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +6 -6
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.d.ts +27 -1
- package/dist/lib/empty-canvas.d.ts.map +1 -1
- package/dist/lib/empty-canvas.js +27 -23
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +19 -2
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +14 -9
- package/dist/lib/field-aria.cjs +1 -1
- package/dist/lib/field-aria.d.ts +4 -4
- package/dist/lib/field-aria.d.ts.map +1 -1
- package/dist/lib/field-aria.js +7 -5
- package/dist/lib/media-viewer-content.cjs +1 -1
- package/dist/lib/media-viewer-content.js +1 -1
- package/dist/lib/table-internal.cjs +1 -1
- package/dist/lib/table-internal.d.ts +19 -0
- package/dist/lib/table-internal.d.ts.map +1 -1
- package/dist/lib/table-internal.js +22 -7
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +13 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +103 -82
- package/dist/logo-mark.cjs +1 -1
- package/dist/logo-mark.d.ts +18 -2
- package/dist/logo-mark.d.ts.map +1 -1
- package/dist/logo-mark.js +159 -79
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.d.ts +50 -7
- package/dist/media-empty.d.ts.map +1 -1
- package/dist/media-empty.js +14 -13
- package/dist/media-viewer.cjs +1 -1
- package/dist/media-viewer.js +6 -6
- package/dist/multi-select-filter.cjs +1 -1
- package/dist/multi-select-filter.d.ts.map +1 -1
- package/dist/multi-select-filter.js +92 -101
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +11 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +17 -17
- package/dist/relative-date.d.ts +6 -0
- package/dist/relative-date.d.ts.map +1 -1
- package/dist/resizable.d.ts +1 -1
- package/dist/result-count.cjs +1 -1
- package/dist/result-count.d.ts +13 -16
- package/dist/result-count.d.ts.map +1 -1
- package/dist/result-count.js +24 -33
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +22 -3
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +152 -125
- package/dist/single-select-filter.cjs +1 -1
- package/dist/single-select-filter.d.ts.map +1 -1
- package/dist/single-select-filter.js +67 -76
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +77 -76
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +39 -3
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +127 -76
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts +34 -0
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +115 -19
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +137 -131
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +6 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +14 -13
- package/package.json +3 -4
- package/src/blocks/empty-state.tsx +108 -48
- package/src/blocks/input-list.tsx +1 -0
- package/src/blocks/sidebar.tsx +39 -16
- package/src/components/alert-dialog.tsx +18 -2
- package/src/components/banner.tsx +247 -68
- package/src/components/button.tsx +27 -10
- package/src/components/card.tsx +89 -7
- package/src/components/chart.tsx +47 -67
- package/src/components/combobox.tsx +221 -12
- package/src/components/command.tsx +83 -37
- package/src/components/count-indicator.tsx +188 -0
- package/src/components/data-table.tsx +506 -159
- package/src/components/dialog.tsx +74 -5
- package/src/components/drawer.tsx +52 -32
- package/src/components/file-upload.tsx +2574 -0
- package/src/components/global-layout.tsx +18 -5
- package/src/components/hover-card.tsx +395 -65
- package/src/components/input-chip.tsx +67 -2
- package/src/components/input-group.tsx +89 -6
- package/src/components/list.tsx +40 -3
- package/src/components/logo-mark.tsx +109 -25
- package/src/components/media-empty.tsx +62 -7
- package/src/components/multi-select-filter.tsx +9 -16
- package/src/components/pagination.tsx +15 -2
- package/src/components/relative-date.tsx +6 -0
- package/src/components/result-count.tsx +27 -54
- package/src/components/sheet.tsx +86 -8
- package/src/components/single-select-filter.tsx +9 -16
- package/src/components/table.tsx +16 -1
- package/src/components/tabs.tsx +223 -41
- package/src/components/textarea.tsx +271 -4
- package/src/components/tooltip.tsx +29 -2
- package/src/components/typography-text.tsx +7 -2
- package/src/hooks/use-file-dropzone.ts +325 -0
- package/src/index.ts +3 -0
- package/src/lib/empty-canvas.tsx +47 -20
- package/src/lib/empty-chip.tsx +38 -3
- package/src/lib/field-aria.tsx +11 -6
- package/src/lib/table-internal.ts +38 -0
package/dist/alert-dialog.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";const g=require("./_virtual/_rolldown/runtime.cjs");let
|
|
1
|
+
"use client";const g=require("./_virtual/_rolldown/runtime.cjs");let r=require("react");r=g.__toESM(r,1);let s=require("@brightlocal/ui-components/lib/utils"),l=require("react/jsx-runtime"),i=require("@radix-ui/react-alert-dialog");i=g.__toESM(i,1);let N=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock"),c=require("@brightlocal/ui-components/button");function u({dataHook:a,trackingEl:e,trackingLabel:t,...o}){return(0,l.jsx)(i.Root,{"data-hook":a,"data-slot":"alert-dialog","data-tracking-el":e,"data-tracking-label":t,...o})}u.displayName="AlertDialog";var m=r.forwardRef((a,e)=>(0,l.jsx)(i.Trigger,{ref:e,"data-slot":"alert-dialog-trigger",...a}));m.displayName="AlertDialogTrigger";function d({...a}){return(0,l.jsx)(i.Portal,{...a})}d.displayName="AlertDialogPortal";var n=r.forwardRef(({className:a,...e},t)=>(0,l.jsx)(i.Overlay,{ref:t,className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:duration-slow fixed inset-0 z-50 bg-black/50 ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in",a),"data-slot":"alert-dialog-overlay",...e}));n.displayName="AlertDialogOverlay";var f=r.forwardRef(({className:a,dataHook:e,...t},o)=>((0,N.useOverlayPointerLock)(),(0,l.jsxs)(d,{children:[(0,l.jsx)(n,{}),(0,l.jsx)(i.Content,{ref:o,className:(0,s.cn)("border-border bg-background 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-[state=open]:duration-slow fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in sm:max-w-lg",a),"data-hook":e,"data-slot":"alert-dialog-content",...t})]})));f.displayName="AlertDialogContent";var A=r.forwardRef(({className:a,...e},t)=>(0,l.jsx)("div",{ref:t,className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",a),"data-slot":"alert-dialog-header",...e}));A.displayName="AlertDialogHeader";var D=r.forwardRef(({className:a,...e},t)=>(0,l.jsx)("div",{ref:t,className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),"data-slot":"alert-dialog-footer",...e}));D.displayName="AlertDialogFooter";var p=r.forwardRef(({className:a,dataHook:e,...t},o)=>(0,l.jsx)(i.Title,{ref:o,className:(0,s.cn)("text-heading-section",a),"data-hook":e,"data-slot":"alert-dialog-title",...t}));p.displayName="AlertDialogTitle";var x=r.forwardRef(({className:a,dataHook:e,...t},o)=>(0,l.jsx)(i.Description,{ref:o,className:(0,s.cn)("text-body-sm text-muted-foreground",a),"data-hook":e,"data-slot":"alert-dialog-description",...t}));x.displayName="AlertDialogDescription";var _=r.forwardRef(({className:a,variant:e="primary",dataHook:t,...o},v)=>(0,l.jsx)(i.Action,{ref:v,className:(0,s.cn)((0,c.ButtonVariants)({variant:e}),a),"data-hook":t,"data-slot":"alert-dialog-action","data-variant":e,...o}));_.displayName="AlertDialogAction";var y=r.forwardRef(({className:a,dataHook:e,...t},o)=>(0,l.jsx)(i.Cancel,{ref:o,className:(0,s.cn)((0,c.ButtonVariants)({variant:"outline"}),a),"data-hook":e,"data-slot":"alert-dialog-cancel",...t}));y.displayName="AlertDialogCancel";exports.AlertDialog=u;exports.AlertDialogAction=_;exports.AlertDialogCancel=y;exports.AlertDialogContent=f;exports.AlertDialogDescription=x;exports.AlertDialogFooter=D;exports.AlertDialogHeader=A;exports.AlertDialogOverlay=n;exports.AlertDialogPortal=d;exports.AlertDialogTitle=p;exports.AlertDialogTrigger=m;
|
package/dist/alert-dialog.d.ts
CHANGED
|
@@ -25,7 +25,18 @@ declare namespace AlertDialogPortal {
|
|
|
25
25
|
var displayName: string;
|
|
26
26
|
}
|
|
27
27
|
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Props for the AlertDialogContent component
|
|
30
|
+
*/
|
|
31
|
+
interface AlertDialogContentProps extends React.ComponentProps<typeof AlertDialogPrimitive.Content> {
|
|
32
|
+
/**
|
|
33
|
+
* Data hook for automated testing, rendered as `data-hook` on the dialog
|
|
34
|
+
* panel (the `role="alertdialog"` element)
|
|
35
|
+
* @example "delete-location-dialog-content"
|
|
36
|
+
*/
|
|
37
|
+
dataHook?: string;
|
|
38
|
+
}
|
|
39
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
40
|
declare const AlertDialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
41
|
declare const AlertDialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
31
42
|
/**
|
|
@@ -83,5 +94,5 @@ interface AlertDialogCancelProps extends React.ComponentProps<typeof AlertDialog
|
|
|
83
94
|
}
|
|
84
95
|
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogCancelProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
85
96
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
86
|
-
export type { AlertDialogActionProps, AlertDialogActionVariant, AlertDialogCancelProps, AlertDialogDescriptionProps, AlertDialogProps, AlertDialogTitleProps, };
|
|
97
|
+
export type { AlertDialogActionProps, AlertDialogActionVariant, AlertDialogCancelProps, AlertDialogContentProps, AlertDialogDescriptionProps, AlertDialogProps, AlertDialogTitleProps, };
|
|
87
98
|
//# sourceMappingURL=alert-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../src/components/alert-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAKrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE,UAAU,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CACrD,OAAO,oBAAoB,CAAC,IAAI,CACjC;IACC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iBAAS,WAAW,CAAC,EACnB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAUlB;kBAfQ,WAAW;;;AAmBpB,QAAA,MAAM,kBAAkB,8KAStB,CAAC;AAIH,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,qBAE1D;kBAJQ,iBAAiB;;;AAQ1B,QAAA,MAAM,kBAAkB,wKAatB,CAAC;AAIH,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../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GAEG;AACH,UAAU,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAChE,OAAO,oBAAoB,CAAC,WAAW,CACxC;IACC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,sBAAsB,uHAW1B,CAAC;AAIH,sEAAsE;AACtE,KAAK,wBAAwB,GAAG,OAAO,CACrC,aAAa,EACb,SAAS,GAAG,WAAW,GAAG,aAAa,CACxC,CAAC;AAEF;;GAEG;AACH,UAAU,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAC3D,OAAO,oBAAoB,CAAC,MAAM,CACnC;IACC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,iBAAiB,+GAYrB,CAAC;AAIH;;GAEG;AACH,UAAU,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAC3D,OAAO,oBAAoB,CAAC,MAAM,CACnC;IACC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,iBAAiB,+GAWrB,CAAC;AAIH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;AAEF,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
|
package/dist/alert-dialog.js
CHANGED
|
@@ -32,11 +32,12 @@ var g = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(i.Overlay,
|
|
|
32
32
|
...t
|
|
33
33
|
}));
|
|
34
34
|
g.displayName = "AlertDialogOverlay";
|
|
35
|
-
var A = r.forwardRef(({ className: a,
|
|
36
|
-
ref:
|
|
35
|
+
var A = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => (f(), /* @__PURE__ */ m(n, { children: [/* @__PURE__ */ o(g, {}), /* @__PURE__ */ o(i.Content, {
|
|
36
|
+
ref: l,
|
|
37
37
|
className: d("border-border bg-background 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-[state=open]:duration-slow fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg ease-out data-[state=closed]:duration-250 data-[state=closed]:ease-in sm:max-w-lg", a),
|
|
38
|
+
"data-hook": t,
|
|
38
39
|
"data-slot": "alert-dialog-content",
|
|
39
|
-
...
|
|
40
|
+
...e
|
|
40
41
|
})] })));
|
|
41
42
|
A.displayName = "AlertDialogContent";
|
|
42
43
|
var D = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o("div", {
|
package/dist/banner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const I=require("./_virtual/_rolldown/runtime.cjs");let t=require("react");t=I.__toESM(t,1);let E=require("@brightlocal/icons"),i=require("@brightlocal/ui-components/lib/utils"),s=require("react/jsx-runtime"),L=require("class-variance-authority"),V=require("@brightlocal/ui-components/button");var p=(0,L.cva)("relative w-full",{variants:{variant:{sky:"bg-highlight-sky text-highlight-sky-foreground",violet:"bg-highlight-violet text-highlight-violet-foreground"},layout:{horizontal:"flex flex-col gap-3 rounded-xl p-4 md:grid md:grid-cols-1 md:gap-x-5 md:pl-5 md:has-[>[data-slot=banner-illustration]]:grid-cols-[auto_minmax(0,1fr)]",vertical:"flex flex-col items-center gap-4 rounded-xl p-5 text-center",hero:"grid grid-cols-1 justify-items-center gap-6 rounded-3xl p-6 text-center md:grid-cols-[minmax(0,1fr)_16rem] md:grid-rows-[1fr_auto_auto_1fr_auto] md:justify-items-stretch md:gap-x-12 md:gap-y-0 md:p-10 md:text-left"},dismissible:{true:"",false:""}},compoundVariants:[{layout:"horizontal",dismissible:!0,className:"pr-12 md:pr-14"},{layout:"vertical",dismissible:!0,className:"pt-12 has-[>[data-slot=banner-illustration]]:pt-5"}],defaultVariants:{variant:"sky",layout:"horizontal",dismissible:!1}}),b={sky:"text-highlight-sky-muted-foreground",violet:"text-highlight-violet-muted-foreground"},A={sky:"border-highlight-sky-foreground/15",violet:"border-highlight-violet-foreground/15"},$={sky:"text-highlight-sky-foreground hover:bg-highlight-sky-foreground/10",violet:"text-highlight-violet-foreground hover:bg-highlight-violet-foreground/10"},l=t.createContext({variant:"sky",layout:"horizontal",inDetails:!1,titleId:"",registerTitle:()=>()=>{}}),k=t.forwardRef(({className:o,variant:e="sky",size:r="sm",flow:n="horizontal",onDismiss:a,dismissLabel:c,dataHook:d,trackingEl:u,trackingLabel:m,children:D,...M},q)=>{const h=t.useId(),[R,x]=t.useState(0),y=t.useCallback(()=>(x(f=>f+1),()=>x(f=>f-1)),[]),g=r==="lg"?"hero":n,T=t.useMemo(()=>({variant:e,layout:g,inDetails:!1,titleId:h,registerTitle:y}),[e,g,h,y]),v=a!=null;return(0,s.jsx)(l.Provider,{value:T,children:(0,s.jsxs)("section",{ref:q,"aria-labelledby":R>0?h:void 0,className:(0,i.cn)(p({variant:e,layout:g,dismissible:v}),o),"data-flow":r==="lg"?void 0:n,"data-hook":d,"data-size":r,"data-slot":"banner","data-tracking-el":u||`banner-${e}`,"data-tracking-label":m,...M,children:[D,v&&(0,s.jsxs)(V.Button,{iconOnly:!0,className:(0,i.cn)("absolute top-2 right-2",$[e]),dataHook:`${d}-dismiss`,variant:"ghost",onClick:a,children:[(0,s.jsx)(E.X,{}),(0,s.jsx)("span",{className:"sr-only",children:c??"Dismiss"})]})]})})});k.displayName="Banner";var P={horizontal:"size-14 md:row-span-2 md:size-16 md:self-center",vertical:"size-14 md:size-16",hero:"size-40 md:col-start-2 md:row-start-1 md:row-end-5 md:size-48 md:self-center md:justify-self-center"},w=t.forwardRef(({className:o,dataHook:e,...r},n)=>{const{layout:a}=t.useContext(l);return(0,s.jsx)("div",{ref:n,"aria-hidden":"true",className:(0,i.cn)("flex shrink-0 [&>svg]:size-full",P[a],o),"data-hook":e,"data-slot":"banner-illustration",...r})});w.displayName="BannerIllustration";var S={horizontal:"gap-1",vertical:"items-center gap-1",hero:"items-center gap-3 md:col-start-1 md:row-start-2 md:items-start"},B=t.forwardRef(({className:o,dataHook:e,...r},n)=>{const{layout:a}=t.useContext(l);return(0,s.jsx)("div",{ref:n,className:(0,i.cn)("flex min-w-0 flex-col",S[a],o),"data-hook":e,"data-slot":"banner-content",...r})});B.displayName="BannerContent";var _=t.forwardRef(({className:o,dataHook:e,...r},n)=>{const{variant:a}=t.useContext(l);return(0,s.jsx)("div",{ref:n,className:(0,i.cn)("text-body-sm font-semibold break-words",b[a],o),"data-hook":e,"data-slot":"banner-eyebrow",...r})});_.displayName="BannerEyebrow";var j=t.forwardRef(({className:o,level:e,dataHook:r,...n},a)=>{const{layout:c,titleId:d,registerTitle:u}=t.useContext(l);t.useLayoutEffect(()=>u(),[u]);const m=e?`h${e}`:"div";return(0,s.jsx)(m,{ref:a,className:(0,i.cn)(c==="hero"?"text-display":"text-heading-subsection","break-words",o),"data-hook":r,"data-slot":"banner-title",id:d,...n})});j.displayName="BannerTitle";var N=t.forwardRef(({className:o,dataHook:e,...r},n)=>{const{variant:a,layout:c,inDetails:d}=t.useContext(l);return(0,s.jsx)("div",{ref:n,className:(0,i.cn)(c==="hero"&&!d?"text-body":"text-body-sm","break-words",b[a],o),"data-hook":e,"data-slot":"banner-description",...r})});N.displayName="BannerDescription";var O={horizontal:"",vertical:"justify-center",hero:"w-full justify-center max-md:[&>*]:flex-1 md:col-start-1 md:row-start-3 md:mt-5 md:w-auto md:justify-start"},C=t.forwardRef(({className:o,dataHook:e,...r},n)=>{const{layout:a}=t.useContext(l);return(0,s.jsx)("div",{ref:n,className:(0,i.cn)("flex shrink-0 flex-wrap items-center gap-2",O[a],o),"data-hook":e,"data-slot":"banner-actions",...r})});C.displayName="BannerActions";var z=t.forwardRef(({className:o,dataHook:e,...r},n)=>{const a=t.useContext(l),{variant:c}=a,d=t.useMemo(()=>({...a,inDetails:!0}),[a]);return(0,s.jsx)(l.Provider,{value:d,children:(0,s.jsx)("div",{ref:n,className:(0,i.cn)("w-full border-t pt-8 text-left md:col-span-2 md:row-start-5 md:mt-10",A[c],o),"data-hook":e,"data-slot":"banner-details",...r})})});z.displayName="BannerDetails";exports.Banner=k;exports.BannerActions=C;exports.BannerContent=B;exports.BannerDescription=N;exports.BannerDetails=z;exports.BannerEyebrow=_;exports.BannerIllustration=w;exports.BannerTitle=j;exports.bannerVariants=p;
|
package/dist/banner.d.ts
CHANGED
|
@@ -3,8 +3,13 @@ import * as React from "react";
|
|
|
3
3
|
type BannerVariant = "sky" | "violet";
|
|
4
4
|
/** Document outline level for the banner title */
|
|
5
5
|
type BannerTitleLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
/** Scale of the banner — a compact strip or a hero */
|
|
7
|
+
type BannerSize = "sm" | "lg";
|
|
8
|
+
/** How an `sm` banner arranges its parts — `lg` has one fixed composition */
|
|
9
|
+
type BannerFlow = "horizontal" | "vertical";
|
|
6
10
|
declare const bannerVariants: (props?: ({
|
|
7
11
|
variant?: "violet" | "sky" | null | undefined;
|
|
12
|
+
layout?: "horizontal" | "vertical" | "hero" | null | undefined;
|
|
8
13
|
dismissible?: boolean | null | undefined;
|
|
9
14
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
15
|
/** Props for the Banner root */
|
|
@@ -17,6 +22,20 @@ interface BannerProps extends React.ComponentPropsWithoutRef<"section"> {
|
|
|
17
22
|
* @default "sky"
|
|
18
23
|
*/
|
|
19
24
|
variant?: BannerVariant;
|
|
25
|
+
/**
|
|
26
|
+
* Scale. `sm` is the compact strip — a nudge next to the page's content.
|
|
27
|
+
* `lg` is the hero — it carries the page (a feature introduction or a plan
|
|
28
|
+
* gate): display title, large illustration on the right, the actions under
|
|
29
|
+
* the text and an optional `BannerDetails` underneath.
|
|
30
|
+
* @default "sm"
|
|
31
|
+
*/
|
|
32
|
+
size?: BannerSize;
|
|
33
|
+
/**
|
|
34
|
+
* How an `sm` banner arranges its parts. `vertical` stacks and centres them
|
|
35
|
+
* — for narrow containers like a sidebar or a card column. Ignored at `lg`.
|
|
36
|
+
* @default "horizontal"
|
|
37
|
+
*/
|
|
38
|
+
flow?: BannerFlow;
|
|
20
39
|
/**
|
|
21
40
|
* Called when the close button is pressed. The close button renders only
|
|
22
41
|
* when this is set; the consumer decides where the dismissal is remembered.
|
|
@@ -36,9 +55,10 @@ interface BannerProps extends React.ComponentPropsWithoutRef<"section"> {
|
|
|
36
55
|
* Branded, dismissible banner that invites the user to do something optional
|
|
37
56
|
* — an invitation, not a fault. Use an Alert when something happened.
|
|
38
57
|
*
|
|
39
|
-
* Compose it from `BannerIllustration`, `BannerContent` (with
|
|
40
|
-
* and `BannerDescription`)
|
|
41
|
-
*
|
|
58
|
+
* Compose it from `BannerIllustration`, `BannerContent` (with an optional
|
|
59
|
+
* `BannerEyebrow`, `BannerTitle` and `BannerDescription`), `BannerActions`
|
|
60
|
+
* and — at `lg` — `BannerDetails`. The root owns the surface, the layout and
|
|
61
|
+
* the close button.
|
|
42
62
|
*/
|
|
43
63
|
declare const Banner: React.ForwardRefExoticComponent<BannerProps & React.RefAttributes<HTMLElement>>;
|
|
44
64
|
/** Shared props for the Banner parts */
|
|
@@ -48,15 +68,22 @@ interface BannerPartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
48
68
|
}
|
|
49
69
|
/**
|
|
50
70
|
* Decorative illustration from `@brightlocal/illustrations`, sized by the
|
|
51
|
-
* banner (56px, 64px from `md`). Hidden from
|
|
52
|
-
* the illustration's `variant` unset so it
|
|
71
|
+
* banner (56px, 64px from `md`; 160px, 192px from `md` at `lg`). Hidden from
|
|
72
|
+
* assistive technologies. Leave the illustration's `variant` unset so it
|
|
73
|
+
* follows light/dark mode.
|
|
53
74
|
*/
|
|
54
75
|
declare const BannerIllustration: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
76
|
/**
|
|
56
|
-
* The text column — takes the remaining width. Holds `
|
|
57
|
-
* `BannerDescription`, plus anything else the composition
|
|
77
|
+
* The text column — takes the remaining width. Holds `BannerEyebrow`,
|
|
78
|
+
* `BannerTitle` and `BannerDescription`, plus anything else the composition
|
|
79
|
+
* needs.
|
|
58
80
|
*/
|
|
59
81
|
declare const BannerContent: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
82
|
+
/**
|
|
83
|
+
* Short line above the title that frames it — the plan it belongs to, the
|
|
84
|
+
* feature's name. Optional; in the surface's muted text role.
|
|
85
|
+
*/
|
|
86
|
+
declare const BannerEyebrow: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
87
|
/** Props for BannerTitle */
|
|
61
88
|
interface BannerTitleProps extends Omit<BannerPartProps, "id"> {
|
|
62
89
|
/**
|
|
@@ -72,10 +99,19 @@ declare const BannerTitle: React.ForwardRefExoticComponent<BannerTitleProps & Re
|
|
|
72
99
|
/** One or two lines of supporting copy, in the surface's muted text role */
|
|
73
100
|
declare const BannerDescription: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
74
101
|
/**
|
|
75
|
-
* The action(s) —
|
|
76
|
-
* `
|
|
102
|
+
* The action(s), always under the text — one outline Button (`sm` in the
|
|
103
|
+
* strip, default size at `lg`), optionally followed by a ghost Button for a
|
|
104
|
+
* secondary action such as "Learn more". Centred in the vertical strip,
|
|
105
|
+
* full width on phones at `lg`.
|
|
77
106
|
*/
|
|
78
107
|
declare const BannerActions: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
79
|
-
|
|
80
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Supporting content under a divider, full width — a grid of benefits, a
|
|
110
|
+
* checklist. `lg` only: the strip has no room for it. `BannerEyebrow` and
|
|
111
|
+
* `BannerDescription` inside it take the compact scale and the surface's
|
|
112
|
+
* muted role, so the content needs no colour or type classes of its own.
|
|
113
|
+
*/
|
|
114
|
+
declare const BannerDetails: React.ForwardRefExoticComponent<BannerPartProps & React.RefAttributes<HTMLDivElement>>;
|
|
115
|
+
export { Banner, BannerIllustration, BannerContent, BannerEyebrow, BannerTitle, BannerDescription, BannerActions, BannerDetails, bannerVariants, };
|
|
116
|
+
export type { BannerProps, BannerPartProps, BannerTitleProps, BannerVariant, BannerSize, BannerFlow, BannerTitleLevel, };
|
|
81
117
|
//# sourceMappingURL=banner.d.ts.map
|
package/dist/banner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,8EAA8E;AAC9E,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtC,kDAAkD;AAClD,KAAK,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/components/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,8EAA8E;AAC9E,KAAK,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtC,kDAAkD;AAClD,KAAK,gBAAgB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE9C,sDAAsD;AACtD,KAAK,UAAU,GAAG,IAAI,GAA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;;GAKG;AACH,QAAA,MAAM,aAAa,wFAkBlB,CAAC;AAGF;;;;;GAKG;AACH,QAAA,MAAM,aAAa,wFAyBlB,CAAC;AAGF,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,GACf,CAAC;AACF,YAAY,EACV,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,UAAU,EACV,gBAAgB,GACjB,CAAC"}
|
package/dist/banner.js
CHANGED
|
@@ -1,130 +1,207 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
|
-
import { X as
|
|
2
|
+
import { X as z } from "@brightlocal/icons";
|
|
3
3
|
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { cva as
|
|
6
|
-
import { Button as
|
|
7
|
-
var
|
|
4
|
+
import { jsx as i, jsxs as x } from "react/jsx-runtime";
|
|
5
|
+
import { cva as R } from "class-variance-authority";
|
|
6
|
+
import { Button as j } from "@brightlocal/ui-components/button";
|
|
7
|
+
var D = R("relative w-full", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
sky: "bg-highlight-sky text-highlight-sky-foreground",
|
|
11
11
|
violet: "bg-highlight-violet text-highlight-violet-foreground"
|
|
12
12
|
},
|
|
13
|
+
layout: {
|
|
14
|
+
horizontal: "flex flex-col gap-3 rounded-xl p-4 md:grid md:grid-cols-1 md:gap-x-5 md:pl-5 md:has-[>[data-slot=banner-illustration]]:grid-cols-[auto_minmax(0,1fr)]",
|
|
15
|
+
vertical: "flex flex-col items-center gap-4 rounded-xl p-5 text-center",
|
|
16
|
+
hero: "grid grid-cols-1 justify-items-center gap-6 rounded-3xl p-6 text-center md:grid-cols-[minmax(0,1fr)_16rem] md:grid-rows-[1fr_auto_auto_1fr_auto] md:justify-items-stretch md:gap-x-12 md:gap-y-0 md:p-10 md:text-left"
|
|
17
|
+
},
|
|
13
18
|
dismissible: {
|
|
14
|
-
true: "
|
|
19
|
+
true: "",
|
|
15
20
|
false: ""
|
|
16
21
|
}
|
|
17
22
|
},
|
|
23
|
+
compoundVariants: [{
|
|
24
|
+
layout: "horizontal",
|
|
25
|
+
dismissible: !0,
|
|
26
|
+
className: "pr-12 md:pr-14"
|
|
27
|
+
}, {
|
|
28
|
+
layout: "vertical",
|
|
29
|
+
dismissible: !0,
|
|
30
|
+
className: "pt-12 has-[>[data-slot=banner-illustration]]:pt-5"
|
|
31
|
+
}],
|
|
18
32
|
defaultVariants: {
|
|
19
33
|
variant: "sky",
|
|
34
|
+
layout: "horizontal",
|
|
20
35
|
dismissible: !1
|
|
21
36
|
}
|
|
22
|
-
}),
|
|
37
|
+
}), b = {
|
|
23
38
|
sky: "text-highlight-sky-muted-foreground",
|
|
24
39
|
violet: "text-highlight-violet-muted-foreground"
|
|
40
|
+
}, M = {
|
|
41
|
+
sky: "border-highlight-sky-foreground/15",
|
|
42
|
+
violet: "border-highlight-violet-foreground/15"
|
|
25
43
|
}, T = {
|
|
26
44
|
sky: "text-highlight-sky-foreground hover:bg-highlight-sky-foreground/10",
|
|
27
45
|
violet: "text-highlight-violet-foreground hover:bg-highlight-violet-foreground/10"
|
|
28
|
-
},
|
|
46
|
+
}, l = t.createContext({
|
|
29
47
|
variant: "sky",
|
|
48
|
+
layout: "horizontal",
|
|
49
|
+
inDetails: !1,
|
|
30
50
|
titleId: "",
|
|
31
51
|
registerTitle: () => () => {
|
|
32
52
|
}
|
|
33
|
-
}), I = t.forwardRef(({ className:
|
|
34
|
-
const
|
|
53
|
+
}), I = t.forwardRef(({ className: s, variant: e = "sky", size: r = "sm", flow: o = "horizontal", onDismiss: a, dismissLabel: m, dataHook: d, trackingEl: u, trackingLabel: c, children: k, ...w }, N) => {
|
|
54
|
+
const h = t.useId(), [B, p] = t.useState(0), v = t.useCallback(() => (p((g) => g + 1), () => p((g) => g - 1)), []), f = r === "lg" ? "hero" : o, C = t.useMemo(() => ({
|
|
35
55
|
variant: e,
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
layout: f,
|
|
57
|
+
inDetails: !1,
|
|
58
|
+
titleId: h,
|
|
59
|
+
registerTitle: v
|
|
38
60
|
}), [
|
|
39
61
|
e,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
f,
|
|
63
|
+
h,
|
|
64
|
+
v
|
|
65
|
+
]), y = a != null;
|
|
66
|
+
return /* @__PURE__ */ i(l.Provider, {
|
|
67
|
+
value: C,
|
|
68
|
+
children: /* @__PURE__ */ x("section", {
|
|
69
|
+
ref: N,
|
|
70
|
+
"aria-labelledby": B > 0 ? h : void 0,
|
|
71
|
+
className: n(D({
|
|
49
72
|
variant: e,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
73
|
+
layout: f,
|
|
74
|
+
dismissible: y
|
|
75
|
+
}), s),
|
|
76
|
+
"data-flow": r === "lg" ? void 0 : o,
|
|
77
|
+
"data-hook": d,
|
|
78
|
+
"data-size": r,
|
|
53
79
|
"data-slot": "banner",
|
|
54
|
-
"data-tracking-el":
|
|
55
|
-
"data-tracking-label":
|
|
56
|
-
...
|
|
57
|
-
children: [
|
|
80
|
+
"data-tracking-el": u || `banner-${e}`,
|
|
81
|
+
"data-tracking-label": c,
|
|
82
|
+
...w,
|
|
83
|
+
children: [k, y && /* @__PURE__ */ x(j, {
|
|
58
84
|
iconOnly: !0,
|
|
59
85
|
className: n("absolute top-2 right-2", T[e]),
|
|
60
|
-
dataHook: `${
|
|
86
|
+
dataHook: `${d}-dismiss`,
|
|
61
87
|
variant: "ghost",
|
|
62
88
|
onClick: a,
|
|
63
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ i(z, {}), /* @__PURE__ */ i("span", {
|
|
64
90
|
className: "sr-only",
|
|
65
|
-
children:
|
|
91
|
+
children: m ?? "Dismiss"
|
|
66
92
|
})]
|
|
67
93
|
})]
|
|
68
94
|
})
|
|
69
95
|
});
|
|
70
96
|
});
|
|
71
97
|
I.displayName = "Banner";
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
98
|
+
var _ = {
|
|
99
|
+
horizontal: "size-14 md:row-span-2 md:size-16 md:self-center",
|
|
100
|
+
vertical: "size-14 md:size-16",
|
|
101
|
+
hero: "size-40 md:col-start-2 md:row-start-1 md:row-end-5 md:size-48 md:self-center md:justify-self-center"
|
|
102
|
+
}, L = t.forwardRef(({ className: s, dataHook: e, ...r }, o) => {
|
|
103
|
+
const { layout: a } = t.useContext(l);
|
|
104
|
+
return /* @__PURE__ */ i("div", {
|
|
105
|
+
ref: o,
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
className: n("flex shrink-0 [&>svg]:size-full", _[a], s),
|
|
108
|
+
"data-hook": e,
|
|
109
|
+
"data-slot": "banner-illustration",
|
|
110
|
+
...r
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
L.displayName = "BannerIllustration";
|
|
114
|
+
var E = {
|
|
115
|
+
horizontal: "gap-1",
|
|
116
|
+
vertical: "items-center gap-1",
|
|
117
|
+
hero: "items-center gap-3 md:col-start-1 md:row-start-2 md:items-start"
|
|
118
|
+
}, V = t.forwardRef(({ className: s, dataHook: e, ...r }, o) => {
|
|
119
|
+
const { layout: a } = t.useContext(l);
|
|
120
|
+
return /* @__PURE__ */ i("div", {
|
|
121
|
+
ref: o,
|
|
122
|
+
className: n("flex min-w-0 flex-col", E[a], s),
|
|
123
|
+
"data-hook": e,
|
|
124
|
+
"data-slot": "banner-content",
|
|
125
|
+
...r
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
V.displayName = "BannerContent";
|
|
129
|
+
var $ = t.forwardRef(({ className: s, dataHook: e, ...r }, o) => {
|
|
130
|
+
const { variant: a } = t.useContext(l);
|
|
131
|
+
return /* @__PURE__ */ i("div", {
|
|
132
|
+
ref: o,
|
|
133
|
+
className: n("text-body-sm font-semibold break-words", b[a], s),
|
|
134
|
+
"data-hook": e,
|
|
135
|
+
"data-slot": "banner-eyebrow",
|
|
136
|
+
...r
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
$.displayName = "BannerEyebrow";
|
|
140
|
+
var A = t.forwardRef(({ className: s, level: e, dataHook: r, ...o }, a) => {
|
|
141
|
+
const { layout: m, titleId: d, registerTitle: u } = t.useContext(l);
|
|
142
|
+
t.useLayoutEffect(() => u(), [u]);
|
|
143
|
+
const c = e ? `h${e}` : "div";
|
|
144
|
+
return /* @__PURE__ */ i(c, {
|
|
145
|
+
ref: a,
|
|
146
|
+
className: n(m === "hero" ? "text-display" : "text-heading-subsection", "break-words", s),
|
|
147
|
+
"data-hook": r,
|
|
97
148
|
"data-slot": "banner-title",
|
|
98
149
|
id: d,
|
|
99
|
-
...
|
|
150
|
+
...o
|
|
100
151
|
});
|
|
101
152
|
});
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
const { variant:
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
ref:
|
|
107
|
-
className: n("text-body-sm break-words",
|
|
153
|
+
A.displayName = "BannerTitle";
|
|
154
|
+
var P = t.forwardRef(({ className: s, dataHook: e, ...r }, o) => {
|
|
155
|
+
const { variant: a, layout: m, inDetails: d } = t.useContext(l);
|
|
156
|
+
return /* @__PURE__ */ i("div", {
|
|
157
|
+
ref: o,
|
|
158
|
+
className: n(m === "hero" && !d ? "text-body" : "text-body-sm", "break-words", b[a], s),
|
|
108
159
|
"data-hook": e,
|
|
109
160
|
"data-slot": "banner-description",
|
|
110
|
-
...
|
|
161
|
+
...r
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
P.displayName = "BannerDescription";
|
|
165
|
+
var O = {
|
|
166
|
+
horizontal: "",
|
|
167
|
+
vertical: "justify-center",
|
|
168
|
+
hero: "w-full justify-center max-md:[&>*]:flex-1 md:col-start-1 md:row-start-3 md:mt-5 md:w-auto md:justify-start"
|
|
169
|
+
}, S = t.forwardRef(({ className: s, dataHook: e, ...r }, o) => {
|
|
170
|
+
const { layout: a } = t.useContext(l);
|
|
171
|
+
return /* @__PURE__ */ i("div", {
|
|
172
|
+
ref: o,
|
|
173
|
+
className: n("flex shrink-0 flex-wrap items-center gap-2", O[a], s),
|
|
174
|
+
"data-hook": e,
|
|
175
|
+
"data-slot": "banner-actions",
|
|
176
|
+
...r
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
S.displayName = "BannerActions";
|
|
180
|
+
var X = t.forwardRef(({ className: s, dataHook: e, ...r }, o) => {
|
|
181
|
+
const a = t.useContext(l), { variant: m } = a, d = t.useMemo(() => ({
|
|
182
|
+
...a,
|
|
183
|
+
inDetails: !0
|
|
184
|
+
}), [a]);
|
|
185
|
+
return /* @__PURE__ */ i(l.Provider, {
|
|
186
|
+
value: d,
|
|
187
|
+
children: /* @__PURE__ */ i("div", {
|
|
188
|
+
ref: o,
|
|
189
|
+
className: n("w-full border-t pt-8 text-left md:col-span-2 md:row-start-5 md:mt-10", M[m], s),
|
|
190
|
+
"data-hook": e,
|
|
191
|
+
"data-slot": "banner-details",
|
|
192
|
+
...r
|
|
193
|
+
})
|
|
111
194
|
});
|
|
112
195
|
});
|
|
113
|
-
|
|
114
|
-
var A = t.forwardRef(({ className: r, dataHook: e, ...a }, i) => /* @__PURE__ */ o("div", {
|
|
115
|
-
ref: i,
|
|
116
|
-
className: n("flex shrink-0 flex-wrap items-center gap-2", r),
|
|
117
|
-
"data-hook": e,
|
|
118
|
-
"data-slot": "banner-actions",
|
|
119
|
-
...a
|
|
120
|
-
}));
|
|
121
|
-
A.displayName = "BannerActions";
|
|
196
|
+
X.displayName = "BannerDetails";
|
|
122
197
|
export {
|
|
123
198
|
I as Banner,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
$ as
|
|
129
|
-
|
|
199
|
+
S as BannerActions,
|
|
200
|
+
V as BannerContent,
|
|
201
|
+
P as BannerDescription,
|
|
202
|
+
X as BannerDetails,
|
|
203
|
+
$ as BannerEyebrow,
|
|
204
|
+
L as BannerIllustration,
|
|
205
|
+
A as BannerTitle,
|
|
206
|
+
D as bannerVariants
|
|
130
207
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const I=require("../_virtual/_rolldown/runtime.cjs"),f=require("../typography-text.cjs"),S=require("../typography-heading.cjs"),v=require("../lib/block-illustration.cjs"),k=require("../lib/empty-chip.cjs");let r=require("react");r=I.__toESM(r,1);let s=require("@brightlocal/ui-components/lib/utils"),e=require("react/jsx-runtime");var L={md:"subsection",lg:"section"},H={lg:2,md:3},E=r.forwardRef((n,c)=>{const{className:o,dataHook:a,title:d,description:m,children:p,titleLevel:q,iconVariant:N="filled",iconShape:j="circle",trackingEl:g,trackingLabel:u,size:t="md",...b}=n,y=n.icon,x=n.illustration,l=t!=="md"?"center":n.align??"center",i=b;delete i.icon,delete i.illustration,delete i.align;const T=k.hasEmptyActions(p),_=t==="lg"&&x?(0,e.jsx)(v.BlockIllustration,{size:v.BLOCK_ILLUSTRATION_SIZE,slot:"empty-state-illustration",children:x}):y?(0,e.jsx)(k.EmptyChip,{className:t!=="lg"&&l==="center"?"mb-1":void 0,dataHook:`${a}-icon`,icon:y,shape:j,slot:"empty-state-icon",variant:N}):null,h=(0,e.jsxs)("div",{className:(0,s.cn)("flex flex-col",t==="sm"?"gap-1":"gap-2",l==="center"&&"w-full items-center"),"data-slot":"empty-state-content",children:[t==="sm"?(0,e.jsx)(f.TypographyText,{align:"center","data-slot":"empty-state-title",dataHook:`${a}-title`,variant:"body-sm",children:d}):(0,e.jsx)(S.TypographyHeading,{align:l==="center"?"center":"left",className:t==="lg"?"max-w-lg":void 0,"data-slot":"empty-state-title",dataHook:`${a}-title`,level:q??H[t],variant:L[t],children:d}),m?(0,e.jsx)(f.TypographyText,{align:l==="center"?"center":"left",className:"max-w-md",color:"muted","data-slot":"empty-state-description",dataHook:`${a}-message`,variant:"body-sm",children:m}):null,T?(0,e.jsx)("div",{className:(0,s.cn)("flex items-center gap-4",t==="sm"?"mt-3 flex-wrap":"mt-2",l==="center"&&"justify-center"),"data-slot":"empty-state-actions",children:p}):null]});return t==="lg"?(0,e.jsxs)("div",{ref:c,className:(0,s.cn)("flex w-full flex-col items-center gap-6",o),"data-hook":a,"data-size":"lg","data-slot":"empty-state","data-tracking-el":g??"empty-state","data-tracking-label":u,...i,children:[_,h]}):(0,e.jsxs)("div",{ref:c,className:(0,s.cn)(l==="left"?"flex items-start gap-4 text-left":(0,s.cn)("flex flex-col items-center text-center",t==="sm"?"gap-1":"gap-2"),o),"data-hook":a,"data-size":t,"data-slot":"empty-state","data-tracking-el":g??"empty-state","data-tracking-label":u,...i,children:[_,h]})});E.displayName="EmptyState";exports.EmptyState=E;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TypographyHeadingLevel } from '../typography-heading';
|
|
2
|
-
import { LogoMarkVariant } from '../logo-mark';
|
|
2
|
+
import { LogoMarkShape, LogoMarkVariant } from '../logo-mark';
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
/**
|
|
5
5
|
* Visual prominence of the block. It sets the title's role, the kind of
|
|
6
6
|
* visual, and the rhythm — never the layout, which stays the consumer's.
|
|
7
7
|
*/
|
|
8
|
-
type EmptyStateSize = "md" | "lg";
|
|
8
|
+
type EmptyStateSize = "sm" | "md" | "lg";
|
|
9
9
|
/**
|
|
10
10
|
* Where an md block's content sits relative to its visual.
|
|
11
11
|
* - `center` — the column centres under the chip. For a standalone area the
|
|
@@ -25,6 +25,12 @@ type EmptyStateAlign = "center" | "left";
|
|
|
25
25
|
* - `transparent` — the bare glyph, no container.
|
|
26
26
|
*/
|
|
27
27
|
type EmptyStateIconVariant = LogoMarkVariant;
|
|
28
|
+
/**
|
|
29
|
+
* The chip's shape — LogoMark's shape, controlling the border-radius.
|
|
30
|
+
* - `circle` — fully round (default for empty states)
|
|
31
|
+
* - `square` — rounded square
|
|
32
|
+
*/
|
|
33
|
+
type EmptyStateIconShape = LogoMarkShape;
|
|
28
34
|
/**
|
|
29
35
|
* The parts every empty state has, at either size.
|
|
30
36
|
*/
|
|
@@ -69,6 +75,12 @@ interface EmptyStateBaseProps extends Omit<React.ComponentPropsWithoutRef<"div">
|
|
|
69
75
|
* @default "filled"
|
|
70
76
|
*/
|
|
71
77
|
iconVariant?: EmptyStateIconVariant;
|
|
78
|
+
/**
|
|
79
|
+
* The icon chip's shape. `circle` is the default for empty states;
|
|
80
|
+
* `square` matches the brand-mark shape used elsewhere.
|
|
81
|
+
* @default "circle"
|
|
82
|
+
*/
|
|
83
|
+
iconShape?: EmptyStateIconShape;
|
|
72
84
|
/**
|
|
73
85
|
* Tracking element identifier for analytics.
|
|
74
86
|
*/
|
|
@@ -129,9 +141,32 @@ interface EmptyStateLgProps extends EmptyStateBaseProps {
|
|
|
129
141
|
align?: never;
|
|
130
142
|
}
|
|
131
143
|
/**
|
|
132
|
-
*
|
|
144
|
+
* The block at sm: a popover, menu or drawer list that found nothing.
|
|
145
|
+
*/
|
|
146
|
+
interface EmptyStateSmProps extends Omit<EmptyStateBaseProps, "titleLevel"> {
|
|
147
|
+
size: "sm";
|
|
148
|
+
/**
|
|
149
|
+
* The glyph in the chip, e.g. `<SearchX />` for a search that matched
|
|
150
|
+
* nothing. Decorative: the chip is `aria-hidden`.
|
|
151
|
+
*/
|
|
152
|
+
icon?: React.ReactNode;
|
|
153
|
+
/**
|
|
154
|
+
* Not available at sm: the title is a body-sm line, never a heading.
|
|
155
|
+
*/
|
|
156
|
+
titleLevel?: never;
|
|
157
|
+
/**
|
|
158
|
+
* Not available at sm: a list message is centred.
|
|
159
|
+
*/
|
|
160
|
+
align?: never;
|
|
161
|
+
/**
|
|
162
|
+
* Not available at sm — use `icon`.
|
|
163
|
+
*/
|
|
164
|
+
illustration?: never;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Props for the EmptyState block. `size` discriminates the three shapes.
|
|
133
168
|
*/
|
|
134
|
-
export type EmptyStateProps = EmptyStateMdProps | EmptyStateLgProps;
|
|
169
|
+
export type EmptyStateProps = EmptyStateSmProps | EmptyStateMdProps | EmptyStateLgProps;
|
|
135
170
|
/**
|
|
136
171
|
* The empty block: a visual, a title, one supporting line, and up to two
|
|
137
172
|
* actions. Pure content — compose the position around it: `size="lg"` inside
|
|
@@ -186,5 +221,5 @@ export type EmptyStateProps = EmptyStateMdProps | EmptyStateLgProps;
|
|
|
186
221
|
*/
|
|
187
222
|
declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
|
|
188
223
|
export { EmptyState };
|
|
189
|
-
export type { EmptyStateAlign, EmptyStateIconVariant, EmptyStateSize };
|
|
224
|
+
export type { EmptyStateAlign, EmptyStateIconShape, EmptyStateIconVariant, EmptyStateSize, };
|
|
190
225
|
//# sourceMappingURL=empty-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/blocks/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,kCAAkC,CAAC;AAM1C,OAAO,
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/blocks/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,M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