@brightlocal/ui-components 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/component-meta.json +749 -53
- package/deprecations.json +114 -4
- 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.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +50 -57
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/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 +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +105 -7
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +198 -101
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +270 -24
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +497 -322
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +38 -4
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +95 -81
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- 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 +251 -225
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +201 -23
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +712 -568
- 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/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +79 -52
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +105 -13
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +146 -129
- package/dist/grid.d.ts +26 -3
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +594 -553
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +45 -15
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +31 -30
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/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/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +3 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +57 -57
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/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 +24 -3
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +130 -110
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.d.ts +13 -0
- package/dist/typography-heading.d.ts.map +1 -1
- package/dist/typography-heading.js +32 -21
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +15 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +35 -24
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +17 -24
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/accordion.tsx +82 -27
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/button-group.tsx +112 -0
- package/src/components/button.tsx +1 -1
- package/src/components/card.tsx +249 -27
- package/src/components/chart.tsx +586 -53
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +83 -10
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +56 -4
- package/src/components/data-table.tsx +842 -199
- package/src/components/date-picker.tsx +18 -7
- package/src/components/field.tsx +81 -12
- package/src/components/global-layout.tsx +176 -38
- package/src/components/grid.tsx +34 -3
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +56 -22
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/pagination.tsx +10 -3
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/scroll-area.tsx +23 -10
- package/src/components/select.tsx +65 -11
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-heading.tsx +24 -0
- package/src/components/typography-text.tsx +27 -3
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +6 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/empty-chip.ts +24 -0
- package/src/lib/utils.ts +1 -0
package/dist/global-layout.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as u, Fragment as H } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { ArrowLeft as
|
|
3
|
+
import { ArrowLeft as k } from "@brightlocal/icons";
|
|
4
4
|
import { cn as m } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
-
import { Breadcrumb as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import { Breadcrumb as C } from "./breadcrumb.js";
|
|
6
|
+
import { Button as j } from "./button.js";
|
|
7
|
+
import { Header as w } from "./header.js";
|
|
8
|
+
import { Link as B } from "./link.js";
|
|
9
|
+
import { ScrollArea as E } from "./scroll-area.js";
|
|
10
|
+
import { TypographyText as S } from "./typography-text.js";
|
|
11
|
+
const A = r.forwardRef(
|
|
11
12
|
({
|
|
12
13
|
className: t,
|
|
13
|
-
maxWidth:
|
|
14
|
-
dataHook:
|
|
14
|
+
maxWidth: a = "none",
|
|
15
|
+
dataHook: e,
|
|
15
16
|
trackingEl: l,
|
|
16
|
-
trackingLabel:
|
|
17
|
+
trackingLabel: n,
|
|
17
18
|
children: s,
|
|
18
|
-
...
|
|
19
|
+
...i
|
|
19
20
|
}, c) => {
|
|
20
|
-
const f = typeof
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
21
|
+
const f = typeof a == "number" ? `${a}px` : a;
|
|
22
|
+
return /* @__PURE__ */ o(
|
|
23
|
+
E,
|
|
23
24
|
{
|
|
24
25
|
className: m(
|
|
25
26
|
"h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0! [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",
|
|
26
27
|
t
|
|
27
28
|
),
|
|
28
|
-
dataHook: `${
|
|
29
|
+
dataHook: `${e}-scroll`,
|
|
29
30
|
scrollOrientation: "both",
|
|
30
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ o(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
33
34
|
ref: c,
|
|
34
35
|
className: "flex min-h-dvh w-full flex-col",
|
|
35
|
-
"data-hook":
|
|
36
|
+
"data-hook": e,
|
|
36
37
|
"data-slot": "global-layout",
|
|
37
38
|
"data-tracking-el": l,
|
|
38
|
-
"data-tracking-label":
|
|
39
|
-
...
|
|
40
|
-
children: /* @__PURE__ */
|
|
39
|
+
"data-tracking-label": n,
|
|
40
|
+
...i,
|
|
41
|
+
children: /* @__PURE__ */ o(
|
|
41
42
|
"div",
|
|
42
43
|
{
|
|
43
44
|
className: "mx-auto flex w-full flex-1",
|
|
@@ -52,10 +53,10 @@ const S = r.forwardRef(
|
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
);
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
return /* @__PURE__ */
|
|
56
|
+
A.displayName = "GlobalLayout";
|
|
57
|
+
const _ = "288px", I = r.forwardRef(({ className: t, width: a = _, dataHook: e, children: l, ...n }, s) => {
|
|
58
|
+
const i = typeof a == "number" ? `${a}px` : a;
|
|
59
|
+
return /* @__PURE__ */ o(
|
|
59
60
|
"aside",
|
|
60
61
|
{
|
|
61
62
|
ref: s,
|
|
@@ -63,30 +64,30 @@ const B = "288px", _ = r.forwardRef(({ className: t, width: e = B, dataHook: a,
|
|
|
63
64
|
"sticky hidden shrink-0 self-start outline-none lg:block",
|
|
64
65
|
t
|
|
65
66
|
),
|
|
66
|
-
"data-hook":
|
|
67
|
+
"data-hook": e,
|
|
67
68
|
"data-slot": "sidebar-container",
|
|
68
|
-
...
|
|
69
|
+
...n,
|
|
69
70
|
style: {
|
|
70
|
-
width:
|
|
71
|
+
width: i,
|
|
71
72
|
top: 0,
|
|
72
73
|
height: "100dvh",
|
|
73
|
-
...
|
|
74
|
+
...n.style
|
|
74
75
|
},
|
|
75
76
|
children: l
|
|
76
77
|
}
|
|
77
78
|
);
|
|
78
79
|
});
|
|
79
|
-
|
|
80
|
-
const
|
|
80
|
+
I.displayName = "GlobalLayoutSidebar";
|
|
81
|
+
const M = r.forwardRef(
|
|
81
82
|
({
|
|
82
83
|
className: t,
|
|
83
|
-
maxWidth:
|
|
84
|
-
dataHook:
|
|
84
|
+
maxWidth: a = "var(--ds-breakpoint-lg)",
|
|
85
|
+
dataHook: e,
|
|
85
86
|
children: l,
|
|
86
|
-
...
|
|
87
|
+
...n
|
|
87
88
|
}, s) => {
|
|
88
|
-
const
|
|
89
|
-
return /* @__PURE__ */
|
|
89
|
+
const i = typeof a == "number" ? `${a}px` : a;
|
|
90
|
+
return /* @__PURE__ */ o(
|
|
90
91
|
"div",
|
|
91
92
|
{
|
|
92
93
|
ref: s,
|
|
@@ -94,103 +95,117 @@ const A = r.forwardRef(
|
|
|
94
95
|
"pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6",
|
|
95
96
|
t
|
|
96
97
|
),
|
|
97
|
-
"data-hook":
|
|
98
|
+
"data-hook": e,
|
|
98
99
|
"data-slot": "content-wrapper",
|
|
99
|
-
style: { "--content-max-width":
|
|
100
|
-
...
|
|
100
|
+
style: { "--content-max-width": i },
|
|
101
|
+
...n,
|
|
101
102
|
children: l
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
105
|
}
|
|
105
106
|
);
|
|
106
|
-
|
|
107
|
-
const x = "px-4 md:px-6 lg:px-section-xs",
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
107
|
+
M.displayName = "GlobalLayoutContent";
|
|
108
|
+
const x = "px-4 md:px-6 lg:px-section-xs", v = r.forwardRef((t, a) => {
|
|
109
|
+
if (t.href === void 0) {
|
|
110
|
+
const { dataHook: s, ariaLabel: i, ...c } = t;
|
|
111
|
+
return /* @__PURE__ */ o(
|
|
112
|
+
j,
|
|
113
|
+
{
|
|
114
|
+
ref: a,
|
|
115
|
+
ariaLabel: i || "Go back",
|
|
116
|
+
"data-slot": "content-header-back-link",
|
|
117
|
+
dataHook: s ?? "content-header-back-link",
|
|
118
|
+
variant: "ghost",
|
|
119
|
+
...c,
|
|
120
|
+
children: /* @__PURE__ */ o(k, { "aria-hidden": "true" })
|
|
121
|
+
}
|
|
122
|
+
);
|
|
121
123
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
const { dataHook: e, ariaLabel: l, ...n } = t;
|
|
125
|
+
return /* @__PURE__ */ o(
|
|
126
|
+
B,
|
|
127
|
+
{
|
|
128
|
+
ref: a,
|
|
129
|
+
"aria-label": l || "Go back",
|
|
130
|
+
"data-slot": "content-header-back-link",
|
|
131
|
+
dataHook: e ?? "content-header-back-link",
|
|
132
|
+
variant: "icon",
|
|
133
|
+
...n,
|
|
134
|
+
children: /* @__PURE__ */ o(k, { "aria-hidden": "true" })
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
v.displayName = "GlobalLayoutBackLink";
|
|
139
|
+
const L = r.forwardRef(({ dataHook: t, asChild: a, ...e }, l) => /* @__PURE__ */ o(
|
|
140
|
+
S,
|
|
126
141
|
{
|
|
127
142
|
ref: l,
|
|
128
|
-
asChild:
|
|
143
|
+
asChild: a,
|
|
129
144
|
color: "muted",
|
|
130
145
|
"data-slot": "content-header-subtitle",
|
|
131
146
|
dataHook: t ?? "content-header-subtitle",
|
|
132
147
|
variant: "body-sm",
|
|
133
|
-
...
|
|
148
|
+
...e
|
|
134
149
|
}
|
|
135
150
|
));
|
|
136
|
-
|
|
137
|
-
const
|
|
151
|
+
L.displayName = "GlobalLayoutSubtitle";
|
|
152
|
+
const N = r.forwardRef(({ className: t, dataHook: a, children: e, ...l }, n) => /* @__PURE__ */ o(
|
|
138
153
|
"div",
|
|
139
154
|
{
|
|
140
|
-
ref:
|
|
155
|
+
ref: n,
|
|
141
156
|
className: m(
|
|
142
157
|
"aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
|
|
143
158
|
t
|
|
144
159
|
),
|
|
145
|
-
"data-hook":
|
|
160
|
+
"data-hook": a ?? "content-header-image",
|
|
146
161
|
"data-slot": "content-header-image",
|
|
147
162
|
...l,
|
|
148
|
-
children:
|
|
163
|
+
children: e
|
|
149
164
|
}
|
|
150
165
|
));
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
({ className: t, dataHook:
|
|
154
|
-
const c = [], f = [], y = [],
|
|
155
|
-
return r.Children.forEach(
|
|
156
|
-
r.isValidElement(
|
|
157
|
-
}), c.length === 0 && f.length === 0 && y.length === 0 &&
|
|
166
|
+
N.displayName = "GlobalLayoutImage";
|
|
167
|
+
const T = r.forwardRef(
|
|
168
|
+
({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => {
|
|
169
|
+
const c = [], f = [], y = [], b = [], p = [], h = [];
|
|
170
|
+
return r.Children.forEach(n, (d) => {
|
|
171
|
+
r.isValidElement(d) && d.type === v ? c.push(d) : r.isValidElement(d) && d.type === N ? f.push(d) : r.isValidElement(d) && d.type === C ? y.push(d) : r.isValidElement(d) && d.type === L ? b.push(d) : r.isValidElement(d) && d.type === g ? p.push(d) : h.push(d);
|
|
172
|
+
}), c.length === 0 && f.length === 0 && y.length === 0 && b.length === 0 && p.length === 0 ? /* @__PURE__ */ o(
|
|
158
173
|
"div",
|
|
159
174
|
{
|
|
160
175
|
className: m("w-full", x),
|
|
161
176
|
"data-slot": "content-header-region",
|
|
162
|
-
children: /* @__PURE__ */
|
|
163
|
-
|
|
177
|
+
children: /* @__PURE__ */ o(
|
|
178
|
+
w,
|
|
164
179
|
{
|
|
165
|
-
ref:
|
|
180
|
+
ref: i,
|
|
166
181
|
className: m(
|
|
167
182
|
"mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",
|
|
168
183
|
t
|
|
169
184
|
),
|
|
170
185
|
"data-slot": "content-header",
|
|
171
|
-
dataHook:
|
|
186
|
+
dataHook: a,
|
|
172
187
|
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
173
|
-
trackingEl:
|
|
188
|
+
trackingEl: e,
|
|
174
189
|
trackingLabel: l,
|
|
175
190
|
...s,
|
|
176
|
-
children:
|
|
191
|
+
children: n
|
|
177
192
|
}
|
|
178
193
|
)
|
|
179
194
|
}
|
|
180
|
-
) : /* @__PURE__ */
|
|
195
|
+
) : /* @__PURE__ */ o(
|
|
181
196
|
"div",
|
|
182
197
|
{
|
|
183
198
|
className: m("w-full", x),
|
|
184
199
|
"data-slot": "content-header-region",
|
|
185
200
|
children: /* @__PURE__ */ u(
|
|
186
|
-
|
|
201
|
+
w,
|
|
187
202
|
{
|
|
188
|
-
ref:
|
|
203
|
+
ref: i,
|
|
189
204
|
className: m("mx-auto w-full items-start gap-4", t),
|
|
190
205
|
"data-slot": "content-header",
|
|
191
|
-
dataHook:
|
|
206
|
+
dataHook: a,
|
|
192
207
|
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
193
|
-
trackingEl:
|
|
208
|
+
trackingEl: e,
|
|
194
209
|
trackingLabel: l,
|
|
195
210
|
...s,
|
|
196
211
|
children: [
|
|
@@ -203,8 +218,8 @@ const I = r.forwardRef(
|
|
|
203
218
|
"data-slot": "content-header-body",
|
|
204
219
|
children: [
|
|
205
220
|
y,
|
|
206
|
-
|
|
207
|
-
// With a slotted
|
|
221
|
+
p.length > 0 ? (
|
|
222
|
+
// With a slotted GlobalLayoutActions the header follows
|
|
208
223
|
// the Figma Page Header structure: a text block (title +
|
|
209
224
|
// description) with the actions beside it — and below it on
|
|
210
225
|
// mobile, so the action lands under the description.
|
|
@@ -221,16 +236,16 @@ const I = r.forwardRef(
|
|
|
221
236
|
"data-slot": "content-header-text",
|
|
222
237
|
children: [
|
|
223
238
|
h,
|
|
224
|
-
|
|
239
|
+
b
|
|
225
240
|
]
|
|
226
241
|
}
|
|
227
242
|
),
|
|
228
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ o(G.Provider, { value: !0, children: p })
|
|
229
244
|
]
|
|
230
245
|
}
|
|
231
246
|
)
|
|
232
|
-
) : /* @__PURE__ */ u(
|
|
233
|
-
/* @__PURE__ */
|
|
247
|
+
) : /* @__PURE__ */ u(H, { children: [
|
|
248
|
+
/* @__PURE__ */ o(
|
|
234
249
|
"div",
|
|
235
250
|
{
|
|
236
251
|
className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
|
|
@@ -238,7 +253,7 @@ const I = r.forwardRef(
|
|
|
238
253
|
children: h
|
|
239
254
|
}
|
|
240
255
|
),
|
|
241
|
-
|
|
256
|
+
b
|
|
242
257
|
] })
|
|
243
258
|
]
|
|
244
259
|
}
|
|
@@ -250,27 +265,27 @@ const I = r.forwardRef(
|
|
|
250
265
|
);
|
|
251
266
|
}
|
|
252
267
|
);
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
({ className: t, dataHook:
|
|
256
|
-
const c = r.useContext(
|
|
268
|
+
T.displayName = "GlobalLayoutContentHeader";
|
|
269
|
+
const G = r.createContext(!1), g = r.forwardRef(
|
|
270
|
+
({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => {
|
|
271
|
+
const c = r.useContext(G), f = /* @__PURE__ */ o(
|
|
257
272
|
"div",
|
|
258
273
|
{
|
|
259
|
-
ref:
|
|
274
|
+
ref: i,
|
|
260
275
|
className: m(
|
|
261
276
|
c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
|
|
262
277
|
t
|
|
263
278
|
),
|
|
264
|
-
"data-hook":
|
|
279
|
+
"data-hook": a,
|
|
265
280
|
"data-slot": "content-actions",
|
|
266
|
-
"data-tracking-el":
|
|
281
|
+
"data-tracking-el": e,
|
|
267
282
|
"data-tracking-label": l,
|
|
268
283
|
style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
269
284
|
...s,
|
|
270
|
-
children:
|
|
285
|
+
children: n
|
|
271
286
|
}
|
|
272
287
|
);
|
|
273
|
-
return c ? f : /* @__PURE__ */
|
|
288
|
+
return c ? f : /* @__PURE__ */ o(
|
|
274
289
|
"div",
|
|
275
290
|
{
|
|
276
291
|
className: m("w-full", x),
|
|
@@ -280,45 +295,45 @@ const N = r.createContext(!1), L = r.forwardRef(
|
|
|
280
295
|
);
|
|
281
296
|
}
|
|
282
297
|
);
|
|
283
|
-
|
|
284
|
-
const
|
|
285
|
-
({ className: t, dataHook:
|
|
298
|
+
g.displayName = "GlobalLayoutActions";
|
|
299
|
+
const J = g, R = r.forwardRef(
|
|
300
|
+
({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => /* @__PURE__ */ o(
|
|
286
301
|
"div",
|
|
287
302
|
{
|
|
288
303
|
className: m("flex w-full flex-1 flex-col", x),
|
|
289
304
|
"data-slot": "content-body-region",
|
|
290
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ o(
|
|
291
306
|
"div",
|
|
292
307
|
{
|
|
293
|
-
ref:
|
|
308
|
+
ref: i,
|
|
294
309
|
className: m("mx-auto flex w-full flex-1 flex-col gap-6", t),
|
|
295
|
-
"data-hook":
|
|
310
|
+
"data-hook": a,
|
|
296
311
|
"data-slot": "content-body",
|
|
297
|
-
"data-tracking-el":
|
|
312
|
+
"data-tracking-el": e,
|
|
298
313
|
"data-tracking-label": l,
|
|
299
314
|
style: { maxWidth: "var(--content-max-width)" },
|
|
300
315
|
...s,
|
|
301
|
-
children:
|
|
316
|
+
children: n
|
|
302
317
|
}
|
|
303
318
|
)
|
|
304
319
|
}
|
|
305
320
|
)
|
|
306
321
|
);
|
|
307
|
-
|
|
308
|
-
const
|
|
322
|
+
R.displayName = "GlobalLayoutBody";
|
|
323
|
+
const K = R, V = r.forwardRef(
|
|
309
324
|
({
|
|
310
325
|
className: t,
|
|
311
|
-
dataHook:
|
|
312
|
-
ariaLabel:
|
|
326
|
+
dataHook: a,
|
|
327
|
+
ariaLabel: e,
|
|
313
328
|
trackingEl: l,
|
|
314
|
-
trackingLabel:
|
|
329
|
+
trackingLabel: n,
|
|
315
330
|
children: s,
|
|
316
|
-
...
|
|
317
|
-
}, c) => /* @__PURE__ */
|
|
331
|
+
...i
|
|
332
|
+
}, c) => /* @__PURE__ */ o(
|
|
318
333
|
"div",
|
|
319
334
|
{
|
|
320
335
|
ref: c,
|
|
321
|
-
"aria-label":
|
|
336
|
+
"aria-label": e ?? "Mobile navigation",
|
|
322
337
|
className: m(
|
|
323
338
|
// The 2px negative margin pulls a slotted SidebarTrigger's box
|
|
324
339
|
// left by its icon inset so the burger glyph — not the invisible
|
|
@@ -326,26 +341,28 @@ const T = r.forwardRef(
|
|
|
326
341
|
"flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5",
|
|
327
342
|
t
|
|
328
343
|
),
|
|
329
|
-
"data-hook":
|
|
344
|
+
"data-hook": a,
|
|
330
345
|
"data-slot": "mobile-header",
|
|
331
346
|
"data-tracking-el": l,
|
|
332
|
-
"data-tracking-label":
|
|
347
|
+
"data-tracking-label": n,
|
|
333
348
|
role: "toolbar",
|
|
334
|
-
...
|
|
349
|
+
...i,
|
|
335
350
|
children: s
|
|
336
351
|
}
|
|
337
352
|
)
|
|
338
353
|
);
|
|
339
|
-
|
|
354
|
+
V.displayName = "GlobalLayoutMobileHeader";
|
|
340
355
|
export {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
M as
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
T as
|
|
349
|
-
|
|
350
|
-
|
|
356
|
+
A as GlobalLayout,
|
|
357
|
+
g as GlobalLayoutActions,
|
|
358
|
+
v as GlobalLayoutBackLink,
|
|
359
|
+
R as GlobalLayoutBody,
|
|
360
|
+
M as GlobalLayoutContent,
|
|
361
|
+
J as GlobalLayoutContentActions,
|
|
362
|
+
K as GlobalLayoutContentBody,
|
|
363
|
+
T as GlobalLayoutContentHeader,
|
|
364
|
+
N as GlobalLayoutImage,
|
|
365
|
+
V as GlobalLayoutMobileHeader,
|
|
366
|
+
I as GlobalLayoutSidebar,
|
|
367
|
+
L as GlobalLayoutSubtitle
|
|
351
368
|
};
|
package/dist/grid.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ interface GridBaseProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
|
23
23
|
/**
|
|
24
24
|
* One message at the page body's optical centre (38/62). Give it a page body
|
|
25
25
|
* to fill — it stretches with `flex-1` — and one message to hold.
|
|
26
|
+
*
|
|
27
|
+
* Requires an unbroken flex chain: the Grid's parent, and every wrapper up to
|
|
28
|
+
* the page body, must be a `flex flex-1 flex-col` box. Behind a non-flex
|
|
29
|
+
* wrapper it centres horizontally only — fix the wrapper, do not add a margin.
|
|
26
30
|
*/
|
|
27
31
|
interface GridCenteredProps extends GridBaseProps {
|
|
28
32
|
variant: "centered";
|
|
@@ -38,16 +42,35 @@ export type GridProps = GridCenteredProps;
|
|
|
38
42
|
*
|
|
39
43
|
* @example
|
|
40
44
|
* ```tsx
|
|
41
|
-
* <
|
|
45
|
+
* <GlobalLayoutBody dataHook="locations-body">
|
|
42
46
|
* <Grid dataHook="locations-empty-center" variant="centered">
|
|
43
47
|
* <EmptyState
|
|
44
48
|
* dataHook="locations-empty"
|
|
45
|
-
* illustration={<
|
|
49
|
+
* illustration={<SmallBusiness aria-hidden />}
|
|
46
50
|
* size="lg"
|
|
47
51
|
* title={t("locations.empty.title")}
|
|
48
52
|
* />
|
|
49
53
|
* </Grid>
|
|
50
|
-
* </
|
|
54
|
+
* </GlobalLayoutBody>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* Wrappers between the page body and the Grid must continue the flex chain:
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // Broken — the plain <div> has no height to give, so the Grid collapses to
|
|
61
|
+
* // its content and the message hugs the top (horizontal centring only).
|
|
62
|
+
* <GlobalLayoutBody dataHook="search-body">
|
|
63
|
+
* <div>
|
|
64
|
+
* <Grid dataHook="search-empty-center" variant="centered">…</Grid>
|
|
65
|
+
* </div>
|
|
66
|
+
* </GlobalLayoutBody>
|
|
67
|
+
*
|
|
68
|
+
* // Fixed — the wrapper passes the height down.
|
|
69
|
+
* <GlobalLayoutBody dataHook="search-body">
|
|
70
|
+
* <div className="flex flex-1 flex-col">
|
|
71
|
+
* <Grid dataHook="search-empty-center" variant="centered">…</Grid>
|
|
72
|
+
* </div>
|
|
73
|
+
* </GlobalLayoutBody>
|
|
51
74
|
* ```
|
|
52
75
|
*/
|
|
53
76
|
declare const Grid: React.ForwardRefExoticComponent<GridCenteredProps & React.RefAttributes<HTMLDivElement>>;
|
package/dist/grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgD/B;;;;GAIG;AACH,KAAK,WAAW,GAAG,UAAU,CAAC;AAE9B,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACnE;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,QAAA,MAAM,IAAI,0FA4BT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=l(d),c={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function s(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(()=>s(e));return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[e]),n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=s;exports.useIsBelowBreakpoint=p;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=l(d),c={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function s(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(()=>s(e));return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[e]),n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=s;exports.useIsBelowBreakpoint=p;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Breakpoint name matching design token keys from `@brightlocal/tokens/breakpoints`.
|
|
3
3
|
*/
|
|
4
|
-
type Breakpoint = "sm" | "md" | "lg" | "xl" | "2xl";
|
|
4
|
+
type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
5
5
|
export declare function getBreakpointValue(size?: Breakpoint): number;
|
|
6
6
|
export declare function isBelowBreakpoint(size?: Breakpoint): boolean;
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-breakpoint.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"use-breakpoint.d.ts","sourceRoot":"","sources":["../../src/hooks/use-breakpoint.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAY3D,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,UAAiB,GAAG,MAAM,CASlE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,UAAiB,GAAG,OAAO,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,UAAiB,WAc3D;AAED,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-breakpoint.cjs");exports.getBreakpointValue=e.getBreakpointValue;exports.getMobileBreakpoint=e.getBreakpointValue;exports.isMobileViewport=e.isBelowBreakpoint;exports.useIsBelowBreakpoint=e.useIsBelowBreakpoint;exports.useIsMobile=e.useIsBelowBreakpoint;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getBreakpointValue as i, getBreakpointValue as a, isBelowBreakpoint as s, useIsBelowBreakpoint as t, useIsBelowBreakpoint as r } from "./use-breakpoint.js";
|
|
2
|
+
export {
|
|
3
|
+
i as getBreakpointValue,
|
|
4
|
+
a as getMobileBreakpoint,
|
|
5
|
+
s as isMobileViewport,
|
|
6
|
+
t as useIsBelowBreakpoint,
|
|
7
|
+
r as useIsMobile
|
|
8
|
+
};
|