@spark-ui/components 16.1.0 → 16.2.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.
Files changed (63) hide show
  1. package/dist/{Button-C3C0aixy.mjs → Button-DPncfbbM.mjs} +3 -3
  2. package/dist/{Button-C3C0aixy.mjs.map → Button-DPncfbbM.mjs.map} +1 -1
  3. package/dist/{Icon-Ck-dhfLd.mjs → Icon-C23-htlD.mjs} +2 -2
  4. package/dist/{Icon-Ck-dhfLd.mjs.map → Icon-C23-htlD.mjs.map} +1 -1
  5. package/dist/{IconButton-C62-axzv.mjs → IconButton-Bfd-6BAD.mjs} +2 -2
  6. package/dist/{IconButton-C62-axzv.mjs.map → IconButton-Bfd-6BAD.mjs.map} +1 -1
  7. package/dist/{Slot-D2Bbf8Gw.mjs → Slot-DLY1rJrG.mjs} +5 -5
  8. package/dist/{Slot-D2Bbf8Gw.mjs.map → Slot-DLY1rJrG.mjs.map} +1 -1
  9. package/dist/{Spinner-jF3-zoh_.mjs → Spinner-aLrtE2JN.mjs} +2 -2
  10. package/dist/{Spinner-jF3-zoh_.mjs.map → Spinner-aLrtE2JN.mjs.map} +1 -1
  11. package/dist/{TextLink-BuzFRWO6.mjs → TextLink-D7mOCjY_.mjs} +2 -2
  12. package/dist/{TextLink-BuzFRWO6.mjs.map → TextLink-D7mOCjY_.mjs.map} +1 -1
  13. package/dist/{VisuallyHidden-KH1biLx-.mjs → VisuallyHidden-DjlV0-CW.mjs} +7 -7
  14. package/dist/{VisuallyHidden-KH1biLx-.mjs.map → VisuallyHidden-DjlV0-CW.mjs.map} +1 -1
  15. package/dist/accordion/index.mjs +5 -5
  16. package/dist/alert-dialog/index.mjs +6 -6
  17. package/dist/avatar/index.mjs +4 -4
  18. package/dist/breadcrumb/index.mjs +3 -3
  19. package/dist/button/index.mjs +1 -1
  20. package/dist/card/index.mjs +1 -1
  21. package/dist/carousel/index.mjs +4 -4
  22. package/dist/checkbox/index.js +1 -1
  23. package/dist/checkbox/index.js.map +1 -1
  24. package/dist/checkbox/index.mjs +31 -31
  25. package/dist/checkbox/index.mjs.map +1 -1
  26. package/dist/chip/index.mjs +2 -2
  27. package/dist/collapsible/index.mjs +1 -1
  28. package/dist/combobox/index.mjs +4 -4
  29. package/dist/dialog/index.mjs +3 -3
  30. package/dist/drawer/index.mjs +3 -3
  31. package/dist/dropdown/index.mjs +2 -2
  32. package/dist/file-upload/index.mjs +4 -4
  33. package/dist/form-field/index.mjs +2 -2
  34. package/dist/icon/index.mjs +1 -1
  35. package/dist/icon-button/index.mjs +1 -1
  36. package/dist/input/index.mjs +10 -10
  37. package/dist/link-box/index.mjs +7 -7
  38. package/dist/pagination/index.mjs +3 -3
  39. package/dist/popover/index.mjs +2 -2
  40. package/dist/progress-tracker/index.mjs +1 -1
  41. package/dist/radio-group/index.js +1 -1
  42. package/dist/radio-group/index.js.map +1 -1
  43. package/dist/radio-group/index.mjs +7 -7
  44. package/dist/radio-group/index.mjs.map +1 -1
  45. package/dist/rating/index.mjs +1 -1
  46. package/dist/rating-display/index.mjs +2 -2
  47. package/dist/scrolling-list/index.mjs +6 -6
  48. package/dist/select/index.mjs +1 -1
  49. package/dist/skeleton/index.mjs +1 -1
  50. package/dist/slider/index.mjs +9 -9
  51. package/dist/slot/index.mjs +1 -1
  52. package/dist/snackbar/index.mjs +3 -3
  53. package/dist/spinner/index.mjs +1 -1
  54. package/dist/stepper/index.mjs +2 -2
  55. package/dist/switch/index.mjs +1 -1
  56. package/dist/tabs/index.mjs +3 -3
  57. package/dist/tag/index.mjs +3 -3
  58. package/dist/text-link/index.mjs +1 -1
  59. package/dist/toast/index.mjs +10 -10
  60. package/dist/{useRenderSlot-LwWj8QbC.mjs → useRenderSlot-Bta2kdp4.mjs} +2 -2
  61. package/dist/{useRenderSlot-LwWj8QbC.mjs.map → useRenderSlot-Bta2kdp4.mjs.map} +1 -1
  62. package/dist/visually-hidden/index.mjs +1 -1
  63. package/package.json +4 -4
