@brightlocal/ui-components 2.26.0 → 2.27.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 +4 -2
- package/component-meta.json +3761 -360
- package/dist/blocks/progress-screen.cjs +1 -0
- package/dist/blocks/progress-screen.d.ts +109 -0
- package/dist/blocks/progress-screen.d.ts.map +1 -0
- package/dist/blocks/progress-screen.js +339 -0
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +155 -153
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +44 -40
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +28 -28
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +1 -1
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +42 -41
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +4 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +161 -161
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +138 -3
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +455 -309
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +31 -5
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +276 -194
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +462 -451
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.js +10 -8
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +8 -6
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +52 -20
- package/dist/list.cjs +1 -1
- package/dist/list.js +65 -63
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +61 -3
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +142 -65
- package/dist/route-progress.cjs +1 -0
- package/dist/route-progress.d.ts +103 -0
- package/dist/route-progress.d.ts.map +1 -0
- package/dist/route-progress.js +106 -0
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +35 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +102 -65
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +11 -15
- package/dist/spinner.cjs +1 -0
- package/dist/spinner.d.ts +57 -0
- package/dist/spinner.d.ts.map +1 -0
- package/dist/spinner.js +35 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.d.ts.map +1 -1
- package/dist/stepper.js +26 -25
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +6 -2
- package/package.json +14 -2
- package/src/blocks/progress-screen.tsx +481 -0
- package/src/blocks/sidebar.tsx +22 -15
- package/src/components/breadcrumb.tsx +9 -4
- package/src/components/button.tsx +2 -5
- package/src/components/chip.tsx +4 -3
- package/src/components/combobox.tsx +15 -8
- package/src/components/data-table.tsx +333 -14
- package/src/components/global-layout.tsx +228 -62
- package/src/components/link.tsx +39 -5
- package/src/components/list.tsx +5 -5
- package/src/components/progress.tsx +217 -30
- package/src/components/route-progress.tsx +354 -0
- package/src/components/sheet.tsx +87 -5
- package/src/components/sonner.tsx +3 -12
- package/src/components/spinner.tsx +94 -0
- package/src/components/stepper.tsx +3 -4
- package/src/components/table.tsx +6 -2
- package/src/index.ts +3 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
+
import { Progress } from "../components/progress";
|
|
7
|
+
import { TypographyH2, TypographyMuted } from "../components/typography";
|
|
8
|
+
|
|
9
|
+
/* -------------------------------------------------------------------------------------------------
|
|
10
|
+
* ProgressScreen
|
|
11
|
+
*
|
|
12
|
+
* The Progress screen pattern (Patterns/Loading → Progress screen) as a block:
|
|
13
|
+
* the state
|
|
14
|
+
* shown while something is being *generated* rather than fetched — minutes, not
|
|
15
|
+
* seconds. It answers what the person is actually asking: is it working, what is
|
|
16
|
+
* it doing, can I leave?
|
|
17
|
+
*
|
|
18
|
+
* The block owns what every tool shares — the centred column, the heading and
|
|
19
|
+
* description treatment, the busy semantics, the live region, and the spacing.
|
|
20
|
+
* The tool supplies the copy, and the illustration where there is one.
|
|
21
|
+
*
|
|
22
|
+
* There are exactly two states, and `value` picks between them:
|
|
23
|
+
* value set → the tool's illustration over a determinate bar showing real
|
|
24
|
+
* backend progress, with the step named above it.
|
|
25
|
+
* value not set → the cel loop and nothing else: no bar, and no status line
|
|
26
|
+
* either, because the status line belongs to Progress and
|
|
27
|
+
* goes where the bar goes. The motion says the run is alive
|
|
28
|
+
* and the description says the rest.
|
|
29
|
+
* Never invent a percentage to get the first one.
|
|
30
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
31
|
+
|
|
32
|
+
/* -------------------------------------------------------------------------------------------------
|
|
33
|
+
* ProgressScreenCelMotion (private)
|
|
34
|
+
*
|
|
35
|
+
* A hand-drawn cel loop: a sheet leaves the shop, folds into a paper plane,
|
|
36
|
+
* flies across and drops into a folder, and both containers take a small knock
|
|
37
|
+
* as it goes. Eighteen cels at 8fps, so every track steps rather than tweens —
|
|
38
|
+
* the snap is the point, this is drawn animation, not interpolated UI.
|
|
39
|
+
*
|
|
40
|
+
* It stands in for the illustration on the indeterminate state, where there is
|
|
41
|
+
* no bar: with nothing to measure, motion is the only honest signal that the run
|
|
42
|
+
* is still alive.
|
|
43
|
+
*
|
|
44
|
+
* Geometry is in `cqw` against an inline-size container, so the whole
|
|
45
|
+
* composition scales with the stage width and every layer stays in register at
|
|
46
|
+
* any size. The values are inline because they are the illustration's own
|
|
47
|
+
* coordinates, not styling decisions — there is no token scale for them.
|
|
48
|
+
*
|
|
49
|
+
* Colour is `currentColor` for the ink and the page background for the paper, so
|
|
50
|
+
* one copy of the artwork tracks the theme in both modes (the fix DS-911 applied
|
|
51
|
+
* to the Neutral icons).
|
|
52
|
+
*
|
|
53
|
+
* Decorative: hidden from assistive technology. The heading and description
|
|
54
|
+
* carry the state on their own.
|
|
55
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
56
|
+
|
|
57
|
+
/** The stage's aspect, and the space every layer's `cqw` value is measured in. */
|
|
58
|
+
const CEL_STAGE_ASPECT = "820 / 372";
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A layer that fills its wrapper with 10% bleed on every side — the framing the
|
|
62
|
+
* artwork was drawn to, so the 600-unit boxes overlap the way the cels do.
|
|
63
|
+
*/
|
|
64
|
+
const CEL_BLEED: React.CSSProperties = {
|
|
65
|
+
position: "absolute",
|
|
66
|
+
inset: "-10%",
|
|
67
|
+
width: "120%",
|
|
68
|
+
height: "120%",
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** The shopfront the sheet leaves, plus the speed marks that flash as it goes. */
|
|
72
|
+
function CelStore() {
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
className="animate-cel-store-knock absolute"
|
|
76
|
+
style={{
|
|
77
|
+
left: "7.073cqw",
|
|
78
|
+
top: "25.244cqw",
|
|
79
|
+
width: "12.561cqw",
|
|
80
|
+
height: "12.561cqw",
|
|
81
|
+
transformOrigin: "50% 92%",
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<svg fill="none" style={CEL_BLEED} viewBox="0 0 600 600">
|
|
85
|
+
<path
|
|
86
|
+
className="fill-background"
|
|
87
|
+
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"
|
|
88
|
+
/>
|
|
89
|
+
<path
|
|
90
|
+
className="fill-background"
|
|
91
|
+
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"
|
|
92
|
+
/>
|
|
93
|
+
<path
|
|
94
|
+
className="fill-background"
|
|
95
|
+
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"
|
|
96
|
+
/>
|
|
97
|
+
<path
|
|
98
|
+
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"
|
|
99
|
+
fill="currentColor"
|
|
100
|
+
/>
|
|
101
|
+
<path
|
|
102
|
+
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"
|
|
103
|
+
fill="currentColor"
|
|
104
|
+
/>
|
|
105
|
+
<path
|
|
106
|
+
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"
|
|
107
|
+
fill="currentColor"
|
|
108
|
+
/>
|
|
109
|
+
</svg>
|
|
110
|
+
{/* Base state is off: the marks only exist for the three cels the sheet
|
|
111
|
+
is leaving, so at rest — and under reduced motion — they stay away. */}
|
|
112
|
+
<svg
|
|
113
|
+
className="animate-cel-marks opacity-0"
|
|
114
|
+
fill="none"
|
|
115
|
+
style={CEL_BLEED}
|
|
116
|
+
viewBox="0 0 600 600"
|
|
117
|
+
>
|
|
118
|
+
<path
|
|
119
|
+
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"
|
|
120
|
+
fill="currentColor"
|
|
121
|
+
/>
|
|
122
|
+
<path
|
|
123
|
+
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"
|
|
124
|
+
fill="currentColor"
|
|
125
|
+
/>
|
|
126
|
+
<path
|
|
127
|
+
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"
|
|
128
|
+
fill="currentColor"
|
|
129
|
+
/>
|
|
130
|
+
</svg>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The sheet, on its way out of the shop and again on its way into the folder.
|
|
137
|
+
* The viewBox is cropped to the drawing's own bounds so the sheet fills its box
|
|
138
|
+
* rather than sitting in the middle of an empty 600-unit square.
|
|
139
|
+
*/
|
|
140
|
+
function CelSheet() {
|
|
141
|
+
return (
|
|
142
|
+
<svg
|
|
143
|
+
className="animate-cel-sheet absolute"
|
|
144
|
+
fill="none"
|
|
145
|
+
style={{
|
|
146
|
+
left: 0,
|
|
147
|
+
top: 0,
|
|
148
|
+
width: "10.2cqw",
|
|
149
|
+
height: "6.3cqw",
|
|
150
|
+
/* Frame 0 of the loop, so the still — and the reduced-motion render —
|
|
151
|
+
shows the sheet at the shop rather than nothing at all. */
|
|
152
|
+
transform: "translate(12.4cqw, 21.35cqw) rotate(-4deg) scale(1.2)",
|
|
153
|
+
}}
|
|
154
|
+
viewBox="54 202 412 280"
|
|
155
|
+
>
|
|
156
|
+
<path
|
|
157
|
+
className="fill-background stroke-current"
|
|
158
|
+
d="M100 246C176 212 302 254 456 288C442 346 426 410 408 472C312 452 192 418 64 398C82 344 92 296 100 246Z"
|
|
159
|
+
strokeLinecap="round"
|
|
160
|
+
strokeLinejoin="round"
|
|
161
|
+
strokeWidth="10"
|
|
162
|
+
/>
|
|
163
|
+
</svg>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** The folded plane, mid-flight between the two. */
|
|
168
|
+
function CelPlane() {
|
|
169
|
+
return (
|
|
170
|
+
<svg
|
|
171
|
+
className="animate-cel-plane absolute opacity-0"
|
|
172
|
+
fill="none"
|
|
173
|
+
style={{
|
|
174
|
+
left: 0,
|
|
175
|
+
top: 0,
|
|
176
|
+
width: "13.7cqw",
|
|
177
|
+
height: "13.7cqw",
|
|
178
|
+
transformOrigin: "55.7% 30%",
|
|
179
|
+
}}
|
|
180
|
+
viewBox="0 0 600 600"
|
|
181
|
+
>
|
|
182
|
+
<path
|
|
183
|
+
className="fill-background"
|
|
184
|
+
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"
|
|
185
|
+
/>
|
|
186
|
+
<path
|
|
187
|
+
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"
|
|
188
|
+
fill="currentColor"
|
|
189
|
+
/>
|
|
190
|
+
</svg>
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** The folder the sheet lands in, and the sparks that mark the landing. */
|
|
195
|
+
function CelFolder() {
|
|
196
|
+
return (
|
|
197
|
+
<div
|
|
198
|
+
className="animate-cel-folder-knock absolute"
|
|
199
|
+
style={{
|
|
200
|
+
left: "73.5cqw",
|
|
201
|
+
top: "24.512cqw",
|
|
202
|
+
width: "14.39cqw",
|
|
203
|
+
height: "14.39cqw",
|
|
204
|
+
transformOrigin: "50% 88%",
|
|
205
|
+
}}
|
|
206
|
+
>
|
|
207
|
+
<svg fill="none" style={CEL_BLEED} viewBox="0 0 600 600">
|
|
208
|
+
<path
|
|
209
|
+
className="fill-background"
|
|
210
|
+
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"
|
|
211
|
+
/>
|
|
212
|
+
</svg>
|
|
213
|
+
<svg fill="none" style={CEL_BLEED} viewBox="0 0 600 600">
|
|
214
|
+
<path
|
|
215
|
+
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"
|
|
216
|
+
fill="currentColor"
|
|
217
|
+
/>
|
|
218
|
+
</svg>
|
|
219
|
+
{/* Off until the sheet lands, so the resting frame is an empty folder.
|
|
220
|
+
Ink, like everything else in the loop: the shop's speed marks and the
|
|
221
|
+
folder's sparks are the same kind of mark at either end of the story,
|
|
222
|
+
so colouring only one of them reads as an inconsistency. */}
|
|
223
|
+
<svg
|
|
224
|
+
className="animate-cel-landed opacity-0"
|
|
225
|
+
fill="none"
|
|
226
|
+
style={CEL_BLEED}
|
|
227
|
+
viewBox="0 0 600 600"
|
|
228
|
+
>
|
|
229
|
+
<path
|
|
230
|
+
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"
|
|
231
|
+
fill="currentColor"
|
|
232
|
+
/>
|
|
233
|
+
<path
|
|
234
|
+
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"
|
|
235
|
+
fill="currentColor"
|
|
236
|
+
/>
|
|
237
|
+
</svg>
|
|
238
|
+
</div>
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** The whole cel stage: an inline-size container every layer is measured in. */
|
|
243
|
+
function ProgressScreenCelMotion() {
|
|
244
|
+
return (
|
|
245
|
+
<div
|
|
246
|
+
aria-hidden="true"
|
|
247
|
+
className="text-foreground w-full max-w-lg"
|
|
248
|
+
data-slot="progress-screen-motion"
|
|
249
|
+
style={{ containerType: "inline-size" }}
|
|
250
|
+
>
|
|
251
|
+
<div
|
|
252
|
+
className="relative w-full"
|
|
253
|
+
style={{ aspectRatio: CEL_STAGE_ASPECT }}
|
|
254
|
+
>
|
|
255
|
+
<CelStore />
|
|
256
|
+
<CelSheet />
|
|
257
|
+
<CelPlane />
|
|
258
|
+
<CelFolder />
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Props for the ProgressScreen block.
|
|
266
|
+
* Extends native `section` props; `title` is overridden to accept rich content.
|
|
267
|
+
*/
|
|
268
|
+
export interface ProgressScreenProps extends Omit<
|
|
269
|
+
React.ComponentPropsWithoutRef<"section">,
|
|
270
|
+
"title" | "children"
|
|
271
|
+
> {
|
|
272
|
+
/**
|
|
273
|
+
* Required data-hook attribute for automated testing.
|
|
274
|
+
* @example "local-search-grid-generating"
|
|
275
|
+
*/
|
|
276
|
+
dataHook: string;
|
|
277
|
+
/**
|
|
278
|
+
* The tool's illustration, shown above the text. Decorative — mark it
|
|
279
|
+
* `aria-hidden`; the heading and description carry the state on their own.
|
|
280
|
+
*
|
|
281
|
+
* The determinate state has no default: pass the illustration that belongs to
|
|
282
|
+
* the thing being generated. The indeterminate state falls back to the cel
|
|
283
|
+
* loop, which is doing the work the missing progress bar cannot — pass an
|
|
284
|
+
* illustration there only if you mean to trade that motion away.
|
|
285
|
+
* @example <MapMagnifyingGlassSearchLocation aria-hidden size={200} />
|
|
286
|
+
*/
|
|
287
|
+
illustration?: React.ReactNode;
|
|
288
|
+
/**
|
|
289
|
+
* Headline naming what is being generated, in the consumer's own words.
|
|
290
|
+
* @example "Building your first search grid"
|
|
291
|
+
*/
|
|
292
|
+
title: React.ReactNode;
|
|
293
|
+
/**
|
|
294
|
+
* Supporting line beneath the heading — the typical duration and permission
|
|
295
|
+
* to leave. A polite live region, so it may change as the run moves on.
|
|
296
|
+
* @example "This usually takes a few minutes and you can safely leave this page."
|
|
297
|
+
*/
|
|
298
|
+
description?: React.ReactNode;
|
|
299
|
+
/**
|
|
300
|
+
* Real progress reported by the backend. Leave it unset and the block shows
|
|
301
|
+
* the cel loop with no bar at all — never invent a percentage to fill one.
|
|
302
|
+
*/
|
|
303
|
+
value?: number | null;
|
|
304
|
+
/**
|
|
305
|
+
* Maximum progress value, the denominator for `value`.
|
|
306
|
+
* @default 100
|
|
307
|
+
*/
|
|
308
|
+
max?: number;
|
|
309
|
+
/**
|
|
310
|
+
* Unit for the progress readout. `"%"` renders percentage form (`45%`); any
|
|
311
|
+
* other unit renders fraction form (`3 / 5 steps`). Determinate state only.
|
|
312
|
+
* @default "%"
|
|
313
|
+
*/
|
|
314
|
+
progressUnit?: string;
|
|
315
|
+
/**
|
|
316
|
+
* Whether the determinate bar shows its numeric readout.
|
|
317
|
+
* @default true
|
|
318
|
+
*/
|
|
319
|
+
showProgressValue?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* The step the run is on right now, shown on its own line above the bar.
|
|
322
|
+
* Determinate state only — it belongs to Progress, so it goes where the bar
|
|
323
|
+
* goes. On the indeterminate state, put anything the run can say about
|
|
324
|
+
* itself in `description`.
|
|
325
|
+
* @example "Scanning search results across your area"
|
|
326
|
+
*/
|
|
327
|
+
progressStatusDescription?: React.ReactNode;
|
|
328
|
+
/**
|
|
329
|
+
* Accessible label for the progress bar. Determinate state only.
|
|
330
|
+
* @default "Generation progress"
|
|
331
|
+
*/
|
|
332
|
+
progressLabel?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Tracking element identifier for analytics.
|
|
335
|
+
*/
|
|
336
|
+
trackingEl?: string;
|
|
337
|
+
/**
|
|
338
|
+
* Tracking label for analytics context.
|
|
339
|
+
*/
|
|
340
|
+
trackingLabel?: string;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* The running state for something being generated — an illustration over a
|
|
345
|
+
* centred heading and description.
|
|
346
|
+
*
|
|
347
|
+
* `value` picks the state: pass one for the tool's illustration over a
|
|
348
|
+
* determinate bar; leave it out and the block runs the cel loop with no bar,
|
|
349
|
+
* because motion is the only honest signal when there is no number. The whole
|
|
350
|
+
* block is `aria-busy` and the description is an `aria-live="polite"` region, so
|
|
351
|
+
* copy that moves forward with the run announces itself without interrupting.
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* ```tsx
|
|
355
|
+
* // The backend reports real progress.
|
|
356
|
+
* <ProgressScreen
|
|
357
|
+
* dataHook="lsg-generating"
|
|
358
|
+
* illustration={<MapMagnifyingGlassSearchLocation aria-hidden size={200} />}
|
|
359
|
+
* title={t("reports.building.title")}
|
|
360
|
+
* description={t("reports.building.description")}
|
|
361
|
+
* progressStatusDescription={t(`reports.building.stages.${run.stage}`)}
|
|
362
|
+
* value={run.percent}
|
|
363
|
+
* />
|
|
364
|
+
*
|
|
365
|
+
* // It reports nothing, but the run is underway.
|
|
366
|
+
* <ProgressScreen
|
|
367
|
+
* dataHook="lsg-generating"
|
|
368
|
+
* title={t("reports.building.title")}
|
|
369
|
+
* description={t("reports.building.description")}
|
|
370
|
+
* />
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
const ProgressScreen = React.forwardRef<HTMLElement, ProgressScreenProps>(
|
|
374
|
+
(
|
|
375
|
+
{
|
|
376
|
+
className,
|
|
377
|
+
dataHook,
|
|
378
|
+
illustration,
|
|
379
|
+
title,
|
|
380
|
+
description,
|
|
381
|
+
value,
|
|
382
|
+
max = 100,
|
|
383
|
+
progressUnit = "%",
|
|
384
|
+
showProgressValue = true,
|
|
385
|
+
progressStatusDescription,
|
|
386
|
+
progressLabel,
|
|
387
|
+
trackingEl,
|
|
388
|
+
trackingLabel,
|
|
389
|
+
...props
|
|
390
|
+
},
|
|
391
|
+
ref
|
|
392
|
+
) => {
|
|
393
|
+
// A real number gives a determinate bar; anything else runs the cel loop.
|
|
394
|
+
const hasProgress = value !== null && value !== undefined;
|
|
395
|
+
|
|
396
|
+
return (
|
|
397
|
+
<section
|
|
398
|
+
ref={ref}
|
|
399
|
+
aria-busy="true"
|
|
400
|
+
className={cn("flex flex-1 flex-col items-center", className)}
|
|
401
|
+
data-hook={dataHook}
|
|
402
|
+
data-slot="progress-screen"
|
|
403
|
+
data-tracking-el={trackingEl ?? "progress-screen"}
|
|
404
|
+
data-tracking-label={trackingLabel}
|
|
405
|
+
{...props}
|
|
406
|
+
>
|
|
407
|
+
{/* Optically centred, not mathematically. A block centred by the maths
|
|
408
|
+
reads as sitting low, so the spacer below is the larger of the two —
|
|
409
|
+
roughly 45/55. Both are flexible, so in a container with no room to
|
|
410
|
+
spare they collapse together and the content simply centres rather
|
|
411
|
+
than overflowing. */}
|
|
412
|
+
<div aria-hidden="true" className="flex-1" />
|
|
413
|
+
|
|
414
|
+
<div className="flex w-full flex-col items-center gap-8">
|
|
415
|
+
{illustration ? (
|
|
416
|
+
<div data-slot="progress-screen-illustration">{illustration}</div>
|
|
417
|
+
) : hasProgress ? null : (
|
|
418
|
+
<ProgressScreenCelMotion />
|
|
419
|
+
)}
|
|
420
|
+
|
|
421
|
+
<div
|
|
422
|
+
className="flex w-full max-w-xl flex-col gap-2"
|
|
423
|
+
data-slot="progress-screen-text"
|
|
424
|
+
>
|
|
425
|
+
<TypographyH2 align="center" dataHook={`${dataHook}-title`}>
|
|
426
|
+
{title}
|
|
427
|
+
</TypographyH2>
|
|
428
|
+
{description ? (
|
|
429
|
+
/* Polite, not assertive: real stages are minutes apart, so this
|
|
430
|
+
announces a handful of times across a run — never on a tick. */
|
|
431
|
+
<div aria-live="polite" data-slot="progress-screen-description">
|
|
432
|
+
<TypographyMuted
|
|
433
|
+
align="center"
|
|
434
|
+
dataHook={`${dataHook}-description`}
|
|
435
|
+
>
|
|
436
|
+
{description}
|
|
437
|
+
</TypographyMuted>
|
|
438
|
+
</div>
|
|
439
|
+
) : null}
|
|
440
|
+
</div>
|
|
441
|
+
|
|
442
|
+
{/* The indicator is the whole of the determinate state's apparatus:
|
|
443
|
+
the bar and the status line are one thing, and the status line is
|
|
444
|
+
Progress's, not the block's. With no bar there is nothing to hang
|
|
445
|
+
it on, so the indeterminate state has neither — the cel loop says
|
|
446
|
+
the run is alive and the description says the rest. */}
|
|
447
|
+
{hasProgress ? (
|
|
448
|
+
/* `text-center` centres the Progress status line with the title and
|
|
449
|
+
description above it — on this screen everything sits on one axis,
|
|
450
|
+
where a left-aligned status reads as a misalignment. It works by
|
|
451
|
+
inheritance: the status sets no alignment of its own, while the
|
|
452
|
+
value keeps its explicit `text-right` against the bar. */
|
|
453
|
+
<div
|
|
454
|
+
className="flex w-full max-w-xl justify-center text-center"
|
|
455
|
+
data-slot="progress-screen-indicator"
|
|
456
|
+
>
|
|
457
|
+
{/* `md` — this is a full page, not a metric row in a card, so the
|
|
458
|
+
bar and its text take the roomier of the two sizes. */}
|
|
459
|
+
<Progress
|
|
460
|
+
ariaLabel={progressLabel ?? "Generation progress"}
|
|
461
|
+
dataHook={`${dataHook}-progress`}
|
|
462
|
+
max={max}
|
|
463
|
+
showValue={showProgressValue}
|
|
464
|
+
size="md"
|
|
465
|
+
statusDescription={progressStatusDescription}
|
|
466
|
+
unit={progressUnit}
|
|
467
|
+
value={value ?? undefined}
|
|
468
|
+
/>
|
|
469
|
+
</div>
|
|
470
|
+
) : null}
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
<div aria-hidden="true" className="flex-[1.3]" />
|
|
474
|
+
</section>
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
|
|
479
|
+
ProgressScreen.displayName = "ProgressScreen";
|
|
480
|
+
|
|
481
|
+
export { ProgressScreen };
|
package/src/blocks/sidebar.tsx
CHANGED
|
@@ -177,11 +177,13 @@ export enum SidebarCollapseIconType {
|
|
|
177
177
|
|
|
178
178
|
const SIDEBAR_COOKIE_NAME = "sidebar:state";
|
|
179
179
|
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
180
|
-
// Outer wrapper width
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
// Outer wrapper width per DS-860 — 288px, matching the Figma binding to
|
|
181
|
+
// `width/w-72`, so nav labels fit without truncation on small desktop
|
|
182
|
+
// screens. SidebarContent's viewport insets live inside this width: 8px on
|
|
183
|
+
// the left (Figma edge inset) and 12px on the right (8px clearance plus the
|
|
184
|
+
// 4px overlay scrollbar lane), so menu buttons render 268px wide with the
|
|
185
|
+
// 3px focus ring unclipped.
|
|
186
|
+
const SIDEBAR_WIDTH = "288px";
|
|
185
187
|
const SIDEBAR_WIDTH_ICON = "48px";
|
|
186
188
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
187
189
|
|
|
@@ -455,16 +457,12 @@ const Sidebar = React.forwardRef<HTMLDivElement, SidebarProps>(
|
|
|
455
457
|
return (
|
|
456
458
|
<Sheet open={openMobile} onOpenChange={setOpenMobile}>
|
|
457
459
|
<SheetContent
|
|
458
|
-
className="bg-sidebar-background text-sidebar-foreground
|
|
460
|
+
className="bg-sidebar-background text-sidebar-foreground p-6"
|
|
459
461
|
data-hook={`${dataHook}-mobile-content`}
|
|
460
462
|
data-mobile="true"
|
|
461
463
|
data-sidebar="sidebar"
|
|
462
464
|
side="left"
|
|
463
|
-
|
|
464
|
-
{
|
|
465
|
-
"--sidebar-width": `min(${SIDEBAR_WIDTH_MOBILE}, calc(100vw - 40px))`,
|
|
466
|
-
} as React.CSSProperties
|
|
467
|
-
}
|
|
465
|
+
size="sm"
|
|
468
466
|
>
|
|
469
467
|
<SheetTitle className="sr-only">
|
|
470
468
|
{mobileTitle ?? "Navigation"}
|
|
@@ -688,7 +686,10 @@ const SidebarHeader = React.forwardRef<HTMLElement, SidebarHeaderProps>(
|
|
|
688
686
|
<header
|
|
689
687
|
ref={ref}
|
|
690
688
|
className={cn(
|
|
691
|
-
|
|
689
|
+
// DS-860 Figma: logo sits 24px from the left and 24px from the
|
|
690
|
+
// top; pb-5 plus the ScrollArea viewport's 4px top inset gives the
|
|
691
|
+
// 24px gap to the first nav item.
|
|
692
|
+
"pr-section-xs flex shrink-0 flex-col gap-2 pt-6 pb-5 pl-6",
|
|
692
693
|
className
|
|
693
694
|
)}
|
|
694
695
|
data-hook={dataHook}
|
|
@@ -812,8 +813,12 @@ const SidebarContent = React.forwardRef<HTMLDivElement, SidebarContentProps>(
|
|
|
812
813
|
return (
|
|
813
814
|
<ScrollArea
|
|
814
815
|
ref={scrollAreaRef}
|
|
816
|
+
// DS-860 Figma insets: menu buttons sit 8px from the left edge
|
|
817
|
+
// (pl-2), and the right padding grows to 12px (4px scrollbar lane +
|
|
818
|
+
// 8px clearance) so buttons stop short of the overlay scrollbar
|
|
819
|
+
// instead of running flush into it.
|
|
815
820
|
className={cn(
|
|
816
|
-
"min-h-0 flex-1 group-data-[collapsible=icon]:overflow-hidden **:data-[slot=scroll-area-scrollbar]:w-1 **:data-[slot=scroll-area-scrollbar]:border-l-0 **:data-[slot=scroll-area-scrollbar]:p-0 [&_[data-slot=scroll-area-viewport]>div]:flex! [&_[data-slot=scroll-area-viewport]>div]:min-h-full [&_[data-slot=scroll-area-viewport]>div]:flex-col",
|
|
821
|
+
"min-h-0 flex-1 group-data-[collapsible=icon]:overflow-hidden **:data-[slot=scroll-area-scrollbar]:w-1 **:data-[slot=scroll-area-scrollbar]:border-l-0 **:data-[slot=scroll-area-scrollbar]:p-0 [&_[data-slot=scroll-area-viewport]]:pr-3! [&_[data-slot=scroll-area-viewport]]:pl-2! [&_[data-slot=scroll-area-viewport]>div]:flex! [&_[data-slot=scroll-area-viewport]>div]:min-h-full [&_[data-slot=scroll-area-viewport]>div]:flex-col",
|
|
817
822
|
className
|
|
818
823
|
)}
|
|
819
824
|
dataHook={dataHook ?? "sidebar-content-scroll"}
|
|
@@ -1155,7 +1160,7 @@ SidebarCollapseIcon.displayName = "SidebarCollapseIcon";
|
|
|
1155
1160
|
|
|
1156
1161
|
const sidebarMenuButtonVariants = cva(
|
|
1157
1162
|
[
|
|
1158
|
-
"peer/menu-button flex w-full items-center gap-
|
|
1163
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-full px-4 py-2 text-left text-sm font-medium outline-none transition-[color,background-color,border-color,box-shadow,opacity,width,height,padding] duration-base ease-in-out hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-semibold data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:rounded-md [&>span:not([data-slot])]:truncate [&>svg]:shrink-0 [&>svg]:opacity-70 data-[active=true]:[&>svg]:opacity-100 group-data-[collapsible=icon]:[&>span]:hidden group-data-[collapsible=icon]:[&>div]:hidden",
|
|
1159
1164
|
SIDEBAR_FOCUS_RING,
|
|
1160
1165
|
],
|
|
1161
1166
|
{
|
|
@@ -1395,7 +1400,7 @@ const SidebarMenuSkeleton = React.forwardRef<
|
|
|
1395
1400
|
/>
|
|
1396
1401
|
)}
|
|
1397
1402
|
<Skeleton
|
|
1398
|
-
className="h-4 max-w-
|
|
1403
|
+
className="h-4 max-w-(--skeleton-width) flex-1"
|
|
1399
1404
|
data-slot="sidebar-menu-skeleton-text"
|
|
1400
1405
|
style={
|
|
1401
1406
|
{
|
|
@@ -2143,6 +2148,8 @@ function SidebarAccountDropdown({
|
|
|
2143
2148
|
<span className="truncate text-sm font-semibold">{name}</span>
|
|
2144
2149
|
<span className="truncate text-xs font-normal">{email}</span>
|
|
2145
2150
|
</div>
|
|
2151
|
+
{/* Dropdown affordance per the DS-860 Figma account row */}
|
|
2152
|
+
<ChevronsUpDown className="shrink-0" />
|
|
2146
2153
|
</SidebarMenuButton>
|
|
2147
2154
|
</DropdownMenuTrigger>
|
|
2148
2155
|
<DropdownMenuContent
|
|
@@ -57,8 +57,11 @@ const BreadcrumbList = React.forwardRef<
|
|
|
57
57
|
>(({ className, ...props }, ref) => (
|
|
58
58
|
<ol
|
|
59
59
|
ref={ref}
|
|
60
|
+
// Trails never wrap (NP breadcrumb spec) — a wrapped trail reads as two
|
|
61
|
+
// trails. Overflow is handled by collapsing the middle behind an
|
|
62
|
+
// ellipsis and truncating the location crumb, not by wrapping.
|
|
60
63
|
className={cn(
|
|
61
|
-
"text-muted-foreground flex flex-
|
|
64
|
+
"text-muted-foreground flex min-w-0 flex-nowrap items-center gap-1.5 text-sm whitespace-nowrap sm:gap-2.5",
|
|
62
65
|
className
|
|
63
66
|
)}
|
|
64
67
|
data-slot="breadcrumb-list"
|
|
@@ -178,18 +181,20 @@ const BreadcrumbEllipsis = React.forwardRef<
|
|
|
178
181
|
BreadcrumbEllipsisProps
|
|
179
182
|
>(({ className, srLabel = "More", ...props }, ref) => {
|
|
180
183
|
return (
|
|
184
|
+
// aria-hidden sits on the icon, not the wrapper — hiding the wrapper
|
|
185
|
+
// would also silence the sr-only label, and the ellipsis must stay
|
|
186
|
+
// announceable when wrapped in a DropdownMenuTrigger to reveal the
|
|
187
|
+
// collapsed pages.
|
|
181
188
|
<span
|
|
182
189
|
ref={ref}
|
|
183
|
-
aria-hidden="true"
|
|
184
190
|
className={cn(
|
|
185
191
|
"relative flex size-9 items-center justify-center",
|
|
186
192
|
className
|
|
187
193
|
)}
|
|
188
194
|
data-slot="breadcrumb-ellipsis"
|
|
189
|
-
role="presentation"
|
|
190
195
|
{...props}
|
|
191
196
|
>
|
|
192
|
-
<MoreHorizontal />
|
|
197
|
+
<MoreHorizontal aria-hidden="true" />
|
|
193
198
|
<span className="sr-only">{srLabel}</span>
|
|
194
199
|
</span>
|
|
195
200
|
);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
import { Loader2 } from "@brightlocal/icons";
|
|
5
4
|
|
|
6
5
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
|
-
|
|
8
|
-
// Shared constants
|
|
9
|
-
const BUTTON_SPINNER_SIZE = 16;
|
|
6
|
+
import { Spinner } from "@brightlocal/ui-components/spinner";
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Variant props for CVA button styling
|
|
@@ -269,7 +266,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
269
266
|
className="pointer-events-none flex items-center justify-center"
|
|
270
267
|
data-slot="button-loading-icon"
|
|
271
268
|
>
|
|
272
|
-
<
|
|
269
|
+
<Spinner size="md" />
|
|
273
270
|
</div>
|
|
274
271
|
)}
|
|
275
272
|
{children}
|