@spark-ui/components 17.2.0 → 17.2.1-beta.0

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.
@@ -1,9 +1,9 @@
1
1
  import { Ref } from 'react';
2
2
  import { RadioInputProps } from './RadioInput';
3
3
  export type RadioProps = RadioInputProps & {
4
- ref?: Ref<HTMLButtonElement>;
4
+ ref?: Ref<HTMLElement>;
5
5
  };
6
6
  export declare const Radio: {
7
- ({ className, children, id, disabled: disabledProp, ref, ...others }: RadioProps): import("react/jsx-runtime").JSX.Element;
7
+ ({ className, children, disabled: disabledProp, ref, ...others }: RadioProps): import("react/jsx-runtime").JSX.Element;
8
8
  displayName: string;
9
9
  };
@@ -38,10 +38,6 @@ export interface RadioGroupProps extends RadioGroupVariantsProps, Pick<RadioInpu
38
38
  * The reading direction of the radio group.
39
39
  */
40
40
  dir?: 'ltr' | 'rtl';
41
- /**
42
- * When true, keyboard navigation will loop from last item to first, and vice versa.
43
- */
44
- loop?: boolean;
45
41
  /**
46
42
  * When true, the label will be placed on the left side of the Radio
47
43
  */
@@ -49,6 +45,6 @@ export interface RadioGroupProps extends RadioGroupVariantsProps, Pick<RadioInpu
49
45
  ref?: Ref<HTMLDivElement>;
50
46
  }
