@sakura-ui/sakura-ui 0.0.11 → 0.0.13

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 (61) hide show
  1. package/package.json +7 -4
  2. package/packages/config/package.json +3 -2
  3. package/packages/config/src/index.ts +105 -90
  4. package/packages/config/src/material-symbols-outlined.woff2 +0 -0
  5. package/packages/config/vite.config.ts +13 -1
  6. package/packages/icons/dist/components/Icon.d.ts +6 -0
  7. package/packages/icons/dist/components/Icon.d.ts.map +1 -0
  8. package/packages/icons/dist/components/IconButton.d.ts +8 -0
  9. package/packages/icons/dist/components/IconButton.d.ts.map +1 -0
  10. package/packages/icons/dist/components/index.d.ts +3 -0
  11. package/packages/icons/dist/components/index.d.ts.map +1 -0
  12. package/packages/icons/dist/index.cjs.js +88 -0
  13. package/packages/icons/dist/index.cjs.js.map +1 -0
  14. package/packages/icons/dist/index.d.ts +2 -0
  15. package/packages/icons/dist/index.d.ts.map +1 -0
  16. package/packages/icons/dist/index.es.js +725 -0
  17. package/packages/icons/dist/index.es.js.map +1 -0
  18. package/packages/icons/dist/utils/index.d.ts +2 -0
  19. package/packages/icons/dist/utils/index.d.ts.map +1 -0
  20. package/packages/icons/node_modules/.bin/autoprefixer +17 -0
  21. package/packages/icons/node_modules/.bin/jest +17 -0
  22. package/packages/icons/node_modules/.bin/npm-run-all +17 -0
  23. package/packages/icons/node_modules/.bin/run-p +17 -0
  24. package/packages/icons/node_modules/.bin/run-s +17 -0
  25. package/packages/icons/node_modules/.bin/tailwind +17 -0
  26. package/packages/icons/node_modules/.bin/tailwindcss +17 -0
  27. package/packages/icons/node_modules/.bin/ts-jest +17 -0
  28. package/packages/icons/node_modules/.bin/ts-node +17 -0
  29. package/packages/icons/node_modules/.bin/ts-node-cwd +17 -0
  30. package/packages/icons/node_modules/.bin/ts-node-esm +17 -0
  31. package/packages/icons/node_modules/.bin/ts-node-script +17 -0
  32. package/packages/icons/node_modules/.bin/ts-node-transpile-only +17 -0
  33. package/packages/icons/node_modules/.bin/ts-script +17 -0
  34. package/packages/icons/node_modules/.bin/tsc +17 -0
  35. package/packages/icons/node_modules/.bin/tsc-alias +17 -0
  36. package/packages/icons/node_modules/.bin/tsserver +17 -0
  37. package/packages/icons/node_modules/.bin/vite +17 -0
  38. package/packages/icons/package.json +61 -0
  39. package/packages/icons/src/components/Icon.tsx +27 -0
  40. package/packages/icons/src/components/IconButton.tsx +94 -0
  41. package/packages/icons/src/components/index.ts +2 -0
  42. package/packages/icons/src/index.ts +1 -0
  43. package/packages/icons/src/utils/index.ts +1 -0
  44. package/{examples → packages/icons}/tsconfig.json +8 -2
  45. package/packages/icons/vite.config.ts +26 -0
  46. package/packages/react/package.json +1 -1
  47. package/packages/react/src/components/Button.tsx +3 -0
  48. package/.prettierrc +0 -21
  49. package/examples/README.md +0 -14
  50. package/examples/index.html +0 -14
  51. package/examples/package.json +0 -25
  52. package/examples/postcss.config.js +0 -6
  53. package/examples/public/vite.svg +0 -1
  54. package/examples/src/App.tsx +0 -56
  55. package/examples/src/main.css +0 -3
  56. package/examples/src/main.tsx +0 -9
  57. package/examples/tailwind.config.js +0 -9
  58. package/examples/vite.config.ts +0 -7
  59. package/pnpm-workspace.yaml +0 -3
  60. /package/{examples → packages/icons}/src/vite-env.d.ts +0 -0
  61. /package/{examples → packages/icons}/tsconfig.node.json +0 -0
