@szum-tech/design-system 1.5.1 → 1.5.2
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/index.d.ts +99 -0
- package/index.js +26 -0
- package/index.mjs +3 -0
- package/package.json +2 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
|
|
6
|
+
declare const avatarCva: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
8
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
9
|
+
|
|
10
|
+
type AvatarCvaProps = VariantProps<typeof avatarCva>;
|
|
11
|
+
type AvatarSizeType = NonNullable<AvatarCvaProps["size"]>;
|
|
12
|
+
|
|
13
|
+
type AvatarProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
14
|
+
/**
|
|
15
|
+
* Defines avatar image alt
|
|
16
|
+
*/
|
|
17
|
+
alt?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Defines background color
|
|
20
|
+
*/
|
|
21
|
+
bg?: `bg-${string}` | `bg-${string}-${number}`;
|
|
22
|
+
/**
|
|
23
|
+
* Defines avatar size
|
|
24
|
+
* @default 'md'
|
|
25
|
+
*/
|
|
26
|
+
size?: AvatarSizeType;
|
|
27
|
+
/**
|
|
28
|
+
* Defines avatar image src
|
|
29
|
+
*/
|
|
30
|
+
src?: string;
|
|
31
|
+
};
|
|
32
|
+
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
33
|
+
|
|
34
|
+
declare const buttonCva: (props?: ({
|
|
35
|
+
color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined;
|
|
36
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
37
|
+
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
38
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
39
|
+
|
|
40
|
+
type ButtonCvaProps = VariantProps<typeof buttonCva>;
|
|
41
|
+
type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>;
|
|
42
|
+
type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>;
|
|
43
|
+
type ButtonColorType = NonNullable<ButtonCvaProps["color"]>;
|
|
44
|
+
|
|
45
|
+
type AsProp<C extends React.ElementType> = {
|
|
46
|
+
/**
|
|
47
|
+
* Defines HTML tag to be used for component
|
|
48
|
+
*/
|
|
49
|
+
as?: C;
|
|
50
|
+
};
|
|
51
|
+
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
52
|
+
type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = React.PropsWithChildren<Props & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
53
|
+
|
|
54
|
+
type ButtonProp = {
|
|
55
|
+
/**
|
|
56
|
+
* Defines button color
|
|
57
|
+
* @default 'primary'
|
|
58
|
+
*/
|
|
59
|
+
color?: ButtonColorType;
|
|
60
|
+
/**
|
|
61
|
+
* Defines button variant
|
|
62
|
+
* @default 'text'
|
|
63
|
+
*/
|
|
64
|
+
variant?: ButtonVariantType;
|
|
65
|
+
/**
|
|
66
|
+
* Defines button size
|
|
67
|
+
* @default 'md'
|
|
68
|
+
*/
|
|
69
|
+
size?: ButtonSizeType;
|
|
70
|
+
};
|
|
71
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<PolymorphicComponentProp<React.ElementType<any>, ButtonProp>, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
72
|
+
|
|
73
|
+
type ThemeType = "light" | "dark";
|
|
74
|
+
interface ThemeContextType {
|
|
75
|
+
theme: ThemeType;
|
|
76
|
+
setTheme: React__default.Dispatch<React__default.SetStateAction<ThemeType>>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare const ThemeContext: React__default.Context<ThemeContextType>;
|
|
80
|
+
|
|
81
|
+
interface ThemeProviderProps {
|
|
82
|
+
/**
|
|
83
|
+
* Children Components using theming.
|
|
84
|
+
*/
|
|
85
|
+
children?: React__default.ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* Define the default theme which is set at the beginning if neither local storage nor media is defined.
|
|
88
|
+
*/
|
|
89
|
+
defaultTheme?: ThemeType;
|
|
90
|
+
/**
|
|
91
|
+
* Define theme that is always set initially.
|
|
92
|
+
*/
|
|
93
|
+
theme?: ThemeType;
|
|
94
|
+
}
|
|
95
|
+
declare function ThemeProvider({ children, defaultTheme, theme }: ThemeProviderProps): JSX.Element;
|
|
96
|
+
|
|
97
|
+
declare const useTheme: () => ThemeContextType;
|
|
98
|
+
|
|
99
|
+
export { Avatar, AvatarProps, AvatarSizeType, _default as Button, ThemeContext, ThemeContextType, ThemeProvider, ThemeProviderProps, ThemeType, useTheme };
|
package/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./components/index');
|
|
4
|
+
var hooks = require('./hooks');
|
|
5
|
+
var contexts = require('./contexts');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.keys(index).forEach(function (k) {
|
|
10
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return index[k]; }
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
Object.keys(hooks).forEach(function (k) {
|
|
16
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return hooks[k]; }
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
Object.keys(contexts).forEach(function (k) {
|
|
22
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return contexts[k]; }
|
|
25
|
+
});
|
|
26
|
+
});
|
package/index.mjs
ADDED
package/package.json
CHANGED
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"vite": "^4.1.2"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
61
|
+
"index.*",
|
|
61
62
|
"components/**",
|
|
62
63
|
"hooks/**",
|
|
63
64
|
"contexts/**",
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
},
|
|
104
105
|
"sideEffects": false,
|
|
105
106
|
"types": "./index.d.ts",
|
|
106
|
-
"version": "1.5.
|
|
107
|
+
"version": "1.5.2",
|
|
107
108
|
"peerDependencies": {
|
|
108
109
|
"@tailwindcss/container-queries": "^0.1.0",
|
|
109
110
|
"react": "^18.2.0",
|