UNPKG

@fidely-ui/react

Version:

Fidely UI is a modern, beautifully crafted React design system powered by Ark UI and Panda CSS, delivering accessible and themeable components for building exceptional web apps

14 lines (13 loc) 826 B
'use client'; import { Switch as ArkSwitch } from '@ark-ui/react/switch'; import { switchRecipe, } from '@fidely-ui/styled-system/recipes'; import { makeStyleContext } from '../../system/make-style-context'; const { withSlotProvider, withSlotContext } = makeStyleContext(switchRecipe); export const SwitchRootProvider = withSlotProvider(ArkSwitch.RootProvider, 'root'); export const SwitchRoot = withSlotProvider(ArkSwitch.Root, 'root'); export const SwitchControl = withSlotContext(ArkSwitch.Control, 'control'); export const SwitchThumb = withSlotContext(ArkSwitch.Thumb, 'thumb'); export const SwitchLabel = withSlotContext(ArkSwitch.Label, 'label'); // -------------------- Context + Hidden Input -------------------- export const SwitchContext = ArkSwitch.Context; export const SwitchHiddenInput = ArkSwitch.HiddenInput;