@wistia/ui 0.18.18-beta.fba14250.ac46dfb → 0.19.0-beta.e04d42c5.ec25c59

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.18.18-beta.fba14250.ac46dfb
3
+ * @license @wistia/ui v0.19.0-beta.e04d42c5.ec25c59
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -14252,7 +14252,7 @@ var DataCardInner = ({
14252
14252
  StyledLabel3,
14253
14253
  {
14254
14254
  "data-wui-data-card-skeleton": isLoading,
14255
- renderAs: "span",
14255
+ renderAs: "dt",
14256
14256
  variant: "heading6",
14257
14257
  children: label
14258
14258
  }
@@ -14261,7 +14261,7 @@ var DataCardInner = ({
14261
14261
  StyledValue,
14262
14262
  {
14263
14263
  "data-wui-data-card-skeleton": isLoading,
14264
- renderAs: "span",
14264
+ renderAs: "dd",
14265
14265
  variant: "heading3",
14266
14266
  children: value
14267
14267
  }
@@ -14314,42 +14314,29 @@ var import_styled_components78 = require("styled-components");
14314
14314
  var import_jsx_runtime279 = require("react/jsx-runtime");
14315
14315
  var StyledDataCards = (0, import_styled_components78.styled)(Box)`
14316
14316
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
14317
- --wui-data-cards-column-count: ${({ $columns }) => $columns === "auto" ? void 0 : $columns};
14318
- --wui-data-cards-total-column-gap-width: calc(var(--wui-data-cards-column-count) - 1) *
14319
- var(--wui-space-02);
14320
- --wui-data-cards-column-width: calc(
14321
- (100% - var(--wui-data-cards-total-column-gap-width)) / var(--wui-data-cards-column-count)
14322
- );
14323
14317
 
14324
14318
  > * {
14325
- min-width: ${({ $cardMinWidth }) => $cardMinWidth};
14326
- flex-basis: var(--wui-data-cards-column-width, 0);
14319
+ min-width: 120px;
14327
14320
  max-width: ${({ $cardMaxWidth }) => $cardMaxWidth};
14328
14321
  }
14329
14322
  `;
14330
14323
  var DataCards = ({
14331
14324
  children,
14332
- cardMinWidth = "120px",
14333
14325
  cardMaxWidth = "none",
14334
14326
  colorScheme = "inherit",
14335
- columns = "auto",
14336
14327
  ...props
14337
14328
  }) => {
14338
- const responsiveCardMinWidth = useResponsiveProp(cardMinWidth);
14339
- const responsiveCardMaxWidth = useResponsiveProp(cardMaxWidth);
14340
- const responsiveColumns = useResponsiveProp(columns);
14341
14329
  return /* @__PURE__ */ (0, import_jsx_runtime279.jsx)(
14342
14330
  StyledDataCards,
14343
14331
  {
14344
14332
  ...props,
14345
- $cardMaxWidth: responsiveCardMaxWidth,
14346
- $cardMinWidth: responsiveCardMinWidth,
14333
+ $cardMaxWidth: cardMaxWidth,
14347
14334
  $colorScheme: colorScheme,
14348
- $columns: responsiveColumns,
14349
14335
  alignItems: "stretch",
14350
14336
  direction: "row",
14351
14337
  fill: "horizontal",
14352
14338
  gap: "space-02",
14339
+ renderAs: "dl",
14353
14340
  wrapItems: true,
14354
14341
  children
14355
14342
  }
@@ -15243,8 +15230,20 @@ var import_react73 = require("react");
15243
15230
  var import_styled_components87 = require("styled-components");
15244
15231
  var import_type_guards49 = require("@wistia/type-guards");
15245
15232
  var import_jsx_runtime293 = require("react/jsx-runtime");
15233
+ var inlineErrorStyles = import_styled_components87.css`
15234
+ grid-template-rows: 1fr auto;
15235
+ grid-template-areas: 'label-description input' '. error';
15236
+ `;
15237
+ var inlineBaseGridAreaStyles = import_styled_components87.css`
15238
+ grid-template-rows: 1fr;
15239
+ grid-template-areas: 'label-description input';
15240
+ `;
15241
+ var blockGridErrorStyles = import_styled_components87.css`
15242
+ grid-template-rows: auto 1fr auto;
15243
+ grid-template-areas: 'label-description' 'input' 'error';
15244
+ `;
15246
15245
  var StyledFormField = import_styled_components87.styled.div`
15247
- --form-field-spacing: var(--wui-space-01);
15246
+ --form-field-spacing: var(--wui-space-02);
15248
15247
  --form-field-spacing-inline: var(--wui-space-02);
15249
15248
  --form-field-error-color: var(--wui-color-text-secondary-error);
15250
15249
 
@@ -15258,21 +15257,28 @@ var StyledFormField = import_styled_components87.styled.div`
15258
15257
  &[data-label-position='inline-compact'] {
15259
15258
  gap: var(--form-field-spacing-inline);
15260
15259
  grid-template-columns: auto 1fr;
15261
- grid-template-rows: 1fr auto;
15260
+ ${inlineBaseGridAreaStyles}
15261
+ ${({ $hasError }) => $hasError && inlineErrorStyles}
15262
15262
  }
15263
15263
 
15264
15264
  &[data-label-position='inline'] {
15265
15265
  gap: var(--form-field-spacing-inline);
15266
15266
  grid-template-columns: minmax(auto, 1fr) 1fr;
15267
- grid-template-rows: 1fr auto;
15267
+ ${inlineBaseGridAreaStyles}
15268
+ ${({ $hasError }) => $hasError && inlineErrorStyles}
15268
15269
  }
15269
15270
 
15270
15271
  &[data-label-position='block'] {
15271
15272
  gap: var(--form-field-spacing);
15272
15273
  grid-template-columns: 1fr;
15273
- grid-template-rows: 1fr;
15274
+ grid-template-rows: auto 1fr;
15275
+ grid-template-areas: 'label-description' 'input';
15276
+ ${({ $hasError }) => $hasError && blockGridErrorStyles}
15274
15277
  }
15275
15278
  `;
15279
+ var ErrorText = (0, import_styled_components87.styled)(Text)`
15280
+ grid-area: error;
15281
+ `;
15276
15282
  var StyledErrorList = import_styled_components87.styled.ul`
15277
15283
  margin: 0;
15278
15284
  padding: 0;
@@ -15280,13 +15286,14 @@ var StyledErrorList = import_styled_components87.styled.ul`
15280
15286
  display: flex;
15281
15287
  flex-direction: column;
15282
15288
  gap: var(--wui-space-01);
15289
+ grid-area: error;
15283
15290
  `;
15284
15291
  var ErrorMessages = ({ errors, id }) => {
15285
15292
  const isErrorArray = (0, import_type_guards49.isArray)(errors);
15286
15293
  const isMultipleErrors = isErrorArray && errors.length > 1;
15287
15294
  if (!isErrorArray) {
15288
15295
  return /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
15289
- Text,
15296
+ ErrorText,
15290
15297
  {
15291
15298
  colorScheme: "error",
15292
15299
  id,
@@ -15299,7 +15306,7 @@ var ErrorMessages = ({ errors, id }) => {
15299
15306
  }
15300
15307
  if (!isMultipleErrors) {
15301
15308
  return /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
15302
- Text,
15309
+ ErrorText,
15303
15310
  {
15304
15311
  colorScheme: "error",
15305
15312
  id,
@@ -15344,12 +15351,16 @@ var FormField = ({
15344
15351
  const descriptionId = `${computedId}-description`;
15345
15352
  const errorId = `${computedId}-error`;
15346
15353
  const ariaDescribedby = [descriptionId, errorId].filter(Boolean).join(" ") || void 0;
15354
+ const hasDescription = (0, import_type_guards49.isNotNil)(description);
15355
+ const hasError = (0, import_type_guards49.isNotNil)(computedError);
15356
+ const shouldRenderLabelDescriptionWrapper = !isIntegratedLabel || hasDescription;
15347
15357
  let childProps = {
15348
15358
  name,
15349
15359
  id: computedId,
15350
15360
  label: isIntegratedLabel ? label : void 0,
15351
15361
  "aria-describedby": ariaDescribedby,
15352
- "aria-invalid": (0, import_type_guards49.isNotNil)(computedError),
15362
+ "aria-invalid": hasError,
15363
+ style: { gridArea: "input" },
15353
15364
  ...props
15354
15365
  };
15355
15366
  if ((0, import_type_guards49.isUndefined)(value) && (0, import_type_guards49.isNotUndefined)(defaultValue)) {
@@ -15379,28 +15390,38 @@ var FormField = ({
15379
15390
  StyledFormField,
15380
15391
  {
15381
15392
  ...props,
15393
+ $hasError: hasError,
15382
15394
  "data-label-position": labelPosition ?? formState.labelPosition,
15383
15395
  children: [
15384
- !isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
15385
- Label,
15396
+ shouldRenderLabelDescriptionWrapper ? /* @__PURE__ */ (0, import_jsx_runtime293.jsxs)(
15397
+ Stack,
15386
15398
  {
15387
- htmlFor: computedId,
15388
- required,
15389
- children: label
15399
+ direction: "vertical",
15400
+ gap: "space-01",
15401
+ style: {
15402
+ gridArea: "label-description"
15403
+ },
15404
+ children: [
15405
+ !isIntegratedLabel && /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
15406
+ Label,
15407
+ {
15408
+ htmlFor: computedId,
15409
+ required,
15410
+ children: label
15411
+ }
15412
+ ),
15413
+ hasDescription ? /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null
15414
+ ]
15390
15415
  }
15391
- ),
15392
- (0, import_type_guards49.isNotNil)(description) ? /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
15416
+ ) : null,
15393
15417
  (0, import_react73.cloneElement)(children, childProps),
15394
- (0, import_type_guards49.isNotNil)(computedError) ? /* @__PURE__ */ (0, import_jsx_runtime293.jsxs)(import_jsx_runtime293.Fragment, { children: [
15395
- /* @__PURE__ */ (0, import_jsx_runtime293.jsx)("div", {}),
15396
- /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
15397
- ErrorMessages,
15398
- {
15399
- errors: computedError,
15400
- id: errorId
15401
- }
15402
- )
15403
- ] }) : null
15418
+ hasError ? /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(
15419
+ ErrorMessages,
15420
+ {
15421
+ errors: computedError,
15422
+ id: errorId
15423
+ }
15424
+ ) : null
15404
15425
  ]
15405
15426
  }
15406
15427
  );
@@ -18566,7 +18587,7 @@ var Thumbnail = (0, import_react97.forwardRef)(
18566
18587
  Thumbnail.displayName = "Thumbnail_UI";
18567
18588
 
18568
18589
  // src/components/ThumbnailCollage/ThumbnailCollage.tsx
18569
- var import_react98 = require("react");
18590
+ var import_react98 = __toESM(require("react"));
18570
18591
  var import_styled_components129 = require("styled-components");
18571
18592
  var import_type_guards75 = require("@wistia/type-guards");
18572
18593
  var import_jsx_runtime338 = (
@@ -18580,12 +18601,20 @@ var ThumbnailCollageContainer = import_styled_components129.styled.div`
18580
18601
  display: flex;
18581
18602
  `;
18582
18603
  var StyledThumbnailCollage = import_styled_components129.styled.div`
18604
+ --wui-thumbnail-collage-spacing: var(--wui-space-01);
18605
+ border-radius: clamp(var(--wui-border-radius-01), 8cqh, var(--wui-border-radius-05));
18583
18606
  display: grid;
18584
- gap: var(--wui-space-01);
18607
+ gap: var(--wui-thumbnail-collage-spacing);
18585
18608
  width: 100%;
18586
18609
  grid-template-columns: 3fr 2fr;
18587
18610
  grid-template-rows: 1fr 1fr;
18588
18611
 
18612
+ ${({ $hasBackground }) => $hasBackground && import_styled_components129.css`
18613
+ background-color: var(--wui-color-bg-surface-secondary);
18614
+ border: 1px solid rgba(0, 0, 0, 0.05);
18615
+ padding: var(--wui-thumbnail-collage-spacing);
18616
+ `}
18617
+
18589
18618
  &:has(:nth-child(1)) {
18590
18619
  grid-template-areas:
18591
18620
  'a a'
@@ -18622,16 +18651,21 @@ var StyledThumbnailCollage = import_styled_components129.styled.div`
18622
18651
  height: 100%;
18623
18652
  width: 100%;
18624
18653
  }
18654
+
18655
+ @container (min-width: 200px) {
18656
+ --wui-thumbnail-collage-spacing: var(--wui-space-02);
18657
+ }
18625
18658
  `;
18626
18659
  var ThumbnailCollage = ({
18627
18660
  children = [],
18628
18661
  gradientBackground = "defaultMidOne",
18662
+ hasBackground = false,
18629
18663
  ...props
18630
18664
  }) => {
18631
- const thumbnailArray = import_react98.Children.toArray(children);
18665
+ const thumbnailArray = import_react98.default.Children.toArray(children);
18632
18666
  const truncatedThumbnails = thumbnailArray.slice(0, 3);
18633
18667
  const thumbnails = (0, import_type_guards75.isNonEmptyArray)(thumbnailArray) ? truncatedThumbnails.map((child) => {
18634
- return (0, import_react98.cloneElement)(child, {
18668
+ return import_react98.default.cloneElement(child, {
18635
18669
  ...child.props,
18636
18670
  children: void 0
18637
18671
  });
@@ -18649,6 +18683,7 @@ var ThumbnailCollage = ({
18649
18683
  StyledThumbnailCollage,
18650
18684
  {
18651
18685
  $gradientBackground: gradientBackground,
18686
+ $hasBackground: hasBackground,
18652
18687
  "data-wui-thumbnail-collage": true,
18653
18688
  ...props,
18654
18689
  children: thumbnails