@saas-ui/react 3.0.0-next.47 → 3.0.0-next.49

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.
@@ -0,0 +1,2 @@
1
+ export { Theme } from './theme.tsx';
2
+ export type { ThemeProps } from './theme.tsx';
@@ -0,0 +1 @@
1
+ export { Theme } from "./theme.js";
@@ -0,0 +1,40 @@
1
+ import { type HTMLChakraProps } from '@chakra-ui/react/styled-system';
2
+ import type { ColorPalette } from '@saas-ui/chakra-preset/colors';
3
+ export interface ThemeProps extends HTMLChakraProps<'div'> {
4
+ /**
5
+ * The appearance of the theme.
6
+ */
7
+ appearance?: 'light' | 'dark' | undefined;
8
+ /**
9
+ * Whether to apply the theme background and color.
10
+ */
11
+ hasBackground?: boolean | undefined;
12
+ /**
13
+ * The default color palette of the theme.
14
+ */
15
+ colorPalette?: ColorPalette | undefined;
16
+ /**
17
+ * The scale factor of the theme.
18
+ */
19
+ scaleFactor?: number | undefined;
20
+ /**
21
+ * Radius factor for control components.
22
+ * Eg Button, Input, Select, etc.
23
+ */
24
+ controlRadius?: number | undefined;
25
+ /**
26
+ * Radius factor for panel components.
27
+ * Eg Drawer, Popover, etc.
28
+ */
29
+ panelRadius?: number | undefined;
30
+ /**
31
+ * Radius factor for indicator components.
32
+ * Eg Badge, Tag, etc.
33
+ */
34
+ indicatorRadius?: number | undefined;
35
+ /**
36
+ * The overlay effect of the theme.
37
+ */
38
+ overlayEffect?: string | undefined;
39
+ }
40
+ export declare const Theme: import("react").ForwardRefExoticComponent<ThemeProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from 'react';
4
+ import { chakra } from '@chakra-ui/react/styled-system';
5
+ import { cx } from '@saas-ui/core/utils';
6
+ export const Theme = forwardRef(function Theme(props, ref) {
7
+ const { appearance, style, className, hasBackground = true, scaleFactor = 1, controlRadius = 1, panelRadius = 1, indicatorRadius = 1, overlayEffect = 'blur(10px)', ...rest } = props;
8
+ let modifiers = {
9
+ '--scale-factor': scaleFactor,
10
+ '--overlay-effect': overlayEffect,
11
+ '--radius-control': controlRadius,
12
+ '--radius-panel': panelRadius,
13
+ '--radius-indicator': indicatorRadius,
14
+ };
15
+ return (_jsx(chakra.div, { color: "fg", bg: hasBackground ? 'bg' : undefined, colorPalette: "gray", ...rest, className: cx('chakra-theme', appearance, className), style: { ...style, colorScheme: appearance, ...modifiers }, ref: ref }));
16
+ });
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { useMediaQuery, useBreakpoint, useBreakpointValue, useControllableState,
5
5
  export type { UseDisclosureProps, UseDisclosureReturn, UseControllableStateProps, UseBreakpointOptions, UseBreakpointValueOptions, } from '@chakra-ui/react';
6
6
  export { SuiProvider, SuiContext, useLink, useSui } from './provider/index.ts';
7
7
  export type { SuiContextValue, SuiProviderProps } from './provider/index.ts';
8
+ export { Theme, type ThemeProps } from './components/theme/index.ts';
8
9
  export { Accordion } from './components/accordion/index.ts';
9
10
  export { ActionBar } from './components/action-bar/index.ts';
10
11
  export { Alert, type AlertProps } from './components/alert/index.ts';
@@ -139,4 +140,3 @@ export { Flex, type FlexProps } from './components/flex/index.ts';
139
140
  export type { ColorPalette } from '@saas-ui/chakra-preset/colors';
140
141
  export { For } from '@chakra-ui/react/for';
141
142
  export { LocaleProvider, useLocaleContext, useFilter, } from '@chakra-ui/react/locale';
142
- export { Theme } from '@chakra-ui/react';
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export { defaultSystem, defaultConfig } from "./preset.js";
2
2
  export { createSystem, defineAnimationStyles, defineConditions, defineConfig, defineGlobalStyles, defineKeyframes, defineLayerStyles, defineRecipe, defineSemanticTokens, defineSlotRecipe, defineStyle, defineTextStyles, defineTokens, chakra, createRecipeContext, createSlotRecipeContext, useRecipe, useSlotRecipe, useChakraContext, useToken, } from '@chakra-ui/react/styled-system';
3
3
  export { useMediaQuery, useBreakpoint, useBreakpointValue, useControllableState, useDisclosure, createListCollection, createContext, mergeRefs, } from '@chakra-ui/react';
4
4
  export { SuiProvider, SuiContext, useLink, useSui } from "./provider/index.js";
5
+ export { Theme } from "./components/theme/index.js";
5
6
  export { Accordion } from "./components/accordion/index.js";
6
7
  export { ActionBar } from "./components/action-bar/index.js";
7
8
  export { Alert } from "./components/alert/index.js";
@@ -132,4 +133,3 @@ export { Wrap } from "./components/wrap/index.js";
132
133
  export { Flex } from "./components/flex/index.js";
133
134
  export { For } from '@chakra-ui/react/for';
134
135
  export { LocaleProvider, useLocaleContext, useFilter, } from '@chakra-ui/react/locale';
135
- export { Theme } from '@chakra-ui/react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saas-ui/react",
3
- "version": "3.0.0-next.47",
3
+ "version": "3.0.0-next.49",
4
4
  "description": "Saas UI - The React component library for startups.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -62,9 +62,9 @@
62
62
  "dependencies": {
63
63
  "@ark-ui/react": "^5.25.1",
64
64
  "next-themes": "^0.4.6",
65
+ "@saas-ui/core": "3.0.0-next.12",
65
66
  "@saas-ui/hooks": "3.0.0-next.3",
66
- "@saas-ui/core": "3.0.0-next.11",
67
- "@saas-ui/chakra-preset": "3.0.0-next.2"
67
+ "@saas-ui/chakra-preset": "3.0.0-next.4"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@chakra-ui/react": "^3.27.0",