@crystallize/design-system 0.2.0 → 1.0.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/CHANGELOG.md +16 -0
- package/dist/index.css +1319 -827
- package/dist/index.d.ts +98 -43
- package/dist/index.js +982 -578
- package/dist/index.mjs +973 -573
- package/package.json +40 -23
- package/readme.md +9 -0
- package/src/Tokens.stories.tsx +18 -0
- package/src/action-menu/ActionMenu.stories.tsx +3 -1
- package/src/action-menu/action-item.tsx +1 -9
- package/src/action-menu/action-menu.css +38 -0
- package/src/action-menu/action-menu.tsx +4 -13
- package/src/action-menu/index.tsx +2 -0
- package/src/avatar/Avatar.stories.tsx +20 -0
- package/src/avatar/avatar.css +23 -0
- package/src/avatar/avatar.tsx +34 -0
- package/src/avatar/get-initials.ts +5 -0
- package/src/avatar/index.ts +1 -0
- package/src/button/Button.stories.tsx +64 -22
- package/src/button/button.css +116 -0
- package/src/button/button.tsx +119 -33
- package/src/button/index.ts +1 -1
- package/src/card/card.css +7 -0
- package/src/card/card.stories.tsx +2 -2
- package/src/card/card.tsx +6 -4
- package/src/card/index.ts +2 -0
- package/src/checkbox/checkbox.css +30 -0
- package/src/checkbox/checkbox.tsx +6 -14
- package/src/colors/Colors.stories.tsx +127 -0
- package/src/colors/color-defaults.json +15 -0
- package/src/colors/color-pairing.json +12 -0
- package/src/colors/colors.json +158 -0
- package/src/colors/index.ts +1 -0
- package/src/colors/old-to-new.txt +19 -0
- package/src/colors/types.ts +29 -0
- package/src/dialog/Dialog.stories.tsx +9 -6
- package/src/dialog/confirm-dialog.tsx +5 -2
- package/src/dialog/dialog.css +27 -0
- package/src/dialog/dialog.tsx +18 -20
- package/src/dialog/types.ts +4 -1
- package/src/dropdown-menu/DropdownMenu.stories.tsx +6 -14
- package/src/dropdown-menu/dropdown-menu-item.tsx +1 -10
- package/src/dropdown-menu/dropdown-menu-label.tsx +1 -8
- package/src/dropdown-menu/dropdown-menu-root.tsx +9 -5
- package/src/dropdown-menu/dropdown-menu.css +20 -0
- package/src/dropdown-menu/index.ts +2 -0
- package/src/icon-button/IconButton.stories.tsx +9 -6
- package/src/icon-button/icon-button.css +40 -0
- package/src/icon-button/icon-button.tsx +14 -22
- package/src/iconography/Icon.stories.tsx +47 -0
- package/src/{icons → iconography}/arrow.tsx +0 -0
- package/src/iconography/atom.tsx +59 -0
- package/src/{icons → iconography}/cancel.tsx +0 -0
- package/src/iconography/copy.tsx +24 -0
- package/src/iconography/crystal.tsx +93 -0
- package/src/iconography/edit.tsx +30 -0
- package/src/iconography/error.tsx +40 -0
- package/src/{icons → iconography}/glasses.tsx +0 -0
- package/src/{icons → iconography}/graphQL.tsx +0 -0
- package/src/{icons → iconography}/index.ts +10 -2
- package/src/iconography/info.tsx +41 -0
- package/src/{icons → iconography}/nail-polish.tsx +0 -0
- package/src/iconography/particle.tsx +88 -0
- package/src/iconography/triangle.tsx +27 -0
- package/src/iconography/warning.tsx +51 -0
- package/src/index.css +11 -0
- package/src/index.ts +12 -2
- package/src/inline-radio/inline-radio.css +20 -0
- package/src/inline-radio/inline-radio.stories.tsx +1 -1
- package/src/inline-radio/inline-radio.tsx +4 -14
- package/src/input/Input.stories.tsx +8 -1
- package/src/input/input.css +7 -0
- package/src/input/input.tsx +8 -21
- package/src/input-with-label/InputWithLabel.stories.tsx +98 -0
- package/src/input-with-label/index.ts +3 -0
- package/src/input-with-label/input-with-label.css +35 -0
- package/src/input-with-label/input-with-label.tsx +59 -0
- package/src/label/label.css +3 -0
- package/src/label/label.tsx +3 -1
- package/src/progress/progress.css +7 -0
- package/src/progress/progress.tsx +8 -7
- package/src/radio/radio.css +20 -0
- package/src/radio/radio.tsx +4 -11
- package/src/select/select-item.tsx +1 -10
- package/src/select/select-root.tsx +5 -12
- package/src/select/select.css +28 -0
- package/src/select/select.stories.tsx +12 -0
- package/src/select/select.ts +2 -0
- package/src/spinner/Spinner.stories.tsx +19 -0
- package/src/spinner/index.tsx +48 -0
- package/src/spinner/spinner.css +11 -0
- package/tailwind.config.cjs +51 -0
- package/src/button copy/ButtonCopy.stories.tsx +0 -86
- package/src/button copy/button.tsx +0 -61
- package/src/button copy/index.ts +0 -3
- package/src/colors/Colors.stories.mdx +0 -33
- package/src/icons/Iconography.stories.mdx +0 -45
- package/src/icons/dots.tsx +0 -24
- package/src/icons/error.tsx +0 -43
- package/src/icons/info.tsx +0 -46
- package/src/icons/warning.tsx +0 -55
- package/src/text-field/TextField.stories.tsx +0 -20
- package/src/text-field/index.ts +0 -1
- package/src/text-field/text-field.tsx +0 -60
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, forwardRef } from 'react';
|
|
2
|
-
import { cva, VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
type ButtonStylesProps = VariantProps<typeof buttonStyles>;
|
|
5
|
-
const buttonStyles = cva(
|
|
6
|
-
[
|
|
7
|
-
'inline-grid grid-flow-col items-center gap-2 rounded font-medium cursor-pointer whitespace-nowrap',
|
|
8
|
-
'disabled:cursor-default disabled:scale-100 disabled:shadow-none',
|
|
9
|
-
'active:scale-95',
|
|
10
|
-
'focus:shadow',
|
|
11
|
-
'hover:shadow',
|
|
12
|
-
'focus-visible:outline-inherit focus-visible:outline-offset-1 focus-visible:outline focus-visible:outline-1',
|
|
13
|
-
],
|
|
14
|
-
{
|
|
15
|
-
variants: {
|
|
16
|
-
variant: {
|
|
17
|
-
contained: 'bg-cosmos',
|
|
18
|
-
outline: 'bg-transparent border border-galaxy border-solid text-galaxy',
|
|
19
|
-
link: [
|
|
20
|
-
'text-sky-700',
|
|
21
|
-
'hover:shadow-none hover:text-sky-500',
|
|
22
|
-
'focus:shadow-none focus:text-sky-500',
|
|
23
|
-
'active:scale-100',
|
|
24
|
-
],
|
|
25
|
-
text: ['hover:shadow-none hover:bg-cosmos', 'focus:shadow-none focus:bg-cosmos'],
|
|
26
|
-
},
|
|
27
|
-
intent: {
|
|
28
|
-
default: '',
|
|
29
|
-
primary: ['bg-cyan-200 text-cyan-800', 'hover:bg-cyan-300', 'focus:bg-cyan-300'],
|
|
30
|
-
success: ['bg-emerald-200 text-emerald-800', 'hover:bg-emerald-300', 'focus:bg-emerald-300'],
|
|
31
|
-
danger: ['bg-red-200 text-red-800', 'hover:bg-red-300', 'focus:bg-red-300'],
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
xs: 'h-8 px-5',
|
|
35
|
-
sm: 'h-9 px-6',
|
|
36
|
-
md: 'h-10 px-7',
|
|
37
|
-
lg: 'h-10 px-8',
|
|
38
|
-
xl: 'h-11 px-9',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
defaultVariants: {
|
|
42
|
-
variant: 'contained',
|
|
43
|
-
intent: 'default',
|
|
44
|
-
size: 'sm',
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
export type ButtonProps = ComponentPropsWithRef<'button'> & ButtonStylesProps;
|
|
50
|
-
|
|
51
|
-
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
52
|
-
({ children, className, type = 'button', size, variant, intent, ...delegated }, ref) => {
|
|
53
|
-
return (
|
|
54
|
-
<button ref={ref} type={type} className={buttonStyles({ size, variant, intent, className })} {...delegated}>
|
|
55
|
-
{children}
|
|
56
|
-
</button>
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
Button.displayName = 'Button';
|
package/src/button copy/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Meta, ColorPalette, ColorItem } from '@storybook/addon-docs';
|
|
2
|
-
|
|
3
|
-
<Meta title="Colors" />
|
|
4
|
-
|
|
5
|
-
# Colors
|
|
6
|
-
|
|
7
|
-
<ColorPalette>
|
|
8
|
-
<ColorItem
|
|
9
|
-
title="color.density"
|
|
10
|
-
subtitle="Lorem ispum"
|
|
11
|
-
colors={{ Density: '#4d525b'}}
|
|
12
|
-
/>
|
|
13
|
-
<ColorItem
|
|
14
|
-
title="color.label"
|
|
15
|
-
subtitle="Lorem ispum"
|
|
16
|
-
colors={{ Label: '#9095a8'}}
|
|
17
|
-
/>
|
|
18
|
-
<ColorItem
|
|
19
|
-
title="color.neptune"
|
|
20
|
-
subtitle="Lorem ispum"
|
|
21
|
-
colors={{ Neptune: '#bff6f8'}}
|
|
22
|
-
/>
|
|
23
|
-
<ColorItem
|
|
24
|
-
title="color.jupiter"
|
|
25
|
-
subtitle="Lorem ispum"
|
|
26
|
-
colors={{ Jupiter: '#eeeff1'}}
|
|
27
|
-
/>
|
|
28
|
-
<ColorItem
|
|
29
|
-
title="color.gray"
|
|
30
|
-
subtitle="Shades of gray"
|
|
31
|
-
colors={{ 'gray-1': '#333333', 'gray-2': '#4f4f4f', 'gray-3': '#828282', 'gray-4': '#bdbdbd', 'gray-5': '#e0e0e0', 'gray-6': '#f2f2f2' }}
|
|
32
|
-
/>
|
|
33
|
-
</ColorPalette>
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Meta, Title, IconGallery, IconItem } from '@storybook/addon-docs/';
|
|
2
|
-
|
|
3
|
-
import { Icon as IconExample } from '.';
|
|
4
|
-
|
|
5
|
-
<Meta title="Iconography" />
|
|
6
|
-
|
|
7
|
-
# Iconography
|
|
8
|
-
|
|
9
|
-
<IconGallery>
|
|
10
|
-
<IconItem name="Arrow" >
|
|
11
|
-
<IconExample.Arrow />
|
|
12
|
-
</IconItem>
|
|
13
|
-
|
|
14
|
-
<IconItem name="Cancel" >
|
|
15
|
-
<IconExample.Cancel />
|
|
16
|
-
</IconItem>
|
|
17
|
-
|
|
18
|
-
<IconItem name="Dots">
|
|
19
|
-
<IconExample.Dots />
|
|
20
|
-
</IconItem>
|
|
21
|
-
|
|
22
|
-
<IconItem name="Glasses" >
|
|
23
|
-
<IconExample.Glasses />
|
|
24
|
-
</IconItem>
|
|
25
|
-
|
|
26
|
-
<IconItem name="GraphQL" >
|
|
27
|
-
<IconExample.GraphQL />
|
|
28
|
-
</IconItem>
|
|
29
|
-
|
|
30
|
-
<IconItem name="NailPolish" >
|
|
31
|
-
<IconExample.NailPolish />
|
|
32
|
-
</IconItem>
|
|
33
|
-
|
|
34
|
-
<IconItem name="Error" >
|
|
35
|
-
<IconExample.Error />
|
|
36
|
-
</IconItem>
|
|
37
|
-
|
|
38
|
-
<IconItem name="Info" >
|
|
39
|
-
<IconExample.Info />
|
|
40
|
-
</IconItem>
|
|
41
|
-
|
|
42
|
-
<IconItem name="Warning" >
|
|
43
|
-
<IconExample.Warning />
|
|
44
|
-
</IconItem>
|
|
45
|
-
</IconGallery>
|
package/src/icons/dots.tsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { forwardRef, SVGProps } from 'react';
|
|
2
|
-
|
|
3
|
-
type DotsProps = SVGProps<SVGSVGElement>;
|
|
4
|
-
type DotsRef = SVGSVGElement;
|
|
5
|
-
|
|
6
|
-
export const Dots = forwardRef<DotsRef, DotsProps>((delegated, ref) => {
|
|
7
|
-
return (
|
|
8
|
-
<svg
|
|
9
|
-
ref={ref}
|
|
10
|
-
width="20"
|
|
11
|
-
height="20"
|
|
12
|
-
viewBox="0 0 20 20"
|
|
13
|
-
fill="none"
|
|
14
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
-
{...delegated}
|
|
16
|
-
>
|
|
17
|
-
<circle cx="10" cy="5" r="1.7857" fill="#9095A8" />
|
|
18
|
-
<circle cx="10" cy="10" r="1.7857" fill="#9095A8" />
|
|
19
|
-
<circle cx="10" cy="15" r="1.7857" fill="#9095A8" />
|
|
20
|
-
</svg>
|
|
21
|
-
);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
Dots.displayName = 'DotsIcon';
|
package/src/icons/error.tsx
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { forwardRef, SVGProps } from 'react';
|
|
2
|
-
|
|
3
|
-
type ErrorProps = SVGProps<SVGSVGElement>;
|
|
4
|
-
type ErrorRef = SVGSVGElement;
|
|
5
|
-
|
|
6
|
-
export const Error = forwardRef<ErrorRef, ErrorProps>((delegated, ref) => {
|
|
7
|
-
return (
|
|
8
|
-
<svg
|
|
9
|
-
ref={ref}
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
width="22"
|
|
12
|
-
height="22"
|
|
13
|
-
fill="none"
|
|
14
|
-
viewBox="0 0 22 22"
|
|
15
|
-
{...delegated}
|
|
16
|
-
>
|
|
17
|
-
<path
|
|
18
|
-
fill="#DD1367"
|
|
19
|
-
d="M20.83 11c0 5.43-4.4 9.83-9.83 9.83S1.17 16.43 1.17 11 5.57 1.17 11 1.17s9.83 4.4 9.83 9.83Z"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
fill="#528693"
|
|
23
|
-
fillRule="evenodd"
|
|
24
|
-
d="M21.431 11c0 5.76-4.67 10.43-10.43 10.43C5.238 21.43.568 16.76.568 11S5.24.57 11 .57C16.76.57 21.431 5.24 21.431 11Zm-10.43 9.83c5.429 0 9.83-4.4 9.83-9.83s-4.401-9.83-9.83-9.83c-5.43 0-9.832 4.4-9.832 9.83S5.571 20.83 11 20.83Z"
|
|
25
|
-
clipRule="evenodd"
|
|
26
|
-
/>
|
|
27
|
-
<path
|
|
28
|
-
fill="#fff"
|
|
29
|
-
fillRule="evenodd"
|
|
30
|
-
d="m7.364 13.479 1.157 1.157L11 12.158l2.479 2.478 1.157-1.157L12.158 11l2.478-2.479-1.157-1.157-2.48 2.478-2.478-2.478L7.364 8.52 9.842 11l-2.478 2.479Z"
|
|
31
|
-
clipRule="evenodd"
|
|
32
|
-
/>
|
|
33
|
-
<path
|
|
34
|
-
fill="#528693"
|
|
35
|
-
fillRule="evenodd"
|
|
36
|
-
d="M6.94 13.903a.6.6 0 0 1 0-.849L8.994 11 6.94 8.946a.6.6 0 0 1 0-.849L8.097 6.94a.6.6 0 0 1 .849 0L11 8.994l2.054-2.054a.6.6 0 0 1 .849 0l1.157 1.157a.6.6 0 0 1 0 .849L13.006 11l2.054 2.054a.6.6 0 0 1 0 .849l-1.157 1.157a.6.6 0 0 1-.849 0L11 13.006 8.946 15.06a.6.6 0 0 1-.849 0L6.94 13.903ZM11 12.158l2.479 2.478 1.157-1.157L12.158 11l2.478-2.479-1.157-1.157L11 9.842 8.521 7.364 7.364 8.52 9.842 11l-2.478 2.479 1.157 1.157L11 12.158Z"
|
|
37
|
-
clipRule="evenodd"
|
|
38
|
-
/>
|
|
39
|
-
</svg>
|
|
40
|
-
);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
Error.displayName = 'ErrorIcon';
|
package/src/icons/info.tsx
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { forwardRef, SVGProps } from 'react';
|
|
2
|
-
|
|
3
|
-
type InfoProps = SVGProps<SVGSVGElement>;
|
|
4
|
-
type InfoRef = SVGSVGElement;
|
|
5
|
-
|
|
6
|
-
export const Info = forwardRef<InfoRef, InfoProps>((delegated, ref) => {
|
|
7
|
-
return (
|
|
8
|
-
<svg
|
|
9
|
-
ref={ref}
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
width="22"
|
|
12
|
-
height="22"
|
|
13
|
-
fill="none"
|
|
14
|
-
viewBox="0 0 22 22"
|
|
15
|
-
{...delegated}
|
|
16
|
-
>
|
|
17
|
-
<path
|
|
18
|
-
fill="#BFF6F8"
|
|
19
|
-
d="M20.83 11c0 5.43-4.4 9.83-9.83 9.83S1.17 16.43 1.17 11 5.57 1.17 11 1.17s9.83 4.4 9.83 9.83Z"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
fill="#528693"
|
|
23
|
-
fillRule="evenodd"
|
|
24
|
-
d="M21.431 11c0 5.76-4.67 10.43-10.43 10.43C5.238 21.43.568 16.76.568 11S5.24.57 11 .57C16.76.57 21.431 5.24 21.431 11Zm-10.43 9.83c5.429 0 9.83-4.4 9.83-9.83s-4.401-9.83-9.83-9.83c-5.43 0-9.832 4.4-9.832 9.83S5.571 20.83 11 20.83Z"
|
|
25
|
-
clipRule="evenodd"
|
|
26
|
-
/>
|
|
27
|
-
<path fill="#fff" d="M14.814 6.317a.991.991 0 1 1-1.983 0 .991.991 0 0 1 1.983 0Z" />
|
|
28
|
-
<path
|
|
29
|
-
fill="#528693"
|
|
30
|
-
fillRule="evenodd"
|
|
31
|
-
d="M15.415 6.317a1.592 1.592 0 1 1-3.184 0 1.592 1.592 0 0 1 3.184 0Zm-1.592.991a.991.991 0 1 0 0-1.982.991.991 0 0 0 0 1.982Z"
|
|
32
|
-
clipRule="evenodd"
|
|
33
|
-
/>
|
|
34
|
-
<path
|
|
35
|
-
fill="#fff"
|
|
36
|
-
d="m9.37 16.049 1.8.26-.22-.7-.78-.621.56-1.14 2.261-3.382-.34-1.381-1.92-1-1.261.14-.28.32 1.08.54.14.54-2.22 2.862-.821 2.36 2 1.202Z"
|
|
37
|
-
/>
|
|
38
|
-
<path
|
|
39
|
-
fill="#528693"
|
|
40
|
-
d="M10.476 16.666a4.93 4.93 0 0 1-2.096-.599c-1.114-.605-1.482-1.63-.961-2.673a9.606 9.606 0 0 1 1.437-1.963l.067-.077c.252-.293.513-.595.742-.897.288-.38.538-.745.443-1.031-.056-.164-.215-.282-.485-.362a1.58 1.58 0 0 0-.247-.033l-.055-.004a.984.984 0 0 1-.481-.096c-.169-.132-.098-.51-.013-.676a.915.915 0 0 1 .701-.473c.139-.025.28-.037.42-.035.656.034 1.301.176 1.91.42 1.104.424 1.631 1.263 1.41 2.244a4.193 4.193 0 0 1-.908 1.714c-.128.161-.26.315-.392.471l-.07.083c-.282.32-.544.654-.788 1.003l-.144.206c-.161.209-.291.44-.385.687a.582.582 0 0 0 .32.743.91.91 0 0 0 .32.08c.175.021.356.044.428.21a.575.575 0 0 1-.035.477 1.144 1.144 0 0 1-1.138.581Zm-.877-8.193c.128.079.268.136.414.17.18.04.35.12.494.236.58.552.14 1.272-.318 1.903-.214.292-.47.58-.74.884l-.068.077c-.624.692-1.27 1.408-1.497 2.232a1.148 1.148 0 0 0 .163 1.06c.493.658 1.78.907 2.819.921l.035-.05-.025-.035a1.248 1.248 0 0 1-.865-.594 1.04 1.04 0 0 1 .006-.894 8.071 8.071 0 0 1 1.309-1.977l.127-.155c.171-.21.356-.437.525-.665.371-.501.844-1.245.664-1.915-.315-1.173-2.15-1.209-3.03-1.226h-.057l.044.028Z"
|
|
41
|
-
/>
|
|
42
|
-
</svg>
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
Info.displayName = 'InfoIcon';
|
package/src/icons/warning.tsx
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { forwardRef, SVGProps } from 'react';
|
|
2
|
-
|
|
3
|
-
type WarningProps = SVGProps<SVGSVGElement>;
|
|
4
|
-
type WarningRef = SVGSVGElement;
|
|
5
|
-
|
|
6
|
-
export const Warning = forwardRef<WarningRef, WarningProps>((delegated, ref) => {
|
|
7
|
-
return (
|
|
8
|
-
<svg
|
|
9
|
-
ref={ref}
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
width="22"
|
|
12
|
-
height="22"
|
|
13
|
-
fill="none"
|
|
14
|
-
viewBox="0 0 22 22"
|
|
15
|
-
{...delegated}
|
|
16
|
-
>
|
|
17
|
-
<path
|
|
18
|
-
fill="#FFDE99"
|
|
19
|
-
d="M20.83 11c0 5.43-4.4 9.83-9.83 9.83S1.17 16.43 1.17 11 5.57 1.17 11 1.17s9.83 4.4 9.83 9.83Z"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
fill="#528693"
|
|
23
|
-
fillRule="evenodd"
|
|
24
|
-
d="M21.43 11c0 5.76-4.67 10.43-10.43 10.43S.57 16.76.57 11 5.24.57 11 .57 21.43 5.24 21.43 11ZM11 20.83c5.43 0 9.83-4.4 9.83-9.83S16.43 1.17 11 1.17 1.17 5.57 1.17 11s4.4 9.83 9.83 9.83Z"
|
|
25
|
-
clipRule="evenodd"
|
|
26
|
-
/>
|
|
27
|
-
<path
|
|
28
|
-
fill="#fff"
|
|
29
|
-
d="M10.077 5.232c.41-.71 1.436-.71 1.846 0L17 14.025c.41.71-.103 1.599-.924 1.599H5.923c-.82 0-1.333-.889-.923-1.6l5.077-8.792Z"
|
|
30
|
-
/>
|
|
31
|
-
<path
|
|
32
|
-
fill="#528693"
|
|
33
|
-
fillRule="evenodd"
|
|
34
|
-
d="m16.48 14.325-5.077-8.793a.466.466 0 0 0-.806 0L5.52 14.325c-.18.31.045.699.403.699h10.153a.466.466 0 0 0 .404-.7Zm-4.557-9.093a1.066 1.066 0 0 0-1.846 0L5 14.025c-.41.71.103 1.599.923 1.599h10.153c.821 0 1.334-.889.924-1.6l-5.077-8.792Z"
|
|
35
|
-
clipRule="evenodd"
|
|
36
|
-
/>
|
|
37
|
-
<path fill="#FFDE99" d="M10.588 8.628a.5.5 0 1 1 1 0v2.475a.5.5 0 0 1-1 0V8.628Z" />
|
|
38
|
-
<path
|
|
39
|
-
fill="#528693"
|
|
40
|
-
fillRule="evenodd"
|
|
41
|
-
d="M12.188 8.628v2.475a1.1 1.1 0 0 1-2.2 0V8.628a1.1 1.1 0 1 1 2.2 0Zm-1.1-.5a.5.5 0 0 0-.5.5v2.475a.5.5 0 1 0 1 0V8.628a.5.5 0 0 0-.5-.5Z"
|
|
42
|
-
clipRule="evenodd"
|
|
43
|
-
/>
|
|
44
|
-
<path fill="#FFDE99" d="M11.588 13.403a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z" />
|
|
45
|
-
<path
|
|
46
|
-
fill="#528693"
|
|
47
|
-
fillRule="evenodd"
|
|
48
|
-
d="M12.188 13.403a1.1 1.1 0 1 1-2.2 0 1.1 1.1 0 0 1 2.2 0Zm-1.1.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z"
|
|
49
|
-
clipRule="evenodd"
|
|
50
|
-
/>
|
|
51
|
-
</svg>
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
Warning.displayName = 'WarningIcon';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { TextField } from '.';
|
|
4
|
-
|
|
5
|
-
const meta: Meta<typeof TextField> = {
|
|
6
|
-
title: 'Components/TextField',
|
|
7
|
-
component: TextField,
|
|
8
|
-
argTypes: {},
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export default meta;
|
|
12
|
-
|
|
13
|
-
type Story = StoryObj<typeof TextField>;
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
args: {
|
|
17
|
-
placeholder: 'Luke Skywalker',
|
|
18
|
-
label: 'Name',
|
|
19
|
-
},
|
|
20
|
-
};
|
package/src/text-field/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TextField } from './text-field';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, forwardRef, ReactNode } from 'react';
|
|
2
|
-
import { cva, VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
import { Input } from '../input';
|
|
5
|
-
|
|
6
|
-
type TextFieldStylesProps = VariantProps<typeof textFieldStyles>;
|
|
7
|
-
const textFieldStyles = cva(
|
|
8
|
-
['relative gap-3 flex flex-col p-3 text-sm font-medium text-gray-400 rounded border border-transparent border-solid'],
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
outlined: '',
|
|
13
|
-
filled: '',
|
|
14
|
-
standard: '',
|
|
15
|
-
},
|
|
16
|
-
raised: {
|
|
17
|
-
sm: 'shadow-sm',
|
|
18
|
-
md: 'shadow-md',
|
|
19
|
-
lg: 'shadow-lg',
|
|
20
|
-
},
|
|
21
|
-
paper: {
|
|
22
|
-
white: 'bg-white',
|
|
23
|
-
gray: 'bg-jupiter',
|
|
24
|
-
},
|
|
25
|
-
error: {
|
|
26
|
-
true: 'border-rose-800 text-rose-800',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: 'standard',
|
|
31
|
-
paper: 'white',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
export type TextFieldProps = Omit<TextFieldStylesProps, 'error'> & {
|
|
37
|
-
label: string;
|
|
38
|
-
startAdornment?: ReactNode;
|
|
39
|
-
endAdornment?: ReactNode;
|
|
40
|
-
error?: string;
|
|
41
|
-
} & ComponentPropsWithRef<'input'>;
|
|
42
|
-
|
|
43
|
-
export type TextFieldRef = HTMLInputElement;
|
|
44
|
-
|
|
45
|
-
export const TextField = forwardRef<TextFieldRef, TextFieldProps>(
|
|
46
|
-
({ variant, raised, className, label, paper, endAdornment, error, ...delegated }, ref) => {
|
|
47
|
-
return (
|
|
48
|
-
<>
|
|
49
|
-
<label className={textFieldStyles({ variant, raised, paper, error: Boolean(error), className })}>
|
|
50
|
-
{label}
|
|
51
|
-
<Input ref={ref} className="w-10/12 text-ellipsis overflow-hidden" type="text" {...delegated} />
|
|
52
|
-
<div className="absolute right-1 top-2/3 -translate-y-1/2 ">{endAdornment}</div>
|
|
53
|
-
</label>
|
|
54
|
-
{error && <div className="text-rose-800 text-sm px-3 !mt-1">{error}</div>}
|
|
55
|
-
</>
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
TextField.displayName = 'TextField';
|