@wistia/ui 0.8.22 → 0.8.23-beta.19d08531.c324c9a
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 +162 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.mjs +161 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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.23-beta.19d08531.c324c9a
|
|
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,
|
|
@@ -7298,6 +7299,7 @@ var Button = (0, import_react22.forwardRef)(
|
|
|
7298
7299
|
{
|
|
7299
7300
|
ref,
|
|
7300
7301
|
as: Link,
|
|
7302
|
+
disabled: isAriaDisabled(),
|
|
7301
7303
|
...props,
|
|
7302
7304
|
...commonProps,
|
|
7303
7305
|
children: unstyled ? children : /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
|
|
@@ -13145,6 +13147,164 @@ var WistiaLogo = ({
|
|
|
13145
13147
|
return href !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime273.jsx)("a", { href, children: Logo }) : Logo;
|
|
13146
13148
|
};
|
|
13147
13149
|
WistiaLogo.displayName = "WistiaLogo";
|
|
13150
|
+
|
|
13151
|
+
// src/components/List/List.tsx
|
|
13152
|
+
var import_type_guards59 = require("@wistia/type-guards");
|
|
13153
|
+
var import_styled_components95 = __toESM(require("styled-components"));
|
|
13154
|
+
|
|
13155
|
+
// src/components/List/ListItem.tsx
|
|
13156
|
+
var import_styled_components94 = __toESM(require("styled-components"));
|
|
13157
|
+
var import_type_guards58 = require("@wistia/type-guards");
|
|
13158
|
+
var import_jsx_runtime274 = require("react/jsx-runtime");
|
|
13159
|
+
var ListItemComponent = import_styled_components94.default.li`
|
|
13160
|
+
margin-bottom: var(--wui-space-02);
|
|
13161
|
+
`;
|
|
13162
|
+
var ListItem = ({ children }) => {
|
|
13163
|
+
if ((0, import_type_guards58.isNil)(children)) {
|
|
13164
|
+
return null;
|
|
13165
|
+
}
|
|
13166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(ListItemComponent, { children });
|
|
13167
|
+
};
|
|
13168
|
+
ListItem.displayName = "ListItem";
|
|
13169
|
+
|
|
13170
|
+
// src/components/List/List.tsx
|
|
13171
|
+
var import_jsx_runtime275 = require("react/jsx-runtime");
|
|
13172
|
+
var spacesStyle = import_styled_components95.css`
|
|
13173
|
+
overflow: hidden;
|
|
13174
|
+
padding-left: 0;
|
|
13175
|
+
vertical-align: bottom;
|
|
13176
|
+
|
|
13177
|
+
li {
|
|
13178
|
+
display: block;
|
|
13179
|
+
float: left;
|
|
13180
|
+
|
|
13181
|
+
&::after {
|
|
13182
|
+
content: ' ';
|
|
13183
|
+
padding-right: var(--wui-space-03);
|
|
13184
|
+
}
|
|
13185
|
+
|
|
13186
|
+
&:last-child {
|
|
13187
|
+
&::after {
|
|
13188
|
+
content: '' !important;
|
|
13189
|
+
padding-right: 0;
|
|
13190
|
+
}
|
|
13191
|
+
}
|
|
13192
|
+
}
|
|
13193
|
+
`;
|
|
13194
|
+
var commasStyle = import_styled_components95.css`
|
|
13195
|
+
${spacesStyle};
|
|
13196
|
+
|
|
13197
|
+
li {
|
|
13198
|
+
&::after {
|
|
13199
|
+
content: ',' !important;
|
|
13200
|
+
padding-right: var(--wui-space-01);
|
|
13201
|
+
}
|
|
13202
|
+
}
|
|
13203
|
+
`;
|
|
13204
|
+
var slashesStyle = import_styled_components95.css`
|
|
13205
|
+
${spacesStyle};
|
|
13206
|
+
|
|
13207
|
+
li {
|
|
13208
|
+
&::after {
|
|
13209
|
+
content: '/' !important;
|
|
13210
|
+
padding-left: var(--wui-space-01);
|
|
13211
|
+
padding-right: var(--wui-space-01);
|
|
13212
|
+
}
|
|
13213
|
+
}
|
|
13214
|
+
`;
|
|
13215
|
+
var breadcrumbsStyle = import_styled_components95.css`
|
|
13216
|
+
${spacesStyle};
|
|
13217
|
+
|
|
13218
|
+
li {
|
|
13219
|
+
&::after {
|
|
13220
|
+
content: '>' !important;
|
|
13221
|
+
padding-left: var(--wui-space-01);
|
|
13222
|
+
padding-right: var(--wui-space-01);
|
|
13223
|
+
}
|
|
13224
|
+
}
|
|
13225
|
+
`;
|
|
13226
|
+
var unbulletedStyle = import_styled_components95.css`
|
|
13227
|
+
list-style: none;
|
|
13228
|
+
padding-left: 0;
|
|
13229
|
+
`;
|
|
13230
|
+
var ListComponent = import_styled_components95.default.ul`
|
|
13231
|
+
list-style-position: outside;
|
|
13232
|
+
margin: 0 0 var(--wui-space-01);
|
|
13233
|
+
padding: 0 0 0 var(--wui-space-04);
|
|
13234
|
+
${({ variant }) => variant === "unbulleted" && unbulletedStyle};
|
|
13235
|
+
${({ variant }) => variant === "spaces" && spacesStyle};
|
|
13236
|
+
${({ variant }) => variant === "commas" && commasStyle};
|
|
13237
|
+
${({ variant }) => variant === "slashes" && slashesStyle};
|
|
13238
|
+
${({ variant }) => variant === "breadcrumbs" && breadcrumbsStyle};
|
|
13239
|
+
|
|
13240
|
+
> li:last-child {
|
|
13241
|
+
margin-bottom: 0;
|
|
13242
|
+
}
|
|
13243
|
+
|
|
13244
|
+
ul,
|
|
13245
|
+
ol {
|
|
13246
|
+
margin-top: var(--wui-space-01);
|
|
13247
|
+
}
|
|
13248
|
+
|
|
13249
|
+
/* nested lists should not have bottom margins because their container <li> will have one */
|
|
13250
|
+
li ul,
|
|
13251
|
+
li ol {
|
|
13252
|
+
margin-bottom: 0;
|
|
13253
|
+
}
|
|
13254
|
+
`;
|
|
13255
|
+
var renderListComponent = (listItems, variant, { ...otherProps }) => {
|
|
13256
|
+
const elementType = variant === "ordered" ? "ol" : "ul";
|
|
13257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(
|
|
13258
|
+
ListComponent,
|
|
13259
|
+
{
|
|
13260
|
+
as: elementType,
|
|
13261
|
+
variant,
|
|
13262
|
+
...otherProps,
|
|
13263
|
+
children: listItems
|
|
13264
|
+
}
|
|
13265
|
+
);
|
|
13266
|
+
};
|
|
13267
|
+
var renderListFromArray = (listItems, variant, otherProps) => {
|
|
13268
|
+
let itemCount = 0;
|
|
13269
|
+
const items = listItems.map((listItem, i) => {
|
|
13270
|
+
const item = listItem;
|
|
13271
|
+
const nextItem = listItems[i + 1];
|
|
13272
|
+
const key = `item-${itemCount += 1}`;
|
|
13273
|
+
if (Array.isArray(nextItem)) {
|
|
13274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(ListItem, { children: [
|
|
13275
|
+
item,
|
|
13276
|
+
renderListFromArray(nextItem, variant, otherProps)
|
|
13277
|
+
] }, key);
|
|
13278
|
+
}
|
|
13279
|
+
if (Array.isArray(item)) {
|
|
13280
|
+
return null;
|
|
13281
|
+
}
|
|
13282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(ListItem, { children: item }, key);
|
|
13283
|
+
});
|
|
13284
|
+
return renderListComponent(items, variant, otherProps);
|
|
13285
|
+
};
|
|
13286
|
+
var List = ({
|
|
13287
|
+
children,
|
|
13288
|
+
items,
|
|
13289
|
+
variant,
|
|
13290
|
+
...otherProps
|
|
13291
|
+
}) => {
|
|
13292
|
+
const listVariant = variant ?? "bullets";
|
|
13293
|
+
if ((0, import_type_guards59.isNotNil)(children)) {
|
|
13294
|
+
if (Array.isArray(children) && !children.length) {
|
|
13295
|
+
return null;
|
|
13296
|
+
}
|
|
13297
|
+
return renderListComponent(children, listVariant, otherProps);
|
|
13298
|
+
}
|
|
13299
|
+
if ((0, import_type_guards59.isNotNil)(items)) {
|
|
13300
|
+
if (!items.length) {
|
|
13301
|
+
return null;
|
|
13302
|
+
}
|
|
13303
|
+
return renderListFromArray(items, listVariant, otherProps);
|
|
13304
|
+
}
|
|
13305
|
+
return null;
|
|
13306
|
+
};
|
|
13307
|
+
List.displayName = "List";
|
|
13148
13308
|
// Annotate the CommonJS export names for ESM import in node:
|
|
13149
13309
|
0 && (module.exports = {
|
|
13150
13310
|
ActionButton,
|
|
@@ -13188,6 +13348,7 @@ WistiaLogo.displayName = "WistiaLogo";
|
|
|
13188
13348
|
KeyboardShortcut,
|
|
13189
13349
|
Label,
|
|
13190
13350
|
Link,
|
|
13351
|
+
List,
|
|
13191
13352
|
Menu,
|
|
13192
13353
|
MenuItem,
|
|
13193
13354
|
MenuItemDescription,
|