UNPKG

@react-three/uikit-default

Version:

Default (shadcn) kit for @react-three/uikit

20 lines (19 loc) 901 B
import { computed, signal } from '@preact/signals-core'; import { isDarkMode, DefaultProperties } from '@react-three/uikit'; import { themes } from './themes.js'; import React from 'react'; export const baseBorderRadius = signal(8); export const borderRadius = { lg: baseBorderRadius, md: computed(() => baseBorderRadius.value - 2), sm: computed(() => baseBorderRadius.value - 4), }; export const themeName = signal('slate'); export const colors = {}; for (const anyKey in themes['slate']['light']) { const key = anyKey; colors[key] = computed(() => themes[themeName.value][isDarkMode.value ? 'dark' : 'light'][key]); } export function Defaults(props) { return (React.createElement(DefaultProperties, { scrollbarColor: colors.foreground, scrollbarBorderRadius: 4, scrollbarOpacity: 0.3, lineHeight: "150%", borderColor: colors.border, color: colors.foreground, ...props })); }