@@ -1,26 +1,26 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { cx as t } from "class-variance-authority";
3
- import { a as s } from "../Slot-D2Bbf8Gw.mjs";
4
- const l = ({ className: e, asChild: o, ref: a, ...n }) => /* @__PURE__ */ i(
3
+ import { S as s } from "../Slot-DLY1rJrG.mjs";
4
+ const l = ({ className: e, asChild: o, ref: n, ...a }) => /* @__PURE__ */ i(
5
5
  o ? s : "div",
6
6
  {
7
- ref: a,
7
+ ref: n,
8
8
  "data-spark-component": "link-box",
9
9
  className: t("default:relative", e),
10
- ...n
10
+ ...a
11
11
  }
12
12
  );
13
13
  l.displayName = "LinkBox";
14
- const k = ({ className: e, asChild: o, ref: a, ...n }) => /* @__PURE__ */ i(
14
+ const k = ({ className: e, asChild: o, ref: n, ...a }) => /* @__PURE__ */ i(
15
15
  o ? s : "a",
16
16
  {
17
- ref: a,
17
+ ref: n,
18
18
  "data-spark-component": "link-box-link",
19
19
  className: t(
20
20
  "before:z-base static before:absolute before:top-0 before:left-0 before:block before:size-full before:content-['']",
21
21
  e
22
22
  ),
23
- ...n
23
+ ...a
24
24
  }
25
25
  );
26
26
  k.displayName = "LinkBox.Link";
@@ -4,9 +4,9 @@ import { useMachine as w, normalizeProps as D, mergeProps as u } from "@zag-js/r
4
4
  import { createContext as F, useId as A, useContext as E } from "react";
5
5
  import { cx as R } from "class-variance-authority";
6
6
  import { ArrowDoubleLeft as j } from "@spark-ui/icons/ArrowDoubleLeft";
7
- import { I as h } from "../Icon-Ck-dhfLd.mjs";
8
- import { I as P } from "../IconButton-C62-axzv.mjs";
9
- import { B as L } from "../Button-C3C0aixy.mjs";
7
+ import { I as h } from "../Icon-C23-htlD.mjs";
8
+ import { I as P } from "../IconButton-Bfd-6BAD.mjs";
9
+ import { B as L } from "../Button-DPncfbbM.mjs";
10
10
  import { ArrowDoubleRight as z } from "@spark-ui/icons/ArrowDoubleRight";
11
11
  import { ArrowVerticalRight as B } from "@spark-ui/icons/ArrowVerticalRight";
12
12
  import { ArrowVerticalLeft as $ } from "@spark-ui/icons/ArrowVerticalLeft";
@@ -3,8 +3,8 @@ import { Popover as i } from "radix-ui";
3
3
  import { createContext as V, useState as W, useContext as j, useId as R, useLayoutEffect as D } from "react";
4
4
  import { cva as P, cx as x } from "class-variance-authority";
5
5
  import { Close as F } from "@spark-ui/icons/Close";
6
- import { I as L } from "../Icon-Ck-dhfLd.mjs";
7
- import { I as O } from "../IconButton-C62-axzv.mjs";
6
+ import { I as L } from "../Icon-C23-htlD.mjs";
7
+ import { I as O } from "../IconButton-Bfd-6BAD.mjs";
8
8
  const y = V(null), S = ":popover", X = ({
9
9
  children: e,
10
10
  intent: o
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as j, Fragment as O } from "react/jsx-runtime";
2
2
  import { cx as y, cva as x } from "class-variance-authority";
3
3
  import { createContext as S, useContext as P, useState as $, useId as A, useEffect as E } from "react";
4
4
  import { Check as F } from "@spark-ui/icons/Check";
5
- import { I as M } from "../Icon-Ck-dhfLd.mjs";
5
+ import { I as M } from "../Icon-C23-htlD.mjs";
6
6
  const R = y([
7
7
  "flex flex-nowrap items-start group/list",
8
8
  "data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:w-full",
@@ -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"),p=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"],basic:["after:bg-basic"],neutral:["after:bg-neutral"],success:["after:bg-success"],alert:["after:bg-alert"],error:["after:bg-error"],info:["after:bg-info"]})},defaultVariants:{intent:"basic"}}),I=({intent:e,className:r,ref:t,...o})=>a.jsx(p.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"],basic:["border-outline","data-[state=checked]:border-basic","hover:ring-basic-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:"basic"}}),j=({intent:e,className:r,ref:t,...o})=>{const{state:i}=G.useFormFieldControl(),n=i??e;return a.jsx(p.RadioGroup.RadioGroupItem,{"data-spark-component":"radio-input",ref:t,className:L({intent:n,className:r}),...o,children:a.jsx(I,{intent:n,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(p.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:i,...n})=>{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}),b=a.jsx(j,{ref:i,id:t||c,intent:f,"aria-labelledby":r?l:void 0,...n,disabled:o}),h=R?a.jsxs(a.Fragment,{children:[u,b]}):a.jsxs(a.Fragment,{children:[b,u]});return a.jsx("div",{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 i=s.useMemo(()=>({intent:e,disabled:r,reverse:t}),[e,r,t]);return a.jsx(k.Provider,{value:i,children:o})},q=({orientation:e="vertical",loop:r=!0,intent:t="basic",disabled:o,className:i,required:n,reverse:c=!1,ref:l,...f})=>{const{labelId:m,isInvalid:R,isRequired:u,description:b,name:h}=G.useFormFieldControl(),g=n!==void 0?n:u;return a.jsx(S,{reverse:c,intent:t,disabled:o,children:a.jsx(p.RadioGroup.RadioGroup,{"data-spark-component":"radio-group",className:C({orientation:e,className:i}),name:h,ref:l,disabled:o,orientation:e,loop:r,required:g,"aria-labelledby":m,"aria-invalid":R,"aria-required":g,"aria-describedby":b,...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"),d=require("class-variance-authority"),s=require("react"),G=require("@spark-ui/components/form-field"),p=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"],basic:["after:bg-basic"],neutral:["after:bg-neutral"],success:["after:bg-success"],alert:["after:bg-alert"],error:["after:bg-error"],info:["after:bg-info"]})},defaultVariants:{intent:"basic"}}),I=({intent:e,className:r,ref:t,...o})=>a.jsx(p.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"],basic:["border-outline","data-[state=checked]:border-basic","hover:ring-basic-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:"basic"}}),j=({intent:e,className:r,ref:t,...o})=>{const{state:i}=G.useFormFieldControl(),n=i??e;return a.jsx(p.RadioGroup.RadioGroupItem,{"data-spark-component":"radio-input",ref:t,className:L({intent:n,className:r}),...o,children:a.jsx(I,{intent:n,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(p.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:i,...n})=>{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}),b=a.jsx(j,{ref:i,id:t||c,intent:f,"aria-labelledby":r?l:void 0,...n,disabled:o}),h=R?a.jsxs(a.Fragment,{children:[u,b]}):a.jsxs(a.Fragment,{children:[b,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 i=s.useMemo(()=>({intent:e,disabled:r,reverse:t}),[e,r,t]);return a.jsx(k.Provider,{value:i,children:o})},q=({orientation:e="vertical",loop:r=!0,intent:t="basic",disabled:o,className:i,required:n,reverse:c=!1,ref:l,...f})=>{const{labelId:m,isInvalid:R,isRequired:u,description:b,name:h}=G.useFormFieldControl(),g=n!==void 0?n:u;return a.jsx(S,{reverse:c,intent:t,disabled:o,children:a.jsx(p.RadioGroup.RadioGroup,{"data-spark-component":"radio-group",className:C({orientation:e,className:i}),name:h,ref:l,disabled:o,orientation:e,loop:r,required:g,"aria-labelledby":m,"aria-invalid":R,"aria-required":g,"aria-describedby":b,...f})})};q.displayName="RadioGroup";const F=Object.assign(q,{Radio:v});F.displayName="RadioGroup";v.displayName="RadioGroup.Radio";exports.RadioGroup=F;
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', 'basic', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n basic: ['after:bg-basic'],\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: 'basic',\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', 'basic', '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 basic: [\n 'border-outline',\n 'data-[state=checked]:border-basic',\n 'hover:ring-basic-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: 'basic',\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 <div className={cx('gap-md text-body-1 flex items-start', className)}>{content}</div>\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 = 'basic',\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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B,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/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', 'basic', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n basic: ['after:bg-basic'],\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: 'basic',\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', 'basic', '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 basic: [\n 'border-outline',\n 'data-[state=checked]:border-basic',\n 'hover:ring-basic-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: 'basic',\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 = 'basic',\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,MAAO,CAAC,gBAAgB,EACxB,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,OAAA,CACV,CAEJ,ECpBaC,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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,EAAU,QAAAU,CAAA,GAAY,CAACvB,EAAQa,EAAUU,CAAO,CAAC,EAExF,OAAOnB,EAAAA,IAACb,EAAkB,SAAlB,CAA2B,MAAAyC,EAAe,SAAAf,CAAA,CAAS,CAC7D,ECsCaiB,EAAa,CAAC,CACzB,YAAAC,EAAc,WACd,KAAAC,EAAO,GACP,OAAApC,EAAS,QACT,SAAAa,EACA,UAAAZ,EACA,SAAUoC,EACV,QAAAd,EAAU,GACV,IAAArB,EACA,GAAGC,CACL,IAAuB,CACrB,KAAM,CAAE,QAAAmC,EAAS,UAAAC,EAAW,WAAAC,EAAY,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,4 +1,4 @@
1
- import { jsx as o, jsxs as g, Fragment as G } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as v, Fragment as G } from "react/jsx-runtime";
2
2
  import { cva as u, cx as F } from "class-variance-authority";
3
3
  import { createContext as V, useContext as j, useId as k, useMemo as C } from "react";
4
4
  import { useFormFieldControl as y } from "@spark-ui/components/form-field";
@@ -154,14 +154,14 @@ const x = ":radio", R = ({
154
154
  ...n,
155
155
  disabled: t
156
156
  }
157
- ), m = f ? /* @__PURE__ */ g(G, { children: [
157
+ ), m = f ? /* @__PURE__ */ v(G, { children: [
158
158
  c,
159
159
  l
160
- ] }) : /* @__PURE__ */ g(G, { children: [
160
+ ] }) : /* @__PURE__ */ v(G, { children: [
161
161
  l,
162
162
  c
163
163
  ] });
164
- return /* @__PURE__ */ o("div", { className: F("gap-md text-body-1 flex items-start", e), children: m });
164
+ return /* @__PURE__ */ o("span", { className: F("gap-md text-body-1 flex items-start", e), children: m });
165
165
  };
166
166
  R.displayName = "RadioGroup.Radio";
167
167
  const O = u(["flex"], {
@@ -190,7 +190,7 @@ const O = u(["flex"], {
190
190
  ref: d,
191
191
  ...b
192
192
  }) => {
193
- const { labelId: p, isInvalid: f, isRequired: c, description: l, name: m } = y(), v = n !== void 0 ? n : c;
193
+ const { labelId: p, isInvalid: f, isRequired: c, description: l, name: m } = y(), g = n !== void 0 ? n : c;
194
194
  return /* @__PURE__ */ o(P, { reverse: s, intent: a, disabled: t, children: /* @__PURE__ */ o(
195
195
  h.RadioGroup,
196
196
  {
@@ -201,10 +201,10 @@ const O = u(["flex"], {
201
201
  disabled: t,
202
202
  orientation: e,
203
203
  loop: r,
204
- required: v,
204
+ required: g,
205
205
  "aria-labelledby": p,
206
206
  "aria-invalid": f,
207
- "aria-required": v,
207
+ "aria-required": g,
208
208
  "aria-describedby": l,
209
209
  ...b
210
210
  }
@@ -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', 'basic', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n basic: ['after:bg-basic'],\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: 'basic',\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', 'basic', '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 basic: [\n 'border-outline',\n 'data-[state=checked]:border-basic',\n 'hover:ring-basic-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: 'basic',\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 <div className={cx('gap-md text-body-1 flex items-start', className)}>{content}</div>\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 = 'basic',\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;AA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Indicator.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', 'basic', 'success', 'alert', 'error', 'info', 'neutral']\n >({\n main: ['after:bg-main'],\n support: ['after:bg-support'],\n accent: ['after:bg-accent'],\n basic: ['after:bg-basic'],\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: 'basic',\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', 'basic', '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 basic: [\n 'border-outline',\n 'data-[state=checked]:border-basic',\n 'hover:ring-basic-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: 'basic',\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 = 'basic',\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,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AAkBF;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;"}
@@ -5,7 +5,7 @@ import { useState as _, useRef as Y, useId as Z, useCallback as j } from "react"
5
5
  import { useFormFieldControl as ee } from "../form-field/index.mjs";
6
6
  import { StarFill as ae } from "@spark-ui/icons/StarFill";
7
7
  import { StarOutline as te } from "@spark-ui/icons/StarOutline";
8
- import { I as q } from "../Icon-Ck-dhfLd.mjs";
8
+ import { I as q } from "../Icon-C23-htlD.mjs";
9
9
  const re = S("[&_>_div]:peer-hover:w-0!"), se = L(["peer after:inset-0 group relative after:block after:absolute"], {
10
10
  variants: {
11
11
  disabled: {
@@ -1,10 +1,10 @@
1
1
  import { jsx as s, jsxs as x } from "react/jsx-runtime";
2
- import { a as N } from "../Slot-D2Bbf8Gw.mjs";
2
+ import { S as N } from "../Slot-DLY1rJrG.mjs";
3
3
  import { createContext as V, useContext as z } from "react";
4
4
  import { cva as c, cx as v } from "class-variance-authority";
5
5
  import { StarFill as b } from "@spark-ui/icons/StarFill";
6
6
  import { StarOutline as h } from "@spark-ui/icons/StarOutline";
7
- import { I as y } from "../Icon-Ck-dhfLd.mjs";
7
+ import { I as y } from "../Icon-C23-htlD.mjs";
8
8
  const R = V(null), C = ({
9
9
  value: t,
10
10
  size: a,
@@ -1,14 +1,14 @@
1
1
  import { jsxs as V, jsx as c } from "react/jsx-runtime";
2
2
  import { useScrollOverflow as D } from "@spark-ui/hooks/use-scroll-overflow";
3
3
  import { cx as u } from "class-variance-authority";
4
- import { createContext as $, useRef as b, useCallback as j, useEffect as S, useLayoutEffect as K, useState as H, useContext as m, Children as W, cloneElement as q, isValidElement as G } from "react";
4
+ import { createContext as $, useRef as b, useCallback as j, useEffect as S, useLayoutEffect as K, useState as H, useContext as m, Children as W, isValidElement as q, cloneElement as G } from "react";
5
5
  import { useSnapCarousel as J } from "react-snap-carousel";
6
- import { a as M } from "../Slot-D2Bbf8Gw.mjs";
6
+ import { S as M } from "../Slot-DLY1rJrG.mjs";
7
7
  import { ArrowVerticalRight as Q } from "@spark-ui/icons/ArrowVerticalRight";
8
- import { I as P } from "../Icon-Ck-dhfLd.mjs";
9
- import { I as L } from "../IconButton-C62-axzv.mjs";
8
+ import { I as P } from "../Icon-C23-htlD.mjs";
9
+ import { I as L } from "../IconButton-Bfd-6BAD.mjs";
10
10
  import { ArrowVerticalLeft as U } from "@spark-ui/icons/ArrowVerticalLeft";
11
- import { B as X } from "../Button-C3C0aixy.mjs";
11
+ import { B as X } from "../Button-DPncfbbM.mjs";
12
12
  const d = $(
13
13
  null
14
14
  ), N = ({
@@ -189,7 +189,7 @@ const B = ({ children: s, ref: l, className: e = "", ...i }) => {
189
189
  ...i,
190
190
  children: W.map(
191
191
  s,
192
- (t, f) => G(t) ? q(t, { index: f }) : t
192
+ (t, f) => q(t) ? G(t, { index: f }) : t
193
193
  )
194
194
  }
195
195
  );
@@ -3,7 +3,7 @@ import { useFormFieldControl as de } from "@spark-ui/components/form-field";
3
3
  import { useCombinedState as ue } from "@spark-ui/hooks/use-combined-state";
4
4
  import { Children as A, isValidElement as D, createContext as $, useState as f, useId as me, useEffect as g, useContext as R } from "react";
5
5
  import { cx as C, cva as U } from "class-variance-authority";
6
- import { I as H } from "../Icon-Ck-dhfLd.mjs";
6
+ import { I as H } from "../Icon-C23-htlD.mjs";
7
7
  import { ArrowHorizontalDown as pe } from "@spark-ui/icons/ArrowHorizontalDown";
8
8
  const fe = (e) => (t) => A.toArray(e).filter(D).find((l) => w(l)?.includes(t)), w = (e) => e ? e.type.displayName : "", X = (e, t = []) => (A.forEach(e, (s) => {
9
9
  if (D(s)) {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as h, jsx as l } from "react/jsx-runtime";
2
- import { V as u } from "../VisuallyHidden-KH1biLx-.mjs";
2
+ import { V as u } from "../VisuallyHidden-DjlV0-CW.mjs";
3
3
  import { cva as i } from "class-variance-authority";
4
4
  const f = i([], {
5
5
  variants: {
@@ -6,7 +6,7 @@ import { cva as L, cx as k } from "class-variance-authority";
6
6
  import { useMergeRefs as M } from "@spark-ui/hooks/use-merge-refs";
7
7
  import { F as ae } from "../FormFieldRequiredIndicator-DTnCGiX2.mjs";
8
8
  import { Label as ne } from "../label/index.mjs";
9
- import { S as oe } from "../Slot-D2Bbf8Gw.mjs";
9
+ import { a as oe } from "../Slot-DLY1rJrG.mjs";
10
10
  const se = L([
11
11
  "grid grid-cols-[1fr_auto] gap-y-sm gap-x-md relative",
12
12
  "touch-none select-none",
@@ -27,7 +27,7 @@ const se = L([
27
27
  max: m = 100,
28
28
  ...g
29
29
  }) => {
30
- const s = P(), h = s.disabled ?? b, p = s.readOnly ?? v, S = s.name ?? n, [y, x] = R(s.labelId), [V, C] = R(0), z = T(null), Q = T(null), U = F((d) => {
30
+ const s = P(), h = s.disabled ?? b, p = s.readOnly ?? v, y = s.name ?? n, [S, x] = R(s.labelId), [V, C] = R(0), z = T(null), Q = T(null), U = F((d) => {
31
31
  x(d);
32
32
  }, []), Y = F(() => (C((d) => d + 1), () => C((d) => d - 1)), []);
33
33
  return /* @__PURE__ */ c(
@@ -37,7 +37,7 @@ const se = L([
37
37
  intent: t,
38
38
  min: u,
39
39
  max: m,
40
- fieldLabelId: s.labelId || y,
40
+ fieldLabelId: s.labelId || S,
41
41
  fieldId: s.id,
42
42
  onLabelId: U,
43
43
  hasValueInThumb: V > 0,
@@ -54,7 +54,7 @@ const se = L([
54
54
  orientation: "horizontal",
55
55
  disabled: h || p,
56
56
  thumbAlignment: "edge",
57
- name: S,
57
+ name: y,
58
58
  "aria-describedby": s.description,
59
59
  "aria-invalid": s.isInvalid,
60
60
  "aria-disabled": h || p ? !0 : void 0,
@@ -142,7 +142,7 @@ const de = ":slider-label", q = ({
142
142
  ref: b,
143
143
  ...v
144
144
  }) => {
145
- const n = P(), { fieldLabelId: i, fieldId: f, onLabelId: u } = I(), m = te(), g = `${de}-${m}`, s = e || i || n.labelId || g, h = l ? void 0 : t || f || n.id, p = n.disabled, S = n.isRequired, y = T(null), x = M(b, y);
145
+ const n = P(), { fieldLabelId: i, fieldId: f, onLabelId: u } = I(), m = te(), g = `${de}-${m}`, s = e || i || n.labelId || g, h = l ? void 0 : t || f || n.id, p = n.disabled, y = n.isRequired, S = T(null), x = M(b, S);
146
146
  return D(() => {
147
147
  u && !i && !n.labelId && u(s);
148
148
  }, [u, i, n.labelId, s]), /* @__PURE__ */ c(
@@ -157,7 +157,7 @@ const de = ":slider-label", q = ({
157
157
  ...v,
158
158
  children: /* @__PURE__ */ Z(ee, { children: [
159
159
  /* @__PURE__ */ c(oe, { children: a }),
160
- S && o
160
+ y && o
161
161
  ] })
162
162
  }
163
163
  );
@@ -272,7 +272,7 @@ function be(t, e, r, a) {
272
272
  requestAnimationFrame(m);
273
273
  return;
274
274
  }
275
- const S = h.left - s.left + h.width / 2, y = p / 2, x = s.width - p / 2, C = Math.max(y, Math.min(x, S)) - S;
275
+ const y = h.left - s.left + h.width / 2, S = p / 2, x = s.width - p / 2, C = Math.max(S, Math.min(x, y)) - y;
276
276
  l((z) => z !== C ? C : z);
277
277
  };
278
278
  m();
@@ -292,8 +292,8 @@ const B = ({ className: t, children: e, ref: r, ...a }) => {
292
292
  n ? "absolute left-1/2 -translate-x-1/2 top-[calc(-100%-var(--spacing-sm))] text-body-1 font-bold whitespace-nowrap" : "default:text-body-1 col-start-2 text-right default:font-bold",
293
293
  t
294
294
  ), h = F(
295
- (S, y) => {
296
- const x = S[0] ?? String(y[0] ?? ""), V = y[0] ?? 0;
295
+ (y, S) => {
296
+ const x = y[0] ?? String(S[0] ?? ""), V = S[0] ?? 0;
297
297
  return m(V), typeof e == "function" ? e(
298
298
  x,
299
299
  V
@@ -1,4 +1,4 @@
1
- import { a as l, S as t, w as r } from "../Slot-D2Bbf8Gw.mjs";
1
+ import { S as l, a as t, w as r } from "../Slot-DLY1rJrG.mjs";
2
2
  export {
3
3
  l as Slot,
4
4
  t as Slottable,
@@ -4,10 +4,10 @@ import { createContext as at, useContext as ot, useState as st, useRef as w, use
4
4
  import { createPortal as dt } from "react-dom";
5
5
  import { useToast as mt, useToastRegion as ut } from "@react-aria/toast";
6
6
  import { cva as B, cx as V } from "class-variance-authority";
7
- import { B as pt } from "../Button-C3C0aixy.mjs";
7
+ import { B as pt } from "../Button-DPncfbbM.mjs";
8
8
  import { Close as gt } from "@spark-ui/icons/Close";
9
- import { I as F } from "../Icon-Ck-dhfLd.mjs";
10
- import { I as bt } from "../IconButton-C62-axzv.mjs";
9
+ import { I as F } from "../Icon-C23-htlD.mjs";
10
+ import { I as bt } from "../IconButton-Bfd-6BAD.mjs";
11
11
  const ft = [
12
12
  {
13
13
  design: "filled",
@@ -1,4 +1,4 @@
1
- import { S as n } from "../Spinner-jF3-zoh_.mjs";
1
+ import { S as n } from "../Spinner-aLrtE2JN.mjs";
2
2
  export {
3
3
  n as Spinner
4
4
  };
@@ -7,8 +7,8 @@ import { useNumberFieldState as L } from "@react-stately/numberfield";
7
7
  import { useButton as B } from "@react-aria/button";
8
8
  import { Minus as M } from "@spark-ui/icons/Minus";
9
9
  import { Plus as T } from "@spark-ui/icons/Plus";
10
- import { I as P } from "../Icon-Ck-dhfLd.mjs";
11
- import { I as S } from "../IconButton-C62-axzv.mjs";
10
+ import { I as P } from "../Icon-C23-htlD.mjs";
11
+ import { I as S } from "../IconButton-Bfd-6BAD.mjs";
12
12
  import { useMergeRefs as V } from "@spark-ui/hooks/use-merge-refs";
13
13
  const W = ({
14
14
  inputRef: r,
@@ -6,7 +6,7 @@ import { useCombinedState as E } from "@spark-ui/hooks/use-combined-state";
6
6
  import { Check as G } from "@spark-ui/icons/Check";
7
7
  import { Close as P } from "@spark-ui/icons/Close";
8
8
  import { Switch as S } from "radix-ui";
9
- import { a as y } from "../Slot-D2Bbf8Gw.mjs";
9
+ import { S as y } from "../Slot-DLY1rJrG.mjs";
10
10
  import { tw as x, makeVariants as h } from "@spark-ui/internal-utils";
11
11
  import { Label as T } from "../label/index.mjs";
12
12
  const W = o(
@@ -4,11 +4,11 @@ import { createContext as E, useContext as A, useState as B, useRef as p, useEff
4
4
  import { cva as x, cx as J } from "class-variance-authority";
5
5
  import { ArrowVerticalLeft as Q } from "@spark-ui/icons/ArrowVerticalLeft";
6
6
  import { ArrowVerticalRight as U } from "@spark-ui/icons/ArrowVerticalRight";
7
- import { B as M } from "../Button-C3C0aixy.mjs";
8
- import { I as N } from "../Icon-Ck-dhfLd.mjs";
7
+ import { B as M } from "../Button-DPncfbbM.mjs";
8
+ import { I as N } from "../Icon-C23-htlD.mjs";
9
9
  import { useMergeRefs as j } from "@spark-ui/hooks/use-merge-refs";
10
10
  import { MoreMenuHorizontal as X } from "@spark-ui/icons/MoreMenuHorizontal";
11
- import { I as Y } from "../IconButton-C62-axzv.mjs";
11
+ import { I as Y } from "../IconButton-Bfd-6BAD.mjs";
12
12
  import { Popover as w } from "../popover/index.mjs";
13
13
  import { makeVariants as Z } from "@spark-ui/internal-utils";
14
14
  const D = E({}), L = () => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { a as g } from "../Slot-D2Bbf8Gw.mjs";
2
+ import { S as g } from "../Slot-DLY1rJrG.mjs";
3
3
  import { tw as t, makeVariants as n } from "@spark-ui/internal-utils";
4
4
  import { cva as u } from "class-variance-authority";
5
5
  const f = [
@@ -197,7 +197,7 @@ const f = [
197
197
  shape: "pill"
198
198
  }
199
199
  }
200
- ), j = ({
200
+ ), S = ({
201
201
  design: e = "filled",
202
202
  intent: s = "basic",
203
203
  size: i = "md",
@@ -222,6 +222,6 @@ const f = [
222
222
  }
223
223
  );
224
224
  export {
225
- j as Tag
225
+ S as Tag
226
226
  };
227
227
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,4 @@
1
- import { T as r } from "../TextLink-BuzFRWO6.mjs";
1
+ import { T as r } from "../TextLink-D7mOCjY_.mjs";
2
2
  export {
3
3
  r as TextLink
4
4
  };