cetec-design-system 0.0.25 → 0.0.26

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 (50) hide show
  1. package/README.md +223 -35
  2. package/dist/cetec-components.css +1 -0
  3. package/dist/cetec-components.es.js +26960 -0
  4. package/package.json +1 -1
  5. package/src/recipes/checkbox.ts +1 -1
  6. package/src/recipes/index.ts +3 -0
  7. package/src/recipes/radioinput.ts +14 -0
  8. package/src/recipes/toggle.ts +115 -0
  9. package/src/recipes/toggleinput.ts +17 -0
  10. package/src/utils/splitProps.ts +12 -5
  11. package/dist/cetec-design-system.es.js +0 -1514
  12. package/dist/components/Box/Box.d.ts +0 -7
  13. package/dist/components/Box/index.d.ts +0 -1
  14. package/dist/components/Button/Button.d.ts +0 -12
  15. package/dist/components/Button/ButtonContent.d.ts +0 -8
  16. package/dist/components/Button/index.d.ts +0 -1
  17. package/dist/components/CheckBox/CheckBox.d.ts +0 -8
  18. package/dist/components/CheckBox/index.d.ts +0 -1
  19. package/dist/components/Code/Code.d.ts +0 -8
  20. package/dist/components/Code/Pre.d.ts +0 -7
  21. package/dist/components/Code/index.d.ts +0 -2
  22. package/dist/components/Divider/Divider.d.ts +0 -7
  23. package/dist/components/Divider/index.d.ts +0 -1
  24. package/dist/components/Heading/Heading.d.ts +0 -7
  25. package/dist/components/Heading/index.d.ts +0 -1
  26. package/dist/components/Icon/Icon.d.ts +0 -14
  27. package/dist/components/Icon/index.d.ts +0 -3
  28. package/dist/components/IconButton/IconButton.d.ts +0 -19
  29. package/dist/components/IconButton/index.d.ts +0 -1
  30. package/dist/components/Input/Input.d.ts +0 -10
  31. package/dist/components/Input/index.d.ts +0 -1
  32. package/dist/components/Label/Label.d.ts +0 -7
  33. package/dist/components/Label/index.d.ts +0 -1
  34. package/dist/components/Link/Link.d.ts +0 -16
  35. package/dist/components/Link/index.d.ts +0 -1
  36. package/dist/components/PandaPatterns.d.ts +0 -1
  37. package/dist/components/Radio/Radio.d.ts +0 -7
  38. package/dist/components/Radio/index.d.ts +0 -1
  39. package/dist/components/Slot.d.ts +0 -4
  40. package/dist/components/Spinner/Spinner.d.ts +0 -4
  41. package/dist/components/Spinner/index.d.ts +0 -1
  42. package/dist/components/Text/Text.d.ts +0 -8
  43. package/dist/components/Text/Text.stories.d.ts +0 -7
  44. package/dist/components/Text/index.d.ts +0 -1
  45. package/dist/components/TextInput/TextInput.d.ts +0 -6
  46. package/dist/components/TextInput/index.d.ts +0 -1
  47. package/dist/components/Textarea/Textarea.d.ts +0 -8
  48. package/dist/components/Textarea/index.d.ts +0 -1
  49. package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +0 -1
  50. package/dist/components/ThemeSwitcher/index.d.ts +0 -1
package/README.md CHANGED
@@ -1,50 +1,238 @@
1
- # React + TypeScript + Vite
1
+ >[!IMPORTANT]
2
+ >Currently a work in progress and may not be accurate.
2
3
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+ # Cetec-ERP Design System
4
5
 
