@wistia/ui 0.15.14-beta.1e41934b.72b042b → 0.15.14-beta.701deb7c.dd1faf8

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.d.mts CHANGED
@@ -589,7 +589,7 @@ type BadgeProps = ComponentPropsWithoutRef<'div'> & {
589
589
  /**
590
590
  * The text to display in the `Badge`
591
591
  */
592
- label: ReactNode;
592
+ label?: ReactNode;
593
593
  /**
594
594
  * The variant of the `Badge`
595
595
  */
@@ -610,7 +610,7 @@ declare const Badge: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
610
610
  /**
611
611
  * The text to display in the `Badge`
612
612
  */
613
- label: ReactNode;
613
+ label?: ReactNode;
614
614
  /**
615
615
  * The variant of the `Badge`
616
616
  */
@@ -2373,6 +2373,10 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
2373
2373
  * The name attribute of the field. It will map to the form data passed into `useFormState`.
2374
2374
  */
2375
2375
  name: string;
2376
+ /**
2377
+ * Use if label describes a required form component
2378
+ */
2379
+ required?: boolean;
2376
2380
  /**
2377
2381
  * A value that overrides the basic value. This should pair with `onChange`.
2378
2382
  */
@@ -2386,7 +2390,7 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
2386
2390
  * FormField is a compound component that combines a label, form control, and optional description and error message.
2387
2391
  */
2388
2392
  declare const FormField: {
2389
- ({ children, description, error, id, label, labelPosition, name, value, ...props }: FormFieldProps): JSX$1.Element;
2393
+ ({ children, description, error, id, label, labelPosition, name, required, value, ...props }: FormFieldProps): JSX$1.Element;
2390
2394
  displayName: string;
2391
2395
  };
2392
2396
 
package/dist/index.d.ts CHANGED
@@ -589,7 +589,7 @@ type BadgeProps = ComponentPropsWithoutRef<'div'> & {
589
589
  /**
590
590
  * The text to display in the `Badge`
591
591
  */
592
- label: ReactNode;
592
+ label?: ReactNode;
593
593
  /**
594
594
  * The variant of the `Badge`
595
595
  */
@@ -610,7 +610,7 @@ declare const Badge: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProp
610
610
  /**
611
611
  * The text to display in the `Badge`
612
612
  */
613
- label: ReactNode;
613
+ label?: ReactNode;
614
614
  /**
615
615
  * The variant of the `Badge`
616
616
  */
@@ -2373,6 +2373,10 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
2373
2373
  * The name attribute of the field. It will map to the form data passed into `useFormState`.
2374
2374
  */
2375
2375
  name: string;
2376
+ /**
2377
+ * Use if label describes a required form component
2378
+ */
2379
+ required?: boolean;
2376
2380
  /**
2377
2381
  * A value that overrides the basic value. This should pair with `onChange`.
2378
2382
  */
@@ -2386,7 +2390,7 @@ type FormFieldProps = ComponentPropsWithoutRef<'div'> & {
2386
2390
  * FormField is a compound component that combines a label, form control, and optional description and error message.
2387
2391
  */
2388
2392
  declare const FormField: {
2389
- ({ children, description, error, id, label, labelPosition, name, value, ...props }: FormFieldProps): JSX$1.Element;
2393
+ ({ children, description, error, id, label, labelPosition, name, required, value, ...props }: FormFieldProps): JSX$1.Element;
2390
2394
  displayName: string;
2391
2395
  };
2392
2396
 
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v0.15.14-beta.1e41934b.72b042b
3
+ * @license @wistia/ui v0.15.14-beta.701deb7c.dd1faf8
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -8255,7 +8255,7 @@ Avatar.displayName = "Avatar_UI";
8255
8255
  // src/components/Badge/Badge.tsx
8256
8256
  import { forwardRef as forwardRef4 } from "react";
8257
8257
  import styled10 from "styled-components";
8258
- import { isNotNil as isNotNil9 } from "@wistia/type-guards";
8258
+ import { isNonEmptyString as isNonEmptyString2, isNotNil as isNotNil9 } from "@wistia/type-guards";
8259
8259
  import { jsx as jsx205, jsxs as jsxs12 } from "react/jsx-runtime";
8260
8260
  var StyledBadge = styled10.div`
8261
8261
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -8296,7 +8296,7 @@ var Badge = forwardRef4(
8296
8296
  $variant: variant,
8297
8297
  children: [
8298
8298
  hasIcon ? icon : null,
8299
- /* @__PURE__ */ jsx205("span", { children: label })
8299
+ isNonEmptyString2(label) && /* @__PURE__ */ jsx205("span", { children: label })
8300
8300
  ]
8301
8301
  }
8302
8302
  );
@@ -9361,7 +9361,7 @@ var Center = forwardRef9(
9361
9361
  Center.displayName = "Center_UI";
9362
9362
 
9363
9363
  // src/components/Checkbox/Checkbox.tsx
9364
- import { isNonEmptyString as isNonEmptyString3, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
9364
+ import { isNonEmptyString as isNonEmptyString4, isNotUndefined as isNotUndefined7 } from "@wistia/type-guards";
9365
9365
  import { forwardRef as forwardRef12, useId as useId2 } from "react";
9366
9366
  import styled27, { css as css26 } from "styled-components";
9367
9367
 
@@ -9491,7 +9491,7 @@ import { isArray } from "@wistia/type-guards";
9491
9491
  // src/components/FormGroup/FormGroup.tsx
9492
9492
  import styled25 from "styled-components";
9493
9493
  import { useRef as useRef7 } from "react";
9494
- import { isNonEmptyString as isNonEmptyString2, isNotNil as isNotNil16 } from "@wistia/type-guards";
9494
+ import { isNonEmptyString as isNonEmptyString3, isNotNil as isNotNil16 } from "@wistia/type-guards";
9495
9495
 
9496
9496
  // src/components/Stack/Stack.tsx
9497
9497
  import { forwardRef as forwardRef10 } from "react";
@@ -9546,8 +9546,8 @@ var FormGroup = ({
9546
9546
  ...props
9547
9547
  }) => {
9548
9548
  const ref = useRef7(null);
9549
- const hasLabel = isNotNil16(label) && isNonEmptyString2(label);
9550
- const hasDescription = isNotNil16(description) && isNonEmptyString2(description);
9549
+ const hasLabel = isNotNil16(label) && isNonEmptyString3(label);
9550
+ const hasDescription = isNotNil16(description) && isNonEmptyString3(description);
9551
9551
  return /* @__PURE__ */ jsxs17(
9552
9552
  Stack,
9553
9553
  {
@@ -9849,7 +9849,7 @@ var Checkbox = forwardRef12(
9849
9849
  ...props
9850
9850
  }, ref) => {
9851
9851
  const generatedId = useId2();
9852
- const computedId = isNonEmptyString3(id) ? id : `wistia-ui-checkbox-${generatedId}`;
9852
+ const computedId = isNonEmptyString4(id) ? id : `wistia-ui-checkbox-${generatedId}`;
9853
9853
  const checkboxGroupContext = useCheckboxGroup();
9854
9854
  const contextName = checkboxGroupContext?.name;
9855
9855
  const contextOnChange = checkboxGroupContext?.onChange;
@@ -11318,7 +11318,7 @@ import { useCallback as useCallback12 } from "react";
11318
11318
  // src/components/Switch/Switch.tsx
11319
11319
  import { forwardRef as forwardRef14, useId as useId3 } from "react";
11320
11320
  import styled43, { css as css28 } from "styled-components";
11321
- import { isNonEmptyString as isNonEmptyString4 } from "@wistia/type-guards";
11321
+ import { isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
11322
11322
  import { jsx as jsx245, jsxs as jsxs28 } from "react/jsx-runtime";
11323
11323
  var switchHeightMap = {
11324
11324
  sm: 16,
@@ -11410,7 +11410,7 @@ var Switch = forwardRef14(
11410
11410
  ...props
11411
11411
  }, ref) => {
11412
11412
  const generatedId = useId3();
11413
- const computedId = isNonEmptyString4(id) ? id : `wistia-ui-switch-${generatedId}`;
11413
+ const computedId = isNonEmptyString5(id) ? id : `wistia-ui-switch-${generatedId}`;
11414
11414
  return /* @__PURE__ */ jsxs28(
11415
11415
  StyledSwitchWrapper,
11416
11416
  {
@@ -12433,7 +12433,7 @@ import { isArray as isArray2, isString as isString3 } from "@wistia/type-guards"
12433
12433
  // src/components/Tag/Tag.tsx
12434
12434
  import { forwardRef as forwardRef16 } from "react";
12435
12435
  import styled49 from "styled-components";
12436
- import { isNil as isNil15, isNotNil as isNotNil19, isNonEmptyString as isNonEmptyString5 } from "@wistia/type-guards";
12436
+ import { isNil as isNil15, isNotNil as isNotNil19, isNonEmptyString as isNonEmptyString6 } from "@wistia/type-guards";
12437
12437
  import { Fragment as Fragment7, jsx as jsx255, jsxs as jsxs33 } from "react/jsx-runtime";
12438
12438
  var TagLabel = styled49.a`
12439
12439
  ${({ $colorScheme }) => getColorScheme($colorScheme)};
@@ -12552,7 +12552,7 @@ var RemoveButton = ({ onClickRemove, onClickRemoveLabel, colorScheme }) => {
12552
12552
  var Tag = forwardRef16(
12553
12553
  ({ onClickRemove, colorScheme = "inherit", href, icon, label, onClickRemoveLabel, ...props }, ref) => {
12554
12554
  const hasIcon = isNotNil19(icon);
12555
- const labelProps = isNotNil19(href) && isNonEmptyString5(href) ? { href, as: "a" } : { as: "span" };
12555
+ const labelProps = isNotNil19(href) && isNonEmptyString6(href) ? { href, as: "a" } : { as: "span" };
12556
12556
  return /* @__PURE__ */ jsxs33(
12557
12557
  StyledTag,
12558
12558
  {
@@ -14175,7 +14175,7 @@ import { isNotNil as isNotNil26 } from "@wistia/type-guards";
14175
14175
 
14176
14176
  // src/components/EditableText/EditableTextRoot.tsx
14177
14177
  import { createContext as createContext7, useMemo as useMemo13, useState as useState19, useCallback as useCallback16, useId as useId4 } from "react";
14178
- import { isNonEmptyString as isNonEmptyString6 } from "@wistia/type-guards";
14178
+ import { isNonEmptyString as isNonEmptyString7 } from "@wistia/type-guards";
14179
14179
  import styled63 from "styled-components";
14180
14180
  import { jsx as jsx277 } from "react/jsx-runtime";
14181
14181
  var StyledEditableTextRoot = styled63.div`
@@ -14210,7 +14210,7 @@ var EditableTextRoot = ({
14210
14210
  const [isEditing, setIsEditing] = useState19(false);
14211
14211
  const value = isControlled ? controlledValue : internalValue;
14212
14212
  const generatedId = useId4();
14213
- const computedId = isNonEmptyString6(id) ? id : `wistia-ui-editable-text-${generatedId}`;
14213
+ const computedId = isNonEmptyString7(id) ? id : `wistia-ui-editable-text-${generatedId}`;
14214
14214
  const handleSetIsEditing = useCallback16(
14215
14215
  (editing) => {
14216
14216
  if (editing && !isEditing) {
@@ -14787,6 +14787,7 @@ var FormField = ({
14787
14787
  label,
14788
14788
  labelPosition,
14789
14789
  name,
14790
+ required = false,
14790
14791
  value,
14791
14792
  ...props
14792
14793
  }) => {
@@ -14836,7 +14837,14 @@ var FormField = ({
14836
14837
  ...props,
14837
14838
  "data-label-position": labelPosition ?? formState.labelPosition,
14838
14839
  children: [
14839
- !isIntegratedLabel && /* @__PURE__ */ jsx283(Label, { htmlFor: computedId, children: label }),
14840
+ !isIntegratedLabel && /* @__PURE__ */ jsx283(
14841
+ Label,
14842
+ {
14843
+ htmlFor: computedId,
14844
+ required,
14845
+ children: label
14846
+ }
14847
+ ),
14840
14848
  isNotNil28(description) ? /* @__PURE__ */ jsx283(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
14841
14849
  cloneElement8(children, childProps),
14842
14850
  isNotNil28(computedError) ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
@@ -15983,7 +15991,7 @@ var ProgressBar = ({
15983
15991
  ProgressBar.displayName = "ProgressBar_UI";
15984
15992
 
15985
15993
  // src/components/Radio/Radio.tsx
15986
- import { isNonEmptyString as isNonEmptyString7, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
15994
+ import { isNonEmptyString as isNonEmptyString8, isNotUndefined as isNotUndefined13 } from "@wistia/type-guards";
15987
15995
  import { forwardRef as forwardRef27, useId as useId5 } from "react";
15988
15996
  import styled82, { css as css41 } from "styled-components";
15989
15997
  import { jsx as jsx300, jsxs as jsxs55 } from "react/jsx-runtime";
@@ -16083,7 +16091,7 @@ var Radio = forwardRef27(
16083
16091
  ...props
16084
16092
  }, ref) => {
16085
16093
  const generatedId = useId5();
16086
- const computedId = isNonEmptyString7(id) ? id : `wistia-ui-radio-${generatedId}`;
16094
+ const computedId = isNonEmptyString8(id) ? id : `wistia-ui-radio-${generatedId}`;
16087
16095
  const radioGroupContext = useRadioGroup();
16088
16096
  const contextName = radioGroupContext?.name;
16089
16097
  const contextOnChange = radioGroupContext?.onChange;
@@ -16137,7 +16145,7 @@ import { forwardRef as forwardRef29 } from "react";
16137
16145
  // src/components/RadioCard/RadioCardRoot.tsx
16138
16146
  import { forwardRef as forwardRef28, useId as useId6 } from "react";
16139
16147
  import styled83, { css as css42 } from "styled-components";
16140
- import { isNonEmptyString as isNonEmptyString8, isNotUndefined as isNotUndefined14 } from "@wistia/type-guards";
16148
+ import { isNonEmptyString as isNonEmptyString9, isNotUndefined as isNotUndefined14 } from "@wistia/type-guards";
16141
16149
  import { jsx as jsx301, jsxs as jsxs56 } from "react/jsx-runtime";
16142
16150
  var checkedStyles = css42`
16143
16151
  --wui-radio-card-border-color: var(--wui-color-focus-ring);
@@ -16259,7 +16267,7 @@ var RadioCardRoot = forwardRef28(
16259
16267
  ...props
16260
16268
  }, ref) => {
16261
16269
  const generatedId = useId6();
16262
- const computedId = isNonEmptyString8(id) ? id : `wistia-ui-radio-${generatedId}`;
16270
+ const computedId = isNonEmptyString9(id) ? id : `wistia-ui-radio-${generatedId}`;
16263
16271
  const radioGroupContext = useRadioGroup();
16264
16272
  const contextName = radioGroupContext?.name;
16265
16273
  const contextOnChange = radioGroupContext?.onChange;
@@ -16856,6 +16864,7 @@ var StyledTrigger2 = styled91(Trigger3)`
16856
16864
  outline: 1px solid var(--wui-input-color-border);
16857
16865
  outline-offset: -2px;
16858
16866
  border-radius: var(--wui-input-border-radius);
16867
+ min-width: 200px;
16859
16868
  text-align: left;
16860
16869
  display: inline-flex;
16861
16870
  align-items: center;
@@ -16999,7 +17008,6 @@ var StyledItem = styled92(Item)`
16999
17008
  align-items: ${({ $checkmarkVerticalAlign }) => $checkmarkVerticalAlign === "center" ? "center" : "flex-start"};
17000
17009
  background-color: transparent;
17001
17010
  display: flex;
17002
- gap: var(--wui-space-01);
17003
17011
  padding: var(--wui-select-option-padding);
17004
17012
  justify-content: space-between;
17005
17013
  font-size: var(--font-size);
@@ -17077,7 +17085,7 @@ import {
17077
17085
  Thumb as RadixSliderThumb
17078
17086
  } from "@radix-ui/react-slider";
17079
17087
  import styled94 from "styled-components";
17080
- import { isNonEmptyString as isNonEmptyString9 } from "@wistia/type-guards";
17088
+ import { isNonEmptyString as isNonEmptyString10 } from "@wistia/type-guards";
17081
17089
  import { jsx as jsx312, jsxs as jsxs64 } from "react/jsx-runtime";
17082
17090
  var SliderContainer = styled94.div`
17083
17091
  --wui-slider-track-color: var(--wui-gray-6);
@@ -17156,7 +17164,7 @@ var Slider = ({
17156
17164
  "data-testid": dataTestId = "ui-slider",
17157
17165
  ...otherProps
17158
17166
  }) => {
17159
- if (!(isNonEmptyString9(ariaLabel) || isNonEmptyString9(ariaLabelledby))) {
17167
+ if (!(isNonEmptyString10(ariaLabel) || isNonEmptyString10(ariaLabelledby))) {
17160
17168
  throw new Error(
17161
17169
  "UI Slider: Sliders should have an accessible name. Add a label using the aria-label or aria-labelledby prop."
17162
17170
  );