@brightlocal/ui-components 0.1.1 → 0.1.3
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/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +209 -202
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +3 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +38 -36
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -1
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/components/table.tsx +1 -1
- package/src/components/toggle-group.tsx +4 -0
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- package/src/components/input-base.tsx +0 -86
package/dist/breadcrumb.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),B=require("@radix-ui/react-slot"),d=require("lucide-react"),o=require("@brightlocal/ui-components/lib/utils");function x(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const c=x(g),i=c.forwardRef(({dataHook:e,trackingEl:a,trackingLabel:r,...s},n)=>t.jsx("nav",{ref:n,"aria-label":"breadcrumb","data-hook":e,"data-slot":"breadcrumb","data-tracking-el":a,"data-tracking-label":r,...s}));i.displayName="Breadcrumb";const l=c.forwardRef(({className:e,...a},r)=>t.jsx("ol",{ref:r,className:o.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",...a}));l.displayName="BreadcrumbList";const m=c.forwardRef(({className:e,...a},r)=>t.jsx("li",{ref:r,className:o.cn("inline-flex items-center gap-1.5",e),"data-slot":"breadcrumb-item",...a}));m.displayName="BreadcrumbItem";const u=c.forwardRef(({asChild:e,className:a,...r},s)=>{const n=e?B.Slot:"a";return t.jsx(n,{ref:s,className:o.cn("hover:text-foreground transition-colors",a),"data-slot":"breadcrumb-link",...r})});u.displayName="BreadcrumbLink";const b=c.forwardRef(({className:e,...a},r)=>t.jsx("span",{ref:r,"aria-current":"page","aria-disabled":"true",className:o.cn("text-foreground font-normal",e),"data-slot":"breadcrumb-page",role:"link",...a}));b.displayName="BreadcrumbPage";const p=c.forwardRef(({children:e,className:a,...r},s)=>t.jsx("li",{ref:s,"aria-hidden":"true",className:o.cn("[&>svg]:size-3.5",a),"data-slot":"breadcrumb-separator",role:"presentation",...r,children:e??t.jsx(d.ChevronRight,{})}));p.displayName="BreadcrumbSeparator";const f=c.forwardRef(({className:e,...a},r)=>t.jsxs("span",{ref:r,"aria-hidden":"true",className:o.cn("flex size-9 items-center justify-center",e),"data-slot":"breadcrumb-ellipsis",role:"presentation",...a,children:[t.jsx(d.MoreHorizontal,{className:"size-4"}),t.jsx("span",{className:"sr-only",children:"More"})]}));f.displayName="BreadcrumbEllipsis";exports.Breadcrumb=i;exports.BreadcrumbEllipsis=f;exports.BreadcrumbItem=m;exports.BreadcrumbLink=u;exports.BreadcrumbList=l;exports.BreadcrumbPage=b;exports.BreadcrumbSeparator=p;
|
package/dist/breadcrumb.d.ts
CHANGED
|
@@ -1,12 +1,67 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Breadcrumb component
|
|
4
|
+
*/
|
|
5
|
+
interface BreadcrumbProps extends React.ComponentProps<"nav"> {
|
|
6
|
+
/**
|
|
7
|
+
* Data hook for automated testing (required)
|
|
8
|
+
*/
|
|
9
|
+
dataHook: string;
|
|
10
|
+
/**
|
|
11
|
+
* Tracking element identifier for analytics
|
|
12
|
+
*/
|
|
13
|
+
trackingEl?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Tracking label for analytics context
|
|
16
|
+
*/
|
|
17
|
+
trackingLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Displays the path to the current resource using a hierarchy of links.
|
|
21
|
+
* Provides navigation context and allows users to navigate back through the hierarchy.
|
|
22
|
+
*/
|
|
23
|
+
declare const Breadcrumb: React.ForwardRefExoticComponent<Omit<BreadcrumbProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
24
|
+
/**
|
|
25
|
+
* Container for breadcrumb items arranged in a horizontal list.
|
|
26
|
+
*/
|
|
27
|
+
declare const BreadcrumbList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & React.RefAttributes<HTMLOListElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* Individual breadcrumb item container.
|
|
30
|
+
*/
|
|
31
|
+
declare const BreadcrumbItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
32
|
+
/**
|
|
33
|
+
* Props for the BreadcrumbLink component
|
|
34
|
+
*/
|
|
35
|
+
interface BreadcrumbLinkProps extends React.ComponentProps<"a"> {
|
|
36
|
+
/**
|
|
37
|
+
* Render as a different element (Radix Slot pattern)
|
|
38
|
+
*/
|
|
6
39
|
asChild?: boolean;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
40
|
+
/**
|
|
41
|
+
* URL the breadcrumb link navigates to
|
|
42
|
+
*/
|
|
43
|
+
href?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Navigational link within a breadcrumb trail.
|
|
47
|
+
* Links to parent pages in the navigation hierarchy.
|
|
48
|
+
*/
|
|
49
|
+
declare const BreadcrumbLink: React.ForwardRefExoticComponent<Omit<BreadcrumbLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
50
|
+
/**
|
|
51
|
+
* Represents the current page in the breadcrumb trail.
|
|
52
|
+
* Non-interactive element that indicates the user's current location.
|
|
53
|
+
*/
|
|
54
|
+
declare const BreadcrumbPage: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
55
|
+
/**
|
|
56
|
+
* Visual separator between breadcrumb items.
|
|
57
|
+
* Defaults to a chevron icon but can be customized.
|
|
58
|
+
*/
|
|
59
|
+
declare const BreadcrumbSeparator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
60
|
+
/**
|
|
61
|
+
* Ellipsis indicator for collapsed breadcrumb sections.
|
|
62
|
+
* Used when the breadcrumb trail is too long to display fully.
|
|
63
|
+
*/
|
|
64
|
+
declare const BreadcrumbEllipsis: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
11
65
|
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
66
|
+
export type { BreadcrumbProps, BreadcrumbLinkProps };
|
|
12
67
|
//# sourceMappingURL=breadcrumb.d.ts.map
|
package/dist/breadcrumb.d.ts.map
CHANGED
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/components/breadcrumb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;GAEG;AACH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC3D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,UAAU,kGAYf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,cAAc,2KAalB,CAAC;AAGH;;GAEG;AACH,QAAA,MAAM,cAAc,kKAUlB,CAAC;AAGH;;GAEG;AACH,UAAU,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC;IAC7D;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,QAAA,MAAM,cAAc,4GAanB,CAAC;AAGF;;;GAGG;AACH,QAAA,MAAM,cAAc,sKAalB,CAAC;AAGH;;;GAGG;AACH,QAAA,MAAM,mBAAmB,kKAcvB,CAAC;AAGH;;;GAGG;AACH,QAAA,MAAM,kBAAkB,sKAetB,CAAC;AAGH,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,CAAC;AACF,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1,102 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return /* @__PURE__ */ a(
|
|
10
|
-
"ol",
|
|
1
|
+
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { Slot as l } from "@radix-ui/react-slot";
|
|
4
|
+
import { ChevronRight as c, MoreHorizontal as n } from "lucide-react";
|
|
5
|
+
import { cn as o } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
const b = s.forwardRef(
|
|
7
|
+
({ dataHook: a, trackingEl: r, trackingLabel: e, ...d }, m) => /* @__PURE__ */ t(
|
|
8
|
+
"nav",
|
|
11
9
|
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"data-
|
|
17
|
-
|
|
10
|
+
ref: m,
|
|
11
|
+
"aria-label": "breadcrumb",
|
|
12
|
+
"data-hook": a,
|
|
13
|
+
"data-slot": "breadcrumb",
|
|
14
|
+
"data-tracking-el": r,
|
|
15
|
+
"data-tracking-label": e,
|
|
16
|
+
...d
|
|
18
17
|
}
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
b.displayName = "Breadcrumb";
|
|
21
|
+
const p = s.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
22
|
+
"ol",
|
|
23
|
+
{
|
|
24
|
+
ref: e,
|
|
25
|
+
className: o(
|
|
26
|
+
"text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
|
|
27
|
+
a
|
|
28
|
+
),
|
|
29
|
+
"data-slot": "breadcrumb-list",
|
|
30
|
+
...r
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
p.displayName = "BreadcrumbList";
|
|
34
|
+
const u = s.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
35
|
+
"li",
|
|
36
|
+
{
|
|
37
|
+
ref: e,
|
|
38
|
+
className: o("inline-flex items-center gap-1.5", a),
|
|
39
|
+
"data-slot": "breadcrumb-item",
|
|
40
|
+
...r
|
|
41
|
+
}
|
|
42
|
+
));
|
|
43
|
+
u.displayName = "BreadcrumbItem";
|
|
44
|
+
const f = s.forwardRef(
|
|
45
|
+
({ asChild: a, className: r, ...e }, d) => /* @__PURE__ */ t(
|
|
46
|
+
a ? l : "a",
|
|
24
47
|
{
|
|
25
|
-
|
|
26
|
-
|
|
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),
|
|
48
|
+
ref: d,
|
|
49
|
+
className: o("hover:text-foreground transition-colors", r),
|
|
40
50
|
"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
51
|
...e
|
|
55
52
|
}
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
f.displayName = "BreadcrumbLink";
|
|
56
|
+
const N = s.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ t(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
ref: e,
|
|
60
|
+
"aria-current": "page",
|
|
61
|
+
"aria-disabled": "true",
|
|
62
|
+
className: o("text-foreground font-normal", a),
|
|
63
|
+
"data-slot": "breadcrumb-page",
|
|
64
|
+
role: "link",
|
|
65
|
+
...r
|
|
66
|
+
}
|
|
67
|
+
));
|
|
68
|
+
N.displayName = "BreadcrumbPage";
|
|
69
|
+
const g = s.forwardRef(({ children: a, className: r, ...e }, d) => /* @__PURE__ */ t(
|
|
70
|
+
"li",
|
|
71
|
+
{
|
|
72
|
+
ref: d,
|
|
73
|
+
"aria-hidden": "true",
|
|
74
|
+
className: o("[&>svg]:size-3.5", r),
|
|
75
|
+
"data-slot": "breadcrumb-separator",
|
|
76
|
+
role: "presentation",
|
|
77
|
+
...e,
|
|
78
|
+
children: a ?? /* @__PURE__ */ t(c, {})
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
g.displayName = "BreadcrumbSeparator";
|
|
82
|
+
const B = s.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ i(
|
|
83
|
+
"span",
|
|
84
|
+
{
|
|
85
|
+
ref: e,
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: o("flex size-9 items-center justify-center", a),
|
|
88
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
89
|
+
role: "presentation",
|
|
90
|
+
...r,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ t(n, { className: "size-4" }),
|
|
93
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "More" })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
));
|
|
97
|
+
B.displayName = "BreadcrumbEllipsis";
|
|
94
98
|
export {
|
|
95
|
-
|
|
99
|
+
b as Breadcrumb,
|
|
96
100
|
B as BreadcrumbEllipsis,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
u as BreadcrumbItem,
|
|
102
|
+
f as BreadcrumbLink,
|
|
103
|
+
p as BreadcrumbList,
|
|
104
|
+
N as BreadcrumbPage,
|
|
105
|
+
g as BreadcrumbSeparator
|
|
102
106
|
};
|
package/dist/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),N=require("react"),O=require("@radix-ui/react-slot"),q=require("class-variance-authority"),B=require("lucide-react"),w=require("@brightlocal/ui-components/lib/utils");function R(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 b=R(N),P=16,f=q.cva(["rounded-full","inline-flex","font-semibold","items-center","justify-center","gap-2","whitespace-nowrap","transition-[color,background-color,border-color,box-shadow]","duration-150","ease-in-out","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","focus-visible:border-ring"],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}}),k=b.forwardRef(({className:e,variant:t="default",size:a="default",fullWidth:r=!1,asChild:l=!1,dataHook:g,trackingEl:v,trackingLabel:p,iconOnly:j=!1,loading:o=!1,ariaLabel:z,disabled:h=!1,children:n,...u},y)=>{const m=l?O.Slot:"button",x=h||o,c=n;let s=j;!s&&b.Children.count(n)===1&&b.isValidElement(n)&&(s=n.props?.children==null);const S=o&&!l;let i="default";o?i="loading":h&&(i="disabled");const _=z??(o?`Loading: ${c||"Please wait"}`:void 0);return l?d.jsx(m,{ref:y,className:w.cn(f({variant:t,size:a,state:i,fullWidth:r}),s&&"size-9 p-0",e),"data-hook":g,"data-slot":"button","data-tracking-el":v||`button-${t}`,"data-tracking-label":p,...u,children:n}):d.jsxs(m,{ref:y,"aria-busy":o?"true":void 0,"aria-disabled":x?"true":void 0,"aria-label":_,className:w.cn(f({variant:t,size:a,state:i,fullWidth:r}),s&&"size-9 p-0",e),"data-hook":g,"data-slot":"button","data-tracking-el":v||`button-${t}`,"data-tracking-label":p,disabled:x,type:u.type??"button",...u,children:[S&&d.jsx("div",{className:"pointer-events-none flex items-center justify-center","data-slot":"button-loading-icon",children:d.jsx(B.Loader2,{className:"animate-spin",size:P})}),typeof c<"u"&&c]})});k.displayName="Button";exports.Button=k;exports.ButtonVariants=f;
|
package/dist/button.d.ts
CHANGED
|
@@ -1,51 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Variant props for CVA button styling
|
|
4
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
5
|
type ButtonVariantProps = {
|
|
47
|
-
|
|
48
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Visual style variant of the button
|
|
8
|
+
* @default "default"
|
|
9
|
+
*/
|
|
10
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "warning";
|
|
11
|
+
/**
|
|
12
|
+
* Size variant of the button
|
|
13
|
+
* @default "default"
|
|
14
|
+
*/
|
|
15
|
+
size?: "default" | "sm" | "lg";
|
|
49
16
|
};
|
|
50
17
|
declare const ButtonVariants: (props?: ({
|
|
51
18
|
variant?: "default" | "destructive" | "warning" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
@@ -61,8 +28,13 @@ type ButtonProps = NativeButtonProps & ButtonVariantProps & {
|
|
|
61
28
|
ariaLabel?: string;
|
|
62
29
|
asChild?: boolean;
|
|
63
30
|
dataHook: string;
|
|
64
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Button type attribute
|
|
33
|
+
* @default "button"
|
|
34
|
+
*/
|
|
35
|
+
type?: "button" | "submit";
|
|
65
36
|
fullWidth?: boolean;
|
|
37
|
+
iconOnly?: boolean;
|
|
66
38
|
loading?: boolean;
|
|
67
39
|
trackingEl?: string;
|
|
68
40
|
trackingLabel?: string;
|
package/dist/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/components/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B;;GAEG;AACH,KAAK,kBAAkB,GAAG;IACxB;;;OAGG;IACH,OAAO,CAAC,EACJ,SAAS,GACT,aAAa,GACb,SAAS,GACT,WAAW,GACX,OAAO,GACP,SAAS,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,QAAA,MAAM,cAAc;;;;;8EAmGnB,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;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEJ,QAAA,MAAM,MAAM,oGAiHX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAElC,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/button.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { Loader2 as
|
|
1
|
+
import { jsx as d, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { Slot as j } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as B } from "class-variance-authority";
|
|
5
|
+
import { Loader2 as C } from "lucide-react";
|
|
6
6
|
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
|
|
8
|
-
const _ = 16, w = L(
|
|
7
|
+
const I = 16, w = B(
|
|
9
8
|
[
|
|
10
9
|
"rounded-full",
|
|
11
10
|
"inline-flex",
|
|
@@ -14,7 +13,9 @@ const _ = 16, w = L(
|
|
|
14
13
|
"justify-center",
|
|
15
14
|
"gap-2",
|
|
16
15
|
"whitespace-nowrap",
|
|
17
|
-
"transition-
|
|
16
|
+
"transition-[color,background-color,border-color,box-shadow]",
|
|
17
|
+
"duration-150",
|
|
18
|
+
"ease-in-out",
|
|
18
19
|
"cursor-pointer",
|
|
19
20
|
"disabled:pointer-events-none",
|
|
20
21
|
"disabled:cursor-not-allowed",
|
|
@@ -57,7 +58,8 @@ const _ = 16, w = L(
|
|
|
57
58
|
"dark:border-input",
|
|
58
59
|
"dark:hover:bg-input/80",
|
|
59
60
|
"dark:hover:border-input",
|
|
60
|
-
"focus-visible:shadow-default"
|
|
61
|
+
"focus-visible:shadow-default",
|
|
62
|
+
"focus-visible:border-ring"
|
|
61
63
|
],
|
|
62
64
|
secondary: [
|
|
63
65
|
"bg-secondary",
|
|
@@ -101,81 +103,82 @@ const _ = 16, w = L(
|
|
|
101
103
|
fullWidth: !1
|
|
102
104
|
}
|
|
103
105
|
}
|
|
104
|
-
),
|
|
106
|
+
), L = l.forwardRef(
|
|
105
107
|
({
|
|
106
|
-
className:
|
|
107
|
-
variant:
|
|
108
|
+
className: u,
|
|
109
|
+
variant: a = "default",
|
|
108
110
|
size: c = "default",
|
|
109
111
|
fullWidth: f = !1,
|
|
110
|
-
asChild:
|
|
112
|
+
asChild: i = !1,
|
|
111
113
|
dataHook: b,
|
|
112
114
|
trackingEl: g,
|
|
113
115
|
trackingLabel: v,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
iconOnly: k = !1,
|
|
117
|
+
loading: e = !1,
|
|
118
|
+
ariaLabel: z,
|
|
116
119
|
disabled: p = !1,
|
|
117
|
-
children:
|
|
118
|
-
...
|
|
120
|
+
children: t,
|
|
121
|
+
...s
|
|
119
122
|
}, h) => {
|
|
120
|
-
const m =
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
const N =
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
return
|
|
123
|
+
const m = i ? j : "button", y = p || e, n = t;
|
|
124
|
+
let o = k;
|
|
125
|
+
!o && l.Children.count(t) === 1 && l.isValidElement(t) && (o = t.props?.children == null);
|
|
126
|
+
const N = e && !i;
|
|
127
|
+
let r = "default";
|
|
128
|
+
e ? r = "loading" : p && (r = "disabled");
|
|
129
|
+
const S = z ?? (e ? `Loading: ${n || "Please wait"}` : void 0);
|
|
130
|
+
return i ? /* @__PURE__ */ d(
|
|
128
131
|
m,
|
|
129
132
|
{
|
|
130
133
|
ref: h,
|
|
131
134
|
className: x(
|
|
132
135
|
w({
|
|
133
|
-
variant:
|
|
136
|
+
variant: a,
|
|
134
137
|
size: c,
|
|
135
|
-
state:
|
|
138
|
+
state: r,
|
|
136
139
|
fullWidth: f
|
|
137
140
|
}),
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
o && "size-9 p-0",
|
|
142
|
+
u
|
|
140
143
|
),
|
|
141
144
|
"data-hook": b,
|
|
142
145
|
"data-slot": "button",
|
|
143
|
-
"data-tracking-el": g || `button-${
|
|
146
|
+
"data-tracking-el": g || `button-${a}`,
|
|
144
147
|
"data-tracking-label": v,
|
|
145
|
-
...
|
|
146
|
-
children:
|
|
148
|
+
...s,
|
|
149
|
+
children: t
|
|
147
150
|
}
|
|
148
|
-
) : /* @__PURE__ */
|
|
151
|
+
) : /* @__PURE__ */ _(
|
|
149
152
|
m,
|
|
150
153
|
{
|
|
151
154
|
ref: h,
|
|
152
|
-
"aria-busy":
|
|
155
|
+
"aria-busy": e ? "true" : void 0,
|
|
153
156
|
"aria-disabled": y ? "true" : void 0,
|
|
154
|
-
"aria-label":
|
|
157
|
+
"aria-label": S,
|
|
155
158
|
className: x(
|
|
156
159
|
w({
|
|
157
|
-
variant:
|
|
160
|
+
variant: a,
|
|
158
161
|
size: c,
|
|
159
|
-
state:
|
|
162
|
+
state: r,
|
|
160
163
|
fullWidth: f
|
|
161
164
|
}),
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
o && "size-9 p-0",
|
|
166
|
+
u
|
|
164
167
|
),
|
|
165
168
|
"data-hook": b,
|
|
166
169
|
"data-slot": "button",
|
|
167
|
-
"data-tracking-el": g || `button-${
|
|
170
|
+
"data-tracking-el": g || `button-${a}`,
|
|
168
171
|
"data-tracking-label": v,
|
|
169
172
|
disabled: y,
|
|
170
|
-
type:
|
|
171
|
-
...
|
|
173
|
+
type: s.type ?? "button",
|
|
174
|
+
...s,
|
|
172
175
|
children: [
|
|
173
|
-
N && /* @__PURE__ */
|
|
176
|
+
N && /* @__PURE__ */ d(
|
|
174
177
|
"div",
|
|
175
178
|
{
|
|
176
179
|
className: "pointer-events-none flex items-center justify-center",
|
|
177
180
|
"data-slot": "button-loading-icon",
|
|
178
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ d(C, { className: "animate-spin", size: I })
|
|
179
182
|
}
|
|
180
183
|
),
|
|
181
184
|
typeof n < "u" && n
|
|
@@ -184,12 +187,8 @@ const _ = 16, w = L(
|
|
|
184
187
|
);
|
|
185
188
|
}
|
|
186
189
|
);
|
|
187
|
-
|
|
190
|
+
L.displayName = "Button";
|
|
188
191
|
export {
|
|
189
|
-
|
|
190
|
-
U as ButtonSize,
|
|
191
|
-
I as ButtonState,
|
|
192
|
-
O as ButtonType,
|
|
193
|
-
S as ButtonVariant,
|
|
192
|
+
L as Button,
|
|
194
193
|
w as ButtonVariants
|
|
195
194
|
};
|
package/dist/calendar.cjs
CHANGED
|
@@ -1 +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
|
|
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","text-muted-foreground hover:text-foreground","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:shadow-default","h-8 w-8 p-0");function x({className:r,day:a,modifiers:n,...d}){const s=f.getDefaultClassNames(),c=m.useRef(null);return m.useEffect(()=>{n.focused&&c.current?.focus()},[n.focused]),o.jsx("button",{ref:c,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",s.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:s,fixedWeeks:c=!0,dataHook:h,trackingEl:y,trackingLabel:w,components:_,formatters:v,...j}){const t=f.getDefaultClassNames();return o.jsx(f.DayPicker,{captionLayout:s,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",s==="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":h,"data-slot":"calendar","data-tracking-el":y,"data-tracking-label":w,fixedWeeks:c,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...v},numberOfMonths:d,showOutsideDays:n,...j})}b.displayName="Calendar";exports.Calendar=b;exports.CalendarDayButton=x;
|
package/dist/calendar.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DayButton, DayPickerProps } from 'react-day-picker';
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Calendar component
|
|
5
|
+
*/
|
|
3
6
|
export type CalendarProps = DayPickerProps & {
|
|
4
7
|
/**
|
|
5
8
|
* Number of months to display (1-3)
|
|
@@ -19,7 +22,16 @@ export type CalendarProps = DayPickerProps & {
|
|
|
19
22
|
*/
|
|
20
23
|
trackingLabel?: string;
|
|
21
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Custom day button component for the Calendar.
|
|
27
|
+
* Renders individual day cells with proper styling and selection states.
|
|
28
|
+
*/
|
|
22
29
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Calendar component for date and range selection.
|
|
32
|
+
* Supports single date, multiple dates, and date range selection modes.
|
|
33
|
+
* Built on top of react-day-picker with custom styling and navigation.
|
|
34
|
+
*/
|
|
23
35
|
declare function Calendar({ className, classNames, showOutsideDays, numberOfMonths, captionLayout, fixedWeeks, dataHook, trackingEl, trackingLabel, components, formatters, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
|
|
24
36
|
declare namespace Calendar {
|
|
25
37
|
var displayName: string;
|