51
47
  export declare const RadioGroup: {
52
- ({ orientation, loop, intent, disabled, className, required: requiredProp, reverse, ref, ...others }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
48
+ ({ orientation, intent, disabled, className, required: requiredProp, reverse, onValueChange: onValueChangeProp, ref, ...others }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
53
49
  displayName: string;
54
50
  };
@@ -3,16 +3,13 @@ import { RadioIndicatorStylesProps } from './RadioIndicator.styles';
3
3
  export interface RadioIndicatorProps extends RadioIndicatorStylesProps {
4
4
  className?: string;
5
5
  /**
6
- * Change the component to the HTML tag or custom component of the only child.
6
+ * Whether to keep the indicator mounted in the DOM when the radio is unchecked.
7
+ * Useful when controlling animation with React animation libraries.
7
8
  */
8
- asChild?: boolean;
9
- /**
10
- * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
11
- */
12
- forceMount?: true | undefined;
9
+ keepMounted?: boolean;
13
10
  ref?: Ref<HTMLSpanElement>;
14
11
  }
15
12
  export declare const RadioIndicator: {
16
- ({ intent, className, ref, ...others }: RadioIndicatorProps): import("react/jsx-runtime").JSX.Element;
13
+ ({ intent, className, keepMounted, ref, ...others }: RadioIndicatorProps): import("react/jsx-runtime").JSX.Element;
17
14
  displayName: string;
18
15
  };
@@ -1,8 +1,9 @@
1
- import { ButtonHTMLAttributes, Ref } from 'react';
1
+ import { HTMLAttributes, Ref } from 'react';
2
2
  import { RadioInputVariantsProps } from './RadioInput.styles';
3
- export interface RadioInputProps extends RadioInputVariantsProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> {
3
+ export interface RadioInputProps extends RadioInputVariantsProps, Omit<HTMLAttributes<HTMLElement>, 'value' | 'onChange'> {
4
4
  /**
5
5
  * Change the component to the HTML tag or custom component of the only child.
6
+ * Uses Base UI's render prop internally to merge behaviour into the child element.
6
7
  */
7
8
  asChild?: boolean;
8
9
  /**
@@ -17,9 +18,20 @@ export interface RadioInputProps extends RadioInputVariantsProps, Omit<ButtonHTM
17
18
  * When true, indicates that the user must check the radio item before the owning form can be submitted.
18
19
  */
19
20
  required?: boolean;
20
- ref?: Ref<HTMLButtonElement>;
21
+ /**
22
+ * Ref forwarded to the hidden `<input type="radio">` rendered by Base UI.
23
+ * Useful for programmatic activation (e.g. clicking from an associated label span).
24
+ */
25
+ inputRef?: Ref<HTMLInputElement>;
26
+ ref?: Ref<HTMLElement>;
27
+ /**
28
+ * When true, the visual radio input (outer ring and inner dot) is visually hidden but remains
29
+ * accessible in the DOM. Useful for custom radio appearances where only the label matters visually.
30
+ * @default false
31
+ */
32
+ hideInput?: boolean;
21
33
  }
22
34
  export declare const RadioInput: {
23
- ({ intent: intentProp, className, ref, ...others }: RadioInputProps): import("react/jsx-runtime").JSX.Element;
35
+ ({ intent: intentProp, className, asChild, children, inputRef, hideInput, ref, ...others }: RadioInputProps): import("react/jsx-runtime").JSX.Element;
24
36
  displayName: string;
25
37
  };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("class-variance-authority"),s=require("react"),G=require("@spark-ui/components/form-field"),b=require("radix-ui"),y=require("@spark-ui/internal-utils"),k=s.createContext(null),w=()=>{const e=s.useContext(k);if(!e)throw Error("useRadioGroup must be used within a RadioGroup provider");return e},V=d.cva(["relative block","size-3/5","after:absolute","after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2","after:h-0","after:w-0","after:block","after:rounded-[50%]","after:content-['']","after:transition-all","data-[state=checked]:after:size-full"],{variants:{intent:y.makeVariants({main:["after:bg-main"],support:["after:bg-support"],accent:["after:bg-accent"],neutral:["after:bg-neutral"],success:["after:bg-success"],alert:["after:bg-alert"],error:["after:bg-error"],info:["after:bg-info"]})},defaultVariants:{intent:"support"}}),I=({intent:e,className:r,ref:t,...o})=>a.jsx(b.RadioGroup.Indicator,{ref:t,className:V({intent:e,className:r}),...o});I.displayName="RadioGroup.RadioIndicator";const L=d.cva(["flex shrink-0 items-center justify-center","rounded-full","border-md","outline-hidden","hover:ring-4","focus-visible:u-outline","disabled:cursor-not-allowed disabled:border-outline/dim-2 disabled:hover:ring-transparent","u-shadow-border-transition","size-sz-24"],{variants:{intent:y.makeVariants({main:["border-outline","data-[state=checked]:border-main","hover:ring-main-container"],support:["border-outline","data-[state=checked]:border-support","hover:ring-support-container"],accent:["border-outline","data-[state=checked]:border-accent","hover:ring-accent-container"],neutral:["border-outline","data-[state=checked]:border-neutral","hover:ring-neutral-container"],info:["border-info","data-[state=checked]:border-info","hover:ring-info-container"],success:["border-success","data-[state=checked]:border-success","hover:ring-success-container"],alert:["border-alert","data-[state=checked]:border-alert","hover:ring-alert-container"],error:["border-error","data-[state=checked]:border-error","hover:ring-error-container"]})},defaultVariants:{intent:"support"}}),j=({intent:e,className:r,ref:t,...o})=>{const{state:n}=G.useFormFieldControl(),i=n??e;return a.jsx(b.RadioGroup.RadioGroupItem,{"data-spark-component":"radio-input",ref:t,className:L({intent:i,className:r}),...o,children:a.jsx(I,{intent:i,forceMount:!0})})};j.displayName="RadioGroup.RadioInput";const z=d.cva("grow",{variants:{disabled:{true:["text-neutral/dim-2","cursor-not-allowed"],false:["cursor-pointer"]}},defaultVariants:{disabled:!1}}),N=({disabled:e,...r})=>a.jsx(b.Label.Root,{"data-spark-component":"radio-label",className:z({disabled:e}),...r});N.displayName="RadioGroup.RadioLabel";const x=":radio",v=({className:e,children:r,id:t,disabled:o,ref:n,...i})=>{const c=`${x}-input-${s.useId()}`,l=`${x}-label-${s.useId()}`,{intent:f,disabled:m,reverse:R}=w(),u=r&&a.jsx(N,{disabled:o||m,htmlFor:t||c,id:l,children:r}),p=a.jsx(j,{ref:n,id:t||c,intent:f,"aria-labelledby":r?l:void 0,...i,disabled:o}),h=R?a.jsxs(a.Fragment,{children:[u,p]}):a.jsxs(a.Fragment,{children:[p,u]});return a.jsx("span",{className:d.cx("gap-md text-body-1 flex items-start",e),children:h})};v.displayName="RadioGroup.Radio";const C=d.cva(["flex"],{variants:{orientation:{vertical:["flex-col","gap-lg"],horizontal:["flex-row","gap-xl"]}}}),S=({intent:e,disabled:r,reverse:t,children:o})=>{const n=s.useMemo(()=>({intent:e,disabled:r,reverse:t}),[e,r,t]);return a.jsx(k.Provider,{value:n,children:o})},q=({orientation:e="vertical",loop:r=!0,intent:t="support",disabled:o,className:n,required:i,reverse:c=!1,ref:l,...f})=>{const{labelId:m,isInvalid:R,isRequired:u,description:p,name:h}=G.useFormFieldControl(),g=i!==void 0?i:u;return a.jsx(S,{reverse:c,intent:t,disabled:o,children:a.jsx(b.RadioGroup.RadioGroup,{"data-spark-component":"radio-group",className:C({orientation:e,className:n}),name:h,ref:l,disabled:o,orientation:e,loop:r,required:g,"aria-labelledby":m,"aria-invalid":R,"aria-required":g,"aria-describedby":p,...f})})};q.displayName="RadioGroup";const F=Object.assign(q,{Radio:v});F.displayName="RadioGroup";v.displayName="RadioGroup.Radio";exports.RadioGroup=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("class-variance-authority"),f=require("react"),v=require("@base-ui/react/radio"),R=require("@spark-ui/components/form-field"),x=require("@spark-ui/internal-utils"),F=require("@base-ui/react/radio-group"),k=f.createContext(null),V=()=>{const e=f.useContext(k);if(!e)throw Error("useRadioGroup must be used within a RadioGroup provider");return e},C=u.cva(["relative block","size-3/5","after:absolute","after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2","after:h-0","after:w-0","after:block","after:rounded-[50%]","after:content-['']","after:transition-all","data-checked:after:size-full"],{variants:{intent:x.makeVariants({main:["after:bg-main"],support:["after:bg-support"],accent:["after:bg-accent"],neutral:["after:bg-neutral"],success:["after:bg-success"],alert:["after:bg-alert"],error:["after:bg-error"],info:["after:bg-info"]})},defaultVariants:{intent:"support"}}),y=({intent:e,className:t,keepMounted:r,ref:n,...o})=>a.jsx(v.Radio.Indicator,{ref:n,keepMounted:r,className:C({intent:e,className:t}),...o});y.displayName="RadioGroup.RadioIndicator";const z=u.cva(["flex shrink-0 items-center justify-center","rounded-full","border-md","outline-hidden","hover:ring-4","focus-visible:u-outline","data-disabled:cursor-not-allowed data-disabled:border-outline/dim-2 data-disabled:hover:ring-transparent","u-shadow-border-transition","size-sz-24"],{variants:{intent:x.makeVariants({main:["border-outline","data-checked:border-main","hover:ring-main-container"],support:["border-outline","data-checked:border-support","hover:ring-support-container"],accent:["border-outline","data-checked:border-accent","hover:ring-accent-container"],neutral:["border-outline","data-checked:border-neutral","hover:ring-neutral-container"],info:["border-info","data-checked:border-info","hover:ring-info-container"],success:["border-success","data-checked:border-success","hover:ring-success-container"],alert:["border-alert","data-checked:border-alert","hover:ring-alert-container"],error:["border-error","data-checked:border-error","hover:ring-error-container"]})},defaultVariants:{intent:"support"}}),G=({intent:e,className:t,asChild:r,children:n,inputRef:o,hideInput:i=!1,ref:s,...c})=>{const{state:l}=R.useFormFieldControl(),d=l??e;return a.jsx(v.Radio.Root,{"data-spark-component":"radio-input",ref:s,inputRef:o,render:r?n:void 0,className:i?"sr-only":z({intent:d,className:t}),...c,children:!r&&!i&&a.jsx(y,{intent:d,keepMounted:!0})})};G.displayName="RadioGroup.RadioInput";const S=":radio",g=({className:e,children:t,disabled:r,ref:n,...o})=>{const i=`${S}-label-${f.useId()}`,{intent:s,disabled:c,reverse:l}=V(),d=r||c,p=t&&a.jsx("span",{"data-spark-component":"radio-label",id:i,className:u.cx("grow",d?"text-neutral/dim-2 cursor-not-allowed":"cursor-pointer"),children:t}),b=a.jsx(G,{ref:n,intent:s,"aria-labelledby":t?i:void 0,...o,disabled:r}),m=l?a.jsxs(a.Fragment,{children:[p,b]}):a.jsxs(a.Fragment,{children:[b,p]});return a.jsx("label",{className:u.cx("gap-md text-body-1 flex items-start",e),children:m})};g.displayName="RadioGroup.Radio";const M=u.cva(["flex"],{variants:{orientation:{vertical:["flex-col","gap-lg"],horizontal:["flex-row","gap-xl"]}}}),$=({intent:e,disabled:t,reverse:r,children:n})=>{const o=f.useMemo(()=>({intent:e,disabled:t,reverse:r}),[e,t,r]);return a.jsx(k.Provider,{value:o,children:n})},j=({orientation:e="vertical",intent:t="support",disabled:r,className:n,required:o,reverse:i=!1,onValueChange:s,ref:c,...l})=>{const{labelId:d,isInvalid:p,isRequired:b,description:m,name:N}=R.useFormFieldControl(),h=o!==void 0?o:b,q=s?w=>s(w):void 0;return a.jsx($,{reverse:i,intent:t,disabled:r,children:a.jsx(F.RadioGroup,{"data-spark-component":"radio-group",className:M({orientation:e,className:n}),name:N,ref:c,disabled:r,required:h,onValueChange:q,"aria-orientation":e,"aria-labelledby":d,"aria-invalid":p,"aria-required":h,"aria-describedby":m,...l})})};j.displayName="RadioGroup";const I=Object.assign(j,{Radio:g});I.displayName="RadioGroup";g.displayName="RadioGroup.Radio";exports.RadioGroup=I;
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/radio-group/RadioGroupContext.tsx","../../src/radio-group/RadioIndicator.styles.ts","../../src/radio-group/RadioIndicator.tsx","../../src/radio-group/RadioInput.styles.ts","../../src/radio-group/RadioInput.tsx","../../src/radio-group/RadioLabel.styles.tsx","../../src/radio-group/RadioLabel.tsx","../../src/radio-group/Radio.tsx","../../src/radio-group/RadioGroup.styles.ts","../../src/radio-group/RadioGroupProvider.tsx","../../src/radio-group/RadioGroup.tsx","../../src/radio-group/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport type { RadioInputProps } from './RadioInput'\n\nexport type RadioGroupContextState = Pick<RadioInputProps, 'intent' | 'disabled'> &\n Pick<RadioGroupProps, 'reverse'>\n\nexport const RadioGroupContext = createContext<RadioGroupContextState | null>(null)\n\nexport const useRadioGroup = () => {\n const context = useContext(RadioGroupContext)\n\n if (!context) {\n throw Error('useRadioGroup must be used within a RadioGroup provider')\n }\n\n return context\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioIndicatorStyles = cva(\n [\n 'relative block',\n 'size-3/5',\n 'after:absolute',\n 'after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2',\n 'after:h-0',\n 'after:w-0',\n 'after:block',\n 'after:rounded-[50%]',\n \"after:content-['']\",\n 'after:transition-all',\n 'data-[state=checked]:after:size-full',\n ],\n {\n variants: {\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n neutral: ['after:bg-neutral'],\n success: ['after:bg-success'],\n alert: ['after:bg-alert'],\n error: ['after:bg-error'],\n info: ['after:bg-info'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioIndicatorStylesProps = VariantProps<typeof radioIndicatorStyles>\n","import { RadioGroup as RadixRadioGroup } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { radioIndicatorStyles, RadioIndicatorStylesProps } from './RadioIndicator.styles'\n\nexport interface RadioIndicatorProps extends RadioIndicatorStylesProps {\n className?: string\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true | undefined\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const RadioIndicator = ({ intent, className, ref, ...others }: RadioIndicatorProps) => {\n return (\n <RadixRadioGroup.Indicator\n ref={ref}\n className={radioIndicatorStyles({ intent, className })}\n {...others}\n />\n )\n}\n\nRadioIndicator.displayName = 'RadioGroup.RadioIndicator'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioInputVariants = cva(\n [\n 'flex shrink-0 items-center justify-center',\n 'rounded-full',\n 'border-md',\n 'outline-hidden',\n 'hover:ring-4',\n 'focus-visible:u-outline',\n 'disabled:cursor-not-allowed disabled:border-outline/dim-2 disabled:hover:ring-transparent',\n 'u-shadow-border-transition',\n 'size-sz-24',\n ],\n {\n variants: {\n /**\n * Color scheme of the radio input.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['border-outline', 'data-[state=checked]:border-main', 'hover:ring-main-container'],\n support: [\n 'border-outline',\n 'data-[state=checked]:border-support',\n 'hover:ring-support-container',\n ],\n accent: [\n 'border-outline',\n 'data-[state=checked]:border-accent',\n 'hover:ring-accent-container',\n ],\n neutral: [\n 'border-outline',\n 'data-[state=checked]:border-neutral',\n 'hover:ring-neutral-container',\n ],\n info: ['border-info', 'data-[state=checked]:border-info', 'hover:ring-info-container'],\n success: [\n 'border-success',\n 'data-[state=checked]:border-success',\n 'hover:ring-success-container',\n ],\n alert: ['border-alert', 'data-[state=checked]:border-alert', 'hover:ring-alert-container'],\n error: ['border-error', 'data-[state=checked]:border-error', 'hover:ring-error-container'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioInputVariantsProps = VariantProps<typeof radioInputVariants>\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui'\nimport { ButtonHTMLAttributes, Ref } from 'react'\n\nimport { RadioIndicator } from './RadioIndicator'\nimport { radioInputVariants, RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioInputProps\n extends RadioInputVariantsProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n /**\n * When true, prevents the user from interacting with the radio item.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the radio item before the owning form can be submitted.\n */\n required?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const RadioInput = ({ intent: intentProp, className, ref, ...others }: RadioInputProps) => {\n const { state } = useFormFieldControl()\n\n const intent = state ?? intentProp\n\n return (\n <RadixRadioGroup.RadioGroupItem\n data-spark-component=\"radio-input\"\n ref={ref}\n className={radioInputVariants({ intent, className })}\n {...others}\n >\n <RadioIndicator intent={intent} forceMount />\n </RadixRadioGroup.RadioGroupItem>\n )\n}\n\nRadioInput.displayName = 'RadioGroup.RadioInput'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioLabelStyles = cva('grow', {\n variants: {\n disabled: {\n true: ['text-neutral/dim-2', 'cursor-not-allowed'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n disabled: false,\n },\n})\n\nexport type RadioLabelStylesProps = VariantProps<typeof radioLabelStyles>\n","import { Label } from 'radix-ui'\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\n\nimport { radioLabelStyles, RadioLabelStylesProps } from './RadioLabel.styles'\n\nexport interface RadioLabelProps\n extends RadioLabelStylesProps,\n PropsWithChildren<HTMLAttributes<HTMLLabelElement>> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The id of the element the label is associated with.\n */\n htmlFor?: string\n /**\n * When true, prevents the user from interacting with the radio item.\n */\n disabled?: boolean\n}\n\nexport const RadioLabel = ({ disabled, ...others }: RadioLabelProps) => {\n return (\n <Label.Root\n data-spark-component=\"radio-label\"\n className={radioLabelStyles({ disabled })}\n {...others}\n />\n )\n}\n\nRadioLabel.displayName = 'RadioGroup.RadioLabel'\n","import { cx } from 'class-variance-authority'\nimport { Ref, useId } from 'react'\n\nimport { useRadioGroup } from './RadioGroupContext'\nimport { RadioInput, RadioInputProps } from './RadioInput'\nimport { RadioLabel } from './RadioLabel'\n\nexport type RadioProps = RadioInputProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nconst ID_PREFIX = ':radio'\n\nexport const Radio = ({\n className,\n children,\n id,\n disabled: disabledProp,\n ref,\n ...others\n}: RadioProps) => {\n const innerId = `${ID_PREFIX}-input-${useId()}`\n const innerLabelId = `${ID_PREFIX}-label-${useId()}`\n\n const { intent, disabled, reverse } = useRadioGroup()\n\n const radioLabel = children && (\n <RadioLabel disabled={disabledProp || disabled} htmlFor={id || innerId} id={innerLabelId}>\n {children}\n </RadioLabel>\n )\n\n const radioInput = (\n <RadioInput\n ref={ref}\n id={id || innerId}\n intent={intent}\n aria-labelledby={children ? innerLabelId : undefined}\n {...others}\n disabled={disabledProp}\n />\n )\n\n const content = reverse ? (\n <>\n {radioLabel}\n {radioInput}\n </>\n ) : (\n <>\n {radioInput}\n {radioLabel}\n </>\n )\n\n return <span className={cx('gap-md text-body-1 flex items-start', className)}>{content}</span>\n}\n\nRadio.displayName = 'RadioGroup.Radio'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioGroupStyles = cva(['flex'], {\n variants: {\n orientation: {\n vertical: ['flex-col', 'gap-lg'],\n horizontal: ['flex-row', 'gap-xl'],\n },\n },\n})\n\nexport type RadioGroupVariantsProps = VariantProps<typeof radioGroupStyles>\n","import { ReactNode, useMemo } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport { RadioGroupContext } from './RadioGroupContext'\nimport type { RadioInputProps } from './RadioInput'\n\nexport interface RadioGroupProviderProps\n extends Pick<RadioInputProps, 'intent' | 'disabled'>,\n Pick<RadioGroupProps, 'reverse'> {\n children: ReactNode\n}\n\nexport const RadioGroupProvider = ({\n intent,\n disabled,\n reverse,\n children,\n}: RadioGroupProviderProps) => {\n const value = useMemo(() => ({ intent, disabled, reverse }), [intent, disabled, reverse])\n\n return <RadioGroupContext.Provider value={value}>{children}</RadioGroupContext.Provider>\n}\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui'\nimport { HTMLAttributes, Ref } from 'react'\n\nimport { radioGroupStyles, RadioGroupVariantsProps } from './RadioGroup.styles'\nimport { RadioGroupProvider } from './RadioGroupProvider'\nimport { RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioGroupProps\n extends RadioGroupVariantsProps,\n Pick<RadioInputVariantsProps, 'intent'>,\n Omit<HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'dir' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items.\n */\n defaultValue?: string\n /**\n * The controlled value of the radio item to check. Should be used in conjunction with onValueChange.\n */\n value?: string\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n /**\n * When true, prevents the user from interacting with radio items.\n */\n disabled?: boolean\n /**\n * The name of the group. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * When true, indicates that the user must check a radio item before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The orientation of the component.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * The reading direction of the radio group.\n */\n dir?: 'ltr' | 'rtl'\n /**\n * When true, keyboard navigation will loop from last item to first, and vice versa.\n */\n loop?: boolean\n /**\n * When true, the label will be placed on the left side of the Radio\n */\n reverse?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const RadioGroup = ({\n orientation = 'vertical',\n loop = true,\n intent = 'support',\n disabled,\n className,\n required: requiredProp,\n reverse = false,\n ref,\n ...others\n}: RadioGroupProps) => {\n const { labelId, isInvalid, isRequired, description, name } = useFormFieldControl()\n const required = requiredProp !== undefined ? requiredProp : isRequired\n\n return (\n <RadioGroupProvider reverse={reverse} intent={intent} disabled={disabled}>\n <RadixRadioGroup.RadioGroup\n data-spark-component=\"radio-group\"\n className={radioGroupStyles({ orientation, className })}\n name={name}\n ref={ref}\n disabled={disabled}\n orientation={orientation}\n loop={loop}\n required={required}\n aria-labelledby={labelId}\n aria-invalid={isInvalid}\n aria-required={required}\n aria-describedby={description}\n {...others}\n />\n </RadioGroupProvider>\n )\n}\n\nRadioGroup.displayName = 'RadioGroup'\n","import { Radio } from './Radio'\nimport { RadioGroup as Root } from './RadioGroup'\n\nexport const RadioGroup: typeof Root & {\n Radio: typeof Radio\n} = Object.assign(Root, {\n Radio,\n})\n\nRadioGroup.displayName = 'RadioGroup'\nRadio.displayName = 'RadioGroup.Radio'\n\nexport { type RadioGroupProps } from './RadioGroup'\nexport { type RadioProps } from './Radio'\n"],"names":["RadioGroupContext","createContext","useRadioGroup","context","useContext","radioIndicatorStyles","cva","makeVariants","RadioIndicator","intent","className","ref","others","jsx","RadixRadioGroup","radioInputVariants","RadioInput","intentProp","state","useFormFieldControl","radioLabelStyles","RadioLabel","disabled","Label","ID_PREFIX","Radio","children","id","disabledProp","innerId","useId","innerLabelId","reverse","radioLabel","radioInput","content","jsxs","Fragment","cx","radioGroupStyles","RadioGroupProvider","value","useMemo","RadioGroup","orientation","loop","requiredProp","labelId","isInvalid","isRequired","description","name","required","Root"],"mappings":"uRAQaA,EAAoBC,EAAAA,cAA6C,IAAI,EAErEC,EAAgB,IAAM,CACjC,MAAMC,EAAUC,EAAAA,WAAWJ,CAAiB,EAE5C,GAAI,CAACG,EACH,MAAM,MAAM,yDAAyD,EAGvE,OAAOA,CACT,ECfaE,EAAuBC,EAAAA,IAClC,CACE,iBACA,WACA,iBACA,6EACA,YACA,YACA,cACA,sBACA,qBACA,uBACA,sCAAA,EAEF,CACE,SAAU,CACR,OAAQC,EAAAA,aAGN,CACA,KAAM,CAAC,eAAe,EACtB,QAAS,CAAC,kBAAkB,EAC5B,OAAQ,CAAC,iBAAiB,EAC1B,QAAS,CAAC,kBAAkB,EAC5B,QAAS,CAAC,kBAAkB,EAC5B,MAAO,CAAC,gBAAgB,EACxB,MAAO,CAAC,gBAAgB,EACxB,KAAM,CAAC,eAAe,CAAA,CACvB,CAAA,EAEH,gBAAiB,CACf,OAAQ,SAAA,CACV,CAEJ,ECnBaC,EAAiB,CAAC,CAAE,OAAAC,EAAQ,UAAAC,EAAW,IAAAC,EAAK,GAAGC,KAExDC,EAAAA,IAACC,EAAAA,WAAgB,UAAhB,CACC,IAAAH,EACA,UAAWN,EAAqB,CAAE,OAAAI,EAAQ,UAAAC,EAAW,EACpD,GAAGE,CAAA,CAAA,EAKVJ,EAAe,YAAc,4BCzBtB,MAAMO,EAAqBT,EAAAA,IAChC,CACE,4CACA,eACA,YACA,iBACA,eACA,0BACA,4FACA,6BACA,YAAA,EAEF,CACE,SAAU,CAIR,OAAQC,EAAAA,aAGN,CACA,KAAM,CAAC,iBAAkB,mCAAoC,2BAA2B,EACxF,QAAS,CACP,iBACA,sCACA,8BAAA,EAEF,OAAQ,CACN,iBACA,qCACA,6BAAA,EAEF,QAAS,CACP,iBACA,sCACA,8BAAA,EAEF,KAAM,CAAC,cAAe,mCAAoC,2BAA2B,EACrF,QAAS,CACP,iBACA,sC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AY,YAAAC,EAAa,KAAAC,CAAA,EAAShC,sBAAA,EACxDiC,EAAWN,IAAiB,OAAYA,EAAeG,EAE7D,OACEpC,EAAAA,IAAC2B,EAAA,CAAmB,QAAAR,EAAkB,OAAAvB,EAAgB,SAAAa,EACpD,SAAAT,EAAAA,IAACC,EAAAA,WAAgB,WAAhB,CACC,uBAAqB,cACrB,UAAWyB,EAAiB,CAAE,YAAAK,EAAa,UAAAlC,EAAW,EACtD,KAAAyC,EACA,IAAAxC,EACA,SAAAW,EACA,YAAAsB,EACA,KAAAC,EACA,SAAAO,EACA,kBAAiBL,EACjB,eAAcC,EACd,gBAAeI,EACf,mBAAkBF,EACjB,GAAGtC,CAAA,CAAA,EAER,CAEJ,EAEA+B,EAAW,YAAc,aC3FlB,MAAMA,EAET,OAAO,OAAOU,EAAM,CACtB,MAAA5B,CACF,CAAC,EAEDkB,EAAW,YAAc,aACzBlB,EAAM,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../src/radio-group/RadioGroupContext.tsx","../../src/radio-group/RadioIndicator.styles.ts","../../src/radio-group/RadioIndicator.tsx","../../src/radio-group/RadioInput.styles.ts","../../src/radio-group/RadioInput.tsx","../../src/radio-group/Radio.tsx","../../src/radio-group/RadioGroup.styles.ts","../../src/radio-group/RadioGroupProvider.tsx","../../src/radio-group/RadioGroup.tsx","../../src/radio-group/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport type { RadioInputProps } from './RadioInput'\n\nexport type RadioGroupContextState = Pick<RadioInputProps, 'intent' | 'disabled'> &\n Pick<RadioGroupProps, 'reverse'>\n\nexport const RadioGroupContext = createContext<RadioGroupContextState | null>(null)\n\nexport const useRadioGroup = () => {\n const context = useContext(RadioGroupContext)\n\n if (!context) {\n throw Error('useRadioGroup must be used within a RadioGroup provider')\n }\n\n return context\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioIndicatorStyles = cva(\n [\n 'relative block',\n 'size-3/5',\n 'after:absolute',\n 'after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2',\n 'after:h-0',\n 'after:w-0',\n 'after:block',\n 'after:rounded-[50%]',\n \"after:content-['']\",\n 'after:transition-all',\n 'data-checked:after:size-full',\n ],\n {\n variants: {\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n neutral: ['after:bg-neutral'],\n success: ['after:bg-success'],\n alert: ['after:bg-alert'],\n error: ['after:bg-error'],\n info: ['after:bg-info'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioIndicatorStylesProps = VariantProps<typeof radioIndicatorStyles>\n","import { Radio } from '@base-ui/react/radio'\nimport { Ref } from 'react'\n\nimport { radioIndicatorStyles, RadioIndicatorStylesProps } from './RadioIndicator.styles'\n\nexport interface RadioIndicatorProps extends RadioIndicatorStylesProps {\n className?: string\n /**\n * Whether to keep the indicator mounted in the DOM when the radio is unchecked.\n * Useful when controlling animation with React animation libraries.\n */\n keepMounted?: boolean\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const RadioIndicator = ({\n intent,\n className,\n keepMounted,\n ref,\n ...others\n}: RadioIndicatorProps) => {\n return (\n <Radio.Indicator\n ref={ref}\n keepMounted={keepMounted}\n className={radioIndicatorStyles({ intent, className })}\n {...others}\n />\n )\n}\n\nRadioIndicator.displayName = 'RadioGroup.RadioIndicator'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioInputVariants = cva(\n [\n 'flex shrink-0 items-center justify-center',\n 'rounded-full',\n 'border-md',\n 'outline-hidden',\n 'hover:ring-4',\n 'focus-visible:u-outline',\n 'data-disabled:cursor-not-allowed data-disabled:border-outline/dim-2 data-disabled:hover:ring-transparent',\n 'u-shadow-border-transition',\n 'size-sz-24',\n ],\n {\n variants: {\n /**\n * Color scheme of the radio input.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['border-outline', 'data-checked:border-main', 'hover:ring-main-container'],\n support: ['border-outline', 'data-checked:border-support', 'hover:ring-support-container'],\n accent: ['border-outline', 'data-checked:border-accent', 'hover:ring-accent-container'],\n neutral: ['border-outline', 'data-checked:border-neutral', 'hover:ring-neutral-container'],\n info: ['border-info', 'data-checked:border-info', 'hover:ring-info-container'],\n success: ['border-success', 'data-checked:border-success', 'hover:ring-success-container'],\n alert: ['border-alert', 'data-checked:border-alert', 'hover:ring-alert-container'],\n error: ['border-error', 'data-checked:border-error', 'hover:ring-error-container'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioInputVariantsProps = VariantProps<typeof radioInputVariants>\n","import { Radio } from '@base-ui/react/radio'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { HTMLAttributes, ReactElement, Ref } from 'react'\n\nimport { RadioIndicator } from './RadioIndicator'\nimport { radioInputVariants, RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioInputProps\n extends RadioInputVariantsProps,\n Omit<HTMLAttributes<HTMLElement>, 'value' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * Uses Base UI's render prop internally to merge behaviour into the child element.\n */\n asChild?: boolean\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n /**\n * When true, prevents the user from interacting with the radio item.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the radio item before the owning form can be submitted.\n */\n required?: boolean\n /**\n * Ref forwarded to the hidden `<input type=\"radio\">` rendered by Base UI.\n * Useful for programmatic activation (e.g. clicking from an associated label span).\n */\n inputRef?: Ref<HTMLInputElement>\n ref?: Ref<HTMLElement>\n /**\n * When true, the visual radio input (outer ring and inner dot) is visually hidden but remains\n * accessible in the DOM. Useful for custom radio appearances where only the label matters visually.\n * @default false\n */\n hideInput?: boolean\n}\n\nexport const RadioInput = ({\n intent: intentProp,\n className,\n asChild,\n children,\n inputRef,\n hideInput = false,\n ref,\n ...others\n}: RadioInputProps) => {\n const { state } = useFormFieldControl()\n\n const intent = state ?? intentProp\n\n return (\n <Radio.Root\n data-spark-component=\"radio-input\"\n ref={ref}\n inputRef={inputRef}\n render={asChild ? (children as ReactElement) : undefined}\n className={hideInput ? 'sr-only' : radioInputVariants({ intent, className })}\n {...others}\n >\n {!asChild && !hideInput && <RadioIndicator intent={intent} keepMounted />}\n </Radio.Root>\n )\n}\n\nRadioInput.displayName = 'RadioGroup.RadioInput'\n","import { cx } from 'class-variance-authority'\nimport { Ref, useId } from 'react'\n\nimport { useRadioGroup } from './RadioGroupContext'\nimport { RadioInput, RadioInputProps } from './RadioInput'\n\nexport type RadioProps = RadioInputProps & {\n ref?: Ref<HTMLElement>\n}\n\nconst ID_PREFIX = ':radio'\n\nexport const Radio = ({\n className,\n children,\n disabled: disabledProp,\n ref,\n ...others\n}: RadioProps) => {\n const innerLabelId = `${ID_PREFIX}-label-${useId()}`\n\n const { intent, disabled, reverse } = useRadioGroup()\n\n const isDisabled = disabledProp || disabled\n\n const radioLabel = children && (\n <span\n data-spark-component=\"radio-label\"\n id={innerLabelId}\n className={cx(\n 'grow',\n isDisabled ? 'text-neutral/dim-2 cursor-not-allowed' : 'cursor-pointer'\n )}\n >\n {children}\n </span>\n )\n\n const radioInput = (\n <RadioInput\n ref={ref}\n intent={intent}\n aria-labelledby={children ? innerLabelId : undefined}\n {...others}\n disabled={disabledProp}\n />\n )\n\n const content = reverse ? (\n <>\n {radioLabel}\n {radioInput}\n </>\n ) : (\n <>\n {radioInput}\n {radioLabel}\n </>\n )\n\n return <label className={cx('gap-md text-body-1 flex items-start', className)}>{content}</label>\n}\n\nRadio.displayName = 'RadioGroup.Radio'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioGroupStyles = cva(['flex'], {\n variants: {\n orientation: {\n vertical: ['flex-col', 'gap-lg'],\n horizontal: ['flex-row', 'gap-xl'],\n },\n },\n})\n\nexport type RadioGroupVariantsProps = VariantProps<typeof radioGroupStyles>\n","import { ReactNode, useMemo } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport { RadioGroupContext } from './RadioGroupContext'\nimport type { RadioInputProps } from './RadioInput'\n\nexport interface RadioGroupProviderProps\n extends Pick<RadioInputProps, 'intent' | 'disabled'>,\n Pick<RadioGroupProps, 'reverse'> {\n children: ReactNode\n}\n\nexport const RadioGroupProvider = ({\n intent,\n disabled,\n reverse,\n children,\n}: RadioGroupProviderProps) => {\n const value = useMemo(() => ({ intent, disabled, reverse }), [intent, disabled, reverse])\n\n return <RadioGroupContext.Provider value={value}>{children}</RadioGroupContext.Provider>\n}\n","import { RadioGroup as BaseUIRadioGroup } from '@base-ui/react/radio-group'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { HTMLAttributes, Ref } from 'react'\n\nimport { radioGroupStyles, RadioGroupVariantsProps } from './RadioGroup.styles'\nimport { RadioGroupProvider } from './RadioGroupProvider'\nimport { RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioGroupProps\n extends RadioGroupVariantsProps,\n Pick<RadioInputVariantsProps, 'intent'>,\n Omit<HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'dir' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items.\n */\n defaultValue?: string\n /**\n * The controlled value of the radio item to check. Should be used in conjunction with onValueChange.\n */\n value?: string\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n /**\n * When true, prevents the user from interacting with radio items.\n */\n disabled?: boolean\n /**\n * The name of the group. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * When true, indicates that the user must check a radio item before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The orientation of the component.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * The reading direction of the radio group.\n */\n dir?: 'ltr' | 'rtl'\n /**\n * When true, the label will be placed on the left side of the Radio\n */\n reverse?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const RadioGroup = ({\n orientation = 'vertical',\n intent = 'support',\n disabled,\n className,\n required: requiredProp,\n reverse = false,\n onValueChange: onValueChangeProp,\n ref,\n ...others\n}: RadioGroupProps) => {\n const { labelId, isInvalid, isRequired, description, name } = useFormFieldControl()\n const required = requiredProp !== undefined ? requiredProp : isRequired\n\n const handleValueChange = onValueChangeProp\n ? (value: unknown) => onValueChangeProp(value as string)\n : undefined\n\n return (\n <RadioGroupProvider reverse={reverse} intent={intent} disabled={disabled}>\n <BaseUIRadioGroup\n data-spark-component=\"radio-group\"\n className={radioGroupStyles({ orientation, className })}\n name={name}\n ref={ref}\n disabled={disabled}\n required={required}\n onValueChange={handleValueChange}\n aria-orientation={orientation}\n aria-labelledby={labelId}\n aria-invalid={isInvalid}\n aria-required={required}\n aria-describedby={description}\n {...others}\n />\n </RadioGroupProvider>\n )\n}\n\nRadioGroup.displayName = 'RadioGroup'\n","import { Radio } from './Radio'\nimport { RadioGroup as Root } from './RadioGroup'\n\nexport const RadioGroup: typeof Root & {\n Radio: typeof Radio\n} = Object.assign(Root, {\n Radio,\n})\n\nRadioGroup.displayName = 'RadioGroup'\nRadio.displayName = 'RadioGroup.Radio'\n\nexport { type RadioGroupProps } from './RadioGroup'\nexport { type RadioProps } from './Radio'\n"],"names":["RadioGroupContext","createContext","useRadioGroup","context","useContext","radioIndicatorStyles","cva","makeVariants","RadioIndicator","intent","className","keepMounted","ref","others","jsx","Radio","radioInputVariants","RadioInput","intentProp","asChild","children","inputRef","hideInput","state","useFormFieldControl","ID_PREFIX","disabledProp","innerLabelId","useId","disabled","reverse","isDisabled","radioLabel","cx","radioInput","content","jsxs","Fragment","radioGroupStyles","RadioGroupProvider","value","useMemo","RadioGroup","orientation","requiredProp","onValueChangeProp","labelId","isInvalid","isRequired","description","name","required","handleValueChange","BaseUIRadioGroup","Root"],"mappings":"2UAQaA,EAAoBC,EAAAA,cAA6C,IAAI,EAErEC,EAAgB,IAAM,CACjC,MAAMC,EAAUC,EAAAA,WAAWJ,CAAiB,EAE5C,GAAI,CAACG,EACH,MAAM,MAAM,yDAAyD,EAGvE,OAAOA,CACT,ECfaE,EAAuBC,EAAAA,IAClC,CACE,iBACA,WACA,iBACA,6EACA,YACA,YACA,cACA,sBACA,qBACA,uBACA,8BAAA,EAEF,CACE,SAAU,CACR,OAAQC,EAAAA,aAGN,CACA,KAAM,CAAC,eAAe,EACtB,QAAS,CAAC,kBAAkB,EAC5B,OAAQ,CAAC,iBAAiB,EAC1B,QAAS,CAAC,kBAAkB,EAC5B,QAAS,CAAC,kBAAkB,EAC5B,MAAO,CAAC,gBAAgB,EACxB,MAAO,CAAC,gBAAgB,EACxB,KAAM,CAAC,eAAe,CAAA,CACvB,CAAA,EAEH,gBAAiB,CACf,OAAQ,SAAA,CACV,CAEJ,ECtBaC,EAAiB,CAAC,CAC7B,OAAAC,EACA,UAAAC,EACA,YAAAC,EACA,IAAAC,EACA,GAAGC,CACL,IAEIC,EAAAA,IAACC,EAAAA,MAAM,UAAN,CACC,IAAAH,EACA,YAAAD,EACA,UAAWN,EAAqB,CAAE,OAAAI,EAAQ,UAAAC,EAAW,EACpD,GAAGG,CAAA,CAAA,EAKVL,EAAe,YAAc,4BC7BtB,MAAMQ,EAAqBV,EAAAA,IAChC,CACE,4CACA,eACA,YACA,iBACA,eACA,0BACA,2GACA,6BACA,YAAA,EAEF,CACE,SAAU,CAIR,OAAQC,EAAAA,aAGN,CACA,KAAM,CAAC,iBAAkB,2BAA4B,2BAA2B,EAChF,QAAS,CAAC,iBAAkB,8BAA+B,8BAA8B,EACzF,OAAQ,CAAC,iBAAkB,6BAA8B,6BAA6B,EACtF,QAAS,CAAC,iBAAkB,8BAA+B,8BAA8B,EACzF,KAAM,CAA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AAf,EAAAA,IAACuC,EAAAA,WAAA,CACC,uBAAqB,cACrB,UAAWf,EAAiB,CAAE,YAAAK,EAAa,UAAAjC,EAAW,EACtD,KAAAwC,EACA,IAAAtC,EACA,SAAAiB,EACA,SAAAsB,EACA,cAAeC,EACf,mBAAkBT,EAClB,kBAAiBG,EACjB,eAAcC,EACd,gBAAeI,EACf,mBAAkBF,EACjB,GAAGpC,CAAA,CAAA,EAER,CAEJ,EAEA6B,EAAW,YAAc,aC3FlB,MAAMA,EAET,OAAO,OAAOY,EAAM,CACtB,MAAAvC,CACF,CAAC,EAED2B,EAAW,YAAc,aACzB3B,EAAM,YAAc"}
@@ -1,15 +1,16 @@
1
- import { jsx as o, jsxs as g, Fragment as G } from "react/jsx-runtime";
2
- import { cva as u, cx as F } from "class-variance-authority";
3
- import { createContext as V, useContext as j, useId as x, useMemo as C } from "react";
4
- import { useFormFieldControl as y } from "@spark-ui/components/form-field";
5
- import { RadioGroup as h, Label as q } from "radix-ui";
6
- import { makeVariants as I } from "@spark-ui/internal-utils";
7
- const N = V(null), S = () => {
8
- const r = j(N);
1
+ import { jsx as n, jsxs as g, Fragment as v } from "react/jsx-runtime";
2
+ import { cva as f, cx as R } from "class-variance-authority";
3
+ import { createContext as $, useContext as j, useId as F, useMemo as q } from "react";
4
+ import { Radio as k } from "@base-ui/react/radio";
5
+ import { useFormFieldControl as x } from "@spark-ui/components/form-field";
6
+ import { makeVariants as G } from "@spark-ui/internal-utils";
7
+ import { RadioGroup as D } from "@base-ui/react/radio-group";
8
+ const y = $(null), E = () => {
9
+ const r = j(y);
9
10
  if (!r)
10
11
  throw Error("useRadioGroup must be used within a RadioGroup provider");
11
12
  return r;
12
- }, E = u(
13
+ }, L = f(
13
14
  [
14
15
  "relative block",
15
16
  "size-3/5",
@@ -21,11 +22,11 @@ const N = V(null), S = () => {
21
22
  "after:rounded-[50%]",
22
23
  "after:content-['']",
23
24
  "after:transition-all",
24
- "data-[state=checked]:after:size-full"
25
+ "data-checked:after:size-full"
25
26
  ],
26
27
  {
27
28
  variants: {
28
- intent: I({
29
+ intent: G({
29
30
  main: ["after:bg-main"],
30
31
  support: ["after:bg-support"],
31
32
  accent: ["after:bg-accent"],
@@ -40,16 +41,23 @@ const N = V(null), S = () => {
40
41
  intent: "support"
41
42
  }
42
43
  }
43
- ), w = ({ intent: r, className: e, ref: a, ...t }) => /* @__PURE__ */ o(
44
- h.Indicator,
44
+ ), I = ({
45
+ intent: r,
46
+ className: a,
47
+ keepMounted: e,
48
+ ref: t,
49
+ ...o
50
+ }) => /* @__PURE__ */ n(
51
+ k.Indicator,
45
52
  {
46
- ref: a,
47
- className: E({ intent: r, className: e }),
48
- ...t
53
+ ref: t,
54
+ keepMounted: e,
55
+ className: L({ intent: r, className: a }),
56
+ ...o
49
57
  }
50
58
  );
51
- w.displayName = "RadioGroup.RadioIndicator";
52
- const M = u(
59
+ I.displayName = "RadioGroup.RadioIndicator";
60
+ const M = f(
53
61
  [
54
62
  "flex shrink-0 items-center justify-center",
55
63
  "rounded-full",
@@ -57,7 +65,7 @@ const M = u(
57
65
  "outline-hidden",
58
66
  "hover:ring-4",
59
67
  "focus-visible:u-outline",
60
- "disabled:cursor-not-allowed disabled:border-outline/dim-2 disabled:hover:ring-transparent",
68
+ "data-disabled:cursor-not-allowed data-disabled:border-outline/dim-2 data-disabled:hover:ring-transparent",
61
69
  "u-shadow-border-transition",
62
70
  "size-sz-24"
63
71
  ],
@@ -66,151 +74,136 @@ const M = u(
66
74
  /**
67
75
  * Color scheme of the radio input.
68
76
  */
69
- intent: I({
70
- main: ["border-outline", "data-[state=checked]:border-main", "hover:ring-main-container"],
71
- support: [
72
- "border-outline",
73
- "data-[state=checked]:border-support",
74
- "hover:ring-support-container"
75
- ],
76
- accent: [
77
- "border-outline",
78
- "data-[state=checked]:border-accent",
79
- "hover:ring-accent-container"
80
- ],
81
- neutral: [
82
- "border-outline",
83
- "data-[state=checked]:border-neutral",
84
- "hover:ring-neutral-container"
85
- ],
86
- info: ["border-info", "data-[state=checked]:border-info", "hover:ring-info-container"],
87
- success: [
88
- "border-success",
89
- "data-[state=checked]:border-success",
90
- "hover:ring-success-container"
91
- ],
92
- alert: ["border-alert", "data-[state=checked]:border-alert", "hover:ring-alert-container"],
93
- error: ["border-error", "data-[state=checked]:border-error", "hover:ring-error-container"]
77
+ intent: G({
78
+ main: ["border-outline", "data-checked:border-main", "hover:ring-main-container"],
79
+ support: ["border-outline", "data-checked:border-support", "hover:ring-support-container"],
80
+ accent: ["border-outline", "data-checked:border-accent", "hover:ring-accent-container"],
81
+ neutral: ["border-outline", "data-checked:border-neutral", "hover:ring-neutral-container"],
82
+ info: ["border-info", "data-checked:border-info", "hover:ring-info-container"],
83
+ success: ["border-success", "data-checked:border-success", "hover:ring-success-container"],
84
+ alert: ["border-alert", "data-checked:border-alert", "hover:ring-alert-container"],
85
+ error: ["border-error", "data-checked:border-error", "hover:ring-error-container"]
94
86
  })
95
87
  },
96
88
  defaultVariants: {
97
89
  intent: "support"
98
90
  }
99
91
  }
100
- ), L = ({ intent: r, className: e, ref: a, ...t }) => {
101
- const { state: n } = y(), i = n ?? r;
102
- return /* @__PURE__ */ o(
103
- h.RadioGroupItem,
92
+ ), N = ({
93
+ intent: r,
94
+ className: a,
95
+ asChild: e,
96
+ children: t,
97
+ inputRef: o,
98
+ hideInput: i = !1,
99
+ ref: d,
100
+ ...s
101
+ }) => {
102
+ const { state: c } = x(), l = c ?? r;
103
+ return /* @__PURE__ */ n(
104
+ k.Root,
104
105
  {
105
106
  "data-spark-component": "radio-input",
106
- ref: a,
107
- className: M({ intent: i, className: e }),
108
- ...t,
109
- children: /* @__PURE__ */ o(w, { intent: i, forceMount: !0 })
107
+ ref: d,
108
+ inputRef: o,
109
+ render: e ? t : void 0,
110
+ className: i ? "sr-only" : M({ intent: l, className: a }),
111
+ ...s,
112
+ children: !e && !i && /* @__PURE__ */ n(I, { intent: l, keepMounted: !0 })
110
113
  }
111
114
  );
112
115
  };
113
- L.displayName = "RadioGroup.RadioInput";
114
- const D = u("grow", {
115
- variants: {
116
- disabled: {
117
- true: ["text-neutral/dim-2", "cursor-not-allowed"],
118
- false: ["cursor-pointer"]
119
- }
120
- },
121
- defaultVariants: {
122
- disabled: !1
123
- }
124
- }), $ = ({ disabled: r, ...e }) => /* @__PURE__ */ o(
125
- q.Root,
126
- {
127
- "data-spark-component": "radio-label",
128
- className: D({ disabled: r }),
129
- ...e
130
- }
131
- );
132
- $.displayName = "RadioGroup.RadioLabel";
133
- const k = ":radio", R = ({
116
+ N.displayName = "RadioGroup.RadioInput";
117
+ const S = ":radio", m = ({
134
118
  className: r,
135
- children: e,
136
- id: a,
137
- disabled: t,
138
- ref: n,
139
- ...i
119
+ children: a,
120
+ disabled: e,
121
+ ref: t,
122
+ ...o
140
123
  }) => {
141
- const s = `${k}-input-${x()}`, d = `${k}-label-${x()}`, { intent: p, disabled: b, reverse: f } = S(), c = e && /* @__PURE__ */ o($, { disabled: t || b, htmlFor: a || s, id: d, children: e }), l = /* @__PURE__ */ o(
142
- L,
124
+ const i = `${S}-label-${F()}`, { intent: d, disabled: s, reverse: c } = E(), u = a && /* @__PURE__ */ n(
125
+ "span",
126
+ {
127
+ "data-spark-component": "radio-label",
128
+ id: i,
129
+ className: R(
130
+ "grow",
131
+ e || s ? "text-neutral/dim-2 cursor-not-allowed" : "cursor-pointer"
132
+ ),
133
+ children: a
134
+ }
135
+ ), p = /* @__PURE__ */ n(
136
+ N,
143
137
  {
144
- ref: n,
145
- id: a || s,
146
- intent: p,
147
- "aria-labelledby": e ? d : void 0,
148
- ...i,
149
- disabled: t
138
+ ref: t,
139
+ intent: d,
140
+ "aria-labelledby": a ? i : void 0,
141
+ ...o,
142
+ disabled: e
150
143
  }
151
- ), m = f ? /* @__PURE__ */ g(G, { children: [
152
- c,
153
- l
154
- ] }) : /* @__PURE__ */ g(G, { children: [
155
- l,
156
- c
144
+ ), b = c ? /* @__PURE__ */ g(v, { children: [
145
+ u,
146
+ p
147
+ ] }) : /* @__PURE__ */ g(v, { children: [
148
+ p,
149
+ u
157
150
  ] });
158
- return /* @__PURE__ */ o("span", { className: F("gap-md text-body-1 flex items-start", r), children: m });
151
+ return /* @__PURE__ */ n("label", { className: R("gap-md text-body-1 flex items-start", r), children: b });
159
152
  };
160
- R.displayName = "RadioGroup.Radio";
161
- const O = u(["flex"], {
153
+ m.displayName = "RadioGroup.Radio";
154
+ const O = f(["flex"], {
162
155
  variants: {
163
156
  orientation: {
164
157
  vertical: ["flex-col", "gap-lg"],
165
158
  horizontal: ["flex-row", "gap-xl"]
166
159
  }
167
160
  }
168
- }), P = ({
161
+ }), X = ({
169
162
  intent: r,
170
- disabled: e,
171
- reverse: a,
163
+ disabled: a,
164
+ reverse: e,
172
165
  children: t
173
166
  }) => {
174
- const n = C(() => ({ intent: r, disabled: e, reverse: a }), [r, e, a]);
175
- return /* @__PURE__ */ o(N.Provider, { value: n, children: t });
176
- }, z = ({
167
+ const o = q(() => ({ intent: r, disabled: a, reverse: e }), [r, a, e]);
168
+ return /* @__PURE__ */ n(y.Provider, { value: o, children: t });
169
+ }, w = ({
177
170
  orientation: r = "vertical",
178
- loop: e = !0,
179
171
  intent: a = "support",
180
- disabled: t,
181
- className: n,
182
- required: i,
183
- reverse: s = !1,
184
- ref: d,
185
- ...p
172
+ disabled: e,
173
+ className: t,
174
+ required: o,
175
+ reverse: i = !1,
176
+ onValueChange: d,
177
+ ref: s,
178
+ ...c
186
179
  }) => {
187
- const { labelId: b, isInvalid: f, isRequired: c, description: l, name: m } = y(), v = i !== void 0 ? i : c;
188
- return /* @__PURE__ */ o(P, { reverse: s, intent: a, disabled: t, children: /* @__PURE__ */ o(
189
- h.RadioGroup,
180
+ const { labelId: l, isInvalid: u, isRequired: p, description: b, name: V } = x(), h = o !== void 0 ? o : p, z = d ? (C) => d(C) : void 0;
181
+ return /* @__PURE__ */ n(X, { reverse: i, intent: a, disabled: e, children: /* @__PURE__ */ n(
182
+ D,
190
183
  {
191
184
  "data-spark-component": "radio-group",
192
- className: O({ orientation: r, className: n }),
193
- name: m,
194
- ref: d,
195
- disabled: t,
196
- orientation: r,
197
- loop: e,
198
- required: v,
199
- "aria-labelledby": b,
200
- "aria-invalid": f,
201
- "aria-required": v,
202
- "aria-describedby": l,
203
- ...p
185
+ className: O({ orientation: r, className: t }),
186
+ name: V,
187
+ ref: s,
188
+ disabled: e,
189
+ required: h,
190
+ onValueChange: z,
191
+ "aria-orientation": r,
192
+ "aria-labelledby": l,
193
+ "aria-invalid": u,
194
+ "aria-required": h,
195
+ "aria-describedby": b,
196
+ ...c
204
197
  }
205
198
  ) });
206
199
  };
207
- z.displayName = "RadioGroup";
208
- const X = Object.assign(z, {
209
- Radio: R
200
+ w.displayName = "RadioGroup";
201
+ const _ = Object.assign(w, {
202
+ Radio: m
210
203
  });
211
- X.displayName = "RadioGroup";
212
- R.displayName = "RadioGroup.Radio";
204
+ _.displayName = "RadioGroup";
205
+ m.displayName = "RadioGroup.Radio";
213
206
  export {
214
- X as RadioGroup
207
+ _ as RadioGroup
215
208
  };
216
209
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/radio-group/RadioGroupContext.tsx","../../src/radio-group/RadioIndicator.styles.ts","../../src/radio-group/RadioIndicator.tsx","../../src/radio-group/RadioInput.styles.ts","../../src/radio-group/RadioInput.tsx","../../src/radio-group/RadioLabel.styles.tsx","../../src/radio-group/RadioLabel.tsx","../../src/radio-group/Radio.tsx","../../src/radio-group/RadioGroup.styles.ts","../../src/radio-group/RadioGroupProvider.tsx","../../src/radio-group/RadioGroup.tsx","../../src/radio-group/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport type { RadioInputProps } from './RadioInput'\n\nexport type RadioGroupContextState = Pick<RadioInputProps, 'intent' | 'disabled'> &\n Pick<RadioGroupProps, 'reverse'>\n\nexport const RadioGroupContext = createContext<RadioGroupContextState | null>(null)\n\nexport const useRadioGroup = () => {\n const context = useContext(RadioGroupContext)\n\n if (!context) {\n throw Error('useRadioGroup must be used within a RadioGroup provider')\n }\n\n return context\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioIndicatorStyles = cva(\n [\n 'relative block',\n 'size-3/5',\n 'after:absolute',\n 'after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2',\n 'after:h-0',\n 'after:w-0',\n 'after:block',\n 'after:rounded-[50%]',\n \"after:content-['']\",\n 'after:transition-all',\n 'data-[state=checked]:after:size-full',\n ],\n {\n variants: {\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n neutral: ['after:bg-neutral'],\n success: ['after:bg-success'],\n alert: ['after:bg-alert'],\n error: ['after:bg-error'],\n info: ['after:bg-info'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioIndicatorStylesProps = VariantProps<typeof radioIndicatorStyles>\n","import { RadioGroup as RadixRadioGroup } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { radioIndicatorStyles, RadioIndicatorStylesProps } from './RadioIndicator.styles'\n\nexport interface RadioIndicatorProps extends RadioIndicatorStylesProps {\n className?: string\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.\n */\n forceMount?: true | undefined\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const RadioIndicator = ({ intent, className, ref, ...others }: RadioIndicatorProps) => {\n return (\n <RadixRadioGroup.Indicator\n ref={ref}\n className={radioIndicatorStyles({ intent, className })}\n {...others}\n />\n )\n}\n\nRadioIndicator.displayName = 'RadioGroup.RadioIndicator'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioInputVariants = cva(\n [\n 'flex shrink-0 items-center justify-center',\n 'rounded-full',\n 'border-md',\n 'outline-hidden',\n 'hover:ring-4',\n 'focus-visible:u-outline',\n 'disabled:cursor-not-allowed disabled:border-outline/dim-2 disabled:hover:ring-transparent',\n 'u-shadow-border-transition',\n 'size-sz-24',\n ],\n {\n variants: {\n /**\n * Color scheme of the radio input.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['border-outline', 'data-[state=checked]:border-main', 'hover:ring-main-container'],\n support: [\n 'border-outline',\n 'data-[state=checked]:border-support',\n 'hover:ring-support-container',\n ],\n accent: [\n 'border-outline',\n 'data-[state=checked]:border-accent',\n 'hover:ring-accent-container',\n ],\n neutral: [\n 'border-outline',\n 'data-[state=checked]:border-neutral',\n 'hover:ring-neutral-container',\n ],\n info: ['border-info', 'data-[state=checked]:border-info', 'hover:ring-info-container'],\n success: [\n 'border-success',\n 'data-[state=checked]:border-success',\n 'hover:ring-success-container',\n ],\n alert: ['border-alert', 'data-[state=checked]:border-alert', 'hover:ring-alert-container'],\n error: ['border-error', 'data-[state=checked]:border-error', 'hover:ring-error-container'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioInputVariantsProps = VariantProps<typeof radioInputVariants>\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui'\nimport { ButtonHTMLAttributes, Ref } from 'react'\n\nimport { RadioIndicator } from './RadioIndicator'\nimport { radioInputVariants, RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioInputProps\n extends RadioInputVariantsProps,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n /**\n * When true, prevents the user from interacting with the radio item.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the radio item before the owning form can be submitted.\n */\n required?: boolean\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const RadioInput = ({ intent: intentProp, className, ref, ...others }: RadioInputProps) => {\n const { state } = useFormFieldControl()\n\n const intent = state ?? intentProp\n\n return (\n <RadixRadioGroup.RadioGroupItem\n data-spark-component=\"radio-input\"\n ref={ref}\n className={radioInputVariants({ intent, className })}\n {...others}\n >\n <RadioIndicator intent={intent} forceMount />\n </RadixRadioGroup.RadioGroupItem>\n )\n}\n\nRadioInput.displayName = 'RadioGroup.RadioInput'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioLabelStyles = cva('grow', {\n variants: {\n disabled: {\n true: ['text-neutral/dim-2', 'cursor-not-allowed'],\n false: ['cursor-pointer'],\n },\n },\n defaultVariants: {\n disabled: false,\n },\n})\n\nexport type RadioLabelStylesProps = VariantProps<typeof radioLabelStyles>\n","import { Label } from 'radix-ui'\nimport type { HTMLAttributes, PropsWithChildren } from 'react'\n\nimport { radioLabelStyles, RadioLabelStylesProps } from './RadioLabel.styles'\n\nexport interface RadioLabelProps\n extends RadioLabelStylesProps,\n PropsWithChildren<HTMLAttributes<HTMLLabelElement>> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The id of the element the label is associated with.\n */\n htmlFor?: string\n /**\n * When true, prevents the user from interacting with the radio item.\n */\n disabled?: boolean\n}\n\nexport const RadioLabel = ({ disabled, ...others }: RadioLabelProps) => {\n return (\n <Label.Root\n data-spark-component=\"radio-label\"\n className={radioLabelStyles({ disabled })}\n {...others}\n />\n )\n}\n\nRadioLabel.displayName = 'RadioGroup.RadioLabel'\n","import { cx } from 'class-variance-authority'\nimport { Ref, useId } from 'react'\n\nimport { useRadioGroup } from './RadioGroupContext'\nimport { RadioInput, RadioInputProps } from './RadioInput'\nimport { RadioLabel } from './RadioLabel'\n\nexport type RadioProps = RadioInputProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nconst ID_PREFIX = ':radio'\n\nexport const Radio = ({\n className,\n children,\n id,\n disabled: disabledProp,\n ref,\n ...others\n}: RadioProps) => {\n const innerId = `${ID_PREFIX}-input-${useId()}`\n const innerLabelId = `${ID_PREFIX}-label-${useId()}`\n\n const { intent, disabled, reverse } = useRadioGroup()\n\n const radioLabel = children && (\n <RadioLabel disabled={disabledProp || disabled} htmlFor={id || innerId} id={innerLabelId}>\n {children}\n </RadioLabel>\n )\n\n const radioInput = (\n <RadioInput\n ref={ref}\n id={id || innerId}\n intent={intent}\n aria-labelledby={children ? innerLabelId : undefined}\n {...others}\n disabled={disabledProp}\n />\n )\n\n const content = reverse ? (\n <>\n {radioLabel}\n {radioInput}\n </>\n ) : (\n <>\n {radioInput}\n {radioLabel}\n </>\n )\n\n return <span className={cx('gap-md text-body-1 flex items-start', className)}>{content}</span>\n}\n\nRadio.displayName = 'RadioGroup.Radio'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioGroupStyles = cva(['flex'], {\n variants: {\n orientation: {\n vertical: ['flex-col', 'gap-lg'],\n horizontal: ['flex-row', 'gap-xl'],\n },\n },\n})\n\nexport type RadioGroupVariantsProps = VariantProps<typeof radioGroupStyles>\n","import { ReactNode, useMemo } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport { RadioGroupContext } from './RadioGroupContext'\nimport type { RadioInputProps } from './RadioInput'\n\nexport interface RadioGroupProviderProps\n extends Pick<RadioInputProps, 'intent' | 'disabled'>,\n Pick<RadioGroupProps, 'reverse'> {\n children: ReactNode\n}\n\nexport const RadioGroupProvider = ({\n intent,\n disabled,\n reverse,\n children,\n}: RadioGroupProviderProps) => {\n const value = useMemo(() => ({ intent, disabled, reverse }), [intent, disabled, reverse])\n\n return <RadioGroupContext.Provider value={value}>{children}</RadioGroupContext.Provider>\n}\n","import { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { RadioGroup as RadixRadioGroup } from 'radix-ui'\nimport { HTMLAttributes, Ref } from 'react'\n\nimport { radioGroupStyles, RadioGroupVariantsProps } from './RadioGroup.styles'\nimport { RadioGroupProvider } from './RadioGroupProvider'\nimport { RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioGroupProps\n extends RadioGroupVariantsProps,\n Pick<RadioInputVariantsProps, 'intent'>,\n Omit<HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'dir' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items.\n */\n defaultValue?: string\n /**\n * The controlled value of the radio item to check. Should be used in conjunction with onValueChange.\n */\n value?: string\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n /**\n * When true, prevents the user from interacting with radio items.\n */\n disabled?: boolean\n /**\n * The name of the group. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * When true, indicates that the user must check a radio item before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The orientation of the component.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * The reading direction of the radio group.\n */\n dir?: 'ltr' | 'rtl'\n /**\n * When true, keyboard navigation will loop from last item to first, and vice versa.\n */\n loop?: boolean\n /**\n * When true, the label will be placed on the left side of the Radio\n */\n reverse?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const RadioGroup = ({\n orientation = 'vertical',\n loop = true,\n intent = 'support',\n disabled,\n className,\n required: requiredProp,\n reverse = false,\n ref,\n ...others\n}: RadioGroupProps) => {\n const { labelId, isInvalid, isRequired, description, name } = useFormFieldControl()\n const required = requiredProp !== undefined ? requiredProp : isRequired\n\n return (\n <RadioGroupProvider reverse={reverse} intent={intent} disabled={disabled}>\n <RadixRadioGroup.RadioGroup\n data-spark-component=\"radio-group\"\n className={radioGroupStyles({ orientation, className })}\n name={name}\n ref={ref}\n disabled={disabled}\n orientation={orientation}\n loop={loop}\n required={required}\n aria-labelledby={labelId}\n aria-invalid={isInvalid}\n aria-required={required}\n aria-describedby={description}\n {...others}\n />\n </RadioGroupProvider>\n )\n}\n\nRadioGroup.displayName = 'RadioGroup'\n","import { Radio } from './Radio'\nimport { RadioGroup as Root } from './RadioGroup'\n\nexport const RadioGroup: typeof Root & {\n Radio: typeof Radio\n} = Object.assign(Root, {\n Radio,\n})\n\nRadioGroup.displayName = 'RadioGroup'\nRadio.displayName = 'RadioGroup.Radio'\n\nexport { type RadioGroupProps } from './RadioGroup'\nexport { type RadioProps } from './Radio'\n"],"names":["RadioGroupContext","createContext","useRadioGroup","context","useContext","radioIndicatorStyles","cva","makeVariants","RadioIndicator","intent","className","ref","others","jsx","RadixRadioGroup","radioInputVariants","RadioInput","intentProp","state","useFormFieldControl","radioLabelStyles","RadioLabel","disabled","Label","ID_PREFIX","Radio","children","id","disabledProp","innerId","useId","innerLabelId","reverse","radioLabel","radioInput","content","jsxs","Fragment","cx","radioGroupStyles","RadioGroupProvider","value","useMemo","RadioGroup","orientation","loop","requiredProp","labelId","isInvalid","isRequired","description","name","required","Root"],"mappings":";;;;;;AAQO,MAAMA,IAAoBC,EAA6C,IAAI,GAErEC,IAAgB,MAAM;AACjC,QAAMC,IAAUC,EAAWJ,CAAiB;AAE5C,MAAI,CAACG;AACH,UAAM,MAAM,yDAAyD;AAGvE,SAAOA;AACT,GCfaE,IAAuBC;AAAA,EAClC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,QAAQC,EAGN;AAAA,QACA,MAAM,CAAC,eAAe;AAAA,QACtB,SAAS,CAAC,kBAAkB;AAAA,QAC5B,QAAQ,CAAC,iBAAiB;AAAA,QAC1B,SAAS,CAAC,kBAAkB;AAAA,QAC5B,SAAS,CAAC,kBAAkB;AAAA,QAC5B,OAAO,CAAC,gBAAgB;AAAA,QACxB,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,KAAArB;AAAA,EACA,GAAGC;AACL,MAAuB;AACrB,QAAM,EAAE,SAAAmC,GAAS,WAAAC,GAAW,YAAAC,GAAY,aAAAC,GAAa,MAAAC,EAAA,IAAShC,EAAA,GACxDiC,IAAWN,MAAiB,SAAYA,IAAeG;AAE7D,SACE,gBAAApC,EAAC2B,GAAA,EAAmB,SAAAR,GAAkB,QAAAvB,GAAgB,UAAAa,GACpD,UAAA,gBAAAT;AAAA,IAACC,EAAgB;AAAA,IAAhB;AAAA,MACC,wBAAqB;AAAA,MACrB,WAAWyB,EAAiB,EAAE,aAAAK,GAAa,WAAAlC,GAAW;AAAA,MACtD,MAAAyC;AAAA,MACA,KAAAxC;AAAA,MACA,UAAAW;AAAA,MACA,aAAAsB;AAAA,MACA,MAAAC;AAAA,MACA,UAAAO;AAAA,MACA,mBAAiBL;AAAA,MACjB,gBAAcC;AAAA,MACd,iBAAeI;AAAA,MACf,oBAAkBF;AAAA,MACjB,GAAGtC;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ;AAEA+B,EAAW,cAAc;AC3FlB,MAAMA,IAET,OAAO,OAAOU,GAAM;AAAA,EACtB,OAAA5B;AACF,CAAC;AAEDkB,EAAW,cAAc;AACzBlB,EAAM,cAAc;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/radio-group/RadioGroupContext.tsx","../../src/radio-group/RadioIndicator.styles.ts","../../src/radio-group/RadioIndicator.tsx","../../src/radio-group/RadioInput.styles.ts","../../src/radio-group/RadioInput.tsx","../../src/radio-group/Radio.tsx","../../src/radio-group/RadioGroup.styles.ts","../../src/radio-group/RadioGroupProvider.tsx","../../src/radio-group/RadioGroup.tsx","../../src/radio-group/index.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport type { RadioInputProps } from './RadioInput'\n\nexport type RadioGroupContextState = Pick<RadioInputProps, 'intent' | 'disabled'> &\n Pick<RadioGroupProps, 'reverse'>\n\nexport const RadioGroupContext = createContext<RadioGroupContextState | null>(null)\n\nexport const useRadioGroup = () => {\n const context = useContext(RadioGroupContext)\n\n if (!context) {\n throw Error('useRadioGroup must be used within a RadioGroup provider')\n }\n\n return context\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioIndicatorStyles = cva(\n [\n 'relative block',\n 'size-3/5',\n 'after:absolute',\n 'after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2',\n 'after:h-0',\n 'after:w-0',\n 'after:block',\n 'after:rounded-[50%]',\n \"after:content-['']\",\n 'after:transition-all',\n 'data-checked:after:size-full',\n ],\n {\n variants: {\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n neutral: ['after:bg-neutral'],\n success: ['after:bg-success'],\n alert: ['after:bg-alert'],\n error: ['after:bg-error'],\n info: ['after:bg-info'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioIndicatorStylesProps = VariantProps<typeof radioIndicatorStyles>\n","import { Radio } from '@base-ui/react/radio'\nimport { Ref } from 'react'\n\nimport { radioIndicatorStyles, RadioIndicatorStylesProps } from './RadioIndicator.styles'\n\nexport interface RadioIndicatorProps extends RadioIndicatorStylesProps {\n className?: string\n /**\n * Whether to keep the indicator mounted in the DOM when the radio is unchecked.\n * Useful when controlling animation with React animation libraries.\n */\n keepMounted?: boolean\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const RadioIndicator = ({\n intent,\n className,\n keepMounted,\n ref,\n ...others\n}: RadioIndicatorProps) => {\n return (\n <Radio.Indicator\n ref={ref}\n keepMounted={keepMounted}\n className={radioIndicatorStyles({ intent, className })}\n {...others}\n />\n )\n}\n\nRadioIndicator.displayName = 'RadioGroup.RadioIndicator'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioInputVariants = cva(\n [\n 'flex shrink-0 items-center justify-center',\n 'rounded-full',\n 'border-md',\n 'outline-hidden',\n 'hover:ring-4',\n 'focus-visible:u-outline',\n 'data-disabled:cursor-not-allowed data-disabled:border-outline/dim-2 data-disabled:hover:ring-transparent',\n 'u-shadow-border-transition',\n 'size-sz-24',\n ],\n {\n variants: {\n /**\n * Color scheme of the radio input.\n */\n intent: makeVariants<\n 'intent',\n ['main', 'support', 'accent', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['border-outline', 'data-checked:border-main', 'hover:ring-main-container'],\n support: ['border-outline', 'data-checked:border-support', 'hover:ring-support-container'],\n accent: ['border-outline', 'data-checked:border-accent', 'hover:ring-accent-container'],\n neutral: ['border-outline', 'data-checked:border-neutral', 'hover:ring-neutral-container'],\n info: ['border-info', 'data-checked:border-info', 'hover:ring-info-container'],\n success: ['border-success', 'data-checked:border-success', 'hover:ring-success-container'],\n alert: ['border-alert', 'data-checked:border-alert', 'hover:ring-alert-container'],\n error: ['border-error', 'data-checked:border-error', 'hover:ring-error-container'],\n }),\n },\n defaultVariants: {\n intent: 'support',\n },\n }\n)\n\nexport type RadioInputVariantsProps = VariantProps<typeof radioInputVariants>\n","import { Radio } from '@base-ui/react/radio'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { HTMLAttributes, ReactElement, Ref } from 'react'\n\nimport { RadioIndicator } from './RadioIndicator'\nimport { radioInputVariants, RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioInputProps\n extends RadioInputVariantsProps,\n Omit<HTMLAttributes<HTMLElement>, 'value' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n * Uses Base UI's render prop internally to merge behaviour into the child element.\n */\n asChild?: boolean\n /**\n * The value given as data when submitted with a name.\n */\n value: string\n /**\n * When true, prevents the user from interacting with the radio item.\n */\n disabled?: boolean\n /**\n * When true, indicates that the user must check the radio item before the owning form can be submitted.\n */\n required?: boolean\n /**\n * Ref forwarded to the hidden `<input type=\"radio\">` rendered by Base UI.\n * Useful for programmatic activation (e.g. clicking from an associated label span).\n */\n inputRef?: Ref<HTMLInputElement>\n ref?: Ref<HTMLElement>\n /**\n * When true, the visual radio input (outer ring and inner dot) is visually hidden but remains\n * accessible in the DOM. Useful for custom radio appearances where only the label matters visually.\n * @default false\n */\n hideInput?: boolean\n}\n\nexport const RadioInput = ({\n intent: intentProp,\n className,\n asChild,\n children,\n inputRef,\n hideInput = false,\n ref,\n ...others\n}: RadioInputProps) => {\n const { state } = useFormFieldControl()\n\n const intent = state ?? intentProp\n\n return (\n <Radio.Root\n data-spark-component=\"radio-input\"\n ref={ref}\n inputRef={inputRef}\n render={asChild ? (children as ReactElement) : undefined}\n className={hideInput ? 'sr-only' : radioInputVariants({ intent, className })}\n {...others}\n >\n {!asChild && !hideInput && <RadioIndicator intent={intent} keepMounted />}\n </Radio.Root>\n )\n}\n\nRadioInput.displayName = 'RadioGroup.RadioInput'\n","import { cx } from 'class-variance-authority'\nimport { Ref, useId } from 'react'\n\nimport { useRadioGroup } from './RadioGroupContext'\nimport { RadioInput, RadioInputProps } from './RadioInput'\n\nexport type RadioProps = RadioInputProps & {\n ref?: Ref<HTMLElement>\n}\n\nconst ID_PREFIX = ':radio'\n\nexport const Radio = ({\n className,\n children,\n disabled: disabledProp,\n ref,\n ...others\n}: RadioProps) => {\n const innerLabelId = `${ID_PREFIX}-label-${useId()}`\n\n const { intent, disabled, reverse } = useRadioGroup()\n\n const isDisabled = disabledProp || disabled\n\n const radioLabel = children && (\n <span\n data-spark-component=\"radio-label\"\n id={innerLabelId}\n className={cx(\n 'grow',\n isDisabled ? 'text-neutral/dim-2 cursor-not-allowed' : 'cursor-pointer'\n )}\n >\n {children}\n </span>\n )\n\n const radioInput = (\n <RadioInput\n ref={ref}\n intent={intent}\n aria-labelledby={children ? innerLabelId : undefined}\n {...others}\n disabled={disabledProp}\n />\n )\n\n const content = reverse ? (\n <>\n {radioLabel}\n {radioInput}\n </>\n ) : (\n <>\n {radioInput}\n {radioLabel}\n </>\n )\n\n return <label className={cx('gap-md text-body-1 flex items-start', className)}>{content}</label>\n}\n\nRadio.displayName = 'RadioGroup.Radio'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const radioGroupStyles = cva(['flex'], {\n variants: {\n orientation: {\n vertical: ['flex-col', 'gap-lg'],\n horizontal: ['flex-row', 'gap-xl'],\n },\n },\n})\n\nexport type RadioGroupVariantsProps = VariantProps<typeof radioGroupStyles>\n","import { ReactNode, useMemo } from 'react'\n\nimport type { RadioGroupProps } from './RadioGroup'\nimport { RadioGroupContext } from './RadioGroupContext'\nimport type { RadioInputProps } from './RadioInput'\n\nexport interface RadioGroupProviderProps\n extends Pick<RadioInputProps, 'intent' | 'disabled'>,\n Pick<RadioGroupProps, 'reverse'> {\n children: ReactNode\n}\n\nexport const RadioGroupProvider = ({\n intent,\n disabled,\n reverse,\n children,\n}: RadioGroupProviderProps) => {\n const value = useMemo(() => ({ intent, disabled, reverse }), [intent, disabled, reverse])\n\n return <RadioGroupContext.Provider value={value}>{children}</RadioGroupContext.Provider>\n}\n","import { RadioGroup as BaseUIRadioGroup } from '@base-ui/react/radio-group'\nimport { useFormFieldControl } from '@spark-ui/components/form-field'\nimport { HTMLAttributes, Ref } from 'react'\n\nimport { radioGroupStyles, RadioGroupVariantsProps } from './RadioGroup.styles'\nimport { RadioGroupProvider } from './RadioGroupProvider'\nimport { RadioInputVariantsProps } from './RadioInput.styles'\n\nexport interface RadioGroupProps\n extends RadioGroupVariantsProps,\n Pick<RadioInputVariantsProps, 'intent'>,\n Omit<HTMLAttributes<HTMLDivElement>, 'value' | 'defaultValue' | 'dir' | 'onChange'> {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items.\n */\n defaultValue?: string\n /**\n * The controlled value of the radio item to check. Should be used in conjunction with onValueChange.\n */\n value?: string\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: string) => void\n /**\n * When true, prevents the user from interacting with radio items.\n */\n disabled?: boolean\n /**\n * The name of the group. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * When true, indicates that the user must check a radio item before the owning form can be submitted.\n */\n required?: boolean\n /**\n * The orientation of the component.\n */\n orientation?: 'horizontal' | 'vertical'\n /**\n * The reading direction of the radio group.\n */\n dir?: 'ltr' | 'rtl'\n /**\n * When true, the label will be placed on the left side of the Radio\n */\n reverse?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const RadioGroup = ({\n orientation = 'vertical',\n intent = 'support',\n disabled,\n className,\n required: requiredProp,\n reverse = false,\n onValueChange: onValueChangeProp,\n ref,\n ...others\n}: RadioGroupProps) => {\n const { labelId, isInvalid, isRequired, description, name } = useFormFieldControl()\n const required = requiredProp !== undefined ? requiredProp : isRequired\n\n const handleValueChange = onValueChangeProp\n ? (value: unknown) => onValueChangeProp(value as string)\n : undefined\n\n return (\n <RadioGroupProvider reverse={reverse} intent={intent} disabled={disabled}>\n <BaseUIRadioGroup\n data-spark-component=\"radio-group\"\n className={radioGroupStyles({ orientation, className })}\n name={name}\n ref={ref}\n disabled={disabled}\n required={required}\n onValueChange={handleValueChange}\n aria-orientation={orientation}\n aria-labelledby={labelId}\n aria-invalid={isInvalid}\n aria-required={required}\n aria-describedby={description}\n {...others}\n />\n </RadioGroupProvider>\n )\n}\n\nRadioGroup.displayName = 'RadioGroup'\n","import { Radio } from './Radio'\nimport { RadioGroup as Root } from './RadioGroup'\n\nexport const RadioGroup: typeof Root & {\n Radio: typeof Radio\n} = Object.assign(Root, {\n Radio,\n})\n\nRadioGroup.displayName = 'RadioGroup'\nRadio.displayName = 'RadioGroup.Radio'\n\nexport { type RadioGroupProps } from './RadioGroup'\nexport { type RadioProps } from './Radio'\n"],"names":["RadioGroupContext","createContext","useRadioGroup","context","useContext","radioIndicatorStyles","cva","makeVariants","RadioIndicator","intent","className","keepMounted","ref","others","jsx","Radio","radioInputVariants","RadioInput","intentProp","asChild","children","inputRef","hideInput","state","useFormFieldControl","ID_PREFIX","disabledProp","innerLabelId","useId","disabled","reverse","radioLabel","cx","radioInput","content","jsxs","Fragment","radioGroupStyles","RadioGroupProvider","value","useMemo","RadioGroup","orientation","requiredProp","onValueChangeProp","labelId","isInvalid","isRequired","description","name","required","handleValueChange","BaseUIRadioGroup","Root"],"mappings":";;;;;;;AAQO,MAAMA,IAAoBC,EAA6C,IAAI,GAErEC,IAAgB,MAAM;AACjC,QAAMC,IAAUC,EAAWJ,CAAiB;AAE5C,MAAI,CAACG;AACH,UAAM,MAAM,yDAAyD;AAGvE,SAAOA;AACT,GCfaE,IAAuBC;AAAA,EAClC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,QAAQC,EAGN;AAAA,QACA,MAAM,CAAC,eAAe;AAAA,QACtB,SAAS,CAAC,kBAAkB;AAAA,QAC5B,QAAQ,CAAC,iBAAiB;AAAA,QAC1B,SAAS,CAAC,kBAAkB;AAAA,QAC5B,SAAS,CAAC,kBAAkB;AAAA,QAC5B,OAAO,CAAC,gBAAgB;AAAA,QACxB,OAAO,CAAC,gBAAgB;AAAA,QACxB,MAAM,CAAC,eAAe;AAAA,MAAA,CACvB;AAAA,IAAA;AAAA,IAEH,iBAAiB;AAAA,MACf,QAAQ;AAAA,IAAA;AAAA,EACV;AAEJ,GCtBaC,IAAiB,CAAC;AAAA,EAC7B,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,KAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAACC,EAAM;AAAA,EAAN;AAAA,IACC,KAAAH;AAAA,IACA,aAAAD;AAAA,IACA,WAAWN,EAAqB,EAAE,Q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,oBAAkBF;AAAA,MACjB,GAAGnC;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ;AAEA4B,EAAW,cAAc;AC3FlB,MAAMA,IAET,OAAO,OAAOY,GAAM;AAAA,EACtB,OAAAtC;AACF,CAAC;AAED0B,EAAW,cAAc;AACzB1B,EAAM,cAAc;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/components",
3
- "version": "17.2.0",
3
+ "version": "17.2.1-beta.0",
4
4
  "license": "MIT",
5
5
  "description": "Spark (Leboncoin design system) components.",
6
6
  "exports": {
@@ -54,9 +54,9 @@
54
54
  "@react-aria/toast": "^3.0.0-beta.18",
55
55
  "@react-stately/numberfield": "3.9.11",
56
56
  "@react-stately/toast": "^3.0.0-beta.7",
57
- "@spark-ui/hooks": "^17.2.0",
58
- "@spark-ui/icons": "^17.2.0",
59
- "@spark-ui/internal-utils": "^17.2.0",
57
+ "@spark-ui/hooks": "^17.2.1-beta.0",
58
+ "@spark-ui/icons": "^17.2.1-beta.0",
59
+ "@spark-ui/internal-utils": "^17.2.1-beta.0",
60
60
  "@zag-js/pagination": "1.30.0",
61
61
  "@zag-js/react": "1.30.0",
62
62
  "class-variance-authority": "0.7.1",
@@ -1,20 +0,0 @@
1
- import { HTMLAttributes, PropsWithChildren } from 'react';
2
- import { RadioLabelStylesProps } from './RadioLabel.styles';
3
- export interface RadioLabelProps extends RadioLabelStylesProps, PropsWithChildren<HTMLAttributes<HTMLLabelElement>> {
4
- /**
5
- * Change the component to the HTML tag or custom component of the only child.
6
- */
7
- asChild?: boolean;
8
- /**
9
- * The id of the element the label is associated with.
10
- */
11
- htmlFor?: string;
12
- /**
13
- * When true, prevents the user from interacting with the radio item.
14
- */
15
- disabled?: boolean;
16
- }
17
- export declare const RadioLabel: {
18
- ({ disabled, ...others }: RadioLabelProps): import("react/jsx-runtime").JSX.Element;
19
- displayName: string;
20
- };
@@ -1,5 +0,0 @@
1
- import { VariantProps } from 'class-variance-authority';
2
- export declare const radioLabelStyles: (props?: ({
3
- disabled?: boolean | null | undefined;
4
- } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
- export type RadioLabelStylesProps = VariantProps<typeof radioLabelStyles>;