@szum-tech/design-system 1.6.1 → 1.7.0
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-e871ff4f.d.ts +37 -0
- package/Button-91229b6b.d.ts +48 -0
- package/README.md +1 -0
- package/ThemeProvider-8e6d7838.d.ts +22 -0
- package/chunk-4AKOYNNP.mjs +7 -0
- package/chunk-5SE7P5YG.mjs +6 -0
- package/chunk-7M2UD3MX.js +2 -0
- package/chunk-AWV2FK6N.mjs +6 -0
- package/chunk-CRJI67D5.mjs +6 -0
- package/chunk-I6ERYEB3.js +29 -0
- package/chunk-JNEX4BMN.js +2 -0
- package/chunk-JQ4UTWMH.js +2 -0
- package/chunk-LYGO5UGG.mjs +1 -0
- package/chunk-PIY4JWBH.js +8 -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 -33
- package/components/Avatar/index.js +3 -4
- package/components/Avatar/index.mjs +1 -6
- package/components/Button/index.d.ts +4 -44
- package/components/Button/index.js +2 -24
- package/components/Button/index.mjs +1 -7
- package/components/index.d.ts +5 -72
- 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 -99
- package/index.js +32 -1
- package/index.mjs +7 -1
- package/package.json +42 -35
- package/theme/global.css +1 -1
- package/theme/main-preset.js +8 -8
- package/theme.types-a32f0702.d.ts +9 -0
- package/useTheme-01c9253b.d.ts +5 -0
|
@@ -0,0 +1,37 @@
|
|
|
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 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 { Avatar as A, AvatarSizeType as a, AvatarProps as b };
|
|
@@ -0,0 +1,48 @@
|
|
|
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 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 _ };
|
package/README.md
CHANGED
|
@@ -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,7 @@
|
|
|
1
|
+
import * as e from 'react';
|
|
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 a };
|
|
@@ -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,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,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var e = 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 e__namespace = /*#__PURE__*/_interopNamespace(e);
|
|
26
|
+
|
|
27
|
+
var r=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 v=e__namespace.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 jsxRuntime.jsx(c,{className:l,ref:d,...n,children:o})});
|
|
28
|
+
|
|
29
|
+
exports.a = v;
|
|
@@ -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 @@
|
|
|
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,33 +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
|
-
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
32
|
-
|
|
33
|
-
export { AvatarProps, AvatarSizeType, Avatar as default };
|
|
1
|
+
export { b as AvatarProps, a as AvatarSizeType, A as default } from '../../Avatar-e871ff4f.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 chunkPIY4JWBH_js = require('../../chunk-PIY4JWBH.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 a({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 = chunkPIY4JWBH_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 a({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 { a as default };
|
|
1
|
+
export { a as default } from '../../chunk-AWV2FK6N.mjs';
|
|
@@ -1,44 +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 = {}> = React.PropsWithChildren<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
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<PolymorphicComponentProp<React.ElementType<any>, ButtonProp>, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
43
|
-
|
|
44
|
-
export { _default as default };
|
|
1
|
+
export { _ as default } from '../../Button-91229b6b.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 chunkI6ERYEB3_js = require('../../chunk-I6ERYEB3.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 = chunkI6ERYEB3_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-4AKOYNNP.mjs';
|
package/components/index.d.ts
CHANGED
|
@@ -1,72 +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
|
-
declare function Avatar({ alt, bg, children, size, src, ...props }: AvatarProps): JSX.Element;
|
|
32
|
-
|
|
33
|
-
declare const buttonCva: (props?: ({
|
|
34
|
-
color?: "neutral" | "primary" | "success" | "warning" | "error" | null | undefined;
|
|
35
|
-
size?: "sm" | "md" | "lg" | null | undefined;
|
|
36
|
-
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
37
|
-
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
38
|
-
|
|
39
|
-
type ButtonCvaProps = VariantProps<typeof buttonCva>;
|
|
40
|
-
type ButtonSizeType = NonNullable<ButtonCvaProps["size"]>;
|
|
41
|
-
type ButtonVariantType = NonNullable<ButtonCvaProps["variant"]>;
|
|
42
|
-
type ButtonColorType = NonNullable<ButtonCvaProps["color"]>;
|
|
43
|
-
|
|
44
|
-
type AsProp<C extends React.ElementType> = {
|
|
45
|
-
/**
|
|
46
|
-
* Defines HTML tag to be used for component
|
|
47
|
-
*/
|
|
48
|
-
as?: C;
|
|
49
|
-
};
|
|
50
|
-
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
51
|
-
type PolymorphicComponentProp<C extends React.ElementType, Props = {}> = React.PropsWithChildren<Props & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
52
|
-
|
|
53
|
-
type ButtonProp = {
|
|
54
|
-
/**
|
|
55
|
-
* Defines button color
|
|
56
|
-
* @default 'primary'
|
|
57
|
-
*/
|
|
58
|
-
color?: ButtonColorType;
|
|
59
|
-
/**
|
|
60
|
-
* Defines button variant
|
|
61
|
-
* @default 'text'
|
|
62
|
-
*/
|
|
63
|
-
variant?: ButtonVariantType;
|
|
64
|
-
/**
|
|
65
|
-
* Defines button size
|
|
66
|
-
* @default 'md'
|
|
67
|
-
*/
|
|
68
|
-
size?: ButtonSizeType;
|
|
69
|
-
};
|
|
70
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<PolymorphicComponentProp<React.ElementType<any>, ButtonProp>, string | number | symbol> & React.RefAttributes<unknown>>;
|
|
71
|
-
|
|
72
|
-
export { Avatar, AvatarProps, AvatarSizeType, _default as Button };
|
|
1
|
+
export { A as Avatar, b as AvatarProps, a as AvatarSizeType } from '../Avatar-e871ff4f.js';
|
|
2
|
+
export { _ as Button } from '../Button-91229b6b.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-JNEX4BMN.js');
|
|
4
|
+
var chunkPIY4JWBH_js = require('../chunk-PIY4JWBH.js');
|
|
5
|
+
var chunkI6ERYEB3_js = require('../chunk-I6ERYEB3.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, 'Avatar', {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () { return chunkPIY4JWBH_js.a; }
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, 'Button', {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return chunkI6ERYEB3_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,99 +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
|
-
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 };
|
|
1
|
+
export { A as Avatar, b as AvatarProps, a as AvatarSizeType } from './Avatar-e871ff4f.js';
|
|
2
|
+
export { _ as Button } from './Button-91229b6b.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-JNEX4BMN.js');
|
|
4
|
+
var chunkPIY4JWBH_js = require('./chunk-PIY4JWBH.js');
|
|
5
|
+
var chunkI6ERYEB3_js = require('./chunk-I6ERYEB3.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 chunkPIY4JWBH_js.a; }
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, 'Button', {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return chunkI6ERYEB3_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-LYGO5UGG.mjs';
|
|
2
|
+
export { a as Avatar } from './chunk-AWV2FK6N.mjs';
|
|
3
|
+
export { a as Button } from './chunk-4AKOYNNP.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.0",
|
|
4
4
|
"description": "Szum-Tech design system with tailwindcss support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"szum-tech",
|
|
@@ -31,15 +31,19 @@
|
|
|
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",
|
|
43
|
+
"build": "env NODE_ENV=production tsup && cpy './src/theme/global.css' './theme' --flat",
|
|
41
44
|
"clean": "rm -rf node_modules && yarn clear:build",
|
|
42
|
-
"clear:build": "rm -rf components && rm -rf contexts && rm -rf hooks && rm -rf theme && rm -rf index.*",
|
|
45
|
+
"clear: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
|
+
"clear:build:dev": "rm -rf dist",
|
|
43
47
|
"dev": "concurrently \"npm run dev:css\" \"npm run dev:build\"",
|
|
44
48
|
"dev:build": "tsup",
|
|
45
49
|
"dev:css": "tailwindcss -w -i src/theme/global.css -o src/styles/default.css",
|
|
@@ -54,55 +58,58 @@
|
|
|
54
58
|
},
|
|
55
59
|
"dependencies": {
|
|
56
60
|
"@tailwindcss/container-queries": "^0.1.0",
|
|
57
|
-
"class-variance-authority": "^0.
|
|
58
|
-
"tailwind-scrollbar": "^3.0.0"
|
|
59
|
-
"tailwindcss": "^3.2.7"
|
|
61
|
+
"class-variance-authority": "^0.5.1",
|
|
62
|
+
"tailwind-scrollbar": "^3.0.0"
|
|
60
63
|
},
|
|
61
64
|
"devDependencies": {
|
|
62
|
-
"@babel/core": "^7.
|
|
63
|
-
"@heroicons/react": "^2.0.
|
|
64
|
-
"@storybook/addon-a11y": "^7.0.0
|
|
65
|
-
"@storybook/addon-actions": "^7.0.0
|
|
66
|
-
"@storybook/addon-docs": "^7.0.0
|
|
67
|
-
"@storybook/addon-essentials": "^7.0.0
|
|
68
|
-
"@storybook/addon-
|
|
69
|
-
"@storybook/
|
|
65
|
+
"@babel/core": "^7.21.4",
|
|
66
|
+
"@heroicons/react": "^2.0.17",
|
|
67
|
+
"@storybook/addon-a11y": "^7.0.0",
|
|
68
|
+
"@storybook/addon-actions": "^7.0.0",
|
|
69
|
+
"@storybook/addon-docs": "^7.0.0",
|
|
70
|
+
"@storybook/addon-essentials": "^7.0.0",
|
|
71
|
+
"@storybook/addon-interactions": "^7.0.0",
|
|
72
|
+
"@storybook/addon-links": "^7.0.0",
|
|
73
|
+
"@storybook/addon-mdx-gfm": "^7.0.0",
|
|
74
|
+
"@storybook/addons": "^7.0.0",
|
|
70
75
|
"@storybook/core-common": "^6.5.16",
|
|
71
76
|
"@storybook/core-events": "^6.5.16",
|
|
72
|
-
"@storybook/react": "^7.0.0
|
|
73
|
-
"@storybook/react-vite": "^7.0.0
|
|
74
|
-
"@storybook/theming": "^7.0.0
|
|
75
|
-
"@szum-tech/prettier-config": "^1.
|
|
76
|
-
"@szum-tech/semantic-release-preset": "^1.
|
|
77
|
-
"@testing-library/react": "^
|
|
77
|
+
"@storybook/react": "^7.0.0",
|
|
78
|
+
"@storybook/react-vite": "^7.0.0",
|
|
79
|
+
"@storybook/theming": "^7.0.0",
|
|
80
|
+
"@szum-tech/prettier-config": "^1.2.0",
|
|
81
|
+
"@szum-tech/semantic-release-preset": "^1.5.0",
|
|
82
|
+
"@testing-library/react": "^14.0.0",
|
|
78
83
|
"@testing-library/user-event": "^14.4.3",
|
|
79
|
-
"@types/react": "^18.0.
|
|
80
|
-
"@types/react-dom": "^18.0.
|
|
81
|
-
"@types/semantic-release": "^
|
|
84
|
+
"@types/react": "^18.0.32",
|
|
85
|
+
"@types/react-dom": "^18.0.11",
|
|
86
|
+
"@types/semantic-release": "^20.0.1",
|
|
82
87
|
"@vitejs/plugin-react": "^3.1.0",
|
|
83
|
-
"autoprefixer": "^10.4.
|
|
84
|
-
"babel-loader": "^
|
|
85
|
-
"concurrently": "^
|
|
88
|
+
"autoprefixer": "^10.4.14",
|
|
89
|
+
"babel-loader": "^9.1.2",
|
|
90
|
+
"concurrently": "^8.0.1",
|
|
86
91
|
"cpy-cli": "^4.2.0",
|
|
87
|
-
"postcss": "^8.4.
|
|
92
|
+
"postcss": "^8.4.21",
|
|
88
93
|
"prettier": "^2.8.7",
|
|
89
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
94
|
+
"prettier-plugin-tailwindcss": "^0.2.6",
|
|
90
95
|
"react": "^18.2.0",
|
|
91
96
|
"react-docgen": "^5.4.3",
|
|
92
97
|
"react-docgen-typescript": "^2.2.2",
|
|
93
98
|
"react-dom": "^18.2.0",
|
|
94
|
-
"semantic-release": "^
|
|
99
|
+
"semantic-release": "^21.0.1",
|
|
95
100
|
"serve": "^14.2.0",
|
|
96
|
-
"storybook": "^7.0.0
|
|
97
|
-
"storybook-addon-pseudo-states": "^2.0.0-next.
|
|
101
|
+
"storybook": "^7.0.0",
|
|
102
|
+
"storybook-addon-pseudo-states": "^2.0.0-next.1",
|
|
98
103
|
"storybook-addon-themes": "^6.1.0",
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
104
|
+
"tailwindcss": "^3.3.1",
|
|
105
|
+
"tsup": "^6.7.0",
|
|
106
|
+
"typescript": "^5.0.3",
|
|
107
|
+
"vite": "^4.2.1"
|
|
102
108
|
},
|
|
103
109
|
"peerDependencies": {
|
|
104
110
|
"react": "^18.2.0",
|
|
105
|
-
"
|
|
111
|
+
"react-dom": "^18.2.0",
|
|
112
|
+
"tailwindcss": "^3.3.1"
|
|
106
113
|
},
|
|
107
114
|
"publishConfig": {
|
|
108
115
|
"access": "public"
|
package/theme/global.css
CHANGED
package/theme/main-preset.js
CHANGED
|
@@ -4,13 +4,13 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
4
4
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// src/theme/plugins/
|
|
7
|
+
// src/theme/plugins/utilities/scroll.js
|
|
8
8
|
var require_scroll = __commonJS({
|
|
9
|
-
"src/theme/plugins/
|
|
9
|
+
"src/theme/plugins/utilities/scroll.js"(exports2, module2) {
|
|
10
10
|
"use strict";
|
|
11
11
|
var plugin = require("tailwindcss/plugin");
|
|
12
|
-
module2.exports = plugin(function({
|
|
13
|
-
|
|
12
|
+
module2.exports = plugin(function({ addUtilities }) {
|
|
13
|
+
addUtilities({
|
|
14
14
|
".scroll": {
|
|
15
15
|
"@apply scrollbar scrollbar-thin scrollbar-thumb-gray-600/100 hover:scrollbar-thumb-gray-600/80": {}
|
|
16
16
|
}
|
|
@@ -19,13 +19,13 @@ var require_scroll = __commonJS({
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
// src/theme/plugins/
|
|
22
|
+
// src/theme/plugins/utilities/typography.js
|
|
23
23
|
var require_typography = __commonJS({
|
|
24
|
-
"src/theme/plugins/
|
|
24
|
+
"src/theme/plugins/utilities/typography.js"(exports2, module2) {
|
|
25
25
|
"use strict";
|
|
26
26
|
var plugin = require("tailwindcss/plugin");
|
|
27
|
-
module2.exports = plugin(function({
|
|
28
|
-
|
|
27
|
+
module2.exports = plugin(function({ addUtilities }) {
|
|
28
|
+
addUtilities({
|
|
29
29
|
".typography-heading-1": {
|
|
30
30
|
"@apply font-poppins text-6xl font-light leading-relaxed -tracking-[.01562em]": {}
|
|
31
31
|
},
|