@ngrok/mantle 0.73.1 → 0.73.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +1 -1
- package/dist/agent.json +1 -1
- package/dist/alert-dialog.d.ts +8 -8
- package/dist/alert.d.ts +3 -3
- package/dist/anchor.d.ts +1 -1
- package/dist/{as-child-C2PttRwz.d.ts → as-child-CpZKMqTE.d.ts} +1 -1
- package/dist/badge.d.ts +2 -2
- package/dist/{button-CoGmk7_d.d.ts → button-DbHFERMB.d.ts} +6 -6
- package/dist/button.d.ts +3 -3
- package/dist/card.d.ts +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/code-block.d.ts +3 -3
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code.d.ts +1 -1
- package/dist/color.d.ts +1 -1
- package/dist/combobox.d.ts +2 -2
- package/dist/command.d.ts +4 -4
- package/dist/data-table.d.ts +3 -3
- package/dist/{deep-non-nullable-CT7hWCFG.d.ts → deep-non-nullable-Xu7ckQM6.d.ts} +1 -1
- package/dist/description-list.d.ts +1 -1
- package/dist/dialog.d.ts +2 -2
- package/dist/{direction-CVntIxOS.d.ts → direction-D9IZ1wW6.d.ts} +1 -1
- package/dist/{dropdown-menu-DVvNlA72.d.ts → dropdown-menu-CvOiQUSZ.d.ts} +2 -2
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/empty.d.ts +2 -2
- package/dist/field-context-B7Z1cmZW.js +2 -0
- package/dist/field-context-B7Z1cmZW.js.map +1 -0
- package/dist/field.d.ts +161 -68
- package/dist/field.js +1 -1
- package/dist/field.js.map +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{icon-D_BMDi_q.d.ts → icon-BJ7q2RXZ.d.ts} +2 -2
- package/dist/{icon-button-Dty-yfE2.d.ts → icon-button-BDTb-lxs.d.ts} +3 -3
- package/dist/icon.d.ts +3 -3
- package/dist/icons.d.ts +3 -3
- package/dist/{in-view-DdIrfU4u.d.ts → in-view-BUgyu-Tk.d.ts} +1 -1
- package/dist/{in-view-BLZVEGFC.js → in-view-CeVqeGbv.js} +1 -1
- package/dist/{in-view-BLZVEGFC.js.map → in-view-CeVqeGbv.js.map} +1 -1
- package/dist/{index-TI92Xpg5.d.ts → index-BbZBDzPh.d.ts} +1 -1
- package/dist/{index-j46YISoN.d.ts → index-BhlxYL_y.d.ts} +1 -1
- package/dist/{index-DIBURJqf.d.ts → index-CWXKBva-.d.ts} +3 -3
- package/dist/{index-CVk4t5hk.d.ts → index-DS_4n2eb.d.ts} +1 -1
- package/dist/input.d.ts +4 -4
- package/dist/input.js +1 -1
- package/dist/{is-input-CEEoHxXN.js → is-input-CtUHJGgL.js} +1 -1
- package/dist/{is-input-CEEoHxXN.js.map → is-input-CtUHJGgL.js.map} +1 -1
- package/dist/llms.txt +1 -1
- package/dist/media-object.d.ts +1 -1
- package/dist/multi-select.d.ts +2 -2
- package/dist/multi-select.js +1 -1
- package/dist/multi-select.js.map +1 -1
- package/dist/otp-input.d.ts +2 -2
- package/dist/otp-input.js +1 -1
- package/dist/otp-input.js.map +1 -1
- package/dist/pagination.d.ts +3 -3
- package/dist/pagination.js +1 -1
- package/dist/{primitive-Ed9cel2r.d.ts → primitive-qkxTYBUY.d.ts} +1 -1
- package/dist/radio-group.d.ts +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/{resolve-pre-rendered-props-DxvamgE6.d.ts → resolve-pre-rendered-props-BONSCwYA.d.ts} +1 -1
- package/dist/sandboxed-on-click.d.ts +1 -1
- package/dist/select-B7orOUPj.js +2 -0
- package/dist/select-B7orOUPj.js.map +1 -0
- package/dist/{select-8ymlL8kC.d.ts → select-SZFFzYs0.d.ts} +3 -3
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/separator.d.ts +1 -1
- package/dist/sheet.d.ts +2 -2
- package/dist/slider.d.ts +17 -0
- package/dist/slider.js +1 -1
- package/dist/slider.js.map +1 -1
- package/dist/slot.d.ts +1 -1
- package/dist/split-button.d.ts +3 -3
- package/dist/{svg-only-CLbMy439.d.ts → svg-only-D4uqM1OC.d.ts} +2 -2
- package/dist/switch.d.ts +1 -1
- package/dist/{table-BWxS7pXj.d.ts → table-CjSQkfZe.d.ts} +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/{themes-f2W5S6xS.d.ts → themes-FPux5kIu.d.ts} +1 -1
- package/dist/toast.d.ts +3 -3
- package/dist/{types-DnghL1WE.d.ts → types-QKZ5fvaQ.d.ts} +1 -1
- package/dist/types.d.ts +5 -5
- package/dist/{use-prefers-reduced-motion-YUurmkwx.js → use-prefers-reduced-motion-Bpx8G3UT.js} +1 -1
- package/dist/{use-prefers-reduced-motion-YUurmkwx.js.map → use-prefers-reduced-motion-Bpx8G3UT.js.map} +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/dist/{validation-DF1z7YDr.d.ts → validation-CBSOmooP.d.ts} +1 -1
- package/dist/{variant-props-B4io4uA_.d.ts → variant-props-BZbM__kQ.d.ts} +2 -2
- package/dist/{with-style-props-CW8buMhK.d.ts → with-style-props-xzZLnIrF.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/select-BBB_e15a.js +0 -2
- package/dist/select-BBB_e15a.js.map +0 -1
package/dist/radio-group.d.ts
CHANGED
package/dist/radio-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./slot-D_ZUrdEW.js";import{t as n}from"./is-input-
|
|
1
|
+
import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./slot-D_ZUrdEW.js";import{t as n}from"./field-context-B7Z1cmZW.js";import{t as r}from"./is-input-CtUHJGgL.js";import{Children as i,cloneElement as a,createContext as o,forwardRef as s,isValidElement as c,useContext as l,useRef as u}from"react";import d from"clsx";import{Fragment as f,jsx as p}from"react/jsx-runtime";import{Radio as m,RadioGroup as h}from"@headlessui/react";const g=s((e,t)=>p(h,{"data-slot":`radio-group`,...e,ref:t}));g.displayName=`RadioGroup`;const _=o({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),v=s(({children:t,className:r,...i},a)=>{let o=l(n);return p(m,{"data-slot":`radio-group-item`,className:e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,r),as:`div`,...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:a,children:e=>p(_.Provider,{value:e,children:t})})});v.displayName=`RadioItem`;const y=({checked:t,disabled:n,focus:r,hover:i})=>p(`span`,{className:e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,n&&`cursor-default opacity-50`,t&&`border-accent-600 bg-accent-600`,r&&!n&&`border-accent-600 ring-focus-accent ring-4`,i&&`border-accent-600`),children:t&&p(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),b=({children:t,className:n,...r})=>{let i=l(_);return p(`div`,{"data-slot":`radio-group-indicator`,className:e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,n),...r,children:t==null?p(y,{...i}):typeof t==`function`?t(i):t})};b.displayName=`RadioIndicator`;const x=s(({className:e,...t},n)=>p(g,{"data-slot":`radio-group-list`,className:d(`-space-y-px`,e),...t,ref:n}));x.displayName=`RadioGroupList`;const S=s(({children:t,className:r,...i},a)=>{let o=l(n);return p(m,{as:`div`,"data-slot":`radio-group-list-item`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,r),ref:a,...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>p(f,{children:p(_.Provider,{value:e,children:t})})})});S.displayName=`RadioListItem`;const C=s(({children:e,className:t,...r},i)=>{let a=l(n);return p(m,{as:`div`,"data-slot":`radio-group-card`,className:d(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,t),...r,...a?{"aria-describedby":a[`aria-describedby`],"aria-errormessage":a[`aria-errormessage`],"aria-invalid":a[`aria-invalid`]}:void 0,ref:i,children:t=>p(f,{children:p(_.Provider,{value:t,children:e})})})});C.displayName=`RadioCard`;const w=({asChild:e=!1,children:n,className:r,...i})=>{let a=l(_);return p(e?t:`div`,{"data-slot":`radio-group-item-content`,className:d(`min-w-0 flex-1`,a.disabled&&`opacity-50`,r),...i,children:n})};w.displayName=`RadioItemContent`;const T=s(({className:e,...t},n)=>p(g,{"data-slot":`radio-group-button-group`,className:d(`flex flex-row flex-nowrap -space-x-px`,e),...t,ref:n}));T.displayName=`RadioButtonGroup`;const E=s(({children:t,className:r,...i},a)=>{let o=l(n);return p(m,{as:`div`,"data-slot":`radio-group-button`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,r),ref:a,...i,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>p(f,{children:p(_.Provider,{value:e,children:t})})})});E.displayName=`RadioButton`;const D=({children:e,onClick:t,onKeyDown:n,...o})=>{let s=u(null),d=l(_),f=i.only(e),m=d.disabled||!d.checked;return p(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:s,onKeyDown:e=>{if(d.disabled){e.stopPropagation(),e.preventDefault();return}switch(e.key){case`Enter`:case`Tab`:break;default:e.stopPropagation()}n?.(e)},onClick:e=>{if(d.disabled){e.stopPropagation(),e.preventDefault();return}let n=e.target;r(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...o,children:c(f)?a(f,{disabled:d.disabled||f.props.disabled,tabIndex:m?-1:f.props.tabIndex}):null})};D.displayName=`RadioInputSandbox`;const O={Button:E,ButtonGroup:T,Card:C,Indicator:b,InputSandbox:D,Item:v,ItemContent:w,List:x,ListItem:S,Root:g};export{O as RadioGroup};
|
|
2
2
|
//# sourceMappingURL=radio-group.js.map
|
package/dist/radio-group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":["HeadlessRadioGroup","HeadlessRadio","clsx"],"sources":["../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { Radio as HeadlessRadio, RadioGroup as HeadlessRadioGroup } from \"@headlessui/react\";\nimport type {\n\tRadioGroupProps as HeadlessRadioGroupProps,\n\tRadioProps as HeadlessRadioProps,\n} from \"@headlessui/react\";\nimport clsx from \"clsx\";\nimport {\n\tChildren,\n\tcloneElement,\n\tcreateContext,\n\tforwardRef,\n\tisValidElement,\n\tuseContext,\n\tuseRef,\n} from \"react\";\nimport type { ComponentRef, HTMLAttributes, PropsWithChildren, ReactNode } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { isInput } from \"../input/is-input.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype RadioGroupProps = PropsWithChildren<Omit<HeadlessRadioGroupProps, \"as\" | \"children\">>;\n\n/**\n * A group of radio items. It manages the state of the children radios. Unstyled and simple.\n * Used as the root component for grouping related radio items where only one can be selected.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogrouproot\n *\n * @example\n * ```tsx\n * <RadioGroup value={value} onValueChange={setValue}>\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * <RadioGroup.Item value=\"option2\">\n * <RadioGroup.Indicator />\n * <span>Option 2</span>\n * </RadioGroup.Item>\n * </RadioGroup>\n * ```\n */\nconst Root = forwardRef<ComponentRef<typeof HeadlessRadioGroup>, RadioGroupProps>((props, ref) => (\n\t<HeadlessRadioGroup data-slot=\"radio-group\" {...props} ref={ref} />\n));\nRoot.displayName = \"RadioGroup\";\n\n/**\n * The shape of the radio state context.\n */\ntype RadioStateContextValue = {\n\tautofocus: boolean;\n\tchecked: boolean;\n\tdisabled: boolean;\n\tfocus: boolean;\n\thover: boolean;\n};\n\n/**\n * The radio state. It's used to pass the state of the radio to its children components.\n * It's used internally by the radio components to manage the state/style of the radio items.\n * Used in place of css classes to avoid specificity issues and slightly improve performance.\n */\nconst RadioStateContext = createContext<RadioStateContextValue>({\n\tautofocus: false,\n\tchecked: false,\n\tdisabled: false,\n\tfocus: false,\n\thover: false,\n});\n\ntype RadioItemProps = Omit<HeadlessRadioProps, \"children\"> & PropsWithChildren;\n\n/**\n * A simple radio item that can be used inside a radio group. The \"conventional\" use-case.\n * Must be a child of `RadioGroup`.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogroupitem\n *\n * @example\n * ```tsx\n * <RadioGroup value={value} onValueChange={setValue}>\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * </RadioGroup>\n * ```\n */\nconst Item = forwardRef<ComponentRef<\"div\">, RadioItemProps>(\n\t({ children, className, ...props }, ref) => (\n\t\t<HeadlessRadio\n\t\t\tdata-slot=\"radio-group-item\"\n\t\t\tclassName={cx(\n\t\t\t\t\"group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tas=\"div\"\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t>\n\t\t\t{(ctx) => <RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>}\n\t\t</HeadlessRadio>\n\t),\n);\nItem.displayName = \"RadioItem\";\n\ntype RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\tchildren?: ReactNode | ((context: RadioStateContextValue) => ReactNode);\n};\n\n/**\n * The default radio indicator.\n * @private\n */\nconst DefaultRadioIndicator = ({ checked, disabled, focus, hover }: RadioStateContextValue) => (\n\t<span\n\t\tclassName={cx(\n\t\t\t\"border-form flex size-4 items-center justify-center rounded-full border shrink-0\",\n\t\t\tdisabled && \"cursor-default opacity-50\",\n\t\t\tchecked && \"border-accent-600 bg-accent-600\",\n\t\t\tfocus && !disabled && \"border-accent-600 ring-focus-accent ring-4\",\n\t\t\thover && \"border-accent-600\",\n\t\t)}\n\t>\n\t\t{checked && <span className=\"size-2 rounded-full bg-white shrink-0\" />}\n\t</span>\n);\n\n/**\n * The selection indicator for any radio item.\n * Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.\n * By default, it's a circle that changes color when checked.\n * You can customize the indicator by passing children:\n * - a different component\n * - a render-props function that receives the radio state context and should return a component.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogroupindicator\n *\n * @example\n * ```tsx\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * ```\n */\nconst Indicator = ({ children, className, ...props }: RadioIndicatorProps) => {\n\tconst ctx = useContext(RadioStateContext);\n\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"radio-group-indicator\"\n\t\t\tclassName={cx(\n\t\t\t\t\"radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children == null ? (\n\t\t\t\t<DefaultRadioIndicator {...ctx} />\n\t\t\t) : typeof children === \"function\" ? (\n\t\t\t\tchildren(ctx)\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</div>\n\t);\n};\nIndicator.displayName = \"RadioIndicator\";\n\n/**\n * A group of radio list items. Use RadioGroup.ListItem as direct children.\n */\nconst List = forwardRef<ComponentRef<typeof Root>, RadioGroupProps>(\n\t({ className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<Root\n\t\t\t\tdata-slot=\"radio-group-list\"\n\t\t\t\tclassName={clsx(\"-space-y-px\", className)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t);\n\t},\n);\nList.displayName = \"RadioGroupList\";\n\ntype RadioListItemProps = RadioItemProps;\n\n/**\n * A radio list item that is used inside a `RadioGroup.List`.\n */\nconst ListItem = forwardRef<ComponentRef<\"div\">, RadioListItemProps>(\n\t({ children, className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tas=\"div\"\n\t\t\t\tdata-slot=\"radio-group-list-item\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm\",\n\t\t\t\t\t\"cursor-pointer aria-disabled:cursor-default focus:outline-hidden\",\n\t\t\t\t\t\"focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4\",\n\t\t\t\t\t\"first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md\",\n\t\t\t\t\t\"aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600\",\n\t\t\t\t\t\"aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600\",\n\t\t\t\t\t\"has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{(ctx) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nListItem.displayName = \"RadioListItem\";\n\ntype RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;\n\ntype RadioCardProps = RadioItemProps;\n\n/**\n * A radio card item. Use it as a child of `RadioGroup`\n */\nconst Card = forwardRef<ComponentRef<\"div\">, RadioCardProps>(\n\t({ children, className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tas=\"div\"\n\t\t\t\tdata-slot=\"radio-group-card\"\n\t\t\t\tclassName={clsx(\n\t\t\t\t\t\"group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm\",\n\t\t\t\t\t\"cursor-pointer aria-disabled:cursor-default focus:outline-hidden\",\n\t\t\t\t\t\"focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4\",\n\t\t\t\t\t\"first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md\",\n\t\t\t\t\t\"aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600\",\n\t\t\t\t\t\"aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{(ctx) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nCard.displayName = \"RadioCard\";\n\n/**\n * The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.\n * Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.\n */\nconst ItemContent = ({ asChild = false, children, className, ...props }: RadioItemContentProps) => {\n\tconst ctx = useContext(RadioStateContext);\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tdata-slot=\"radio-group-item-content\"\n\t\t\tclassName={clsx(\"min-w-0 flex-1\", ctx.disabled && \"opacity-50\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\nItemContent.displayName = \"RadioItemContent\";\n\n/**\n * An inline group of radio buttons. Use RadioGroup.Button as direct children.\n */\nconst ButtonGroup = forwardRef<ComponentRef<typeof Root>, RadioGroupProps>(\n\t({ className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<Root\n\t\t\t\tdata-slot=\"radio-group-button-group\"\n\t\t\t\tclassName={clsx(\"flex flex-row flex-nowrap -space-x-px\", className)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t);\n\t},\n);\nButtonGroup.displayName = \"RadioButtonGroup\";\n\ntype RadioButtonProps = RadioItemProps;\n\n/**\n * A radio button that is used inside a `RadioGroup.ButtonGroup`.\n */\nconst Button = forwardRef<ComponentRef<\"div\">, RadioButtonProps>(\n\t({ children, className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tas=\"div\"\n\t\t\t\tdata-slot=\"radio-group-button\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm\",\n\t\t\t\t\t\"h-9\",\n\t\t\t\t\t\"focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4\",\n\t\t\t\t\t\"cursor-pointer aria-disabled:cursor-default focus:outline-hidden\",\n\t\t\t\t\t\"first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md\",\n\t\t\t\t\t\"not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50\",\n\t\t\t\t\t\"aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600\",\n\t\t\t\t\t\"has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{(ctx) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nButton.displayName = \"RadioButton\";\n\ntype RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * A sandbox container for input elements composed within radio group items.\n * It prevents the default behavior of the radio group when clicking on the input element or accepting keyboard input.\n */\nconst InputSandbox = ({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst ctx = useContext(RadioStateContext);\n\n\tconst singleChild = Children.only(children);\n\n\t// Prevent the child input from receiving focus when the parent radio group item is disabled or unchecked.\n\tconst shouldPreventTabIndex = ctx.disabled || !ctx.checked;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"none\"\n\t\t\tdata-slot=\"radio-group-input-sandbox\"\n\t\t\tref={ref}\n\t\t\tonKeyDown={(event) => {\n\t\t\t\tif (ctx.disabled) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tswitch (event.key) {\n\t\t\t\t\tcase \"Enter\":\n\t\t\t\t\tcase \"Tab\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\t\t\t\tonKeyDown?.(event);\n\t\t\t}}\n\t\t\tonClick={(event) => {\n\t\t\t\tif (ctx.disabled) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst target = event.target;\n\t\t\t\tif (isInput(target)) {\n\t\t\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t\t\ttarget.focus();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tonClick?.(event);\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isValidElement<HTMLInputElement>(singleChild)\n\t\t\t\t? cloneElement(singleChild, {\n\t\t\t\t\t\tdisabled: ctx.disabled || singleChild.props.disabled,\n\t\t\t\t\t\ttabIndex: shouldPreventTabIndex ? -1 : singleChild.props.tabIndex,\n\t\t\t\t\t})\n\t\t\t\t: null}\n\t\t</div>\n\t);\n};\nInputSandbox.displayName = \"RadioInputSandbox\";\n\n/**\n * A group of radio items. It manages the state of the children radios.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogrouproot\n *\n * @example\n * Composition:\n * ```\n * # Default radios\n * RadioGroup.Root\n * └── RadioGroup.Item\n * ├── RadioGroup.Indicator\n * └── RadioGroup.ItemContent\n *\n * # List layout with descriptions\n * RadioGroup.List\n * └── RadioGroup.ListItem\n * ├── RadioGroup.Indicator\n * └── RadioGroup.ItemContent\n *\n * # Segmented button group\n * RadioGroup.ButtonGroup\n * └── RadioGroup.Button\n *\n * # Card-style radios\n * RadioGroup.Root\n * └── RadioGroup.Card\n * └── RadioGroup.Indicator\n * ```\n *\n * @example\n * ```tsx\n * <RadioGroup value={value} onValueChange={setValue}>\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * <RadioGroup.Item value=\"option2\">\n * <RadioGroup.Indicator />\n * <span>Option 2</span>\n * </RadioGroup.Item>\n * </RadioGroup>\n * ```\n */\nconst RadioGroup = {\n\t/**\n\t * A radio button that is used inside a RadioGroup.ButtonGroup for inline grouped radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupbutton\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"option1\">\n\t * <RadioGroup.ButtonGroup>\n\t * <RadioGroup.Button value=\"option1\">Option 1</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"option2\">Option 2</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"option3\">Option 3</RadioGroup.Button>\n\t * </RadioGroup.ButtonGroup>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tButton,\n\t/**\n\t * An inline group of radio buttons. Use RadioGroup.Button as direct children for horizontal radio layouts.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupbuttongroup\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"small\">\n\t * <Label htmlFor=\"size-group\">Size</Label>\n\t * <RadioGroup.ButtonGroup>\n\t * <RadioGroup.Button value=\"small\">Small</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"medium\">Medium</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"large\">Large</RadioGroup.Button>\n\t * </RadioGroup.ButtonGroup>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tButtonGroup,\n\t/**\n\t * A radio card item with enhanced styling. Use it as a child of RadioGroup for card-based radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupcard\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"basic\">\n\t * <div className=\"space-y-3\">\n\t * <RadioGroup.Card value=\"basic\">\n\t * <RadioGroup.ItemContent>\n\t * <Text weight=\"strong\">Basic Plan</Text>\n\t * <Text>$10/month</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Card>\n\t * <RadioGroup.Card value=\"pro\">\n\t * <RadioGroup.ItemContent>\n\t * <Text weight=\"strong\">Pro Plan</Text>\n\t * <Text>$25/month</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Card>\n\t * </div>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tCard,\n\t/**\n\t * The selection indicator for any radio item. Shows the checked state with customizable appearance.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupindicator\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <span>Option 1</span>\n\t * </RadioGroup.Item>\n\t * ```\n\t */\n\tIndicator,\n\t/**\n\t * A sandbox container for input elements composed within radio group items. Prevents default radio behavior.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupinputsandbox\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"custom\">\n\t * <RadioGroup.Item value=\"custom\">\n\t * <RadioGroup.Indicator />\n\t * <RadioGroup.ItemContent>\n\t * <Text>Custom amount</Text>\n\t * <RadioGroup.InputSandbox>\n\t * <Input type=\"number\" placeholder=\"Enter amount\" />\n\t * </RadioGroup.InputSandbox>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Item>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tInputSandbox,\n\t/**\n\t * A simple radio item that can be used inside a radio group. The conventional use-case for basic radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <span>Option 1</span>\n\t * </RadioGroup.Item>\n\t * ```\n\t */\n\tItem,\n\t/**\n\t * The content wrapper for any radio item. Use it to wrap labels, descriptions, or content of a radio item.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupitemcontent\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"option1\">\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <RadioGroup.ItemContent>\n\t * <Text weight=\"strong\">Option 1</Text>\n\t * <Text size=\"sm\">Description for option 1</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Item>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tItemContent,\n\t/**\n\t * A group of radio list items with connected borders. Use RadioGroup.ListItem as direct children.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogrouplist\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"option1\">\n\t * <RadioGroup.List>\n\t * <RadioGroup.ListItem value=\"option1\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>Option 1</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * <RadioGroup.ListItem value=\"option2\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>Option 2</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * </RadioGroup.List>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tList,\n\t/**\n\t * A radio list item that is used inside a RadioGroup.List for connected list-style radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogrouplistitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"item1\">\n\t * <RadioGroup.List>\n\t * <RadioGroup.ListItem value=\"item1\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>List Item 1</Text>\n\t * <Text size=\"sm\" className=\"text-muted\">First option</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * <RadioGroup.ListItem value=\"item2\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>List Item 2</Text>\n\t * <Text size=\"sm\" className=\"text-muted\">Second option</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * </RadioGroup.List>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tListItem,\n\t/**\n\t * The root radio group component. Manages the state of the children radios where only one can be selected.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogrouproot\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root value={value} onValueChange={setValue}>\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <span>Option 1</span>\n\t * </RadioGroup.Item>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tRoot,\n} as const;\n\nexport {\n\t//\n\tRadioGroup,\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["HeadlessRadioGroup","HeadlessRadio","clsx"],"sources":["../src/components/radio-group/radio-group.tsx"],"sourcesContent":["\"use client\";\n\nimport { Radio as HeadlessRadio, RadioGroup as HeadlessRadioGroup } from \"@headlessui/react\";\nimport type {\n\tRadioGroupProps as HeadlessRadioGroupProps,\n\tRadioProps as HeadlessRadioProps,\n} from \"@headlessui/react\";\nimport clsx from \"clsx\";\nimport {\n\tChildren,\n\tcloneElement,\n\tcreateContext,\n\tforwardRef,\n\tisValidElement,\n\tuseContext,\n\tuseRef,\n} from \"react\";\nimport type { ComponentRef, HTMLAttributes, PropsWithChildren, ReactNode } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { FieldControlContext } from \"../field/field-context.js\";\nimport { isInput } from \"../input/is-input.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype RadioGroupProps = PropsWithChildren<Omit<HeadlessRadioGroupProps, \"as\" | \"children\">>;\n\n/**\n * A group of radio items. It manages the state of the children radios. Unstyled and simple.\n * Used as the root component for grouping related radio items where only one can be selected.\n *\n * The recommended Field composition is `Field.Set` + `Field.Legend` + `RadioGroup.Root`,\n * which uses fieldset semantics so all radios share a single accessible name from the\n * legend. As an alternative, when individual items render inside a `Field.Control`,\n * each item picks up `aria-invalid` and `aria-errormessage` from `FieldControlContext`.\n * Note: `aria-describedby` is owned by Headless UI's Radio primitive and does not\n * propagate through `FieldControlContext`, so helper text wired via `Field.Description`\n * will not be associated automatically in that alternative composition.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogrouproot\n *\n * @example\n * ```tsx\n * <RadioGroup value={value} onValueChange={setValue}>\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * <RadioGroup.Item value=\"option2\">\n * <RadioGroup.Indicator />\n * <span>Option 2</span>\n * </RadioGroup.Item>\n * </RadioGroup>\n * ```\n */\nconst Root = forwardRef<ComponentRef<typeof HeadlessRadioGroup>, RadioGroupProps>((props, ref) => (\n\t<HeadlessRadioGroup data-slot=\"radio-group\" {...props} ref={ref} />\n));\nRoot.displayName = \"RadioGroup\";\n\n/**\n * The shape of the radio state context.\n */\ntype RadioStateContextValue = {\n\tautofocus: boolean;\n\tchecked: boolean;\n\tdisabled: boolean;\n\tfocus: boolean;\n\thover: boolean;\n};\n\n/**\n * The radio state. It's used to pass the state of the radio to its children components.\n * It's used internally by the radio components to manage the state/style of the radio items.\n * Used in place of css classes to avoid specificity issues and slightly improve performance.\n */\nconst RadioStateContext = createContext<RadioStateContextValue>({\n\tautofocus: false,\n\tchecked: false,\n\tdisabled: false,\n\tfocus: false,\n\thover: false,\n});\n\ntype RadioItemProps = Omit<HeadlessRadioProps, \"children\"> & PropsWithChildren;\n\n/**\n * A simple radio item that can be used inside a radio group. The \"conventional\" use-case.\n * Must be a child of `RadioGroup`.\n *\n * When rendered inside `Field.Control` (an alternative to the recommended\n * `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and\n * `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned\n * by Headless UI's Radio primitive and does not propagate.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogroupitem\n *\n * @example\n * ```tsx\n * <RadioGroup value={value} onValueChange={setValue}>\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * </RadioGroup>\n * ```\n */\nconst Item = forwardRef<ComponentRef<\"div\">, RadioItemProps>(\n\t({ children, className, ...props }, ref) => {\n\t\tconst fieldControl = useContext(FieldControlContext);\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tdata-slot=\"radio-group-item\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tas=\"div\"\n\t\t\t\t{...props}\n\t\t\t\t{...(fieldControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t\"aria-describedby\": fieldControl[\"aria-describedby\"],\n\t\t\t\t\t\t\t\"aria-errormessage\": fieldControl[\"aria-errormessage\"],\n\t\t\t\t\t\t\t\"aria-invalid\": fieldControl[\"aria-invalid\"],\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined)}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{(ctx) => <RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nItem.displayName = \"RadioItem\";\n\ntype RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\tchildren?: ReactNode | ((context: RadioStateContextValue) => ReactNode);\n};\n\n/**\n * The default radio indicator.\n * @private\n */\nconst DefaultRadioIndicator = ({ checked, disabled, focus, hover }: RadioStateContextValue) => (\n\t<span\n\t\tclassName={cx(\n\t\t\t\"border-form flex size-4 items-center justify-center rounded-full border shrink-0\",\n\t\t\tdisabled && \"cursor-default opacity-50\",\n\t\t\tchecked && \"border-accent-600 bg-accent-600\",\n\t\t\tfocus && !disabled && \"border-accent-600 ring-focus-accent ring-4\",\n\t\t\thover && \"border-accent-600\",\n\t\t)}\n\t>\n\t\t{checked && <span className=\"size-2 rounded-full bg-white shrink-0\" />}\n\t</span>\n);\n\n/**\n * The selection indicator for any radio item.\n * Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.\n * By default, it's a circle that changes color when checked.\n * You can customize the indicator by passing children:\n * - a different component\n * - a render-props function that receives the radio state context and should return a component.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogroupindicator\n *\n * @example\n * ```tsx\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * ```\n */\nconst Indicator = ({ children, className, ...props }: RadioIndicatorProps) => {\n\tconst ctx = useContext(RadioStateContext);\n\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"radio-group-indicator\"\n\t\t\tclassName={cx(\n\t\t\t\t\"radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children == null ? (\n\t\t\t\t<DefaultRadioIndicator {...ctx} />\n\t\t\t) : typeof children === \"function\" ? (\n\t\t\t\tchildren(ctx)\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t</div>\n\t);\n};\nIndicator.displayName = \"RadioIndicator\";\n\n/**\n * A group of radio list items. Use RadioGroup.ListItem as direct children.\n */\nconst List = forwardRef<ComponentRef<typeof Root>, RadioGroupProps>(\n\t({ className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<Root\n\t\t\t\tdata-slot=\"radio-group-list\"\n\t\t\t\tclassName={clsx(\"-space-y-px\", className)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t);\n\t},\n);\nList.displayName = \"RadioGroupList\";\n\ntype RadioListItemProps = RadioItemProps;\n\n/**\n * A radio list item that is used inside a `RadioGroup.List`.\n *\n * When rendered inside `Field.Control` (an alternative to the recommended\n * `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and\n * `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned\n * by Headless UI's Radio primitive and does not propagate.\n */\nconst ListItem = forwardRef<ComponentRef<\"div\">, RadioListItemProps>(\n\t({ children, className, ...props }, ref) => {\n\t\tconst fieldControl = useContext(FieldControlContext);\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tas=\"div\"\n\t\t\t\tdata-slot=\"radio-group-list-item\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm\",\n\t\t\t\t\t\"cursor-pointer aria-disabled:cursor-default focus:outline-hidden\",\n\t\t\t\t\t\"focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4\",\n\t\t\t\t\t\"first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md\",\n\t\t\t\t\t\"aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600\",\n\t\t\t\t\t\"aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600\",\n\t\t\t\t\t\"has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t\t{...(fieldControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t\"aria-describedby\": fieldControl[\"aria-describedby\"],\n\t\t\t\t\t\t\t\"aria-errormessage\": fieldControl[\"aria-errormessage\"],\n\t\t\t\t\t\t\t\"aria-invalid\": fieldControl[\"aria-invalid\"],\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined)}\n\t\t\t>\n\t\t\t\t{(ctx) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nListItem.displayName = \"RadioListItem\";\n\ntype RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;\n\ntype RadioCardProps = RadioItemProps;\n\n/**\n * A radio card item. Use it as a child of `RadioGroup`\n *\n * When rendered inside `Field.Control` (an alternative to the recommended\n * `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and\n * `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned\n * by Headless UI's Radio primitive and does not propagate.\n */\nconst Card = forwardRef<ComponentRef<\"div\">, RadioCardProps>(\n\t({ children, className, ...props }, ref) => {\n\t\tconst fieldControl = useContext(FieldControlContext);\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tas=\"div\"\n\t\t\t\tdata-slot=\"radio-group-card\"\n\t\t\t\tclassName={clsx(\n\t\t\t\t\t\"group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm\",\n\t\t\t\t\t\"cursor-pointer aria-disabled:cursor-default focus:outline-hidden\",\n\t\t\t\t\t\"focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4\",\n\t\t\t\t\t\"first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md\",\n\t\t\t\t\t\"aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600\",\n\t\t\t\t\t\"aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t\t{...(fieldControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t\"aria-describedby\": fieldControl[\"aria-describedby\"],\n\t\t\t\t\t\t\t\"aria-errormessage\": fieldControl[\"aria-errormessage\"],\n\t\t\t\t\t\t\t\"aria-invalid\": fieldControl[\"aria-invalid\"],\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined)}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t{(ctx) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nCard.displayName = \"RadioCard\";\n\n/**\n * The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.\n * Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.\n */\nconst ItemContent = ({ asChild = false, children, className, ...props }: RadioItemContentProps) => {\n\tconst ctx = useContext(RadioStateContext);\n\tconst Component = asChild ? Slot : \"div\";\n\n\treturn (\n\t\t<Component\n\t\t\tdata-slot=\"radio-group-item-content\"\n\t\t\tclassName={clsx(\"min-w-0 flex-1\", ctx.disabled && \"opacity-50\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Component>\n\t);\n};\nItemContent.displayName = \"RadioItemContent\";\n\n/**\n * An inline group of radio buttons. Use RadioGroup.Button as direct children.\n */\nconst ButtonGroup = forwardRef<ComponentRef<typeof Root>, RadioGroupProps>(\n\t({ className, ...props }, ref) => {\n\t\treturn (\n\t\t\t<Root\n\t\t\t\tdata-slot=\"radio-group-button-group\"\n\t\t\t\tclassName={clsx(\"flex flex-row flex-nowrap -space-x-px\", className)}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t);\n\t},\n);\nButtonGroup.displayName = \"RadioButtonGroup\";\n\ntype RadioButtonProps = RadioItemProps;\n\n/**\n * A radio button that is used inside a `RadioGroup.ButtonGroup`.\n *\n * When rendered inside `Field.Control` (an alternative to the recommended\n * `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and\n * `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned\n * by Headless UI's Radio primitive and does not propagate.\n */\nconst Button = forwardRef<ComponentRef<\"div\">, RadioButtonProps>(\n\t({ children, className, ...props }, ref) => {\n\t\tconst fieldControl = useContext(FieldControlContext);\n\t\treturn (\n\t\t\t<HeadlessRadio\n\t\t\t\tas=\"div\"\n\t\t\t\tdata-slot=\"radio-group-button\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm\",\n\t\t\t\t\t\"h-9\",\n\t\t\t\t\t\"focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4\",\n\t\t\t\t\t\"cursor-pointer aria-disabled:cursor-default focus:outline-hidden\",\n\t\t\t\t\t\"first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md\",\n\t\t\t\t\t\"not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50\",\n\t\t\t\t\t\"aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600\",\n\t\t\t\t\t\"has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t\t{...(fieldControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t\"aria-describedby\": fieldControl[\"aria-describedby\"],\n\t\t\t\t\t\t\t\"aria-errormessage\": fieldControl[\"aria-errormessage\"],\n\t\t\t\t\t\t\t\"aria-invalid\": fieldControl[\"aria-invalid\"],\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined)}\n\t\t\t>\n\t\t\t\t{(ctx) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<RadioStateContext.Provider value={ctx}>{children}</RadioStateContext.Provider>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</HeadlessRadio>\n\t\t);\n\t},\n);\nButton.displayName = \"RadioButton\";\n\ntype RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * A sandbox container for input elements composed within radio group items.\n * It prevents the default behavior of the radio group when clicking on the input element or accepting keyboard input.\n */\nconst InputSandbox = ({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst ctx = useContext(RadioStateContext);\n\n\tconst singleChild = Children.only(children);\n\n\t// Prevent the child input from receiving focus when the parent radio group item is disabled or unchecked.\n\tconst shouldPreventTabIndex = ctx.disabled || !ctx.checked;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"none\"\n\t\t\tdata-slot=\"radio-group-input-sandbox\"\n\t\t\tref={ref}\n\t\t\tonKeyDown={(event) => {\n\t\t\t\tif (ctx.disabled) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tswitch (event.key) {\n\t\t\t\t\tcase \"Enter\":\n\t\t\t\t\tcase \"Tab\":\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\t\t\t\tonKeyDown?.(event);\n\t\t\t}}\n\t\t\tonClick={(event) => {\n\t\t\t\tif (ctx.disabled) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst target = event.target;\n\t\t\t\tif (isInput(target)) {\n\t\t\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\t\t\ttarget.focus();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tonClick?.(event);\n\t\t\t}}\n\t\t\t{...props}\n\t\t>\n\t\t\t{isValidElement<HTMLInputElement>(singleChild)\n\t\t\t\t? cloneElement(singleChild, {\n\t\t\t\t\t\tdisabled: ctx.disabled || singleChild.props.disabled,\n\t\t\t\t\t\ttabIndex: shouldPreventTabIndex ? -1 : singleChild.props.tabIndex,\n\t\t\t\t\t})\n\t\t\t\t: null}\n\t\t</div>\n\t);\n};\nInputSandbox.displayName = \"RadioInputSandbox\";\n\n/**\n * A group of radio items. It manages the state of the children radios.\n *\n * @see https://mantle.ngrok.com/components/radio-group#radiogrouproot\n *\n * @example\n * Composition:\n * ```\n * # Default radios\n * RadioGroup.Root\n * └── RadioGroup.Item\n * ├── RadioGroup.Indicator\n * └── RadioGroup.ItemContent\n *\n * # List layout with descriptions\n * RadioGroup.List\n * └── RadioGroup.ListItem\n * ├── RadioGroup.Indicator\n * └── RadioGroup.ItemContent\n *\n * # Segmented button group\n * RadioGroup.ButtonGroup\n * └── RadioGroup.Button\n *\n * # Card-style radios\n * RadioGroup.Root\n * └── RadioGroup.Card\n * └── RadioGroup.Indicator\n * ```\n *\n * @example\n * ```tsx\n * <RadioGroup value={value} onValueChange={setValue}>\n * <RadioGroup.Item value=\"option1\">\n * <RadioGroup.Indicator />\n * <span>Option 1</span>\n * </RadioGroup.Item>\n * <RadioGroup.Item value=\"option2\">\n * <RadioGroup.Indicator />\n * <span>Option 2</span>\n * </RadioGroup.Item>\n * </RadioGroup>\n * ```\n */\nconst RadioGroup = {\n\t/**\n\t * A radio button that is used inside a RadioGroup.ButtonGroup for inline grouped radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupbutton\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"option1\">\n\t * <RadioGroup.ButtonGroup>\n\t * <RadioGroup.Button value=\"option1\">Option 1</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"option2\">Option 2</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"option3\">Option 3</RadioGroup.Button>\n\t * </RadioGroup.ButtonGroup>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tButton,\n\t/**\n\t * An inline group of radio buttons. Use RadioGroup.Button as direct children for horizontal radio layouts.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupbuttongroup\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"small\">\n\t * <Label htmlFor=\"size-group\">Size</Label>\n\t * <RadioGroup.ButtonGroup>\n\t * <RadioGroup.Button value=\"small\">Small</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"medium\">Medium</RadioGroup.Button>\n\t * <RadioGroup.Button value=\"large\">Large</RadioGroup.Button>\n\t * </RadioGroup.ButtonGroup>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tButtonGroup,\n\t/**\n\t * A radio card item with enhanced styling. Use it as a child of RadioGroup for card-based radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupcard\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"basic\">\n\t * <div className=\"space-y-3\">\n\t * <RadioGroup.Card value=\"basic\">\n\t * <RadioGroup.ItemContent>\n\t * <Text weight=\"strong\">Basic Plan</Text>\n\t * <Text>$10/month</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Card>\n\t * <RadioGroup.Card value=\"pro\">\n\t * <RadioGroup.ItemContent>\n\t * <Text weight=\"strong\">Pro Plan</Text>\n\t * <Text>$25/month</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Card>\n\t * </div>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tCard,\n\t/**\n\t * The selection indicator for any radio item. Shows the checked state with customizable appearance.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupindicator\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <span>Option 1</span>\n\t * </RadioGroup.Item>\n\t * ```\n\t */\n\tIndicator,\n\t/**\n\t * A sandbox container for input elements composed within radio group items. Prevents default radio behavior.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupinputsandbox\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"custom\">\n\t * <RadioGroup.Item value=\"custom\">\n\t * <RadioGroup.Indicator />\n\t * <RadioGroup.ItemContent>\n\t * <Text>Custom amount</Text>\n\t * <RadioGroup.InputSandbox>\n\t * <Input type=\"number\" placeholder=\"Enter amount\" />\n\t * </RadioGroup.InputSandbox>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Item>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tInputSandbox,\n\t/**\n\t * A simple radio item that can be used inside a radio group. The conventional use-case for basic radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <span>Option 1</span>\n\t * </RadioGroup.Item>\n\t * ```\n\t */\n\tItem,\n\t/**\n\t * The content wrapper for any radio item. Use it to wrap labels, descriptions, or content of a radio item.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogroupitemcontent\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"option1\">\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <RadioGroup.ItemContent>\n\t * <Text weight=\"strong\">Option 1</Text>\n\t * <Text size=\"sm\">Description for option 1</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.Item>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tItemContent,\n\t/**\n\t * A group of radio list items with connected borders. Use RadioGroup.ListItem as direct children.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogrouplist\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"option1\">\n\t * <RadioGroup.List>\n\t * <RadioGroup.ListItem value=\"option1\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>Option 1</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * <RadioGroup.ListItem value=\"option2\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>Option 2</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * </RadioGroup.List>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tList,\n\t/**\n\t * A radio list item that is used inside a RadioGroup.List for connected list-style radio options.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogrouplistitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root defaultValue=\"item1\">\n\t * <RadioGroup.List>\n\t * <RadioGroup.ListItem value=\"item1\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>List Item 1</Text>\n\t * <Text size=\"sm\" className=\"text-muted\">First option</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * <RadioGroup.ListItem value=\"item2\">\n\t * <RadioGroup.ItemContent>\n\t * <Text>List Item 2</Text>\n\t * <Text size=\"sm\" className=\"text-muted\">Second option</Text>\n\t * </RadioGroup.ItemContent>\n\t * </RadioGroup.ListItem>\n\t * </RadioGroup.List>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tListItem,\n\t/**\n\t * The root radio group component. Manages the state of the children radios where only one can be selected.\n\t *\n\t * @see https://mantle.ngrok.com/components/radio-group#radiogrouproot\n\t *\n\t * @example\n\t * ```tsx\n\t * <RadioGroup.Root value={value} onValueChange={setValue}>\n\t * <RadioGroup.Item value=\"option1\">\n\t * <RadioGroup.Indicator />\n\t * <span>Option 1</span>\n\t * </RadioGroup.Item>\n\t * </RadioGroup.Root>\n\t * ```\n\t */\n\tRoot,\n} as const;\n\nexport {\n\t//\n\tRadioGroup,\n};\n"],"mappings":"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"}
|
package/dist/{resolve-pre-rendered-props-DxvamgE6.d.ts → resolve-pre-rendered-props-BONSCwYA.d.ts}
RENAMED
|
@@ -430,4 +430,4 @@ type ResolvePreRenderedCodeBlockPropsResult<T extends Record<string, unknown>> =
|
|
|
430
430
|
declare function resolvePreRenderedCodeBlockProps<T extends ResolvePreRenderedCodeBlockPropsInput & Record<string, unknown>>(input: T): ResolvePreRenderedCodeBlockPropsResult<T>;
|
|
431
431
|
//#endregion
|
|
432
432
|
export { FoldStrategy as A, computeJsonFoldRanges as B, Indentation as C, FoldExplanation as D, ComputeFoldRangesInput as E, isSupportedLanguage as F, finalizeFoldRanges as H, parseLanguage as I, supportedLanguages as L, computeFoldRanges as M, foldStrategyFor as N, FoldLine as O, SupportedLanguage as P, DecorateHighlightedHtmlInput as R, normalizeIndentation as S, isIndentation as T, LineRange as U, FoldableRange as V, MantleCodeBlockValue as _, Mode as a, defaultShowLineNumbers as b, ResolvedPreRenderedCodeBlockProps as c, parseMetastring as d, resolvePreRenderedCodeBlockProps as f, parseCodeBlockShowLineNumbers as g, parseCodeBlockLineNumberStart as h, MetaInput as i, FoldToken as j, FoldScope as k, defaultMeta as l, parseCodeBlockHighlightLines as m, DefaultMeta as n, ResolvePreRenderedCodeBlockPropsInput as o, tokenizeMetastring as p, Meta as r, ResolvePreRenderedCodeBlockPropsResult as s, CodeBlockPreElementInput as t, normalizeValue as u, MantleCodeOptions as v, inferIndentation as w, mantleCode as x, createMantleCodeBlockValue as y, decorateHighlightedHtml as z };
|
|
433
|
-
//# sourceMappingURL=resolve-pre-rendered-props-
|
|
433
|
+
//# sourceMappingURL=resolve-pre-rendered-props-BONSCwYA.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./icon-bWc5yC3-.js";import{t as n}from"./compose-refs-DZ3cPi47.js";import{a as r,r as i}from"./validation-BYME8rWN.js";import{n as a}from"./separator-awchG4LI.js";import{t as o}from"./field-context-B7Z1cmZW.js";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,forwardRef as l,useContext as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{CheckIcon as p}from"@phosphor-icons/react/Check";import{CaretUpIcon as m}from"@phosphor-icons/react/CaretUp";import*as h from"@radix-ui/react-select";const g=c({}),_=l(({"aria-invalid":e,children:t,id:n,validation:r,onBlur:i,onValueChange:a,onChange:o,...s},c)=>d(h.Root,{...s,onValueChange:e=>{o?.(e),a?.(e)},children:d(g.Provider,{value:{"aria-invalid":e,id:n,validation:r,onBlur:i,ref:c},children:t})}));_.displayName=`Select`;const v=l(({className:t,...n},r)=>d(h.Group,{ref:r,"data-slot":`select-group`,className:e(`space-y-px`,t),...n}));v.displayName=`SelectGroup`;const y=h.Value;y.displayName=`SelectValue`;const b=l(({"aria-invalid":a,className:c,children:l,id:p,validation:m,..._},v)=>{let y=u(g),b=u(o),x=r(),{ariaInvalid:S,validation:C}=i({"aria-invalid":b?b[`aria-invalid`]:y[`aria-invalid`]??a,validation:y.validation??m??x}),w=b?b.id:y.id??p;return f(h.Trigger,{"data-slot":`select-trigger`,className:e(`h-9 text-sm`,`border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,c),"data-validation":C||void 0,id:w,ref:n(v,y.ref),..._,...b?{"aria-describedby":b[`aria-describedby`],"aria-errormessage":b[`aria-errormessage`]}:void 0,"aria-invalid":S,children:[l,d(h.Icon,{asChild:!0,children:d(t,{svg:d(s,{weight:`bold`}),className:`size-4`})})]})});b.displayName=`SelectTrigger`;const x=l(({className:n,...r},i)=>d(h.ScrollUpButton,{ref:i,className:e(`flex cursor-default items-center justify-center py-1`,n),...r,children:d(t,{svg:d(m,{weight:`bold`}),className:`size-4`})}));x.displayName=`SelectScrollUpButton`;const S=l(({className:n,...r},i)=>d(h.ScrollDownButton,{ref:i,className:e(`flex cursor-default items-center justify-center py-1`,n),...r,children:d(t,{svg:d(s,{weight:`bold`}),className:`size-4`})}));S.displayName=`SelectScrollDownButton`;const C=l(({className:t,children:n,position:r=`popper`,width:i=`trigger`,...a},o)=>d(h.Portal,{children:f(h.Content,{ref:o,"data-slot":`select-content`,className:e(`border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,r===`popper`&&`data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)`,i===`trigger`&&`w-(--radix-select-trigger-width)`,t),position:r,...a,children:[d(x,{}),d(h.Viewport,{className:e(`p-1 space-y-px`,r===`popper`&&`h-(--radix-select-trigger-height) w-full`),children:n}),d(S,{})]})}));C.displayName=`SelectContent`;const w=l(({className:t,...n},r)=>d(h.Label,{ref:r,"data-slot":`select-label`,className:e(`px-2 py-1.5 text-sm font-medium`,t),...n}));w.displayName=`SelectLabel`;const T=l(({className:n,children:r,icon:i,...a},o)=>f(h.Item,{ref:o,"data-slot":`select-item`,className:e(`relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden`,`focus:bg-active-menu-item`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`data-state-checked:bg-selected-menu-item`,`focus:data-state-checked:bg-active-selected-menu-item`,n),...a,children:[i&&d(t,{svg:i}),d(h.ItemText,{children:r}),d(h.ItemIndicator,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:d(t,{svg:d(p,{weight:`bold`}),className:`size-4 text-accent-600`})})]}));T.displayName=`SelectItem`;const E=l(({className:t,...n},r)=>d(a,{ref:r,"data-slot":`select-separator`,className:e(`-mx-1 my-1 h-px w-auto`,t),...n}));E.displayName=`SelectSeparator`;const D={Root:_,Content:C,Group:v,Item:T,Label:w,Separator:E,Trigger:b,Value:y};export{D as t};
|
|
2
|
+
//# sourceMappingURL=select-B7orOUPj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-B7orOUPj.js","names":[],"sources":["../src/components/select/select.tsx"],"sourcesContent":["\"use client\";\n\nimport { CaretDownIcon } from \"@phosphor-icons/react/CaretDown\";\nimport { CaretUpIcon } from \"@phosphor-icons/react/CaretUp\";\nimport { CheckIcon } from \"@phosphor-icons/react/Check\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport type {\n\tComponentProps,\n\tComponentPropsWithoutRef,\n\tComponentRef,\n\tFocusEvent,\n\tPropsWithChildren,\n\tReactNode,\n\tRef,\n\tSelectHTMLAttributes,\n} from \"react\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport { composeRefs } from \"../../utils/compose-refs/compose-refs.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { FieldControlContext } from \"../field/field-context.js\";\nimport { parseValidation, useFieldValidation } from \"../field/validation.js\";\nimport type { WithValidation } from \"../field/validation.js\";\nimport { Icon } from \"../icon/icon.js\";\nimport { Separator } from \"../separator/separator.js\";\n\ntype WithAriaInvalid = Pick<SelectHTMLAttributes<HTMLSelectElement>, \"aria-invalid\">;\ntype SelectContextType = WithValidation &\n\tWithAriaInvalid & {\n\t\t/**\n\t\t * Ref for the trigger button.\n\t\t */\n\t\tref?: Ref<HTMLButtonElement>;\n\t\t/**\n\t\t * Event handler called when Select blurs.\n\t\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t\t */\n\t\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t} & Pick<ComponentProps<\"button\">, \"id\">;\n\nconst SelectContext = createContext<SelectContextType>({});\n\ntype SelectProps = PropsWithChildren & {\n\tautoComplete?: string;\n\tdefaultOpen?: boolean;\n\tdefaultValue?: string;\n\tdir?: \"ltr\" | \"rtl\";\n\tdisabled?: boolean;\n\tform?: string;\n\tid?: string;\n\tname?: string;\n\t/**\n\t * Event handler called when Select blurs.\n\t * @note this is a no-op for now until we can guarantee that it works identically to a native select onBlur\n\t */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Event handler called when the value changes.\n\t * @deprecated Use `onValueChange` instead.\n\t */\n\tonChange?: (value: string) => void;\n\tonOpenChange?(open: boolean): void;\n\tonValueChange?(value: string): void;\n\topen?: boolean;\n\trequired?: boolean;\n\tvalue?: string;\n} & WithValidation &\n\tWithAriaInvalid;\n\n/**\n * Displays a list of options for the user to pick from—triggered by a button.\n *\n * Use Select for a small, finite list of options (~2-15) where the user picks exactly one\n * and search/filtering is unnecessary. For larger lists or async/searchable data, use\n * Combobox. For picking multiple options, use MultiSelect.\n *\n * Pass `validation` here when the entire select has an explicit state. That\n * root state is forwarded to `Select.Trigger` and takes precedence over the\n * ambient `validation` from `Field.Item`. Note: rendered `Field.Errors` /\n * `Field.ErrorList` set `aria-invalid=\"true\"` on the trigger via\n * `Field.Control`'s wiring, which still forces the trigger into the error\n * state — suppress the inferred error by passing `validation` on `Field.Item`\n * if a non-error `Select.Root` state needs to win in that case.\n *\n * @see https://mantle.ngrok.com/components/select#selectroot\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Root = forwardRef<HTMLButtonElement, SelectProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\tchildren,\n\t\t\tid,\n\t\t\tvalidation,\n\t\t\tonBlur,\n\t\t\tonValueChange,\n\t\t\tonChange,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\treturn (\n\t\t\t<SelectPrimitive.Root\n\t\t\t\t{...props}\n\t\t\t\tonValueChange={(value) => {\n\t\t\t\t\tonChange?.(value);\n\t\t\t\t\tonValueChange?.(value);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<SelectContext.Provider\n\t\t\t\t\tvalue={{\n\t\t\t\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tvalidation,\n\t\t\t\t\t\tonBlur,\n\t\t\t\t\t\tref,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SelectContext.Provider>\n\t\t\t</SelectPrimitive.Root>\n\t\t);\n\t},\n);\nRoot.displayName = \"Select\";\n\n/**\n * A group of related options within a select menu. Similar to an html `<optgroup>` element.\n * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.\n *\n * @see https://mantle.ngrok.com/components/select#selectgroup\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Group = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Group>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Group>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Group\n\t\tref={ref}\n\t\tdata-slot=\"select-group\"\n\t\tclassName={cx(\"space-y-px\", className)}\n\t\t{...props}\n\t/>\n));\nGroup.displayName = \"SelectGroup\";\n\n/**\n * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.\n *\n * @see https://mantle.ngrok.com/components/select#selectvalue\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Value = SelectPrimitive.Value;\nValue.displayName = \"SelectValue\";\n\ntype SelectTriggerProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n\tWithAriaInvalid &\n\tWithValidation;\n\n/**\n * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.\n * When composing with `Field.Item`, wrap `Select.Root` in `Field.Control` —\n * the generated `id`, `name`, and `aria-invalid` flow onto `Select.Root` (so\n * the hidden form input gets the field name), and the trigger reads\n * `aria-describedby` / `aria-errormessage` from `FieldControlContext`.\n *\n * @see https://mantle.ngrok.com/components/select#selecttrigger\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Trigger = forwardRef<ComponentRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(\n\t(\n\t\t{\n\t\t\t\"aria-invalid\": ariaInValidProp,\n\t\t\tclassName,\n\t\t\tchildren,\n\t\t\tid: propId,\n\t\t\tvalidation: propValidation,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst ctx = useContext(SelectContext);\n\t\tconst fieldControl = useContext(FieldControlContext);\n\t\tconst fieldValidation = useFieldValidation();\n\t\tconst rawAriaInvalid = fieldControl\n\t\t\t? fieldControl[\"aria-invalid\"]\n\t\t\t: (ctx[\"aria-invalid\"] ?? ariaInValidProp);\n\t\t// Explicit Select props win over ambient Field validation. This lets\n\t\t// Field.Control override Field.Item while preserving Select.Root as the\n\t\t// highest-precedence select-level state.\n\t\tconst rawValidation = ctx.validation ?? propValidation ?? fieldValidation;\n\t\tconst { ariaInvalid, validation } = parseValidation({\n\t\t\t\"aria-invalid\": rawAriaInvalid,\n\t\t\tvalidation: rawValidation,\n\t\t});\n\t\tconst id = fieldControl ? fieldControl.id : (ctx.id ?? propId);\n\n\t\treturn (\n\t\t\t<SelectPrimitive.Trigger\n\t\t\t\tdata-slot=\"select-trigger\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"h-9 text-sm\",\n\t\t\t\t\t\"border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:text-left\",\n\t\t\t\t\t\"hover:border-neutral-400\",\n\t\t\t\t\t\"focus:outline-hidden focus:ring-4 aria-expanded:ring-4\",\n\t\t\t\t\t\"focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent\",\n\t\t\t\t\t\"data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success\",\n\t\t\t\t\t\"data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning\",\n\t\t\t\t\t\"data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-validation={validation || undefined}\n\t\t\t\tid={id}\n\t\t\t\tref={composeRefs(ref, ctx.ref)}\n\t\t\t\t{...props}\n\t\t\t\t{...(fieldControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t\"aria-describedby\": fieldControl[\"aria-describedby\"],\n\t\t\t\t\t\t\t\"aria-errormessage\": fieldControl[\"aria-errormessage\"],\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined)}\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t<SelectPrimitive.Icon asChild>\n\t\t\t\t\t<Icon svg={<CaretDownIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t\t\t</SelectPrimitive.Icon>\n\t\t\t</SelectPrimitive.Trigger>\n\t\t);\n\t},\n);\nTrigger.displayName = \"SelectTrigger\";\n\n/**\n * The button that scrolls the select content up.\n * @private\n */\nconst SelectScrollUpButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollUpButton\n\t\tref={ref}\n\t\tclassName={cx(\"flex cursor-default items-center justify-center py-1\", className)}\n\t\t{...props}\n\t>\n\t\t<Icon svg={<CaretUpIcon weight=\"bold\" />} className=\"size-4\" />\n\t</SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = \"SelectScrollUpButton\";\n\n/**\n * The button that scrolls the select content down.\n * @private\n */\nconst SelectScrollDownButton = forwardRef<\n\tComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.ScrollDownButton\n\t\tref={ref}\n\t\tclassName={cx(\"flex cursor-default items-center justify-center py-1\", className)}\n\t\t{...props}\n\t>\n\t\t<Icon svg={<CaretDownIcon weight=\"bold\" />} className=\"size-4\" />\n\t</SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName = \"SelectScrollDownButton\";\n\ntype SelectContentProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {\n\t/**\n\t * The width of the content. Defaults to the width of the trigger.\n\t * If set to \"content\", the content will use the intrinsic content width; it will be the width of the longest/widest item.\n\t * @default \"trigger\"\n\t */\n\twidth?: \"trigger\" | \"content\";\n};\n\n/**\n * The component that pops out when the select is open as a portal adjacent to the trigger button.\n * It contains a scrolling viewport of the select items.\n *\n * @see https://mantle.ngrok.com/components/select#selectcontent\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Content = forwardRef<ComponentRef<typeof SelectPrimitive.Content>, SelectContentProps>(\n\t({ className, children, position = \"popper\", width = \"trigger\", ...props }, ref) => (\n\t\t<SelectPrimitive.Portal>\n\t\t\t<SelectPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"select-content\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"border-popover data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md\",\n\t\t\t\t\t\"bg-popover font-sans\",\n\t\t\t\t\tposition === \"popper\" &&\n\t\t\t\t\t\t\"data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)\",\n\t\t\t\t\twidth === \"trigger\" && \"w-(--radix-select-trigger-width)\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tposition={position}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<SelectScrollUpButton />\n\t\t\t\t<SelectPrimitive.Viewport\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"p-1 space-y-px\",\n\t\t\t\t\t\tposition === \"popper\" && \"h-(--radix-select-trigger-height) w-full\",\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SelectPrimitive.Viewport>\n\t\t\t\t<SelectScrollDownButton />\n\t\t\t</SelectPrimitive.Content>\n\t\t</SelectPrimitive.Portal>\n\t),\n);\nContent.displayName = \"SelectContent\";\n\n/**\n * Used to render the label of a group. It won't be focusable using arrow keys.\n *\n * @see https://mantle.ngrok.com/components/select#selectlabel\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Label = forwardRef<\n\tComponentRef<typeof SelectPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tdata-slot=\"select-label\"\n\t\tclassName={cx(\"px-2 py-1.5 text-sm font-medium\", className)}\n\t\t{...props}\n\t/>\n));\nLabel.displayName = \"SelectLabel\";\n\ntype SelectItemProps = ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n\ticon?: ReactNode;\n};\n\n/**\n * An option within a select menu. Similar to an html `<option>` element.\n * Has a required `value` prop that will be passed to the `onChange` handler of the `Select` component when this item is selected.\n * Displays the children as the option's text.\n *\n * @see https://mantle.ngrok.com/components/select#selectitem\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Item = forwardRef<ComponentRef<typeof SelectPrimitive.Item>, SelectItemProps>(\n\t({ className, children, icon, ...props }, ref) => (\n\t\t<SelectPrimitive.Item\n\t\t\tref={ref}\n\t\t\tdata-slot=\"select-item\"\n\t\t\tclassName={cx(\n\t\t\t\t\"relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden\",\n\t\t\t\t\"focus:bg-active-menu-item\",\n\t\t\t\t\"data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\t\"data-state-checked:bg-selected-menu-item\",\n\t\t\t\t\"focus:data-state-checked:bg-active-selected-menu-item\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{icon && <Icon svg={icon} />}\n\t\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Icon svg={<CheckIcon weight=\"bold\" />} className=\"size-4 text-accent-600\" />\n\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t</SelectPrimitive.Item>\n\t),\n);\nItem.displayName = \"SelectItem\";\n\n/**\n * Used to visually separate items or groups of items in the select content.\n *\n * @see https://mantle.ngrok.com/components/select#selectseparator\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst SelectSeparatorComponent = forwardRef<\n\tComponentRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tdata-slot=\"select-separator\"\n\t\tclassName={cx(\"-mx-1 my-1 h-px w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nSelectSeparatorComponent.displayName = \"SelectSeparator\";\n\n/**\n * Displays a list of options for the user to pick from—triggered by a button.\n *\n * Use Select for a small, finite list of options (~2-15) where the user picks exactly one\n * and search/filtering is unnecessary. For larger lists or async/searchable data, use\n * Combobox. For picking multiple options, use MultiSelect.\n *\n * @see https://mantle.ngrok.com/components/select\n *\n * @example\n * Composition:\n * ```\n * Select.Root\n * ├── Select.Trigger\n * │ └── Select.Value\n * └── Select.Content\n * ├── Select.Group\n * │ ├── Select.Label\n * │ └── Select.Item\n * └── Select.Separator\n * ```\n *\n * @example\n * ```tsx\n * <Select.Root>\n * <Select.Trigger>\n * <Select.Value placeholder=\"Select a fruit\" />\n * </Select.Trigger>\n * <Select.Content>\n * <Select.Group>\n * <Select.Label>Fruits</Select.Label>\n * <Select.Item value=\"apple\">Apple</Select.Item>\n * <Select.Item value=\"banana\">Banana</Select.Item>\n * <Select.Item value=\"cherry\">Cherry</Select.Item>\n * </Select.Group>\n * <Select.Separator />\n * <Select.Group>\n * <Select.Label>Veggies</Select.Label>\n * <Select.Item value=\"carrot\">Carrot</Select.Item>\n * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n * </Select.Group>\n * </Select.Content>\n * </Select.Root>\n * ```\n */\nconst Select = {\n\t/**\n\t * Displays a list of options for the user to pick from—triggered by a button.\n\t *\n\t * Use Select for a small, finite list of options (~2-15) where the user picks exactly one\n\t * and search/filtering is unnecessary. For larger lists or async/searchable data, use\n\t * Combobox. For picking multiple options, use MultiSelect.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectroot\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The component that pops out when the select is open as a portal adjacent to the trigger button.\n\t * It contains a scrolling viewport of the select items.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectcontent\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * A group of related options within a select menu. Similar to an html `<optgroup>` element.\n\t * Use in conjunction with Select.Label to ensure good accessibility via automatic labelling.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectgroup\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tGroup,\n\t/**\n\t * An option within a select menu. Similar to an html `<option>` element.\n\t * Has a required `value` prop that will be passed to the `onChange` handler of the `Select` component when this item is selected.\n\t * Displays the children as the option's text.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tItem,\n\t/**\n\t * Used to render the label of a group. It won't be focusable using arrow keys.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectlabel\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tLabel,\n\t/**\n\t * Used to visually separate items or groups of items in the select content.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectseparator\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tSeparator: SelectSeparatorComponent,\n\t/**\n\t * The button that toggles the select. The Select.Content will position itself adjacent to the trigger.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selecttrigger\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tTrigger,\n\t/**\n\t * The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.\n\t *\n\t * @see https://mantle.ngrok.com/components/select#selectvalue\n\t *\n\t * @example\n\t * ```tsx\n\t * <Select.Root>\n\t * <Select.Trigger>\n\t * <Select.Value placeholder=\"Select a fruit\" />\n\t * </Select.Trigger>\n\t * <Select.Content>\n\t * <Select.Group>\n\t * <Select.Label>Fruits</Select.Label>\n\t * <Select.Item value=\"apple\">Apple</Select.Item>\n\t * <Select.Item value=\"banana\">Banana</Select.Item>\n\t * <Select.Item value=\"cherry\">Cherry</Select.Item>\n\t * </Select.Group>\n\t * <Select.Separator />\n\t * <Select.Group>\n\t * <Select.Label>Veggies</Select.Label>\n\t * <Select.Item value=\"carrot\">Carrot</Select.Item>\n\t * <Select.Item value=\"cucumber\">Cucumber</Select.Item>\n\t * </Select.Group>\n\t * </Select.Content>\n\t * </Select.Root>\n\t * ```\n\t */\n\tValue,\n} as const;\n\nexport {\n\t//,\n\tSelect,\n};\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { o as WithValidation } from "./validation-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CpZKMqTE.js";
|
|
2
|
+
import { o as WithValidation } from "./validation-CBSOmooP.js";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import { FocusEvent, ReactNode, SelectHTMLAttributes } from "react";
|
|
5
5
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
@@ -333,4 +333,4 @@ declare const Select: {
|
|
|
333
333
|
};
|
|
334
334
|
//#endregion
|
|
335
335
|
export { Select as t };
|
|
336
|
-
//# sourceMappingURL=select-
|
|
336
|
+
//# sourceMappingURL=select-SZFFzYs0.d.ts.map
|
package/dist/select.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Select } from "./select-
|
|
1
|
+
import { t as Select } from "./select-SZFFzYs0.js";
|
|
2
2
|
export { Select };
|
package/dist/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./select-
|
|
1
|
+
import{t as e}from"./select-B7orOUPj.js";export{e as Select};
|
package/dist/separator.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CpZKMqTE.js";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
4
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
package/dist/sheet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Root } from "./primitive-
|
|
2
|
-
import { n as IconButtonProps } from "./icon-button-
|
|
1
|
+
import { t as Root } from "./primitive-qkxTYBUY.js";
|
|
2
|
+
import { n as IconButtonProps } from "./icon-button-BDTb-lxs.js";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import { HTMLAttributes } from "react";
|
|
5
5
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
package/dist/slider.d.ts
CHANGED
|
@@ -50,12 +50,20 @@ type SliderProps = SliderBaseProps & SliderValueProps & {
|
|
|
50
50
|
/**
|
|
51
51
|
* An input where the user selects a value from within a given range.
|
|
52
52
|
*
|
|
53
|
+
* When composing with `Field.Item`, wrap `Slider` in `Field.Control`.
|
|
54
|
+
* `Field.Control` flows `aria-invalid`, `aria-describedby`, and
|
|
55
|
+
* `aria-errormessage` onto each thumb via `FieldControlContext`. Because
|
|
56
|
+
* slider thumbs are ARIA slider widgets rather than native labelable controls,
|
|
57
|
+
* pass `aria-label` or `aria-labelledby` to `Slider`; Mantle forwards those
|
|
58
|
+
* labels to the rendered thumb(s).
|
|
59
|
+
*
|
|
53
60
|
* @see https://mantle.ngrok.com/components/slider
|
|
54
61
|
*
|
|
55
62
|
* @example
|
|
56
63
|
* ```tsx
|
|
57
64
|
* // single thumb
|
|
58
65
|
* <Slider
|
|
66
|
+
* aria-label="Volume"
|
|
59
67
|
* defaultValue={75}
|
|
60
68
|
* max={100}
|
|
61
69
|
* step={1}
|
|
@@ -66,6 +74,7 @@ type SliderProps = SliderBaseProps & SliderValueProps & {
|
|
|
66
74
|
* ```tsx
|
|
67
75
|
* // range
|
|
68
76
|
* <Slider
|
|
77
|
+
* aria-label="Price"
|
|
69
78
|
* defaultValue={[25, 50]}
|
|
70
79
|
* max={100}
|
|
71
80
|
* step={5}
|
|
@@ -76,6 +85,7 @@ type SliderProps = SliderBaseProps & SliderValueProps & {
|
|
|
76
85
|
* ```tsx
|
|
77
86
|
* // multiple thumbs
|
|
78
87
|
* <Slider
|
|
88
|
+
* aria-label="Breakpoint"
|
|
79
89
|
* defaultValue={[10, 20, 70]}
|
|
80
90
|
* max={100}
|
|
81
91
|
* step={10}
|
|
@@ -83,12 +93,19 @@ type SliderProps = SliderBaseProps & SliderValueProps & {
|
|
|
83
93
|
* ```
|
|
84
94
|
*/
|
|
85
95
|
declare function Slider({
|
|
96
|
+
"aria-describedby": ariaDescribedBy,
|
|
97
|
+
"aria-errormessage": ariaErrorMessage,
|
|
98
|
+
"aria-invalid": ariaInvalid,
|
|
99
|
+
"aria-label": ariaLabel,
|
|
100
|
+
"aria-labelledby": ariaLabelledBy,
|
|
86
101
|
className,
|
|
87
102
|
color,
|
|
88
103
|
defaultValue,
|
|
104
|
+
id,
|
|
89
105
|
max,
|
|
90
106
|
min,
|
|
91
107
|
minStepsBetweenThumbs,
|
|
108
|
+
name,
|
|
92
109
|
step,
|
|
93
110
|
showTicks,
|
|
94
111
|
value,
|
package/dist/slider.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./cx-D1HYnpvA.js";import{jsx as
|
|
1
|
+
import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./field-context-B7Z1cmZW.js";import{useContext as n}from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";import*as a from"@radix-ui/react-slider";function o({"aria-describedby":o,"aria-errormessage":l,"aria-invalid":u,"aria-label":d,"aria-labelledby":f,className:p,color:m=`bg-accent-600`,defaultValue:h,id:g,max:_=100,min:v=0,minStepsBetweenThumbs:y=1,name:b,step:x=1,showTicks:S=!1,value:C,...w}){let T=n(t),E=C==null?void 0:Array.isArray(C)?C:[C],D=h==null?void 0:Array.isArray(h)?h:[h],O=E??D??[v],k=s(S,v,_,x);return i(a.Root,{"data-slot":`slider`,defaultValue:D,value:E,...T?{}:{"aria-describedby":o,"aria-errormessage":l,"aria-invalid":u,id:g},min:v,minStepsBetweenThumbs:y,max:_,name:b,step:x,className:e(`[--slider-thumb-size:--spacing(4.5)]`,`data-orientation-vertical:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-orientation-vertical:h-full data-orientation-vertical:w-auto data-orientation-vertical:flex-col`,k>0&&`mb-3`,p),...w,children:[r(a.Track,{"data-slot":`slider-track`,className:e(`bg-neutral-300 rounded-full relative grow overflow-hidden`,`data-orientation-horizontal:h-1.5 data-orientation-horizontal:w-full`,`data-orientation-vertical:w-1.5 data-orientation-vertical:h-full`),children:r(a.Range,{"data-slot":`slider-range`,className:e(`absolute select-none data-orientation-horizontal:h-full data-orientation-vertical:w-full`,m)})}),Array.from({length:O.length},(t,n)=>r(a.Thumb,{"data-slot":`slider-thumb`,"aria-describedby":T?.[`aria-describedby`]??o,"aria-errormessage":T?.[`aria-errormessage`]??l,"aria-invalid":T?.[`aria-invalid`]??u,"aria-label":c({ariaLabel:d,index:n,thumbCount:O.length}),"aria-labelledby":f,id:n===0?T?.id:void 0,className:e(`bg-card border-card relative size-(--slider-thumb-size) rounded-full border`,`shadow-md transition-[color,box-shadow]`,`after:absolute after:-inset-2`,`focus-visible:ring-3 focus-visible:ring-accent-500/20 focus-visible:outline-hidden`,`block shrink-0 cursor-pointer select-none`,`data-disabled:pointer-events-none data-disabled:cursor-default`)},n)),k>0&&r(`div`,{"data-slot":`slider-ticks`,className:`absolute top-full mt-1.5 flex w-full justify-between px-[calc(var(--slider-thumb-size)/2)]`,"aria-hidden":`true`,children:Array.from({length:k},(e,t)=>r(`span`,{"data-slot":`slider-tick`,className:`bg-card-border h-1.5 w-px`},t))})]})}function s(e,t,n,r){let i=n-t;return!e||!Number.isFinite(i)||!Number.isFinite(r)||r<=0||i<=0?0:Math.floor(i/r)+1}function c({ariaLabel:e,index:t,thumbCount:n}){if(e)return n===1?e:n===2?`${t===0?`Minimum`:`Maximum`} ${e}`:`${e} ${t+1} of ${n}`}export{o as Slider};
|
|
2
2
|
//# sourceMappingURL=slider.js.map
|
package/dist/slider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","names":[],"sources":["../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype SliderBaseProps = Omit<ComponentProps<typeof SliderPrimitive.Root>, \"defaultValue\" | \"value\">;\n\n/**\n * Value props for the {@link Slider} component. Either both `defaultValue` and\n * `value` must be the same type (both `number` or both `number[]`), or only one\n * may be provided.\n */\ntype SliderValueProps =\n\t| {\n\t\t\t/**\n\t\t\t * The value of the slider when initially rendered. Use when you do not need\n\t\t\t * to control the state of the slider.\n\t\t\t */\n\t\t\tdefaultValue?: number;\n\t\t\t/**\n\t\t\t * The controlled value of the slider. Must be used with `onValueChange`.\n\t\t\t */\n\t\t\tvalue?: number;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The values of the slider when initially rendered. Use when you do not need\n\t\t\t * to control the state of the slider. Pass an array to create a range slider\n\t\t\t * with multiple thumbs.\n\t\t\t */\n\t\t\tdefaultValue?: number[];\n\t\t\t/**\n\t\t\t * The controlled values of the slider. Must be used with `onValueChange`.\n\t\t\t * Pass an array to create a range slider with multiple thumbs.\n\t\t\t */\n\t\t\tvalue?: number[];\n\t };\n\n/**\n * Props for the {@link Slider} component.\n */\ntype SliderProps = SliderBaseProps &\n\tSliderValueProps & {\n\t\t/**\n\t\t * The color of the slider range. Accepts any Tailwind `bg-*` class.\n\t\t * @default \"bg-accent-500\"\n\t\t */\n\t\tcolor?: `bg-${string}`;\n\t\t/**\n\t\t * Whether to show tick marks along the track at each `step` interval.\n\t\t * @default false\n\t\t */\n\t\tshowTicks?: boolean;\n\t};\n\n/**\n * An input where the user selects a value from within a given range.\n *\n * @see https://mantle.ngrok.com/components/slider\n *\n * @example\n * ```tsx\n * // single thumb\n * <Slider\n * defaultValue={75}\n * max={100}\n * step={1}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // range\n * <Slider\n * defaultValue={[25, 50]}\n * max={100}\n * step={5}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // multiple thumbs\n * <Slider\n * defaultValue={[10, 20, 70]}\n * max={100}\n * step={10}\n * />\n * ```\n */\nfunction Slider({\n\tclassName,\n\tcolor = \"bg-accent-600\",\n\tdefaultValue,\n\tmax = 100,\n\tmin = 0,\n\tminStepsBetweenThumbs = 1,\n\tstep = 1,\n\tshowTicks = false,\n\tvalue,\n\t...props\n}: SliderProps) {\n\tconst normalizedValue = value != null ? (Array.isArray(value) ? value : [value]) : undefined;\n\tconst normalizedDefaultValue =\n\t\tdefaultValue != null\n\t\t\t? Array.isArray(defaultValue)\n\t\t\t\t? defaultValue\n\t\t\t\t: [defaultValue]\n\t\t\t: undefined;\n\tconst values = normalizedValue ?? normalizedDefaultValue ?? [min];\n\tconst tickCount = computeTickCount(showTicks, min, max, step);\n\n\treturn (\n\t\t<SliderPrimitive.Root\n\t\t\tdata-slot=\"slider\"\n\t\t\tdefaultValue={normalizedDefaultValue}\n\t\t\tvalue={normalizedValue}\n\t\t\tmin={min}\n\t\t\tminStepsBetweenThumbs={minStepsBetweenThumbs}\n\t\t\tmax={max}\n\t\t\tstep={step}\n\t\t\tclassName={cx(\n\t\t\t\t\"[--slider-thumb-size:--spacing(4.5)]\",\n\t\t\t\t\"data-orientation-vertical:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-orientation-vertical:h-full data-orientation-vertical:w-auto data-orientation-vertical:flex-col\",\n\t\t\t\ttickCount > 0 && \"mb-3\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SliderPrimitive.Track\n\t\t\t\tdata-slot=\"slider-track\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"bg-neutral-300 rounded-full relative grow overflow-hidden\",\n\t\t\t\t\t\"data-orientation-horizontal:h-1.5 data-orientation-horizontal:w-full\",\n\t\t\t\t\t\"data-orientation-vertical:w-1.5 data-orientation-vertical:h-full\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<SliderPrimitive.Range\n\t\t\t\t\tdata-slot=\"slider-range\"\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"absolute select-none data-orientation-horizontal:h-full data-orientation-vertical:w-full\",\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</SliderPrimitive.Track>\n\t\t\t{Array.from({ length: values.length }, (_, index) => (\n\t\t\t\t<SliderPrimitive.Thumb\n\t\t\t\t\tdata-slot=\"slider-thumb\"\n\t\t\t\t\tkey={index}\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"bg-card border-card relative size-(--slider-thumb-size) rounded-full border\",\n\t\t\t\t\t\t\"shadow-md transition-[color,box-shadow]\",\n\t\t\t\t\t\t\"after:absolute after:-inset-2\",\n\t\t\t\t\t\t\"focus-visible:ring-3 focus-visible:ring-accent-500/20 focus-visible:outline-hidden\",\n\t\t\t\t\t\t\"block shrink-0 cursor-pointer select-none\",\n\t\t\t\t\t\t\"data-disabled:pointer-events-none data-disabled:cursor-default\",\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{tickCount > 0 && (\n\t\t\t\t<div\n\t\t\t\t\tdata-slot=\"slider-ticks\"\n\t\t\t\t\tclassName=\"absolute top-full mt-1.5 flex w-full justify-between px-[calc(var(--slider-thumb-size)/2)]\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t{Array.from({ length: tickCount }, (_, index) => (\n\t\t\t\t\t\t<span key={index} data-slot=\"slider-tick\" className=\"bg-card-border h-1.5 w-px\" />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</SliderPrimitive.Root>\n\t);\n}\n\nexport { Slider };\nexport type { SliderProps };\n\n// MARK: - Private\n\n/**\n * Compute the number of tick marks to render based on the slider's range and step.\n * Returns 0 if ticks are disabled or if the step/range is invalid.\n */\nfunction computeTickCount(showTicks: boolean, min: number, max: number, step: number): number {\n\tconst range = max - min;\n\tif (!showTicks || !Number.isFinite(range) || !Number.isFinite(step) || step <= 0 || range <= 0) {\n\t\treturn 0;\n\t}\n\treturn Math.floor(range / step) + 1;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"slider.js","names":[],"sources":["../src/components/slider/slider.tsx"],"sourcesContent":["\"use client\";\n\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport type { ComponentProps } from \"react\";\nimport { useContext } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { FieldControlContext } from \"../field/field-context.js\";\n\ntype SliderBaseProps = Omit<ComponentProps<typeof SliderPrimitive.Root>, \"defaultValue\" | \"value\">;\n\n/**\n * Value props for the {@link Slider} component. Either both `defaultValue` and\n * `value` must be the same type (both `number` or both `number[]`), or only one\n * may be provided.\n */\ntype SliderValueProps =\n\t| {\n\t\t\t/**\n\t\t\t * The value of the slider when initially rendered. Use when you do not need\n\t\t\t * to control the state of the slider.\n\t\t\t */\n\t\t\tdefaultValue?: number;\n\t\t\t/**\n\t\t\t * The controlled value of the slider. Must be used with `onValueChange`.\n\t\t\t */\n\t\t\tvalue?: number;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The values of the slider when initially rendered. Use when you do not need\n\t\t\t * to control the state of the slider. Pass an array to create a range slider\n\t\t\t * with multiple thumbs.\n\t\t\t */\n\t\t\tdefaultValue?: number[];\n\t\t\t/**\n\t\t\t * The controlled values of the slider. Must be used with `onValueChange`.\n\t\t\t * Pass an array to create a range slider with multiple thumbs.\n\t\t\t */\n\t\t\tvalue?: number[];\n\t };\n\n/**\n * Props for the {@link Slider} component.\n */\ntype SliderProps = SliderBaseProps &\n\tSliderValueProps & {\n\t\t/**\n\t\t * The color of the slider range. Accepts any Tailwind `bg-*` class.\n\t\t * @default \"bg-accent-500\"\n\t\t */\n\t\tcolor?: `bg-${string}`;\n\t\t/**\n\t\t * Whether to show tick marks along the track at each `step` interval.\n\t\t * @default false\n\t\t */\n\t\tshowTicks?: boolean;\n\t};\n\n/**\n * An input where the user selects a value from within a given range.\n *\n * When composing with `Field.Item`, wrap `Slider` in `Field.Control`.\n * `Field.Control` flows `aria-invalid`, `aria-describedby`, and\n * `aria-errormessage` onto each thumb via `FieldControlContext`. Because\n * slider thumbs are ARIA slider widgets rather than native labelable controls,\n * pass `aria-label` or `aria-labelledby` to `Slider`; Mantle forwards those\n * labels to the rendered thumb(s).\n *\n * @see https://mantle.ngrok.com/components/slider\n *\n * @example\n * ```tsx\n * // single thumb\n * <Slider\n * aria-label=\"Volume\"\n * defaultValue={75}\n * max={100}\n * step={1}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // range\n * <Slider\n * aria-label=\"Price\"\n * defaultValue={[25, 50]}\n * max={100}\n * step={5}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // multiple thumbs\n * <Slider\n * aria-label=\"Breakpoint\"\n * defaultValue={[10, 20, 70]}\n * max={100}\n * step={10}\n * />\n * ```\n */\nfunction Slider({\n\t\"aria-describedby\": ariaDescribedBy,\n\t\"aria-errormessage\": ariaErrorMessage,\n\t\"aria-invalid\": ariaInvalid,\n\t\"aria-label\": ariaLabel,\n\t\"aria-labelledby\": ariaLabelledBy,\n\tclassName,\n\tcolor = \"bg-accent-600\",\n\tdefaultValue,\n\tid,\n\tmax = 100,\n\tmin = 0,\n\tminStepsBetweenThumbs = 1,\n\tname,\n\tstep = 1,\n\tshowTicks = false,\n\tvalue,\n\t...props\n}: SliderProps) {\n\tconst fieldControl = useContext(FieldControlContext);\n\tconst normalizedValue = value != null ? (Array.isArray(value) ? value : [value]) : undefined;\n\tconst normalizedDefaultValue =\n\t\tdefaultValue != null\n\t\t\t? Array.isArray(defaultValue)\n\t\t\t\t? defaultValue\n\t\t\t\t: [defaultValue]\n\t\t\t: undefined;\n\tconst values = normalizedValue ?? normalizedDefaultValue ?? [min];\n\tconst tickCount = computeTickCount(showTicks, min, max, step);\n\n\treturn (\n\t\t<SliderPrimitive.Root\n\t\t\tdata-slot=\"slider\"\n\t\t\tdefaultValue={normalizedDefaultValue}\n\t\t\tvalue={normalizedValue}\n\t\t\t{...(fieldControl\n\t\t\t\t? {}\n\t\t\t\t: {\n\t\t\t\t\t\t\"aria-describedby\": ariaDescribedBy,\n\t\t\t\t\t\t\"aria-errormessage\": ariaErrorMessage,\n\t\t\t\t\t\t\"aria-invalid\": ariaInvalid,\n\t\t\t\t\t\tid,\n\t\t\t\t\t})}\n\t\t\tmin={min}\n\t\t\tminStepsBetweenThumbs={minStepsBetweenThumbs}\n\t\t\tmax={max}\n\t\t\tname={name}\n\t\t\tstep={step}\n\t\t\tclassName={cx(\n\t\t\t\t\"[--slider-thumb-size:--spacing(4.5)]\",\n\t\t\t\t\"data-orientation-vertical:min-h-40 relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-orientation-vertical:h-full data-orientation-vertical:w-auto data-orientation-vertical:flex-col\",\n\t\t\t\ttickCount > 0 && \"mb-3\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SliderPrimitive.Track\n\t\t\t\tdata-slot=\"slider-track\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"bg-neutral-300 rounded-full relative grow overflow-hidden\",\n\t\t\t\t\t\"data-orientation-horizontal:h-1.5 data-orientation-horizontal:w-full\",\n\t\t\t\t\t\"data-orientation-vertical:w-1.5 data-orientation-vertical:h-full\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<SliderPrimitive.Range\n\t\t\t\t\tdata-slot=\"slider-range\"\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"absolute select-none data-orientation-horizontal:h-full data-orientation-vertical:w-full\",\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t</SliderPrimitive.Track>\n\t\t\t{Array.from({ length: values.length }, (_, index) => (\n\t\t\t\t<SliderPrimitive.Thumb\n\t\t\t\t\tdata-slot=\"slider-thumb\"\n\t\t\t\t\tkey={index}\n\t\t\t\t\taria-describedby={fieldControl?.[\"aria-describedby\"] ?? ariaDescribedBy}\n\t\t\t\t\taria-errormessage={fieldControl?.[\"aria-errormessage\"] ?? ariaErrorMessage}\n\t\t\t\t\taria-invalid={fieldControl?.[\"aria-invalid\"] ?? ariaInvalid}\n\t\t\t\t\taria-label={resolveThumbAriaLabel({\n\t\t\t\t\t\tariaLabel,\n\t\t\t\t\t\tindex,\n\t\t\t\t\t\tthumbCount: values.length,\n\t\t\t\t\t})}\n\t\t\t\t\taria-labelledby={ariaLabelledBy}\n\t\t\t\t\t// Only the first thumb receives the field-generated id so\n\t\t\t\t\t// Field.Label's htmlFor lands on a unique element. Range/\n\t\t\t\t\t// multi-thumb sliders share the surrounding aria wiring.\n\t\t\t\t\tid={index === 0 ? fieldControl?.id : undefined}\n\t\t\t\t\tclassName={cx(\n\t\t\t\t\t\t\"bg-card border-card relative size-(--slider-thumb-size) rounded-full border\",\n\t\t\t\t\t\t\"shadow-md transition-[color,box-shadow]\",\n\t\t\t\t\t\t\"after:absolute after:-inset-2\",\n\t\t\t\t\t\t\"focus-visible:ring-3 focus-visible:ring-accent-500/20 focus-visible:outline-hidden\",\n\t\t\t\t\t\t\"block shrink-0 cursor-pointer select-none\",\n\t\t\t\t\t\t\"data-disabled:pointer-events-none data-disabled:cursor-default\",\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t))}\n\t\t\t{tickCount > 0 && (\n\t\t\t\t<div\n\t\t\t\t\tdata-slot=\"slider-ticks\"\n\t\t\t\t\tclassName=\"absolute top-full mt-1.5 flex w-full justify-between px-[calc(var(--slider-thumb-size)/2)]\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t{Array.from({ length: tickCount }, (_, index) => (\n\t\t\t\t\t\t<span key={index} data-slot=\"slider-tick\" className=\"bg-card-border h-1.5 w-px\" />\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</SliderPrimitive.Root>\n\t);\n}\n\nexport { Slider };\nexport type { SliderProps };\n\n// MARK: - Private\n\n/**\n * Compute the number of tick marks to render based on the slider's range and step.\n * Returns 0 if ticks are disabled or if the step/range is invalid.\n */\nfunction computeTickCount(showTicks: boolean, min: number, max: number, step: number): number {\n\tconst range = max - min;\n\tif (!showTicks || !Number.isFinite(range) || !Number.isFinite(step) || step <= 0 || range <= 0) {\n\t\treturn 0;\n\t}\n\treturn Math.floor(range / step) + 1;\n}\n\nfunction resolveThumbAriaLabel({\n\tariaLabel,\n\tindex,\n\tthumbCount,\n}: {\n\tariaLabel?: string;\n\tindex: number;\n\tthumbCount: number;\n}): string | undefined {\n\tif (!ariaLabel) {\n\t\treturn undefined;\n\t}\n\n\tif (thumbCount === 1) {\n\t\treturn ariaLabel;\n\t}\n\n\tif (thumbCount === 2) {\n\t\treturn `${index === 0 ? \"Minimum\" : \"Maximum\"} ${ariaLabel}`;\n\t}\n\n\treturn `${ariaLabel} ${index + 1} of ${thumbCount}`;\n}\n"],"mappings":"8MAuGA,SAAS,EAAO,CACf,mBAAoB,EACpB,oBAAqB,EACrB,eAAgB,EAChB,aAAc,EACd,kBAAmB,EACnB,YACA,QAAQ,gBACR,eACA,KACA,MAAM,IACN,MAAM,EACN,wBAAwB,EACxB,OACA,OAAO,EACP,YAAY,GACZ,QACA,GAAG,GACY,CACf,IAAM,EAAe,EAAW,EAAoB,CAC9C,EAAkB,GAAS,KAAkD,IAAA,GAA1C,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM,CACzE,EACL,GAAgB,KAIb,IAAA,GAHA,MAAM,QAAQ,EAAa,CAC1B,EACA,CAAC,EAAa,CAEb,EAAS,GAAmB,GAA0B,CAAC,EAAI,CAC3D,EAAY,EAAiB,EAAW,EAAK,EAAK,EAAK,CAE7D,OACC,EAAC,EAAgB,KAAjB,CACC,YAAU,SACV,aAAc,EACd,MAAO,EACP,GAAK,EACF,EAAE,CACF,CACA,mBAAoB,EACpB,oBAAqB,EACrB,eAAgB,EAChB,KACA,CACE,MACkB,wBAClB,MACC,OACA,OACN,UAAW,EACV,uCACA,4NACA,EAAY,GAAK,OACjB,EACA,CACD,GAAI,WAvBL,CAyBC,EAAC,EAAgB,MAAjB,CACC,YAAU,eACV,UAAW,EACV,4DACA,uEACA,mEACA,UAED,EAAC,EAAgB,MAAjB,CACC,YAAU,eACV,UAAW,EACV,2FACA,EACA,CACA,CAAA,CACqB,CAAA,CACvB,MAAM,KAAK,CAAE,OAAQ,EAAO,OAAQ,EAAG,EAAG,IAC1C,EAAC,EAAgB,MAAjB,CACC,YAAU,eAEV,mBAAkB,IAAe,qBAAuB,EACxD,oBAAmB,IAAe,sBAAwB,EAC1D,eAAc,IAAe,iBAAmB,EAChD,aAAY,EAAsB,CACjC,YACA,QACA,WAAY,EAAO,OACnB,CAAC,CACF,kBAAiB,EAIjB,GAAI,IAAU,EAAI,GAAc,GAAK,IAAA,GACrC,UAAW,EACV,8EACA,0CACA,gCACA,qFACA,4CACA,iEACA,CACA,CAtBI,EAsBJ,CACD,CACD,EAAY,GACZ,EAAC,MAAD,CACC,YAAU,eACV,UAAU,6FACV,cAAY,gBAEX,MAAM,KAAK,CAAE,OAAQ,EAAW,EAAG,EAAG,IACtC,EAAC,OAAD,CAAkB,YAAU,cAAc,UAAU,4BAA8B,CAAvE,EAAuE,CACjF,CACG,CAAA,CAEe,GAazB,SAAS,EAAiB,EAAoB,EAAa,EAAa,EAAsB,CAC7F,IAAM,EAAQ,EAAM,EAIpB,MAHI,CAAC,GAAa,CAAC,OAAO,SAAS,EAAM,EAAI,CAAC,OAAO,SAAS,EAAK,EAAI,GAAQ,GAAK,GAAS,EACrF,EAED,KAAK,MAAM,EAAQ,EAAK,CAAG,EAGnC,SAAS,EAAsB,CAC9B,YACA,QACA,cAKsB,CACjB,KAYL,OARI,IAAe,EACX,EAGJ,IAAe,EACX,GAAG,IAAU,EAAI,UAAY,UAAU,GAAG,IAG3C,GAAG,EAAU,GAAG,EAAQ,EAAE,MAAM"}
|
package/dist/slot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Slot } from "./index-
|
|
1
|
+
import { t as Slot } from "./index-BhlxYL_y.js";
|
|
2
2
|
export { Slot };
|
package/dist/split-button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as IconButton } from "./icon-button-
|
|
2
|
-
import { t as Button } from "./button-
|
|
3
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
1
|
+
import { t as IconButton } from "./icon-button-BDTb-lxs.js";
|
|
2
|
+
import { t as Button } from "./button-DbHFERMB.js";
|
|
3
|
+
import { t as DropdownMenu } from "./dropdown-menu-CvOiQUSZ.js";
|
|
4
4
|
import * as _$react from "react";
|
|
5
5
|
import { ComponentProps, ReactNode } from "react";
|
|
6
6
|
import * as _$_radix_ui_react_dropdown_menu0 from "@radix-ui/react-dropdown-menu";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SvgAttributes } from "./types-
|
|
1
|
+
import { t as SvgAttributes } from "./types-QKZ5fvaQ.js";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
@@ -25,4 +25,4 @@ type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
|
|
|
25
25
|
declare const SvgOnly: _$react.ForwardRefExoticComponent<Omit<SvgOnlyProps, "ref"> & _$react.RefAttributes<SVGSVGElement>>;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { SvgOnlyProps as n, SvgOnly as t };
|
|
28
|
-
//# sourceMappingURL=svg-only-
|
|
28
|
+
//# sourceMappingURL=svg-only-D4uqM1OC.d.ts.map
|
package/dist/switch.d.ts
CHANGED
package/dist/table.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Table } from "./table-
|
|
1
|
+
import { t as Table } from "./table-CjSQkfZe.js";
|
|
2
2
|
export { Table };
|
package/dist/tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./booleanish-CBGdPL3Q.js";import{t as n}from"./compose-refs-DZ3cPi47.js";import{t as r}from"./use-prefers-reduced-motion-
|
|
1
|
+
import{t as e}from"./cx-D1HYnpvA.js";import{t}from"./booleanish-CBGdPL3Q.js";import{t as n}from"./compose-refs-DZ3cPi47.js";import{t as r}from"./use-prefers-reduced-motion-Bpx8G3UT.js";import{Children as i,cloneElement as a,createContext as o,forwardRef as s,isValidElement as c,useContext as l,useEffect as u,useRef as d}from"react";import f from"clsx";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Content as v,List as y,Root as b,Trigger as x}from"@radix-ui/react-tabs";const S=o({orientation:`horizontal`,appearance:`classic`}),C=s(({className:t,children:n,orientation:r=`horizontal`,appearance:i=`classic`,...a},o)=>h(b,{"data-slot":`tabs`,className:e(`flex gap-4`,r===`horizontal`?`flex-col`:`flex-row`,t),orientation:r,ref:o,...a,children:h(S.Provider,{value:{orientation:r,appearance:i},children:n})}));C.displayName=`Tabs`;const w=_(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`vertical`,appearance:`classic`,className:`border-r border-gray-200`}]}),T=s(({className:t,...i},a)=>{let{orientation:o,appearance:s}=l(S),c=d(null);return u(()=>{let e=c.current;if(!e||o!==`horizontal`)return;let t=new AbortController,n=0,i=()=>{e.toggleAttribute(`data-scroll-left`,e.scrollLeft>0),e.toggleAttribute(`data-scroll-right`,Math.ceil(e.scrollLeft)<n-1)},a=()=>{n=e.scrollWidth-e.clientWidth,i()};e.addEventListener(`scroll`,i,{passive:!0,signal:t.signal});let s=new MutationObserver(a);s.observe(e,{childList:!0,subtree:!0}),e.addEventListener(`focusin`,t=>{if(t.target instanceof Element&&t.target!==e){let e=r()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:t.signal});let l=new ResizeObserver(a);return l.observe(e),a(),()=>{t.abort(),l.disconnect(),s.disconnect()}},[o]),h(y,{"aria-orientation":o,"data-slot":`tabs-list`,className:e(w({orientation:o,appearance:s}),t),ref:n(c,a),...i})});T.displayName=`TabsList`;const E=_(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),D=()=>{let{orientation:e,appearance:t}=l(S);return h(`span`,{"aria-hidden":!0,className:f(E({orientation:e,appearance:t}))})};D.displayName=`TabsTriggerDecoration`;const O=_(e(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>svg]:shrink-0 [&>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:e(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:e(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),k=s(({"aria-disabled":n,asChild:r=!1,children:o,className:s,disabled:u,...d},f)=>{let{orientation:_,appearance:v}=l(S),y=t(n??u),b={"aria-disabled":n??u,className:e(O({orientation:_,appearance:v}),s),disabled:y,...d};if(r){let e=i.only(o);p(c(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.");let t=e.props?.children,n=y?{href:void 0,to:void 0}:{tabIndex:0};return h(x,{asChild:!0,"data-slot":`tabs-trigger`,...b,ref:f,children:a(y?h(`button`,{type:`button`}):e,n,g(m,{children:[h(D,{}),t]}))})}return g(x,{"data-slot":`tabs-trigger`,ref:f,...b,children:[h(D,{}),o]})});k.displayName=`TabsTrigger`;const A=({className:t,children:n,...r})=>h(`span`,{"data-slot":`tabs-badge`,className:e(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,t),...r,children:n});A.displayName=`TabBadge`;const j=s(({className:t,...n},r)=>h(v,{ref:r,"data-slot":`tabs-content`,className:e(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,t),...n}));j.displayName=`TabsContent`;const M={Root:C,Content:j,List:T,Trigger:k,Badge:A};export{M as Tabs};
|
|
2
2
|
//# sourceMappingURL=tabs.js.map
|
package/dist/text-area.d.ts
CHANGED
package/dist/theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./themes-
|
|
1
|
+
import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./themes-FPux5kIu.js";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -33,4 +33,4 @@ declare const $resolvedTheme: <T extends ResolvedTheme = ResolvedTheme>(value: T
|
|
|
33
33
|
declare function isResolvedTheme(value: unknown): value is ResolvedTheme;
|
|
34
34
|
//#endregion
|
|
35
35
|
export { isResolvedTheme as a, themes as c, Theme as i, $theme as n, isTheme as o, ResolvedTheme as r, resolvedThemes as s, $resolvedTheme as t };
|
|
36
|
-
//# sourceMappingURL=themes-
|
|
36
|
+
//# sourceMappingURL=themes-FPux5kIu.d.ts.map
|
package/dist/toast.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { t as WithStyleProps } from "./with-style-props-
|
|
3
|
-
import { n as SvgOnlyProps } from "./svg-only-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CpZKMqTE.js";
|
|
2
|
+
import { t as WithStyleProps } from "./with-style-props-xzZLnIrF.js";
|
|
3
|
+
import { n as SvgOnlyProps } from "./svg-only-D4uqM1OC.js";
|
|
4
4
|
import * as _$react from "react";
|
|
5
5
|
import { ComponentProps, ReactNode } from "react";
|
|
6
6
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|