@syscore/ui-library 2.0.0-beta-publish-workflow-beta.23 → 2.0.0-beta-publish-workflow-beta.25
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/client/components/ui/card.tsx +16 -4
- package/client/components/ui/resource-thumbnail.tsx +20 -1
- package/client/components/ui/skeleton.tsx +20 -2
- package/client/global.css +79 -1
- package/dist/client/components/ui/card.js +16 -3
- package/dist/client/components/ui/resource-thumbnail.js +16 -1
- package/dist/client/components/ui/skeleton.js +10 -1
- package/dist/index.cjs +1 -1
- package/package.json +1 -1
|
@@ -81,11 +81,18 @@ CardHeader.displayName = "CardHeader";
|
|
|
81
81
|
|
|
82
82
|
const CardTitle = React.forwardRef<
|
|
83
83
|
HTMLParagraphElement,
|
|
84
|
-
React.HTMLAttributes<HTMLHeadingElement>
|
|
85
|
-
|
|
84
|
+
React.HTMLAttributes<HTMLHeadingElement> & {
|
|
85
|
+
/** `compact` — a smaller title for dense card grids (e.g. a catalog card), below heading-xxsmall. */
|
|
86
|
+
size?: "default" | "compact";
|
|
87
|
+
}
|
|
88
|
+
>(({ className, size = "default", ...props }, ref) => (
|
|
86
89
|
<h3
|
|
87
90
|
ref={ref}
|
|
88
|
-
className={cn(
|
|
91
|
+
className={cn(
|
|
92
|
+
"card-title",
|
|
93
|
+
size === "compact" ? "card-title--compact" : "heading-xxsmall",
|
|
94
|
+
className,
|
|
95
|
+
)}
|
|
89
96
|
{...props}
|
|
90
97
|
/>
|
|
91
98
|
));
|
|
@@ -140,7 +147,12 @@ const CardMedia = React.forwardRef<
|
|
|
140
147
|
HTMLDivElement,
|
|
141
148
|
React.HTMLAttributes<HTMLDivElement> & { src?: string; alt?: string; height?: number }
|
|
142
149
|
>(({ className, src, alt = "", height = 200, children, ...props }, ref) => (
|
|
143
|
-
<div
|
|
150
|
+
<div
|
|
151
|
+
ref={ref}
|
|
152
|
+
className={cn("card-media", !src && "card-media--placeholder", className)}
|
|
153
|
+
style={{ height }}
|
|
154
|
+
{...props}
|
|
155
|
+
>
|
|
144
156
|
{src ? (
|
|
145
157
|
<img src={src} alt={alt} className="card-media__img" />
|
|
146
158
|
) : (
|
|
@@ -2,20 +2,39 @@ import * as React from "react";
|
|
|
2
2
|
import { cn } from "@/lib/utils";
|
|
3
3
|
|
|
4
4
|
export interface ResourceThumbnailProps {
|
|
5
|
-
|
|
5
|
+
/** Omit to render the placeholder tile instead (pass `children`, e.g. an icon). */
|
|
6
|
+
src?: string;
|
|
6
7
|
alt?: string;
|
|
7
8
|
/**
|
|
8
9
|
* `default` fills its container at 16:9. `preview` keeps the image's own proportions, at most 160px
|
|
9
10
|
* tall (a live preview of a pasted URL). `thumb` is a 56 × 40 table thumbnail.
|
|
10
11
|
*/
|
|
11
12
|
size?: "default" | "preview" | "thumb";
|
|
13
|
+
/** Placeholder content (e.g. an icon) shown when `src` is omitted. */
|
|
14
|
+
children?: React.ReactNode;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
export function ResourceThumbnail({
|
|
15
18
|
src,
|
|
16
19
|
alt = "",
|
|
17
20
|
size = "default",
|
|
21
|
+
children,
|
|
18
22
|
}: ResourceThumbnailProps) {
|
|
23
|
+
if (!src) {
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
className={cn(
|
|
27
|
+
"resource-thumbnail",
|
|
28
|
+
"resource-thumbnail--placeholder",
|
|
29
|
+
size === "preview" && "resource-thumbnail--preview",
|
|
30
|
+
size === "thumb" && "resource-thumbnail--thumb",
|
|
31
|
+
)}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
19
38
|
return (
|
|
20
39
|
<img
|
|
21
40
|
className={cn(
|
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { cn } from "@/lib/utils";
|
|
2
2
|
|
|
3
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Exact width: px when a number, any CSS length when a string (e.g. "60%"). Omit to fill the parent. */
|
|
5
|
+
width?: number | string;
|
|
6
|
+
/** Exact height: px when a number, any CSS length when a string. Omit for the "text" shape's 1-line default. */
|
|
7
|
+
height?: number | string;
|
|
8
|
+
/** "text" (default, a line of copy) | "circle" (avatar/icon) | "rect" (image/media block) */
|
|
9
|
+
shape?: "text" | "circle" | "rect";
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
function Skeleton({
|
|
4
13
|
className,
|
|
14
|
+
width,
|
|
15
|
+
height,
|
|
16
|
+
shape = "text",
|
|
17
|
+
style,
|
|
5
18
|
...props
|
|
6
|
-
}:
|
|
19
|
+
}: SkeletonProps) {
|
|
7
20
|
return (
|
|
8
21
|
<div
|
|
9
|
-
className={cn("skeleton", className)}
|
|
22
|
+
className={cn("skeleton", `skeleton--${shape}`, className)}
|
|
23
|
+
style={{
|
|
24
|
+
...style,
|
|
25
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
26
|
+
height: typeof height === "number" ? `${height}px` : height,
|
|
27
|
+
}}
|
|
10
28
|
{...props}
|
|
11
29
|
/>
|
|
12
30
|
);
|
package/client/global.css
CHANGED
|
@@ -1660,11 +1660,25 @@ body {
|
|
|
1660
1660
|
|
|
1661
1661
|
/* Skeleton Styles */
|
|
1662
1662
|
.skeleton {
|
|
1663
|
+
display: block;
|
|
1664
|
+
width: 100%;
|
|
1663
1665
|
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
1664
|
-
border-radius: calc(var(--radius-md, 8px));
|
|
1665
1666
|
background-color: hsl(var(--muted));
|
|
1666
1667
|
}
|
|
1667
1668
|
|
|
1669
|
+
.skeleton--text {
|
|
1670
|
+
height: 1em;
|
|
1671
|
+
border-radius: calc(var(--radius-sm, 4px));
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
.skeleton--rect {
|
|
1675
|
+
border-radius: calc(var(--radius-md, 8px));
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
.skeleton--circle {
|
|
1679
|
+
border-radius: 9999px;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1668
1682
|
@keyframes pulse {
|
|
1669
1683
|
0%,
|
|
1670
1684
|
100% {
|
|
@@ -2414,6 +2428,14 @@ body {
|
|
|
2414
2428
|
color: var(--color-gray-800, #282a31);
|
|
2415
2429
|
}
|
|
2416
2430
|
|
|
2431
|
+
.card-title--compact {
|
|
2432
|
+
font-family: var(--font-ftmade);
|
|
2433
|
+
font-size: 18px;
|
|
2434
|
+
line-height: 22px;
|
|
2435
|
+
letter-spacing: -0.18px;
|
|
2436
|
+
font-weight: 500;
|
|
2437
|
+
}
|
|
2438
|
+
|
|
2417
2439
|
.card-description {
|
|
2418
2440
|
color: var(--color-gray-600, #52545d);
|
|
2419
2441
|
}
|
|
@@ -2473,6 +2495,19 @@ body {
|
|
|
2473
2495
|
display: block;
|
|
2474
2496
|
}
|
|
2475
2497
|
|
|
2498
|
+
.card-media--placeholder {
|
|
2499
|
+
display: flex;
|
|
2500
|
+
align-items: center;
|
|
2501
|
+
justify-content: center;
|
|
2502
|
+
background: linear-gradient(135deg, var(--color-cyan-50, #fafeff), var(--color-gray-50, #f9f9fa));
|
|
2503
|
+
color: var(--color-gray-400, #9fa2ab);
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
.card-media--placeholder svg {
|
|
2507
|
+
width: 2rem;
|
|
2508
|
+
height: 2rem;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2476
2511
|
/* Card Badge */
|
|
2477
2512
|
.card-badge {
|
|
2478
2513
|
position: absolute;
|
|
@@ -16285,6 +16320,36 @@ body {
|
|
|
16285
16320
|
font-weight: 600;
|
|
16286
16321
|
}
|
|
16287
16322
|
|
|
16323
|
+
.copy p {
|
|
16324
|
+
margin: 0 0 1em;
|
|
16325
|
+
}
|
|
16326
|
+
|
|
16327
|
+
.copy p:last-child {
|
|
16328
|
+
margin-bottom: 0;
|
|
16329
|
+
}
|
|
16330
|
+
|
|
16331
|
+
.copy strong {
|
|
16332
|
+
font-weight: 600;
|
|
16333
|
+
}
|
|
16334
|
+
|
|
16335
|
+
.copy ul,
|
|
16336
|
+
.copy ol {
|
|
16337
|
+
margin: 0 0 1em;
|
|
16338
|
+
padding-left: 1.25rem;
|
|
16339
|
+
}
|
|
16340
|
+
|
|
16341
|
+
.copy ul {
|
|
16342
|
+
list-style: disc;
|
|
16343
|
+
}
|
|
16344
|
+
|
|
16345
|
+
.copy ol {
|
|
16346
|
+
list-style: decimal;
|
|
16347
|
+
}
|
|
16348
|
+
|
|
16349
|
+
.copy li {
|
|
16350
|
+
margin-bottom: 0.25rem;
|
|
16351
|
+
}
|
|
16352
|
+
|
|
16288
16353
|
.copy--italic {
|
|
16289
16354
|
font-style: italic;
|
|
16290
16355
|
}
|
|
@@ -16874,6 +16939,19 @@ body {
|
|
|
16874
16939
|
background: var(--color-neutral-100, #f1f1f1);
|
|
16875
16940
|
}
|
|
16876
16941
|
|
|
16942
|
+
.resource-thumbnail--placeholder {
|
|
16943
|
+
display: flex;
|
|
16944
|
+
align-items: center;
|
|
16945
|
+
justify-content: center;
|
|
16946
|
+
background: linear-gradient(135deg, var(--color-cyan-50, #fafeff), var(--color-gray-50, #f9f9fa));
|
|
16947
|
+
color: var(--color-gray-400, #9fa2ab);
|
|
16948
|
+
}
|
|
16949
|
+
|
|
16950
|
+
.resource-thumbnail--placeholder svg {
|
|
16951
|
+
width: 3rem;
|
|
16952
|
+
height: 3rem;
|
|
16953
|
+
}
|
|
16954
|
+
|
|
16877
16955
|
/* ---------------------------------------------------------------------------
|
|
16878
16956
|
FileAttachment — status + filename + remove, as one attached-file row
|
|
16879
16957
|
--------------------------------------------------------------------------- */
|
|
@@ -61,11 +61,15 @@ const CardHeader = React.forwardRef(({ className, tinted = false, ...props }, re
|
|
|
61
61
|
}
|
|
62
62
|
));
|
|
63
63
|
CardHeader.displayName = "CardHeader";
|
|
64
|
-
const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
64
|
+
const CardTitle = React.forwardRef(({ className, size = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
65
65
|
"h3",
|
|
66
66
|
{
|
|
67
67
|
ref,
|
|
68
|
-
className: cn(
|
|
68
|
+
className: cn(
|
|
69
|
+
"card-title",
|
|
70
|
+
size === "compact" ? "card-title--compact" : "heading-xxsmall",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
69
73
|
...props
|
|
70
74
|
}
|
|
71
75
|
));
|
|
@@ -104,7 +108,16 @@ const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
104
108
|
}
|
|
105
109
|
));
|
|
106
110
|
CardFooter.displayName = "CardFooter";
|
|
107
|
-
const CardMedia = React.forwardRef(({ className, src, alt = "", height = 200, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
111
|
+
const CardMedia = React.forwardRef(({ className, src, alt = "", height = 200, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
ref,
|
|
115
|
+
className: cn("card-media", !src && "card-media--placeholder", className),
|
|
116
|
+
style: { height },
|
|
117
|
+
...props,
|
|
118
|
+
children: src ? /* @__PURE__ */ jsx("img", { src, alt, className: "card-media__img" }) : children
|
|
119
|
+
}
|
|
120
|
+
));
|
|
108
121
|
CardMedia.displayName = "CardMedia";
|
|
109
122
|
const CardBadge = React.forwardRef(
|
|
110
123
|
({ className, color = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
@@ -3,8 +3,23 @@ import { cn } from "../../lib/utils.js";
|
|
|
3
3
|
function ResourceThumbnail({
|
|
4
4
|
src,
|
|
5
5
|
alt = "",
|
|
6
|
-
size = "default"
|
|
6
|
+
size = "default",
|
|
7
|
+
children
|
|
7
8
|
}) {
|
|
9
|
+
if (!src) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
className: cn(
|
|
14
|
+
"resource-thumbnail",
|
|
15
|
+
"resource-thumbnail--placeholder",
|
|
16
|
+
size === "preview" && "resource-thumbnail--preview",
|
|
17
|
+
size === "thumb" && "resource-thumbnail--thumb"
|
|
18
|
+
),
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
8
23
|
return /* @__PURE__ */ jsx(
|
|
9
24
|
"img",
|
|
10
25
|
{
|
|
@@ -2,12 +2,21 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
3
|
function Skeleton({
|
|
4
4
|
className,
|
|
5
|
+
width,
|
|
6
|
+
height,
|
|
7
|
+
shape = "text",
|
|
8
|
+
style,
|
|
5
9
|
...props
|
|
6
10
|
}) {
|
|
7
11
|
return /* @__PURE__ */ jsx(
|
|
8
12
|
"div",
|
|
9
13
|
{
|
|
10
|
-
className: cn("skeleton", className),
|
|
14
|
+
className: cn("skeleton", `skeleton--${shape}`, className),
|
|
15
|
+
style: {
|
|
16
|
+
...style,
|
|
17
|
+
width: typeof width === "number" ? `${width}px` : width,
|
|
18
|
+
height: typeof height === "number" ? `${height}px` : height
|
|
19
|
+
},
|
|
11
20
|
...props
|
|
12
21
|
}
|
|
13
22
|
);
|