design-zystem 1.0.297 → 1.0.299
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/dist/index.d.mts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +43 -5
- package/dist/index.mjs +43 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -390,6 +390,17 @@ interface AvatarBadge {
|
|
|
390
390
|
backgroundColor?: string;
|
|
391
391
|
iconColor?: string;
|
|
392
392
|
}
|
|
393
|
+
interface AvatarPhotoBadge {
|
|
394
|
+
name: string;
|
|
395
|
+
src?: string | null;
|
|
396
|
+
backgroundColor?: string;
|
|
397
|
+
textColor?: string;
|
|
398
|
+
}
|
|
399
|
+
interface AvatarIcon {
|
|
400
|
+
name: string;
|
|
401
|
+
family?: 'solid' | 'regular' | 'light' | 'brands';
|
|
402
|
+
color?: string;
|
|
403
|
+
}
|
|
393
404
|
interface AvatarProps {
|
|
394
405
|
name: string;
|
|
395
406
|
src?: string | null;
|
|
@@ -397,9 +408,14 @@ interface AvatarProps {
|
|
|
397
408
|
textColor?: string;
|
|
398
409
|
size?: number;
|
|
399
410
|
shape?: 'circle' | 'square';
|
|
411
|
+
/** `contain` fits a wide picture — a vehicle, a logo — instead of cropping it to the square. */
|
|
412
|
+
objectFit?: string;
|
|
413
|
+
/** Stands in for a subject that has no portrait — an invoice, a document. `src` wins over it, it wins over the initials. */
|
|
414
|
+
icon?: AvatarIcon | null;
|
|
400
415
|
badge?: AvatarBadge | null;
|
|
416
|
+
avatarBadge?: AvatarPhotoBadge | null;
|
|
401
417
|
}
|
|
402
|
-
declare const Avatar: ({ name, src, backgroundColor, textColor, size, shape, badge, }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
418
|
+
declare const Avatar: ({ name, src, backgroundColor, textColor, size, shape, objectFit, icon, badge, avatarBadge, }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
403
419
|
|
|
404
420
|
interface ButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
405
421
|
label?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -390,6 +390,17 @@ interface AvatarBadge {
|
|
|
390
390
|
backgroundColor?: string;
|
|
391
391
|
iconColor?: string;
|
|
392
392
|
}
|
|
393
|
+
interface AvatarPhotoBadge {
|
|
394
|
+
name: string;
|
|
395
|
+
src?: string | null;
|
|
396
|
+
backgroundColor?: string;
|
|
397
|
+
textColor?: string;
|
|
398
|
+
}
|
|
399
|
+
interface AvatarIcon {
|
|
400
|
+
name: string;
|
|
401
|
+
family?: 'solid' | 'regular' | 'light' | 'brands';
|
|
402
|
+
color?: string;
|
|
403
|
+
}
|
|
393
404
|
interface AvatarProps {
|
|
394
405
|
name: string;
|
|
395
406
|
src?: string | null;
|
|
@@ -397,9 +408,14 @@ interface AvatarProps {
|
|
|
397
408
|
textColor?: string;
|
|
398
409
|
size?: number;
|
|
399
410
|
shape?: 'circle' | 'square';
|
|
411
|
+
/** `contain` fits a wide picture — a vehicle, a logo — instead of cropping it to the square. */
|
|
412
|
+
objectFit?: string;
|
|
413
|
+
/** Stands in for a subject that has no portrait — an invoice, a document. `src` wins over it, it wins over the initials. */
|
|
414
|
+
icon?: AvatarIcon | null;
|
|
400
415
|
badge?: AvatarBadge | null;
|
|
416
|
+
avatarBadge?: AvatarPhotoBadge | null;
|
|
401
417
|
}
|
|
402
|
-
declare const Avatar: ({ name, src, backgroundColor, textColor, size, shape, badge, }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
418
|
+
declare const Avatar: ({ name, src, backgroundColor, textColor, size, shape, objectFit, icon, badge, avatarBadge, }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
403
419
|
|
|
404
420
|
interface ButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
405
421
|
label?: string;
|
package/dist/index.js
CHANGED
|
@@ -2254,6 +2254,21 @@ var BadgeIcon = import_styled_components18.default.i`
|
|
|
2254
2254
|
font-size: ${(props) => Math.round(props.$size * 0.2)}px;
|
|
2255
2255
|
line-height: 2;
|
|
2256
2256
|
`;
|
|
2257
|
+
var AvatarBadgeSlot = import_styled_components18.default.div`
|
|
2258
|
+
position: absolute;
|
|
2259
|
+
right: 0;
|
|
2260
|
+
bottom: 0;
|
|
2261
|
+
padding: ${(props) => Math.max(1, Math.round(props.$size * 0.05))}px;
|
|
2262
|
+
background-color: ${colors.white};
|
|
2263
|
+
border-radius: 50%;
|
|
2264
|
+
box-shadow: 0 2px 6px ${colors.blue_950}66;
|
|
2265
|
+
line-height: 0;
|
|
2266
|
+
`;
|
|
2267
|
+
var MainIcon = import_styled_components18.default.i`
|
|
2268
|
+
color: ${(props) => props.$color};
|
|
2269
|
+
font-size: ${(props) => Math.round(props.$size * 0.45)}px;
|
|
2270
|
+
line-height: 1;
|
|
2271
|
+
`;
|
|
2257
2272
|
var Initials = import_styled_components18.default.span`
|
|
2258
2273
|
color: ${(props) => props.$textColor};
|
|
2259
2274
|
font-weight: 600;
|
|
@@ -2273,9 +2288,12 @@ var Avatar = ({
|
|
|
2273
2288
|
textColor,
|
|
2274
2289
|
size = 56,
|
|
2275
2290
|
shape = "circle",
|
|
2276
|
-
|
|
2291
|
+
objectFit,
|
|
2292
|
+
icon,
|
|
2293
|
+
badge,
|
|
2294
|
+
avatarBadge
|
|
2277
2295
|
}) => {
|
|
2278
|
-
var _a, _b, _c;
|
|
2296
|
+
var _a, _b, _c, _d;
|
|
2279
2297
|
const [hasImageError, setHasImageError] = (0, import_react10.useState)(false);
|
|
2280
2298
|
const resolvedBackground = resolveColor3(backgroundColor, colors.grey_300);
|
|
2281
2299
|
const resolvedText = resolveColor3(textColor, colors.dark);
|
|
@@ -2297,17 +2315,36 @@ var Avatar = ({
|
|
|
2297
2315
|
width: sizePx,
|
|
2298
2316
|
height: sizePx,
|
|
2299
2317
|
borderRadius,
|
|
2318
|
+
objectFit,
|
|
2300
2319
|
onError: () => setHasImageError(true)
|
|
2301
2320
|
}
|
|
2321
|
+
) : icon ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2322
|
+
MainIcon,
|
|
2323
|
+
{
|
|
2324
|
+
$size: size,
|
|
2325
|
+
$color: resolveColor3(icon.color, resolvedText),
|
|
2326
|
+
className: `fa-${(_a = icon.family) != null ? _a : "regular"} fa-${icon.name}`,
|
|
2327
|
+
role: "img",
|
|
2328
|
+
"aria-label": name
|
|
2329
|
+
}
|
|
2302
2330
|
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Initials, { $textColor: resolvedText, $size: size, children: initials })
|
|
2303
2331
|
}
|
|
2304
2332
|
),
|
|
2305
|
-
|
|
2333
|
+
avatarBadge ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AvatarBadgeSlot, { $size: size, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2334
|
+
Avatar,
|
|
2335
|
+
{
|
|
2336
|
+
name: avatarBadge.name,
|
|
2337
|
+
src: avatarBadge.src,
|
|
2338
|
+
backgroundColor: avatarBadge.backgroundColor,
|
|
2339
|
+
textColor: avatarBadge.textColor,
|
|
2340
|
+
size: Math.round(size * 0.4)
|
|
2341
|
+
}
|
|
2342
|
+
) }) : badge && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(BadgeSlot, { $size: size, $bg: (_b = badge.backgroundColor) != null ? _b : colors.white, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2306
2343
|
BadgeIcon,
|
|
2307
2344
|
{
|
|
2308
2345
|
$size: size,
|
|
2309
|
-
$color: (
|
|
2310
|
-
className: `fa-${(
|
|
2346
|
+
$color: (_c = badge.iconColor) != null ? _c : colors.blue_950,
|
|
2347
|
+
className: `fa-${(_d = badge.family) != null ? _d : "regular"} fa-${badge.name}`
|
|
2311
2348
|
}
|
|
2312
2349
|
) })
|
|
2313
2350
|
] });
|
|
@@ -5335,6 +5372,7 @@ var MetricCard = ({
|
|
|
5335
5372
|
padding: "16px",
|
|
5336
5373
|
borderRadius: "6px",
|
|
5337
5374
|
alignSelf,
|
|
5375
|
+
alignItems: "center",
|
|
5338
5376
|
style: {
|
|
5339
5377
|
flex: 1,
|
|
5340
5378
|
border: checked ? `1px solid ${colors.blue_950}` : void 0,
|
package/dist/index.mjs
CHANGED
|
@@ -2113,6 +2113,21 @@ var BadgeIcon = styled18.i`
|
|
|
2113
2113
|
font-size: ${(props) => Math.round(props.$size * 0.2)}px;
|
|
2114
2114
|
line-height: 2;
|
|
2115
2115
|
`;
|
|
2116
|
+
var AvatarBadgeSlot = styled18.div`
|
|
2117
|
+
position: absolute;
|
|
2118
|
+
right: 0;
|
|
2119
|
+
bottom: 0;
|
|
2120
|
+
padding: ${(props) => Math.max(1, Math.round(props.$size * 0.05))}px;
|
|
2121
|
+
background-color: ${colors.white};
|
|
2122
|
+
border-radius: 50%;
|
|
2123
|
+
box-shadow: 0 2px 6px ${colors.blue_950}66;
|
|
2124
|
+
line-height: 0;
|
|
2125
|
+
`;
|
|
2126
|
+
var MainIcon = styled18.i`
|
|
2127
|
+
color: ${(props) => props.$color};
|
|
2128
|
+
font-size: ${(props) => Math.round(props.$size * 0.45)}px;
|
|
2129
|
+
line-height: 1;
|
|
2130
|
+
`;
|
|
2116
2131
|
var Initials = styled18.span`
|
|
2117
2132
|
color: ${(props) => props.$textColor};
|
|
2118
2133
|
font-weight: 600;
|
|
@@ -2132,9 +2147,12 @@ var Avatar = ({
|
|
|
2132
2147
|
textColor,
|
|
2133
2148
|
size = 56,
|
|
2134
2149
|
shape = "circle",
|
|
2135
|
-
|
|
2150
|
+
objectFit,
|
|
2151
|
+
icon,
|
|
2152
|
+
badge,
|
|
2153
|
+
avatarBadge
|
|
2136
2154
|
}) => {
|
|
2137
|
-
var _a, _b, _c;
|
|
2155
|
+
var _a, _b, _c, _d;
|
|
2138
2156
|
const [hasImageError, setHasImageError] = useState5(false);
|
|
2139
2157
|
const resolvedBackground = resolveColor3(backgroundColor, colors.grey_300);
|
|
2140
2158
|
const resolvedText = resolveColor3(textColor, colors.dark);
|
|
@@ -2156,17 +2174,36 @@ var Avatar = ({
|
|
|
2156
2174
|
width: sizePx,
|
|
2157
2175
|
height: sizePx,
|
|
2158
2176
|
borderRadius,
|
|
2177
|
+
objectFit,
|
|
2159
2178
|
onError: () => setHasImageError(true)
|
|
2160
2179
|
}
|
|
2180
|
+
) : icon ? /* @__PURE__ */ jsx22(
|
|
2181
|
+
MainIcon,
|
|
2182
|
+
{
|
|
2183
|
+
$size: size,
|
|
2184
|
+
$color: resolveColor3(icon.color, resolvedText),
|
|
2185
|
+
className: `fa-${(_a = icon.family) != null ? _a : "regular"} fa-${icon.name}`,
|
|
2186
|
+
role: "img",
|
|
2187
|
+
"aria-label": name
|
|
2188
|
+
}
|
|
2161
2189
|
) : /* @__PURE__ */ jsx22(Initials, { $textColor: resolvedText, $size: size, children: initials })
|
|
2162
2190
|
}
|
|
2163
2191
|
),
|
|
2164
|
-
|
|
2192
|
+
avatarBadge ? /* @__PURE__ */ jsx22(AvatarBadgeSlot, { $size: size, children: /* @__PURE__ */ jsx22(
|
|
2193
|
+
Avatar,
|
|
2194
|
+
{
|
|
2195
|
+
name: avatarBadge.name,
|
|
2196
|
+
src: avatarBadge.src,
|
|
2197
|
+
backgroundColor: avatarBadge.backgroundColor,
|
|
2198
|
+
textColor: avatarBadge.textColor,
|
|
2199
|
+
size: Math.round(size * 0.4)
|
|
2200
|
+
}
|
|
2201
|
+
) }) : badge && /* @__PURE__ */ jsx22(BadgeSlot, { $size: size, $bg: (_b = badge.backgroundColor) != null ? _b : colors.white, children: /* @__PURE__ */ jsx22(
|
|
2165
2202
|
BadgeIcon,
|
|
2166
2203
|
{
|
|
2167
2204
|
$size: size,
|
|
2168
|
-
$color: (
|
|
2169
|
-
className: `fa-${(
|
|
2205
|
+
$color: (_c = badge.iconColor) != null ? _c : colors.blue_950,
|
|
2206
|
+
className: `fa-${(_d = badge.family) != null ? _d : "regular"} fa-${badge.name}`
|
|
2170
2207
|
}
|
|
2171
2208
|
) })
|
|
2172
2209
|
] });
|
|
@@ -5214,6 +5251,7 @@ var MetricCard = ({
|
|
|
5214
5251
|
padding: "16px",
|
|
5215
5252
|
borderRadius: "6px",
|
|
5216
5253
|
alignSelf,
|
|
5254
|
+
alignItems: "center",
|
|
5217
5255
|
style: {
|
|
5218
5256
|
flex: 1,
|
|
5219
5257
|
border: checked ? `1px solid ${colors.blue_950}` : void 0,
|