@orsetra/shared-ui 1.10.31 → 1.10.33
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/components/ui/logo.tsx +11 -24
- package/components/ui/spinner.tsx +55 -53
- package/package.json +1 -1
package/components/ui/logo.tsx
CHANGED
|
@@ -12,44 +12,31 @@ interface LogoProps {
|
|
|
12
12
|
const MonogramIcon = ({ className }: { className?: string }) => (
|
|
13
13
|
<svg
|
|
14
14
|
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
-
viewBox="0 0
|
|
15
|
+
viewBox="0 0 64 64"
|
|
16
16
|
className={cn("inline-block flex-shrink-0", className)}
|
|
17
17
|
aria-hidden="true"
|
|
18
18
|
>
|
|
19
|
-
<rect width="
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fontFamily="Helvetica Neue, Arial, sans-serif"
|
|
24
|
-
fontWeight="700"
|
|
25
|
-
fontSize="13"
|
|
26
|
-
letterSpacing="-0.75"
|
|
27
|
-
fill="#FFFFFF"
|
|
28
|
-
textAnchor="middle"
|
|
29
|
-
dominantBaseline="central"
|
|
30
|
-
>
|
|
31
|
-
CX
|
|
32
|
-
</text>
|
|
19
|
+
<rect width="64" height="64" fill="#0F62FE" />
|
|
20
|
+
<polygon fill="#FFFFFF" points="12.56,14.72 18.32,14.72 26.96,32 18.32,49.28 12.56,49.28 21.2,32" />
|
|
21
|
+
<polygon fill="#FFFFFF" points="51.44,14.72 45.68,14.72 37.04,32 45.68,49.28 51.44,49.28 42.8,32" />
|
|
22
|
+
<rect fill="#FFFFFF" x="28.4" y="28.4" width="7.2" height="7.2" />
|
|
33
23
|
</svg>
|
|
34
24
|
)
|
|
35
25
|
|
|
36
26
|
const Wordmark = ({ className }: { className?: string }) => (
|
|
37
27
|
<svg
|
|
38
28
|
xmlns="http://www.w3.org/2000/svg"
|
|
39
|
-
viewBox="0 0
|
|
29
|
+
viewBox="0 0 118.55 32"
|
|
40
30
|
className={cn("inline-block flex-shrink-0", className)}
|
|
41
31
|
style={{ height: "1.15em", width: "auto" }}
|
|
42
32
|
role="img"
|
|
43
33
|
aria-label="Camel X"
|
|
44
34
|
>
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/>
|
|
49
|
-
<path
|
|
50
|
-
fill="#0F62FE"
|
|
51
|
-
d="M94.6 25.3 100.96 15.59 95.2 6.69H99.59L103.32 12.67L106.98 6.69H111.33L105.54 15.73L111.9 25.3H107.37L103.25 18.86L99.11 25.3Z"
|
|
52
|
-
/>
|
|
35
|
+
<polygon fill="#161616" points="0,5 3.67,5 9.17,16 3.67,27 0,27 5.5,16" />
|
|
36
|
+
<polygon fill="#161616" points="24.75,5 21.08,5 15.58,16 21.08,27 24.75,27 19.25,16" />
|
|
37
|
+
<rect fill="#0F62FE" x="10.08" y="13.71" width="4.58" height="4.58" />
|
|
38
|
+
<path fill="#161616" d="M41.52 23.94Q40 23.94 38.78 23.45Q37.56 22.95 36.69 21.96Q35.82 20.97 35.36 19.51Q34.89 18.05 34.89 16.11Q34.89 14.17 35.36 12.67Q35.82 11.16 36.69 10.14Q37.56 9.11 38.78 8.59Q40 8.06 41.52 8.06Q43.58 8.06 44.95 8.94Q46.31 9.82 47.13 11.6L44.64 12.92Q44.31 11.89 43.56 11.26Q42.81 10.63 41.52 10.63Q39.89 10.63 38.93 11.73Q37.97 12.83 37.97 14.81V17.23Q37.97 19.23 38.93 20.3Q39.89 21.37 41.52 21.37Q42.81 21.37 43.64 20.66Q44.46 19.96 44.84 18.93L47.19 20.31Q46.36 22.03 44.97 22.98Q43.58 23.94 41.52 23.94Z M57.95 23.68Q57.03 23.68 56.49 23.14Q55.95 22.6 55.82 21.7H55.68Q55.4 22.82 54.52 23.38Q53.64 23.94 52.34 23.94Q50.58 23.94 49.63 23.02Q48.69 22.09 48.69 20.55Q48.69 18.77 49.96 17.9Q51.24 17.03 53.59 17.03H55.55V16.2Q55.55 15.23 55.05 14.7Q54.54 14.17 53.42 14.17Q52.43 14.17 51.82 14.6Q51.22 15.03 50.8 15.63L49.13 14.13Q49.77 13.14 50.82 12.53Q51.88 11.93 53.62 11.93Q55.95 11.93 57.16 12.99Q58.37 14.04 58.37 16.02V21.43H59.51V23.68ZM53.29 21.9Q54.23 21.9 54.89 21.48Q55.55 21.06 55.55 20.25V18.73H53.75Q51.55 18.73 51.55 20.14V20.51Q51.55 21.21 52 21.55Q52.45 21.9 53.29 21.9Z M61.8 23.68V12.19H64.62V14.11H64.73Q65.06 13.21 65.78 12.57Q66.51 11.93 67.81 11.93Q68.99 11.93 69.85 12.5Q70.71 13.07 71.13 14.24H71.17Q71.48 13.27 72.39 12.6Q73.31 11.93 74.69 11.93Q76.39 11.93 77.3 13.1Q78.21 14.26 78.21 16.42V23.68H75.4V16.7Q75.4 14.24 73.55 14.24Q73.13 14.24 72.75 14.36Q72.36 14.48 72.06 14.71Q71.77 14.94 71.59 15.28Q71.41 15.63 71.41 16.09V23.68H68.6V16.7Q68.6 14.24 66.75 14.24Q66.35 14.24 65.97 14.36Q65.58 14.48 65.29 14.71Q64.99 14.94 64.8 15.28Q64.62 15.63 64.62 16.09V23.68Z M85.98 23.94Q84.7 23.94 83.7 23.51Q82.7 23.08 82.01 22.3Q81.31 21.52 80.94 20.41Q80.57 19.3 80.57 17.91Q80.57 16.55 80.93 15.45Q81.29 14.35 81.97 13.57Q82.66 12.79 83.65 12.36Q84.64 11.93 85.89 11.93Q87.23 11.93 88.22 12.39Q89.21 12.85 89.85 13.65Q90.49 14.44 90.81 15.48Q91.13 16.53 91.13 17.72V18.64H83.49V18.93Q83.49 20.18 84.2 20.94Q84.9 21.7 86.29 21.7Q87.34 21.7 88.01 21.26Q88.68 20.82 89.21 20.14L90.73 21.83Q90.03 22.82 88.81 23.38Q87.58 23.94 85.98 23.94ZM85.93 14.04Q84.81 14.04 84.15 14.79Q83.49 15.54 83.49 16.73V16.9H88.2V16.7Q88.2 15.52 87.62 14.78Q87.03 14.04 85.93 14.04Z M96.43 23.68Q94.98 23.68 94.29 22.95Q93.61 22.23 93.61 20.91V7.4H96.43V21.43H97.95V23.68Z" />
|
|
39
|
+
<path fill="#0F62FE" d="M117.66 23.68H114.27L110.75 17.78H110.68L107.21 23.68H104.04L109.01 15.8L104.26 8.32H107.65L110.9 13.78H110.97L114.27 8.32H117.44L112.64 15.8Z" />
|
|
53
40
|
</svg>
|
|
54
41
|
)
|
|
55
42
|
|
|
@@ -3,80 +3,82 @@ import * as React from "react"
|
|
|
3
3
|
import { cn } from "../../lib/utils"
|
|
4
4
|
|
|
5
5
|
export interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
size?: "sm" | "md" | "lg"
|
|
6
|
+
size?: "xs" | "sm" | "md" | "lg"
|
|
7
|
+
/** "inverse" draws the whole sign in white, for a blue or dark surface such as a primary button. */
|
|
8
|
+
tone?: "default" | "inverse"
|
|
7
9
|
/** Accessible label announced to screen readers while loading. */
|
|
8
10
|
label?: string
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
const SIZE_PX: Record<NonNullable<SpinnerProps["size"]>, number> = {
|
|
14
|
+
xs: 16,
|
|
12
15
|
sm: 20,
|
|
13
16
|
md: 32,
|
|
14
17
|
lg: 48,
|
|
15
18
|
}
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const TONES: Record<NonNullable<SpinnerProps["tone"]>, { parties: string; exchange: string }> = {
|
|
21
|
+
default: { parties: "#161616", exchange: "#0F62FE" },
|
|
22
|
+
inverse: { parties: "#FFFFFF", exchange: "#FFFFFF" },
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const STEP_DELAY_S = 0.3
|
|
26
|
+
|
|
27
|
+
const MOTION = `
|
|
28
|
+
@keyframes cx-spinner-relay {
|
|
29
|
+
0%, 60%, 100% { opacity: 0.22; }
|
|
30
|
+
18%, 34% { opacity: 1; }
|
|
31
|
+
}
|
|
32
|
+
@keyframes cx-spinner-calm {
|
|
33
|
+
0%, 100% { opacity: 1; }
|
|
34
|
+
50% { opacity: 0.35; }
|
|
35
|
+
}
|
|
36
|
+
.cx-spinner-part {
|
|
37
|
+
opacity: 0.22;
|
|
38
|
+
animation: cx-spinner-relay 1.5s cubic-bezier(0.2, 0, 0.38, 0.9) infinite;
|
|
39
|
+
}
|
|
40
|
+
@media (prefers-reduced-motion: reduce) {
|
|
41
|
+
.cx-spinner-part { opacity: 1; animation: none; }
|
|
42
|
+
.cx-spinner-exchange { animation: cx-spinner-calm 2.4s ease-in-out infinite; }
|
|
43
|
+
}
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
function Spinner({ size = "md", tone = "default", label = "Loading", className, ...props }: SpinnerProps) {
|
|
22
47
|
const px = SIZE_PX[size]
|
|
23
|
-
const
|
|
48
|
+
const colors = TONES[tone]
|
|
49
|
+
const delay = (step: number): React.CSSProperties => ({ animationDelay: `${step * STEP_DELAY_S}s` })
|
|
24
50
|
|
|
25
51
|
return (
|
|
26
52
|
<div
|
|
27
53
|
role="status"
|
|
28
54
|
aria-label={label}
|
|
29
|
-
className={cn("
|
|
55
|
+
className={cn("inline-flex items-center justify-center flex-shrink-0", className)}
|
|
30
56
|
style={{ width: px, height: px }}
|
|
31
57
|
{...props}
|
|
32
58
|
>
|
|
33
|
-
<svg
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<circle
|
|
41
|
-
cx="16"
|
|
42
|
-
cy="16"
|
|
43
|
-
r="14.5"
|
|
44
|
-
fill="none"
|
|
45
|
-
stroke="#0F62FE"
|
|
46
|
-
strokeOpacity="0.15"
|
|
47
|
-
strokeWidth="2.5"
|
|
59
|
+
<svg width={px} height={px} viewBox="0 0 64 64" aria-hidden="true">
|
|
60
|
+
<style>{MOTION}</style>
|
|
61
|
+
<polygon
|
|
62
|
+
className="cx-spinner-part"
|
|
63
|
+
style={delay(0)}
|
|
64
|
+
fill={colors.parties}
|
|
65
|
+
points="5,8 13,8 25,32 13,56 5,56 17,32"
|
|
48
66
|
/>
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
<rect
|
|
68
|
+
className="cx-spinner-part cx-spinner-exchange"
|
|
69
|
+
style={delay(1)}
|
|
70
|
+
fill={colors.exchange}
|
|
71
|
+
x="27"
|
|
72
|
+
y="27"
|
|
73
|
+
width="10"
|
|
74
|
+
height="10"
|
|
75
|
+
/>
|
|
76
|
+
<polygon
|
|
77
|
+
className="cx-spinner-part"
|
|
78
|
+
style={delay(2)}
|
|
79
|
+
fill={colors.parties}
|
|
80
|
+
points="59,8 51,8 39,32 51,56 59,56 47,32"
|
|
58
81
|
/>
|
|
59
|
-
</svg>
|
|
60
|
-
<svg
|
|
61
|
-
width={iconPx}
|
|
62
|
-
height={iconPx}
|
|
63
|
-
viewBox="0 0 32 32"
|
|
64
|
-
className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
65
|
-
>
|
|
66
|
-
<rect width="32" height="32" rx="7" fill="#0F62FE" />
|
|
67
|
-
<text
|
|
68
|
-
x="16.5"
|
|
69
|
-
y="17"
|
|
70
|
-
fontFamily="Helvetica Neue, Arial, sans-serif"
|
|
71
|
-
fontWeight="700"
|
|
72
|
-
fontSize="13"
|
|
73
|
-
letterSpacing="-0.75"
|
|
74
|
-
fill="#FFFFFF"
|
|
75
|
-
textAnchor="middle"
|
|
76
|
-
dominantBaseline="central"
|
|
77
|
-
>
|
|
78
|
-
CX
|
|
79
|
-
</text>
|
|
80
82
|
</svg>
|
|
81
83
|
<span className="sr-only">{label}</span>
|
|
82
84
|
</div>
|