@brightlocal/ui-components 2.26.0 → 3.0.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 +9 -2
- package/component-meta.json +4010 -255
- package/deprecations.json +189 -2
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +18 -18
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +11 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +31 -28
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +4 -4
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +15 -11
- package/dist/blocks/empty-state.cjs +1 -0
- package/dist/blocks/empty-state.d.ts +172 -0
- package/dist/blocks/empty-state.d.ts.map +1 -0
- package/dist/blocks/empty-state.js +155 -0
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +124 -108
- package/dist/blocks/progress-state.cjs +1 -0
- package/dist/blocks/progress-state.d.ts +121 -0
- package/dist/blocks/progress-state.d.ts.map +1 -0
- package/dist/blocks/progress-state.js +368 -0
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +297 -296
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +44 -40
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +23 -23
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +37 -38
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +24 -2
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +57 -55
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +23 -2
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +94 -91
- package/dist/chart-empty.cjs +1 -0
- package/dist/chart-empty.d.ts +59 -0
- package/dist/chart-empty.d.ts.map +1 -0
- package/dist/chart-empty.js +29 -0
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +6 -1
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +183 -183
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +47 -44
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +4 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +143 -141
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +74 -77
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +26 -29
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +182 -13
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +462 -314
- package/dist/description.cjs +1 -1
- package/dist/description.js +5 -5
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +20 -20
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +8 -11
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +17 -20
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +29 -25
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +58 -6
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +278 -194
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +56 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +32 -0
- package/dist/header.d.ts +13 -0
- package/dist/header.d.ts.map +1 -1
- package/dist/hooks/use-delayed-pending.cjs +1 -0
- package/dist/hooks/use-delayed-pending.d.ts +34 -0
- package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
- package/dist/hooks/use-delayed-pending.js +17 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +523 -494
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +25 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +9 -9
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.js +51 -51
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +25 -28
- package/dist/lib/block-illustration.cjs +1 -0
- package/dist/lib/block-illustration.d.ts +28 -0
- package/dist/lib/block-illustration.d.ts.map +1 -0
- package/dist/lib/block-illustration.js +21 -0
- package/dist/lib/empty-canvas.cjs +1 -0
- package/dist/lib/empty-canvas.d.ts +27 -0
- package/dist/lib/empty-canvas.d.ts.map +1 -0
- package/dist/lib/empty-canvas.js +62 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +10 -8
- package/dist/lib/optical-center.cjs +1 -0
- package/dist/lib/optical-center.d.ts +12 -0
- package/dist/lib/optical-center.d.ts.map +1 -0
- package/dist/lib/optical-center.js +11 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +28 -5
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +8 -6
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +52 -20
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +87 -81
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +60 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +187 -164
- package/dist/media-empty.cjs +1 -0
- package/dist/media-empty.d.ts +72 -0
- package/dist/media-empty.d.ts.map +1 -0
- package/dist/media-empty.js +45 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +17 -20
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +7 -7
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +127 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +189 -98
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +37 -3
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +102 -64
- package/dist/route-progress.cjs +1 -0
- package/dist/route-progress.d.ts +103 -0
- package/dist/route-progress.d.ts.map +1 -0
- package/dist/route-progress.js +106 -0
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +19 -18
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +8 -8
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +35 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +103 -66
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +38 -3
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +43 -20
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +32 -36
- package/dist/spinner.cjs +1 -0
- package/dist/spinner.d.ts +57 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +35 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.d.ts.map +1 -1
- package/dist/stepper.js +23 -22
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +36 -29
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.d.ts +10 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +8 -8
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +8 -8
- package/dist/typography-heading.cjs +1 -0
- package/dist/typography-heading.d.ts +116 -0
- package/dist/typography-heading.d.ts.map +1 -0
- package/dist/typography-heading.js +84 -0
- package/dist/typography-text.cjs +1 -0
- package/dist/typography-text.d.ts +113 -0
- package/dist/typography-text.d.ts.map +1 -0
- package/dist/typography-text.js +81 -0
- package/dist/typography.d.ts +13 -0
- package/dist/typography.d.ts.map +1 -1
- package/package.json +42 -2
- package/src/blocks/empty-state.tsx +424 -0
- package/src/blocks/input-list.tsx +66 -36
- package/src/blocks/progress-state.tsx +542 -0
- package/src/blocks/sidebar.tsx +46 -40
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/alert.tsx +27 -13
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +8 -4
- package/src/components/breadcrumb.tsx +9 -4
- package/src/components/button.tsx +5 -8
- package/src/components/calendar.tsx +5 -6
- package/src/components/callout.tsx +48 -15
- package/src/components/card.tsx +52 -17
- package/src/components/chart-empty.tsx +116 -0
- package/src/components/chart.tsx +43 -17
- package/src/components/chip.tsx +9 -6
- package/src/components/combobox.tsx +21 -12
- package/src/components/command.tsx +9 -10
- package/src/components/context-menu.tsx +6 -9
- package/src/components/data-table.tsx +405 -31
- package/src/components/description.tsx +1 -1
- package/src/components/dialog.tsx +2 -2
- package/src/components/drawer.tsx +2 -5
- package/src/components/dropdown-menu.tsx +8 -11
- package/src/components/field.tsx +8 -4
- package/src/components/global-layout.tsx +264 -65
- package/src/components/grid.tsx +130 -0
- package/src/components/header.tsx +13 -0
- package/src/components/hover-card.tsx +1 -1
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +10 -13
- package/src/components/link.tsx +39 -5
- package/src/components/list.tsx +18 -14
- package/src/components/map.tsx +101 -5
- package/src/components/media-empty.tsx +156 -0
- package/src/components/menubar.tsx +7 -10
- package/src/components/navigation-menu.tsx +1 -1
- package/src/components/pagination.tsx +279 -1
- package/src/components/progress.tsx +120 -11
- package/src/components/route-progress.tsx +354 -0
- package/src/components/select.tsx +5 -4
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +89 -7
- package/src/components/skeleton.tsx +78 -7
- package/src/components/sonner.tsx +5 -14
- package/src/components/spinner.tsx +94 -0
- package/src/components/stepper.tsx +6 -7
- package/src/components/table.tsx +11 -4
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +10 -0
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/components/typography-heading.tsx +229 -0
- package/src/components/typography-text.tsx +225 -0
- package/src/components/typography.tsx +13 -0
- package/src/hooks/use-delayed-pending.ts +60 -0
- package/src/index.ts +12 -0
- package/src/lib/block-illustration.tsx +88 -0
- package/src/lib/empty-canvas.tsx +128 -0
- package/src/lib/optical-center.tsx +45 -0
- package/src/lib/utils.ts +26 -0
package/dist/separator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as h, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import { cva as m } from "class-variance-authority";
|
|
4
4
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
5
5
|
const u = m("bg-border shrink-0", {
|
|
@@ -41,7 +41,7 @@ const u = m("bg-border shrink-0", {
|
|
|
41
41
|
defaultVariants: {
|
|
42
42
|
spacing: "default"
|
|
43
43
|
}
|
|
44
|
-
}), c =
|
|
44
|
+
}), c = n.forwardRef(
|
|
45
45
|
({
|
|
46
46
|
className: t,
|
|
47
47
|
orientation: a = "horizontal",
|
|
@@ -56,7 +56,7 @@ const u = m("bg-border shrink-0", {
|
|
|
56
56
|
"aria-orientation": "vertical",
|
|
57
57
|
role: "separator"
|
|
58
58
|
} : {};
|
|
59
|
-
return
|
|
59
|
+
return n.createElement(a === "horizontal" ? "hr" : "div", {
|
|
60
60
|
ref: f,
|
|
61
61
|
className: p(u({ orientation: a, spacing: e }), t),
|
|
62
62
|
"data-hook": o,
|
|
@@ -70,7 +70,7 @@ const u = m("bg-border shrink-0", {
|
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
c.displayName = "Separator";
|
|
73
|
-
const N =
|
|
73
|
+
const N = n.forwardRef(
|
|
74
74
|
({
|
|
75
75
|
className: t,
|
|
76
76
|
children: a,
|
|
@@ -88,9 +88,9 @@ const N = l.forwardRef(
|
|
|
88
88
|
"data-tracking-el": o,
|
|
89
89
|
"data-tracking-label": s,
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ l(c, { className: "flex-1" }),
|
|
92
|
+
/* @__PURE__ */ l("span", { className: "text-body-sm text-muted-foreground shrink-0 leading-none whitespace-nowrap", children: a }),
|
|
93
|
+
/* @__PURE__ */ l(c, { className: "flex-1" })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
)
|
package/dist/sheet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),R=require("react"),O=require("@radix-ui/react-dialog"),C=require("class-variance-authority"),P=require("@brightlocal/icons"),n=require("@brightlocal/ui-components/lib/utils"),T=require("@brightlocal/ui-components/scroll-area"),q=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=f(R),r=f(O),z=C.cva(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","ease-out","data-[state=closed]:ease-in","data-[state=open]:duration-slow","data-[state=closed]:duration-250"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","border-l"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","border-r"]},size:{default:[],sm:[]}},compoundVariants:[{side:["left","right"],size:"default",className:["w-3/4","sm:max-w-sm"]},{side:["left","right"],size:"sm",className:["w-fit","min-w-(--ds-container-2xs)","max-w-(--ds-container-xs)"]}],defaultVariants:{side:"right",size:"default"}});function u({...e}){return s.jsx(r.Root,{"data-slot":"sheet",modal:!0,...e})}u.displayName="Sheet";const m=i.forwardRef(({dataHook:e,...t},a)=>s.jsx(r.Trigger,{ref:a,"data-slot":"sheet-trigger",...e!=null&&{"data-hook":e},...t}));m.displayName="SheetTrigger";const p=i.forwardRef(({...e},t)=>s.jsx(r.Close,{ref:t,"data-slot":"sheet-close",...e}));p.displayName="SheetClose";function c({...e}){return s.jsx(r.Portal,{"data-slot":"sheet-portal",...e})}c.displayName="SheetPortal";const h=i.forwardRef(({className:e,...t},a)=>s.jsx(r.Overlay,{ref:a,className:n.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":"sheet-overlay",...t}));h.displayName="SheetOverlay";const g=i.forwardRef(({className:e,children:t,side:a,size:o,dataHook:l,trackingEl:d,trackingLabel:v,closeLabel:N,...w},k)=>(q.useOverlayPointerLock(),s.jsxs(c,{children:[s.jsx(h,{}),s.jsxs(r.Content,{ref:k,className:n.cn(z({side:a,size:o}),e),"data-hook":l,"data-slot":"sheet-content","data-tracking-el":d,"data-tracking-label":v,...w,children:[t,s.jsxs(r.Close,{className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground duration-fast absolute top-4 right-4 rounded-xs opacity-70 outline-hidden transition-opacity ease-out hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[s.jsx(P.X,{}),s.jsx("span",{className:"sr-only",children:N??"Close"})]})]})]})));g.displayName="SheetContent";const x=i.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:n.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"sheet-header",...t}));x.displayName="SheetHeader";const y=i.forwardRef(({className:e,children:t,dataHook:a,...o},l)=>s.jsx(T.ScrollArea,{ref:l,className:n.cn("-mx-6 min-h-0 flex-1",e),"data-slot":"sheet-body",dataHook:a??"sheet-body",...o,children:s.jsx("div",{className:"px-5","data-slot":"sheet-body-content",children:t})}));y.displayName="SheetBody";const S=i.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:n.cn("mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",e),"data-slot":"sheet-footer",...t}));S.displayName="SheetFooter";const b=i.forwardRef(({className:e,icon:t,children:a,dataHook:o,...l},d)=>s.jsxs(r.Title,{ref:d,className:n.cn("text-foreground text-heading-section",t&&"flex items-center gap-2",e),"data-hook":o,"data-slot":"sheet-title",...l,children:[t&&s.jsx("span",{className:"shrink-0 [&_svg]:size-5","data-slot":"sheet-title-icon",children:t}),a]}));b.displayName="SheetTitle";const j=i.forwardRef(({className:e,dataHook:t,...a},o)=>s.jsx(r.Description,{ref:o,className:n.cn("text-body-sm text-muted-foreground",e),"data-hook":t,"data-slot":"sheet-description",...a}));j.displayName="SheetDescription";exports.Sheet=u;exports.SheetBody=y;exports.SheetClose=p;exports.SheetContent=g;exports.SheetDescription=j;exports.SheetFooter=S;exports.SheetHeader=x;exports.SheetOverlay=h;exports.SheetPortal=c;exports.SheetTitle=b;exports.SheetTrigger=m;
|
package/dist/sheet.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ScrollArea } from './scroll-area';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
5
|
/**
|
|
@@ -9,8 +10,16 @@ import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
|
9
10
|
* - left: Sheet slides in from the left
|
|
10
11
|
*/
|
|
11
12
|
export type SheetSide = "top" | "right" | "bottom" | "left";
|
|
13
|
+
/**
|
|
14
|
+
* Available sheet size variants (side panels only — ignored for top/bottom)
|
|
15
|
+
* - default: Panel fills 75% of the viewport up to 384px
|
|
16
|
+
* - sm: Panel hugs its content between 288 and 320px, keeping the page
|
|
17
|
+
* partly visible behind it on phones (used by the Sidebar mobile nav)
|
|
18
|
+
*/
|
|
19
|
+
export type SheetSize = "default" | "sm";
|
|
12
20
|
declare const sheetContentVariants: (props?: ({
|
|
13
21
|
side?: "left" | "right" | "bottom" | "top" | null | undefined;
|
|
22
|
+
size?: "default" | "sm" | null | undefined;
|
|
14
23
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
24
|
/**
|
|
16
25
|
* Sheet root component that provides context for the sheet dialog.
|
|
@@ -61,6 +70,13 @@ interface SheetContentProps extends React.ComponentProps<typeof SheetPrimitive.C
|
|
|
61
70
|
* @default "right"
|
|
62
71
|
*/
|
|
63
72
|
side?: SheetSide;
|
|
73
|
+
/**
|
|
74
|
+
* Width preset for side panels. `sm` hugs the content between 288 and
|
|
75
|
+
* 320px; `default` keeps the classic 75%-up-to-384px drawer width.
|
|
76
|
+
* Ignored for top/bottom sheets.
|
|
77
|
+
* @default "default"
|
|
78
|
+
*/
|
|
79
|
+
size?: SheetSize;
|
|
64
80
|
/**
|
|
65
81
|
* Data hook for automated testing
|
|
66
82
|
*/
|
|
@@ -89,6 +105,23 @@ declare const SheetContent: React.ForwardRefExoticComponent<Omit<SheetContentPro
|
|
|
89
105
|
* Centers text on mobile, left-aligns on larger screens.
|
|
90
106
|
*/
|
|
91
107
|
declare const SheetHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
108
|
+
/**
|
|
109
|
+
* Props for the SheetBody component
|
|
110
|
+
*/
|
|
111
|
+
interface SheetBodyProps extends Omit<React.ComponentProps<typeof ScrollArea>, "dataHook"> {
|
|
112
|
+
/**
|
|
113
|
+
* Data hook for automated testing
|
|
114
|
+
* @default "sheet-body"
|
|
115
|
+
*/
|
|
116
|
+
dataHook?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sheet body — the scrollable region between a pinned SheetHeader and
|
|
120
|
+
* SheetFooter. Wraps ScrollArea so long content scrolls with DS-styled
|
|
121
|
+
* scrollbars inside a keyboard-focusable viewport, while the close button,
|
|
122
|
+
* header, and footer stay visible.
|
|
123
|
+
*/
|
|
124
|
+
declare const SheetBody: React.ForwardRefExoticComponent<Omit<SheetBodyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
92
125
|
/**
|
|
93
126
|
* Sheet footer section for actions and buttons.
|
|
94
127
|
* Stacks buttons on mobile, aligns to end on larger screens.
|
|
@@ -130,6 +163,6 @@ interface SheetDescriptionProps extends React.ComponentProps<typeof SheetPrimiti
|
|
|
130
163
|
* Should be used within SheetHeader below SheetTitle.
|
|
131
164
|
*/
|
|
132
165
|
declare const SheetDescription: React.ForwardRefExoticComponent<Omit<SheetDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
133
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, };
|
|
134
|
-
export type { SheetContentProps, SheetDescriptionProps, SheetTitleProps, SheetTriggerProps, };
|
|
166
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, };
|
|
167
|
+
export type { SheetBodyProps, SheetContentProps, SheetDescriptionProps, SheetTitleProps, SheetTriggerProps, };
|
|
135
168
|
//# sourceMappingURL=sheet.d.ts.map
|
package/dist/sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"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"}
|
package/dist/sheet.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as o, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
3
|
import * as s from "@radix-ui/react-dialog";
|
|
4
|
-
import { cva as
|
|
5
|
-
import { X as
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
8
|
-
|
|
4
|
+
import { cva as x } from "class-variance-authority";
|
|
5
|
+
import { X as y } from "@brightlocal/icons";
|
|
6
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
import { ScrollArea as b } from "@brightlocal/ui-components/scroll-area";
|
|
8
|
+
import { useOverlayPointerLock as N } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
|
|
9
|
+
const S = x(
|
|
9
10
|
[
|
|
10
11
|
"bg-background",
|
|
11
12
|
"data-[state=open]:animate-in",
|
|
@@ -43,9 +44,7 @@ const y = g(
|
|
|
43
44
|
"inset-y-0",
|
|
44
45
|
"right-0",
|
|
45
46
|
"h-full",
|
|
46
|
-
"
|
|
47
|
-
"border-l",
|
|
48
|
-
"sm:max-w-sm"
|
|
47
|
+
"border-l"
|
|
49
48
|
],
|
|
50
49
|
bottom: [
|
|
51
50
|
"data-[state=closed]:slide-out-to-bottom",
|
|
@@ -61,22 +60,46 @@ const y = g(
|
|
|
61
60
|
"inset-y-0",
|
|
62
61
|
"left-0",
|
|
63
62
|
"h-full",
|
|
64
|
-
"
|
|
65
|
-
"border-r",
|
|
66
|
-
"sm:max-w-sm"
|
|
63
|
+
"border-r"
|
|
67
64
|
]
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
default: [],
|
|
68
|
+
sm: []
|
|
68
69
|
}
|
|
69
70
|
},
|
|
71
|
+
compoundVariants: [
|
|
72
|
+
// Width only applies to side panels — top/bottom sheets span the
|
|
73
|
+
// viewport and size their height from content on every size.
|
|
74
|
+
{
|
|
75
|
+
side: ["left", "right"],
|
|
76
|
+
size: "default",
|
|
77
|
+
className: ["w-3/4", "sm:max-w-sm"]
|
|
78
|
+
},
|
|
79
|
+
// sm side panels hug their content between 288 and 320px (DS-860) so
|
|
80
|
+
// the page stays partly visible behind them on phones — used by the
|
|
81
|
+
// Sidebar mobile navigation sheet.
|
|
82
|
+
{
|
|
83
|
+
side: ["left", "right"],
|
|
84
|
+
size: "sm",
|
|
85
|
+
className: [
|
|
86
|
+
"w-fit",
|
|
87
|
+
"min-w-(--ds-container-2xs)",
|
|
88
|
+
"max-w-(--ds-container-xs)"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
70
92
|
defaultVariants: {
|
|
71
|
-
side: "right"
|
|
93
|
+
side: "right",
|
|
94
|
+
size: "default"
|
|
72
95
|
}
|
|
73
96
|
}
|
|
74
97
|
);
|
|
75
|
-
function
|
|
98
|
+
function v({ ...e }) {
|
|
76
99
|
return /* @__PURE__ */ o(s.Root, { "data-slot": "sheet", modal: !0, ...e });
|
|
77
100
|
}
|
|
78
|
-
|
|
79
|
-
const
|
|
101
|
+
v.displayName = "Sheet";
|
|
102
|
+
const w = i.forwardRef(({ dataHook: e, ...t }, a) => /* @__PURE__ */ o(
|
|
80
103
|
s.Trigger,
|
|
81
104
|
{
|
|
82
105
|
ref: a,
|
|
@@ -85,20 +108,20 @@ const v = r.forwardRef(({ dataHook: e, ...t }, a) => /* @__PURE__ */ o(
|
|
|
85
108
|
...t
|
|
86
109
|
}
|
|
87
110
|
));
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
function
|
|
111
|
+
w.displayName = "SheetTrigger";
|
|
112
|
+
const k = i.forwardRef(({ ...e }, t) => /* @__PURE__ */ o(s.Close, { ref: t, "data-slot": "sheet-close", ...e }));
|
|
113
|
+
k.displayName = "SheetClose";
|
|
114
|
+
function f({
|
|
92
115
|
...e
|
|
93
116
|
}) {
|
|
94
117
|
return /* @__PURE__ */ o(s.Portal, { "data-slot": "sheet-portal", ...e });
|
|
95
118
|
}
|
|
96
|
-
|
|
97
|
-
const m =
|
|
119
|
+
f.displayName = "SheetPortal";
|
|
120
|
+
const m = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
98
121
|
s.Overlay,
|
|
99
122
|
{
|
|
100
123
|
ref: a,
|
|
101
|
-
className:
|
|
124
|
+
className: d(
|
|
102
125
|
"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",
|
|
103
126
|
e
|
|
104
127
|
),
|
|
@@ -107,55 +130,68 @@ const m = r.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
|
107
130
|
}
|
|
108
131
|
));
|
|
109
132
|
m.displayName = "SheetOverlay";
|
|
110
|
-
const
|
|
133
|
+
const R = i.forwardRef(
|
|
111
134
|
({
|
|
112
135
|
className: e,
|
|
113
136
|
children: t,
|
|
114
137
|
side: a,
|
|
138
|
+
size: r,
|
|
115
139
|
dataHook: l,
|
|
116
|
-
trackingEl:
|
|
117
|
-
trackingLabel:
|
|
118
|
-
closeLabel:
|
|
119
|
-
...
|
|
120
|
-
},
|
|
140
|
+
trackingEl: c,
|
|
141
|
+
trackingLabel: h,
|
|
142
|
+
closeLabel: p,
|
|
143
|
+
...u
|
|
144
|
+
}, g) => (N(), /* @__PURE__ */ n(f, { children: [
|
|
121
145
|
/* @__PURE__ */ o(m, {}),
|
|
122
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ n(
|
|
123
147
|
s.Content,
|
|
124
148
|
{
|
|
125
|
-
ref:
|
|
126
|
-
className:
|
|
149
|
+
ref: g,
|
|
150
|
+
className: d(S({ side: a, size: r }), e),
|
|
127
151
|
"data-hook": l,
|
|
128
152
|
"data-slot": "sheet-content",
|
|
129
|
-
"data-tracking-el":
|
|
130
|
-
"data-tracking-label":
|
|
131
|
-
...
|
|
153
|
+
"data-tracking-el": c,
|
|
154
|
+
"data-tracking-label": h,
|
|
155
|
+
...u,
|
|
132
156
|
children: [
|
|
133
157
|
t,
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
/* @__PURE__ */ o(
|
|
136
|
-
/* @__PURE__ */ o("span", { className: "sr-only", children:
|
|
158
|
+
/* @__PURE__ */ n(s.Close, { className: "ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground duration-fast absolute top-4 right-4 rounded-xs opacity-70 outline-hidden transition-opacity ease-out hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0", children: [
|
|
159
|
+
/* @__PURE__ */ o(y, {}),
|
|
160
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: p ?? "Close" })
|
|
137
161
|
] })
|
|
138
162
|
]
|
|
139
163
|
}
|
|
140
164
|
)
|
|
141
165
|
] }))
|
|
142
166
|
);
|
|
143
|
-
|
|
144
|
-
const
|
|
167
|
+
R.displayName = "SheetContent";
|
|
168
|
+
const C = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
145
169
|
"div",
|
|
146
170
|
{
|
|
147
171
|
ref: a,
|
|
148
|
-
className:
|
|
172
|
+
className: d("flex flex-col gap-2 text-center sm:text-left", e),
|
|
149
173
|
"data-slot": "sheet-header",
|
|
150
174
|
...t
|
|
151
175
|
}
|
|
152
176
|
));
|
|
153
|
-
|
|
154
|
-
const
|
|
177
|
+
C.displayName = "SheetHeader";
|
|
178
|
+
const z = i.forwardRef(({ className: e, children: t, dataHook: a, ...r }, l) => /* @__PURE__ */ o(
|
|
179
|
+
b,
|
|
180
|
+
{
|
|
181
|
+
ref: l,
|
|
182
|
+
className: d("-mx-6 min-h-0 flex-1", e),
|
|
183
|
+
"data-slot": "sheet-body",
|
|
184
|
+
dataHook: a ?? "sheet-body",
|
|
185
|
+
...r,
|
|
186
|
+
children: /* @__PURE__ */ o("div", { className: "px-5", "data-slot": "sheet-body-content", children: t })
|
|
187
|
+
}
|
|
188
|
+
));
|
|
189
|
+
z.displayName = "SheetBody";
|
|
190
|
+
const T = i.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
155
191
|
"div",
|
|
156
192
|
{
|
|
157
193
|
ref: a,
|
|
158
|
-
className:
|
|
194
|
+
className: d(
|
|
159
195
|
"mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",
|
|
160
196
|
e
|
|
161
197
|
),
|
|
@@ -163,46 +199,47 @@ const R = r.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ o(
|
|
|
163
199
|
...t
|
|
164
200
|
}
|
|
165
201
|
));
|
|
166
|
-
|
|
167
|
-
const
|
|
202
|
+
T.displayName = "SheetFooter";
|
|
203
|
+
const P = i.forwardRef(({ className: e, icon: t, children: a, dataHook: r, ...l }, c) => /* @__PURE__ */ n(
|
|
168
204
|
s.Title,
|
|
169
205
|
{
|
|
170
|
-
ref:
|
|
171
|
-
className:
|
|
172
|
-
"text-foreground text-
|
|
206
|
+
ref: c,
|
|
207
|
+
className: d(
|
|
208
|
+
"text-foreground text-heading-section",
|
|
173
209
|
t && "flex items-center gap-2",
|
|
174
210
|
e
|
|
175
211
|
),
|
|
176
|
-
"data-hook":
|
|
212
|
+
"data-hook": r,
|
|
177
213
|
"data-slot": "sheet-title",
|
|
178
|
-
...
|
|
214
|
+
...l,
|
|
179
215
|
children: [
|
|
180
216
|
t && /* @__PURE__ */ o("span", { className: "shrink-0 [&_svg]:size-5", "data-slot": "sheet-title-icon", children: t }),
|
|
181
217
|
a
|
|
182
218
|
]
|
|
183
219
|
}
|
|
184
220
|
));
|
|
185
|
-
|
|
186
|
-
const
|
|
221
|
+
P.displayName = "SheetTitle";
|
|
222
|
+
const D = i.forwardRef(({ className: e, dataHook: t, ...a }, r) => /* @__PURE__ */ o(
|
|
187
223
|
s.Description,
|
|
188
224
|
{
|
|
189
|
-
ref:
|
|
190
|
-
className:
|
|
225
|
+
ref: r,
|
|
226
|
+
className: d("text-body-sm text-muted-foreground", e),
|
|
191
227
|
"data-hook": t,
|
|
192
228
|
"data-slot": "sheet-description",
|
|
193
229
|
...a
|
|
194
230
|
}
|
|
195
231
|
));
|
|
196
|
-
|
|
232
|
+
D.displayName = "SheetDescription";
|
|
197
233
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
234
|
+
v as Sheet,
|
|
235
|
+
z as SheetBody,
|
|
236
|
+
k as SheetClose,
|
|
237
|
+
R as SheetContent,
|
|
238
|
+
D as SheetDescription,
|
|
239
|
+
T as SheetFooter,
|
|
240
|
+
C as SheetHeader,
|
|
204
241
|
m as SheetOverlay,
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
242
|
+
f as SheetPortal,
|
|
243
|
+
P as SheetTitle,
|
|
244
|
+
w as SheetTrigger
|
|
208
245
|
};
|
package/dist/skeleton.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 c=require("react/jsx-runtime"),m=require("react"),b=require("@brightlocal/ui-components/lib/utils");function g(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const k=g(m),p={short:300,long:1e3},l=k.forwardRef(({className:t,dataHook:n,delay:e=!1,style:r,trackingEl:i,trackingLabel:u,loadingLabel:o,...d},f)=>{const s=e===!1?0:typeof e=="number"?e:p[e],a=o!==void 0;return c.jsx("div",{ref:f,"aria-busy":a?"true":void 0,"aria-hidden":a?void 0:"true",className:b.cn("bg-skeleton animate-status-shimmer relative rounded-md",t),"data-hook":n,"data-slot":"skeleton","data-tracking-el":i,"data-tracking-label":u,style:s?{"--skeleton-delay":`${s}ms`,...r}:r,...d,children:a?c.jsx("span",{className:"sr-only",children:o}):null})});l.displayName="Skeleton";exports.Skeleton=l;
|
package/dist/skeleton.d.ts
CHANGED
|
@@ -2,7 +2,23 @@ import * as React from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Props for the Skeleton component
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Entry delay for the skeleton's appearance. `false` (default) shows it
|
|
7
|
+
* immediately; "short" holds it back 300ms (the flash zone's upper edge —
|
|
8
|
+
* waits that resolve first never show it); "long" holds it 1000ms for
|
|
9
|
+
* below-the-fold or secondary surfaces; a number sets a measured per-surface
|
|
10
|
+
* value in milliseconds. The delayed skeleton still reserves its geometry —
|
|
11
|
+
* it is invisible, not unmounted.
|
|
12
|
+
*/
|
|
13
|
+
type SkeletonDelay = "short" | "long" | number | false;
|
|
5
14
|
interface SkeletonProps extends React.ComponentProps<"div"> {
|
|
15
|
+
/**
|
|
16
|
+
* Delay before the skeleton becomes visible: `"short"` (300ms),
|
|
17
|
+
* `"long"` (1000ms), or a number of milliseconds. It keeps reserving its
|
|
18
|
+
* space while invisible.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
delay?: SkeletonDelay;
|
|
6
22
|
/**
|
|
7
23
|
* Data hook for automated testing (optional for Skeleton as it's purely presentational)
|
|
8
24
|
*/
|
|
@@ -17,16 +33,35 @@ interface SkeletonProps extends React.ComponentProps<"div"> {
|
|
|
17
33
|
trackingLabel?: string;
|
|
18
34
|
/**
|
|
19
35
|
* Accessible label announced to screen readers during loading.
|
|
20
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* Unset (the default) the skeleton is silent: `aria-hidden`, with no
|
|
38
|
+
* screen-reader text. A loading layout is many skeletons — a table page is
|
|
39
|
+
* a dozen rows of four — and one announcement per shape is the whole wait
|
|
40
|
+
* read out dozens of times. The region being loaded carries `aria-busy` and
|
|
41
|
+
* makes the single announcement instead.
|
|
42
|
+
*
|
|
43
|
+
* Pass it only for a skeleton that stands alone, where there is no owning
|
|
44
|
+
* region to do the announcing.
|
|
21
45
|
*/
|
|
22
46
|
loadingLabel?: string;
|
|
23
47
|
}
|
|
24
48
|
/**
|
|
25
49
|
* Skeleton component for loading placeholder states.
|
|
26
|
-
* Displays a
|
|
50
|
+
* Displays a travelling shimmer wave — one soft color wave (skeleton base to
|
|
51
|
+
* a lighter peak) moving left to right through every skeleton shape in the
|
|
52
|
+
* view, so composed layouts light up in position order with no per-shape
|
|
53
|
+
* setup. The skeleton appears instantly at full strength — deliberately no
|
|
54
|
+
* fade-in — and the wave animates color only, never the shape's opacity.
|
|
27
55
|
* Use to represent text, images, avatars, or any other content while data is being fetched.
|
|
56
|
+
*
|
|
57
|
+
* Appears instantly at full strength — deliberately no fade-in: a skeleton
|
|
58
|
+
* is the page assembling, not a transition worth softening. Flicker on fast
|
|
59
|
+
* responses is prevented by not showing the skeleton at all (the `delay`
|
|
60
|
+
* prop, or `useDelayedPending`), never by easing it in. The exit is equally
|
|
61
|
+
* instant: unmounting is immediate, and fading a skeleton out over readable
|
|
62
|
+
* content is banned (a minimum display time by another name).
|
|
28
63
|
*/
|
|
29
64
|
declare const Skeleton: React.ForwardRefExoticComponent<Omit<SkeletonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
65
|
export { Skeleton };
|
|
31
|
-
export type { SkeletonProps };
|
|
66
|
+
export type { SkeletonDelay, SkeletonProps };
|
|
32
67
|
//# sourceMappingURL=skeleton.d.ts.map
|
package/dist/skeleton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;GAEG;AACH,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACzD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;GAEG;AACH;;;;;;;GAOG;AACH,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAOvD,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACzD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,QAAQ,mGAkDb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/skeleton.js
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
const k = {
|
|
5
|
+
short: 300,
|
|
6
|
+
long: 1e3
|
|
7
|
+
}, p = u.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
className: r,
|
|
10
|
+
dataHook: l,
|
|
11
|
+
delay: e = !1,
|
|
12
|
+
style: a,
|
|
13
|
+
trackingEl: i,
|
|
14
|
+
trackingLabel: d,
|
|
15
|
+
loadingLabel: o,
|
|
16
|
+
...m
|
|
17
|
+
}, c) => {
|
|
18
|
+
const s = e === !1 ? 0 : typeof e == "number" ? e : k[e], t = o !== void 0;
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref: c,
|
|
23
|
+
"aria-busy": t ? "true" : void 0,
|
|
24
|
+
"aria-hidden": t ? void 0 : "true",
|
|
25
|
+
className: f(
|
|
26
|
+
"bg-skeleton animate-status-shimmer relative rounded-md",
|
|
27
|
+
r
|
|
28
|
+
),
|
|
29
|
+
"data-hook": l,
|
|
30
|
+
"data-slot": "skeleton",
|
|
31
|
+
"data-tracking-el": i,
|
|
32
|
+
"data-tracking-label": d,
|
|
33
|
+
style: s ? {
|
|
34
|
+
"--skeleton-delay": `${s}ms`,
|
|
35
|
+
...a
|
|
36
|
+
} : a,
|
|
37
|
+
...m,
|
|
38
|
+
children: t ? /* @__PURE__ */ n("span", { className: "sr-only", children: o }) : null
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
19
42
|
);
|
|
20
|
-
|
|
43
|
+
p.displayName = "Skeleton";
|
|
21
44
|
export {
|
|
22
|
-
|
|
45
|
+
p as Skeleton
|
|
23
46
|
};
|
package/dist/sonner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@brightlocal/icons"),h=require("class-variance-authority"),m=require("sonner"),x=require("@brightlocal/ui-components/button"),s=require("@brightlocal/ui-components/lib/utils"),g=require("@brightlocal/ui-components/spinner"),v=4e3,p=h.cva(["flex","items-center","justify-between","w-full","md:w-auto","md:min-w-[364px]","rounded-md","border","border-border","p-4","gap-2","shadow-lg"].join(" "),{variants:{colorSchema:{default:"bg-white dark:bg-popover",success:"bg-green-200 dark:bg-popover"}},defaultVariants:{colorSchema:"default"}}),N=h.cva("text-heading-compact",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900 dark:text-green-100"}},defaultVariants:{colorSchema:"default"}}),j=h.cva("text-body-sm",{variants:{colorSchema:{default:"text-muted-foreground",success:"text-green-900 dark:text-green-100"}},defaultVariants:{colorSchema:"default"}}),l=h.cva("",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900 dark:text-green-100"}},defaultVariants:{colorSchema:"default"}});function T(r,t){switch(r){case"info":return e.jsx(d.Info,{className:s.cn(l({colorSchema:t}))});case"success":return e.jsx(d.CheckCircle2,{className:s.cn(l({colorSchema:t}))});case"warning":return e.jsx(d.AlertTriangle,{className:s.cn(l({colorSchema:t}))});case"error":return e.jsx(d.XCircle,{className:s.cn(l({colorSchema:t}))});case"loading":return e.jsx(g.Spinner,{className:s.cn(l({colorSchema:t}))});default:return null}}const S=function(t,a){const{id:c,...n}=t,u={...a,duration:a?.duration??v,...c!=null&&{id:a?.id??c}},f=u.duration===1/0;m.toast.custom(o=>{const i=n.button&&n.button.label?{label:n.button.label,variant:n.button.variant,onClick:()=>{n.button?.onClick&&n.button.onClick(),m.toast.dismiss(o)}}:void 0;return e.jsx(I,{button:i,colorSchema:n.colorSchema,description:n.description,icon:n.icon??void 0,id:o,title:n.title})},{...u,...f&&{dismissible:!1}})};S.dismiss=r=>{m.toast.dismiss(r)};function I(r){const{button:t,description:a,icon:c,title:n,colorSchema:u}=r,o=(i=>i==="success"?"success":"default")(u);return e.jsxs("div",{"aria-atomic":"true","aria-live":"polite",className:s.cn(p({colorSchema:o})),role:"status",children:[e.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[c!=null&&(()=>{const i=T(c,o);return i?e.jsx("span",{className:"mt-0.5 shrink-0",children:i}):null})(),e.jsxs("div",{className:"w-full",children:[e.jsx("p",{className:s.cn(N({colorSchema:o})),children:n}),a&&e.jsx("p",{className:s.cn(j({colorSchema:o})),children:a})]})]}),t?.label&&e.jsx(x.Button,{"aria-label":t.label,dataHook:"toast-action",size:"sm",variant:t.variant,onClick:t.onClick,children:t.label})]})}function b(){return e.jsx(m.Toaster,{position:"top-right"})}b.displayName="Sonner";exports.Sonner=b;exports.sonner=S;
|
package/dist/sonner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAI/E;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEhD;;;;GAIG;AACH,KAAK,UAAU,GAAG;IAChB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,MAAM,CAAC,EAAE;QACP,wBAAwB;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mCAAmC;QACnC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB,mCAAmC;QACnC,OAAO,CAAC,EAAE,mBAAmB,CAAC;KAC/B,CAAC;IACF,gCAAgC;IAChC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;AAEtD,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,+MAA+M;IAC/M,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAmGpE,UAAU,QAAQ;IAChB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzD,mCAAmC;IACnC,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,QAAA,MAAM,MAAM,EAAE,QA+Cb,CAAC;AA+DF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,iBAAS,MAAM,4CAEd;kBAFQ,MAAM;;;AAKf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|