@wistia/ui 1.10.0 → 1.11.0-beta.7c6dde1e.24384fb

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.js CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/ui v1.10.0
3
+ * @license @wistia/ui v1.11.0-beta.7c6dde1e.24384fb
4
4
  *
5
5
  * Copyright (c) 2024-2026, Wistia, Inc. and its affiliates.
6
6
  *
@@ -7491,7 +7491,7 @@ const CheckboxGroup = ({ children, name, onChange, value, ...props }) => {
7491
7491
  CheckboxGroup.displayName = "CheckboxGroup_UI";
7492
7492
  //#endregion
7493
7493
  //#region src/components/Checkbox/Checkbox.tsx
7494
- const CheckIcon = () => /* @__PURE__ */ jsx("svg", {
7494
+ const CheckIcon$1 = () => /* @__PURE__ */ jsx("svg", {
7495
7495
  fill: "inherit",
7496
7496
  height: "8",
7497
7497
  viewBox: "0 0 10 8",
@@ -7619,7 +7619,7 @@ const Checkbox = ({ checked, disabled = false, id, label, description, name, onC
7619
7619
  $disabled: disabled,
7620
7620
  $size: size,
7621
7621
  "data-wui-faux-input": "true",
7622
- children: /* @__PURE__ */ jsx(CheckIcon, {})
7622
+ children: /* @__PURE__ */ jsx(CheckIcon$1, {})
7623
7623
  }),
7624
7624
  description,
7625
7625
  disabled,
@@ -7630,6 +7630,364 @@ const Checkbox = ({ checked, disabled = false, id, label, description, name, onC
7630
7630
  });
7631
7631
  };
7632
7632
  //#endregion
7633
+ //#region src/components/CheckboxCard/CheckboxCardChildrenContainer.tsx
7634
+ const CheckboxCardChildrenContainer = styled.div`
7635
+ flex: 1 1 auto;
7636
+ `;
7637
+ //#endregion
7638
+ //#region src/components/FormGroup/RadioGroup.tsx
7639
+ const RadioGroupContext = createContext(null);
7640
+ /**
7641
+ * Connects Radio components with their parent RadioGroup; provides access to `name` and `onChange`
7642
+ */
7643
+ const useRadioGroup = () => {
7644
+ return useContext(RadioGroupContext);
7645
+ };
7646
+ /**
7647
+ * For grouping like form elements together. Can serve as a checkbox
7648
+ */
7649
+ const RadioGroup = ({ children, name, onChange, value, ...props }) => {
7650
+ const formState = useContext(FormContext);
7651
+ const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
7652
+ const context = useMemo(() => {
7653
+ return {
7654
+ name,
7655
+ onChange,
7656
+ value: derivedValue
7657
+ };
7658
+ }, [
7659
+ name,
7660
+ derivedValue,
7661
+ onChange
7662
+ ]);
7663
+ return /* @__PURE__ */ jsx(RadioGroupContext, {
7664
+ value: context,
7665
+ children: /* @__PURE__ */ jsx(FormGroup, {
7666
+ ...props,
7667
+ role: "radiogroup",
7668
+ children
7669
+ })
7670
+ });
7671
+ };
7672
+ RadioGroup.displayName = "RadioGroup_UI";
7673
+ //#endregion
7674
+ //#region src/components/RadioCard/RadioCardRoot.tsx
7675
+ const checkedStyles = css`
7676
+ --wui-radio-card-border-color: var(--wui-color-focus-ring);
7677
+ --wui-color-icon: var(--wui-color-icon-selected);
7678
+ --wui-radio-card-background-color: var(--wui-color-bg-surface-info);
7679
+ --wui-color-text: var(--wui-color-text-info);
7680
+ --wui-color-text-secondary: var(--wui-color-text-info);
7681
+ `;
7682
+ const disabledStyles = css`
7683
+ --wui-radio-card-border-color: var(--wui-color-border-disabled);
7684
+ --wui-radio-card-background-color: var(--wui-color-bg-surface-disabled);
7685
+ --wui-radio-card-cursor: not-allowed;
7686
+ --wui-color-icon: var(--wui-color-icon-disabled);
7687
+ --wui-color-text: var(--wui-color-text-disabled);
7688
+ --wui-color-text-secondary: var(--wui-color-text-disabled);
7689
+ `;
7690
+ const focusStyles = css`
7691
+ outline: 2px solid var(--wui-color-focus-ring);
7692
+ `;
7693
+ const imageCoverStyles = css`
7694
+ --wui-radio-card-image-inset: 0px;
7695
+ --wui-radio-card-border-width: 0px;
7696
+ --wui-inset-shadow-width: 1px;
7697
+ --wui-radio-card-border-color: rgb(0 0 0 / 25%);
7698
+
7699
+ overflow: hidden;
7700
+
7701
+ &:has(input:checked) {
7702
+ --wui-radio-card-border-color: var(--wui-color-focus-ring);
7703
+ --wui-radio-card-image-inset: 2px;
7704
+ --wui-inset-shadow-width: 2px;
7705
+ }
7706
+
7707
+ &:hover:not(:has(input:disabled, input:checked)) {
7708
+ --wui-radio-card-border-color: rgb(0 0 0 / 50%);
7709
+ }
7710
+
7711
+ &::after {
7712
+ content: '';
7713
+ position: absolute;
7714
+ top: 0;
7715
+ width: 100%;
7716
+ height: 100%;
7717
+ border-radius: var(--wui-radio-card-border-radius);
7718
+ box-shadow:
7719
+ inset 0 0 0 var(--wui-inset-shadow-width) var(--wui-radio-card-border-color),
7720
+ inset 0 0 0 calc(var(--wui-radio-card-image-inset) * 2) var(--wui-radio-card-background-color);
7721
+ transition: all var(--wui-motion-duration-02) var(--wui-motion-ease);
7722
+ }
7723
+ `;
7724
+ const StyledCard = styled.label`
7725
+ --wui-radio-card-border-color: var(--wui-color-border-secondary);
7726
+ --wui-radio-card-background-color: var(--wui-color-bg-surface);
7727
+ --wui-radio-card-cursor: pointer;
7728
+ --wui-radio-card-border-width: 1px;
7729
+ --wui-radio-card-border-radius: var(--wui-border-radius-02);
7730
+
7731
+ position: relative;
7732
+ display: inline-flex;
7733
+ padding: ${({ $padding }) => `var(--wui-${$padding})`};
7734
+ aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
7735
+ border: var(--wui-radio-card-border-width) solid var(--wui-radio-card-border-color);
7736
+ border-radius: var(--wui-radio-card-border-radius);
7737
+ background-color: var(--wui-radio-card-background-color);
7738
+ cursor: var(--wui-radio-card-cursor);
7739
+ overflow: hidden;
7740
+ transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
7741
+
7742
+ svg {
7743
+ transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
7744
+ }
7745
+
7746
+ &:hover {
7747
+ --wui-radio-card-border-color: var(--wui-color-border-secondary-hover);
7748
+ }
7749
+
7750
+ &:active {
7751
+ --wui-radio-card-border-color: var(--wui-color-border-secondary-active);
7752
+ }
7753
+
7754
+ &:has(input:checked) {
7755
+ ${({ $isGated }) => $isGated ? getColorScheme("purple") : checkedStyles}
7756
+ }
7757
+
7758
+ &:has(input:disabled) {
7759
+ ${disabledStyles}
7760
+ }
7761
+
7762
+ &:has(input:focus-visible) {
7763
+ ${focusStyles}
7764
+ }
7765
+
7766
+ &:has([data-wui-radio-card-image]) {
7767
+ &:has(input:disabled) {
7768
+ & [data-wui-radio-card-image] {
7769
+ filter: grayscale(100%);
7770
+ }
7771
+ }
7772
+
7773
+ &:has([data-wui-radio-card-image='cover']) {
7774
+ ${imageCoverStyles}
7775
+ }
7776
+ }
7777
+ `;
7778
+ const StyledHiddenInput$1 = styled.input`
7779
+ ${visuallyHiddenStyle}
7780
+ `;
7781
+ const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
7782
+ const generatedId = useId();
7783
+ const computedId = isNonEmptyString(id) ? id : `wistia-ui-radio-${generatedId}`;
7784
+ const radioGroupContext = useRadioGroup();
7785
+ const contextName = radioGroupContext?.name;
7786
+ const contextOnChange = radioGroupContext?.onChange;
7787
+ const contextValue = radioGroupContext?.value;
7788
+ const radioName = name ?? contextName;
7789
+ const handleOnChange = onChange ?? contextOnChange;
7790
+ const isChecked = isNotUndefined(value) && isNotUndefined(contextValue) ? contextValue === value : checked;
7791
+ return /* @__PURE__ */ jsxs(StyledCard, {
7792
+ $aspectRatio: aspectRatio,
7793
+ $isGated: isGated,
7794
+ $padding: padding,
7795
+ htmlFor: computedId,
7796
+ children: [/* @__PURE__ */ jsx(StyledHiddenInput$1, {
7797
+ ...props,
7798
+ ref,
7799
+ checked: isChecked,
7800
+ disabled,
7801
+ id: computedId,
7802
+ name: radioName,
7803
+ onChange: handleOnChange,
7804
+ type: "radio",
7805
+ value
7806
+ }), children]
7807
+ });
7808
+ };
7809
+ //#endregion
7810
+ //#region src/components/CheckboxCard/CheckboxCardIndicator.tsx
7811
+ const CheckIcon = () => /* @__PURE__ */ jsx("svg", {
7812
+ fill: "inherit",
7813
+ height: "8",
7814
+ viewBox: "0 0 10 8",
7815
+ width: "10",
7816
+ xmlns: "http://www.w3.org/2000/svg",
7817
+ children: /* @__PURE__ */ jsx("path", {
7818
+ d: "M3.47281 7.19303L0.377565 4.07999C0.191609 3.89297 0.191609 3.58973 0.377565 3.40268L1.05098 2.72537C1.23694 2.53833 1.53847 2.53833 1.72442 2.72537L3.80953 4.82245L8.27558 0.330729C8.46154 0.143704 8.76306 0.143704 8.94902 0.330729L9.62244 1.00804C9.8084 1.19506 9.8084 1.49831 9.62244 1.68535L4.14624 7.19305C3.96027 7.38008 3.65876 7.38008 3.47281 7.19303Z",
7819
+ fill: "var(--wui-checkbox-card-indicator-icon-color)"
7820
+ })
7821
+ });
7822
+ const StyledIndicator = styled.div`
7823
+ --wui-checkbox-card-indicator-size: 14px;
7824
+ --wui-checkbox-card-indicator-icon-size: 7px;
7825
+ --wui-checkbox-card-indicator-background-color: var(--wui-color-bg-surface);
7826
+ --wui-checkbox-card-indicator-icon-color: transparent;
7827
+
7828
+ /* TODO: figure out radio / checkbox / switch colors */
7829
+ --wui-checkbox-card-indicator-border-color: var(--wui-color-border-secondary-active);
7830
+
7831
+ width: var(--wui-checkbox-card-indicator-size);
7832
+ height: var(--wui-checkbox-card-indicator-size);
7833
+ min-width: var(--wui-checkbox-card-indicator-size);
7834
+ min-height: var(--wui-checkbox-card-indicator-size);
7835
+ display: grid;
7836
+ place-content: center;
7837
+ background-color: var(--wui-checkbox-card-indicator-background-color);
7838
+ box-shadow: inset 0 0 0 1px var(--wui-checkbox-card-indicator-border-color);
7839
+ border-radius: var(--wui-border-radius-01);
7840
+ cursor: pointer;
7841
+ transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
7842
+
7843
+ /* check icon */
7844
+ svg {
7845
+ width: var(--wui-checkbox-card-indicator-icon-size);
7846
+ height: var(--wui-checkbox-card-indicator-icon-size);
7847
+ }
7848
+
7849
+ ${StyledCard}:has(input:checked) & {
7850
+ --wui-checkbox-card-indicator-background-color: var(--wui-color-bg-fill);
7851
+ --wui-checkbox-card-indicator-border-color: transparent;
7852
+ --wui-checkbox-card-indicator-icon-color: var(--wui-color-bg-fill-white);
7853
+ }
7854
+
7855
+ ${StyledCard}:has(input:disabled) & {
7856
+ --wui-checkbox-card-indicator-border-color: var(--wui-color-border-secondary);
7857
+ --wui-checkbox-card-indicator-background-color: var(--wui-color-bg-surface-disabled);
7858
+ }
7859
+
7860
+ ${StyledCard}:has(input:disabled:checked) & {
7861
+ --wui-checkbox-card-indicator-icon-color: var(--wui-color-icon-disabled);
7862
+ }
7863
+ `;
7864
+ const CheckboxCardIndicator = (props) => /* @__PURE__ */ jsx(StyledIndicator, {
7865
+ ...props,
7866
+ children: /* @__PURE__ */ jsx(CheckIcon, {})
7867
+ });
7868
+ CheckboxCardIndicator.displayName = "CheckboxCardIndicator_UI";
7869
+ //#endregion
7870
+ //#region src/components/CheckboxCard/CheckboxCardDefaultLayout.tsx
7871
+ const StyledCardContent$1 = styled.div`
7872
+ display: grid;
7873
+ grid-auto-flow: column;
7874
+ gap: var(--wui-space-02);
7875
+ `;
7876
+ const StyledCardIcon$1 = styled.div`
7877
+ display: contents;
7878
+ `;
7879
+ const StyledGatedIcon$1 = styled.div`
7880
+ position: absolute;
7881
+ right: 10px;
7882
+ top: 10px;
7883
+ z-index: 1;
7884
+ `;
7885
+ const StyledIndicatorContainer$1 = styled.div`
7886
+ height: ${({ $hasIcon }) => $hasIcon ? "24px" : "16px"};
7887
+ display: flex;
7888
+ align-items: center;
7889
+ `;
7890
+ const CheckboxCardDefaultLayout = ({ icon, label, description, showIndicator = true, isGated = false }) => {
7891
+ return /* @__PURE__ */ jsxs(StyledCardContent$1, { children: [
7892
+ showIndicator ? /* @__PURE__ */ jsx(StyledIndicatorContainer$1, {
7893
+ $hasIcon: isNotNil(icon),
7894
+ children: /* @__PURE__ */ jsx(CheckboxCardIndicator, { "data-testid": "wui-checkbox-card-indicator" })
7895
+ }) : null,
7896
+ isGated ? /* @__PURE__ */ jsx(StyledGatedIcon$1, {
7897
+ "data-testid": "wui-checkbox-gated-icon",
7898
+ children: /* @__PURE__ */ jsx(Icon, {
7899
+ colorScheme: "purple",
7900
+ "data-testid": "wui-icon-sparkle",
7901
+ type: "sparkle"
7902
+ })
7903
+ }) : null,
7904
+ /* @__PURE__ */ jsxs(Stack, {
7905
+ gap: "space-02",
7906
+ children: [isNotNil(icon) && /* @__PURE__ */ jsx(StyledCardIcon$1, {
7907
+ "data-wui-checkbox-card-icon": true,
7908
+ children: icon
7909
+ }), /* @__PURE__ */ jsxs(Stack, {
7910
+ gap: "space-01",
7911
+ style: isNotNil(icon) ? { paddingLeft: 2 } : void 0,
7912
+ children: [isNotNil(label) && /* @__PURE__ */ jsx(Text, {
7913
+ variant: "label3",
7914
+ children: /* @__PURE__ */ jsx("strong", { children: label })
7915
+ }), isNotNil(description) && /* @__PURE__ */ jsx(Text, {
7916
+ prominence: "secondary",
7917
+ variant: "body3",
7918
+ children: description
7919
+ })]
7920
+ })]
7921
+ })
7922
+ ] });
7923
+ };
7924
+ CheckboxCardDefaultLayout.displayName = "CheckboxCardDefaultLayout_UI";
7925
+ //#endregion
7926
+ //#region src/components/CheckboxCard/CheckboxCardRoot.tsx
7927
+ const StyledHiddenInput = styled.input`
7928
+ ${visuallyHiddenStyle}
7929
+ `;
7930
+ /**
7931
+ * `CheckboxCardRoot` renders the same card shell as `RadioCardRoot` (`StyledCard`) so
7932
+ * radio and checkbox cards stay visually identical — including the `--wui-radio-card-*`
7933
+ * custom properties consumers may override — but wires it to a hidden checkbox input
7934
+ * and the `CheckboxGroup` context instead.
7935
+ */
7936
+ const CheckboxCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
7937
+ const generatedId = useId();
7938
+ const computedId = isNonEmptyString(id) ? id : `wistia-ui-checkbox-card-${generatedId}`;
7939
+ const checkboxGroupContext = useCheckboxGroup();
7940
+ const contextName = checkboxGroupContext?.name;
7941
+ const contextOnChange = checkboxGroupContext?.onChange;
7942
+ const contextValue = checkboxGroupContext?.value;
7943
+ const checkboxName = name ?? contextName;
7944
+ const handleOnChange = onChange ?? contextOnChange;
7945
+ const isChecked = isNotUndefined(value) && isNotUndefined(contextValue) ? contextValue.includes(value) : checked;
7946
+ return /* @__PURE__ */ jsxs(StyledCard, {
7947
+ $aspectRatio: aspectRatio,
7948
+ $isGated: isGated,
7949
+ $padding: padding,
7950
+ htmlFor: computedId,
7951
+ children: [/* @__PURE__ */ jsx(StyledHiddenInput, {
7952
+ ...props,
7953
+ ref,
7954
+ checked: isChecked,
7955
+ disabled,
7956
+ id: computedId,
7957
+ name: checkboxName,
7958
+ onChange: handleOnChange,
7959
+ type: "checkbox",
7960
+ value
7961
+ }), children]
7962
+ });
7963
+ };
7964
+ //#endregion
7965
+ //#region src/components/CheckboxCard/CheckboxCard.tsx
7966
+ /**
7967
+ * A `CheckboxCard` lets users select one or more options from a set of visually rich,
7968
+ * card-based choices. It shares its card styling with `RadioCard`, so the two can be
7969
+ * used side by side for single-select and multi-select questions. It supports both
7970
+ * standalone controlled usage and grouped usage via `CheckboxGroup`.
7971
+ */
7972
+ const CheckboxCard = ({ icon, label, description, showIndicator, isGated, children, padding, ref, ...rootProps }) => {
7973
+ return /* @__PURE__ */ jsx(CheckboxCardRoot, {
7974
+ ref,
7975
+ isGated,
7976
+ padding: padding ?? (children != null ? "space-00" : "space-04"),
7977
+ ...rootProps,
7978
+ children: children != null ? /* @__PURE__ */ jsx(CheckboxCardChildrenContainer, {
7979
+ "data-wui-radio-card-image": "cover",
7980
+ children
7981
+ }) : /* @__PURE__ */ jsx(CheckboxCardDefaultLayout, {
7982
+ description,
7983
+ icon,
7984
+ isGated,
7985
+ label,
7986
+ showIndicator
7987
+ })
7988
+ });
7989
+ };
7990
+ //#endregion
7633
7991
  //#region src/components/ClickRegion/ClickRegion.tsx
7634
7992
  const isClickableElement = (element) => {
7635
7993
  if (!element) return false;
@@ -12745,42 +13103,6 @@ const FormField = ({ children, description, error, id, label, labelPosition, nam
12745
13103
  };
12746
13104
  FormField.displayName = "FormField_UI";
12747
13105
  //#endregion
12748
- //#region src/components/FormGroup/RadioGroup.tsx
12749
- const RadioGroupContext = createContext(null);
12750
- /**
12751
- * Connects Radio components with their parent RadioGroup; provides access to `name` and `onChange`
12752
- */
12753
- const useRadioGroup = () => {
12754
- return useContext(RadioGroupContext);
12755
- };
12756
- /**
12757
- * For grouping like form elements together. Can serve as a checkbox
12758
- */
12759
- const RadioGroup = ({ children, name, onChange, value, ...props }) => {
12760
- const formState = useContext(FormContext);
12761
- const derivedValue = typeof formState.values[name] === "string" ? formState.values[name] : value;
12762
- const context = useMemo(() => {
12763
- return {
12764
- name,
12765
- onChange,
12766
- value: derivedValue
12767
- };
12768
- }, [
12769
- name,
12770
- derivedValue,
12771
- onChange
12772
- ]);
12773
- return /* @__PURE__ */ jsx(RadioGroupContext, {
12774
- value: context,
12775
- children: /* @__PURE__ */ jsx(FormGroup, {
12776
- ...props,
12777
- role: "radiogroup",
12778
- children
12779
- })
12780
- });
12781
- };
12782
- RadioGroup.displayName = "RadioGroup_UI";
12783
- //#endregion
12784
13106
  //#region src/components/Grid/Grid.tsx
12785
13107
  const DEFAULT_ELEMENT = "div";
12786
13108
  /**
@@ -15141,142 +15463,6 @@ const RadioCardChildrenContainer = styled.div`
15141
15463
  flex: 1 1 auto;
15142
15464
  `;
15143
15465
  //#endregion
15144
- //#region src/components/RadioCard/RadioCardRoot.tsx
15145
- const checkedStyles = css`
15146
- --wui-radio-card-border-color: var(--wui-color-focus-ring);
15147
- --wui-color-icon: var(--wui-color-icon-selected);
15148
- --wui-radio-card-background-color: var(--wui-color-bg-surface-info);
15149
- --wui-color-text: var(--wui-color-text-info);
15150
- --wui-color-text-secondary: var(--wui-color-text-info);
15151
- `;
15152
- const disabledStyles = css`
15153
- --wui-radio-card-border-color: var(--wui-color-border-disabled);
15154
- --wui-radio-card-background-color: var(--wui-color-bg-surface-disabled);
15155
- --wui-radio-card-cursor: not-allowed;
15156
- --wui-color-icon: var(--wui-color-icon-disabled);
15157
- --wui-color-text: var(--wui-color-text-disabled);
15158
- --wui-color-text-secondary: var(--wui-color-text-disabled);
15159
- `;
15160
- const focusStyles = css`
15161
- outline: 2px solid var(--wui-color-focus-ring);
15162
- `;
15163
- const imageCoverStyles = css`
15164
- --wui-radio-card-image-inset: 0px;
15165
- --wui-radio-card-border-width: 0px;
15166
- --wui-inset-shadow-width: 1px;
15167
- --wui-radio-card-border-color: rgb(0 0 0 / 25%);
15168
-
15169
- overflow: hidden;
15170
-
15171
- &:has(input:checked) {
15172
- --wui-radio-card-border-color: var(--wui-color-focus-ring);
15173
- --wui-radio-card-image-inset: 2px;
15174
- --wui-inset-shadow-width: 2px;
15175
- }
15176
-
15177
- &:hover:not(:has(input:disabled, input:checked)) {
15178
- --wui-radio-card-border-color: rgb(0 0 0 / 50%);
15179
- }
15180
-
15181
- &::after {
15182
- content: '';
15183
- position: absolute;
15184
- top: 0;
15185
- width: 100%;
15186
- height: 100%;
15187
- border-radius: var(--wui-radio-card-border-radius);
15188
- box-shadow:
15189
- inset 0 0 0 var(--wui-inset-shadow-width) var(--wui-radio-card-border-color),
15190
- inset 0 0 0 calc(var(--wui-radio-card-image-inset) * 2) var(--wui-radio-card-background-color);
15191
- transition: all var(--wui-motion-duration-02) var(--wui-motion-ease);
15192
- }
15193
- `;
15194
- const StyledCard = styled.label`
15195
- --wui-radio-card-border-color: var(--wui-color-border-secondary);
15196
- --wui-radio-card-background-color: var(--wui-color-bg-surface);
15197
- --wui-radio-card-cursor: pointer;
15198
- --wui-radio-card-border-width: 1px;
15199
- --wui-radio-card-border-radius: var(--wui-border-radius-02);
15200
-
15201
- position: relative;
15202
- display: inline-flex;
15203
- padding: ${({ $padding }) => `var(--wui-${$padding})`};
15204
- aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};
15205
- border: var(--wui-radio-card-border-width) solid var(--wui-radio-card-border-color);
15206
- border-radius: var(--wui-radio-card-border-radius);
15207
- background-color: var(--wui-radio-card-background-color);
15208
- cursor: var(--wui-radio-card-cursor);
15209
- overflow: hidden;
15210
- transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
15211
-
15212
- svg {
15213
- transition: all var(--wui-motion-duration-03) var(--wui-motion-ease);
15214
- }
15215
-
15216
- &:hover {
15217
- --wui-radio-card-border-color: var(--wui-color-border-secondary-hover);
15218
- }
15219
-
15220
- &:active {
15221
- --wui-radio-card-border-color: var(--wui-color-border-secondary-active);
15222
- }
15223
-
15224
- &:has(input:checked) {
15225
- ${({ $isGated }) => $isGated ? getColorScheme("purple") : checkedStyles}
15226
- }
15227
-
15228
- &:has(input:disabled) {
15229
- ${disabledStyles}
15230
- }
15231
-
15232
- &:has(input:focus-visible) {
15233
- ${focusStyles}
15234
- }
15235
-
15236
- &:has([data-wui-radio-card-image]) {
15237
- &:has(input:disabled) {
15238
- & [data-wui-radio-card-image] {
15239
- filter: grayscale(100%);
15240
- }
15241
- }
15242
-
15243
- &:has([data-wui-radio-card-image='cover']) {
15244
- ${imageCoverStyles}
15245
- }
15246
- }
15247
- `;
15248
- const StyledHiddenInput = styled.input`
15249
- ${visuallyHiddenStyle}
15250
- `;
15251
- const RadioCardRoot = ({ children, disabled = false, id, isGated = false, name, onChange, value, aspectRatio = "initial", padding = "space-04", checked, ref, ...props }) => {
15252
- const generatedId = useId();
15253
- const computedId = isNonEmptyString(id) ? id : `wistia-ui-radio-${generatedId}`;
15254
- const radioGroupContext = useRadioGroup();
15255
- const contextName = radioGroupContext?.name;
15256
- const contextOnChange = radioGroupContext?.onChange;
15257
- const contextValue = radioGroupContext?.value;
15258
- const radioName = name ?? contextName;
15259
- const handleOnChange = onChange ?? contextOnChange;
15260
- const isChecked = isNotUndefined(value) && isNotUndefined(contextValue) ? contextValue === value : checked;
15261
- return /* @__PURE__ */ jsxs(StyledCard, {
15262
- $aspectRatio: aspectRatio,
15263
- $isGated: isGated,
15264
- $padding: padding,
15265
- htmlFor: computedId,
15266
- children: [/* @__PURE__ */ jsx(StyledHiddenInput, {
15267
- ...props,
15268
- ref,
15269
- checked: isChecked,
15270
- disabled,
15271
- id: computedId,
15272
- name: radioName,
15273
- onChange: handleOnChange,
15274
- type: "radio",
15275
- value
15276
- }), children]
15277
- });
15278
- };
15279
- //#endregion
15280
15466
  //#region src/components/RadioCard/RadioCardIndicator.tsx
15281
15467
  const RadioCardIndicator = styled.div`
15282
15468
  --wui-radio-card-indicator-size: 14px;
@@ -17050,6 +17236,6 @@ const WistiaLogo = ({ description, height = 100, hoverColor, href, iconOnly = fa
17050
17236
  };
17051
17237
  WistiaLogo.displayName = "WistiaLogo_UI";
17052
17238
  //#endregion
17053
- export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, ContrastEnforcerSwitch, ContrastIndicator, ContrastPreview, CustomizableThemeWrapper, DOCUMENT_COLOR_MODE_ATTRIBUTE, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, DatePicker, Dimmer, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorModeOptions, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, documentColorModeOptions, getBackgroundGradient, getDocumentColorMode, getSemiRandomBackgroundGradient, iconSizeMap, isKeyboardKey, isUrl, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, setDocumentColorMode, stripExtension, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useDocumentColorMode, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
17239
+ export { ActionButton, Avatar, Badge, Banner, Box, Breadcrumb, Breadcrumbs, Button, ButtonGroup, Card, Center, Checkbox, CheckboxCard, CheckboxGroup, CheckboxMenuItem, ClickRegion, Collapsible, CollapsibleContent, CollapsibleTrigger, CollapsibleTriggerIcon, ColorGrid, ColorGridOption, ColorList, ColorListGroup, ColorListOption, ColorPicker, ColorPickerPopoverContent, ColorPickerSection, ColorPickerTrigger, ColorSchemeWrapper, Combobox, ComboboxOption, ContextMenu, ContrastControls, ContrastEnforcerSwitch, ContrastIndicator, ContrastPreview, CustomizableThemeWrapper, DOCUMENT_COLOR_MODE_ATTRIBUTE, DataCard, DataCardHoverArrow, DataCardTrend, DataCards, DataList, DataListItem, DataListItemLabel, DataListItemValue, DatePicker, Dimmer, Divider, EditableHeading, EditableText, EditableTextCancelButton, EditableTextContext, EditableTextDisplay, EditableTextInput, EditableTextLabel, EditableTextRoot, EditableTextSubmitButton, EditableTextTrigger, Ellipsis, FeatureCard, FeatureCardImage, FileAmountLimitValidator, FileSizeValidator, FileTypeValidator, FilterMenu, FilterMenuItem, Form, FormErrorSummary, FormField, FormGroup, Grid, Heading, HexColorInput, HueSlider, Icon, IconButton, Image, ImageDimensionsValidator, Input, InputClickToCopy, InputDuration, InputPassword, KeyboardShortcut, Label, Link, List, ListItem, Mark, Markdown, Menu, MenuItem, MenuItemDescription, MenuItemLabel, MenuLabel, MenuRadioGroup, Meter, Modal, ModalCallout, ModalCallouts, PersistentFileAmountLimitValidator, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverCloseButton, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, PreviewCard, ProgressBar, Radio, RadioCard, RadioCardImage, RadioGroup, RadioMenuItem, SaturationAndValuePicker, ScreenReaderOnly, ScrollArea, SegmentedControl, SegmentedControlItem, Select, SelectOption, SelectOptionGroup, Sidebar, SidebarButton, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarSearchInput, SidebarTitle, Slider, SplitButton, Stack, SubMenu, Switch, Table, TableBody, TableCell, TableFoot, TableHead, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Text, Thumbnail, ThumbnailBadge, ThumbnailCollage, Tooltip, UIProvider, ValueNameOrHexCode, ValueSwatch, WistiaLogo, buildTimeDuration, calculateContrast, coerceToBoolean, colorModeOptions, colorSchemeOptions, copyToClipboard, dateOnlyISOString, dateOnlyString, dateOnlyStringForSentence, dateOnlyStringNumeric, dateTime, dateTimeRounded, dateTimeString, dateTimeStringForSentence, dateTimeToDate, dateTimeToISO, dateToDateTime, dateUTCOffset, dayOfWeekString, documentColorModeOptions, getBackgroundGradient, getDocumentColorMode, getSemiRandomBackgroundGradient, iconSizeMap, isKeyboardKey, isUrl, mediaDurationString, mergeRefs, millisecondsToDurationISOString, monthDayStringNumeric, mq, parseDateString, sessionDurationString, setDocumentColorMode, stripExtension, timeAgoString, timeOnlyString, useActiveMq, useAriaLive, useBoolean, useClipboard, useDocumentColorMode, useElementObserver, useFilePicker, useFocusTrap, useForceUpdate, useFormState, useImperativeFilePicker, useIsHovered, useKey, useKeyPress, useLocalStorage, useLockBodyScroll, useMq, useOnClickOutside, usePreviousValue, useToast, useWindowSize, validateWithYup };
17054
17240
 
17055
17241
  //# sourceMappingURL=index.js.map