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.
Files changed (250) hide show
  1. package/package.json +6 -13
  2. package/src/App.tsx +478 -0
  3. package/src/components/CheckBox/CheckBox.tsx +34 -35
  4. package/src/components/TextInput/TextInput.tsx +33 -0
  5. package/src/components/TextInput/index.tsx +1 -0
  6. package/src/components/Textarea/Textarea.tsx +9 -19
  7. package/src/contexts/ThemeContext.tsx +77 -0
  8. package/src/main.tsx +10 -0
  9. package/src/recipes/checkbox.ts +73 -80
  10. package/src/recipes/index.ts +2 -0
  11. package/src/recipes/text.ts +10 -2
  12. package/src/recipes/textarea.ts +53 -52
  13. package/src/recipes/textinput.ts +76 -0
  14. package/src/styles/globalStyle.ts +9 -4
  15. package/src/vite-env.d.ts +1 -0
  16. package/styled-system/recipes/index.d.ts +4 -3
  17. package/styled-system/recipes/index.mjs +1 -0
  18. package/styled-system/recipes/radio-input.d.ts +28 -0
  19. package/styled-system/recipes/radio-input.mjs +24 -0
  20. package/styled-system/recipes/switchbox.d.ts +1 -1
  21. package/styled-system/recipes/switchbox.mjs +4 -0
  22. package/styled-system/recipes/textarea.d.ts +3 -2
  23. package/styled-system/recipes/textarea.mjs +8 -5
  24. package/styled-system/styles.css +1454 -0
  25. package/styled-system/tokens/index.mjs +100 -0
  26. package/styled-system/tokens/tokens.d.ts +4 -1
  27. package/eslint.config.js +0 -50
  28. package/public/sprite.svg +0 -1
  29. package/public/sprite.symbol.html +0 -4091
  30. package/public/svgs/Building.svg +0 -1
  31. package/public/svgs/aa-placeholder.svg +0 -1
  32. package/public/svgs/alarm.svg +0 -1
  33. package/public/svgs/apps.svg +0 -1
  34. package/public/svgs/arrow-down.svg +0 -1
  35. package/public/svgs/arrow-drop-down.svg +0 -1
  36. package/public/svgs/arrow-drop-up.svg +0 -1
  37. package/public/svgs/arrow-left.svg +0 -1
  38. package/public/svgs/arrow-line-down.svg +0 -1
  39. package/public/svgs/arrow-line-left.svg +0 -1
  40. package/public/svgs/arrow-line-right.svg +0 -1
  41. package/public/svgs/arrow-line-up.svg +0 -1
  42. package/public/svgs/arrow-prompt.svg +0 -1
  43. package/public/svgs/arrow-redo.svg +0 -1
  44. package/public/svgs/arrow-right.svg +0 -1
  45. package/public/svgs/arrow-square-in.svg +0 -1
  46. package/public/svgs/arrow-square-out.svg +0 -1
  47. package/public/svgs/arrow-undo.svg +0 -1
  48. package/public/svgs/arrow-up.svg +0 -1
  49. package/public/svgs/arrows-down-up.svg +0 -1
  50. package/public/svgs/arrows-left-right.svg +0 -1
  51. package/public/svgs/at.svg +0 -1
  52. package/public/svgs/attachment.svg +0 -1
  53. package/public/svgs/barcode-reader.svg +0 -1
  54. package/public/svgs/barcode.svg +0 -1
  55. package/public/svgs/basket.svg +0 -1
  56. package/public/svgs/bell-active.svg +0 -1
  57. package/public/svgs/bell-slash.svg +0 -1
  58. package/public/svgs/bell.svg +0 -1
  59. package/public/svgs/bin.svg +0 -1
  60. package/public/svgs/bookmark-outlined.svg +0 -1
  61. package/public/svgs/bookmark.svg +0 -1
  62. package/public/svgs/bookmarks.svg +0 -1
  63. package/public/svgs/calendar-add.svg +0 -1
  64. package/public/svgs/calendar-view-day.svg +0 -1
  65. package/public/svgs/calendar-view-month.svg +0 -1
  66. package/public/svgs/calendar-view-week.svg +0 -1
  67. package/public/svgs/calendar.svg +0 -1
  68. package/public/svgs/caret-down.svg +0 -1
  69. package/public/svgs/caret-left.svg +0 -1
  70. package/public/svgs/caret-right.svg +0 -1
  71. package/public/svgs/caret-up.svg +0 -1
  72. package/public/svgs/cart.svg +0 -1
  73. package/public/svgs/check-thick.svg +0 -1
  74. package/public/svgs/check.svg +0 -1
  75. package/public/svgs/checkbox-checked.svg +0 -1
  76. package/public/svgs/checkbox-focus.svg +0 -1
  77. package/public/svgs/checkbox-indeterminate.svg +0 -1
  78. package/public/svgs/checkbox.svg +0 -1
  79. package/public/svgs/circle-check.svg +0 -1
  80. package/public/svgs/circle.svg +0 -1
  81. package/public/svgs/circles-add.svg +0 -1
  82. package/public/svgs/clipboard.svg +0 -1
  83. package/public/svgs/clock-countdown.svg +0 -1
  84. package/public/svgs/clock.svg +0 -1
  85. package/public/svgs/cloud-synced.svg +0 -1
  86. package/public/svgs/code.svg +0 -1
  87. package/public/svgs/color.svg +0 -1
  88. package/public/svgs/copy.svg +0 -1
  89. package/public/svgs/credit-card.svg +0 -1
  90. package/public/svgs/cut.svg +0 -1
  91. package/public/svgs/database.svg +0 -1
  92. package/public/svgs/devices.svg +0 -1
  93. package/public/svgs/dictionary.svg +0 -1
  94. package/public/svgs/dots.svg +0 -1
  95. package/public/svgs/download-cloud.svg +0 -1
  96. package/public/svgs/download.svg +0 -1
  97. package/public/svgs/dragger.svg +0 -1
  98. package/public/svgs/edit.svg +0 -1
  99. package/public/svgs/encrypted.svg +0 -1
  100. package/public/svgs/envelope.svg +0 -1
  101. package/public/svgs/equal.svg +0 -1
  102. package/public/svgs/eraser.svg +0 -1
  103. package/public/svgs/error.svg +0 -1
  104. package/public/svgs/event-list.svg +0 -1
  105. package/public/svgs/export.svg +0 -1
  106. package/public/svgs/extension.svg +0 -1
  107. package/public/svgs/eye-slash.svg +0 -1
  108. package/public/svgs/eye.svg +0 -1
  109. package/public/svgs/file-add.svg +0 -1
  110. package/public/svgs/file.svg +0 -1
  111. package/public/svgs/files.svg +0 -1
  112. package/public/svgs/filter-remove.svg +0 -1
  113. package/public/svgs/filter.svg +0 -1
  114. package/public/svgs/finish.svg +0 -1
  115. package/public/svgs/flag.svg +0 -1
  116. package/public/svgs/forklift.svg +0 -1
  117. package/public/svgs/garage.svg +0 -1
  118. package/public/svgs/globe.svg +0 -1
  119. package/public/svgs/hash.svg +0 -1
  120. package/public/svgs/heart-outlined.svg +0 -1
  121. package/public/svgs/heart.svg +0 -1
  122. package/public/svgs/help.svg +0 -1
  123. package/public/svgs/history.svg +0 -1
  124. package/public/svgs/home.svg +0 -1
  125. package/public/svgs/image.svg +0 -1
  126. package/public/svgs/images.svg +0 -1
  127. package/public/svgs/inbox.svg +0 -1
  128. package/public/svgs/infinity.svg +0 -1
  129. package/public/svgs/info.svg +0 -1
  130. package/public/svgs/inventory.svg +0 -1
  131. package/public/svgs/invoice.svg +0 -1
  132. package/public/svgs/jump-back.svg +0 -1
  133. package/public/svgs/jump-forward.svg +0 -1
  134. package/public/svgs/kbd-backspace.svg +0 -1
  135. package/public/svgs/kbd-capslock.svg +0 -1
  136. package/public/svgs/kbd-command.svg +0 -1
  137. package/public/svgs/kbd-control.svg +0 -1
  138. package/public/svgs/kbd-hide.svg +0 -1
  139. package/public/svgs/kbd-option.svg +0 -1
  140. package/public/svgs/kbd-return.svg +0 -1
  141. package/public/svgs/kbd-shift.svg +0 -1
  142. package/public/svgs/kbd-space.svg +0 -1
  143. package/public/svgs/kbd.svg +0 -1
  144. package/public/svgs/link-slash.svg +0 -1
  145. package/public/svgs/link.svg +0 -1
  146. package/public/svgs/list-bullets.svg +0 -1
  147. package/public/svgs/list-checks.svg +0 -1
  148. package/public/svgs/list-numbers.svg +0 -1
  149. package/public/svgs/lock-open.svg +0 -1
  150. package/public/svgs/lock.svg +0 -1
  151. package/public/svgs/map-pin.svg +0 -1
  152. package/public/svgs/mark-unread.svg +0 -1
  153. package/public/svgs/menu-close.svg +0 -1
  154. package/public/svgs/menu.svg +0 -1
  155. package/public/svgs/message.svg +0 -1
  156. package/public/svgs/messages.svg +0 -1
  157. package/public/svgs/minus-thick.svg +0 -1
  158. package/public/svgs/minus.svg +0 -1
  159. package/public/svgs/money.svg +0 -1
  160. package/public/svgs/monitor.svg +0 -1
  161. package/public/svgs/moon.svg +0 -1
  162. package/public/svgs/note.svg +0 -1
  163. package/public/svgs/nut.svg +0 -1
  164. package/public/svgs/order.svg +0 -1
  165. package/public/svgs/package.svg +0 -1
  166. package/public/svgs/page-first.svg +0 -1
  167. package/public/svgs/page-last.svg +0 -1
  168. package/public/svgs/parts.svg +0 -1
  169. package/public/svgs/password.svg +0 -1
  170. package/public/svgs/pause.svg +0 -1
  171. package/public/svgs/pencil.svg +0 -1
  172. package/public/svgs/percent.svg +0 -1
  173. package/public/svgs/placeholder.svg +0 -1
  174. package/public/svgs/plan.svg +0 -1
  175. package/public/svgs/play-pause.svg +0 -1
  176. package/public/svgs/play.svg +0 -1
  177. package/public/svgs/plus.svg +0 -1
  178. package/public/svgs/printer.svg +0 -1
  179. package/public/svgs/prohibit.svg +0 -1
  180. package/public/svgs/question-mark.svg +0 -1
  181. package/public/svgs/quote.svg +0 -1
  182. package/public/svgs/radio-checked.svg +0 -1
  183. package/public/svgs/radio-focus.svg +0 -1
  184. package/public/svgs/radio.svg +0 -1
  185. package/public/svgs/receipt.svg +0 -1
  186. package/public/svgs/refresh.svg +0 -1
  187. package/public/svgs/repeat.svg +0 -1
  188. package/public/svgs/reply-all.svg +0 -1
  189. package/public/svgs/reply.svg +0 -1
  190. package/public/svgs/ribbon.svg +0 -1
  191. package/public/svgs/rows-add.svg +0 -1
  192. package/public/svgs/rules.svg +0 -1
  193. package/public/svgs/search-items.svg +0 -1
  194. package/public/svgs/search.svg +0 -1
  195. package/public/svgs/send.svg +0 -1
  196. package/public/svgs/settings.svg +0 -1
  197. package/public/svgs/share.svg +0 -1
  198. package/public/svgs/shuffle.svg +0 -1
  199. package/public/svgs/skip-back.svg +0 -1
  200. package/public/svgs/skip-forward.svg +0 -1
  201. package/public/svgs/skull.svg +0 -1
  202. package/public/svgs/sliders.svg +0 -1
  203. package/public/svgs/sort-alpha-down.svg +0 -1
  204. package/public/svgs/sort-alpha-up.svg +0 -1
  205. package/public/svgs/sort-ascending.svg +0 -1
  206. package/public/svgs/sort-descending.svg +0 -1
  207. package/public/svgs/sort-time-down.svg +0 -1
  208. package/public/svgs/sort-time-up.svg +0 -1
  209. package/public/svgs/square-add.svg +0 -1
  210. package/public/svgs/square.svg +0 -1
  211. package/public/svgs/stamp.svg +0 -1
  212. package/public/svgs/star-outlined.svg +0 -1
  213. package/public/svgs/star.svg +0 -1
  214. package/public/svgs/start.svg +0 -1
  215. package/public/svgs/stop.svg +0 -1
  216. package/public/svgs/success.svg +0 -1
  217. package/public/svgs/sun.svg +0 -1
  218. package/public/svgs/support.svg +0 -1
  219. package/public/svgs/sync.svg +0 -1
  220. package/public/svgs/tag.svg +0 -1
  221. package/public/svgs/target.svg +0 -1
  222. package/public/svgs/text-add.svg +0 -1
  223. package/public/svgs/time-add.svg +0 -1
  224. package/public/svgs/timer.svg +0 -1
  225. package/public/svgs/toolbox.svg +0 -1
  226. package/public/svgs/tools.svg +0 -1
  227. package/public/svgs/trash.svg +0 -1
  228. package/public/svgs/trophy.svg +0 -1
  229. package/public/svgs/truck-trailer.svg +0 -1
  230. package/public/svgs/update.svg +0 -1
  231. package/public/svgs/upload-cloud.svg +0 -1
  232. package/public/svgs/upload.svg +0 -1
  233. package/public/svgs/user-add.svg +0 -1
  234. package/public/svgs/user-details.svg +0 -1
  235. package/public/svgs/user-group.svg +0 -1
  236. package/public/svgs/user-id-badge.svg +0 -1
  237. package/public/svgs/user-id-card.svg +0 -1
  238. package/public/svgs/user.svg +0 -1
  239. package/public/svgs/verified.svg +0 -1
  240. package/public/svgs/video.svg +0 -1
  241. package/public/svgs/view-cards.svg +0 -1
  242. package/public/svgs/view-doc.svg +0 -1
  243. package/public/svgs/view-grid.svg +0 -1
  244. package/public/svgs/view-rows.svg +0 -1
  245. package/public/svgs/view-table.svg +0 -1
  246. package/public/svgs/warning.svg +0 -1
  247. package/public/svgs/work-order.svg +0 -1
  248. package/public/svgs/x.svg +0 -1
  249. package/public/vite.svg +0 -1
  250. 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 TextProps | keyof TextareaVariantProps | keyof LabelProps> & TextareaVariantProps & TextProps & LabelProps & {
9
- variant?: 'autoGrow' | 'stacked' | 'internalLabel';
10
- label?: string;
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
- variant,
16
- label,
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
- id={props.id}
28
- htmlFor={props.id || ''}
25
+ {...error && { 'data-error': true }}
29
26
  className={cx(
30
- textarea({ variant }),
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
@@ -0,0 +1,10 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import App from "./App.tsx";
4
+ import '~/styles/index.css';
5
+
6
+ createRoot(document.getElementById("root")!).render(
7
+ <StrictMode>
8
+ <App />
9
+ </StrictMode>
10
+ );
@@ -1,88 +1,81 @@
1
- import { defineSlotRecipe } from "@pandacss/dev";
1
+ import { defineSlotRecipe } from '@pandacss/dev';
2
2
 
3
3
  export const checkBoxRecipe = defineSlotRecipe({
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",
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
- 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" },
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
- indicator: {
74
- placeContent: "center",
75
- display: 'none',
76
- width: 24,
77
- height: 24,
78
- "&:is([name='checkbox'])": {
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
- variants: {
85
- },
86
- defaultVariants: {
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
  });
@@ -8,3 +8,5 @@ export { dividerRecipe } from "./divider"
8
8
  export { preRecipe, codeRecipe } from "./code"
9
9
  export { boxRecipe } from './box';
10
10
  export { radioRecipe } from './radio';
11
+ export { textinputRecipe } from './textinput';
12
+
@@ -2,7 +2,7 @@ import { defineRecipe } from '@pandacss/dev';
2
2
  import {
3
3
  fontSizes as fontSizeTokens,
4
4
  fontWeights as fontWeightTokens,
5
- } from '~/styles/tokens';
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.7,
130
+ opacity: 0.4,
123
131
  pointerEvents: 'none',
124
132
  },
125
133
  },
@@ -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
- '&::after, & textarea': {
17
- width: 'auto',
18
- minWidth: '16',
19
- maxWidth: 'full',
20
- font: 'inherit',
21
- py: '4',
22
- px: '8',
23
- m: '0',
24
- resize: 'none',
25
- appearance: 'none',
26
- borderWidth: '1',
27
- borderStyle: 'solid',
28
- borderRadius: '4',
29
- borderColor: 'transparent',
30
- background: { base: 'slate.0', _osDark: 'slate.90' },
31
- _hover: {
32
- borderColor: { base: 'slate.20', _osDark: 'slate.30' },
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: 'slate.90', _osDark: 'slate.5' },
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
- _after: {
39
- content: 'attr(data-value) " "',
40
- outline: '1px solid olive',
41
- whiteSpace: 'pre-wrap',
42
- transform: 'translate(4px, 4px)',
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
- variant: {
51
- autoGrow: {
52
- width: 'fit-content',
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
- stacked: {
55
- gridTemplateRows: 'auto 1fr',
56
- alignItems: 'stretch',
57
- '&::after, & textarea': {
58
- gridArea: '2 / 1',
59
- },
60
- '& textarea': {
61
- background: { base: 'slate.0', _osDark: 'slate.90' },
62
- borderColor: { base: 'slate.40', _osDark: 'slate.50' },
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
- variant: 'autoGrow',
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.80', _dark: 'slate.5' },
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.20' },
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: 'inherit',
54
+ fontFamily: 'body',
55
55
  fontSize: '100%',
56
- lineHeight: '1.15',
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';
@@ -5,6 +5,7 @@ export * from './label.mjs';
5
5
  export * from './button.mjs';
6
6
  export * from './icon-button.mjs';
7
7
  export * from './input.mjs';
8
+ export * from './textinput.mjs';
8
9
  export * from './textarea.mjs';
9
10
  export * from './code.mjs';
10
11
  export * from './pre.mjs';
@@ -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