@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.cjs
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
|
*
|
|
@@ -80,6 +80,7 @@ __export(index_exports, {
|
|
|
80
80
|
KeyboardShortcut: () => KeyboardShortcut,
|
|
81
81
|
Label: () => Label,
|
|
82
82
|
Link: () => Link,
|
|
83
|
+
List: () => List,
|
|
83
84
|
Menu: () => Menu,
|
|
84
85
|
MenuItem: () => MenuItem,
|
|
85
86
|
MenuItemDescription: () => MenuItemDescription,
|
|
@@ -7096,11 +7097,15 @@ var StyledLink = import_styled_components20.default.a`
|
|
|
7096
7097
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
7097
7098
|
font-family: var(--wui-typography-family-default);
|
|
7098
7099
|
color: ${({ $disabled }) => $disabled ? "var(--wui-color-text-disabled)" : "var(--wui-color-text-link)"};
|
|
7099
|
-
text-decoration: ${({ $underline }) => $underline ? "underline" : "none"};
|
|
7100
|
+
text-decoration: ${({ $underline }) => $underline === "always" ? "underline" : "none"};
|
|
7100
7101
|
display: inline-flex;
|
|
7101
7102
|
align-items: baseline;
|
|
7102
7103
|
gap: var(--wui-space-01);
|
|
7103
7104
|
|
|
7105
|
+
&:hover {
|
|
7106
|
+
text-decoration: ${({ $underline }) => $underline === "hover" || $underline === "always" ? "underline" : "none"};
|
|
7107
|
+
}
|
|
7108
|
+
|
|
7104
7109
|
&& {
|
|
7105
7110
|
svg {
|
|
7106
7111
|
width: 14px;
|
|
@@ -7115,7 +7120,7 @@ var Link = (0, import_react21.forwardRef)(
|
|
|
7115
7120
|
type,
|
|
7116
7121
|
disabled = false,
|
|
7117
7122
|
colorScheme = "inherit",
|
|
7118
|
-
underline =
|
|
7123
|
+
underline = "none",
|
|
7119
7124
|
leftIcon,
|
|
7120
7125
|
rightIcon,
|
|
7121
7126
|
"aria-disabled": ariaDisabled,
|
|
@@ -7790,7 +7795,6 @@ var makePolymorphic = (component) => {
|
|
|
7790
7795
|
|
|
7791
7796
|
// src/components/Box/Box.tsx
|
|
7792
7797
|
var import_jsx_runtime199 = require("react/jsx-runtime");
|
|
7793
|
-
var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
|
|
7794
7798
|
var getGapStyle = (gap) => {
|
|
7795
7799
|
if ((0, import_type_guards20.isNotNil)(gap)) {
|
|
7796
7800
|
if ((0, import_type_guards20.isRecord)(gap)) {
|
|
@@ -7885,22 +7889,6 @@ var StyledBoxComponent = import_styled_components27.default.div`
|
|
|
7885
7889
|
justify-content: ${({ $justifyContent }) => $justifyContent};
|
|
7886
7890
|
order: ${({ $order }) => (0, import_type_guards20.isNotNil)($order) ? $order : null};
|
|
7887
7891
|
`;
|
|
7888
|
-
var wrapChildren = (children) => {
|
|
7889
|
-
if ((0, import_type_guards20.isNotNil)(children)) {
|
|
7890
|
-
if (typeof children === "object" && isDev) {
|
|
7891
|
-
return import_react26.Children.map(children, (child) => {
|
|
7892
|
-
if ((0, import_type_guards20.isNil)(child)) return null;
|
|
7893
|
-
const elementParams = {};
|
|
7894
|
-
if (child.type?.displayName === "Box" || child.type?.displayName === "Box_UI") {
|
|
7895
|
-
elementParams.hasBoxParent = true;
|
|
7896
|
-
}
|
|
7897
|
-
return (0, import_react26.cloneElement)(child, elementParams);
|
|
7898
|
-
});
|
|
7899
|
-
}
|
|
7900
|
-
return children;
|
|
7901
|
-
}
|
|
7902
|
-
return null;
|
|
7903
|
-
};
|
|
7904
7892
|
var DEFAULT_ELEMENT = "div";
|
|
7905
7893
|
var BoxComponent = (0, import_react26.forwardRef)(
|
|
7906
7894
|
({
|
|
@@ -7914,8 +7902,6 @@ var BoxComponent = (0, import_react26.forwardRef)(
|
|
|
7914
7902
|
fillViewport = false,
|
|
7915
7903
|
gap,
|
|
7916
7904
|
grow,
|
|
7917
|
-
hasBoxParent = false,
|
|
7918
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7919
7905
|
height,
|
|
7920
7906
|
inline = false,
|
|
7921
7907
|
justifyContent = "flex-start",
|
|
@@ -7976,7 +7962,7 @@ var BoxComponent = (0, import_react26.forwardRef)(
|
|
|
7976
7962
|
$wrapItems: wrapItems,
|
|
7977
7963
|
as: renderAs ?? DEFAULT_ELEMENT,
|
|
7978
7964
|
...props,
|
|
7979
|
-
children
|
|
7965
|
+
children
|
|
7980
7966
|
}
|
|
7981
7967
|
);
|
|
7982
7968
|
}
|
|
@@ -13277,6 +13263,164 @@ var WistiaLogo = ({
|
|
|
13277
13263
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime274.jsx)("a", { href, children: Logo }) : Logo;
|
|
13278
13264
|
};
|
|
13279
13265
|
WistiaLogo.displayName = "WistiaLogo";
|
|
13266
|
+
|
|
13267
|
+
// src/components/List/List.tsx
|
|
13268
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13269
|
+
var import_styled_components96 = __toESM(require("styled-components"));
|
|
13270
|
+
|
|
13271
|
+
// src/components/List/ListItem.tsx
|
|
13272
|
+
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13273
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13274
|
+
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
13275
|
+
var ListItemComponent = import_styled_components95.default.li`
|
|
13276
|
+
margin-bottom: var(--wui-space-02);
|
|
13277
|
+
`;
|
|
13278
|
+
var ListItem = ({ children }) => {
|
|
13279
|
+
if ((0, import_type_guards58.isNil)(children)) {
|
|
13280
|
+
return null;
|
|
13281
|
+
}
|
|
13282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(ListItemComponent, { children });
|
|
13283
|
+
};
|
|
13284
|
+
ListItem.displayName = "ListItem";
|
|
13285
|
+
|
|
13286
|
+
// src/components/List/List.tsx
|
|
13287
|
+
var import_jsx_runtime276 = require("react/jsx-runtime");
|
|
13288
|
+
var spacesStyle = import_styled_components96.css`
|
|
13289
|
+
overflow: hidden;
|
|
13290
|
+
padding-left: 0;
|
|
13291
|
+
vertical-align: bottom;
|
|
13292
|
+
|
|
13293
|
+
li {
|
|
13294
|
+
display: block;
|
|
13295
|
+
float: left;
|
|
13296
|
+
|
|
13297
|
+
&::after {
|
|
13298
|
+
content: ' ';
|
|
13299
|
+
padding-right: var(--wui-space-03);
|
|
13300
|
+
}
|
|
13301
|
+
|
|
13302
|
+
&:last-child {
|
|
13303
|
+
&::after {
|
|
13304
|
+
content: '' !important;
|
|
13305
|
+
padding-right: 0;
|
|
13306
|
+
}
|
|
13307
|
+
}
|
|
13308
|
+
}
|
|
13309
|
+
`;
|
|
13310
|
+
var commasStyle = import_styled_components96.css`
|
|
13311
|
+
${spacesStyle};
|
|
13312
|
+
|
|
13313
|
+
li {
|
|
13314
|
+
&::after {
|
|
13315
|
+
content: ',' !important;
|
|
13316
|
+
padding-right: var(--wui-space-01);
|
|
13317
|
+
}
|
|
13318
|
+
}
|
|
13319
|
+
`;
|
|
13320
|
+
var slashesStyle = import_styled_components96.css`
|
|
13321
|
+
${spacesStyle};
|
|
13322
|
+
|
|
13323
|
+
li {
|
|
13324
|
+
&::after {
|
|
13325
|
+
content: '/' !important;
|
|
13326
|
+
padding-left: var(--wui-space-01);
|
|
13327
|
+
padding-right: var(--wui-space-01);
|
|
13328
|
+
}
|
|
13329
|
+
}
|
|
13330
|
+
`;
|
|
13331
|
+
var breadcrumbsStyle = import_styled_components96.css`
|
|
13332
|
+
${spacesStyle};
|
|
13333
|
+
|
|
13334
|
+
li {
|
|
13335
|
+
&::after {
|
|
13336
|
+
content: '>' !important;
|
|
13337
|
+
padding-left: var(--wui-space-01);
|
|
13338
|
+
padding-right: var(--wui-space-01);
|
|
13339
|
+
}
|
|
13340
|
+
}
|
|
13341
|
+
`;
|
|
13342
|
+
var unbulletedStyle = import_styled_components96.css`
|
|
13343
|
+
list-style: none;
|
|
13344
|
+
padding-left: 0;
|
|
13345
|
+
`;
|
|
13346
|
+
var ListComponent = import_styled_components96.default.ul`
|
|
13347
|
+
list-style-position: outside;
|
|
13348
|
+
margin: 0 0 var(--wui-space-01);
|
|
13349
|
+
padding: 0 0 0 var(--wui-space-04);
|
|
13350
|
+
${({ variant }) => variant === "unbulleted" && unbulletedStyle};
|
|
13351
|
+
${({ variant }) => variant === "spaces" && spacesStyle};
|
|
13352
|
+
${({ variant }) => variant === "commas" && commasStyle};
|
|
13353
|
+
${({ variant }) => variant === "slashes" && slashesStyle};
|
|
13354
|
+
${({ variant }) => variant === "breadcrumbs" && breadcrumbsStyle};
|
|
13355
|
+
|
|
13356
|
+
> li:last-child {
|
|
13357
|
+
margin-bottom: 0;
|
|
13358
|
+
}
|
|
13359
|
+
|
|
13360
|
+
ul,
|
|
13361
|
+
ol {
|
|
13362
|
+
margin-top: var(--wui-space-01);
|
|
13363
|
+
}
|
|
13364
|
+
|
|
13365
|
+
/* nested lists should not have bottom margins because their container <li> will have one */
|
|
13366
|
+
li ul,
|
|
13367
|
+
li ol {
|
|
13368
|
+
margin-bottom: 0;
|
|
13369
|
+
}
|
|
13370
|
+
`;
|
|
13371
|
+
var renderListComponent = (listItems, variant, { ...otherProps }) => {
|
|
13372
|
+
const elementType = variant === "ordered" ? "ol" : "ul";
|
|
13373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(
|
|
13374
|
+
ListComponent,
|
|
13375
|
+
{
|
|
13376
|
+
as: elementType,
|
|
13377
|
+
variant,
|
|
13378
|
+
...otherProps,
|
|
13379
|
+
children: listItems
|
|
13380
|
+
}
|
|
13381
|
+
);
|
|
13382
|
+
};
|
|
13383
|
+
var renderListFromArray = (listItems, variant, otherProps) => {
|
|
13384
|
+
let itemCount = 0;
|
|
13385
|
+
const items = listItems.map((listItem, i) => {
|
|
13386
|
+
const item = listItem;
|
|
13387
|
+
const nextItem = listItems[i + 1];
|
|
13388
|
+
const key = `item-${itemCount += 1}`;
|
|
13389
|
+
if (Array.isArray(nextItem)) {
|
|
13390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(ListItem, { children: [
|
|
13391
|
+
item,
|
|
13392
|
+
renderListFromArray(nextItem, variant, otherProps)
|
|
13393
|
+
] }, key);
|
|
13394
|
+
}
|
|
13395
|
+
if (Array.isArray(item)) {
|
|
13396
|
+
return null;
|
|
13397
|
+
}
|
|
13398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(ListItem, { children: item }, key);
|
|
13399
|
+
});
|
|
13400
|
+
return renderListComponent(items, variant, otherProps);
|
|
13401
|
+
};
|
|
13402
|
+
var List = ({
|
|
13403
|
+
children,
|
|
13404
|
+
items,
|
|
13405
|
+
variant,
|
|
13406
|
+
...otherProps
|
|
13407
|
+
}) => {
|
|
13408
|
+
const listVariant = variant ?? "bullets";
|
|
13409
|
+
if ((0, import_type_guards59.isNotNil)(children)) {
|
|
13410
|
+
if (Array.isArray(children) && !children.length) {
|
|
13411
|
+
return null;
|
|
13412
|
+
}
|
|
13413
|
+
return renderListComponent(children, listVariant, otherProps);
|
|
13414
|
+
}
|
|
13415
|
+
if ((0, import_type_guards59.isNotNil)(items)) {
|
|
13416
|
+
if (!items.length) {
|
|
13417
|
+
return null;
|
|
13418
|
+
}
|
|
13419
|
+
return renderListFromArray(items, listVariant, otherProps);
|
|
13420
|
+
}
|
|
13421
|
+
return null;
|
|
13422
|
+
};
|
|
13423
|
+
List.displayName = "List";
|
|
13280
13424
|
// Annotate the CommonJS export names for ESM import in node:
|
|
13281
13425
|
0 && (module.exports = {
|
|
13282
13426
|
ActionButton,
|
|
@@ -13320,6 +13464,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13320
13464
|
KeyboardShortcut,
|
|
13321
13465
|
Label,
|
|
13322
13466
|
Link,
|
|
13467
|
+
List,
|
|
13323
13468
|
Menu,
|
|
13324
13469
|
MenuItem,
|
|
13325
13470
|
MenuItemDescription,
|