@wistia/ui 3.4.0 → 3.4.1-beta.553fcfef.3cd9c64
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.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +165 -153
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/CHANGELOG.md +0 -2594
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v3.4.
|
|
3
|
+
* @license @wistia/ui v3.4.1-beta.553fcfef.3cd9c64
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
11
11
|
import { Children, Fragment, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
|
|
12
12
|
import { createGlobalStyle, css, keyframes, styled } from "styled-components";
|
|
13
|
-
import { isArray, isBoolean, isDate, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined, noOpFn } from "@wistia/
|
|
13
|
+
import { isArray, isBoolean, isDate, isEmptyString, isFunction, isNil, isNonEmptyArray, isNonEmptyString, isNotNil, isNotUndefined, isNumber, isRecord, isString, isUndefined, noOpFn } from "@wistia/utils";
|
|
14
14
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { Toaster, toast } from "sonner";
|
|
16
16
|
import { getValueAndUnit } from "polished";
|
|
@@ -1902,7 +1902,7 @@ const usePreviousValue = (value) => {
|
|
|
1902
1902
|
const lineClampCss = ($lines = 1) => css`
|
|
1903
1903
|
-webkit-box-orient: vertical;
|
|
1904
1904
|
-webkit-line-clamp: ${$lines};
|
|
1905
|
-
display: -webkit-box
|
|
1905
|
+
display: -webkit-box;
|
|
1906
1906
|
white-space: initial;
|
|
1907
1907
|
`;
|
|
1908
1908
|
//#endregion
|
|
@@ -6939,13 +6939,6 @@ const PolymorphicStyledHeading = withPolymorphicAs(styled.div`
|
|
|
6939
6939
|
line-height: var(--line-height);
|
|
6940
6940
|
color: var(--text-color);
|
|
6941
6941
|
${({ $variant }) => headingVariantStyleMap[$variant]}
|
|
6942
|
-
${({ $maxLines, $wordBreak }) => {
|
|
6943
|
-
if (isNotNil($maxLines)) return css`
|
|
6944
|
-
${ellipsisStyle};
|
|
6945
|
-
${lineClampCss($maxLines)};
|
|
6946
|
-
${wordBreakCss($wordBreak)};
|
|
6947
|
-
`;
|
|
6948
|
-
}}
|
|
6949
6942
|
${({ $inline }) => $inline && css`
|
|
6950
6943
|
display: inline-block;
|
|
6951
6944
|
`}
|
|
@@ -6961,6 +6954,13 @@ const PolymorphicStyledHeading = withPolymorphicAs(styled.div`
|
|
|
6961
6954
|
margin: 0;
|
|
6962
6955
|
|
|
6963
6956
|
${iconInlineStyle}
|
|
6957
|
+
${({ $maxLines, $wordBreak }) => {
|
|
6958
|
+
if (isNotNil($maxLines)) return css`
|
|
6959
|
+
${ellipsisStyle};
|
|
6960
|
+
${lineClampCss($maxLines)};
|
|
6961
|
+
${wordBreakCss($wordBreak)};
|
|
6962
|
+
`;
|
|
6963
|
+
}}
|
|
6964
6964
|
`);
|
|
6965
6965
|
const headingVariantElementMap = {
|
|
6966
6966
|
hero: DEFAULT_ELEMENT$3,
|
|
@@ -7168,13 +7168,6 @@ const PolymorphicStyledText = withPolymorphicAs(styled.div`
|
|
|
7168
7168
|
font-style: normal;
|
|
7169
7169
|
margin: 0;
|
|
7170
7170
|
${({ $variant }) => textVariantStyleMap[$variant]}
|
|
7171
|
-
${({ $maxLines, $wordBreak }) => {
|
|
7172
|
-
if (isNotNil($maxLines)) return css`
|
|
7173
|
-
${ellipsisStyle};
|
|
7174
|
-
${lineClampCss($maxLines)};
|
|
7175
|
-
${wordBreakCss($wordBreak)};
|
|
7176
|
-
`;
|
|
7177
|
-
}}
|
|
7178
7171
|
${({ $inline }) => $inline && css`
|
|
7179
7172
|
display: inline-block;
|
|
7180
7173
|
`}
|
|
@@ -7197,6 +7190,13 @@ const PolymorphicStyledText = withPolymorphicAs(styled.div`
|
|
|
7197
7190
|
margin-top: var(--paragraph-spacing, var(--wui-space-04));
|
|
7198
7191
|
}
|
|
7199
7192
|
`}
|
|
7193
|
+
${({ $maxLines, $wordBreak }) => {
|
|
7194
|
+
if (isNotNil($maxLines)) return css`
|
|
7195
|
+
${ellipsisStyle};
|
|
7196
|
+
${lineClampCss($maxLines)};
|
|
7197
|
+
${wordBreakCss($wordBreak)};
|
|
7198
|
+
`;
|
|
7199
|
+
}}
|
|
7200
7200
|
`);
|
|
7201
7201
|
const TextComponent = ({ ref, align = "left", children, colorScheme = "inherit", disabled = false, inline = false, maxChars, preventUserSelect = false, prominence = "primary", maxLines, textTransform, wordBreak = "anywhere", variant = "body2", renderAs, ...props }) => {
|
|
7202
7202
|
const processedChildren = applyMaxCharsToChildren(children, maxChars);
|
|
@@ -9262,6 +9262,112 @@ const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name,
|
|
|
9262
9262
|
});
|
|
9263
9263
|
};
|
|
9264
9264
|
//#endregion
|
|
9265
|
+
//#region src/components/RadioCard/RadioCardIndicator.tsx
|
|
9266
|
+
const RadioCardIndicator = styled.div`
|
|
9267
|
+
--wui-radio-card-indicator-size: 14px;
|
|
9268
|
+
--wui-radio-card-indicator-background-color: var(--wui-color-bg-surface);
|
|
9269
|
+
--wui-radio-card-indicator-fill-color: var(--wui-color-bg-fill);
|
|
9270
|
+
|
|
9271
|
+
/* TODO: figure out radio / checkbox / switch colors */
|
|
9272
|
+
--wui-radio-card-indicator-border-color: var(--wui-color-border-secondary-active);
|
|
9273
|
+
|
|
9274
|
+
width: var(--wui-radio-card-indicator-size);
|
|
9275
|
+
height: var(--wui-radio-card-indicator-size);
|
|
9276
|
+
min-width: var(--wui-radio-card-indicator-size);
|
|
9277
|
+
min-height: var(--wui-radio-card-indicator-size);
|
|
9278
|
+
background-color: var(--wui-radio-card-indicator-background-color);
|
|
9279
|
+
box-shadow: inset 0 0 0 1px var(--wui-radio-card-indicator-border-color);
|
|
9280
|
+
border-radius: 100%;
|
|
9281
|
+
position: relative;
|
|
9282
|
+
cursor: pointer;
|
|
9283
|
+
transition: border-color var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
9284
|
+
|
|
9285
|
+
&::after {
|
|
9286
|
+
content: '';
|
|
9287
|
+
position: absolute;
|
|
9288
|
+
top: 50%;
|
|
9289
|
+
left: 50%;
|
|
9290
|
+
width: 0;
|
|
9291
|
+
height: 0;
|
|
9292
|
+
background-color: var(--wui-radio-card-indicator-fill-color);
|
|
9293
|
+
border-radius: 100%;
|
|
9294
|
+
transform: translate(-50%, -50%);
|
|
9295
|
+
}
|
|
9296
|
+
|
|
9297
|
+
${StyledCard}:has(input:checked) & {
|
|
9298
|
+
--wui-radio-card-indicator-border-color: var(--wui-color-focus-ring);
|
|
9299
|
+
--wui-radio-card-indicator-fill-color: var(--wui-color-focus-ring);
|
|
9300
|
+
|
|
9301
|
+
&::after {
|
|
9302
|
+
width: calc(var(--wui-radio-card-indicator-size) / 2);
|
|
9303
|
+
height: calc(var(--wui-radio-card-indicator-size) / 2);
|
|
9304
|
+
}
|
|
9305
|
+
}
|
|
9306
|
+
|
|
9307
|
+
${StyledCard}:has(input:disabled) & {
|
|
9308
|
+
--wui-radio-card-indicator-border-color: var(--wui-color-border-secondary);
|
|
9309
|
+
--wui-radio-card-indicator-background-color: var(--wui-color-bg-surface-disabled);
|
|
9310
|
+
}
|
|
9311
|
+
`;
|
|
9312
|
+
RadioCardIndicator.displayName = "RadioCardIndicator_UI";
|
|
9313
|
+
//#endregion
|
|
9314
|
+
//#region src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
9315
|
+
const StyledCardContent$1 = styled.div`
|
|
9316
|
+
display: grid;
|
|
9317
|
+
grid-auto-flow: column;
|
|
9318
|
+
gap: var(--wui-space-02);
|
|
9319
|
+
`;
|
|
9320
|
+
const StyledCardIcon$1 = styled.div`
|
|
9321
|
+
display: contents;
|
|
9322
|
+
`;
|
|
9323
|
+
const StyledGatedIcon = styled.div`
|
|
9324
|
+
position: absolute;
|
|
9325
|
+
right: 10px;
|
|
9326
|
+
top: 10px;
|
|
9327
|
+
z-index: 1;
|
|
9328
|
+
`;
|
|
9329
|
+
const StyledIndicatorContainer$1 = styled.div`
|
|
9330
|
+
height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
|
|
9331
|
+
display: flex;
|
|
9332
|
+
align-items: center;
|
|
9333
|
+
`;
|
|
9334
|
+
const RadioCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
|
|
9335
|
+
const gatedIcon = useGatedIcon();
|
|
9336
|
+
return /* @__PURE__ */ jsxs(StyledCardContent$1, { children: [
|
|
9337
|
+
showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer$1, {
|
|
9338
|
+
$hasIcon: isNotNil(icon),
|
|
9339
|
+
children: /* @__PURE__ */ jsx(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" })
|
|
9340
|
+
}) : null,
|
|
9341
|
+
isGated ? /* @__PURE__ */ jsx(StyledGatedIcon, {
|
|
9342
|
+
"data-testid": "wui-radio-gated-icon",
|
|
9343
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
9344
|
+
colorScheme: "purple",
|
|
9345
|
+
"data-testid": "wui-icon-sparkle",
|
|
9346
|
+
type: gatedIcon
|
|
9347
|
+
})
|
|
9348
|
+
}) : null,
|
|
9349
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
9350
|
+
gap: "space-02",
|
|
9351
|
+
children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon$1, {
|
|
9352
|
+
"data-wui-radio-card-icon": true,
|
|
9353
|
+
children: icon
|
|
9354
|
+
}), /* @__PURE__ */ jsxs(Stack, {
|
|
9355
|
+
gap: "space-01",
|
|
9356
|
+
style: isNotNil(icon) ? { paddingLeft: 2 } : void 0,
|
|
9357
|
+
children: [isNotNil(label) && /* @__PURE__ */ jsx(Text, {
|
|
9358
|
+
variant: "label3",
|
|
9359
|
+
children: /* @__PURE__ */ jsx("strong", { children: label })
|
|
9360
|
+
}), isNotNil(description) && /* @__PURE__ */ jsx(Text, {
|
|
9361
|
+
prominence: "secondary",
|
|
9362
|
+
variant: "body3",
|
|
9363
|
+
children: description
|
|
9364
|
+
})]
|
|
9365
|
+
})]
|
|
9366
|
+
})
|
|
9367
|
+
] });
|
|
9368
|
+
};
|
|
9369
|
+
RadioCardDefaultLayout.displayName = "RadioCardDefaultLayout_UI";
|
|
9370
|
+
//#endregion
|
|
9265
9371
|
//#region src/components/CheckboxCard/CheckboxCardIndicator.tsx
|
|
9266
9372
|
const CheckIcon = () => /* @__PURE__ */ jsx("svg", {
|
|
9267
9373
|
fill: "inherit",
|
|
@@ -9323,33 +9429,27 @@ const CheckboxCardIndicator = (props) => /* @__PURE__ */ jsx(StyledIndicator, {
|
|
|
9323
9429
|
CheckboxCardIndicator.displayName = "CheckboxCardIndicator_UI";
|
|
9324
9430
|
//#endregion
|
|
9325
9431
|
//#region src/components/CheckboxCard/CheckboxCardDefaultLayout.tsx
|
|
9326
|
-
const StyledCardContent
|
|
9432
|
+
const StyledCardContent = styled.div`
|
|
9327
9433
|
display: grid;
|
|
9328
9434
|
grid-auto-flow: column;
|
|
9329
9435
|
gap: var(--wui-space-02);
|
|
9330
9436
|
`;
|
|
9331
|
-
const StyledCardIcon
|
|
9437
|
+
const StyledCardIcon = styled.div`
|
|
9332
9438
|
display: contents;
|
|
9333
9439
|
`;
|
|
9334
|
-
const
|
|
9335
|
-
position: absolute;
|
|
9336
|
-
right: 10px;
|
|
9337
|
-
top: 10px;
|
|
9338
|
-
z-index: 1;
|
|
9339
|
-
`;
|
|
9340
|
-
const StyledIndicatorContainer$1 = styled.div`
|
|
9440
|
+
const StyledIndicatorContainer = styled.div`
|
|
9341
9441
|
height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
|
|
9342
9442
|
display: flex;
|
|
9343
9443
|
align-items: center;
|
|
9344
9444
|
`;
|
|
9345
9445
|
const CheckboxCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
|
|
9346
9446
|
const gatedIcon = useGatedIcon();
|
|
9347
|
-
return /* @__PURE__ */ jsxs(StyledCardContent
|
|
9348
|
-
showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer
|
|
9447
|
+
return /* @__PURE__ */ jsxs(StyledCardContent, { children: [
|
|
9448
|
+
showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer, {
|
|
9349
9449
|
$hasIcon: isNotNil(icon),
|
|
9350
9450
|
children: /* @__PURE__ */ jsx(CheckboxCardIndicator, { "data-testid": "wui-checkbox-card-indicator" })
|
|
9351
9451
|
}) : null,
|
|
9352
|
-
isGated ? /* @__PURE__ */ jsx(StyledGatedIcon
|
|
9452
|
+
isGated ? /* @__PURE__ */ jsx(StyledGatedIcon, {
|
|
9353
9453
|
"data-testid": "wui-checkbox-gated-icon",
|
|
9354
9454
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
9355
9455
|
colorScheme: "purple",
|
|
@@ -9359,7 +9459,7 @@ const CheckboxCardDefaultLayout = ({ icon, label, description, showIndicator = t
|
|
|
9359
9459
|
}) : null,
|
|
9360
9460
|
/* @__PURE__ */ jsxs(Stack, {
|
|
9361
9461
|
gap: "space-02",
|
|
9362
|
-
children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon
|
|
9462
|
+
children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon, {
|
|
9363
9463
|
"data-wui-checkbox-card-icon": true,
|
|
9364
9464
|
children: icon
|
|
9365
9465
|
}), /* @__PURE__ */ jsxs(Stack, {
|
|
@@ -12417,6 +12517,27 @@ const PopoverCloseButton = ({ label = "Close" }) => /* @__PURE__ */ jsx(PopoverC
|
|
|
12417
12517
|
}) });
|
|
12418
12518
|
PopoverCloseButton.displayName = "PopoverCloseButton_UI";
|
|
12419
12519
|
//#endregion
|
|
12520
|
+
//#region src/components/Popover/withDefaultCollisionAvoidance.ts
|
|
12521
|
+
/**
|
|
12522
|
+
* Resolves PopoverContent's `collisionAvoidance` prop one field at a time.
|
|
12523
|
+
* Base UI fills omitted fields with its own defaults (`align: 'flip'`,
|
|
12524
|
+
* `fallbackAxisSide: 'end'`), so this fills them with ours instead. A
|
|
12525
|
+
* `side: 'shift'` object only allows `align: 'shift' | 'none'`, hence the branch.
|
|
12526
|
+
*/
|
|
12527
|
+
const withDefaultCollisionAvoidance = (collisionAvoidance = {}) => {
|
|
12528
|
+
const fallbackAxisSide = collisionAvoidance.fallbackAxisSide ?? "none";
|
|
12529
|
+
if (collisionAvoidance.side === "shift") return {
|
|
12530
|
+
side: "shift",
|
|
12531
|
+
align: collisionAvoidance.align ?? "shift",
|
|
12532
|
+
fallbackAxisSide
|
|
12533
|
+
};
|
|
12534
|
+
return {
|
|
12535
|
+
side: collisionAvoidance.side ?? "flip",
|
|
12536
|
+
align: collisionAvoidance.align ?? "shift",
|
|
12537
|
+
fallbackAxisSide
|
|
12538
|
+
};
|
|
12539
|
+
};
|
|
12540
|
+
//#endregion
|
|
12420
12541
|
//#region src/components/Popover/PopoverContent.tsx
|
|
12421
12542
|
const StyledPopup$2 = styled(Popover$1.Popup)`
|
|
12422
12543
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12444,7 +12565,7 @@ const DEFAULT_MAX_HEIGHT = "auto";
|
|
|
12444
12565
|
* The styled popover surface. Place inside a `PopoverRoot` (typically wrapped
|
|
12445
12566
|
* in a `PopoverPortal`). Wraps a `Positioner` and `Popup` internally.
|
|
12446
12567
|
*/
|
|
12447
|
-
const PopoverContent = ({ colorScheme = "inherit", unstyled = false, maxWidth = DEFAULT_MAX_WIDTH, maxHeight = DEFAULT_MAX_HEIGHT, sideOffset = DEFAULT_SIDE_OFFSET, side, align, style, role = "dialog", children, ref, ...props }) => {
|
|
12568
|
+
const PopoverContent = ({ colorScheme = "inherit", unstyled = false, maxWidth = DEFAULT_MAX_WIDTH, maxHeight = DEFAULT_MAX_HEIGHT, sideOffset = DEFAULT_SIDE_OFFSET, side, align, collisionAvoidance, style, role = "dialog", children, ref, ...props }) => {
|
|
12448
12569
|
const sharedAnchorRef = usePopoverAnchor();
|
|
12449
12570
|
const hasAnchor = sharedAnchorRef?.current != null;
|
|
12450
12571
|
const mergedStyle = {
|
|
@@ -12454,11 +12575,7 @@ const PopoverContent = ({ colorScheme = "inherit", unstyled = false, maxWidth =
|
|
|
12454
12575
|
};
|
|
12455
12576
|
return /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
12456
12577
|
align,
|
|
12457
|
-
collisionAvoidance:
|
|
12458
|
-
side: "flip",
|
|
12459
|
-
align: "shift",
|
|
12460
|
-
fallbackAxisSide: "none"
|
|
12461
|
-
},
|
|
12578
|
+
collisionAvoidance: withDefaultCollisionAvoidance(collisionAvoidance),
|
|
12462
12579
|
side,
|
|
12463
12580
|
sideOffset,
|
|
12464
12581
|
style: { zIndex: "var(--wui-zindex-popover)" },
|
|
@@ -15389,7 +15506,7 @@ const spacesStyle = css`
|
|
|
15389
15506
|
|
|
15390
15507
|
&:last-child {
|
|
15391
15508
|
&::after {
|
|
15392
|
-
content: ''
|
|
15509
|
+
content: '';
|
|
15393
15510
|
padding-right: 0;
|
|
15394
15511
|
}
|
|
15395
15512
|
}
|
|
@@ -15400,7 +15517,7 @@ const commasStyle = css`
|
|
|
15400
15517
|
|
|
15401
15518
|
li {
|
|
15402
15519
|
&::after {
|
|
15403
|
-
content: ','
|
|
15520
|
+
content: ',';
|
|
15404
15521
|
padding-right: var(--wui-space-01);
|
|
15405
15522
|
}
|
|
15406
15523
|
}
|
|
@@ -15410,7 +15527,7 @@ const slashesStyle = css`
|
|
|
15410
15527
|
|
|
15411
15528
|
li {
|
|
15412
15529
|
&::after {
|
|
15413
|
-
content: '/'
|
|
15530
|
+
content: '/';
|
|
15414
15531
|
padding-left: var(--wui-space-01);
|
|
15415
15532
|
padding-right: var(--wui-space-01);
|
|
15416
15533
|
}
|
|
@@ -15421,7 +15538,7 @@ const breadcrumbsStyle = css`
|
|
|
15421
15538
|
|
|
15422
15539
|
li {
|
|
15423
15540
|
&::after {
|
|
15424
|
-
content: '>'
|
|
15541
|
+
content: '>';
|
|
15425
15542
|
padding-left: var(--wui-space-01);
|
|
15426
15543
|
padding-right: var(--wui-space-01);
|
|
15427
15544
|
}
|
|
@@ -16289,112 +16406,6 @@ const RadioCardChildrenContainer = styled.div`
|
|
|
16289
16406
|
flex: 1 1 auto;
|
|
16290
16407
|
`;
|
|
16291
16408
|
//#endregion
|
|
16292
|
-
//#region src/components/RadioCard/RadioCardIndicator.tsx
|
|
16293
|
-
const RadioCardIndicator = styled.div`
|
|
16294
|
-
--wui-radio-card-indicator-size: 14px;
|
|
16295
|
-
--wui-radio-card-indicator-background-color: var(--wui-color-bg-surface);
|
|
16296
|
-
--wui-radio-card-indicator-fill-color: var(--wui-color-bg-fill);
|
|
16297
|
-
|
|
16298
|
-
/* TODO: figure out radio / checkbox / switch colors */
|
|
16299
|
-
--wui-radio-card-indicator-border-color: var(--wui-color-border-secondary-active);
|
|
16300
|
-
|
|
16301
|
-
width: var(--wui-radio-card-indicator-size);
|
|
16302
|
-
height: var(--wui-radio-card-indicator-size);
|
|
16303
|
-
min-width: var(--wui-radio-card-indicator-size);
|
|
16304
|
-
min-height: var(--wui-radio-card-indicator-size);
|
|
16305
|
-
background-color: var(--wui-radio-card-indicator-background-color);
|
|
16306
|
-
box-shadow: inset 0 0 0 1px var(--wui-radio-card-indicator-border-color);
|
|
16307
|
-
border-radius: 100%;
|
|
16308
|
-
position: relative;
|
|
16309
|
-
cursor: pointer;
|
|
16310
|
-
transition: border-color var(--wui-motion-duration-03) var(--wui-motion-ease);
|
|
16311
|
-
|
|
16312
|
-
&::after {
|
|
16313
|
-
content: '';
|
|
16314
|
-
position: absolute;
|
|
16315
|
-
top: 50%;
|
|
16316
|
-
left: 50%;
|
|
16317
|
-
width: 0;
|
|
16318
|
-
height: 0;
|
|
16319
|
-
background-color: var(--wui-radio-card-indicator-fill-color);
|
|
16320
|
-
border-radius: 100%;
|
|
16321
|
-
transform: translate(-50%, -50%);
|
|
16322
|
-
}
|
|
16323
|
-
|
|
16324
|
-
${StyledCard}:has(input:checked) & {
|
|
16325
|
-
--wui-radio-card-indicator-border-color: var(--wui-color-focus-ring);
|
|
16326
|
-
--wui-radio-card-indicator-fill-color: var(--wui-color-focus-ring);
|
|
16327
|
-
|
|
16328
|
-
&::after {
|
|
16329
|
-
width: calc(var(--wui-radio-card-indicator-size) / 2);
|
|
16330
|
-
height: calc(var(--wui-radio-card-indicator-size) / 2);
|
|
16331
|
-
}
|
|
16332
|
-
}
|
|
16333
|
-
|
|
16334
|
-
${StyledCard}:has(input:disabled) & {
|
|
16335
|
-
--wui-radio-card-indicator-border-color: var(--wui-color-border-secondary);
|
|
16336
|
-
--wui-radio-card-indicator-background-color: var(--wui-color-bg-surface-disabled);
|
|
16337
|
-
}
|
|
16338
|
-
`;
|
|
16339
|
-
RadioCardIndicator.displayName = "RadioCardIndicator_UI";
|
|
16340
|
-
//#endregion
|
|
16341
|
-
//#region src/components/RadioCard/RadioCardDefaultLayout.tsx
|
|
16342
|
-
const StyledCardContent = styled.div`
|
|
16343
|
-
display: grid;
|
|
16344
|
-
grid-auto-flow: column;
|
|
16345
|
-
gap: var(--wui-space-02);
|
|
16346
|
-
`;
|
|
16347
|
-
const StyledCardIcon = styled.div`
|
|
16348
|
-
display: contents;
|
|
16349
|
-
`;
|
|
16350
|
-
const StyledGatedIcon = styled.div`
|
|
16351
|
-
position: absolute;
|
|
16352
|
-
right: 10px;
|
|
16353
|
-
top: 10px;
|
|
16354
|
-
z-index: 1;
|
|
16355
|
-
`;
|
|
16356
|
-
const StyledIndicatorContainer = styled.div`
|
|
16357
|
-
height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
|
|
16358
|
-
display: flex;
|
|
16359
|
-
align-items: center;
|
|
16360
|
-
`;
|
|
16361
|
-
const RadioCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
|
|
16362
|
-
const gatedIcon = useGatedIcon();
|
|
16363
|
-
return /* @__PURE__ */ jsxs(StyledCardContent, { children: [
|
|
16364
|
-
showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer, {
|
|
16365
|
-
$hasIcon: isNotNil(icon),
|
|
16366
|
-
children: /* @__PURE__ */ jsx(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" })
|
|
16367
|
-
}) : null,
|
|
16368
|
-
isGated ? /* @__PURE__ */ jsx(StyledGatedIcon, {
|
|
16369
|
-
"data-testid": "wui-radio-gated-icon",
|
|
16370
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
16371
|
-
colorScheme: "purple",
|
|
16372
|
-
"data-testid": "wui-icon-sparkle",
|
|
16373
|
-
type: gatedIcon
|
|
16374
|
-
})
|
|
16375
|
-
}) : null,
|
|
16376
|
-
/* @__PURE__ */ jsxs(Stack, {
|
|
16377
|
-
gap: "space-02",
|
|
16378
|
-
children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon, {
|
|
16379
|
-
"data-wui-radio-card-icon": true,
|
|
16380
|
-
children: icon
|
|
16381
|
-
}), /* @__PURE__ */ jsxs(Stack, {
|
|
16382
|
-
gap: "space-01",
|
|
16383
|
-
style: isNotNil(icon) ? { paddingLeft: 2 } : void 0,
|
|
16384
|
-
children: [isNotNil(label) && /* @__PURE__ */ jsx(Text, {
|
|
16385
|
-
variant: "label3",
|
|
16386
|
-
children: /* @__PURE__ */ jsx("strong", { children: label })
|
|
16387
|
-
}), isNotNil(description) && /* @__PURE__ */ jsx(Text, {
|
|
16388
|
-
prominence: "secondary",
|
|
16389
|
-
variant: "body3",
|
|
16390
|
-
children: description
|
|
16391
|
-
})]
|
|
16392
|
-
})]
|
|
16393
|
-
})
|
|
16394
|
-
] });
|
|
16395
|
-
};
|
|
16396
|
-
RadioCardDefaultLayout.displayName = "RadioCardDefaultLayout_UI";
|
|
16397
|
-
//#endregion
|
|
16398
16409
|
//#region src/components/RadioCard/RadioCard.tsx
|
|
16399
16410
|
/**
|
|
16400
16411
|
* A `RadioCard` lets users select exactly one option from a set of visually rich, card-based choices.
|
|
@@ -16935,14 +16946,19 @@ const Sidebar = ({ children, ref, ...props }) => {
|
|
|
16935
16946
|
});
|
|
16936
16947
|
};
|
|
16937
16948
|
//#endregion
|
|
16938
|
-
//#region src/components/Sidebar/
|
|
16939
|
-
const
|
|
16949
|
+
//#region src/components/Sidebar/sidebarSectionStyles.ts
|
|
16950
|
+
const sidebarSectionStyles = css`
|
|
16940
16951
|
display: flex;
|
|
16941
16952
|
flex-direction: column;
|
|
16942
16953
|
width: 100%;
|
|
16943
16954
|
padding-block: var(--wui-sidebar-padding-block);
|
|
16944
16955
|
padding-inline: var(--wui-sidebar-padding-inline);
|
|
16945
16956
|
`;
|
|
16957
|
+
//#endregion
|
|
16958
|
+
//#region src/components/Sidebar/SidebarHeader.tsx
|
|
16959
|
+
const StyledSidebarHeader = styled.div`
|
|
16960
|
+
${sidebarSectionStyles}
|
|
16961
|
+
`;
|
|
16946
16962
|
const SidebarHeader = ({ children }) => {
|
|
16947
16963
|
return /* @__PURE__ */ jsx(StyledSidebarHeader, {
|
|
16948
16964
|
"data-wui-sidebar-header": true,
|
|
@@ -16953,11 +16969,7 @@ SidebarHeader.displayName = "SidebarHeader_UI";
|
|
|
16953
16969
|
//#endregion
|
|
16954
16970
|
//#region src/components/Sidebar/SidebarFooter.tsx
|
|
16955
16971
|
const StyledSidebarFooter = styled.div`
|
|
16956
|
-
|
|
16957
|
-
flex-direction: column;
|
|
16958
|
-
width: 100%;
|
|
16959
|
-
padding-block: var(--wui-sidebar-padding-block);
|
|
16960
|
-
padding-inline: var(--wui-sidebar-padding-inline);
|
|
16972
|
+
${sidebarSectionStyles}
|
|
16961
16973
|
`;
|
|
16962
16974
|
const SidebarFooter = ({ children }) => {
|
|
16963
16975
|
return /* @__PURE__ */ jsx(StyledSidebarFooter, {
|