@wistia/ui 3.4.0 → 3.4.1-beta.6b786a22.02b1b86

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v3.4.0
3
+ * @license @wistia/ui v3.4.1-beta.6b786a22.02b1b86
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
11
- import { Children, Fragment, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useTransition } from "react";
11
+ import { Children, Fragment, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, 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/type-guards";
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";
@@ -1224,13 +1224,24 @@ const mergeRefs = (refs) => (value) => {
1224
1224
  };
1225
1225
  //#endregion
1226
1226
  //#region src/css/breakpoints.ts
1227
- const breakpoints = {
1227
+ const breakpointsEm = {
1228
1228
  xs: "0em",
1229
1229
  sm: "37.5em",
1230
1230
  md: "56.5625em",
1231
1231
  lg: "77.5em",
1232
1232
  xl: "90em"
1233
1233
  };
1234
+ /**
1235
+ * The minimum viewport width, in px, of each breakpoint (at the default 16px font size).
1236
+ * A breakpoint's range runs from its own value up to, but not including, the next one.
1237
+ */
1238
+ const breakpoints = {
1239
+ xs: 0,
1240
+ sm: 600,
1241
+ md: 905,
1242
+ lg: 1240,
1243
+ xl: 1440
1244
+ };
1234
1245
  //#endregion
1235
1246
  //#region src/helpers/mq/mq.ts
1236
1247
  const getMaxWidth = (breakpoint) => {
@@ -1238,15 +1249,15 @@ const getMaxWidth = (breakpoint) => {
1238
1249
  const [value, unit] = getValueAndUnit(breakpoint);
1239
1250
  return `@media (max-width: ${Math.max(value - breakpointBuffer, 0)}${unit})`;
1240
1251
  };
1241
- const xsAndUp = () => `@media (min-width: ${breakpoints.xs})`;
1242
- const smAndUp = () => `@media (min-width: ${breakpoints.sm})`;
1243
- const mdAndUp = () => `@media (min-width: ${breakpoints.md})`;
1244
- const lgAndUp = () => `@media (min-width: ${breakpoints.lg})`;
1245
- const xlAndUp = () => `@media (min-width: ${breakpoints.xl})`;
1246
- const xsAndDown = () => getMaxWidth(breakpoints.sm);
1247
- const smAndDown = () => getMaxWidth(breakpoints.md);
1248
- const mdAndDown = () => getMaxWidth(breakpoints.lg);
1249
- const lgAndDown = () => getMaxWidth(breakpoints.xl);
1252
+ const xsAndUp = () => `@media (min-width: ${breakpointsEm.xs})`;
1253
+ const smAndUp = () => `@media (min-width: ${breakpointsEm.sm})`;
1254
+ const mdAndUp = () => `@media (min-width: ${breakpointsEm.md})`;
1255
+ const lgAndUp = () => `@media (min-width: ${breakpointsEm.lg})`;
1256
+ const xlAndUp = () => `@media (min-width: ${breakpointsEm.xl})`;
1257
+ const xsAndDown = () => getMaxWidth(breakpointsEm.sm);
1258
+ const smAndDown = () => getMaxWidth(breakpointsEm.md);
1259
+ const mdAndDown = () => getMaxWidth(breakpointsEm.lg);
1260
+ const lgAndDown = () => getMaxWidth(breakpointsEm.xl);
1250
1261
  const xlAndDown = () => "@media all";
1251
1262
  const mq = {
1252
1263
  xsAndUp,
@@ -1804,65 +1815,86 @@ const useLockBodyScroll = (locked) => {
1804
1815
  }, [locked]);
1805
1816
  };
1806
1817
  //#endregion
1807
- //#region src/private/helpers/isClient/isClient.ts
1808
- /**
1809
- * @returns {boolean} - whether running in a browser environment
1810
- */
1811
- const isClient = () => typeof window !== "undefined" && typeof document !== "undefined";
1812
- //#endregion
1813
- //#region src/hooks/useWindowSize/useWindowSize.ts
1814
- const useWindowSize = (interval = 0) => {
1815
- const [dimensions, setDimensions] = useState({
1816
- width: isClient() ? window.innerWidth : 0,
1817
- height: isClient() ? window.innerHeight : 0
1818
+ //#region src/hooks/useMq/useMq.ts
1819
+ const reachedKeys = [
1820
+ "sm",
1821
+ "md",
1822
+ "lg",
1823
+ "xl"
1824
+ ];
1825
+ const toFlags = ([sm, md, lg, xl]) => ({
1826
+ isXlAndUp: xl,
1827
+ isLgAndUp: lg,
1828
+ isMdAndUp: md,
1829
+ isSmAndUp: sm,
1830
+ isXsAndUp: true,
1831
+ isXsAndDown: !sm,
1832
+ isSmAndDown: !md,
1833
+ isMdAndDown: !lg,
1834
+ isLgAndDown: !xl,
1835
+ isXlAndDown: true
1836
+ });
1837
+ const readReached = () => reachedKeys.map((key) => window.innerWidth >= breakpoints[key]);
1838
+ const serverSnapshot = toFlags([
1839
+ false,
1840
+ false,
1841
+ false,
1842
+ false
1843
+ ]);
1844
+ const subscribers = /* @__PURE__ */ new Set();
1845
+ let snapshotKey = "";
1846
+ let snapshot = serverSnapshot;
1847
+ const refresh = () => {
1848
+ const reached = readReached();
1849
+ const key = reached.join();
1850
+ if (key === snapshotKey) return false;
1851
+ snapshotKey = key;
1852
+ snapshot = toFlags(reached);
1853
+ return true;
1854
+ };
1855
+ const notifyIfChanged = () => {
1856
+ if (refresh()) subscribers.forEach((subscriber) => {
1857
+ subscriber();
1818
1858
  });
1819
- useLayoutEffect(() => {
1820
- const updateDimensions = () => {
1821
- const { innerWidth: width, innerHeight: height } = window;
1822
- setDimensions((prev) => prev.width === width && prev.height === height ? prev : {
1823
- width,
1824
- height
1825
- });
1826
- };
1827
- const handleResize = debounce(interval, updateDimensions);
1828
- updateDimensions();
1829
- window.addEventListener("resize", handleResize);
1830
- return () => {
1831
- window.removeEventListener("resize", handleResize);
1832
- handleResize.cancel();
1833
- };
1834
- }, [interval]);
1835
- return dimensions;
1836
1859
  };
1837
- //#endregion
1838
- //#region src/hooks/useMq/useMq.ts
1839
- const REM_SIZE = 16;
1840
- const useMq = () => {
1841
- const { width } = useWindowSize();
1842
- const viewportWidth = width / REM_SIZE;
1843
- const isXsAndUp = true;
1844
- const isSmAndUp = viewportWidth >= Number.parseFloat(breakpoints.sm);
1845
- const isMdAndUp = viewportWidth >= Number.parseFloat(breakpoints.md);
1846
- const isLgAndUp = viewportWidth >= Number.parseFloat(breakpoints.lg);
1847
- return {
1848
- isXlAndUp: viewportWidth >= Number.parseFloat(breakpoints.xl),
1849
- isLgAndUp,
1850
- isMdAndUp,
1851
- isSmAndUp,
1852
- isXsAndUp,
1853
- isXsAndDown: viewportWidth < Number.parseFloat(breakpoints.sm),
1854
- isSmAndDown: viewportWidth < Number.parseFloat(breakpoints.md),
1855
- isMdAndDown: viewportWidth < Number.parseFloat(breakpoints.lg),
1856
- isLgAndDown: viewportWidth < Number.parseFloat(breakpoints.xl),
1857
- isXlAndDown: true
1860
+ const subscribe = (subscriber) => {
1861
+ subscribers.add(subscriber);
1862
+ if (subscribers.size === 1) window.addEventListener("resize", notifyIfChanged);
1863
+ notifyIfChanged();
1864
+ return () => {
1865
+ subscribers.delete(subscriber);
1866
+ if (subscribers.size === 0) window.removeEventListener("resize", notifyIfChanged);
1858
1867
  };
1859
1868
  };
1869
+ const getSnapshot = () => {
1870
+ if (subscribers.size === 0) refresh();
1871
+ return snapshot;
1872
+ };
1873
+ /**
1874
+ * Returns which breakpoints the viewport is in. Components re-render only when a
1875
+ * breakpoint is crossed, and the returned object keeps its identity until then.
1876
+ */
1877
+ const useMq = () => useSyncExternalStore(subscribe, getSnapshot, () => serverSnapshot);
1878
+ /**
1879
+ * Returns the largest breakpoint the viewport has reached.
1880
+ */
1881
+ const useBreakpoint = () => {
1882
+ const { isSmAndUp, isMdAndUp, isLgAndUp, isXlAndUp } = useMq();
1883
+ return reachedKeys[[
1884
+ isSmAndUp,
1885
+ isMdAndUp,
1886
+ isLgAndUp,
1887
+ isXlAndUp
1888
+ ].lastIndexOf(true)] ?? "xs";
1889
+ };
1860
1890
  const useActiveMq = () => {
1861
- const mq = useMq();
1862
- return Object.keys(mq).filter((key) => {
1863
- const value = mq[key];
1864
- return isBoolean(value) && value;
1865
- });
1891
+ const mqState = useMq();
1892
+ return useMemo(() => {
1893
+ return Object.keys(mqState).filter((key) => {
1894
+ const value = mqState[key];
1895
+ return isBoolean(value) && value;
1896
+ });
1897
+ }, [mqState]);
1866
1898
  };
1867
1899
  //#endregion
1868
1900
  //#region src/hooks/useOnClickOutside/useOnClickOutside.ts
@@ -2175,6 +2207,37 @@ const useToast = () => {
2175
2207
  }, [toasterId]);
2176
2208
  };
2177
2209
  //#endregion
2210
+ //#region src/private/helpers/isClient/isClient.ts
2211
+ /**
2212
+ * @returns {boolean} - whether running in a browser environment
2213
+ */
2214
+ const isClient = () => typeof window !== "undefined" && typeof document !== "undefined";
2215
+ //#endregion
2216
+ //#region src/hooks/useWindowSize/useWindowSize.ts
2217
+ const useWindowSize = (interval = 0) => {
2218
+ const [dimensions, setDimensions] = useState({
2219
+ width: isClient() ? window.innerWidth : 0,
2220
+ height: isClient() ? window.innerHeight : 0
2221
+ });
2222
+ useLayoutEffect(() => {
2223
+ const updateDimensions = () => {
2224
+ const { innerWidth: width, innerHeight: height } = window;
2225
+ setDimensions((prev) => prev.width === width && prev.height === height ? prev : {
2226
+ width,
2227
+ height
2228
+ });
2229
+ };
2230
+ const handleResize = debounce(interval, updateDimensions);
2231
+ updateDimensions();
2232
+ window.addEventListener("resize", handleResize);
2233
+ return () => {
2234
+ window.removeEventListener("resize", handleResize);
2235
+ handleResize.cancel();
2236
+ };
2237
+ }, [interval]);
2238
+ return dimensions;
2239
+ };
2240
+ //#endregion
2178
2241
  //#region src/private/hooks/useGatedIcon/useGatedIcon.ts
2179
2242
  /** The icon marking a gated feature — `sparkle` unless `UIProvider` overrides it. */
2180
2243
  const useGatedIcon = () => useContext(GatedIconContext);
@@ -9262,6 +9325,112 @@ const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name,
9262
9325
  });
9263
9326
  };
9264
9327
  //#endregion
9328
+ //#region src/components/RadioCard/RadioCardIndicator.tsx
9329
+ const RadioCardIndicator = styled.div`
9330
+ --wui-radio-card-indicator-size: 14px;
9331
+ --wui-radio-card-indicator-background-color: var(--wui-color-bg-surface);
9332
+ --wui-radio-card-indicator-fill-color: var(--wui-color-bg-fill);
9333
+
9334
+ /* TODO: figure out radio / checkbox / switch colors */
9335
+ --wui-radio-card-indicator-border-color: var(--wui-color-border-secondary-active);
9336
+
9337
+ width: var(--wui-radio-card-indicator-size);
9338
+ height: var(--wui-radio-card-indicator-size);
9339
+ min-width: var(--wui-radio-card-indicator-size);
9340
+ min-height: var(--wui-radio-card-indicator-size);
9341
+ background-color: var(--wui-radio-card-indicator-background-color);
9342
+ box-shadow: inset 0 0 0 1px var(--wui-radio-card-indicator-border-color);
9343
+ border-radius: 100%;
9344
+ position: relative;
9345
+ cursor: pointer;
9346
+ transition: border-color var(--wui-motion-duration-03) var(--wui-motion-ease);
9347
+
9348
+ &::after {
9349
+ content: '';
9350
+ position: absolute;
9351
+ top: 50%;
9352
+ left: 50%;
9353
+ width: 0;
9354
+ height: 0;
9355
+ background-color: var(--wui-radio-card-indicator-fill-color);
9356
+ border-radius: 100%;
9357
+ transform: translate(-50%, -50%);
9358
+ }
9359
+
9360
+ ${StyledCard}:has(input:checked) & {
9361
+ --wui-radio-card-indicator-border-color: var(--wui-color-focus-ring);
9362
+ --wui-radio-card-indicator-fill-color: var(--wui-color-focus-ring);
9363
+
9364
+ &::after {
9365
+ width: calc(var(--wui-radio-card-indicator-size) / 2);
9366
+ height: calc(var(--wui-radio-card-indicator-size) / 2);
9367
+ }
9368
+ }
9369
+
9370
+ ${StyledCard}:has(input:disabled) & {
9371
+ --wui-radio-card-indicator-border-color: var(--wui-color-border-secondary);
9372
+ --wui-radio-card-indicator-background-color: var(--wui-color-bg-surface-disabled);
9373
+ }
9374
+ `;
9375
+ RadioCardIndicator.displayName = "RadioCardIndicator_UI";
9376
+ //#endregion
9377
+ //#region src/components/RadioCard/RadioCardDefaultLayout.tsx
9378
+ const StyledCardContent$1 = styled.div`
9379
+ display: grid;
9380
+ grid-auto-flow: column;
9381
+ gap: var(--wui-space-02);
9382
+ `;
9383
+ const StyledCardIcon$1 = styled.div`
9384
+ display: contents;
9385
+ `;
9386
+ const StyledGatedIcon = styled.div`
9387
+ position: absolute;
9388
+ right: 10px;
9389
+ top: 10px;
9390
+ z-index: 1;
9391
+ `;
9392
+ const StyledIndicatorContainer$1 = styled.div`
9393
+ height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
9394
+ display: flex;
9395
+ align-items: center;
9396
+ `;
9397
+ const RadioCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
9398
+ const gatedIcon = useGatedIcon();
9399
+ return /* @__PURE__ */ jsxs(StyledCardContent$1, { children: [
9400
+ showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer$1, {
9401
+ $hasIcon: isNotNil(icon),
9402
+ children: /* @__PURE__ */ jsx(RadioCardIndicator, { "data-testid": "wui-radio-card-indicator" })
9403
+ }) : null,
9404
+ isGated ? /* @__PURE__ */ jsx(StyledGatedIcon, {
9405
+ "data-testid": "wui-radio-gated-icon",
9406
+ children: /* @__PURE__ */ jsx(Icon, {
9407
+ colorScheme: "purple",
9408
+ "data-testid": "wui-icon-sparkle",
9409
+ type: gatedIcon
9410
+ })
9411
+ }) : null,
9412
+ /* @__PURE__ */ jsxs(Stack, {
9413
+ gap: "space-02",
9414
+ children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon$1, {
9415
+ "data-wui-radio-card-icon": true,
9416
+ children: icon
9417
+ }), /* @__PURE__ */ jsxs(Stack, {
9418
+ gap: "space-01",
9419
+ style: isNotNil(icon) ? { paddingLeft: 2 } : void 0,
9420
+ children: [isNotNil(label) && /* @__PURE__ */ jsx(Text, {
9421
+ variant: "label3",
9422
+ children: /* @__PURE__ */ jsx("strong", { children: label })
9423
+ }), isNotNil(description) && /* @__PURE__ */ jsx(Text, {
9424
+ prominence: "secondary",
9425
+ variant: "body3",
9426
+ children: description
9427
+ })]
9428
+ })]
9429
+ })
9430
+ ] });
9431
+ };
9432
+ RadioCardDefaultLayout.displayName = "RadioCardDefaultLayout_UI";
9433
+ //#endregion
9265
9434
  //#region src/components/CheckboxCard/CheckboxCardIndicator.tsx
