@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),i=require("@radix-ui/react-slot"),n=require("lucide-react"),t=require("@brightlocal/ui-components/lib/utils");function u({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function o({className:e,...r}){return a.jsx("ol",{className:t.cn("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),"data-slot":"breadcrumb-list",...r})}function l({className:e,...r}){return a.jsx("li",{className:t.cn("inline-flex items-center gap-1.5",e),"data-slot":"breadcrumb-item",...r})}function d({asChild:e,className:r,...s}){const c=e?i.Slot:"a";return a.jsx(c,{className:t.cn("hover:text-foreground transition-colors",r),"data-slot":"breadcrumb-link",...s})}function m({className:e,...r}){return a.jsx("span",{"aria-current":"page","aria-disabled":"true",className:t.cn("text-foreground font-normal",e),"data-slot":"breadcrumb-page",role:"link",...r})}function b({children:e,className:r,...s}){return a.jsx("li",{"aria-hidden":"true",className:t.cn("[&>svg]:size-3.5",r),"data-slot":"breadcrumb-separator",role:"presentation",...s,children:e??a.jsx(n.ChevronRight,{})})}function p({className:e,...r}){return a.jsxs("span",{"aria-hidden":"true",className:t.cn("flex size-9 items-center justify-center",e),"data-slot":"breadcrumb-ellipsis",role:"presentation",...r,children:[a.jsx(n.MoreHorizontal,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"More"})]})}exports.Breadcrumb=u;exports.BreadcrumbEllipsis=p;exports.BreadcrumbItem=l;exports.BreadcrumbLink=d;exports.BreadcrumbList=o;exports.BreadcrumbPage=m;exports.BreadcrumbSeparator=b;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Breadcrumb({ ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
12
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/components/breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,iBAAS,UAAU,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAE5D;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAW1E;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQ1E;AAED,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAUA;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW5E;AAED,iBAAS,mBAAmB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAY5B;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAa9B;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Slot as s } from "@radix-ui/react-slot";
|
|
3
|
+
import { ChevronRight as i, MoreHorizontal as l } from "lucide-react";
|
|
4
|
+
import { cn as t } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
function p({ ...r }) {
|
|
6
|
+
return /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...r });
|
|
7
|
+
}
|
|
8
|
+
function f({ className: r, ...e }) {
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
"ol",
|
|
11
|
+
{
|
|
12
|
+
className: t(
|
|
13
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
14
|
+
r
|
|
15
|
+
),
|
|
16
|
+
"data-slot": "breadcrumb-list",
|
|
17
|
+
...e
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function g({ className: r, ...e }) {
|
|
22
|
+
return /* @__PURE__ */ a(
|
|
23
|
+
"li",
|
|
24
|
+
{
|
|
25
|
+
className: t("inline-flex items-center gap-1.5", r),
|
|
26
|
+
"data-slot": "breadcrumb-item",
|
|
27
|
+
...e
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function x({
|
|
32
|
+
asChild: r,
|
|
33
|
+
className: e,
|
|
34
|
+
...n
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ a(
|
|
37
|
+
r ? s : "a",
|
|
38
|
+
{
|
|
39
|
+
className: t("hover:text-foreground transition-colors", e),
|
|
40
|
+
"data-slot": "breadcrumb-link",
|
|
41
|
+
...n
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function h({ className: r, ...e }) {
|
|
46
|
+
return /* @__PURE__ */ a(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
"aria-current": "page",
|
|
50
|
+
"aria-disabled": "true",
|
|
51
|
+
className: t("text-foreground font-normal", r),
|
|
52
|
+
"data-slot": "breadcrumb-page",
|
|
53
|
+
role: "link",
|
|
54
|
+
...e
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function N({
|
|
59
|
+
children: r,
|
|
60
|
+
className: e,
|
|
61
|
+
...n
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ a(
|
|
64
|
+
"li",
|
|
65
|
+
{
|
|
66
|
+
"aria-hidden": "true",
|
|
67
|
+
className: t("[&>svg]:size-3.5", e),
|
|
68
|
+
"data-slot": "breadcrumb-separator",
|
|
69
|
+
role: "presentation",
|
|
70
|
+
...n,
|
|
71
|
+
children: r ?? /* @__PURE__ */ a(i, {})
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function B({
|
|
76
|
+
className: r,
|
|
77
|
+
...e
|
|
78
|
+
}) {
|
|
79
|
+
return /* @__PURE__ */ o(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
className: t("flex size-9 items-center justify-center", r),
|
|
84
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
85
|
+
role: "presentation",
|
|
86
|
+
...e,
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ a(l, { className: "size-4" }),
|
|
89
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "More" })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
p as Breadcrumb,
|
|
96
|
+
B as BreadcrumbEllipsis,
|
|
97
|
+
g as BreadcrumbItem,
|
|
98
|
+
x as BreadcrumbLink,
|
|
99
|
+
f as BreadcrumbList,
|
|
100
|
+
h as BreadcrumbPage,
|
|
101
|
+
N as BreadcrumbSeparator
|
|
102
|
+
};
|
package/dist/button.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),_=require("react"),E=require("@radix-ui/react-slot"),L=require("class-variance-authority"),R=require("lucide-react"),w=require("@brightlocal/ui-components/lib/utils");function U(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const f=U(_);var k=(e=>(e.DEFAULT="default",e.DESTRUCTIVE="destructive",e.OUTLINE="outline",e.SECONDARY="secondary",e.GHOST="ghost",e))(k||{}),S=(e=>(e.DEFAULT="default",e.SM="sm",e.LG="lg",e))(S||{}),T=(e=>(e.Default="default",e.Loading="loading",e.Disabled="disabled",e))(T||{}),j=(e=>(e.BUTTON="button",e.SUBMIT="submit",e))(j||{});const q=16,b=L.cva(["rounded-full","inline-flex","font-semibold","items-center","justify-center","gap-2","whitespace-nowrap","transition-all","cursor-pointer","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","aria-disabled:opacity-50","[&_svg]:pointer-events-none","shrink-0","outline-none","aria-invalid:ring-destructive/20","dark:aria-invalid:ring-destructive/40","aria-invalid:border-destructive"],{variants:{variant:{default:["bg-primary","dark:bg-green-400","text-primary-foreground","dark:text-[var(--ds-colors-primary-foreground-light)]","hover:bg-primary/90","focus-visible:shadow-default"],destructive:["bg-destructive","dark:bg-red-400/90","hover:bg-destructive/90","dark:hover:bg-red-400/90","text-destructive-foreground","focus-visible:shadow-destructive"],outline:["border","border-border","border-solid","bg-background","hover:bg-accent","hover:text-accent-foreground","dark:bg-input/30","dark:border-input","dark:hover:bg-input/80","dark:hover:border-input","focus-visible:shadow-default"],secondary:["bg-secondary","text-secondary-foreground","hover:bg-secondary/80","focus-visible:shadow-default"],ghost:["bg-transparent","text-foreground","hover:bg-accent","data-[state=open]:bg-accent","focus-visible:shadow-default"],warning:["bg-warning-light","text-warning-foreground","hover:bg-warning-light/90","focus-visible:shadow-default"]},size:{default:"px-4 py-2 h-9 text-sm [&_svg:not([class*='size-'])]:size-4",sm:"py-2 px-3 h-8 text-xs [&_svg:not([class*='size-'])]:size-4",lg:"py-2 px-8 h-10 text-sm [&_svg:not([class*='size-'])]:size-5"},state:{default:"",loading:"pointer-events-none",disabled:"pointer-events-none opacity-50"},fullWidth:{false:"",true:"w-full"}},defaultVariants:{variant:"default",size:"default",state:"default",fullWidth:!1}}),O=f.forwardRef(({className:e,variant:t="default",size:a="default",fullWidth:r=!1,asChild:d=!1,dataHook:g,trackingEl:v,trackingLabel:p,loading:s=!1,ariaLabel:N,disabled:h=!1,children:n,...l},y)=>{const m=d?E.Slot:"button",x=h||s,u=n;let c=!1;f.Children.count(n)===1&&f.isValidElement(n)&&(c=n.props?.children==null);const z=s&&!d;let i="default";s?i="loading":h&&(i="disabled");const D=N??(s?`Loading: ${u||"Please wait"}`:void 0);return d?o.jsx(m,{ref:y,className:w.cn(b({variant:t,size:a,state:i,fullWidth:r}),c&&"size-9 p-0",e),"data-hook":g,"data-slot":"button","data-tracking-el":v||`button-${t}`,"data-tracking-label":p,...l,children:n}):o.jsxs(m,{ref:y,"aria-busy":s?"true":void 0,"aria-disabled":x?"true":void 0,"aria-label":D,className:w.cn(b({variant:t,size:a,state:i,fullWidth:r}),c&&"size-9 p-0",e),"data-hook":g,"data-slot":"button","data-tracking-el":v||`button-${t}`,"data-tracking-label":p,disabled:x,type:l.type??"button",...l,children:[z&&o.jsx("div",{className:"pointer-events-none flex items-center justify-center","data-slot":"button-loading-icon",children:o.jsx(R.Loader2,{className:"animate-spin",size:q})}),typeof u<"u"&&u]})});O.displayName="Button";exports.Button=O;exports.ButtonSize=S;exports.ButtonState=T;exports.ButtonType=j;exports.ButtonVariant=k;exports.ButtonVariants=b;
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Available button visual variants
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ButtonVariant {
|
|
6
|
+
/** Primary action button with solid background */
|
|
7
|
+
DEFAULT = "default",
|
|
8
|
+
/** Destructive action button (delete, remove, etc.) */
|
|
9
|
+
DESTRUCTIVE = "destructive",
|
|
10
|
+
/** Button with border and transparent background */
|
|
11
|
+
OUTLINE = "outline",
|
|
12
|
+
/** Secondary action button with muted background */
|
|
13
|
+
SECONDARY = "secondary",
|
|
14
|
+
/** Subtle button with transparent background */
|
|
15
|
+
GHOST = "ghost"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Available button size variants
|
|
19
|
+
*/
|
|
20
|
+
export declare enum ButtonSize {
|
|
21
|
+
/** Standard button size (36px height) */
|
|
22
|
+
DEFAULT = "default",
|
|
23
|
+
/** Small button size (32px height) */
|
|
24
|
+
SM = "sm",
|
|
25
|
+
/** Large button size (40px height) */
|
|
26
|
+
LG = "lg"
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Internal button state variants for styling
|
|
30
|
+
*/
|
|
31
|
+
export declare enum ButtonState {
|
|
32
|
+
/** Normal interactive state */
|
|
33
|
+
Default = "default",
|
|
34
|
+
/** Loading state with spinner */
|
|
35
|
+
Loading = "loading",
|
|
36
|
+
/** Disabled state with reduced opacity */
|
|
37
|
+
Disabled = "disabled"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Button types matching native button types
|
|
41
|
+
*/
|
|
42
|
+
export declare enum ButtonType {
|
|
43
|
+
BUTTON = "button",
|
|
44
|
+
SUBMIT = "submit"
|
|
45
|
+
}
|
|
46
|
+
type ButtonVariantProps = {
|
|
47
|
+
variant?: ButtonVariant;
|
|
48
|
+
size?: ButtonSize;
|
|
49
|
+
};
|
|
50
|
+
declare const ButtonVariants: (props?: ({
|
|
51
|
+
variant?: "default" | "destructive" | "warning" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
52
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
53
|
+
state?: "disabled" | "default" | "loading" | null | undefined;
|
|
54
|
+
fullWidth?: boolean | null | undefined;
|
|
55
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
56
|
+
/**
|
|
57
|
+
* Props for the Button component
|
|
58
|
+
*/
|
|
59
|
+
type NativeButtonProps = Omit<React.ComponentProps<"button">, "type">;
|
|
60
|
+
type ButtonProps = NativeButtonProps & ButtonVariantProps & {
|
|
61
|
+
ariaLabel?: string;
|
|
62
|
+
asChild?: boolean;
|
|
63
|
+
dataHook: string;
|
|
64
|
+
type?: ButtonType;
|
|
65
|
+
fullWidth?: boolean;
|
|
66
|
+
loading?: boolean;
|
|
67
|
+
trackingEl?: string;
|
|
68
|
+
trackingLabel?: string;
|
|
69
|
+
};
|
|
70
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
export { Button, ButtonVariants };
|
|
72
|
+
export type { ButtonProps };
|
|
73
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;GAEG;AACH,oBAAY,aAAa;IACvB,kDAAkD;IAClD,OAAO,YAAY;IACnB,uDAAuD;IACvD,WAAW,gBAAgB;IAC3B,oDAAoD;IACpD,OAAO,YAAY;IACnB,oDAAoD;IACpD,SAAS,cAAc;IACvB,gDAAgD;IAChD,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,yCAAyC;IACzC,OAAO,YAAY;IACnB,sCAAsC;IACtC,EAAE,OAAO;IACT,sCAAsC;IACtC,EAAE,OAAO;CACV;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,+BAA+B;IAC/B,OAAO,YAAY;IACnB,iCAAiC;IACjC,OAAO,YAAY;IACnB,0CAA0C;IAC1C,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAKD,KAAK,kBAAkB,GAAG;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,QAAA,MAAM,cAAc;;;;;8EAgGnB,CAAC;AAEF;;GAEG;AACH,KAAK,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;AAEtE,KAAK,WAAW,GAAG,iBAAiB,GAClC,kBAAkB,GAAG;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,QAAA,MAAM,MAAM,oGA+GX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAElC,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { jsx as l, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { Slot as E } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as L } from "class-variance-authority";
|
|
5
|
+
import { Loader2 as D } from "lucide-react";
|
|
6
|
+
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
+
var S = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.DESTRUCTIVE = "destructive", e.OUTLINE = "outline", e.SECONDARY = "secondary", e.GHOST = "ghost", e))(S || {}), U = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.SM = "sm", e.LG = "lg", e))(U || {}), I = /* @__PURE__ */ ((e) => (e.Default = "default", e.Loading = "loading", e.Disabled = "disabled", e))(I || {}), O = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.SUBMIT = "submit", e))(O || {});
|
|
8
|
+
const _ = 16, w = L(
|
|
9
|
+
[
|
|
10
|
+
"rounded-full",
|
|
11
|
+
"inline-flex",
|
|
12
|
+
"font-semibold",
|
|
13
|
+
"items-center",
|
|
14
|
+
"justify-center",
|
|
15
|
+
"gap-2",
|
|
16
|
+
"whitespace-nowrap",
|
|
17
|
+
"transition-all",
|
|
18
|
+
"cursor-pointer",
|
|
19
|
+
"disabled:pointer-events-none",
|
|
20
|
+
"disabled:cursor-not-allowed",
|
|
21
|
+
"disabled:opacity-50",
|
|
22
|
+
"aria-disabled:opacity-50",
|
|
23
|
+
"[&_svg]:pointer-events-none",
|
|
24
|
+
"shrink-0",
|
|
25
|
+
"outline-none",
|
|
26
|
+
"aria-invalid:ring-destructive/20",
|
|
27
|
+
"dark:aria-invalid:ring-destructive/40",
|
|
28
|
+
"aria-invalid:border-destructive"
|
|
29
|
+
],
|
|
30
|
+
{
|
|
31
|
+
variants: {
|
|
32
|
+
variant: {
|
|
33
|
+
default: [
|
|
34
|
+
"bg-primary",
|
|
35
|
+
"dark:bg-green-400",
|
|
36
|
+
"text-primary-foreground",
|
|
37
|
+
"dark:text-[var(--ds-colors-primary-foreground-light)]",
|
|
38
|
+
"hover:bg-primary/90",
|
|
39
|
+
"focus-visible:shadow-default"
|
|
40
|
+
],
|
|
41
|
+
destructive: [
|
|
42
|
+
"bg-destructive",
|
|
43
|
+
"dark:bg-red-400/90",
|
|
44
|
+
"hover:bg-destructive/90",
|
|
45
|
+
"dark:hover:bg-red-400/90",
|
|
46
|
+
"text-destructive-foreground",
|
|
47
|
+
"focus-visible:shadow-destructive"
|
|
48
|
+
],
|
|
49
|
+
outline: [
|
|
50
|
+
"border",
|
|
51
|
+
"border-border",
|
|
52
|
+
"border-solid",
|
|
53
|
+
"bg-background",
|
|
54
|
+
"hover:bg-accent",
|
|
55
|
+
"hover:text-accent-foreground",
|
|
56
|
+
"dark:bg-input/30",
|
|
57
|
+
"dark:border-input",
|
|
58
|
+
"dark:hover:bg-input/80",
|
|
59
|
+
"dark:hover:border-input",
|
|
60
|
+
"focus-visible:shadow-default"
|
|
61
|
+
],
|
|
62
|
+
secondary: [
|
|
63
|
+
"bg-secondary",
|
|
64
|
+
"text-secondary-foreground",
|
|
65
|
+
"hover:bg-secondary/80",
|
|
66
|
+
"focus-visible:shadow-default"
|
|
67
|
+
],
|
|
68
|
+
ghost: [
|
|
69
|
+
"bg-transparent",
|
|
70
|
+
"text-foreground",
|
|
71
|
+
"hover:bg-accent",
|
|
72
|
+
"data-[state=open]:bg-accent",
|
|
73
|
+
"focus-visible:shadow-default"
|
|
74
|
+
],
|
|
75
|
+
warning: [
|
|
76
|
+
"bg-warning-light",
|
|
77
|
+
"text-warning-foreground",
|
|
78
|
+
"hover:bg-warning-light/90",
|
|
79
|
+
"focus-visible:shadow-default"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
size: {
|
|
83
|
+
default: "px-4 py-2 h-9 text-sm [&_svg:not([class*='size-'])]:size-4",
|
|
84
|
+
sm: "py-2 px-3 h-8 text-xs [&_svg:not([class*='size-'])]:size-4",
|
|
85
|
+
lg: "py-2 px-8 h-10 text-sm [&_svg:not([class*='size-'])]:size-5"
|
|
86
|
+
},
|
|
87
|
+
state: {
|
|
88
|
+
default: "",
|
|
89
|
+
loading: "pointer-events-none",
|
|
90
|
+
disabled: "pointer-events-none opacity-50"
|
|
91
|
+
},
|
|
92
|
+
fullWidth: {
|
|
93
|
+
false: "",
|
|
94
|
+
true: "w-full"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
variant: "default",
|
|
99
|
+
size: "default",
|
|
100
|
+
state: "default",
|
|
101
|
+
fullWidth: !1
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
), C = u.forwardRef(
|
|
105
|
+
({
|
|
106
|
+
className: e,
|
|
107
|
+
variant: r = "default",
|
|
108
|
+
size: c = "default",
|
|
109
|
+
fullWidth: f = !1,
|
|
110
|
+
asChild: o = !1,
|
|
111
|
+
dataHook: b,
|
|
112
|
+
trackingEl: g,
|
|
113
|
+
trackingLabel: v,
|
|
114
|
+
loading: t = !1,
|
|
115
|
+
ariaLabel: k,
|
|
116
|
+
disabled: p = !1,
|
|
117
|
+
children: a,
|
|
118
|
+
...i
|
|
119
|
+
}, h) => {
|
|
120
|
+
const m = o ? E : "button", y = p || t, n = a;
|
|
121
|
+
let d = !1;
|
|
122
|
+
u.Children.count(a) === 1 && u.isValidElement(a) && (d = a.props?.children == null);
|
|
123
|
+
const N = t && !o;
|
|
124
|
+
let s = "default";
|
|
125
|
+
t ? s = "loading" : p && (s = "disabled");
|
|
126
|
+
const T = k ?? (t ? `Loading: ${n || "Please wait"}` : void 0);
|
|
127
|
+
return o ? /* @__PURE__ */ l(
|
|
128
|
+
m,
|
|
129
|
+
{
|
|
130
|
+
ref: h,
|
|
131
|
+
className: x(
|
|
132
|
+
w({
|
|
133
|
+
variant: r,
|
|
134
|
+
size: c,
|
|
135
|
+
state: s,
|
|
136
|
+
fullWidth: f
|
|
137
|
+
}),
|
|
138
|
+
d && "size-9 p-0",
|
|
139
|
+
e
|
|
140
|
+
),
|
|
141
|
+
"data-hook": b,
|
|
142
|
+
"data-slot": "button",
|
|
143
|
+
"data-tracking-el": g || `button-${r}`,
|
|
144
|
+
"data-tracking-label": v,
|
|
145
|
+
...i,
|
|
146
|
+
children: a
|
|
147
|
+
}
|
|
148
|
+
) : /* @__PURE__ */ z(
|
|
149
|
+
m,
|
|
150
|
+
{
|
|
151
|
+
ref: h,
|
|
152
|
+
"aria-busy": t ? "true" : void 0,
|
|
153
|
+
"aria-disabled": y ? "true" : void 0,
|
|
154
|
+
"aria-label": T,
|
|
155
|
+
className: x(
|
|
156
|
+
w({
|
|
157
|
+
variant: r,
|
|
158
|
+
size: c,
|
|
159
|
+
state: s,
|
|
160
|
+
fullWidth: f
|
|
161
|
+
}),
|
|
162
|
+
d && "size-9 p-0",
|
|
163
|
+
e
|
|
164
|
+
),
|
|
165
|
+
"data-hook": b,
|
|
166
|
+
"data-slot": "button",
|
|
167
|
+
"data-tracking-el": g || `button-${r}`,
|
|
168
|
+
"data-tracking-label": v,
|
|
169
|
+
disabled: y,
|
|
170
|
+
type: i.type ?? "button",
|
|
171
|
+
...i,
|
|
172
|
+
children: [
|
|
173
|
+
N && /* @__PURE__ */ l(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: "pointer-events-none flex items-center justify-center",
|
|
177
|
+
"data-slot": "button-loading-icon",
|
|
178
|
+
children: /* @__PURE__ */ l(D, { className: "animate-spin", size: _ })
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
typeof n < "u" && n
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
C.displayName = "Button";
|
|
188
|
+
export {
|
|
189
|
+
C as Button,
|
|
190
|
+
U as ButtonSize,
|
|
191
|
+
I as ButtonState,
|
|
192
|
+
O as ButtonType,
|
|
193
|
+
S as ButtonVariant,
|
|
194
|
+
w as ButtonVariants
|
|
195
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),k=require("react"),g=require("lucide-react"),f=require("react-day-picker"),e=require("@brightlocal/ui-components/lib/utils");function D(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const d=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,d.get?d:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const m=D(k),p=e.cn("inline-flex items-center justify-center rounded-md bg-background","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:shadow-default","h-8 w-8 p-0 opacity-50 hover:opacity-100");function x({className:r,day:a,modifiers:n,...d}){const c=f.getDefaultClassNames(),s=m.useRef(null);return m.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),o.jsx("button",{ref:s,className:e.cn("text-foreground h-8 w-8 rounded-md p-0 font-sans text-sm leading-5 font-normal","hover:bg-accent hover:text-accent-foreground","focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none","group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10","data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[selected-single=true]:rounded-md","data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-start=true]:rounded-md","data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-end=true]:rounded-md","data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground",c.day,r),"data-day":a.date.toLocaleDateString(),"data-range-end":n.range_end,"data-range-middle":n.range_middle,"data-range-start":n.range_start,"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,type:"button",...d})}function b({className:r,classNames:a,showOutsideDays:n=!0,numberOfMonths:d=1,captionLayout:c,fixedWeeks:s=!0,dataHook:y,trackingEl:h,trackingLabel:w,components:_,formatters:v,...j}){const t=f.getDefaultClassNames();return o.jsx(f.DayPicker,{captionLayout:c,className:e.cn("bg-background border-border group/calendar relative rounded-lg border p-3 shadow-sm",r),classNames:{months:e.cn("flex flex-col sm:flex-row gap-4",t.months),month:e.cn("flex flex-col gap-4",t.month),month_caption:e.cn("flex justify-center relative items-center w-full h-8",t.month_caption),caption_label:e.cn("text-sm font-sans leading-5 text-foreground select-none",c==="dropdown"?"font-normal":"font-medium","[&>svg]:text-muted-foreground [&>svg]:size-4","flex h-[34px] items-center gap-1 rounded-md pl-2 pr-1",t.caption_label),dropdowns:e.cn("flex w-full items-center justify-center gap-1.5 text-sm font-normal",t.dropdowns),dropdown_root:e.cn("relative rounded-md border border-input shadow-xs h-[34px]","has-focus:shadow-default",t.dropdown_root),dropdown:e.cn("absolute inset-0 z-10 opacity-0 cursor-pointer",t.dropdown),months_dropdown:e.cn("w-[58px]",t.months_dropdown),years_dropdown:e.cn("w-[69px]",t.years_dropdown),nav:e.cn("absolute top-3 left-3 right-3 flex items-center justify-between z-10",t.nav),button_previous:e.cn(p,t.button_previous),button_next:e.cn(p,t.button_next),month_grid:e.cn("w-full border-collapse flex flex-col",t.month_grid),weekdays:e.cn("flex",t.weekdays),weekday:e.cn("text-muted-foreground rounded-md w-8 h-5 flex items-center justify-center font-normal font-sans text-xs leading-4",t.weekday),week:e.cn(t.week,"flex w-full mt-2"),day:e.cn("relative w-full h-full p-0 text-center text-sm focus-within:relative focus-within:z-20 group/day select-none","[&:first-child[data-selected=true]_button]:!rounded-l-md","[&:last-child[data-selected=true]_button]:!rounded-r-md",t.day),range_start:e.cn("rounded-l-md bg-accent",t.range_start),range_middle:e.cn("rounded-none bg-accent","first:rounded-l-md last:rounded-r-md",t.range_middle),range_end:e.cn("rounded-r-md bg-accent",t.range_end),today:e.cn("bg-accent text-accent-foreground rounded-md",t.today),outside:e.cn("text-muted-foreground opacity-50 aria-selected:text-muted-foreground aria-selected:opacity-50",t.outside),disabled:e.cn("text-foreground opacity-50 cursor-not-allowed",t.disabled),hidden:e.cn(t.hidden),...a},components:{Chevron:({orientation:u,className:l,...i})=>u==="left"?o.jsx(g.ChevronLeft,{className:e.cn("size-4",l),...i}):u==="right"?o.jsx(g.ChevronRight,{className:e.cn("size-4",l),...i}):o.jsx(g.ChevronDown,{className:e.cn("size-4",l),...i}),DayButton:x,..._},"data-hook":y,"data-tracking-el":h,"data-tracking-label":w,fixedWeeks:s,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...v},numberOfMonths:d,showOutsideDays:n,...j})}b.displayName="Calendar";exports.Calendar=b;exports.CalendarDayButton=x;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DayButton, DayPickerProps } from 'react-day-picker';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type CalendarProps = DayPickerProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Number of months to display (1-3)
|
|
6
|
+
* @default 1
|
|
7
|
+
*/
|
|
8
|
+
numberOfMonths?: 1 | 2 | 3;
|
|
9
|
+
/**
|
|
10
|
+
* Data hook for testing and analytics
|
|
11
|
+
*/
|
|
12
|
+
dataHook: string;
|
|
13
|
+
/**
|
|
14
|
+
* Tracking element identifier
|
|
15
|
+
*/
|
|
16
|
+
trackingEl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Tracking label for analytics
|
|
19
|
+
*/
|
|
20
|
+
trackingLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function Calendar({ className, classNames, showOutsideDays, numberOfMonths, captionLayout, fixedWeeks, dataHook, trackingEl, trackingLabel, components, formatters, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare namespace Calendar {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
export { Calendar, CalendarDayButton };
|
|
28
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/components/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,SAAS,EAGT,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IAC3C;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AASF,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,2CAqCxC;AAED,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,cAAkB,EAClB,aAAa,EACb,UAAiB,EACjB,QAAQ,EACR,UAAU,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,aAAa,2CAoIf;kBAjJQ,QAAQ;;;AAqJjB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/calendar.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { ChevronLeft as _, ChevronRight as v, ChevronDown as k } from "lucide-react";
|
|
4
|
+
import { getDefaultClassNames as m, DayPicker as N } from "react-day-picker";
|
|
5
|
+
import { cn as e } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
const f = e(
|
|
7
|
+
"inline-flex items-center justify-center rounded-md bg-background",
|
|
8
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
9
|
+
"focus-visible:outline-none focus-visible:shadow-default",
|
|
10
|
+
"h-8 w-8 p-0 opacity-50 hover:opacity-100"
|
|
11
|
+
);
|
|
12
|
+
function z({
|
|
13
|
+
className: s,
|
|
14
|
+
day: l,
|
|
15
|
+
modifiers: r,
|
|
16
|
+
...u
|
|
17
|
+
}) {
|
|
18
|
+
const n = m(), d = g.useRef(null);
|
|
19
|
+
return g.useEffect(() => {
|
|
20
|
+
r.focused && d.current?.focus();
|
|
21
|
+
}, [r.focused]), /* @__PURE__ */ a(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
ref: d,
|
|
25
|
+
className: e(
|
|
26
|
+
"text-foreground h-8 w-8 rounded-md p-0 font-sans text-sm leading-5 font-normal",
|
|
27
|
+
"hover:bg-accent hover:text-accent-foreground",
|
|
28
|
+
"focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none",
|
|
29
|
+
"group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10",
|
|
30
|
+
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[selected-single=true]:rounded-md",
|
|
31
|
+
"data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-start=true]:rounded-md",
|
|
32
|
+
"data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-end=true]:rounded-md",
|
|
33
|
+
"data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground",
|
|
34
|
+
n.day,
|
|
35
|
+
s
|
|
36
|
+
),
|
|
37
|
+
"data-day": l.date.toLocaleDateString(),
|
|
38
|
+
"data-range-end": r.range_end,
|
|
39
|
+
"data-range-middle": r.range_middle,
|
|
40
|
+
"data-range-start": r.range_start,
|
|
41
|
+
"data-selected-single": r.selected && !r.range_start && !r.range_end && !r.range_middle,
|
|
42
|
+
type: "button",
|
|
43
|
+
...u
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function C({
|
|
48
|
+
className: s,
|
|
49
|
+
classNames: l,
|
|
50
|
+
showOutsideDays: r = !0,
|
|
51
|
+
numberOfMonths: u = 1,
|
|
52
|
+
captionLayout: n,
|
|
53
|
+
fixedWeeks: d = !0,
|
|
54
|
+
dataHook: p,
|
|
55
|
+
trackingEl: x,
|
|
56
|
+
trackingLabel: h,
|
|
57
|
+
components: b,
|
|
58
|
+
formatters: w,
|
|
59
|
+
...y
|
|
60
|
+
}) {
|
|
61
|
+
const t = m();
|
|
62
|
+
return /* @__PURE__ */ a(
|
|
63
|
+
N,
|
|
64
|
+
{
|
|
65
|
+
captionLayout: n,
|
|
66
|
+
className: e(
|
|
67
|
+
"bg-background border-border group/calendar relative rounded-lg border p-3 shadow-sm",
|
|
68
|
+
s
|
|
69
|
+
),
|
|
70
|
+
classNames: {
|
|
71
|
+
months: e("flex flex-col sm:flex-row gap-4", t.months),
|
|
72
|
+
month: e("flex flex-col gap-4", t.month),
|
|
73
|
+
month_caption: e(
|
|
74
|
+
"flex justify-center relative items-center w-full h-8",
|
|
75
|
+
t.month_caption
|
|
76
|
+
),
|
|
77
|
+
caption_label: e(
|
|
78
|
+
"text-sm font-sans leading-5 text-foreground select-none",
|
|
79
|
+
n === "dropdown" ? "font-normal" : "font-medium",
|
|
80
|
+
"[&>svg]:text-muted-foreground [&>svg]:size-4",
|
|
81
|
+
"flex h-[34px] items-center gap-1 rounded-md pl-2 pr-1",
|
|
82
|
+
t.caption_label
|
|
83
|
+
),
|
|
84
|
+
dropdowns: e(
|
|
85
|
+
"flex w-full items-center justify-center gap-1.5 text-sm font-normal",
|
|
86
|
+
t.dropdowns
|
|
87
|
+
),
|
|
88
|
+
dropdown_root: e(
|
|
89
|
+
"relative rounded-md border border-input shadow-xs h-[34px]",
|
|
90
|
+
"has-focus:shadow-default",
|
|
91
|
+
t.dropdown_root
|
|
92
|
+
),
|
|
93
|
+
dropdown: e(
|
|
94
|
+
"absolute inset-0 z-10 opacity-0 cursor-pointer",
|
|
95
|
+
t.dropdown
|
|
96
|
+
),
|
|
97
|
+
months_dropdown: e("w-[58px]", t.months_dropdown),
|
|
98
|
+
years_dropdown: e("w-[69px]", t.years_dropdown),
|
|
99
|
+
nav: e(
|
|
100
|
+
"absolute top-3 left-3 right-3 flex items-center justify-between z-10",
|
|
101
|
+
t.nav
|
|
102
|
+
),
|
|
103
|
+
button_previous: e(f, t.button_previous),
|
|
104
|
+
button_next: e(f, t.button_next),
|
|
105
|
+
month_grid: e(
|
|
106
|
+
"w-full border-collapse flex flex-col",
|
|
107
|
+
t.month_grid
|
|
108
|
+
),
|
|
109
|
+
weekdays: e("flex", t.weekdays),
|
|
110
|
+
weekday: e(
|
|
111
|
+
"text-muted-foreground rounded-md w-8 h-5 flex items-center justify-center font-normal font-sans text-xs leading-4",
|
|
112
|
+
t.weekday
|
|
113
|
+
),
|
|
114
|
+
week: e(t.week, "flex w-full mt-2"),
|
|
115
|
+
day: e(
|
|
116
|
+
"relative w-full h-full p-0 text-center text-sm focus-within:relative focus-within:z-20 group/day select-none",
|
|
117
|
+
"[&:first-child[data-selected=true]_button]:!rounded-l-md",
|
|
118
|
+
"[&:last-child[data-selected=true]_button]:!rounded-r-md",
|
|
119
|
+
t.day
|
|
120
|
+
),
|
|
121
|
+
range_start: e(
|
|
122
|
+
"rounded-l-md bg-accent",
|
|
123
|
+
t.range_start
|
|
124
|
+
),
|
|
125
|
+
range_middle: e(
|
|
126
|
+
"rounded-none bg-accent",
|
|
127
|
+
"first:rounded-l-md last:rounded-r-md",
|
|
128
|
+
t.range_middle
|
|
129
|
+
),
|
|
130
|
+
range_end: e("rounded-r-md bg-accent", t.range_end),
|
|
131
|
+
today: e(
|
|
132
|
+
"bg-accent text-accent-foreground rounded-md",
|
|
133
|
+
t.today
|
|
134
|
+
),
|
|
135
|
+
outside: e(
|
|
136
|
+
"text-muted-foreground opacity-50 aria-selected:text-muted-foreground aria-selected:opacity-50",
|
|
137
|
+
t.outside
|
|
138
|
+
),
|
|
139
|
+
disabled: e(
|
|
140
|
+
"text-foreground opacity-50 cursor-not-allowed",
|
|
141
|
+
t.disabled
|
|
142
|
+
),
|
|
143
|
+
hidden: e(t.hidden),
|
|
144
|
+
...l
|
|
145
|
+
},
|
|
146
|
+
components: {
|
|
147
|
+
Chevron: ({
|
|
148
|
+
orientation: o,
|
|
149
|
+
className: c,
|
|
150
|
+
...i
|
|
151
|
+
}) => o === "left" ? /* @__PURE__ */ a(
|
|
152
|
+
_,
|
|
153
|
+
{
|
|
154
|
+
className: e("size-4", c),
|
|
155
|
+
...i
|
|
156
|
+
}
|
|
157
|
+
) : o === "right" ? /* @__PURE__ */ a(
|
|
158
|
+
v,
|
|
159
|
+
{
|
|
160
|
+
className: e("size-4", c),
|
|
161
|
+
...i
|
|
162
|
+
}
|
|
163
|
+
) : /* @__PURE__ */ a(
|
|
164
|
+
k,
|
|
165
|
+
{
|
|
166
|
+
className: e("size-4", c),
|
|
167
|
+
...i
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
DayButton: z,
|
|
171
|
+
...b
|
|
172
|
+
},
|
|
173
|
+
"data-hook": p,
|
|
174
|
+
"data-tracking-el": x,
|
|
175
|
+
"data-tracking-label": h,
|
|
176
|
+
fixedWeeks: d,
|
|
177
|
+
formatters: {
|
|
178
|
+
formatMonthDropdown: (o) => o.toLocaleString("default", { month: "short" }),
|
|
179
|
+
...w
|
|
180
|
+
},
|
|
181
|
+
numberOfMonths: u,
|
|
182
|
+
showOutsideDays: r,
|
|
183
|
+
...y
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
C.displayName = "Calendar";
|
|
188
|
+
export {
|
|
189
|
+
C as Calendar,
|
|
190
|
+
z as CalendarDayButton
|
|
191
|
+
};
|
package/dist/card.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),f=require("class-variance-authority"),e=require("@brightlocal/ui-components/lib/utils");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const p=g(u);var d=(t=>(t.DEFAULT="default",t.TRANSPARENT="transparent",t.BORDER="border",t))(d||{});const m=f.cva(["flex","flex-col","gap-8","rounded-[14px]","py-8","transition-colors"],{variants:{variant:{default:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"]}},defaultVariants:{variant:"default"}}),s=p.forwardRef(({className:t,variant:r="default",dataHook:n,trackingEl:o,trackingLabel:c,...i},l)=>a.jsx("div",{ref:l,className:e.cn(m({variant:r}),t),"data-hook":n,"data-slot":"card","data-tracking-el":o||`card-${r}`,"data-tracking-label":c,...i}));s.displayName="Card";function b({className:t,...r}){return a.jsx("div",{className:e.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-8 has-data-[slot=card-action]:grid-cols-[1fr_auto]",t),"data-slot":"card-header",...r})}function x({className:t,...r}){return a.jsx("div",{className:e.cn("heading-sm",t),"data-slot":"card-title",...r})}function C({className:t,...r}){return a.jsx("div",{className:e.cn("text-muted-foreground text-sm leading-normal font-normal",t),"data-slot":"card-description",...r})}function j({className:t,...r}){return a.jsx("div",{className:e.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),"data-slot":"card-action",...r})}function v({className:t,...r}){return a.jsx("div",{className:e.cn("px-8",t),"data-slot":"card-content",...r})}function N({className:t,...r}){return a.jsx("div",{className:e.cn("flex items-center px-8",t),"data-slot":"card-footer",...r})}exports.Card=s;exports.CardAction=j;exports.CardContent=v;exports.CardDescription=C;exports.CardFooter=N;exports.CardHeader=b;exports.CardTitle=x;exports.CardVariant=d;
|