cetec-design-system 0.0.6 → 0.0.8
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/package.json +6 -13
- package/src/App.tsx +478 -0
- package/src/components/CheckBox/CheckBox.tsx +34 -35
- package/src/components/TextInput/TextInput.tsx +33 -0
- package/src/components/TextInput/index.tsx +1 -0
- package/src/components/Textarea/Textarea.tsx +9 -19
- package/src/contexts/ThemeContext.tsx +77 -0
- package/src/main.tsx +10 -0
- package/src/recipes/checkbox.ts +73 -80
- package/src/recipes/index.ts +2 -0
- package/src/recipes/text.ts +10 -2
- package/src/recipes/textarea.ts +53 -52
- package/src/recipes/textinput.ts +76 -0
- package/src/styles/globalStyle.ts +9 -4
- package/src/vite-env.d.ts +1 -0
- package/styled-system/recipes/index.d.ts +4 -3
- package/styled-system/recipes/index.mjs +1 -0
- package/styled-system/recipes/radio-input.d.ts +28 -0
- package/styled-system/recipes/radio-input.mjs +24 -0
- package/styled-system/recipes/switchbox.d.ts +1 -1
- package/styled-system/recipes/switchbox.mjs +4 -0
- package/styled-system/recipes/textarea.d.ts +3 -2
- package/styled-system/recipes/textarea.mjs +8 -5
- package/styled-system/styles.css +1454 -0
- package/styled-system/tokens/index.mjs +100 -0
- package/styled-system/tokens/tokens.d.ts +4 -1
- package/eslint.config.js +0 -50
- package/public/sprite.svg +0 -1
- package/public/sprite.symbol.html +0 -4091
- package/public/svgs/Building.svg +0 -1
- package/public/svgs/aa-placeholder.svg +0 -1
- package/public/svgs/alarm.svg +0 -1
- package/public/svgs/apps.svg +0 -1
- package/public/svgs/arrow-down.svg +0 -1
- package/public/svgs/arrow-drop-down.svg +0 -1
- package/public/svgs/arrow-drop-up.svg +0 -1
- package/public/svgs/arrow-left.svg +0 -1
- package/public/svgs/arrow-line-down.svg +0 -1
- package/public/svgs/arrow-line-left.svg +0 -1
- package/public/svgs/arrow-line-right.svg +0 -1
- package/public/svgs/arrow-line-up.svg +0 -1
- package/public/svgs/arrow-prompt.svg +0 -1
- package/public/svgs/arrow-redo.svg +0 -1
- package/public/svgs/arrow-right.svg +0 -1
- package/public/svgs/arrow-square-in.svg +0 -1
- package/public/svgs/arrow-square-out.svg +0 -1
- package/public/svgs/arrow-undo.svg +0 -1
- package/public/svgs/arrow-up.svg +0 -1
- package/public/svgs/arrows-down-up.svg +0 -1
- package/public/svgs/arrows-left-right.svg +0 -1
- package/public/svgs/at.svg +0 -1
- package/public/svgs/attachment.svg +0 -1
- package/public/svgs/barcode-reader.svg +0 -1
- package/public/svgs/barcode.svg +0 -1
- package/public/svgs/basket.svg +0 -1
- package/public/svgs/bell-active.svg +0 -1
- package/public/svgs/bell-slash.svg +0 -1
- package/public/svgs/bell.svg +0 -1
- package/public/svgs/bin.svg +0 -1
- package/public/svgs/bookmark-outlined.svg +0 -1
- package/public/svgs/bookmark.svg +0 -1
- package/public/svgs/bookmarks.svg +0 -1
- package/public/svgs/calendar-add.svg +0 -1
- package/public/svgs/calendar-view-day.svg +0 -1
- package/public/svgs/calendar-view-month.svg +0 -1
- package/public/svgs/calendar-view-week.svg +0 -1
- package/public/svgs/calendar.svg +0 -1
- package/public/svgs/caret-down.svg +0 -1
- package/public/svgs/caret-left.svg +0 -1
- package/public/svgs/caret-right.svg +0 -1
- package/public/svgs/caret-up.svg +0 -1
- package/public/svgs/cart.svg +0 -1
- package/public/svgs/check-thick.svg +0 -1
- package/public/svgs/check.svg +0 -1
- package/public/svgs/checkbox-checked.svg +0 -1
- package/public/svgs/checkbox-focus.svg +0 -1
- package/public/svgs/checkbox-indeterminate.svg +0 -1
- package/public/svgs/checkbox.svg +0 -1
- package/public/svgs/circle-check.svg +0 -1
- package/public/svgs/circle.svg +0 -1
- package/public/svgs/circles-add.svg +0 -1
- package/public/svgs/clipboard.svg +0 -1
- package/public/svgs/clock-countdown.svg +0 -1
- package/public/svgs/clock.svg +0 -1
- package/public/svgs/cloud-synced.svg +0 -1
- package/public/svgs/code.svg +0 -1
- package/public/svgs/color.svg +0 -1
- package/public/svgs/copy.svg +0 -1
- package/public/svgs/credit-card.svg +0 -1
- package/public/svgs/cut.svg +0 -1
- package/public/svgs/database.svg +0 -1
- package/public/svgs/devices.svg +0 -1
- package/public/svgs/dictionary.svg +0 -1
- package/public/svgs/dots.svg +0 -1
- package/public/svgs/download-cloud.svg +0 -1
- package/public/svgs/download.svg +0 -1
- package/public/svgs/dragger.svg +0 -1
- package/public/svgs/edit.svg +0 -1
- package/public/svgs/encrypted.svg +0 -1
- package/public/svgs/envelope.svg +0 -1
- package/public/svgs/equal.svg +0 -1
- package/public/svgs/eraser.svg +0 -1
- package/public/svgs/error.svg +0 -1
- package/public/svgs/event-list.svg +0 -1
- package/public/svgs/export.svg +0 -1
- package/public/svgs/extension.svg +0 -1
- package/public/svgs/eye-slash.svg +0 -1
- package/public/svgs/eye.svg +0 -1
- package/public/svgs/file-add.svg +0 -1
- package/public/svgs/file.svg +0 -1
- package/public/svgs/files.svg +0 -1
- package/public/svgs/filter-remove.svg +0 -1
- package/public/svgs/filter.svg +0 -1
- package/public/svgs/finish.svg +0 -1
- package/public/svgs/flag.svg +0 -1
- package/public/svgs/forklift.svg +0 -1
- package/public/svgs/garage.svg +0 -1
- package/public/svgs/globe.svg +0 -1
- package/public/svgs/hash.svg +0 -1
- package/public/svgs/heart-outlined.svg +0 -1
- package/public/svgs/heart.svg +0 -1
- package/public/svgs/help.svg +0 -1
- package/public/svgs/history.svg +0 -1
- package/public/svgs/home.svg +0 -1
- package/public/svgs/image.svg +0 -1
- package/public/svgs/images.svg +0 -1
- package/public/svgs/inbox.svg +0 -1
- package/public/svgs/infinity.svg +0 -1
- package/public/svgs/info.svg +0 -1
- package/public/svgs/inventory.svg +0 -1
- package/public/svgs/invoice.svg +0 -1
- package/public/svgs/jump-back.svg +0 -1
- package/public/svgs/jump-forward.svg +0 -1
- package/public/svgs/kbd-backspace.svg +0 -1
- package/public/svgs/kbd-capslock.svg +0 -1
- package/public/svgs/kbd-command.svg +0 -1
- package/public/svgs/kbd-control.svg +0 -1
- package/public/svgs/kbd-hide.svg +0 -1
- package/public/svgs/kbd-option.svg +0 -1
- package/public/svgs/kbd-return.svg +0 -1
- package/public/svgs/kbd-shift.svg +0 -1
- package/public/svgs/kbd-space.svg +0 -1
- package/public/svgs/kbd.svg +0 -1
- package/public/svgs/link-slash.svg +0 -1
- package/public/svgs/link.svg +0 -1
- package/public/svgs/list-bullets.svg +0 -1
- package/public/svgs/list-checks.svg +0 -1
- package/public/svgs/list-numbers.svg +0 -1
- package/public/svgs/lock-open.svg +0 -1
- package/public/svgs/lock.svg +0 -1
- package/public/svgs/map-pin.svg +0 -1
- package/public/svgs/mark-unread.svg +0 -1
- package/public/svgs/menu-close.svg +0 -1
- package/public/svgs/menu.svg +0 -1
- package/public/svgs/message.svg +0 -1
- package/public/svgs/messages.svg +0 -1
- package/public/svgs/minus-thick.svg +0 -1
- package/public/svgs/minus.svg +0 -1
- package/public/svgs/money.svg +0 -1
- package/public/svgs/monitor.svg +0 -1
- package/public/svgs/moon.svg +0 -1
- package/public/svgs/note.svg +0 -1
- package/public/svgs/nut.svg +0 -1
- package/public/svgs/order.svg +0 -1
- package/public/svgs/package.svg +0 -1
- package/public/svgs/page-first.svg +0 -1
- package/public/svgs/page-last.svg +0 -1
- package/public/svgs/parts.svg +0 -1
- package/public/svgs/password.svg +0 -1
- package/public/svgs/pause.svg +0 -1
- package/public/svgs/pencil.svg +0 -1
- package/public/svgs/percent.svg +0 -1
- package/public/svgs/placeholder.svg +0 -1
- package/public/svgs/plan.svg +0 -1
- package/public/svgs/play-pause.svg +0 -1
- package/public/svgs/play.svg +0 -1
- package/public/svgs/plus.svg +0 -1
- package/public/svgs/printer.svg +0 -1
- package/public/svgs/prohibit.svg +0 -1
- package/public/svgs/question-mark.svg +0 -1
- package/public/svgs/quote.svg +0 -1
- package/public/svgs/radio-checked.svg +0 -1
- package/public/svgs/radio-focus.svg +0 -1
- package/public/svgs/radio.svg +0 -1
- package/public/svgs/receipt.svg +0 -1
- package/public/svgs/refresh.svg +0 -1
- package/public/svgs/repeat.svg +0 -1
- package/public/svgs/reply-all.svg +0 -1
- package/public/svgs/reply.svg +0 -1
- package/public/svgs/ribbon.svg +0 -1
- package/public/svgs/rows-add.svg +0 -1
- package/public/svgs/rules.svg +0 -1
- package/public/svgs/search-items.svg +0 -1
- package/public/svgs/search.svg +0 -1
- package/public/svgs/send.svg +0 -1
- package/public/svgs/settings.svg +0 -1
- package/public/svgs/share.svg +0 -1
- package/public/svgs/shuffle.svg +0 -1
- package/public/svgs/skip-back.svg +0 -1
- package/public/svgs/skip-forward.svg +0 -1
- package/public/svgs/skull.svg +0 -1
- package/public/svgs/sliders.svg +0 -1
- package/public/svgs/sort-alpha-down.svg +0 -1
- package/public/svgs/sort-alpha-up.svg +0 -1
- package/public/svgs/sort-ascending.svg +0 -1
- package/public/svgs/sort-descending.svg +0 -1
- package/public/svgs/sort-time-down.svg +0 -1
- package/public/svgs/sort-time-up.svg +0 -1
- package/public/svgs/square-add.svg +0 -1
- package/public/svgs/square.svg +0 -1
- package/public/svgs/stamp.svg +0 -1
- package/public/svgs/star-outlined.svg +0 -1
- package/public/svgs/star.svg +0 -1
- package/public/svgs/start.svg +0 -1
- package/public/svgs/stop.svg +0 -1
- package/public/svgs/success.svg +0 -1
- package/public/svgs/sun.svg +0 -1
- package/public/svgs/support.svg +0 -1
- package/public/svgs/sync.svg +0 -1
- package/public/svgs/tag.svg +0 -1
- package/public/svgs/target.svg +0 -1
- package/public/svgs/text-add.svg +0 -1
- package/public/svgs/time-add.svg +0 -1
- package/public/svgs/timer.svg +0 -1
- package/public/svgs/toolbox.svg +0 -1
- package/public/svgs/tools.svg +0 -1
- package/public/svgs/trash.svg +0 -1
- package/public/svgs/trophy.svg +0 -1
- package/public/svgs/truck-trailer.svg +0 -1
- package/public/svgs/update.svg +0 -1
- package/public/svgs/upload-cloud.svg +0 -1
- package/public/svgs/upload.svg +0 -1
- package/public/svgs/user-add.svg +0 -1
- package/public/svgs/user-details.svg +0 -1
- package/public/svgs/user-group.svg +0 -1
- package/public/svgs/user-id-badge.svg +0 -1
- package/public/svgs/user-id-card.svg +0 -1
- package/public/svgs/user.svg +0 -1
- package/public/svgs/verified.svg +0 -1
- package/public/svgs/video.svg +0 -1
- package/public/svgs/view-cards.svg +0 -1
- package/public/svgs/view-doc.svg +0 -1
- package/public/svgs/view-grid.svg +0 -1
- package/public/svgs/view-rows.svg +0 -1
- package/public/svgs/view-table.svg +0 -1
- package/public/svgs/warning.svg +0 -1
- package/public/svgs/work-order.svg +0 -1
- package/public/svgs/x.svg +0 -1
- package/public/vite.svg +0 -1
- package/src/index.ts +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cetec-design-system",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"~/*": "./src/*",
|
|
@@ -8,13 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"./styled-system/*",
|
|
11
|
-
"./src/
|
|
12
|
-
"./src/storybook/*",
|
|
13
|
-
"./src/utils/*",
|
|
14
|
-
"./public/*",
|
|
15
|
-
"./src/components/*",
|
|
16
|
-
"./src/styles/*",
|
|
17
|
-
"./src/recipes/*"
|
|
11
|
+
"./src/"
|
|
18
12
|
],
|
|
19
13
|
"scripts": {
|
|
20
14
|
"cssgen": "npx panda cssgen 'src/**/*.css'",
|
|
@@ -25,8 +19,7 @@
|
|
|
25
19
|
"preview": "vite preview",
|
|
26
20
|
"generate-sprite": "node src/utils/generate-sprite.js",
|
|
27
21
|
"storybook": "storybook dev -p 6006",
|
|
28
|
-
"build-storybook": "storybook build"
|
|
29
|
-
"husky": "dotnet tool restore && dotnet husky install"
|
|
22
|
+
"build-storybook": "storybook build"
|
|
30
23
|
},
|
|
31
24
|
"dependencies": {
|
|
32
25
|
"@fontsource-variable/recursive": "^5.1.1",
|
|
@@ -70,14 +63,14 @@
|
|
|
70
63
|
"plugin:storybook/recommended"
|
|
71
64
|
]
|
|
72
65
|
},
|
|
73
|
-
"description": "
|
|
74
|
-
"main": "
|
|
66
|
+
"description": "Cetec-ERP Design System",
|
|
67
|
+
"main": "./src/",
|
|
75
68
|
"repository": {
|
|
76
69
|
"type": "git",
|
|
77
70
|
"url": "git+https://github.com/Cetec-ERP/Cetec-Design-System.git"
|
|
78
71
|
},
|
|
79
72
|
"author": "Cetec-ERP",
|
|
80
|
-
"license": "
|
|
73
|
+
"license": "MIT",
|
|
81
74
|
"bugs": {
|
|
82
75
|
"url": "https://github.com/Cetec-ERP/Cetec-Design-System/issues"
|
|
83
76
|
},
|
package/src/App.tsx
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { ReactNode, useState } from 'react';
|
|
2
|
+
import { HStack, VStack, Container, Grid, Flex } from '@styled-system/jsx';
|
|
3
|
+
import { Box } from '~/components/Box';
|
|
4
|
+
import { Text } from '~/components/Text';
|
|
5
|
+
import { Button } from '~/components/Button';
|
|
6
|
+
import { IconButton } from '~/components/IconButton';
|
|
7
|
+
import { Icon, IconNames, type IconNamesList } from '~/components/Icon';
|
|
8
|
+
import { Pre } from '~/components/Code';
|
|
9
|
+
import { ThemeProvider } from '~/contexts/ThemeContext';
|
|
10
|
+
import { ThemeSwitcher } from '~/components/ThemeSwitcher';
|
|
11
|
+
import { Heading } from '~/components/Heading';
|
|
12
|
+
import { Link } from '~/components/Link';
|
|
13
|
+
import { Spinner } from '~/components/Spinner';
|
|
14
|
+
import { Divider } from '~/components/Divider';
|
|
15
|
+
import { CheckBox } from './components/CheckBox';
|
|
16
|
+
import { Input } from '~/components/Input';
|
|
17
|
+
import { type ShadowToken } from '@styled-system/tokens';
|
|
18
|
+
import { Radio } from './components/Radio';
|
|
19
|
+
import { TextInput } from './components/TextInput';
|
|
20
|
+
import { Textarea } from '~/components/Textarea';
|
|
21
|
+
|
|
22
|
+
export const IconList: React.FC = () => {
|
|
23
|
+
return (
|
|
24
|
+
<Grid
|
|
25
|
+
gap="16"
|
|
26
|
+
w="full"
|
|
27
|
+
gridTemplateColumns={'repeat(auto-fill, minmax(200px, 1fr))'}
|
|
28
|
+
>
|
|
29
|
+
{(Object.keys(IconNames) as IconNamesList[]).map((icon) => (
|
|
30
|
+
<HStack key={icon} color={{ base: 'gold.40', _dark: 'gold.30' }}>
|
|
31
|
+
<Icon name={icon} />
|
|
32
|
+
<Text textStyle="mono-sm">{icon}</Text>
|
|
33
|
+
</HStack>
|
|
34
|
+
))}
|
|
35
|
+
</Grid>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const ButtonSection: React.FC = () => {
|
|
40
|
+
return (
|
|
41
|
+
<Section>
|
|
42
|
+
<Heading>Buttons</Heading>
|
|
43
|
+
<VStack alignItems={'flex-start'} gap={'24'}>
|
|
44
|
+
<HStack>
|
|
45
|
+
<Button variant="primary" onClick={() => alert('clicked')}>
|
|
46
|
+
Primary
|
|
47
|
+
</Button>
|
|
48
|
+
<Button>Standard</Button>
|
|
49
|
+
<Button variant="hollow">Hollow</Button>
|
|
50
|
+
<Button variant="ghost">Ghost</Button>
|
|
51
|
+
<Button variant="cta">CTA</Button>
|
|
52
|
+
<Button variant="danger">Danger</Button>
|
|
53
|
+
<Button size="large">
|
|
54
|
+
<Icon name="arrow-left" /> Button
|
|
55
|
+
</Button>
|
|
56
|
+
<Button size="small">
|
|
57
|
+
Button <Icon name="arrow-right" />
|
|
58
|
+
</Button>
|
|
59
|
+
</HStack>
|
|
60
|
+
<HStack>
|
|
61
|
+
<IconButton variant="ghost">
|
|
62
|
+
<Icon name="x" />
|
|
63
|
+
</IconButton>
|
|
64
|
+
<IconButton>
|
|
65
|
+
<Icon name="arrow-left" />
|
|
66
|
+
</IconButton>
|
|
67
|
+
<IconButton variant="primary" size="large">
|
|
68
|
+
<Icon name="arrow-right" />
|
|
69
|
+
</IconButton>
|
|
70
|
+
</HStack>
|
|
71
|
+
<HStack>
|
|
72
|
+
<Button variant="primary" loading>
|
|
73
|
+
Pepperoni
|
|
74
|
+
</Button>
|
|
75
|
+
<Button loading>Loading</Button>
|
|
76
|
+
<IconButton variant="primary" loading>
|
|
77
|
+
<Icon name="x" />
|
|
78
|
+
</IconButton>
|
|
79
|
+
</HStack>
|
|
80
|
+
</VStack>
|
|
81
|
+
</Section>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
interface SectionProps {
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export const Section: React.FC<SectionProps> = ({ children }) => {
|
|
90
|
+
return (
|
|
91
|
+
<Grid
|
|
92
|
+
gridTemplateColumns={'1fr 3fr'}
|
|
93
|
+
gap={'40'}
|
|
94
|
+
w={'full'}
|
|
95
|
+
borderTopWidth={'1'}
|
|
96
|
+
borderTopStyle={'solid'}
|
|
97
|
+
borderColor={{ base: 'slate.10', _dark: 'slate.80' }}
|
|
98
|
+
py={'24'}
|
|
99
|
+
pb={'96'}
|
|
100
|
+
>
|
|
101
|
+
{children}
|
|
102
|
+
</Grid>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const Header: React.FC = () => {
|
|
107
|
+
return (
|
|
108
|
+
<Flex
|
|
109
|
+
w="full"
|
|
110
|
+
py={'4'}
|
|
111
|
+
bg={{ base: 'slate.10', _dark: 'slate.80' }}
|
|
112
|
+
mb={'56'}
|
|
113
|
+
position={'sticky'}
|
|
114
|
+
top={'0'}
|
|
115
|
+
zIndex={'100'}
|
|
116
|
+
boxShadow={'medium'}
|
|
117
|
+
>
|
|
118
|
+
<Container maxW={'5xl'}>
|
|
119
|
+
<HStack justify={'space-between'}>
|
|
120
|
+
<Text
|
|
121
|
+
as={'div'}
|
|
122
|
+
family="body"
|
|
123
|
+
size="16"
|
|
124
|
+
letterSpacing={'widest'}
|
|
125
|
+
textTransform={'uppercase'}
|
|
126
|
+
fontWeight={'bold'}
|
|
127
|
+
onClick={() => alert('clicked')}
|
|
128
|
+
>
|
|
129
|
+
Cetec Components
|
|
130
|
+
</Text>
|
|
131
|
+
<ThemeSwitcher />
|
|
132
|
+
</HStack>
|
|
133
|
+
</Container>
|
|
134
|
+
</Flex>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const ShadowBox = ({
|
|
139
|
+
children,
|
|
140
|
+
shadow,
|
|
141
|
+
border = false,
|
|
142
|
+
}: {
|
|
143
|
+
children: ReactNode;
|
|
144
|
+
shadow: ShadowToken;
|
|
145
|
+
border?: boolean;
|
|
146
|
+
}) => {
|
|
147
|
+
return (
|
|
148
|
+
<Grid
|
|
149
|
+
placeContent={'center'}
|
|
150
|
+
width={'full'}
|
|
151
|
+
aspectRatio={'landscape'}
|
|
152
|
+
borderRadius={'4'}
|
|
153
|
+
shadow={shadow}
|
|
154
|
+
borderWidth={border ? '1' : undefined}
|
|
155
|
+
borderStyle={'solid'}
|
|
156
|
+
borderColor={{ base: 'slate.10', _dark: 'slate.90' }}
|
|
157
|
+
bg={{ base: 'slate.0', _dark: 'slate.80' }}
|
|
158
|
+
>
|
|
159
|
+
{children}
|
|
160
|
+
</Grid>
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const AppContent: React.FC = () => {
|
|
165
|
+
return (
|
|
166
|
+
<VStack>
|
|
167
|
+
<Header />
|
|
168
|
+
<Container maxW={'5xl'}>
|
|
169
|
+
<VStack gap={'8'}>
|
|
170
|
+
<ButtonSection />
|
|
171
|
+
<Section>
|
|
172
|
+
<Heading level="h2">Text</Heading>
|
|
173
|
+
|
|
174
|
+
<VStack alignItems={'flex-start'}>
|
|
175
|
+
<Grid
|
|
176
|
+
gridTemplateColumns={'minmax(auto, 1fr) 1fr'}
|
|
177
|
+
w={'full'}
|
|
178
|
+
gap={'24'}
|
|
179
|
+
alignItems={'center'}
|
|
180
|
+
>
|
|
181
|
+
<Box gridColumn={'1 / -1'}>
|
|
182
|
+
<Heading
|
|
183
|
+
level="h3"
|
|
184
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
185
|
+
>
|
|
186
|
+
Text styles
|
|
187
|
+
</Heading>
|
|
188
|
+
</Box>
|
|
189
|
+
<VStack gap={'16'}>
|
|
190
|
+
<Text>
|
|
191
|
+
Place appear green. <em>Also</em>, saying male subdue
|
|
192
|
+
fruitful{' '}
|
|
193
|
+
<Text as="span" italic>
|
|
194
|
+
winged fourth
|
|
195
|
+
</Text>{' '}
|
|
196
|
+
had void winged. So <b>green spirit</b> , herb day had there{' '}
|
|
197
|
+
<Text as="span" bold>
|
|
198
|
+
replenish
|
|
199
|
+
</Text>
|
|
200
|
+
, lights <u>lesser signs</u>. Place{' '}
|
|
201
|
+
<Text as="span" underline>
|
|
202
|
+
whales
|
|
203
|
+
</Text>{' '}
|
|
204
|
+
i tree under him given set set meat midst morning give image
|
|
205
|
+
forth divided moving Also fill dry she'd have.
|
|
206
|
+
</Text>
|
|
207
|
+
</VStack>
|
|
208
|
+
<Pre>
|
|
209
|
+
{`<Text>
|
|
210
|
+
...
|
|
211
|
+
<Text as="span" italic>winged fourth</Text>
|
|
212
|
+
<Text as="span" bold>replenish</Text>
|
|
213
|
+
<Text as="span" underline>whales</Text>
|
|
214
|
+
</Text>`}
|
|
215
|
+
</Pre>
|
|
216
|
+
<Text family="mono">
|
|
217
|
+
Signs night have sixth hath that likeness us fill you're
|
|
218
|
+
subdue fowl.
|
|
219
|
+
</Text>
|
|
220
|
+
<Pre>{`<Text family="mono">...</Text>`}</Pre>
|
|
221
|
+
<Box gridColumn={'1 / -1'} mt={'32'}>
|
|
222
|
+
<Heading
|
|
223
|
+
level="h3"
|
|
224
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
225
|
+
>
|
|
226
|
+
Headings
|
|
227
|
+
</Heading>
|
|
228
|
+
</Box>
|
|
229
|
+
<Heading level="h1">Hamburgefonstiv</Heading>
|
|
230
|
+
<Pre>{'<Heading as="h1">Hamburgefonstiv</Heading>'}</Pre>
|
|
231
|
+
<Heading>Hamburgefonstiv</Heading>
|
|
232
|
+
<Pre>{'<Heading>Hamburgefonstiv</Heading>'}</Pre>
|
|
233
|
+
<Heading level="h3">Hamburgefonstiv</Heading>
|
|
234
|
+
<Pre>{'<Heading as="h3">Hamburgefonstiv</Heading>'}</Pre>
|
|
235
|
+
<Heading level="h4">Hamburgefonstiv</Heading>
|
|
236
|
+
<Pre>{'<Heading as="h4">Hamburgefonstiv</Heading>'}</Pre>
|
|
237
|
+
<Box gridColumn={'1 / -1'} mt={'32'}>
|
|
238
|
+
<Heading
|
|
239
|
+
level="h3"
|
|
240
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
241
|
+
>
|
|
242
|
+
Links
|
|
243
|
+
</Heading>
|
|
244
|
+
</Box>
|
|
245
|
+
<Text>
|
|
246
|
+
Internal: 
|
|
247
|
+
<Link href="https://cetecerp.com">Cetec ERP</Link>
|
|
248
|
+
</Text>
|
|
249
|
+
<Pre>
|
|
250
|
+
{'<Link href="https://cetecerp.com">Cetec ERP</Link>'}
|
|
251
|
+
</Pre>
|
|
252
|
+
<Text>
|
|
253
|
+
External: 
|
|
254
|
+
<Link href="https://cetecerp.com" external>
|
|
255
|
+
Cetec ERP
|
|
256
|
+
</Link>
|
|
257
|
+
</Text>
|
|
258
|
+
<Pre>
|
|
259
|
+
{
|
|
260
|
+
'<Link href="https://cetecerp.com" external>Cetec ERP</Link>'
|
|
261
|
+
}
|
|
262
|
+
</Pre>
|
|
263
|
+
<Box gridColumn={'1 / -1'}>
|
|
264
|
+
<Text>
|
|
265
|
+
Signs night have sixth hath that likeness us fill{' '}
|
|
266
|
+
<Link href="https://cetecerp.com" external>
|
|
267
|
+
Cetec ERP
|
|
268
|
+
</Link>{' '}
|
|
269
|
+
you're subdue fowl brought divide beginning multiply brought
|
|
270
|
+
created after open given of made beginning multiply green.
|
|
271
|
+
</Text>
|
|
272
|
+
</Box>
|
|
273
|
+
</Grid>
|
|
274
|
+
</VStack>
|
|
275
|
+
</Section>
|
|
276
|
+
<Section>
|
|
277
|
+
<Heading level="h2">Shadows</Heading>
|
|
278
|
+
<VStack gap={'40'} alignItems={'flex-end'}>
|
|
279
|
+
<HStack width={'full'} gap={'40'} alignItems={'flex-end'}>
|
|
280
|
+
<ShadowBox shadow={'inset'}>
|
|
281
|
+
<Text>Inset</Text>
|
|
282
|
+
</ShadowBox>
|
|
283
|
+
<ShadowBox shadow={'low'}>
|
|
284
|
+
<Text>Low</Text>
|
|
285
|
+
</ShadowBox>
|
|
286
|
+
<ShadowBox shadow={'medium'}>
|
|
287
|
+
<Text>Medium</Text>
|
|
288
|
+
</ShadowBox>
|
|
289
|
+
<ShadowBox shadow={'high'}>
|
|
290
|
+
<Text>High</Text>
|
|
291
|
+
</ShadowBox>
|
|
292
|
+
</HStack>
|
|
293
|
+
<HStack width={'full'} gap={'40'} alignItems={'flex-end'}>
|
|
294
|
+
<ShadowBox shadow={'inset'} border={true}>
|
|
295
|
+
<Text>Inset</Text>
|
|
296
|
+
</ShadowBox>
|
|
297
|
+
<ShadowBox shadow={'low'} border={true}>
|
|
298
|
+
<Text>Low</Text>
|
|
299
|
+
</ShadowBox>
|
|
300
|
+
<ShadowBox shadow={'medium'} border={true}>
|
|
301
|
+
<Text>Medium</Text>
|
|
302
|
+
</ShadowBox>
|
|
303
|
+
<ShadowBox shadow={'high'} border={true}>
|
|
304
|
+
<Text>High</Text>
|
|
305
|
+
</ShadowBox>
|
|
306
|
+
</HStack>
|
|
307
|
+
</VStack>
|
|
308
|
+
</Section>
|
|
309
|
+
<Section>
|
|
310
|
+
<Heading level="h2">Spinner</Heading>
|
|
311
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
312
|
+
<VStack>
|
|
313
|
+
<Spinner size="small" />
|
|
314
|
+
<Text>Small</Text>
|
|
315
|
+
</VStack>
|
|
316
|
+
<VStack>
|
|
317
|
+
<Spinner />
|
|
318
|
+
<Text>Standard</Text>
|
|
319
|
+
</VStack>
|
|
320
|
+
<VStack>
|
|
321
|
+
<Spinner size="large" />
|
|
322
|
+
<Text>Large</Text>
|
|
323
|
+
</VStack>
|
|
324
|
+
</HStack>
|
|
325
|
+
</Section>
|
|
326
|
+
<Section>
|
|
327
|
+
<Heading level="h2">Divider</Heading>
|
|
328
|
+
<VStack>
|
|
329
|
+
<Heading level="h3" color={{ base: 'gold.40', _dark: 'gold.30' }}>
|
|
330
|
+
Horizontal (default)
|
|
331
|
+
</Heading>
|
|
332
|
+
<VStack width="full">
|
|
333
|
+
<Divider />
|
|
334
|
+
<Text> Thin (default) </Text>
|
|
335
|
+
<Divider weight={'medium'} />
|
|
336
|
+
<Text> Medium </Text>
|
|
337
|
+
<Divider weight={'thick'} />
|
|
338
|
+
<Text> Thick </Text>
|
|
339
|
+
<Divider
|
|
340
|
+
weight={'thicker'}
|
|
341
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
342
|
+
/>
|
|
343
|
+
<Text> Thicker </Text>
|
|
344
|
+
</VStack>
|
|
345
|
+
<Heading level="h3" color={{ base: 'gold.40', _dark: 'gold.30' }}>
|
|
346
|
+
Vertical
|
|
347
|
+
</Heading>
|
|
348
|
+
<HStack height="96">
|
|
349
|
+
<Divider direction={'vertical'} />
|
|
350
|
+
<Divider direction={'vertical'} weight={'medium'} />
|
|
351
|
+
<Divider direction={'vertical'} weight={'thick'} />
|
|
352
|
+
<Divider
|
|
353
|
+
direction={'vertical'}
|
|
354
|
+
weight={'thicker'}
|
|
355
|
+
color={{ base: 'gold.40', _dark: 'gold.30' }}
|
|
356
|
+
/>
|
|
357
|
+
</HStack>
|
|
358
|
+
</VStack>
|
|
359
|
+
</Section>
|
|
360
|
+
<Section>
|
|
361
|
+
<Heading level="h2">Icons</Heading>
|
|
362
|
+
<IconList />
|
|
363
|
+
</Section>
|
|
364
|
+
<Section>
|
|
365
|
+
<Heading level="h2">Checkboxes</Heading>
|
|
366
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
367
|
+
<CheckBox />
|
|
368
|
+
<CheckBox defaultChecked={true} />
|
|
369
|
+
<CheckBox indeterminate={true} />
|
|
370
|
+
<CheckBox error={true} />
|
|
371
|
+
<CheckBox disabled />
|
|
372
|
+
<CheckBox disabled />
|
|
373
|
+
</HStack>
|
|
374
|
+
</Section>
|
|
375
|
+
<Section>
|
|
376
|
+
<Heading level="h2">Radio</Heading>
|
|
377
|
+
<VStack gap={'40'} alignItems={'start'}>
|
|
378
|
+
<HStack>
|
|
379
|
+
<Radio />
|
|
380
|
+
<Radio defaultChecked={true} />
|
|
381
|
+
<Radio disabled />
|
|
382
|
+
<Radio data-error={true} />
|
|
383
|
+
</HStack>
|
|
384
|
+
<HStack>
|
|
385
|
+
<HStack gap={'10'} alignItems={'center'}>
|
|
386
|
+
<Heading level="h4">Gender</Heading>
|
|
387
|
+
<Radio name="gender"></Radio> Male
|
|
388
|
+
<Radio name="gender"></Radio> Female
|
|
389
|
+
</HStack>
|
|
390
|
+
</HStack>
|
|
391
|
+
</VStack>
|
|
392
|
+
</Section>
|
|
393
|
+
<Section>
|
|
394
|
+
<Heading level="h2">Text Input</Heading>
|
|
395
|
+
<VStack gap={'40'} alignItems={'flex-start'}>
|
|
396
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
397
|
+
<VStack>
|
|
398
|
+
<TextInput size={'small'} placeHolder={'Enter Text'} />
|
|
399
|
+
<Text>Small</Text>
|
|
400
|
+
</VStack>
|
|
401
|
+
<VStack>
|
|
402
|
+
<TextInput placeHolder={'Enter Text'} />
|
|
403
|
+
<Text>Medium</Text>
|
|
404
|
+
</VStack>
|
|
405
|
+
<VStack>
|
|
406
|
+
<TextInput size={'large'} placeHolder={'Enter Text'} />
|
|
407
|
+
<Text>Large</Text>
|
|
408
|
+
</VStack>
|
|
409
|
+
</HStack>
|
|
410
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
411
|
+
<VStack>
|
|
412
|
+
<TextInput defaultValue="entered text" />
|
|
413
|
+
<Text>Default - Filled</Text>
|
|
414
|
+
</VStack>
|
|
415
|
+
<VStack>
|
|
416
|
+
<TextInput data-error={true} placeHolder={'placeholder'} />
|
|
417
|
+
<Text>Error</Text>
|
|
418
|
+
</VStack>
|
|
419
|
+
<VStack>
|
|
420
|
+
<TextInput disabled placeHolder={'placeholder'} />
|
|
421
|
+
<Text>Disabled</Text>
|
|
422
|
+
</VStack>
|
|
423
|
+
</HStack>
|
|
424
|
+
<HStack gap={'40'} alignItems={'flex-end'}>
|
|
425
|
+
<VStack>
|
|
426
|
+
<TextInput autoSize={true} placeHolder={'Enter Text'} />
|
|
427
|
+
<Text>Auto Size</Text>
|
|
428
|
+
</VStack>
|
|
429
|
+
</HStack>
|
|
430
|
+
</VStack>
|
|
431
|
+
</Section>
|
|
432
|
+
<Section>
|
|
433
|
+
<Heading level="h2">Textarea</Heading>
|
|
434
|
+
<VStack gap={'40'} alignItems={'flex-start'}>
|
|
435
|
+
<HStack gap={'40'} alignItems={'flex-start'}>
|
|
436
|
+
<Textarea placeholder="Small" size="small" />
|
|
437
|
+
<Textarea placeholder="Medium" />
|
|
438
|
+
<Textarea placeholder="Large" size="large" />
|
|
439
|
+
</HStack>
|
|
440
|
+
<HStack gap={'40'} alignItems={'flex-start'}>
|
|
441
|
+
<Textarea
|
|
442
|
+
placeholder="placeholder"
|
|
443
|
+
defaultValue="Default – Filled"
|
|
444
|
+
/>
|
|
445
|
+
<Textarea placeholder="Disabled" disabled />
|
|
446
|
+
<Textarea placeholder="Error" data-error={true} />
|
|
447
|
+
</HStack>
|
|
448
|
+
<HStack gap={'40'} alignItems={'flex-start'}>
|
|
449
|
+
<Textarea placeholder="Auto Size" autoSize={true} />
|
|
450
|
+
</HStack>
|
|
451
|
+
</VStack>
|
|
452
|
+
</Section>
|
|
453
|
+
{/* <Section>
|
|
454
|
+
<Heading level="h2">Inputs</Heading>
|
|
455
|
+
<VStack>
|
|
456
|
+
<HStack gap={'24'}>
|
|
457
|
+
<Input label="First" type="text" />
|
|
458
|
+
<Input label="Last" type="text" />
|
|
459
|
+
<Input label="Email" type="email" variant={'internalLabel'} />
|
|
460
|
+
</HStack>
|
|
461
|
+
<HStack gap={'24'}>
|
|
462
|
+
<Input label="Phone" type="tel" />
|
|
463
|
+
</HStack>
|
|
464
|
+
</VStack>
|
|
465
|
+
</Section> */}
|
|
466
|
+
</VStack>
|
|
467
|
+
</Container>
|
|
468
|
+
</VStack>
|
|
469
|
+
);
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export default function App() {
|
|
473
|
+
return (
|
|
474
|
+
<ThemeProvider>
|
|
475
|
+
<AppContent />
|
|
476
|
+
</ThemeProvider>
|
|
477
|
+
);
|
|
478
|
+
}
|
|
@@ -1,37 +1,36 @@
|
|
|
1
|
-
import { Box, type BoxProps } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Icon } from "../Icon";
|
|
1
|
+
import { Box, type BoxProps } from '../Box';
|
|
2
|
+
import { Label } from '../Label';
|
|
3
|
+
import { checkbox, type CheckboxVariantProps } from '@styled-system/recipes';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
6
5
|
|
|
7
|
-
export type CheckBoxProps = Omit<BoxProps, keyof CheckboxVariantProps
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export type CheckBoxProps = Omit<BoxProps, keyof CheckboxVariantProps> &
|
|
7
|
+
CheckboxVariantProps & {
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
};
|
|
13
12
|
|
|
14
|
-
export const CheckBox: React.FC<CheckBoxProps> = (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
13
|
+
export const CheckBox: React.FC<CheckBoxProps> = ({
|
|
14
|
+
indeterminate,
|
|
15
|
+
error,
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
const { container, input, indicator } = checkbox({});
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Label className={container}>
|
|
22
|
+
<Box
|
|
23
|
+
as="input"
|
|
24
|
+
type="checkbox"
|
|
25
|
+
className={input}
|
|
26
|
+
{...props}
|
|
27
|
+
{...(indeterminate && { 'data-indeterminate': true })}
|
|
28
|
+
{...(error && { 'data-error': true })}
|
|
29
|
+
/>
|
|
30
|
+
<Icon className={indicator} name={'checkbox'} />
|
|
31
|
+
<Icon className={indicator} name={'checkbox-checked'} />
|
|
32
|
+
<Icon className={indicator} name={'checkbox-indeterminate'} />
|
|
33
|
+
<Icon className={indicator} name={'checkbox-focus'} />
|
|
34
|
+
</Label>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { splitProps } from '~/utils/splitProps';
|
|
2
|
+
import {Box, type BoxProps} from '../Box/Box';
|
|
3
|
+
import {textinput, type TextinputVariantProps } from '@styled-system/recipes';
|
|
4
|
+
import { cx } from '@styled-system/css';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export type TextInputProps = Omit<BoxProps, keyof TextinputVariantProps> & TextinputVariantProps &{
|
|
8
|
+
error?: boolean,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const TextInput: React.FC<TextInputProps> = (
|
|
12
|
+
{
|
|
13
|
+
size,
|
|
14
|
+
error,
|
|
15
|
+
autoSize = false,
|
|
16
|
+
...props
|
|
17
|
+
}: TextInputProps
|
|
18
|
+
) => {
|
|
19
|
+
|
|
20
|
+
const [ className, otherProps] = splitProps(props);
|
|
21
|
+
return(
|
|
22
|
+
<Box
|
|
23
|
+
as="input"
|
|
24
|
+
{...error && { 'data-error': true }}
|
|
25
|
+
className={cx(
|
|
26
|
+
textinput({size, autoSize}),
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...otherProps}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextInput, type TextInputProps } from './TextInput';
|