@@ -0,0 +1,94 @@
1
+ import React from 'react'
2
+ import { cx } from '../utils'
3
+
4
+ export interface IconButtonProps extends React.ComponentProps<'button'> {
5
+ variant?: 'primary' | 'secondary'
6
+ iconLayout?: 'left' | 'right'
7
+ icon: string
8
+ }
9
+
10
+ export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
11
+ (props, ref) => {
12
+ const { className, children, variant, icon, iconLayout, ...newProps } =
13
+ props
14
+
15
+ const layout = iconLayout ?? 'left'
16
+
17
+ const align = 'center'
18
+
19
+ const style = `
20
+ inline-block
21
+ p-4
22
+ text-base
23
+ font-bold
24
+ rounded-lg
25
+ text-${align}
26
+ cursor-pointer
27
+ whitespace-nowrap
28
+ `
29
+
30
+ const primary = `
31
+ text-white-1000
32
+ border
33
+ border-solid
34
+ border-sea-600
35
+ bg-sea-600
36
+ hover:bg-sea-800
37
+ active:bg-sea-800
38
+ focus:outline
39
+ focus:outline-2
40
+ focus:outline-wood-500
41
+ disabled:bg-sumi-500
42
+ disabled:text-white-1000
43
+ disabled:border
44
+ disabled:border-solid
45
+ disabled:border-sumi-500
46
+ disabled:cursor-not-allowed
47
+ `
48
+ const secondary = `
49
+ text-sea-600
50
+ border
51
+ border-solid
52
+ border-sea-600
53
+ hover:bg-sea-100
54
+ active:bg-sea-100
55
+ focus:outline
56
+ focus:outline-2
57
+ focus:outline-wood-500
58
+ disabled:hover:bg-white-1000
59
+ disabled:text-sumi-500
60
+ disabled:border
61
+ disabled:border-solid
62
+ disabled:border-sumi-500
63
+ disabled:cursor-not-allowed
64
+ `
65
+
66
+ const styles = {
67
+ primary: primary,
68
+ secondary: secondary
69
+ }
70
+
71
+ const iconStyle = `
72
+ inline-block
73
+ align-middle
74
+ font-icon
75
+ text-2xl
76
+ font-light
77
+ leading-4
78
+ antialiased
79
+ mb-1
80
+ `
81
+
82
+ return (
83
+ <button
84
+ className={cx(style, styles[variant ?? 'primary'], className)}
85
+ {...newProps}
86
+ ref={ref}
87
+ >
88
+ {layout == 'left' && <span className={cx(iconStyle)}>{icon}</span>}
89
+ {children && <span className="mx-1 inline-block">{children}</span>}
90
+ {layout == 'right' && <span className={cx(iconStyle)}>{icon}</span>}
91
+ </button>
92
+ )
93
+ }
94
+ )
@@ -0,0 +1,2 @@
1
+ export { IconButton } from './IconButton'
2
+ export { Icon } from './Icon'
@@ -0,0 +1 @@
1
+ export { Icon, IconButton } from './components'
@@ -0,0 +1 @@
1
+ export const cx = (...classNames: any[]) => classNames.filter(Boolean).join(' ')
@@ -13,8 +13,14 @@
13
13
  "moduleResolution": "Node",
14
14
  "resolveJsonModule": true,
15
15
  "isolatedModules": true,
16
- "noEmit": true,
17
- "jsx": "react-jsx"
16
+ "jsx": "react-jsx",
17
+ "outDir": "dist",
18
+ "declaration": true,
19
+ "declarationMap": true,
20
+ "baseUrl": ".",
21
+ "paths": {
22
+ "@/*": ["src/*"]
23
+ }
18
24
  },
19
25
  "include": ["src"],
20
26
  "references": [{ "path": "./tsconfig.node.json" }]
@@ -0,0 +1,26 @@
1
+ import { resolve } from 'path'
2
+ import { defineConfig } from 'vite'
3
+ import react from '@vitejs/plugin-react-swc'
4
+ import { peerDependencies } from './package.json'
5
+
6
+ // https://vitejs.dev/config/
7
+ export default defineConfig({
8
+ plugins: [react()],
9
+ resolve: {
10
+ alias: {
11
+ '@': resolve(__dirname, 'src')
12
+ }
13
+ },
14
+ build: {
15
+ lib: {
16
+ entry: resolve(__dirname, 'src', 'index.ts'),
17
+ formats: ['es', 'cjs'],
18
+ fileName: (ext) => `index.${ext}.js`
19
+ },
20
+ rollupOptions: {
21
+ external: [...Object.keys(peerDependencies)]
22
+ },
23
+ target: 'esnext',
24
+ sourcemap: true
25
+ }
26
+ })
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sakura-ui/react",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -26,6 +26,9 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
26
26
 