5
- Currently, two official plugins are available:
6
+ Contains components and styles for the Cetec-ERP application and marketing website.
6
7
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
8
+ - [Overview](#overview)
9
+ - [Installation](#installation)
10
+ - [Usage](#usage)
9
11
 
10
- ## Expanding the ESLint configuration
12
+ ## Overview
13
+ Components are bundled in /dist/cetec-design-system.es.js
14
+ Type definitions are in src/components/
11
15
 
12
- If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
16
+ ## Installation
17
+ ## Usage
13
18
 
14
- - Configure the top-level `parserOptions` property like this:
19
+ Copy the panda config from the repo (below) and change the paths to the imports to point to path of the package in node modules.
20
+ Set up the 'include' option to contain the paths in which you want panda to look when building styled-system and styles.css.
21
+ ```
22
+ import {
23
+ defineConfig,
24
+ defineTokens,
25
+ defineSemanticTokens,
26
+ } from '@pandacss/dev';
27
+ import pandaBasePreset from '@pandacss/preset-base';
28
+
29
+ import * as tokens from 'node_modules/cetec-design-system/src/styles/tokens';
30
+ import * as semanticTokens from 'node_modules/cetec-design-system/src/styles/semanticTokens';
31
+ import { globalCss } from 'node_modules/cetec-design-system/src/styles/globalStyle';
32
+ import { conditions } from 'node_modules/cetec-design-system/src/styles/conditions';
33
+ import {
34
+ buttonRecipe,
35
+ iconButtonRecipe,
36
+ inputRecipe,
37
+ textareaRecipe,
38
+ headingRecipe,
39
+ linkRecipe,
40
+ labelRecipe,
41
+ textRecipe,
42
+ checkBoxRecipe,
43
+ spinnerRecipe,
44
+ dividerRecipe,
45
+ preRecipe,
46
+ codeRecipe,
47
+ boxRecipe,
48
+ radioRecipe,
49
+ textinputRecipe,
50
+ } from 'node_modules/cetec-design-system/src/recipes';
51
+ import { benefitsRecipe } from "./src/recipes";
52
+
53
+ // https://panda-css.com/docs/concepts/extend#removing-something-from-the-base-presets
54
+ // omit default patterns here
55
+ const { box, divider, ...pandaBasePresetPatterns } = pandaBasePreset.patterns;
56
+ const pandaBasePresetConditions = pandaBasePreset.conditions;
57
+ const pandaBasePresetUtilities = pandaBasePreset.utilities;
58
+ const pandaBasePresetGlobalCss = pandaBasePreset.globalCss;
59
+
60
+ // using pandas methods to define type-safe tokens
61
+ const theme = {
62
+ tokens: defineTokens({
63
+ aspectRatios: tokens.aspectRatios,
64
+ borders: tokens.borders,
65
+ shadows: tokens.shadows,
66
+ easings: tokens.easings,
67
+ durations: tokens.durations,
68
+ letterSpacings: tokens.letterSpacings,
69
+ lineHeights: tokens.lineHeights,
70
+ blurs: tokens.blurs,
71
+ animations: tokens.animations,
72
+ colors: tokens.colors,
73
+ fonts: tokens.fonts,
74
+ fontSizes: tokens.fontSizes,
75
+ fontWeights: tokens.fontWeights,
76
+ sizes: tokens.sizes,
77
+ numericSizes: tokens.numericSizes,
78
+ spacing: tokens.sizes,
79
+ radii: tokens.radii,
80
+ keyframes: tokens.keyframes,
81
+ containerSizes: tokens.containerSizes,
82
+ breakpoints: tokens.breakpoints,
83
+ }),
84
+ semanticTokens: defineSemanticTokens({
85
+ colors: semanticTokens.colors,
86
+ }),
87
+ };
88
+
89
+ export default defineConfig({
90
+ presets: ['@pandacss/dev/presets'],
91
+ eject: true,
92
+ gitignore: true,
93
+ jsxFramework: 'react',
94
+ jsxStyleProps: 'all',
95
+ jsxFactory: 'styled',
96
+ watch: true,
97
+ include: ["./src/pages/index.astro", "./src/components/**/*{ts, tsx, js, jsx, astro}"],
98
+ preflight: true,
99
+ exclude: [],
100
+ strictTokens: true,
101
+ importMap: '@styled-system',
102
+ outdir: 'styled-system',
15
103
 
16
- ```js
17
- export default tseslint.config({
18
- languageOptions: {
19
- // other options...
20
- parserOptions: {
21
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
22
- tsconfigRootDir: import.meta.dirname,
104
+ theme: {
105
+ containerSizes: tokens.containerSizes,
106
+ keyframes: tokens.keyframes,
107
+ tokens: {
108
+ aspectRatios: theme.tokens.aspectRatios,
109
+ borders: theme.tokens.borders,
110
+ shadows: theme.tokens.shadows,
111
+ easings: theme.tokens.easings,
112
+ durations: theme.tokens.durations,
113
+ letterSpacings: theme.tokens.letterSpacings,
114
+ lineHeights: theme.tokens.lineHeights,
115
+ blurs: theme.tokens.blurs,
116
+ animations: theme.tokens.animations,
117
+ colors: theme.tokens.colors,
118
+ fonts: theme.tokens.fonts,
119
+ fontSizes: theme.tokens.fontSizes,
120
+ fontWeights: theme.tokens.fontWeights,
121
+ sizes: theme.tokens.sizes,
122
+ numericSizes: theme.tokens.numericSizes,
123
+ spacing: theme.tokens.sizes,
124
+ radii: theme.tokens.radii,
125
+ },
126
+ semanticTokens: {
127
+ colors: theme.semanticTokens.colors,
128
+ },
129
+ extend: {
130
+ breakpoints: theme.tokens.breakpoints,
131
+ textStyles: tokens.textStyles,
132
+ recipes: {
133
+ benefits: benefitsRecipe,
134
+ text: textRecipe,
135
+ heading: headingRecipe,
136
+ link: linkRecipe,
137
+ label: labelRecipe,
138
+ button: buttonRecipe,
139
+ iconButton: iconButtonRecipe,
140
+ input: inputRecipe,
141
+ textinput: textinputRecipe,
142
+ textarea: textareaRecipe,
143
+ code: codeRecipe,
144
+ pre: preRecipe,
145
+ spinner: spinnerRecipe,
146
+ divider: dividerRecipe,
147
+ box: boxRecipe,
148
+ },
149
+ slotRecipes: {
150
+ checkbox: checkBoxRecipe,
151
+ radio: radioRecipe,
152
+ },
23
153
  },
24
154
  },
25
- })
26
- ```
27
155
 
28
- - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29
- - Optionally add `...tseslint.configs.stylisticTypeChecked`
30
- - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
156
+ utilities: {
157
+ ...pandaBasePresetUtilities,
158
+ },
31
159
 
32
- ```js
33
- // eslint.config.js
34
- import react from 'eslint-plugin-react'
160
+ patterns: {
161
+ icon: {
162
+ properties: {
163
+ size: {
164
+ type: 'enum',
165
+ value: Object.keys(tokens.sizes),
166
+ },
167
+ },
168
+ transform(props) {
169
+ const { size, ...rest } = props;
170
+ return {
171
+ width: size,
172
+ height: size,
173
+ ...rest,
174
+ };
175
+ },
176
+ },
177
+ extend: {
178
+ ...pandaBasePresetPatterns,
179
+ container: {
180
+ transform(props) {
181
+ return Object.assign(
182
+ {
183
+ position: 'relative',
184
+ width: '100%',
185
+ maxWidth: '7xl',
186
+ mx: 'auto',
187
+ px: { base: '24', md: '20', sm: '16' },
188
+ },
189
+ props,
190
+ );
191
+ },
192
+ },
193
+ },
194
+ },
35
195
 
36
- export default tseslint.config({
37
- // Set the react version
38
- settings: { react: { version: '18.3' } },
39
- plugins: {
40
- // Add the react plugin
41
- react,
196
+ globalCss: {
197
+ ...pandaBasePresetGlobalCss,
198
+ ...globalCss,
199
+ html: {
200
+ '--global-font-heading': 'fonts.heading',
201
+ '--global-font-body': 'fonts.body',
202
+ '--global-font-mono': 'fonts.mono',
203
+ },
42
204
  },
43
- rules: {
44
- // other rules...
45
- // Enable its recommended rules
46
- ...react.configs.recommended.rules,
47
- ...react.configs['jsx-runtime'].rules,
205
+ conditions: {
206
+ ...pandaBasePresetConditions,
207
+ // Core conditions pulled from panda preset-base package
208
+ ...conditions,
209
+
210
+ // Themes moved to conditions.tx
211
+
212
+ // States
213
+ indeterminate:
214
+ '&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=indeterminate])',
215
+ hidden: '&:is([hidden])',
216
+ current: '&:is([data-current])',
217
+ today: '&:is([data-today])',
218
+ collapsed:
219
+ '&:is([aria-collapsed=true], [data-collapsed], [data-state="collapsed"])',
220
+
221
+ // Containers
222
+ containerSmall: '@container (max-width: 560px)',
223
+ containerMedium: '@container (min-width: 561px) and (max-width: 999px)',
224
+ containerLarge: '@container (min-width: 1000px)',
48
225
  },
49
- })
226
+ });
227
+ ```
228
+ At the root of your project you'll want to:
229
+ - Import styles.css from the styled-system folder generated from panda codegen, usually at the root of the project: ./styled-system/styles.css
230
+ - Import Icons from the cetec-design-system like so: import * as iconsimport Header from "../components/Header.astro"; - maybe you don't need to do this anymore?
231
+
232
+ ```
233
+
234
+ import { ThemeProvider, Text, Spinner, Button, Icon } from "cetec-design-system";
235
+ import "@styled-system/styles.css";
236
+ import * as icons from 'cetec-design-system/icons';
237
+ from 'cetec-design-system/icons';
50
238
  ```