@wistia/ui 0.8.27 → 0.8.28

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 CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.8.27
3
+ * @license @wistia/ui v0.8.28
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,
@@ -7790,7 +7791,6 @@ var makePolymorphic = (component) => {
7790
7791
 
7791
7792
  // src/components/Box/Box.tsx
7792
7793
  var import_jsx_runtime199 = require("react/jsx-runtime");
7793
- var isDev = process.env["NODE_ENV"] === "development" || process.env["NODE_ENV"] === "test";
7794
7794
  var getGapStyle = (gap) => {
7795
7795
  if ((0, import_type_guards20.isNotNil)(gap)) {
7796
7796
  if ((0, import_type_guards20.isRecord)(gap)) {
@@ -7885,22 +7885,6 @@ var StyledBoxComponent = import_styled_components27.default.div`
7885
7885
  justify-content: ${({ $justifyContent }) => $justifyContent};
7886
7886
  order: ${({ $order }) => (0, import_type_guards20.isNotNil)($order) ? $order : null};
7887
7887
  `;
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
7888
  var DEFAULT_ELEMENT = "div";
7905
7889
  var BoxComponent = (0, import_react26.forwardRef)(
7906
7890
  ({
@@ -7914,8 +7898,6 @@ var BoxComponent = (0, import_react26.forwardRef)(
7914
7898
  fillViewport = false,
7915
7899
  gap,
7916
7900
  grow,
7917
- hasBoxParent = false,
7918
- // eslint-disable-line @typescript-eslint/no-unused-vars
7919
7901
  height,
7920
7902
  inline = false,
7921
7903
  justifyContent = "flex-start",
@@ -7976,7 +7958,7 @@ var BoxComponent = (0, import_react26.forwardRef)(
7976
7958
  $wrapItems: wrapItems,
7977
7959
  as: renderAs ?? DEFAULT_ELEMENT,
7978
7960
  ...props,
7979
- children: wrapChildren(children)
7961
+ children
7980
7962
  }
7981
7963
  );
7982
7964
  }
@@ -13277,6 +13259,164 @@ var WistiaLogo = ({
13277
13259
  return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime274.jsx)("a", { href, children: Logo }) : Logo;
13278
13260
  };
13279
13261
  WistiaLogo.displayName = "WistiaLogo";
13262
+
13263
+ // src/components/List/List.tsx
13264
+ var import_type_guards59 = require("@wistia/type-guards");
13265
+ var import_styled_components96 = __toESM(require("styled-components"));
13266
+
13267
+ // src/components/List/ListItem.tsx
13268
+ var import_styled_components95 = __toESM(require("styled-components"));
13269
+ var import_type_guards58 = require("@wistia/type-guards");
13270
+ var import_jsx_runtime275 = require("react/jsx-runtime");
13271
+ var ListItemComponent = import_styled_components95.default.li`
13272
+ margin-bottom: var(--wui-space-02);
13273
+ `;
13274
+ var ListItem = ({ children }) => {
13275
+ if ((0, import_type_guards58.isNil)(children)) {
13276
+ return null;
13277
+ }
13278
+ return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(ListItemComponent, { children });
13279
+ };
13280
+ ListItem.displayName = "ListItem";
13281
+
13282
+ // src/components/List/List.tsx
13283
+ var import_jsx_runtime276 = require("react/jsx-runtime");
13284
+ var spacesStyle = import_styled_components96.css`
13285
+ overflow: hidden;
13286
+ padding-left: 0;
13287
+ vertical-align: bottom;
13288
+
13289
+ li {
13290
+ display: block;
13291
+ float: left;
13292
+
13293
+ &::after {
13294
+ content: ' ';
13295
+ padding-right: var(--wui-space-03);
13296
+ }
13297
+
13298
+ &:last-child {
13299
+ &::after {
13300
+ content: '' !important;
13301
+ padding-right: 0;
13302
+ }
13303
+ }
13304
+ }
13305
+ `;
13306
+ var commasStyle = import_styled_components96.css`
13307
+ ${spacesStyle};
13308
+
13309
+ li {
13310
+ &::after {
13311
+ content: ',' !important;
13312
+ padding-right: var(--wui-space-01);
13313
+ }
13314
+ }
13315
+ `;
13316
+ var slashesStyle = import_styled_components96.css`
13317
+ ${spacesStyle};
13318
+
13319
+ li {
13320
+ &::after {
13321
+ content: '/' !important;
13322
+ padding-left: var(--wui-space-01);
13323
+ padding-right: var(--wui-space-01);
13324
+ }
13325
+ }
13326
+ `;
13327
+ var breadcrumbsStyle = import_styled_components96.css`
13328
+ ${spacesStyle};
13329
+
13330
+ li {
13331
+ &::after {
13332
+ content: '>' !important;
13333
+ padding-left: var(--wui-space-01);
13334
+ padding-right: var(--wui-space-01);
13335
+ }
13336
+ }
13337
+ `;
13338
+ var unbulletedStyle = import_styled_components96.css`
13339
+ list-style: none;
13340
+ padding-left: 0;
13341
+ `;
13342
+ var ListComponent = import_styled_components96.default.ul`
13343
+ list-style-position: outside;
13344
+ margin: 0 0 var(--wui-space-01);
13345
+ padding: 0 0 0 var(--wui-space-04);
13346
+ ${({ variant }) => variant === "unbulleted" && unbulletedStyle};
13347
+ ${({ variant }) => variant === "spaces" && spacesStyle};
13348
+ ${({ variant }) => variant === "commas" && commasStyle};
13349
+ ${({ variant }) => variant === "slashes" && slashesStyle};
13350
+ ${({ variant }) => variant === "breadcrumbs" && breadcrumbsStyle};
13351
+
13352
+ > li:last-child {
13353
+ margin-bottom: 0;
13354
+ }
13355
+
13356
+ ul,
13357
+ ol {
13358
+ margin-top: var(--wui-space-01);
13359
+ }
13360
+
13361
+ /* nested lists should not have bottom margins because their container <li> will have one */
13362
+ li ul,
13363
+ li ol {
13364
+ margin-bottom: 0;
13365
+ }
13366
+ `;
13367
+ var renderListComponent = (listItems, variant, { ...otherProps }) => {
13368
+ const elementType = variant === "ordered" ? "ol" : "ul";
13369
+ return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(
13370
+ ListComponent,
13371
+ {
13372
+ as: elementType,
13373
+ variant,
13374
+ ...otherProps,
13375
+ children: listItems
13376
+ }
13377
+ );
13378
+ };
13379
+ var renderListFromArray = (listItems, variant, otherProps) => {
13380
+ let itemCount = 0;
13381
+ const items = listItems.map((listItem, i) => {
13382
+ const item = listItem;
13383
+ const nextItem = listItems[i + 1];
13384
+ const key = `item-${itemCount += 1}`;
13385
+ if (Array.isArray(nextItem)) {
13386
+ return /* @__PURE__ */ (0, import_jsx_runtime276.jsxs)(ListItem, { children: [
13387
+ item,
13388
+ renderListFromArray(nextItem, variant, otherProps)
13389
+ ] }, key);
13390
+ }
13391
+ if (Array.isArray(item)) {
13392
+ return null;
13393
+ }
13394
+ return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)(ListItem, { children: item }, key);
13395
+ });
13396
+ return renderListComponent(items, variant, otherProps);
13397
+ };
13398
+ var List = ({
13399
+ children,
13400
+ items,
13401
+ variant,
13402
+ ...otherProps
13403
+ }) => {
13404
+ const listVariant = variant ?? "bullets";
13405
+ if ((0, import_type_guards59.isNotNil)(children)) {
13406
+ if (Array.isArray(children) && !children.length) {
13407
+ return null;
13408
+ }
13409
+ return renderListComponent(children, listVariant, otherProps);
13410
+ }
13411
+ if ((0, import_type_guards59.isNotNil)(items)) {
13412
+ if (!items.length) {
13413
+ return null;
13414
+ }
13415
+ return renderListFromArray(items, listVariant, otherProps);
13416
+ }
13417
+ return null;
13418
+ };
13419
+ List.displayName = "List";
13280
13420
  // Annotate the CommonJS export names for ESM import in node:
13281
13421
  0 && (module.exports = {
13282
13422
  ActionButton,
@@ -13320,6 +13460,7 @@ WistiaLogo.displayName = "WistiaLogo";
13320
13460
  KeyboardShortcut,
13321
13461
  Label,
13322
13462
  Link,
13463
+ List,
13323
13464
  Menu,
13324
13465
  MenuItem,
13325
13466
  MenuItemDescription,