@liguelead/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 (32) hide show
  1. package/components/Button/Button.styles.ts +3 -3
  2. package/components/Button/Button.tsx +62 -56
  3. package/components/Button/Button.types.ts +2 -1
  4. package/components/Checkbox/Checkbox.styles.ts +66 -0
  5. package/components/Checkbox/Checkbox.tsx +40 -0
  6. package/components/Checkbox/Checkbox.types.ts +11 -0
  7. package/components/Checkbox/index.tsx +2 -0
  8. package/components/DatePicker/DatePicker.styles.ts +66 -0
  9. package/components/DatePicker/DatePicker.tsx +135 -0
  10. package/components/DatePicker/DatePicker.types.ts +29 -0
  11. package/components/DatePicker/index.ts +1 -0
  12. package/components/IconButton/IconButton.tsx +53 -50
  13. package/components/SegmentedButton/SegmentedButton.styles.ts +29 -0
  14. package/components/SegmentedButton/SegmentedButton.tsx +49 -0
  15. package/components/SegmentedButton/SegmentedButton.types.ts +20 -0
  16. package/components/SegmentedButton/index.ts +1 -0
  17. package/components/Select/Select.sizes.ts +56 -0
  18. package/components/Select/Select.states.tsx +69 -0
  19. package/components/Select/Select.styles.ts +148 -0
  20. package/components/Select/Select.tsx +144 -0
  21. package/components/Select/Select.types.ts +36 -0
  22. package/components/Select/index.ts +1 -0
  23. package/components/Text/Text.styles.ts +5 -5
  24. package/components/Text/Text.tsx +4 -42
  25. package/components/Text/Text.types.ts +42 -0
  26. package/components/TextField/TextField.tsx +7 -2
  27. package/components/TextField/TextField.types.ts +2 -1
  28. package/components/ThemeProvider/ThemeProvider.tsx +11 -20
  29. package/components/ThemeProvider/style.ts +781 -12
  30. package/components/index.ts +4 -0
  31. package/package.json +6 -3
  32. package/scripts/createTypes.js +32 -2
@@ -1,7 +1,11 @@
1
1
  export { default as Button } from './Button'
2
+ export { default as Checkbox } from './Checkbox'
3
+ export { default as DatePicker } from './DatePicker'
2
4
  export { default as IconButton } from './IconButton'
3
5
  export { default as PageWrapper } from './PageWrapper'
4
6
  export { default as Text } from './Text'
5
7
  export { default as TextField } from './TextField'
6
8
  export { default as ThemeProvider } from './ThemeProvider'
7
9
  export { default as Wizard } from './Wizard'
10
+ export { default as Select } from './Select'
11
+ export { default as SegmentedButton } from './SegmentedButton'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liguelead/design-system",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "components/index.ts",
6
6
  "publishConfig": {
@@ -8,7 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@liguelead/foundation": "^0.0.11",
11
- "@phosphor-icons/react": "^2.1.7"
11
+ "@phosphor-icons/react": "^2.1.7",
12
+ "@radix-ui/react-dropdown-menu": "^2.1.6",
13
+ "@radix-ui/react-select": "^2.1.6"
12
14
  },
13
15
  "scripts": {
14
16
  "lint": "eslint ."
@@ -31,6 +33,7 @@
31
33
  "react": "^18.3.1",
32
34
  "styled-components": "6.1.13",
33
35
  "typescript": "5.6.2",
34
- "typescript-eslint": "^8.11.0"
36
+ "typescript-eslint": "^8.11.0",
37
+ "vite-tsconfig-paths": "^5.1.3"
35
38
  }
36
39
  }
@@ -4,13 +4,40 @@ import fs from 'fs'
4
4
  import path from 'path'
5
5
 
6
6
  // Diretório e arquivos que queremos criar
7
+ const dir = path.resolve(process.cwd(), './')
7
8
  const srcDir = path.resolve(process.cwd(), 'src')
8
9
  const typesDir = path.join(srcDir, 'types')
9
10
  const indexFile = path.join(typesDir, 'index.ts')
10
11
  const typesFile = path.join(typesDir, 'types.ts')
12
+ const tsconfigApp = path.join(dir, 'tsconfig.json')
13
+ const viteConfig = path.join(dir, 'vite.config.ts')
11
14
 
12
15
  // Função para criar pasta e arquivos
13
16
  const createOrUpdateTypes = () => {
17
+ const viteConfigContent = `
18
+ // vite.config.ts
19
+ import { defineConfig } from 'vite';
20
+ import react from '@vitejs/plugin-react';
21
+ import tsconfigPaths from 'vite-tsconfig-paths';
22
+
23
+ export default defineConfig({
24
+ plugins: [react(), tsconfigPaths()],
25
+ });
26
+ `
27
+
28
+ const tsconfigAppContent = `{
29
+ "compilerOptions": {
30
+ // Configurações de compilação base
31
+ "baseUrl": "./src"
32
+ }
33
+ }
34
+ `
35
+ fs.writeFileSync(tsconfigApp, tsconfigAppContent, 'utf8')
36
+ console.log(`Arquivo sobrescrito: ${tsconfigApp}`)
37
+
38
+ fs.writeFileSync(viteConfig, viteConfigContent, 'utf8')
39
+ console.log(`Arquivo sobrescrito: ${viteConfig}`)
40
+
14
41
  if (!fs.existsSync(srcDir)) {
15
42
  console.error(
16
43
  'A pasta "src" não foi encontrada. Certifique-se de que ela existe.'
@@ -26,13 +53,16 @@ const createOrUpdateTypes = () => {
26
53
  }
27
54
 
28
55
  if (!fs.existsSync(indexFile)) {
29
- fs.writeFileSync(indexFile, '// Arquivo de exportação\n', 'utf8')
56
+ const indexFileContent = `export type {colorType} from './types'`
57
+ fs.writeFileSync(indexFile, indexFileContent, 'utf8')
30
58
  console.log(`Arquivo criado: ${indexFile}`)
31
59
  } else {
32
60
  console.log(`O arquivo já existe e não será modificado: ${indexFile}`)
33
61
  }
62
+ const typesFileContent = `import {DefaultTheme} from 'styled-components'
63
+ export type colorType = keyof DefaultTheme['colors']`
34
64
 
35
- fs.writeFileSync(typesFile, '// Definições de tipos atualizadas\n', 'utf8')
65
+ fs.writeFileSync(typesFile, typesFileContent, 'utf8')
36
66
  console.log(`Arquivo sobrescrito: ${typesFile}`)
37
67
  }
38
68