@beydesign/storybook 0.0.3 → 0.0.4
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/dist/stories/Avatar.d.ts +4 -0
- package/dist/stories/Avatar.js +79 -0
- package/dist/stories/Avatar.stories.d.ts +8 -0
- package/dist/stories/Avatar.stories.js +76 -0
- package/dist/stories/Badge.stories.d.ts +11 -0
- package/dist/stories/Badge.stories.js +98 -0
- package/dist/stories/Bagde.d.ts +3 -0
- package/dist/stories/Bagde.js +113 -0
- package/dist/stories/Button.js +28 -11
- package/dist/stories/Checkbox.d.ts +3 -0
- package/dist/stories/Checkbox.js +66 -0
- package/dist/stories/Checkbox.stories.d.ts +13 -0
- package/dist/stories/Checkbox.stories.js +121 -0
- package/dist/stories/Colors.d.ts +1 -4
- package/dist/stories/Colors.js +251 -6
- package/dist/stories/Colors.stories.js +1 -1
- package/dist/stories/Typography.d.ts +4 -0
- package/dist/stories/Typography.js +36 -0
- package/dist/stories/Typography.stories.d.ts +25 -0
- package/dist/stories/Typography.stories.js +189 -0
- package/dist/stories/types/avatar.d.ts +44 -0
- package/dist/stories/types/avatar.js +28 -0
- package/dist/stories/types/badge.d.ts +47 -0
- package/dist/stories/types/badge.js +25 -0
- package/dist/stories/types/checkbox.d.ts +26 -0
- package/dist/stories/types/checkbox.js +5 -0
- package/dist/stories/types/typography.d.ts +43 -0
- package/dist/stories/types/typography.js +27 -0
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
/**
|
|
3
|
+
* Avatar size variants
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AvatarSize {
|
|
6
|
+
xxl = "xxl",
|
|
7
|
+
xl = "xl",
|
|
8
|
+
lg = "lg",
|
|
9
|
+
md = "md",
|
|
10
|
+
sm = "sm",
|
|
11
|
+
xs = "xs"
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Avatar style variants
|
|
15
|
+
*/
|
|
16
|
+
export declare enum AvatarStyle {
|
|
17
|
+
Placeholder = "Placeholder",
|
|
18
|
+
Picture = "Picture",
|
|
19
|
+
Letters = "Letters"
|
|
20
|
+
}
|
|
21
|
+
export declare const AvatarImage = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTAUPUG0r--EDZzf-f9Afj_Jp7N96yIGsWPgCYIkrAS1rCJHIcdm_RCq_me44bJc0dvvY&usqp=CAU";
|
|
22
|
+
export declare const getInitials: (text: string) => string;
|
|
23
|
+
/**
|
|
24
|
+
* Avatar component props
|
|
25
|
+
*/
|
|
26
|
+
export type AvatarProps = {
|
|
27
|
+
/** Style variant of the avatar */
|
|
28
|
+
avatarStyle: AvatarStyle;
|
|
29
|
+
/** Text content of the avatar if avatarStyle is Letters */
|
|
30
|
+
text?: string;
|
|
31
|
+
/** Image source of the avatar if avatarStyle is Picture */
|
|
32
|
+
image?: string;
|
|
33
|
+
/** Custom style of the avatar */
|
|
34
|
+
style?: SxProps<Theme>;
|
|
35
|
+
/** Size variant of the avatar */
|
|
36
|
+
size?: AvatarSize;
|
|
37
|
+
/** Visual hierarchy of the avatar */
|
|
38
|
+
border?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Props for the Components wrapper
|
|
42
|
+
*/
|
|
43
|
+
export interface ComponentsProps {
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Avatar size variants
|
|
3
|
+
*/
|
|
4
|
+
export var AvatarSize;
|
|
5
|
+
(function (AvatarSize) {
|
|
6
|
+
AvatarSize["xxl"] = "xxl";
|
|
7
|
+
AvatarSize["xl"] = "xl";
|
|
8
|
+
AvatarSize["lg"] = "lg";
|
|
9
|
+
AvatarSize["md"] = "md";
|
|
10
|
+
AvatarSize["sm"] = "sm";
|
|
11
|
+
AvatarSize["xs"] = "xs";
|
|
12
|
+
})(AvatarSize || (AvatarSize = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Avatar style variants
|
|
15
|
+
*/
|
|
16
|
+
export var AvatarStyle;
|
|
17
|
+
(function (AvatarStyle) {
|
|
18
|
+
AvatarStyle["Placeholder"] = "Placeholder";
|
|
19
|
+
AvatarStyle["Picture"] = "Picture";
|
|
20
|
+
AvatarStyle["Letters"] = "Letters";
|
|
21
|
+
})(AvatarStyle || (AvatarStyle = {}));
|
|
22
|
+
export const AvatarImage = `https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTTAUPUG0r--EDZzf-f9Afj_Jp7N96yIGsWPgCYIkrAS1rCJHIcdm_RCq_me44bJc0dvvY&usqp=CAU`;
|
|
23
|
+
export const getInitials = (text) => {
|
|
24
|
+
return text
|
|
25
|
+
.split(' ')
|
|
26
|
+
.map((word) => word[0]?.toUpperCase())
|
|
27
|
+
.join('');
|
|
28
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import * as PhosphorIcons from '@phosphor-icons/react';
|
|
3
|
+
/**
|
|
4
|
+
* Badge size variants
|
|
5
|
+
*/
|
|
6
|
+
export declare enum BadgeSize {
|
|
7
|
+
lg = "lg",
|
|
8
|
+
md = "md",
|
|
9
|
+
xs = "xs"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Badge color variants
|
|
13
|
+
*/
|
|
14
|
+
export declare enum BadgeColor {
|
|
15
|
+
Default = "Default",
|
|
16
|
+
Violet = "Violet",
|
|
17
|
+
Lemon = "Lemon",
|
|
18
|
+
Green = "Green",
|
|
19
|
+
Red = "Red",
|
|
20
|
+
Yellow = "Yellow",
|
|
21
|
+
Blue = "Blue",
|
|
22
|
+
Cyan = "Cyan",
|
|
23
|
+
Pink = "Pink",
|
|
24
|
+
DarkTransparent = "DarkTransparent"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Badge component props
|
|
28
|
+
*/
|
|
29
|
+
export type BadgeProps = {
|
|
30
|
+
/** Size variant of the badge */
|
|
31
|
+
size?: BadgeSize;
|
|
32
|
+
/** Color variant of the badge */
|
|
33
|
+
color?: BadgeColor;
|
|
34
|
+
/** Text content of the badge */
|
|
35
|
+
text: string;
|
|
36
|
+
/** Custom style of the badge */
|
|
37
|
+
style?: SxProps<Theme>;
|
|
38
|
+
/** Icon to display in the badge */
|
|
39
|
+
icon?: keyof typeof PhosphorIcons;
|
|
40
|
+
/** Whether to fill the icon */
|
|
41
|
+
fill?: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Props for the Components wrapper
|
|
45
|
+
*/
|
|
46
|
+
export interface ComponentsProps {
|
|
47
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Badge size variants
|
|
3
|
+
*/
|
|
4
|
+
export var BadgeSize;
|
|
5
|
+
(function (BadgeSize) {
|
|
6
|
+
BadgeSize["lg"] = "lg";
|
|
7
|
+
BadgeSize["md"] = "md";
|
|
8
|
+
BadgeSize["xs"] = "xs";
|
|
9
|
+
})(BadgeSize || (BadgeSize = {}));
|
|
10
|
+
/**
|
|
11
|
+
* Badge color variants
|
|
12
|
+
*/
|
|
13
|
+
export var BadgeColor;
|
|
14
|
+
(function (BadgeColor) {
|
|
15
|
+
BadgeColor["Default"] = "Default";
|
|
16
|
+
BadgeColor["Violet"] = "Violet";
|
|
17
|
+
BadgeColor["Lemon"] = "Lemon";
|
|
18
|
+
BadgeColor["Green"] = "Green";
|
|
19
|
+
BadgeColor["Red"] = "Red";
|
|
20
|
+
BadgeColor["Yellow"] = "Yellow";
|
|
21
|
+
BadgeColor["Blue"] = "Blue";
|
|
22
|
+
BadgeColor["Cyan"] = "Cyan";
|
|
23
|
+
BadgeColor["Pink"] = "Pink";
|
|
24
|
+
BadgeColor["DarkTransparent"] = "DarkTransparent";
|
|
25
|
+
})(BadgeColor || (BadgeColor = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare enum CheckboxType {
|
|
2
|
+
Radio = "Radio",
|
|
3
|
+
Checkbox = "Checkbox"
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Checkbox component props
|
|
7
|
+
*/
|
|
8
|
+
export type CheckboxProps = {
|
|
9
|
+
/** Type variant of the checkbox */
|
|
10
|
+
type?: CheckboxType;
|
|
11
|
+
/** Label of the checkbox */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Whether the checkbox is checked */
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
/** Whether the checkbox is disabled */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Whether the checkbox is read-only */
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** Event handler for the checkbox */
|
|
20
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Props for the Components wrapper
|
|
24
|
+
*/
|
|
25
|
+
export interface ComponentsProps {
|
|
26
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography size variants
|
|
3
|
+
*/
|
|
4
|
+
export declare enum TypographySize {
|
|
5
|
+
HeadingXL = "HeadingXL",
|
|
6
|
+
HeadingL = "HeadingL",
|
|
7
|
+
HeadingM = "HeadingM",
|
|
8
|
+
HeadingS = "HeadingS",
|
|
9
|
+
HeadingXS = "HeadingXS",
|
|
10
|
+
Heading2XS = "Heading2XS",
|
|
11
|
+
TextL = "TextL",
|
|
12
|
+
TextM = "TextM",
|
|
13
|
+
TextS = "TextS",
|
|
14
|
+
TextXS = "TextXS",
|
|
15
|
+
Text2XS = "Text2XS"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Typography weight variants
|
|
19
|
+
*/
|
|
20
|
+
export declare enum TypographyWeight {
|
|
21
|
+
Bold = "Bold",
|
|
22
|
+
SemiBold = "SemiBold",
|
|
23
|
+
Medium = "Medium",
|
|
24
|
+
Regular = "Regular"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Typography component props
|
|
28
|
+
*/
|
|
29
|
+
export interface TypographyProps {
|
|
30
|
+
/** Text content of the typography */
|
|
31
|
+
text: string;
|
|
32
|
+
/** Size variant of the typography */
|
|
33
|
+
size?: TypographySize;
|
|
34
|
+
/** Weight variant of the typography */
|
|
35
|
+
weight?: TypographyWeight;
|
|
36
|
+
/** Color variant of the typography */
|
|
37
|
+
color?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Props for the Components wrapper
|
|
41
|
+
*/
|
|
42
|
+
export interface ComponentsProps {
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography size variants
|
|
3
|
+
*/
|
|
4
|
+
export var TypographySize;
|
|
5
|
+
(function (TypographySize) {
|
|
6
|
+
TypographySize["HeadingXL"] = "HeadingXL";
|
|
7
|
+
TypographySize["HeadingL"] = "HeadingL";
|
|
8
|
+
TypographySize["HeadingM"] = "HeadingM";
|
|
9
|
+
TypographySize["HeadingS"] = "HeadingS";
|
|
10
|
+
TypographySize["HeadingXS"] = "HeadingXS";
|
|
11
|
+
TypographySize["Heading2XS"] = "Heading2XS";
|
|
12
|
+
TypographySize["TextL"] = "TextL";
|
|
13
|
+
TypographySize["TextM"] = "TextM";
|
|
14
|
+
TypographySize["TextS"] = "TextS";
|
|
15
|
+
TypographySize["TextXS"] = "TextXS";
|
|
16
|
+
TypographySize["Text2XS"] = "Text2XS";
|
|
17
|
+
})(TypographySize || (TypographySize = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Typography weight variants
|
|
20
|
+
*/
|
|
21
|
+
export var TypographyWeight;
|
|
22
|
+
(function (TypographyWeight) {
|
|
23
|
+
TypographyWeight["Bold"] = "Bold";
|
|
24
|
+
TypographyWeight["SemiBold"] = "SemiBold";
|
|
25
|
+
TypographyWeight["Medium"] = "Medium";
|
|
26
|
+
TypographyWeight["Regular"] = "Regular";
|
|
27
|
+
})(TypographyWeight || (TypographyWeight = {}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beydesign/storybook",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"build:lib": "tsc",
|
|
16
16
|
"lint": "eslint .",
|
|
17
17
|
"preview": "vite preview",
|
|
18
|
-
"storybook": "storybook dev -p 6006",
|
|
18
|
+
"storybook": "npm update @beydesign/tokens && storybook dev -p 6006",
|
|
19
19
|
"build-storybook": "storybook build",
|
|
20
20
|
"version:patch": "npm version patch -m \"🔖 Release %s\"",
|
|
21
21
|
"version:minor": "npm version minor -m \"🔖 Release %s\"",
|