@brightlocal/ui-components 3.1.0 → 3.2.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 +6 -1
- package/component-meta.json +663 -38
- package/deprecations.json +1 -1
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +21 -20
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +86 -6
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +185 -96
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +231 -13
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +466 -306
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.js +1 -1
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +169 -22
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +695 -561
- package/dist/grid.d.ts +24 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +593 -561
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- 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.d.ts +28 -6
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +5 -5
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +11 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +97 -81
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-text.d.ts +1 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +8 -3
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/card.tsx +211 -24
- package/src/components/chart.tsx +523 -35
- package/src/components/checkbox.tsx +1 -1
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +1 -1
- package/src/components/data-table.tsx +778 -195
- package/src/components/grid.tsx +32 -1
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +33 -11
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/select.tsx +35 -5
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-text.tsx +1 -2
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +5 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/utils.ts +1 -0
package/deprecations.json
CHANGED
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
"type": "component",
|
|
338
338
|
"since": "2.27.0",
|
|
339
339
|
"reason": "Superseded by the type-scale inline code treatment (0.9em, inherits line-height)",
|
|
340
|
-
"replacement": "code element with
|
|
340
|
+
"replacement": "code element with font-mono text-[0.9em] inside a sentence",
|
|
341
341
|
"ticket": "DS-714"
|
|
342
342
|
},
|
|
343
343
|
{
|
package/dist/alert-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"),b=require("react"),w=require("@radix-ui/react-alert-dialog"),s=require("@brightlocal/ui-components/lib/utils"),v=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock"),c=require("@brightlocal/ui-components/button");function g(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,l.get?l:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const r=g(b),i=g(w);function u({dataHook:a,trackingEl:t,trackingLabel:e,...l}){return o.jsx(i.Root,{"data-hook":a,"data-slot":"alert-dialog","data-tracking-el":t,"data-tracking-label":e,...l})}u.displayName="AlertDialog";const f=r.forwardRef((a,t)=>o.jsx(i.Trigger,{ref:t,"data-slot":"alert-dialog-trigger",...a}));f.displayName="AlertDialogTrigger";function n({...a}){return o.jsx(i.Portal,{...a})}n.displayName="AlertDialogPortal";const d=r.forwardRef(({className:a,...t},e)=>o.jsx(i.Overlay,{ref:e,className: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",...t}));d.displayName="AlertDialogOverlay";const m=r.forwardRef(({className:a,...t},e)=>(v.useOverlayPointerLock(),o.jsxs(n,{children:[o.jsx(d,{}),o.jsx(i.Content,{ref:e,className: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-slot":"alert-dialog-content",...t})]})));m.displayName="AlertDialogContent";const D=r.forwardRef(({className:a,...t},e)=>o.jsx("div",{ref:e,className:s.cn("flex flex-col gap-2 text-center sm:text-left",a),"data-slot":"alert-dialog-header",...t}));D.displayName="AlertDialogHeader";const A=r.forwardRef(({className:a,...t},e)=>o.jsx("div",{ref:e,className:s.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),"data-slot":"alert-dialog-footer",...t}));A.displayName="AlertDialogFooter";const p=r.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx(i.Title,{ref:l,className:s.cn("text-heading-section",a),"data-hook":t,"data-slot":"alert-dialog-title",...e}));p.displayName="AlertDialogTitle";const x=r.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx(i.Description,{ref:l,className:s.cn("text-body-sm text-muted-foreground",a),"data-hook":t,"data-slot":"alert-dialog-description",...e}));x.displayName="AlertDialogDescription";const y=r.forwardRef(({className:a,variant:t="primary",dataHook:e,...l},N)=>o.jsx(i.Action,{ref:N,className:s.cn(c.ButtonVariants({variant:t}),a),"data-hook":e,"data-slot":"alert-dialog-action","data-variant":t,...l}));y.displayName="AlertDialogAction";const j=r.forwardRef(({className:a,dataHook:t,...e},l)=>o.jsx(i.Cancel,{ref:l,className:s.cn(c.ButtonVariants({variant:"outline"}),a),"data-hook":t,"data-slot":"alert-dialog-cancel",...e}));j.displayName="AlertDialogCancel";exports.AlertDialog=u;exports.AlertDialogAction=y;exports.AlertDialogCancel=j;exports.AlertDialogContent=m;exports.AlertDialogDescription=x;exports.AlertDialogFooter=A;exports.AlertDialogHeader=D;exports.AlertDialogOverlay=d;exports.AlertDialogPortal=n;exports.AlertDialogTitle=p;exports.AlertDialogTrigger=f;
|
package/dist/alert-dialog.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ButtonVariant } from './button';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
3
4
|
interface AlertDialogProps extends React.ComponentProps<typeof AlertDialogPrimitive.Root> {
|
|
@@ -49,8 +50,36 @@ interface AlertDialogDescriptionProps extends React.ComponentProps<typeof AlertD
|
|
|
49
50
|
dataHook?: string;
|
|
50
51
|
}
|
|
51
52
|
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
/** Visual style variants for the AlertDialogAction confirm button. */
|
|
54
|
+
type AlertDialogActionVariant = Extract<ButtonVariant, "primary" | "destructive">;
|
|
55
|
+
/**
|
|
56
|
+
* Props for the AlertDialogAction component
|
|
57
|
+
*/
|
|
58
|
+
interface AlertDialogActionProps extends React.ComponentProps<typeof AlertDialogPrimitive.Action> {
|
|
59
|
+
/**
|
|
60
|
+
* Visual style of the confirm button. Use `"destructive"` when confirming
|
|
61
|
+
* an irreversible action such as a delete.
|
|
62
|
+
* @default "primary"
|
|
63
|
+
*/
|
|
64
|
+
variant?: AlertDialogActionVariant;
|
|
65
|
+
/**
|
|
66
|
+
* Data hook for automated testing
|
|
67
|
+
* @example "delete-location-confirm"
|
|
68
|
+
*/
|
|
69
|
+
dataHook?: string;
|
|
70
|
+
}
|
|
71
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogActionProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
72
|
+
/**
|
|
73
|
+
* Props for the AlertDialogCancel component
|
|
74
|
+
*/
|
|
75
|
+
interface AlertDialogCancelProps extends React.ComponentProps<typeof AlertDialogPrimitive.Cancel> {
|
|
76
|
+
/**
|
|
77
|
+
* Data hook for automated testing
|
|
78
|
+
* @example "delete-location-cancel"
|
|
79
|
+
*/
|
|
80
|
+
dataHook?: string;
|
|
81
|
+
}
|
|
82
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogCancelProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
54
83
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
55
|
-
export type { AlertDialogDescriptionProps, AlertDialogProps, AlertDialogTitleProps, };
|
|
84
|
+
export type { AlertDialogActionProps, AlertDialogActionVariant, AlertDialogCancelProps, AlertDialogDescriptionProps, AlertDialogProps, AlertDialogTitleProps, };
|
|
56
85
|
//# 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;
|
|
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,2CAUlB;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,2CAE1D;kBAJQ,iBAAiB;;;AAQ1B,QAAA,MAAM,kBAAkB,wKAatB,CAAC;AAIH,QAAA,MAAM,kBAAkB,wKAqBtB,CAAC;AAIH,QAAA,MAAM,iBAAiB,mKAUrB,CAAC;AAIH,QAAA,MAAM,iBAAiB,mKAarB,CAAC;AAIH;;GAEG;AACH,UAAU,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAC1D,OAAO,oBAAoB,CAAC,KAAK,CAClC;IACC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,gBAAgB,+GAWpB,CAAC;AAIH;;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,aAAa,CAC1B,CAAC;AAEF;;GAEG;AACH,UAAU,sBAAuB,SAAQ,KAAK,CAAC,cAAc,CAC3D,OAAO,oBAAoB,CAAC,MAAM,CACnC;IACC;;;;OAIG;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,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,GACtB,CAAC"}
|
package/dist/alert-dialog.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useOverlayPointerLock as
|
|
1
|
+
import { jsx as o, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import * as i from "@radix-ui/react-alert-dialog";
|
|
4
|
+
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { useOverlayPointerLock as f } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
|
|
6
6
|
import { ButtonVariants as s } from "@brightlocal/ui-components/button";
|
|
7
|
-
function
|
|
7
|
+
function p({
|
|
8
8
|
dataHook: a,
|
|
9
9
|
trackingEl: t,
|
|
10
10
|
trackingLabel: e,
|
|
11
|
-
...
|
|
11
|
+
...l
|
|
12
12
|
}) {
|
|
13
13
|
return /* @__PURE__ */ o(
|
|
14
|
-
|
|
14
|
+
i.Root,
|
|
15
15
|
{
|
|
16
16
|
"data-hook": a,
|
|
17
17
|
"data-slot": "alert-dialog",
|
|
18
18
|
"data-tracking-el": t,
|
|
19
19
|
"data-tracking-label": e,
|
|
20
|
-
...
|
|
20
|
+
...l
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
24
|
+
p.displayName = "AlertDialog";
|
|
25
|
+
const A = r.forwardRef((a, t) => /* @__PURE__ */ o(
|
|
26
|
+
i.Trigger,
|
|
27
27
|
{
|
|
28
28
|
ref: t,
|
|
29
29
|
"data-slot": "alert-dialog-trigger",
|
|
30
30
|
...a
|
|
31
31
|
}
|
|
32
32
|
));
|
|
33
|
-
|
|
33
|
+
A.displayName = "AlertDialogTrigger";
|
|
34
34
|
function n({
|
|
35
35
|
...a
|
|
36
36
|
}) {
|
|
37
|
-
return /* @__PURE__ */ o(
|
|
37
|
+
return /* @__PURE__ */ o(i.Portal, { ...a });
|
|
38
38
|
}
|
|
39
39
|
n.displayName = "AlertDialogPortal";
|
|
40
|
-
const c =
|
|
41
|
-
|
|
40
|
+
const c = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
41
|
+
i.Overlay,
|
|
42
42
|
{
|
|
43
43
|
ref: e,
|
|
44
|
-
className:
|
|
44
|
+
className: d(
|
|
45
45
|
"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",
|
|
46
46
|
a
|
|
47
47
|
),
|
|
@@ -50,13 +50,13 @@ const c = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
|
50
50
|
}
|
|
51
51
|
));
|
|
52
52
|
c.displayName = "AlertDialogOverlay";
|
|
53
|
-
const
|
|
53
|
+
const D = r.forwardRef(({ className: a, ...t }, e) => (f(), /* @__PURE__ */ m(n, { children: [
|
|
54
54
|
/* @__PURE__ */ o(c, {}),
|
|
55
55
|
/* @__PURE__ */ o(
|
|
56
|
-
|
|
56
|
+
i.Content,
|
|
57
57
|
{
|
|
58
58
|
ref: e,
|
|
59
|
-
className:
|
|
59
|
+
className: d(
|
|
60
60
|
"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",
|
|
61
61
|
a
|
|
62
62
|
),
|
|
@@ -65,22 +65,22 @@ const A = l.forwardRef(({ className: a, ...t }, e) => (m(), /* @__PURE__ */ g(n,
|
|
|
65
65
|
}
|
|
66
66
|
)
|
|
67
67
|
] })));
|
|
68
|
-
|
|
69
|
-
const
|
|
68
|
+
D.displayName = "AlertDialogContent";
|
|
69
|
+
const u = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
72
|
ref: e,
|
|
73
|
-
className:
|
|
73
|
+
className: d("flex flex-col gap-2 text-center sm:text-left", a),
|
|
74
74
|
"data-slot": "alert-dialog-header",
|
|
75
75
|
...t
|
|
76
76
|
}
|
|
77
77
|
));
|
|
78
|
-
|
|
79
|
-
const
|
|
78
|
+
u.displayName = "AlertDialogHeader";
|
|
79
|
+
const y = r.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
ref: e,
|
|
83
|
-
className:
|
|
83
|
+
className: d(
|
|
84
84
|
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
85
85
|
a
|
|
86
86
|
),
|
|
@@ -88,59 +88,62 @@ const u = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
|
|
|
88
88
|
...t
|
|
89
89
|
}
|
|
90
90
|
));
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
91
|
+
y.displayName = "AlertDialogFooter";
|
|
92
|
+
const N = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => /* @__PURE__ */ o(
|
|
93
|
+
i.Title,
|
|
94
94
|
{
|
|
95
|
-
ref:
|
|
96
|
-
className:
|
|
95
|
+
ref: l,
|
|
96
|
+
className: d("text-heading-section", a),
|
|
97
97
|
"data-hook": t,
|
|
98
98
|
"data-slot": "alert-dialog-title",
|
|
99
99
|
...e
|
|
100
100
|
}
|
|
101
101
|
));
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
102
|
+
N.displayName = "AlertDialogTitle";
|
|
103
|
+
const x = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => /* @__PURE__ */ o(
|
|
104
|
+
i.Description,
|
|
105
105
|
{
|
|
106
|
-
ref:
|
|
107
|
-
className:
|
|
106
|
+
ref: l,
|
|
107
|
+
className: d("text-body-sm text-muted-foreground", a),
|
|
108
108
|
"data-hook": t,
|
|
109
109
|
"data-slot": "alert-dialog-description",
|
|
110
110
|
...e
|
|
111
111
|
}
|
|
112
112
|
));
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
113
|
+
x.displayName = "AlertDialogDescription";
|
|
114
|
+
const w = r.forwardRef(({ className: a, variant: t = "primary", dataHook: e, ...l }, g) => /* @__PURE__ */ o(
|
|
115
|
+
i.Action,
|
|
116
116
|
{
|
|
117
|
-
ref:
|
|
118
|
-
className:
|
|
117
|
+
ref: g,
|
|
118
|
+
className: d(s({ variant: t }), a),
|
|
119
|
+
"data-hook": e,
|
|
119
120
|
"data-slot": "alert-dialog-action",
|
|
120
|
-
|
|
121
|
+
"data-variant": t,
|
|
122
|
+
...l
|
|
121
123
|
}
|
|
122
124
|
));
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
125
|
+
w.displayName = "AlertDialogAction";
|
|
126
|
+
const R = r.forwardRef(({ className: a, dataHook: t, ...e }, l) => /* @__PURE__ */ o(
|
|
127
|
+
i.Cancel,
|
|
126
128
|
{
|
|
127
|
-
ref:
|
|
128
|
-
className:
|
|
129
|
+
ref: l,
|
|
130
|
+
className: d(s({ variant: "outline" }), a),
|
|
131
|
+
"data-hook": t,
|
|
129
132
|
"data-slot": "alert-dialog-cancel",
|
|
130
|
-
...
|
|
133
|
+
...e
|
|
131
134
|
}
|
|
132
135
|
));
|
|
133
|
-
|
|
136
|
+
R.displayName = "AlertDialogCancel";
|
|
134
137
|
export {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
p as AlertDialog,
|
|
139
|
+
w as AlertDialogAction,
|
|
140
|
+
R as AlertDialogCancel,
|
|
141
|
+
D as AlertDialogContent,
|
|
142
|
+
x as AlertDialogDescription,
|
|
143
|
+
y as AlertDialogFooter,
|
|
144
|
+
u as AlertDialogHeader,
|
|
142
145
|
c as AlertDialogOverlay,
|
|
143
146
|
n as AlertDialogPortal,
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
N as AlertDialogTitle,
|
|
148
|
+
A as AlertDialogTrigger
|
|
146
149
|
};
|
package/dist/alert.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"),j=require("react"),v=require("@radix-ui/react-slot"),N=require("class-variance-authority"),u=require("@brightlocal/icons"),i=require("@brightlocal/ui-components/lib/utils");function p(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(a,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return a.default=t,Object.freeze(a)}const g=p(j),h=N.cva("relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",{variants:{variant:{default:"bg-muted text-foreground",success:"bg-success-background text-success-foreground",info:"bg-info-background text-info-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning-background text-warning-foreground"}},defaultVariants:{variant:"default"}}),d=g.forwardRef(({className:t,variant:a,...s},r)=>e.jsx("div",{ref:r,className:i.cn(h({variant:a}),t),"data-slot":"alert","data-tracking-el":`alert-${a}`,role:"alert",...s}));d.displayName="Alert";const o=g.forwardRef(({className:t,asChild:a=!1,...s},r)=>{const l=a?v.Slot:"div";return e.jsx(l,{ref:r,className:i.cn("text-heading-compact break-words",t),"data-slot":"alert-title",...s})});o.displayName="AlertTitle";const x=g.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:i.cn("text-body-sm [&_p]:leading-5",t),"data-slot":"alert-description",...a}));x.displayName="AlertDescription";const f="max-md:flex-col max-md:items-stretch items-center",m="shrink-0 self-center max-md:self-start max-md:pl-7";function k({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"success",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleCheck,{className:"text-success-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}function A({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"info",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.Info,{className:"text-info-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}function b({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"destructive",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleX,{className:"text-destructive-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}function w({title:t,description:a,action:s,className:r,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn(f,r),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"warning",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.TriangleAlert,{className:"text-warning-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(x,{children:a})]})]}),s&&e.jsx("div",{className:m,children:s})]})}exports.Alert=d;exports.AlertDescription=x;exports.AlertDestructive=b;exports.AlertInfo=A;exports.AlertSuccess=k;exports.AlertTitle=o;exports.AlertWarning=w;exports.alertVariants=h;
|
package/dist/alert.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,QAAA,MAAM,KAAK;;sHAYT,CAAC;AAGH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,UAAU,wFAYf,CAAC;AAGF,QAAA,MAAM,gBAAgB,6GAUpB,CAAC;AAGH,UAAU,qBAAqB;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,qBAAqB,GAC5C,CACI;IACE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,GACD;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CACJ,CAAC;
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,QAAA,MAAM,KAAK;;sHAYT,CAAC;AAGH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,UAAU,wFAYf,CAAC;AAGF,QAAA,MAAM,gBAAgB,6GAUpB,CAAC;AAGH,UAAU,qBAAqB;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,qBAAqB,GAC5C,CACI;IACE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,GACD;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CACJ,CAAC;AAUJ,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,GACb,CAAC;AACF,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/alert.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { CircleX as
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { Slot as h } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as v } from "class-variance-authority";
|
|
5
|
+
import { CircleX as N, Info as p, CircleCheck as k, TriangleAlert as w } from "@brightlocal/icons";
|
|
6
6
|
import { cn as d } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
const
|
|
7
|
+
const A = v(
|
|
8
8
|
"relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -20,11 +20,11 @@ const p = h(
|
|
|
20
20
|
variant: "default"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
), o =
|
|
23
|
+
), o = x.forwardRef(({ className: r, variant: a, ...t }, s) => /* @__PURE__ */ e(
|
|
24
24
|
"div",
|
|
25
25
|
{
|
|
26
|
-
ref:
|
|
27
|
-
className: d(
|
|
26
|
+
ref: s,
|
|
27
|
+
className: d(A({ variant: a }), r),
|
|
28
28
|
"data-slot": "alert",
|
|
29
29
|
"data-tracking-el": `alert-${a}`,
|
|
30
30
|
role: "alert",
|
|
@@ -32,19 +32,19 @@ const p = h(
|
|
|
32
32
|
}
|
|
33
33
|
));
|
|
34
34
|
o.displayName = "Alert";
|
|
35
|
-
const
|
|
36
|
-
({ className: r, asChild: a = !1, ...t },
|
|
37
|
-
a ?
|
|
35
|
+
const m = x.forwardRef(
|
|
36
|
+
({ className: r, asChild: a = !1, ...t }, s) => /* @__PURE__ */ e(
|
|
37
|
+
a ? h : "div",
|
|
38
38
|
{
|
|
39
|
-
ref:
|
|
39
|
+
ref: s,
|
|
40
40
|
className: d("text-heading-compact break-words", r),
|
|
41
41
|
"data-slot": "alert-title",
|
|
42
42
|
...t
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
);
|
|
46
|
-
|
|
47
|
-
const
|
|
46
|
+
m.displayName = "AlertTitle";
|
|
47
|
+
const f = x.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
50
|
ref: t,
|
|
@@ -53,21 +53,22 @@ const m = g.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
|
|
|
53
53
|
...a
|
|
54
54
|
}
|
|
55
55
|
));
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
f.displayName = "AlertDescription";
|
|
57
|
+
const g = "max-md:flex-col max-md:items-stretch items-center", u = "shrink-0 self-center max-md:self-start max-md:pl-7";
|
|
58
|
+
function _({
|
|
58
59
|
title: r,
|
|
59
60
|
description: a,
|
|
60
61
|
action: t,
|
|
61
|
-
className:
|
|
62
|
-
dataHook:
|
|
62
|
+
className: s,
|
|
63
|
+
dataHook: n,
|
|
63
64
|
trackingEl: i,
|
|
64
65
|
trackingLabel: c
|
|
65
66
|
}) {
|
|
66
67
|
return /* @__PURE__ */ l(
|
|
67
68
|
o,
|
|
68
69
|
{
|
|
69
|
-
className: d(
|
|
70
|
-
"data-hook":
|
|
70
|
+
className: d(g, s),
|
|
71
|
+
"data-hook": n,
|
|
71
72
|
"data-tracking-el": i,
|
|
72
73
|
"data-tracking-label": c,
|
|
73
74
|
variant: "success",
|
|
@@ -75,112 +76,112 @@ function R({
|
|
|
75
76
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
76
77
|
/* @__PURE__ */ e(k, { className: "text-success-foreground shrink-0 translate-y-0.5" }),
|
|
77
78
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
78
|
-
r && /* @__PURE__ */ e(
|
|
79
|
-
a != null && /* @__PURE__ */ e(
|
|
79
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
80
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
80
81
|
] })
|
|
81
82
|
] }),
|
|
82
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
83
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
83
84
|
]
|
|
84
85
|
}
|
|
85
86
|
);
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function L({
|
|
88
89
|
title: r,
|
|
89
90
|
description: a,
|
|
90
91
|
action: t,
|
|
91
|
-
className:
|
|
92
|
-
dataHook:
|
|
92
|
+
className: s,
|
|
93
|
+
dataHook: n,
|
|
93
94
|
trackingEl: i,
|
|
94
95
|
trackingLabel: c
|
|
95
96
|
}) {
|
|
96
97
|
return /* @__PURE__ */ l(
|
|
97
98
|
o,
|
|
98
99
|
{
|
|
99
|
-
className: d(
|
|
100
|
-
"data-hook":
|
|
100
|
+
className: d(g, s),
|
|
101
|
+
"data-hook": n,
|
|
101
102
|
"data-tracking-el": i,
|
|
102
103
|
"data-tracking-label": c,
|
|
103
104
|
variant: "info",
|
|
104
105
|
children: [
|
|
105
106
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
106
|
-
/* @__PURE__ */ e(
|
|
107
|
+
/* @__PURE__ */ e(p, { className: "text-info-foreground shrink-0 translate-y-0.5" }),
|
|
107
108
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
108
|
-
r && /* @__PURE__ */ e(
|
|
109
|
-
a != null && /* @__PURE__ */ e(
|
|
109
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
110
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
110
111
|
] })
|
|
111
112
|
] }),
|
|
112
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
113
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
113
114
|
]
|
|
114
115
|
}
|
|
115
116
|
);
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function O({
|
|
118
119
|
title: r,
|
|
119
120
|
description: a,
|
|
120
121
|
action: t,
|
|
121
|
-
className:
|
|
122
|
-
dataHook:
|
|
122
|
+
className: s,
|
|
123
|
+
dataHook: n,
|
|
123
124
|
trackingEl: i,
|
|
124
125
|
trackingLabel: c
|
|
125
126
|
}) {
|
|
126
127
|
return /* @__PURE__ */ l(
|
|
127
128
|
o,
|
|
128
129
|
{
|
|
129
|
-
className: d(
|
|
130
|
-
"data-hook":
|
|
130
|
+
className: d(g, s),
|
|
131
|
+
"data-hook": n,
|
|
131
132
|
"data-tracking-el": i,
|
|
132
133
|
"data-tracking-label": c,
|
|
133
134
|
variant: "destructive",
|
|
134
135
|
children: [
|
|
135
136
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
136
|
-
/* @__PURE__ */ e(
|
|
137
|
+
/* @__PURE__ */ e(N, { className: "text-destructive-foreground shrink-0 translate-y-0.5" }),
|
|
137
138
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
138
|
-
r && /* @__PURE__ */ e(
|
|
139
|
-
a != null && /* @__PURE__ */ e(
|
|
139
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
140
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
140
141
|
] })
|
|
141
142
|
] }),
|
|
142
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
143
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
143
144
|
]
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function D({
|
|
148
149
|
title: r,
|
|
149
150
|
description: a,
|
|
150
151
|
action: t,
|
|
151
|
-
className:
|
|
152
|
-
dataHook:
|
|
152
|
+
className: s,
|
|
153
|
+
dataHook: n,
|
|
153
154
|
trackingEl: i,
|
|
154
155
|
trackingLabel: c
|
|
155
156
|
}) {
|
|
156
157
|
return /* @__PURE__ */ l(
|
|
157
158
|
o,
|
|
158
159
|
{
|
|
159
|
-
className: d(
|
|
160
|
-
"data-hook":
|
|
160
|
+
className: d(g, s),
|
|
161
|
+
"data-hook": n,
|
|
161
162
|
"data-tracking-el": i,
|
|
162
163
|
"data-tracking-label": c,
|
|
163
164
|
variant: "warning",
|
|
164
165
|
children: [
|
|
165
166
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
|
|
166
|
-
/* @__PURE__ */ e(
|
|
167
|
+
/* @__PURE__ */ e(w, { className: "text-warning-foreground shrink-0 translate-y-0.5" }),
|
|
167
168
|
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
168
|
-
r && /* @__PURE__ */ e(
|
|
169
|
-
a != null && /* @__PURE__ */ e(
|
|
169
|
+
r && /* @__PURE__ */ e(m, { children: r }),
|
|
170
|
+
a != null && /* @__PURE__ */ e(f, { children: a })
|
|
170
171
|
] })
|
|
171
172
|
] }),
|
|
172
|
-
t && /* @__PURE__ */ e("div", { className:
|
|
173
|
+
t && /* @__PURE__ */ e("div", { className: u, children: t })
|
|
173
174
|
]
|
|
174
175
|
}
|
|
175
176
|
);
|
|
176
177
|
}
|
|
177
178
|
export {
|
|
178
179
|
o as Alert,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
180
|
+
f as AlertDescription,
|
|
181
|
+
O as AlertDestructive,
|
|
182
|
+
L as AlertInfo,
|
|
183
|
+
_ as AlertSuccess,
|
|
184
|
+
m as AlertTitle,
|
|
185
|
+
D as AlertWarning,
|
|
186
|
+
A as alertVariants
|
|
186
187
|
};
|
package/dist/badge.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"),f=require("react"),v=require("@radix-ui/react-slot"),_=require("class-variance-authority"),m=require("@brightlocal/ui-components/lib/utils"),x=require("@brightlocal/ui-components/lib/use-dev-warning");function y(r){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(t,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return t.default=r,Object.freeze(t)}const h=y(f),j=_.cva(["inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden","rounded-full border px-2 py-0.5","text-label-sm whitespace-nowrap","[&>svg]:size-3 [&>svg]:pointer-events-none","[&>.contents>svg]:size-3 [&>.contents>svg]:pointer-events-none","transition-[color,background-color,border-color,box-shadow] duration-fast ease-out","focus-visible:outline-none","focus-visible:shadow-[0_0_0_1px_white,0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(0,0,0,0.1)]","dark:focus-visible:shadow-[0_0_0_1px_var(--background),0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(255,255,255,0.1)]","data-[number=true]:size-5 data-[number=true]:p-0 data-[number=true]:aspect-square"],{variants:{variant:{primary:"border-transparent bg-success-background text-success-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground focus-visible:border-ring",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"bg-background border-border text-foreground focus-visible:border-ring"}},defaultVariants:{variant:"primary"}}),c=h.forwardRef(({className:r,variant:t,asChild:e=!1,dataHook:a,trackingEl:d,trackingLabel:u,srLabel:s,children:o,...l},g)=>{const b=e?v.Slot:"span",i=s!==void 0&&!e;x.useDevWarning(()=>e&&s!==void 0,"srLabel is set on a <Badge asChild>. Slot renders the child element as-is, so the phrase cannot be injected — add an sr-only span inside the child instead.",[e,s]);const p=typeof o=="string"&&/^[0-9]$/.test(o);return n.jsx(b,{ref:g,className:m.cn(j({variant:t}),i&&"relative",r),"data-hook":a,"data-number":p,"data-slot":"badge","data-tracking-el":d,"data-tracking-label":u,...l,children:i?n.jsxs(n.Fragment,{children:[n.jsx("span",{"aria-hidden":"true",className:"contents",children:o}),n.jsx("span",{className:"sr-only",children:s})]}):o})});c.displayName="Badge";exports.Badge=c;
|
package/dist/badge.d.ts
CHANGED
|
@@ -23,6 +23,15 @@ interface BadgeProps extends React.ComponentProps<"span">, VariantProps<typeof b
|
|
|
23
23
|
* Tracking label for analytics context
|
|
24
24
|
*/
|
|
25
25
|
trackingLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Screen-reader phrase that replaces the visible content. A bare numeral
|
|
28
|
+
* tells a screen-reader user nothing about what it counts, so a count
|
|
29
|
+
* badge passes the phrase here ("3 active", "2 selected") and the numeral
|
|
30
|
+
* stays visual only. Ignored with `asChild` — the Slot's single child is
|
|
31
|
+
* the consumer's element, so put the phrase inside it instead.
|
|
32
|
+
* @example srLabel="3 active"
|
|
33
|
+
*/
|
|
34
|
+
srLabel?: string;
|
|
26
35
|
}
|
|
27
36
|
/**
|
|
28
37
|
* Displays a badge or a component that looks like a badge.
|
package/dist/badge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EA2ClB,CAAC;AAEF;;GAEG;AACH,UAAU,UACR,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,QAAA,MAAM,KAAK,iGA2DV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
|