@brightlocal/ui-components 2.27.0 → 3.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/README.md +7 -1
- package/component-meta.json +568 -143
- package/deprecations.json +298 -1
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +74 -61
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +18 -18
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +11 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +31 -28
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +4 -4
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +15 -11
- package/dist/blocks/empty-state.cjs +1 -0
- package/dist/blocks/empty-state.d.ts +172 -0
- package/dist/blocks/empty-state.d.ts.map +1 -0
- package/dist/blocks/empty-state.js +147 -0
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +124 -108
- package/dist/blocks/progress-state.cjs +1 -0
- package/dist/blocks/{progress-screen.d.ts → progress-state.d.ts} +30 -18
- package/dist/blocks/progress-state.d.ts.map +1 -0
- package/dist/blocks/{progress-screen.js → progress-state.js} +100 -71
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +160 -161
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.d.ts +36 -0
- package/dist/button-group.d.ts.map +1 -0
- package/dist/button-group.js +47 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +12 -12
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +37 -38
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +24 -2
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +57 -55
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +42 -3
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +102 -91
- package/dist/chart-empty.cjs +1 -0
- package/dist/chart-empty.d.ts +59 -0
- package/dist/chart-empty.d.ts.map +1 -0
- package/dist/chart-empty.js +29 -0
- package/dist/chart.cjs +6 -6
- package/dist/chart.d.ts +46 -13
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +172 -157
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +38 -4
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +100 -84
- package/dist/combobox.cjs +2 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +81 -79
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +248 -225
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +26 -29
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +75 -10
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +346 -334
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +13 -5
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +54 -53
- package/dist/description.cjs +1 -1
- package/dist/description.js +5 -5
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +20 -20
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +8 -11
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +17 -20
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +96 -65
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +130 -12
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +146 -127
- package/dist/grid.cjs +1 -0
- package/dist/grid.d.ts +56 -0
- package/dist/grid.d.ts.map +1 -0
- package/dist/grid.js +32 -0
- package/dist/header.d.ts +13 -0
- package/dist/header.d.ts.map +1 -1
- package/dist/hooks/use-delayed-pending.cjs +1 -0
- package/dist/hooks/use-delayed-pending.d.ts +34 -0
- package/dist/hooks/use-delayed-pending.d.ts.map +1 -0
- package/dist/hooks/use-delayed-pending.js +17 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.js +13 -13
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +554 -527
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +25 -25
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +9 -9
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +17 -9
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +73 -72
- package/dist/input.cjs +1 -1
- package/dist/input.js +9 -9
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +25 -28
- package/dist/lib/block-illustration.cjs +1 -0
- package/dist/lib/block-illustration.d.ts +28 -0
- package/dist/lib/block-illustration.d.ts.map +1 -0
- package/dist/lib/block-illustration.js +21 -0
- package/dist/lib/empty-canvas.cjs +1 -0
- package/dist/lib/empty-canvas.d.ts +27 -0
- package/dist/lib/empty-canvas.d.ts.map +1 -0
- package/dist/lib/empty-canvas.js +62 -0
- package/dist/lib/empty-chip.cjs +1 -0
- package/dist/lib/empty-chip.d.ts +4 -0
- package/dist/lib/empty-chip.d.ts.map +1 -0
- package/dist/lib/empty-chip.js +13 -0
- package/dist/lib/optical-center.cjs +1 -0
- package/dist/lib/optical-center.d.ts +12 -0
- package/dist/lib/optical-center.d.ts.map +1 -0
- package/dist/lib/optical-center.js +11 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +28 -5
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +62 -58
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts +60 -2
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +187 -164
- package/dist/media-empty.cjs +1 -0
- package/dist/media-empty.d.ts +72 -0
- package/dist/media-empty.d.ts.map +1 -0
- package/dist/media-empty.js +45 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +17 -20
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +7 -7
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +130 -1
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +193 -102
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +2 -26
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +79 -118
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +15 -6
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +38 -36
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +13 -2
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +92 -87
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +8 -8
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.js +2 -2
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +38 -3
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +43 -20
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.js +26 -26
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +40 -40
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +31 -28
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.d.ts +10 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +8 -8
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.js +8 -8
- package/dist/typography-heading.cjs +1 -0
- package/dist/typography-heading.d.ts +129 -0
- package/dist/typography-heading.d.ts.map +1 -0
- package/dist/typography-heading.js +95 -0
- package/dist/typography-text.cjs +1 -0
- package/dist/typography-text.d.ts +127 -0
- package/dist/typography-text.d.ts.map +1 -0
- package/dist/typography-text.js +92 -0
- package/dist/typography.d.ts +13 -0
- package/dist/typography.d.ts.map +1 -1
- package/package.json +35 -7
- package/src/blocks/empty-state.tsx +412 -0
- package/src/blocks/input-list.tsx +66 -36
- package/src/blocks/{progress-screen.tsx → progress-state.tsx} +154 -93
- package/src/blocks/sidebar.tsx +25 -26
- package/src/components/accordion.tsx +82 -27
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/alert.tsx +27 -13
- package/src/components/avatar.tsx +1 -1
- package/src/components/badge.tsx +8 -4
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button-group.tsx +112 -0
- package/src/components/button.tsx +4 -4
- package/src/components/calendar.tsx +5 -6
- package/src/components/callout.tsx +48 -15
- package/src/components/card.tsx +89 -19
- package/src/components/chart-empty.tsx +116 -0
- package/src/components/chart.tsx +103 -32
- package/src/components/chip.tsx +88 -13
- package/src/components/combobox.tsx +12 -10
- package/src/components/command.tsx +64 -13
- package/src/components/context-menu.tsx +6 -9
- package/src/components/data-table.tsx +135 -20
- package/src/components/date-picker.tsx +18 -7
- package/src/components/description.tsx +1 -1
- package/src/components/dialog.tsx +2 -2
- package/src/components/drawer.tsx +2 -5
- package/src/components/dropdown-menu.tsx +8 -11
- package/src/components/field.tsx +89 -16
- package/src/components/global-layout.tsx +210 -39
- package/src/components/grid.tsx +130 -0
- package/src/components/header.tsx +13 -0
- package/src/components/hover-card.tsx +1 -1
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +1 -1
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +24 -12
- package/src/components/input.tsx +1 -1
- package/src/components/label.tsx +10 -13
- package/src/components/list.tsx +13 -9
- package/src/components/map.tsx +101 -5
- package/src/components/media-empty.tsx +156 -0
- package/src/components/menubar.tsx +7 -10
- package/src/components/navigation-menu.tsx +1 -1
- package/src/components/pagination.tsx +286 -1
- package/src/components/progress.tsx +35 -113
- package/src/components/scroll-area.tsx +23 -10
- package/src/components/select.tsx +35 -10
- package/src/components/separator.tsx +1 -1
- package/src/components/sheet.tsx +2 -2
- package/src/components/skeleton.tsx +78 -7
- package/src/components/sonner.tsx +2 -2
- package/src/components/stepper.tsx +3 -3
- package/src/components/table.tsx +6 -3
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +10 -0
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/components/tooltip.tsx +1 -1
- package/src/components/typography-heading.tsx +253 -0
- package/src/components/typography-text.tsx +250 -0
- package/src/components/typography.tsx +13 -0
- package/src/hooks/use-delayed-pending.ts +60 -0
- package/src/index.ts +11 -1
- package/src/lib/block-illustration.tsx +88 -0
- package/src/lib/empty-canvas.tsx +128 -0
- package/src/lib/empty-chip.ts +24 -0
- package/src/lib/optical-center.tsx +45 -0
- package/src/lib/utils.ts +26 -0
- package/dist/blocks/progress-screen.cjs +0 -1
- package/dist/blocks/progress-screen.d.ts.map +0 -1
package/dist/select.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as e, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-select";
|
|
4
4
|
import { Check as N, ChevronDown as S, ChevronUp as w } from "@brightlocal/icons";
|
|
5
5
|
import { cva as k } from "class-variance-authority";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as l, FLOATING_CONTENT_ANIMATION as C } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
import { useDevWarning as I } from "./lib/use-dev-warning.js";
|
|
8
8
|
import { useOverlayPointerLock as R } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
|
|
9
9
|
function T({
|
|
10
|
-
children:
|
|
10
|
+
children: t,
|
|
11
11
|
onClose: r,
|
|
12
|
-
onOpenChange:
|
|
12
|
+
onOpenChange: n,
|
|
13
13
|
open: s,
|
|
14
|
-
defaultOpen:
|
|
15
|
-
...
|
|
14
|
+
defaultOpen: i,
|
|
15
|
+
...p
|
|
16
16
|
}) {
|
|
17
|
-
const [a,
|
|
18
|
-
|
|
19
|
-
), u = s !== void 0,
|
|
17
|
+
const [a, m] = d.useState(
|
|
18
|
+
i ?? !1
|
|
19
|
+
), u = s !== void 0, c = u ? s : a, f = d.useCallback(
|
|
20
20
|
(h) => {
|
|
21
|
-
u ||
|
|
21
|
+
u || m(h), n?.(h);
|
|
22
22
|
},
|
|
23
|
-
[u,
|
|
24
|
-
), b =
|
|
25
|
-
|
|
23
|
+
[u, n]
|
|
24
|
+
), b = d.useRef(r);
|
|
25
|
+
d.useEffect(() => {
|
|
26
26
|
b.current = r;
|
|
27
27
|
}, [r]);
|
|
28
|
-
const v =
|
|
29
|
-
return
|
|
30
|
-
v.current && !
|
|
31
|
-
}, [
|
|
28
|
+
const v = d.useRef(c);
|
|
29
|
+
return d.useEffect(() => {
|
|
30
|
+
v.current && !c && b.current?.(), v.current = c;
|
|
31
|
+
}, [c]), d.useEffect(() => () => {
|
|
32
32
|
v.current && b.current?.();
|
|
33
|
-
}, []), /* @__PURE__ */
|
|
33
|
+
}, []), /* @__PURE__ */ e(
|
|
34
34
|
o.Root,
|
|
35
35
|
{
|
|
36
36
|
"data-slot": "select",
|
|
37
|
-
defaultOpen:
|
|
37
|
+
defaultOpen: i,
|
|
38
38
|
open: s,
|
|
39
|
-
onOpenChange:
|
|
40
|
-
...
|
|
41
|
-
children:
|
|
39
|
+
onOpenChange: f,
|
|
40
|
+
...p,
|
|
41
|
+
children: t
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
T.displayName = "Select";
|
|
46
|
-
function O(
|
|
47
|
-
return /* @__PURE__ */
|
|
46
|
+
function O(t) {
|
|
47
|
+
return /* @__PURE__ */ e(o.Group, { "data-slot": "select-group", ...t });
|
|
48
48
|
}
|
|
49
49
|
O.displayName = "SelectGroup";
|
|
50
|
-
function j(
|
|
51
|
-
return /* @__PURE__ */
|
|
50
|
+
function j(t) {
|
|
51
|
+
return /* @__PURE__ */ e(o.Value, { "data-slot": "select-value", ...t });
|
|
52
52
|
}
|
|
53
53
|
j.displayName = "SelectValue";
|
|
54
54
|
const B = k([
|
|
@@ -59,8 +59,9 @@ const B = k([
|
|
|
59
59
|
"border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
60
60
|
"bg-neutral-50 border-neutral-300",
|
|
61
61
|
"dark:bg-white/5 dark:border-white/15",
|
|
62
|
-
// Typography
|
|
63
|
-
|
|
62
|
+
// Typography — text-body (16px) per the Figma form-field example: the select
|
|
63
|
+
// sits beside inputs and both are values, so both are body (DS-921).
|
|
64
|
+
"text-body text-foreground",
|
|
64
65
|
// Text truncation for long content (shadcn default behavior)
|
|
65
66
|
"[&>span]:block [&>span]:truncate",
|
|
66
67
|
// Placeholder state
|
|
@@ -76,50 +77,50 @@ const B = k([
|
|
|
76
77
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
77
78
|
]);
|
|
78
79
|
function L({
|
|
79
|
-
className:
|
|
80
|
+
className: t,
|
|
80
81
|
children: r,
|
|
81
|
-
placeholder:
|
|
82
|
+
placeholder: n,
|
|
82
83
|
dataHook: s,
|
|
83
|
-
error:
|
|
84
|
-
selectLabel:
|
|
84
|
+
error: i,
|
|
85
|
+
selectLabel: p,
|
|
85
86
|
...a
|
|
86
87
|
}) {
|
|
87
|
-
const
|
|
88
|
+
const m = i || a["aria-invalid"] === !0 || a["aria-invalid"] === "true", u = a["aria-required"] === !0 || a["aria-required"] === "true", c = a["aria-label"] || p || n || "Select an option", f = m ? "border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive" : "";
|
|
88
89
|
return /* @__PURE__ */ g(
|
|
89
90
|
o.Trigger,
|
|
90
91
|
{
|
|
91
92
|
...a,
|
|
92
|
-
"aria-invalid":
|
|
93
|
-
"aria-label":
|
|
93
|
+
"aria-invalid": m ? "true" : void 0,
|
|
94
|
+
"aria-label": c,
|
|
94
95
|
"aria-required": u ? "true" : void 0,
|
|
95
|
-
className:
|
|
96
|
+
className: l(B(), f, t),
|
|
96
97
|
"data-hook": s,
|
|
97
98
|
"data-slot": "select-trigger",
|
|
98
99
|
children: [
|
|
99
100
|
r,
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ e(o.Icon, { asChild: !0, children: /* @__PURE__ */ e(S, { className: "text-muted-foreground" }) })
|
|
101
102
|
]
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
L.displayName = "SelectTrigger";
|
|
106
107
|
function _({
|
|
107
|
-
className:
|
|
108
|
+
className: t,
|
|
108
109
|
children: r,
|
|
109
|
-
position:
|
|
110
|
+
position: n = "popper",
|
|
110
111
|
maxHeight: s,
|
|
111
|
-
style:
|
|
112
|
-
...
|
|
112
|
+
style: i,
|
|
113
|
+
...p
|
|
113
114
|
}) {
|
|
114
115
|
R();
|
|
115
|
-
const a =
|
|
116
|
+
const a = d.useRef(null);
|
|
116
117
|
I(
|
|
117
118
|
() => a.current ? a.current.querySelectorAll('[data-slot="select-item"]').length >= 100 : !1,
|
|
118
119
|
`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
|
|
119
120
|
Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,
|
|
120
121
|
[r]
|
|
121
122
|
);
|
|
122
|
-
const
|
|
123
|
+
const m = l(
|
|
123
124
|
// Base appearance
|
|
124
125
|
"relative z-50 overflow-hidden",
|
|
125
126
|
"min-w-[8rem]",
|
|
@@ -130,52 +131,52 @@ Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,
|
|
|
130
131
|
"origin-[var(--radix-select-content-transform-origin)]",
|
|
131
132
|
// Animations
|
|
132
133
|
C
|
|
133
|
-
), u =
|
|
134
|
+
), u = n === "popper" && l(
|
|
134
135
|
"data-[side=bottom]:translate-y-1",
|
|
135
136
|
"data-[side=left]:-translate-x-1",
|
|
136
137
|
"data-[side=right]:translate-x-1",
|
|
137
138
|
"data-[side=top]:-translate-y-1"
|
|
138
|
-
),
|
|
139
|
-
...
|
|
139
|
+
), c = s !== void 0 ? {
|
|
140
|
+
...i,
|
|
140
141
|
maxHeight: `min(${s}px, var(--radix-select-content-available-height))`
|
|
141
|
-
} :
|
|
142
|
-
return /* @__PURE__ */
|
|
142
|
+
} : i;
|
|
143
|
+
return /* @__PURE__ */ e(o.Portal, { children: /* @__PURE__ */ g(
|
|
143
144
|
o.Content,
|
|
144
145
|
{
|
|
145
|
-
className:
|
|
146
|
+
className: l(m, u, t),
|
|
146
147
|
"data-slot": "select-content",
|
|
147
|
-
position:
|
|
148
|
-
style:
|
|
149
|
-
...
|
|
148
|
+
position: n,
|
|
149
|
+
style: c,
|
|
150
|
+
...p,
|
|
150
151
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ e(x, {}),
|
|
153
|
+
/* @__PURE__ */ e(
|
|
153
154
|
o.Viewport,
|
|
154
155
|
{
|
|
155
156
|
ref: a,
|
|
156
|
-
className:
|
|
157
|
+
className: l(
|
|
157
158
|
"p-1",
|
|
158
|
-
|
|
159
|
+
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
159
160
|
),
|
|
160
161
|
children: r
|
|
161
162
|
}
|
|
162
163
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ e(y, {})
|
|
164
165
|
]
|
|
165
166
|
}
|
|
166
167
|
) });
|
|
167
168
|
}
|
|
168
169
|
_.displayName = "SelectContent";
|
|
169
170
|
function q({
|
|
170
|
-
className:
|
|
171
|
+
className: t,
|
|
171
172
|
...r
|
|
172
173
|
}) {
|
|
173
|
-
return /* @__PURE__ */
|
|
174
|
+
return /* @__PURE__ */ e(
|
|
174
175
|
o.Label,
|
|
175
176
|
{
|
|
176
|
-
className:
|
|
177
|
-
"text-muted-foreground px-2 py-1.5
|
|
178
|
-
|
|
177
|
+
className: l(
|
|
178
|
+
"text-muted-foreground text-label-sm px-2 py-1.5",
|
|
179
|
+
t
|
|
179
180
|
),
|
|
180
181
|
"data-slot": "select-label",
|
|
181
182
|
...r
|
|
@@ -183,17 +184,13 @@ function q({
|
|
|
183
184
|
);
|
|
184
185
|
}
|
|
185
186
|
q.displayName = "SelectLabel";
|
|
186
|
-
function D({
|
|
187
|
-
|
|
188
|
-
children: r,
|
|
189
|
-
...l
|
|
190
|
-
}) {
|
|
191
|
-
const s = n(
|
|
187
|
+
function D({ className: t, children: r, hint: n, ...s }) {
|
|
188
|
+
const i = l(
|
|
192
189
|
// Base layout
|
|
193
190
|
"relative flex w-full cursor-default select-none items-center gap-2",
|
|
194
191
|
"rounded py-1.5 pl-2 pr-8",
|
|
195
192
|
// Typography
|
|
196
|
-
"text-
|
|
193
|
+
"text-label text-popover-foreground",
|
|
197
194
|
// Interactive states
|
|
198
195
|
"focus:bg-accent focus:text-accent-foreground",
|
|
199
196
|
"hover:bg-accent/50 hover:text-accent-foreground",
|
|
@@ -206,25 +203,33 @@ function D({
|
|
|
206
203
|
return /* @__PURE__ */ g(
|
|
207
204
|
o.Item,
|
|
208
205
|
{
|
|
209
|
-
className:
|
|
206
|
+
className: l(i, t),
|
|
210
207
|
"data-slot": "select-item",
|
|
211
|
-
...
|
|
208
|
+
...s,
|
|
212
209
|
children: [
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ e("span", { className: "absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(o.ItemIndicator, { children: /* @__PURE__ */ e(N, {}) }) }),
|
|
211
|
+
/* @__PURE__ */ e(o.ItemText, { children: r }),
|
|
212
|
+
n != null && /* @__PURE__ */ e(
|
|
213
|
+
"span",
|
|
214
|
+
{
|
|
215
|
+
className: "text-label-sm text-muted-foreground ml-auto",
|
|
216
|
+
"data-slot": "select-item-hint",
|
|
217
|
+
children: n
|
|
218
|
+
}
|
|
219
|
+
)
|
|
215
220
|
]
|
|
216
221
|
}
|
|
217
222
|
);
|
|
218
223
|
}
|
|
219
224
|
D.displayName = "SelectItem";
|
|
220
225
|
function E({
|
|
221
|
-
className:
|
|
226
|
+
className: t,
|
|
222
227
|
...r
|
|
223
228
|
}) {
|
|
224
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ e(
|
|
225
230
|
o.Separator,
|
|
226
231
|
{
|
|
227
|
-
className:
|
|
232
|
+
className: l("bg-border pointer-events-none -mx-1 my-1 h-px", t),
|
|
228
233
|
"data-slot": "select-separator",
|
|
229
234
|
...r
|
|
230
235
|
}
|
|
@@ -232,37 +237,37 @@ function E({
|
|
|
232
237
|
}
|
|
233
238
|
E.displayName = "SelectSeparator";
|
|
234
239
|
function x({
|
|
235
|
-
className:
|
|
240
|
+
className: t,
|
|
236
241
|
...r
|
|
237
242
|
}) {
|
|
238
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ e(
|
|
239
244
|
o.ScrollUpButton,
|
|
240
245
|
{
|
|
241
|
-
className:
|
|
246
|
+
className: l(
|
|
242
247
|
"flex cursor-default items-center justify-center py-1",
|
|
243
|
-
|
|
248
|
+
t
|
|
244
249
|
),
|
|
245
250
|
"data-slot": "select-scroll-up-button",
|
|
246
251
|
...r,
|
|
247
|
-
children: /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ e(w, {})
|
|
248
253
|
}
|
|
249
254
|
);
|
|
250
255
|
}
|
|
251
256
|
x.displayName = "SelectScrollUpButton";
|
|
252
257
|
function y({
|
|
253
|
-
className:
|
|
258
|
+
className: t,
|
|
254
259
|
...r
|
|
255
260
|
}) {
|
|
256
|
-
return /* @__PURE__ */
|
|
261
|
+
return /* @__PURE__ */ e(
|
|
257
262
|
o.ScrollDownButton,
|
|
258
263
|
{
|
|
259
|
-
className:
|
|
264
|
+
className: l(
|
|
260
265
|
"flex cursor-default items-center justify-center py-1",
|
|
261
|
-
|
|
266
|
+
t
|
|
262
267
|
),
|
|
263
268
|
"data-slot": "select-scroll-down-button",
|
|
264
269
|
...r,
|
|
265
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ e(S, {})
|
|
266
271
|
}
|
|
267
272
|
);
|
|
268
273
|
}
|
package/dist/separator.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),h=require("react"),p=require("class-variance-authority"),d=require("@brightlocal/ui-components/lib/utils");function x(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const c=x(h),N=p.cva("bg-border shrink-0",{variants:{orientation:{horizontal:"h-px border-0",vertical:"w-px"},spacing:{default:"",sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",spacing:"default",className:"w-full"},{orientation:"horizontal",spacing:"sm",className:"my-2 mx-6 w-auto"},{orientation:"horizontal",spacing:"md",className:"my-4 mx-6 w-auto"},{orientation:"horizontal",spacing:"lg",className:"m-6 w-auto"},{orientation:"vertical",spacing:"default",className:"h-full"},{orientation:"vertical",spacing:"sm",className:"self-stretch mx-2"},{orientation:"vertical",spacing:"md",className:"self-stretch mx-4"},{orientation:"vertical",spacing:"lg",className:"self-stretch mx-6"}],defaultVariants:{orientation:"horizontal",spacing:"default"}}),v=p.cva("flex items-center gap-2",{variants:{spacing:{default:"",sm:"py-2 px-6",md:"py-4 px-6",lg:"p-6"}},defaultVariants:{spacing:"default"}}),o=c.forwardRef(({className:t,orientation:a="horizontal",spacing:e="default",decorative:r=!0,dataHook:n,trackingEl:i,trackingLabel:l,...u},f)=>{const g=r?{role:"none"}:a==="vertical"?{"aria-orientation":"vertical",role:"separator"}:{};return c.createElement(a==="horizontal"?"hr":"div",{ref:f,className:d.cn(N({orientation:a,spacing:e}),t),"data-hook":n,"data-orientation":a,"data-slot":"separator","data-tracking-el":i,"data-tracking-label":l,...g,...u})});o.displayName="Separator";const m=c.forwardRef(({className:t,children:a,spacing:e="default",dataHook:r,trackingEl:n,trackingLabel:i},l)=>s.jsxs("div",{ref:l,className:d.cn(v({spacing:e}),t),"data-hook":r,"data-slot":"separator-with-text","data-tracking-el":n,"data-tracking-label":i,children:[s.jsx(o,{className:"flex-1"}),s.jsx("span",{className:"text-muted-foreground shrink-0
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),h=require("react"),p=require("class-variance-authority"),d=require("@brightlocal/ui-components/lib/utils");function x(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const c=x(h),N=p.cva("bg-border shrink-0",{variants:{orientation:{horizontal:"h-px border-0",vertical:"w-px"},spacing:{default:"",sm:"",md:"",lg:""}},compoundVariants:[{orientation:"horizontal",spacing:"default",className:"w-full"},{orientation:"horizontal",spacing:"sm",className:"my-2 mx-6 w-auto"},{orientation:"horizontal",spacing:"md",className:"my-4 mx-6 w-auto"},{orientation:"horizontal",spacing:"lg",className:"m-6 w-auto"},{orientation:"vertical",spacing:"default",className:"h-full"},{orientation:"vertical",spacing:"sm",className:"self-stretch mx-2"},{orientation:"vertical",spacing:"md",className:"self-stretch mx-4"},{orientation:"vertical",spacing:"lg",className:"self-stretch mx-6"}],defaultVariants:{orientation:"horizontal",spacing:"default"}}),v=p.cva("flex items-center gap-2",{variants:{spacing:{default:"",sm:"py-2 px-6",md:"py-4 px-6",lg:"p-6"}},defaultVariants:{spacing:"default"}}),o=c.forwardRef(({className:t,orientation:a="horizontal",spacing:e="default",decorative:r=!0,dataHook:n,trackingEl:i,trackingLabel:l,...u},f)=>{const g=r?{role:"none"}:a==="vertical"?{"aria-orientation":"vertical",role:"separator"}:{};return c.createElement(a==="horizontal"?"hr":"div",{ref:f,className:d.cn(N({orientation:a,spacing:e}),t),"data-hook":n,"data-orientation":a,"data-slot":"separator","data-tracking-el":i,"data-tracking-label":l,...g,...u})});o.displayName="Separator";const m=c.forwardRef(({className:t,children:a,spacing:e="default",dataHook:r,trackingEl:n,trackingLabel:i},l)=>s.jsxs("div",{ref:l,className:d.cn(v({spacing:e}),t),"data-hook":r,"data-slot":"separator-with-text","data-tracking-el":n,"data-tracking-label":i,children:[s.jsx(o,{className:"flex-1"}),s.jsx("span",{className:"text-body-sm text-muted-foreground shrink-0 leading-none whitespace-nowrap",children:a}),s.jsx(o,{className:"flex-1"})]}));m.displayName="SeparatorWithText";exports.Separator=o;exports.SeparatorWithText=m;
|
package/dist/separator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as h, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import { cva as m } from "class-variance-authority";
|
|
4
4
|
import { cn as p } from "@brightlocal/ui-components/lib/utils";
|
|
5
5
|
const u = m("bg-border shrink-0", {
|
|
@@ -41,7 +41,7 @@ const u = m("bg-border shrink-0", {
|
|
|
41
41
|
defaultVariants: {
|
|
42
42
|
spacing: "default"
|
|
43
43
|
}
|
|
44
|
-
}), c =
|
|
44
|
+
}), c = n.forwardRef(
|
|
45
45
|
({
|
|
46
46
|
className: t,
|
|
47
47
|
orientation: a = "horizontal",
|
|
@@ -56,7 +56,7 @@ const u = m("bg-border shrink-0", {
|
|
|
56
56
|
"aria-orientation": "vertical",
|
|
57
57
|
role: "separator"
|
|
58
58
|
} : {};
|
|
59
|
-
return
|
|
59
|
+
return n.createElement(a === "horizontal" ? "hr" : "div", {
|
|
60
60
|
ref: f,
|
|
61
61
|
className: p(u({ orientation: a, spacing: e }), t),
|
|
62
62
|
"data-hook": o,
|
|
@@ -70,7 +70,7 @@ const u = m("bg-border shrink-0", {
|
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
c.displayName = "Separator";
|
|
73
|
-
const N =
|
|
73
|
+
const N = n.forwardRef(
|
|
74
74
|
({
|
|
75
75
|
className: t,
|
|
76
76
|
children: a,
|
|
@@ -88,9 +88,9 @@ const N = l.forwardRef(
|
|
|
88
88
|
"data-tracking-el": o,
|
|
89
89
|
"data-tracking-label": s,
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ l(c, { className: "flex-1" }),
|
|
92
|
+
/* @__PURE__ */ l("span", { className: "text-body-sm text-muted-foreground shrink-0 leading-none whitespace-nowrap", children: a }),
|
|
93
|
+
/* @__PURE__ */ l(c, { className: "flex-1" })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
)
|
package/dist/sheet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),R=require("react"),O=require("@radix-ui/react-dialog"),C=require("class-variance-authority"),P=require("@brightlocal/icons"),n=require("@brightlocal/ui-components/lib/utils"),T=require("@brightlocal/ui-components/scroll-area"),q=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=f(R),r=f(O),z=C.cva(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","ease-out","data-[state=closed]:ease-in","data-[state=open]:duration-slow","data-[state=closed]:duration-250"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","border-l"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","border-r"]},size:{default:[],sm:[]}},compoundVariants:[{side:["left","right"],size:"default",className:["w-3/4","sm:max-w-sm"]},{side:["left","right"],size:"sm",className:["w-fit","min-w-(--ds-container-2xs)","max-w-(--ds-container-xs)"]}],defaultVariants:{side:"right",size:"default"}});function u({...e}){return s.jsx(r.Root,{"data-slot":"sheet",modal:!0,...e})}u.displayName="Sheet";const m=i.forwardRef(({dataHook:e,...t},a)=>s.jsx(r.Trigger,{ref:a,"data-slot":"sheet-trigger",...e!=null&&{"data-hook":e},...t}));m.displayName="SheetTrigger";const p=i.forwardRef(({...e},t)=>s.jsx(r.Close,{ref:t,"data-slot":"sheet-close",...e}));p.displayName="SheetClose";function c({...e}){return s.jsx(r.Portal,{"data-slot":"sheet-portal",...e})}c.displayName="SheetPortal";const h=i.forwardRef(({className:e,...t},a)=>s.jsx(r.Overlay,{ref:a,className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"sheet-overlay",...t}));h.displayName="SheetOverlay";const g=i.forwardRef(({className:e,children:t,side:a,size:o,dataHook:l,trackingEl:d,trackingLabel:v,closeLabel:N,...w},k)=>(q.useOverlayPointerLock(),s.jsxs(c,{children:[s.jsx(h,{}),s.jsxs(r.Content,{ref:k,className:n.cn(z({side:a,size:o}),e),"data-hook":l,"data-slot":"sheet-content","data-tracking-el":d,"data-tracking-label":v,...w,children:[t,s.jsxs(r.Close,{className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground duration-fast absolute top-4 right-4 rounded-xs opacity-70 outline-hidden transition-opacity ease-out hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[s.jsx(P.X,{}),s.jsx("span",{className:"sr-only",children:N??"Close"})]})]})]})));g.displayName="SheetContent";const x=i.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:n.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"sheet-header",...t}));x.displayName="SheetHeader";const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),R=require("react"),O=require("@radix-ui/react-dialog"),C=require("class-variance-authority"),P=require("@brightlocal/icons"),n=require("@brightlocal/ui-components/lib/utils"),T=require("@brightlocal/ui-components/scroll-area"),q=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock");function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=f(R),r=f(O),z=C.cva(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","ease-out","data-[state=closed]:ease-in","data-[state=open]:duration-slow","data-[state=closed]:duration-250"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","border-l"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","border-r"]},size:{default:[],sm:[]}},compoundVariants:[{side:["left","right"],size:"default",className:["w-3/4","sm:max-w-sm"]},{side:["left","right"],size:"sm",className:["w-fit","min-w-(--ds-container-2xs)","max-w-(--ds-container-xs)"]}],defaultVariants:{side:"right",size:"default"}});function u({...e}){return s.jsx(r.Root,{"data-slot":"sheet",modal:!0,...e})}u.displayName="Sheet";const m=i.forwardRef(({dataHook:e,...t},a)=>s.jsx(r.Trigger,{ref:a,"data-slot":"sheet-trigger",...e!=null&&{"data-hook":e},...t}));m.displayName="SheetTrigger";const p=i.forwardRef(({...e},t)=>s.jsx(r.Close,{ref:t,"data-slot":"sheet-close",...e}));p.displayName="SheetClose";function c({...e}){return s.jsx(r.Portal,{"data-slot":"sheet-portal",...e})}c.displayName="SheetPortal";const h=i.forwardRef(({className:e,...t},a)=>s.jsx(r.Overlay,{ref:a,className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"sheet-overlay",...t}));h.displayName="SheetOverlay";const g=i.forwardRef(({className:e,children:t,side:a,size:o,dataHook:l,trackingEl:d,trackingLabel:v,closeLabel:N,...w},k)=>(q.useOverlayPointerLock(),s.jsxs(c,{children:[s.jsx(h,{}),s.jsxs(r.Content,{ref:k,className:n.cn(z({side:a,size:o}),e),"data-hook":l,"data-slot":"sheet-content","data-tracking-el":d,"data-tracking-label":v,...w,children:[t,s.jsxs(r.Close,{className:"ring-offset-background focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground duration-fast absolute top-4 right-4 rounded-xs opacity-70 outline-hidden transition-opacity ease-out hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[s.jsx(P.X,{}),s.jsx("span",{className:"sr-only",children:N??"Close"})]})]})]})));g.displayName="SheetContent";const x=i.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:n.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"sheet-header",...t}));x.displayName="SheetHeader";const y=i.forwardRef(({className:e,children:t,dataHook:a,...o},l)=>s.jsx(T.ScrollArea,{ref:l,className:n.cn("-mx-6 min-h-0 flex-1",e),"data-slot":"sheet-body",dataHook:a??"sheet-body",...o,children:s.jsx("div",{className:"px-5","data-slot":"sheet-body-content",children:t})}));y.displayName="SheetBody";const S=i.forwardRef(({className:e,...t},a)=>s.jsx("div",{ref:a,className:n.cn("mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",e),"data-slot":"sheet-footer",...t}));S.displayName="SheetFooter";const b=i.forwardRef(({className:e,icon:t,children:a,dataHook:o,...l},d)=>s.jsxs(r.Title,{ref:d,className:n.cn("text-foreground text-heading-section",t&&"flex items-center gap-2",e),"data-hook":o,"data-slot":"sheet-title",...l,children:[t&&s.jsx("span",{className:"shrink-0 [&_svg]:size-5","data-slot":"sheet-title-icon",children:t}),a]}));b.displayName="SheetTitle";const j=i.forwardRef(({className:e,dataHook:t,...a},o)=>s.jsx(r.Description,{ref:o,className:n.cn("text-body-sm text-muted-foreground",e),"data-hook":t,"data-slot":"sheet-description",...a}));j.displayName="SheetDescription";exports.Sheet=u;exports.SheetBody=y;exports.SheetClose=p;exports.SheetContent=g;exports.SheetDescription=j;exports.SheetFooter=S;exports.SheetHeader=x;exports.SheetOverlay=h;exports.SheetPortal=c;exports.SheetTitle=b;exports.SheetTrigger=m;
|
package/dist/sheet.js
CHANGED
|
@@ -205,7 +205,7 @@ const P = i.forwardRef(({ className: e, icon: t, children: a, dataHook: r, ...l
|
|
|
205
205
|
{
|
|
206
206
|
ref: c,
|
|
207
207
|
className: d(
|
|
208
|
-
"text-foreground text-
|
|
208
|
+
"text-foreground text-heading-section",
|
|
209
209
|
t && "flex items-center gap-2",
|
|
210
210
|
e
|
|
211
211
|
),
|
|
@@ -223,7 +223,7 @@ const D = i.forwardRef(({ className: e, dataHook: t, ...a }, r) => /* @__PURE__
|
|
|
223
223
|
s.Description,
|
|
224
224
|
{
|
|
225
225
|
ref: r,
|
|
226
|
-
className: d("text-
|
|
226
|
+
className: d("text-body-sm text-muted-foreground", e),
|
|
227
227
|
"data-hook": t,
|
|
228
228
|
"data-slot": "sheet-description",
|
|
229
229
|
...a
|
package/dist/skeleton.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),m=require("react"),b=require("@brightlocal/ui-components/lib/utils");function g(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const k=g(m),p={short:300,long:1e3},l=k.forwardRef(({className:t,dataHook:n,delay:e=!1,style:r,trackingEl:i,trackingLabel:u,loadingLabel:o,...d},f)=>{const s=e===!1?0:typeof e=="number"?e:p[e],a=o!==void 0;return c.jsx("div",{ref:f,"aria-busy":a?"true":void 0,"aria-hidden":a?void 0:"true",className:b.cn("bg-skeleton animate-status-shimmer relative rounded-md",t),"data-hook":n,"data-slot":"skeleton","data-tracking-el":i,"data-tracking-label":u,style:s?{"--skeleton-delay":`${s}ms`,...r}:r,...d,children:a?c.jsx("span",{className:"sr-only",children:o}):null})});l.displayName="Skeleton";exports.Skeleton=l;
|
package/dist/skeleton.d.ts
CHANGED
|
@@ -2,7 +2,23 @@ import * as React from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* Props for the Skeleton component
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* Entry delay for the skeleton's appearance. `false` (default) shows it
|
|
7
|
+
* immediately; "short" holds it back 300ms (the flash zone's upper edge —
|
|
8
|
+
* waits that resolve first never show it); "long" holds it 1000ms for
|
|
9
|
+
* below-the-fold or secondary surfaces; a number sets a measured per-surface
|
|
10
|
+
* value in milliseconds. The delayed skeleton still reserves its geometry —
|
|
11
|
+
* it is invisible, not unmounted.
|
|
12
|
+
*/
|
|
13
|
+
type SkeletonDelay = "short" | "long" | number | false;
|
|
5
14
|
interface SkeletonProps extends React.ComponentProps<"div"> {
|
|
15
|
+
/**
|
|
16
|
+
* Delay before the skeleton becomes visible: `"short"` (300ms),
|
|
17
|
+
* `"long"` (1000ms), or a number of milliseconds. It keeps reserving its
|
|
18
|
+
* space while invisible.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
delay?: SkeletonDelay;
|
|
6
22
|
/**
|
|
7
23
|
* Data hook for automated testing (optional for Skeleton as it's purely presentational)
|
|
8
24
|
*/
|
|
@@ -17,16 +33,35 @@ interface SkeletonProps extends React.ComponentProps<"div"> {
|
|
|
17
33
|
trackingLabel?: string;
|
|
18
34
|
/**
|
|
19
35
|
* Accessible label announced to screen readers during loading.
|
|
20
|
-
*
|
|
36
|
+
*
|
|
37
|
+
* Unset (the default) the skeleton is silent: `aria-hidden`, with no
|
|
38
|
+
* screen-reader text. A loading layout is many skeletons — a table page is
|
|
39
|
+
* a dozen rows of four — and one announcement per shape is the whole wait
|
|
40
|
+
* read out dozens of times. The region being loaded carries `aria-busy` and
|
|
41
|
+
* makes the single announcement instead.
|
|
42
|
+
*
|
|
43
|
+
* Pass it only for a skeleton that stands alone, where there is no owning
|
|
44
|
+
* region to do the announcing.
|
|
21
45
|
*/
|
|
22
46
|
loadingLabel?: string;
|
|
23
47
|
}
|
|
24
48
|
/**
|
|
25
49
|
* Skeleton component for loading placeholder states.
|
|
26
|
-
* Displays a
|
|
50
|
+
* Displays a travelling shimmer wave — one soft color wave (skeleton base to
|
|
51
|
+
* a lighter peak) moving left to right through every skeleton shape in the
|
|
52
|
+
* view, so composed layouts light up in position order with no per-shape
|
|
53
|
+
* setup. The skeleton appears instantly at full strength — deliberately no
|
|
54
|
+
* fade-in — and the wave animates color only, never the shape's opacity.
|
|
27
55
|
* Use to represent text, images, avatars, or any other content while data is being fetched.
|
|
56
|
+
*
|
|
57
|
+
* Appears instantly at full strength — deliberately no fade-in: a skeleton
|
|
58
|
+
* is the page assembling, not a transition worth softening. Flicker on fast
|
|
59
|
+
* responses is prevented by not showing the skeleton at all (the `delay`
|
|
60
|
+
* prop, or `useDelayedPending`), never by easing it in. The exit is equally
|
|
61
|
+
* instant: unmounting is immediate, and fading a skeleton out over readable
|
|
62
|
+
* content is banned (a minimum display time by another name).
|
|
28
63
|
*/
|
|
29
64
|
declare const Skeleton: React.ForwardRefExoticComponent<Omit<SkeletonProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
65
|
export { Skeleton };
|
|
31
|
-
export type { SkeletonProps };
|
|
66
|
+
export type { SkeletonDelay, SkeletonProps };
|
|
32
67
|
//# sourceMappingURL=skeleton.d.ts.map
|
package/dist/skeleton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;GAEG;AACH,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACzD;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../src/components/skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;GAEG;AACH;;;;;;;GAOG;AACH,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;AAOvD,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACzD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,QAAQ,mGAkDb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/skeleton.js
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
const k = {
|
|
5
|
+
short: 300,
|
|
6
|
+
long: 1e3
|
|
7
|
+
}, p = u.forwardRef(
|
|
8
|
+
({
|
|
9
|
+
className: r,
|
|
10
|
+
dataHook: l,
|
|
11
|
+
delay: e = !1,
|
|
12
|
+
style: a,
|
|
13
|
+
trackingEl: i,
|
|
14
|
+
trackingLabel: d,
|
|
15
|
+
loadingLabel: o,
|
|
16
|
+
...m
|
|
17
|
+
}, c) => {
|
|
18
|
+
const s = e === !1 ? 0 : typeof e == "number" ? e : k[e], t = o !== void 0;
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref: c,
|
|
23
|
+
"aria-busy": t ? "true" : void 0,
|
|
24
|
+
"aria-hidden": t ? void 0 : "true",
|
|
25
|
+
className: f(
|
|
26
|
+
"bg-skeleton animate-status-shimmer relative rounded-md",
|
|
27
|
+
r
|
|
28
|
+
),
|
|
29
|
+
"data-hook": l,
|
|
30
|
+
"data-slot": "skeleton",
|
|
31
|
+
"data-tracking-el": i,
|
|
32
|
+
"data-tracking-label": d,
|
|
33
|
+
style: s ? {
|
|
34
|
+
"--skeleton-delay": `${s}ms`,
|
|
35
|
+
...a
|
|
36
|
+
} : a,
|
|
37
|
+
...m,
|
|
38
|
+
children: t ? /* @__PURE__ */ n("span", { className: "sr-only", children: o }) : null
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
19
42
|
);
|
|
20
|
-
|
|
43
|
+
p.displayName = "Skeleton";
|
|
21
44
|
export {
|
|
22
|
-
|
|
45
|
+
p as Skeleton
|
|
23
46
|
};
|
package/dist/sonner.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@brightlocal/icons"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@brightlocal/icons"),h=require("class-variance-authority"),m=require("sonner"),x=require("@brightlocal/ui-components/button"),s=require("@brightlocal/ui-components/lib/utils"),g=require("@brightlocal/ui-components/spinner"),v=4e3,p=h.cva(["flex","items-center","justify-between","w-full","md:w-auto","md:min-w-[364px]","rounded-md","border","border-border","p-4","gap-2","shadow-lg"].join(" "),{variants:{colorSchema:{default:"bg-white dark:bg-popover",success:"bg-green-200 dark:bg-popover"}},defaultVariants:{colorSchema:"default"}}),N=h.cva("text-heading-compact",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900 dark:text-green-100"}},defaultVariants:{colorSchema:"default"}}),j=h.cva("text-body-sm",{variants:{colorSchema:{default:"text-muted-foreground",success:"text-green-900 dark:text-green-100"}},defaultVariants:{colorSchema:"default"}}),l=h.cva("",{variants:{colorSchema:{default:"text-foreground",success:"text-green-900 dark:text-green-100"}},defaultVariants:{colorSchema:"default"}});function T(r,t){switch(r){case"info":return e.jsx(d.Info,{className:s.cn(l({colorSchema:t}))});case"success":return e.jsx(d.CheckCircle2,{className:s.cn(l({colorSchema:t}))});case"warning":return e.jsx(d.AlertTriangle,{className:s.cn(l({colorSchema:t}))});case"error":return e.jsx(d.XCircle,{className:s.cn(l({colorSchema:t}))});case"loading":return e.jsx(g.Spinner,{className:s.cn(l({colorSchema:t}))});default:return null}}const S=function(t,a){const{id:c,...n}=t,u={...a,duration:a?.duration??v,...c!=null&&{id:a?.id??c}},f=u.duration===1/0;m.toast.custom(o=>{const i=n.button&&n.button.label?{label:n.button.label,variant:n.button.variant,onClick:()=>{n.button?.onClick&&n.button.onClick(),m.toast.dismiss(o)}}:void 0;return e.jsx(I,{button:i,colorSchema:n.colorSchema,description:n.description,icon:n.icon??void 0,id:o,title:n.title})},{...u,...f&&{dismissible:!1}})};S.dismiss=r=>{m.toast.dismiss(r)};function I(r){const{button:t,description:a,icon:c,title:n,colorSchema:u}=r,o=(i=>i==="success"?"success":"default")(u);return e.jsxs("div",{"aria-atomic":"true","aria-live":"polite",className:s.cn(p({colorSchema:o})),role:"status",children:[e.jsxs("div",{className:"flex flex-1 items-start gap-2",children:[c!=null&&(()=>{const i=T(c,o);return i?e.jsx("span",{className:"mt-0.5 shrink-0",children:i}):null})(),e.jsxs("div",{className:"w-full",children:[e.jsx("p",{className:s.cn(N({colorSchema:o})),children:n}),a&&e.jsx("p",{className:s.cn(j({colorSchema:o})),children:a})]})]}),t?.label&&e.jsx(x.Button,{"aria-label":t.label,dataHook:"toast-action",size:"sm",variant:t.variant,onClick:t.onClick,children:t.label})]})}function b(){return e.jsx(m.Toaster,{position:"top-right"})}b.displayName="Sonner";exports.Sonner=b;exports.sonner=S;
|