@x4b/design-system 28.4.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/README.md +30 -0
- package/dist/AnchorLink/AnchorLink.d.ts +7 -0
- package/dist/AnchorLink/index.d.ts +1 -0
- package/dist/BlurrableImage/BlurrableImage.d.ts +6 -0
- package/dist/BlurrableImage/index.d.ts +1 -0
- package/dist/Button/Button.d.ts +16 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Icons/RightArrow.d.ts +2 -0
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Images/Images.d.ts +22 -0
- package/dist/Images/index.d.ts +1 -0
- package/dist/Spinner/Spinner.d.ts +4 -0
- package/dist/Spinner/index.d.ts +1 -0
- package/dist/constants.d.ts +130 -0
- package/dist/design-system.es.js +1312 -0
- package/dist/design-system.es.js.map +1 -0
- package/dist/design-system.umd.js +28 -0
- package/dist/design-system.umd.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/utils/misc.d.ts +2 -0
- package/dist/vite-env.d.ts +10 -0
- package/package.json +49 -0
- package/styles/tailwind.utilities.css +5 -0
- package/styles.css +1 -0
- package/tailwind-base.js +117 -0
package/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# X4B design system
|
2
|
+
|
3
|
+
X4B design system is a collection of reusable components for building X4B web applications.
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
We use Storybook as a playground for developing components. It's also a fantastic tool for documentation.
|
8
|
+
Run Storybook:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
pnpm storybook
|
12
|
+
```
|
13
|
+
|
14
|
+
Run unit tests:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
pnpm test
|
18
|
+
```
|
19
|
+
|
20
|
+
Run lint:
|
21
|
+
|
22
|
+
```bash
|
23
|
+
pnpm lint
|
24
|
+
```
|
25
|
+
|
26
|
+
Run type checks:
|
27
|
+
|
28
|
+
```bash
|
29
|
+
pnpm typecheck
|
30
|
+
```
|
@@ -0,0 +1,7 @@
|
|
1
|
+
declare type AnchorLinkProps<Type extends React.ElementType> = {
|
2
|
+
children: React.ReactNode;
|
3
|
+
size?: 'sm' | 'base' | 'lg' | 'xl';
|
4
|
+
as?: Type;
|
5
|
+
};
|
6
|
+
declare function AnchorLink<Type extends React.ElementType = 'a'>({ as, children, size, ...props }: AnchorLinkProps<Type> & Omit<React.ComponentPropsWithoutRef<Type>, keyof AnchorLinkProps<Type>>): JSX.Element;
|
7
|
+
export default AnchorLink;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './AnchorLink';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
declare function BlurrableImage({ img, blurDataUrl, ...rest }: {
|
3
|
+
img: JSX.Element & React.ReactElement<React.ImgHTMLAttributes<HTMLImageElement>>;
|
4
|
+
blurDataUrl?: string;
|
5
|
+
} & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
6
|
+
export default BlurrableImage;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './BlurrableImage';
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React, { ElementType } from 'react';
|
2
|
+
declare type ButtonProps<T extends ElementType> = {
|
3
|
+
children: React.ReactNode;
|
4
|
+
as?: T;
|
5
|
+
variant?: 'solid' | 'outline' | 'ghost' | 'link';
|
6
|
+
colorScheme?: 'primary' | 'accent' | 'gray' | 'red' | 'green';
|
7
|
+
size?: 'sm' | 'base' | 'lg' | 'xl';
|
8
|
+
isLoading?: boolean;
|
9
|
+
loadingLabel?: string;
|
10
|
+
compact?: boolean;
|
11
|
+
rounded?: boolean;
|
12
|
+
ref?: React.Ref<T>;
|
13
|
+
};
|
14
|
+
declare type ButtonComponent = <T extends ElementType = 'button'>(props: ButtonProps<T> & Omit<React.ComponentPropsWithRef<T>, keyof ButtonProps<T>>) => React.ReactElement | null;
|
15
|
+
declare const Button: ButtonComponent;
|
16
|
+
export default Button;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Button';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default as RightArrow } from './RightArrow';
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import type { TransformerOption } from '@cld-apis/types';
|
2
|
+
export declare type ImageBuilder = {
|
3
|
+
(transformations?: TransformerOption): string;
|
4
|
+
alt: string;
|
5
|
+
id: string;
|
6
|
+
};
|
7
|
+
export declare function getImageBuilder(id: string, alt?: string): ImageBuilder;
|
8
|
+
export declare function getImgProps(imageBuilder: ImageBuilder, { widths, sizes, transformations, }: {
|
9
|
+
widths: Array<number>;
|
10
|
+
sizes: Array<string>;
|
11
|
+
transformations?: TransformerOption;
|
12
|
+
}): {
|
13
|
+
alt: string;
|
14
|
+
src: string;
|
15
|
+
srcSet: string;
|
16
|
+
sizes: string;
|
17
|
+
};
|
18
|
+
export declare const createImages: <ImageType extends Record<string, {
|
19
|
+
id: string;
|
20
|
+
prefix: string;
|
21
|
+
alt: string;
|
22
|
+
}>>(images: ImageType) => { [Name in keyof ImageType]: ImageBuilder; };
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Images';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Spinner';
|
@@ -0,0 +1,130 @@
|
|
1
|
+
export declare const FONT_FAMILY = "var(--x4b-font-family, 'Open Sans', sans-serif)";
|
2
|
+
export declare const COLORS: {
|
3
|
+
white: string;
|
4
|
+
black: string;
|
5
|
+
primary: {
|
6
|
+
50: string;
|
7
|
+
100: string;
|
8
|
+
200: string;
|
9
|
+
300: string;
|
10
|
+
400: string;
|
11
|
+
500: string;
|
12
|
+
600: string;
|
13
|
+
700: string;
|
14
|
+
800: string;
|
15
|
+
900: string;
|
16
|
+
};
|
17
|
+
accent: {
|
18
|
+
50: string;
|
19
|
+
100: string;
|
20
|
+
200: string;
|
21
|
+
300: string;
|
22
|
+
400: string;
|
23
|
+
500: string;
|
24
|
+
600: string;
|
25
|
+
700: string;
|
26
|
+
800: string;
|
27
|
+
900: string;
|
28
|
+
};
|
29
|
+
yellow: {
|
30
|
+
100: string;
|
31
|
+
200: string;
|
32
|
+
300: string;
|
33
|
+
400: string;
|
34
|
+
500: string;
|
35
|
+
600: string;
|
36
|
+
700: string;
|
37
|
+
800: string;
|
38
|
+
900: string;
|
39
|
+
};
|
40
|
+
green: {
|
41
|
+
100: string;
|
42
|
+
200: string;
|
43
|
+
300: string;
|
44
|
+
400: string;
|
45
|
+
500: string;
|
46
|
+
600: string;
|
47
|
+
700: string;
|
48
|
+
800: string;
|
49
|
+
900: string;
|
50
|
+
};
|
51
|
+
red: {
|
52
|
+
100: string;
|
53
|
+
200: string;
|
54
|
+
300: string;
|
55
|
+
400: string;
|
56
|
+
500: string;
|
57
|
+
600: string;
|
58
|
+
700: string;
|
59
|
+
800: string;
|
60
|
+
900: string;
|
61
|
+
};
|
62
|
+
gray: {
|
63
|
+
50: string;
|
64
|
+
100: string;
|
65
|
+
200: string;
|
66
|
+
300: string;
|
67
|
+
400: string;
|
68
|
+
500: string;
|
69
|
+
600: string;
|
70
|
+
700: string;
|
71
|
+
800: string;
|
72
|
+
900: string;
|
73
|
+
};
|
74
|
+
};
|
75
|
+
export declare const SPACES: {
|
76
|
+
0: string;
|
77
|
+
1: string;
|
78
|
+
2: string;
|
79
|
+
3: string;
|
80
|
+
4: string;
|
81
|
+
5: string;
|
82
|
+
6: string;
|
83
|
+
7: string;
|
84
|
+
8: string;
|
85
|
+
9: string;
|
86
|
+
10: string;
|
87
|
+
11: string;
|
88
|
+
12: string;
|
89
|
+
13: string;
|
90
|
+
14: string;
|
91
|
+
15: string;
|
92
|
+
};
|
93
|
+
export declare const BREAKPOINTS: {
|
94
|
+
phone: number;
|
95
|
+
tablet: number;
|
96
|
+
laptop: number;
|
97
|
+
};
|
98
|
+
export declare const QUERIES: {
|
99
|
+
phoneAndSmaller: string;
|
100
|
+
tabletAndSmaller: string;
|
101
|
+
laptopAndSmaller: string;
|
102
|
+
};
|
103
|
+
export declare const TEXT: {
|
104
|
+
xs: string;
|
105
|
+
sm: string;
|
106
|
+
base: string;
|
107
|
+
lg: string;
|
108
|
+
xl: string;
|
109
|
+
'2xl': string;
|
110
|
+
'3xl': string;
|
111
|
+
'4xl': string;
|
112
|
+
'5xl': string;
|
113
|
+
'6xl': string;
|
114
|
+
};
|
115
|
+
export declare const WEIGHTS: {
|
116
|
+
light: number;
|
117
|
+
normal: number;
|
118
|
+
medium: number;
|
119
|
+
bold: number;
|
120
|
+
};
|
121
|
+
export declare const BORDERS: {
|
122
|
+
rounded: {
|
123
|
+
none: string;
|
124
|
+
sm: string;
|
125
|
+
default: string;
|
126
|
+
md: string;
|
127
|
+
lg: string;
|
128
|
+
xl: string;
|
129
|
+
};
|
130
|
+
};
|