vorma 0.86.0-pre.2 → 0.86.0-pre.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/core/_index.d.ts +1 -0
- package/.dist/core/_index.d.ts.map +1 -1
- package/.dist/core/_index.js +6 -0
- package/.dist/core/_index.js.map +1 -1
- package/.dist/core/vorma_client_wasm_bg.wasm +0 -0
- package/.dist/ui/solid/solid.js +29 -39
- package/.dist/ui/solid/solid.js.map +1 -1
- package/core/client_wasm/vorma_client_wasm_bg.wasm +0 -0
- package/core/create_client_core.ts +9 -1
- package/package.json +1 -16
- package/ui/solid/solid.tsx +29 -10
- package/.dist/kit/lab/design/components/remix/remix.d.ts +0 -2309
- package/.dist/kit/lab/design/components/remix/remix.d.ts.map +0 -1
- package/.dist/kit/lab/design/components/remix/remix.js +0 -7022
- package/.dist/kit/lab/design/components/remix/remix.js.map +0 -1
- package/.dist/kit/lab/design/core/core.d.ts +0 -527
- package/.dist/kit/lab/design/core/core.d.ts.map +0 -1
- package/.dist/kit/lab/design/core/core.js +0 -668
- package/.dist/kit/lab/design/core/core.js.map +0 -1
- package/.dist/kit/matcher/matcher.d.ts +0 -78
- package/.dist/kit/matcher/matcher.d.ts.map +0 -1
- package/.dist/kit/matcher/matcher.js +0 -517
- package/.dist/kit/matcher/matcher.js.map +0 -1
- package/.dist/ui/remix/remix.d.ts +0 -73
- package/.dist/ui/remix/remix.d.ts.map +0 -1
- package/.dist/ui/remix/remix.js +0 -409
- package/.dist/ui/remix/remix.js.map +0 -1
- package/kit/lab/design/components/remix/accordion.ts +0 -474
- package/kit/lab/design/components/remix/alert-dialog.ts +0 -512
- package/kit/lab/design/components/remix/alert.ts +0 -213
- package/kit/lab/design/components/remix/aspect-ratio.ts +0 -111
- package/kit/lab/design/components/remix/badge.ts +0 -59
- package/kit/lab/design/components/remix/box.ts +0 -49
- package/kit/lab/design/components/remix/button.ts +0 -314
- package/kit/lab/design/components/remix/callout.ts +0 -127
- package/kit/lab/design/components/remix/checkable-state.ts +0 -187
- package/kit/lab/design/components/remix/checkbox-group.ts +0 -443
- package/kit/lab/design/components/remix/checkbox.ts +0 -215
- package/kit/lab/design/components/remix/chip.ts +0 -165
- package/kit/lab/design/components/remix/code-block.ts +0 -181
- package/kit/lab/design/components/remix/collapsible.ts +0 -325
- package/kit/lab/design/components/remix/component-state.ts +0 -55
- package/kit/lab/design/components/remix/component-style.ts +0 -364
- package/kit/lab/design/components/remix/composite-navigation.ts +0 -71
- package/kit/lab/design/components/remix/conditions.ts +0 -25
- package/kit/lab/design/components/remix/controllable-state.ts +0 -58
- package/kit/lab/design/components/remix/description-list.ts +0 -275
- package/kit/lab/design/components/remix/dialog.ts +0 -653
- package/kit/lab/design/components/remix/empty-state.ts +0 -146
- package/kit/lab/design/components/remix/field.ts +0 -418
- package/kit/lab/design/components/remix/fieldset.ts +0 -153
- package/kit/lab/design/components/remix/form-mirror.ts +0 -94
- package/kit/lab/design/components/remix/form-reset.ts +0 -85
- package/kit/lab/design/components/remix/form.ts +0 -109
- package/kit/lab/design/components/remix/grid.ts +0 -187
- package/kit/lab/design/components/remix/group-label.ts +0 -47
- package/kit/lab/design/components/remix/icon.ts +0 -176
- package/kit/lab/design/components/remix/input.ts +0 -163
- package/kit/lab/design/components/remix/kbd.ts +0 -58
- package/kit/lab/design/components/remix/list.ts +0 -120
- package/kit/lab/design/components/remix/listbox.ts +0 -1116
- package/kit/lab/design/components/remix/menu.ts +0 -1477
- package/kit/lab/design/components/remix/ordered-collection.ts +0 -95
- package/kit/lab/design/components/remix/popover-scroll-lock.ts +0 -89
- package/kit/lab/design/components/remix/popover.ts +0 -576
- package/kit/lab/design/components/remix/popup-behavior.ts +0 -96
- package/kit/lab/design/components/remix/progress.ts +0 -185
- package/kit/lab/design/components/remix/radio-group.ts +0 -420
- package/kit/lab/design/components/remix/recipe.ts +0 -70
- package/kit/lab/design/components/remix/remix.ts +0 -683
- package/kit/lab/design/components/remix/responsive.ts +0 -106
- package/kit/lab/design/components/remix/root.ts +0 -137
- package/kit/lab/design/components/remix/select.ts +0 -1546
- package/kit/lab/design/components/remix/separator.ts +0 -108
- package/kit/lab/design/components/remix/slider.ts +0 -308
- package/kit/lab/design/components/remix/spinner.ts +0 -114
- package/kit/lab/design/components/remix/stack.ts +0 -205
- package/kit/lab/design/components/remix/stat.ts +0 -127
- package/kit/lab/design/components/remix/surface.ts +0 -71
- package/kit/lab/design/components/remix/switch.ts +0 -219
- package/kit/lab/design/components/remix/table.ts +0 -395
- package/kit/lab/design/components/remix/tabs.ts +0 -404
- package/kit/lab/design/components/remix/text.ts +0 -169
- package/kit/lab/design/components/remix/textarea.ts +0 -164
- package/kit/lab/design/components/remix/toast.ts +0 -299
- package/kit/lab/design/components/remix/tooltip.ts +0 -330
- package/kit/lab/design/components/remix/typeahead.ts +0 -81
- package/kit/lab/design/components/remix/types.ts +0 -19
- package/kit/lab/design/components/remix/visually-hidden.ts +0 -100
- package/kit/lab/design/core/color.ts +0 -46
- package/kit/lab/design/core/core.ts +0 -111
- package/kit/lab/design/core/create_primitive.ts +0 -455
- package/kit/lab/design/core/create_system.ts +0 -303
- package/kit/lab/design/core/css.ts +0 -127
- package/kit/lab/design/core/define_system.ts +0 -508
- package/kit/lab/design/core/math.ts +0 -12
- package/kit/lab/design/core/object.ts +0 -31
- package/kit/lab/design/core/recipe/create_recipe.ts +0 -185
- package/kit/lab/design/core/recipe/recipe.ts +0 -26
- package/kit/lab/design/core/recipe/style.ts +0 -62
- package/kit/lab/design/core/recipe/types.ts +0 -160
- package/kit/lab/design/core/resolve_token.ts +0 -118
- package/kit/lab/design/core/types.ts +0 -636
- package/ui/remix/remix.tsx +0 -901
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remix.js","names":["button_type_default","click_event","button_type_default","cancel_event","click_event","close_event","style_for_props","button_type_default","checkbox_type","item_conditions","add_value","remove_value","is_same_values","button_type_default","button_type_default","click_event","click_event","button_type_default","align_map","option_conditions","focus_event","click_event","keydown_event","pointermove_event","infer_text_value","is_printable_key_event","button_type_default","click_event","focus_event","infer_text_value","is_printable_key_event","button_type_default","button_type_default","click_event","button_type_default"],"sources":["../../../../../../kit/lab/design/core/recipe/style.ts","../../../../../../kit/lab/design/core/recipe/create_recipe.ts","../../../../../../kit/lab/design/components/remix/component-state.ts","../../../../../../kit/lab/design/components/remix/recipe.ts","../../../../../../kit/lab/design/components/remix/responsive.ts","../../../../../../kit/lab/design/components/remix/component-style.ts","../../../../../../kit/lab/design/components/remix/conditions.ts","../../../../../../kit/lab/design/components/remix/accordion.ts","../../../../../../kit/lab/design/components/remix/alert-dialog.ts","../../../../../../kit/lab/design/components/remix/alert.ts","../../../../../../kit/lab/design/components/remix/aspect-ratio.ts","../../../../../../kit/lab/design/components/remix/root.ts","../../../../../../kit/lab/design/components/remix/badge.ts","../../../../../../kit/lab/design/components/remix/box.ts","../../../../../../kit/lab/design/components/remix/button.ts","../../../../../../kit/lab/design/components/remix/callout.ts","../../../../../../kit/lab/design/components/remix/form-reset.ts","../../../../../../kit/lab/design/components/remix/checkable-state.ts","../../../../../../kit/lab/design/components/remix/controllable-state.ts","../../../../../../kit/lab/design/components/remix/checkbox-group.ts","../../../../../../kit/lab/design/components/remix/checkbox.ts","../../../../../../kit/lab/design/components/remix/chip.ts","../../../../../../kit/lab/design/components/remix/code-block.ts","../../../../../../kit/lab/design/components/remix/collapsible.ts","../../../../../../kit/lab/design/components/remix/description-list.ts","../../../../../../kit/lab/design/components/remix/dialog.ts","../../../../../../kit/lab/design/components/remix/empty-state.ts","../../../../../../kit/lab/design/components/remix/field.ts","../../../../../../kit/lab/design/components/remix/fieldset.ts","../../../../../../kit/lab/design/components/remix/form.ts","../../../../../../kit/lab/design/components/remix/grid.ts","../../../../../../kit/lab/design/components/remix/icon.ts","../../../../../../kit/lab/design/components/remix/input.ts","../../../../../../kit/lab/design/components/remix/kbd.ts","../../../../../../kit/lab/design/components/remix/list.ts","../../../../../../kit/lab/design/components/remix/composite-navigation.ts","../../../../../../kit/lab/design/components/remix/group-label.ts","../../../../../../kit/lab/design/components/remix/ordered-collection.ts","../../../../../../kit/lab/design/components/remix/typeahead.ts","../../../../../../kit/lab/design/components/remix/listbox.ts","../../../../../../kit/lab/design/components/remix/popover-scroll-lock.ts","../../../../../../kit/lab/design/components/remix/popup-behavior.ts","../../../../../../kit/lab/design/components/remix/menu.ts","../../../../../../kit/lab/design/components/remix/popover.ts","../../../../../../kit/lab/design/components/remix/progress.ts","../../../../../../kit/lab/design/components/remix/radio-group.ts","../../../../../../kit/lab/design/components/remix/visually-hidden.ts","../../../../../../kit/lab/design/components/remix/form-mirror.ts","../../../../../../kit/lab/design/components/remix/select.ts","../../../../../../kit/lab/design/components/remix/separator.ts","../../../../../../kit/lab/design/components/remix/slider.ts","../../../../../../kit/lab/design/components/remix/spinner.ts","../../../../../../kit/lab/design/components/remix/stack.ts","../../../../../../kit/lab/design/components/remix/stat.ts","../../../../../../kit/lab/design/components/remix/surface.ts","../../../../../../kit/lab/design/components/remix/switch.ts","../../../../../../kit/lab/design/components/remix/table.ts","../../../../../../kit/lab/design/components/remix/tabs.ts","../../../../../../kit/lab/design/components/remix/text.ts","../../../../../../kit/lab/design/components/remix/textarea.ts","../../../../../../kit/lab/design/components/remix/toast.ts","../../../../../../kit/lab/design/components/remix/tooltip.ts"],"sourcesContent":["export type RecipeStyleValue = string | number | null | undefined;\nexport type RecipeStyle = {\n\treadonly [property: string]: unknown;\n};\n\nconst empty_recipe_style = Object.freeze({}) as RecipeStyle;\n\n/////////////////////////////////////////////////////////////////////\n/////// Style Objects\n/////////////////////////////////////////////////////////////////////\n\nfunction has_recipe_style_entries(style: object): boolean {\n\treturn Object.keys(style).length > 0;\n}\n\nfunction is_mergeable_recipe_style(value: unknown): value is RecipeStyle {\n\tif (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n\t\treturn false;\n\t}\n\n\treturn Object.getOwnPropertySymbols(value).length === 0;\n}\n\nfunction merge_recipe_style_value(current: unknown, value: unknown): unknown {\n\tif (is_mergeable_recipe_style(current) && is_mergeable_recipe_style(value)) {\n\t\treturn mergeRecipeStyles(current, value);\n\t}\n\n\treturn value;\n}\n\nfunction merge_recipe_style_into(\n\tmerged: Record<string, unknown>,\n\tstyle: RecipeStyle,\n): void {\n\tfor (const [key, value] of Object.entries(style)) {\n\t\tmerged[key] = merge_recipe_style_value(merged[key], value);\n\t}\n}\n\nexport function mergeRecipeStyles<TStyle extends RecipeStyle>(\n\t...styles: ReadonlyArray<TStyle | undefined>\n): TStyle {\n\tconst non_empty_styles = styles.filter((style): style is TStyle => {\n\t\treturn style !== undefined && has_recipe_style_entries(style);\n\t});\n\n\tif (non_empty_styles.length === 0) {\n\t\treturn empty_recipe_style as TStyle;\n\t}\n\n\tif (non_empty_styles.length === 1) {\n\t\treturn non_empty_styles[0]!;\n\t}\n\n\tconst merged: Record<string, unknown> = {};\n\tfor (const style of non_empty_styles) {\n\t\tmerge_recipe_style_into(merged, style);\n\t}\n\n\treturn merged as TStyle;\n}\n","import type { RecipeStyle } from \"./style.ts\";\nimport { mergeRecipeStyles } from \"./style.ts\";\nimport type {\n\tCreatedRecipe,\n\tRecipeCompoundVariantInput,\n\tRecipeConditionMap,\n\tRecipeConditionName,\n\tRecipeInput,\n\tRecipeSlotInput,\n\tRecipeVariantGroupName,\n\tRecipeVariantPropsFor,\n\tRecipeVariantSelection,\n\tResolvedRecipe,\n\tResolvedRecipeSlot,\n} from \"./types.ts\";\n\ntype AnyRecipeInput = RecipeInput<string, string, RecipeStyle>;\ntype AnyRecipeSlotInput = RecipeSlotInput<string, RecipeStyle>;\ntype AnyRecipeConditionMap = RecipeConditionMap<string, RecipeStyle>;\ntype AnyRecipeVariantSelection = Record<string, string>;\ntype AnyRecipeCompoundVariantInput = RecipeCompoundVariantInput<\n\tstring,\n\tstring,\n\tRecipeStyle\n>;\n\n/////////////////////////////////////////////////////////////////////\n/////// Recipe Resolution\n/////////////////////////////////////////////////////////////////////\n\nfunction merge_variant_selection(\n\tdefault_variants: RecipeVariantSelection | undefined,\n\tvariants: RecipeVariantSelection | undefined,\n): AnyRecipeVariantSelection {\n\tconst selection: Record<string, string> = {};\n\n\tfor (const [key, value] of Object.entries(default_variants ?? {})) {\n\t\tif (value !== undefined) {\n\t\t\tselection[key] = value;\n\t\t}\n\t}\n\n\tfor (const [key, value] of Object.entries(variants ?? {})) {\n\t\tif (value !== undefined) {\n\t\t\tselection[key] = value;\n\t\t}\n\t}\n\n\treturn selection;\n}\n\nfunction matches_compound_variant(\n\tcompound_variant: AnyRecipeCompoundVariantInput,\n\tselection: AnyRecipeVariantSelection,\n): boolean {\n\treturn Object.entries(compound_variant.variants).every(([key, value]) => {\n\t\treturn selection[key] === value;\n\t});\n}\n\nfunction merge_recipe_condition_maps(\n\tcondition_maps: readonly (AnyRecipeConditionMap | undefined)[],\n): AnyRecipeConditionMap {\n\tconst condition_names = new Set<string>();\n\n\tfor (const conditions of condition_maps) {\n\t\tfor (const condition_name of Object.keys(conditions ?? {})) {\n\t\t\tcondition_names.add(condition_name);\n\t\t}\n\t}\n\n\treturn Object.fromEntries(\n\t\tArray.from(condition_names).map((condition_name) => {\n\t\t\tconst condition_styles = condition_maps.map((conditions) => {\n\t\t\t\treturn conditions?.[condition_name];\n\t\t\t});\n\n\t\t\treturn [condition_name, mergeRecipeStyles(...condition_styles)];\n\t\t}),\n\t);\n}\n\nfunction merge_recipe_slot_inputs(\n\tslot_inputs: readonly (AnyRecipeSlotInput | undefined)[],\n): ResolvedRecipeSlot<string, RecipeStyle> {\n\tconst base_styles = slot_inputs.map((slot_input) => {\n\t\treturn slot_input?.base;\n\t});\n\tconst condition_maps = slot_inputs.map((slot_input) => {\n\t\treturn slot_input?.conditions;\n\t});\n\n\treturn {\n\t\tbase: mergeRecipeStyles(...base_styles),\n\t\tconditions: merge_recipe_condition_maps(condition_maps),\n\t};\n}\n\nfunction read_variant_slot_inputs(input: {\n\trecipe: AnyRecipeInput;\n\tselection: AnyRecipeVariantSelection;\n\tslot: string;\n}): AnyRecipeSlotInput[] {\n\treturn Object.entries(input.recipe.variants ?? {}).flatMap(\n\t\t([variant_name, variant_group]) => {\n\t\t\tconst variant_value = input.selection[variant_name];\n\t\t\tif (variant_value === undefined) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst variant_slot = variant_group[variant_value]?.[input.slot];\n\n\t\t\treturn variant_slot ? [variant_slot] : [];\n\t\t},\n\t);\n}\n\nfunction read_compound_variant_slot_inputs(input: {\n\trecipe: AnyRecipeInput;\n\tselection: AnyRecipeVariantSelection;\n\tslot: string;\n}): AnyRecipeSlotInput[] {\n\treturn (input.recipe.compoundVariants ?? []).flatMap((compound_variant) => {\n\t\tif (!matches_compound_variant(compound_variant, input.selection)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst compound_slot = compound_variant.slots[input.slot];\n\n\t\treturn compound_slot ? [compound_slot] : [];\n\t});\n}\n\nfunction resolve_recipe_slot(input: {\n\trecipe: AnyRecipeInput;\n\tselection: AnyRecipeVariantSelection;\n\tslot: string;\n}): ResolvedRecipeSlot<string, RecipeStyle> {\n\treturn merge_recipe_slot_inputs([\n\t\tinput.recipe.slots[input.slot],\n\t\t...read_variant_slot_inputs(input),\n\t\t...read_compound_variant_slot_inputs(input),\n\t]);\n}\n\nexport function resolveRecipe<\n\tconst TRecipe extends AnyRecipeInput,\n\tconst TGroups extends RecipeVariantGroupName<TRecipe>,\n>(\n\trecipe: TRecipe,\n\tvariants?: RecipeVariantPropsFor<TRecipe, TGroups>,\n): ResolvedRecipe<TRecipe, RecipeConditionName<TRecipe>, RecipeStyle> {\n\tconst selection = merge_variant_selection(\n\t\trecipe.defaultVariants,\n\t\tvariants as AnyRecipeVariantSelection | undefined,\n\t);\n\n\treturn {\n\t\tslots: Object.fromEntries(\n\t\t\tObject.keys(recipe.slots).map((slot) => {\n\t\t\t\treturn [\n\t\t\t\t\tslot,\n\t\t\t\t\tresolve_recipe_slot({\n\t\t\t\t\t\trecipe,\n\t\t\t\t\t\tselection,\n\t\t\t\t\t\tslot,\n\t\t\t\t\t}),\n\t\t\t\t];\n\t\t\t}),\n\t\t),\n\t} as ResolvedRecipe<TRecipe, RecipeConditionName<TRecipe>, RecipeStyle>;\n}\n\nexport function createRecipe<const TRecipe extends AnyRecipeInput>(\n\trecipe: TRecipe,\n): CreatedRecipe<TRecipe> {\n\treturn {\n\t\tinput: recipe,\n\t\tresolve<const TGroups extends RecipeVariantGroupName<TRecipe>>(\n\t\t\tvariants?: RecipeVariantPropsFor<TRecipe, TGroups>,\n\t\t): ResolvedRecipe<TRecipe, RecipeConditionName<TRecipe>, RecipeStyle> {\n\t\t\treturn resolveRecipe(recipe, variants);\n\t\t},\n\t} as CreatedRecipe<TRecipe>;\n}\n","export const componentStateAttribute = \"data-state\";\n\nexport const componentDataAttribute = {\n\tdisabled: \"data-disabled\",\n\thighlighted: \"data-highlighted\",\n\tinvalid: \"data-invalid\",\n\tloading: \"data-loading\",\n\topen: \"data-open\",\n\tplaceholder: \"data-placeholder\",\n\treadOnly: \"data-readonly\",\n\trequired: \"data-required\",\n\tselected: \"data-selected\",\n} as const;\n\nexport type ARIABoolean = \"false\" | \"true\";\n\nexport function ariaBoolean(value: boolean): ARIABoolean {\n\treturn value ? \"true\" : \"false\";\n}\n\nexport function ariaTrue(value: boolean): \"true\" | undefined {\n\treturn value ? \"true\" : undefined;\n}\n\nexport function dataFlag(value: boolean): \"\" | undefined {\n\treturn value ? \"\" : undefined;\n}\n\nexport function is_aria_invalid(value: unknown): boolean {\n\treturn (\n\t\tvalue === true || value === \"true\" || value === \"grammar\" || value === \"spelling\"\n\t);\n}\n\nexport const openState = {\n\tclosed: \"closed\",\n\topen: \"open\",\n} as const;\n\nexport type OpenStateName = (typeof openState)[keyof typeof openState];\n\nexport const selectionState = {\n\tselected: \"selected\",\n\tunselected: \"unselected\",\n} as const;\n\nexport type SelectionStateName = (typeof selectionState)[keyof typeof selectionState];\n\nexport function openStateFromBoolean(open: boolean): OpenStateName {\n\treturn open ? openState.open : openState.closed;\n}\n\nexport function selectionStateFromBoolean(selected: boolean): SelectionStateName {\n\treturn selected ? selectionState.selected : selectionState.unselected;\n}\n","import { css, type MixInput } from \"remix/ui\";\nimport {\n\tmergeRecipeStyles,\n\ttype RecipeConditionMap as RecipeConditionStyleMap,\n\ttype RecipeStyle,\n\ttype ResolvedRecipeSlot,\n} from \"../../core/core.ts\";\n\nexport type RecipeConditionSelectorMap<TCondition extends string = string> = Partial<\n\tReadonly<Record<TCondition, string>>\n>;\n\nexport function mergeRecipeConditionSelectors<TCondition extends string>(\n\t...maps: readonly (RecipeConditionSelectorMap<TCondition> | undefined)[]\n): RecipeConditionSelectorMap<TCondition> {\n\treturn Object.assign({}, ...maps);\n}\n\nexport type RecipeStyleInput<TCondition extends string = string> = {\n\tconditions?: RecipeConditionSelectorMap;\n\tslot: ResolvedRecipeSlot<TCondition, RecipeStyle>;\n\tstyle?: RecipeStyle;\n};\n\nfunction condition_styles_to_selectors<TCondition extends string>(\n\tcondition_styles: RecipeConditionStyleMap<TCondition, RecipeStyle>,\n\tcondition_selectors: RecipeConditionSelectorMap | undefined,\n): RecipeStyle {\n\tconst selector_styles: Record<string, RecipeStyle> = {};\n\n\tfor (const [condition_name, condition_style] of Object.entries(condition_styles) as [\n\t\tTCondition,\n\t\tRecipeStyle | undefined,\n\t][]) {\n\t\tif (!condition_style) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst selector = condition_selectors?.[condition_name];\n\t\tif (!selector) {\n\t\t\tthrow new Error(\n\t\t\t\t`Missing Remix recipe condition selector for \"${condition_name}\"`,\n\t\t\t);\n\t\t}\n\n\t\tselector_styles[selector] = mergeRecipeStyles(\n\t\t\tselector_styles[selector],\n\t\t\tcondition_style,\n\t\t);\n\t}\n\n\treturn selector_styles;\n}\n\nexport function createRecipeStyle<TCondition extends string>(\n\tinput: RecipeStyleInput<TCondition>,\n): RecipeStyle {\n\treturn mergeRecipeStyles(\n\t\tinput.slot.base,\n\t\tcondition_styles_to_selectors(input.slot.conditions, input.conditions),\n\t\tinput.style,\n\t);\n}\n\nexport function createRecipeMix<\n\tTElement extends Element = Element,\n\tTCondition extends string = string,\n>(input: RecipeStyleInput<TCondition>): MixInput<TElement> {\n\treturn css<TElement>(createRecipeStyle(input) as Parameters<typeof css>[0]);\n}\n","import {\n\tmergeRecipeStyles,\n\ttype RecipeStyle,\n\ttype ResolvedRecipeSlot,\n} from \"../../core/core.ts\";\nimport { createRecipeStyle, type RecipeConditionSelectorMap } from \"./recipe.ts\";\nimport type { ComponentStyleSystem } from \"./types.ts\";\n\ntype MetadataBreakpoint<TMetadata> = TMetadata extends {\n\tbreakpoint: Record<infer TBreakpoint, string | number>;\n}\n\t? TBreakpoint & string\n\t: never;\n\nexport type ResponsiveProps<TProps extends object, TBreakpoint extends string> = {\n\tat?: Partial<Record<TBreakpoint, Partial<TProps>>>;\n};\n\nexport type BreakpointForStyleSystem<TStyleSystem> =\n\tTStyleSystem extends ComponentStyleSystem<string, unknown, infer TMetadata>\n\t\t? MetadataBreakpoint<TMetadata>\n\t\t: never;\n\nexport function createResponsiveStyle<\n\tTProps extends object,\n\tTMode extends string,\n\tTToken,\n\tTMetadata extends {\n\t\tbreakpoint?: Record<string, string | number>;\n\t},\n>(input: {\n\tat: Partial<Record<string, Partial<TProps>>> | undefined;\n\tresolve: (props: Partial<TProps>) => RecipeStyle | undefined;\n\tstyleSystem: ComponentStyleSystem<TMode, TToken, TMetadata>;\n}): RecipeStyle | undefined {\n\tconst breakpoints = input.styleSystem.metadata.breakpoint;\n\tif (!breakpoints || !input.at) {\n\t\treturn undefined;\n\t}\n\n\tlet style: RecipeStyle | undefined;\n\tfor (const [name, props] of Object.entries(input.at)) {\n\t\tif (!props) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst breakpoint = breakpoints[name];\n\t\tif (breakpoint === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tstyle = mergeRecipeStyles(style, {\n\t\t\t[`@media (min-width: ${breakpoint})`]: input.resolve(props),\n\t\t});\n\t}\n\n\treturn style;\n}\n\nexport function createResponsiveRecipeStyle<\n\tTProps extends object,\n\tTCondition extends string,\n\tTMode extends string,\n\tTToken,\n\tTMetadata extends {\n\t\tbreakpoint?: Record<string, string | number>;\n\t},\n>(input: {\n\tat: Partial<Record<string, Partial<TProps>>> | undefined;\n\tconditions?: RecipeConditionSelectorMap;\n\tresolve: (\n\t\tprops: Partial<TProps>,\n\t) => ResolvedRecipeSlot<TCondition, RecipeStyle> | undefined;\n\tstyleSystem: ComponentStyleSystem<TMode, TToken, TMetadata>;\n}): RecipeStyle | undefined {\n\tconst breakpoints = input.styleSystem.metadata.breakpoint;\n\tif (!breakpoints || !input.at) {\n\t\treturn undefined;\n\t}\n\n\tlet style: RecipeStyle | undefined;\n\tfor (const [name, props] of Object.entries(input.at)) {\n\t\tif (!props) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst breakpoint = breakpoints[name];\n\t\tif (breakpoint === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst slot = input.resolve(props);\n\t\tif (!slot) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tstyle = mergeRecipeStyles(style, {\n\t\t\t[`@media (min-width: ${breakpoint})`]: createRecipeStyle({\n\t\t\t\tconditions: input.conditions,\n\t\t\t\tslot,\n\t\t\t}),\n\t\t});\n\t}\n\n\treturn style;\n}\n","import { css, type MixInput, type Props } from \"remix/ui\";\nimport {\n\tmergeRecipeStyles,\n\ttype RecipeStyle,\n\ttype ResolvedRecipeSlot,\n} from \"../../core/core.ts\";\nimport { createRecipeStyle, type RecipeConditionSelectorMap } from \"./recipe.ts\";\nimport { createResponsiveRecipeStyle } from \"./responsive.ts\";\nimport type { ComponentStyleSystem } from \"./types.ts\";\n\nconst component_scope_attribute = \"data-vorma-scope\";\nconst component_part_attribute = \"data-vorma-part\";\n\ntype ComponentRecipeStyleMetadata = {\n\tbreakpoint?: Record<string, string | number>;\n};\n\ntype ComponentStyleHostElementName = keyof HTMLElementTagNameMap;\n\nexport type ComponentStyleHostElementMap<THost extends string> = Partial<\n\tReadonly<Record<THost, ComponentStyleHostElementName>>\n>;\n\ntype ComponentStyleHostElement<\n\tTHost extends string,\n\tTHostElements extends ComponentStyleHostElementMap<THost>,\n\tTKey extends THost,\n> = TKey extends keyof THostElements\n\t? THostElements[TKey] extends ComponentStyleHostElementName\n\t\t? HTMLElementTagNameMap[THostElements[TKey]]\n\t\t: Element\n\t: Element;\n\nexport const componentAnatomyAttrs = {\n\tpart: component_part_attribute,\n\tscope: component_scope_attribute,\n} as const;\n\nexport type ComponentAnatomyAttrs = {\n\treadonly [component_part_attribute]: string;\n\treadonly [component_scope_attribute]: string;\n};\n\nexport type ComponentSlotProps<TElement extends keyof HTMLElementTagNameMap> = Omit<\n\tProps<TElement>,\n\t\"style\"\n> & {\n\tstyle?: never;\n};\n\ntype ComponentSlotOwnProps = {\n\tmix?: unknown;\n};\n\ntype ComponentSlotInputProps<TProps extends object> = TProps & ComponentSlotOwnProps;\n\nexport function createComponentSlotProps<TProps extends object = {}>(input: {\n\tattrs: ComponentAnatomyAttrs;\n\tmix?: unknown;\n\tprops?: ComponentSlotInputProps<TProps>;\n}): Omit<ComponentSlotInputProps<TProps>, \"mix\"> &\n\tComponentAnatomyAttrs & { mix: unknown[] } {\n\tconst { mix, ...props } = input.props ?? {};\n\tconst system_mix = Array.isArray(input.mix) ? input.mix : [input.mix];\n\tconst consumer_mix = Array.isArray(mix) ? mix : [mix];\n\n\treturn {\n\t\t...input.attrs,\n\t\t...props,\n\t\tmix: [...system_mix, ...consumer_mix],\n\t} as Omit<ComponentSlotInputProps<TProps>, \"mix\"> &\n\t\tComponentAnatomyAttrs & { mix: unknown[] };\n}\n\nexport type ComponentStyleTargetRecipeInput<\n\tTProps extends object,\n\tTCondition extends string,\n> = {\n\tconditions?: RecipeConditionSelectorMap;\n\tresolveSlot: (props: Partial<TProps>) => ResolvedRecipeSlot<TCondition, RecipeStyle>;\n\tresolveStyle?: (props: Partial<TProps>) => RecipeStyle | undefined;\n\tstyle?: RecipeStyle;\n};\n\nexport type ComponentStyleTargetInput<\n\tTProps extends object,\n\tTHost extends string,\n\tTCondition extends string,\n> = ComponentStyleTargetRecipeInput<TProps, TCondition> & {\n\thost: THost;\n\tselectors?: readonly string[];\n};\n\nexport type ComponentStyleTargetsInput<\n\tTProps extends object,\n\tTHost extends string,\n\tTTarget extends string,\n\tTCondition extends string,\n\tTMode extends string,\n\tTToken,\n\tTMetadata extends ComponentRecipeStyleMetadata,\n\tTHostElements extends ComponentStyleHostElementMap<THost> = {},\n> = {\n\tat?: Partial<Record<string, Partial<TProps>>>;\n\thostElements?: THostElements;\n\tprops: Partial<TProps>;\n\tstyleSystem: ComponentStyleSystem<TMode, TToken, TMetadata>;\n\ttargets: Record<TTarget, ComponentStyleTargetInput<TProps, THost, TCondition>>;\n};\n\nexport type ComponentStyleTargetOutput<TElement extends Element = Element> = {\n\tmix: MixInput<TElement>;\n\tstyle: RecipeStyle;\n};\n\nexport type ComponentStyleTargetsOutput<\n\tTHost extends string,\n\tTTarget extends string,\n\tTHostElements extends ComponentStyleHostElementMap<THost> = {},\n> = {\n\treadonly hosts: {\n\t\treadonly [K in THost]: ComponentStyleTargetOutput<\n\t\t\tComponentStyleHostElement<THost, THostElements, K>\n\t\t>;\n\t};\n\treadonly targets: {\n\t\treadonly [K in TTarget]: ComponentStyleTargetOutput;\n\t};\n};\n\nexport function createComponentAnatomyAttrs(\n\tscope: string,\n\tpart: string,\n): ComponentAnatomyAttrs {\n\treturn {\n\t\t[component_part_attribute]: part,\n\t\t[component_scope_attribute]: scope,\n\t};\n}\n\nfunction is_recipe_style(value: unknown): value is RecipeStyle {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction merge_style_value(\n\tstyle: Record<string, unknown>,\n\tkey: string,\n\tvalue: unknown,\n): void {\n\tconst current = style[key];\n\tif (is_recipe_style(current) && is_recipe_style(value)) {\n\t\tstyle[key] = merge_component_styles(current, value);\n\t\treturn;\n\t}\n\tstyle[key] = value;\n}\n\nfunction merge_component_styles(\n\t...styles: ReadonlyArray<RecipeStyle | undefined>\n): RecipeStyle {\n\tconst merged: Record<string, unknown> = {};\n\tfor (const style of styles) {\n\t\tif (style === undefined) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const [key, value] of Object.entries(style)) {\n\t\t\tmerge_style_value(merged, key, value);\n\t\t}\n\t}\n\treturn merged;\n}\n\nfunction is_style_at_rule(key: string): boolean {\n\treturn key.startsWith(\"@\");\n}\n\nfunction is_style_selector(key: string): boolean {\n\treturn key.startsWith(\"&\");\n}\n\nfunction combine_style_selectors(\n\tcondition_selector: string,\n\ttarget_selector: string,\n): string {\n\tif (target_selector.includes(\"&\")) {\n\t\treturn target_selector.replaceAll(\"&\", condition_selector);\n\t}\n\treturn `${condition_selector} ${target_selector}`;\n}\n\nfunction scope_style_to_selectors(\n\tstyle: RecipeStyle,\n\tselectors: readonly string[],\n): RecipeStyle {\n\tconst scoped: Record<string, unknown> = {};\n\n\tfor (const [key, value] of Object.entries(style)) {\n\t\tif (is_style_at_rule(key) && is_recipe_style(value)) {\n\t\t\tmerge_style_value(scoped, key, scope_style_to_selectors(value, selectors));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (is_style_selector(key) && is_recipe_style(value)) {\n\t\t\tfor (const selector of selectors) {\n\t\t\t\tmerge_style_value(scoped, combine_style_selectors(key, selector), value);\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const selector of selectors) {\n\t\t\tconst selector_style = scoped[selector];\n\t\t\tconst next_selector_style: Record<string, unknown> = is_recipe_style(\n\t\t\t\tselector_style,\n\t\t\t)\n\t\t\t\t? { ...selector_style }\n\t\t\t\t: {};\n\t\t\tmerge_style_value(next_selector_style, key, value);\n\t\t\tmerge_style_value(scoped, selector, next_selector_style);\n\t\t}\n\t}\n\n\treturn scoped;\n}\n\nfunction create_component_style_target_slot<\n\tTProps extends object,\n\tTCondition extends string,\n>(\n\ttarget: ComponentStyleTargetRecipeInput<TProps, TCondition>,\n\tprops: Partial<TProps>,\n): ResolvedRecipeSlot<TCondition, RecipeStyle> {\n\tconst slot = target.resolveSlot(props);\n\n\treturn {\n\t\tbase: mergeRecipeStyles(slot.base, target.resolveStyle?.(props)),\n\t\tconditions: slot.conditions,\n\t};\n}\n\nfunction create_component_style_target_recipe_style<\n\tTProps extends object,\n\tTCondition extends string,\n\tTMode extends string,\n\tTToken,\n\tTMetadata extends ComponentRecipeStyleMetadata,\n>(\n\tinput: {\n\t\tat?: Partial<Record<string, Partial<TProps>>>;\n\t\tprops: Partial<TProps>;\n\t\tstyleSystem: ComponentStyleSystem<TMode, TToken, TMetadata>;\n\t},\n\ttarget: ComponentStyleTargetRecipeInput<TProps, TCondition>,\n): RecipeStyle {\n\treturn createRecipeStyle({\n\t\tconditions: target.conditions,\n\t\tslot: create_component_style_target_slot(target, input.props),\n\t\tstyle: mergeRecipeStyles(\n\t\t\ttarget.style,\n\t\t\tcreateResponsiveRecipeStyle({\n\t\t\t\tat: input.at,\n\t\t\t\tconditions: target.conditions,\n\t\t\t\tresolve: (props) => {\n\t\t\t\t\treturn create_component_style_target_slot(target, {\n\t\t\t\t\t\t...input.props,\n\t\t\t\t\t\t...props,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tstyleSystem: input.styleSystem,\n\t\t\t}),\n\t\t),\n\t});\n}\n\nfunction create_component_style_output<TElement extends Element = Element>(\n\tstyle: RecipeStyle,\n): ComponentStyleTargetOutput<TElement> {\n\treturn {\n\t\tmix: css<TElement>(style as Parameters<typeof css>[0]),\n\t\tstyle,\n\t};\n}\n\nfunction create_component_style_target_style<\n\tTProps extends object,\n\tTHost extends string,\n\tTTarget extends string,\n\tTCondition extends string,\n\tTMode extends string,\n\tTToken,\n\tTMetadata extends ComponentRecipeStyleMetadata,\n\tTHostElements extends ComponentStyleHostElementMap<THost>,\n>(\n\tinput: ComponentStyleTargetsInput<\n\t\tTProps,\n\t\tTHost,\n\t\tTTarget,\n\t\tTCondition,\n\t\tTMode,\n\t\tTToken,\n\t\tTMetadata,\n\t\tTHostElements\n\t>,\n\ttarget: ComponentStyleTargetInput<TProps, THost, TCondition>,\n): RecipeStyle {\n\tconst style = create_component_style_target_recipe_style(input, target);\n\tif (target.selectors === undefined || target.selectors.length === 0) {\n\t\treturn style;\n\t}\n\treturn scope_style_to_selectors(style, target.selectors);\n}\n\nexport function createComponentStyleTargets<\n\tTProps extends object,\n\tTHost extends string,\n\tTTarget extends string,\n\tTCondition extends string,\n\tTMode extends string,\n\tTToken,\n\tTMetadata extends ComponentRecipeStyleMetadata,\n\tTHostElements extends ComponentStyleHostElementMap<THost> = {},\n>(\n\tinput: ComponentStyleTargetsInput<\n\t\tTProps,\n\t\tTHost,\n\t\tTTarget,\n\t\tTCondition,\n\t\tTMode,\n\t\tTToken,\n\t\tTMetadata,\n\t\tTHostElements\n\t>,\n): ComponentStyleTargetsOutput<THost, TTarget, THostElements> {\n\tconst host_styles: Partial<Record<THost, RecipeStyle>> = {};\n\tconst target_outputs: Partial<Record<TTarget, ComponentStyleTargetOutput>> = {};\n\n\tfor (const [target_name, target] of Object.entries(input.targets) as [\n\t\tTTarget,\n\t\tComponentStyleTargetInput<TProps, THost, TCondition>,\n\t][]) {\n\t\tconst target_style = create_component_style_target_style(input, target);\n\t\ttarget_outputs[target_name] = create_component_style_output(target_style);\n\t\thost_styles[target.host] = merge_component_styles(\n\t\t\thost_styles[target.host],\n\t\t\ttarget_style,\n\t\t);\n\t}\n\n\treturn {\n\t\thosts: Object.fromEntries(\n\t\t\tObject.entries(host_styles).map(([host, style]) => {\n\t\t\t\treturn [host, create_component_style_output(style as RecipeStyle)];\n\t\t\t}),\n\t\t) as unknown as ComponentStyleTargetsOutput<\n\t\t\tTHost,\n\t\t\tTTarget,\n\t\t\tTHostElements\n\t\t>[\"hosts\"],\n\t\ttargets: target_outputs as ComponentStyleTargetsOutput<\n\t\t\tTHost,\n\t\t\tTTarget,\n\t\t\tTHostElements\n\t\t>[\"targets\"],\n\t};\n}\n","import { componentDataAttribute } from \"./component-state.ts\";\nimport type { RecipeConditionSelectorMap } from \"./recipe.ts\";\n\nexport type CommonRecipeCondition =\n\t| \"active\"\n\t| \"disabled\"\n\t| \"focusVisible\"\n\t| \"hover\"\n\t| \"idle\"\n\t| \"invalid\"\n\t| \"placeholder\"\n\t| \"reducedMotion\"\n\t| \"selected\";\n\nexport const commonConditions = {\n\tactive: \"&:active\",\n\tdisabled: `&:disabled, &[aria-disabled='true'], &[${componentDataAttribute.disabled}]`,\n\tfocusVisible: \"&:focus-visible\",\n\thover: \"&:hover\",\n\tidle: \"&[data-idle='true']\",\n\tinvalid: `&:invalid, &[aria-invalid='true'], &[${componentDataAttribute.invalid}]`,\n\tplaceholder: \"&::placeholder\",\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n\tselected: `&[aria-selected='true'], &[${componentDataAttribute.selected}]`,\n} as const satisfies RecipeConditionSelectorMap<CommonRecipeCondition>;\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcomponentStateAttribute,\n\topenState,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type AccordionRecipeCondition = CommonRecipeCondition | \"closed\" | \"open\";\n\nexport type AccordionRecipeInput<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"item\" | \"panel\" | \"root\" | \"trigger\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type AccordionRecipeLayout<TRecipe extends AccordionRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type AccordionRecipeVariant<TRecipe extends AccordionRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"variant\">;\n\nexport type AccordionRecipeSize<TRecipe extends AccordionRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"size\">;\n\nexport type AccordionRecipeSelection<TRecipe extends AccordionRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\" | \"size\" | \"variant\">;\n\nexport type AccordionStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends AccordionRecipeInput = AccordionRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { accordion: TRecipe } }, TMetadata>;\n\nexport type AccordionValue = string | readonly string[] | null;\n\nexport type AccordionValueChangeDetails = {\n\tevent?: Event;\n};\n\nexport type AccordionValueChangeHandler = (\n\tvalue: AccordionValue,\n\tdetails?: AccordionValueChangeDetails,\n) => void;\n\nexport type AccordionRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type AccordionItemStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type AccordionRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tAccordionRootStyleProps<TLayout> &\n\tResponsiveProps<AccordionRootStyleProps<TLayout>, TBreakpoint> & {\n\t\tdefaultValue?: AccordionValue;\n\t\tmultiple?: boolean;\n\t\tonValueChange?: AccordionValueChangeHandler;\n\t\tstyle?: never;\n\t\tvalue?: AccordionValue;\n\t};\n\nexport type AccordionItemProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tAccordionItemStyleProps<TVariant, TSize> &\n\tResponsiveProps<AccordionItemStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t\tvalue: string;\n\t};\n\nexport type AccordionTriggerProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AccordionPanelProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AccordionComponents<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tItem: RemixComponent<AccordionItemProps<TVariant, TSize>, AccordionItemContext>;\n\tPanel: RemixComponent<AccordionPanelProps>;\n\tRoot: RemixComponent<AccordionRootProps<TLayout>, AccordionRootContext>;\n\tTrigger: RemixComponent<AccordionTriggerProps>;\n};\n\ntype AccordionRootContext = {\n\tget_multiple: () => boolean;\n\tis_open: (value: string) => boolean;\n\ttoggle_value: (value: string, details?: AccordionValueChangeDetails) => void;\n};\n\ntype AccordionItemContext = {\n\tget_at: () => Partial<Record<string, Partial<AccordionItemStyleProps>>> | undefined;\n\tget_open: () => boolean;\n\tget_panel_id: () => string;\n\tget_style_props: () => Partial<AccordionItemStyleProps>;\n\tget_trigger_id: () => string;\n\tget_value: () => string;\n\ttoggle: (details?: AccordionValueChangeDetails) => void;\n};\n\nconst accordion_scope = \"accordion\";\nconst button_type_default = \"button\";\nconst click_event = \"click\";\n\nconst accordion_conditions = mergeRecipeConditionSelectors<AccordionRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tclosed: `&[${componentStateAttribute}='${openState.closed}']`,\n\t\topen: `&[${componentStateAttribute}='${openState.open}']`,\n\t} satisfies RecipeConditionSelectorMap<AccordionRecipeCondition>,\n);\n\nfunction normalize_accordion_values(value: AccordionValue): readonly string[] {\n\tif (value === null) {\n\t\treturn [];\n\t}\n\tif (typeof value === \"string\") {\n\t\treturn [value];\n\t}\n\treturn value;\n}\n\nfunction format_accordion_value(\n\tvalues: readonly string[],\n\tmultiple: boolean,\n): AccordionValue {\n\treturn multiple ? values : (values[0] ?? null);\n}\n\nfunction toggle_accordion_value(\n\tvalues: readonly string[],\n\tvalue: string,\n\tmultiple: boolean,\n): readonly string[] {\n\tif (values.includes(value)) {\n\t\treturn values.filter((current_value) => {\n\t\t\treturn current_value !== value;\n\t\t});\n\t}\n\tif (multiple) {\n\t\treturn [...values, value];\n\t}\n\treturn [value];\n}\n\nexport function createAccordion<\n\tTMode extends string,\n\tTRecipe extends AccordionRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: AccordionStyleSystem<TMode, TRecipe, TMetadata>,\n): AccordionComponents<\n\tAccordionRecipeLayout<TRecipe>,\n\tAccordionRecipeVariant<TRecipe>,\n\tAccordionRecipeSize<TRecipe>\n> {\n\ttype TLayout = AccordionRecipeLayout<TRecipe>;\n\ttype TVariant = AccordionRecipeVariant<TRecipe>;\n\ttype TSize = AccordionRecipeSize<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = AccordionRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.accordion);\n\n\tfunction resolve_slot(\n\t\tslot: \"item\" | \"panel\" | \"root\" | \"trigger\",\n\t\tprops: Partial<AccordionRootStyleProps<TLayout>> &\n\t\t\tPartial<AccordionItemStyleProps<TVariant, TSize>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t\tsize: props.size,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<AccordionRootProps<TLayout, TBreakpoint>, AccordionRootContext>,\n\t): (props: AccordionRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tlet local_values = normalize_accordion_values(handle.props.defaultValue ?? null);\n\n\t\tfunction get_multiple(): boolean {\n\t\t\treturn handle.props.multiple === true;\n\t\t}\n\n\t\tfunction get_values(): readonly string[] {\n\t\t\treturn normalize_accordion_values(handle.props.value ?? local_values);\n\t\t}\n\n\t\tconst context: AccordionRootContext = {\n\t\t\tget_multiple,\n\t\t\tis_open: (value) => {\n\t\t\t\treturn get_values().includes(value);\n\t\t\t},\n\t\t\ttoggle_value: (value, details) => {\n\t\t\t\tconst next_values = toggle_accordion_value(\n\t\t\t\t\tget_values(),\n\t\t\t\t\tvalue,\n\t\t\t\t\tget_multiple(),\n\t\t\t\t);\n\t\t\t\tif (handle.props.value === undefined) {\n\t\t\t\t\tlocal_values = [...next_values];\n\t\t\t\t}\n\t\t\t\thandle.props.onValueChange?.(\n\t\t\t\t\tformat_accordion_value(next_values, get_multiple()),\n\t\t\t\t\tdetails,\n\t\t\t\t);\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: AccordionRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultValue: _default_value,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\tmultiple: _multiple,\n\t\t\t\tonValueChange: _on_value_change,\n\t\t\t\tvalue: _value,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: accordion_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"root\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(accordion_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Item(\n\t\thandle: Handle<\n\t\t\tAccordionItemProps<TVariant, TSize, TBreakpoint>,\n\t\t\tAccordionItemContext\n\t\t>,\n\t): (props: AccordionItemProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst root_context = handle.context.get(Root);\n\t\tconst context: AccordionItemContext = {\n\t\t\tget_at: () => {\n\t\t\t\treturn handle.props.at;\n\t\t\t},\n\t\t\tget_open: () => {\n\t\t\t\treturn root_context.is_open(handle.props.value);\n\t\t\t},\n\t\t\tget_panel_id: () => {\n\t\t\t\treturn `${handle.id}-panel`;\n\t\t\t},\n\t\t\tget_style_props: () => {\n\t\t\t\treturn {\n\t\t\t\t\tsize: handle.props.size,\n\t\t\t\t\tvariant: handle.props.variant,\n\t\t\t\t};\n\t\t\t},\n\t\t\tget_trigger_id: () => {\n\t\t\t\treturn `${handle.id}-trigger`;\n\t\t\t},\n\t\t\tget_value: () => {\n\t\t\t\treturn handle.props.value;\n\t\t\t},\n\t\t\ttoggle: (details) => {\n\t\t\t\troot_context.toggle_value(handle.props.value, details);\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: AccordionItemProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\tvalue: _value,\n\t\t\t\tvariant,\n\t\t\t\t...item_props\n\t\t\t} = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\titem: {\n\t\t\t\t\t\thost: \"item\",\n\t\t\t\t\t\tconditions: accordion_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"item\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(accordion_scope, \"item\"),\n\t\t\t\t\tmix: parts.hosts.item.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...item_props,\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<AccordionTriggerProps>,\n\t): (props: AccordionTriggerProps) => RemixNode {\n\t\tconst item_context = handle.context.get(Item);\n\n\t\treturn (props: AccordionTriggerProps): RemixNode => {\n\t\t\tconst { children, mix, type = button_type_default, ...trigger_props } = props;\n\t\t\tconst open = item_context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat: item_context.get_at(),\n\t\t\t\ttargets: {\n\t\t\t\t\ttrigger: {\n\t\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\t\tconditions: accordion_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"trigger\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: item_context.get_style_props(),\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(accordion_scope, \"trigger\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\titem_context.toggle({ event });\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-controls\": item_context.get_panel_id(),\n\t\t\t\t\t\t\"aria-expanded\": open,\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\tid: trigger_props.id ?? item_context.get_trigger_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Panel(\n\t\thandle: Handle<AccordionPanelProps>,\n\t): (props: AccordionPanelProps) => RemixNode {\n\t\tconst item_context = handle.context.get(Item);\n\n\t\treturn (props: AccordionPanelProps): RemixNode => {\n\t\t\tconst { children, mix, ...panel_props } = props;\n\t\t\tconst open = item_context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat: item_context.get_at(),\n\t\t\t\ttargets: {\n\t\t\t\t\tpanel: {\n\t\t\t\t\t\thost: \"panel\",\n\t\t\t\t\t\tconditions: accordion_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"panel\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: item_context.get_style_props(),\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(accordion_scope, \"panel\"),\n\t\t\t\t\tmix: parts.hosts.panel.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...panel_props,\n\t\t\t\t\t\t\"aria-labelledby\": item_context.get_trigger_id(),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\thidden: !open,\n\t\t\t\t\t\tid: panel_props.id ?? item_context.get_panel_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: panel_props.role ?? \"region\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tItem,\n\t\tPanel,\n\t\tRoot,\n\t\tTrigger,\n\t};\n}\n","import {\n\tcreateElement,\n\tcreateMixin,\n\ton,\n\ttype ElementProps,\n\ttype Handle,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcomponentStateAttribute,\n\topenState,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type AlertDialogRecipeCondition = CommonRecipeCondition | \"closed\" | \"open\";\n\nexport type AlertDialogRecipeInput<TLayout extends string = string> =\n\tRecipeWithVariantGroups<\n\t\t\"action\" | \"cancel\" | \"description\" | \"overlay\" | \"popup\" | \"title\" | \"trigger\",\n\t\tstring,\n\t\tComponentStyle,\n\t\t{\n\t\t\tlayout: TLayout;\n\t\t}\n\t>;\n\nexport type AlertDialogRecipeLayout<TRecipe extends AlertDialogRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type AlertDialogRecipeSelection<TRecipe extends AlertDialogRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\">;\n\nexport type AlertDialogStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends AlertDialogRecipeInput = AlertDialogRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { alertDialog: TRecipe } }, TMetadata>;\n\nexport type AlertDialogOpenChangeReason = \"action\" | \"cancel\" | \"escape\" | \"trigger\";\n\nexport type AlertDialogOpenChangeDetails = {\n\tevent?: Event;\n\treason: AlertDialogOpenChangeReason;\n};\n\nexport type AlertDialogOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: AlertDialogOpenChangeDetails,\n) => void;\n\nexport type AlertDialogRootProps = {\n\tchildren?: RemixNode;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: AlertDialogOpenChangeHandler;\n\tonOpenChangeComplete?: AlertDialogOpenChangeHandler;\n\topen?: boolean;\n};\n\nexport type AlertDialogPopupStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type AlertDialogTriggerProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertDialogPopupProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"dialog\">, \"style\"> &\n\tAlertDialogPopupStyleProps<TLayout> &\n\tResponsiveProps<AlertDialogPopupStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type AlertDialogTitleProps = Omit<Props<\"h2\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertDialogDescriptionProps = Omit<Props<\"p\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertDialogActionProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertDialogCancelProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertDialogComponents<TLayout extends string = string> = {\n\tAction: RemixComponent<AlertDialogActionProps>;\n\tCancel: RemixComponent<AlertDialogCancelProps>;\n\tDescription: RemixComponent<AlertDialogDescriptionProps>;\n\tPopup: RemixComponent<AlertDialogPopupProps<TLayout>>;\n\tRoot: RemixComponent<AlertDialogRootProps, AlertDialogContext>;\n\tTitle: RemixComponent<AlertDialogTitleProps>;\n\tTrigger: RemixComponent<AlertDialogTriggerProps>;\n};\n\ntype AlertDialogContext = {\n\tget_description_id: () => string;\n\tget_open: () => boolean;\n\tget_title_id: () => string;\n\tset_open: (open: boolean, details?: AlertDialogOpenChangeDetails) => void;\n};\n\nconst alert_dialog_scope = \"alertDialog\";\nconst alert_dialog_role = \"alertdialog\";\nconst button_type_default = \"button\";\nconst cancel_event = \"cancel\";\nconst click_event = \"click\";\nconst close_event = \"close\";\nconst backdrop_selector = \"&::backdrop\";\n\nconst alert_dialog_conditions = mergeRecipeConditionSelectors<AlertDialogRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tclosed: `&[${componentStateAttribute}='${openState.closed}']`,\n\t\topen: `&[${componentStateAttribute}='${openState.open}'], &[open]`,\n\t} satisfies RecipeConditionSelectorMap<AlertDialogRecipeCondition>,\n);\n\nconst native_alert_dialog = createMixin<\n\tHTMLDialogElement,\n\t[\n\t\toptions: {\n\t\t\topen: boolean;\n\t\t},\n\t],\n\tElementProps\n>((handle) => {\n\tlet dialog: HTMLDialogElement | undefined;\n\tlet options = {\n\t\topen: false,\n\t};\n\n\tfunction sync(): void {\n\t\tif (!dialog) {\n\t\t\treturn;\n\t\t}\n\t\tif (options.open && !dialog.open) {\n\t\t\tdialog.showModal();\n\t\t\treturn;\n\t\t}\n\t\tif (!options.open && dialog.open) {\n\t\t\tdialog.close();\n\t\t}\n\t}\n\n\thandle.addEventListener(\"insert\", (event) => {\n\t\tdialog = event.node;\n\t\tsync();\n\t});\n\thandle.addEventListener(\"commit\", () => {\n\t\tsync();\n\t});\n\thandle.addEventListener(\"remove\", () => {\n\t\tdialog = undefined;\n\t});\n\n\treturn (next_options) => {\n\t\toptions = next_options;\n\t\treturn handle.element;\n\t};\n});\n\nexport function createAlertDialog<\n\tTMode extends string,\n\tTRecipe extends AlertDialogRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: AlertDialogStyleSystem<TMode, TRecipe, TMetadata>,\n): AlertDialogComponents<AlertDialogRecipeLayout<TRecipe>> {\n\ttype TLayout = AlertDialogRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.alertDialog);\n\n\tfunction resolve_slot(\n\t\tslot:\n\t\t\t| \"action\"\n\t\t\t| \"cancel\"\n\t\t\t| \"description\"\n\t\t\t| \"overlay\"\n\t\t\t| \"popup\"\n\t\t\t| \"title\"\n\t\t\t| \"trigger\",\n\t\tprops: Partial<AlertDialogPopupStyleProps<TLayout>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies AlertDialogRecipeSelection<TRecipe>).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<AlertDialogRootProps, AlertDialogContext>,\n\t): (props: AlertDialogRootProps) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? false;\n\t\tlet last_completed_open = handle.props.open ?? local_open;\n\t\tlet last_open_details: AlertDialogOpenChangeDetails | undefined;\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn handle.props.open ?? local_open;\n\t\t}\n\n\t\tconst context: AlertDialogContext = {\n\t\t\tget_description_id: () => {\n\t\t\t\treturn `${handle.id}-description`;\n\t\t\t},\n\t\t\tget_open,\n\t\t\tget_title_id: () => {\n\t\t\t\treturn `${handle.id}-title`;\n\t\t\t},\n\t\t\tset_open: (open, details) => {\n\t\t\t\tif (get_open() === open) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlast_open_details = details;\n\t\t\t\tif (handle.props.open === undefined) {\n\t\t\t\t\tlocal_open = open;\n\t\t\t\t}\n\t\t\t\thandle.props.onOpenChange?.(open, details);\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: AlertDialogRootProps): RemixNode => {\n\t\t\tconst current_open = get_open();\n\t\t\tif (current_open !== last_completed_open) {\n\t\t\t\tconst completed_open = current_open;\n\t\t\t\tconst completed_details = last_open_details;\n\t\t\t\tlast_completed_open = current_open;\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onOpenChangeComplete?.(completed_open, completed_details);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn props.children;\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<AlertDialogTriggerProps>,\n\t): (props: AlertDialogTriggerProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\treturn (props: AlertDialogTriggerProps): RemixNode => {\n\t\t\tconst { children, mix, type = button_type_default, ...trigger_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\ttrigger: {\n\t\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(\"trigger\", {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(alert_dialog_scope, \"trigger\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.set_open(true, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: \"trigger\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Popup(\n\t\thandle: Handle<AlertDialogPopupProps<TLayout, TBreakpoint>>,\n\t): (props: AlertDialogPopupProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\treturn (props: AlertDialogPopupProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...popup_props } = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\tpopup: \"dialog\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\toverlay: {\n\t\t\t\t\t\thost: \"popup\",\n\t\t\t\t\t\tconditions: alert_dialog_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"overlay\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: [backdrop_selector],\n\t\t\t\t\t},\n\t\t\t\t\tpopup: {\n\t\t\t\t\t\thost: \"popup\",\n\t\t\t\t\t\tconditions: alert_dialog_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"popup\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\treturn createElement(\n\t\t\t\t\"dialog\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(alert_dialog_scope, \"popup\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tnative_alert_dialog({ open }),\n\t\t\t\t\t\ton<HTMLDialogElement, typeof close_event>(\n\t\t\t\t\t\t\tclose_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.set_open(false, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: \"cancel\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLDialogElement, typeof cancel_event>(\n\t\t\t\t\t\t\tcancel_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.set_open(false, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: \"escape\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.popup.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...popup_props,\n\t\t\t\t\t\t\"aria-describedby\":\n\t\t\t\t\t\t\tpopup_props[\"aria-describedby\"] ??\n\t\t\t\t\t\t\tcontext.get_description_id(),\n\t\t\t\t\t\t\"aria-labelledby\":\n\t\t\t\t\t\t\tpopup_props[\"aria-labelledby\"] ?? context.get_title_id(),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: popup_props.role ?? alert_dialog_role,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_button_part(\n\t\tslot: \"action\" | \"cancel\",\n\t\treason: AlertDialogOpenChangeReason,\n\t): RemixComponent<AlertDialogActionProps | AlertDialogCancelProps> {\n\t\treturn (handle: Handle<AlertDialogActionProps>) => {\n\t\t\tconst context = handle.context.get(Root);\n\t\t\treturn (props: AlertDialogActionProps): RemixNode => {\n\t\t\t\tconst {\n\t\t\t\t\tchildren,\n\t\t\t\t\tmix,\n\t\t\t\t\ttype = button_type_default,\n\t\t\t\t\t...button_props\n\t\t\t\t} = props;\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn resolve_slot(slot, {});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} as Record<\n\t\t\t\t\t\ttypeof slot,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconditions: typeof commonConditions;\n\t\t\t\t\t\t\thost: typeof slot;\n\t\t\t\t\t\t\tresolveSlot: () => ReturnType<\n\t\t\t\t\t\t\t\ttypeof recipe.resolve\n\t\t\t\t\t\t\t>[\"slots\"][typeof slot];\n\t\t\t\t\t\t}\n\t\t\t\t\t>,\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\t\t\t\treturn createElement(\n\t\t\t\t\t\"button\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(alert_dialog_scope, slot),\n\t\t\t\t\t\tmix: [\n\t\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\t\tcontext.set_open(false, {\n\t\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\t\treason,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tparts.hosts[slot].mix,\n\t\t\t\t\t\t],\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...button_props,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction create_text_part<TElement extends \"h2\" | \"p\">(\n\t\telement: TElement,\n\t\tslot: \"description\" | \"title\",\n\t): RemixComponent<Omit<Props<TElement>, \"style\"> & { style?: never }> {\n\t\treturn (handle: Handle<Omit<Props<TElement>, \"style\">>) => {\n\t\t\tconst context = handle.context.get(Root);\n\t\t\treturn (\n\t\t\t\tprops: Omit<Props<TElement>, \"style\"> & { style?: never },\n\t\t\t): RemixNode => {\n\t\t\t\tconst { children, mix, ...text_props } = props;\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn resolve_slot(slot, {});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} as Record<\n\t\t\t\t\t\ttypeof slot,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconditions: typeof commonConditions;\n\t\t\t\t\t\t\thost: typeof slot;\n\t\t\t\t\t\t\tresolveSlot: () => ReturnType<\n\t\t\t\t\t\t\t\ttypeof recipe.resolve\n\t\t\t\t\t\t\t>[\"slots\"][typeof slot];\n\t\t\t\t\t\t}\n\t\t\t\t\t>,\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\t\t\t\treturn createElement(\n\t\t\t\t\telement,\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(alert_dialog_scope, slot),\n\t\t\t\t\t\tmix: parts.hosts[slot].mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...text_props,\n\t\t\t\t\t\t\tid:\n\t\t\t\t\t\t\t\ttext_props.id ??\n\t\t\t\t\t\t\t\t(slot === \"title\"\n\t\t\t\t\t\t\t\t\t? context.get_title_id()\n\t\t\t\t\t\t\t\t\t: context.get_description_id()),\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\treturn {\n\t\tAction: create_button_part(\"action\", \"action\"),\n\t\tCancel: create_button_part(\"cancel\", \"cancel\"),\n\t\tDescription: create_text_part(\"p\", \"description\"),\n\t\tPopup,\n\t\tRoot,\n\t\tTitle: create_text_part(\"h2\", \"title\"),\n\t\tTrigger,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nconst alert_slot = {\n\tdescription: \"description\",\n\ticon: \"icon\",\n\troot: \"root\",\n\ttitle: \"title\",\n} as const;\n\nexport type AlertRecipeSlot = (typeof alert_slot)[keyof typeof alert_slot];\n\nexport type AlertRecipeInput<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n> = RecipeWithVariantGroups<\n\tAlertRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\ttone: TTone;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type AlertRecipeTone<TRecipe extends AlertRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\n\nexport type AlertRecipeVariant<TRecipe extends AlertRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type AlertRecipeSelection<TRecipe extends AlertRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"tone\" | \"variant\">;\n\nexport type AlertStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends AlertRecipeInput = AlertRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { alert: TRecipe } }, TMetadata>;\n\nexport type AlertRootStyleProps<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n> = {\n\ttone?: TTone;\n\tvariant?: TVariant;\n};\n\nexport type AlertRootProps<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tAlertRootStyleProps<TTone, TVariant> &\n\tResponsiveProps<AlertRootStyleProps<TTone, TVariant>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type AlertIconProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertTitleProps = Omit<Props<\"h2\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertDescriptionProps = Omit<Props<\"p\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type AlertComponents<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n> = {\n\tDescription: RemixComponent<AlertDescriptionProps>;\n\tIcon: RemixComponent<AlertIconProps>;\n\tRoot: RemixComponent<AlertRootProps<TTone, TVariant>>;\n\tTitle: RemixComponent<AlertTitleProps>;\n};\n\nconst alert_scope = \"alert\";\nconst alert_role = \"alert\";\n\nexport function createAlert<\n\tTMode extends string,\n\tTRecipe extends AlertRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: AlertStyleSystem<TMode, TRecipe, TMetadata>,\n): AlertComponents<AlertRecipeTone<TRecipe>, AlertRecipeVariant<TRecipe>> {\n\ttype TTone = AlertRecipeTone<TRecipe>;\n\ttype TVariant = AlertRecipeVariant<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = AlertRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.alert);\n\n\tfunction resolve_slot(\n\t\tslot: AlertRecipeSlot,\n\t\tprops: Partial<AlertRootStyleProps<TTone, TVariant>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][AlertRecipeSlot] {\n\t\treturn recipe.resolve({\n\t\t\ttone: props.tone,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots[slot];\n\t}\n\n\tfunction Root(): (props: AlertRootProps<TTone, TVariant, TBreakpoint>) => RemixNode {\n\t\treturn (props: AlertRootProps<TTone, TVariant, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, mix, tone, variant, ...root_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(alert_slot.root, current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { tone, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(alert_scope, alert_slot.root),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: root_props.role ?? alert_role,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_static_part<TElement extends \"h2\" | \"p\" | \"span\">(\n\t\telement: TElement,\n\t\tslot: AlertRecipeSlot,\n\t): RemixComponent<Omit<Props<TElement>, \"style\"> & { style?: never }> {\n\t\treturn () => {\n\t\t\treturn (\n\t\t\t\tprops: Omit<Props<TElement>, \"style\"> & { style?: never },\n\t\t\t): RemixNode => {\n\t\t\t\tconst { children, mix, ...part_props } = props;\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn resolve_slot(slot, {});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} as Record<\n\t\t\t\t\t\ttypeof slot,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconditions: typeof commonConditions;\n\t\t\t\t\t\t\thost: typeof slot;\n\t\t\t\t\t\t\tresolveSlot: () => ReturnType<\n\t\t\t\t\t\t\t\ttypeof recipe.resolve\n\t\t\t\t\t\t\t>[\"slots\"][AlertRecipeSlot];\n\t\t\t\t\t\t}\n\t\t\t\t\t>,\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\n\t\t\t\treturn createElement(\n\t\t\t\t\telement,\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(alert_scope, slot),\n\t\t\t\t\t\tmix: parts.hosts[slot].mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...part_props,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\treturn {\n\t\tDescription: create_static_part(\"p\", alert_slot.description),\n\t\tIcon: create_static_part(\"span\", alert_slot.icon),\n\t\tRoot,\n\t\tTitle: create_static_part(\"h2\", alert_slot.title),\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport { mergeRecipeStyles, type RecipeStyle } from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type AspectRatioOverflow = \"auto\" | \"clip\" | \"hidden\" | \"visible\";\n\nexport type AspectRatioStyleProps = {\n\theight?: number | string;\n\tminHeight?: number | string;\n\toverflow?: AspectRatioOverflow;\n\tratio?: string;\n\twidth?: number | string;\n};\n\nexport type AspectRatioProps<TBreakpoint extends string = string> = Omit<\n\tProps<\"div\">,\n\t\"style\"\n> &\n\tAspectRatioStyleProps &\n\tResponsiveProps<AspectRatioStyleProps, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nconst root_style = {\n\tboxSizing: \"border-box\",\n\tdisplay: \"block\",\n\tminWidth: 0,\n\twidth: \"100%\",\n} as const satisfies RecipeStyle;\n\nfunction style_for_props(props: Partial<AspectRatioStyleProps>): RecipeStyle {\n\treturn {\n\t\taspectRatio: props.ratio,\n\t\theight: props.height,\n\t\tminHeight: props.minHeight,\n\t\toverflow: props.overflow,\n\t\twidth: props.width,\n\t};\n}\n\nconst aspect_ratio_scope = \"aspectRatio\";\n\nexport function createAspectRatio<\n\tTMode extends string,\n\tTMetadata extends { breakpoint?: Record<string, string | number> },\n>(\n\tstyle_system: ComponentStyleSystem<TMode, unknown, TMetadata>,\n): RemixComponent<AspectRatioProps<BreakpointForStyleSystem<typeof style_system>>> {\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\n\treturn () => {\n\t\treturn (props: AspectRatioProps<TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\theight,\n\t\t\t\tminHeight,\n\t\t\t\tmix,\n\t\t\t\toverflow,\n\t\t\t\tratio,\n\t\t\t\twidth,\n\t\t\t\t...div_props\n\t\t\t} = props;\n\t\t\tconst base_props = {\n\t\t\t\theight,\n\t\t\t\tminHeight,\n\t\t\t\toverflow,\n\t\t\t\tratio,\n\t\t\t\twidth,\n\t\t\t};\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: (style_props) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tbase: mergeRecipeStyles(\n\t\t\t\t\t\t\t\t\troot_style,\n\t\t\t\t\t\t\t\t\tstyle_for_props(style_props),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tconditions: {},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: base_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(aspect_ratio_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...div_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type RecipeConditionSelectorMap } from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type RootRecipeInput<TGroups extends Record<string, string>> =\n\tRecipeWithVariantGroups<\"root\", string, ComponentStyle, TGroups>;\n\nexport type RootStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends RootRecipeInput<Record<string, string>> = RootRecipeInput<\n\t\tRecord<string, string>\n\t>,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n\tTRecipeName extends string = string,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: Record<TRecipeName, TRecipe>;\n\t},\n\tTMetadata\n>;\n\nexport type RootVariantProps<\n\tTRecipe extends RootRecipeInput<Record<string, string>>,\n\tTGroups extends string,\n> = RecipeVariantPropsFor<TRecipe, TGroups>;\n\nexport type RootHostProps<TElement extends keyof HTMLElementTagNameMap> = Omit<\n\tProps<TElement>,\n\t\"style\"\n> & {\n\tas?: TElement;\n\tstyle?: never;\n};\n\nexport type RootComponentProps<\n\tTGroups extends string,\n\tTRecipe extends RootRecipeInput<Record<TGroups, string>>,\n\tTBreakpoint extends string,\n> = RootHostProps<keyof HTMLElementTagNameMap> &\n\tPartial<RecipeVariantPropsFor<TRecipe, TGroups>> &\n\tResponsiveProps<RecipeVariantPropsFor<TRecipe, TGroups>, TBreakpoint>;\n\nexport type RootComponent<\n\tTGroups extends string,\n\tTRecipe extends RootRecipeInput<Record<TGroups, string>>,\n\tTBreakpoint extends string,\n> = RemixComponent<RootComponentProps<TGroups, TRecipe, TBreakpoint>>;\n\nexport function createRootComponent<\n\tTRecipeName extends string,\n\tTDefaultElement extends keyof HTMLElementTagNameMap,\n\tTGroups extends string,\n\tTMode extends string,\n\tTRecipe extends RootRecipeInput<Record<TGroups, string>>,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: RootStyleSystem<TMode, TRecipe, TMetadata, TRecipeName>,\n\tinput: {\n\t\tconditions?: RecipeConditionSelectorMap;\n\t\tdefaultElement: TDefaultElement;\n\t\trecipeName: TRecipeName;\n\t\tresolveProps: (\n\t\t\tprops: Partial<RecipeVariantPropsFor<TRecipe, TGroups>>,\n\t\t) => RecipeVariantPropsFor<TRecipe, TGroups>;\n\t\tvariantProps: readonly TGroups[];\n\t},\n): RootComponent<TGroups, TRecipe, BreakpointForStyleSystem<typeof style_system>> {\n\ttype TProps = RecipeVariantPropsFor<TRecipe, TGroups>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\n\tconst recipe = createRecipe(style_system.token.recipe[input.recipeName]);\n\tconst conditions = input.conditions ?? commonConditions;\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TProps>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve(input.resolveProps(props)).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: RootHostProps<keyof HTMLElementTagNameMap> &\n\t\t\t\tPartial<TProps> &\n\t\t\t\tResponsiveProps<TProps, TBreakpoint>,\n\t\t): RemixNode => {\n\t\t\tconst { as, at, children, mix, ...host_props } = props as RootHostProps<\n\t\t\t\tkeyof HTMLElementTagNameMap\n\t\t\t> &\n\t\t\t\tPartial<TProps> &\n\t\t\t\tResponsiveProps<TProps, TBreakpoint>;\n\t\t\tconst element_props = { ...host_props };\n\t\t\tfor (const variant_prop of input.variantProps) {\n\t\t\t\tdelete (element_props as Record<string, unknown>)[variant_prop];\n\t\t\t}\n\t\t\tconst selected_props = input.resolveProps(host_props as Partial<TProps>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: selected_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\tas ?? input.defaultElement,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(input.recipeName, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...element_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import {\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantValue,\n} from \"../../core/core.ts\";\nimport type { BreakpointForStyleSystem } from \"./responsive.ts\";\nimport {\n\tcreateRootComponent,\n\ttype RootComponent,\n\ttype RootRecipeInput,\n\ttype RootStyleSystem,\n} from \"./root.ts\";\n\nexport type BadgeRecipeInput<\n\tTTone extends string = string,\n\tTSize extends string = string,\n> = RootRecipeInput<{\n\tsize: TSize;\n\ttone: TTone;\n}>;\n\nexport type BadgeRecipeTone<TRecipe extends BadgeRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\n\nexport type BadgeRecipeSize<TRecipe extends BadgeRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type BadgeStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends BadgeRecipeInput = BadgeRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = RootStyleSystem<TMode, TRecipe, TMetadata, \"badge\">;\n\nexport function createBadge<\n\tTMode extends string,\n\tTRecipe extends BadgeRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: BadgeStyleSystem<TMode, TRecipe, TMetadata>,\n): RootComponent<\n\t\"size\" | \"tone\",\n\tTRecipe,\n\tBreakpointForStyleSystem<BadgeStyleSystem<TMode, TRecipe, TMetadata>>\n> {\n\treturn createRootComponent(style_system, {\n\t\tdefaultElement: \"span\",\n\t\trecipeName: \"badge\",\n\t\tresolveProps: (props) => {\n\t\t\treturn {\n\t\t\t\tsize: props.size,\n\t\t\t\ttone: props.tone,\n\t\t\t};\n\t\t},\n\t\tvariantProps: [\"size\", \"tone\"],\n\t});\n}\n","import {\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantValue,\n} from \"../../core/core.ts\";\nimport type { BreakpointForStyleSystem } from \"./responsive.ts\";\nimport {\n\tcreateRootComponent,\n\ttype RootComponent,\n\ttype RootRecipeInput,\n\ttype RootStyleSystem,\n} from \"./root.ts\";\n\nexport type BoxRecipeInput<TLayout extends string = string> = RootRecipeInput<{\n\tlayout: TLayout;\n}>;\n\nexport type BoxRecipeLayout<TRecipe extends BoxRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type BoxStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends BoxRecipeInput = BoxRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = RootStyleSystem<TMode, TRecipe, TMetadata, \"box\">;\n\nexport function createBox<\n\tTMode extends string,\n\tTRecipe extends BoxRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: RootStyleSystem<TMode, TRecipe, TMetadata, \"box\">,\n): RootComponent<\n\t\"layout\",\n\tTRecipe,\n\tBreakpointForStyleSystem<RootStyleSystem<TMode, TRecipe, TMetadata, \"box\">>\n> {\n\treturn createRootComponent(style_system, {\n\t\tdefaultElement: \"div\",\n\t\trecipeName: \"box\",\n\t\tresolveProps: (props) => {\n\t\t\treturn {\n\t\t\t\tlayout: props.layout,\n\t\t\t};\n\t\t},\n\t\tvariantProps: [\"layout\"],\n\t});\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport { componentDataAttribute, dataFlag } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport const buttonAnatomy = {\n\tcontent: \"content\",\n\tloadingIndicator: \"loadingIndicator\",\n\tloadingIndicatorFrame: \"loadingIndicatorFrame\",\n\troot: \"root\",\n} as const;\n\nexport type ButtonRecipeSlot = (typeof buttonAnatomy)[keyof typeof buttonAnatomy];\n\nexport type ButtonRecipeCondition =\n\t| \"active\"\n\t| \"disabled\"\n\t| \"focusVisible\"\n\t| \"hover\"\n\t| \"reducedMotion\";\n\nexport type ButtonRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTLayout extends string = string,\n> = RecipeWithVariantGroups<\n\tButtonRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\tfluid: \"true\";\n\t\tlayout: TLayout;\n\t\tloading: \"true\";\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type ButtonRecipeVariant<TRecipe extends ButtonRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type ButtonRecipeSize<TRecipe extends ButtonRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type ButtonRecipeLayout<TRecipe extends ButtonRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type ButtonRecipeSelection<TRecipe extends ButtonRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"fluid\" | \"layout\" | \"loading\" | \"size\" | \"variant\">;\n\nexport type ButtonStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends ButtonRecipeInput = ButtonRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tbutton: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type ButtonStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTLayout extends string = string,\n> = {\n\tfluid?: boolean;\n\tlayout?: TLayout;\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\ntype ButtonHostProps = Props<\"button\">;\n\nexport type ButtonProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<ButtonHostProps, \"style\"> &\n\tButtonStyleProps<TVariant, TSize, TLayout> &\n\tResponsiveProps<ButtonStyleProps<TVariant, TSize, TLayout>, TBreakpoint> & {\n\t\tloading?: boolean;\n\t\tloadingIndicator?: RemixNode;\n\t\tloadingLabel?: string;\n\t\tstyle?: never;\n\t};\n\nexport type ButtonOptions = {\n\tconditions?: Partial<\n\t\tReadonly<Record<ButtonRecipeSlot, RecipeConditionSelectorMap<string>>>\n\t>;\n};\n\nconst button_conditions = {\n\tactive: \"&:active\",\n\tdisabled: \"&:disabled, &[aria-disabled='true']\",\n\tfocusVisible: \"&:focus-visible\",\n\thover: \"&:hover\",\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<ButtonRecipeCondition>;\n\nconst loading_indicator_conditions = {\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<ButtonRecipeCondition>;\n\nconst button_scope = \"button\";\nconst button_type_default = \"button\";\n\nexport function createButton<\n\tTMode extends string,\n\tTRecipe extends ButtonRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: ButtonStyleSystem<TMode, TRecipe, TMetadata>,\n\toptions: ButtonOptions = {},\n): RemixComponent<\n\tButtonProps<\n\t\tButtonRecipeVariant<TRecipe>,\n\t\tButtonRecipeSize<TRecipe>,\n\t\tButtonRecipeLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TVariant = ButtonRecipeVariant<TRecipe>;\n\ttype TSize = ButtonRecipeSize<TRecipe>;\n\ttype TLayout = ButtonRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TStyleProps = ButtonStyleProps<TVariant, TSize, TLayout> & {\n\t\tloading?: boolean;\n\t};\n\n\tconst button_recipe = createRecipe(style_system.token.recipe.button);\n\tconst resolve_slot = (\n\t\tslot: ButtonRecipeSlot,\n\t\tstyle_props: Partial<TStyleProps>,\n\t): ReturnType<typeof button_recipe.resolve>[\"slots\"][ButtonRecipeSlot] => {\n\t\tconst resolved = button_recipe.resolve({\n\t\t\tfluid: style_props.fluid ? \"true\" : undefined,\n\t\t\tlayout: style_props.layout,\n\t\t\tloading: style_props.loading ? \"true\" : undefined,\n\t\t\tsize: style_props.size,\n\t\t\tvariant: style_props.variant,\n\t\t} satisfies ButtonRecipeSelection<TRecipe>);\n\n\t\treturn resolved.slots[slot];\n\t};\n\n\treturn () => {\n\t\treturn (props: ButtonProps<TVariant, TSize, TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled = false,\n\t\t\t\tfluid = false,\n\t\t\t\tlayout,\n\t\t\t\tloading = false,\n\t\t\t\tloadingIndicator: loading_indicator,\n\t\t\t\tloadingLabel: loading_label,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvariant,\n\t\t\t\t...button_props\n\t\t\t} = props;\n\t\t\tconst style_props = {\n\t\t\t\tfluid,\n\t\t\t\tlayout,\n\t\t\t\tloading,\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t};\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\t[buttonAnatomy.content]: {\n\t\t\t\t\t\thost: buttonAnatomy.content,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tbutton_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[buttonAnatomy.content],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\n\t\t\t\t\t\t\t\tbuttonAnatomy.content,\n\t\t\t\t\t\t\t\tcurrent_style_props,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t[buttonAnatomy.loadingIndicator]: {\n\t\t\t\t\t\thost: buttonAnatomy.loadingIndicator,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tloading_indicator_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[buttonAnatomy.loadingIndicator],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\n\t\t\t\t\t\t\t\tbuttonAnatomy.loadingIndicator,\n\t\t\t\t\t\t\t\tcurrent_style_props,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t[buttonAnatomy.loadingIndicatorFrame]: {\n\t\t\t\t\t\thost: buttonAnatomy.loadingIndicatorFrame,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tbutton_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[buttonAnatomy.loadingIndicatorFrame],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\n\t\t\t\t\t\t\t\tbuttonAnatomy.loadingIndicatorFrame,\n\t\t\t\t\t\t\t\tcurrent_style_props,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t[buttonAnatomy.root]: {\n\t\t\t\t\t\thost: buttonAnatomy.root,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tbutton_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[buttonAnatomy.root],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(buttonAnatomy.root, current_style_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst is_disabled = disabled || loading;\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(button_scope, buttonAnatomy.root),\n\t\t\t\t\tmix: parts.hosts[buttonAnatomy.root].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...button_props,\n\t\t\t\t\t\t\"aria-busy\": loading || undefined,\n\t\t\t\t\t\t\"aria-label\": loading\n\t\t\t\t\t\t\t? (loading_label ?? props[\"aria-label\"])\n\t\t\t\t\t\t\t: props[\"aria-label\"],\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(is_disabled),\n\t\t\t\t\t\t[componentDataAttribute.loading]: dataFlag(loading),\n\t\t\t\t\t\tdisabled: is_disabled,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"span\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\tbutton_scope,\n\t\t\t\t\t\t\tbuttonAnatomy.content,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmix: parts.hosts[buttonAnatomy.content].mix,\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t),\n\t\t\t\tloading\n\t\t\t\t\t? createElement(\n\t\t\t\t\t\t\t\"span\",\n\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\t\t\tbutton_scope,\n\t\t\t\t\t\t\t\t\tbuttonAnatomy.loadingIndicatorFrame,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmix: parts.hosts[buttonAnatomy.loadingIndicatorFrame].mix,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\t\"aria-hidden\": \"true\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcreateElement(\n\t\t\t\t\t\t\t\t\"span\",\n\t\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\t\t\t\tbutton_scope,\n\t\t\t\t\t\t\t\t\t\tbuttonAnatomy.loadingIndicator,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tmix: parts.hosts[buttonAnatomy.loadingIndicator].mix,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\tloading_indicator,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t)\n\t\t\t\t\t: null,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentSlotProps,\n} from \"./component-style.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type CalloutRecipeInput<TTone extends string = string> = RecipeWithVariantGroups<\n\t\"content\" | \"icon\" | \"root\",\n\tnever,\n\tComponentStyle,\n\t{\n\t\ttone: TTone;\n\t}\n>;\n\nexport type CalloutRecipeTone<TRecipe extends CalloutRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\n\nexport type CalloutRecipeSelection<TRecipe extends CalloutRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"tone\">;\n\nexport type CalloutStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends CalloutRecipeInput = CalloutRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { callout: TRecipe } }, TMetadata>;\n\nexport type CalloutProps<TTone extends string = string> = Omit<Props<\"div\">, \"style\"> & {\n\tcontentProps?: ComponentSlotProps<\"div\">;\n\ticon?: RemixNode;\n\ticonProps?: ComponentSlotProps<\"span\">;\n\tstyle?: never;\n\ttone?: TTone;\n};\n\nconst callout_scope = \"callout\";\n\nexport function createCallout<\n\tTMode extends string,\n\tTRecipe extends CalloutRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: CalloutStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<CalloutProps<CalloutRecipeTone<TRecipe>>> {\n\ttype TTone = CalloutRecipeTone<TRecipe>;\n\tconst callout_recipe = createRecipe(style_system.token.recipe.callout);\n\n\treturn () => {\n\t\treturn (props: CalloutProps<TTone>): RemixNode => {\n\t\t\tconst { children, contentProps, icon, iconProps, tone, ...callout_props } =\n\t\t\t\tprops;\n\t\t\tconst { children: _content_children, ...content_props } = contentProps ?? {};\n\t\t\tconst { children: _icon_children, ...icon_props } = iconProps ?? {};\n\t\t\tconst resolved = callout_recipe.resolve({\n\t\t\t\ttone,\n\t\t\t} satisfies CalloutRecipeSelection<TRecipe>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\thost: \"content\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.content;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ticon: {\n\t\t\t\t\t\thost: \"icon\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.icon;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(callout_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: callout_props,\n\t\t\t\t}),\n\t\t\t\ticon === undefined\n\t\t\t\t\t? null\n\t\t\t\t\t: createElement(\n\t\t\t\t\t\t\t\"span\",\n\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(callout_scope, \"icon\"),\n\t\t\t\t\t\t\t\tmix: parts.hosts.icon.mix,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\t\"aria-hidden\": icon_props[\"aria-hidden\"] ?? \"true\",\n\t\t\t\t\t\t\t\t\t...icon_props,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ticon,\n\t\t\t\t\t\t),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"div\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(callout_scope, \"content\"),\n\t\t\t\t\t\tmix: parts.hosts.content.mix,\n\t\t\t\t\t\tprops: content_props,\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createMixin, type ElementProps } from \"remix/ui\";\n\nexport const formResetEvent = \"reset\";\n\nexport type FormResetMixinInput = {\n\tform?: string;\n\tonReset: (event: Event) => void;\n};\n\nfunction is_form_element(element: Element | null): element is HTMLFormElement {\n\tif (!element) {\n\t\treturn false;\n\t}\n\tconst view = element.ownerDocument.defaultView;\n\treturn view !== null && element instanceof view.HTMLFormElement;\n}\n\nfunction find_form_owner(\n\tnode: HTMLElement,\n\tform: string | undefined,\n): HTMLFormElement | null {\n\tif (form !== undefined) {\n\t\tconst element = node.ownerDocument.getElementById(form);\n\t\tif (is_form_element(element)) {\n\t\t\treturn element;\n\t\t}\n\t\treturn null;\n\t}\n\n\tconst closest_form = node.closest(\"form\");\n\tif (is_form_element(closest_form)) {\n\t\treturn closest_form;\n\t}\n\treturn null;\n}\n\nexport const formResetMixin = createMixin<\n\tHTMLElement,\n\t[input: FormResetMixinInput],\n\tElementProps\n>((handle) => {\n\tlet current_form: HTMLFormElement | null = null;\n\tlet current_input: FormResetMixinInput = {\n\t\tonReset: () => {},\n\t};\n\tlet current_node: HTMLElement | null = null;\n\n\tfunction handle_reset(event: Event): void {\n\t\tcurrent_input.onReset(event);\n\t}\n\n\tfunction set_form(form: HTMLFormElement | null): void {\n\t\tif (current_form === form) {\n\t\t\treturn;\n\t\t}\n\t\tcurrent_form?.removeEventListener(formResetEvent, handle_reset);\n\t\tcurrent_form = form;\n\t\tcurrent_form?.addEventListener(formResetEvent, handle_reset);\n\t}\n\n\tfunction sync_form_owner(node: HTMLElement): void {\n\t\tset_form(find_form_owner(node, current_input.form));\n\t}\n\n\thandle.addEventListener(\"insert\", (event) => {\n\t\tcurrent_node = event.node;\n\t\tsync_form_owner(event.node);\n\t});\n\thandle.addEventListener(\"commit\", (event) => {\n\t\tcurrent_node = event.node;\n\t\tsync_form_owner(event.node);\n\t});\n\thandle.addEventListener(\"remove\", () => {\n\t\tcurrent_node = null;\n\t\tset_form(null);\n\t});\n\n\treturn (input) => {\n\t\tcurrent_input = input;\n\t\tif (current_node) {\n\t\t\tsync_form_owner(current_node);\n\t\t}\n\t\treturn handle.element;\n\t};\n});\n","import { createMixin, type ElementProps } from \"remix/ui\";\nimport { componentStateAttribute } from \"./component-state.ts\";\nimport { formResetEvent } from \"./form-reset.ts\";\n\nexport const checkableStateAttribute = componentStateAttribute;\nexport const checkableState = {\n\tchecked: \"checked\",\n\tindeterminate: \"indeterminate\",\n\tunchecked: \"unchecked\",\n} as const;\nexport const checkableChangeEvent = \"change\";\n\nexport type CheckableStateName = (typeof checkableState)[keyof typeof checkableState];\n\nexport type CheckableChecked = boolean | typeof checkableState.indeterminate;\n\nexport type CheckableCheckedChangeDetails = {\n\tevent?: Event;\n};\n\nexport type CheckableCheckedChangeHandler = (\n\tchecked: CheckableChecked,\n\tdetails?: CheckableCheckedChangeDetails,\n) => void;\n\nexport type CheckableStateMixinInput = {\n\tallowIndeterminate?: boolean;\n\tchecked: CheckableChecked | undefined;\n\tdefaultChecked: CheckableChecked | undefined;\n\tdisabled?: boolean;\n\tonCheckedChange?: CheckableCheckedChangeHandler;\n\treadOnly?: boolean;\n};\n\nfunction is_checkable_indeterminate(\n\tvalue: CheckableChecked | undefined,\n\tallow_indeterminate: boolean,\n): boolean {\n\treturn allow_indeterminate && value === checkableState.indeterminate;\n}\n\nexport function checkableInitialChecked(value: CheckableChecked | undefined): boolean {\n\treturn value === true;\n}\n\nexport function checkableStateFromValue(\n\tvalue: CheckableChecked | undefined,\n\tallow_indeterminate = true,\n): CheckableStateName {\n\tif (is_checkable_indeterminate(value, allow_indeterminate)) {\n\t\treturn checkableState.indeterminate;\n\t}\n\treturn value === true ? checkableState.checked : checkableState.unchecked;\n}\n\nfunction checkable_dom_state(\n\tnode: HTMLInputElement,\n\tallow_indeterminate: boolean,\n): CheckableStateName {\n\tif (allow_indeterminate && node.indeterminate) {\n\t\treturn checkableState.indeterminate;\n\t}\n\treturn node.checked ? checkableState.checked : checkableState.unchecked;\n}\n\nfunction checkable_value_from_state(state: CheckableStateName): CheckableChecked {\n\tif (state === checkableState.indeterminate) {\n\t\treturn checkableState.indeterminate;\n\t}\n\treturn state === checkableState.checked;\n}\n\nfunction set_checkable_value(\n\tnode: HTMLInputElement,\n\tvalue: CheckableChecked,\n\tallow_indeterminate: boolean,\n): void {\n\tnode.checked = value === true;\n\tnode.indeterminate = is_checkable_indeterminate(value, allow_indeterminate);\n}\n\nfunction sync_checkable_state_attribute(\n\tnode: HTMLInputElement,\n\tallow_indeterminate: boolean,\n): CheckableChecked {\n\tconst state = checkable_dom_state(node, allow_indeterminate);\n\tnode.setAttribute(checkableStateAttribute, state);\n\treturn checkable_value_from_state(state);\n}\n\nfunction sync_checkable_state(\n\tnode: HTMLInputElement,\n\tstate: CheckableStateMixinInput,\n\tinitial: boolean,\n): CheckableChecked {\n\tconst allow_indeterminate = state.allowIndeterminate !== false;\n\tif (state.checked !== undefined) {\n\t\tset_checkable_value(node, state.checked, allow_indeterminate);\n\t\treturn sync_checkable_state_attribute(node, allow_indeterminate);\n\t}\n\n\tif (initial && state.defaultChecked !== undefined) {\n\t\tset_checkable_value(node, state.defaultChecked, allow_indeterminate);\n\t}\n\treturn sync_checkable_state_attribute(node, allow_indeterminate);\n}\n\nexport const checkableStateMixin = createMixin<\n\tHTMLInputElement,\n\t[state: CheckableStateMixinInput],\n\tElementProps\n>((handle) => {\n\tlet current_form: HTMLFormElement | null = null;\n\tlet current_node: HTMLInputElement | undefined;\n\tlet current_state: CheckableStateMixinInput = {\n\t\tchecked: undefined,\n\t\tdefaultChecked: undefined,\n\t};\n\tlet current_value: CheckableChecked = false;\n\n\tfunction handle_change(event: Event): void {\n\t\tconst node = event.currentTarget as HTMLInputElement;\n\t\tconst allow_indeterminate = current_state.allowIndeterminate !== false;\n\t\tif (current_state.disabled === true || current_state.readOnly === true) {\n\t\t\tset_checkable_value(node, current_value, allow_indeterminate);\n\t\t\tsync_checkable_state_attribute(node, allow_indeterminate);\n\t\t\treturn;\n\t\t}\n\n\t\tconst next_value = sync_checkable_state_attribute(node, allow_indeterminate);\n\t\tif (Object.is(current_value, next_value)) {\n\t\t\treturn;\n\t\t}\n\t\tcurrent_value = next_value;\n\t\tcurrent_state.onCheckedChange?.(next_value, { event });\n\t}\n\n\tfunction handle_reset(): void {\n\t\tconst node = current_node;\n\t\tif (!node) {\n\t\t\treturn;\n\t\t}\n\t\tqueueMicrotask(() => {\n\t\t\tif (node !== current_node) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcurrent_value = sync_checkable_state(node, current_state, true);\n\t\t});\n\t}\n\n\tfunction set_form(form: HTMLFormElement | null): void {\n\t\tif (current_form === form) {\n\t\t\treturn;\n\t\t}\n\t\tcurrent_form?.removeEventListener(formResetEvent, handle_reset);\n\t\tcurrent_form = form;\n\t\tcurrent_form?.addEventListener(formResetEvent, handle_reset);\n\t}\n\n\tfunction sync_form_owner(node: HTMLInputElement): void {\n\t\tset_form(node.form);\n\t}\n\n\thandle.addEventListener(\"insert\", (event) => {\n\t\tcurrent_node = event.node;\n\t\tcurrent_node.addEventListener(checkableChangeEvent, handle_change);\n\t\tsync_form_owner(current_node);\n\t\tcurrent_value = sync_checkable_state(current_node, current_state, true);\n\t});\n\thandle.addEventListener(\"commit\", (event) => {\n\t\tsync_form_owner(event.node);\n\t\tcurrent_value = sync_checkable_state(event.node, current_state, false);\n\t});\n\thandle.addEventListener(\"remove\", () => {\n\t\tcurrent_node?.removeEventListener(checkableChangeEvent, handle_change);\n\t\tcurrent_node = undefined;\n\t\tset_form(null);\n\t});\n\n\treturn (state) => {\n\t\tcurrent_state = state;\n\t\tif (current_node) {\n\t\t\tsync_checkable_state(current_node, current_state, false);\n\t\t}\n\t\treturn handle.element;\n\t};\n});\n","export type ControllableStateChangeHandler<TValue, TDetails> = (\n\tvalue: TValue,\n\tdetails: TDetails,\n) => void;\n\nexport type ControllableState<TValue, TDetails> = {\n\tget: () => TValue;\n\tisControlled: () => boolean;\n\tset: (value: TValue, details: TDetails) => boolean;\n};\n\nexport type ControllableStateInput<TValue, TDetails> = {\n\tequals?: (left: TValue, right: TValue) => boolean;\n\tgetControlled: () => TValue | undefined;\n\tgetLocal: () => TValue;\n\tgetOnChange: () => ControllableStateChangeHandler<TValue, TDetails> | undefined;\n\tsetLocal: (value: TValue) => void;\n};\n\nfunction default_state_equals<TValue>(left: TValue, right: TValue): boolean {\n\treturn Object.is(left, right);\n}\n\nexport function create_controllable_state<TValue, TDetails>(\n\tinput: ControllableStateInput<TValue, TDetails>,\n): ControllableState<TValue, TDetails> {\n\tconst equals = input.equals ?? default_state_equals;\n\n\tfunction is_controlled(): boolean {\n\t\treturn input.getControlled() !== undefined;\n\t}\n\n\tfunction get(): TValue {\n\t\tconst controlled = input.getControlled();\n\t\tif (controlled !== undefined) {\n\t\t\treturn controlled;\n\t\t}\n\t\treturn input.getLocal();\n\t}\n\n\tfunction set(value: TValue, details: TDetails): boolean {\n\t\tif (equals(get(), value)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!is_controlled()) {\n\t\t\tinput.setLocal(value);\n\t\t}\n\t\tinput.getOnChange()?.(value, details);\n\t\treturn true;\n\t}\n\n\treturn {\n\t\tget,\n\t\tisControlled: is_controlled,\n\t\tset,\n\t};\n}\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcheckableChangeEvent,\n\tcheckableInitialChecked,\n\tcheckableState,\n\tcheckableStateAttribute,\n\tcheckableStateFromValue,\n\tcheckableStateMixin,\n} from \"./checkable-state.ts\";\nimport { ariaTrue, componentDataAttribute, dataFlag } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport { create_controllable_state } from \"./controllable-state.ts\";\nimport { formResetMixin } from \"./form-reset.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type CheckboxGroupRecipeCondition =\n\t| CommonRecipeCondition\n\t| \"checked\"\n\t| \"unchecked\";\n\nexport type CheckboxGroupRecipeInput<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"item\" | \"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type CheckboxGroupRecipeLayout<TRecipe extends CheckboxGroupRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type CheckboxGroupRecipeVariant<TRecipe extends CheckboxGroupRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"variant\">;\n\nexport type CheckboxGroupRecipeSize<TRecipe extends CheckboxGroupRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"size\">;\n\nexport type CheckboxGroupRecipeSelection<TRecipe extends CheckboxGroupRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\" | \"size\" | \"variant\">;\n\nexport type CheckboxGroupStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends CheckboxGroupRecipeInput = CheckboxGroupRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tcheckboxGroup: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type CheckboxGroupValueChangeDetails = {\n\tevent?: Event;\n};\n\nexport type CheckboxGroupValueChangeHandler<TValue extends string = string> = (\n\tvalue: readonly TValue[],\n\tdetails?: CheckboxGroupValueChangeDetails,\n) => void;\n\nexport type CheckboxGroupRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type CheckboxGroupItemStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type CheckboxGroupRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tCheckboxGroupRootStyleProps<TLayout> &\n\tResponsiveProps<CheckboxGroupRootStyleProps<TLayout>, TBreakpoint> & {\n\t\tdefaultValue?: readonly TValue[];\n\t\tdisabled?: boolean;\n\t\tform?: string;\n\t\tname?: string;\n\t\tonValueChange?: CheckboxGroupValueChangeHandler<TValue>;\n\t\treadOnly?: boolean;\n\t\trequired?: boolean;\n\t\tstyle?: never;\n\t\tvalue?: readonly TValue[];\n\t};\n\nexport type CheckboxGroupItemProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<\n\tProps<\"input\">,\n\t\"checked\" | \"defaultChecked\" | \"name\" | \"style\" | \"type\" | \"value\"\n> &\n\tCheckboxGroupItemStyleProps<TVariant, TSize> &\n\tResponsiveProps<CheckboxGroupItemStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t\tvalue: TValue;\n\t};\n\nexport type CheckboxGroupComponents<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tItem: RemixComponent<CheckboxGroupItemProps<TVariant, TSize>>;\n\tRoot: RemixComponent<CheckboxGroupRootProps<TLayout>, CheckboxGroupContext>;\n};\n\ntype CheckboxGroupContext = {\n\tget_disabled: () => boolean;\n\tget_form: () => string | undefined;\n\tget_name: () => string | undefined;\n\tget_read_only: () => boolean;\n\tget_required: () => boolean;\n\tget_values: () => readonly string[];\n\tset_item_checked: (\n\t\tvalue: string,\n\t\tchecked: boolean,\n\t\tdetails?: CheckboxGroupValueChangeDetails,\n\t) => void;\n};\n\nconst checkbox_group_scope = \"checkboxGroup\";\nconst checkbox_group_role = \"group\";\nconst checkbox_type = \"checkbox\";\n\nconst item_conditions = mergeRecipeConditionSelectors<CheckboxGroupRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tchecked: `&[${checkableStateAttribute}='${checkableState.checked}']`,\n\t\tunchecked: `&[${checkableStateAttribute}='${checkableState.unchecked}']`,\n\t} satisfies RecipeConditionSelectorMap<CheckboxGroupRecipeCondition>,\n);\n\nfunction add_value(values: readonly string[], value: string): readonly string[] {\n\tif (values.includes(value)) {\n\t\treturn values;\n\t}\n\treturn [...values, value];\n}\n\nfunction remove_value(values: readonly string[], value: string): readonly string[] {\n\treturn values.filter((current_value) => {\n\t\treturn current_value !== value;\n\t});\n}\n\nfunction is_same_values(left: readonly string[], right: readonly string[]): boolean {\n\treturn (\n\t\tleft.length === right.length &&\n\t\tleft.every((left_value, index) => {\n\t\t\treturn left_value === right[index];\n\t\t})\n\t);\n}\n\nexport function createCheckboxGroup<\n\tTMode extends string,\n\tTRecipe extends CheckboxGroupRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: CheckboxGroupStyleSystem<TMode, TRecipe, TMetadata>,\n): CheckboxGroupComponents<\n\tCheckboxGroupRecipeLayout<TRecipe>,\n\tCheckboxGroupRecipeVariant<TRecipe>,\n\tCheckboxGroupRecipeSize<TRecipe>\n> {\n\ttype TLayout = CheckboxGroupRecipeLayout<TRecipe>;\n\ttype TVariant = CheckboxGroupRecipeVariant<TRecipe>;\n\ttype TSize = CheckboxGroupRecipeSize<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = CheckboxGroupRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.checkboxGroup);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<CheckboxGroupRootStyleProps<TLayout>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies TSelection).slots.root;\n\t}\n\n\tfunction resolve_item_slot(\n\t\tprops: Partial<CheckboxGroupItemStyleProps<TVariant, TSize>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"item\"] {\n\t\treturn recipe.resolve({\n\t\t\tsize: props.size,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots.item;\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<\n\t\t\tCheckboxGroupRootProps<TLayout, TBreakpoint>,\n\t\t\tCheckboxGroupContext\n\t\t>,\n\t): (props: CheckboxGroupRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tlet local_values = [...(handle.props.defaultValue ?? [])];\n\t\tconst values_state = create_controllable_state<\n\t\t\treadonly string[],\n\t\t\tCheckboxGroupValueChangeDetails\n\t\t>({\n\t\t\tequals: is_same_values,\n\t\t\tgetControlled: () => {\n\t\t\t\treturn handle.props.value;\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_values;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onValueChange;\n\t\t\t},\n\t\t\tsetLocal: (values) => {\n\t\t\t\tlocal_values = [...values];\n\t\t\t},\n\t\t});\n\n\t\tfunction reset_values(): void {\n\t\t\tif (handle.props.value !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlocal_values = [...(handle.props.defaultValue ?? [])];\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tconst context: CheckboxGroupContext = {\n\t\t\tget_disabled: () => {\n\t\t\t\treturn handle.props.disabled === true;\n\t\t\t},\n\t\t\tget_form: () => {\n\t\t\t\treturn handle.props.form;\n\t\t\t},\n\t\t\tget_name: () => {\n\t\t\t\treturn handle.props.name;\n\t\t\t},\n\t\t\tget_read_only: () => {\n\t\t\t\treturn handle.props.readOnly === true;\n\t\t\t},\n\t\t\tget_required: () => {\n\t\t\t\treturn handle.props.required === true;\n\t\t\t},\n\t\t\tget_values: () => {\n\t\t\t\treturn values_state.get();\n\t\t\t},\n\t\t\tset_item_checked: (value, checked, details) => {\n\t\t\t\tconst current_values = values_state.get();\n\t\t\t\tconst next_values = checked\n\t\t\t\t\t? add_value(current_values, value)\n\t\t\t\t\t: remove_value(current_values, value);\n\t\t\t\tconst changed = values_state.set(next_values, details ?? {});\n\t\t\t\tif (changed) {\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: CheckboxGroupRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultValue: _default_value,\n\t\t\t\tdisabled,\n\t\t\t\tform: _form,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\tname: _name,\n\t\t\t\tonValueChange: _on_value_change,\n\t\t\t\treadOnly,\n\t\t\t\trequired: _required,\n\t\t\t\tvalue: _value,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(checkbox_group_scope, \"root\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tformResetMixin({\n\t\t\t\t\t\t\tform: _form,\n\t\t\t\t\t\t\tonReset: () => {\n\t\t\t\t\t\t\t\treset_values();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.root.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(disabled === true),\n\t\t\t\t\t\t\"aria-required\": ariaTrue(_required === true),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(_required === true),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: root_props.role ?? checkbox_group_role,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Item(\n\t\thandle: Handle<CheckboxGroupItemProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: CheckboxGroupItemProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (\n\t\t\tprops: CheckboxGroupItemProps<TVariant, TSize, TBreakpoint>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tdisabled,\n\t\t\t\tform,\n\t\t\t\tmix,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\tsize,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t\t...item_props\n\t\t\t} = props;\n\t\t\tconst checked = context.get_values().includes(value);\n\t\t\tconst is_disabled = context.get_disabled() || disabled === true;\n\t\t\tconst is_read_only = context.get_read_only() || readOnly === true;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\titem: \"input\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\titem: {\n\t\t\t\t\t\thost: \"item\",\n\t\t\t\t\t\tconditions: item_conditions,\n\t\t\t\t\t\tresolveSlot: resolve_item_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"input\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(checkbox_group_scope, \"item\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tcheckableStateMixin({\n\t\t\t\t\t\t\tallowIndeterminate: false,\n\t\t\t\t\t\t\tchecked,\n\t\t\t\t\t\t\tdefaultChecked: undefined,\n\t\t\t\t\t\t\tdisabled: is_disabled,\n\t\t\t\t\t\t\treadOnly: is_read_only,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ton<HTMLInputElement, typeof checkableChangeEvent>(\n\t\t\t\t\t\t\tcheckableChangeEvent,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tif (is_disabled || is_read_only) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontext.set_item_checked(\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tevent.currentTarget.checked,\n\t\t\t\t\t\t\t\t\t{ event },\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.item.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...item_props,\n\t\t\t\t\t\t[checkableStateAttribute]: checkableStateFromValue(\n\t\t\t\t\t\t\tchecked,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(is_disabled),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(is_read_only),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\tchecked: checkableInitialChecked(checked),\n\t\t\t\t\t\tdisabled: is_disabled || undefined,\n\t\t\t\t\t\tform: form ?? context.get_form(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\tname: context.get_name(),\n\t\t\t\t\t\treadOnly: is_read_only || undefined,\n\t\t\t\t\t\trequired: required === true || undefined,\n\t\t\t\t\t\ttype: checkbox_type,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tItem,\n\t\tRoot,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcheckableInitialChecked,\n\tcheckableState,\n\tcheckableStateAttribute,\n\tcheckableStateFromValue,\n\tcheckableStateMixin,\n\ttype CheckableChecked,\n\ttype CheckableCheckedChangeDetails,\n\ttype CheckableCheckedChangeHandler,\n} from \"./checkable-state.ts\";\nimport { componentDataAttribute, dataFlag } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type CheckboxRecipeCondition =\n\t| CommonRecipeCondition\n\t| \"checked\"\n\t| \"indeterminate\"\n\t| \"unchecked\";\n\nexport type CheckboxChecked = CheckableChecked;\n\nexport type CheckboxCheckedChangeDetails = CheckableCheckedChangeDetails;\n\nexport type CheckboxCheckedChangeHandler = CheckableCheckedChangeHandler;\n\nexport type CheckboxRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type CheckboxRecipeVariant<TRecipe extends CheckboxRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"variant\">;\n\nexport type CheckboxRecipeSize<TRecipe extends CheckboxRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type CheckboxRecipeSelection<TRecipe extends CheckboxRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"size\" | \"variant\">;\n\nexport type CheckboxStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends CheckboxRecipeInput = CheckboxRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tcheckbox: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type CheckboxProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"input\">, \"checked\" | \"defaultChecked\" | \"style\" | \"type\"> &\n\tPartial<CheckboxRecipeSelection<CheckboxRecipeInput<TVariant, TSize>>> &\n\tResponsiveProps<\n\t\tCheckboxRecipeSelection<CheckboxRecipeInput<TVariant, TSize>>,\n\t\tTBreakpoint\n\t> & {\n\t\tchecked?: CheckboxChecked;\n\t\tdefaultChecked?: CheckboxChecked;\n\t\tonCheckedChange?: CheckboxCheckedChangeHandler;\n\t\tstyle?: never;\n\t};\n\nconst checkbox_scope = \"checkbox\";\nconst checkbox_type = \"checkbox\";\n\nconst checkbox_conditions = mergeRecipeConditionSelectors<CheckboxRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tchecked: `&[${checkableStateAttribute}='${checkableState.checked}']`,\n\t\tindeterminate: `&[${checkableStateAttribute}='${checkableState.indeterminate}']`,\n\t\tunchecked: `&[${checkableStateAttribute}='${checkableState.unchecked}']`,\n\t} satisfies RecipeConditionSelectorMap<CheckboxRecipeCondition>,\n);\n\nexport function createCheckbox<\n\tTMode extends string,\n\tTRecipe extends CheckboxRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: CheckboxStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tCheckboxProps<\n\t\tCheckboxRecipeVariant<TRecipe>,\n\t\tCheckboxRecipeSize<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TSelection = CheckboxRecipeSelection<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.checkbox);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TSelection>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve(props).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: CheckboxProps<\n\t\t\t\tCheckboxRecipeVariant<TRecipe>,\n\t\t\t\tCheckboxRecipeSize<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchecked,\n\t\t\t\tdefaultChecked,\n\t\t\t\tdisabled,\n\t\t\t\tmix,\n\t\t\t\tonCheckedChange,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst selection = {\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t} satisfies TSelection;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\troot: \"input\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: checkbox_conditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: selection,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"input\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(checkbox_scope, \"root\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tcheckableStateMixin({\n\t\t\t\t\t\t\tchecked,\n\t\t\t\t\t\t\tdefaultChecked,\n\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\tonCheckedChange,\n\t\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.root.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[checkableStateAttribute]: checkableStateFromValue(\n\t\t\t\t\t\t\tchecked ?? defaultChecked,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tchecked:\n\t\t\t\t\t\t\tchecked === undefined\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: checkableInitialChecked(checked),\n\t\t\t\t\t\tdefaultChecked:\n\t\t\t\t\t\t\tchecked === undefined\n\t\t\t\t\t\t\t\t? checkableInitialChecked(defaultChecked)\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\trequired,\n\t\t\t\t\t\ttype: checkbox_type,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type ChipRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tselected: \"false\" | \"true\";\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type ChipRecipeVariant<TRecipe extends ChipRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type ChipRecipeSize<TRecipe extends ChipRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type ChipRecipeSelection<TRecipe extends ChipRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"selected\" | \"size\" | \"variant\"\n>;\n\nexport type ChipStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends ChipRecipeInput = ChipRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tchip: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type ChipStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tselected?: boolean;\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type ChipProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\"> &\n\tChipStyleProps<TVariant, TSize> &\n\tResponsiveProps<ChipStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nconst button_type_default = \"button\";\nconst chip_scope = \"chip\";\n\nexport function createChip<\n\tTMode extends string,\n\tTRecipe extends ChipRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: ChipStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tChipProps<\n\t\tChipRecipeVariant<TRecipe>,\n\t\tChipRecipeSize<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TSelection = ChipRecipeSelection<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.chip);\n\n\tfunction selection(\n\t\tinput: ChipStyleProps<ChipRecipeVariant<TRecipe>, ChipRecipeSize<TRecipe>>,\n\t): TSelection {\n\t\treturn {\n\t\t\tselected: input.selected ? \"true\" : \"false\",\n\t\t\tsize: input.size,\n\t\t\tvariant: input.variant,\n\t\t} satisfies TSelection;\n\t}\n\n\tfunction resolve_root_slot(\n\t\tprops: ChipStyleProps<ChipRecipeVariant<TRecipe>, ChipRecipeSize<TRecipe>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve(selection(props)).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: ChipProps<\n\t\t\t\tChipRecipeVariant<TRecipe>,\n\t\t\t\tChipRecipeSize<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\tselected = false,\n\t\t\t\tsize,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvariant,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst style_props = { selected, size, variant };\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(chip_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-pressed\": selected,\n\t\t\t\t\t\t\"data-selected\": selected || undefined,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentSlotProps,\n} from \"./component-style.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type CodeBlockRecipeInput = RecipeWithVariantGroups<\n\t\"caption\" | \"code\" | \"header\" | \"pre\" | \"root\",\n\tnever,\n\tComponentStyle,\n\tRecord<string, never>\n>;\n\nexport type CodeBlockStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends CodeBlockRecipeInput = CodeBlockRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { codeBlock: TRecipe } }, TMetadata>;\n\nexport type CodeBlockProps = Omit<Props<\"figure\">, \"style\"> & {\n\tcaption?: RemixNode;\n\tcaptionProps?: ComponentSlotProps<\"figcaption\">;\n\tcodeProps?: ComponentSlotProps<\"code\">;\n\theader?: RemixNode;\n\theaderProps?: ComponentSlotProps<\"div\">;\n\tpreProps?: ComponentSlotProps<\"pre\">;\n\tstyle?: never;\n};\n\nconst code_block_scope = \"codeBlock\";\n\nexport function createCodeBlock<\n\tTMode extends string,\n\tTRecipe extends CodeBlockRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: CodeBlockStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<CodeBlockProps> {\n\tconst code_block_recipe = createRecipe(style_system.token.recipe.codeBlock);\n\n\treturn () => {\n\t\treturn (props: CodeBlockProps): RemixNode => {\n\t\t\tconst {\n\t\t\t\tcaption,\n\t\t\t\tcaptionProps: caption_props_input,\n\t\t\t\tchildren,\n\t\t\t\tcodeProps: code_props,\n\t\t\t\theader,\n\t\t\t\theaderProps: header_props,\n\t\t\t\tpreProps: pre_props,\n\t\t\t\t...figure_props\n\t\t\t} = props;\n\t\t\tconst resolved = code_block_recipe.resolve();\n\t\t\tconst {\n\t\t\t\tchildren: _code_children,\n\t\t\t\tmix: code_mix,\n\t\t\t\t...code_host_props\n\t\t\t} = code_props ?? {};\n\t\t\tconst {\n\t\t\t\tchildren: _pre_children,\n\t\t\t\tmix: pre_mix,\n\t\t\t\t...pre_host_props\n\t\t\t} = pre_props ?? {};\n\t\t\tconst { children: _header_children, ...header_host_props } =\n\t\t\t\theader_props ?? {};\n\t\t\tconst { children: _caption_children, ...caption_host_props } =\n\t\t\t\tcaption_props_input ?? {};\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tcaption: {\n\t\t\t\t\t\thost: \"caption\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.caption;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tcode: {\n\t\t\t\t\t\thost: \"code\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.code;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\theader: {\n\t\t\t\t\t\thost: \"header\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.header;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tpre: {\n\t\t\t\t\t\thost: \"pre\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.pre;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\thostElements: {\n\t\t\t\t\tcaption: \"figcaption\",\n\t\t\t\t\tcode: \"code\",\n\t\t\t\t\theader: \"div\",\n\t\t\t\t\tpre: \"pre\",\n\t\t\t\t\troot: \"figure\",\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"figure\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(code_block_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: figure_props,\n\t\t\t\t}),\n\t\t\t\theader === undefined\n\t\t\t\t\t? null\n\t\t\t\t\t: createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\t\t\tcode_block_scope,\n\t\t\t\t\t\t\t\t\t\"header\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmix: parts.hosts.header.mix,\n\t\t\t\t\t\t\t\tprops: header_host_props,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\theader,\n\t\t\t\t\t\t),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"pre\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(code_block_scope, \"pre\"),\n\t\t\t\t\t\tmix: parts.hosts.pre.mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...pre_host_props,\n\t\t\t\t\t\t\tmix: pre_mix,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tcreateElement(\n\t\t\t\t\t\t\"code\",\n\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(code_block_scope, \"code\"),\n\t\t\t\t\t\t\tmix: parts.hosts.code.mix,\n\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t...code_host_props,\n\t\t\t\t\t\t\t\tmix: code_mix,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tcaption === undefined\n\t\t\t\t\t? null\n\t\t\t\t\t: createElement(\n\t\t\t\t\t\t\t\"figcaption\",\n\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\t\t\tcode_block_scope,\n\t\t\t\t\t\t\t\t\t\"caption\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmix: parts.hosts.caption.mix,\n\t\t\t\t\t\t\t\tprops: caption_host_props,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcaption,\n\t\t\t\t\t\t),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcomponentStateAttribute,\n\topenState,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type CollapsibleRecipeCondition = CommonRecipeCondition | \"closed\" | \"open\";\n\nexport type CollapsibleRecipeInput<TLayout extends string = string> =\n\tRecipeWithVariantGroups<\n\t\t\"content\" | \"root\" | \"trigger\",\n\t\tstring,\n\t\tComponentStyle,\n\t\t{\n\t\t\tlayout: TLayout;\n\t\t}\n\t>;\n\nexport type CollapsibleRecipeLayout<TRecipe extends CollapsibleRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type CollapsibleRecipeSelection<TRecipe extends CollapsibleRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\">;\n\nexport type CollapsibleStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends CollapsibleRecipeInput = CollapsibleRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { collapsible: TRecipe } }, TMetadata>;\n\nexport type CollapsibleOpenChangeDetails = {\n\tevent?: Event;\n\treason: \"trigger\";\n};\n\nexport type CollapsibleOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: CollapsibleOpenChangeDetails,\n) => void;\n\nexport type CollapsibleRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type CollapsibleRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tCollapsibleRootStyleProps<TLayout> &\n\tResponsiveProps<CollapsibleRootStyleProps<TLayout>, TBreakpoint> & {\n\t\tdefaultOpen?: boolean;\n\t\tonOpenChange?: CollapsibleOpenChangeHandler;\n\t\tonOpenChangeComplete?: CollapsibleOpenChangeHandler;\n\t\topen?: boolean;\n\t\tstyle?: never;\n\t};\n\nexport type CollapsibleTriggerProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type CollapsibleContentProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type CollapsibleComponents<TLayout extends string = string> = {\n\tContent: RemixComponent<CollapsibleContentProps>;\n\tRoot: RemixComponent<CollapsibleRootProps<TLayout>, CollapsibleContext>;\n\tTrigger: RemixComponent<CollapsibleTriggerProps>;\n};\n\ntype CollapsibleContext = {\n\tget_content_id: () => string;\n\tget_open: () => boolean;\n\tget_trigger_id: () => string;\n\ttoggle: (details: CollapsibleOpenChangeDetails) => void;\n};\n\nconst collapsible_scope = \"collapsible\";\nconst button_type_default = \"button\";\nconst click_event = \"click\";\n\nconst collapsible_conditions = mergeRecipeConditionSelectors<CollapsibleRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tclosed: `&[${componentStateAttribute}='${openState.closed}']`,\n\t\topen: `&[${componentStateAttribute}='${openState.open}']`,\n\t} satisfies RecipeConditionSelectorMap<CollapsibleRecipeCondition>,\n);\n\nexport function createCollapsible<\n\tTMode extends string,\n\tTRecipe extends CollapsibleRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: CollapsibleStyleSystem<TMode, TRecipe, TMetadata>,\n): CollapsibleComponents<CollapsibleRecipeLayout<TRecipe>> {\n\ttype TLayout = CollapsibleRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.collapsible);\n\n\tfunction resolve_slot(\n\t\tslot: \"content\" | \"root\" | \"trigger\",\n\t\tprops: Partial<CollapsibleRootStyleProps<TLayout>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies CollapsibleRecipeSelection<TRecipe>).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<CollapsibleRootProps<TLayout, TBreakpoint>, CollapsibleContext>,\n\t): (props: CollapsibleRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? false;\n\t\tlet last_completed_open = handle.props.open ?? local_open;\n\t\tlet last_open_details: CollapsibleOpenChangeDetails | undefined;\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn handle.props.open ?? local_open;\n\t\t}\n\n\t\tfunction request_open(\n\t\t\topen: boolean,\n\t\t\tdetails: CollapsibleOpenChangeDetails,\n\t\t): void {\n\t\t\tif (get_open() === open) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlast_open_details = details;\n\t\t\tif (handle.props.open === undefined) {\n\t\t\t\tlocal_open = open;\n\t\t\t}\n\t\t\thandle.props.onOpenChange?.(open, details);\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tconst context: CollapsibleContext = {\n\t\t\tget_content_id: () => {\n\t\t\t\treturn `${handle.id}-content`;\n\t\t\t},\n\t\t\tget_open,\n\t\t\tget_trigger_id: () => {\n\t\t\t\treturn `${handle.id}-trigger`;\n\t\t\t},\n\t\t\ttoggle: (details) => {\n\t\t\t\trequest_open(!get_open(), details);\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: CollapsibleRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultOpen: _default_open,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\tonOpenChange: _on_open_change,\n\t\t\t\tonOpenChangeComplete: _on_open_change_complete,\n\t\t\t\topen: _open,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst current_open = get_open();\n\t\t\tif (current_open !== last_completed_open) {\n\t\t\t\tconst completed_open = current_open;\n\t\t\t\tconst completed_details = last_open_details;\n\t\t\t\tlast_completed_open = current_open;\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onOpenChangeComplete?.(completed_open, completed_details);\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: collapsible_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"root\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(collapsible_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(current_open),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<CollapsibleTriggerProps>,\n\t): (props: CollapsibleTriggerProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: CollapsibleTriggerProps): RemixNode => {\n\t\t\tconst { children, mix, type = button_type_default, ...trigger_props } = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\ttrigger: {\n\t\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\t\tconditions: collapsible_conditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(\"trigger\", {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(collapsible_scope, \"trigger\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.toggle({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: \"trigger\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-controls\": context.get_content_id(),\n\t\t\t\t\t\t\"aria-expanded\": open,\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\tid: trigger_props.id ?? context.get_trigger_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Content(\n\t\thandle: Handle<CollapsibleContentProps>,\n\t): (props: CollapsibleContentProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: CollapsibleContentProps): RemixNode => {\n\t\t\tconst { children, mix, ...content_props } = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tcontent: {\n\t\t\t\t\t\thost: \"content\",\n\t\t\t\t\t\tconditions: collapsible_conditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(\"content\", {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(collapsible_scope, \"content\"),\n\t\t\t\t\tmix: parts.hosts.content.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...content_props,\n\t\t\t\t\t\t\"aria-labelledby\": context.get_trigger_id(),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\thidden: !open,\n\t\t\t\t\t\tid: content_props.id ?? context.get_content_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tContent,\n\t\tRoot,\n\t\tTrigger,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentSlotProps,\n} from \"./component-style.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type DescriptionListRecipeInput<\n\tTTone extends string = string,\n\tTDescriptionTone extends string = string,\n\tTLayout extends string = string,\n> = RecipeWithVariantGroups<\n\t\"description\" | \"item\" | \"root\" | \"term\",\n\tnever,\n\tComponentStyle,\n\t{\n\t\tdescriptionTone: TDescriptionTone;\n\t\tlayout: TLayout;\n\t\ttone: TTone;\n\t}\n>;\n\nexport type DescriptionListRecipeTone<TRecipe extends DescriptionListRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"tone\">;\nexport type DescriptionListRecipeDescriptionTone<\n\tTRecipe extends DescriptionListRecipeInput,\n> = RecipeVariantValue<TRecipe, \"descriptionTone\">;\nexport type DescriptionListLayout<TRecipe extends DescriptionListRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type DescriptionListRecipeSelection<TRecipe extends DescriptionListRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"descriptionTone\" | \"layout\" | \"tone\">;\n\nexport type DescriptionListStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends DescriptionListRecipeInput = DescriptionListRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { descriptionList: TRecipe } }, TMetadata>;\n\nexport type DescriptionListProps = Omit<Props<\"dl\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type DescriptionListItemStyleProps<\n\tTDescriptionTone extends string = string,\n\tTTone extends string = string,\n\tTLayout extends string = string,\n> = {\n\tdescriptionTone?: TDescriptionTone;\n\tlayout?: TLayout;\n\ttone?: TTone;\n};\n\nexport type DescriptionListItemProps<\n\tTDescriptionTone extends string = string,\n\tTTone extends string = string,\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tDescriptionListItemStyleProps<TDescriptionTone, TTone, TLayout> &\n\tResponsiveProps<\n\t\tDescriptionListItemStyleProps<TDescriptionTone, TTone, TLayout>,\n\t\tTBreakpoint\n\t> & {\n\t\tdescriptionProps?: ComponentSlotProps<\"dd\">;\n\t\tstyle?: never;\n\t\tterm: RemixNode;\n\t\ttermProps?: ComponentSlotProps<\"dt\">;\n\t};\n\nconst layout_style: Record<\n\tstring,\n\t{\n\t\tdescription?: ComponentStyle;\n\t\titem?: ComponentStyle;\n\t}\n> = {\n\trow: {},\n\tstacked: {\n\t\tdescription: {\n\t\t\ttextAlign: \"left\",\n\t\t},\n\t\titem: {\n\t\t\talignItems: \"flex-start\",\n\t\t\tflexDirection: \"column\",\n\t\t},\n\t},\n};\nconst description_list_scope = \"descriptionList\";\n\nexport function createDescriptionList<\n\tTMode extends string,\n\tTRecipe extends DescriptionListRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: DescriptionListStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<DescriptionListProps> {\n\tconst description_list_recipe = createRecipe(\n\t\tstyle_system.token.recipe.descriptionList,\n\t);\n\n\treturn () => {\n\t\treturn (props: DescriptionListProps): RemixNode => {\n\t\t\tconst { children, ...listProps } = props;\n\t\t\tconst resolved = description_list_recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"dl\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(description_list_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: listProps,\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createDescriptionListItem<\n\tTMode extends string,\n\tTRecipe extends DescriptionListRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: DescriptionListStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tDescriptionListItemProps<\n\t\tDescriptionListRecipeDescriptionTone<TRecipe>,\n\t\tDescriptionListRecipeTone<TRecipe>,\n\t\tDescriptionListLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TDescriptionTone = DescriptionListRecipeDescriptionTone<TRecipe>;\n\ttype TTone = DescriptionListRecipeTone<TRecipe>;\n\ttype TLayout = DescriptionListLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\n\tconst description_list_recipe = createRecipe(\n\t\tstyle_system.token.recipe.descriptionList,\n\t);\n\n\tfunction resolve(\n\t\tprops: Partial<DescriptionListItemStyleProps<TDescriptionTone, TTone, TLayout>>,\n\t): ReturnType<typeof description_list_recipe.resolve> {\n\t\treturn description_list_recipe.resolve({\n\t\t\tdescriptionTone: props.descriptionTone,\n\t\t\tlayout: props.layout,\n\t\t\ttone: props.tone,\n\t\t} satisfies DescriptionListRecipeSelection<TRecipe>);\n\t}\n\n\tfunction item_style(\n\t\tprops: Partial<DescriptionListItemStyleProps<TDescriptionTone, TTone, TLayout>>,\n\t): ComponentStyle | undefined {\n\t\tconst layout = props.layout ? layout_style[props.layout] : undefined;\n\t\treturn layout?.item;\n\t}\n\n\tfunction description_style(\n\t\tprops: Partial<DescriptionListItemStyleProps<TDescriptionTone, TTone, TLayout>>,\n\t): ComponentStyle | undefined {\n\t\tconst layout = props.layout ? layout_style[props.layout] : undefined;\n\t\treturn layout?.description;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: DescriptionListItemProps<\n\t\t\t\tTDescriptionTone,\n\t\t\t\tTTone,\n\t\t\t\tTLayout,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdescriptionProps,\n\t\t\t\tdescriptionTone,\n\t\t\t\tlayout,\n\t\t\t\tterm,\n\t\t\t\ttermProps,\n\t\t\t\ttone,\n\t\t\t\t...itemProps\n\t\t\t} = props;\n\t\t\tconst { children: _description_children, ...description_props } =\n\t\t\t\tdescriptionProps ?? {};\n\t\t\tconst { children: _term_children, ...term_props } = termProps ?? {};\n\t\t\tconst style_props = { descriptionTone, layout, tone };\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\tdescription: {\n\t\t\t\t\t\thost: \"description\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve(current_style_props).slots.description;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tresolveStyle: description_style,\n\t\t\t\t\t},\n\t\t\t\t\titem: {\n\t\t\t\t\t\thost: \"item\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve(current_style_props).slots.item;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tresolveStyle: item_style,\n\t\t\t\t\t},\n\t\t\t\t\tterm: {\n\t\t\t\t\t\thost: \"term\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve(current_style_props).slots.term;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(description_list_scope, \"item\"),\n\t\t\t\t\tmix: parts.hosts.item.mix,\n\t\t\t\t\tprops: itemProps,\n\t\t\t\t}),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"dt\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\tdescription_list_scope,\n\t\t\t\t\t\t\t\"term\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmix: parts.hosts.term.mix,\n\t\t\t\t\t\tprops: term_props,\n\t\t\t\t\t}),\n\t\t\t\t\tterm,\n\t\t\t\t),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"dd\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\tdescription_list_scope,\n\t\t\t\t\t\t\t\"description\",\n\t\t\t\t\t\t),\n\t\t\t\t\t\tmix: parts.hosts.description.mix,\n\t\t\t\t\t\tprops: description_props,\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t),\n\t\t\t);\n\t\t};\n\t};\n}\n","import {\n\tcreateElement,\n\tcreateMixin,\n\ton,\n\ttype ElementProps,\n\ttype Handle,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n\ttype ResolvedRecipeSlot,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { type RecipeConditionSelectorMap } from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type DialogRequiredRecipeSlot =\n\t| \"close\"\n\t| \"description\"\n\t| \"popup\"\n\t| \"title\"\n\t| \"trigger\";\n\nexport type DialogRecipeSlot = DialogRequiredRecipeSlot | \"overlay\";\n\nexport type DialogRecipeCondition =\n\t| \"active\"\n\t| \"disabled\"\n\t| \"focusVisible\"\n\t| \"hover\"\n\t| \"modal\"\n\t| \"open\"\n\t| \"reducedMotion\";\n\nexport type DialogRecipeInput<TPopupLayout extends string = string> =\n\tRecipeWithVariantGroups<\n\t\tDialogRequiredRecipeSlot,\n\t\tstring,\n\t\tComponentStyle,\n\t\t{\n\t\t\tpopupLayout: TPopupLayout;\n\t\t}\n\t>;\n\nexport type DialogRecipePopupLayout<TRecipe extends DialogRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"popupLayout\">;\nexport type DialogRecipeSelection<TRecipe extends DialogRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"popupLayout\">;\n\nexport type DialogStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends DialogRecipeInput = DialogRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { dialog: TRecipe } }, TMetadata>;\n\nconst dialog_open_change_reason = {\n\tclose: \"close\",\n\tescape: \"escape\",\n\tinteractOutside: \"interactOutside\",\n\ttrigger: \"trigger\",\n} as const;\n\nexport type DialogOpenChangeReason =\n\t(typeof dialog_open_change_reason)[keyof typeof dialog_open_change_reason];\n\nexport type DialogOpenChangeDetails = {\n\tevent?: Event;\n\treason: DialogOpenChangeReason;\n};\n\nexport type DialogOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: DialogOpenChangeDetails,\n) => void;\n\nexport type DialogProps = {\n\tchildren?: RemixNode;\n\tcloseOnInteractOutside?: boolean;\n\tdefaultOpen?: boolean;\n\tmodal?: boolean;\n\tonOpenChange?: DialogOpenChangeHandler;\n\tonOpenChangeComplete?: DialogOpenChangeHandler;\n\topen?: boolean;\n\tshouldCloseOnInteractOutside?: (element: Element) => boolean;\n};\n\nexport type DialogTriggerProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type DialogPopupStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type DialogPopupProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"dialog\">, \"style\"> &\n\tDialogPopupStyleProps<TLayout> &\n\tResponsiveProps<DialogPopupStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type DialogOverlayProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type DialogTitleProps = Omit<Props<\"h2\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type DialogDescriptionProps = Omit<Props<\"p\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type DialogCloseProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type DialogComponents<TPopupLayout extends string = string> = {\n\tClose: RemixComponent<DialogCloseProps>;\n\tDescription: RemixComponent<DialogDescriptionProps>;\n\tOverlay: RemixComponent<DialogOverlayProps>;\n\tPopup: RemixComponent<DialogPopupProps<TPopupLayout>>;\n\tRoot: RemixComponent<DialogProps, DialogRuntimeContext>;\n\tTitle: RemixComponent<DialogTitleProps>;\n\tTrigger: RemixComponent<DialogTriggerProps>;\n};\n\ntype DialogRuntimeContext = {\n\tcloseOnInteractOutside: () => boolean;\n\tisModal: () => boolean;\n\tisOpen: () => boolean;\n\tshouldCloseOnInteractOutside: () => ((element: Element) => boolean) | undefined;\n\tsetOpen: (open: boolean, details?: DialogOpenChangeDetails) => void;\n};\n\nconst action_conditions = {\n\tactive: \"&:active\",\n\tdisabled: \"&:disabled, &[aria-disabled='true']\",\n\tfocusVisible: \"&:focus-visible\",\n\thover: \"&:hover\",\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<DialogRecipeCondition>;\n\nconst popup_conditions = {\n\tmodal: \"&[data-modal='true']\",\n\topen: \"&[open]\",\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<DialogRecipeCondition>;\n\nconst dialog_scope = \"dialog\";\nconst dialog_backdrop_selector = \"&::backdrop\";\nconst click_event = \"click\";\nconst close_event = \"close\";\nconst cancel_event = \"cancel\";\nconst button_type_default = \"button\";\nconst empty_dialog_overlay_slot = {\n\tbase: {},\n\tconditions: {},\n} as const satisfies ResolvedRecipeSlot<DialogRecipeCondition, ComponentStyle>;\n\nconst native_dialog = createMixin<\n\tHTMLDialogElement,\n\t[\n\t\toptions: {\n\t\t\tmodal: boolean;\n\t\t\topen: boolean;\n\t\t},\n\t],\n\tElementProps\n>((handle) => {\n\tlet dialog: HTMLDialogElement | undefined;\n\tlet options: {\n\t\tmodal: boolean;\n\t\topen: boolean;\n\t} = {\n\t\tmodal: true,\n\t\topen: false,\n\t};\n\n\tfunction sync(): void {\n\t\tif (!dialog) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (options.open && !dialog.open) {\n\t\t\tif (options.modal) {\n\t\t\t\tdialog.showModal();\n\t\t\t} else {\n\t\t\t\tdialog.show();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (!options.open && dialog.open) {\n\t\t\tdialog.close();\n\t\t}\n\t}\n\n\thandle.addEventListener(\"insert\", (event) => {\n\t\tdialog = event.node;\n\t\tsync();\n\t});\n\thandle.addEventListener(\"commit\", () => {\n\t\tsync();\n\t});\n\thandle.addEventListener(\"remove\", () => {\n\t\tdialog = undefined;\n\t});\n\n\treturn (nextOptions) => {\n\t\toptions = nextOptions;\n\t\treturn handle.element;\n\t};\n});\n\nfunction is_dialog_outside_click(event: MouseEvent): boolean {\n\tconst dialog = event.currentTarget;\n\tif (!(dialog instanceof HTMLDialogElement)) {\n\t\treturn false;\n\t}\n\n\tconst rect = dialog.getBoundingClientRect();\n\treturn (\n\t\tevent.clientX < rect.left ||\n\t\tevent.clientX > rect.right ||\n\t\tevent.clientY < rect.top ||\n\t\tevent.clientY > rect.bottom\n\t);\n}\n\nexport function createDialog<\n\tTMode extends string,\n\tTRecipe extends DialogRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: DialogStyleSystem<TMode, TRecipe, TMetadata>,\n): DialogComponents<DialogRecipePopupLayout<TRecipe>> {\n\ttype TPopupLayout = DialogRecipePopupLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst dialog_recipe = createRecipe(style_system.token.recipe.dialog);\n\n\tfunction Root(\n\t\thandle: Handle<DialogProps, DialogRuntimeContext>,\n\t): (props: DialogProps) => RemixNode {\n\t\tlet uncontrolled_open = handle.props.defaultOpen ?? false;\n\t\tlet requested_open = handle.props.open ?? uncontrolled_open;\n\t\tlet last_completed_open = requested_open;\n\t\tlet last_open_details: DialogOpenChangeDetails | undefined;\n\t\tconst context = {\n\t\t\tcloseOnInteractOutside: (): boolean => {\n\t\t\t\treturn handle.props.closeOnInteractOutside ?? true;\n\t\t\t},\n\t\t\tisModal: (): boolean => {\n\t\t\t\treturn handle.props.modal ?? true;\n\t\t\t},\n\t\t\tisOpen: (): boolean => {\n\t\t\t\treturn handle.props.open ?? uncontrolled_open;\n\t\t\t},\n\t\t\tsetOpen: (open: boolean, details?: DialogOpenChangeDetails): void => {\n\t\t\t\tif (requested_open === open) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequested_open = open;\n\t\t\t\tlast_open_details = details;\n\t\t\t\tif (handle.props.open === undefined) {\n\t\t\t\t\tuncontrolled_open = open;\n\t\t\t\t}\n\t\t\t\thandle.props.onOpenChange?.(open, details);\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t\tshouldCloseOnInteractOutside: () => {\n\t\t\t\treturn handle.props.shouldCloseOnInteractOutside;\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: DialogProps): RemixNode => {\n\t\t\trequested_open = props.open ?? uncontrolled_open;\n\t\t\tif (requested_open !== last_completed_open) {\n\t\t\t\tconst completed_open = requested_open;\n\t\t\t\tconst completed_details = last_open_details;\n\t\t\t\tlast_completed_open = requested_open;\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onOpenChangeComplete?.(completed_open, completed_details);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn props.children;\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<DialogTriggerProps>,\n\t): (props: DialogTriggerProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst resolved = dialog_recipe.resolve();\n\t\tconst parts = createComponentStyleTargets({\n\t\t\ttargets: {\n\t\t\t\ttrigger: {\n\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\tconditions: action_conditions,\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.trigger;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprops: {},\n\t\t\tstyleSystem: style_system,\n\t\t});\n\n\t\treturn (props: DialogTriggerProps): RemixNode => {\n\t\t\tconst { children, mix, type = button_type_default, ...trigger_props } = props;\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(dialog_scope, \"trigger\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.setOpen(true, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: dialog_open_change_reason.trigger,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-expanded\": context.isOpen(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Popup(\n\t\thandle: Handle<DialogPopupProps<TPopupLayout, TBreakpoint>>,\n\t): (props: DialogPopupProps<TPopupLayout, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\tfunction resolve_slot(\n\t\t\tprops: Partial<DialogPopupStyleProps<TPopupLayout>>,\n\t\t): ReturnType<typeof dialog_recipe.resolve>[\"slots\"][\"popup\"] {\n\t\t\treturn dialog_recipe.resolve({\n\t\t\t\tpopupLayout: props.layout,\n\t\t\t} satisfies DialogRecipeSelection<TRecipe>).slots.popup;\n\t\t}\n\n\t\tfunction resolve_overlay_slot(\n\t\t\tprops: Partial<DialogPopupStyleProps<TPopupLayout>>,\n\t\t): ResolvedRecipeSlot<DialogRecipeCondition, ComponentStyle> {\n\t\t\tconst resolved = dialog_recipe.resolve({\n\t\t\t\tpopupLayout: props.layout,\n\t\t\t} satisfies DialogRecipeSelection<TRecipe>);\n\t\t\tconst slots = resolved.slots as Partial<\n\t\t\t\tRecord<\n\t\t\t\t\tDialogRecipeSlot,\n\t\t\t\t\tResolvedRecipeSlot<DialogRecipeCondition, ComponentStyle>\n\t\t\t\t>\n\t\t\t>;\n\n\t\t\treturn slots.overlay ?? empty_dialog_overlay_slot;\n\t\t}\n\n\t\treturn (props: DialogPopupProps<TPopupLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...popup_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\toverlay: {\n\t\t\t\t\t\thost: \"popup\",\n\t\t\t\t\t\tconditions: popup_conditions,\n\t\t\t\t\t\tresolveSlot: resolve_overlay_slot,\n\t\t\t\t\t\tselectors: [dialog_backdrop_selector],\n\t\t\t\t\t},\n\t\t\t\t\tpopup: {\n\t\t\t\t\t\thost: \"popup\",\n\t\t\t\t\t\tconditions: popup_conditions,\n\t\t\t\t\t\tresolveSlot: resolve_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"dialog\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(dialog_scope, \"popup\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tnative_dialog({\n\t\t\t\t\t\t\tmodal: context.isModal(),\n\t\t\t\t\t\t\topen: context.isOpen(),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ton<HTMLDialogElement, typeof close_event>(\n\t\t\t\t\t\t\tclose_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.setOpen(false, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: dialog_open_change_reason.close,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLDialogElement, typeof cancel_event>(\n\t\t\t\t\t\t\tcancel_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.setOpen(false, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: dialog_open_change_reason.escape,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLDialogElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tcontext.closeOnInteractOutside() &&\n\t\t\t\t\t\t\t\t\tis_dialog_outside_click(event)\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tconst should_close =\n\t\t\t\t\t\t\t\t\t\tevent.target instanceof Element\n\t\t\t\t\t\t\t\t\t\t\t? context.shouldCloseOnInteractOutside()?.(\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.target,\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\t\tif (should_close === false) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcontext.setOpen(false, {\n\t\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\t\treason: dialog_open_change_reason.interactOutside,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.popup.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...popup_props,\n\t\t\t\t\t\t\"data-modal\": context.isModal() ? \"true\" : undefined,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Overlay(\n\t\thandle: Handle<DialogOverlayProps>,\n\t): (props: DialogOverlayProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: DialogOverlayProps): RemixNode => {\n\t\t\tconst { children, mix, ...overlay_props } = props;\n\t\t\tconst resolved = dialog_recipe.resolve();\n\t\t\tconst slots = resolved.slots as Partial<\n\t\t\t\tRecord<\n\t\t\t\t\tDialogRecipeSlot,\n\t\t\t\t\tResolvedRecipeSlot<DialogRecipeCondition, ComponentStyle>\n\t\t\t\t>\n\t\t\t>;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\toverlay: {\n\t\t\t\t\t\thost: \"overlay\",\n\t\t\t\t\t\tconditions: popup_conditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn slots.overlay ?? empty_dialog_overlay_slot;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(dialog_scope, \"overlay\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLElement, typeof click_event>(click_event, (event) => {\n\t\t\t\t\t\t\tif (!context.closeOnInteractOutside()) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst should_close =\n\t\t\t\t\t\t\t\tevent.target instanceof Element\n\t\t\t\t\t\t\t\t\t? context.shouldCloseOnInteractOutside()?.(\n\t\t\t\t\t\t\t\t\t\t\tevent.target,\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tif (should_close === false) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontext.setOpen(false, {\n\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\treason: dialog_open_change_reason.interactOutside,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.overlay.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...overlay_props,\n\t\t\t\t\t\t\"aria-hidden\": \"true\",\n\t\t\t\t\t\t\"data-open\": context.isOpen() ? \"\" : undefined,\n\t\t\t\t\t\thidden: !context.isOpen(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Title(): (props: DialogTitleProps) => RemixNode {\n\t\tconst resolved = dialog_recipe.resolve();\n\t\tconst parts = createComponentStyleTargets({\n\t\t\ttargets: {\n\t\t\t\ttitle: {\n\t\t\t\t\thost: \"title\",\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.title;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprops: {},\n\t\t\tstyleSystem: style_system,\n\t\t});\n\t\treturn (props: DialogTitleProps): RemixNode => {\n\t\t\tconst { children, mix, ...title_props } = props;\n\t\t\treturn createElement(\n\t\t\t\t\"h2\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(dialog_scope, \"title\"),\n\t\t\t\t\tmix: parts.hosts.title.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...title_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Description(): (props: DialogDescriptionProps) => RemixNode {\n\t\tconst resolved = dialog_recipe.resolve();\n\t\tconst parts = createComponentStyleTargets({\n\t\t\ttargets: {\n\t\t\t\tdescription: {\n\t\t\t\t\thost: \"description\",\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.description;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprops: {},\n\t\t\tstyleSystem: style_system,\n\t\t});\n\t\treturn (props: DialogDescriptionProps): RemixNode => {\n\t\t\tconst { children, mix, ...description_props } = props;\n\t\t\treturn createElement(\n\t\t\t\t\"p\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(dialog_scope, \"description\"),\n\t\t\t\t\tmix: parts.hosts.description.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...description_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Close(\n\t\thandle: Handle<DialogCloseProps>,\n\t): (props: DialogCloseProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst resolved = dialog_recipe.resolve();\n\t\tconst parts = createComponentStyleTargets({\n\t\t\ttargets: {\n\t\t\t\tclose: {\n\t\t\t\t\thost: \"close\",\n\t\t\t\t\tconditions: action_conditions,\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.close;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprops: {},\n\t\t\tstyleSystem: style_system,\n\t\t});\n\n\t\treturn (props: DialogCloseProps): RemixNode => {\n\t\t\tconst { children, mix, type = button_type_default, ...close_props } = props;\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(dialog_scope, \"close\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.setOpen(false, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: dialog_open_change_reason.close,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.close.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...close_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tClose,\n\t\tDescription,\n\t\tOverlay,\n\t\tPopup,\n\t\tRoot,\n\t\tTitle,\n\t\tTrigger,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentSlotProps,\n} from \"./component-style.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type EmptyStateRecipeInput = RecipeWithVariantGroups<\n\t\"body\" | \"indicator\" | \"root\" | \"title\",\n\tnever,\n\tComponentStyle,\n\tRecord<string, never>\n>;\n\nexport type EmptyStateStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends EmptyStateRecipeInput = EmptyStateRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { emptyState: TRecipe } }, TMetadata>;\n\nexport type EmptyStateProps = Omit<Props<\"div\">, \"style\"> & {\n\tbodyProps?: ComponentSlotProps<\"div\">;\n\tindicator?: RemixNode;\n\tindicatorProps?: ComponentSlotProps<\"div\">;\n\tstyle?: never;\n\ttitle: RemixNode;\n\ttitleProps?: ComponentSlotProps<\"div\">;\n};\n\nconst empty_state_scope = \"emptyState\";\n\nexport function createEmptyState<\n\tTMode extends string,\n\tTRecipe extends EmptyStateRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: EmptyStateStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<EmptyStateProps> {\n\tconst empty_state_recipe = createRecipe(style_system.token.recipe.emptyState);\n\n\treturn () => {\n\t\treturn (props: EmptyStateProps): RemixNode => {\n\t\t\tconst {\n\t\t\t\tbodyProps,\n\t\t\t\tchildren,\n\t\t\t\tindicator,\n\t\t\t\tindicatorProps,\n\t\t\t\ttitle,\n\t\t\t\ttitleProps,\n\t\t\t\t...empty_state_props\n\t\t\t} = props;\n\t\t\tconst { children: _body_children, ...body_props } = bodyProps ?? {};\n\t\t\tconst { children: _indicator_children, ...indicator_props } =\n\t\t\t\tindicatorProps ?? {};\n\t\t\tconst { children: _title_children, ...title_props } = titleProps ?? {};\n\t\t\tconst resolved = empty_state_recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tbody: {\n\t\t\t\t\t\thost: \"body\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.body;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tindicator: {\n\t\t\t\t\t\thost: \"indicator\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.indicator;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\thost: \"title\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.title;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(empty_state_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: empty_state_props,\n\t\t\t\t}),\n\t\t\t\tindicator === undefined\n\t\t\t\t\t? null\n\t\t\t\t\t: createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\t\t\tempty_state_scope,\n\t\t\t\t\t\t\t\t\t\"indicator\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmix: parts.hosts.indicator.mix,\n\t\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t\t\"aria-hidden\":\n\t\t\t\t\t\t\t\t\t\tindicator_props[\"aria-hidden\"] ?? \"true\",\n\t\t\t\t\t\t\t\t\t...indicator_props,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tindicator,\n\t\t\t\t\t\t),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"div\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(empty_state_scope, \"title\"),\n\t\t\t\t\t\tmix: parts.hosts.title.mix,\n\t\t\t\t\t\tprops: title_props,\n\t\t\t\t\t}),\n\t\t\t\t\ttitle,\n\t\t\t\t),\n\t\t\t\tchildren === undefined\n\t\t\t\t\t? null\n\t\t\t\t\t: createElement(\n\t\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\t\t\t\tempty_state_scope,\n\t\t\t\t\t\t\t\t\t\"body\",\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tmix: parts.hosts.body.mix,\n\t\t\t\t\t\t\t\tprops: body_props,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t),\n\t\t\t);\n\t\t};\n\t};\n}\n","import {\n\tcreateElement,\n\tcreateMixin,\n\ttype ElementProps,\n\ttype Handle,\n\ttype MixInput,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport { ariaTrue, componentDataAttribute, dataFlag } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentStyleTargetsOutput,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport const fieldAnatomy = {\n\tdescription: \"description\",\n\terror: \"error\",\n\tlabel: \"label\",\n\troot: \"root\",\n} as const;\n\nexport type FieldRecipeSlot = (typeof fieldAnatomy)[keyof typeof fieldAnatomy];\nexport type FieldRecipeInput = RecipeWithVariantGroups<\n\tFieldRecipeSlot,\n\tstring,\n\tComponentStyle,\n\tRecord<never, string>\n>;\n\nexport type FieldStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends FieldRecipeInput = FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tfield: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type FieldProps = Omit<Props<\"div\">, \"style\"> & {\n\tcontrolId?: string;\n\tdisabled?: boolean;\n\tinvalid?: boolean;\n\treadOnly?: boolean;\n\trequired?: boolean;\n\tstyle?: never;\n};\n\nexport type FieldLabelProps = Omit<Props<\"label\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type FieldDescriptionProps = Omit<Props<\"p\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type FieldErrorProps = Omit<Props<\"p\">, \"style\"> & {\n\tmatch?: boolean;\n\tstyle?: never;\n};\n\ntype FieldContext = {\n\tcontrolId: () => string;\n\tdescriptionId: () => string;\n\tdescribedBy: () => string;\n\tdisabled: () => boolean;\n\terrorId: () => string;\n\tinvalid: () => boolean;\n\treadOnly: () => boolean;\n\trequired: () => boolean;\n};\n\nexport type FieldControlMixin = <\n\tTElement extends HTMLElement = HTMLElement,\n>() => MixInput<TElement>;\n\nexport type FieldComponents = {\n\tcontrolMixin: FieldControlMixin;\n\tDescription: RemixComponent<FieldDescriptionProps>;\n\tError: RemixComponent<FieldErrorProps>;\n\tLabel: RemixComponent<FieldLabelProps>;\n\tRoot: RemixComponent<FieldProps, FieldContext>;\n};\n\nconst field_parts_by_system = new WeakMap<object, FieldComponents>();\nconst field_scope = \"field\";\n\nfunction merge_id_refs(\n\town_id_refs: unknown,\n\tcontext_id_refs: string,\n): string | undefined {\n\tif (typeof own_id_refs !== \"string\" || !own_id_refs.trim()) {\n\t\treturn context_id_refs || undefined;\n\t}\n\tif (!context_id_refs) {\n\t\treturn own_id_refs;\n\t}\n\n\tconst ids = new Set([\n\t\t...own_id_refs.split(/\\s+/).filter(Boolean),\n\t\t...context_id_refs.split(/\\s+/).filter(Boolean),\n\t]);\n\treturn Array.from(ids).join(\" \");\n}\n\nfunction create_field_parts_for_system<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(style_system: FieldStyleSystem<TMode, TRecipe, TMetadata>): FieldComponents {\n\tconst recipe = createRecipe(style_system.token.recipe.field);\n\n\tfunction create_parts(): ComponentStyleTargetsOutput<\n\t\tFieldRecipeSlot,\n\t\tFieldRecipeSlot\n\t> {\n\t\tconst resolved = recipe.resolve();\n\n\t\treturn createComponentStyleTargets({\n\t\t\ttargets: {\n\t\t\t\t[fieldAnatomy.description]: {\n\t\t\t\t\thost: fieldAnatomy.description,\n\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.description;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[fieldAnatomy.error]: {\n\t\t\t\t\thost: fieldAnatomy.error,\n\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.error;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[fieldAnatomy.label]: {\n\t\t\t\t\thost: fieldAnatomy.label,\n\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.label;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t[fieldAnatomy.root]: {\n\t\t\t\t\thost: fieldAnatomy.root,\n\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprops: {},\n\t\t\tstyleSystem: style_system,\n\t\t});\n\t}\n\n\tfunction Field(handle: Handle<FieldProps, FieldContext>) {\n\t\tconst context = {\n\t\t\tcontrolId: (): string => {\n\t\t\t\treturn handle.props.controlId ?? `${handle.id}-control`;\n\t\t\t},\n\t\t\tdescriptionId: (): string => {\n\t\t\t\treturn `${handle.id}-description`;\n\t\t\t},\n\t\t\tdescribedBy: (): string => {\n\t\t\t\treturn context.invalid()\n\t\t\t\t\t? `${context.descriptionId()} ${context.errorId()}`\n\t\t\t\t\t: context.descriptionId();\n\t\t\t},\n\t\t\tdisabled: (): boolean => {\n\t\t\t\treturn Boolean(handle.props.disabled);\n\t\t\t},\n\t\t\terrorId: (): string => {\n\t\t\t\treturn `${handle.id}-error`;\n\t\t\t},\n\t\t\tinvalid: (): boolean => {\n\t\t\t\treturn Boolean(handle.props.invalid);\n\t\t\t},\n\t\t\treadOnly: (): boolean => {\n\t\t\t\treturn Boolean(handle.props.readOnly);\n\t\t\t},\n\t\t\trequired: (): boolean => {\n\t\t\t\treturn Boolean(handle.props.required);\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: FieldProps): RemixNode => {\n\t\t\tconst {\n\t\t\t\tchildren,\n\t\t\t\tcontrolId: _control_id,\n\t\t\t\tdisabled,\n\t\t\t\tinvalid,\n\t\t\t\tmix,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst parts = create_parts();\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(field_scope, fieldAnatomy.root),\n\t\t\t\t\tmix: parts.hosts[fieldAnatomy.root].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(invalid === true),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tconst field_control_mixin = createMixin<HTMLElement, [], ElementProps>((handle) => {\n\t\tconst context = handle.context.get(Field);\n\n\t\treturn (props) => {\n\t\t\treturn createElement(handle.element, {\n\t\t\t\t...props,\n\t\t\t\t\"aria-describedby\": merge_id_refs(\n\t\t\t\t\tprops[\"aria-describedby\"],\n\t\t\t\t\tcontext.describedBy(),\n\t\t\t\t),\n\t\t\t\t\"aria-invalid\":\n\t\t\t\t\tprops[\"aria-invalid\"] ?? (context.invalid() ? true : undefined),\n\t\t\t\tdisabled: context.disabled() ? true : props.disabled,\n\t\t\t\tid: props.id ?? context.controlId(),\n\t\t\t\treadOnly: context.readOnly() ? true : props.readOnly,\n\t\t\t\trequired: context.required() ? true : props.required,\n\t\t\t});\n\t\t};\n\t});\n\n\tfunction control_mixin<\n\t\tTElement extends HTMLElement = HTMLElement,\n\t>(): MixInput<TElement> {\n\t\treturn field_control_mixin() as MixInput<TElement>;\n\t}\n\n\tfunction FieldLabel(handle: Handle<FieldLabelProps>) {\n\t\tconst context = handle.context.get(Field);\n\n\t\treturn (props: FieldLabelProps): RemixNode => {\n\t\t\tconst { children, mix, ...host_props } = props;\n\t\t\tconst parts = create_parts();\n\n\t\t\treturn createElement(\n\t\t\t\t\"label\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(field_scope, fieldAnatomy.label),\n\t\t\t\t\tmix: parts.hosts[fieldAnatomy.label].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(context.disabled()),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(context.disabled()),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(context.invalid()),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(context.readOnly()),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(context.required()),\n\t\t\t\t\t\thtmlFor: host_props.htmlFor ?? context.controlId(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction FieldDescription(handle: Handle<FieldDescriptionProps>) {\n\t\tconst context = handle.context.get(Field);\n\n\t\treturn (props: FieldDescriptionProps): RemixNode => {\n\t\t\tconst { children, mix, ...host_props } = props;\n\t\t\tconst parts = create_parts();\n\n\t\t\treturn createElement(\n\t\t\t\t\"p\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tfield_scope,\n\t\t\t\t\t\tfieldAnatomy.description,\n\t\t\t\t\t),\n\t\t\t\t\tmix: parts.hosts[fieldAnatomy.description].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(context.disabled()),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(context.disabled()),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(context.invalid()),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(context.readOnly()),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(context.required()),\n\t\t\t\t\t\tid: host_props.id ?? context.descriptionId(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction FieldError(handle: Handle<FieldErrorProps>) {\n\t\tconst context = handle.context.get(Field);\n\n\t\treturn (props: FieldErrorProps): RemixNode => {\n\t\t\tconst { children, match = false, mix, ...host_props } = props;\n\t\t\tif (match && !context.invalid()) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst parts = create_parts();\n\n\t\t\treturn createElement(\n\t\t\t\t\"p\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(field_scope, fieldAnatomy.error),\n\t\t\t\t\tmix: parts.hosts[fieldAnatomy.error].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(context.disabled()),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(context.disabled()),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(context.invalid()),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(context.readOnly()),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(context.required()),\n\t\t\t\t\t\tid: host_props.id ?? context.errorId(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tcontrolMixin: control_mixin,\n\t\tDescription: FieldDescription,\n\t\tError: FieldError,\n\t\tLabel: FieldLabel,\n\t\tRoot: Field,\n\t};\n}\n\nexport function createFieldParts<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(style_system: FieldStyleSystem<TMode, TRecipe, TMetadata>): FieldComponents {\n\tlet parts = field_parts_by_system.get(style_system);\n\tif (!parts) {\n\t\tparts = create_field_parts_for_system(style_system);\n\t\tfield_parts_by_system.set(style_system, parts);\n\t}\n\treturn parts;\n}\n\nexport function createField<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: FieldStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<FieldProps, FieldContext> {\n\treturn createFieldParts(style_system).Root;\n}\n\nexport function createFieldLabel<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: FieldStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<FieldLabelProps> {\n\treturn createFieldParts(style_system).Label;\n}\n\nexport function createFieldDescription<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: FieldStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<FieldDescriptionProps> {\n\treturn createFieldParts(style_system).Description;\n}\n\nexport function createFieldError<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: FieldStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<FieldErrorProps> {\n\treturn createFieldParts(style_system).Error;\n}\n\nexport function createFieldControlMixin<\n\tTMode extends string,\n\tTRecipe extends FieldRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(style_system: FieldStyleSystem<TMode, TRecipe, TMetadata>): FieldControlMixin {\n\treturn createFieldParts(style_system).controlMixin;\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type FieldsetRecipeInput<TLayout extends string = string> =\n\tRecipeWithVariantGroups<\n\t\t\"legend\" | \"root\",\n\t\tstring,\n\t\tComponentStyle,\n\t\t{\n\t\t\tlayout: TLayout;\n\t\t}\n\t>;\n\nexport type FieldsetRecipeLayout<TRecipe extends FieldsetRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type FieldsetRecipeSelection<TRecipe extends FieldsetRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\">;\n\nexport type FieldsetStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends FieldsetRecipeInput = FieldsetRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { fieldset: TRecipe } }, TMetadata>;\n\nexport type FieldsetRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type FieldsetRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"fieldset\">, \"style\"> &\n\tFieldsetRootStyleProps<TLayout> &\n\tResponsiveProps<FieldsetRootStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type FieldsetLegendProps = Omit<Props<\"legend\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type FieldsetComponents<TLayout extends string = string> = {\n\tLegend: RemixComponent<FieldsetLegendProps>;\n\tRoot: RemixComponent<FieldsetRootProps<TLayout>>;\n};\n\nconst fieldset_scope = \"fieldset\";\n\nexport function createFieldset<\n\tTMode extends string,\n\tTRecipe extends FieldsetRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: FieldsetStyleSystem<TMode, TRecipe, TMetadata>,\n): FieldsetComponents<FieldsetRecipeLayout<TRecipe>> {\n\ttype TLayout = FieldsetRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.fieldset);\n\n\tfunction resolve_slot(\n\t\tslot: \"legend\" | \"root\",\n\t\tprops: Partial<FieldsetRootStyleProps<TLayout>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies FieldsetRecipeSelection<TRecipe>).slots[slot];\n\t}\n\n\tfunction Root(): (props: FieldsetRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\treturn (props: FieldsetRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...root_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"root\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"fieldset\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(fieldset_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Legend(): (props: FieldsetLegendProps) => RemixNode {\n\t\treturn (props: FieldsetLegendProps): RemixNode => {\n\t\t\tconst { children, mix, ...legend_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tlegend: {\n\t\t\t\t\t\thost: \"legend\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(\"legend\", {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"legend\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(fieldset_scope, \"legend\"),\n\t\t\t\t\tmix: parts.hosts.legend.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...legend_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tLegend,\n\t\tRoot,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type FormRecipeInput<TLayout extends string = string> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t}\n>;\n\nexport type FormRecipeLayout<TRecipe extends FormRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type FormRecipeSelection<TRecipe extends FormRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type FormStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends FormRecipeInput = FormRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { form: TRecipe } }, TMetadata>;\n\nexport type FormStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type FormProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"form\">, \"style\"> &\n\tFormStyleProps<TLayout> &\n\tResponsiveProps<FormStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nconst form_scope = \"form\";\n\nexport function createForm<\n\tTMode extends string,\n\tTRecipe extends FormRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: FormStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tFormProps<FormRecipeLayout<TRecipe>, BreakpointForStyleSystem<typeof style_system>>\n> {\n\ttype TLayout = FormRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.form);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<FormStyleProps<TLayout>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies FormRecipeSelection<TRecipe>).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (props: FormProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...form_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"form\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(form_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...form_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type GridAlign = \"center\" | \"end\" | \"start\" | \"stretch\";\nexport type GridJustify = \"center\" | \"end\" | \"start\" | \"stretch\";\n\nexport type GridRecipeInput<\n\tTColumns extends string = string,\n\tTGap extends string = string,\n\tTLayout extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tcolumns: TColumns;\n\t\tgap: TGap;\n\t\tlayout: TLayout;\n\t}\n>;\n\nexport type GridRecipeColumns<TRecipe extends GridRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"columns\"\n>;\n\nexport type GridRecipeGap<TRecipe extends GridRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"gap\"\n>;\n\nexport type GridRecipeLayout<TRecipe extends GridRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type GridRecipeSelection<TRecipe extends GridRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"columns\" | \"gap\" | \"layout\"\n>;\n\nexport type GridStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends GridRecipeInput = GridRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tgrid: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type GridStyleProps<\n\tTColumns extends string = string,\n\tTGap extends string = string,\n\tTLayout extends string = string,\n> = Partial<GridRecipeSelection<GridRecipeInput<TColumns, TGap, TLayout>>> & {\n\talign?: GridAlign;\n\tjustify?: GridJustify;\n};\n\nexport type GridProps<\n\tTColumns extends string = string,\n\tTGap extends string = string,\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<keyof HTMLElementTagNameMap>, \"style\"> &\n\tGridStyleProps<TColumns, TGap, TLayout> &\n\tResponsiveProps<GridStyleProps<TColumns, TGap, TLayout>, TBreakpoint> & {\n\t\tas?: keyof HTMLElementTagNameMap;\n\t\tstyle?: never;\n\t};\n\nconst align_map = {\n\tcenter: \"center\",\n\tend: \"end\",\n\tstart: \"start\",\n\tstretch: \"stretch\",\n} as const;\nconst grid_scope = \"grid\";\n\nexport function createGrid<\n\tTMode extends string,\n\tTRecipe extends GridRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: GridStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tGridProps<\n\t\tGridRecipeColumns<TRecipe>,\n\t\tGridRecipeGap<TRecipe>,\n\t\tGridRecipeLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TStyleProps = GridStyleProps<\n\t\tGridRecipeColumns<TRecipe>,\n\t\tGridRecipeGap<TRecipe>,\n\t\tGridRecipeLayout<TRecipe>\n\t>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.grid);\n\n\tfunction deterministic_style(props: Partial<TStyleProps>): ComponentStyle {\n\t\treturn {\n\t\t\talignItems: props.align ? align_map[props.align] : undefined,\n\t\t\tjustifyItems: props.justify ? align_map[props.justify] : undefined,\n\t\t};\n\t}\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TStyleProps>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve({\n\t\t\tcolumns: props.columns,\n\t\t\tgap: props.gap,\n\t\t\tlayout: props.layout,\n\t\t} satisfies GridRecipeSelection<TRecipe>).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: GridProps<\n\t\t\t\tGridRecipeColumns<TRecipe>,\n\t\t\t\tGridRecipeGap<TRecipe>,\n\t\t\t\tGridRecipeLayout<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\talign,\n\t\t\t\tas = \"div\",\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tcolumns,\n\t\t\t\tgap,\n\t\t\t\tjustify,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst style_props = { align, columns, gap, justify, layout };\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t\tresolveStyle: deterministic_style,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\treturn createElement(\n\t\t\t\tas,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(grid_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeStyle,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type IconElement = \"div\" | \"span\";\nexport type IconRotate = string;\n\nexport type IconRecipeInput<\n\tTSize extends string = string,\n\tTTone extends string = string,\n\tTLayout extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tnever,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\ttone: TTone;\n\t}\n>;\n\nexport type IconRecipeSize<TRecipe extends IconRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\nexport type IconRecipeTone<TRecipe extends IconRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\nexport type IconRecipeLayout<TRecipe extends IconRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\nexport type IconRecipeSelection<TRecipe extends IconRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"layout\" | \"size\" | \"tone\"\n>;\n\nexport type IconStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends IconRecipeInput = IconRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { icon: TRecipe } }, TMetadata>;\n\nexport type IconStyleProps<\n\tTSize extends string = string,\n\tTTone extends string = string,\n\tTLayout extends string = string,\n> = {\n\tlayout?: TLayout;\n\trotate?: IconRotate;\n\tsize?: TSize;\n\ttone?: TTone;\n};\n\nexport type IconProps<\n\tTSize extends string = string,\n\tTTone extends string = string,\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<IconElement>, \"style\"> &\n\tIconStyleProps<TSize, TTone, TLayout> &\n\tResponsiveProps<IconStyleProps<TSize, TTone, TLayout>, TBreakpoint> & {\n\t\tas?: IconElement;\n\t\tdecorative?: boolean;\n\t\tstyle?: never;\n\t};\n\nconst icon_scope = \"icon\";\n\nexport function createIcon<\n\tTMode extends string,\n\tTRecipe extends IconRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: IconStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tIconProps<\n\t\tIconRecipeSize<TRecipe>,\n\t\tIconRecipeTone<TRecipe>,\n\t\tIconRecipeLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TSize = IconRecipeSize<TRecipe>;\n\ttype TTone = IconRecipeTone<TRecipe>;\n\ttype TLayout = IconRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\n\tconst icon_recipe = createRecipe(style_system.token.recipe.icon);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<IconStyleProps<TSize, TTone, TLayout>>,\n\t): ReturnType<typeof icon_recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn icon_recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t\tsize: props.size,\n\t\t\ttone: props.tone,\n\t\t} satisfies IconRecipeSelection<TRecipe>).slots.root;\n\t}\n\n\tfunction deterministic_style(\n\t\tprops: Partial<IconStyleProps<TSize, TTone, TLayout>>,\n\t): RecipeStyle | undefined {\n\t\treturn props.rotate ? { rotate: props.rotate } : undefined;\n\t}\n\n\treturn () => {\n\t\treturn (props: IconProps<TSize, TTone, TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tas = \"span\",\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdecorative,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\trotate,\n\t\t\t\tsize,\n\t\t\t\ttone,\n\t\t\t\t...icon_props\n\t\t\t} = props;\n\t\t\tconst has_accessible_name =\n\t\t\t\ticon_props[\"aria-label\"] !== undefined ||\n\t\t\t\ticon_props[\"aria-labelledby\"] !== undefined;\n\t\t\tconst is_decorative = decorative ?? !has_accessible_name;\n\t\t\tconst style_props = {\n\t\t\t\tlayout,\n\t\t\t\trotate,\n\t\t\t\tsize,\n\t\t\t\ttone,\n\t\t\t};\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t\tresolveStyle: deterministic_style,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\tas,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(icon_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...icon_props,\n\t\t\t\t\t\t\"aria-hidden\":\n\t\t\t\t\t\t\ticon_props[\"aria-hidden\"] ??\n\t\t\t\t\t\t\t(is_decorative ? true : undefined),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport { componentDataAttribute, dataFlag, is_aria_invalid } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type InputRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type InputRecipeVariant<TRecipe extends InputRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type InputRecipeSize<TRecipe extends InputRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type InputRecipeSelection<TRecipe extends InputRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"size\" | \"variant\">;\n\nexport type InputStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends InputRecipeInput = InputRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tinput: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type InputProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"input\">, \"size\" | \"style\"> &\n\tPartial<InputRecipeSelection<InputRecipeInput<TVariant, TSize>>> &\n\tResponsiveProps<\n\t\tInputRecipeSelection<InputRecipeInput<TVariant, TSize>>,\n\t\tTBreakpoint\n\t> & {\n\t\thtmlSize?: number;\n\t\tstyle?: never;\n\t};\n\nexport const inputAnatomy = {\n\troot: \"root\",\n} as const;\n\nconst input_scope = \"input\";\n\nexport function createInput<\n\tTMode extends string,\n\tTRecipe extends InputRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: InputStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tInputProps<\n\t\tInputRecipeVariant<TRecipe>,\n\t\tInputRecipeSize<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TSelection = InputRecipeSelection<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.input);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TSelection>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve(props).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: InputProps<\n\t\t\t\tInputRecipeVariant<TRecipe>,\n\t\t\t\tInputRecipeSize<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\t\"aria-invalid\": aria_invalid,\n\t\t\t\tdisabled,\n\t\t\t\thtmlSize,\n\t\t\t\tmix,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst selection = {\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t} satisfies TSelection;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: selection,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"input\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(input_scope, inputAnatomy.root),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-invalid\": aria_invalid,\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(\n\t\t\t\t\t\t\tis_aria_invalid(aria_invalid),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\trequired,\n\t\t\t\t\t\tsize: htmlSize,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import {\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantValue,\n} from \"../../core/core.ts\";\nimport type { BreakpointForStyleSystem } from \"./responsive.ts\";\nimport {\n\tcreateRootComponent,\n\ttype RootComponent,\n\ttype RootComponentProps,\n\ttype RootRecipeInput,\n\ttype RootStyleSystem,\n} from \"./root.ts\";\n\nexport const kbdDefaultElement = \"kbd\";\nexport const kbdScope = \"kbd\";\n\nexport type KbdRecipeInput<TSize extends string = string> = RootRecipeInput<{\n\tsize: TSize;\n}>;\n\nexport type KbdRecipeSize<TRecipe extends KbdRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type KbdStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends KbdRecipeInput = KbdRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = RootStyleSystem<TMode, TRecipe, TMetadata, typeof kbdScope>;\n\nexport type KbdProps<\n\tTRecipe extends KbdRecipeInput = KbdRecipeInput,\n\tTBreakpoint extends string = string,\n> = RootComponentProps<\"size\", TRecipe, TBreakpoint>;\n\nexport function createKbd<\n\tTMode extends string,\n\tTRecipe extends KbdRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: KbdStyleSystem<TMode, TRecipe, TMetadata>,\n): RootComponent<\n\t\"size\",\n\tTRecipe,\n\tBreakpointForStyleSystem<KbdStyleSystem<TMode, TRecipe, TMetadata>>\n> {\n\treturn createRootComponent(style_system, {\n\t\tdefaultElement: kbdDefaultElement,\n\t\trecipeName: kbdScope,\n\t\tresolveProps: (props) => {\n\t\t\treturn {\n\t\t\t\tsize: props.size,\n\t\t\t};\n\t\t},\n\t\tvariantProps: [\"size\"],\n\t});\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type ListElement = \"ol\" | \"ul\";\n\nexport type ListRecipeInput = RecipeWithVariantGroups<\n\t\"item\" | \"root\",\n\tnever,\n\tComponentStyle,\n\tRecord<string, never>\n>;\n\nexport type ListStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends ListRecipeInput = ListRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { list: TRecipe } }, TMetadata>;\n\nexport type ListProps = Omit<Props<ListElement>, \"style\"> & {\n\tas?: ListElement;\n\tstyle?: never;\n};\n\nexport type ListItemProps = Omit<Props<\"li\">, \"style\"> & {\n\tstyle?: never;\n};\n\nconst list_scope = \"list\";\n\nexport function createList<\n\tTMode extends string,\n\tTRecipe extends ListRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(style_system: ListStyleSystem<TMode, TRecipe, TMetadata>): RemixComponent<ListProps> {\n\tconst list_recipe = createRecipe(style_system.token.recipe.list);\n\n\treturn () => {\n\t\treturn (props: ListProps): RemixNode => {\n\t\t\tconst { as = \"ul\", children, mix, ...listProps } = props;\n\t\t\tconst resolved = list_recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\tas,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(list_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...listProps,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createListItem<\n\tTMode extends string,\n\tTRecipe extends ListRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: ListStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<ListItemProps> {\n\tconst list_recipe = createRecipe(style_system.token.recipe.list);\n\n\treturn () => {\n\t\treturn (props: ListItemProps): RemixNode => {\n\t\t\tconst { children, mix, ...itemProps } = props;\n\t\t\tconst resolved = list_recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\titem: {\n\t\t\t\t\t\thost: \"item\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.item;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"li\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(list_scope, \"item\"),\n\t\t\t\t\tmix: parts.hosts.item.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...itemProps,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import type { OrderedCollectionItem } from \"./ordered-collection.ts\";\n\nexport type CollectionNavigationInput<TItem extends OrderedCollectionItem> = {\n\tclamp?: boolean;\n\tcurrentValue: string | null | undefined;\n\tfallbackValue?: string | null | undefined;\n\titems: readonly TItem[];\n\tloop?: boolean;\n\toffset: number;\n};\n\nexport type RovingTabIndexInput = {\n\tcurrentValue: string | null | undefined;\n\tfallbackValue?: string | null | undefined;\n\titemValue: string;\n};\n\nexport function get_collection_navigation_item<TItem extends OrderedCollectionItem>(\n\tinput: CollectionNavigationInput<TItem>,\n): TItem | undefined {\n\tif (input.items.length === 0) {\n\t\treturn undefined;\n\t}\n\n\tconst current_index = input.items.findIndex((item) => {\n\t\treturn item.value === input.currentValue;\n\t});\n\tconst fallback_index = input.items.findIndex((item) => {\n\t\treturn item.value === input.fallbackValue;\n\t});\n\tconst base_index = current_index >= 0 ? current_index : fallback_index;\n\tconst next_index =\n\t\tbase_index >= 0\n\t\t\t? base_index + input.offset\n\t\t\t: input.offset > 0\n\t\t\t\t? 0\n\t\t\t\t: input.items.length - 1;\n\n\tif (input.clamp === true) {\n\t\tconst clamped_index = Math.max(0, Math.min(input.items.length - 1, next_index));\n\t\treturn input.items[clamped_index];\n\t}\n\n\tif (input.loop === true) {\n\t\tconst wrapped_index =\n\t\t\t((next_index % input.items.length) + input.items.length) % input.items.length;\n\t\treturn input.items[wrapped_index];\n\t}\n\n\tif (next_index < 0 || next_index >= input.items.length) {\n\t\treturn undefined;\n\t}\n\treturn input.items[next_index];\n}\n\nexport function get_first_collection_item<TItem extends OrderedCollectionItem>(\n\titems: readonly TItem[],\n): TItem | undefined {\n\treturn items[0];\n}\n\nexport function get_last_collection_item<TItem extends OrderedCollectionItem>(\n\titems: readonly TItem[],\n): TItem | undefined {\n\treturn items[items.length - 1];\n}\n\nexport function get_roving_tab_index(input: RovingTabIndexInput): 0 | -1 {\n\tconst active_value = input.currentValue ?? input.fallbackValue;\n\treturn input.itemValue === active_value ? 0 : -1;\n}\n","import { ref, type MixInput } from \"remix/ui\";\n\nexport type GroupLabelRelationship = {\n\tget_label_id: () => string;\n\tget_labelled_by: () => string | undefined;\n\tregister_label: (node: HTMLElement | null) => void;\n};\n\nexport type GroupLabelRelationshipInput = {\n\tlabel_id: string;\n\ton_change: () => void;\n};\n\nexport function create_group_label_relationship(\n\tinput: GroupLabelRelationshipInput,\n): GroupLabelRelationship {\n\tlet label_node: HTMLElement | null = null;\n\n\tconst relationship: GroupLabelRelationship = {\n\t\tget_label_id: () => {\n\t\t\treturn input.label_id;\n\t\t},\n\t\tget_labelled_by: () => {\n\t\t\treturn label_node ? relationship.get_label_id() : undefined;\n\t\t},\n\t\tregister_label: (node) => {\n\t\t\tconst changed = label_node !== node;\n\t\t\tlabel_node = node;\n\t\t\tif (changed) {\n\t\t\t\tinput.on_change();\n\t\t\t}\n\t\t},\n\t};\n\n\treturn relationship;\n}\n\nexport function create_group_label_ref_mix(\n\trelationship: GroupLabelRelationship,\n): MixInput<HTMLElement> {\n\treturn ref<HTMLElement>((node, signal) => {\n\t\trelationship.register_label(node);\n\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\trelationship.register_label(null);\n\t\t});\n\t});\n}\n","export type OrderedCollectionItem<TValue extends string = string> = {\n\tdisabled: boolean;\n\tid: string;\n\tnode: HTMLElement;\n\ttext: string;\n\tvalue: TValue;\n};\n\nexport type OrderedCollection<TItem extends OrderedCollectionItem> = {\n\tfindByValue: (value: string | null | undefined) => TItem | undefined;\n\tgetEnabledItems: () => TItem[];\n\tgetItems: () => TItem[];\n\tregister: (item: TItem) => boolean;\n\tunregister: (id: string) => TItem | undefined;\n};\n\nfunction compare_collection_items<TItem extends OrderedCollectionItem>(\n\tleft: TItem,\n\tright: TItem,\n): number {\n\tif (left.node === right.node) {\n\t\treturn 0;\n\t}\n\n\tconst position = left.node.compareDocumentPosition(right.node);\n\tif ((position & Node.DOCUMENT_POSITION_PRECEDING) !== 0) {\n\t\treturn 1;\n\t}\n\tif ((position & Node.DOCUMENT_POSITION_FOLLOWING) !== 0) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nfunction item_changed<TItem extends OrderedCollectionItem>(\n\tcurrent: TItem | undefined,\n\tnext: TItem,\n): boolean {\n\treturn (\n\t\tcurrent === undefined ||\n\t\tcurrent.disabled !== next.disabled ||\n\t\tcurrent.node !== next.node ||\n\t\tcurrent.text !== next.text ||\n\t\tcurrent.value !== next.value\n\t);\n}\n\nexport function create_ordered_collection<\n\tTItem extends OrderedCollectionItem,\n>(): OrderedCollection<TItem> {\n\tconst items_by_id = new Map<string, TItem>();\n\n\tfunction get_items(): TItem[] {\n\t\treturn Array.from(items_by_id.values())\n\t\t\t.filter((item) => {\n\t\t\t\treturn item.node.isConnected;\n\t\t\t})\n\t\t\t.sort(compare_collection_items);\n\t}\n\n\tfunction get_enabled_items(): TItem[] {\n\t\treturn get_items().filter((item) => {\n\t\t\treturn !item.disabled;\n\t\t});\n\t}\n\n\tfunction find_by_value(value: string | null | undefined): TItem | undefined {\n\t\tif (value == null) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn get_items().find((item) => {\n\t\t\treturn item.value === value;\n\t\t});\n\t}\n\n\tfunction register(item: TItem): boolean {\n\t\tconst current = items_by_id.get(item.id);\n\t\titems_by_id.set(item.id, item);\n\t\treturn item_changed(current, item);\n\t}\n\n\tfunction unregister(id: string): TItem | undefined {\n\t\tconst item = items_by_id.get(id);\n\t\titems_by_id.delete(id);\n\t\treturn item;\n\t}\n\n\treturn {\n\t\tfindByValue: find_by_value,\n\t\tgetEnabledItems: get_enabled_items,\n\t\tgetItems: get_items,\n\t\tregister,\n\t\tunregister,\n\t};\n}\n","export type TypeaheadItem<TValue extends string = string> = {\n\ttext: string;\n\tvalue: TValue;\n};\n\nexport type Typeahead<TItem extends TypeaheadItem> = {\n\treset: () => void;\n\tsearch: (input: TypeaheadSearchInput<TItem>) => TItem | undefined;\n};\n\nexport type TypeaheadInput = {\n\ttimeoutMs: number;\n};\n\nexport type TypeaheadSearchInput<TItem extends TypeaheadItem> = {\n\tcurrentValue: string | null | undefined;\n\titems: readonly TItem[];\n\tkey: string;\n};\n\nfunction is_repeated_character_search(value: string): boolean {\n\tfor (let i = 0; i < value.length; i += 1) {\n\t\tif (value[i] !== value[0]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nfunction order_items_after_current<TItem extends TypeaheadItem>(\n\titems: readonly TItem[],\n\tcurrent_value: string | null | undefined,\n): readonly TItem[] {\n\tconst current_index = items.findIndex((item) => {\n\t\treturn item.value === current_value;\n\t});\n\tconst start_index = current_index >= 0 ? current_index : -1;\n\treturn [...items.slice(start_index + 1), ...items.slice(0, start_index + 1)];\n}\n\nexport function create_typeahead<TItem extends TypeaheadItem>(\n\tinput: TypeaheadInput,\n): Typeahead<TItem> {\n\tlet buffer = \"\";\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\n\tfunction reset(): void {\n\t\tif (timer !== undefined) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = undefined;\n\t\t}\n\t\tbuffer = \"\";\n\t}\n\n\tfunction search(search_input: TypeaheadSearchInput<TItem>): TItem | undefined {\n\t\tif (timer !== undefined) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = undefined;\n\t\t}\n\t\tbuffer += search_input.key.toLowerCase();\n\t\ttimer = setTimeout(() => {\n\t\t\tbuffer = \"\";\n\t\t\ttimer = undefined;\n\t\t}, input.timeoutMs);\n\n\t\tconst query = is_repeated_character_search(buffer)\n\t\t\t? search_input.key.toLowerCase()\n\t\t\t: buffer;\n\t\treturn order_items_after_current(\n\t\t\tsearch_input.items,\n\t\t\tsearch_input.currentValue,\n\t\t).find((item) => {\n\t\t\treturn item.text.toLowerCase().startsWith(query);\n\t\t});\n\t}\n\n\treturn {\n\t\treset,\n\t\tsearch,\n\t};\n}\n","import {\n\tcreateElement,\n\ton,\n\tref,\n\ttype Handle,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tariaBoolean,\n\tariaTrue,\n\tcomponentDataAttribute,\n\tdataFlag,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport {\n\tget_collection_navigation_item,\n\tget_first_collection_item,\n\tget_last_collection_item,\n} from \"./composite-navigation.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport { create_controllable_state } from \"./controllable-state.ts\";\nimport {\n\tcreate_group_label_ref_mix,\n\tcreate_group_label_relationship,\n\ttype GroupLabelRelationship,\n} from \"./group-label.ts\";\nimport {\n\tcreate_ordered_collection,\n\ttype OrderedCollectionItem,\n} from \"./ordered-collection.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport { create_typeahead } from \"./typeahead.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nconst listbox_slot = {\n\tgroup: \"group\",\n\tgroupLabel: \"groupLabel\",\n\toption: \"option\",\n\toptionIndicator: \"optionIndicator\",\n\toptionText: \"optionText\",\n\troot: \"root\",\n} as const;\n\nexport type ListboxRecipeSlot = (typeof listbox_slot)[keyof typeof listbox_slot];\n\nexport type ListboxRecipeCondition = CommonRecipeCondition | \"highlighted\";\n\nexport type ListboxRecipeInput<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\tListboxRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type ListboxRecipeLayout<TRecipe extends ListboxRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type ListboxRecipeVariant<TRecipe extends ListboxRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type ListboxRecipeSize<TRecipe extends ListboxRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type ListboxRecipeSelection<TRecipe extends ListboxRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\" | \"size\" | \"variant\">;\n\nexport type ListboxStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends ListboxRecipeInput = ListboxRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tlistbox: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport const listboxValueChangeReason = {\n\tkeyboard: \"keyboard\",\n\tpointer: \"pointer\",\n} as const;\n\nexport const listboxHighlightChangeReason = {\n\tfocus: \"focus\",\n\tkeyboard: \"keyboard\",\n\tpointer: \"pointer\",\n\ttypeahead: \"typeahead\",\n} as const;\n\nexport type ListboxValueChangeReason =\n\t(typeof listboxValueChangeReason)[keyof typeof listboxValueChangeReason];\n\nexport type ListboxHighlightChangeReason =\n\t(typeof listboxHighlightChangeReason)[keyof typeof listboxHighlightChangeReason];\n\nexport type ListboxValueChangeDetails = {\n\tevent?: Event;\n\treason: ListboxValueChangeReason;\n};\n\nexport type ListboxHighlightChangeDetails = {\n\tevent?: Event;\n\treason: ListboxHighlightChangeReason;\n};\n\nexport type ListboxValueChangeHandler<TValue extends string = string> = (\n\tvalue: TValue | null,\n\tdetails?: ListboxValueChangeDetails,\n) => void;\n\nexport type ListboxHighlightChangeHandler<TValue extends string = string> = (\n\tvalue: TValue | null,\n\tdetails?: ListboxHighlightChangeDetails,\n) => void;\n\nexport type ListboxValuesChangeHandler<TValue extends string = string> = (\n\tvalues: readonly TValue[],\n\tdetails?: ListboxValueChangeDetails,\n) => void;\n\nexport type ListboxSelectionMode = \"multiple\" | \"single\";\n\nexport type ListboxRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type ListboxOrientation = \"horizontal\" | \"vertical\";\n\nexport type ListboxRootSharedProps<TValue extends string = string> = {\n\tdefaultHighlightedValue?: TValue | null;\n\tdisabled?: boolean;\n\thighlightedValue?: TValue | null;\n\tinvalid?: boolean;\n\tloopFocus?: boolean;\n\tonHighlightChange?: ListboxHighlightChangeHandler<TValue>;\n\torientation?: ListboxOrientation;\n\trequired?: boolean;\n\tstyle?: never;\n\ttypeahead?: boolean;\n};\n\nexport type ListboxRootSingleSelectionProps<TValue extends string = string> = {\n\tdefaultValue?: TValue | null;\n\tdefaultValues?: never;\n\tonValueChange?: ListboxValueChangeHandler<TValue>;\n\tonValuesChange?: never;\n\tselectionFollowsFocus?: boolean;\n\tselectionMode?: \"single\";\n\tvalue?: TValue | null;\n\tvalues?: never;\n};\n\nexport type ListboxRootMultipleSelectionProps<TValue extends string = string> = {\n\tdefaultValue?: never;\n\tdefaultValues?: readonly TValue[];\n\tonValueChange?: never;\n\tonValuesChange?: ListboxValuesChangeHandler<TValue>;\n\tselectionFollowsFocus?: never;\n\tselectionMode: \"multiple\";\n\tvalue?: never;\n\tvalues?: readonly TValue[];\n};\n\nexport type ListboxRootSelectionProps<TValue extends string = string> =\n\t| ListboxRootSingleSelectionProps<TValue>\n\t| ListboxRootMultipleSelectionProps<TValue>;\n\nexport type ListboxOptionStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type ListboxRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tListboxRootStyleProps<TLayout> &\n\tResponsiveProps<ListboxRootStyleProps<TLayout>, TBreakpoint> &\n\tListboxRootSharedProps<TValue> &\n\tListboxRootSelectionProps<TValue>;\n\nexport type ListboxOptionProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tListboxOptionStyleProps<TVariant, TSize> &\n\tResponsiveProps<ListboxOptionStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tdisabled?: boolean;\n\t\tstyle?: never;\n\t\ttextValue?: string;\n\t\tvalue: TValue;\n\t};\n\nexport type ListboxGroupProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ListboxGroupLabelProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ListboxOptionTextProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ListboxOptionIndicatorProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ListboxComponents<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tGroup: RemixComponent<ListboxGroupProps, ListboxGroupRuntimeContext>;\n\tGroupLabel: RemixComponent<ListboxGroupLabelProps>;\n\tOption: RemixComponent<ListboxOptionProps<TVariant, TSize>>;\n\tOptionIndicator: RemixComponent<ListboxOptionIndicatorProps>;\n\tOptionText: RemixComponent<ListboxOptionTextProps>;\n\tRoot: RemixComponent<ListboxRootProps<TLayout>, ListboxRuntimeContext>;\n};\n\nexport type ListboxOptions = {\n\tconditions?: Partial<\n\t\tReadonly<Record<ListboxRecipeSlot, RecipeConditionSelectorMap<string>>>\n\t>;\n};\n\ntype ListboxRuntimeContext = {\n\tget_disabled: () => boolean;\n\tget_highlighted_id: () => string | undefined;\n\tget_highlighted_value: () => string | null;\n\tget_invalid: () => boolean;\n\tget_required: () => boolean;\n\tget_value: () => string | null;\n\thandle_focus: (event: FocusEvent) => void;\n\thandle_keydown: (event: KeyboardEvent) => void;\n\thighlight_value: (\n\t\tvalue: string | null,\n\t\tdetails: ListboxHighlightChangeDetails,\n\t) => void;\n\tregister_option: (option: RegisteredListboxOption) => void;\n\tselect_value: (value: string | null, details: ListboxValueChangeDetails) => void;\n\tvalue_selected: (value: string) => boolean;\n\tunregister_option: (id: string) => void;\n};\n\ntype ListboxGroupRuntimeContext = GroupLabelRelationship;\n\ntype RegisteredListboxOption = OrderedCollectionItem<string>;\n\nconst option_conditions = mergeRecipeConditionSelectors<ListboxRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\thighlighted: `&[${componentDataAttribute.highlighted}]`,\n\t} satisfies RecipeConditionSelectorMap<ListboxRecipeCondition>,\n);\n\nconst listbox_scope = \"listbox\";\nconst listbox_page_jump_size = 10;\nconst listbox_typeahead_reset_ms = 700;\nconst multiple_selection_mode = \"multiple\";\nconst single_selection_mode = \"single\";\nconst vertical_orientation = \"vertical\";\nconst focus_event = \"focus\";\nconst click_event = \"click\";\nconst keydown_event = \"keydown\";\nconst pointermove_event = \"pointermove\";\n\nfunction infer_text_value(children: RemixNode): string {\n\tif (typeof children === \"string\" || typeof children === \"number\") {\n\t\treturn String(children);\n\t}\n\treturn \"\";\n}\n\nfunction is_listbox_keyboard_selection(event: KeyboardEvent): boolean {\n\treturn event.key === \"Enter\" || event.key === \" \" || event.key === \"Spacebar\";\n}\n\nfunction is_printable_key_event(event: KeyboardEvent): boolean {\n\treturn event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey;\n}\n\nfunction coerce_listbox_value(value: string | null | undefined): string | null {\n\treturn value ?? null;\n}\n\nfunction coerce_listbox_values(values: readonly string[] | undefined): readonly string[] {\n\treturn values ?? [];\n}\n\nfunction add_value(values: readonly string[], value: string): readonly string[] {\n\tif (values.includes(value)) {\n\t\treturn values;\n\t}\n\treturn [...values, value];\n}\n\nfunction remove_value(values: readonly string[], value: string): readonly string[] {\n\treturn values.filter((current_value) => {\n\t\treturn current_value !== value;\n\t});\n}\n\nfunction toggle_value(values: readonly string[], value: string): readonly string[] {\n\tif (values.includes(value)) {\n\t\treturn remove_value(values, value);\n\t}\n\treturn add_value(values, value);\n}\n\nfunction is_same_values(left: readonly string[], right: readonly string[]): boolean {\n\treturn (\n\t\tleft.length === right.length &&\n\t\tleft.every((left_value, index) => {\n\t\t\treturn left_value === right[index];\n\t\t})\n\t);\n}\n\nfunction is_next_navigation_key(key: string, orientation: ListboxOrientation): boolean {\n\treturn key === \"ArrowDown\" || (orientation === \"horizontal\" && key === \"ArrowRight\");\n}\n\nfunction is_previous_navigation_key(\n\tkey: string,\n\torientation: ListboxOrientation,\n): boolean {\n\treturn key === \"ArrowUp\" || (orientation === \"horizontal\" && key === \"ArrowLeft\");\n}\n\nexport function createListbox<\n\tTMode extends string,\n\tTRecipe extends ListboxRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: ListboxStyleSystem<TMode, TRecipe, TMetadata>,\n\toptions: ListboxOptions = {},\n): ListboxComponents<\n\tListboxRecipeLayout<TRecipe>,\n\tListboxRecipeVariant<TRecipe>,\n\tListboxRecipeSize<TRecipe>\n> {\n\ttype TLayout = ListboxRecipeLayout<TRecipe>;\n\ttype TVariant = ListboxRecipeVariant<TRecipe>;\n\ttype TSize = ListboxRecipeSize<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\n\tconst listbox_recipe = createRecipe(style_system.token.recipe.listbox);\n\n\tfunction create_resolve_slot<TProps extends object>(\n\t\tslot: ListboxRecipeSlot,\n\t\tselection: (props: Partial<TProps>) => ListboxRecipeSelection<TRecipe>,\n\t): (\n\t\tprops: Partial<TProps>,\n\t) => ReturnType<typeof listbox_recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn (props) => {\n\t\t\treturn listbox_recipe.resolve(selection(props)).slots[slot];\n\t\t};\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<ListboxRootProps<TLayout, TBreakpoint>, ListboxRuntimeContext>,\n\t): (props: ListboxRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tlet local_value = handle.props.defaultValue ?? null;\n\t\tlet local_values = [...(handle.props.defaultValues ?? [])];\n\t\tlet local_highlighted_value = handle.props.defaultHighlightedValue ?? null;\n\t\tconst option_collection = create_ordered_collection<RegisteredListboxOption>();\n\t\tconst option_typeahead = create_typeahead<RegisteredListboxOption>({\n\t\t\ttimeoutMs: listbox_typeahead_reset_ms,\n\t\t});\n\t\tconst value_state = create_controllable_state<\n\t\t\tstring | null,\n\t\t\tListboxValueChangeDetails\n\t\t>({\n\t\t\tgetControlled: () => {\n\t\t\t\tif (handle.props.value === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn coerce_listbox_value(handle.props.value);\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_value;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onValueChange;\n\t\t\t},\n\t\t\tsetLocal: (value) => {\n\t\t\t\tlocal_value = value;\n\t\t\t},\n\t\t});\n\t\tconst values_state = create_controllable_state<\n\t\t\treadonly string[],\n\t\t\tListboxValueChangeDetails\n\t\t>({\n\t\t\tequals: is_same_values,\n\t\t\tgetControlled: () => {\n\t\t\t\tif (handle.props.values === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn coerce_listbox_values(handle.props.values);\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_values;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onValuesChange;\n\t\t\t},\n\t\t\tsetLocal: (values) => {\n\t\t\t\tlocal_values = [...values];\n\t\t\t},\n\t\t});\n\t\tconst highlighted_state = create_controllable_state<\n\t\t\tstring | null,\n\t\t\tListboxHighlightChangeDetails\n\t\t>({\n\t\t\tgetControlled: () => {\n\t\t\t\tif (handle.props.highlightedValue === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn coerce_listbox_value(handle.props.highlightedValue);\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_highlighted_value;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onHighlightChange;\n\t\t\t},\n\t\t\tsetLocal: (value) => {\n\t\t\t\tlocal_highlighted_value = value;\n\t\t\t},\n\t\t});\n\n\t\tfunction get_value(): string | null {\n\t\t\treturn value_state.get();\n\t\t}\n\n\t\tfunction get_values(): readonly string[] {\n\t\t\treturn values_state.get();\n\t\t}\n\n\t\tfunction get_selection_mode(): ListboxSelectionMode {\n\t\t\treturn handle.props.selectionMode ?? single_selection_mode;\n\t\t}\n\n\t\tfunction get_navigation_fallback_value(): string | null {\n\t\t\tif (get_selection_mode() === multiple_selection_mode) {\n\t\t\t\treturn get_values()[0] ?? null;\n\t\t\t}\n\t\t\treturn get_value();\n\t\t}\n\n\t\tfunction get_highlighted_value(): string | null {\n\t\t\treturn highlighted_state.get();\n\t\t}\n\n\t\tfunction get_enabled_options(): RegisteredListboxOption[] {\n\t\t\treturn option_collection.getEnabledItems();\n\t\t}\n\n\t\tfunction find_option(value: string | null): RegisteredListboxOption | undefined {\n\t\t\tif (value === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn option_collection.findByValue(value);\n\t\t}\n\n\t\tfunction scroll_highlighted_option_into_view(): void {\n\t\t\tconst highlighted_option = find_option(get_highlighted_value());\n\t\t\tif (\n\t\t\t\thighlighted_option &&\n\t\t\t\ttypeof highlighted_option.node.scrollIntoView === \"function\"\n\t\t\t) {\n\t\t\t\thighlighted_option.node.scrollIntoView({ block: \"nearest\" });\n\t\t\t}\n\t\t}\n\n\t\tfunction schedule_highlight_scroll(): void {\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscroll_highlighted_option_into_view();\n\t\t\t});\n\t\t}\n\n\t\tfunction value_selected(value: string): boolean {\n\t\t\tif (get_selection_mode() === multiple_selection_mode) {\n\t\t\t\treturn get_values().includes(value);\n\t\t\t}\n\t\t\treturn get_value() === value;\n\t\t}\n\n\t\tfunction select_value(\n\t\t\tvalue: string | null,\n\t\t\tdetails: ListboxValueChangeDetails,\n\t\t): void {\n\t\t\tif (handle.props.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst option = find_option(value);\n\t\t\tif (option?.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (get_selection_mode() === multiple_selection_mode) {\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvalues_state.set(toggle_value(get_values(), value), details);\n\t\t\t\tif (handle.props.highlightedValue === undefined) {\n\t\t\t\t\tlocal_highlighted_value = value;\n\t\t\t\t}\n\t\t\t\tvoid handle.update();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvalue_state.set(value, details);\n\t\t\tif (handle.props.highlightedValue === undefined) {\n\t\t\t\tlocal_highlighted_value = value;\n\t\t\t}\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tfunction set_highlighted_value(\n\t\t\tvalue: string | null,\n\t\t\tdetails: ListboxHighlightChangeDetails,\n\t\t): void {\n\t\t\tconst changed = highlighted_state.set(value, details);\n\t\t\tif (!changed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tschedule_highlight_scroll();\n\t\t\tif (\n\t\t\t\tget_selection_mode() === single_selection_mode &&\n\t\t\t\thandle.props.selectionFollowsFocus &&\n\t\t\t\tvalue !== null\n\t\t\t) {\n\t\t\t\tvalue_state.set(value, {\n\t\t\t\t\tevent: details.event,\n\t\t\t\t\treason:\n\t\t\t\t\t\tdetails.reason === listboxHighlightChangeReason.pointer\n\t\t\t\t\t\t\t? listboxValueChangeReason.pointer\n\t\t\t\t\t\t\t: listboxValueChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t}\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tfunction highlight_option(\n\t\t\toption: RegisteredListboxOption | undefined,\n\t\t\tdetails: ListboxHighlightChangeDetails,\n\t\t): void {\n\t\t\tset_highlighted_value(option?.value ?? null, details);\n\t\t}\n\n\t\tfunction move_highlight(\n\t\t\toffset: number,\n\t\t\tdetails: ListboxHighlightChangeDetails,\n\t\t\tclamp = false,\n\t\t): void {\n\t\t\tconst enabled_options = get_enabled_options();\n\t\t\tif (enabled_options.length === 0) {\n\t\t\t\thighlight_option(undefined, details);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next_option = get_collection_navigation_item({\n\t\t\t\tclamp,\n\t\t\t\tcurrentValue: get_highlighted_value(),\n\t\t\t\tfallbackValue: get_navigation_fallback_value(),\n\t\t\t\titems: enabled_options,\n\t\t\t\tloop: handle.props.loopFocus,\n\t\t\t\toffset,\n\t\t\t});\n\t\t\tif (next_option === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thighlight_option(next_option, details);\n\t\t}\n\n\t\tfunction ensure_highlight(details: ListboxHighlightChangeDetails): void {\n\t\t\tif (get_highlighted_value() !== null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thighlight_option(\n\t\t\t\tfind_option(get_navigation_fallback_value()) ??\n\t\t\t\t\tget_first_collection_item(get_enabled_options()),\n\t\t\t\tdetails,\n\t\t\t);\n\t\t}\n\n\t\tfunction search(text: string, event: KeyboardEvent): void {\n\t\t\tif (handle.props.typeahead === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst match = option_typeahead.search({\n\t\t\t\tcurrentValue: get_highlighted_value(),\n\t\t\t\titems: get_enabled_options(),\n\t\t\t\tkey: text,\n\t\t\t});\n\n\t\t\thighlight_option(match, {\n\t\t\t\tevent,\n\t\t\t\treason: listboxHighlightChangeReason.typeahead,\n\t\t\t});\n\t\t}\n\n\t\tfunction handle_keyboard(event: KeyboardEvent): void {\n\t\t\tif (handle.props.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst keyboard_highlight_details: ListboxHighlightChangeDetails = {\n\t\t\t\tevent,\n\t\t\t\treason: listboxHighlightChangeReason.keyboard,\n\t\t\t};\n\t\t\tconst orientation = handle.props.orientation ?? vertical_orientation;\n\n\t\t\tif (is_next_navigation_key(event.key, orientation)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_highlight(1, keyboard_highlight_details);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_previous_navigation_key(event.key, orientation)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_highlight(-1, keyboard_highlight_details);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\thighlight_option(\n\t\t\t\t\tget_first_collection_item(get_enabled_options()),\n\t\t\t\t\tkeyboard_highlight_details,\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\thighlight_option(\n\t\t\t\t\tget_last_collection_item(get_enabled_options()),\n\t\t\t\t\tkeyboard_highlight_details,\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"PageDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_highlight(listbox_page_jump_size, keyboard_highlight_details, true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"PageUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_highlight(-listbox_page_jump_size, keyboard_highlight_details, true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_listbox_keyboard_selection(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tselect_value(get_highlighted_value(), {\n\t\t\t\t\tevent,\n\t\t\t\t\treason: listboxValueChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_printable_key_event(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearch(event.key, event);\n\t\t\t}\n\t\t}\n\n\t\tconst context: ListboxRuntimeContext = {\n\t\t\tget_disabled: () => {\n\t\t\t\treturn handle.props.disabled === true;\n\t\t\t},\n\t\t\tget_highlighted_id: () => {\n\t\t\t\treturn find_option(get_highlighted_value())?.id;\n\t\t\t},\n\t\t\tget_highlighted_value,\n\t\t\tget_invalid: () => {\n\t\t\t\treturn handle.props.invalid === true;\n\t\t\t},\n\t\t\tget_required: () => {\n\t\t\t\treturn handle.props.required === true;\n\t\t\t},\n\t\t\tget_value,\n\t\t\thandle_focus: (event) => {\n\t\t\t\tif (handle.props.disabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tensure_highlight({\n\t\t\t\t\tevent,\n\t\t\t\t\treason: listboxHighlightChangeReason.focus,\n\t\t\t\t});\n\t\t\t},\n\t\t\thandle_keydown: handle_keyboard,\n\t\t\thighlight_value: (value, details) => {\n\t\t\t\tif (handle.props.disabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thighlight_option(find_option(value), details);\n\t\t\t},\n\t\t\tregister_option: (option) => {\n\t\t\t\tconst changed = option_collection.register(option);\n\t\t\t\tif (changed) {\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tselect_value,\n\t\t\tvalue_selected,\n\t\t\tunregister_option: (id) => {\n\t\t\t\tconst option = option_collection.unregister(id);\n\t\t\t\tvoid handle.update();\n\t\t\t\tif (option?.value === get_highlighted_value()) {\n\t\t\t\t\tset_highlighted_value(null, {\n\t\t\t\t\t\treason: listboxHighlightChangeReason.focus,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\tconst resolve_slot = create_resolve_slot<ListboxRootStyleProps<TLayout>>(\n\t\t\tlistbox_slot.root,\n\t\t\t(props) => {\n\t\t\t\treturn {\n\t\t\t\t\tlayout: props.layout,\n\t\t\t\t} satisfies ListboxRecipeSelection<TRecipe>;\n\t\t\t},\n\t\t);\n\n\t\treturn (props: ListboxRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultHighlightedValue: _default_highlighted_value,\n\t\t\t\tdefaultValue: _default_value,\n\t\t\t\tdefaultValues: _default_values,\n\t\t\t\tdisabled,\n\t\t\t\thighlightedValue: _highlighted_value,\n\t\t\t\tinvalid,\n\t\t\t\tlayout,\n\t\t\t\tloopFocus: _loop_focus,\n\t\t\t\tmix,\n\t\t\t\tonHighlightChange: _on_highlight_change,\n\t\t\t\tonValueChange: _on_value_change,\n\t\t\t\tonValuesChange: _on_values_change,\n\t\t\t\torientation = vertical_orientation,\n\t\t\t\trequired,\n\t\t\t\tselectionFollowsFocus: _selection_follows_focus,\n\t\t\t\tselectionMode = single_selection_mode,\n\t\t\t\ttypeahead: _typeahead,\n\t\t\t\tvalue: _value,\n\t\t\t\tvalues: _values,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst highlighted_id = context.get_highlighted_id();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\t[listbox_slot.root]: {\n\t\t\t\t\t\thost: listbox_slot.root,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tcommonConditions,\n\t\t\t\t\t\t\toptions.conditions?.[listbox_slot.root],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: resolve_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(listbox_scope, listbox_slot.root),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLElement, typeof focus_event>(focus_event, (event) => {\n\t\t\t\t\t\t\tcontext.handle_focus(event);\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ton<HTMLElement, typeof keydown_event>(keydown_event, (event) => {\n\t\t\t\t\t\t\tcontext.handle_keydown(event);\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts[listbox_slot.root].mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\t\"aria-activedescendant\": highlighted_id,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(disabled === true),\n\t\t\t\t\t\t\"aria-invalid\": ariaTrue(invalid === true),\n\t\t\t\t\t\t\"aria-multiselectable\": ariaTrue(\n\t\t\t\t\t\t\tselectionMode === multiple_selection_mode,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\"aria-orientation\": orientation,\n\t\t\t\t\t\t\"aria-required\": ariaTrue(required === true),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(invalid === true),\n\t\t\t\t\t\t\"data-orientation\": orientation,\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: root_props.role ?? \"listbox\",\n\t\t\t\t\t\ttabIndex: disabled ? undefined : (root_props.tabIndex ?? 0),\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Option(\n\t\thandle: Handle<ListboxOptionProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: ListboxOptionProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tlet option_node: HTMLElement | null = null;\n\t\tlet option_id: string | null = null;\n\t\tconst resolve_slot = create_resolve_slot<\n\t\t\tListboxOptionStyleProps<TVariant, TSize>\n\t\t>(listbox_slot.option, (props) => {\n\t\t\treturn {\n\t\t\t\tsize: props.size,\n\t\t\t\tvariant: props.variant,\n\t\t\t} satisfies ListboxRecipeSelection<TRecipe>;\n\t\t});\n\n\t\treturn (props: ListboxOptionProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled = false,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttextValue,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t\t...option_props\n\t\t\t} = props;\n\t\t\tconst selected = context.value_selected(value);\n\t\t\tconst highlighted = context.get_highlighted_value() === value;\n\t\t\tconst option_text = textValue ?? infer_text_value(children);\n\t\t\tconst current_option_id = `${handle.id}-option`;\n\t\t\toption_id = current_option_id;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\t[listbox_slot.option]: {\n\t\t\t\t\t\thost: listbox_slot.option,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\toption_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[listbox_slot.option],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: resolve_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\tfunction register_option(node: HTMLElement): void {\n\t\t\t\tcontext.register_option({\n\t\t\t\t\tdisabled,\n\t\t\t\t\tid: current_option_id,\n\t\t\t\t\tnode,\n\t\t\t\t\ttext: option_text || node.textContent || \"\",\n\t\t\t\t\tvalue,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (option_node) {\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted || !option_node) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tregister_option(option_node);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst option_ref_mix = ref<HTMLElement>((node, signal) => {\n\t\t\t\toption_node = node;\n\t\t\t\tregister_option(node);\n\t\t\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\t\t\tif (option_id) {\n\t\t\t\t\t\tcontext.unregister_option(option_id);\n\t\t\t\t\t}\n\t\t\t\t\toption_node = null;\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tlistbox_scope,\n\t\t\t\t\t\tlistbox_slot.option,\n\t\t\t\t\t),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\toption_ref_mix,\n\t\t\t\t\t\ton<HTMLElement, typeof click_event>(click_event, (event) => {\n\t\t\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontext.select_value(value, {\n\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\treason: listboxValueChangeReason.pointer,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ton<HTMLElement, typeof pointermove_event>(\n\t\t\t\t\t\t\tpointermove_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontext.highlight_value(value, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: listboxHighlightChangeReason.pointer,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts[listbox_slot.option].mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...option_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(disabled),\n\t\t\t\t\t\t\"aria-selected\": ariaBoolean(selected),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled),\n\t\t\t\t\t\t[componentDataAttribute.highlighted]: dataFlag(highlighted),\n\t\t\t\t\t\t[componentDataAttribute.selected]: dataFlag(selected),\n\t\t\t\t\t\tid: current_option_id,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: \"option\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren ?? option_text,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_static_span_component<TProps extends { mix?: unknown }>(\n\t\tslot: ListboxRecipeSlot,\n\t): RemixComponent<TProps> {\n\t\treturn () => {\n\t\t\treturn (props: TProps): RemixNode => {\n\t\t\t\tconst { children, mix, ...rest_props } = props as TProps & {\n\t\t\t\t\tchildren?: RemixNode;\n\t\t\t\t\tmix?: unknown;\n\t\t\t\t};\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn listbox_recipe.resolve().slots[slot];\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\n\t\t\t\treturn createElement(\n\t\t\t\t\t\"span\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(listbox_scope, slot),\n\t\t\t\t\t\tmix: parts.hosts[slot].mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...rest_props,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction Group(\n\t\thandle: Handle<ListboxGroupProps, ListboxGroupRuntimeContext>,\n\t): (props: ListboxGroupProps) => RemixNode {\n\t\tconst group_context = create_group_label_relationship({\n\t\t\tlabel_id: `${handle.id}-label`,\n\t\t\ton_change: () => {\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t});\n\t\thandle.context.set(group_context);\n\n\t\treturn (props: ListboxGroupProps): RemixNode => {\n\t\t\tconst { children, mix, ...group_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[listbox_slot.group]: {\n\t\t\t\t\t\thost: listbox_slot.group,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn listbox_recipe.resolve().slots.group;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(listbox_scope, listbox_slot.group),\n\t\t\t\t\tmix: parts.hosts[listbox_slot.group].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...group_props,\n\t\t\t\t\t\t\"aria-labelledby\": group_context.get_labelled_by(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: \"group\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction GroupLabel(\n\t\thandle: Handle<ListboxGroupLabelProps>,\n\t): (props: ListboxGroupLabelProps) => RemixNode {\n\t\tconst group_context = handle.context.get(Group);\n\n\t\treturn (props: ListboxGroupLabelProps): RemixNode => {\n\t\t\tconst { children, mix, ...group_label_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[listbox_slot.groupLabel]: {\n\t\t\t\t\t\thost: listbox_slot.groupLabel,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn listbox_recipe.resolve().slots.groupLabel;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst group_label_ref_mix = create_group_label_ref_mix(group_context);\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tlistbox_scope,\n\t\t\t\t\t\tlistbox_slot.groupLabel,\n\t\t\t\t\t),\n\t\t\t\t\tmix: [group_label_ref_mix, parts.hosts[listbox_slot.groupLabel].mix],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...group_label_props,\n\t\t\t\t\t\tid: group_context.get_label_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tGroup,\n\t\tGroupLabel,\n\t\tOption,\n\t\tOptionIndicator: create_static_span_component<ListboxOptionIndicatorProps>(\n\t\t\tlistbox_slot.optionIndicator,\n\t\t),\n\t\tOptionText: create_static_span_component<ListboxOptionTextProps>(\n\t\t\tlistbox_slot.optionText,\n\t\t),\n\t\tRoot,\n\t};\n}\n","import { createMixin, on, ref, type ElementProps } from \"remix/ui\";\n\ntype PopoverScrollStyle = {\n\toverflow: string;\n\tscrollbarGutter: string;\n};\n\nconst scroll_styles = new WeakMap<Document, PopoverScrollStyle>();\n\nfunction has_open_popover(document: Document): boolean {\n\treturn document.querySelector(\"[popover]:popover-open\") !== null;\n}\n\nfunction capture_scroll_style(document: Document): void {\n\tif (scroll_styles.has(document)) {\n\t\treturn;\n\t}\n\n\tconst document_element = document.documentElement;\n\tscroll_styles.set(document, {\n\t\toverflow: document_element.style.overflow,\n\t\tscrollbarGutter: document_element.style.scrollbarGutter,\n\t});\n}\n\nexport function releasePopoverScrollLock(document: Document): void {\n\tif (has_open_popover(document)) {\n\t\treturn;\n\t}\n\n\tconst style = scroll_styles.get(document);\n\tif (!style) {\n\t\treturn;\n\t}\n\n\tscroll_styles.delete(document);\n\n\tconst document_element = document.documentElement;\n\tif (document_element.style.overflow === \"hidden\") {\n\t\tdocument_element.style.overflow = style.overflow;\n\t}\n\tif (document_element.style.scrollbarGutter === \"stable\") {\n\t\tdocument_element.style.scrollbarGutter = style.scrollbarGutter;\n\t}\n}\n\nexport const popoverScrollLockGuard = createMixin<HTMLElement, [], ElementProps>(\n\t(handle) => {\n\t\tlet owner_document: Document | undefined;\n\n\t\tfunction release(): void {\n\t\t\tif (!owner_document) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treleasePopoverScrollLock(owner_document);\n\t\t}\n\n\t\thandle.signal.addEventListener(\"abort\", release);\n\n\t\treturn () => {\n\t\t\treturn [\n\t\t\t\tref((node) => {\n\t\t\t\t\towner_document = node.ownerDocument;\n\t\t\t\t}),\n\t\t\t\ton<HTMLElement, \"beforetoggle\">(\"beforetoggle\", (event) => {\n\t\t\t\t\tif (event.newState === \"closed\") {\n\t\t\t\t\t\tsetTimeout(release, 0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (event.newState !== \"open\") {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst document_element =\n\t\t\t\t\t\tevent.currentTarget.ownerDocument.documentElement;\n\t\t\t\t\tcapture_scroll_style(document_element.ownerDocument);\n\t\t\t\t}),\n\t\t\t\ton<HTMLElement, \"toggle\">(\"toggle\", (event) => {\n\t\t\t\t\tif (event.newState !== \"closed\") {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\trelease();\n\t\t\t\t}),\n\t\t\t];\n\t\t};\n\t},\n);\n","import { ref, type MixInput } from \"remix/ui\";\nimport { releasePopoverScrollLock } from \"./popover-scroll-lock.ts\";\n\nexport type PopupRelationship = {\n\tcontainsTarget: (target: EventTarget | null) => boolean;\n\tfocusTrigger: () => void;\n\tgetPopup: () => HTMLElement | null;\n\tgetTrigger: () => HTMLElement | null;\n\tregisterPopup: (node: HTMLElement | null) => void;\n\tregisterTrigger: (node: HTMLElement | null) => void;\n\tsyncPopup: (open: boolean) => void;\n};\n\nexport type PopupRefMixInput = {\n\tgetOpen: () => boolean;\n\tonInteractOutside?: (event: PointerEvent) => void;\n\trelationship: PopupRelationship;\n};\n\nexport function containsEventTarget(\n\tnode: HTMLElement | null,\n\ttarget: EventTarget | null,\n): boolean {\n\treturn target instanceof Node && node?.contains(target) === true;\n}\n\nexport function syncNativePopover(node: HTMLElement, open: boolean): void {\n\tif (open) {\n\t\tnode.hidden = false;\n\t\tif (\"showPopover\" in node && !node.matches(\":popover-open\")) {\n\t\t\tnode.showPopover();\n\t\t}\n\t\treturn;\n\t}\n\n\tif (\"hidePopover\" in node && node.matches(\":popover-open\")) {\n\t\tnode.hidePopover();\n\t}\n\tnode.hidden = true;\n\treleasePopoverScrollLock(node.ownerDocument);\n}\n\nexport function createPopupRelationship(): PopupRelationship {\n\tlet popup_node: HTMLElement | null = null;\n\tlet trigger_node: HTMLElement | null = null;\n\n\treturn {\n\t\tcontainsTarget: (target) => {\n\t\t\treturn (\n\t\t\t\tcontainsEventTarget(trigger_node, target) ||\n\t\t\t\tcontainsEventTarget(popup_node, target)\n\t\t\t);\n\t\t},\n\t\tfocusTrigger: () => {\n\t\t\ttrigger_node?.focus();\n\t\t},\n\t\tgetPopup: () => {\n\t\t\treturn popup_node;\n\t\t},\n\t\tgetTrigger: () => {\n\t\t\treturn trigger_node;\n\t\t},\n\t\tregisterPopup: (node) => {\n\t\t\tpopup_node = node;\n\t\t},\n\t\tregisterTrigger: (node) => {\n\t\t\ttrigger_node = node;\n\t\t},\n\t\tsyncPopup: (open) => {\n\t\t\tif (popup_node) {\n\t\t\t\tsyncNativePopover(popup_node, open);\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport function createPopupRefMix(input: PopupRefMixInput): MixInput<HTMLElement> {\n\treturn ref<HTMLElement>((node, signal) => {\n\t\tinput.relationship.registerPopup(node);\n\t\tsyncNativePopover(node, input.getOpen());\n\t\tconst on_pointer_down = (event: PointerEvent): void => {\n\t\t\tif (!input.getOpen()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (input.relationship.containsTarget(event.target)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tinput.onInteractOutside?.(event);\n\t\t};\n\t\tnode.ownerDocument.addEventListener(\"pointerdown\", on_pointer_down, true);\n\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\tinput.relationship.registerPopup(null);\n\t\t\tnode.ownerDocument.removeEventListener(\"pointerdown\", on_pointer_down, true);\n\t\t});\n\t});\n}\n","import {\n\tcreateElement,\n\ton,\n\tref,\n\ttype Handle,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcheckableState,\n\tcheckableStateFromValue,\n\ttype CheckableChecked,\n\ttype CheckableStateName,\n} from \"./checkable-state.ts\";\nimport {\n\tariaBoolean,\n\tariaTrue,\n\tcomponentDataAttribute,\n\tcomponentStateAttribute,\n\tdataFlag,\n\topenState,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport {\n\tget_collection_navigation_item,\n\tget_first_collection_item,\n\tget_last_collection_item,\n\tget_roving_tab_index,\n} from \"./composite-navigation.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport { create_controllable_state } from \"./controllable-state.ts\";\nimport {\n\tcreate_group_label_ref_mix,\n\tcreate_group_label_relationship,\n\ttype GroupLabelRelationship,\n} from \"./group-label.ts\";\nimport {\n\tcreate_ordered_collection,\n\ttype OrderedCollectionItem,\n} from \"./ordered-collection.ts\";\nimport {\n\tcreatePopupRefMix,\n\tcreatePopupRelationship,\n\ttype PopupRelationship,\n} from \"./popup-behavior.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport { create_typeahead } from \"./typeahead.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport const menuAnatomy = {\n\tgroup: \"group\",\n\tgroupLabel: \"groupLabel\",\n\titem: \"item\",\n\titemIndicator: \"itemIndicator\",\n\tpopup: \"popup\",\n\tseparator: \"separator\",\n\ttrigger: \"trigger\",\n} as const;\n\nexport type MenuRecipeSlot = (typeof menuAnatomy)[keyof typeof menuAnatomy];\n\nexport type MenuRecipeCondition =\n\t| CommonRecipeCondition\n\t| \"checked\"\n\t| \"closed\"\n\t| \"highlighted\"\n\t| \"indeterminate\"\n\t| \"open\"\n\t| \"unchecked\";\n\nexport type MenuRecipeInput<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\tMenuRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type MenuRecipeLayout<TRecipe extends MenuRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type MenuRecipeVariant<TRecipe extends MenuRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type MenuRecipeSize<TRecipe extends MenuRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type MenuRecipeSelection<TRecipe extends MenuRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"layout\" | \"size\" | \"variant\"\n>;\n\nexport type MenuStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends MenuRecipeInput = MenuRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { menu: TRecipe } }, TMetadata>;\n\nexport type MenuOpenChangeDetails = {\n\tevent?: Event;\n\treason: MenuOpenChangeReason;\n};\n\nexport type MenuOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: MenuOpenChangeDetails,\n) => void;\n\nexport type MenuRootProps = {\n\tchildren?: RemixNode;\n\tcloseOnSelect?: boolean;\n\tdefaultOpen?: boolean;\n\tloopFocus?: boolean;\n\tonOpenChange?: MenuOpenChangeHandler;\n\tonOpenChangeComplete?: MenuOpenChangeHandler;\n\topen?: boolean;\n\ttypeahead?: boolean;\n};\n\nexport type MenuTriggerStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type MenuPopupStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type MenuItemStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = MenuTriggerStyleProps<TVariant, TSize>;\n\nexport type MenuTriggerProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\"> &\n\tMenuTriggerStyleProps<TVariant, TSize> &\n\tResponsiveProps<MenuTriggerStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type MenuPopupProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tMenuPopupStyleProps<TLayout> &\n\tResponsiveProps<MenuPopupStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type MenuItemProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\"> &\n\tMenuItemStyleProps<TVariant, TSize> &\n\tResponsiveProps<MenuItemStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tdisabled?: boolean;\n\t\tstyle?: never;\n\t\ttextValue?: string;\n\t};\n\nexport type MenuChecked = CheckableChecked;\n\nexport type MenuCheckedChangeHandler = (\n\tchecked: MenuChecked,\n\tdetails?: MenuItemSelectDetails,\n) => void;\n\nexport type MenuRadioValueChangeHandler<TValue extends string = string> = (\n\tvalue: TValue,\n\tdetails?: MenuItemSelectDetails,\n) => void;\n\nexport type MenuCheckboxItemProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\"> &\n\tMenuItemStyleProps<TVariant, TSize> &\n\tResponsiveProps<MenuItemStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tchecked?: MenuChecked;\n\t\tdefaultChecked?: MenuChecked;\n\t\tdisabled?: boolean;\n\t\tonCheckedChange?: MenuCheckedChangeHandler;\n\t\tstyle?: never;\n\t\ttextValue?: string;\n\t};\n\nexport type MenuRadioGroupProps<TValue extends string = string> = {\n\tchildren?: RemixNode;\n\tdefaultValue?: TValue | null;\n\tonValueChange?: MenuRadioValueChangeHandler<TValue>;\n\tvalue?: TValue | null;\n};\n\nexport type MenuRadioItemProps<\n\tTValue extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\" | \"value\"> &\n\tMenuItemStyleProps<TVariant, TSize> &\n\tResponsiveProps<MenuItemStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tdisabled?: boolean;\n\t\tstyle?: never;\n\t\ttextValue?: string;\n\t\tvalue: TValue;\n\t};\n\nexport type MenuItemIndicatorProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type MenuSeparatorProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type MenuGroupProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type MenuGroupLabelProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type MenuComponents<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tCheckboxItem: RemixComponent<\n\t\tMenuCheckboxItemProps<TVariant, TSize>,\n\t\tMenuItemRuntimeContext\n\t>;\n\tGroup: RemixComponent<MenuGroupProps, MenuGroupContext>;\n\tGroupLabel: RemixComponent<MenuGroupLabelProps>;\n\tItem: RemixComponent<MenuItemProps<TVariant, TSize>>;\n\tItemIndicator: RemixComponent<MenuItemIndicatorProps>;\n\tPopup: RemixComponent<MenuPopupProps<TLayout>>;\n\tRadioGroup: RemixComponent<MenuRadioGroupProps, MenuRadioGroupContext>;\n\tRadioItem: RemixComponent<\n\t\tMenuRadioItemProps<string, TVariant, TSize>,\n\t\tMenuItemRuntimeContext\n\t>;\n\tRoot: RemixComponent<MenuRootProps, MenuContext>;\n\tSeparator: RemixComponent<MenuSeparatorProps>;\n\tTrigger: RemixComponent<MenuTriggerProps<TVariant, TSize>>;\n};\n\ntype MenuContext = {\n\tclose: (details: MenuOpenChangeDetails) => void;\n\tget_close_on_select: () => boolean;\n\tget_current_item_value: () => string | null;\n\tget_open: () => boolean;\n\tget_popup_relationship: () => PopupRelationship;\n\tget_popup_id: () => string;\n\tget_trigger_id: () => string;\n\thandle_popup_keydown: (event: KeyboardEvent) => void;\n\topen: (details: MenuOpenChangeDetails, focus?: MenuOpenFocus) => void;\n\tregister_item: (item: RegisteredMenuItem) => void;\n\tregister_trigger: (node: HTMLButtonElement | null) => void;\n\tselect_item: (value: string, details: MenuItemSelectDetails) => void;\n\tset_current_item: (\n\t\tvalue: string | null,\n\t\tdetails: MenuItemFocusDetails,\n\t\tfocus?: boolean,\n\t) => void;\n\ttoggle: (details: MenuOpenChangeDetails, focus?: MenuOpenFocus) => void;\n\tunregister_item: (id: string) => void;\n\tsync_popup: () => void;\n};\n\ntype MenuGroupContext = GroupLabelRelationship;\n\ntype MenuRadioGroupContext = {\n\tget_value: () => string | null;\n\tset_value: (value: string, details: MenuItemSelectDetails) => void;\n};\n\ntype MenuItemRuntimeContext = {\n\tget_state: () => CheckableStateName | undefined;\n};\n\nexport const menuOpenChangeReason = {\n\tescape: \"escape\",\n\tinteractOutside: \"interactOutside\",\n\titem: \"item\",\n\ttab: \"tab\",\n\ttrigger: \"trigger\",\n} as const;\n\nexport const menuItemFocusReason = {\n\tkeyboard: \"keyboard\",\n\topen: \"open\",\n\tpointer: \"pointer\",\n\ttypeahead: \"typeahead\",\n} as const;\n\nexport const menuItemSelectReason = {\n\tkeyboard: \"keyboard\",\n\tpointer: \"pointer\",\n} as const;\n\nexport type MenuOpenChangeReason =\n\t(typeof menuOpenChangeReason)[keyof typeof menuOpenChangeReason];\n\nexport type MenuItemFocusReason =\n\t(typeof menuItemFocusReason)[keyof typeof menuItemFocusReason];\n\nexport type MenuItemSelectReason =\n\t(typeof menuItemSelectReason)[keyof typeof menuItemSelectReason];\n\nexport type MenuItemFocusDetails = {\n\tevent?: Event;\n\treason: MenuItemFocusReason;\n};\n\nexport type MenuItemSelectDetails = {\n\tevent?: Event;\n\treason: MenuItemSelectReason;\n};\n\ntype RegisteredMenuItem = OrderedCollectionItem<string> & {\n\tactivate: (details: MenuItemSelectDetails) => void;\n};\n\ntype MenuOpenFocus = \"first\" | \"last\";\n\nconst menu_scope = \"menu\";\nconst button_type_default = \"button\";\nconst click_event = \"click\";\nconst focus_event = \"focus\";\nconst keydown_event = \"keydown\";\nconst pointermove_event = \"pointermove\";\nconst menu_typeahead_reset_ms = 700;\n\nconst menu_conditions = mergeRecipeConditionSelectors<MenuRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tchecked: `&[${componentStateAttribute}='${checkableState.checked}']`,\n\t\tclosed: `&[${componentStateAttribute}='${openState.closed}']`,\n\t\thighlighted: `&[${componentDataAttribute.highlighted}]`,\n\t\tindeterminate: `&[${componentStateAttribute}='${checkableState.indeterminate}']`,\n\t\topen: `&[${componentStateAttribute}='${openState.open}']`,\n\t\tunchecked: `&[${componentStateAttribute}='${checkableState.unchecked}']`,\n\t} satisfies RecipeConditionSelectorMap<MenuRecipeCondition>,\n);\n\nfunction infer_text_value(children: RemixNode): string {\n\tif (typeof children === \"string\" || typeof children === \"number\") {\n\t\treturn String(children);\n\t}\n\treturn \"\";\n}\n\nfunction is_menu_keyboard_selection(event: KeyboardEvent): boolean {\n\treturn event.key === \"Enter\" || event.key === \" \" || event.key === \"Spacebar\";\n}\n\nfunction is_printable_key_event(event: KeyboardEvent): boolean {\n\treturn event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey;\n}\n\nexport function createMenu<\n\tTMode extends string,\n\tTRecipe extends MenuRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: MenuStyleSystem<TMode, TRecipe, TMetadata>,\n): MenuComponents<\n\tMenuRecipeLayout<TRecipe>,\n\tMenuRecipeVariant<TRecipe>,\n\tMenuRecipeSize<TRecipe>\n> {\n\ttype TLayout = MenuRecipeLayout<TRecipe>;\n\ttype TVariant = MenuRecipeVariant<TRecipe>;\n\ttype TSize = MenuRecipeSize<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = MenuRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.menu);\n\n\tfunction resolve_slot(\n\t\tslot: MenuRecipeSlot,\n\t\tprops: Partial<MenuPopupStyleProps<TLayout>> &\n\t\t\tPartial<MenuTriggerStyleProps<TVariant, TSize>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t\tsize: props.size,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<MenuRootProps, MenuContext>,\n\t): (props: MenuRootProps) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? false;\n\t\tlet current_item_value: string | null = null;\n\t\tlet last_completed_open = handle.props.open ?? local_open;\n\t\tlet last_open_details: MenuOpenChangeDetails = {\n\t\t\treason: menuOpenChangeReason.trigger,\n\t\t};\n\t\tconst popup_relationship = createPopupRelationship();\n\t\tconst item_collection = create_ordered_collection<RegisteredMenuItem>();\n\t\tconst item_typeahead = create_typeahead<RegisteredMenuItem>({\n\t\t\ttimeoutMs: menu_typeahead_reset_ms,\n\t\t});\n\t\tconst open_state = create_controllable_state<boolean, MenuOpenChangeDetails>({\n\t\t\tgetControlled: () => {\n\t\t\t\treturn handle.props.open;\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_open;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onOpenChange;\n\t\t\t},\n\t\t\tsetLocal: (open) => {\n\t\t\t\tlocal_open = open;\n\t\t\t},\n\t\t});\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn open_state.get();\n\t\t}\n\n\t\tfunction request_open(open: boolean, details: MenuOpenChangeDetails): void {\n\t\t\tconst changed = open_state.set(open, details);\n\t\t\tif (!changed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlast_open_details = details;\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tfunction get_items(): RegisteredMenuItem[] {\n\t\t\treturn item_collection.getItems();\n\t\t}\n\n\t\tfunction find_item(value: string | null): RegisteredMenuItem | undefined {\n\t\t\tif (value === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn item_collection.findByValue(value);\n\t\t}\n\n\t\tfunction focus_item(item: RegisteredMenuItem | undefined): void {\n\t\t\tif (item === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\titem.node.focus();\n\t\t\t});\n\t\t}\n\n\t\tfunction set_current_item(\n\t\t\tvalue: string | null,\n\t\t\tdetails: MenuItemFocusDetails,\n\t\t\tfocus = false,\n\t\t): void {\n\t\t\tconst item = find_item(value);\n\t\t\tif (value !== null && item === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst changed = current_item_value !== value;\n\t\t\tcurrent_item_value = value;\n\t\t\tif (focus) {\n\t\t\t\tfocus_item(item);\n\t\t\t}\n\t\t\tif (changed) {\n\t\t\t\tvoid handle.update();\n\t\t\t}\n\t\t}\n\n\t\tfunction focus_open_item(focus: MenuOpenFocus): void {\n\t\t\tconst items = get_items();\n\t\t\tconst item =\n\t\t\t\tfocus === \"last\"\n\t\t\t\t\t? get_last_collection_item(items)\n\t\t\t\t\t: get_first_collection_item(items);\n\t\t\tif (item === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tset_current_item(item.value, { reason: menuItemFocusReason.open }, true);\n\t\t}\n\n\t\tfunction open_menu(\n\t\t\tdetails: MenuOpenChangeDetails,\n\t\t\tfocus: MenuOpenFocus = \"first\",\n\t\t): void {\n\t\t\trequest_open(true, details);\n\t\t\tfocus_open_item(focus);\n\t\t}\n\n\t\tfunction close_menu(details: MenuOpenChangeDetails): void {\n\t\t\trequest_open(false, details);\n\t\t}\n\n\t\tfunction close_and_focus_trigger(details: MenuOpenChangeDetails): void {\n\t\t\tclose_menu(details);\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tpopup_relationship.focusTrigger();\n\t\t\t});\n\t\t}\n\n\t\tfunction move_current_item(\n\t\t\toffset: number,\n\t\t\tdetails: MenuItemFocusDetails,\n\t\t\tclamp = false,\n\t\t): void {\n\t\t\tconst item = get_collection_navigation_item({\n\t\t\t\tclamp,\n\t\t\t\tcurrentValue: current_item_value,\n\t\t\t\titems: get_items(),\n\t\t\t\tloop: handle.props.loopFocus,\n\t\t\t\toffset,\n\t\t\t});\n\t\t\tif (item === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tset_current_item(item.value, details, true);\n\t\t}\n\n\t\tfunction select_item(value: string, details: MenuItemSelectDetails): void {\n\t\t\tconst item = find_item(value);\n\t\t\tif (item === undefined || item.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\titem.activate(details);\n\t\t}\n\n\t\tfunction search_item(text: string, event: KeyboardEvent): void {\n\t\t\tif (handle.props.typeahead === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst item = item_typeahead.search({\n\t\t\t\tcurrentValue: current_item_value,\n\t\t\t\titems: get_items(),\n\t\t\t\tkey: text,\n\t\t\t});\n\t\t\tif (item === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tset_current_item(\n\t\t\t\titem.value,\n\t\t\t\t{\n\t\t\t\t\tevent,\n\t\t\t\t\treason: menuItemFocusReason.typeahead,\n\t\t\t\t},\n\t\t\t\ttrue,\n\t\t\t);\n\t\t}\n\n\t\tfunction handle_popup_keydown(event: KeyboardEvent): void {\n\t\t\tconst keyboard_focus_details: MenuItemFocusDetails = {\n\t\t\t\tevent,\n\t\t\t\treason: menuItemFocusReason.keyboard,\n\t\t\t};\n\n\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_current_item(1, keyboard_focus_details);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_current_item(-1, keyboard_focus_details);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst item = get_first_collection_item(get_items());\n\t\t\t\tset_current_item(item?.value ?? null, keyboard_focus_details, true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst item = get_last_collection_item(get_items());\n\t\t\t\tset_current_item(item?.value ?? null, keyboard_focus_details, true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_menu_keyboard_selection(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (current_item_value !== null) {\n\t\t\t\t\tselect_item(current_item_value, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\treason: menuItemSelectReason.keyboard,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Escape\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tclose_and_focus_trigger({\n\t\t\t\t\tevent,\n\t\t\t\t\treason: menuOpenChangeReason.escape,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Tab\") {\n\t\t\t\tclose_menu({\n\t\t\t\t\tevent,\n\t\t\t\t\treason: menuOpenChangeReason.tab,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_printable_key_event(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearch_item(event.key, event);\n\t\t\t}\n\t\t}\n\n\t\tconst context: MenuContext = {\n\t\t\tclose: (details) => {\n\t\t\t\tclose_menu(details);\n\t\t\t},\n\t\t\tget_close_on_select: () => {\n\t\t\t\treturn handle.props.closeOnSelect !== false;\n\t\t\t},\n\t\t\tget_current_item_value: () => {\n\t\t\t\treturn current_item_value;\n\t\t\t},\n\t\t\tget_open,\n\t\t\tget_popup_relationship: () => {\n\t\t\t\treturn popup_relationship;\n\t\t\t},\n\t\t\tget_popup_id: () => {\n\t\t\t\treturn `${handle.id}-popup`;\n\t\t\t},\n\t\t\tget_trigger_id: () => {\n\t\t\t\treturn popup_relationship.getTrigger()?.id || `${handle.id}-trigger`;\n\t\t\t},\n\t\t\thandle_popup_keydown,\n\t\t\topen: open_menu,\n\t\t\tregister_item: (item) => {\n\t\t\t\tconst changed = item_collection.register(item);\n\t\t\t\tif (get_open() && current_item_value === null) {\n\t\t\t\t\tconst first_item = get_first_collection_item(get_items());\n\t\t\t\t\tset_current_item(\n\t\t\t\t\t\tfirst_item?.value ?? null,\n\t\t\t\t\t\t{ reason: menuItemFocusReason.open },\n\t\t\t\t\t\ttrue,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (changed) {\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tregister_trigger: (node) => {\n\t\t\t\tconst changed = popup_relationship.getTrigger() !== node;\n\t\t\t\tpopup_relationship.registerTrigger(node);\n\t\t\t\tif (changed) {\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tselect_item,\n\t\t\tset_current_item,\n\t\t\ttoggle: (details, focus = \"first\") => {\n\t\t\t\tif (get_open()) {\n\t\t\t\t\tclose_menu(details);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\topen_menu(details, focus);\n\t\t\t},\n\t\t\tsync_popup: () => {\n\t\t\t\tpopup_relationship.syncPopup(get_open());\n\t\t\t},\n\t\t\tunregister_item: (id) => {\n\t\t\t\tconst item = item_collection.unregister(id);\n\t\t\t\tif (item?.value === current_item_value) {\n\t\t\t\t\tcurrent_item_value = null;\n\t\t\t\t}\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: MenuRootProps): RemixNode => {\n\t\t\tconst current_open = get_open();\n\t\t\tif (current_open !== last_completed_open) {\n\t\t\t\tconst completed_open = current_open;\n\t\t\t\tconst completed_details = last_open_details;\n\t\t\t\tlast_completed_open = current_open;\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onOpenChangeComplete?.(completed_open, completed_details);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn props.children;\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<MenuTriggerProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: MenuTriggerProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: MenuTriggerProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvariant,\n\t\t\t\t...trigger_props\n\t\t\t} = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\t[menuAnatomy.trigger]: \"button\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\t[menuAnatomy.trigger]: {\n\t\t\t\t\t\thost: menuAnatomy.trigger,\n\t\t\t\t\t\tconditions: menu_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(menuAnatomy.trigger, current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst trigger_ref_mix = ref<HTMLButtonElement>((node, signal) => {\n\t\t\t\tcontext.register_trigger(node);\n\t\t\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\t\t\tcontext.register_trigger(null);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(menu_scope, menuAnatomy.trigger),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ttrigger_ref_mix,\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.toggle({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: menuOpenChangeReason.trigger,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLButtonElement, typeof keydown_event>(\n\t\t\t\t\t\t\tkeydown_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tevent.key === \"ArrowDown\" ||\n\t\t\t\t\t\t\t\t\tevent.key === \"Enter\" ||\n\t\t\t\t\t\t\t\t\tevent.key === \" \" ||\n\t\t\t\t\t\t\t\t\tevent.key === \"Spacebar\"\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.open({\n\t\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\t\treason: menuOpenChangeReason.trigger,\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (event.key === \"ArrowUp\") {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tcontext.open(\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\t\t\treason: menuOpenChangeReason.trigger,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\"last\",\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-controls\": context.get_popup_id(),\n\t\t\t\t\t\t\"aria-expanded\": ariaBoolean(open),\n\t\t\t\t\t\t\"aria-haspopup\": \"menu\",\n\t\t\t\t\t\t[componentDataAttribute.open]: dataFlag(open),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\tid: trigger_props.id ?? context.get_trigger_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Popup(\n\t\thandle: Handle<MenuPopupProps<TLayout, TBreakpoint>>,\n\t): (props: MenuPopupProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: MenuPopupProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...popup_props } = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\t[menuAnatomy.popup]: \"div\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\t[menuAnatomy.popup]: {\n\t\t\t\t\t\thost: menuAnatomy.popup,\n\t\t\t\t\t\tconditions: menu_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(menuAnatomy.popup, current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst popup_ref_mix = createPopupRefMix({\n\t\t\t\tgetOpen: context.get_open,\n\t\t\t\tonInteractOutside: (event) => {\n\t\t\t\t\tcontext.close({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\treason: menuOpenChangeReason.interactOutside,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\trelationship: context.get_popup_relationship(),\n\t\t\t});\n\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.sync_popup();\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(menu_scope, menuAnatomy.popup),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tpopup_ref_mix,\n\t\t\t\t\t\ton<HTMLElement, typeof keydown_event>(keydown_event, (event) => {\n\t\t\t\t\t\t\tcontext.handle_popup_keydown(event);\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.popup.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...popup_props,\n\t\t\t\t\t\t\"aria-labelledby\": context.get_trigger_id(),\n\t\t\t\t\t\t[componentDataAttribute.open]: dataFlag(open),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\thidden: !open,\n\t\t\t\t\t\tid: popup_props.id ?? context.get_popup_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\tpopover: \"manual\",\n\t\t\t\t\t\trole: popup_props.role ?? \"menu\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\ttype MenuItemARIAChecked = \"false\" | \"mixed\" | \"true\";\n\n\ttype MenuItemRenderInput = {\n\t\tariaChecked?: MenuItemARIAChecked;\n\t\tat?: Partial<Record<TBreakpoint, Partial<MenuItemStyleProps<TVariant, TSize>>>>;\n\t\tchildren?: RemixNode;\n\t\tdisabled: boolean;\n\t\thostProps: Omit<Props<\"button\">, \"style\">;\n\t\tmix?: unknown;\n\t\tonActivate: (details: MenuItemSelectDetails) => void;\n\t\trole: string;\n\t\tsize?: TSize;\n\t\tstate?: CheckableStateName;\n\t\ttextValue: string;\n\t\ttype: string;\n\t\tvariant?: TVariant;\n\t};\n\n\tfunction create_menu_item_renderer<TProps extends object, TContext>(\n\t\thandle: Handle<TProps, TContext>,\n\t\tcontext: MenuContext,\n\t): (input: MenuItemRenderInput) => RemixNode {\n\t\tlet item_node: HTMLButtonElement | null = null;\n\t\tlet item_id: string | null = null;\n\n\t\treturn (input: MenuItemRenderInput): RemixNode => {\n\t\t\tconst current_item_id = `${handle.id}-item`;\n\t\t\titem_id = current_item_id;\n\t\t\tconst current = context.get_current_item_value() === current_item_id;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat: input.at,\n\t\t\t\thostElements: {\n\t\t\t\t\t[menuAnatomy.item]: \"button\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\t[menuAnatomy.item]: {\n\t\t\t\t\t\thost: menuAnatomy.item,\n\t\t\t\t\t\tconditions: menu_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(menuAnatomy.item, current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {\n\t\t\t\t\tsize: input.size,\n\t\t\t\t\tvariant: input.variant,\n\t\t\t\t},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\tfunction register_item(node: HTMLButtonElement): void {\n\t\t\t\tcontext.register_item({\n\t\t\t\t\tactivate: input.onActivate,\n\t\t\t\t\tdisabled: input.disabled,\n\t\t\t\t\tid: current_item_id,\n\t\t\t\t\tnode,\n\t\t\t\t\ttext: input.textValue || node.textContent || \"\",\n\t\t\t\t\tvalue: current_item_id,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (item_node) {\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted || !item_node) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tregister_item(item_node);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst item_ref_mix = ref<HTMLButtonElement>((node, signal) => {\n\t\t\t\titem_node = node;\n\t\t\t\tregister_item(node);\n\t\t\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\t\t\tif (item_id) {\n\t\t\t\t\t\tcontext.unregister_item(item_id);\n\t\t\t\t\t}\n\t\t\t\t\titem_node = null;\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(menu_scope, menuAnatomy.item),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\titem_ref_mix,\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tif (input.disabled) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontext.select_item(current_item_id, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: menuItemSelectReason.pointer,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLButtonElement, typeof focus_event>(\n\t\t\t\t\t\t\tfocus_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.set_current_item(current_item_id, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: menuItemFocusReason.pointer,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLButtonElement, typeof pointermove_event>(\n\t\t\t\t\t\t\tpointermove_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.set_current_item(current_item_id, {\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: menuItemFocusReason.pointer,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.item.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...input.hostProps,\n\t\t\t\t\t\t\"aria-checked\": input.ariaChecked,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(input.disabled),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(input.disabled),\n\t\t\t\t\t\t[componentDataAttribute.highlighted]: dataFlag(current),\n\t\t\t\t\t\t[componentStateAttribute]: input.state,\n\t\t\t\t\t\tid: current_item_id,\n\t\t\t\t\t\tmix: input.mix,\n\t\t\t\t\t\trole: input.role,\n\t\t\t\t\t\ttabIndex: get_roving_tab_index({\n\t\t\t\t\t\t\tcurrentValue: context.get_current_item_value(),\n\t\t\t\t\t\t\titemValue: current_item_id,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttype: input.type,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tinput.children ?? input.textValue,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Item(\n\t\thandle: Handle<MenuItemProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: MenuItemProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst render_item = create_menu_item_renderer(handle, context);\n\n\t\treturn (props: MenuItemProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled = false,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttextValue,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvariant,\n\t\t\t\t...item_props\n\t\t\t} = props;\n\t\t\tconst item_text = textValue ?? infer_text_value(children);\n\t\t\treturn render_item({\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled,\n\t\t\t\thostProps: item_props,\n\t\t\t\tmix,\n\t\t\t\tonActivate: (details) => {\n\t\t\t\t\tif (context.get_close_on_select()) {\n\t\t\t\t\t\tcontext.close({\n\t\t\t\t\t\t\tevent: details.event,\n\t\t\t\t\t\t\treason: menuOpenChangeReason.item,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trole: item_props.role ?? \"menuitem\",\n\t\t\t\tsize,\n\t\t\t\ttextValue: item_text,\n\t\t\t\ttype,\n\t\t\t\tvariant,\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction CheckboxItem(\n\t\thandle: Handle<\n\t\t\tMenuCheckboxItemProps<TVariant, TSize, TBreakpoint>,\n\t\t\tMenuItemRuntimeContext\n\t\t>,\n\t): (props: MenuCheckboxItemProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tlet local_checked = handle.props.defaultChecked ?? false;\n\t\tconst render_item = create_menu_item_renderer(handle, context);\n\t\tconst checked_state = create_controllable_state<\n\t\t\tMenuChecked,\n\t\t\tMenuItemSelectDetails\n\t\t>({\n\t\t\tgetControlled: () => {\n\t\t\t\treturn handle.props.checked;\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_checked;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onCheckedChange;\n\t\t\t},\n\t\t\tsetLocal: (checked) => {\n\t\t\t\tlocal_checked = checked;\n\t\t\t},\n\t\t});\n\t\tconst item_context: MenuItemRuntimeContext = {\n\t\t\tget_state: () => {\n\t\t\t\treturn checkableStateFromValue(checked_state.get());\n\t\t\t},\n\t\t};\n\t\thandle.context.set(item_context);\n\n\t\treturn (\n\t\t\tprops: MenuCheckboxItemProps<TVariant, TSize, TBreakpoint>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchecked: _checked,\n\t\t\t\tchildren,\n\t\t\t\tdefaultChecked: _default_checked,\n\t\t\t\tdisabled = false,\n\t\t\t\tmix,\n\t\t\t\tonCheckedChange: _on_checked_change,\n\t\t\t\tsize,\n\t\t\t\ttextValue,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvariant,\n\t\t\t\t...item_props\n\t\t\t} = props;\n\t\t\tconst item_text = textValue ?? infer_text_value(children);\n\t\t\tconst state = checkableStateFromValue(checked_state.get());\n\t\t\tconst aria_checked =\n\t\t\t\tstate === checkableState.indeterminate\n\t\t\t\t\t? \"mixed\"\n\t\t\t\t\t: state === checkableState.checked\n\t\t\t\t\t\t? \"true\"\n\t\t\t\t\t\t: \"false\";\n\t\t\treturn render_item({\n\t\t\t\tariaChecked: aria_checked,\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled,\n\t\t\t\thostProps: item_props,\n\t\t\t\tmix,\n\t\t\t\tonActivate: (details) => {\n\t\t\t\t\tconst next_checked = checked_state.get() === true ? false : true;\n\t\t\t\t\tchecked_state.set(next_checked, details);\n\t\t\t\t\tif (context.get_close_on_select()) {\n\t\t\t\t\t\tcontext.close({\n\t\t\t\t\t\t\tevent: details.event,\n\t\t\t\t\t\t\treason: menuOpenChangeReason.item,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t},\n\t\t\t\trole: item_props.role ?? \"menuitemcheckbox\",\n\t\t\t\tsize,\n\t\t\t\tstate,\n\t\t\t\ttextValue: item_text,\n\t\t\t\ttype,\n\t\t\t\tvariant,\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction RadioGroup(\n\t\thandle: Handle<MenuRadioGroupProps, MenuRadioGroupContext>,\n\t): (props: MenuRadioGroupProps) => RemixNode {\n\t\tlet local_value = handle.props.defaultValue ?? null;\n\n\t\tfunction get_value(): string | null {\n\t\t\tif (handle.props.value !== undefined) {\n\t\t\t\treturn handle.props.value;\n\t\t\t}\n\t\t\treturn local_value;\n\t\t}\n\n\t\tfunction set_value(value: string, details: MenuItemSelectDetails): void {\n\t\t\tif (Object.is(get_value(), value)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (handle.props.value === undefined) {\n\t\t\t\tlocal_value = value;\n\t\t\t}\n\t\t\thandle.props.onValueChange?.(value, details);\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tconst context: MenuRadioGroupContext = {\n\t\t\tget_value,\n\t\t\tset_value,\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: MenuRadioGroupProps): RemixNode => {\n\t\t\treturn props.children;\n\t\t};\n\t}\n\n\tfunction RadioItem(\n\t\thandle: Handle<\n\t\t\tMenuRadioItemProps<string, TVariant, TSize, TBreakpoint>,\n\t\t\tMenuItemRuntimeContext\n\t\t>,\n\t): (props: MenuRadioItemProps<string, TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst radio_group_context = handle.context.get(RadioGroup);\n\t\tconst render_item = create_menu_item_renderer(handle, context);\n\t\tconst item_context: MenuItemRuntimeContext = {\n\t\t\tget_state: () => {\n\t\t\t\treturn checkableStateFromValue(\n\t\t\t\t\tradio_group_context.get_value() === handle.props.value,\n\t\t\t\t\tfalse,\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t\thandle.context.set(item_context);\n\n\t\treturn (\n\t\t\tprops: MenuRadioItemProps<string, TVariant, TSize, TBreakpoint>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled = false,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttextValue,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t\t...item_props\n\t\t\t} = props;\n\t\t\tconst item_text = textValue ?? infer_text_value(children);\n\t\t\tconst checked = radio_group_context.get_value() === value;\n\t\t\tconst state = checkableStateFromValue(checked, false);\n\t\t\treturn render_item({\n\t\t\t\tariaChecked: ariaBoolean(checked),\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdisabled,\n\t\t\t\thostProps: item_props,\n\t\t\t\tmix,\n\t\t\t\tonActivate: (details) => {\n\t\t\t\t\tradio_group_context.set_value(value, details);\n\t\t\t\t\tif (context.get_close_on_select()) {\n\t\t\t\t\t\tcontext.close({\n\t\t\t\t\t\t\tevent: details.event,\n\t\t\t\t\t\t\treason: menuOpenChangeReason.item,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\trole: item_props.role ?? \"menuitemradio\",\n\t\t\t\tsize,\n\t\t\t\tstate,\n\t\t\t\ttextValue: item_text,\n\t\t\t\ttype,\n\t\t\t\tvariant,\n\t\t\t});\n\t\t};\n\t}\n\n\tfunction ItemIndicator(\n\t\thandle: Handle<MenuItemIndicatorProps>,\n\t): (props: MenuItemIndicatorProps) => RemixNode {\n\t\tconst checkbox_item_context = handle.context.get(CheckboxItem) as\n\t\t\t| MenuItemRuntimeContext\n\t\t\t| undefined;\n\t\tconst radio_item_context = handle.context.get(RadioItem) as\n\t\t\t| MenuItemRuntimeContext\n\t\t\t| undefined;\n\n\t\treturn (props: MenuItemIndicatorProps): RemixNode => {\n\t\t\tconst { children, mix, ...indicator_props } = props;\n\t\t\tconst state =\n\t\t\t\tcheckbox_item_context?.get_state() ?? radio_item_context?.get_state();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[menuAnatomy.itemIndicator]: {\n\t\t\t\t\t\thost: menuAnatomy.itemIndicator,\n\t\t\t\t\t\tconditions: menu_conditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(menuAnatomy.itemIndicator, {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"span\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tmenu_scope,\n\t\t\t\t\t\tmenuAnatomy.itemIndicator,\n\t\t\t\t\t),\n\t\t\t\t\tmix: parts.hosts[menuAnatomy.itemIndicator].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...indicator_props,\n\t\t\t\t\t\t[componentStateAttribute]: state,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Group(\n\t\thandle: Handle<MenuGroupProps, MenuGroupContext>,\n\t): (props: MenuGroupProps) => RemixNode {\n\t\tconst group_context = create_group_label_relationship({\n\t\t\tlabel_id: `${handle.id}-label`,\n\t\t\ton_change: () => {\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t});\n\t\thandle.context.set(group_context);\n\n\t\treturn (props: MenuGroupProps): RemixNode => {\n\t\t\tconst { children, mix, ...group_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[menuAnatomy.group]: {\n\t\t\t\t\t\thost: menuAnatomy.group,\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(menuAnatomy.group, {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(menu_scope, menuAnatomy.group),\n\t\t\t\t\tmix: parts.hosts[menuAnatomy.group].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...group_props,\n\t\t\t\t\t\t\"aria-labelledby\": group_context.get_labelled_by(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: group_props.role ?? \"group\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction GroupLabel(\n\t\thandle: Handle<MenuGroupLabelProps>,\n\t): (props: MenuGroupLabelProps) => RemixNode {\n\t\tconst group_context = handle.context.get(Group);\n\n\t\treturn (props: MenuGroupLabelProps): RemixNode => {\n\t\t\tconst { children, mix, ...group_label_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[menuAnatomy.groupLabel]: {\n\t\t\t\t\t\thost: menuAnatomy.groupLabel,\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(menuAnatomy.groupLabel, {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst group_label_ref_mix = create_group_label_ref_mix(group_context);\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tmenu_scope,\n\t\t\t\t\t\tmenuAnatomy.groupLabel,\n\t\t\t\t\t),\n\t\t\t\t\tmix: [group_label_ref_mix, parts.hosts[menuAnatomy.groupLabel].mix],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...group_label_props,\n\t\t\t\t\t\tid: group_context.get_label_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_static_part<TElement extends \"div\">(\n\t\tpart: typeof menuAnatomy.separator,\n\t\trole: string | undefined,\n\t): RemixComponent<Omit<Props<TElement>, \"style\"> & { style?: never }> {\n\t\treturn () => {\n\t\t\treturn (\n\t\t\t\tprops: Omit<Props<TElement>, \"style\"> & { style?: never },\n\t\t\t): RemixNode => {\n\t\t\t\tconst { children, mix, ...part_props } = props;\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[part]: {\n\t\t\t\t\t\t\thost: part,\n\t\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn resolve_slot(part, {});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} as Record<\n\t\t\t\t\t\ttypeof part,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconditions: typeof commonConditions;\n\t\t\t\t\t\t\thost: typeof part;\n\t\t\t\t\t\t\tresolveSlot: () => ReturnType<\n\t\t\t\t\t\t\t\ttypeof recipe.resolve\n\t\t\t\t\t\t\t>[\"slots\"][typeof part];\n\t\t\t\t\t\t}\n\t\t\t\t\t>,\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\n\t\t\t\treturn createElement(\n\t\t\t\t\t\"div\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(menu_scope, part),\n\t\t\t\t\t\tmix: parts.hosts[part].mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...part_props,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t\trole: part_props.role ?? role,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\treturn {\n\t\tCheckboxItem,\n\t\tGroup,\n\t\tGroupLabel,\n\t\tItem,\n\t\tItemIndicator,\n\t\tPopup,\n\t\tRadioGroup,\n\t\tRadioItem,\n\t\tRoot,\n\t\tSeparator: create_static_part(menuAnatomy.separator, \"separator\"),\n\t\tTrigger,\n\t};\n}\n","import {\n\tFragment,\n\tcreateElement,\n\ton,\n\tref,\n\ttype Handle,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { popoverScrollLockGuard } from \"./popover-scroll-lock.ts\";\nimport {\n\tcreatePopupRefMix,\n\tcreatePopupRelationship,\n\ttype PopupRelationship,\n} from \"./popup-behavior.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport const popoverAnatomy = {\n\tparts: {\n\t\tarrow: \"arrow\",\n\t\tclose: \"close\",\n\t\tdescription: \"description\",\n\t\tpopup: \"popup\",\n\t\ttitle: \"title\",\n\t\ttrigger: \"trigger\",\n\t},\n\tscope: \"popover\",\n} as const;\n\nexport type PopoverRecipeSlot =\n\t(typeof popoverAnatomy.parts)[keyof typeof popoverAnatomy.parts];\nexport type PopoverRecipeCondition = string;\n\nexport type PopoverRecipeInput<TSize extends string = string> = RecipeWithVariantGroups<\n\tPopoverRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t}\n>;\n\nexport type PopoverRecipeSize<TRecipe extends PopoverRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type PopoverStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends PopoverRecipeInput = PopoverRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tpopover: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type PopoverOpenChangeReason = \"close\" | \"escape\" | \"interactOutside\" | \"trigger\";\n\nexport type PopoverOpenChangeDetails = {\n\tevent?: Event;\n\treason: PopoverOpenChangeReason;\n};\n\nexport type PopoverOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: PopoverOpenChangeDetails,\n) => void;\n\nexport type PopoverRootProps = {\n\tchildren?: RemixNode;\n\tcloseOnEscape?: boolean;\n\tcloseOnInteractOutside?: boolean;\n\tdefaultOpen?: boolean;\n\tmodal?: boolean;\n\topen?: boolean;\n\tonOpenChange?: PopoverOpenChangeHandler;\n\tonOpenChangeComplete?: PopoverOpenChangeHandler;\n\tshouldCloseOnInteractOutside?: (element: Element) => boolean;\n};\n\nexport type PopoverTriggerProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type PopoverSide = \"bottom\" | \"left\" | \"right\" | \"top\";\nexport type PopoverAlign = \"center\" | \"end\" | \"start\";\n\nexport type PopoverPopupStyleProps<TSize extends string = string> = {\n\tsize?: TSize;\n};\n\nexport type PopoverPopupProps<TSize extends string = string> = Omit<\n\tProps<\"div\">,\n\t\"style\"\n> &\n\tPopoverPopupStyleProps<TSize> & {\n\t\talign?: PopoverAlign;\n\t\talignOffset?: number;\n\t\tarrowPadding?: number;\n\t\tavoidCollisions?: boolean;\n\t\tcollisionPadding?: number;\n\t\tside?: PopoverSide;\n\t\tsideOffset?: number;\n\t\tstyle?: never;\n\t};\n\nexport type PopoverArrowProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type PopoverTitleProps = Omit<Props<\"h2\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type PopoverDescriptionProps = Omit<Props<\"p\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type PopoverCloseProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type PopoverComponents<TSize extends string = string> = {\n\tArrow: RemixComponent<PopoverArrowProps>;\n\tClose: RemixComponent<PopoverCloseProps>;\n\tDescription: RemixComponent<PopoverDescriptionProps>;\n\tPopup: RemixComponent<PopoverPopupProps<TSize>>;\n\tRoot: RemixComponent<PopoverRootProps, PopoverRuntimeContext>;\n\tTitle: RemixComponent<PopoverTitleProps>;\n\tTrigger: RemixComponent<PopoverTriggerProps>;\n};\n\nexport type PopoverConditionSelectors = Partial<\n\tReadonly<Record<PopoverRecipeSlot, RecipeConditionSelectorMap<string>>>\n>;\n\nexport type PopoverOptions = {\n\tconditions?: PopoverConditionSelectors;\n};\n\ntype PopoverRuntimeContext = {\n\tclose: (details: PopoverOpenChangeDetails) => void;\n\tget_close_on_escape: () => boolean;\n\tget_close_on_interact_outside: () => boolean;\n\tget_description_id: () => string;\n\tget_open: () => boolean;\n\tget_popup_relationship: () => PopupRelationship;\n\tget_popup_id: () => string;\n\tget_should_close_on_interact_outside: () =>\n\t\t| ((element: Element) => boolean)\n\t\t| undefined;\n\tget_title_id: () => string;\n\tget_trigger_id: () => string;\n\topen: (details: PopoverOpenChangeDetails) => void;\n\tregister_trigger: (node: HTMLElement | null) => void;\n\tsync_popup: () => void;\n\ttoggle: (details: PopoverOpenChangeDetails) => void;\n};\n\nconst popover_trigger_conditions = mergeRecipeConditionSelectors<string>(\n\tcommonConditions,\n\t{\n\t\tclosed: \"&[aria-expanded='false']\",\n\t\topen: \"&[aria-expanded='true']\",\n\t},\n);\n\nconst popover_popup_conditions = {\n\tclosed: \"&:not(:popover-open), &:not([data-open])\",\n\topen: \"&:popover-open, &[data-open]\",\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<string>;\n\nconst popover_static_conditions = commonConditions;\n\nconst button_type_default = \"button\";\nconst popover_align_default = \"start\" satisfies PopoverAlign;\nconst popover_side_default = \"bottom\" satisfies PopoverSide;\n\nexport function createPopover<\n\tTMode extends string,\n\tTRecipe extends PopoverRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: PopoverStyleSystem<TMode, TRecipe, TMetadata>,\n\toptions: PopoverOptions = {},\n): PopoverComponents<PopoverRecipeSize<TRecipe>> {\n\ttype TSize = PopoverRecipeSize<TRecipe>;\n\n\tconst popover_recipe = createRecipe(style_system.token.recipe.popover);\n\n\tfunction Root(\n\t\thandle: Handle<PopoverRootProps, PopoverRuntimeContext>,\n\t): (props: PopoverRootProps) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? false;\n\t\tlet last_completed_open = handle.props.open ?? local_open;\n\t\tlet last_open_details: PopoverOpenChangeDetails = {\n\t\t\treason: \"trigger\",\n\t\t};\n\t\tconst popup_relationship = createPopupRelationship();\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn handle.props.open ?? local_open;\n\t\t}\n\n\t\tfunction request_open(open: boolean, details: PopoverOpenChangeDetails): void {\n\t\t\tif (get_open() === open) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlast_open_details = details;\n\t\t\tif (handle.props.open === undefined) {\n\t\t\t\tlocal_open = open;\n\t\t\t}\n\t\t\thandle.props.onOpenChange?.(open, details);\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tconst context: PopoverRuntimeContext = {\n\t\t\tclose: (details) => {\n\t\t\t\trequest_open(false, details);\n\t\t\t},\n\t\t\tget_close_on_escape: () => {\n\t\t\t\treturn handle.props.closeOnEscape !== false;\n\t\t\t},\n\t\t\tget_close_on_interact_outside: () => {\n\t\t\t\treturn handle.props.closeOnInteractOutside !== false;\n\t\t\t},\n\t\t\tget_description_id: () => {\n\t\t\t\treturn `${handle.id}-description`;\n\t\t\t},\n\t\t\tget_open,\n\t\t\tget_popup_relationship: () => {\n\t\t\t\treturn popup_relationship;\n\t\t\t},\n\t\t\tget_popup_id: () => {\n\t\t\t\treturn `${handle.id}-popup`;\n\t\t\t},\n\t\t\tget_should_close_on_interact_outside: () => {\n\t\t\t\treturn handle.props.shouldCloseOnInteractOutside;\n\t\t\t},\n\t\t\tget_title_id: () => {\n\t\t\t\treturn `${handle.id}-title`;\n\t\t\t},\n\t\t\tget_trigger_id: () => {\n\t\t\t\treturn `${handle.id}-trigger`;\n\t\t\t},\n\t\t\topen: (details) => {\n\t\t\t\trequest_open(true, details);\n\t\t\t},\n\t\t\tregister_trigger: (node) => {\n\t\t\t\tpopup_relationship.registerTrigger(node);\n\t\t\t},\n\t\t\tsync_popup: () => {\n\t\t\t\tpopup_relationship.syncPopup(get_open());\n\t\t\t\tif (!get_open()) {\n\t\t\t\t\tpopup_relationship.focusTrigger();\n\t\t\t\t}\n\t\t\t},\n\t\t\ttoggle: (details) => {\n\t\t\t\trequest_open(!get_open(), details);\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: PopoverRootProps): RemixNode => {\n\t\t\tconst current_open = get_open();\n\t\t\tif (current_open !== last_completed_open) {\n\t\t\t\tconst completed_open = current_open;\n\t\t\t\tconst completed_details = last_open_details;\n\t\t\t\tlast_completed_open = current_open;\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onOpenChangeComplete?.(completed_open, completed_details);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn createElement(Fragment, {}, props.children);\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<PopoverTriggerProps>,\n\t): (props: PopoverTriggerProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst resolved = popover_recipe.resolve();\n\t\tconst parts = createComponentStyleTargets({\n\t\t\thostElements: {\n\t\t\t\ttrigger: \"button\",\n\t\t\t},\n\t\t\ttargets: {\n\t\t\t\ttrigger: {\n\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\tpopover_trigger_conditions,\n\t\t\t\t\t\toptions.conditions?.trigger,\n\t\t\t\t\t),\n\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\treturn resolved.slots[popoverAnatomy.parts.trigger];\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tprops: {},\n\t\t\tstyleSystem: style_system,\n\t\t});\n\n\t\treturn (props: PopoverTriggerProps): RemixNode => {\n\t\t\tconst { children, mix, type = button_type_default, ...trigger_props } = props;\n\t\t\tconst is_open = context.get_open();\n\t\t\tconst trigger_ref_mix = ref<HTMLButtonElement>((node, signal) => {\n\t\t\t\tcontext.register_trigger(node);\n\t\t\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\t\t\tcontext.register_trigger(null);\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst trigger_click_mix = on<HTMLButtonElement, \"click\">(\"click\", (event) => {\n\t\t\t\tcontext.toggle({ event, reason: \"trigger\" });\n\t\t\t});\n\t\t\tconst trigger_keydown_mix = on<HTMLButtonElement, \"keydown\">(\n\t\t\t\t\"keydown\",\n\t\t\t\t(event) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.key !== \"ArrowDown\" &&\n\t\t\t\t\t\tevent.key !== \"Enter\" &&\n\t\t\t\t\t\tevent.key !== \" \"\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tcontext.open({ event, reason: \"trigger\" });\n\t\t\t\t},\n\t\t\t);\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tpopoverAnatomy.scope,\n\t\t\t\t\t\tpopoverAnatomy.parts.trigger,\n\t\t\t\t\t),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ttrigger_ref_mix,\n\t\t\t\t\t\ttrigger_click_mix,\n\t\t\t\t\t\ttrigger_keydown_mix,\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-controls\": context.get_popup_id(),\n\t\t\t\t\t\t\"aria-expanded\": is_open ? \"true\" : \"false\",\n\t\t\t\t\t\t\"data-open\": is_open ? \"\" : undefined,\n\t\t\t\t\t\tid: context.get_trigger_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Popup(\n\t\thandle: Handle<PopoverPopupProps<TSize>>,\n\t): (props: PopoverPopupProps<TSize>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: PopoverPopupProps<TSize>): RemixNode => {\n\t\t\tconst {\n\t\t\t\talign = popover_align_default,\n\t\t\t\talignOffset,\n\t\t\t\tarrowPadding,\n\t\t\t\tavoidCollisions,\n\t\t\t\tchildren,\n\t\t\t\tcollisionPadding,\n\t\t\t\tmix,\n\t\t\t\tside = popover_side_default,\n\t\t\t\tsideOffset,\n\t\t\t\tsize,\n\t\t\t\t...popup_props\n\t\t\t} = props;\n\t\t\tconst is_open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tpopup: {\n\t\t\t\t\t\thost: \"popup\",\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tpopover_popup_conditions,\n\t\t\t\t\t\t\toptions.conditions?.popup,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: (style_props) => {\n\t\t\t\t\t\t\treturn popover_recipe.resolve({\n\t\t\t\t\t\t\t\tsize: style_props.size,\n\t\t\t\t\t\t\t}).slots[popoverAnatomy.parts.popup];\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst popup_ref_mix = createPopupRefMix({\n\t\t\t\tgetOpen: context.get_open,\n\t\t\t\tonInteractOutside: (event) => {\n\t\t\t\t\tif (!context.get_close_on_interact_outside()) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst should_close =\n\t\t\t\t\t\tevent.target instanceof Element\n\t\t\t\t\t\t\t? context.get_should_close_on_interact_outside()?.(\n\t\t\t\t\t\t\t\t\tevent.target,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\tif (should_close === false) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcontext.close({ event, reason: \"interactOutside\" });\n\t\t\t\t},\n\t\t\t\trelationship: context.get_popup_relationship(),\n\t\t\t});\n\t\t\tconst popup_keydown_mix = on<HTMLElement, \"keydown\">(\"keydown\", (event) => {\n\t\t\t\tif (event.key !== \"Escape\" || !context.get_close_on_escape()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcontext.close({ event, reason: \"escape\" });\n\t\t\t});\n\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.sync_popup();\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tpopoverAnatomy.scope,\n\t\t\t\t\t\tpopoverAnatomy.parts.popup,\n\t\t\t\t\t),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tpopoverScrollLockGuard(),\n\t\t\t\t\t\tpopup_ref_mix,\n\t\t\t\t\t\tpopup_keydown_mix,\n\t\t\t\t\t\tparts.hosts.popup.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...popup_props,\n\t\t\t\t\t\t\"aria-describedby\": context.get_description_id(),\n\t\t\t\t\t\t\"aria-labelledby\": context.get_title_id(),\n\t\t\t\t\t\t\"data-align\": align,\n\t\t\t\t\t\t\"data-avoid-collisions\": avoidCollisions,\n\t\t\t\t\t\t\"data-open\": is_open ? \"\" : undefined,\n\t\t\t\t\t\t\"data-side\": side,\n\t\t\t\t\t\t\"data-vorma-align-offset\": alignOffset,\n\t\t\t\t\t\t\"data-vorma-arrow-padding\": arrowPadding,\n\t\t\t\t\t\t\"data-vorma-collision-padding\": collisionPadding,\n\t\t\t\t\t\t\"data-vorma-side-offset\": sideOffset,\n\t\t\t\t\t\thidden: !is_open,\n\t\t\t\t\t\tid: context.get_popup_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\tpopover: \"manual\",\n\t\t\t\t\t\trole: \"dialog\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_static_component<TProps extends { mix?: unknown }>(\n\t\tslot: PopoverRecipeSlot,\n\t\telement: \"button\" | \"div\" | \"h2\" | \"p\",\n\t\textra_props?: Record<string, unknown>,\n\t): RemixComponent<TProps> {\n\t\treturn (handle: Handle<TProps>) => {\n\t\t\tconst context = handle.context.get(Root);\n\n\t\t\treturn (props: TProps): RemixNode => {\n\t\t\t\tconst { children, mix, ...rest_props } = props as TProps & {\n\t\t\t\t\tchildren?: RemixNode;\n\t\t\t\t\tmix?: unknown;\n\t\t\t\t};\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\t\tpopover_static_conditions,\n\t\t\t\t\t\t\t\toptions.conditions?.[slot],\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn popover_recipe.resolve().slots[slot];\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\t\t\t\tconst close_mix =\n\t\t\t\t\tslot === popoverAnatomy.parts.close\n\t\t\t\t\t\t? on<HTMLButtonElement, \"click\">(\"click\", (event) => {\n\t\t\t\t\t\t\t\tcontext.close({ event, reason: \"close\" });\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\treturn createElement(\n\t\t\t\t\telement,\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(popoverAnatomy.scope, slot),\n\t\t\t\t\t\tmix: [close_mix, parts.hosts[slot].mix],\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...extra_props,\n\t\t\t\t\t\t\t...rest_props,\n\t\t\t\t\t\t\tid:\n\t\t\t\t\t\t\t\tslot === popoverAnatomy.parts.title\n\t\t\t\t\t\t\t\t\t? context.get_title_id()\n\t\t\t\t\t\t\t\t\t: slot === popoverAnatomy.parts.description\n\t\t\t\t\t\t\t\t\t\t? context.get_description_id()\n\t\t\t\t\t\t\t\t\t\t: (rest_props as { id?: string }).id,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\treturn {\n\t\tArrow: create_static_component<PopoverArrowProps>(\n\t\t\tpopoverAnatomy.parts.arrow,\n\t\t\t\"div\",\n\t\t\t{ \"aria-hidden\": \"true\" },\n\t\t),\n\t\tClose: create_static_component<PopoverCloseProps>(\n\t\t\tpopoverAnatomy.parts.close,\n\t\t\t\"button\",\n\t\t\t{ type: button_type_default },\n\t\t),\n\t\tDescription: create_static_component<PopoverDescriptionProps>(\n\t\t\tpopoverAnatomy.parts.description,\n\t\t\t\"p\",\n\t\t),\n\t\tPopup,\n\t\tRoot,\n\t\tTitle: create_static_component<PopoverTitleProps>(\n\t\t\tpopoverAnatomy.parts.title,\n\t\t\t\"h2\",\n\t\t),\n\t\tTrigger,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeStyle,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentSlotProps,\n} from \"./component-style.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type ProgressRecipeInput<TTone extends string = string> = RecipeWithVariantGroups<\n\t\"root\" | \"segment\",\n\tnever,\n\tComponentStyle,\n\t{\n\t\ttone: TTone;\n\t}\n>;\n\nexport type ProgressRecipeTone<TRecipe extends ProgressRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\nexport type ProgressRecipeSelection<TRecipe extends ProgressRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"tone\">;\n\nexport type ProgressStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends ProgressRecipeInput = ProgressRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { progress: TRecipe } }, TMetadata>;\n\nexport type ProgressSegment<TTone extends string = string> = {\n\tkey?: string;\n\tlabel?: RemixNode;\n\tprops?: ComponentSlotProps<\"div\">;\n\ttone?: TTone;\n\tvalue: number;\n};\n\nexport type ProgressProps<TTone extends string = string> = Omit<Props<\"div\">, \"style\"> & {\n\tmax?: number;\n\tsegments?: readonly ProgressSegment<TTone>[];\n\tstyle?: never;\n\ttone?: TTone;\n\tvalue?: number;\n};\n\nconst progress_scope = \"progress\";\nconst progress_min = 0;\nconst progress_max_default = 100;\n\nfunction normalize_progress_max(value: number | undefined): number {\n\tif (value === undefined || !Number.isFinite(value) || value <= 0) {\n\t\treturn progress_max_default;\n\t}\n\treturn value;\n}\n\nfunction normalize_progress_value(value: number, max: number): number {\n\tif (!Number.isFinite(value)) {\n\t\treturn progress_min;\n\t}\n\treturn Math.min(max, Math.max(progress_min, value));\n}\n\nfunction progress_value_width(value: number, max: number): string {\n\tconst normalized_value = normalize_progress_value(value, max);\n\treturn `${(normalized_value / max) * 100}%`;\n}\n\nexport function createProgress<\n\tTMode extends string,\n\tTRecipe extends ProgressRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: ProgressStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<ProgressProps<ProgressRecipeTone<TRecipe>>> {\n\ttype TTone = ProgressRecipeTone<TRecipe>;\n\tconst progress_recipe = createRecipe(style_system.token.recipe.progress);\n\n\treturn () => {\n\t\treturn (props: ProgressProps<TTone>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tchildren,\n\t\t\t\tmax: max_input,\n\t\t\t\tsegments: segments_input,\n\t\t\t\ttone,\n\t\t\t\tvalue,\n\t\t\t\t...progress_props\n\t\t\t} = props;\n\t\t\tconst max = normalize_progress_max(max_input);\n\t\t\tconst segments =\n\t\t\t\tsegments_input ?? (value === undefined ? [] : [{ tone, value }]);\n\t\t\tconst value_now =\n\t\t\t\tvalue === undefined && segments_input === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: normalize_progress_value(\n\t\t\t\t\t\t\tsegments.reduce((total, segment) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\ttotal + normalize_progress_value(segment.value, max)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}, 0),\n\t\t\t\t\t\t\tmax,\n\t\t\t\t\t\t);\n\t\t\tconst root = progress_recipe.resolve();\n\t\t\tconst root_parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn root.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(progress_scope, \"root\"),\n\t\t\t\t\tmix: root_parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...progress_props,\n\t\t\t\t\t\t\"aria-valuemax\": progress_props[\"aria-valuemax\"] ?? max,\n\t\t\t\t\t\t\"aria-valuemin\": progress_props[\"aria-valuemin\"] ?? progress_min,\n\t\t\t\t\t\t\"aria-valuenow\": progress_props[\"aria-valuenow\"] ?? value_now,\n\t\t\t\t\t\trole: progress_props.role ?? \"progressbar\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tsegments.map((segment, index) => {\n\t\t\t\t\tconst { children: _segment_children, ...segment_props } =\n\t\t\t\t\t\tsegment.props ?? {};\n\t\t\t\t\tconst resolved = progress_recipe.resolve({\n\t\t\t\t\t\ttone: segment.tone,\n\t\t\t\t\t} satisfies ProgressRecipeSelection<TRecipe>);\n\t\t\t\t\tconst segment_parts = createComponentStyleTargets({\n\t\t\t\t\t\ttargets: {\n\t\t\t\t\t\t\tsegment: {\n\t\t\t\t\t\t\t\thost: \"segment\",\n\t\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\t\treturn resolved.slots.segment;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tresolveStyle: (): RecipeStyle => {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\twidth: progress_value_width(segment.value, max),\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tprops: {},\n\t\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t\t});\n\n\t\t\t\t\treturn createElement(\n\t\t\t\t\t\t\"div\",\n\t\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(progress_scope, \"segment\"),\n\t\t\t\t\t\t\tmix: segment_parts.hosts.segment.mix,\n\t\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t\t...segment_props,\n\t\t\t\t\t\t\t\t\"aria-label\":\n\t\t\t\t\t\t\t\t\tsegment_props[\"aria-label\"] ??\n\t\t\t\t\t\t\t\t\t(typeof segment.label === \"string\"\n\t\t\t\t\t\t\t\t\t\t? segment.label\n\t\t\t\t\t\t\t\t\t\t: undefined),\n\t\t\t\t\t\t\t\tkey: segment.key ?? segment_props.key ?? index,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcheckableChangeEvent,\n\tcheckableInitialChecked,\n\tcheckableState,\n\tcheckableStateAttribute,\n\tcheckableStateFromValue,\n\tcheckableStateMixin,\n} from \"./checkable-state.ts\";\nimport { ariaTrue, componentDataAttribute, dataFlag } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport { create_controllable_state } from \"./controllable-state.ts\";\nimport { formResetMixin } from \"./form-reset.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type RadioGroupRecipeCondition = CommonRecipeCondition | \"checked\" | \"unchecked\";\n\nexport type RadioGroupRecipeInput<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"item\" | \"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type RadioGroupRecipeLayout<TRecipe extends RadioGroupRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"layout\">;\n\nexport type RadioGroupRecipeVariant<TRecipe extends RadioGroupRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"variant\">;\n\nexport type RadioGroupRecipeSize<TRecipe extends RadioGroupRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"size\">;\n\nexport type RadioGroupRecipeSelection<TRecipe extends RadioGroupRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\" | \"size\" | \"variant\">;\n\nexport type RadioGroupStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends RadioGroupRecipeInput = RadioGroupRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tradioGroup: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type RadioGroupValueChangeDetails = {\n\tevent?: Event;\n};\n\nexport type RadioGroupValueChangeHandler<TValue extends string = string> = (\n\tvalue: TValue,\n\tdetails?: RadioGroupValueChangeDetails,\n) => void;\n\nexport type RadioGroupRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type RadioGroupItemStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type RadioGroupRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tRadioGroupRootStyleProps<TLayout> &\n\tResponsiveProps<RadioGroupRootStyleProps<TLayout>, TBreakpoint> & {\n\t\tdefaultValue?: TValue | null;\n\t\tdisabled?: boolean;\n\t\tform?: string;\n\t\tname?: string;\n\t\tonValueChange?: RadioGroupValueChangeHandler<TValue>;\n\t\treadOnly?: boolean;\n\t\trequired?: boolean;\n\t\tstyle?: never;\n\t\tvalue?: TValue | null;\n\t};\n\nexport type RadioGroupItemProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<\n\tProps<\"input\">,\n\t\"checked\" | \"defaultChecked\" | \"name\" | \"style\" | \"type\" | \"value\"\n> &\n\tRadioGroupItemStyleProps<TVariant, TSize> &\n\tResponsiveProps<RadioGroupItemStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t\tvalue: TValue;\n\t};\n\nexport type RadioGroupComponents<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tItem: RemixComponent<RadioGroupItemProps<TVariant, TSize>>;\n\tRoot: RemixComponent<RadioGroupRootProps<TLayout>, RadioGroupContext>;\n};\n\ntype RadioGroupContext = {\n\tget_disabled: () => boolean;\n\tget_form: () => string | undefined;\n\tget_name: () => string;\n\tget_read_only: () => boolean;\n\tget_required: () => boolean;\n\tget_value: () => string | null;\n\tset_value: (value: string, details?: RadioGroupValueChangeDetails) => void;\n\tsync_items: () => void;\n};\n\nconst radio_group_scope = \"radioGroup\";\nconst radio_group_role = \"radiogroup\";\nconst radio_type = \"radio\";\n\nconst item_conditions = mergeRecipeConditionSelectors<RadioGroupRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tchecked: `&[${checkableStateAttribute}='${checkableState.checked}']`,\n\t\tunchecked: `&[${checkableStateAttribute}='${checkableState.unchecked}']`,\n\t} satisfies RecipeConditionSelectorMap<RadioGroupRecipeCondition>,\n);\n\nexport function createRadioGroup<\n\tTMode extends string,\n\tTRecipe extends RadioGroupRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: RadioGroupStyleSystem<TMode, TRecipe, TMetadata>,\n): RadioGroupComponents<\n\tRadioGroupRecipeLayout<TRecipe>,\n\tRadioGroupRecipeVariant<TRecipe>,\n\tRadioGroupRecipeSize<TRecipe>\n> {\n\ttype TLayout = RadioGroupRecipeLayout<TRecipe>;\n\ttype TVariant = RadioGroupRecipeVariant<TRecipe>;\n\ttype TSize = RadioGroupRecipeSize<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = RadioGroupRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.radioGroup);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<RadioGroupRootStyleProps<TLayout>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies TSelection).slots.root;\n\t}\n\n\tfunction resolve_item_slot(\n\t\tprops: Partial<RadioGroupItemStyleProps<TVariant, TSize>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"item\"] {\n\t\treturn recipe.resolve({\n\t\t\tsize: props.size,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots.item;\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<RadioGroupRootProps<TLayout, TBreakpoint>, RadioGroupContext>,\n\t): (props: RadioGroupRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tlet local_value = handle.props.defaultValue ?? null;\n\t\tconst value_state = create_controllable_state<\n\t\t\tstring | null,\n\t\t\tRadioGroupValueChangeDetails\n\t\t>({\n\t\t\tgetControlled: () => {\n\t\t\t\tif (handle.props.value === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn handle.props.value;\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_value;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\tconst on_value_change = handle.props.onValueChange;\n\t\t\t\tif (!on_value_change) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn (value, details) => {\n\t\t\t\t\tif (value === null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\ton_value_change(value, details);\n\t\t\t\t};\n\t\t\t},\n\t\t\tsetLocal: (value) => {\n\t\t\t\tlocal_value = value;\n\t\t\t},\n\t\t});\n\n\t\tfunction reset_value(): void {\n\t\t\tif (handle.props.value !== undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlocal_value = handle.props.defaultValue ?? null;\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tconst context: RadioGroupContext = {\n\t\t\tget_disabled: () => {\n\t\t\t\treturn handle.props.disabled === true;\n\t\t\t},\n\t\t\tget_form: () => {\n\t\t\t\treturn handle.props.form;\n\t\t\t},\n\t\t\tget_name: () => {\n\t\t\t\treturn handle.props.name ?? handle.id;\n\t\t\t},\n\t\t\tget_read_only: () => {\n\t\t\t\treturn handle.props.readOnly === true;\n\t\t\t},\n\t\t\tget_required: () => {\n\t\t\t\treturn handle.props.required === true;\n\t\t\t},\n\t\t\tget_value: () => {\n\t\t\t\treturn value_state.get();\n\t\t\t},\n\t\t\tset_value: (value, details) => {\n\t\t\t\tconst changed = value_state.set(value, details ?? {});\n\t\t\t\tif (changed) {\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tsync_items: () => {\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: RadioGroupRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultValue: _default_value,\n\t\t\t\tdisabled,\n\t\t\t\tform: _form,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\tname: _name,\n\t\t\t\tonValueChange: _on_value_change,\n\t\t\t\treadOnly,\n\t\t\t\trequired: _required,\n\t\t\t\tvalue: _value,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(radio_group_scope, \"root\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tformResetMixin({\n\t\t\t\t\t\t\tform: _form,\n\t\t\t\t\t\t\tonReset: () => {\n\t\t\t\t\t\t\t\treset_value();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.root.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(disabled === true),\n\t\t\t\t\t\t\"aria-required\": ariaTrue(_required === true),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(_required === true),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: root_props.role ?? radio_group_role,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Item(\n\t\thandle: Handle<RadioGroupItemProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: RadioGroupItemProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: RadioGroupItemProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tdisabled,\n\t\t\t\tform,\n\t\t\t\tmix,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\tsize,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t\t...item_props\n\t\t\t} = props;\n\t\t\tconst checked = context.get_value() === value;\n\t\t\tconst is_disabled = context.get_disabled() || disabled === true;\n\t\t\tconst is_read_only = context.get_read_only() || readOnly === true;\n\t\t\tconst is_required = context.get_required() || required === true;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\titem: \"input\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\titem: {\n\t\t\t\t\t\thost: \"item\",\n\t\t\t\t\t\tconditions: item_conditions,\n\t\t\t\t\t\tresolveSlot: resolve_item_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"input\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(radio_group_scope, \"item\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tcheckableStateMixin({\n\t\t\t\t\t\t\tallowIndeterminate: false,\n\t\t\t\t\t\t\tchecked,\n\t\t\t\t\t\t\tdefaultChecked: undefined,\n\t\t\t\t\t\t\tdisabled: is_disabled,\n\t\t\t\t\t\t\treadOnly: is_read_only,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ton<HTMLInputElement, typeof checkableChangeEvent>(\n\t\t\t\t\t\t\tcheckableChangeEvent,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tif (is_disabled || is_read_only) {\n\t\t\t\t\t\t\t\t\tcontext.sync_items();\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (event.currentTarget.checked) {\n\t\t\t\t\t\t\t\t\tcontext.set_value(value, { event });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.item.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...item_props,\n\t\t\t\t\t\t[checkableStateAttribute]: checkableStateFromValue(\n\t\t\t\t\t\t\tchecked,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(is_disabled),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(is_read_only),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(is_required),\n\t\t\t\t\t\tchecked: checkableInitialChecked(checked),\n\t\t\t\t\t\tdisabled: is_disabled || undefined,\n\t\t\t\t\t\tform: form ?? context.get_form(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\tname: context.get_name(),\n\t\t\t\t\t\treadOnly: is_read_only || undefined,\n\t\t\t\t\t\trequired: is_required || undefined,\n\t\t\t\t\t\ttype: radio_type,\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tItem,\n\t\tRoot,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport { type RecipeStyle } from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport type { ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport const visuallyHiddenDefaultElement = \"span\";\nexport const visuallyHiddenFocusableSelector = \"&:not(:focus):not(:active)\";\nexport const visuallyHiddenPart = {\n\troot: \"root\",\n} as const;\nexport const visuallyHiddenScope = \"visuallyHidden\";\nexport const visuallyHiddenStyle = {\n\tborder: 0,\n\tclip: \"rect(0 0 0 0)\",\n\tclipPath: \"inset(50%)\",\n\theight: \"1px\",\n\tmargin: \"-1px\",\n\toverflow: \"hidden\",\n\tpadding: 0,\n\tposition: \"absolute\",\n\twhiteSpace: \"nowrap\",\n\twidth: \"1px\",\n} as const satisfies RecipeStyle;\n\nexport type VisuallyHiddenElement = keyof HTMLElementTagNameMap;\n\nexport type VisuallyHiddenProps<TElement extends VisuallyHiddenElement = \"span\"> = Omit<\n\tProps<TElement>,\n\t\"style\"\n> & {\n\tas?: TElement;\n\tisFocusable?: boolean;\n\tstyle?: never;\n};\n\nfunction style_for_props(props: { isFocusable?: boolean }): RecipeStyle {\n\tif (props.isFocusable) {\n\t\treturn {\n\t\t\t[visuallyHiddenFocusableSelector]: visuallyHiddenStyle,\n\t\t};\n\t}\n\n\treturn visuallyHiddenStyle;\n}\n\nexport function createVisuallyHidden<\n\tTMode extends string,\n\tTMetadata extends { breakpoint?: Record<string, string | number> },\n>(\n\tstyle_system: ComponentStyleSystem<TMode, unknown, TMetadata>,\n): RemixComponent<VisuallyHiddenProps> {\n\treturn () => {\n\t\treturn (props: VisuallyHiddenProps): RemixNode => {\n\t\t\tconst {\n\t\t\t\tas = visuallyHiddenDefaultElement,\n\t\t\t\tchildren,\n\t\t\t\tisFocusable = false,\n\t\t\t\tmix,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tprops: {\n\t\t\t\t\tisFocusable,\n\t\t\t\t},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: (style_props) => {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tbase: style_for_props(style_props),\n\t\t\t\t\t\t\t\tconditions: {},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\tas,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tvisuallyHiddenScope,\n\t\t\t\t\t\tvisuallyHiddenPart.root,\n\t\t\t\t\t),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, css, type RemixNode } from \"remix/ui\";\nimport { visuallyHiddenStyle } from \"./visually-hidden.ts\";\n\nexport type NativeSelectFormMirrorOption = {\n\tdisabled?: boolean;\n\ttext: string;\n\tvalue: string;\n};\n\nexport type NativeSelectFormMirrorInput = {\n\tautoComplete?: string;\n\tdisabled?: boolean;\n\tform?: string;\n\tname?: string;\n\toptions: readonly NativeSelectFormMirrorOption[];\n\tplaceholder?: RemixNode;\n\trequired?: boolean;\n\tvalue: string | null;\n};\n\nconst native_select_empty_value = \"\";\nconst native_select_aria_hidden = \"true\";\nconst native_select_tab_index = -1;\nconst native_select_mix = css<HTMLSelectElement>({\n\t...visuallyHiddenStyle,\n\tpointerEvents: \"none\",\n});\n\nfunction has_form_owner(input: NativeSelectFormMirrorInput): boolean {\n\treturn input.name !== undefined || input.form !== undefined;\n}\n\nfunction has_current_value(input: NativeSelectFormMirrorInput): boolean {\n\treturn (\n\t\tinput.value === null ||\n\t\tinput.options.some((option) => {\n\t\t\treturn option.value === input.value;\n\t\t})\n\t);\n}\n\nexport function createNativeSelectFormMirror(\n\tinput: NativeSelectFormMirrorInput,\n): RemixNode {\n\tif (!has_form_owner(input)) {\n\t\treturn null;\n\t}\n\n\tconst current_value = input.value ?? native_select_empty_value;\n\n\treturn createElement(\n\t\t\"select\",\n\t\t{\n\t\t\t\"aria-hidden\": native_select_aria_hidden,\n\t\t\tautoComplete: input.autoComplete,\n\t\t\tdisabled: input.disabled,\n\t\t\tform: input.form,\n\t\t\tmix: native_select_mix,\n\t\t\tname: input.name,\n\t\t\trequired: input.required,\n\t\t\ttabIndex: native_select_tab_index,\n\t\t\tvalue: current_value,\n\t\t},\n\t\tcreateElement(\n\t\t\t\"option\",\n\t\t\t{\n\t\t\t\tselected: input.value === null,\n\t\t\t\tvalue: native_select_empty_value,\n\t\t\t},\n\t\t\tinput.placeholder ?? \"\",\n\t\t),\n\t\t...input.options.map((option) => {\n\t\t\treturn createElement(\n\t\t\t\t\"option\",\n\t\t\t\t{\n\t\t\t\t\tdisabled: option.disabled,\n\t\t\t\t\tselected: option.value === input.value,\n\t\t\t\t\tvalue: option.value,\n\t\t\t\t},\n\t\t\t\toption.text,\n\t\t\t);\n\t\t}),\n\t\thas_current_value(input)\n\t\t\t? null\n\t\t\t: createElement(\n\t\t\t\t\t\"option\",\n\t\t\t\t\t{\n\t\t\t\t\t\tselected: true,\n\t\t\t\t\t\tvalue: current_value,\n\t\t\t\t\t},\n\t\t\t\t\tcurrent_value,\n\t\t\t\t),\n\t);\n}\n","import {\n\tFragment,\n\tcreateElement,\n\ton,\n\tref,\n\ttype Handle,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport { checkableStateFromValue, type CheckableStateName } from \"./checkable-state.ts\";\nimport {\n\tariaBoolean,\n\tariaTrue,\n\tcomponentDataAttribute,\n\tcomponentStateAttribute,\n\tdataFlag,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport {\n\tget_collection_navigation_item,\n\tget_first_collection_item,\n\tget_last_collection_item,\n} from \"./composite-navigation.ts\";\nimport { create_controllable_state } from \"./controllable-state.ts\";\nimport { createNativeSelectFormMirror } from \"./form-mirror.ts\";\nimport {\n\tcreate_group_label_ref_mix,\n\tcreate_group_label_relationship,\n\ttype GroupLabelRelationship,\n} from \"./group-label.ts\";\nimport {\n\tcreate_ordered_collection,\n\ttype OrderedCollectionItem,\n} from \"./ordered-collection.ts\";\nimport { popoverScrollLockGuard } from \"./popover-scroll-lock.ts\";\nimport {\n\tcreatePopupRefMix,\n\tcreatePopupRelationship,\n\ttype PopupRelationship,\n} from \"./popup-behavior.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport { create_typeahead } from \"./typeahead.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nconst select_slot = {\n\tgroup: \"group\",\n\tgroupLabel: \"groupLabel\",\n\ticon: \"icon\",\n\tlist: \"list\",\n\toption: \"option\",\n\toptionIndicator: \"optionIndicator\",\n\toptionText: \"optionText\",\n\tpopup: \"popup\",\n\tseparator: \"separator\",\n\ttrigger: \"trigger\",\n\tvalue: \"value\",\n} as const;\n\nexport type SelectRecipeSlot = (typeof select_slot)[keyof typeof select_slot];\n\nexport type SelectRecipeCondition =\n\t| \"active\"\n\t| \"disabled\"\n\t| \"focusVisible\"\n\t| \"highlighted\"\n\t| \"hover\"\n\t| \"open\"\n\t| \"placeholder\"\n\t| \"reducedMotion\"\n\t| \"selected\";\n\nexport type SelectRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTPopupLayout extends string = string,\n> = RecipeWithVariantGroups<\n\tSelectRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\tpopupLayout: TPopupLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type SelectRecipeVariant<TRecipe extends SelectRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\nexport type SelectRecipeSize<TRecipe extends SelectRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\nexport type SelectRecipePopupLayout<TRecipe extends SelectRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"popupLayout\">;\nexport type SelectRecipeSelection<TRecipe extends SelectRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"popupLayout\" | \"size\" | \"variant\">;\n\nexport type SelectStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends SelectRecipeInput = SelectRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { select: TRecipe } }, TMetadata>;\n\nexport const selectOpenChangeReason = {\n\tescape: \"escape\",\n\tinteractOutside: \"interactOutside\",\n\toption: \"option\",\n\ttab: \"tab\",\n\ttrigger: \"trigger\",\n} as const;\n\nexport const selectValueChangeReason = {\n\tkeyboard: \"keyboard\",\n\tpointer: \"pointer\",\n} as const;\n\nexport const selectHighlightChangeReason = {\n\tkeyboard: \"keyboard\",\n\topen: \"open\",\n\tpointer: \"pointer\",\n\ttypeahead: \"typeahead\",\n} as const;\n\nexport type SelectOpenChangeReason =\n\t(typeof selectOpenChangeReason)[keyof typeof selectOpenChangeReason];\n\nexport type SelectValueChangeReason =\n\t(typeof selectValueChangeReason)[keyof typeof selectValueChangeReason];\n\nexport type SelectHighlightChangeReason =\n\t(typeof selectHighlightChangeReason)[keyof typeof selectHighlightChangeReason];\n\nexport type SelectOpenChangeDetails = {\n\tevent?: Event;\n\treason: SelectOpenChangeReason;\n};\n\nexport type SelectValueChangeDetails = {\n\tevent?: Event;\n\treason: SelectValueChangeReason;\n};\n\nexport type SelectHighlightChangeDetails = {\n\tevent?: Event;\n\treason: SelectHighlightChangeReason;\n};\n\nexport type SelectValueChangeHandler<TValue extends string = string> = (\n\tvalue: TValue | null,\n\tdetails?: SelectValueChangeDetails,\n) => void;\n\nexport type SelectOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: SelectOpenChangeDetails,\n) => void;\n\nexport type SelectHighlightChangeHandler<TValue extends string = string> = (\n\tvalue: TValue | null,\n\tdetails?: SelectHighlightChangeDetails,\n) => void;\n\nexport type SelectProps<TValue extends string = string> = {\n\tautoComplete?: string;\n\tchildren?: RemixNode;\n\tdefaultOpen?: boolean;\n\tdefaultHighlightedValue?: TValue | null;\n\tdefaultValue?: TValue | null;\n\tdisabled?: boolean;\n\tform?: string;\n\thighlightedValue?: TValue | null;\n\tinvalid?: boolean;\n\tloopFocus?: boolean;\n\tname?: string;\n\tonHighlightChange?: SelectHighlightChangeHandler<TValue>;\n\tonOpenChange?: SelectOpenChangeHandler;\n\tonOpenChangeComplete?: SelectOpenChangeHandler;\n\tonValueChange?: SelectValueChangeHandler<TValue>;\n\topen?: boolean;\n\tplaceholder?: string;\n\treadOnly?: boolean;\n\trequired?: boolean;\n\ttypeahead?: boolean;\n\tvalue?: TValue | null;\n};\n\nexport type SelectTriggerStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type SelectTriggerProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\"> &\n\tSelectTriggerStyleProps<TVariant, TSize> &\n\tResponsiveProps<SelectTriggerStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type SelectPopupStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type SelectPopupProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tSelectPopupStyleProps<TLayout> &\n\tResponsiveProps<SelectPopupStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type SelectListProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = SelectPopupProps<TLayout, TBreakpoint>;\n\nexport type SelectValueProps = Omit<Props<\"span\">, \"style\"> & {\n\tplaceholder?: RemixNode;\n\tstyle?: never;\n};\n\nexport type SelectIconProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type SelectGroupProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type SelectGroupLabelProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type SelectSeparatorProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type SelectOptionProps<TValue extends string = string> = Omit<\n\tProps<\"div\">,\n\t\"style\"\n> & {\n\tdisabled?: boolean;\n\tstyle?: never;\n\ttextValue?: string;\n\tvalue: TValue;\n};\n\nexport type SelectOptionTextProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type SelectOptionIndicatorProps = Omit<Props<\"span\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type SelectComponents<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTPopupLayout extends string = string,\n> = {\n\tGroup: RemixComponent<SelectGroupProps, SelectGroupRuntimeContext>;\n\tGroupLabel: RemixComponent<SelectGroupLabelProps>;\n\tIcon: RemixComponent<SelectIconProps>;\n\tList: RemixComponent<SelectListProps<TPopupLayout>>;\n\tOption: RemixComponent<SelectOptionProps>;\n\tOptionIndicator: RemixComponent<SelectOptionIndicatorProps>;\n\tOptionText: RemixComponent<SelectOptionTextProps>;\n\tPopup: RemixComponent<SelectPopupProps<TPopupLayout>>;\n\tRoot: RemixComponent<SelectProps, SelectRuntimeContext>;\n\tSeparator: RemixComponent<SelectSeparatorProps>;\n\tTrigger: RemixComponent<SelectTriggerProps<TVariant, TSize>>;\n\tValue: RemixComponent<SelectValueProps>;\n};\n\nexport type SelectOptions = {\n\tconditions?: Partial<\n\t\tReadonly<Record<SelectRecipeSlot, RecipeConditionSelectorMap<string>>>\n\t>;\n};\n\ntype SelectRuntimeContext = {\n\tclose: (details: SelectOpenChangeDetails) => void;\n\tget_disabled: () => boolean;\n\tget_highlighted_id: () => string | undefined;\n\tget_highlighted_value: () => string | null;\n\tget_invalid: () => boolean;\n\tget_list_id: () => string;\n\tget_open: () => boolean;\n\tget_placeholder: () => string | undefined;\n\tget_popup_relationship: () => PopupRelationship;\n\tget_popup_id: () => string;\n\tget_read_only: () => boolean;\n\tget_required: () => boolean;\n\tget_selected_text: () => string | undefined;\n\tget_trigger_id: () => string;\n\tget_value: () => string | null;\n\thandle_keydown: (event: KeyboardEvent) => void;\n\thighlight_by_offset: (offset: number, details: SelectHighlightChangeDetails) => void;\n\thighlight_first: () => void;\n\thighlight_last: () => void;\n\thighlight_value: (\n\t\tvalue: string | null,\n\t\tdetails: SelectHighlightChangeDetails,\n\t) => void;\n\topen: (details: SelectOpenChangeDetails, highlight?: SelectOpenHighlight) => void;\n\tregister_option: (option: RegisteredSelectOption) => void;\n\tregister_trigger: (node: HTMLElement | null) => void;\n\tsearch: (text: string, event: KeyboardEvent) => void;\n\tselect_value: (value: string | null, details: SelectValueChangeDetails) => void;\n\tsync_popup: () => void;\n\ttoggle: (details: SelectOpenChangeDetails) => void;\n\tunregister_option: (id: string) => void;\n};\n\ntype RegisteredSelectOption = OrderedCollectionItem<string>;\n\ntype SelectOpenHighlight = \"first\" | \"last\" | \"selected\";\n\ntype SelectGroupRuntimeContext = GroupLabelRelationship;\n\nconst trigger_conditions = {\n\tactive: \"&:active\",\n\tdisabled: \"&:disabled, &[aria-disabled='true']\",\n\tfocusVisible: \"&:focus-visible\",\n\thover: \"&:hover\",\n\topen: \"&[aria-expanded='true']\",\n\tplaceholder: `&[${componentDataAttribute.placeholder}]`,\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<SelectRecipeCondition>;\n\nconst option_conditions = {\n\tdisabled: `&[aria-disabled='true'], &[${componentDataAttribute.disabled}]`,\n\thighlighted: `&[${componentDataAttribute.highlighted}]`,\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n\tselected: `&[aria-selected='true'], &[${componentDataAttribute.selected}]`,\n} as const satisfies RecipeConditionSelectorMap<SelectRecipeCondition>;\n\nconst open_conditions = {\n\topen: `&:popover-open, &[${componentDataAttribute.open}]`,\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<SelectRecipeCondition>;\n\nconst value_conditions = {\n\tplaceholder: `&[${componentDataAttribute.placeholder}]`,\n\treducedMotion: \"@media (prefers-reduced-motion: reduce)\",\n} as const satisfies RecipeConditionSelectorMap<SelectRecipeCondition>;\n\nconst select_scope = \"select\";\nconst select_option_value_attribute = \"data-vorma-select-value\";\nconst select_page_jump_size = 10;\nconst select_typeahead_reset_ms = 700;\n\nfunction infer_text_value(children: RemixNode): string {\n\tif (typeof children === \"string\" || typeof children === \"number\") {\n\t\treturn String(children);\n\t}\n\treturn \"\";\n}\n\nfunction is_select_keyboard_selection(event: KeyboardEvent): boolean {\n\treturn event.key === \"Enter\" || event.key === \" \" || event.key === \"Spacebar\";\n}\n\nfunction is_printable_key_event(event: KeyboardEvent): boolean {\n\treturn event.key.length === 1 && !event.altKey && !event.ctrlKey && !event.metaKey;\n}\n\nfunction coerce_select_value(value: string | null | undefined): string | null {\n\treturn value ?? null;\n}\n\nfunction select_option_state(selected: boolean): CheckableStateName {\n\treturn checkableStateFromValue(selected, false);\n}\n\nexport function createSelect<\n\tTMode extends string,\n\tTRecipe extends SelectRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: SelectStyleSystem<TMode, TRecipe, TMetadata>,\n\toptions: SelectOptions = {},\n): SelectComponents<\n\tSelectRecipeVariant<TRecipe>,\n\tSelectRecipeSize<TRecipe>,\n\tSelectRecipePopupLayout<TRecipe>\n> {\n\ttype TVariant = SelectRecipeVariant<TRecipe>;\n\ttype TSize = SelectRecipeSize<TRecipe>;\n\ttype TPopupLayout = SelectRecipePopupLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\n\tconst select_recipe = createRecipe(style_system.token.recipe.select);\n\n\tfunction Root(\n\t\thandle: Handle<SelectProps, SelectRuntimeContext>,\n\t): (props: SelectProps) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? false;\n\t\tlet local_value = handle.props.defaultValue ?? null;\n\t\tlet local_highlighted_value = handle.props.defaultHighlightedValue ?? null;\n\t\tlet last_completed_open = handle.props.open ?? local_open;\n\t\tlet last_open_details: SelectOpenChangeDetails = {\n\t\t\treason: selectOpenChangeReason.trigger,\n\t\t};\n\t\tconst popup_relationship = createPopupRelationship();\n\t\tconst option_collection = create_ordered_collection<RegisteredSelectOption>();\n\t\tconst option_typeahead = create_typeahead<RegisteredSelectOption>({\n\t\t\ttimeoutMs: select_typeahead_reset_ms,\n\t\t});\n\t\tconst open_state = create_controllable_state<boolean, SelectOpenChangeDetails>({\n\t\t\tgetControlled: () => {\n\t\t\t\treturn handle.props.open;\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_open;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onOpenChange;\n\t\t\t},\n\t\t\tsetLocal: (value) => {\n\t\t\t\tlocal_open = value;\n\t\t\t},\n\t\t});\n\t\tconst value_state = create_controllable_state<\n\t\t\tstring | null,\n\t\t\tSelectValueChangeDetails\n\t\t>({\n\t\t\tgetControlled: () => {\n\t\t\t\tif (handle.props.value === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn coerce_select_value(handle.props.value);\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_value;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onValueChange;\n\t\t\t},\n\t\t\tsetLocal: (value) => {\n\t\t\t\tlocal_value = value;\n\t\t\t},\n\t\t});\n\t\tconst highlighted_state = create_controllable_state<\n\t\t\tstring | null,\n\t\t\tSelectHighlightChangeDetails\n\t\t>({\n\t\t\tgetControlled: () => {\n\t\t\t\tif (handle.props.highlightedValue === undefined) {\n\t\t\t\t\treturn undefined;\n\t\t\t\t}\n\t\t\t\treturn coerce_select_value(handle.props.highlightedValue);\n\t\t\t},\n\t\t\tgetLocal: () => {\n\t\t\t\treturn local_highlighted_value;\n\t\t\t},\n\t\t\tgetOnChange: () => {\n\t\t\t\treturn handle.props.onHighlightChange;\n\t\t\t},\n\t\t\tsetLocal: (value) => {\n\t\t\t\tlocal_highlighted_value = value;\n\t\t\t},\n\t\t});\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn open_state.get();\n\t\t}\n\n\t\tfunction get_value(): string | null {\n\t\t\treturn value_state.get();\n\t\t}\n\n\t\tfunction get_highlighted_value(): string | null {\n\t\t\treturn highlighted_state.get();\n\t\t}\n\n\t\tfunction get_options(): RegisteredSelectOption[] {\n\t\t\treturn option_collection.getItems();\n\t\t}\n\n\t\tfunction get_enabled_options(): RegisteredSelectOption[] {\n\t\t\treturn option_collection.getEnabledItems();\n\t\t}\n\n\t\tfunction find_option(value: string | null): RegisteredSelectOption | undefined {\n\t\t\tif (value === null) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\treturn option_collection.findByValue(value);\n\t\t}\n\n\t\tfunction scroll_highlighted_option_into_view(): void {\n\t\t\tconst highlighted_option = find_option(get_highlighted_value());\n\t\t\tif (\n\t\t\t\thighlighted_option &&\n\t\t\t\ttypeof highlighted_option.node.scrollIntoView === \"function\"\n\t\t\t) {\n\t\t\t\thighlighted_option.node.scrollIntoView({ block: \"nearest\" });\n\t\t\t}\n\t\t}\n\n\t\tfunction schedule_highlight_scroll(): void {\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tscroll_highlighted_option_into_view();\n\t\t\t});\n\t\t}\n\n\t\tfunction request_open(open: boolean, details: SelectOpenChangeDetails): void {\n\t\t\tif (open && handle.props.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst changed = open_state.set(open, details);\n\t\t\tif (!changed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlast_open_details = details;\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tfunction set_highlighted_value(\n\t\t\tvalue: string | null,\n\t\t\tdetails: SelectHighlightChangeDetails,\n\t\t): void {\n\t\t\tconst changed = highlighted_state.set(value, details);\n\t\t\tif (!changed) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tschedule_highlight_scroll();\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tfunction highlight_option(\n\t\t\toption: RegisteredSelectOption | undefined,\n\t\t\tdetails: SelectHighlightChangeDetails,\n\t\t): void {\n\t\t\tset_highlighted_value(option?.value ?? null, details);\n\t\t}\n\n\t\tfunction move_highlight(\n\t\t\toffset: number,\n\t\t\tdetails: SelectHighlightChangeDetails,\n\t\t\tclamp = false,\n\t\t): void {\n\t\t\tconst enabled_options = get_enabled_options();\n\t\t\tif (enabled_options.length === 0) {\n\t\t\t\thighlight_option(undefined, details);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst next_option = get_collection_navigation_item({\n\t\t\t\tclamp,\n\t\t\t\tcurrentValue: get_highlighted_value(),\n\t\t\t\tfallbackValue: get_value(),\n\t\t\t\titems: enabled_options,\n\t\t\t\tloop: handle.props.loopFocus,\n\t\t\t\toffset,\n\t\t\t});\n\t\t\tif (next_option === undefined) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thighlight_option(next_option, details);\n\t\t}\n\n\t\tfunction select_value(\n\t\t\tvalue: string | null,\n\t\t\tdetails: SelectValueChangeDetails,\n\t\t): void {\n\t\t\tif (handle.props.disabled || handle.props.readOnly) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst option = find_option(value);\n\t\t\tif (option?.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvalue_state.set(value, details);\n\t\t\tif (handle.props.highlightedValue === undefined) {\n\t\t\t\tlocal_highlighted_value = value;\n\t\t\t}\n\t\t\trequest_open(false, {\n\t\t\t\tevent: details.event,\n\t\t\t\treason:\n\t\t\t\t\tdetails.event instanceof KeyboardEvent && details.event.key === \"Tab\"\n\t\t\t\t\t\t? selectOpenChangeReason.tab\n\t\t\t\t\t\t: selectOpenChangeReason.option,\n\t\t\t});\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tfunction search(text: string, event: KeyboardEvent): void {\n\t\t\tif (handle.props.typeahead === false) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst match = option_typeahead.search({\n\t\t\t\tcurrentValue: get_highlighted_value(),\n\t\t\t\titems: get_enabled_options(),\n\t\t\t\tkey: text,\n\t\t\t});\n\n\t\t\thighlight_option(match, {\n\t\t\t\tevent,\n\t\t\t\treason: selectHighlightChangeReason.typeahead,\n\t\t\t});\n\t\t}\n\n\t\tfunction apply_open_highlight(\n\t\t\thighlight: SelectOpenHighlight | undefined,\n\t\t\tdetails: SelectOpenChangeDetails,\n\t\t): void {\n\t\t\tif (highlight === \"first\") {\n\t\t\t\thighlight_option(get_first_collection_item(get_enabled_options()), {\n\t\t\t\t\tevent: details.event,\n\t\t\t\t\treason: selectHighlightChangeReason.open,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (highlight === \"last\") {\n\t\t\t\thighlight_option(get_last_collection_item(get_enabled_options()), {\n\t\t\t\t\tevent: details.event,\n\t\t\t\t\treason: selectHighlightChangeReason.open,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (highlight === \"selected\" && get_highlighted_value() === null) {\n\t\t\t\thighlight_option(find_option(get_value()), {\n\t\t\t\t\tevent: details.event,\n\t\t\t\t\treason: selectHighlightChangeReason.open,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tfunction create_hidden_select(props: SelectProps): RemixNode {\n\t\t\treturn createNativeSelectFormMirror({\n\t\t\t\tautoComplete: props.autoComplete,\n\t\t\t\tdisabled: props.disabled,\n\t\t\t\tform: props.form,\n\t\t\t\tname: props.name,\n\t\t\t\toptions: get_options().map((option) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdisabled: option.disabled,\n\t\t\t\t\t\ttext: option.text,\n\t\t\t\t\t\tvalue: option.value,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t\tplaceholder: props.placeholder,\n\t\t\t\trequired: props.required,\n\t\t\t\tvalue: get_value(),\n\t\t\t});\n\t\t}\n\n\t\tfunction open_from_keyboard(\n\t\t\tevent: KeyboardEvent,\n\t\t\thighlight?: SelectOpenHighlight,\n\t\t): void {\n\t\t\trequest_open(true, {\n\t\t\t\tevent,\n\t\t\t\treason: selectOpenChangeReason.trigger,\n\t\t\t});\n\t\t\tapply_open_highlight(highlight, {\n\t\t\t\tevent,\n\t\t\t\treason: selectOpenChangeReason.trigger,\n\t\t\t});\n\t\t}\n\n\t\tfunction handle_keyboard(event: KeyboardEvent): void {\n\t\t\tif (handle.props.disabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst keyboard_highlight_details: SelectHighlightChangeDetails = {\n\t\t\t\tevent,\n\t\t\t\treason: selectHighlightChangeReason.keyboard,\n\t\t\t};\n\n\t\t\tif (event.altKey && event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\topen_from_keyboard(event, \"selected\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.altKey && event.key === \"ArrowUp\" && get_open()) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tselect_value(get_highlighted_value(), {\n\t\t\t\t\tevent,\n\t\t\t\t\treason: selectValueChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowDown\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (get_open()) {\n\t\t\t\t\tmove_highlight(1, keyboard_highlight_details);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\topen_from_keyboard(event, \"selected\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"ArrowUp\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (get_open()) {\n\t\t\t\t\tmove_highlight(-1, keyboard_highlight_details);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\topen_from_keyboard(event, \"last\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Home\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (!get_open()) {\n\t\t\t\t\topen_from_keyboard(event, \"first\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thighlight_option(\n\t\t\t\t\tget_first_collection_item(get_enabled_options()),\n\t\t\t\t\tkeyboard_highlight_details,\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"End\") {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst enabled_options = get_enabled_options();\n\t\t\t\tif (!get_open()) {\n\t\t\t\t\topen_from_keyboard(event, \"last\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\thighlight_option(\n\t\t\t\t\tget_last_collection_item(enabled_options),\n\t\t\t\t\tkeyboard_highlight_details,\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"PageDown\" && get_open()) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_highlight(select_page_jump_size, keyboard_highlight_details, true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"PageUp\" && get_open()) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tmove_highlight(-select_page_jump_size, keyboard_highlight_details, true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_select_keyboard_selection(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (!get_open()) {\n\t\t\t\t\topen_from_keyboard(event, \"selected\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tselect_value(get_highlighted_value(), {\n\t\t\t\t\tevent,\n\t\t\t\t\treason: selectValueChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Escape\" && get_open()) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\trequest_open(false, {\n\t\t\t\t\tevent,\n\t\t\t\t\treason: selectOpenChangeReason.escape,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event.key === \"Tab\" && get_open()) {\n\t\t\t\tconst highlighted_value = get_highlighted_value();\n\t\t\t\tif (highlighted_value === null) {\n\t\t\t\t\trequest_open(false, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\treason: selectOpenChangeReason.tab,\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tselect_value(highlighted_value, {\n\t\t\t\t\tevent,\n\t\t\t\t\treason: selectValueChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (is_printable_key_event(event)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (!get_open()) {\n\t\t\t\t\trequest_open(true, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\treason: selectOpenChangeReason.trigger,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tsearch(event.key, event);\n\t\t\t}\n\t\t}\n\n\t\tconst context: SelectRuntimeContext = {\n\t\t\tclose: (details) => {\n\t\t\t\trequest_open(false, details);\n\t\t\t},\n\t\t\tget_disabled: () => {\n\t\t\t\treturn handle.props.disabled === true;\n\t\t\t},\n\t\t\tget_highlighted_id: () => {\n\t\t\t\treturn find_option(get_highlighted_value())?.id;\n\t\t\t},\n\t\t\tget_highlighted_value,\n\t\t\tget_invalid: () => {\n\t\t\t\treturn handle.props.invalid === true;\n\t\t\t},\n\t\t\tget_list_id: () => {\n\t\t\t\treturn `${handle.id}-list`;\n\t\t\t},\n\t\t\tget_open,\n\t\t\tget_placeholder: () => {\n\t\t\t\treturn handle.props.placeholder;\n\t\t\t},\n\t\t\tget_popup_relationship: () => {\n\t\t\t\treturn popup_relationship;\n\t\t\t},\n\t\t\tget_popup_id: () => {\n\t\t\t\treturn `${handle.id}-popup`;\n\t\t\t},\n\t\t\tget_read_only: () => {\n\t\t\t\treturn handle.props.readOnly === true;\n\t\t\t},\n\t\t\tget_required: () => {\n\t\t\t\treturn handle.props.required === true;\n\t\t\t},\n\t\t\tget_selected_text: () => {\n\t\t\t\treturn find_option(get_value())?.text;\n\t\t\t},\n\t\t\tget_trigger_id: () => {\n\t\t\t\treturn `${handle.id}-trigger`;\n\t\t\t},\n\t\t\tget_value,\n\t\t\thandle_keydown: handle_keyboard,\n\t\t\thighlight_by_offset: (offset, details) => {\n\t\t\t\tmove_highlight(offset, details);\n\t\t\t},\n\t\t\thighlight_first: () => {\n\t\t\t\thighlight_option(get_first_collection_item(get_enabled_options()), {\n\t\t\t\t\treason: selectHighlightChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t},\n\t\t\thighlight_last: () => {\n\t\t\t\thighlight_option(get_last_collection_item(get_enabled_options()), {\n\t\t\t\t\treason: selectHighlightChangeReason.keyboard,\n\t\t\t\t});\n\t\t\t},\n\t\t\thighlight_value: (value, details) => {\n\t\t\t\thighlight_option(find_option(value), details);\n\t\t\t},\n\t\t\topen: (details, highlight = \"selected\") => {\n\t\t\t\tif (handle.props.disabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tapply_open_highlight(highlight, details);\n\t\t\t\trequest_open(true, details);\n\t\t\t},\n\t\t\tregister_option: (option) => {\n\t\t\t\tconst changed = option_collection.register(option);\n\t\t\t\tif (changed) {\n\t\t\t\t\tvoid handle.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tregister_trigger: (node) => {\n\t\t\t\tpopup_relationship.registerTrigger(node);\n\t\t\t},\n\t\t\tsearch,\n\t\t\tselect_value,\n\t\t\tsync_popup: () => {\n\t\t\t\tpopup_relationship.syncPopup(get_open());\n\t\t\t\tschedule_highlight_scroll();\n\t\t\t},\n\t\t\ttoggle: (details) => {\n\t\t\t\tif (get_open()) {\n\t\t\t\t\trequest_open(false, details);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.open(details);\n\t\t\t},\n\t\t\tunregister_option: (id) => {\n\t\t\t\tconst option = option_collection.unregister(id);\n\t\t\t\tvoid handle.update();\n\t\t\t\tif (option?.value === get_highlighted_value()) {\n\t\t\t\t\tset_highlighted_value(null, {\n\t\t\t\t\t\treason: selectHighlightChangeReason.open,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: SelectProps): RemixNode => {\n\t\t\tconst current_open = get_open();\n\t\t\tif (current_open !== last_completed_open) {\n\t\t\t\tconst completed_open = current_open;\n\t\t\t\tconst completed_details = last_open_details;\n\t\t\t\tlast_completed_open = current_open;\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tprops.onOpenChangeComplete?.(completed_open, completed_details);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn createElement(\n\t\t\t\tFragment,\n\t\t\t\t{},\n\t\t\t\tprops.children,\n\t\t\t\tcreate_hidden_select(props),\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_resolve_slot<TProps extends object>(\n\t\tslot: SelectRecipeSlot,\n\t\tselection: (props: Partial<TProps>) => SelectRecipeSelection<TRecipe>,\n\t): (\n\t\tprops: Partial<TProps>,\n\t) => ReturnType<typeof select_recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn (props) => {\n\t\t\treturn select_recipe.resolve(selection(props)).slots[slot];\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<SelectTriggerProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: SelectTriggerProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst resolve_slot = create_resolve_slot<\n\t\t\tSelectTriggerStyleProps<TVariant, TSize>\n\t\t>(select_slot.trigger, (props) => {\n\t\t\treturn {\n\t\t\t\tsize: props.size,\n\t\t\t\tvariant: props.variant,\n\t\t\t} satisfies SelectRecipeSelection<TRecipe>;\n\t\t});\n\n\t\treturn (props: SelectTriggerProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttype = \"button\",\n\t\t\t\tvariant,\n\t\t\t\t...trigger_props\n\t\t\t} = props;\n\t\t\tconst is_open = context.get_open();\n\t\t\tconst has_value = context.get_value() !== null;\n\t\t\tconst highlighted_id = context.get_highlighted_id();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\t[select_slot.trigger]: \"button\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.trigger]: {\n\t\t\t\t\t\thost: select_slot.trigger,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\ttrigger_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[select_slot.trigger],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: resolve_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst trigger_click_mix = on<HTMLButtonElement, \"click\">(\"click\", (event) => {\n\t\t\t\tcontext.toggle({\n\t\t\t\t\tevent,\n\t\t\t\t\treason: selectOpenChangeReason.trigger,\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst trigger_keydown_mix = on<HTMLButtonElement, \"keydown\">(\n\t\t\t\t\"keydown\",\n\t\t\t\t(event) => {\n\t\t\t\t\tcontext.handle_keydown(event);\n\t\t\t\t},\n\t\t\t);\n\t\t\tconst trigger_ref_mix = ref<HTMLButtonElement>((node, signal) => {\n\t\t\t\tcontext.register_trigger(node);\n\t\t\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\t\t\tcontext.register_trigger(null);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, select_slot.trigger),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ttrigger_ref_mix,\n\t\t\t\t\t\ttrigger_click_mix,\n\t\t\t\t\t\ttrigger_keydown_mix,\n\t\t\t\t\t\tparts.hosts[select_slot.trigger].mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-activedescendant\": is_open ? highlighted_id : undefined,\n\t\t\t\t\t\t\"aria-controls\": context.get_list_id(),\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(context.get_disabled()),\n\t\t\t\t\t\t\"aria-expanded\": ariaBoolean(is_open),\n\t\t\t\t\t\t\"aria-haspopup\": \"listbox\",\n\t\t\t\t\t\t\"aria-invalid\": ariaTrue(context.get_invalid()),\n\t\t\t\t\t\t\"aria-readonly\": ariaTrue(context.get_read_only()),\n\t\t\t\t\t\t\"aria-required\": ariaTrue(context.get_required()),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(\n\t\t\t\t\t\t\tcontext.get_disabled(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(context.get_invalid()),\n\t\t\t\t\t\t[componentDataAttribute.open]: dataFlag(is_open),\n\t\t\t\t\t\t[componentDataAttribute.placeholder]: dataFlag(!has_value),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(\n\t\t\t\t\t\t\tcontext.get_read_only(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(\n\t\t\t\t\t\t\tcontext.get_required(),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(is_open),\n\t\t\t\t\t\tdisabled: context.get_disabled(),\n\t\t\t\t\t\tid: context.get_trigger_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: \"combobox\",\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Popup(\n\t\thandle: Handle<SelectPopupProps<TPopupLayout, TBreakpoint>>,\n\t): (props: SelectPopupProps<TPopupLayout, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst resolve_slot = create_resolve_slot<SelectPopupStyleProps<TPopupLayout>>(\n\t\t\tselect_slot.popup,\n\t\t\t(props) => {\n\t\t\t\treturn {\n\t\t\t\t\tpopupLayout: props.layout,\n\t\t\t\t} satisfies SelectRecipeSelection<TRecipe>;\n\t\t\t},\n\t\t);\n\n\t\treturn (props: SelectPopupProps<TPopupLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...popup_props } = props;\n\t\t\tconst is_open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.popup]: {\n\t\t\t\t\t\thost: select_slot.popup,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\topen_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[select_slot.popup],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: resolve_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst popup_ref_mix = createPopupRefMix({\n\t\t\t\tgetOpen: context.get_open,\n\t\t\t\tonInteractOutside: (event) => {\n\t\t\t\t\tcontext.close({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\treason: selectOpenChangeReason.interactOutside,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\trelationship: context.get_popup_relationship(),\n\t\t\t});\n\n\t\t\thandle.queueTask((signal) => {\n\t\t\t\tif (signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.sync_popup();\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, select_slot.popup),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tpopoverScrollLockGuard(),\n\t\t\t\t\t\tpopup_ref_mix,\n\t\t\t\t\t\tparts.hosts[select_slot.popup].mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...popup_props,\n\t\t\t\t\t\t\"aria-labelledby\": context.get_trigger_id(),\n\t\t\t\t\t\t[componentDataAttribute.open]: dataFlag(is_open),\n\t\t\t\t\t\thidden: !is_open,\n\t\t\t\t\t\tid: context.get_popup_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\tpopover: \"manual\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction List(\n\t\thandle: Handle<SelectListProps<TPopupLayout, TBreakpoint>>,\n\t): (props: SelectListProps<TPopupLayout, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tconst resolve_slot = create_resolve_slot<SelectPopupStyleProps<TPopupLayout>>(\n\t\t\tselect_slot.list,\n\t\t\t(props) => {\n\t\t\t\treturn {\n\t\t\t\t\tpopupLayout: props.layout,\n\t\t\t\t} satisfies SelectRecipeSelection<TRecipe>;\n\t\t\t},\n\t\t);\n\n\t\treturn (props: SelectPopupProps<TPopupLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, layout, mix, ...list_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.list]: {\n\t\t\t\t\t\thost: select_slot.list,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\topen_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[select_slot.list],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: resolve_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst list_keydown_mix = on<HTMLElement, \"keydown\">(\"keydown\", (event) => {\n\t\t\t\tcontext.handle_keydown(event);\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, select_slot.list),\n\t\t\t\t\tmix: [list_keydown_mix, parts.hosts[select_slot.list].mix],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...list_props,\n\t\t\t\t\t\t\"aria-labelledby\": context.get_trigger_id(),\n\t\t\t\t\t\tid: context.get_list_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: \"listbox\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Value(\n\t\thandle: Handle<SelectValueProps>,\n\t): (props: SelectValueProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: SelectValueProps): RemixNode => {\n\t\t\tconst { children, mix, placeholder, ...value_props } = props;\n\t\t\tconst selected_text = context.get_selected_text();\n\t\t\tconst placeholder_text = placeholder ?? context.get_placeholder();\n\t\t\tconst is_placeholder = selected_text === undefined;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.value]: {\n\t\t\t\t\t\thost: select_slot.value,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\tvalue_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[select_slot.value],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn select_recipe.resolve().slots.value;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"span\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, select_slot.value),\n\t\t\t\t\tmix: parts.hosts[select_slot.value].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...value_props,\n\t\t\t\t\t\t[componentDataAttribute.placeholder]: dataFlag(is_placeholder),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren ?? selected_text ?? placeholder_text,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_static_span_component<TProps extends { mix?: unknown }>(\n\t\tslot: SelectRecipeSlot,\n\t): RemixComponent<TProps> {\n\t\treturn () => {\n\t\t\treturn (props: TProps): RemixNode => {\n\t\t\t\tconst { children, mix, ...rest_props } = props as TProps & {\n\t\t\t\t\tchildren?: RemixNode;\n\t\t\t\t\tmix?: unknown;\n\t\t\t\t};\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn select_recipe.resolve().slots[slot];\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\n\t\t\t\treturn createElement(\n\t\t\t\t\t\"span\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, slot),\n\t\t\t\t\t\tmix: parts.hosts[slot].mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...rest_props,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction create_static_div_component<TProps extends { mix?: unknown }>(\n\t\tslot: SelectRecipeSlot,\n\t\trole?: string,\n\t): RemixComponent<TProps> {\n\t\treturn () => {\n\t\t\treturn (props: TProps): RemixNode => {\n\t\t\t\tconst { children, mix, ...rest_props } = props as TProps & {\n\t\t\t\t\tchildren?: RemixNode;\n\t\t\t\t\tmix?: unknown;\n\t\t\t\t};\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn select_recipe.resolve().slots[slot];\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\n\t\t\t\treturn createElement(\n\t\t\t\t\t\"div\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, slot),\n\t\t\t\t\t\tmix: parts.hosts[slot].mix,\n\t\t\t\t\t\tprops: {\n\t\t\t\t\t\t\t...rest_props,\n\t\t\t\t\t\t\tmix,\n\t\t\t\t\t\t\trole,\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\tfunction Group(\n\t\thandle: Handle<SelectGroupProps, SelectGroupRuntimeContext>,\n\t): (props: SelectGroupProps) => RemixNode {\n\t\tconst group_context = create_group_label_relationship({\n\t\t\tlabel_id: `${handle.id}-label`,\n\t\t\ton_change: () => {\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t});\n\t\thandle.context.set(group_context);\n\n\t\treturn (props: SelectGroupProps): RemixNode => {\n\t\t\tconst { children, mix, ...group_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.group]: {\n\t\t\t\t\t\thost: select_slot.group,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn select_recipe.resolve().slots.group;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, select_slot.group),\n\t\t\t\t\tmix: parts.hosts[select_slot.group].mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...group_props,\n\t\t\t\t\t\t\"aria-labelledby\": group_context.get_labelled_by(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: \"group\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction GroupLabel(\n\t\thandle: Handle<SelectGroupLabelProps>,\n\t): (props: SelectGroupLabelProps) => RemixNode {\n\t\tconst group_context = handle.context.get(Group);\n\n\t\treturn (props: SelectGroupLabelProps): RemixNode => {\n\t\t\tconst { children, mix, ...group_label_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.groupLabel]: {\n\t\t\t\t\t\thost: select_slot.groupLabel,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn select_recipe.resolve().slots.groupLabel;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst group_label_ref_mix = create_group_label_ref_mix(group_context);\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\tselect_scope,\n\t\t\t\t\t\tselect_slot.groupLabel,\n\t\t\t\t\t),\n\t\t\t\t\tmix: [group_label_ref_mix, parts.hosts[select_slot.groupLabel].mix],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...group_label_props,\n\t\t\t\t\t\tid: group_context.get_label_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Option(\n\t\thandle: Handle<SelectOptionProps>,\n\t): (props: SelectOptionProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\t\tlet option_node: HTMLElement | null = null;\n\t\tlet option_id: string | null = null;\n\n\t\treturn (props: SelectOptionProps): RemixNode => {\n\t\t\tconst {\n\t\t\t\tchildren,\n\t\t\t\tdisabled = false,\n\t\t\t\tmix,\n\t\t\t\ttextValue,\n\t\t\t\tvalue,\n\t\t\t\t...option_props\n\t\t\t} = props;\n\t\t\tconst selected = context.get_value() === value;\n\t\t\tconst highlighted = context.get_highlighted_value() === value;\n\t\t\tconst option_text = textValue ?? infer_text_value(children);\n\t\t\tconst current_option_id = `${handle.id}-option`;\n\t\t\toption_id = current_option_id;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\t[select_slot.option]: {\n\t\t\t\t\t\thost: select_slot.option,\n\t\t\t\t\t\tconditions: mergeRecipeConditionSelectors(\n\t\t\t\t\t\t\toption_conditions,\n\t\t\t\t\t\t\toptions.conditions?.[select_slot.option],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn select_recipe.resolve().slots.option;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\tconst option_click_mix = on<HTMLElement, \"click\">(\"click\", (event) => {\n\t\t\t\tif (disabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.select_value(value, {\n\t\t\t\t\tevent,\n\t\t\t\t\treason: selectValueChangeReason.pointer,\n\t\t\t\t});\n\t\t\t});\n\t\t\tconst option_pointer_down_mix = on<HTMLElement, \"pointerdown\">(\n\t\t\t\t\"pointerdown\",\n\t\t\t\t(event) => {\n\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t);\n\t\t\tconst option_pointer_move_mix = on<HTMLElement, \"pointermove\">(\n\t\t\t\t\"pointermove\",\n\t\t\t\t(event) => {\n\t\t\t\t\tif (disabled) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tcontext.highlight_value(value, {\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\treason: selectHighlightChangeReason.pointer,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t);\n\t\t\tfunction register_option(node: HTMLElement): void {\n\t\t\t\tcontext.register_option({\n\t\t\t\t\tdisabled,\n\t\t\t\t\tid: current_option_id,\n\t\t\t\t\tnode,\n\t\t\t\t\ttext: option_text || node.textContent || \"\",\n\t\t\t\t\tvalue,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (option_node) {\n\t\t\t\thandle.queueTask((signal) => {\n\t\t\t\t\tif (signal.aborted || !option_node) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tregister_option(option_node);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst option_ref_mix = ref<HTMLElement>((node, signal) => {\n\t\t\t\toption_node = node;\n\t\t\t\tregister_option(node);\n\t\t\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\t\t\tif (option_id) {\n\t\t\t\t\t\tcontext.unregister_option(option_id);\n\t\t\t\t\t}\n\t\t\t\t\toption_node = null;\n\t\t\t\t});\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(select_scope, select_slot.option),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\toption_ref_mix,\n\t\t\t\t\t\toption_pointer_down_mix,\n\t\t\t\t\t\toption_click_mix,\n\t\t\t\t\t\toption_pointer_move_mix,\n\t\t\t\t\t\tparts.hosts[select_slot.option].mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...option_props,\n\t\t\t\t\t\t\"aria-disabled\": ariaTrue(disabled),\n\t\t\t\t\t\t\"aria-selected\": ariaBoolean(selected),\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled),\n\t\t\t\t\t\t[componentDataAttribute.highlighted]: dataFlag(highlighted),\n\t\t\t\t\t\t[componentDataAttribute.selected]: dataFlag(selected),\n\t\t\t\t\t\t[componentStateAttribute]: select_option_state(selected),\n\t\t\t\t\t\t[select_option_value_attribute]: value,\n\t\t\t\t\t\tid: current_option_id,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: \"option\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren ?? option_text,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tGroup,\n\t\tGroupLabel,\n\t\tIcon: create_static_span_component<SelectIconProps>(select_slot.icon),\n\t\tList,\n\t\tOption,\n\t\tOptionIndicator: create_static_span_component<SelectOptionIndicatorProps>(\n\t\t\tselect_slot.optionIndicator,\n\t\t),\n\t\tOptionText: create_static_span_component<SelectOptionTextProps>(\n\t\t\tselect_slot.optionText,\n\t\t),\n\t\tPopup,\n\t\tRoot,\n\t\tSeparator: create_static_div_component<SelectSeparatorProps>(\n\t\t\tselect_slot.separator,\n\t\t\t\"separator\",\n\t\t),\n\t\tTrigger,\n\t\tValue,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport const separatorDecorativeRole = \"presentation\";\nexport const separatorHiddenAttribute = \"aria-hidden\";\nexport const separatorOrientation = {\n\thorizontal: \"horizontal\",\n\tvertical: \"vertical\",\n} as const;\nexport const separatorOrientationAttribute = \"data-orientation\";\nexport const separatorRole = \"separator\";\n\nexport type SeparatorOrientation =\n\t(typeof separatorOrientation)[keyof typeof separatorOrientation];\n\nexport type SeparatorRecipeInput = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\tRecord<never, string>\n>;\n\nexport type SeparatorStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends SeparatorRecipeInput = SeparatorRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tseparator: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type SeparatorProps = Omit<\n\tProps<\"div\">,\n\t\"children\" | \"role\" | \"style\" | \"tabIndex\"\n> & {\n\tchildren?: never;\n\tdecorative?: boolean;\n\torientation?: SeparatorOrientation;\n\tstyle?: never;\n};\n\nconst separator_scope = \"separator\";\n\nexport function createSeparator<\n\tTMode extends string,\n\tTRecipe extends SeparatorRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: SeparatorStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<SeparatorProps> {\n\tconst recipe = createRecipe(style_system.token.recipe.separator);\n\n\treturn () => {\n\t\treturn (props: SeparatorProps): RemixNode => {\n\t\t\tconst {\n\t\t\t\tdecorative = false,\n\t\t\t\tmix,\n\t\t\t\torientation = separatorOrientation.horizontal,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst resolved = recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(separator_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t[separatorHiddenAttribute]: decorative ? \"true\" : undefined,\n\t\t\t\t\t\t[separatorOrientationAttribute]: orientation,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: decorative ? separatorDecorativeRole : separatorRole,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import {\n\tcreateElement,\n\tcreateMixin,\n\ttype ElementProps,\n\ttype Props,\n\ttype RemixNode,\n} from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { type RecipeConditionSelectorMap } from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type SliderRecipeCondition = \"disabled\" | \"focusVisible\";\n\nconst slider_slot = {\n\tprogress: \"progress\",\n\troot: \"root\",\n\tthumb: \"thumb\",\n\ttrack: \"track\",\n} as const;\n\nexport type SliderRecipeSlot = (typeof slider_slot)[keyof typeof slider_slot];\n\nexport type SliderStyleTarget =\n\t| SliderRecipeSlot\n\t| \"thumbMoz\"\n\t| \"thumbWebkit\"\n\t| \"trackMoz\"\n\t| \"trackWebkit\";\n\nexport type SliderTargetStyles = Partial<\n\tReadonly<Record<SliderStyleTarget, ComponentStyle>>\n>;\n\ntype SliderHost = \"root\";\n\nexport type SliderRecipeInput<TLayout extends string = string> = RecipeWithVariantGroups<\n\tSliderRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t}\n>;\n\nexport type SliderRecipeLayout<TRecipe extends SliderRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\nexport type SliderRecipeSelection<TRecipe extends SliderRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"layout\">;\n\nexport type SliderStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends SliderRecipeInput = SliderRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { slider: TRecipe } }, TMetadata>;\n\nexport type SliderStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type SliderProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"input\">, \"style\" | \"type\"> &\n\tSliderStyleProps<TLayout> &\n\tResponsiveProps<SliderStyleProps<TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type SliderOptions = {\n\tprogressVariable?: string;\n\ttargetStyles?: SliderTargetStyles;\n};\n\nconst input_conditions = {\n\tdisabled: \"&:disabled\",\n\tfocusVisible: \"&:focus-visible\",\n} as const satisfies RecipeConditionSelectorMap<SliderRecipeCondition>;\n\nconst slider_scope = \"slider\";\nexport const sliderProgressVariable = \"--vorma-slider-progress\";\nconst slider_progress_selectors = [\"&::-moz-range-progress\"] as const;\nconst slider_thumb_selectors = [\n\t\"&::-webkit-slider-thumb\",\n\t\"&::-moz-range-thumb\",\n] as const;\nconst slider_thumb_moz_selectors = [\"&::-moz-range-thumb\"] as const;\nconst slider_thumb_webkit_selectors = [\"&::-webkit-slider-thumb\"] as const;\nconst slider_track_selectors = [\n\t\"&::-webkit-slider-runnable-track\",\n\t\"&::-moz-range-track\",\n] as const;\nconst slider_track_moz_selectors = [\"&::-moz-range-track\"] as const;\nconst slider_track_webkit_selectors = [\"&::-webkit-slider-runnable-track\"] as const;\nconst slider_empty_slot = {\n\tbase: {},\n\tconditions: {},\n} as const;\n\nfunction read_range_number(value: string, fallback: number): number {\n\tconst numeric_value = Number(value);\n\tif (Number.isFinite(numeric_value)) {\n\t\treturn numeric_value;\n\t}\n\treturn fallback;\n}\n\nfunction update_slider_progress(node: HTMLInputElement, progress_variable: string): void {\n\tconst min = read_range_number(node.min, 0);\n\tconst max = read_range_number(node.max, 100);\n\tconst fallback_value = min + (max - min) / 2;\n\tconst value = read_range_number(node.value, fallback_value);\n\tconst raw_progress = max <= min ? 0 : ((value - min) / (max - min)) * 100;\n\tconst progress = Math.min(100, Math.max(0, raw_progress));\n\n\tnode.style.setProperty(progress_variable, `${progress.toFixed(4)}%`);\n}\n\nconst slider_progress_mixin = createMixin<\n\tHTMLInputElement,\n\t[progressVariable: string],\n\tElementProps\n>((handle) => {\n\tlet current_node: HTMLInputElement | undefined;\n\tlet current_progress_variable = sliderProgressVariable;\n\n\tfunction handle_input(event: Event): void {\n\t\tupdate_slider_progress(\n\t\t\tevent.currentTarget as HTMLInputElement,\n\t\t\tcurrent_progress_variable,\n\t\t);\n\t}\n\n\thandle.addEventListener(\"insert\", (event) => {\n\t\tcurrent_node = event.node;\n\t\tcurrent_node.addEventListener(\"input\", handle_input);\n\t\tupdate_slider_progress(current_node, current_progress_variable);\n\t});\n\thandle.addEventListener(\"commit\", (event) => {\n\t\tupdate_slider_progress(event.node, current_progress_variable);\n\t});\n\thandle.addEventListener(\"remove\", () => {\n\t\tcurrent_node?.removeEventListener(\"input\", handle_input);\n\t\tcurrent_node = undefined;\n\t});\n\n\treturn (progress_variable) => {\n\t\tcurrent_progress_variable = progress_variable;\n\t\tif (current_node) {\n\t\t\tupdate_slider_progress(current_node, current_progress_variable);\n\t\t}\n\t\treturn handle.element;\n\t};\n});\n\nexport function createSlider<\n\tTMode extends string,\n\tTRecipe extends SliderRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: SliderStyleSystem<TMode, TRecipe, TMetadata>,\n\toptions: SliderOptions = {},\n): RemixComponent<\n\tSliderProps<\n\t\tSliderRecipeLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TLayout = SliderRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst slider_recipe = createRecipe(style_system.token.recipe.slider);\n\n\tfunction resolve_slot(\n\t\tslot: SliderRecipeSlot,\n\t\tprops: Partial<SliderStyleProps<TLayout>>,\n\t): ReturnType<typeof slider_recipe.resolve>[\"slots\"][SliderRecipeSlot] {\n\t\treturn slider_recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t} satisfies SliderRecipeSelection<TRecipe>).slots[slot];\n\t}\n\n\treturn () => {\n\t\treturn (props: SliderProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, layout, mix, ...input_props } = props;\n\t\t\tconst progress_variable = options.progressVariable ?? sliderProgressVariable;\n\t\t\tconst style_props = { layout };\n\t\t\tconst targets = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\troot: \"input\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\tconditions: input_conditions,\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"root\", current_style_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstyle: options.targetStyles?.root,\n\t\t\t\t\t},\n\t\t\t\t\tprogress: {\n\t\t\t\t\t\tconditions: input_conditions,\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"progress\", current_style_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_progress_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.progress,\n\t\t\t\t\t},\n\t\t\t\t\tthumb: {\n\t\t\t\t\t\tconditions: input_conditions,\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"thumb\", current_style_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_thumb_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.thumb,\n\t\t\t\t\t},\n\t\t\t\t\tthumbMoz: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn slider_empty_slot;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_thumb_moz_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.thumbMoz,\n\t\t\t\t\t},\n\t\t\t\t\tthumbWebkit: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn slider_empty_slot;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_thumb_webkit_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.thumbWebkit,\n\t\t\t\t\t},\n\t\t\t\t\ttrack: {\n\t\t\t\t\t\tconditions: input_conditions,\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: (current_style_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"track\", current_style_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_track_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.track,\n\t\t\t\t\t},\n\t\t\t\t\ttrackMoz: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn slider_empty_slot;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_track_moz_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.trackMoz,\n\t\t\t\t\t},\n\t\t\t\t\ttrackWebkit: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn slider_empty_slot;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tselectors: slider_track_webkit_selectors,\n\t\t\t\t\t\tstyle: options.targetStyles?.trackWebkit,\n\t\t\t\t\t},\n\t\t\t\t} satisfies Record<\n\t\t\t\t\tSliderStyleTarget,\n\t\t\t\t\t{\n\t\t\t\t\t\tconditions?: RecipeConditionSelectorMap<SliderRecipeCondition>;\n\t\t\t\t\t\thost: SliderHost;\n\t\t\t\t\t\tresolveSlot: (\n\t\t\t\t\t\t\tprops: Partial<SliderStyleProps<TLayout>>,\n\t\t\t\t\t\t) => ReturnType<\n\t\t\t\t\t\t\ttypeof slider_recipe.resolve\n\t\t\t\t\t\t>[\"slots\"][SliderRecipeSlot];\n\t\t\t\t\t\tselectors?: readonly string[];\n\t\t\t\t\t\tstyle?: ComponentStyle;\n\t\t\t\t\t}\n\t\t\t\t>,\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"input\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(slider_scope, \"root\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tslider_progress_mixin(progress_variable),\n\t\t\t\t\t\ttargets.hosts.root.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...input_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype: \"range\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type SpinnerRecipeInput<\n\tTTone extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t\ttone: TTone;\n\t}\n>;\n\nexport type SpinnerRecipeTone<TRecipe extends SpinnerRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\n\nexport type SpinnerRecipeSize<TRecipe extends SpinnerRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type SpinnerRecipeSelection<TRecipe extends SpinnerRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"size\" | \"tone\">;\n\nexport type SpinnerStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends SpinnerRecipeInput = SpinnerRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tspinner: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type SpinnerProps<\n\tTTone extends string = string,\n\tTSize extends string = string,\n> = Omit<Props<\"span\">, \"style\"> &\n\tPartial<SpinnerRecipeSelection<SpinnerRecipeInput<TTone, TSize>>> & {\n\t\tidle?: boolean;\n\t\tstyle?: never;\n\t};\n\nconst spinner_scope = \"spinner\";\n\nexport function createSpinner<\n\tTMode extends string,\n\tTRecipe extends SpinnerRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: SpinnerStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<SpinnerProps<SpinnerRecipeTone<TRecipe>, SpinnerRecipeSize<TRecipe>>> {\n\tconst recipe = createRecipe(style_system.token.recipe.spinner);\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: SpinnerProps<SpinnerRecipeTone<TRecipe>, SpinnerRecipeSize<TRecipe>>,\n\t\t): RemixNode => {\n\t\t\tconst { idle = false, mix, size, tone, ...host_props } = props;\n\t\t\tconst resolved = recipe.resolve({\n\t\t\t\tsize,\n\t\t\t\ttone,\n\t\t\t} satisfies SpinnerRecipeSelection<TRecipe>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"span\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(spinner_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"data-idle\": idle || undefined,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type StackAlign = \"center\" | \"end\" | \"start\" | \"stretch\";\nexport type StackDirection = \"column\" | \"column-reverse\" | \"row\" | \"row-reverse\";\nexport type StackJustify = \"between\" | \"center\" | \"end\" | \"start\";\n\nexport type StackRecipeInput<\n\tTGap extends string = string,\n\tTLayout extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tgap: TGap;\n\t\tlayout: TLayout;\n\t}\n>;\n\nexport type StackRecipeGap<TRecipe extends StackRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"gap\"\n>;\n\nexport type StackRecipeLayout<TRecipe extends StackRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type StackRecipeSelection<TRecipe extends StackRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"gap\" | \"layout\">;\n\nexport type StackStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends StackRecipeInput = StackRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tstack: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type StackStyleProps<\n\tTGap extends string = string,\n\tTLayout extends string = string,\n> = Partial<StackRecipeSelection<StackRecipeInput<TGap, TLayout>>> & {\n\talign?: StackAlign;\n\tdirection?: StackDirection;\n\tjustify?: StackJustify;\n\twrap?: boolean;\n};\n\nexport type StackProps<\n\tTGap extends string = string,\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<keyof HTMLElementTagNameMap>, \"style\"> &\n\tStackStyleProps<TGap, TLayout> &\n\tResponsiveProps<StackStyleProps<TGap, TLayout>, TBreakpoint> & {\n\t\tas?: keyof HTMLElementTagNameMap;\n\t\tstyle?: never;\n\t};\n\nexport type StackOptions = {\n\tdefaultAlign?: StackAlign;\n\tdefaultDirection?: StackDirection;\n\tdefaultJustify?: StackJustify;\n\tdefaultWrap?: boolean;\n};\n\nconst align_map = {\n\tcenter: \"center\",\n\tend: \"flex-end\",\n\tstart: \"flex-start\",\n\tstretch: \"stretch\",\n} as const;\n\nconst justify_map = {\n\tbetween: \"space-between\",\n\tcenter: \"center\",\n\tend: \"flex-end\",\n\tstart: \"flex-start\",\n} as const;\nconst stack_scope = \"stack\";\n\nexport function createStack<\n\tTMode extends string,\n\tTRecipe extends StackRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: StackStyleSystem<TMode, TRecipe, TMetadata>,\n\toptions: StackOptions = {},\n): RemixComponent<\n\tStackProps<\n\t\tStackRecipeGap<TRecipe>,\n\t\tStackRecipeLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TStyleProps = StackStyleProps<\n\t\tStackRecipeGap<TRecipe>,\n\t\tStackRecipeLayout<TRecipe>\n\t>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.stack);\n\n\tfunction deterministic_style(props: Partial<TStyleProps>): ComponentStyle {\n\t\tconst align = props.align ?? options.defaultAlign;\n\t\tconst direction = props.direction ?? options.defaultDirection;\n\t\tconst justify = props.justify ?? options.defaultJustify;\n\t\tconst wrap = props.wrap ?? options.defaultWrap;\n\n\t\treturn {\n\t\t\talignItems: align ? align_map[align] : undefined,\n\t\t\tflexDirection: direction,\n\t\t\tflexWrap: wrap === undefined ? undefined : wrap ? \"wrap\" : \"nowrap\",\n\t\t\tjustifyContent: justify ? justify_map[justify] : undefined,\n\t\t};\n\t}\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TStyleProps>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve({\n\t\t\tgap: props.gap,\n\t\t\tlayout: props.layout,\n\t\t} satisfies StackRecipeSelection<TRecipe>).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: StackProps<\n\t\t\t\tStackRecipeGap<TRecipe>,\n\t\t\t\tStackRecipeLayout<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\talign,\n\t\t\t\tas = \"div\",\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdirection,\n\t\t\t\tgap,\n\t\t\t\tjustify,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\twrap,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst style_props = {\n\t\t\t\talign,\n\t\t\t\tdirection,\n\t\t\t\tgap,\n\t\t\t\tjustify,\n\t\t\t\tlayout,\n\t\t\t\twrap,\n\t\t\t};\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t\tresolveStyle: deterministic_style,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\treturn createElement(\n\t\t\t\tas,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(stack_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n\ttype ComponentSlotProps,\n} from \"./component-style.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type StatRecipeInput<TValueTone extends string = string> = RecipeWithVariantGroups<\n\t\"root\" | \"title\" | \"value\",\n\tnever,\n\tComponentStyle,\n\t{\n\t\tvalueTone: TValueTone;\n\t}\n>;\n\nexport type StatRecipeValueTone<TRecipe extends StatRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"valueTone\"\n>;\nexport type StatRecipeSelection<TRecipe extends StatRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"valueTone\"\n>;\n\nexport type StatStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends StatRecipeInput = StatRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { stat: TRecipe } }, TMetadata>;\n\nexport type StatProps<TValueTone extends string = string> = Omit<\n\tProps<\"div\">,\n\t\"style\"\n> & {\n\tstyle?: never;\n\ttitle: RemixNode;\n\ttitleProps?: ComponentSlotProps<\"div\">;\n\tvalue: RemixNode;\n\tvalueProps?: ComponentSlotProps<\"div\">;\n\tvalueTone?: TValueTone;\n};\n\nconst stat_scope = \"stat\";\n\nexport function createStat<\n\tTMode extends string,\n\tTRecipe extends StatRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: StatStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<StatProps<StatRecipeValueTone<TRecipe>>> {\n\ttype TValueTone = StatRecipeValueTone<TRecipe>;\n\tconst stat_recipe = createRecipe(style_system.token.recipe.stat);\n\n\treturn () => {\n\t\treturn (props: StatProps<TValueTone>): RemixNode => {\n\t\t\tconst { title, titleProps, value, valueProps, valueTone, ...stat_props } =\n\t\t\t\tprops;\n\t\t\tconst { children: _title_children, ...title_props } = titleProps ?? {};\n\t\t\tconst { children: _value_children, ...value_props } = valueProps ?? {};\n\t\t\tconst resolved = stat_recipe.resolve({\n\t\t\t\tvalueTone,\n\t\t\t} satisfies StatRecipeSelection<TRecipe>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.root;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttitle: {\n\t\t\t\t\t\thost: \"title\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.title;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tvalue: {\n\t\t\t\t\t\thost: \"value\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.value;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(stat_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: stat_props,\n\t\t\t\t}),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"div\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(stat_scope, \"title\"),\n\t\t\t\t\t\tmix: parts.hosts.title.mix,\n\t\t\t\t\t\tprops: title_props,\n\t\t\t\t\t}),\n\t\t\t\t\ttitle,\n\t\t\t\t),\n\t\t\t\tcreateElement(\n\t\t\t\t\t\"div\",\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(stat_scope, \"value\"),\n\t\t\t\t\t\tmix: parts.hosts.value.mix,\n\t\t\t\t\t\tprops: value_props,\n\t\t\t\t\t}),\n\t\t\t\t\tvalue,\n\t\t\t\t),\n\t\t\t);\n\t\t};\n\t};\n}\n","import {\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n} from \"../../core/core.ts\";\nimport type { BreakpointForStyleSystem } from \"./responsive.ts\";\nimport {\n\tcreateRootComponent,\n\ttype RootComponent,\n\ttype RootRecipeInput,\n\ttype RootStyleSystem,\n} from \"./root.ts\";\n\nexport type SurfaceRecipeInput<\n\tTVariant extends string = string,\n\tTDensity extends string = string,\n\tTLayout extends string = string,\n> = RootRecipeInput<{\n\tdensity: TDensity;\n\tlayout: TLayout;\n\tvariant: TVariant;\n}>;\n\nexport type SurfaceRecipeVariant<TRecipe extends SurfaceRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type SurfaceRecipeDensity<TRecipe extends SurfaceRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"density\"\n>;\n\nexport type SurfaceRecipeLayout<TRecipe extends SurfaceRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type SurfaceStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends SurfaceRecipeInput = SurfaceRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = RootStyleSystem<TMode, TRecipe, TMetadata, \"surface\">;\n\nexport type SurfaceRecipeSelection<TRecipe extends SurfaceRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"density\" | \"layout\" | \"variant\">;\n\nexport function createSurface<\n\tTMode extends string,\n\tTRecipe extends SurfaceRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: SurfaceStyleSystem<TMode, TRecipe, TMetadata>,\n): RootComponent<\n\t\"density\" | \"layout\" | \"variant\",\n\tTRecipe,\n\tBreakpointForStyleSystem<SurfaceStyleSystem<TMode, TRecipe, TMetadata>>\n> {\n\treturn createRootComponent(style_system, {\n\t\tdefaultElement: \"div\",\n\t\trecipeName: \"surface\",\n\t\tresolveProps: (props: Partial<SurfaceRecipeSelection<TRecipe>>) => {\n\t\t\treturn {\n\t\t\t\tdensity: props.density,\n\t\t\t\tlayout: props.layout,\n\t\t\t\tvariant: props.variant,\n\t\t\t};\n\t\t},\n\t\tvariantProps: [\"density\", \"layout\", \"variant\"],\n\t});\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcheckableInitialChecked,\n\tcheckableState,\n\tcheckableStateAttribute,\n\tcheckableStateFromValue,\n\tcheckableStateMixin,\n\ttype CheckableCheckedChangeDetails,\n} from \"./checkable-state.ts\";\nimport { componentDataAttribute, dataFlag } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type SwitchRecipeCondition = CommonRecipeCondition | \"checked\" | \"unchecked\";\n\nexport type SwitchCheckedChangeDetails = CheckableCheckedChangeDetails;\n\nexport type SwitchCheckedChangeHandler = (\n\tchecked: boolean,\n\tdetails?: SwitchCheckedChangeDetails,\n) => void;\n\nexport type SwitchRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type SwitchRecipeVariant<TRecipe extends SwitchRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type SwitchRecipeSize<TRecipe extends SwitchRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type SwitchRecipeSelection<TRecipe extends SwitchRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"size\" | \"variant\">;\n\nexport type SwitchStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends SwitchRecipeInput = SwitchRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\tswitch: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type SwitchProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"input\">, \"checked\" | \"defaultChecked\" | \"role\" | \"style\" | \"type\"> &\n\tPartial<SwitchRecipeSelection<SwitchRecipeInput<TVariant, TSize>>> &\n\tResponsiveProps<\n\t\tSwitchRecipeSelection<SwitchRecipeInput<TVariant, TSize>>,\n\t\tTBreakpoint\n\t> & {\n\t\tchecked?: boolean;\n\t\tdefaultChecked?: boolean;\n\t\tonCheckedChange?: SwitchCheckedChangeHandler;\n\t\tstyle?: never;\n\t};\n\nconst switch_scope = \"switch\";\nconst switch_role = \"switch\";\nconst switch_type = \"checkbox\";\n\nconst switch_conditions = mergeRecipeConditionSelectors<SwitchRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tchecked: `&[${checkableStateAttribute}='${checkableState.checked}']`,\n\t\tunchecked: `&[${checkableStateAttribute}='${checkableState.unchecked}']`,\n\t} satisfies RecipeConditionSelectorMap<SwitchRecipeCondition>,\n);\n\nexport function createSwitch<\n\tTMode extends string,\n\tTRecipe extends SwitchRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: SwitchStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tSwitchProps<\n\t\tSwitchRecipeVariant<TRecipe>,\n\t\tSwitchRecipeSize<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TSelection = SwitchRecipeSelection<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.switch);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TSelection>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve(props).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: SwitchProps<\n\t\t\t\tSwitchRecipeVariant<TRecipe>,\n\t\t\t\tSwitchRecipeSize<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchecked,\n\t\t\t\tdefaultChecked,\n\t\t\t\tdisabled,\n\t\t\t\tmix,\n\t\t\t\tonCheckedChange,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst selection = {\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t} satisfies TSelection;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\troot: \"input\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: switch_conditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: selection,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"input\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(switch_scope, \"root\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\tcheckableStateMixin({\n\t\t\t\t\t\t\tallowIndeterminate: false,\n\t\t\t\t\t\t\tchecked,\n\t\t\t\t\t\t\tdefaultChecked,\n\t\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\t\tonCheckedChange: onCheckedChange\n\t\t\t\t\t\t\t\t? (next_checked, details) => {\n\t\t\t\t\t\t\t\t\t\tonCheckedChange(next_checked === true, details);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.root.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[checkableStateAttribute]: checkableStateFromValue(\n\t\t\t\t\t\t\tchecked ?? defaultChecked,\n\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t),\n\t\t\t\t\t\tchecked:\n\t\t\t\t\t\t\tchecked === undefined\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: checkableInitialChecked(checked),\n\t\t\t\t\t\tdefaultChecked:\n\t\t\t\t\t\t\tchecked === undefined\n\t\t\t\t\t\t\t\t? checkableInitialChecked(defaultChecked)\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\trequired,\n\t\t\t\t\t\trole: switch_role,\n\t\t\t\t\t\ttype: switch_type,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type TableCellRole = \"body\" | \"columnHeader\" | \"rowHeader\";\nexport type TableHeaderCellScope = \"col\" | \"row\";\n\nexport type TableRecipeInput<\n\tTDensity extends string = string,\n\tTLayout extends string = string,\n\tTRowVariant extends string = string,\n\tTCellVariant extends string = string,\n> = RecipeWithVariantGroups<\n\t\"body\" | \"cell\" | \"head\" | \"root\" | \"row\",\n\tnever,\n\tComponentStyle,\n\t{\n\t\tcellRole: TableCellRole;\n\t\tcellVariant: TCellVariant;\n\t\tdensity: TDensity;\n\t\tlayout: TLayout;\n\t\trowVariant: TRowVariant;\n\t}\n>;\n\nexport type TableRecipeDensity<TRecipe extends TableRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"density\"\n>;\nexport type TableRecipeLayout<TRecipe extends TableRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\nexport type TableRecipeRowVariant<TRecipe extends TableRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"rowVariant\"\n>;\nexport type TableRecipeCellVariant<TRecipe extends TableRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"cellVariant\"\n>;\nexport type TableRecipeSelection<TRecipe extends TableRecipeInput> =\n\tRecipeVariantPropsFor<\n\t\tTRecipe,\n\t\t\"cellRole\" | \"cellVariant\" | \"density\" | \"layout\" | \"rowVariant\"\n\t>;\n\nexport type TableStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends TableRecipeInput = TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { table: TRecipe } }, TMetadata>;\n\nexport type TableStyleProps<\n\tTDensity extends string = string,\n\tTLayout extends string = string,\n> = {\n\tdensity?: TDensity;\n\tlayout?: TLayout;\n};\n\nexport type TableProps<\n\tTDensity extends string = string,\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"table\">, \"style\"> &\n\tTableStyleProps<TDensity, TLayout> &\n\tResponsiveProps<TableStyleProps<TDensity, TLayout>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type TableSectionProps<TElement extends \"tbody\" | \"thead\"> = Omit<\n\tProps<TElement>,\n\t\"style\"\n> & {\n\tstyle?: never;\n};\n\nexport type TableRowProps<TRowVariant extends string = string> = Omit<\n\tProps<\"tr\">,\n\t\"style\"\n> & {\n\tstyle?: never;\n\tvariant?: TRowVariant;\n};\n\nexport type TableCellProps<TCellVariant extends string = string> = Omit<\n\tProps<\"td\">,\n\t\"style\"\n> & {\n\tstyle?: never;\n\tvariant?: TCellVariant;\n};\n\nexport type TableHeaderCellProps<TCellVariant extends string = string> = Omit<\n\tProps<\"th\">,\n\t\"scope\" | \"style\"\n> & {\n\tscope?: TableHeaderCellScope;\n\tstyle?: never;\n\tvariant?: TCellVariant;\n};\n\nconst table_scope = \"table\";\n\nexport function createTable<\n\tTMode extends string,\n\tTRecipe extends TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TableStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tTableProps<\n\t\tTableRecipeDensity<TRecipe>,\n\t\tTableRecipeLayout<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TDensity = TableRecipeDensity<TRecipe>;\n\ttype TLayout = TableRecipeLayout<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst table_recipe = createRecipe(style_system.token.recipe.table);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TableStyleProps<TDensity, TLayout>>,\n\t): ReturnType<typeof table_recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn table_recipe.resolve({\n\t\t\tdensity: props.density,\n\t\t\tlayout: props.layout,\n\t\t} satisfies TableRecipeSelection<TRecipe>).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (props: TableProps<TDensity, TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, density, layout, mix, ...table_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { density, layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"table\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(table_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...table_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createTableHead<\n\tTMode extends string,\n\tTRecipe extends TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TableStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<TableSectionProps<\"thead\">> {\n\tconst table_recipe = createRecipe(style_system.token.recipe.table);\n\n\treturn () => {\n\t\treturn (props: TableSectionProps<\"thead\">): RemixNode => {\n\t\t\tconst { children, mix, ...headProps } = props;\n\t\t\tconst resolved = table_recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\thead: {\n\t\t\t\t\t\thost: \"head\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.head;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\treturn createElement(\n\t\t\t\t\"thead\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(table_scope, \"head\"),\n\t\t\t\t\tmix: parts.hosts.head.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...headProps,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createTableBody<\n\tTMode extends string,\n\tTRecipe extends TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TableStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<TableSectionProps<\"tbody\">> {\n\tconst table_recipe = createRecipe(style_system.token.recipe.table);\n\n\treturn () => {\n\t\treturn (props: TableSectionProps<\"tbody\">): RemixNode => {\n\t\t\tconst { children, mix, ...bodyProps } = props;\n\t\t\tconst resolved = table_recipe.resolve();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tbody: {\n\t\t\t\t\t\thost: \"body\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.body;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\t\t\treturn createElement(\n\t\t\t\t\"tbody\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(table_scope, \"body\"),\n\t\t\t\t\tmix: parts.hosts.body.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...bodyProps,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createTableRow<\n\tTMode extends string,\n\tTRecipe extends TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TableStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<TableRowProps<TableRecipeRowVariant<TRecipe>>> {\n\tconst table_recipe = createRecipe(style_system.token.recipe.table);\n\n\treturn () => {\n\t\treturn (props: TableRowProps<TableRecipeRowVariant<TRecipe>>): RemixNode => {\n\t\t\tconst { children, mix, variant, ...row_props } = props;\n\t\t\tconst resolved = table_recipe.resolve({\n\t\t\t\trowVariant: variant,\n\t\t\t} satisfies TableRecipeSelection<TRecipe>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\trow: {\n\t\t\t\t\t\thost: \"row\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.row;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"tr\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(table_scope, \"row\"),\n\t\t\t\t\tmix: parts.hosts.row.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...row_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createTableCell<\n\tTMode extends string,\n\tTRecipe extends TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TableStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<TableCellProps<TableRecipeCellVariant<TRecipe>>> {\n\tconst table_recipe = createRecipe(style_system.token.recipe.table);\n\n\treturn () => {\n\t\treturn (props: TableCellProps<TableRecipeCellVariant<TRecipe>>): RemixNode => {\n\t\t\tconst { children, mix, variant, ...cell_props } = props;\n\t\t\tconst resolved = table_recipe.resolve({\n\t\t\t\tcellRole: \"body\",\n\t\t\t\tcellVariant: variant,\n\t\t\t} satisfies TableRecipeSelection<TRecipe>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tcell: {\n\t\t\t\t\t\thost: \"cell\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.cell;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"td\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(table_scope, \"cell\"),\n\t\t\t\t\tmix: parts.hosts.cell.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...cell_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n\nexport function createTableHeaderCell<\n\tTMode extends string,\n\tTRecipe extends TableRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TableStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<TableHeaderCellProps<TableRecipeCellVariant<TRecipe>>> {\n\tconst table_recipe = createRecipe(style_system.token.recipe.table);\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: TableHeaderCellProps<TableRecipeCellVariant<TRecipe>>,\n\t\t): RemixNode => {\n\t\t\tconst { children, mix, scope = \"col\", variant, ...cell_props } = props;\n\t\t\tconst cell_role: Extract<TableCellRole, \"columnHeader\" | \"rowHeader\"> =\n\t\t\t\tscope === \"row\" ? \"rowHeader\" : \"columnHeader\";\n\t\t\tconst resolved = table_recipe.resolve({\n\t\t\t\tcellRole: cell_role,\n\t\t\t\tcellVariant: variant,\n\t\t\t} satisfies TableRecipeSelection<TRecipe>);\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tcell: {\n\t\t\t\t\t\thost: \"cell\",\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolved.slots.cell;\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"th\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(table_scope, \"cell\"),\n\t\t\t\t\tmix: parts.hosts.cell.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...cell_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcomponentStateAttribute,\n\tselectionState,\n\tselectionStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type TabsRecipeCondition = CommonRecipeCondition | \"selected\" | \"unselected\";\n\nexport type TabsRecipeInput<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"list\" | \"panel\" | \"root\" | \"trigger\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tlayout: TLayout;\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type TabsRecipeLayout<TRecipe extends TabsRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"layout\"\n>;\n\nexport type TabsRecipeVariant<TRecipe extends TabsRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type TabsRecipeSize<TRecipe extends TabsRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type TabsRecipeSelection<TRecipe extends TabsRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"layout\" | \"size\" | \"variant\"\n>;\n\nexport type TabsStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends TabsRecipeInput = TabsRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { tabs: TRecipe } }, TMetadata>;\n\nexport type TabsValueChangeDetails = {\n\tevent?: Event;\n};\n\nexport type TabsValueChangeHandler<TValue extends string = string> = (\n\tvalue: TValue,\n\tdetails?: TabsValueChangeDetails,\n) => void;\n\nexport type TabsRootStyleProps<TLayout extends string = string> = {\n\tlayout?: TLayout;\n};\n\nexport type TabsTriggerStyleProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type TabsRootProps<\n\tTLayout extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tTabsRootStyleProps<TLayout> &\n\tResponsiveProps<TabsRootStyleProps<TLayout>, TBreakpoint> & {\n\t\tdefaultValue?: TValue | null;\n\t\tonValueChange?: TabsValueChangeHandler<TValue>;\n\t\tstyle?: never;\n\t\tvalue?: TValue | null;\n\t};\n\nexport type TabsListProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type TabsTriggerProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n\tTValue extends string = string,\n> = Omit<Props<\"button\">, \"style\" | \"value\"> &\n\tTabsTriggerStyleProps<TVariant, TSize> &\n\tResponsiveProps<TabsTriggerStyleProps<TVariant, TSize>, TBreakpoint> & {\n\t\tstyle?: never;\n\t\tvalue: TValue;\n\t};\n\nexport type TabsPanelProps<TValue extends string = string> = Omit<\n\tProps<\"div\">,\n\t\"style\"\n> & {\n\tstyle?: never;\n\tvalue: TValue;\n};\n\nexport type TabsComponents<\n\tTLayout extends string = string,\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = {\n\tList: RemixComponent<TabsListProps>;\n\tPanel: RemixComponent<TabsPanelProps>;\n\tRoot: RemixComponent<TabsRootProps<TLayout>, TabsRootContext>;\n\tTrigger: RemixComponent<TabsTriggerProps<TVariant, TSize>>;\n};\n\ntype TabsRootContext = {\n\tget_panel_id: (value: string) => string;\n\tget_trigger_id: (value: string) => string;\n\tget_value: () => string | null;\n\tset_value: (value: string, details?: TabsValueChangeDetails) => void;\n};\n\nconst tabs_scope = \"tabs\";\nconst button_type_default = \"button\";\nconst click_event = \"click\";\n\nconst tabs_conditions = mergeRecipeConditionSelectors<TabsRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tselected: `&[${componentStateAttribute}='${selectionState.selected}']`,\n\t\tunselected: `&[${componentStateAttribute}='${selectionState.unselected}']`,\n\t} satisfies RecipeConditionSelectorMap<TabsRecipeCondition>,\n);\n\nfunction value_id_segment(value: string): string {\n\treturn value.replaceAll(/[^A-Za-z0-9_-]/g, \"-\");\n}\n\nexport function createTabs<\n\tTMode extends string,\n\tTRecipe extends TabsRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TabsStyleSystem<TMode, TRecipe, TMetadata>,\n): TabsComponents<\n\tTabsRecipeLayout<TRecipe>,\n\tTabsRecipeVariant<TRecipe>,\n\tTabsRecipeSize<TRecipe>\n> {\n\ttype TLayout = TabsRecipeLayout<TRecipe>;\n\ttype TVariant = TabsRecipeVariant<TRecipe>;\n\ttype TSize = TabsRecipeSize<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = TabsRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.tabs);\n\n\tfunction resolve_slot(\n\t\tslot: \"list\" | \"panel\" | \"root\" | \"trigger\",\n\t\tprops: Partial<TabsRootStyleProps<TLayout>> &\n\t\t\tPartial<TabsTriggerStyleProps<TVariant, TSize>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tlayout: props.layout,\n\t\t\tsize: props.size,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<TabsRootProps<TLayout, TBreakpoint>, TabsRootContext>,\n\t): (props: TabsRootProps<TLayout, TBreakpoint>) => RemixNode {\n\t\tlet local_value = handle.props.defaultValue ?? null;\n\n\t\tfunction get_value(): string | null {\n\t\t\treturn handle.props.value ?? local_value;\n\t\t}\n\n\t\tconst context: TabsRootContext = {\n\t\t\tget_panel_id: (value) => {\n\t\t\t\treturn `${handle.id}-${value_id_segment(value)}-panel`;\n\t\t\t},\n\t\t\tget_trigger_id: (value) => {\n\t\t\t\treturn `${handle.id}-${value_id_segment(value)}-trigger`;\n\t\t\t},\n\t\t\tget_value,\n\t\t\tset_value: (value, details) => {\n\t\t\t\tif (get_value() === value) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (handle.props.value === undefined) {\n\t\t\t\t\tlocal_value = value;\n\t\t\t\t}\n\t\t\t\thandle.props.onValueChange?.(value, details);\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: TabsRootProps<TLayout, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultValue: _default_value,\n\t\t\t\tlayout,\n\t\t\t\tmix,\n\t\t\t\tonValueChange: _on_value_change,\n\t\t\t\tvalue: _value,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: tabs_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"root\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { layout },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(tabs_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction List(): (props: TabsListProps) => RemixNode {\n\t\treturn (props: TabsListProps): RemixNode => {\n\t\t\tconst { children, mix, ...list_props } = props;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tlist: {\n\t\t\t\t\t\thost: \"list\",\n\t\t\t\t\t\tconditions: tabs_conditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(\"list\", {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(tabs_scope, \"list\"),\n\t\t\t\t\tmix: parts.hosts.list.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...list_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: list_props.role ?? \"tablist\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<TabsTriggerProps<TVariant, TSize, TBreakpoint>>,\n\t): (props: TabsTriggerProps<TVariant, TSize, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: TabsTriggerProps<TVariant, TSize, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvalue,\n\t\t\t\tvariant,\n\t\t\t\t...trigger_props\n\t\t\t} = props;\n\t\t\tconst selected = context.get_value() === value;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\ttrigger: {\n\t\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\t\tconditions: tabs_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"trigger\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(tabs_scope, \"trigger\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.set_value(value, { event });\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-controls\": context.get_panel_id(value),\n\t\t\t\t\t\t\"aria-selected\": selected,\n\t\t\t\t\t\t[componentStateAttribute]: selectionStateFromBoolean(selected),\n\t\t\t\t\t\tid: trigger_props.id ?? context.get_trigger_id(value),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: trigger_props.role ?? \"tab\",\n\t\t\t\t\t\ttabIndex: trigger_props.tabIndex ?? (selected ? 0 : -1),\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Panel(handle: Handle<TabsPanelProps>): (props: TabsPanelProps) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: TabsPanelProps): RemixNode => {\n\t\t\tconst { children, mix, value, ...panel_props } = props;\n\t\t\tconst selected = context.get_value() === value;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\ttargets: {\n\t\t\t\t\tpanel: {\n\t\t\t\t\t\thost: \"panel\",\n\t\t\t\t\t\tconditions: tabs_conditions,\n\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\treturn resolve_slot(\"panel\", {});\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: {},\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(tabs_scope, \"panel\"),\n\t\t\t\t\tmix: parts.hosts.panel.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...panel_props,\n\t\t\t\t\t\t\"aria-labelledby\": context.get_trigger_id(value),\n\t\t\t\t\t\t[componentStateAttribute]: selectionStateFromBoolean(selected),\n\t\t\t\t\t\thidden: !selected,\n\t\t\t\t\t\tid: panel_props.id ?? context.get_panel_id(value),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: panel_props.role ?? \"tabpanel\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tList,\n\t\tPanel,\n\t\tRoot,\n\t\tTrigger,\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type TextAlign = \"center\" | \"end\" | \"justify\" | \"start\";\nexport type TextRecipeSlot = \"root\";\nexport type TextRecipeCondition = string;\n\nexport type TextRecipeInput<\n\tTVariant extends string = string,\n\tTTone extends string = string,\n> = RecipeWithVariantGroups<\n\tTextRecipeSlot,\n\tstring,\n\tComponentStyle,\n\t{\n\t\ttone: TTone;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type TextRecipeVariant<TRecipe extends TextRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type TextRecipeTone<TRecipe extends TextRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\n\nexport type TextRecipeSelection<TRecipe extends TextRecipeInput> = RecipeVariantPropsFor<\n\tTRecipe,\n\t\"tone\" | \"variant\"\n>;\n\nexport type TextStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends TextRecipeInput = TextRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\ttext: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\ntype TextStyleProps<TVariant extends string, TTone extends string> = Partial<\n\tTextRecipeSelection<TextRecipeInput<TVariant, TTone>>\n> & {\n\talign?: TextAlign;\n};\n\nexport type TextProps<\n\tTVariant extends string = string,\n\tTTone extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<keyof HTMLElementTagNameMap>, \"style\"> &\n\tTextStyleProps<TVariant, TTone> &\n\tResponsiveProps<TextStyleProps<TVariant, TTone>, TBreakpoint> & {\n\t\tas?: keyof HTMLElementTagNameMap;\n\t\tstyle?: never;\n\t};\n\nconst text_scope = \"text\";\n\nexport function createText<\n\tTMode extends string,\n\tTRecipe extends TextRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TextStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tTextProps<\n\t\tTextRecipeVariant<TRecipe>,\n\t\tTextRecipeTone<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TStyleProps = TextStyleProps<\n\t\tTextRecipeVariant<TRecipe>,\n\t\tTextRecipeTone<TRecipe>\n\t>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.text);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TStyleProps>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve({\n\t\t\ttone: props.tone,\n\t\t\tvariant: props.variant,\n\t\t} satisfies Partial<TextRecipeSelection<TRecipe>>).slots.root;\n\t}\n\n\tfunction deterministic_style(\n\t\tprops: Partial<TStyleProps>,\n\t): ComponentStyle | undefined {\n\t\treturn props.align ? { textAlign: props.align } : undefined;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: TextProps<\n\t\t\t\tTextRecipeVariant<TRecipe>,\n\t\t\t\tTextRecipeTone<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\talign,\n\t\t\t\tas = \"p\",\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\ttone,\n\t\t\t\tvariant,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst style_props = {\n\t\t\t\talign,\n\t\t\t\ttone,\n\t\t\t\tvariant,\n\t\t\t};\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t\tresolveStyle: deterministic_style,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: style_props,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\tas,\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(text_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport { componentDataAttribute, dataFlag, is_aria_invalid } from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions } from \"./conditions.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type TextareaRecipeInput<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n> = RecipeWithVariantGroups<\n\t\"root\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type TextareaRecipeVariant<TRecipe extends TextareaRecipeInput> =\n\tRecipeVariantValue<TRecipe, \"variant\">;\n\nexport type TextareaRecipeSize<TRecipe extends TextareaRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type TextareaRecipeSelection<TRecipe extends TextareaRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"size\" | \"variant\">;\n\nexport type TextareaStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends TextareaRecipeInput = TextareaRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<\n\tTMode,\n\t{\n\t\trecipe: {\n\t\t\ttextarea: TRecipe;\n\t\t};\n\t},\n\tTMetadata\n>;\n\nexport type TextareaProps<\n\tTVariant extends string = string,\n\tTSize extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"textarea\">, \"style\"> &\n\tPartial<TextareaRecipeSelection<TextareaRecipeInput<TVariant, TSize>>> &\n\tResponsiveProps<\n\t\tTextareaRecipeSelection<TextareaRecipeInput<TVariant, TSize>>,\n\t\tTBreakpoint\n\t> & {\n\t\tstyle?: never;\n\t};\n\nexport const textareaAnatomy = {\n\troot: \"root\",\n} as const;\n\nconst textarea_scope = \"textarea\";\n\nexport function createTextarea<\n\tTMode extends string,\n\tTRecipe extends TextareaRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TextareaStyleSystem<TMode, TRecipe, TMetadata>,\n): RemixComponent<\n\tTextareaProps<\n\t\tTextareaRecipeVariant<TRecipe>,\n\t\tTextareaRecipeSize<TRecipe>,\n\t\tBreakpointForStyleSystem<typeof style_system>\n\t>\n> {\n\ttype TSelection = TextareaRecipeSelection<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\tconst recipe = createRecipe(style_system.token.recipe.textarea);\n\n\tfunction resolve_root_slot(\n\t\tprops: Partial<TSelection>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][\"root\"] {\n\t\treturn recipe.resolve(props).slots.root;\n\t}\n\n\treturn () => {\n\t\treturn (\n\t\t\tprops: TextareaProps<\n\t\t\t\tTextareaRecipeVariant<TRecipe>,\n\t\t\t\tTextareaRecipeSize<TRecipe>,\n\t\t\t\tTBreakpoint\n\t\t\t>,\n\t\t): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\t\"aria-invalid\": aria_invalid,\n\t\t\t\tdisabled,\n\t\t\t\tmix,\n\t\t\t\treadOnly,\n\t\t\t\trequired,\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t\t...host_props\n\t\t\t} = props;\n\t\t\tconst selection = {\n\t\t\t\tsize,\n\t\t\t\tvariant,\n\t\t\t} satisfies TSelection;\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\troot: \"textarea\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: commonConditions,\n\t\t\t\t\t\tresolveSlot: resolve_root_slot,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: selection,\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"textarea\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(\n\t\t\t\t\t\ttextarea_scope,\n\t\t\t\t\t\ttextareaAnatomy.root,\n\t\t\t\t\t),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...host_props,\n\t\t\t\t\t\t\"aria-invalid\": aria_invalid,\n\t\t\t\t\t\t[componentDataAttribute.disabled]: dataFlag(disabled === true),\n\t\t\t\t\t\t[componentDataAttribute.invalid]: dataFlag(\n\t\t\t\t\t\t\tis_aria_invalid(aria_invalid),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t[componentDataAttribute.readOnly]: dataFlag(readOnly === true),\n\t\t\t\t\t\t[componentDataAttribute.required]: dataFlag(required === true),\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\trequired,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t};\n}\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcomponentStateAttribute,\n\topenState,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type ToastRecipeCondition = CommonRecipeCondition | \"closed\" | \"open\";\n\nexport type ToastRecipeInput<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n> = RecipeWithVariantGroups<\n\t\"close\" | \"description\" | \"root\" | \"title\" | \"viewport\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\ttone: TTone;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type ToastRecipeTone<TRecipe extends ToastRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"tone\"\n>;\n\nexport type ToastRecipeVariant<TRecipe extends ToastRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type ToastRecipeSelection<TRecipe extends ToastRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"tone\" | \"variant\">;\n\nexport type ToastStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends ToastRecipeInput = ToastRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { toast: TRecipe } }, TMetadata>;\n\nexport type ToastOpenChangeDetails = {\n\tevent?: Event;\n\treason: \"close\";\n};\n\nexport type ToastOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: ToastOpenChangeDetails,\n) => void;\n\nexport type ToastRootStyleProps<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n> = {\n\ttone?: TTone;\n\tvariant?: TVariant;\n};\n\nexport type ToastRootProps<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tToastRootStyleProps<TTone, TVariant> &\n\tResponsiveProps<ToastRootStyleProps<TTone, TVariant>, TBreakpoint> & {\n\t\tdefaultOpen?: boolean;\n\t\tonOpenChange?: ToastOpenChangeHandler;\n\t\topen?: boolean;\n\t\tstyle?: never;\n\t};\n\nexport type ToastViewportProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ToastTitleProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ToastDescriptionProps = Omit<Props<\"div\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ToastCloseProps = Omit<Props<\"button\">, \"style\"> & {\n\tstyle?: never;\n};\n\nexport type ToastComponents<\n\tTTone extends string = string,\n\tTVariant extends string = string,\n> = {\n\tClose: RemixComponent<ToastCloseProps>;\n\tDescription: RemixComponent<ToastDescriptionProps>;\n\tRoot: RemixComponent<ToastRootProps<TTone, TVariant>, ToastContext>;\n\tTitle: RemixComponent<ToastTitleProps>;\n\tViewport: RemixComponent<ToastViewportProps>;\n};\n\ntype ToastContext = {\n\tclose: (details: ToastOpenChangeDetails) => void;\n\tget_open: () => boolean;\n};\n\nconst toast_scope = \"toast\";\nconst button_type_default = \"button\";\nconst click_event = \"click\";\n\nconst toast_conditions = mergeRecipeConditionSelectors<ToastRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tclosed: `&[${componentStateAttribute}='${openState.closed}']`,\n\t\topen: `&[${componentStateAttribute}='${openState.open}']`,\n\t} satisfies RecipeConditionSelectorMap<ToastRecipeCondition>,\n);\n\nexport function createToast<\n\tTMode extends string,\n\tTRecipe extends ToastRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: ToastStyleSystem<TMode, TRecipe, TMetadata>,\n): ToastComponents<ToastRecipeTone<TRecipe>, ToastRecipeVariant<TRecipe>> {\n\ttype TTone = ToastRecipeTone<TRecipe>;\n\ttype TVariant = ToastRecipeVariant<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = ToastRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.toast);\n\n\tfunction resolve_slot(\n\t\tslot: \"close\" | \"description\" | \"root\" | \"title\" | \"viewport\",\n\t\tprops: Partial<ToastRootStyleProps<TTone, TVariant>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\ttone: props.tone,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<ToastRootProps<TTone, TVariant, TBreakpoint>, ToastContext>,\n\t): (props: ToastRootProps<TTone, TVariant, TBreakpoint>) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? true;\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn handle.props.open ?? local_open;\n\t\t}\n\n\t\tconst context: ToastContext = {\n\t\t\tclose: (details) => {\n\t\t\t\tif (!get_open()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (handle.props.open === undefined) {\n\t\t\t\t\tlocal_open = false;\n\t\t\t\t}\n\t\t\t\thandle.props.onOpenChange?.(false, details);\n\t\t\t\tvoid handle.update();\n\t\t\t},\n\t\t\tget_open,\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: ToastRootProps<TTone, TVariant, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tdefaultOpen: _default_open,\n\t\t\t\tmix,\n\t\t\t\tonOpenChange: _on_open_change,\n\t\t\t\topen: _open,\n\t\t\t\ttone,\n\t\t\t\tvariant,\n\t\t\t\t...root_props\n\t\t\t} = props;\n\t\t\tconst open = get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\ttargets: {\n\t\t\t\t\troot: {\n\t\t\t\t\t\thost: \"root\",\n\t\t\t\t\t\tconditions: toast_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"root\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { tone, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(toast_scope, \"root\"),\n\t\t\t\t\tmix: parts.hosts.root.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...root_props,\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\thidden: !open,\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: root_props.role ?? \"status\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction create_static_part<TElement extends \"button\" | \"div\">(\n\t\telement: TElement,\n\t\tslot: \"close\" | \"description\" | \"title\" | \"viewport\",\n\t): RemixComponent<Omit<Props<TElement>, \"style\"> & { style?: never }> {\n\t\treturn (handle: Handle<Omit<Props<TElement>, \"style\">>) => {\n\t\t\tconst context = slot === \"close\" ? handle.context.get(Root) : null;\n\n\t\t\treturn (\n\t\t\t\tprops: Omit<Props<TElement>, \"style\"> & { style?: never },\n\t\t\t): RemixNode => {\n\t\t\t\tconst { children, mix, ...part_props } = props;\n\t\t\t\tconst host_props: Record<string, unknown> = {\n\t\t\t\t\t...part_props,\n\t\t\t\t\tmix,\n\t\t\t\t};\n\t\t\t\tif (element === \"button\" && host_props.type === undefined) {\n\t\t\t\t\thost_props.type = button_type_default;\n\t\t\t\t}\n\t\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\t\ttargets: {\n\t\t\t\t\t\t[slot]: {\n\t\t\t\t\t\t\thost: slot,\n\t\t\t\t\t\t\tconditions: toast_conditions,\n\t\t\t\t\t\t\tresolveSlot: () => {\n\t\t\t\t\t\t\t\treturn resolve_slot(slot, {});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t} as Record<\n\t\t\t\t\t\ttypeof slot,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconditions: typeof toast_conditions;\n\t\t\t\t\t\t\thost: typeof slot;\n\t\t\t\t\t\t\tresolveSlot: () => ReturnType<\n\t\t\t\t\t\t\t\ttypeof recipe.resolve\n\t\t\t\t\t\t\t>[\"slots\"][typeof slot];\n\t\t\t\t\t\t}\n\t\t\t\t\t>,\n\t\t\t\t\tprops: {},\n\t\t\t\t\tstyleSystem: style_system,\n\t\t\t\t});\n\t\t\t\tconst close_mix =\n\t\t\t\t\tslot === \"close\" && context\n\t\t\t\t\t\t? on<HTMLButtonElement, typeof click_event>(\n\t\t\t\t\t\t\t\tclick_event,\n\t\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\t\tcontext.close({ event, reason: \"close\" });\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\treturn createElement(\n\t\t\t\t\telement,\n\t\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\t\tattrs: createComponentAnatomyAttrs(toast_scope, slot),\n\t\t\t\t\t\tmix: [close_mix, parts.hosts[slot].mix],\n\t\t\t\t\t\tprops: host_props,\n\t\t\t\t\t}),\n\t\t\t\t\tchildren,\n\t\t\t\t);\n\t\t\t};\n\t\t};\n\t}\n\n\treturn {\n\t\tClose: create_static_part(\"button\", \"close\"),\n\t\tDescription: create_static_part(\"div\", \"description\"),\n\t\tRoot,\n\t\tTitle: create_static_part(\"div\", \"title\"),\n\t\tViewport: create_static_part(\"div\", \"viewport\"),\n\t};\n}\n","import { createElement, on, type Handle, type Props, type RemixNode } from \"remix/ui\";\nimport {\n\tcreateRecipe,\n\ttype AnyGeneratedSystemMetadata,\n\ttype RecipeVariantPropsFor,\n\ttype RecipeVariantValue,\n\ttype RecipeWithVariantGroups,\n} from \"../../core/core.ts\";\nimport {\n\tcomponentStateAttribute,\n\topenState,\n\topenStateFromBoolean,\n} from \"./component-state.ts\";\nimport {\n\tcreateComponentAnatomyAttrs,\n\tcreateComponentSlotProps,\n\tcreateComponentStyleTargets,\n} from \"./component-style.ts\";\nimport { commonConditions, type CommonRecipeCondition } from \"./conditions.ts\";\nimport {\n\tmergeRecipeConditionSelectors,\n\ttype RecipeConditionSelectorMap,\n} from \"./recipe.ts\";\nimport { type BreakpointForStyleSystem, type ResponsiveProps } from \"./responsive.ts\";\nimport type { ComponentStyle, ComponentStyleSystem, RemixComponent } from \"./types.ts\";\n\nexport type TooltipRecipeCondition = CommonRecipeCondition | \"closed\" | \"open\";\n\nexport type TooltipRecipeInput<\n\tTSize extends string = string,\n\tTVariant extends string = string,\n> = RecipeWithVariantGroups<\n\t\"popup\" | \"trigger\",\n\tstring,\n\tComponentStyle,\n\t{\n\t\tsize: TSize;\n\t\tvariant: TVariant;\n\t}\n>;\n\nexport type TooltipRecipeSize<TRecipe extends TooltipRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"size\"\n>;\n\nexport type TooltipRecipeVariant<TRecipe extends TooltipRecipeInput> = RecipeVariantValue<\n\tTRecipe,\n\t\"variant\"\n>;\n\nexport type TooltipRecipeSelection<TRecipe extends TooltipRecipeInput> =\n\tRecipeVariantPropsFor<TRecipe, \"size\" | \"variant\">;\n\nexport type TooltipStyleSystem<\n\tTMode extends string = string,\n\tTRecipe extends TooltipRecipeInput = TooltipRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata = AnyGeneratedSystemMetadata,\n> = ComponentStyleSystem<TMode, { recipe: { tooltip: TRecipe } }, TMetadata>;\n\nexport type TooltipOpenChangeDetails = {\n\tevent?: Event;\n\treason: \"blur\" | \"focus\" | \"pointerEnter\" | \"pointerLeave\";\n};\n\nexport type TooltipOpenChangeHandler = (\n\topen: boolean,\n\tdetails?: TooltipOpenChangeDetails,\n) => void;\n\nexport type TooltipRootProps = {\n\tchildren?: RemixNode;\n\tdefaultOpen?: boolean;\n\tonOpenChange?: TooltipOpenChangeHandler;\n\topen?: boolean;\n};\n\nexport type TooltipStyleProps<\n\tTSize extends string = string,\n\tTVariant extends string = string,\n> = {\n\tsize?: TSize;\n\tvariant?: TVariant;\n};\n\nexport type TooltipTriggerProps<\n\tTSize extends string = string,\n\tTVariant extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"button\">, \"style\"> &\n\tTooltipStyleProps<TSize, TVariant> &\n\tResponsiveProps<TooltipStyleProps<TSize, TVariant>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type TooltipPopupProps<\n\tTSize extends string = string,\n\tTVariant extends string = string,\n\tTBreakpoint extends string = string,\n> = Omit<Props<\"div\">, \"style\"> &\n\tTooltipStyleProps<TSize, TVariant> &\n\tResponsiveProps<TooltipStyleProps<TSize, TVariant>, TBreakpoint> & {\n\t\tstyle?: never;\n\t};\n\nexport type TooltipComponents<\n\tTSize extends string = string,\n\tTVariant extends string = string,\n> = {\n\tPopup: RemixComponent<TooltipPopupProps<TSize, TVariant>>;\n\tRoot: RemixComponent<TooltipRootProps, TooltipContext>;\n\tTrigger: RemixComponent<TooltipTriggerProps<TSize, TVariant>>;\n};\n\ntype TooltipContext = {\n\tclose: (details: TooltipOpenChangeDetails) => void;\n\tget_open: () => boolean;\n\tget_popup_id: () => string;\n\topen: (details: TooltipOpenChangeDetails) => void;\n};\n\nconst tooltip_scope = \"tooltip\";\nconst button_type_default = \"button\";\nconst blur_event = \"blur\";\nconst focus_event = \"focus\";\nconst mouse_enter_event = \"mouseenter\";\nconst mouse_leave_event = \"mouseleave\";\n\nconst tooltip_conditions = mergeRecipeConditionSelectors<TooltipRecipeCondition>(\n\tcommonConditions,\n\t{\n\t\tclosed: `&[${componentStateAttribute}='${openState.closed}']`,\n\t\topen: `&[${componentStateAttribute}='${openState.open}']`,\n\t} satisfies RecipeConditionSelectorMap<TooltipRecipeCondition>,\n);\n\nexport function createTooltip<\n\tTMode extends string,\n\tTRecipe extends TooltipRecipeInput,\n\tTMetadata extends AnyGeneratedSystemMetadata,\n>(\n\tstyle_system: TooltipStyleSystem<TMode, TRecipe, TMetadata>,\n): TooltipComponents<TooltipRecipeSize<TRecipe>, TooltipRecipeVariant<TRecipe>> {\n\ttype TSize = TooltipRecipeSize<TRecipe>;\n\ttype TVariant = TooltipRecipeVariant<TRecipe>;\n\ttype TBreakpoint = BreakpointForStyleSystem<typeof style_system>;\n\ttype TSelection = TooltipRecipeSelection<TRecipe>;\n\tconst recipe = createRecipe(style_system.token.recipe.tooltip);\n\n\tfunction resolve_slot(\n\t\tslot: \"popup\" | \"trigger\",\n\t\tprops: Partial<TooltipStyleProps<TSize, TVariant>>,\n\t): ReturnType<typeof recipe.resolve>[\"slots\"][typeof slot] {\n\t\treturn recipe.resolve({\n\t\t\tsize: props.size,\n\t\t\tvariant: props.variant,\n\t\t} satisfies TSelection).slots[slot];\n\t}\n\n\tfunction Root(\n\t\thandle: Handle<TooltipRootProps, TooltipContext>,\n\t): (props: TooltipRootProps) => RemixNode {\n\t\tlet local_open = handle.props.defaultOpen ?? false;\n\n\t\tfunction get_open(): boolean {\n\t\t\treturn handle.props.open ?? local_open;\n\t\t}\n\n\t\tfunction request_open(open: boolean, details: TooltipOpenChangeDetails): void {\n\t\t\tif (get_open() === open) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (handle.props.open === undefined) {\n\t\t\t\tlocal_open = open;\n\t\t\t}\n\t\t\thandle.props.onOpenChange?.(open, details);\n\t\t\tvoid handle.update();\n\t\t}\n\n\t\tconst context: TooltipContext = {\n\t\t\tclose: (details) => {\n\t\t\t\trequest_open(false, details);\n\t\t\t},\n\t\t\tget_open,\n\t\t\tget_popup_id: () => {\n\t\t\t\treturn `${handle.id}-popup`;\n\t\t\t},\n\t\t\topen: (details) => {\n\t\t\t\trequest_open(true, details);\n\t\t\t},\n\t\t};\n\t\thandle.context.set(context);\n\n\t\treturn (props: TooltipRootProps): RemixNode => {\n\t\t\treturn props.children;\n\t\t};\n\t}\n\n\tfunction Trigger(\n\t\thandle: Handle<TooltipTriggerProps<TSize, TVariant, TBreakpoint>>,\n\t): (props: TooltipTriggerProps<TSize, TVariant, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: TooltipTriggerProps<TSize, TVariant, TBreakpoint>): RemixNode => {\n\t\t\tconst {\n\t\t\t\tat,\n\t\t\t\tchildren,\n\t\t\t\tmix,\n\t\t\t\tsize,\n\t\t\t\ttype = button_type_default,\n\t\t\t\tvariant,\n\t\t\t\t...trigger_props\n\t\t\t} = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\ttrigger: \"button\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\ttrigger: {\n\t\t\t\t\t\thost: \"trigger\",\n\t\t\t\t\t\tconditions: tooltip_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"trigger\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"button\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(tooltip_scope, \"trigger\"),\n\t\t\t\t\tmix: [\n\t\t\t\t\t\ton<HTMLButtonElement, typeof mouse_enter_event>(\n\t\t\t\t\t\t\tmouse_enter_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.open({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: \"pointerEnter\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLButtonElement, typeof mouse_leave_event>(\n\t\t\t\t\t\t\tmouse_leave_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.close({\n\t\t\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\t\t\treason: \"pointerLeave\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLButtonElement, typeof focus_event>(\n\t\t\t\t\t\t\tfocus_event,\n\t\t\t\t\t\t\t(event) => {\n\t\t\t\t\t\t\t\tcontext.open({ event, reason: \"focus\" });\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t),\n\t\t\t\t\t\ton<HTMLButtonElement, typeof blur_event>(blur_event, (event) => {\n\t\t\t\t\t\t\tcontext.close({ event, reason: \"blur\" });\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tparts.hosts.trigger.mix,\n\t\t\t\t\t],\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...trigger_props,\n\t\t\t\t\t\t\"aria-describedby\": context.get_popup_id(),\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction Popup(\n\t\thandle: Handle<TooltipPopupProps<TSize, TVariant, TBreakpoint>>,\n\t): (props: TooltipPopupProps<TSize, TVariant, TBreakpoint>) => RemixNode {\n\t\tconst context = handle.context.get(Root);\n\n\t\treturn (props: TooltipPopupProps<TSize, TVariant, TBreakpoint>): RemixNode => {\n\t\t\tconst { at, children, mix, size, variant, ...popup_props } = props;\n\t\t\tconst open = context.get_open();\n\t\t\tconst parts = createComponentStyleTargets({\n\t\t\t\tat,\n\t\t\t\thostElements: {\n\t\t\t\t\tpopup: \"div\",\n\t\t\t\t},\n\t\t\t\ttargets: {\n\t\t\t\t\tpopup: {\n\t\t\t\t\t\thost: \"popup\",\n\t\t\t\t\t\tconditions: tooltip_conditions,\n\t\t\t\t\t\tresolveSlot: (current_props) => {\n\t\t\t\t\t\t\treturn resolve_slot(\"popup\", current_props);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tprops: { size, variant },\n\t\t\t\tstyleSystem: style_system,\n\t\t\t});\n\n\t\t\treturn createElement(\n\t\t\t\t\"div\",\n\t\t\t\tcreateComponentSlotProps({\n\t\t\t\t\tattrs: createComponentAnatomyAttrs(tooltip_scope, \"popup\"),\n\t\t\t\t\tmix: parts.hosts.popup.mix,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...popup_props,\n\t\t\t\t\t\t[componentStateAttribute]: openStateFromBoolean(open),\n\t\t\t\t\t\thidden: !open,\n\t\t\t\t\t\tid: popup_props.id ?? context.get_popup_id(),\n\t\t\t\t\t\tmix,\n\t\t\t\t\t\trole: popup_props.role ?? \"tooltip\",\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tchildren,\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tPopup,\n\t\tRoot,\n\t\tTrigger,\n\t};\n}\n"],"mappings":";;AAKA,MAAM,qBAAqB,OAAO,OAAO,EAAE,CAAC;AAM5C,SAAS,yBAAyB,OAAwB;AACzD,QAAO,OAAO,KAAK,MAAM,CAAC,SAAS;;AAGpC,SAAS,0BAA0B,OAAsC;AACxE,KAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,MAAM,CACtE,QAAO;AAGR,QAAO,OAAO,sBAAsB,MAAM,CAAC,WAAW;;AAGvD,SAAS,yBAAyB,SAAkB,OAAyB;AAC5E,KAAI,0BAA0B,QAAQ,IAAI,0BAA0B,MAAM,CACzE,QAAO,kBAAkB,SAAS,MAAM;AAGzC,QAAO;;AAGR,SAAS,wBACR,QACA,OACO;AACP,MAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,MAAM,CAC/C,QAAO,OAAO,yBAAyB,OAAO,MAAM,MAAM;;AAI5D,SAAgB,kBACf,GAAG,QACM;CACT,MAAM,mBAAmB,OAAO,QAAQ,UAA2B;AAClE,SAAO,UAAU,KAAA,KAAa,yBAAyB,MAAM;GAC5D;AAEF,KAAI,iBAAiB,WAAW,EAC/B,QAAO;AAGR,KAAI,iBAAiB,WAAW,EAC/B,QAAO,i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