@szum-tech/design-system 1.6.2 → 1.7.1
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/Avatar-cea60385.d.ts +36 -0
- package/Button-b6aa5957.d.ts +50 -0
- package/ThemeProvider-8e6d7838.d.ts +22 -0
- package/chunk-35PGUWPE.js +29 -0
- package/chunk-5AJUIVQP.js +2 -0
- package/chunk-5SE7P5YG.mjs +6 -0
- package/chunk-7M2UD3MX.js +2 -0
- package/chunk-CRJI67D5.mjs +6 -0
- package/chunk-CUMOJXWX.mjs +7 -0
- package/chunk-JQ4UTWMH.js +2 -0
- package/chunk-LMETIM25.mjs +1 -0
- package/chunk-M6LWZWJB.js +8 -0
- package/chunk-MM2WP564.mjs +6 -0
- package/chunk-TAA4AMBN.mjs +1 -0
- package/chunk-UJM6RAIA.js +12 -0
- package/chunk-WPEQQQCR.mjs +1 -0
- package/chunk-X2QIG2W5.js +13 -0
- package/components/Avatar/index.d.ts +4 -37
- package/components/Avatar/index.js +3 -4
- package/components/Avatar/index.mjs +1 -6
- package/components/Button/index.d.ts +4 -48
- package/components/Button/index.js +2 -24
- package/components/Button/index.mjs +1 -7
- package/components/index.d.ts +5 -80
- package/components/index.js +16 -1
- package/components/index.mjs +3 -1
- package/contexts/index.d.ts +3 -27
- package/contexts/index.js +15 -1
- package/contexts/index.mjs +2 -1
- package/contexts/theme/index.d.ts +3 -27
- package/contexts/theme/index.js +9 -8
- package/contexts/theme/index.mjs +1 -6
- package/hooks/index.d.ts +3 -11
- package/hooks/index.js +13 -1
- package/hooks/index.mjs +4 -1
- package/hooks/useTheme/index.d.ts +3 -11
- package/hooks/useTheme/index.js +7 -6
- package/hooks/useTheme/index.mjs +3 -5
- package/index.d.ts +8 -107
- package/index.js +32 -1
- package/index.mjs +7 -1
- package/package.json +37 -28
- package/theme.types-a32f0702.d.ts +9 -0
- package/useTheme-01c9253b.d.ts +5 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
4
|
+
|
|
5
|
+
declare const avatarCva: (props?: ({
|
|
6
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
8
|
+
|
|
9
|
+
type AvatarCvaProps = VariantProps<typeof avatarCva>;
|
|
10
|
+
type AvatarSizeType = NonNullable<AvatarCvaProps["size"]>;
|
|
11
|
+
|
|
12
|
+
type AvatarProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
13
|
+
/**
|
|
14
|
+
* Defines avatar image alt
|
|
15
|
+
*/
|
|
16
|
+
alt?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Defines background color
|
|
19
|
+
*/
|
|
20
|
+
bg?: `bg-${string}` | `bg-${string}-${number}`;
|
|
21
|
+
/**
|
|
22
|
+
* Defines avatar children
|
|
23
|
+
*/
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Defines avatar size
|
|
27
|
+
*/
|
|
28
|
+
size?: AvatarSizeType;
|
|
29
|
+
/**
|
|
30
|
+
* Defines avatar image src
|
|
31
|
+
*/
|
|
32
|
+
src?: string;
|
|
33
|
+
};
|
|
34
|
+
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
35
|
+
|
|
36
|
+
export { Avatar as A, AvatarProps as a, AvatarSizeType as b };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
4
|
+
|
|
5
|
+
type AsProp<C extends React.ElementType> = {
|
|
6
|
+
/**
|
|
7
|
+
* Defines HTML tag to be used for component
|
|
8
|
+
*/
|
|
9
|
+
as?: C;
|
|
10
|
+
};
|
|
11
|
+
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
12
|
+
type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = Props & AsProp<C> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
13
|
+
|
|
14
|
+
declare const buttonCva: (props?: ({
|
|
15
|
+
color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined;
|
|
16
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
17
|
+
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
18
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
19
|
+
|
|
20
|
+
type ButtonCvaProps = VariantProps<typeof buttonCva>;
|
|
21
|
+
type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>;
|
|
22
|
+
type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>;
|
|
23
|
+
type ButtonColorType = NonNullable<ButtonCvaProps["color"]>;
|
|
24
|
+
|
|
25
|
+
type Props = {
|
|
26
|
+
/**
|
|
27
|
+
* Defines button color
|
|
28
|
+
*/
|
|
29
|
+
color?: ButtonColorType;
|
|
30
|
+
/**
|
|
31
|
+
* Defines button variant
|
|
32
|
+
*/
|
|
33
|
+
variant?: ButtonVariantType;
|
|
34
|
+
/**
|
|
35
|
+
* Defines button size
|
|
36
|
+
*/
|
|
37
|
+
size?: ButtonSizeType;
|
|
38
|
+
/**
|
|
39
|
+
* Defines button content
|
|
40
|
+
*/
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Disabled button
|
|
44
|
+
*/
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type ButtonProps<T extends React.ElementType> = PolymorphicComponentProp<T, Props>;
|
|
48
|
+
declare const Button: <T extends React.ElementType<any> = "button">(props: Props & AsProp<T> & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "as" | keyof Props> & React.RefAttributes<unknown>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
49
|
+
|
|
50
|
+
export { Button as B, ButtonProps as a, ButtonSizeType as b, ButtonVariantType as c, ButtonColorType as d };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { a as ThemeContextType, T as ThemeType } from './theme.types-a32f0702.js';
|
|
3
|
+
|
|
4
|
+
declare const ThemeContext: React__default.Context<ThemeContextType>;
|
|
5
|
+
|
|
6
|
+
interface ThemeProviderProps {
|
|
7
|
+
/**
|
|
8
|
+
* Children Components using theming.
|
|
9
|
+
*/
|
|
10
|
+
children?: React__default.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Define the default theme which is set at the beginning if neither local storage nor media is defined.
|
|
13
|
+
*/
|
|
14
|
+
defaultTheme?: ThemeType;
|
|
15
|
+
/**
|
|
16
|
+
* Define theme that is always set initially.
|
|
17
|
+
*/
|
|
18
|
+
theme?: ThemeType;
|
|
19
|
+
}
|
|
20
|
+
declare function ThemeProvider({ children, defaultTheme, theme }: ThemeProviderProps): JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { ThemeContext as T, ThemeProviderProps as a, ThemeProvider as b };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var r = require('react');
|
|
4
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var r__namespace = /*#__PURE__*/_interopNamespace(r);
|
|
26
|
+
|
|
27
|
+
var e=classVarianceAuthority.cva("border rounded font-sans font-medium leading-[1.75] tracking-[.02857em]",{variants:{color:{neutral:"",primary:"",success:"",warning:"",error:""},size:{sm:"py-1 px-2.5 text-[.8125rem]",md:"px-4 py-1.5 text-sm",lg:"px-5 py-2 text-[.9375rem]"},variant:{text:"border-transparent bg-transparent hover:text-white",outlined:"",contained:""}},compoundVariants:[{variant:"text",color:"neutral",class:["text-gray-400","hover:border-gray-400 hover:bg-gray-400","active:text-white active:border-gray-300 active:bg-gray-300","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-gray-400"]},{variant:"text",color:"primary",class:["text-primary-500","hover:border-primary-400 hover:bg-primary-400","active:text-white active:border-primary-600 active:bg-primary-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-primary-500"]},{variant:"text",color:"success",class:["text-success-500","hover:border-success-400 hover:bg-success-400","active:text-white active:border-success-600 active:bg-success-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-success-500"]},{variant:"text",color:"warning",class:["text-warning-500","hover:border-warning-400 hover:bg-warning-400","active:text-white active:border-warning-600 active:bg-warning-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-warning-500"]},{variant:"text",color:"error",class:["text-error-500","hover:border-error-400 hover:bg-error-400","active:text-white active:border-error-600 active:bg-error-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-error-500"]},{variant:"outlined",color:"neutral",class:["text-gray-400 border-gray-400 bg-transparent","hover:bg-gray-500 hover:text-white","active:text-white active:bg-gray-300","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-gray-400"]},{variant:"outlined",color:"primary",class:["text-primary-500 border-primary-500 bg-transparent","hover:bg-primary-400 hover:text-white","active:text-white active:bg-primary-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-primary-500"]},{variant:"outlined",color:"success",class:["text-success-500 border-success-500 bg-transparent","hover:bg-success-400 hover:text-white","active:text-white active:bg-success-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-success-500"]},{variant:"outlined",color:"warning",class:["text-warning-500 border-warning-500 bg-transparent","hover:bg-warning-400 hover:text-white","active:text-white active:bg-warning-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-warning-500"]},{variant:"outlined",color:"error",class:["text-error-500 border-error-500 bg-transparent","hover:bg-error-400 hover:text-white","active:text-white active:bg-error-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-error-500"]}]});var p=r__namespace.forwardRef(function({as:t,color:a="primary",children:o,size:i="md",variant:s="text",disabled:g=!1,...n},d){let c=t||"button",l=e({size:i,variant:s,color:a});return jsxRuntime.jsx(c,{className:l,ref:d,...n,children:o})}),v=p;
|
|
28
|
+
|
|
29
|
+
exports.a = v;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import a from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
var n=a.createContext({});function T(t){if(typeof window<"u"&&window.localStorage){let e=window.localStorage.getItem("theme");if(e==="dark"||!e&&window.matchMedia("(prefers-color-scheme: dark)").matches)return "dark"}return t??"light"}function u({children:t,defaultTheme:e,theme:r}){let[o,i]=a.useState(r||T(e));function d(m){typeof window<"u"&&window.localStorage&&(m==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",m));}return a.useEffect(()=>{d(o);},[o]),jsx(n.Provider,{value:{theme:o,setTheme:i},children:t})}
|
|
5
|
+
|
|
6
|
+
export { n as a, u as b };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as r from 'react';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var e=cva("border rounded font-sans font-medium leading-[1.75] tracking-[.02857em]",{variants:{color:{neutral:"",primary:"",success:"",warning:"",error:""},size:{sm:"py-1 px-2.5 text-[.8125rem]",md:"px-4 py-1.5 text-sm",lg:"px-5 py-2 text-[.9375rem]"},variant:{text:"border-transparent bg-transparent hover:text-white",outlined:"",contained:""}},compoundVariants:[{variant:"text",color:"neutral",class:["text-gray-400","hover:border-gray-400 hover:bg-gray-400","active:text-white active:border-gray-300 active:bg-gray-300","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-gray-400"]},{variant:"text",color:"primary",class:["text-primary-500","hover:border-primary-400 hover:bg-primary-400","active:text-white active:border-primary-600 active:bg-primary-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-primary-500"]},{variant:"text",color:"success",class:["text-success-500","hover:border-success-400 hover:bg-success-400","active:text-white active:border-success-600 active:bg-success-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-success-500"]},{variant:"text",color:"warning",class:["text-warning-500","hover:border-warning-400 hover:bg-warning-400","active:text-white active:border-warning-600 active:bg-warning-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-warning-500"]},{variant:"text",color:"error",class:["text-error-500","hover:border-error-400 hover:bg-error-400","active:text-white active:border-error-600 active:bg-error-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-error-500"]},{variant:"outlined",color:"neutral",class:["text-gray-400 border-gray-400 bg-transparent","hover:bg-gray-500 hover:text-white","active:text-white active:bg-gray-300","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-gray-400"]},{variant:"outlined",color:"primary",class:["text-primary-500 border-primary-500 bg-transparent","hover:bg-primary-400 hover:text-white","active:text-white active:bg-primary-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-primary-500"]},{variant:"outlined",color:"success",class:["text-success-500 border-success-500 bg-transparent","hover:bg-success-400 hover:text-white","active:text-white active:bg-success-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-success-500"]},{variant:"outlined",color:"warning",class:["text-warning-500 border-warning-500 bg-transparent","hover:bg-warning-400 hover:text-white","active:text-white active:bg-warning-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-warning-500"]},{variant:"outlined",color:"error",class:["text-error-500 border-error-500 bg-transparent","hover:bg-error-400 hover:text-white","active:text-white active:bg-error-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-error-500"]}]});var p=r.forwardRef(function({as:t,color:a="primary",children:o,size:i="md",variant:s="text",disabled:g=!1,...n},d){let c=t||"button",l=e({size:i,variant:s,color:a});return jsx(c,{className:l,ref:d,...n,children:o})}),v=p;
|
|
6
|
+
|
|
7
|
+
export { v as a };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
var e=classVarianceAuthority.cva("select-none rounded font-semibold leading-none justify-center flex items-center bg-gray-500 text-white dark:text-black",{variants:{size:{sm:"h-6 w-6 text-lg",md:"h-10 w-10 text-xl",lg:"h-14 w-14 text-2xl"}},defaultVariants:{size:"md"}});function r({alt:o,bg:s,children:i,size:n="md",src:t,...l}){let m=e({size:n,className:s});return jsxRuntime.jsx("div",{className:m,...l,children:t?jsxRuntime.jsx("img",{className:"h-full w-full rounded object-cover object-center",alt:o,src:t}):i})}
|
|
7
|
+
|
|
8
|
+
exports.a = r;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
var e=cva("select-none rounded font-semibold leading-none justify-center flex items-center bg-gray-500 text-white dark:text-black",{variants:{size:{sm:"h-6 w-6 text-lg",md:"h-10 w-10 text-xl",lg:"h-14 w-14 text-2xl"}},defaultVariants:{size:"md"}});function r({alt:o,bg:s,children:i,size:n="md",src:t,...l}){let m=e({size:n,className:s});return jsx("div",{className:m,...l,children:t?jsx("img",{className:"h-full w-full rounded object-cover object-center",alt:o,src:t}):i})}
|
|
5
|
+
|
|
6
|
+
export { r as a };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkX2QIG2W5_js = require('./chunk-X2QIG2W5.js');
|
|
4
|
+
var t = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var t__default = /*#__PURE__*/_interopDefault(t);
|
|
9
|
+
|
|
10
|
+
var r=()=>t__default.default.useContext(chunkX2QIG2W5_js.a);
|
|
11
|
+
|
|
12
|
+
exports.a = r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var a = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var a__default = /*#__PURE__*/_interopDefault(a);
|
|
9
|
+
|
|
10
|
+
var n=a__default.default.createContext({});function T(t){if(typeof window<"u"&&window.localStorage){let e=window.localStorage.getItem("theme");if(e==="dark"||!e&&window.matchMedia("(prefers-color-scheme: dark)").matches)return "dark"}return t??"light"}function u({children:t,defaultTheme:e,theme:r}){let[o,i]=a__default.default.useState(r||T(e));function d(m){typeof window<"u"&&window.localStorage&&(m==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",m));}return a__default.default.useEffect(()=>{d(o);},[o]),jsxRuntime.jsx(n.Provider,{value:{theme:o,setTheme:i},children:t})}
|
|
11
|
+
|
|
12
|
+
exports.a = n;
|
|
13
|
+
exports.b = u;
|
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
declare const avatarCva: (props?: ({
|
|
6
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
8
|
-
|
|
9
|
-
type AvatarCvaProps = VariantProps<typeof avatarCva>;
|
|
10
|
-
type AvatarSizeType = NonNullable<AvatarCvaProps["size"]>;
|
|
11
|
-
|
|
12
|
-
type AvatarProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
13
|
-
/**
|
|
14
|
-
* Defines avatar image alt
|
|
15
|
-
*/
|
|
16
|
-
alt?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Defines background color
|
|
19
|
-
*/
|
|
20
|
-
bg?: `bg-${string}` | `bg-${string}-${number}`;
|
|
21
|
-
/**
|
|
22
|
-
* Defines avatar size
|
|
23
|
-
* @default 'md'
|
|
24
|
-
*/
|
|
25
|
-
size?: AvatarSizeType;
|
|
26
|
-
/**
|
|
27
|
-
* Defines avatar image src
|
|
28
|
-
*/
|
|
29
|
-
src?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Defines avatar children
|
|
32
|
-
*/
|
|
33
|
-
children?: React.ReactNode;
|
|
34
|
-
};
|
|
35
|
-
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
36
|
-
|
|
37
|
-
export { AvatarProps, AvatarSizeType, Avatar as default };
|
|
1
|
+
export { a as AvatarProps, b as AvatarSizeType, A as default } from '../../Avatar-cea60385.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'class-variance-authority';
|
|
4
|
+
import 'class-variance-authority/dist/types';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
3
|
+
var chunkM6LWZWJB_js = require('../../chunk-M6LWZWJB.js');
|
|
5
4
|
|
|
6
|
-
var e=classVarianceAuthority.cva("select-none rounded font-semibold leading-none justify-center flex items-center bg-gray-500 text-white dark:text-black",{variants:{size:{sm:"h-6 w-6 text-lg",md:"h-10 w-10 text-xl",lg:"h-14 w-14 text-2xl"}},defaultVariants:{size:"md"}});function r({alt:o,bg:s,children:i,size:n="md",src:t,...l}){let m=e({size:n,className:s});return jsxRuntime.jsx("div",{className:m,...l,children:t?jsxRuntime.jsx("img",{className:"h-full w-full rounded object-cover object-center",alt:o,src:t}):i})}
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
module.exports = chunkM6LWZWJB_js.a;
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
var e=cva("select-none rounded font-semibold leading-none justify-center flex items-center bg-gray-500 text-white dark:text-black",{variants:{size:{sm:"h-6 w-6 text-lg",md:"h-10 w-10 text-xl",lg:"h-14 w-14 text-2xl"}},defaultVariants:{size:"md"}});function r({alt:o,bg:s,children:i,size:n="md",src:t,...l}){let m=e({size:n,className:s});return jsx("div",{className:m,...l,children:t?jsx("img",{className:"h-full w-full rounded object-cover object-center",alt:o,src:t}):i})}
|
|
5
|
-
|
|
6
|
-
export { r as default };
|
|
1
|
+
export { a as default } from '../../chunk-MM2WP564.mjs';
|
|
@@ -1,48 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
declare const buttonCva: (props?: ({
|
|
6
|
-
color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined;
|
|
7
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
8
|
-
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
9
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
10
|
-
|
|
11
|
-
type ButtonCvaProps = VariantProps<typeof buttonCva>;
|
|
12
|
-
type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>;
|
|
13
|
-
type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>;
|
|
14
|
-
type ButtonColorType = NonNullable<ButtonCvaProps["color"]>;
|
|
15
|
-
|
|
16
|
-
type AsProp<C extends React.ElementType> = {
|
|
17
|
-
/**
|
|
18
|
-
* Defines HTML tag to be used for component
|
|
19
|
-
*/
|
|
20
|
-
as?: C;
|
|
21
|
-
};
|
|
22
|
-
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
23
|
-
type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = Props & AsProp<C> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
24
|
-
|
|
25
|
-
type ButtonProp = {
|
|
26
|
-
/**
|
|
27
|
-
* Defines button color
|
|
28
|
-
* @default 'primary'
|
|
29
|
-
*/
|
|
30
|
-
color?: ButtonColorType;
|
|
31
|
-
/**
|
|
32
|
-
* Defines button variant
|
|
33
|
-
* @default 'text'
|
|
34
|
-
*/
|
|
35
|
-
variant?: ButtonVariantType;
|
|
36
|
-
/**
|
|
37
|
-
* Defines button size
|
|
38
|
-
* @default 'md'
|
|
39
|
-
*/
|
|
40
|
-
size?: ButtonSizeType;
|
|
41
|
-
/**
|
|
42
|
-
* Defines avatar children
|
|
43
|
-
*/
|
|
44
|
-
children?: React.ReactNode;
|
|
45
|
-
};
|
|
46
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<PolymorphicComponentProp<React.ElementType<any>, ButtonProp>, "ref"> & React.RefAttributes<unknown>>;
|
|
47
|
-
|
|
48
|
-
export { _default as default };
|
|
1
|
+
export { d as ButtonColorType, a as ButtonProps, b as ButtonSizeType, c as ButtonVariantType, B as default } from '../../Button-b6aa5957.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import 'class-variance-authority';
|
|
4
|
+
import 'class-variance-authority/dist/types';
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
3
|
+
var chunk35PGUWPE_js = require('../../chunk-35PGUWPE.js');
|
|
6
4
|
|
|
7
|
-
function _interopNamespace(e) {
|
|
8
|
-
if (e && e.__esModule) return e;
|
|
9
|
-
var n = Object.create(null);
|
|
10
|
-
if (e) {
|
|
11
|
-
Object.keys(e).forEach(function (k) {
|
|
12
|
-
if (k !== 'default') {
|
|
13
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () { return e[k]; }
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
n.default = e;
|
|
22
|
-
return Object.freeze(n);
|
|
23
|
-
}
|
|
24
5
|
|
|
25
|
-
var e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
26
6
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
module.exports = v;
|
|
7
|
+
module.exports = chunk35PGUWPE_js.a;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var r=cva("border rounded font-sans font-medium leading-[1.75] tracking-[.02857em]",{variants:{color:{neutral:"",primary:"",success:"",warning:"",error:""},size:{sm:"py-1 px-2.5 text-[.8125rem]",md:"px-4 py-1.5 text-sm",lg:"px-5 py-2 text-[.9375rem]"},variant:{text:"border-transparent bg-transparent hover:text-white",outlined:"",contained:""}},compoundVariants:[{variant:"text",color:"neutral",class:["text-gray-400","hover:border-gray-400 hover:bg-gray-400","active:text-white active:border-gray-300 active:bg-gray-300","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-gray-400"]},{variant:"text",color:"primary",class:["text-primary-500","hover:border-primary-400 hover:bg-primary-400","active:text-white active:border-primary-600 active:bg-primary-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-primary-500"]},{variant:"text",color:"success",class:["text-success-500","hover:border-success-400 hover:bg-success-400","active:text-white active:border-success-600 active:bg-success-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-success-500"]},{variant:"text",color:"warning",class:["text-warning-500","hover:border-warning-400 hover:bg-warning-400","active:text-white active:border-warning-600 active:bg-warning-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-warning-500"]},{variant:"text",color:"error",class:["text-error-500","hover:border-error-400 hover:bg-error-400","active:text-white active:border-error-600 active:bg-error-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-transparent disabled:hover:bg-transparent disabled:hover:text-error-500"]},{variant:"outlined",color:"neutral",class:["text-gray-400 border-gray-400 bg-transparent","hover:bg-gray-500 hover:text-white","active:text-white active:bg-gray-300","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-gray-400"]},{variant:"outlined",color:"primary",class:["text-primary-500 border-primary-500 bg-transparent","hover:bg-primary-400 hover:text-white","active:text-white active:bg-primary-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-primary-500"]},{variant:"outlined",color:"success",class:["text-success-500 border-success-500 bg-transparent","hover:bg-success-400 hover:text-white","active:text-white active:bg-success-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-success-500"]},{variant:"outlined",color:"warning",class:["text-warning-500 border-warning-500 bg-transparent","hover:bg-warning-400 hover:text-white","active:text-white active:bg-warning-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-warning-500"]},{variant:"outlined",color:"error",class:["text-error-500 border-error-500 bg-transparent","hover:bg-error-400 hover:text-white","active:text-white active:bg-error-600","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-error-500"]}]});var v=e.forwardRef(function({as:t,color:a="primary",children:o,size:i="md",variant:s="text",...n},d){let c=t||"button",l=r({size:i,variant:s,color:a});return jsx(c,{className:l,ref:d,...n,children:o})});
|
|
6
|
-
|
|
7
|
-
export { v as default };
|
|
1
|
+
export { a as default } from '../../chunk-CUMOJXWX.mjs';
|
package/components/index.d.ts
CHANGED
|
@@ -1,80 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
7
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
8
|
-
|
|
9
|
-
type AvatarCvaProps = VariantProps<typeof avatarCva>;
|
|
10
|
-
type AvatarSizeType = NonNullable<AvatarCvaProps["size"]>;
|
|
11
|
-
|
|
12
|
-
type AvatarProps = React.ComponentPropsWithoutRef<"div"> & {
|
|
13
|
-
/**
|
|
14
|
-
* Defines avatar image alt
|
|
15
|
-
*/
|
|
16
|
-
alt?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Defines background color
|
|
19
|
-
*/
|
|
20
|
-
bg?: `bg-${string}` | `bg-${string}-${number}`;
|
|
21
|
-
/**
|
|
22
|
-
* Defines avatar size
|
|
23
|
-
* @default 'md'
|
|
24
|
-
*/
|
|
25
|
-
size?: AvatarSizeType;
|
|
26
|
-
/**
|
|
27
|
-
* Defines avatar image src
|
|
28
|
-
*/
|
|
29
|
-
src?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Defines avatar children
|
|
32
|
-
*/
|
|
33
|
-
children?: React.ReactNode;
|
|
34
|
-
};
|
|
35
|
-
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
36
|
-
|
|
37
|
-
declare const buttonCva: (props?: ({
|
|
38
|
-
color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined;
|
|
39
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
40
|
-
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
41
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
42
|
-
|
|
43
|
-
type ButtonCvaProps = VariantProps<typeof buttonCva>;
|
|
44
|
-
type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>;
|
|
45
|
-
type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>;
|
|
46
|
-
type ButtonColorType = NonNullable<ButtonCvaProps["color"]>;
|
|
47
|
-
|
|
48
|
-
type AsProp<C extends React.ElementType> = {
|
|
49
|
-
/**
|
|
50
|
-
* Defines HTML tag to be used for component
|
|
51
|
-
*/
|
|
52
|
-
as?: C;
|
|
53
|
-
};
|
|
54
|
-
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
55
|
-
type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = Props & AsProp<C> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
56
|
-
|
|
57
|
-
type ButtonProp = {
|
|
58
|
-
/**
|
|
59
|
-
* Defines button color
|
|
60
|
-
* @default 'primary'
|
|
61
|
-
*/
|
|
62
|
-
color?: ButtonColorType;
|
|
63
|
-
/**
|
|
64
|
-
* Defines button variant
|
|
65
|
-
* @default 'text'
|
|
66
|
-
*/
|
|
67
|
-
variant?: ButtonVariantType;
|
|
68
|
-
/**
|
|
69
|
-
* Defines button size
|
|
70
|
-
* @default 'md'
|
|
71
|
-
*/
|
|
72
|
-
size?: ButtonSizeType;
|
|
73
|
-
/**
|
|
74
|
-
* Defines avatar children
|
|
75
|
-
*/
|
|
76
|
-
children?: React.ReactNode;
|
|
77
|
-
};
|
|
78
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<PolymorphicComponentProp<React.ElementType<any>, ButtonProp>, "ref"> & React.RefAttributes<unknown>>;
|
|
79
|
-
|
|
80
|
-
export { Avatar, AvatarProps, AvatarSizeType, _default as Button };
|
|
1
|
+
export { A as Avatar, a as AvatarProps, b as AvatarSizeType } from '../Avatar-cea60385.js';
|
|
2
|
+
export { B as Button, d as ButtonColorType, a as ButtonProps, b as ButtonSizeType, c as ButtonVariantType } from '../Button-b6aa5957.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'class-variance-authority';
|
|
5
|
+
import 'class-variance-authority/dist/types';
|
package/components/index.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-5AJUIVQP.js');
|
|
4
|
+
var chunkM6LWZWJB_js = require('../chunk-M6LWZWJB.js');
|
|
5
|
+
var chunk35PGUWPE_js = require('../chunk-35PGUWPE.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'Avatar', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkM6LWZWJB_js.a; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, 'Button', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunk35PGUWPE_js.a; }
|
|
16
|
+
});
|
package/components/index.mjs
CHANGED
package/contexts/index.d.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface ThemeContextType {
|
|
5
|
-
theme: ThemeType;
|
|
6
|
-
setTheme: React.Dispatch<React.SetStateAction<ThemeType>>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare const ThemeContext: React.Context<ThemeContextType>;
|
|
10
|
-
|
|
11
|
-
interface ThemeProviderProps {
|
|
12
|
-
/**
|
|
13
|
-
* Children Components using theming.
|
|
14
|
-
*/
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Define the default theme which is set at the beginning if neither local storage nor media is defined.
|
|
18
|
-
*/
|
|
19
|
-
defaultTheme?: ThemeType;
|
|
20
|
-
/**
|
|
21
|
-
* Define theme that is always set initially.
|
|
22
|
-
*/
|
|
23
|
-
theme?: ThemeType;
|
|
24
|
-
}
|
|
25
|
-
declare function ThemeProvider({ children, defaultTheme, theme }: ThemeProviderProps): JSX.Element;
|
|
26
|
-
|
|
27
|
-
export { ThemeContext, ThemeContextType, ThemeProvider, ThemeProviderProps, ThemeType };
|
|
1
|
+
export { T as ThemeContext, b as ThemeProvider, a as ThemeProviderProps } from '../ThemeProvider-8e6d7838.js';
|
|
2
|
+
export { a as ThemeContextType, T as ThemeType } from '../theme.types-a32f0702.js';
|
|
3
|
+
import 'react';
|
package/contexts/index.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-JQ4UTWMH.js');
|
|
4
|
+
var chunkX2QIG2W5_js = require('../chunk-X2QIG2W5.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, 'ThemeContext', {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkX2QIG2W5_js.a; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, 'ThemeProvider', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkX2QIG2W5_js.b; }
|
|
15
|
+
});
|
package/contexts/index.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import '../chunk-WPEQQQCR.mjs';
|
|
2
|
+
export { a as ThemeContext, b as ThemeProvider } from '../chunk-5SE7P5YG.mjs';
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface ThemeContextType {
|
|
5
|
-
theme: ThemeType;
|
|
6
|
-
setTheme: React.Dispatch<React.SetStateAction<ThemeType>>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare const ThemeContext: React.Context<ThemeContextType>;
|
|
10
|
-
|
|
11
|
-
interface ThemeProviderProps {
|
|
12
|
-
/**
|
|
13
|
-
* Children Components using theming.
|
|
14
|
-
*/
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Define the default theme which is set at the beginning if neither local storage nor media is defined.
|
|
18
|
-
*/
|
|
19
|
-
defaultTheme?: ThemeType;
|
|
20
|
-
/**
|
|
21
|
-
* Define theme that is always set initially.
|
|
22
|
-
*/
|
|
23
|
-
theme?: ThemeType;
|
|
24
|
-
}
|
|
25
|
-
declare function ThemeProvider({ children, defaultTheme, theme }: ThemeProviderProps): JSX.Element;
|
|
26
|
-
|
|
27
|
-
export { ThemeContext, ThemeContextType, ThemeProvider, ThemeProviderProps, ThemeType };
|
|
1
|
+
export { T as ThemeContext, b as ThemeProvider, a as ThemeProviderProps } from '../../ThemeProvider-8e6d7838.js';
|
|
2
|
+
export { a as ThemeContextType, T as ThemeType } from '../../theme.types-a32f0702.js';
|
|
3
|
+
import 'react';
|
package/contexts/theme/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
3
|
+
var chunkX2QIG2W5_js = require('../../chunk-X2QIG2W5.js');
|
|
5
4
|
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
5
|
|
|
8
|
-
var a__default = /*#__PURE__*/_interopDefault(a);
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
Object.defineProperty(exports, 'ThemeContext', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkX2QIG2W5_js.a; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, 'ThemeProvider', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkX2QIG2W5_js.b; }
|
|
14
|
+
});
|
package/contexts/theme/index.mjs
CHANGED
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
var n=a.createContext({});function T(t){if(typeof window<"u"&&window.localStorage){let e=window.localStorage.getItem("theme");if(e==="dark"||!e&&window.matchMedia("(prefers-color-scheme: dark)").matches)return "dark"}return t??"light"}function u({children:t,defaultTheme:e,theme:r}){let[o,i]=a.useState(r||T(e));function d(m){typeof window<"u"&&window.localStorage&&(m==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("theme",m));}return a.useEffect(()=>{d(o);},[o]),jsx(n.Provider,{value:{theme:o,setTheme:i},children:t})}
|
|
5
|
-
|
|
6
|
-
export { n as ThemeContext, u as ThemeProvider };
|
|
1
|
+
export { a as ThemeContext, b as ThemeProvider } from '../../chunk-5SE7P5YG.mjs';
|
package/hooks/index.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface ThemeContextType {
|
|
5
|
-
theme: ThemeType;
|
|
6
|
-
setTheme: React.Dispatch<React.SetStateAction<ThemeType>>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare const useTheme: () => ThemeContextType;
|
|
10
|
-
|
|
11
|
-
export { useTheme };
|
|
1
|
+
export { u as useTheme } from '../useTheme-01c9253b.js';
|
|
2
|
+
import '../theme.types-a32f0702.js';
|
|
3
|
+
import 'react';
|
package/hooks/index.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../chunk-7M2UD3MX.js');
|
|
4
|
+
var chunkUJM6RAIA_js = require('../chunk-UJM6RAIA.js');
|
|
5
|
+
require('../chunk-JQ4UTWMH.js');
|
|
6
|
+
require('../chunk-X2QIG2W5.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkUJM6RAIA_js.a; }
|
|
13
|
+
});
|
package/hooks/index.mjs
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface ThemeContextType {
|
|
5
|
-
theme: ThemeType;
|
|
6
|
-
setTheme: React.Dispatch<React.SetStateAction<ThemeType>>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare const useTheme: () => ThemeContextType;
|
|
10
|
-
|
|
11
|
-
export { useTheme };
|
|
1
|
+
export { u as useTheme } from '../../useTheme-01c9253b.js';
|
|
2
|
+
import '../../theme.types-a32f0702.js';
|
|
3
|
+
import 'react';
|
package/hooks/useTheme/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUJM6RAIA_js = require('../../chunk-UJM6RAIA.js');
|
|
4
|
+
require('../../chunk-JQ4UTWMH.js');
|
|
5
|
+
require('../../chunk-X2QIG2W5.js');
|
|
4
6
|
|
|
5
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
7
|
|
|
7
|
-
var t__default = /*#__PURE__*/_interopDefault(t);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkUJM6RAIA_js.a; }
|
|
12
|
+
});
|
package/hooks/useTheme/index.mjs
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,107 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
* Defines avatar children
|
|
33
|
-
*/
|
|
34
|
-
children?: React.ReactNode;
|
|
35
|
-
};
|
|
36
|
-
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
37
|
-
|
|
38
|
-
declare const buttonCva: (props?: ({
|
|
39
|
-
color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined;
|
|
40
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
41
|
-
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
42
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
43
|
-
|
|
44
|
-
type ButtonCvaProps = VariantProps<typeof buttonCva>;
|
|
45
|
-
type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>;
|
|
46
|
-
type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>;
|
|
47
|
-
type ButtonColorType = NonNullable<ButtonCvaProps["color"]>;
|
|
48
|
-
|
|
49
|
-
type AsProp<C extends React.ElementType> = {
|
|
50
|
-
/**
|
|
51
|
-
* Defines HTML tag to be used for component
|
|
52
|
-
*/
|
|
53
|
-
as?: C;
|
|
54
|
-
};
|
|
55
|
-
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
56
|
-
type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = Props & AsProp<C> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
57
|
-
|
|
58
|
-
type ButtonProp = {
|
|
59
|
-
/**
|
|
60
|
-
* Defines button color
|
|
61
|
-
* @default 'primary'
|
|
62
|
-
*/
|
|
63
|
-
color?: ButtonColorType;
|
|
64
|
-
/**
|
|
65
|
-
* Defines button variant
|
|
66
|
-
* @default 'text'
|
|
67
|
-
*/
|
|
68
|
-
variant?: ButtonVariantType;
|
|
69
|
-
/**
|
|
70
|
-
* Defines button size
|
|
71
|
-
* @default 'md'
|
|
72
|
-
*/
|
|
73
|
-
size?: ButtonSizeType;
|
|
74
|
-
/**
|
|
75
|
-
* Defines avatar children
|
|
76
|
-
*/
|
|
77
|
-
children?: React.ReactNode;
|
|
78
|
-
};
|
|
79
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<PolymorphicComponentProp<React.ElementType<any>, ButtonProp>, "ref"> & React.RefAttributes<unknown>>;
|
|
80
|
-
|
|
81
|
-
type ThemeType = "light" | "dark";
|
|
82
|
-
interface ThemeContextType {
|
|
83
|
-
theme: ThemeType;
|
|
84
|
-
setTheme: React__default.Dispatch<React__default.SetStateAction<ThemeType>>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
declare const ThemeContext: React__default.Context<ThemeContextType>;
|
|
88
|
-
|
|
89
|
-
interface ThemeProviderProps {
|
|
90
|
-
/**
|
|
91
|
-
* Children Components using theming.
|
|
92
|
-
*/
|
|
93
|
-
children?: React__default.ReactNode;
|
|
94
|
-
/**
|
|
95
|
-
* Define the default theme which is set at the beginning if neither local storage nor media is defined.
|
|
96
|
-
*/
|
|
97
|
-
defaultTheme?: ThemeType;
|
|
98
|
-
/**
|
|
99
|
-
* Define theme that is always set initially.
|
|
100
|
-
*/
|
|
101
|
-
theme?: ThemeType;
|
|
102
|
-
}
|
|
103
|
-
declare function ThemeProvider({ children, defaultTheme, theme }: ThemeProviderProps): JSX.Element;
|
|
104
|
-
|
|
105
|
-
declare const useTheme: () => ThemeContextType;
|
|
106
|
-
|
|
107
|
-
export { Avatar, AvatarProps, AvatarSizeType, _default as Button, ThemeContext, ThemeContextType, ThemeProvider, ThemeProviderProps, ThemeType, useTheme };
|
|
1
|
+
export { A as Avatar, a as AvatarProps, b as AvatarSizeType } from './Avatar-cea60385.js';
|
|
2
|
+
export { B as Button, d as ButtonColorType, a as ButtonProps, b as ButtonSizeType, c as ButtonVariantType } from './Button-b6aa5957.js';
|
|
3
|
+
export { u as useTheme } from './useTheme-01c9253b.js';
|
|
4
|
+
export { T as ThemeContext, b as ThemeProvider, a as ThemeProviderProps } from './ThemeProvider-8e6d7838.js';
|
|
5
|
+
export { a as ThemeContextType, T as ThemeType } from './theme.types-a32f0702.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import 'class-variance-authority';
|
|
8
|
+
import 'class-variance-authority/dist/types';
|
package/index.js
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('./chunk-5AJUIVQP.js');
|
|
4
|
+
var chunkM6LWZWJB_js = require('./chunk-M6LWZWJB.js');
|
|
5
|
+
var chunk35PGUWPE_js = require('./chunk-35PGUWPE.js');
|
|
6
|
+
require('./chunk-7M2UD3MX.js');
|
|
7
|
+
var chunkUJM6RAIA_js = require('./chunk-UJM6RAIA.js');
|
|
8
|
+
require('./chunk-JQ4UTWMH.js');
|
|
9
|
+
var chunkX2QIG2W5_js = require('./chunk-X2QIG2W5.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(exports, 'Avatar', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkM6LWZWJB_js.a; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, 'Button', {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunk35PGUWPE_js.a; }
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, 'useTheme', {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return chunkUJM6RAIA_js.a; }
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(exports, 'ThemeContext', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return chunkX2QIG2W5_js.a; }
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, 'ThemeProvider', {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return chunkX2QIG2W5_js.b; }
|
|
32
|
+
});
|
package/index.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import './chunk-LMETIM25.mjs';
|
|
2
|
+
export { a as Avatar } from './chunk-MM2WP564.mjs';
|
|
3
|
+
export { a as Button } from './chunk-CUMOJXWX.mjs';
|
|
4
|
+
import './chunk-TAA4AMBN.mjs';
|
|
5
|
+
export { a as useTheme } from './chunk-CRJI67D5.mjs';
|
|
6
|
+
import './chunk-WPEQQQCR.mjs';
|
|
7
|
+
export { a as ThemeContext, b as ThemeProvider } from './chunk-5SE7P5YG.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@szum-tech/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Szum-Tech design system with tailwindcss support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"szum-tech",
|
|
@@ -31,16 +31,20 @@
|
|
|
31
31
|
"types": "./index.d.ts",
|
|
32
32
|
"files": [
|
|
33
33
|
"index.*",
|
|
34
|
+
"*.d.ts",
|
|
35
|
+
"chunk-*.mjs",
|
|
36
|
+
"chunk-*.js",
|
|
34
37
|
"components/**",
|
|
35
38
|
"hooks/**",
|
|
36
39
|
"contexts/**",
|
|
37
40
|
"theme/**"
|
|
38
41
|
],
|
|
39
42
|
"scripts": {
|
|
40
|
-
"build": "tsup && cpy './src/theme/global.css' './theme' --flat",
|
|
41
|
-
"clean": "rm -rf node_modules && yarn clear:build",
|
|
42
|
-
"
|
|
43
|
-
"dev": "
|
|
43
|
+
"build": "env NODE_ENV=production tsup && cpy './src/theme/global.css' './theme' --flat",
|
|
44
|
+
"clean": "rm -rf node_modules && yarn clear:build && yarn clean:build:dev",
|
|
45
|
+
"clean:build": "rm -rf components && rm -rf contexts && rm -rf hooks && rm -rf theme && rm -rf index.* && rm -rf chunk-*.js && rm -rf chunk-*.mjs && rm -rf *.d.ts",
|
|
46
|
+
"clean:build:dev": "rm -rf dist",
|
|
47
|
+
"dev": "concurrently \"yarn dev:css\" \"yarn dev:build\"",
|
|
44
48
|
"dev:build": "tsup",
|
|
45
49
|
"dev:css": "tailwindcss -w -i src/theme/global.css -o src/styles/default.css",
|
|
46
50
|
"prettier:check": "prettier --check .",
|
|
@@ -54,53 +58,58 @@
|
|
|
54
58
|
},
|
|
55
59
|
"dependencies": {
|
|
56
60
|
"@tailwindcss/container-queries": "^0.1.0",
|
|
57
|
-
"class-variance-authority": "^0.5.
|
|
61
|
+
"class-variance-authority": "^0.5.2",
|
|
58
62
|
"tailwind-scrollbar": "^3.0.0"
|
|
59
63
|
},
|
|
60
64
|
"devDependencies": {
|
|
61
65
|
"@babel/core": "^7.21.4",
|
|
62
66
|
"@heroicons/react": "^2.0.17",
|
|
63
|
-
"@storybook/addon-a11y": "^7.0.
|
|
64
|
-
"@storybook/addon-actions": "^7.0.
|
|
65
|
-
"@storybook/addon-docs": "^7.0.
|
|
66
|
-
"@storybook/addon-essentials": "^7.0.
|
|
67
|
-
"@storybook/addon-interactions": "^7.0.
|
|
68
|
-
"@storybook/addon-links": "^7.0.
|
|
69
|
-
"@storybook/addon-mdx-gfm": "^7.0.
|
|
70
|
-
"@storybook/addons": "^7.0.
|
|
71
|
-
"@storybook/
|
|
72
|
-
"@storybook/core-
|
|
73
|
-
"@storybook/
|
|
74
|
-
"@storybook/
|
|
75
|
-
"@storybook/
|
|
67
|
+
"@storybook/addon-a11y": "^7.0.6",
|
|
68
|
+
"@storybook/addon-actions": "^7.0.6",
|
|
69
|
+
"@storybook/addon-docs": "^7.0.6",
|
|
70
|
+
"@storybook/addon-essentials": "^7.0.6",
|
|
71
|
+
"@storybook/addon-interactions": "^7.0.6",
|
|
72
|
+
"@storybook/addon-links": "^7.0.6",
|
|
73
|
+
"@storybook/addon-mdx-gfm": "^7.0.6",
|
|
74
|
+
"@storybook/addons": "^7.0.6",
|
|
75
|
+
"@storybook/components": "^7.0.6",
|
|
76
|
+
"@storybook/core-common": "^7.0.6",
|
|
77
|
+
"@storybook/core-events": "^7.0.6",
|
|
78
|
+
"@storybook/manager-api": "^7.0.6",
|
|
79
|
+
"@storybook/preview-api": "^7.0.6",
|
|
80
|
+
"@storybook/react": "^7.0.6",
|
|
81
|
+
"@storybook/react-vite": "^7.0.6",
|
|
82
|
+
"@storybook/theming": "^7.0.6",
|
|
76
83
|
"@szum-tech/prettier-config": "^1.2.0",
|
|
77
84
|
"@szum-tech/semantic-release-preset": "^1.5.0",
|
|
85
|
+
"@testing-library/dom": "^9.2.0",
|
|
86
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
78
87
|
"@testing-library/react": "^14.0.0",
|
|
79
88
|
"@testing-library/user-event": "^14.4.3",
|
|
80
|
-
"@types/react": "^18.0.
|
|
89
|
+
"@types/react": "^18.0.38",
|
|
81
90
|
"@types/react-dom": "^18.0.11",
|
|
82
91
|
"@types/semantic-release": "^20.0.1",
|
|
83
|
-
"@vitejs/plugin-react": "^
|
|
92
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
84
93
|
"autoprefixer": "^10.4.14",
|
|
85
94
|
"babel-loader": "^9.1.2",
|
|
86
95
|
"concurrently": "^8.0.1",
|
|
87
96
|
"cpy-cli": "^4.2.0",
|
|
88
|
-
"postcss": "^8.4.
|
|
89
|
-
"prettier": "^2.8.
|
|
90
|
-
"prettier-plugin-tailwindcss": "^0.2.
|
|
97
|
+
"postcss": "^8.4.23",
|
|
98
|
+
"prettier": "^2.8.8",
|
|
99
|
+
"prettier-plugin-tailwindcss": "^0.2.7",
|
|
91
100
|
"react": "^18.2.0",
|
|
92
101
|
"react-docgen": "^5.4.3",
|
|
93
102
|
"react-docgen-typescript": "^2.2.2",
|
|
94
103
|
"react-dom": "^18.2.0",
|
|
95
104
|
"semantic-release": "^21.0.1",
|
|
96
105
|
"serve": "^14.2.0",
|
|
97
|
-
"storybook": "^7.0.
|
|
98
|
-
"storybook-addon-pseudo-states": "^2.0.
|
|
106
|
+
"storybook": "^7.0.6",
|
|
107
|
+
"storybook-addon-pseudo-states": "^2.0.1",
|
|
99
108
|
"storybook-addon-themes": "^6.1.0",
|
|
100
109
|
"tailwindcss": "^3.3.1",
|
|
101
110
|
"tsup": "^6.7.0",
|
|
102
|
-
"typescript": "^5.0.
|
|
103
|
-
"vite": "^4.
|
|
111
|
+
"typescript": "^5.0.4",
|
|
112
|
+
"vite": "^4.3.1"
|
|
104
113
|
},
|
|
105
114
|
"peerDependencies": {
|
|
106
115
|
"react": "^18.2.0",
|