@wistia/ui 0.8.27 → 0.8.28-beta.a699b2af.d8fac3a
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.cjs +168 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +33 -12
- package/dist/index.d.ts +33 -12
- package/dist/index.mjs +202 -58
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.8.
|
|
3
|
+
* @license @wistia/ui v0.8.28-beta.a699b2af.d8fac3a
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -6965,11 +6965,15 @@ var StyledLink = styled4.a`
|
|
|
6965
6965
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
6966
6966
|
font-family: var(--wui-typography-family-default);
|
|
6967
6967
|
color: ${({ $disabled }) => $disabled ? "var(--wui-color-text-disabled)" : "var(--wui-color-text-link)"};
|
|
6968
|
-
text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
|
|
6968
|
+
text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
|
|
6969
6969
|
display: inline-flex;
|
|
6970
6970
|
align-items: baseline;
|
|
6971
6971
|
gap: var(--wui-space-01);
|
|
6972
6972
|
|
|
6973
|
+
&:hover {
|
|
6974
|
+
text-decoration: ${({ $underline }) => $underline === "hover" || $underline === "always" ? "underline" : "none"};
|
|
6975
|
+
}
|
|
6976
|
+
|
|
6973
6977
|
&& {
|
|
6974
6978
|
svg {
|
|
6975
6979
|
width: 14px;
|
|
@@ -6984,7 +6988,7 @@ var Link = forwardRef(
|
|
|
6984
6988
|
type,
|
|
6985
6989
|
disabled = false,
|
|
6986
6990
|
colorScheme = "inherit",
|
|
6987
|
-
underline =
|
|
6991
|
+
underline = "none",
|
|
6988
6992
|
leftIcon,
|
|
6989
6993
|
rightIcon,
|
|
6990
6994
|
"aria-disabled": ariaDisabled,
|
|
@@ -7648,9 +7652,9 @@ var Badge = forwardRef4(
|
|
|
7648
7652
|
Badge.displayName = "Badge";
|
|
7649
7653
|
|
|
7650
7654
|
// src/components/Box/Box.tsx
|
|
7651
|
-
import {
|
|
7655
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
7652
7656
|
import styled11, { css as css18 } from "styled-components";
|
|
7653
|
-
import { isNotNil as isNotNil10,
|
|
7657
|
+
import { isNotNil as isNotNil10, isRecord as isRecord3, isNotUndefined as isNotUndefined5 } from "@wistia/type-guards";
|
|
7654
7658
|
|
|
7655
7659
|
// src/private/helpers/makePolymorphic/makePolymorphic.tsx
|
|
7656
7660
|
var makePolymorphic = (component) => {
|
|
@@ -7659,7 +7663,6 @@ var makePolymorphic = (component) => {
|
|
|
7659
7663
|
|
|
7660
7664
|
// src/components/Box/Box.tsx
|
|
7661
7665
|
import { jsx as jsx199 } from "react/jsx-runtime";
|
|
7662
|
-
var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
|
|
7663
7666
|
var getGapStyle = (gap) => {
|
|
7664
7667
|
if (isNotNil10(gap)) {
|
|
7665
7668
|
if (isRecord3(gap)) {
|
|
@@ -7754,22 +7757,6 @@ var StyledBoxComponent = styled11.div`
|
|
|
7754
7757
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7755
7758
|
order: ${({ $order }) => isNotNil10($order) ? $order : null};
|
|
7756
7759
|
`;
|
|
7757
|
-
var wrapChildren = (children) => {
|
|
7758
|
-
if (isNotNil10(children)) {
|
|
7759
|
-
if (typeof children === "object" && isDev) {
|
|
7760
|
-
return Children.map(children, (child) => {
|
|
7761
|
-
if (isNil9(child)) return null;
|
|
7762
|
-
const elementParams = {};
|
|
7763
|
-
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7764
|
-
elementParams.hasBoxParent = true;
|
|
7765
|
-
}
|
|
7766
|
-
return cloneElement2(child, elementParams);
|
|
7767
|
-
});
|
|
7768
|
-
}
|
|
7769
|
-
return children;
|
|
7770
|
-
}
|
|
7771
|
-
return null;
|
|
7772
|
-
};
|
|
7773
7760
|
var DEFAULT_ELEMENT = "div";
|
|
7774
7761
|
var BoxComponent = forwardRef5(
|
|
7775
7762
|
({
|
|
@@ -7783,8 +7770,6 @@ var BoxComponent = forwardRef5(
|
|
|
7783
7770
|
fillViewport = false,
|
|
7784
7771
|
gap,
|
|
7785
7772
|
grow,
|
|
7786
|
-
hasBoxParent = false,
|
|
7787
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7788
7773
|
height,
|
|
7789
7774
|
inline = false,
|
|
7790
7775
|
justifyContent = "flex-start",
|
|
@@ -7845,7 +7830,7 @@ var BoxComponent = forwardRef5(
|
|
|
7845
7830
|
$wrapItems: wrapItems,
|
|
7846
7831
|
as: renderAs ?? DEFAULT_ELEMENT,
|
|
7847
7832
|
...props,
|
|
7848
|
-
children
|
|
7833
|
+
children
|
|
7849
7834
|
}
|
|
7850
7835
|
);
|
|
7851
7836
|
}
|
|
@@ -7854,7 +7839,7 @@ BoxComponent.displayName = "Box";
|
|
|
7854
7839
|
var Box = makePolymorphic(BoxComponent);
|
|
7855
7840
|
|
|
7856
7841
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
7857
|
-
import { Children
|
|
7842
|
+
import { Children } from "react";
|
|
7858
7843
|
import styled12 from "styled-components";
|
|
7859
7844
|
import { Fragment as Fragment2, jsx as jsx200, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
7860
7845
|
var StyledBreadcrumbs = styled12.nav`
|
|
@@ -7870,7 +7855,7 @@ var StyledBreadcrumbs = styled12.nav`
|
|
|
7870
7855
|
var BUFFER_WIDTH = 10;
|
|
7871
7856
|
var Breadcrumbs = ({ children, ...props }) => {
|
|
7872
7857
|
const { isXsAndDown } = useMq();
|
|
7873
|
-
let crumbs =
|
|
7858
|
+
let crumbs = Children.toArray(children);
|
|
7874
7859
|
if (isXsAndDown) {
|
|
7875
7860
|
crumbs = crumbs.slice(-1);
|
|
7876
7861
|
}
|
|
@@ -7937,7 +7922,7 @@ var Breadcrumb = ({ icon, href, children, ...props }) => {
|
|
|
7937
7922
|
|
|
7938
7923
|
// src/components/ButtonGroup/ButtonGroup.tsx
|
|
7939
7924
|
import styled14 from "styled-components";
|
|
7940
|
-
import { isNil as
|
|
7925
|
+
import { isNil as isNil9 } from "@wistia/type-guards";
|
|
7941
7926
|
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
7942
7927
|
var getAlignment = (align) => {
|
|
7943
7928
|
if (align === "center") {
|
|
@@ -7983,7 +7968,7 @@ var ButtonGroup = ({
|
|
|
7983
7968
|
collapseOnSmallScreens = true,
|
|
7984
7969
|
...props
|
|
7985
7970
|
}) => {
|
|
7986
|
-
if (
|
|
7971
|
+
if (isNil9(children)) {
|
|
7987
7972
|
return null;
|
|
7988
7973
|
}
|
|
7989
7974
|
return /* @__PURE__ */ jsx202(
|
|
@@ -8096,11 +8081,11 @@ import { isNonEmptyString as isNonEmptyString2 } from "@wistia/type-guards";
|
|
|
8096
8081
|
|
|
8097
8082
|
// src/private/components/FormControlLabel/FormControlLabel.tsx
|
|
8098
8083
|
import styled19, { css as css20 } from "styled-components";
|
|
8099
|
-
import { isNil as
|
|
8084
|
+
import { isNil as isNil11, isNotNil as isNotNil12 } from "@wistia/type-guards";
|
|
8100
8085
|
|
|
8101
8086
|
// src/private/components/FormControlLabel/FormControlLabelDescription.tsx
|
|
8102
8087
|
import styled17, { css as css19 } from "styled-components";
|
|
8103
|
-
import { isNil as
|
|
8088
|
+
import { isNil as isNil10 } from "@wistia/type-guards";
|
|
8104
8089
|
import { jsx as jsx205 } from "react/jsx-runtime";
|
|
8105
8090
|
var disabledStyle = css19`
|
|
8106
8091
|
color: var(--wui-color-text-disabled);
|
|
@@ -8120,7 +8105,7 @@ var FormControlLabelDescription = ({
|
|
|
8120
8105
|
disabled = false,
|
|
8121
8106
|
...props
|
|
8122
8107
|
}) => {
|
|
8123
|
-
if (
|
|
8108
|
+
if (isNil10(children)) {
|
|
8124
8109
|
return null;
|
|
8125
8110
|
}
|
|
8126
8111
|
return /* @__PURE__ */ jsx205(
|
|
@@ -8188,7 +8173,7 @@ var FormControlLabel = ({
|
|
|
8188
8173
|
hideLabel = false,
|
|
8189
8174
|
...props
|
|
8190
8175
|
}) => {
|
|
8191
|
-
if (
|
|
8176
|
+
if (isNil11(label)) {
|
|
8192
8177
|
return null;
|
|
8193
8178
|
}
|
|
8194
8179
|
const labelContent = hideLabel ? /* @__PURE__ */ jsx207(ScreenReaderOnly, { children: label }) : /* @__PURE__ */ jsxs14(StyledLabelWrapper, { children: [
|
|
@@ -8368,7 +8353,7 @@ var Checkbox = forwardRef7(
|
|
|
8368
8353
|
Checkbox.displayName = "Checkbox";
|
|
8369
8354
|
|
|
8370
8355
|
// src/components/ClickRegion/ClickRegion.tsx
|
|
8371
|
-
import { Children as
|
|
8356
|
+
import { Children as Children2, cloneElement as cloneElement2, useCallback as useCallback8, useEffect as useEffect8 } from "react";
|
|
8372
8357
|
var isClickableElement = (element) => {
|
|
8373
8358
|
if (!element) return false;
|
|
8374
8359
|
const el = element;
|
|
@@ -8403,7 +8388,7 @@ var ClickRegion = ({ children, targetRef }) => {
|
|
|
8403
8388
|
},
|
|
8404
8389
|
[targetRef]
|
|
8405
8390
|
);
|
|
8406
|
-
return
|
|
8391
|
+
return cloneElement2(Children2.only(children), {
|
|
8407
8392
|
"data-click-region": true,
|
|
8408
8393
|
onClick: handleClick
|
|
8409
8394
|
});
|
|
@@ -8436,11 +8421,11 @@ var Collapsible = ({
|
|
|
8436
8421
|
Collapsible.displayName = "Collapsible";
|
|
8437
8422
|
|
|
8438
8423
|
// src/components/Collapsible/CollapsibleTrigger.tsx
|
|
8439
|
-
import { Children as
|
|
8424
|
+
import { Children as Children3 } from "react";
|
|
8440
8425
|
import { Trigger } from "@radix-ui/react-collapsible";
|
|
8441
8426
|
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
8442
8427
|
var CollapsibleTrigger = ({ children }) => {
|
|
8443
|
-
|
|
8428
|
+
Children3.only(children);
|
|
8444
8429
|
return /* @__PURE__ */ jsx210(Trigger, { asChild: true, children });
|
|
8445
8430
|
};
|
|
8446
8431
|
|
|
@@ -9180,9 +9165,9 @@ var Tooltip = ({
|
|
|
9180
9165
|
Tooltip.displayName = "Tooltip";
|
|
9181
9166
|
|
|
9182
9167
|
// src/components/Input/Input.tsx
|
|
9183
|
-
import { forwardRef as forwardRef10, cloneElement as
|
|
9168
|
+
import { forwardRef as forwardRef10, cloneElement as cloneElement3, useRef as useRef6 } from "react";
|
|
9184
9169
|
import styled30, { css as css26 } from "styled-components";
|
|
9185
|
-
import { isNil as
|
|
9170
|
+
import { isNil as isNil12, isNotNil as isNotNil16, isRecord as isRecord4 } from "@wistia/type-guards";
|
|
9186
9171
|
|
|
9187
9172
|
// src/css/sharedStyles/inputCssVariables.ts
|
|
9188
9173
|
import { css as css25 } from "styled-components";
|
|
@@ -9331,18 +9316,18 @@ var Input = forwardRef10(
|
|
|
9331
9316
|
isNotNil16(externalRef) && isRecord4(externalRef) && "current" in externalRef ? externalRef : internalRef
|
|
9332
9317
|
);
|
|
9333
9318
|
let leftIconToDisplay = leftIcon;
|
|
9334
|
-
if (
|
|
9319
|
+
if (isNil12(leftIcon) && type === "search") {
|
|
9335
9320
|
leftIconToDisplay = /* @__PURE__ */ jsx219(Icon, { type: "search" });
|
|
9336
9321
|
}
|
|
9337
9322
|
if (isNotNil16(leftIconToDisplay)) {
|
|
9338
|
-
leftIconToDisplay =
|
|
9323
|
+
leftIconToDisplay = cloneElement3(leftIconToDisplay, {
|
|
9339
9324
|
size: "md",
|
|
9340
9325
|
className: "wui-input-left-icon"
|
|
9341
9326
|
});
|
|
9342
9327
|
}
|
|
9343
9328
|
let rightIconToDisplay = rightIcon;
|
|
9344
9329
|
if (isNotNil16(rightIconToDisplay)) {
|
|
9345
|
-
rightIconToDisplay =
|
|
9330
|
+
rightIconToDisplay = cloneElement3(rightIconToDisplay, {
|
|
9346
9331
|
size: "md",
|
|
9347
9332
|
className: "wui-input-right-icon"
|
|
9348
9333
|
});
|
|
@@ -9729,7 +9714,7 @@ var FormErrorSummary = ({ description }) => {
|
|
|
9729
9714
|
};
|
|
9730
9715
|
|
|
9731
9716
|
// src/components/FormField/FormField.tsx
|
|
9732
|
-
import { Children as
|
|
9717
|
+
import { Children as Children4, cloneElement as cloneElement4, useContext as useContext4 } from "react";
|
|
9733
9718
|
import styled36 from "styled-components";
|
|
9734
9719
|
import { isArray as isArray2, isNotNil as isNotNil17, isNotUndefined as isNotUndefined9, isUndefined as isUndefined4 } from "@wistia/type-guards";
|
|
9735
9720
|
|
|
@@ -9964,7 +9949,7 @@ var FormField = ({
|
|
|
9964
9949
|
"aria-invalid": isNotNil17(error)
|
|
9965
9950
|
};
|
|
9966
9951
|
}
|
|
9967
|
-
|
|
9952
|
+
Children4.only(children);
|
|
9968
9953
|
return /* @__PURE__ */ jsxs24(
|
|
9969
9954
|
StyledFormField,
|
|
9970
9955
|
{
|
|
@@ -9973,7 +9958,7 @@ var FormField = ({
|
|
|
9973
9958
|
children: [
|
|
9974
9959
|
!isIntegratedLabel && /* @__PURE__ */ jsx227(Label, { htmlFor: computedId, children: label }),
|
|
9975
9960
|
isNotNil17(description) ? /* @__PURE__ */ jsx227(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
|
|
9976
|
-
|
|
9961
|
+
cloneElement4(children, childProps),
|
|
9977
9962
|
isNotNil17(computedError) ? /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
9978
9963
|
/* @__PURE__ */ jsx227("div", {}),
|
|
9979
9964
|
/* @__PURE__ */ jsx227(
|
|
@@ -10012,7 +9997,7 @@ var RadioGroup = ({
|
|
|
10012
9997
|
RadioGroup.displayName = "RadioGroup";
|
|
10013
9998
|
|
|
10014
9999
|
// src/components/IconButton/IconButton.tsx
|
|
10015
|
-
import { Children as
|
|
10000
|
+
import { Children as Children5, cloneElement as cloneElement5, forwardRef as forwardRef13 } from "react";
|
|
10016
10001
|
import styled37 from "styled-components";
|
|
10017
10002
|
import { jsx as jsx229 } from "react/jsx-runtime";
|
|
10018
10003
|
var StyledButton2 = styled37(Button)`
|
|
@@ -10040,7 +10025,7 @@ var IconButton = forwardRef13(
|
|
|
10040
10025
|
"aria-label": label,
|
|
10041
10026
|
"data-wistia-ui-icon-button": true,
|
|
10042
10027
|
size: responsiveSize,
|
|
10043
|
-
children:
|
|
10028
|
+
children: cloneElement5(Children5.only(children), {
|
|
10044
10029
|
size: responsiveSize
|
|
10045
10030
|
})
|
|
10046
10031
|
}
|
|
@@ -11513,7 +11498,7 @@ Radio.displayName = "Radio";
|
|
|
11513
11498
|
import { forwardRef as forwardRef21 } from "react";
|
|
11514
11499
|
import styled55, { css as css34 } from "styled-components";
|
|
11515
11500
|
import { Root as ToggleGroupRoot } from "@radix-ui/react-toggle-group";
|
|
11516
|
-
import { isNil as
|
|
11501
|
+
import { isNil as isNil13 } from "@wistia/type-guards";
|
|
11517
11502
|
|
|
11518
11503
|
// src/components/SegmentedControl/useSelectedItemStyle.tsx
|
|
11519
11504
|
import { createContext as createContext7, useContext as useContext6, useMemo as useMemo8, useState as useState14 } from "react";
|
|
@@ -11613,7 +11598,7 @@ var SegmentedControl = forwardRef21(
|
|
|
11613
11598
|
onSelectedValueChange,
|
|
11614
11599
|
...props
|
|
11615
11600
|
}, ref) => {
|
|
11616
|
-
if (
|
|
11601
|
+
if (isNil13(children)) {
|
|
11617
11602
|
return null;
|
|
11618
11603
|
}
|
|
11619
11604
|
return /* @__PURE__ */ jsx252(
|
|
@@ -12244,7 +12229,7 @@ var TableRow = ({ children, ...props }) => {
|
|
|
12244
12229
|
// src/components/Tabs/Tabs.tsx
|
|
12245
12230
|
import { forwardRef as forwardRef27, useState as useState15 } from "react";
|
|
12246
12231
|
import { Root as TabsRoot } from "@radix-ui/react-tabs";
|
|
12247
|
-
import { isNotNil as isNotNil30, isNil as
|
|
12232
|
+
import { isNotNil as isNotNil30, isNil as isNil14 } from "@wistia/type-guards";
|
|
12248
12233
|
import styled71 from "styled-components";
|
|
12249
12234
|
|
|
12250
12235
|
// src/components/Tabs/TabPanel.tsx
|
|
@@ -12373,10 +12358,10 @@ var TabItem = forwardRef26(
|
|
|
12373
12358
|
TabItem.displayName = "TabItem";
|
|
12374
12359
|
|
|
12375
12360
|
// src/components/Tabs/extractTabItems.ts
|
|
12376
|
-
import { Children as
|
|
12361
|
+
import { Children as Children6, Fragment as Fragment7, isValidElement as isValidElement2 } from "react";
|
|
12377
12362
|
var extractTabItems = (children) => {
|
|
12378
12363
|
const tabItems = [];
|
|
12379
|
-
|
|
12364
|
+
Children6.forEach(children, (child) => {
|
|
12380
12365
|
if (!isValidElement2(child)) {
|
|
12381
12366
|
return;
|
|
12382
12367
|
}
|
|
@@ -12471,7 +12456,7 @@ var Tabs = forwardRef27(
|
|
|
12471
12456
|
label,
|
|
12472
12457
|
"aria-label": ariaLabelForTab
|
|
12473
12458
|
} = tab.props;
|
|
12474
|
-
if (
|
|
12459
|
+
if (isNil14(icon)) {
|
|
12475
12460
|
return /* @__PURE__ */ jsx266(
|
|
12476
12461
|
TabItem,
|
|
12477
12462
|
{
|
|
@@ -12537,7 +12522,7 @@ Tab.displayName = "Tab";
|
|
|
12537
12522
|
// src/components/Tag/Tag.tsx
|
|
12538
12523
|
import { forwardRef as forwardRef29 } from "react";
|
|
12539
12524
|
import styled72 from "styled-components";
|
|
12540
|
-
import { isNil as
|
|
12525
|
+
import { isNil as isNil15, isNotNil as isNotNil31, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
|
|
12541
12526
|
import { Fragment as Fragment8, jsx as jsx268, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
12542
12527
|
var TagLabel = styled72.a`
|
|
12543
12528
|
${({ $colorScheme }) => getColorScheme($colorScheme)};
|
|
@@ -12622,10 +12607,10 @@ var StyledTag = styled72.div`
|
|
|
12622
12607
|
}
|
|
12623
12608
|
`;
|
|
12624
12609
|
var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
|
|
12625
|
-
if (
|
|
12610
|
+
if (isNil15(onClickRemove)) {
|
|
12626
12611
|
return null;
|
|
12627
12612
|
}
|
|
12628
|
-
if (
|
|
12613
|
+
if (isNil15(onClickRemoveLabel)) {
|
|
12629
12614
|
throw new Error(
|
|
12630
12615
|
"for accessibility, onClickRemoveLabel must be provided if onClickRemove is provided"
|
|
12631
12616
|
);
|
|
@@ -12728,7 +12713,7 @@ ThumbnailBadge.displayName = "ThumbnailBadge";
|
|
|
12728
12713
|
// src/components/Thumbnail/Thumbnail.tsx
|
|
12729
12714
|
import { forwardRef as forwardRef30 } from "react";
|
|
12730
12715
|
import styled74 from "styled-components";
|
|
12731
|
-
import { isNil as
|
|
12716
|
+
import { isNil as isNil16, isNotNil as isNotNil34 } from "@wistia/type-guards";
|
|
12732
12717
|
|
|
12733
12718
|
// src/private/helpers/getBackgroundGradient/getBackgroundGradient.ts
|
|
12734
12719
|
import { isNotNil as isNotNil33 } from "@wistia/type-guards";
|
|
@@ -12898,7 +12883,7 @@ var StyledThumbnail = styled74.div`
|
|
|
12898
12883
|
background-image: ${({ $backgroundUrl }) => isNotNil34($backgroundUrl) ? `url('${$backgroundUrl}')` : void 0};
|
|
12899
12884
|
${({ $backgroundUrl, $gradientBackground }) => (
|
|
12900
12885
|
// if we don't have $backgroundUrl show a gradient
|
|
12901
|
-
|
|
12886
|
+
isNil16($backgroundUrl) ? getBackgroundGradient($gradientBackground) : void 0
|
|
12902
12887
|
)};
|
|
12903
12888
|
background-position: center center;
|
|
12904
12889
|
background-size: cover;
|
|
@@ -13179,6 +13164,164 @@ var WistiaLogo = ({
|
|
|
13179
13164
|
return href !== void 0 ? /* @__PURE__ */ jsx272("a", { href, children: Logo }) : Logo;
|
|
13180
13165
|
};
|
|
13181
13166
|
WistiaLogo.displayName = "WistiaLogo";
|
|
13167
|
+
|
|
13168
|
+
// src/components/List/List.tsx
|
|
13169
|
+
import { isNotNil as isNotNil36 } from "@wistia/type-guards";
|
|
13170
|
+
import styled78, { css as css41 } from "styled-components";
|
|
13171
|
+
|
|
13172
|
+
// src/components/List/ListItem.tsx
|
|
13173
|
+
import styled77 from "styled-components";
|
|
13174
|
+
import { isNil as isNil17 } from "@wistia/type-guards";
|
|
13175
|
+
import { jsx as jsx273 } from "react/jsx-runtime";
|
|
13176
|
+
var ListItemComponent = styled77.li`
|
|
13177
|
+
margin-bottom: var(--wui-space-02);
|
|
13178
|
+
`;
|
|
13179
|
+
var ListItem = ({ children }) => {
|
|
13180
|
+
if (isNil17(children)) {
|
|
13181
|
+
return null;
|
|
13182
|
+
}
|
|
13183
|
+
return /* @__PURE__ */ jsx273(ListItemComponent, { children });
|
|
13184
|
+
};
|
|
13185
|
+
ListItem.displayName = "ListItem";
|
|
13186
|
+
|
|
13187
|
+
// src/components/List/List.tsx
|
|
13188
|
+
import { jsx as jsx274, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
13189
|
+
var spacesStyle = css41`
|
|
13190
|
+
overflow: hidden;
|
|
13191
|
+
padding-left: 0;
|
|
13192
|
+
vertical-align: bottom;
|
|
13193
|
+
|
|
13194
|
+
li {
|
|
13195
|
+
display: block;
|
|
13196
|
+
float: left;
|
|
13197
|
+
|
|
13198
|
+
&::after {
|
|
13199
|
+
content: ' ';
|
|
13200
|
+
padding-right: var(--wui-space-03);
|
|
13201
|
+
}
|
|
13202
|
+
|
|
13203
|
+
&:last-child {
|
|
13204
|
+
&::after {
|
|
13205
|
+
content: '' !important;
|
|
13206
|
+
padding-right: 0;
|
|
13207
|
+
}
|
|
13208
|
+
}
|
|
13209
|
+
}
|
|
13210
|
+
`;
|
|
13211
|
+
var commasStyle = css41`
|
|
13212
|
+
${spacesStyle};
|
|
13213
|
+
|
|
13214
|
+
li {
|
|
13215
|
+
&::after {
|
|
13216
|
+
content: ',' !important;
|
|
13217
|
+
padding-right: var(--wui-space-01);
|
|
13218
|
+
}
|
|
13219
|
+
}
|
|
13220
|
+
`;
|
|
13221
|
+
var slashesStyle = css41`
|
|
13222
|
+
${spacesStyle};
|
|
13223
|
+
|
|
13224
|
+
li {
|
|
13225
|
+
&::after {
|
|
13226
|
+
content: '/' !important;
|
|
13227
|
+
padding-left: var(--wui-space-01);
|
|
13228
|
+
padding-right: var(--wui-space-01);
|
|
13229
|
+
}
|
|
13230
|
+
}
|
|
13231
|
+
`;
|
|
13232
|
+
var breadcrumbsStyle = css41`
|
|
13233
|
+
${spacesStyle};
|
|
13234
|
+
|
|
13235
|
+
li {
|
|
13236
|
+
&::after {
|
|
13237
|
+
content: '>' !important;
|
|
13238
|
+
padding-left: var(--wui-space-01);
|
|
13239
|
+
padding-right: var(--wui-space-01);
|
|
13240
|
+
}
|
|
13241
|
+
}
|
|
13242
|
+
`;
|
|
13243
|
+
var unbulletedStyle = css41`
|
|
13244
|
+
list-style: none;
|
|
13245
|
+
padding-left: 0;
|
|
13246
|
+
`;
|
|
13247
|
+
var ListComponent = styled78.ul`
|
|
13248
|
+
list-style-position: outside;
|
|
13249
|
+
margin: 0 0 var(--wui-space-01);
|
|
13250
|
+
padding: 0 0 0 var(--wui-space-04);
|
|
13251
|
+
${({ variant }) => variant === "unbulleted" && unbulletedStyle};
|
|
13252
|
+
${({ variant }) => variant === "spaces" && spacesStyle};
|
|
13253
|
+
${({ variant }) => variant === "commas" && commasStyle};
|
|
13254
|
+
${({ variant }) => variant === "slashes" && slashesStyle};
|
|
13255
|
+
${({ variant }) => variant === "breadcrumbs" && breadcrumbsStyle};
|
|
13256
|
+
|
|
13257
|
+
> li:last-child {
|
|
13258
|
+
margin-bottom: 0;
|
|
13259
|
+
}
|
|
13260
|
+
|
|
13261
|
+
ul,
|
|
13262
|
+
ol {
|
|
13263
|
+
margin-top: var(--wui-space-01);
|
|
13264
|
+
}
|
|
13265
|
+
|
|
13266
|
+
/* nested lists should not have bottom margins because their container <li> will have one */
|
|
13267
|
+
li ul,
|
|
13268
|
+
li ol {
|
|
13269
|
+
margin-bottom: 0;
|
|
13270
|
+
}
|
|
13271
|
+
`;
|
|
13272
|
+
var renderListComponent = (listItems, variant, { ...otherProps }) => {
|
|
13273
|
+
const elementType = variant === "ordered" ? "ol" : "ul";
|
|
13274
|
+
return /* @__PURE__ */ jsx274(
|
|
13275
|
+
ListComponent,
|
|
13276
|
+
{
|
|
13277
|
+
as: elementType,
|
|
13278
|
+
variant,
|
|
13279
|
+
...otherProps,
|
|
13280
|
+
children: listItems
|
|
13281
|
+
}
|
|
13282
|
+
);
|
|
13283
|
+
};
|
|
13284
|
+
var renderListFromArray = (listItems, variant, otherProps) => {
|
|
13285
|
+
let itemCount = 0;
|
|
13286
|
+
const items = listItems.map((listItem, i) => {
|
|
13287
|
+
const item = listItem;
|
|
13288
|
+
const nextItem = listItems[i + 1];
|
|
13289
|
+
const key = `item-${itemCount += 1}`;
|
|
13290
|
+
if (Array.isArray(nextItem)) {
|
|
13291
|
+
return /* @__PURE__ */ jsxs48(ListItem, { children: [
|
|
13292
|
+
item,
|
|
13293
|
+
renderListFromArray(nextItem, variant, otherProps)
|
|
13294
|
+
] }, key);
|
|
13295
|
+
}
|
|
13296
|
+
if (Array.isArray(item)) {
|
|
13297
|
+
return null;
|
|
13298
|
+
}
|
|
13299
|
+
return /* @__PURE__ */ jsx274(ListItem, { children: item }, key);
|
|
13300
|
+
});
|
|
13301
|
+
return renderListComponent(items, variant, otherProps);
|
|
13302
|
+
};
|
|
13303
|
+
var List = ({
|
|
13304
|
+
children,
|
|
13305
|
+
items,
|
|
13306
|
+
variant,
|
|
13307
|
+
...otherProps
|
|
13308
|
+
}) => {
|
|
13309
|
+
const listVariant = variant ?? "bullets";
|
|
13310
|
+
if (isNotNil36(children)) {
|
|
13311
|
+
if (Array.isArray(children) && !children.length) {
|
|
13312
|
+
return null;
|
|
13313
|
+
}
|
|
13314
|
+
return renderListComponent(children, listVariant, otherProps);
|
|
13315
|
+
}
|
|
13316
|
+
if (isNotNil36(items)) {
|
|
13317
|
+
if (!items.length) {
|
|
13318
|
+
return null;
|
|
13319
|
+
}
|
|
13320
|
+
return renderListFromArray(items, listVariant, otherProps);
|
|
13321
|
+
}
|
|
13322
|
+
return null;
|
|
13323
|
+
};
|
|
13324
|
+
List.displayName = "List";
|
|
13182
13325
|
export {
|
|
13183
13326
|
ActionButton,
|
|
13184
13327
|
Avatar,
|
|
@@ -13221,6 +13364,7 @@ export {
|
|
|
13221
13364
|
KeyboardShortcut,
|
|
13222
13365
|
Label,
|
|
13223
13366
|
Link,
|
|
13367
|
+
List,
|
|
13224
13368
|
Menu,
|
|
13225
13369
|
MenuItem,
|
|
13226
13370
|
MenuItemDescription,
|