9266
9435
  const CheckIcon = () => /* @__PURE__ */ jsx("svg", {
9267
9436
  fill: "inherit",
@@ -9323,33 +9492,27 @@ const CheckboxCardIndicator = (props) => /* @__PURE__ */ jsx(StyledIndicator, {
9323
9492
  CheckboxCardIndicator.displayName = "CheckboxCardIndicator_UI";
9324
9493
  //#endregion
9325
9494
  //#region src/components/CheckboxCard/CheckboxCardDefaultLayout.tsx
9326
- const StyledCardContent$1 = styled.div`
9495
+ const StyledCardContent = styled.div`
9327
9496
  display: grid;
9328
9497
  grid-auto-flow: column;
9329
9498
  gap: var(--wui-space-02);
9330
9499
  `;
9331
- const StyledCardIcon$1 = styled.div`
9500
+ const StyledCardIcon = styled.div`
9332
9501
  display: contents;
9333
9502
  `;
9334
- const StyledGatedIcon$1 = styled.div`
9335
- position: absolute;
9336
- right: 10px;
9337
- top: 10px;
9338
- z-index: 1;
9339
- `;
9340
- const StyledIndicatorContainer$1 = styled.div`
9503
+ const StyledIndicatorContainer = styled.div`
9341
9504
  height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
9342
9505
  display: flex;
9343
9506
  align-items: center;
9344
9507
  `;
9345
9508
  const CheckboxCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
9346
9509
  const gatedIcon = useGatedIcon();
9347
- return /* @__PURE__ */ jsxs(StyledCardContent$1, { children: [
9348
- showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer$1, {
9510
+ return /* @__PURE__ */ jsxs(StyledCardContent, { children: [
9511
+ showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer, {
9349
9512
  $hasIcon: isNotNil(icon),
9350
9513
  children: /* @__PURE__ */ jsx(CheckboxCardIndicator, { "data-testid": "wui-checkbox-card-indicator" })
9351
9514
  }) : null,
9352
- isGated ? /* @__PURE__ */ jsx(StyledGatedIcon$1, {
9515
+ isGated ? /* @__PURE__ */ jsx(StyledGatedIcon, {
9353
9516
  "data-testid": "wui-checkbox-gated-icon",
9354
9517
  children: /* @__PURE__ */ jsx(Icon, {
9355
9518
  colorScheme: "purple",
@@ -9359,7 +9522,7 @@ const CheckboxCardDefaultLayout = ({ icon, label, description, showIndicator = t
9359
9522
  }) : null,
9360
9523
  /* @__PURE__ */ jsxs(Stack, {
9361
9524
  gap: "space-02",
9362
- children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon$1, {
9525
+ children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon, {
9363
9526
  "data-wui-checkbox-card-icon": true,
9364
9527
  children: icon
9365
9528
  }), /* @__PURE__ */ jsxs(Stack, {
@@ -16289,112 +16452,6 @@ const RadioCardChildrenContainer = styled.div`
16289
16452
  flex: 1 1 auto;
16290
16453
  `;
16291
16454
  //#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
16455
  //#region src/components/RadioCard/RadioCard.tsx
16399
16456
  /**
16400
16457
  * A `RadioCard` lets users select exactly one option from a set of visually rich, card-based choices.
@@ -16935,14 +16992,19 @@ const Sidebar = ({ children, ref, ...props }) => {
16935
16992
  });
16936
16993
  };
16937
16994
  //#endregion
16938
- //#region src/components/Sidebar/SidebarHeader.tsx
16939
- const StyledSidebarHeader = styled.div`
16995
+ //#region src/components/Sidebar/sidebarSectionStyles.ts
16996
+ const sidebarSectionStyles = css`
16940
16997
  display: flex;
16941
16998
  flex-direction: column;
16942
16999
  width: 100%;
16943
17000
  padding-block: var(--wui-sidebar-padding-block);
16944
17001
  padding-inline: var(--wui-sidebar-padding-inline);
16945
17002
  `;
17003
+ //#endregion
17004
+ //#region src/components/Sidebar/SidebarHeader.tsx
17005
+ const StyledSidebarHeader = styled.div`
17006
+ ${sidebarSectionStyles}
17007
+ `;
16946
17008
  const SidebarHeader = ({ children }) => {
16947
17009
  return /* @__PURE__ */ jsx(StyledSidebarHeader, {
16948
17010
  "data-wui-sidebar-header": true,
@@ -16953,11 +17015,7 @@ SidebarHeader.displayName = "SidebarHeader_UI";
16953
17015
  //#endregion
16954
17016
  //#region src/components/Sidebar/SidebarFooter.tsx
16955
17017
  const StyledSidebarFooter = styled.div`
16956
- display: flex;
16957
- flex-direction: column;
16958
- width: 100%;
16959
- padding-block: var(--wui-sidebar-padding-block);
16960
- padding-inline: var(--wui-sidebar-padding-inline);
17018
+ ${sidebarSectionStyles}
16961
17019
  `;
16962
17020
  const SidebarFooter = ({ children }) => {
16963
17021
  return /* @__PURE__ */ jsx(StyledSidebarFooter, {
@@ -18159,6 +18217,6 @@ const WistiaLogo = ({ description, height = 100, hoverColor, href, iconOnly = fa
18159
18217
  };
18160
18218
  WistiaLogo.displayName = "WistiaLogo_UI";
18161
18219
  //#endregion
18162
- export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxCard, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, ContrastEnforcerSwitch, ContrastIndicator, ContrastPreview, CustomizableThemeWrapper, DOCUMENT_COLOR_MODE_ATTRIBUTE, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, DatePicker, Dimmer, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, IconChip, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, TileButton, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorModeOptions, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, documentColorModeOptions, getBackgroundGradient, getDocumentColorMode, getSemiRandomBackgroundGradient, iconSizeMap, isKeyboardKey, isUrl, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, setDocumentColorMode, stripExtension, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useDocumentColorMode, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
18220
+ export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxCard, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, ContrastEnforcerSwitch, ContrastIndicator, ContrastPreview, CustomizableThemeWrapper, DOCUMENT_COLOR_MODE_ATTRIBUTE, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, DatePicker, Dimmer, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, IconChip, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, TileButton, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, breakpoints, breakpointsEm, buildTimeDuration, calculateContrast, coerceToBoolean, colorModeOptions, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, documentColorModeOptions, getBackgroundGradient, getDocumentColorMode, getSemiRandomBackgroundGradient, iconSizeMap, isKeyboardKey, isUrl, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, setDocumentColorMode, stripExtension, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useBreakpoint, useClipboard, useDocumentColorMode, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
18163
18221
 
18164
18222
  //# sourceMappingURL=index.js.map