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
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
import { Box, type BoxProps } from '~/components/Box';
|
|
2
|
-
import { Text, type TextProps } from '~/components/Text';
|
|
3
|
-
import { Label, type LabelProps } from '~/components/Label';
|
|
4
2
|
import { textarea, type TextareaVariantProps } from '@styled-system/recipes';
|
|
5
3
|
import { cx } from '@styled-system/css';
|
|
6
4
|
import { splitProps } from '~/utils/splitProps';
|
|
7
5
|
|
|
8
|
-
export type TextareaProps = Omit<BoxProps, keyof
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export type TextareaProps = Omit<BoxProps, keyof TextareaVariantProps > & TextareaVariantProps & {
|
|
7
|
+
autoSize?: boolean,
|
|
8
|
+
error?: boolean,
|
|
9
|
+
disabled?:boolean,
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export const Textarea: React.FC<TextareaProps> = (
|
|
14
13
|
{
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
size,
|
|
15
|
+
error,
|
|
16
|
+
autoSize= false,
|
|
17
17
|
...props
|
|
18
18
|
}: TextareaProps,
|
|
19
19
|
) => {
|
|
20
20
|
|
|
21
21
|
const [ className, otherProps ] = splitProps(props);
|
|
22
22
|
return (
|
|
23
|
-
<Label>
|
|
24
|
-
<Text as='span'>{label}</Text>
|
|
25
23
|
<Box
|
|
26
24
|
as="textarea"
|
|
27
|
-
|
|
28
|
-
htmlFor={props.id || ''}
|
|
25
|
+
{...error && { 'data-error': true }}
|
|
29
26
|
className={cx(
|
|
30
|
-
textarea({
|
|
27
|
+
textarea({ size, autoSize }),
|
|
31
28
|
className,
|
|
32
29
|
)}
|
|
33
|
-
onInput={(e: React.FormEvent<HTMLTextAreaElement>) => {
|
|
34
|
-
const target = e.currentTarget;
|
|
35
|
-
const parent = target.parentNode as HTMLElement;
|
|
36
|
-
parent.dataset.value = target.value || '';
|
|
37
|
-
}}
|
|
38
30
|
{...otherProps}
|
|
39
31
|
>
|
|
40
|
-
<Text>{props.value}</Text>
|
|
41
32
|
</Box>
|
|
42
|
-
</Label>
|
|
43
33
|
);
|
|
44
34
|
};
|
|
45
35
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
type Theme = 'light' | 'dark';
|
|
4
|
+
|
|
5
|
+
interface ThemeContextType {
|
|
6
|
+
theme: Theme;
|
|
7
|
+
setTheme: (theme: Theme) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const THEME_STORAGE_KEY = 'cetec-theme-preference';
|
|
11
|
+
|
|
12
|
+
function getInitialTheme(): Theme {
|
|
13
|
+
// Check for stored preference
|
|
14
|
+
const storedTheme = localStorage.getItem(THEME_STORAGE_KEY) as Theme | null;
|
|
15
|
+
if (storedTheme) {
|
|
16
|
+
return storedTheme;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Check for system preference
|
|
20
|
+
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
21
|
+
return 'dark';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Default to light
|
|
25
|
+
return 'light';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const ThemeContext = createContext<ThemeContextType | undefined>(undefined);
|
|
29
|
+
|
|
30
|
+
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
|
31
|
+
const [theme, setThemeState] = useState<Theme>(() => getInitialTheme());
|
|
32
|
+
|
|
33
|
+
// Update theme in both DOM and localStorage
|
|
34
|
+
const setTheme = (newTheme: Theme) => {
|
|
35
|
+
setThemeState(newTheme);
|
|
36
|
+
localStorage.setItem(THEME_STORAGE_KEY, newTheme);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Apply theme to DOM
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
// Remove any existing theme
|
|
42
|
+
document.documentElement.removeAttribute('data-color-mode');
|
|
43
|
+
document.documentElement.removeAttribute('data-theme');
|
|
44
|
+
|
|
45
|
+
document.documentElement.setAttribute('data-color-mode', theme);
|
|
46
|
+
}, [theme]);
|
|
47
|
+
|
|
48
|
+
// Listen for system theme changes
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
|
|
51
|
+
|
|
52
|
+
const handleChange = (e: MediaQueryListEvent) => {
|
|
53
|
+
const storedTheme = localStorage.getItem(THEME_STORAGE_KEY);
|
|
54
|
+
// Only update if user hasn't explicitly set a preference
|
|
55
|
+
if (!storedTheme) {
|
|
56
|
+
setThemeState(e.matches ? 'dark' : 'light');
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
mediaQuery.addEventListener('change', handleChange);
|
|
61
|
+
return () => mediaQuery.removeEventListener('change', handleChange);
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<ThemeContext.Provider value={{ theme, setTheme }}>
|
|
66
|
+
{children}
|
|
67
|
+
</ThemeContext.Provider>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function useTheme() {
|
|
72
|
+
const context = useContext(ThemeContext);
|
|
73
|
+
if (context === undefined) {
|
|
74
|
+
throw new Error('useTheme must be used within a ThemeProvider');
|
|
75
|
+
}
|
|
76
|
+
return context;
|
|
77
|
+
}
|
package/src/main.tsx
ADDED
package/src/recipes/checkbox.ts
CHANGED
|
@@ -1,88 +1,81 @@
|
|
|
1
|
-
import { defineSlotRecipe } from
|
|
1
|
+
import { defineSlotRecipe } from '@pandacss/dev';
|
|
2
2
|
|
|
3
3
|
export const checkBoxRecipe = defineSlotRecipe({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
className: 'checkbox',
|
|
5
|
+
jsx: ['CheckBox'],
|
|
6
|
+
slots: ['container', 'input', 'indicator'],
|
|
7
|
+
base: {
|
|
8
|
+
container: {
|
|
9
|
+
position: 'relative',
|
|
10
|
+
display: 'inline-grid',
|
|
11
|
+
gridTemplateColumns: 'auto 1fr',
|
|
12
|
+
gap: 4,
|
|
13
|
+
alignItems: 'start',
|
|
14
|
+
cursor: 'pointer',
|
|
15
|
+
userSelect: 'none',
|
|
16
|
+
},
|
|
17
|
+
input: {
|
|
18
|
+
position: 'absolute',
|
|
19
|
+
opacity: 0,
|
|
20
|
+
width: 'full',
|
|
21
|
+
height: 'full',
|
|
22
|
+
margin: '0',
|
|
23
|
+
padding: '0',
|
|
24
|
+
zIndex: 1,
|
|
25
|
+
cursor: 'inherit',
|
|
26
|
+
"& ~ [name='checkbox']": {
|
|
27
|
+
display: 'inline-grid',
|
|
28
|
+
},
|
|
29
|
+
_checked: {
|
|
30
|
+
"& ~ [name='checkbox-checked']": {
|
|
31
|
+
display: 'inline-grid',
|
|
32
|
+
fill: { base: 'slate.90', _dark: 'slate.0' },
|
|
16
33
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
opacity: 0,
|
|
20
|
-
width: "full",
|
|
21
|
-
height: "full",
|
|
22
|
-
margin: "0",
|
|
23
|
-
padding: "0",
|
|
24
|
-
zIndex: 1,
|
|
25
|
-
cursor: "inherit",
|
|
26
|
-
"& ~ [name='checkbox']": {
|
|
27
|
-
display: "inline-grid",
|
|
28
|
-
},
|
|
29
|
-
_checked: {
|
|
30
|
-
"& ~ [name='checkbox-checked']": {
|
|
31
|
-
display: "inline-grid",
|
|
32
|
-
fill: { base: "slate.90", _dark: "slate.0" },
|
|
33
|
-
},
|
|
34
|
-
"& ~ [name='checkbox']": {
|
|
35
|
-
display: "none",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
_indeterminate: {
|
|
39
|
-
"& ~ [name='checkbox-indeterminate']": {
|
|
40
|
-
display: "inline-grid",
|
|
41
|
-
fill: { base: "slate.90", _dark: "slate.0" },
|
|
42
|
-
_disabled: {
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
"& ~ [name='checkbox']": {
|
|
46
|
-
display: "none",
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
_disabled: {
|
|
50
|
-
"& ~ svg": {
|
|
51
|
-
opacity: 0.4,
|
|
52
|
-
pointerEvents: 'none',
|
|
53
|
-
cursor: 'none',
|
|
54
|
-
},
|
|
55
|
-
display: "inline-grid",
|
|
56
|
-
},
|
|
57
|
-
_error: {
|
|
58
|
-
display: "inline-grid",
|
|
59
|
-
"& ~ svg": {
|
|
60
|
-
fill: "red.50",
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
_focusVisible: {
|
|
64
|
-
"& ~ svg": {
|
|
65
|
-
outlineColor: { base: 'slate.80', _dark: 'slate.5' },
|
|
66
|
-
outlineOffset: -3,
|
|
67
|
-
borderRadius: 5,
|
|
68
|
-
outlineWidth: 1,
|
|
69
|
-
outlineStyle: 'solid',
|
|
70
|
-
},
|
|
71
|
-
},
|
|
34
|
+
"& ~ [name='checkbox']": {
|
|
35
|
+
display: 'none',
|
|
72
36
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
display: "inline-grid",
|
|
80
|
-
fill: "slate.20",
|
|
81
|
-
},
|
|
37
|
+
},
|
|
38
|
+
_indeterminate: {
|
|
39
|
+
"& ~ [name='checkbox-indeterminate']": {
|
|
40
|
+
display: 'inline-grid',
|
|
41
|
+
fill: { base: 'slate.90', _dark: 'slate.0' },
|
|
42
|
+
_disabled: {},
|
|
82
43
|
},
|
|
44
|
+
"& ~ [name='checkbox']": {
|
|
45
|
+
display: 'none',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
_disabled: {
|
|
49
|
+
'& ~ svg': {
|
|
50
|
+
opacity: 0.4,
|
|
51
|
+
pointerEvents: 'none',
|
|
52
|
+
cursor: 'none',
|
|
53
|
+
},
|
|
54
|
+
display: 'inline-grid',
|
|
55
|
+
},
|
|
56
|
+
_error: {
|
|
57
|
+
display: 'inline-grid',
|
|
58
|
+
'& ~ svg': {
|
|
59
|
+
fill: 'error.default',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
_focusVisible: {
|
|
63
|
+
"& ~ [name='checkbox-focus']": {
|
|
64
|
+
display: 'inline-grid',
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
fill: { base: 'slate.90', _dark: 'slate.1' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
83
69
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
indicator: {
|
|
71
|
+
placeContent: 'center',
|
|
72
|
+
display: 'none',
|
|
73
|
+
width: 24,
|
|
74
|
+
height: 24,
|
|
75
|
+
"&:is([name='checkbox'])": {
|
|
76
|
+
display: 'inline-grid',
|
|
77
|
+
fill: { base: 'slate.30', _dark: 'slate.20' },
|
|
78
|
+
},
|
|
87
79
|
},
|
|
80
|
+
},
|
|
88
81
|
});
|
package/src/recipes/index.ts
CHANGED
package/src/recipes/text.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineRecipe } from '@pandacss/dev';
|
|
|
2
2
|
import {
|
|
3
3
|
fontSizes as fontSizeTokens,
|
|
4
4
|
fontWeights as fontWeightTokens,
|
|
5
|
-
} from '
|
|
5
|
+
} from '../styles/tokens';
|
|
6
6
|
|
|
7
7
|
const textBase = {
|
|
8
8
|
margin: '0',
|
|
@@ -106,12 +106,20 @@ const linkBase = {
|
|
|
106
106
|
backgroundSize: '100% 1px',
|
|
107
107
|
backgroundRepeat: 'no-repeat',
|
|
108
108
|
backgroundPositionY: '100%',
|
|
109
|
+
outlineWidth: '2',
|
|
110
|
+
outlineStyle: 'solid',
|
|
111
|
+
outlineColor: 'transparent',
|
|
112
|
+
outlineOffset: '1',
|
|
109
113
|
width: 'fit-content',
|
|
110
114
|
cursor: 'pointer',
|
|
111
115
|
_hover: {
|
|
112
116
|
color: { base: 'blue.40', _dark: 'blue.30' },
|
|
113
117
|
backgroundImage: 'linear-gradient(90deg, currentColor 0% 100%)',
|
|
114
118
|
},
|
|
119
|
+
_focus: {
|
|
120
|
+
borderRadius: '4',
|
|
121
|
+
outlineColor: { base: 'slate.90', _dark: 'slate.0' },
|
|
122
|
+
},
|
|
115
123
|
};
|
|
116
124
|
|
|
117
125
|
const linkVariants = {
|
|
@@ -119,7 +127,7 @@ const linkVariants = {
|
|
|
119
127
|
_disabled: {
|
|
120
128
|
true: {
|
|
121
129
|
cursor: 'not-allowed',
|
|
122
|
-
opacity: 0.
|
|
130
|
+
opacity: 0.4,
|
|
123
131
|
pointerEvents: 'none',
|
|
124
132
|
},
|
|
125
133
|
},
|
package/src/recipes/textarea.ts
CHANGED
|
@@ -2,67 +2,68 @@ import { defineRecipe } from '@pandacss/dev';
|
|
|
2
2
|
|
|
3
3
|
const textareaBase = {
|
|
4
4
|
position: 'relative',
|
|
5
|
-
display: 'inline-grid',
|
|
6
|
-
verticalAlign: 'top',
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
padding: '0',
|
|
9
|
-
fontFamily: 'body',
|
|
10
|
-
fontSize: '16',
|
|
11
|
-
fontWeight: 'normal',
|
|
12
|
-
lineHeight: 'normal',
|
|
13
|
-
color: { base: 'slate.90', _osDark: 'slate.5' },
|
|
14
|
-
borderRadius: '8',
|
|
15
5
|
width: 'full',
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
6
|
+
color: { base: 'slate.90', _dark: 'slate.0' },
|
|
7
|
+
borderWidth: '1',
|
|
8
|
+
borderStyle: 'solid',
|
|
9
|
+
borderColor: 'slate.30',
|
|
10
|
+
borderRadius: '4',
|
|
11
|
+
lineHeight: 'tight',
|
|
12
|
+
outlineWidth: '1',
|
|
13
|
+
outlineStyle: 'solid',
|
|
14
|
+
outlineColor: 'transparent',
|
|
15
|
+
resize: 'both',
|
|
16
|
+
_focus: {
|
|
17
|
+
outlineColor: { base: 'slate.90', _dark: 'slate.0' },
|
|
18
|
+
borderColor: { base: 'slate.90', _dark: 'slate.0' },
|
|
19
|
+
},
|
|
20
|
+
_error: {
|
|
21
|
+
display: 'inline-grid',
|
|
22
|
+
borderColor: 'error.default',
|
|
34
23
|
_focus: {
|
|
35
|
-
borderColor: { base: '
|
|
24
|
+
borderColor: { base: 'error.default', _dark: 'error.default' },
|
|
25
|
+
outlineColor: { base: 'error.default', _dark: 'error.default' },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
_placeholder: {
|
|
29
|
+
color: {
|
|
30
|
+
base: 'slate.50',
|
|
31
|
+
_dark: 'slate.40',
|
|
36
32
|
},
|
|
37
33
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
opacity: '0.3',
|
|
34
|
+
_disabled: {
|
|
35
|
+
opacity: 0.4,
|
|
36
|
+
},
|
|
37
|
+
'&[data-error]:focus': {
|
|
38
|
+
borderColor: 'error.default',
|
|
44
39
|
},
|
|
45
|
-
'& textarea': {},
|
|
46
|
-
gridTemplateColumns: 'auto 1fr',
|
|
47
40
|
};
|
|
48
41
|
|
|
49
42
|
const textareaVariants = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
size: {
|
|
44
|
+
small: {
|
|
45
|
+
py: '0',
|
|
46
|
+
px: '8',
|
|
47
|
+
minHeight: '48',
|
|
48
|
+
fontSize: '14',
|
|
49
|
+
},
|
|
50
|
+
medium: {
|
|
51
|
+
py: '3',
|
|
52
|
+
px: '10',
|
|
53
|
+
fontSize: '16',
|
|
54
|
+
minHeight: '64',
|
|
53
55
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
large: {
|
|
57
|
+
py: '7',
|
|
58
|
+
px: '12',
|
|
59
|
+
fontSize: '16',
|
|
60
|
+
minHeight: '80',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
autoSize: {
|
|
64
|
+
true: {
|
|
65
|
+
fieldSizing: 'content',
|
|
64
66
|
},
|
|
65
|
-
internalLabel: {},
|
|
66
67
|
},
|
|
67
68
|
};
|
|
68
69
|
|
|
@@ -72,6 +73,6 @@ export const textareaRecipe = defineRecipe({
|
|
|
72
73
|
base: textareaBase,
|
|
73
74
|
variants: textareaVariants,
|
|
74
75
|
defaultVariants: {
|
|
75
|
-
|
|
76
|
+
size: 'medium',
|
|
76
77
|
},
|
|
77
78
|
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineRecipe } from '@pandacss/dev';
|
|
2
|
+
|
|
3
|
+
const textInputVariants = {
|
|
4
|
+
size: {
|
|
5
|
+
medium: {
|
|
6
|
+
py: 3,
|
|
7
|
+
px: 10,
|
|
8
|
+
fontSize: '16',
|
|
9
|
+
},
|
|
10
|
+
small: {
|
|
11
|
+
py: 0,
|
|
12
|
+
px: 8,
|
|
13
|
+
fontSize: '14',
|
|
14
|
+
},
|
|
15
|
+
large: {
|
|
16
|
+
py: 7,
|
|
17
|
+
px: 12,
|
|
18
|
+
fontSize: '16',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
autoSize: {
|
|
22
|
+
true: {
|
|
23
|
+
fieldSizing: 'content',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const textInputBase = {
|
|
29
|
+
position: 'relative',
|
|
30
|
+
width: 'full',
|
|
31
|
+
borderWidth: '1',
|
|
32
|
+
borderColor: 'slate.30',
|
|
33
|
+
borderStyle: 'solid',
|
|
34
|
+
borderRadius: '4',
|
|
35
|
+
lineHeight: 'default',
|
|
36
|
+
fontFamily: 'body',
|
|
37
|
+
outlineWidth: '1',
|
|
38
|
+
outlineStyle: 'solid',
|
|
39
|
+
outlineColor: 'transparent',
|
|
40
|
+
color: {
|
|
41
|
+
base: 'slate.90',
|
|
42
|
+
_dark: 'slate.0',
|
|
43
|
+
},
|
|
44
|
+
_placeholder: {
|
|
45
|
+
color: {
|
|
46
|
+
base: 'slate.50',
|
|
47
|
+
_dark: 'slate.40',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
_disabled: {
|
|
51
|
+
opacity: 0.4,
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
_focus: {
|
|
55
|
+
outlineColor: { base: 'slate.90', _dark: 'slate.0' },
|
|
56
|
+
borderColor: { base: 'slate.90', _dark: 'slate.0' },
|
|
57
|
+
},
|
|
58
|
+
_error: {
|
|
59
|
+
display: 'inline-grid',
|
|
60
|
+
borderColor: 'error.default',
|
|
61
|
+
_focus: {
|
|
62
|
+
borderColor: { base: 'error.default', _dark: 'error.default' },
|
|
63
|
+
outlineColor: { base: 'error.default', _dark: 'error.default' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const textinputRecipe = defineRecipe({
|
|
69
|
+
className: 'textinput',
|
|
70
|
+
jsx: ['TextInput'],
|
|
71
|
+
base: textInputBase,
|
|
72
|
+
variants: textInputVariants,
|
|
73
|
+
defaultVariants: {
|
|
74
|
+
size: 'medium',
|
|
75
|
+
},
|
|
76
|
+
});
|
|
@@ -9,7 +9,7 @@ export const globalCss = defineGlobalStyles({
|
|
|
9
9
|
margin: 0,
|
|
10
10
|
padding: 0,
|
|
11
11
|
_focusVisible: {
|
|
12
|
-
outlineColor: { base: 'slate.
|
|
12
|
+
outlineColor: { base: 'slate.90', _dark: 'slate.0' },
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
html: {
|
|
@@ -22,7 +22,7 @@ export const globalCss = defineGlobalStyles({
|
|
|
22
22
|
fontFamily: 'body',
|
|
23
23
|
fontVariationSettings: '"CRSV" 0, "CASL" 0',
|
|
24
24
|
bg: { base: 'slate.0', _dark: 'slate.90' },
|
|
25
|
-
color: { base: 'slate.60', _dark: 'slate.
|
|
25
|
+
color: { base: 'slate.60', _dark: 'slate.30' },
|
|
26
26
|
fontWeight: 'normal',
|
|
27
27
|
},
|
|
28
28
|
'h1, h2, h3, h4, h5, h6': {
|
|
@@ -51,14 +51,19 @@ export const globalCss = defineGlobalStyles({
|
|
|
51
51
|
borderColor: 'currentcolor',
|
|
52
52
|
},
|
|
53
53
|
'button, input, optgroup, select, textarea': {
|
|
54
|
-
fontFamily: '
|
|
54
|
+
fontFamily: 'body',
|
|
55
55
|
fontSize: '100%',
|
|
56
|
-
lineHeight: '
|
|
56
|
+
lineHeight: 'calc(1em + 0.5rem)',
|
|
57
57
|
margin: '0',
|
|
58
58
|
},
|
|
59
59
|
'button, [type="button"], [type="reset"], [type="submit"]': {
|
|
60
60
|
'-webkit-appearance': 'button',
|
|
61
61
|
},
|
|
62
|
+
_disabled: {
|
|
63
|
+
opacity: 0.4,
|
|
64
|
+
cursor: 'not-allowed',
|
|
65
|
+
pointerEvents: 'none',
|
|
66
|
+
},
|
|
62
67
|
legend: {
|
|
63
68
|
padding: '0',
|
|
64
69
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
export * from './radio';
|
|
3
|
-
export * from './checkbox';
|
|
4
2
|
export * from './text';
|
|
5
3
|
export * from './heading';
|
|
6
4
|
export * from './link';
|
|
@@ -8,9 +6,12 @@ export * from './label';
|
|
|
8
6
|
export * from './button';
|
|
9
7
|
export * from './icon-button';
|
|
10
8
|
export * from './input';
|
|
9
|
+
export * from './textinput';
|
|
11
10
|
export * from './textarea';
|
|
12
11
|
export * from './code';
|
|
13
12
|
export * from './pre';
|
|
14
13
|
export * from './spinner';
|
|
15
14
|
export * from './divider';
|
|
16
|
-
export * from './box';
|
|
15
|
+
export * from './box';
|
|
16
|
+
export * from './checkbox';
|
|
17
|
+
export * from './radio';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface RadioInputVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type RadioInputVariantMap = {
|
|
10
|
+
[key in keyof RadioInputVariant]: Array<RadioInputVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RadioInputVariantProps = {
|
|
14
|
+
[key in keyof RadioInputVariant]?: ConditionalValue<RadioInputVariant[key]> | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RadioInputRecipe {
|
|
18
|
+
__type: RadioInputVariantProps
|
|
19
|
+
(props?: RadioInputVariantProps): string
|
|
20
|
+
raw: (props?: RadioInputVariantProps) => RadioInputVariantProps
|
|
21
|
+
variantMap: RadioInputVariantMap
|
|
22
|
+
variantKeys: Array<keyof RadioInputVariant>
|
|
23
|
+
splitVariantProps<Props extends RadioInputVariantProps>(props: Props): [RadioInputVariantProps, Pretty<DistributiveOmit<Props, keyof RadioInputVariantProps>>]
|
|
24
|
+
getVariantProps: (props?: RadioInputVariantProps) => RadioInputVariantProps
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare const radioInput: RadioInputRecipe
|