@wistia/ui 0.15.14-beta.1e41934b.72b042b → 0.15.14-beta.7f547429.3a64c1e

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
@@ -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
@@ -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.7f547429.3a64c1e
4
4
  *
5
5
  * Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -14178,10 +14178,44 @@ import { createContext as createContext7, useMemo as useMemo13, useState as useS
14178
14178
  import { isNonEmptyString as isNonEmptyString6 } from "@wistia/type-guards";
14179
14179
  import styled63 from "styled-components";
14180
14180
  import { jsx as jsx277 } from "react/jsx-runtime";
14181
+ var LARGE_PADDING = "var(--wui-space-02)";
14182
+ var SMALL_PADDING = "var(--wui-space-01)";
14183
+ var getPaddingForVariant = (variant) => {
14184
+ const largePaddingVariants = [
14185
+ "hero",
14186
+ "heading1",
14187
+ "heading2",
14188
+ "heading3",
14189
+ "heading4",
14190
+ "heading5",
14191
+ "body1",
14192
+ "label1",
14193
+ "body1Mono"
14194
+ ];
14195
+ const smallPaddingVariants = [
14196
+ "heading6",
14197
+ "body2",
14198
+ "body3",
14199
+ "body4",
14200
+ "label2",
14201
+ "label3",
14202
+ "label4",
14203
+ "body2Mono",
14204
+ "body3Mono",
14205
+ "body4Mono"
14206
+ ];
14207
+ if (largePaddingVariants.includes(variant)) {
14208
+ return LARGE_PADDING;
14209
+ }
14210
+ if (smallPaddingVariants.includes(variant)) {
14211
+ return SMALL_PADDING;
14212
+ }
14213
+ return SMALL_PADDING;
14214
+ };
14181
14215
  var StyledEditableTextRoot = styled63.div`
14182
14216
  display: contents;
14183
14217
 
14184
- --wui-editable-text-padding: var(--wui-space-01);
14218
+ --wui-editable-text-padding: ${({ $typographicVariant }) => getPaddingForVariant($typographicVariant)};
14185
14219
  --wui-editable-text-border-radius: var(--wui-border-radius-01);
14186
14220
  `;
14187
14221
  var EditableTextContext = createContext7(null);
@@ -14279,6 +14313,7 @@ var EditableTextRoot = ({
14279
14313
  return /* @__PURE__ */ jsx277(
14280
14314
  StyledEditableTextRoot,
14281
14315
  {
14316
+ $typographicVariant: typographicVariant,
14282
14317
  "data-testid": "editable-text-root",
14283
14318
  "data-wui-editable-text-root": true,
14284
14319
  "data-wui-editable-text-state": getState(),
@@ -14787,6 +14822,7 @@ var FormField = ({
14787
14822
  label,
14788
14823
  labelPosition,
14789
14824
  name,
14825
+ required = false,
14790
14826
  value,
14791
14827
  ...props
14792
14828
  }) => {
@@ -14836,7 +14872,14 @@ var FormField = ({
14836
14872
  ...props,
14837
14873
  "data-label-position": labelPosition ?? formState.labelPosition,
14838
14874
  children: [
14839
- !isIntegratedLabel && /* @__PURE__ */ jsx283(Label, { htmlFor: computedId, children: label }),
14875
+ !isIntegratedLabel && /* @__PURE__ */ jsx283(
14876
+ Label,
14877
+ {
14878
+ htmlFor: computedId,
14879
+ required,
14880
+ children: label
14881
+ }
14882
+ ),
14840
14883
  isNotNil28(description) ? /* @__PURE__ */ jsx283(FormControlLabelDescription, { id: descriptionId, children: description }) : null,
14841
14884
  cloneElement8(children, childProps),
14842
14885
  isNotNil28(computedError) ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
@@ -16856,6 +16899,7 @@ var StyledTrigger2 = styled91(Trigger3)`
16856
16899
  outline: 1px solid var(--wui-input-color-border);
16857
16900
  outline-offset: -2px;
16858
16901
  border-radius: var(--wui-input-border-radius);
16902
+ min-width: 200px;
16859
16903
  text-align: left;
16860
16904
  display: inline-flex;
16861
16905
  align-items: center;
@@ -16999,7 +17043,6 @@ var StyledItem = styled92(Item)`
16999
17043
  align-items: ${({ $checkmarkVerticalAlign }) => $checkmarkVerticalAlign === "center" ? "center" : "flex-start"};
17000
17044
  background-color: transparent;
17001
17045
  display: flex;
17002
- gap: var(--wui-space-01);
17003
17046
  padding: var(--wui-select-option-padding);
17004
17047
  justify-content: space-between;
17005
17048
  font-size: var(--font-size);