@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/src/index.ts
CHANGED
|
@@ -8,11 +8,15 @@ export * from "./components/badge";
|
|
|
8
8
|
export * from "./components/brand-illustration-motif";
|
|
9
9
|
export * from "./components/breadcrumb";
|
|
10
10
|
export * from "./components/button";
|
|
11
|
+
export * from "./components/button-group";
|
|
11
12
|
export * from "./components/calendar";
|
|
12
13
|
export * from "./components/callout";
|
|
13
14
|
export * from "./components/card";
|
|
14
15
|
export * from "./components/carousel";
|
|
15
16
|
export * from "./components/chart";
|
|
17
|
+
// Also re-exported through ./components/chart, which is the documented path;
|
|
18
|
+
// both resolve to the same binding, so the duplicate star export is not ambiguous.
|
|
19
|
+
export * from "./components/chart-empty";
|
|
16
20
|
export * from "./components/centred-layout";
|
|
17
21
|
export * from "./components/checkbox";
|
|
18
22
|
export * from "./components/chip";
|
|
@@ -28,6 +32,7 @@ export * from "./components/drawer";
|
|
|
28
32
|
export * from "./components/dropdown-menu";
|
|
29
33
|
export * from "./components/field";
|
|
30
34
|
export * from "./components/global-layout";
|
|
35
|
+
export * from "./components/grid";
|
|
31
36
|
export * from "./components/header";
|
|
32
37
|
export * from "./components/height-transition";
|
|
33
38
|
export * from "./components/hover-card";
|
|
@@ -41,6 +46,7 @@ export * from "./components/list";
|
|
|
41
46
|
export * from "./components/loading";
|
|
42
47
|
export * from "./components/logo";
|
|
43
48
|
export * from "./components/map";
|
|
49
|
+
export * from "./components/media-empty";
|
|
44
50
|
export * from "./components/menubar";
|
|
45
51
|
export * from "./components/navigation-menu";
|
|
46
52
|
export * from "./components/pagination";
|
|
@@ -70,14 +76,18 @@ export * from "./components/toggle";
|
|
|
70
76
|
export * from "./components/toggle-group";
|
|
71
77
|
export * from "./components/tooltip";
|
|
72
78
|
export * from "./components/typography";
|
|
79
|
+
export * from "./components/typography-heading";
|
|
80
|
+
export * from "./components/typography-text";
|
|
73
81
|
|
|
74
82
|
// Blocks
|
|
75
|
-
export * from "./blocks/
|
|
83
|
+
export * from "./blocks/empty-state";
|
|
84
|
+
export * from "./blocks/progress-state";
|
|
76
85
|
export * from "./blocks/input-list";
|
|
77
86
|
export * from "./blocks/sidebar";
|
|
78
87
|
|
|
79
88
|
// Hooks
|
|
80
89
|
export * from "./hooks/use-debounce";
|
|
90
|
+
export * from "./hooks/use-delayed-pending";
|
|
81
91
|
export * from "./hooks/use-breakpoint";
|
|
82
92
|
export * from "./hooks/use-mobile";
|
|
83
93
|
export * from "./hooks/use-overlay-pointer-lock";
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* BlockIllustration (internal)
|
|
5
|
+
*
|
|
6
|
+
* The illustration slot shared by the blocks that draw one — ProgressState,
|
|
7
|
+
* and EmptyState at page scope. Both had the same problem and the same fix, so
|
|
8
|
+
* it lives once.
|
|
9
|
+
*
|
|
10
|
+
* The block owns the size, not the caller. Left to the consumer it was a number
|
|
11
|
+
* to get wrong on every call site, and forgetting it was as bad as mistyping
|
|
12
|
+
* it: the illustrations default to 250, so an unsized one arrives nearly twice
|
|
13
|
+
* the intended height and buries the title under it.
|
|
14
|
+
*
|
|
15
|
+
* The size is applied twice on purpose. As the element's own `size` prop,
|
|
16
|
+
* because clamping it only in the stylesheet means the artwork paints at 250
|
|
17
|
+
* and snaps down the moment the CSS lands — one visible jump on every mount.
|
|
18
|
+
* And as the wrapper's inline width/height, which is the whole mechanism for
|
|
19
|
+
* children that cannot take the prop.
|
|
20
|
+
*
|
|
21
|
+
* The box is square but the artwork is NOT stretched into it. The child keeps
|
|
22
|
+
* its own width — capped by the box — and takes its height from that, which is
|
|
23
|
+
* why `h-auto` is set and `w-auto` deliberately is not: an `<img>`'s `width`
|
|
24
|
+
* attribute is only a presentational hint, so a `w-auto` class beats it and
|
|
25
|
+
* collapses the element to nothing until the source has loaded. Most of the
|
|
26
|
+
* library's illustrations are square SVGs with a `size` prop, but a couple are
|
|
27
|
+
* `<img>`s with their own width and height (`GlobeyFixingFault` is 164×137),
|
|
28
|
+
* and forcing `size-full` on one of those squashed it. The child is capped by
|
|
29
|
+
* the box and keeps its own ratio instead, centred in whatever room is left, so
|
|
30
|
+
* the column's rhythm stays predictable whichever kind of artwork arrives.
|
|
31
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The size the design specifies for a page-scope illustration, shared by every
|
|
35
|
+
* block that draws one — `ProgressState` and `EmptyState` at page scope — so the
|
|
36
|
+
* artwork never resizes as one of those screens becomes the other.
|
|
37
|
+
*
|
|
38
|
+
* The artwork is the title's companion, not the subject of the screen: much
|
|
39
|
+
* larger and it outweighs the 24px heading under it, and the eye lands on the
|
|
40
|
+
* drawing instead of the words that say what to do next.
|
|
41
|
+
*/
|
|
42
|
+
const BLOCK_ILLUSTRATION_SIZE = 130;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Props for the internal BlockIllustration wrapper.
|
|
46
|
+
*/
|
|
47
|
+
interface BlockIllustrationProps {
|
|
48
|
+
/** The illustration element, exactly as the consumer passed it. */
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
/** Rendered width and height in pixels. */
|
|
51
|
+
size: number;
|
|
52
|
+
/** The owning block's slot name, e.g. `"empty-screen-illustration"`. */
|
|
53
|
+
slot: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Renders a consumer-supplied illustration at the block's own size.
|
|
58
|
+
*/
|
|
59
|
+
function BlockIllustration({ children, size, slot }: BlockIllustrationProps) {
|
|
60
|
+
/* Override whatever the caller set — including nothing, which is the
|
|
61
|
+
illustration's own 250. Merging leaves their other props (aria-hidden,
|
|
62
|
+
className) intact.
|
|
63
|
+
|
|
64
|
+
Only a plain function component gets the prop, and that is deliberately
|
|
65
|
+
narrow: those are the 109 SVG illustrations that declare `size`. A
|
|
66
|
+
`forwardRef` illustration (the two `<img>` ones) has an object type and so
|
|
67
|
+
falls through, which is what we want — `size` is not in its API and would
|
|
68
|
+
land on the `<img>` as an invalid attribute. A host element or a fragment
|
|
69
|
+
falls through for the same reason. Those are handled by the box below. */
|
|
70
|
+
const sized =
|
|
71
|
+
React.isValidElement(children) && typeof children.type === "function"
|
|
72
|
+
? React.cloneElement(children as React.ReactElement<{ size?: number }>, {
|
|
73
|
+
size,
|
|
74
|
+
})
|
|
75
|
+
: children;
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
className="flex shrink-0 items-center justify-center [&>*]:h-auto [&>*]:max-h-full [&>*]:max-w-full"
|
|
80
|
+
data-slot={slot}
|
|
81
|
+
style={{ width: size, height: size }}
|
|
82
|
+
>
|
|
83
|
+
{sized}
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { BlockIllustration, BLOCK_ILLUSTRATION_SIZE };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
4
|
+
import { TypographyText } from "../components/typography-text";
|
|
5
|
+
|
|
6
|
+
/* -------------------------------------------------------------------------------------------------
|
|
7
|
+
* EmptyCanvas (internal)
|
|
8
|
+
*
|
|
9
|
+
* The shared body of the canvas-empty family — `ChartEmpty`, `MapEmpty` and
|
|
10
|
+
* `MediaEmpty`. A muted surface filling the box the consumer reserved, one bare
|
|
11
|
+
* glyph, one quiet line. No title, no CTA, and no circle chip, because a circle
|
|
12
|
+
* on a flat surface reads as a button.
|
|
13
|
+
*
|
|
14
|
+
* It is deliberately NOT `EmptyState` with most of its parts switched off. A
|
|
15
|
+
* canvas shares only the muted vocabulary with the standard block, not its
|
|
16
|
+
* anatomy — and `EmptyState` is a block that composes typography and actions,
|
|
17
|
+
* while these three are primitives. Borrowing the block here would point a
|
|
18
|
+
* primitive at a block and invert the layering.
|
|
19
|
+
*
|
|
20
|
+
* Internal, so it lives in `lib/` rather than `components/`: the package's
|
|
21
|
+
* `"./*"` export maps every file in `components/` to a public entry point, and
|
|
22
|
+
* this is not one.
|
|
23
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The glyph is one size, everywhere: 32.
|
|
27
|
+
*
|
|
28
|
+
* It does not scale with the box, and there is no size step either. A canvas
|
|
29
|
+
* empty is one treatment, so it reads the same on a metric card's plot, a map
|
|
30
|
+
* well and a photo slot — and every box these land in is a real content box,
|
|
31
|
+
* where 32 is right. A step existed briefly for a 1200px mockup-filler frame
|
|
32
|
+
* that no longer exists; three variants of one treatment were noise.
|
|
33
|
+
*/
|
|
34
|
+
const CANVAS_ICON_SIZE = 32;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Props for the internal EmptyCanvas body.
|
|
38
|
+
*/
|
|
39
|
+
interface EmptyCanvasProps extends Omit<
|
|
40
|
+
React.ComponentPropsWithoutRef<"div">,
|
|
41
|
+
"children" | "title"
|
|
42
|
+
> {
|
|
43
|
+
/** Required data-hook; the parts derive `-icon` and `-message` from it. */
|
|
44
|
+
dataHook: string;
|
|
45
|
+
/**
|
|
46
|
+
* The decorative glyph. This component owns its size — whatever the element
|
|
47
|
+
* carries is overridden — so no call site has a number to get wrong.
|
|
48
|
+
*/
|
|
49
|
+
icon: React.ReactNode;
|
|
50
|
+
/** The one line under the glyph. */
|
|
51
|
+
message: string;
|
|
52
|
+
/** The calling component's slot name, e.g. `"chart-empty"`. */
|
|
53
|
+
slot: string;
|
|
54
|
+
/** Tracking element identifier for analytics. */
|
|
55
|
+
trackingEl?: string;
|
|
56
|
+
/** Tracking label for analytics context. */
|
|
57
|
+
trackingLabel?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Renders the muted canvas surface with its glyph and line.
|
|
62
|
+
*/
|
|
63
|
+
const EmptyCanvas = React.forwardRef<HTMLDivElement, EmptyCanvasProps>(
|
|
64
|
+
(
|
|
65
|
+
{
|
|
66
|
+
className,
|
|
67
|
+
dataHook,
|
|
68
|
+
icon,
|
|
69
|
+
message,
|
|
70
|
+
slot,
|
|
71
|
+
trackingEl,
|
|
72
|
+
trackingLabel,
|
|
73
|
+
...props
|
|
74
|
+
},
|
|
75
|
+
ref
|
|
76
|
+
) => {
|
|
77
|
+
/* Override whatever size the element carries, including none. Only
|
|
78
|
+
component elements get the prop — DS icons (forwardRef) and any icon
|
|
79
|
+
component take `size` — while a host element (`<svg>`, `<img>`) or a
|
|
80
|
+
fragment would receive it as an invalid attribute, so those fall
|
|
81
|
+
through; the span's CSS below sizes a raw svg instead. */
|
|
82
|
+
const sized =
|
|
83
|
+
React.isValidElement(icon) &&
|
|
84
|
+
typeof icon.type !== "string" &&
|
|
85
|
+
icon.type !== React.Fragment
|
|
86
|
+
? React.cloneElement(icon as React.ReactElement<{ size?: number }>, {
|
|
87
|
+
size: CANVAS_ICON_SIZE,
|
|
88
|
+
})
|
|
89
|
+
: icon;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div
|
|
93
|
+
ref={ref}
|
|
94
|
+
className={cn(
|
|
95
|
+
"bg-muted flex flex-col items-center justify-center gap-2 text-center",
|
|
96
|
+
className
|
|
97
|
+
)}
|
|
98
|
+
data-hook={dataHook}
|
|
99
|
+
data-slot={slot}
|
|
100
|
+
data-tracking-el={trackingEl ?? slot}
|
|
101
|
+
data-tracking-label={trackingLabel}
|
|
102
|
+
{...props}
|
|
103
|
+
>
|
|
104
|
+
<span
|
|
105
|
+
aria-hidden="true"
|
|
106
|
+
className="text-muted-foreground flex items-center justify-center [&_svg:not([class*='size-'])]:size-8"
|
|
107
|
+
data-hook={`${dataHook}-icon`}
|
|
108
|
+
data-slot={`${slot}-icon`}
|
|
109
|
+
>
|
|
110
|
+
{sized}
|
|
111
|
+
</span>
|
|
112
|
+
<TypographyText
|
|
113
|
+
align="center"
|
|
114
|
+
color="muted"
|
|
115
|
+
data-slot={`${slot}-message`}
|
|
116
|
+
dataHook={`${dataHook}-message`}
|
|
117
|
+
variant="body-sm"
|
|
118
|
+
>
|
|
119
|
+
{message}
|
|
120
|
+
</TypographyText>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
EmptyCanvas.displayName = "EmptyCanvas";
|
|
127
|
+
|
|
128
|
+
export { EmptyCanvas };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* Empty chip (internal)
|
|
5
|
+
*
|
|
6
|
+
* The icon chip every "nothing here" moment shares — EmptyState at card
|
|
7
|
+
* scope, and CommandEmpty / ComboboxEmpty at popover scope. 40px of
|
|
8
|
+
* `bg-muted` around a 16px glyph. It lives once so the two cannot drift: the
|
|
9
|
+
* popover form used to be hand-rolled in consumer code with these classes
|
|
10
|
+
* copied in.
|
|
11
|
+
*
|
|
12
|
+
* A canvas drops the chip — but a canvas is a different component, so there
|
|
13
|
+
* is no variant for that here.
|
|
14
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
15
|
+
|
|
16
|
+
export const emptyChipStyles = cva(
|
|
17
|
+
"bg-muted text-muted-foreground flex size-10 items-center justify-center rounded-full",
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
align: { center: "", left: "shrink-0" },
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: { align: "center" },
|
|
23
|
+
}
|
|
24
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
/* -------------------------------------------------------------------------------------------------
|
|
4
|
+
* OpticalCenter (internal)
|
|
5
|
+
*
|
|
6
|
+
* The one agreement every single-message screen shares: where "centred in the
|
|
7
|
+
* page body" actually is. Rendered as a fragment of two flexible spacers, so
|
|
8
|
+
* the OWNER of the element supplies the box (`flex flex-1 flex-col`) and this
|
|
9
|
+
* helper supplies only the ratio.
|
|
10
|
+
*
|
|
11
|
+
* Centred on the viewport, not on the container — hence 38/62 rather than
|
|
12
|
+
* 50/50. A block fills the page BODY, but the reader centres the whole window,
|
|
13
|
+
* and the page header above the body biases that by about half its height:
|
|
14
|
+
* centred in the body, the block's centre lands 22–45px below the window's
|
|
15
|
+
* across every realistic viewport (720–1080). Sitting 38% down cancels most of
|
|
16
|
+
* it — the offset falls to single digits at the 800–900px heights most people
|
|
17
|
+
* are on. Both spacers are flexible, so in a container with no room to spare
|
|
18
|
+
* they collapse together and the content simply centres rather than
|
|
19
|
+
* overflowing.
|
|
20
|
+
*
|
|
21
|
+
* Internal on purpose: everyone — consumers and the DS's own blocks alike —
|
|
22
|
+
* reaches this through `Grid variant="centered"`. The number must never be
|
|
23
|
+
* re-typed at a call site — that is the whole reason this file exists.
|
|
24
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
25
|
+
|
|
26
|
+
interface OpticalCenterProps {
|
|
27
|
+
/** The content to hold at the optical centre. */
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Two flexible spacers in a 38/62 ratio around the children. The parent must
|
|
33
|
+
* be a `flex flex-1 flex-col` box for the ratio to have room to work.
|
|
34
|
+
*/
|
|
35
|
+
function OpticalCenter({ children }: OpticalCenterProps) {
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<div aria-hidden="true" className="flex-1" />
|
|
39
|
+
{children}
|
|
40
|
+
<div aria-hidden="true" className="flex-[1.6]" />
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { OpticalCenter };
|
package/src/lib/utils.ts
CHANGED
|
@@ -4,11 +4,37 @@ import { extendTailwindMerge } from "tailwind-merge";
|
|
|
4
4
|
// The motion scale adds named duration/ease utilities (tailwind-preset.css)
|
|
5
5
|
// that stock twMerge does not recognize — without registering them, a
|
|
6
6
|
// consumer's `duration-300` would not replace a baked-in `duration-fast`.
|
|
7
|
+
// The semantic type scale (DS-714) must register as font-size classes:
|
|
8
|
+
// unknown `text-*` values are otherwise treated as text colours, so
|
|
9
|
+
// `cn("text-body", "text-foreground")` would drop the scale utility.
|
|
7
10
|
const twMerge = extendTailwindMerge({
|
|
8
11
|
extend: {
|
|
9
12
|
classGroups: {
|
|
10
13
|
duration: [{ duration: ["fast", "base", "slow"] }],
|
|
11
14
|
ease: [{ ease: ["emphasized", "overshoot"] }],
|
|
15
|
+
// text-emphasis sets font-weight only, so it belongs to the font-weight
|
|
16
|
+
// group (conflicts with font-bold etc.), NOT font-size — and unregistered
|
|
17
|
+
// it would be treated as a text colour and clobber color utilities.
|
|
18
|
+
"font-weight": [{ text: ["emphasis"] }],
|
|
19
|
+
"font-size": [
|
|
20
|
+
{
|
|
21
|
+
text: [
|
|
22
|
+
"display",
|
|
23
|
+
"heading-page",
|
|
24
|
+
"heading-section",
|
|
25
|
+
"heading-subsection",
|
|
26
|
+
"heading-compact",
|
|
27
|
+
"body",
|
|
28
|
+
"body-sm",
|
|
29
|
+
"body-xs",
|
|
30
|
+
"label",
|
|
31
|
+
"label-sm",
|
|
32
|
+
"metric",
|
|
33
|
+
"code",
|
|
34
|
+
"code-inline",
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
12
38
|
},
|
|
13
39
|
},
|
|
14
40
|
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),w=require("react"),M=require("@brightlocal/ui-components/lib/utils"),v=require("../progress.cjs"),o=require("../typography.cjs");function y(s){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(C,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return C.default=s,Object.freeze(C)}const Z=y(w),L="820 / 372",l={position:"absolute",inset:"-10%",width:"120%",height:"120%"};function b(){return e.jsxs("div",{className:"animate-cel-store-knock absolute",style:{left:"7.073cqw",top:"25.244cqw",width:"12.561cqw",height:"12.561cqw",transformOrigin:"50% 92%"},children:[e.jsxs("svg",{fill:"none",style:l,viewBox:"0 0 600 600",children:[e.jsx("path",{className:"fill-background",d:"M133.799 109.677C133.799 109.677 172.946 105.308 236.317 118.307C216.376 135.415 200.955 159.833 193.969 187.517C186.81 215.634 184.539 245.611 153.567 259.323C130.728 269.943 102.395 260.859 91.2779 240.723C77.8683 217.494 86.0438 188.101 94.9115 163.769C102.849 143.201 116.648 124.211 133.821 109.677"}),e.jsx("path",{className:"fill-background",d:"M336.847 126.765C336.847 126.765 375.41 122.396 438.543 135.33C419.38 152.438 404.954 176.835 398.985 204.476C392.842 232.549 391.61 262.505 361.417 276.217C339.183 286.836 310.85 277.774 299.17 257.681C285.112 234.496 292.228 205.146 300.187 180.836C307.346 160.289 320.344 141.299 336.847 126.787"}),e.jsx("path",{className:"fill-background",d:"M141.5 349.492L252.972 358.338C252.972 358.338 253.037 358.381 253.037 358.403L240.6 463.798C240.6 463.798 240.557 463.863 240.536 463.841L127.16 455.082C127.16 455.082 127.095 455.038 127.095 455.017L141.5 349.492Z"}),e.jsx("path",{d:"M583.82 202.591C579.148 176.399 575.212 151.44 553.065 140.69C529.922 135.435 500.94 131.196 477.625 130.157C458.073 128.881 444.512 132.428 426.561 127.389C394.529 120.143 362.173 122.977 331.742 120.165C302.025 114.931 269.496 110.259 240.946 113.504C209.045 107.058 176.126 102.992 145.501 104.247C132.372 104.701 128.371 115.039 144.657 114.693C169.638 114.347 196.241 116.942 222.195 121.549C173.574 169.802 193.602 209.014 167.259 242.927C141.348 272.126 89.7428 256.337 89.8077 215.87C89.1805 185.201 103.282 150.293 122.661 128.362C125.3 123.928 134.795 118.067 133.562 112.509C133.778 103.187 125.776 108.378 121.515 113.179C89.094 145.903 54.9861 221.624 99.6702 258.716C88.51 329.268 77.393 412.428 66.0382 488.279C64.0916 495.698 64.7188 505.387 73.5864 507.701C219.945 520.721 381.552 533.763 516.642 544.642C531.415 543.907 552.308 551.996 560.267 542.696C569.956 547.065 566.15 518.753 568.01 511.638C570.994 420.453 593.964 295.419 583.798 202.569L583.82 202.591ZM451.844 140.452C476.846 140.085 503.73 142.94 529.619 147.611C499.102 176.593 499.34 221.926 486.082 258.932C472.456 289.688 425.263 291.807 409.107 262.35C388.041 221.213 417.606 163.66 442.652 139.22C445.42 140.279 449.227 140.323 451.844 140.431V140.452ZM351.597 131.736C375.496 131.606 401.731 134.418 426.582 138.938C395.394 168.05 394.94 212.972 380.99 250.108C368.597 276.646 330.531 283.437 310.092 262.631C287.75 239.272 297.786 203.283 307.691 176.593C307.778 176.528 307.843 176.399 307.799 176.355C315.24 158.469 326.465 143.243 340.199 130.849C344.265 131.844 347.725 131.78 351.597 131.758V131.736ZM256.908 123.171C277.823 123.539 302.198 126.308 324.194 130.287C292.53 159.161 291.081 204.148 276.59 241.305C262.337 271.715 214.538 275.608 198.36 245.328C180.56 210.917 211.921 145.384 239.908 122.674C246.094 123.431 250.528 122.912 256.908 123.15V123.171ZM309.313 385.22C309.465 380.267 311.174 372.805 310.027 367.55C342.751 372.827 368.748 372.589 405.797 376.309C401.991 418.009 397.319 469.397 392.647 520.397C359.859 517.953 327.827 515.531 295.428 513.108C302.003 452.333 307.389 402.912 309.313 385.198V385.22ZM421.694 525.631C415.898 525.155 409.928 524.636 403.894 524.139C407.484 484.948 411.161 444.59 414.622 405.832C413.411 395.212 423.576 370.015 412.005 365.517C382.482 362.835 349.045 360.802 320.928 358.877C316.364 358.639 307.864 358.293 306.221 363.051C300.424 359.958 299.927 368.285 299.321 373.065C294.368 419.869 289.978 458.41 283.9 514.082C215.793 508.372 144.16 502.402 76.8091 496.779C85.1792 425.146 104.126 311.597 109.338 264.404C135.703 277.187 169.768 265.118 183.675 239.705C196.825 288.152 267.852 289.904 287.62 244.874C299.516 296.22 372.793 300.524 392.82 252.033C400.953 294.057 458.527 309.845 487.012 277.619C481.864 344.343 469.947 481.899 467.438 529.524C453.293 528.313 437.959 527.015 421.651 525.631H421.694ZM575.104 265.832C572.011 351.48 556.806 461.914 556.201 538.046C530.831 533.59 505.309 533.374 478.014 530.411C484.178 445.952 495.23 344.451 498.367 259.711C510.543 220.196 510.846 176.788 545.17 148.26C579.559 165.758 573.828 230.188 575.104 265.832Z",fill:"currentColor"}),e.jsx("path",{d:"M254.831 352.994C231.451 350.593 204.178 349.187 181.836 347.414C169.767 348.084 147.209 341.098 141.477 349.966C132.826 346.549 134.945 362.424 133.194 368.22C129.755 393.677 125.472 424.562 121.752 451.684C119.416 460.076 126.381 461.373 133.323 461.33C148.939 462.563 164.122 463.752 180.019 464.985C199.355 466.478 219.382 468.056 239.475 469.614C244.277 470.306 246.721 466.11 246.634 461.828C249.727 435.679 252.841 408.99 255.869 383.036C255.112 374.536 263.288 357.73 254.788 352.994H254.831ZM235.495 457.761C199.506 455.036 163.776 452.333 133.367 450.04C139.401 399.019 144.289 383.468 145.068 354.4C179.694 359.98 207.249 359.72 246.569 363.657C243.217 392.249 239.345 425.124 235.517 457.761H235.495Z",fill:"currentColor"}),e.jsx("path",{d:"M320.02 427.005C333.408 428.887 363.341 427.848 370.435 429.362C376.967 429.708 383.499 430.422 386.484 424.02C394.032 425.166 393.232 404.317 394.94 398.369C397.947 377.216 369.484 385.652 355.706 383.229C346.796 382.926 337.495 382.58 328.498 382.278C328.498 382.364 328.39 381.564 328.412 381.91C318.7 383.056 317.057 390.302 316.689 398.78C316.884 407.842 309.984 421.576 320.041 427.005H320.02ZM328.822 401.765C329.06 399.364 329.32 396.963 329.558 394.541C349.261 394.908 366.629 395.276 383.758 395.557C384.299 403.149 382.937 411.13 384.018 417.597C367.472 414.482 346.298 415.455 327.46 415.196C327.871 410.849 328.39 406.307 328.844 401.765H328.822Z",fill:"currentColor"})]}),e.jsxs("svg",{className:"animate-cel-marks opacity-0",fill:"none",style:l,viewBox:"0 0 600 600",children:[e.jsx("path",{d:"M15.0161 130.482C13.5022 127.259 13.805 128.513 15.1027 125.183C17.0276 119.819 24.2082 122.349 28.2743 122.695C32.6648 125.68 78.8413 129.4 66.1239 138.96C56.9534 142.356 51.6978 141.512 39.4561 139.566C29.0097 137.403 26.2629 136.689 19.6879 135.283C16.0543 135.218 16.8546 132.623 14.9945 130.503L15.0161 130.482Z",fill:"currentColor"}),e.jsx("path",{d:"M37.185 67.263C43.5869 61.3152 47.9991 63.6078 53.8388 68.3877C63.3552 77.9907 80.5714 88.0478 84.5077 99.6839C81.0039 109.244 64.2636 94.1686 56.7586 89.0644C49.3184 81.2133 33.7893 75.1574 37.185 67.2414V67.263Z",fill:"currentColor"}),e.jsx("path",{d:"M90.3906 22.6425C94.6298 21.1934 92.813 21.972 96.4249 22.1667C101.421 21.4313 102.913 27.3359 105.184 30.5368C108.342 40.1398 122.141 58.2427 120.454 68.6459C113.295 76.4321 103.368 57.5722 98.7824 49.786C95.2137 40.0533 83.9021 28.4173 90.4339 22.6425H90.3906Z",fill:"currentColor"})]})]})}function N(){return e.jsx("svg",{className:"animate-cel-sheet absolute",fill:"none",style:{left:0,top:0,width:"10.2cqw",height:"6.3cqw",transform:"translate(12.4cqw, 21.35cqw) rotate(-4deg) scale(1.2)"},viewBox:"54 202 412 280",children:e.jsx("path",{className:"fill-background stroke-current",d:"M100 246C176 212 302 254 456 288C442 346 426 410 408 472C312 452 192 418 64 398C82 344 92 296 100 246Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"10"})})}function k(){return e.jsxs("svg",{className:"animate-cel-plane absolute opacity-0",fill:"none",style:{left:0,top:0,width:"13.7cqw",height:"13.7cqw",transformOrigin:"55.7% 30%"},viewBox:"0 0 600 600",children:[e.jsx("path",{className:"fill-background",d:"M531.501 42.7422C467.581 132.522 426.061 231.502 360.921 320.742C336.861 303.082 312.581 285.702 288.121 268.602L288.641 267.862C271.361 282.102 255.081 297.542 239.941 314.042L240.041 316.242C230.421 282.262 222.641 247.762 216.761 212.962C190.601 191.422 164.101 170.402 137.221 149.962C264.901 109.182 396.581 73.3822 531.501 42.7422Z"}),e.jsx("path",{d:"M534.539 46.4182C533.779 44.6582 534.019 44.4182 533.559 43.8382C539.299 31.3982 470.979 54.2182 458.259 55.6382C359.699 81.5982 234.119 111.178 140.119 149.058C125.399 151.618 169.639 179.258 174.899 185.118C195.999 200.198 200.999 209.698 215.619 215.018C214.719 229.938 229.919 291.118 233.779 305.618C235.219 308.998 235.919 315.378 240.139 315.918C242.539 317.038 245.439 318.378 246.819 315.218C258.919 305.838 277.139 287.458 289.679 275.598C307.899 288.338 333.519 306.638 348.699 317.698C353.339 320.878 358.499 324.418 363.199 321.318C367.939 325.538 373.919 313.378 377.159 310.178C404.139 272.818 426.339 234.038 451.679 189.698C477.859 143.338 501.859 100.938 528.759 61.3782C530.819 57.3382 537.279 50.8782 534.499 46.4182H534.539ZM214.039 202.378C205.419 195.258 158.739 157.778 148.479 152.358C244.139 123.298 384.659 83.6582 485.819 60.5382C401.619 103.378 298.619 156.318 221.399 210.438C220.699 207.378 216.599 204.778 214.039 202.378ZM234.439 263.718C228.879 241.238 226.959 227.138 222.679 215.658C281.679 184.718 366.359 132.158 432.979 99.6582C369.039 143.578 298.879 185.218 245.219 235.438C237.419 241.118 240.539 270.058 238.719 281.558C237.339 275.978 235.899 269.898 234.459 263.738L234.439 263.718ZM279.739 271.458C270.879 279.098 254.619 293.998 248.159 302.678C248.659 289.418 250.699 262.158 249.819 247.378C255.279 251.698 272.439 263.358 281.639 269.918C280.979 270.478 280.339 270.998 279.719 271.458H279.739ZM504.939 75.8382C458.879 149.458 411.079 243.178 363.939 315.878C331.859 291.278 285.559 257.198 249.939 237.618C324.459 185.658 434.079 108.698 514.039 61.9782C511.339 66.0782 508.319 70.5982 504.959 75.8382H504.939Z",fill:"currentColor"})]})}function q(){return e.jsxs("div",{className:"animate-cel-folder-knock absolute",style:{left:"73.5cqw",top:"24.512cqw",width:"14.39cqw",height:"14.39cqw",transformOrigin:"50% 88%"},children:[e.jsx("svg",{fill:"none",style:l,viewBox:"0 0 600 600",children:e.jsx("path",{className:"fill-background",d:"M424.819 265.626L360.202 271.282H360.156C355.714 271.007 352.554 266.519 354.042 262.123L356.905 253.582C359.423 246.14 353.607 238.584 345.868 238.996C345.387 238.973 344.883 238.973 344.379 239.019L253.727 246.918C249.331 247.308 245.599 250.239 244.179 254.406L219.152 328.755L201.36 382.107C201.36 382.107 170.952 387.511 170.448 387.488C167.128 386.938 164.655 383.801 165.182 380.229C173.929 320.855 145.627 224.547 145.627 224.547C145.627 224.524 145.627 224.479 145.604 224.456C127.286 176.05 102.442 141.726 92.527 129.11C90.512 126.522 91.7256 122.744 94.8855 121.828C220.709 85.329 311.201 74.8418 340.372 72.1857C340.853 72.1399 341.288 72.117 341.723 72.0712C342.593 72.0025 343.395 71.9338 344.128 71.888L345.295 71.8193C392.075 110.86 411.676 196.429 419.896 260.726L424.819 265.626Z"})}),e.jsx("svg",{fill:"none",style:l,viewBox:"0 0 600 600",children:e.jsx("path",{d:"M576.495 259.581C567.725 242.064 546.087 252.643 530.265 252.116C504.367 254.383 469.174 257.451 429.812 260.863C426.172 219.006 394.39 63.805 336.664 68.0869C256.499 76.1469 174.09 94.3048 95.528 116.699C75.6298 121.439 87.2848 136.46 95.528 146.603C111.717 169.707 125.295 194.734 135.851 220.929C109.427 223.219 83.2548 225.486 56.4873 227.822C34.391 227.913 34.4368 253.719 44.0767 267.893C79.7972 349.706 123.509 444.297 155.383 519.699C158.314 526.363 165.664 531.515 173.289 530.255C196.759 528.194 220.389 526.134 243.745 524.096C325.65 516.906 406.182 509.83 486.919 502.686C495.048 502.755 502.444 496.481 504.093 488.513C530.723 408.668 549.224 353.668 570.382 289.371C572.465 283.875 577.297 269.656 568.321 269.862C565.642 270.778 563.421 276.273 562.184 279.021C542.08 337.456 517.763 410.729 492.69 484.643C490.354 495.267 471.898 489.955 463.426 492.588C367.141 500.992 268.795 509.624 171.526 518.165C167.793 518.646 166.145 513.906 164.954 511.067C185.035 451.35 241.341 283.303 249.241 259.81C249.928 256.077 252.881 254.085 256.614 254.314C283.61 251.933 310.881 249.552 337.58 247.193C341.77 247.079 348.044 244.743 349.624 250.284C349.487 260.565 339.023 271.694 355.486 278.105C417.287 275.884 520.716 263.748 546.66 262.535C551.766 262.855 559.551 259.329 564.726 262.626C566.558 264.87 569.397 267.458 571.412 269.518C576.678 274.579 579.518 264.046 576.495 259.581ZM116.502 156.22C110.595 146.832 104.367 137.673 97.5888 128.903C97.0621 128.491 100.222 128.102 100.176 127.942C165.435 109.165 233.876 93.7553 300.142 84.3672C316.056 84.5962 343.74 72.2772 354.296 85.7411C398.58 134.788 407.556 200.963 419.005 261.779C399.587 262.924 378.865 266.107 358.783 266.381C358.623 265.855 359.012 264.985 359.196 264.458C365.79 252.208 361.806 235.241 345.869 234.622C317.865 236.225 287.778 239.66 254.576 242.27C244.455 242.018 237.609 249.781 235.616 259.214C227.923 282.066 201.636 360.674 195.66 378.397C187.211 379.909 178.624 381.466 170.129 382.977C170.106 382.908 170.083 382.862 170.106 382.771C180.433 301.598 148.971 219.762 148.559 219.785C139.881 197.642 129.05 176.302 116.479 156.175L116.502 156.22ZM63.5398 281.677C59.8762 273.434 56.1439 265.053 52.4802 256.81C49.6409 252.162 47.3053 242.224 53.9228 240.164C82.7739 237.576 111.854 235.057 140.362 232.516C155.749 274.487 162.916 319.894 158.955 364.155C158.772 370.933 156.688 377.894 157.169 384.648C160.855 401.753 180.685 392.8 192.363 391.426C180.845 425.567 169.373 459.639 157.81 493.939C129.417 430.009 94.0396 350.302 63.5169 281.677H63.5398Z",fill:"currentColor"})}),e.jsxs("svg",{className:"animate-cel-landed opacity-0",fill:"none",style:l,viewBox:"0 0 600 600",children:[e.jsx("path",{d:"M560.695 161.763C524.448 169.456 515.587 178.387 507.939 214.886C507.458 217.198 504.184 217.198 503.703 214.886C496.055 178.387 487.194 169.456 450.946 161.763C448.657 161.282 448.657 157.985 450.946 157.504C487.194 149.81 496.055 140.88 503.703 104.381C504.184 102.068 507.458 102.068 507.939 104.381C515.587 140.88 524.448 149.81 560.695 157.504C562.985 157.985 562.985 161.282 560.695 161.763Z",fill:"currentColor"}),e.jsx("path",{d:"M96.4659 458.311C72.8812 463.325 67.1339 469.118 62.1651 492.863C61.8445 494.352 59.715 494.352 59.4174 492.863C54.4485 469.118 48.6783 463.325 25.1165 458.311C23.6282 457.99 23.6282 455.861 25.1165 455.54C48.7012 450.525 54.4485 444.732 59.4174 420.987C59.7379 419.499 61.8674 419.499 62.1651 420.987C67.1339 444.732 72.9041 450.525 96.4659 455.54C97.9543 455.861 97.9543 457.99 96.4659 458.311Z",fill:"currentColor"})]})]})}function H(){return e.jsx("div",{"aria-hidden":"true",className:"text-foreground w-full max-w-lg","data-slot":"progress-screen-motion",style:{containerType:"inline-size"},children:e.jsxs("div",{className:"relative w-full",style:{aspectRatio:L},children:[e.jsx(b,{}),e.jsx(N,{}),e.jsx(k,{}),e.jsx(q,{})]})})}const c=Z.forwardRef(({className:s,dataHook:C,illustration:t,title:r,description:n,value:a,max:d=100,progressUnit:u="%",showProgressValue:x=!0,progressStatusDescription:f,progressLabel:h,trackingEl:p,trackingLabel:g,...j},m)=>{const i=a!=null;return e.jsxs("section",{ref:m,"aria-busy":"true",className:M.cn("flex flex-1 flex-col items-center",s),"data-hook":C,"data-slot":"progress-screen","data-tracking-el":p??"progress-screen","data-tracking-label":g,...j,children:[e.jsx("div",{"aria-hidden":"true",className:"flex-1"}),e.jsxs("div",{className:"flex w-full flex-col items-center gap-8",children:[t?e.jsx("div",{"data-slot":"progress-screen-illustration",children:t}):i?null:e.jsx(H,{}),e.jsxs("div",{className:"flex w-full max-w-xl flex-col gap-2","data-slot":"progress-screen-text",children:[e.jsx(o.TypographyH2,{align:"center",dataHook:`${C}-title`,children:r}),n?e.jsx("div",{"aria-live":"polite","data-slot":"progress-screen-description",children:e.jsx(o.TypographyMuted,{align:"center",dataHook:`${C}-description`,children:n})}):null]}),i?e.jsx("div",{className:"flex w-full max-w-xl justify-center text-center","data-slot":"progress-screen-indicator",children:e.jsx(v.Progress,{ariaLabel:h??"Generation progress",dataHook:`${C}-progress`,max:d,showValue:x,size:"md",statusDescription:f,unit:u,value:a??void 0})}):null]}),e.jsx("div",{"aria-hidden":"true",className:"flex-[1.3]"})]})});c.displayName="ProgressScreen";exports.ProgressScreen=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"progress-screen.d.ts","sourceRoot":"","sources":["../../src/blocks/progress-screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqQ/B;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,KAAK,CAAC,wBAAwB,CAAC,SAAS,CAAC,EACzC,OAAO,GAAG,UAAU,CACrB;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5C;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,cAAc,yFAwGnB,CAAC;AAIF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|