{"version":3,"names":["dynamic","createMemo","createRenderEffect","createSignal","omit","useCheckboxGroupContext","useBaseUiId","createChangeEventDetails","REASONS","composeRefs","userRef","createControlledState","useFieldRootContext","fieldStateAttrs","HiddenInput","useAriaLabelledBy","readOption","mergeRootProps","resolveClassStyle","ariaLabelledBy","seedAriaLabelledBy","useButton","useFieldControlValidation","useValueChanged","CheckboxRootContext","createCheckbox","CheckboxRoot","props","field","groupContext","isParent","parent","inGroupAsChild","present","value","inGroupAsParent","readOnly","required","nativeButton","id","undefined","resolvedChecked","setUncontrolledChecked","controlled","checked","values","includes","Boolean","default","defaultGroupValue","defaultValue","defaultChecked","fallback","name","state","c","disabled","indeterminate","onCheckedChange","next","event","details","none","isCanceled","preventDefault","buttonProps","ref","buttonRef","native","controlRef","current","validation","getValue","enabled","setFilled","setDirty","validityData","initialValue","shouldValidateOnChange","commit","hiddenInputEl","setHiddenInputEl","captureInput","el","contextValue","v","map","disabledStates","payload","set","delete","checkboxExtraAttrs","data-parent","checkboxStateAttrs","wrapperClick","wasIndeterminate","getParentProps","currentValues","nextValues","filter","setValue","toggle","wrapperEventHandlers","onFocus","setFocused","onBlur","setTouched","validationMode","onClick","userStyling","userProps","triggerBag","trigger","triggerWithoutClick","styledUserProps","merged","getValidationProps","Tag","as","buttonElement","children","resolvedName","resolvedValue","form","uncheckedValue"],"sources":["checkbox-root.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { createMemo, createRenderEffect, createSignal, omit } from \"solid-js\";\nimport { useCheckboxGroupContext } from \"../../checkbox-group/checkbox-group-context.ts\";\nimport { useBaseUiId } from \"../../internals/base-ui-id\";\nimport {\n\ttype BaseUIChangeEventDetails,\n\tcreateChangeEventDetails,\n\tREASONS,\n} from \"../../internals/change-event-details\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { createControlledState } from \"../../internals/create-controlled-state\";\nimport { useFieldRootContext } from \"../../internals/field-context\";\nimport { fieldStateAttrs } from \"../../internals/field-state-attrs\";\nimport { HiddenInput } from \"../../internals/hidden-input/hidden-input.tsx\";\nimport { useAriaLabelledBy } from \"../../internals/labelable-provider/use-aria-labelled-by.ts\";\nimport { type MaybeAccessor, readOption } from \"../../internals/maybe-accessor\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport { ariaLabelledBy as seedAriaLabelledBy } from \"../../internals/seed-aria-attr\";\nimport type {\n\tBaseUIComponentProps,\n\tNonNativeButtonProps,\n} from \"../../internals/types\";\nimport { useButton } from \"../../internals/use-button/use-button\";\nimport { useFieldControlValidation } from \"../../internals/use-field-control-validation/use-field-control-validation.ts\";\nimport { useValueChanged } from \"../../internals/use-value-changed.ts\";\nimport {\n\tCheckboxRootContext,\n\ttype CheckboxRootContextValue,\n\ttype CheckboxRootState,\n} from \"../checkbox-root-context.ts\";\nimport { createCheckbox } from \"../create-checkbox.tsx\";\n\nexport type { CheckboxRootState };\n\nexport type CheckboxRootChangeEventReason = typeof REASONS.none;\nexport type CheckboxRootChangeEventDetails =\n\tBaseUIChangeEventDetails<CheckboxRootChangeEventReason>;\n\nexport interface CheckboxRootProps\n\textends NonNativeButtonProps,\n\t\tOmit<\n\t\t\tBaseUIComponentProps<\"button\", CheckboxRootState>,\n\t\t\t\"onChange\" | \"value\"\n\t\t> {\n\t/**\n\t * Tag/component to render. Defaults to `\"button\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n\tid?: string | undefined;\n\tname?: string | undefined;\n\tform?: string | undefined;\n\t/**\n\t * Controlled checked state. When provided (resolved value not\n\t * `undefined`), the consumer owns the state — pair with\n\t * {@link onCheckedChange}. When omitted, the checkbox manages its own\n\t * checked state (seeded from {@link defaultChecked}). Inside a\n\t * `<CheckboxGroup>` a checkbox with a `value` derives its checked state\n\t * from the group's value array instead.\n\t */\n\tchecked?: MaybeAccessor<boolean | undefined>;\n\t/**\n\t * Initial checked state when uncontrolled. Read once at mount. Inside a\n\t * `<CheckboxGroup>` with a `defaultValue`, a checkbox with a `value`\n\t * seeds from `defaultValue.includes(value)` instead.\n\t * @default false\n\t */\n\tdefaultChecked?: MaybeAccessor<boolean | undefined>;\n\tdisabled?: boolean | undefined;\n\tonCheckedChange?:\n\t\t| ((checked: boolean, eventDetails: CheckboxRootChangeEventDetails) => void)\n\t\t| undefined;\n\treadOnly?: MaybeAccessor<boolean | undefined>;\n\trequired?: MaybeAccessor<boolean | undefined>;\n\tindeterminate?: MaybeAccessor<boolean | undefined>;\n\tvalue?: string | undefined;\n\tuncheckedValue?: string | undefined;\n\tparent?: boolean | undefined;\n}\n\n/**\n * The checkbox root. Renders a `<button role=\"checkbox\">` (or `as`\n * override) plus a visually-hidden `<input type=\"checkbox\">` for native\n * form submission.\n *\n * Solid 2.0-native rewire (§1 wave 1): replaces `renderElement` with\n * `dynamic(() => props.as ?? \"button\")` and threads\n * `createCheckbox().trigger()` (carrying role, aria-checked/readonly/\n * required, data-checked/unchecked/indeterminate/disabled/readonly/\n * required, primitive onClick) through `mergeRootProps` together with\n * useButton + field-validation + a wrapper-level onClick that owns the\n * checkbox-group/parent routing (which bypasses the primitive's\n * onClick). Field-state attrs and `data-parent` are emitted via inline\n * getters reading from `state()` / `inGroupAsParent()`.\n */\nexport function CheckboxRoot(props: CheckboxRootProps): JSX.Element {\n\tconst field = useFieldRootContext();\n\tconst groupContext = useCheckboxGroupContext();\n\n\tconst isParent = (): boolean => props.parent === true;\n\tconst inGroupAsChild = (): boolean =>\n\t\tgroupContext.present === true &&\n\t\t!isParent() &&\n\t\ttypeof props.value === \"string\";\n\tconst inGroupAsParent = (): boolean =>\n\t\tgroupContext.present === true && isParent();\n\n\tconst readOnly = (): boolean => readOption(props.readOnly) ?? false;\n\tconst required = (): boolean => readOption(props.required) ?? false;\n\tconst nativeButton = (): boolean => props.nativeButton ?? true;\n\n\tconst id = useBaseUiId(typeof props.id === \"string\" ? props.id : undefined);\n\n\t// Controlled / uncontrolled checked state (Base UI `checked` /\n\t// `defaultChecked` contract, mirroring React's `useControlled` in\n\t// `CheckboxRoot`):\n\t//\n\t// - parent checkbox in a group → always controlled by the parent\n\t//   indicator's all/none math (`groupChecked` from `getParentProps()`);\n\t// - child checkbox with a `value` in a group → always controlled by the\n\t//   group's (resolved) value array (`groupValue.includes(value)`);\n\t// - standalone → the `checked` prop wins while its resolved value is\n\t//   defined, else an internal signal seeded once from `defaultChecked`\n\t//   (or, per Base UI, from the group's `defaultValue` when present).\n\tconst [resolvedChecked, setUncontrolledChecked] =\n\t\tcreateControlledState<boolean>({\n\t\t\tcontrolled: () => {\n\t\t\t\tif (inGroupAsParent()) {\n\t\t\t\t\treturn groupContext.parent.checked();\n\t\t\t\t}\n\t\t\t\tif (inGroupAsChild() && typeof props.value === \"string\") {\n\t\t\t\t\tconst values = groupContext.value() ?? [];\n\t\t\t\t\treturn values.includes(props.value);\n\t\t\t\t}\n\t\t\t\tconst controlled = readOption(props.checked);\n\t\t\t\treturn controlled === undefined ? undefined : Boolean(controlled);\n\t\t\t},\n\t\t\tdefault: () => {\n\t\t\t\t// Base UI: `value && defaultGroupValue && !parent ?\n\t\t\t\t// defaultGroupValue.includes(value) : defaultChecked`.\n\t\t\t\tif (\n\t\t\t\t\tgroupContext.present === true &&\n\t\t\t\t\t!isParent() &&\n\t\t\t\t\ttypeof props.value === \"string\"\n\t\t\t\t) {\n\t\t\t\t\tconst defaultGroupValue = groupContext.defaultValue?.();\n\t\t\t\t\tif (defaultGroupValue !== undefined) {\n\t\t\t\t\t\treturn defaultGroupValue.includes(props.value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn readOption(props.defaultChecked);\n\t\t\t},\n\t\t\tfallback: false,\n\t\t\tname: \"<Checkbox.Root>\",\n\t\t\tstate: \"checked\",\n\t\t});\n\n\tconst c = createCheckbox({\n\t\tchecked: resolvedChecked,\n\t\tdisabled: () =>\n\t\t\tfield.disabled() ||\n\t\t\t(groupContext.present === true && groupContext.disabled()) ||\n\t\t\tprops.disabled === true,\n\t\tindeterminate: () => {\n\t\t\tif (inGroupAsParent()) {\n\t\t\t\treturn (\n\t\t\t\t\tgroupContext.parent.indeterminate() ||\n\t\t\t\t\treadOption(props.indeterminate) === true\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn readOption(props.indeterminate) === true;\n\t\t},\n\t\treadOnly,\n\t\trequired,\n\t\tonCheckedChange: (next, event) => {\n\t\t\tconst details = createChangeEventDetails(\n\t\t\t\tREASONS.none,\n\t\t\t\tevent,\n\t\t\t) as CheckboxRootChangeEventDetails;\n\t\t\t// Base UI change flow: fire the consumer callback first, honor\n\t\t\t// `details.cancel()`, then write the uncontrolled state (a no-op\n\t\t\t// for reads while controlled / in a group).\n\t\t\tprops.onCheckedChange?.(next, details);\n\t\t\tif (details.isCanceled) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetUncontrolledChecked(next);\n\t\t},\n\t});\n\tconst checked = c.checked;\n\n\tconst { props: buttonProps, ref: buttonRef } = useButton({\n\t\tdisabled: c.disabled,\n\t\tnative: nativeButton,\n\t});\n\n\tconst controlRef: { current: HTMLElement | null } = { current: null };\n\n\tconst validation = useFieldControlValidation({\n\t\tvalue: () => checked() ?? false,\n\t\tid: () => id,\n\t\tcontrolRef,\n\t\tgetValue: () => checked() ?? false,\n\t\tenabled: () => !groupContext.present,\n\t});\n\n\tuseValueChanged(\n\t\t() => checked() ?? false,\n\t\t() => {\n\t\t\tif (groupContext.present === true && !isParent()) return;\n\t\t\tconst value = checked() ?? false;\n\t\t\tfield.setFilled(value);\n\t\t\tfield.setDirty(value !== field.validityData().initialValue);\n\t\t\tif (field.shouldValidateOnChange()) {\n\t\t\t\tvoid validation.commit(value);\n\t\t\t} else {\n\t\t\t\tvoid validation.commit(value, true);\n\t\t\t}\n\t\t},\n\t);\n\n\tconst [hiddenInputEl, setHiddenInputEl] =\n\t\tcreateSignal<HTMLInputElement | null>(null);\n\tconst captureInput = (el: HTMLInputElement | null): void => {\n\t\tsetHiddenInputEl(el);\n\t};\n\n\tcreateRenderEffect(\n\t\t() => ({ el: hiddenInputEl(), value: c.indeterminate() }),\n\t\t({ el, value }) => {\n\t\t\tif (el) el.indeterminate = value;\n\t\t},\n\t);\n\n\tconst state = createMemo(\n\t\t(): CheckboxRootState => ({\n\t\t\t...field.state(),\n\t\t\tchecked: checked() ?? false,\n\t\t\tdisabled: c.disabled(),\n\t\t\treadOnly: readOnly(),\n\t\t\trequired: required(),\n\t\t\tindeterminate: c.indeterminate(),\n\t\t}),\n\t);\n\n\tconst contextValue: CheckboxRootContextValue = {\n\t\tchecked: () => checked() ?? false,\n\t\tindeterminate: c.indeterminate,\n\t\tdisabled: c.disabled,\n\t\treadOnly,\n\t\trequired,\n\t\tstate,\n\t};\n\n\tconst ariaLabelledBy = useAriaLabelledBy(() => {\n\t\tconst v = props[\"aria-labelledby\"];\n\t\treturn typeof v === \"string\" ? v : undefined;\n\t});\n\n\tcreateRenderEffect(\n\t\t() => {\n\t\t\tif (!inGroupAsChild() || typeof props.value !== \"string\") {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tvalue: props.value,\n\t\t\t\tdisabled: c.disabled(),\n\t\t\t\tmap: groupContext.parent.disabledStates,\n\t\t\t};\n\t\t},\n\t\t(payload) => {\n\t\t\tif (!payload) return;\n\t\t\tpayload.map.set(payload.value, payload.disabled);\n\t\t\treturn () => {\n\t\t\t\tpayload.map.delete(payload.value);\n\t\t\t};\n\t\t},\n\t);\n\n\t// Field-state data-attrs not carried by `c.trigger()`. Composed via\n\t// the shared `fieldStateAttrs` helper plus checkbox-specific extras.\n\t// Spreading `fieldStateAttrs(...)` here would invoke its getters at\n\t// body time (object spread reads each property eagerly), breaking\n\t// reactivity AND tripping `[STRICT_READ_UNTRACKED]`. Build the\n\t// extras separately and let `mergeRootProps` compose the two\n\t// getter bags below.\n\tconst checkboxExtraAttrs = {\n\t\tget id() {\n\t\t\treturn id;\n\t\t},\n\t\tget \"data-parent\"(): \"\" | undefined {\n\t\t\treturn inGroupAsParent() ? \"\" : undefined;\n\t\t},\n\t};\n\tconst checkboxStateAttrs = mergeRootProps(\n\t\tcheckboxExtraAttrs,\n\t\tfieldStateAttrs(state),\n\t);\n\n\t// Wrapper-level click handler. In group mode this bypasses the primitive\n\t// (the group's value array is the source of truth). The primitive's own\n\t// onClick (in c.trigger()) is overridden via mergeRootProps's right-most\n\t// wins for plain keys — but onClick is an event handler so it CHAINS\n\t// instead. We need the wrapper's logic to run INSTEAD of the primitive's\n\t// in group mode. Solution: chain ordering — we put the primitive bag\n\t// AFTER our wrapper handler in the mergeRootProps chain so the wrapper\n\t// runs first; if we're in group mode the wrapper handles the toggle and\n\t// calls preventDefault to stop the primitive's default toggle from\n\t// running. In standalone mode we skip the preventDefault and let the\n\t// primitive's onClick fire (which calls c.toggle through the primitive's\n\t// own internal path, applying the indeterminate→true rule).\n\t//\n\t// Actually simpler: the wrapper handler short-circuits group mode by\n\t// preventDefault'ing, and in standalone calls the primitive's setChecked\n\t// directly with the indeterminate→true rule. This way the primitive's\n\t// onClick can be replaced.\n\t//\n\t// Cleanest: skip c.trigger()'s onClick and manage the click here.\n\tconst wrapperClick = (event: MouseEvent): void => {\n\t\tif (c.disabled() || readOnly()) return;\n\t\tif (inGroupAsParent() || inGroupAsChild()) {\n\t\t\tconst wasIndeterminate = c.indeterminate();\n\t\t\tconst current = c.checked();\n\t\t\tconst next = wasIndeterminate ? true : !current;\n\t\t\tconst details = createChangeEventDetails(\n\t\t\t\tREASONS.none,\n\t\t\t\tevent,\n\t\t\t) as CheckboxRootChangeEventDetails;\n\t\t\t// Base UI change flow: consumer callback first, cancel gate, then\n\t\t\t// the (inert-while-grouped) uncontrolled write, then the group\n\t\t\t// value write — mirrors `CheckboxRoot`'s hidden-input onChange.\n\t\t\tprops.onCheckedChange?.(next, details);\n\t\t\tif (details.isCanceled) return;\n\t\t\tsetUncontrolledChecked(next);\n\t\t\tif (inGroupAsParent()) {\n\t\t\t\tgroupContext.parent.getParentProps().onCheckedChange(next, details);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (typeof props.value === \"string\") {\n\t\t\t\tconst currentValues = groupContext.value() ?? [];\n\t\t\t\tconst nextValues = next\n\t\t\t\t\t? [...currentValues, props.value]\n\t\t\t\t\t: currentValues.filter((v) => v !== props.value);\n\t\t\t\tgroupContext.setValue(nextValues, details);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tc.toggle(event, \"trigger-press\");\n\t};\n\n\tconst wrapperEventHandlers = {\n\t\tonFocus: () => {\n\t\t\tfield.setFocused(true);\n\t\t},\n\t\tonBlur: () => {\n\t\t\tfield.setTouched(true);\n\t\t\tfield.setFocused(false);\n\t\t\tif (field.validationMode() === \"onBlur\") {\n\t\t\t\tvoid validation.commit(checked() ?? false);\n\t\t\t}\n\t\t},\n\t\tonClick: wrapperClick,\n\t};\n\n\tconst userStyling = resolveClassStyle(props, () => state());\n\n\tconst userProps = omit(\n\t\tprops,\n\t\t\"class\",\n\t\t\"style\",\n\t\t\"attrs\",\n\t\t\"as\",\n\t\t\"aria-labelledby\",\n\t\t\"checked\",\n\t\t\"children\",\n\t\t\"defaultChecked\",\n\t\t\"disabled\",\n\t\t\"form\",\n\t\t\"id\",\n\t\t\"indeterminate\",\n\t\t\"name\",\n\t\t\"nativeButton\",\n\t\t\"onCheckedChange\",\n\t\t\"parent\",\n\t\t\"readOnly\",\n\t\t\"required\",\n\t\t\"uncheckedValue\",\n\t\t\"value\",\n\t);\n\n\t// Build c.trigger() once; we want all its keys EXCEPT onClick (since the\n\t// wrapper now owns the toggle in both group + standalone modes). Use\n\t// `omit` so the getter descriptors are preserved instead of being read\n\t// at body-time (a `{...rest}` destructure would invoke every getter,\n\t// breaking reactivity for aria-checked / data-checked / etc.).\n\tconst triggerBag = c.trigger();\n\tconst triggerWithoutClick = omit(triggerBag, \"onClick\");\n\n\t// Compose: useButton ∘ aria-labelledby ∘ field-validation ∘ c.trigger()(no-click)\n\t// ∘ fieldStateAttrs ∘ wrapperEventHandlers ∘ userProps.\n\tconst styledUserProps = mergeRootProps(userStyling, userProps);\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tbuttonProps,\n\t\tseedAriaLabelledBy(ariaLabelledBy),\n\t);\n\tmerged = mergeRootProps(merged, validation.getValidationProps());\n\tmerged = mergeRootProps(merged, triggerWithoutClick);\n\tmerged = mergeRootProps(merged, checkboxStateAttrs);\n\tmerged = mergeRootProps(merged, wrapperEventHandlers);\n\tmerged = mergeRootProps(merged, styledUserProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"button\");\n\tconst buttonElement = (\n\t\t<Tag\n\t\t\t{...merged}\n\t\t\tref={composeRefs(\n\t\t\t\t(el: HTMLElement | null) => {\n\t\t\t\t\tcontrolRef.current = el;\n\t\t\t\t},\n\t\t\t\tbuttonRef,\n\t\t\t\tuserRef(props),\n\t\t\t)}\n\t\t>\n\t\t\t<CheckboxRootContext value={contextValue}>\n\t\t\t\t{props.children}\n\t\t\t</CheckboxRootContext>\n\t\t</Tag>\n\t);\n\n\tconst resolvedName = (): string | undefined => {\n\t\tif (isParent()) return undefined;\n\t\treturn field.name() ?? props.name;\n\t};\n\tconst resolvedValue = (): string => props.value ?? resolvedName() ?? \"\";\n\n\treturn (\n\t\t<>\n\t\t\t{buttonElement}\n\t\t\t<HiddenInput\n\t\t\t\ttype=\"checkbox\"\n\t\t\t\tref={captureInput}\n\t\t\t\tchecked={checked() ?? false}\n\t\t\t\tdisabled={c.disabled()}\n\t\t\t\tform={props.form}\n\t\t\t\tname={resolvedName()}\n\t\t\t\trequired={required()}\n\t\t\t\tvalue={resolvedValue()}\n\t\t\t\ttabindex={-1}\n\t\t\t\taria-hidden=\"true\"\n\t\t\t/>\n\t\t\t{!(checked() ?? false) &&\n\t\t\tresolvedName() &&\n\t\t\tprops.uncheckedValue !== undefined ? (\n\t\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