27
27
  const primary = `
28
28
  text-white-1000
29
+ border
30
+ border-solid
31
+ border-sea-600
29
32
  bg-sea-600
30
33
  hover:bg-sea-800
31
34
  active:bg-sea-800
package/.prettierrc DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "tabWidth": 2,
3
- "singleQuote": true,
4
- "jsxSingleQuote": false,
5
- "trailingComma": "none",
6
- "semi": false,
7
- "overrides": [
8
- {
9
- "files": ["*.md", "README"],
10
- "options": {
11
- "parser": "markdown-nocjsp"
12
- }
13
- },
14
- {
15
- "files": ["*.mdx"],
16
- "options": {
17
- "parser": "mdx-nocjsp"
18
- }
19
- }
20
- ]
21
- }
@@ -1,14 +0,0 @@
1
- # SakuraUI examples
2
-
3
- ## Install
4
- ```
5
- $ pnpm install
6
- ```
7
-
8
- ## Run
9
- ```
10
- $ pnpm dev
11
- ```
12
-
13
- ## Browse
14
- http://localhost:5173/
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <link rel="stylesheet" href="/src/main.css" />
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
8
- <title>Vite + React + TS</title>
9
- </head>
10
- <body>
11
- <div id="root"></div>
12
- <script type="module" src="/src/main.tsx"></script>
13
- </body>
14
- </html>
@@ -1,25 +0,0 @@
1
- {
2
- "name": "examples",
3
- "private": true,
4
- "version": "0.0.0",
5
- "scripts": {
6
- "dev": "vite",
7
- "build": "tsc && vite build",
8
- "preview": "vite preview"
9
- },
10
- "dependencies": {
11
- "@sakura-ui/sakura-ui": "workspace:^0.0.10",
12
- "react": "^18.2.0",
13
- "react-dom": "^18.2.0"
14
- },
15
- "devDependencies": {
16
- "@types/react": "^18.0.27",
17
- "@types/react-dom": "^18.0.10",
18
- "@vitejs/plugin-react-swc": "^3.0.0",
19
- "autoprefixer": "^10.4.13",
20
- "postcss": "^8.4.21",
21
- "tailwindcss": "^3.2.7",
22
- "typescript": "^4.9.3",
23
- "vite": "^4.1.4"
24
- }
25
- }
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {},
5
- },
6
- }
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,56 +0,0 @@
1
- import { useState } from 'react'
2
- import {
3
- H1,
4
- H2,
5
- H3,
6
- H4,
7
- H5,
8
- H6,
9
- Button,
10
- Checkbox,
11
- Radio,
12
- Text,
13
- Textarea
14
- } from '../../packages/react/src'
15
-
16
- const App = () => {
17
- const [count, setCount] = useState(0)
18
-
19
- return (
20
- <div className="text-sumi-900 text-base">
21
- <H1>SakuraUI Heading1</H1>
22
- <H2>SakuraUI Heading2</H2>
23
- <H3>SakuraUI Heading3</H3>
24
- <H4>SakuraUI Heading4</H4>
25
- <H5>SakuraUI Heading5</H5>
26
- <H6>SakuraUI Heading6</H6>
27
- <div>
28
- <Button onClick={() => setCount((count) => count + 1)}>
29
- count is {count}
30
- </Button>
31
- <Button
32
- variant="secondary"
33
- onClick={() => setCount((count) => count + 1)}
34
- >
35
- count is {count}
36
- </Button>
37
- <Button onClick={() => setCount((count) => count + 1)} disabled>
38
- count is {count}
39
- </Button>
40
- <Button
41
- variant="secondary"
42
- onClick={() => setCount((count) => count + 1)}
43
- disabled
44
- >
45
- count is {count}
46
- </Button>
47
- <Radio name="sample">ラジオ1</Radio>
48
- <Radio name="sample">ラジオ2</Radio>
49
- <Checkbox>選択肢1</Checkbox>
50
- <Checkbox>選択肢2</Checkbox>
51
- </div>
52
- </div>
53
- )
54
- }
55
-
56
- export default App
@@ -1,3 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
@@ -1,9 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
3
- import App from './App'
4
-
5
- ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
6
- <React.StrictMode>
7
- <App />
8
- </React.StrictMode>
9
- )
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- mode: 'jit',
3
- content: [
4
- './index.html',
5
- './src/**/*.{jsx,tsx}',
6
- './node_modules/@sakura-ui/sakura-ui/packages/react/**/*.{jsx,tsx}'
7
- ],
8
- plugins: [require('@sakura-ui/config')]
9
- }
@@ -1,7 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react-swc'
3
-
4
- // https://vitejs.dev/config/
5
- export default defineConfig({
6
- plugins: [react()],
7
- })
@@ -1,3 +0,0 @@
1
- packages:
2
- - 'packages/**'
3
- - '!**/test/**'
File without changes
File without changes