@brightlocal/ui-components 0.1.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/LICENSE +21 -0
- package/README.md +349 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.d.ts +32 -0
- package/dist/accordion.d.ts.map +1 -0
- package/dist/accordion.js +107 -0
- package/dist/alert-dialog.cjs +1 -0
- package/dist/alert-dialog.d.ts +15 -0
- package/dist/alert-dialog.d.ts.map +1 -0
- package/dist/alert-dialog.js +146 -0
- package/dist/alert.cjs +1 -0
- package/dist/alert.d.ts +16 -0
- package/dist/alert.d.ts.map +1 -0
- package/dist/alert.js +174 -0
- package/dist/aspect-ratio.cjs +1 -0
- package/dist/aspect-ratio.d.ts +10 -0
- package/dist/aspect-ratio.d.ts.map +1 -0
- package/dist/aspect-ratio.js +22 -0
- package/dist/avatar.cjs +1 -0
- package/dist/avatar.d.ts +11 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +46 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.d.ts +19 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.js +50 -0
- package/dist/blocks/data-table.cjs +1 -0
- package/dist/blocks/data-table.d.ts +303 -0
- package/dist/blocks/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table.js +555 -0
- package/dist/blocks/sidebar.cjs +1 -0
- package/dist/blocks/sidebar.d.ts +744 -0
- package/dist/blocks/sidebar.d.ts.map +1 -0
- package/dist/blocks/sidebar.js +839 -0
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.d.ts +12 -0
- package/dist/breadcrumb.d.ts.map +1 -0
- package/dist/breadcrumb.js +102 -0
- package/dist/button.cjs +1 -0
- package/dist/button.d.ts +73 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +195 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.d.ts +28 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +191 -0
- package/dist/card.cjs +1 -0
- package/dist/card.d.ts +28 -0
- package/dist/card.d.ts.map +1 -0
- package/dist/card.js +131 -0
- package/dist/carousel.cjs +1 -0
- package/dist/carousel.d.ts +21 -0
- package/dist/carousel.d.ts.map +1 -0
- package/dist/carousel.js +185 -0
- package/dist/centred-layout.cjs +1 -0
- package/dist/centred-layout.d.ts +49 -0
- package/dist/centred-layout.d.ts.map +1 -0
- package/dist/centred-layout.js +35 -0
- package/dist/chart.cjs +10 -0
- package/dist/chart.d.ts +83 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +254 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.d.ts +15 -0
- package/dist/checkbox.d.ts.map +1 -0
- package/dist/checkbox.js +96 -0
- package/dist/collapsible.cjs +1 -0
- package/dist/collapsible.d.ts +18 -0
- package/dist/collapsible.d.ts.map +1 -0
- package/dist/collapsible.js +58 -0
- package/dist/combobox.cjs +1 -0
- package/dist/combobox.d.ts +65 -0
- package/dist/combobox.d.ts.map +1 -0
- package/dist/combobox.js +203 -0
- package/dist/command.cjs +1 -0
- package/dist/command.d.ts +44 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +166 -0
- package/dist/context-menu.cjs +1 -0
- package/dist/context-menu.d.ts +42 -0
- package/dist/context-menu.d.ts.map +1 -0
- package/dist/context-menu.js +226 -0
- package/dist/date-picker.cjs +1 -0
- package/dist/date-picker.d.ts +54 -0
- package/dist/date-picker.d.ts.map +1 -0
- package/dist/date-picker.js +95 -0
- package/dist/dialog.cjs +1 -0
- package/dist/dialog.d.ts +20 -0
- package/dist/dialog.d.ts.map +1 -0
- package/dist/dialog.js +130 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.d.ts +22 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +149 -0
- package/dist/dropdown-menu.cjs +1 -0
- package/dist/dropdown-menu.d.ts +253 -0
- package/dist/dropdown-menu.d.ts.map +1 -0
- package/dist/dropdown-menu.js +325 -0
- package/dist/field.cjs +1 -0
- package/dist/field.d.ts +21 -0
- package/dist/field.d.ts.map +1 -0
- package/dist/field.js +148 -0
- package/dist/global-layout.cjs +1 -0
- package/dist/global-layout.d.ts +60 -0
- package/dist/global-layout.d.ts.map +1 -0
- package/dist/global-layout.js +87 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hover-card.cjs +1 -0
- package/dist/hover-card.d.ts +43 -0
- package/dist/hover-card.d.ts.map +1 -0
- package/dist/hover-card.js +71 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +412 -0
- package/dist/input-base.cjs +1 -0
- package/dist/input-base.d.ts +28 -0
- package/dist/input-base.d.ts.map +1 -0
- package/dist/input-base.js +56 -0
- package/dist/input-group.cjs +1 -0
- package/dist/input-group.d.ts +26 -0
- package/dist/input-group.d.ts.map +1 -0
- package/dist/input-group.js +116 -0
- package/dist/input-otp.cjs +1 -0
- package/dist/input-otp.d.ts +45 -0
- package/dist/input-otp.d.ts.map +1 -0
- package/dist/input-otp.js +186 -0
- package/dist/input-password.cjs +1 -0
- package/dist/input-password.d.ts +38 -0
- package/dist/input-password.d.ts.map +1 -0
- package/dist/input-password.js +101 -0
- package/dist/input.cjs +1 -0
- package/dist/input.d.ts +32 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +146 -0
- package/dist/label.cjs +1 -0
- package/dist/label.d.ts +12 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +34 -0
- package/dist/lib/utils.cjs +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/link.cjs +1 -0
- package/dist/link.d.ts +29 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.figma.d.ts +2 -0
- package/dist/link.figma.d.ts.map +1 -0
- package/dist/link.js +71 -0
- package/dist/logo.cjs +1 -0
- package/dist/logo.d.ts +25 -0
- package/dist/logo.d.ts.map +1 -0
- package/dist/logo.js +71 -0
- package/dist/menubar.cjs +1 -0
- package/dist/menubar.d.ts +106 -0
- package/dist/menubar.d.ts.map +1 -0
- package/dist/menubar.js +270 -0
- package/dist/navigation-menu.cjs +1 -0
- package/dist/navigation-menu.d.ts +108 -0
- package/dist/navigation-menu.d.ts.map +1 -0
- package/dist/navigation-menu.js +175 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.d.ts +81 -0
- package/dist/pagination.d.ts.map +1 -0
- package/dist/pagination.js +216 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.d.ts +8 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +44 -0
- package/dist/progress.cjs +1 -0
- package/dist/progress.d.ts +29 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +64 -0
- package/dist/radio-group.cjs +1 -0
- package/dist/radio-group.d.ts +33 -0
- package/dist/radio-group.d.ts.map +1 -0
- package/dist/radio-group.js +193 -0
- package/dist/rating.cjs +1 -0
- package/dist/rating.d.ts +22 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +51 -0
- package/dist/resizable.cjs +1 -0
- package/dist/resizable.d.ts +14 -0
- package/dist/resizable.d.ts.map +1 -0
- package/dist/resizable.js +46 -0
- package/dist/scroll-area.cjs +1 -0
- package/dist/scroll-area.d.ts +12 -0
- package/dist/scroll-area.d.ts.map +1 -0
- package/dist/scroll-area.js +67 -0
- package/dist/select.cjs +1 -0
- package/dist/select.d.ts +77 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +259 -0
- package/dist/separator.cjs +1 -0
- package/dist/separator.d.ts +14 -0
- package/dist/separator.d.ts.map +1 -0
- package/dist/separator.js +43 -0
- package/dist/sheet.cjs +1 -0
- package/dist/sheet.d.ts +38 -0
- package/dist/sheet.d.ts.map +1 -0
- package/dist/sheet.js +190 -0
- package/dist/skeleton.cjs +1 -0
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -0
- package/dist/skeleton.js +15 -0
- package/dist/slider.cjs +1 -0
- package/dist/slider.d.ts +19 -0
- package/dist/slider.d.ts.map +1 -0
- package/dist/slider.js +69 -0
- package/dist/sonner.cjs +1 -0
- package/dist/sonner.d.ts +188 -0
- package/dist/sonner.d.ts.map +1 -0
- package/dist/sonner.js +150 -0
- package/dist/split-layout.cjs +1 -0
- package/dist/split-layout.d.ts +42 -0
- package/dist/split-layout.d.ts.map +1 -0
- package/dist/split-layout.js +108 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.d.ts +43 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.figma.d.ts +2 -0
- package/dist/switch.figma.d.ts.map +1 -0
- package/dist/switch.js +110 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +95 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +164 -0
- package/dist/tabs.cjs +1 -0
- package/dist/tabs.d.ts +29 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +96 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.d.ts +23 -0
- package/dist/textarea.d.ts.map +1 -0
- package/dist/textarea.js +47 -0
- package/dist/toggle-group.cjs +1 -0
- package/dist/toggle-group.d.ts +25 -0
- package/dist/toggle-group.d.ts.map +1 -0
- package/dist/toggle-group.js +74 -0
- package/dist/toggle.cjs +1 -0
- package/dist/toggle.d.ts +44 -0
- package/dist/toggle.d.ts.map +1 -0
- package/dist/toggle.figma.d.ts +2 -0
- package/dist/toggle.figma.d.ts.map +1 -0
- package/dist/toggle.js +57 -0
- package/dist/tooltip.cjs +1 -0
- package/dist/tooltip.d.ts +66 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +78 -0
- package/package.json +184 -0
- package/src/blocks/data-table.tsx +1166 -0
- package/src/blocks/sidebar.tsx +1830 -0
- package/src/components/.gitkeep +0 -0
- package/src/components/accordion.tsx +142 -0
- package/src/components/alert-dialog.tsx +157 -0
- package/src/components/alert.tsx +199 -0
- package/src/components/aspect-ratio.tsx +30 -0
- package/src/components/avatar.tsx +56 -0
- package/src/components/badge.tsx +72 -0
- package/src/components/breadcrumb.tsx +109 -0
- package/src/components/button.tsx +296 -0
- package/src/components/calendar.tsx +234 -0
- package/src/components/card.tsx +158 -0
- package/src/components/carousel.tsx +256 -0
- package/src/components/centred-layout.tsx +91 -0
- package/src/components/chart.tsx +456 -0
- package/src/components/checkbox.tsx +132 -0
- package/src/components/collapsible.tsx +68 -0
- package/src/components/combobox.tsx +321 -0
- package/src/components/command.tsx +220 -0
- package/src/components/context-menu.tsx +305 -0
- package/src/components/date-picker.tsx +155 -0
- package/src/components/dialog.tsx +152 -0
- package/src/components/drawer.tsx +168 -0
- package/src/components/dropdown-menu.tsx +575 -0
- package/src/components/field.tsx +155 -0
- package/src/components/global-layout.tsx +153 -0
- package/src/components/hover-card.tsx +121 -0
- package/src/components/input-base.tsx +86 -0
- package/src/components/input-group.tsx +158 -0
- package/src/components/input-otp.tsx +327 -0
- package/src/components/input-password.tsx +191 -0
- package/src/components/input.tsx +220 -0
- package/src/components/label.tsx +42 -0
- package/src/components/link.figma.tsx +71 -0
- package/src/components/link.tsx +105 -0
- package/src/components/logo.tsx +97 -0
- package/src/components/menubar.tsx +379 -0
- package/src/components/navigation-menu.tsx +324 -0
- package/src/components/pagination.tsx +368 -0
- package/src/components/popover.tsx +46 -0
- package/src/components/progress.tsx +100 -0
- package/src/components/radio-group.tsx +281 -0
- package/src/components/rating.tsx +87 -0
- package/src/components/resizable.tsx +66 -0
- package/src/components/scroll-area.tsx +72 -0
- package/src/components/select.tsx +442 -0
- package/src/components/separator.tsx +53 -0
- package/src/components/sheet.tsx +220 -0
- package/src/components/skeleton.tsx +17 -0
- package/src/components/slider.tsx +86 -0
- package/src/components/sonner.tsx +396 -0
- package/src/components/split-layout.tsx +155 -0
- package/src/components/switch.figma.tsx +115 -0
- package/src/components/switch.tsx +173 -0
- package/src/components/table.tsx +277 -0
- package/src/components/tabs.tsx +142 -0
- package/src/components/textarea.tsx +77 -0
- package/src/components/toggle-group.tsx +109 -0
- package/src/components/toggle.figma.tsx +81 -0
- package/src/components/toggle.tsx +103 -0
- package/src/components/tooltip.tsx +156 -0
- package/src/hooks/.gitkeep +0 -0
- package/src/hooks/use-mobile.ts +21 -0
- package/src/index.ts +67 -0
- package/src/lib/utils.ts +6 -0
- package/src/types/external-modules.d.ts +16 -0
package/dist/sheet.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
/**
|
|
5
|
+
* Available sheet side variants
|
|
6
|
+
*/
|
|
7
|
+
export declare enum SheetSide {
|
|
8
|
+
/** Sheet slides in from the top */
|
|
9
|
+
TOP = "top",
|
|
10
|
+
/** Sheet slides in from the right (default) */
|
|
11
|
+
RIGHT = "right",
|
|
12
|
+
/** Sheet slides in from the bottom */
|
|
13
|
+
BOTTOM = "bottom",
|
|
14
|
+
/** Sheet slides in from the left */
|
|
15
|
+
LEFT = "left"
|
|
16
|
+
}
|
|
17
|
+
declare const sheetContentVariants: (props?: ({
|
|
18
|
+
side?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
19
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
20
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof SheetPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
interface SheetContentProps extends React.ComponentProps<typeof SheetPrimitive.Content>, VariantProps<typeof sheetContentVariants> {
|
|
26
|
+
/**
|
|
27
|
+
* Side from which the sheet slides in
|
|
28
|
+
*/
|
|
29
|
+
side?: SheetSide;
|
|
30
|
+
}
|
|
31
|
+
declare function SheetContent({ className, children, side, ...props }: SheetContentProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, };
|
|
37
|
+
export type { SheetContentProps };
|
|
38
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/components/sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE;;GAEG;AACH,oBAAY,SAAS;IACnB,mCAAmC;IACnC,GAAG,QAAQ;IACX,+CAA+C;IAC/C,KAAK,UAAU;IACf,sCAAsC;IACtC,MAAM,WAAW;IACjB,oCAAoC;IACpC,IAAI,SAAS;CACd;AAED,QAAA,MAAM,oBAAoB;;8EA8DzB,CAAC;AAEF,iBAAS,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAE5E;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,2CAErD;AAED,iBAAS,UAAU,CAAC,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,2CAEnD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,MAAM,CAAC,2CAEpD;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,2CAWrD;AAED,UAAU,iBACR,SACE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,EACnD,YAAY,CAAC,OAAO,oBAAoB,CAAC;IAC3C;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAiBnB;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQxE;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAWxE;AAED,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,2CAQnD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,WAAW,CAAC,2CAQzD;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,UAAU,EACV,YAAY,GACb,CAAC;AAEF,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/sheet.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "@radix-ui/react-dialog";
|
|
3
|
+
import { cva as l } from "class-variance-authority";
|
|
4
|
+
import { XIcon as d } from "lucide-react";
|
|
5
|
+
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
var c = /* @__PURE__ */ ((t) => (t.TOP = "top", t.RIGHT = "right", t.BOTTOM = "bottom", t.LEFT = "left", t))(c || {});
|
|
7
|
+
const f = l(
|
|
8
|
+
[
|
|
9
|
+
"bg-background",
|
|
10
|
+
"data-[state=open]:animate-in",
|
|
11
|
+
"data-[state=closed]:animate-out",
|
|
12
|
+
"fixed",
|
|
13
|
+
"z-50",
|
|
14
|
+
"flex",
|
|
15
|
+
"flex-col",
|
|
16
|
+
"gap-4",
|
|
17
|
+
"p-6",
|
|
18
|
+
"shadow-lg",
|
|
19
|
+
"transition",
|
|
20
|
+
"ease-in-out",
|
|
21
|
+
"data-[state=closed]:duration-300",
|
|
22
|
+
"data-[state=open]:duration-500"
|
|
23
|
+
],
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
side: {
|
|
27
|
+
top: [
|
|
28
|
+
"data-[state=closed]:slide-out-to-top",
|
|
29
|
+
"data-[state=open]:slide-in-from-top",
|
|
30
|
+
"inset-x-0",
|
|
31
|
+
"top-0",
|
|
32
|
+
"h-auto",
|
|
33
|
+
"border-b"
|
|
34
|
+
],
|
|
35
|
+
right: [
|
|
36
|
+
"data-[state=closed]:slide-out-to-right",
|
|
37
|
+
"data-[state=open]:slide-in-from-right",
|
|
38
|
+
"inset-y-0",
|
|
39
|
+
"right-0",
|
|
40
|
+
"h-full",
|
|
41
|
+
"w-3/4",
|
|
42
|
+
"border-l",
|
|
43
|
+
"sm:max-w-sm"
|
|
44
|
+
],
|
|
45
|
+
bottom: [
|
|
46
|
+
"data-[state=closed]:slide-out-to-bottom",
|
|
47
|
+
"data-[state=open]:slide-in-from-bottom",
|
|
48
|
+
"inset-x-0",
|
|
49
|
+
"bottom-0",
|
|
50
|
+
"h-auto",
|
|
51
|
+
"border-t"
|
|
52
|
+
],
|
|
53
|
+
left: [
|
|
54
|
+
"data-[state=closed]:slide-out-to-left",
|
|
55
|
+
"data-[state=open]:slide-in-from-left",
|
|
56
|
+
"inset-y-0",
|
|
57
|
+
"left-0",
|
|
58
|
+
"h-full",
|
|
59
|
+
"w-3/4",
|
|
60
|
+
"border-r",
|
|
61
|
+
"sm:max-w-sm"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
side: "right"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
function b({ ...t }) {
|
|
71
|
+
return /* @__PURE__ */ e(a.Root, { "data-slot": "sheet", modal: !0, ...t });
|
|
72
|
+
}
|
|
73
|
+
function v({
|
|
74
|
+
...t
|
|
75
|
+
}) {
|
|
76
|
+
return /* @__PURE__ */ e(a.Trigger, { "data-slot": "sheet-trigger", ...t });
|
|
77
|
+
}
|
|
78
|
+
function y({
|
|
79
|
+
...t
|
|
80
|
+
}) {
|
|
81
|
+
return /* @__PURE__ */ e(a.Close, { "data-slot": "sheet-close", ...t });
|
|
82
|
+
}
|
|
83
|
+
function u({
|
|
84
|
+
...t
|
|
85
|
+
}) {
|
|
86
|
+
return /* @__PURE__ */ e(a.Portal, { "data-slot": "sheet-portal", ...t });
|
|
87
|
+
}
|
|
88
|
+
function m({
|
|
89
|
+
className: t,
|
|
90
|
+
...o
|
|
91
|
+
}) {
|
|
92
|
+
return /* @__PURE__ */ e(
|
|
93
|
+
a.Overlay,
|
|
94
|
+
{
|
|
95
|
+
className: s(
|
|
96
|
+
"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",
|
|
97
|
+
t
|
|
98
|
+
),
|
|
99
|
+
"data-slot": "sheet-overlay",
|
|
100
|
+
...o
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function T({
|
|
105
|
+
className: t,
|
|
106
|
+
children: o,
|
|
107
|
+
side: r,
|
|
108
|
+
...i
|
|
109
|
+
}) {
|
|
110
|
+
return /* @__PURE__ */ n(u, { children: [
|
|
111
|
+
/* @__PURE__ */ e(m, {}),
|
|
112
|
+
/* @__PURE__ */ n(
|
|
113
|
+
a.Content,
|
|
114
|
+
{
|
|
115
|
+
className: s(f({ side: r }), t),
|
|
116
|
+
"data-slot": "sheet-content",
|
|
117
|
+
...i,
|
|
118
|
+
children: [
|
|
119
|
+
o,
|
|
120
|
+
/* @__PURE__ */ n(a.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [
|
|
121
|
+
/* @__PURE__ */ e(d, {}),
|
|
122
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
123
|
+
] })
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] });
|
|
128
|
+
}
|
|
129
|
+
function N({ className: t, ...o }) {
|
|
130
|
+
return /* @__PURE__ */ e(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: s("flex flex-col gap-2 text-center sm:text-left", t),
|
|
134
|
+
"data-slot": "sheet-header",
|
|
135
|
+
...o
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
function C({ className: t, ...o }) {
|
|
140
|
+
return /* @__PURE__ */ e(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
className: s(
|
|
144
|
+
"mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",
|
|
145
|
+
t
|
|
146
|
+
),
|
|
147
|
+
"data-slot": "sheet-footer",
|
|
148
|
+
...o
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
function w({
|
|
153
|
+
className: t,
|
|
154
|
+
...o
|
|
155
|
+
}) {
|
|
156
|
+
return /* @__PURE__ */ e(
|
|
157
|
+
a.Title,
|
|
158
|
+
{
|
|
159
|
+
className: s("text-foreground text-lg font-semibold", t),
|
|
160
|
+
"data-slot": "sheet-title",
|
|
161
|
+
...o
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
function O({
|
|
166
|
+
className: t,
|
|
167
|
+
...o
|
|
168
|
+
}) {
|
|
169
|
+
return /* @__PURE__ */ e(
|
|
170
|
+
a.Description,
|
|
171
|
+
{
|
|
172
|
+
className: s("text-muted-foreground text-sm", t),
|
|
173
|
+
"data-slot": "sheet-description",
|
|
174
|
+
...o
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
export {
|
|
179
|
+
b as Sheet,
|
|
180
|
+
y as SheetClose,
|
|
181
|
+
T as SheetContent,
|
|
182
|
+
O as SheetDescription,
|
|
183
|
+
C as SheetFooter,
|
|
184
|
+
N as SheetHeader,
|
|
185
|
+
m as SheetOverlay,
|
|
186
|
+
u as SheetPortal,
|
|
187
|
+
c as SheetSide,
|
|
188
|
+
w as SheetTitle,
|
|
189
|
+
v as SheetTrigger
|
|
190
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("@brightlocal/ui-components/lib/utils");function s({className:e,...t}){return n.jsx("div",{className:o.cn("bg-accent animate-pulse rounded-md",e),"data-slot":"skeleton",...t})}exports.Skeleton=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"AAEA,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAQvD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
3
|
+
function m({ className: e, ...t }) {
|
|
4
|
+
return /* @__PURE__ */ o(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: n("bg-accent animate-pulse rounded-md", e),
|
|
8
|
+
"data-slot": "skeleton",
|
|
9
|
+
...t
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
m as Skeleton
|
|
15
|
+
};
|
package/dist/slider.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),m=require("@radix-ui/react-slider"),s=require("@brightlocal/ui-components/lib/utils");function c(t){const a=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(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const v=c(h),n=c(m);function y({className:t,dataHook:a,defaultValue:e,max:r=100,min:l=0,trackingEl:d,trackingLabel:u,value:i,...b}){const f=v.useMemo(()=>Array.isArray(i)?i:Array.isArray(e)?e:[l,r],[i,e,l,r]);return o.jsxs(n.Root,{className:s.cn("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),"data-hook":a,"data-slot":"slider","data-tracking-el":d,"data-tracking-label":u,defaultValue:e,max:r,min:l,value:i,...b,children:[o.jsx(n.Track,{className:s.cn("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),"data-slot":"slider-track",children:o.jsx(n.Range,{className:s.cn("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),"data-slot":"slider-range"})}),Array.from({length:f.length},(p,g)=>o.jsx(n.Thumb,{className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50","data-slot":"slider-thumb"},g))]})}exports.Slider=y;
|
package/dist/slider.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
|
+
export interface SliderProps extends React.ComponentProps<typeof SliderPrimitive.Root> {
|
|
4
|
+
/**
|
|
5
|
+
* Required data-hook attribute for testing and analytics
|
|
6
|
+
*/
|
|
7
|
+
dataHook: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional analytics element identifier
|
|
10
|
+
*/
|
|
11
|
+
trackingEl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Optional analytics label context
|
|
14
|
+
*/
|
|
15
|
+
trackingLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
declare function Slider({ className, dataHook, defaultValue, max, min, trackingEl, trackingLabel, value, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Slider };
|
|
19
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/components/slider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,IAAI,CAC5B;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,MAAM,CAAC,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,GAAS,EACT,GAAO,EACP,UAAU,EACV,aAAa,EACb,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,2CAiDb;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/slider.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import * as r from "@radix-ui/react-slider";
|
|
4
|
+
import { cn as n } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
function w({
|
|
6
|
+
className: l,
|
|
7
|
+
dataHook: d,
|
|
8
|
+
defaultValue: a,
|
|
9
|
+
max: o = 100,
|
|
10
|
+
min: i = 0,
|
|
11
|
+
trackingEl: s,
|
|
12
|
+
trackingLabel: c,
|
|
13
|
+
value: t,
|
|
14
|
+
...h
|
|
15
|
+
}) {
|
|
16
|
+
const m = g.useMemo(
|
|
17
|
+
() => Array.isArray(t) ? t : Array.isArray(a) ? a : [i, o],
|
|
18
|
+
[t, a, i, o]
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ f(
|
|
21
|
+
r.Root,
|
|
22
|
+
{
|
|
23
|
+
className: n(
|
|
24
|
+
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
25
|
+
l
|
|
26
|
+
),
|
|
27
|
+
"data-hook": d,
|
|
28
|
+
"data-slot": "slider",
|
|
29
|
+
"data-tracking-el": s,
|
|
30
|
+
"data-tracking-label": c,
|
|
31
|
+
defaultValue: a,
|
|
32
|
+
max: o,
|
|
33
|
+
min: i,
|
|
34
|
+
value: t,
|
|
35
|
+
...h,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
r.Track,
|
|
39
|
+
{
|
|
40
|
+
className: n(
|
|
41
|
+
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
42
|
+
),
|
|
43
|
+
"data-slot": "slider-track",
|
|
44
|
+
children: /* @__PURE__ */ e(
|
|
45
|
+
r.Range,
|
|
46
|
+
{
|
|
47
|
+
className: n(
|
|
48
|
+
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
49
|
+
),
|
|
50
|
+
"data-slot": "slider-range"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
Array.from({ length: m.length }, (u, b) => /* @__PURE__ */ e(
|
|
56
|
+
r.Thumb,
|
|
57
|
+
{
|
|
58
|
+
className: "border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50",
|
|
59
|
+
"data-slot": "slider-thumb"
|
|
60
|
+
},
|
|
61
|
+
b
|
|
62
|
+
))
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
w as Slider
|
|
69
|
+
};
|
package/dist/sonner.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("lucide-react"),u=require("class-variance-authority"),m=require("sonner"),S=require("@brightlocal/ui-components/button"),o=require("@brightlocal/ui-components/lib/utils");var h=(e=>(e.INFO="info",e.SUCCESS="success",e.WARNING="warning",e.ERROR="error",e.LOADING="loading",e))(h||{}),x=(e=>(e.DEFAULT="default",e.SUCCESS="success",e))(x||{});const v=u.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"}}),g=u.cva("text-sm leading-normal font-medium",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900"}},defaultVariants:{colorSchema:"default"}}),N=u.cva("text-sm leading-normal",{variants:{colorSchema:{default:"text-muted-foreground",success:"text-green-900"}},defaultVariants:{colorSchema:"default"}}),n=u.cva("size-5",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900"}},defaultVariants:{colorSchema:"default"}});function p(e,t){switch(e){case"info":return r.jsx(c.Info,{className:o.cn(n({colorSchema:t}))});case"success":return r.jsx(c.CheckCircle2,{className:o.cn(n({colorSchema:t}))});case"warning":return r.jsx(c.AlertTriangle,{className:o.cn(n({colorSchema:t}))});case"error":return r.jsx(c.XCircle,{className:o.cn(n({colorSchema:t}))});case"loading":return r.jsx(c.Loader2,{className:o.cn(n({colorSchema:t}),"animate-spin")});default:return null}}function j(e,t){const{id:s,...a}=e,d=s!=null?{...t,id:t?.id??s}:t;m.toast.custom(l=>{const f=a.button&&a.button.label?{label:a.button.label,variant:a.button.variant,onClick:()=>{a.button?.onClick&&a.button.onClick(),m.toast.dismiss(l)}}:void 0;return r.jsx(A,{button:f,colorSchema:a.colorSchema,description:a.description,icon:a.icon??void 0,id:l,title:a.title})},d)}function A(e){const{button:t,description:s,icon:a,title:d,colorSchema:l}=e,i=(b=>b==="success"?"success":"default")(l);return r.jsxs("div",{"aria-atomic":"true","aria-live":"polite",className:o.cn(v({colorSchema:i})),role:"status",children:[r.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[a!=null&&p(a,i),r.jsxs("div",{className:"w-full",children:[r.jsx("p",{className:o.cn(g({colorSchema:i})),children:d}),s&&r.jsx("p",{className:o.cn(N({colorSchema:i})),children:s})]})]}),t?.label&&r.jsx(S.Button,{"aria-label":t.label,className:"min-h-6 px-2 py-0 text-xs leading-normal font-medium",dataHook:"toast-action",size:S.ButtonSize.DEFAULT,variant:t.variant,onClick:t.onClick,children:t.label})]})}function C(){return r.jsx(m.Toaster,{position:"top-right"})}exports.Sonner=C;exports.SonnerColorSchema=x;exports.SonnerIcon=h;exports.sonner=j;
|
package/dist/sonner.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { ButtonVariant } from '../button';
|
|
2
|
+
/**
|
|
3
|
+
* Internal props for the Toast component.
|
|
4
|
+
* Includes the `id` field which is managed internally by Sonner.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
type ToastProps = {
|
|
8
|
+
/** Internal toast ID assigned by Sonner */
|
|
9
|
+
id: string | number;
|
|
10
|
+
/** The main heading text of the toast */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Optional description text displayed below the title */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Optional action button configuration */
|
|
15
|
+
button?: {
|
|
16
|
+
/** Button label text */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Click handler for the button */
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
/** Visual variant of the button */
|
|
21
|
+
variant?: ButtonVariant;
|
|
22
|
+
};
|
|
23
|
+
/** Color theme for the toast */
|
|
24
|
+
colorSchema?: SonnerColorSchema;
|
|
25
|
+
/** Icon to display in the toast */
|
|
26
|
+
icon?: ToastIconType | null;
|
|
27
|
+
};
|
|
28
|
+
export declare enum SonnerIcon {
|
|
29
|
+
INFO = "info",
|
|
30
|
+
SUCCESS = "success",
|
|
31
|
+
WARNING = "warning",
|
|
32
|
+
ERROR = "error",
|
|
33
|
+
LOADING = "loading"
|
|
34
|
+
}
|
|
35
|
+
export type ToastIconType = SonnerIcon | null;
|
|
36
|
+
export declare enum SonnerColorSchema {
|
|
37
|
+
DEFAULT = "default",
|
|
38
|
+
SUCCESS = "success"
|
|
39
|
+
}
|
|
40
|
+
type SonnerCustomOptions = {
|
|
41
|
+
className?: string;
|
|
42
|
+
id?: string | number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Input type for creating a toast. The `id` is optional as it will be generated if not provided.
|
|
46
|
+
*/
|
|
47
|
+
type ToastInput = Omit<ToastProps, "id"> & {
|
|
48
|
+
id?: string | number;
|
|
49
|
+
};
|
|
50
|
+
declare function sonner(toast: ToastInput, options?: SonnerCustomOptions): void;
|
|
51
|
+
/**
|
|
52
|
+
* Sonner toaster component that must be mounted once in your application root.
|
|
53
|
+
* This component manages the toast container and handles toast display, stacking, and animations.
|
|
54
|
+
*
|
|
55
|
+
* **Important - Mounting Location:**
|
|
56
|
+
* Always mount <Sonner /> at the root level of your app or at the story decorator level in Storybook.
|
|
57
|
+
* DO NOT mount it inside individual components, as this will break the fixed positioning.
|
|
58
|
+
* The component needs to be a direct child of the body/root to position correctly relative to the viewport.
|
|
59
|
+
*
|
|
60
|
+
* **Animations:**
|
|
61
|
+
* Entry and exit animations are automatically handled by the underlying Sonner library.
|
|
62
|
+
* Toasts slide in from top-right and fade out when dismissed.
|
|
63
|
+
* No additional animation classes or configuration are required - animations work out of the box.
|
|
64
|
+
* The library provides smooth, performant transitions using CSS transforms and opacity.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // CORRECT: Mount in your app root (App.tsx or layout.tsx)
|
|
68
|
+
* import { Sonner } from '@brightlocal/ui-components/sonner';
|
|
69
|
+
*
|
|
70
|
+
* function App() {
|
|
71
|
+
* return (
|
|
72
|
+
* <>
|
|
73
|
+
* <Sonner />
|
|
74
|
+
* <YourAppContent />
|
|
75
|
+
* </>
|
|
76
|
+
* );
|
|
77
|
+
* }
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* // CORRECT: In Storybook, mount in decorator
|
|
81
|
+
* const meta: Meta = {
|
|
82
|
+
* decorators: [
|
|
83
|
+
* (Story) => (
|
|
84
|
+
* <>
|
|
85
|
+
* <Sonner />
|
|
86
|
+
* <Story />
|
|
87
|
+
* </>
|
|
88
|
+
* ),
|
|
89
|
+
* ],
|
|
90
|
+
* };
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // WRONG: Do not mount inside components
|
|
94
|
+
* function MyComponent() {
|
|
95
|
+
* return (
|
|
96
|
+
* <>
|
|
97
|
+
* <Sonner />
|
|
98
|
+
* <div>Content</div>
|
|
99
|
+
* </>
|
|
100
|
+
* );
|
|
101
|
+
* }
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* // Then use sonner() anywhere in your app
|
|
105
|
+
* import { sonner, SonnerIcon } from '@brightlocal/ui-components/sonner';
|
|
106
|
+
*
|
|
107
|
+
* function MyComponent() {
|
|
108
|
+
* const handleClick = () => {
|
|
109
|
+
* sonner({
|
|
110
|
+
* title: "Success!",
|
|
111
|
+
* icon: SonnerIcon.SUCCESS
|
|
112
|
+
* });
|
|
113
|
+
* };
|
|
114
|
+
*
|
|
115
|
+
* return <button onClick={handleClick}>Show Toast</button>;
|
|
116
|
+
* }
|
|
117
|
+
*/
|
|
118
|
+
declare function Sonner(): import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
/**
|
|
120
|
+
* @module Sonner
|
|
121
|
+
*
|
|
122
|
+
* A custom toast notification system built on top of Sonner library.
|
|
123
|
+
* Provides a fully styled, accessible toast component with support for:
|
|
124
|
+
* - Multiple icon types (info, success, warning, error, loading)
|
|
125
|
+
* - Action buttons
|
|
126
|
+
* - Color schemas
|
|
127
|
+
* - Dark mode
|
|
128
|
+
* - Customizable positioning and timing
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```tsx
|
|
132
|
+
* // 1. Mount the Sonner component in your app root
|
|
133
|
+
* import { Sonner } from '@brightlocal/ui-components/sonner';
|
|
134
|
+
* import { toast } from 'sonner';
|
|
135
|
+
*
|
|
136
|
+
* <Sonner />
|
|
137
|
+
*
|
|
138
|
+
* // 2. Show toasts anywhere in your app
|
|
139
|
+
* import { sonner, SonnerIcon, SonnerColorSchema } from '@brightlocal/ui-components/sonner';
|
|
140
|
+
*
|
|
141
|
+
* // Simple toast
|
|
142
|
+
* sonner({ title: "Hello world" });
|
|
143
|
+
*
|
|
144
|
+
* // Success toast with action
|
|
145
|
+
* sonner({
|
|
146
|
+
* title: "Changes saved",
|
|
147
|
+
* description: "Your changes have been saved successfully.",
|
|
148
|
+
* icon: SonnerIcon.SUCCESS,
|
|
149
|
+
* colorSchema: SonnerColorSchema.SUCCESS,
|
|
150
|
+
* button: {
|
|
151
|
+
* label: "Undo",
|
|
152
|
+
* onClick: () => undoChanges()
|
|
153
|
+
* }
|
|
154
|
+
* });
|
|
155
|
+
*
|
|
156
|
+
* // Loading toast that updates when operation completes
|
|
157
|
+
* // Note: Store the toast ID to update or dismiss the loading toast
|
|
158
|
+
* const loadingToastId = 'upload-operation';
|
|
159
|
+
*
|
|
160
|
+
* // Show loading toast
|
|
161
|
+
* sonner({
|
|
162
|
+
* title: "Uploading...",
|
|
163
|
+
* description: "Please wait while we upload your file.",
|
|
164
|
+
* icon: SonnerIcon.LOADING,
|
|
165
|
+
* id: loadingToastId
|
|
166
|
+
* });
|
|
167
|
+
*
|
|
168
|
+
* // After operation completes, dismiss the loading toast and show success
|
|
169
|
+
* try {
|
|
170
|
+
* await uploadFile();
|
|
171
|
+
* toast.dismiss(loadingToastId);
|
|
172
|
+
* sonner({
|
|
173
|
+
* title: "Upload complete!",
|
|
174
|
+
* icon: SonnerIcon.SUCCESS,
|
|
175
|
+
* colorSchema: SonnerColorSchema.SUCCESS
|
|
176
|
+
* });
|
|
177
|
+
* } catch (error) {
|
|
178
|
+
* toast.dismiss(loadingToastId);
|
|
179
|
+
* sonner({
|
|
180
|
+
* title: "Upload failed",
|
|
181
|
+
* description: error.message,
|
|
182
|
+
* icon: SonnerIcon.ERROR
|
|
183
|
+
* });
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
export { sonner, Sonner };
|
|
188
|
+
//# sourceMappingURL=sonner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/components/sonner.tsx"],"names":[],"mappings":"AAYA,OAAO,EAEL,aAAa,EAEd,MAAM,mCAAmC,CAAC;AAG3C;;;;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,aAAa,CAAC;KACzB,CAAC;IACF,gCAAgC;IAChC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,IAAI,CAAC;AAE9C,oBAAY,iBAAiB;IAC3B,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,KAAK,mBAAmB,GAAG;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAoGpE,iBAAS,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAkCtE;AAqDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,iBAAS,MAAM,4CAEd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC"}
|