@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/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", M = 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,101 +95,117 @@ const _ = 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,
|
|
144
|
+
color: "muted",
|
|
129
145
|
"data-slot": "content-header-subtitle",
|
|
130
146
|
dataHook: t ?? "content-header-subtitle",
|
|
131
|
-
|
|
147
|
+
variant: "body-sm",
|
|
148
|
+
...e
|
|
132
149
|
}
|
|
133
150
|
));
|
|
134
|
-
|
|
135
|
-
const
|
|
151
|
+
L.displayName = "GlobalLayoutSubtitle";
|
|
152
|
+
const N = r.forwardRef(({ className: t, dataHook: a, children: e, ...l }, n) => /* @__PURE__ */ o(
|
|
136
153
|
"div",
|
|
137
154
|
{
|
|
138
|
-
ref:
|
|
155
|
+
ref: n,
|
|
139
156
|
className: m(
|
|
140
157
|
"aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
|
|
141
158
|
t
|
|
142
159
|
),
|
|
143
|
-
"data-hook":
|
|
160
|
+
"data-hook": a ?? "content-header-image",
|
|
144
161
|
"data-slot": "content-header-image",
|
|
145
162
|
...l,
|
|
146
|
-
children:
|
|
163
|
+
children: e
|
|
147
164
|
}
|
|
148
165
|
));
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
({ className: t, dataHook:
|
|
152
|
-
const c = [], f = [], y = [],
|
|
153
|
-
return r.Children.forEach(
|
|
154
|
-
r.isValidElement(
|
|
155
|
-
}), 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(
|
|
156
173
|
"div",
|
|
157
174
|
{
|
|
158
175
|
className: m("w-full", x),
|
|
159
176
|
"data-slot": "content-header-region",
|
|
160
|
-
children: /* @__PURE__ */
|
|
161
|
-
|
|
177
|
+
children: /* @__PURE__ */ o(
|
|
178
|
+
w,
|
|
162
179
|
{
|
|
163
|
-
ref:
|
|
180
|
+
ref: i,
|
|
164
181
|
className: m(
|
|
165
182
|
"mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",
|
|
166
183
|
t
|
|
167
184
|
),
|
|
168
185
|
"data-slot": "content-header",
|
|
169
|
-
dataHook:
|
|
186
|
+
dataHook: a,
|
|
170
187
|
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
171
|
-
trackingEl:
|
|
188
|
+
trackingEl: e,
|
|
172
189
|
trackingLabel: l,
|
|
173
190
|
...s,
|
|
174
|
-
children:
|
|
191
|
+
children: n
|
|
175
192
|
}
|
|
176
193
|
)
|
|
177
194
|
}
|
|
178
|
-
) : /* @__PURE__ */
|
|
195
|
+
) : /* @__PURE__ */ o(
|
|
179
196
|
"div",
|
|
180
197
|
{
|
|
181
198
|
className: m("w-full", x),
|
|
182
199
|
"data-slot": "content-header-region",
|
|
183
200
|
children: /* @__PURE__ */ u(
|
|
184
|
-
|
|
201
|
+
w,
|
|
185
202
|
{
|
|
186
|
-
ref:
|
|
203
|
+
ref: i,
|
|
187
204
|
className: m("mx-auto w-full items-start gap-4", t),
|
|
188
205
|
"data-slot": "content-header",
|
|
189
|
-
dataHook:
|
|
206
|
+
dataHook: a,
|
|
190
207
|
style: { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
191
|
-
trackingEl:
|
|
208
|
+
trackingEl: e,
|
|
192
209
|
trackingLabel: l,
|
|
193
210
|
...s,
|
|
194
211
|
children: [
|
|
@@ -201,8 +218,8 @@ const A = r.forwardRef(
|
|
|
201
218
|
"data-slot": "content-header-body",
|
|
202
219
|
children: [
|
|
203
220
|
y,
|
|
204
|
-
|
|
205
|
-
// With a slotted
|
|
221
|
+
p.length > 0 ? (
|
|
222
|
+
// With a slotted GlobalLayoutActions the header follows
|
|
206
223
|
// the Figma Page Header structure: a text block (title +
|
|
207
224
|
// description) with the actions beside it — and below it on
|
|
208
225
|
// mobile, so the action lands under the description.
|
|
@@ -219,16 +236,16 @@ const A = r.forwardRef(
|
|
|
219
236
|
"data-slot": "content-header-text",
|
|
220
237
|
children: [
|
|
221
238
|
h,
|
|
222
|
-
|
|
239
|
+
b
|
|
223
240
|
]
|
|
224
241
|
}
|
|
225
242
|
),
|
|
226
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ o(G.Provider, { value: !0, children: p })
|
|
227
244
|
]
|
|
228
245
|
}
|
|
229
246
|
)
|
|
230
|
-
) : /* @__PURE__ */ u(
|
|
231
|
-
/* @__PURE__ */
|
|
247
|
+
) : /* @__PURE__ */ u(H, { children: [
|
|
248
|
+
/* @__PURE__ */ o(
|
|
232
249
|
"div",
|
|
233
250
|
{
|
|
234
251
|
className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
|
|
@@ -236,7 +253,7 @@ const A = r.forwardRef(
|
|
|
236
253
|
children: h
|
|
237
254
|
}
|
|
238
255
|
),
|
|
239
|
-
|
|
256
|
+
b
|
|
240
257
|
] })
|
|
241
258
|
]
|
|
242
259
|
}
|
|
@@ -248,27 +265,27 @@ const A = r.forwardRef(
|
|
|
248
265
|
);
|
|
249
266
|
}
|
|
250
267
|
);
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
({ className: t, dataHook:
|
|
254
|
-
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(
|
|
255
272
|
"div",
|
|
256
273
|
{
|
|
257
|
-
ref:
|
|
274
|
+
ref: i,
|
|
258
275
|
className: m(
|
|
259
276
|
c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
|
|
260
277
|
t
|
|
261
278
|
),
|
|
262
|
-
"data-hook":
|
|
279
|
+
"data-hook": a,
|
|
263
280
|
"data-slot": "content-actions",
|
|
264
|
-
"data-tracking-el":
|
|
281
|
+
"data-tracking-el": e,
|
|
265
282
|
"data-tracking-label": l,
|
|
266
283
|
style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
|
|
267
284
|
...s,
|
|
268
|
-
children:
|
|
285
|
+
children: n
|
|
269
286
|
}
|
|
270
287
|
);
|
|
271
|
-
return c ? f : /* @__PURE__ */
|
|
288
|
+
return c ? f : /* @__PURE__ */ o(
|
|
272
289
|
"div",
|
|
273
290
|
{
|
|
274
291
|
className: m("w-full", x),
|
|
@@ -278,45 +295,45 @@ const N = r.createContext(!1), L = r.forwardRef(
|
|
|
278
295
|
);
|
|
279
296
|
}
|
|
280
297
|
);
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
({ 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(
|
|
284
301
|
"div",
|
|
285
302
|
{
|
|
286
303
|
className: m("flex w-full flex-1 flex-col", x),
|
|
287
304
|
"data-slot": "content-body-region",
|
|
288
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ o(
|
|
289
306
|
"div",
|
|
290
307
|
{
|
|
291
|
-
ref:
|
|
308
|
+
ref: i,
|
|
292
309
|
className: m("mx-auto flex w-full flex-1 flex-col gap-6", t),
|
|
293
|
-
"data-hook":
|
|
310
|
+
"data-hook": a,
|
|
294
311
|
"data-slot": "content-body",
|
|
295
|
-
"data-tracking-el":
|
|
312
|
+
"data-tracking-el": e,
|
|
296
313
|
"data-tracking-label": l,
|
|
297
314
|
style: { maxWidth: "var(--content-max-width)" },
|
|
298
315
|
...s,
|
|
299
|
-
children:
|
|
316
|
+
children: n
|
|
300
317
|
}
|
|
301
318
|
)
|
|
302
319
|
}
|
|
303
320
|
)
|
|
304
321
|
);
|
|
305
|
-
|
|
306
|
-
const V = r.forwardRef(
|
|
322
|
+
R.displayName = "GlobalLayoutBody";
|
|
323
|
+
const K = R, V = r.forwardRef(
|
|
307
324
|
({
|
|
308
325
|
className: t,
|
|
309
|
-
dataHook:
|
|
310
|
-
ariaLabel:
|
|
326
|
+
dataHook: a,
|
|
327
|
+
ariaLabel: e,
|
|
311
328
|
trackingEl: l,
|
|
312
|
-
trackingLabel:
|
|
329
|
+
trackingLabel: n,
|
|
313
330
|
children: s,
|
|
314
|
-
...
|
|
315
|
-
}, c) => /* @__PURE__ */
|
|
331
|
+
...i
|
|
332
|
+
}, c) => /* @__PURE__ */ o(
|
|
316
333
|
"div",
|
|
317
334
|
{
|
|
318
335
|
ref: c,
|
|
319
|
-
"aria-label":
|
|
336
|
+
"aria-label": e ?? "Mobile navigation",
|
|
320
337
|
className: m(
|
|
321
338
|
// The 2px negative margin pulls a slotted SidebarTrigger's box
|
|
322
339
|
// left by its icon inset so the burger glyph — not the invisible
|
|
@@ -324,26 +341,28 @@ const V = r.forwardRef(
|
|
|
324
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",
|
|
325
342
|
t
|
|
326
343
|
),
|
|
327
|
-
"data-hook":
|
|
344
|
+
"data-hook": a,
|
|
328
345
|
"data-slot": "mobile-header",
|
|
329
346
|
"data-tracking-el": l,
|
|
330
|
-
"data-tracking-label":
|
|
347
|
+
"data-tracking-label": n,
|
|
331
348
|
role: "toolbar",
|
|
332
|
-
...
|
|
349
|
+
...i,
|
|
333
350
|
children: s
|
|
334
351
|
}
|
|
335
352
|
)
|
|
336
353
|
);
|
|
337
354
|
V.displayName = "GlobalLayoutMobileHeader";
|
|
338
355
|
export {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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,
|
|
346
365
|
V as GlobalLayoutMobileHeader,
|
|
347
|
-
|
|
348
|
-
|
|
366
|
+
I as GlobalLayoutSidebar,
|
|
367
|
+
L as GlobalLayoutSubtitle
|
|
349
368
|
};
|
package/dist/grid.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react"),u=require("@brightlocal/ui-components/lib/utils"),f=require("./lib/optical-center.cjs");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const p=g(d),c=p.forwardRef(({className:e,children:r,dataHook:t,variant:a,trackingEl:i,trackingLabel:l,...o},s)=>n.jsx("div",{ref:s,className:u.cn("flex w-full flex-1 flex-col items-center",e),"data-hook":t,"data-slot":"grid","data-tracking-el":i??"grid","data-tracking-label":l,"data-variant":a,...o,children:n.jsx(f.OpticalCenter,{children:r})}));c.displayName="Grid";exports.Grid=c;
|
package/dist/grid.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The named layouts. Closed on purpose — a layout the vocabulary lacks is a
|
|
4
|
+
* signal to add a value here, not a className at the call site.
|
|
5
|
+
* (`stack`, `row`, `cards` are reserved for DS-970.)
|
|
6
|
+
*/
|
|
7
|
+
type GridVariant = "centered";
|
|
8
|
+
interface GridBaseProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
9
|
+
/**
|
|
10
|
+
* Required data-hook attribute for automated testing.
|
|
11
|
+
* @example "locations-empty-center"
|
|
12
|
+
*/
|
|
13
|
+
dataHook: string;
|
|
14
|
+
/**
|
|
15
|
+
* Tracking element identifier for analytics.
|
|
16
|
+
*/
|
|
17
|
+
trackingEl?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Tracking label for analytics context.
|
|
20
|
+
*/
|
|
21
|
+
trackingLabel?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* One message at the page body's optical centre (38/62). Give it a page body
|
|
25
|
+
* to fill — it stretches with `flex-1` — and one message to hold.
|
|
26
|
+
*/
|
|
27
|
+
interface GridCenteredProps extends GridBaseProps {
|
|
28
|
+
variant: "centered";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Props for the Grid primitive. `variant` discriminates the shapes; each
|
|
32
|
+
* variant carries only the modifiers it actually has.
|
|
33
|
+
*/
|
|
34
|
+
export type GridProps = GridCenteredProps;
|
|
35
|
+
/**
|
|
36
|
+
* The layout primitive: a closed vocabulary of named layouts instead of
|
|
37
|
+
* hand-rolled flex/grid classNames.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <GlobalLayoutBody dataHook="locations-body">
|
|
42
|
+
* <Grid dataHook="locations-empty-center" variant="centered">
|
|
43
|
+
* <EmptyState
|
|
44
|
+
* dataHook="locations-empty"
|
|
45
|
+
* illustration={<BusinessLocation aria-hidden />}
|
|
46
|
+
* size="lg"
|
|
47
|
+
* title={t("locations.empty.title")}
|
|
48
|
+
* />
|
|
49
|
+
* </Grid>
|
|
50
|
+
* </GlobalLayoutBody>
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare const Grid: React.ForwardRefExoticComponent<GridCenteredProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
export { Grid };
|
|
55
|
+
export type { GridVariant };
|
|
56
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwC/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;;;GAGG;AACH,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,IAAI,0FA4BT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
package/dist/grid.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { OpticalCenter as n } from "./lib/optical-center.js";
|
|
5
|
+
const s = c.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
className: r,
|
|
8
|
+
children: t,
|
|
9
|
+
dataHook: e,
|
|
10
|
+
variant: i,
|
|
11
|
+
trackingEl: o,
|
|
12
|
+
trackingLabel: l,
|
|
13
|
+
...d
|
|
14
|
+
}, m) => /* @__PURE__ */ a(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
ref: m,
|
|
18
|
+
className: f("flex w-full flex-1 flex-col items-center", r),
|
|
19
|
+
"data-hook": e,
|
|
20
|
+
"data-slot": "grid",
|
|
21
|
+
"data-tracking-el": o ?? "grid",
|
|
22
|
+
"data-tracking-label": l,
|
|
23
|
+
"data-variant": i,
|
|
24
|
+
...d,
|
|
25
|
+
children: /* @__PURE__ */ a(n, { children: t })
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
s.displayName = "Grid";
|
|
30
|
+
export {
|
|
31
|
+
s as Grid
|
|
32
|
+
};
|
package/dist/header.d.ts
CHANGED
|
@@ -18,6 +18,19 @@ import * as React from "react";
|
|
|
18
18
|
* <Logo dataHook="header-logo" />
|
|
19
19
|
* <NavigationMenu dataHook="header-nav" />
|
|
20
20
|
* </Header>
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // With the page title. The title is a TypographyHeading on the semantic
|
|
24
|
+
* // type scale (DS-714): text-heading-page — Poppins · Figma 600 · 24/32,
|
|
25
|
+
* // rendering one CSS weight lighter per the DS-305 offset. Never
|
|
26
|
+
* // hand-style it. `variant="page"` is level 1's default, written out so
|
|
27
|
+
* // the scale role is explicit. Exactly one page title per screen — a
|
|
28
|
+
* // second title is a section (`variant="section"`).
|
|
29
|
+
* <Header dataHook="page-header">
|
|
30
|
+
* <TypographyHeading level={1} variant="page" dataHook="page-title">
|
|
31
|
+
* All Locations
|
|
32
|
+
* </TypographyHeading>
|
|
33
|
+
* </Header>
|
|
21
34
|
*/
|
|
22
35
|
interface HeaderProps extends React.ComponentProps<"header"> {
|
|
23
36
|
/**
|
package/dist/header.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/components/header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;IAC1D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,QAAA,MAAM,MAAM,8FA2BX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),u=150;function a(e,t=u){const[n,s]=r.useState(!1);return r.useEffect(()=>{if(!e)return;const o=setTimeout(()=>s(!0),t);return()=>{clearTimeout(o),s(!1)}},[e,t]),e&&n}exports.FLASH_THRESHOLD_MS=u;exports.useDelayedPending=a;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The flash threshold — the delay before a pending state becomes visible.
|
|
3
|
+
* Below it an indicator registers as a flicker rather than as information.
|
|
4
|
+
* One shared constant so every surface flickers (or rather, doesn't) the
|
|
5
|
+
* same way. See the Loading pattern, "Timing".
|
|
6
|
+
*
|
|
7
|
+
* This is the JS mirror of the `--ds-motion-flash-threshold` motion token
|
|
8
|
+
* (the `flash-delay` CSS utility), which drives CSS-only appearance delays
|
|
9
|
+
* such as ComboboxLoading's — when one changes, change the other.
|
|
10
|
+
*/
|
|
11
|
+
export declare const FLASH_THRESHOLD_MS = 150;
|
|
12
|
+
/**
|
|
13
|
+
* Delays entering a visible pending state by the flash threshold, and leaves
|
|
14
|
+
* it immediately.
|
|
15
|
+
*
|
|
16
|
+
* The two rules are deliberately asymmetric ("delay, don't hold" — see the
|
|
17
|
+
* Loading pattern):
|
|
18
|
+
* - On the way in, the returned flag turns on only after `delay` ms, so a
|
|
19
|
+
* wait that resolves inside the flash zone never shows an indicator at all.
|
|
20
|
+
* - On the way out, the flag turns off the moment `pending` does — there is
|
|
21
|
+
* no timer on the exit path, so a minimum display time is impossible by
|
|
22
|
+
* construction. Never re-add one: flicker is fixed by this entry delay,
|
|
23
|
+
* not by holding skeletons over content the user could already be reading.
|
|
24
|
+
*
|
|
25
|
+
* The flag gates only what is rendered. It must never gate the request or
|
|
26
|
+
* the content swap — data renders the moment it lands.
|
|
27
|
+
*
|
|
28
|
+
* @param pending - The raw pending state (e.g. a query's `isFetching`).
|
|
29
|
+
* @param delay - Delay before the pending state shows, in milliseconds
|
|
30
|
+
* (default `FLASH_THRESHOLD_MS`).
|
|
31
|
+
* @returns Whether the pending indicator should be visible.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDelayedPending(pending: boolean, delay?: number): boolean;
|
|
34
|
+
//# sourceMappingURL=use-delayed-pending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-delayed-pending.d.ts","sourceRoot":"","sources":["../../src/hooks/use-delayed-pending.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,KAAK,GAAE,MAA2B,GACjC,OAAO,CAqBT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useState as o, useEffect as f } from "react";
|
|
2
|
+
const a = 150;
|
|
3
|
+
function n(e, t = a) {
|
|
4
|
+
const [s, r] = o(!1);
|
|
5
|
+
return f(() => {
|
|
6
|
+
if (!e)
|
|
7
|
+
return;
|
|
8
|
+
const u = setTimeout(() => r(!0), t);
|
|
9
|
+
return () => {
|
|
10
|
+
clearTimeout(u), r(!1);
|
|
11
|
+
};
|
|
12
|
+
}, [e, t]), e && s;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
a as FLASH_THRESHOLD_MS,
|
|
16
|
+
n as useDelayedPending
|
|
17
|
+
};
|
|
@@ -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;
|