@sakura-ui/sakura-ui 0.2.0 → 0.3.0
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/README.md +16 -6
- package/package.json +21 -15
- package/packages/core/package.json +26 -15
- package/packages/core/src/components/Button.tsx +33 -32
- package/packages/core/src/components/Card.tsx +29 -17
- package/packages/core/src/components/Code.tsx +6 -4
- package/packages/core/src/components/Faq.tsx +13 -7
- package/packages/core/src/components/Heading.tsx +42 -32
- package/packages/core/src/components/Icon.tsx +43 -13
- package/packages/core/src/components/IconButton.tsx +54 -43
- package/packages/core/src/components/LangSelector.tsx +135 -0
- package/packages/core/src/components/Link.tsx +38 -66
- package/packages/core/src/components/LinkCard.tsx +91 -0
- package/packages/core/src/components/List.tsx +14 -12
- package/packages/core/src/components/MenuButton.tsx +112 -0
- package/packages/core/src/components/NavigationItem.tsx +41 -0
- package/packages/core/src/components/OverflowContainer.tsx +24 -0
- package/packages/core/src/components/PopoverMenu.tsx +81 -0
- package/packages/core/src/components/Pre.tsx +6 -4
- package/packages/core/src/components/Table.tsx +31 -25
- package/packages/core/src/components/buttonStyle.ts +42 -31
- package/packages/core/src/components/index.ts +13 -25
- package/packages/core/src/icons/Close.tsx +21 -0
- package/packages/core/src/icons/CloseMobile.tsx +43 -0
- package/packages/core/src/icons/KeyboardArrowDown.tsx +24 -0
- package/packages/core/src/icons/Language.tsx +25 -0
- package/packages/core/src/icons/LanguageMobile.tsx +40 -0
- package/packages/core/src/icons/Menu.tsx +24 -0
- package/packages/core/src/icons/MenuMobile.tsx +40 -0
- package/packages/core/src/icons/index.ts +8 -0
- package/packages/core/src/icons/props.ts +5 -0
- package/packages/core/src/index.ts +9 -28
- package/packages/core/src/type.d.ts +1 -0
- package/packages/core/tests/Button.test.tsx +20 -10
- package/packages/core/tests/Card.test.tsx +16 -11
- package/packages/core/tests/IconButton.test.tsx +57 -0
- package/packages/core/tests/Link.test.tsx +60 -0
- package/packages/core/tests/vitest.setup.ts +1 -0
- package/packages/core/tsconfig.node.json +3 -2
- package/packages/forms/.turbo/turbo-build.log +22 -0
- package/packages/forms/dist/index.cjs.js +199 -120
- package/packages/forms/dist/index.es.js +890 -1023
- package/packages/forms/dist/types/components/Checkbox.d.ts +9 -4
- package/packages/forms/dist/types/components/Checkbox.d.ts.map +1 -1
- package/packages/forms/dist/types/components/FieldsetControl.d.ts +14 -9
- package/packages/forms/dist/types/components/FieldsetControl.d.ts.map +1 -1
- package/packages/forms/dist/types/components/FileInput.d.ts +10 -3
- package/packages/forms/dist/types/components/FileInput.d.ts.map +1 -1
- package/packages/forms/dist/types/components/Input.d.ts +9 -4
- package/packages/forms/dist/types/components/Input.d.ts.map +1 -1
- package/packages/forms/dist/types/components/LabelControl.d.ts +13 -8
- package/packages/forms/dist/types/components/LabelControl.d.ts.map +1 -1
- package/packages/forms/dist/types/components/Radio.d.ts +9 -4
- package/packages/forms/dist/types/components/Radio.d.ts.map +1 -1
- package/packages/forms/dist/types/components/Select.d.ts +9 -4
- package/packages/forms/dist/types/components/Select.d.ts.map +1 -1
- package/packages/forms/dist/types/components/Textarea.d.ts +8 -3
- package/packages/forms/dist/types/components/Textarea.d.ts.map +1 -1
- package/packages/forms/dist/types/components/controlled/CheckboxGroup.d.ts +16 -11
- package/packages/forms/dist/types/components/controlled/CheckboxGroup.d.ts.map +1 -1
- package/packages/forms/dist/types/components/controlled/RadioGroup.d.ts +17 -12
- package/packages/forms/dist/types/components/controlled/RadioGroup.d.ts.map +1 -1
- package/packages/forms/dist/types/components/index.d.ts +8 -8
- package/packages/forms/dist/types/components/index.d.ts.map +1 -1
- package/packages/forms/dist/types/components/inputStyle.d.ts +1 -1
- package/packages/forms/dist/types/components/inputStyle.d.ts.map +1 -1
- package/packages/forms/dist/types/index.d.ts +0 -1
- package/packages/forms/dist/types/index.d.ts.map +1 -1
- package/packages/forms/node_modules/.bin/autoprefixer +2 -2
- package/packages/forms/node_modules/.bin/tailwind +2 -2
- package/packages/forms/node_modules/.bin/tailwindcss +2 -2
- package/packages/forms/node_modules/.bin/ts-node +4 -4
- package/packages/forms/node_modules/.bin/ts-node-cwd +4 -4
- package/packages/forms/node_modules/.bin/ts-node-esm +4 -4
- package/packages/forms/node_modules/.bin/ts-node-script +4 -4
- package/packages/forms/node_modules/.bin/ts-node-transpile-only +4 -4
- package/packages/forms/node_modules/.bin/ts-script +4 -4
- package/packages/forms/node_modules/.bin/tsc +17 -0
- package/packages/forms/node_modules/.bin/tsserver +17 -0
- package/packages/forms/node_modules/.vite/vitest/results.json +1 -0
- package/packages/forms/package.json +17 -14
- package/packages/forms/src/components/Checkbox.tsx +76 -80
- package/packages/forms/src/components/FieldsetControl.tsx +21 -28
- package/packages/forms/src/components/FileInput.tsx +87 -63
- package/packages/forms/src/components/Input.tsx +29 -31
- package/packages/forms/src/components/LabelControl.tsx +19 -25
- package/packages/forms/src/components/Radio.tsx +66 -69
- package/packages/forms/src/components/Select.tsx +65 -65
- package/packages/forms/src/components/Textarea.tsx +49 -54
- package/packages/forms/src/components/controlled/CheckboxGroup.tsx +15 -17
- package/packages/forms/src/components/controlled/RadioGroup.tsx +16 -18
- package/packages/forms/src/components/index.ts +8 -8
- package/packages/forms/src/components/inputStyle.ts +7 -8
- package/packages/forms/src/index.ts +0 -11
- package/packages/forms/tests/Checkbox.test.tsx +44 -0
- package/packages/forms/tests/FieldsetControl.test.tsx +62 -11
- package/packages/forms/tests/FileInput.test.tsx +25 -0
- package/packages/forms/tests/Input.test.tsx +12 -83
- package/packages/forms/tests/LabelControl.test.tsx +82 -20
- package/packages/forms/tests/Radio.test.tsx +23 -78
- package/packages/forms/tests/Select.test.tsx +30 -0
- package/packages/forms/tests/Textarea.test.tsx +25 -0
- package/packages/forms/tests/vitest.setup.ts +1 -0
- package/packages/forms/tsconfig.node.json +3 -2
- package/packages/helper/.turbo/turbo-build.log +23 -0
- package/packages/helper/dist/index.cjs.js +78 -0
- package/packages/helper/dist/index.es.js +119 -0
- package/packages/helper/dist/types/calc.d.ts +2 -0
- package/packages/helper/dist/types/calc.d.ts.map +1 -0
- package/packages/{forms/dist/types/utils/class.d.ts → helper/dist/types/cx.d.ts} +1 -1
- package/packages/helper/dist/types/cx.d.ts.map +1 -0
- package/packages/helper/dist/types/index.d.ts +6 -0
- package/packages/helper/dist/types/index.d.ts.map +1 -0
- package/packages/helper/dist/types/querySelector.d.ts +2 -0
- package/packages/helper/dist/types/querySelector.d.ts.map +1 -0
- package/packages/helper/dist/types/styles.d.ts +22 -0
- package/packages/helper/dist/types/styles.d.ts.map +1 -0
- package/packages/helper/dist/types/treefy.d.ts +8 -0
- package/packages/helper/dist/types/treefy.d.ts.map +1 -0
- package/packages/helper/package.json +40 -0
- package/packages/helper/src/calc.ts +1 -0
- package/packages/helper/src/index.ts +5 -0
- package/packages/helper/src/querySelector.ts +20 -0
- package/packages/helper/src/styles.ts +116 -0
- package/packages/helper/src/treefy.ts +22 -0
- package/packages/helper/tsconfig.json +13 -0
- package/packages/helper/tsconfig.node.json +6 -0
- package/packages/helper/vite.config.ts +26 -0
- package/packages/markdown/.turbo/turbo-build.log +22 -0
- package/packages/markdown/README.md +129 -0
- package/packages/markdown/dist/index.cjs.js +175 -0
- package/packages/markdown/dist/index.es.js +17098 -0
- package/packages/markdown/dist/types/components/Markdown.d.ts +15 -0
- package/packages/markdown/dist/types/components/Markdown.d.ts.map +1 -0
- package/packages/markdown/dist/types/components/index.d.ts +2 -0
- package/packages/markdown/dist/types/components/index.d.ts.map +1 -0
- package/packages/markdown/dist/types/index.d.ts +2 -0
- package/packages/markdown/dist/types/index.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/attr.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/attr.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/card.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/card.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/cell.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/cell.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/faq.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/faq.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/grid.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/grid.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/headings.d.ts +9 -0
- package/packages/markdown/dist/types/plugins/headings.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/helper.d.ts +9 -0
- package/packages/markdown/dist/types/plugins/helper.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/index.d.ts +9 -0
- package/packages/markdown/dist/types/plugins/index.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/linkButton.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/linkButton.d.ts.map +1 -0
- package/packages/markdown/dist/types/plugins/youtube.d.ts +3 -0
- package/packages/markdown/dist/types/plugins/youtube.d.ts.map +1 -0
- package/packages/markdown/node_modules/.bin/autoprefixer +17 -0
- package/packages/markdown/node_modules/.bin/tailwind +17 -0
- package/packages/markdown/node_modules/.bin/tailwindcss +17 -0
- package/packages/markdown/node_modules/.bin/ts-node +17 -0
- package/packages/markdown/node_modules/.bin/ts-node-cwd +17 -0
- package/packages/markdown/node_modules/.bin/ts-node-esm +17 -0
- package/packages/markdown/node_modules/.bin/ts-node-script +17 -0
- package/packages/markdown/node_modules/.bin/ts-node-transpile-only +17 -0
- package/packages/markdown/node_modules/.bin/ts-script +17 -0
- package/packages/markdown/node_modules/.bin/tsc +17 -0
- package/packages/markdown/node_modules/.bin/tsserver +17 -0
- package/packages/markdown/package.json +83 -0
- package/packages/markdown/src/components/Markdown.tsx +361 -0
- package/packages/markdown/src/components/index.ts +1 -0
- package/packages/markdown/src/global.d.ts +9 -0
- package/packages/markdown/src/index.ts +1 -0
- package/packages/markdown/src/plugins/attr.ts +19 -0
- package/packages/markdown/src/plugins/card.ts +57 -0
- package/packages/markdown/src/plugins/cell.ts +47 -0
- package/packages/markdown/src/plugins/faq.ts +40 -0
- package/packages/markdown/src/plugins/grid.ts +51 -0
- package/packages/markdown/src/plugins/headings.ts +35 -0
- package/packages/markdown/src/plugins/helper.ts +27 -0
- package/packages/markdown/src/plugins/index.ts +8 -0
- package/packages/markdown/src/plugins/linkButton.ts +25 -0
- package/packages/markdown/src/plugins/youtube.ts +48 -0
- package/packages/markdown/tsconfig.json +13 -0
- package/packages/markdown/tsconfig.node.json +7 -0
- package/packages/markdown/vite.config.ts +30 -0
- package/packages/tailwind-theme-plugin/.turbo/turbo-build.log +22 -0
- package/packages/tailwind-theme-plugin/dist/index.cjs.js +1 -1
- package/packages/tailwind-theme-plugin/dist/index.es.js +5354 -6111
- package/packages/tailwind-theme-plugin/dist/types/index.d.ts +1 -1
- package/packages/tailwind-theme-plugin/dist/types/index.d.ts.map +1 -1
- package/packages/tailwind-theme-plugin/node_modules/.bin/autoprefixer +2 -2
- package/packages/tailwind-theme-plugin/node_modules/.bin/tailwind +2 -2
- package/packages/tailwind-theme-plugin/node_modules/.bin/tailwindcss +2 -2
- package/packages/tailwind-theme-plugin/node_modules/.bin/ts-node +4 -4
- package/packages/tailwind-theme-plugin/node_modules/.bin/ts-node-cwd +4 -4
- package/packages/tailwind-theme-plugin/node_modules/.bin/ts-node-esm +4 -4
- package/packages/tailwind-theme-plugin/node_modules/.bin/ts-node-script +4 -4
- package/packages/tailwind-theme-plugin/node_modules/.bin/ts-node-transpile-only +4 -4
- package/packages/tailwind-theme-plugin/node_modules/.bin/ts-script +4 -4
- package/packages/tailwind-theme-plugin/node_modules/.bin/tsc +17 -0
- package/packages/tailwind-theme-plugin/node_modules/.bin/tsserver +17 -0
- package/packages/tailwind-theme-plugin/package.json +6 -6
- package/packages/tailwind-theme-plugin/src/index.ts +226 -291
- package/packages/core/src/libs/forward-ref.ts +0 -44
- package/packages/core/src/types/component.ts +0 -83
- package/packages/forms/dist/types/utils/class.d.ts.map +0 -1
- package/packages/forms/node_modules/.bin/acorn +0 -17
- package/packages/forms/node_modules/.bin/browserslist +0 -17
- package/packages/forms/node_modules/.bin/eslint +0 -17
- package/packages/forms/node_modules/.bin/vitest +0 -17
- package/packages/forms/src/utils/class.ts +0 -2
- package/packages/tailwind-theme-plugin/node_modules/.bin/browserslist +0 -17
- /package/packages/{core/src/libs → helper/src}/cx.ts +0 -0
package/README.md
CHANGED
|
@@ -9,15 +9,20 @@ Sakura UI - UI components built with Tailwind CSS for React. Sakura UI is an uno
|
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
```
|
|
12
|
-
$ npm install @sakura-ui/sakura-ui
|
|
12
|
+
$ npm install @sakura-ui/core @sakura-ui/forms @sakura-ui/tailwind-theme-plugin @sakura-ui/markdown
|
|
13
13
|
```
|
|
14
14
|
or
|
|
15
15
|
```
|
|
16
|
-
$ yarn add @sakura-ui/sakura-ui
|
|
16
|
+
$ yarn add @sakura-ui/core @sakura-ui/forms @sakura-ui/tailwind-theme-plugin @sakura-ui/markdown
|
|
17
17
|
```
|
|
18
18
|
or
|
|
19
19
|
```
|
|
20
|
-
$ pnpm add @sakura-ui/core @sakura-ui/forms @sakura-ui/
|
|
20
|
+
$ pnpm add @sakura-ui/core @sakura-ui/forms @sakura-ui/tailwind-theme-plugin @sakura-ui/markdown
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### For React 18
|
|
24
|
+
```
|
|
25
|
+
$ pnpm add @sakura-ui/core@0.3.1 @sakura-ui/forms@0.2.2 @sakura-ui/tailwind-theme-plugin@0.2.2 @sakura-ui/markdown@0.0.17
|
|
21
26
|
```
|
|
22
27
|
|
|
23
28
|
## Configuration
|
|
@@ -28,9 +33,10 @@ module.exports = {
|
|
|
28
33
|
content: [
|
|
29
34
|
'./src/pages/**/*.{jsx,tsx}',
|
|
30
35
|
'./node_modules/@sakura-ui/core/**/*.{js,jsx,ts,tsx}',
|
|
31
|
-
'./node_modules/@sakura-ui/forms/**/*.{js,jsx,ts,tsx}'
|
|
36
|
+
'./node_modules/@sakura-ui/forms/**/*.{js,jsx,ts,tsx}',
|
|
37
|
+
'./node_modules/@sakura-ui/markdown/**/*.{js,jsx,ts,tsx}'
|
|
32
38
|
],
|
|
33
|
-
plugins: [require('@sakura-ui/
|
|
39
|
+
plugins: [require('@sakura-ui/tailwind-theme-plugin')]
|
|
34
40
|
}
|
|
35
41
|
```
|
|
36
42
|
|
|
@@ -96,7 +102,7 @@ export default App
|
|
|
96
102
|
- H1-H6 Headings
|
|
97
103
|
- Link
|
|
98
104
|
- Card
|
|
99
|
-
-
|
|
105
|
+
- LinkCard
|
|
100
106
|
- Ol
|
|
101
107
|
- Ul
|
|
102
108
|
- Table
|
|
@@ -117,6 +123,10 @@ export default App
|
|
|
117
123
|
- Checkbox
|
|
118
124
|
- Select
|
|
119
125
|
- Input
|
|
126
|
+
- FileInput
|
|
120
127
|
- Textarea
|
|
121
128
|
- LabelControl
|
|
122
129
|
- FieldsetControl
|
|
130
|
+
|
|
131
|
+
## Markdwon extension
|
|
132
|
+
- Markdown
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakura-ui/sakura-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "glassonion1",
|
|
6
6
|
"homepage": "https://github.com/glassonion1/sakura-ui",
|
|
@@ -16,28 +16,34 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "turbo build"
|
|
20
|
+
},
|
|
21
|
+
"packageManager": "pnpm@9.15.1",
|
|
22
|
+
"engines": {
|
|
23
|
+
"pnpm": ">=9.15.1"
|
|
20
24
|
},
|
|
21
25
|
"dependencies": {
|
|
22
|
-
"@sakura-ui/tailwind-theme-plugin": "workspace:*",
|
|
23
26
|
"@sakura-ui/core": "workspace:*",
|
|
24
|
-
"@sakura-ui/forms": "workspace:*"
|
|
27
|
+
"@sakura-ui/forms": "workspace:*",
|
|
28
|
+
"@sakura-ui/helper": "workspace:*",
|
|
29
|
+
"@sakura-ui/tailwind-theme-plugin": "workspace:*"
|
|
25
30
|
},
|
|
26
31
|
"peerDependencies": {
|
|
27
|
-
"react": "^
|
|
28
|
-
"react-dom": "^
|
|
29
|
-
"tailwindcss": "^3.
|
|
32
|
+
"react": "^19.0.0",
|
|
33
|
+
"react-dom": "^19.0.0",
|
|
34
|
+
"tailwindcss": "^3.4.5"
|
|
30
35
|
},
|
|
31
36
|
"devDependencies": {
|
|
32
|
-
"@biomejs/biome": "^1.
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"@vitejs/plugin-react-swc": "^3.7.
|
|
35
|
-
"npm-run-all2": "^
|
|
36
|
-
"rimraf": "^
|
|
37
|
+
"@biomejs/biome": "^1.9.4",
|
|
38
|
+
"@types/node": "^22.10.2",
|
|
39
|
+
"@vitejs/plugin-react-swc": "^3.7.2",
|
|
40
|
+
"npm-run-all2": "^7.0.1",
|
|
41
|
+
"rimraf": "^6.0.1",
|
|
37
42
|
"ts-node": "^10.9.2",
|
|
38
43
|
"tsc-alias": "^1.8.10",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
44
|
+
"turbo": "^2.3.3",
|
|
45
|
+
"typescript": "^5.7.2",
|
|
46
|
+
"vite": "^6.0.3",
|
|
47
|
+
"vitest": "^2.1.8"
|
|
42
48
|
}
|
|
43
49
|
}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakura-ui/core",
|
|
3
|
-
"version": "0.2
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"ui",
|
|
8
|
+
"design-system",
|
|
9
|
+
"accessible",
|
|
10
|
+
"components",
|
|
11
|
+
"library"
|
|
12
|
+
],
|
|
6
13
|
"author": "glassonion1",
|
|
7
14
|
"homepage": "https://github.com/glassonion1/sakura-ui",
|
|
8
15
|
"repository": {
|
|
@@ -39,20 +46,24 @@
|
|
|
39
46
|
"test": "vitest"
|
|
40
47
|
},
|
|
41
48
|
"peerDependencies": {
|
|
42
|
-
"react": "^
|
|
43
|
-
"react-dom": "^
|
|
44
|
-
"tailwindcss": "^3.
|
|
49
|
+
"react": "^19.0.0",
|
|
50
|
+
"react-dom": "^19.0.0",
|
|
51
|
+
"tailwindcss": "^3.4.5"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@sakura-ui/helper": "0.0.5"
|
|
45
55
|
},
|
|
46
56
|
"devDependencies": {
|
|
47
|
-
"@testing-library/jest-dom": "
|
|
48
|
-
"@testing-library/react": "
|
|
49
|
-
"@types/react": "
|
|
50
|
-
"@types/react-dom": "
|
|
51
|
-
"autoprefixer": "
|
|
52
|
-
"happy-dom": "^
|
|
53
|
-
"postcss": "
|
|
54
|
-
"react": "
|
|
55
|
-
"react-dom": "
|
|
56
|
-
"tailwindcss": "
|
|
57
|
+
"@testing-library/jest-dom": "catalog:",
|
|
58
|
+
"@testing-library/react": "catalog:",
|
|
59
|
+
"@types/react": "catalog:",
|
|
60
|
+
"@types/react-dom": "catalog:",
|
|
61
|
+
"autoprefixer": "catalog:",
|
|
62
|
+
"happy-dom": "^15.11.7",
|
|
63
|
+
"postcss": "catalog:",
|
|
64
|
+
"react": "catalog:",
|
|
65
|
+
"react-dom": "catalog:",
|
|
66
|
+
"tailwindcss": "catalog:",
|
|
67
|
+
"vitest": "catalog:"
|
|
57
68
|
}
|
|
58
69
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef } from '../libs/forward-ref'
|
|
1
|
+
import React, { type ComponentProps } from 'react'
|
|
2
|
+
import { cx } from '@sakura-ui/helper'
|
|
4
3
|
import {
|
|
5
4
|
type ButtonVariant,
|
|
6
5
|
type ButtonSize,
|
|
@@ -9,37 +8,39 @@ import {
|
|
|
9
8
|
getSizeStyle
|
|
10
9
|
} from './buttonStyle'
|
|
11
10
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export namespace Button {
|
|
12
|
+
export interface Props<T extends React.ElementType> {
|
|
13
|
+
as?: T
|
|
14
|
+
variant?: ButtonVariant
|
|
15
|
+
size?: ButtonSize
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
export const Button
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
export const Button = <T extends React.ElementType = 'button'>(
|
|
20
|
+
props: Button.Props<T> & Omit<React.ComponentProps<T>, keyof Button.Props<T>>
|
|
21
|
+
) => {
|
|
22
|
+
const {
|
|
23
|
+
as: Component = 'button',
|
|
24
|
+
variant = 'solid-fill',
|
|
25
|
+
size = 'lg',
|
|
26
|
+
className,
|
|
27
|
+
children,
|
|
28
|
+
...restProps
|
|
29
|
+
} = props
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
)
|
|
31
|
+
return (
|
|
32
|
+
<Component
|
|
33
|
+
className={cx(
|
|
34
|
+
base,
|
|
35
|
+
getVariantStyle(variant),
|
|
36
|
+
getSizeStyle(size),
|
|
37
|
+
className
|
|
38
|
+
)}
|
|
39
|
+
{...restProps}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</Component>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
44
45
|
|
|
45
46
|
Button.displayName = 'Button'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { cx } from '
|
|
2
|
+
import { cx } from '@sakura-ui/helper'
|
|
3
3
|
|
|
4
4
|
interface IdContextType {
|
|
5
5
|
id: string
|
|
@@ -7,9 +7,11 @@ interface IdContextType {
|
|
|
7
7
|
|
|
8
8
|
const IdContext = React.createContext<IdContextType>({ id: '' })
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export namespace Card {
|
|
11
|
+
export interface Props extends React.ComponentPropsWithoutRef<'article'> {}
|
|
12
|
+
}
|
|
11
13
|
|
|
12
|
-
export const Card = (props:
|
|
14
|
+
export const Card = (props: Card.Props) => {
|
|
13
15
|
const { className, children, ...restProps } = props
|
|
14
16
|
|
|
15
17
|
const id = React.useId()
|
|
@@ -18,13 +20,11 @@ export const Card = (props: CardProps) => {
|
|
|
18
20
|
const style = `
|
|
19
21
|
border
|
|
20
22
|
border-solid
|
|
21
|
-
border-
|
|
23
|
+
border-solid-gray-500
|
|
22
24
|
rounded-2xl
|
|
23
25
|
sm:rounded-3xl
|
|
24
|
-
text-
|
|
26
|
+
text-solid-gray-900
|
|
25
27
|
overflow-hidden
|
|
26
|
-
flex flex-col
|
|
27
|
-
gap-2
|
|
28
28
|
`
|
|
29
29
|
|
|
30
30
|
return (
|
|
@@ -41,9 +41,11 @@ export const Card = (props: CardProps) => {
|
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export
|
|
44
|
+
export namespace CardImg {
|
|
45
|
+
export interface Props extends React.ComponentPropsWithoutRef<'img'> {}
|
|
46
|
+
}
|
|
45
47
|
|
|
46
|
-
export const CardImg = (props:
|
|
48
|
+
export const CardImg = (props: CardImg.Props) => {
|
|
47
49
|
const { className, ...restProps } = props
|
|
48
50
|
|
|
49
51
|
const style = `
|
|
@@ -55,18 +57,21 @@ export const CardImg = (props: CardImgProps) => {
|
|
|
55
57
|
return <img className={cx(style, className)} {...restProps} />
|
|
56
58
|
}
|
|
57
59
|
|
|
58
|
-
export
|
|
59
|
-
extends React.ComponentPropsWithoutRef<'div'> {}
|
|
60
|
+
export namespace CardHeader {
|
|
61
|
+
export interface Props extends React.ComponentPropsWithoutRef<'div'> {}
|
|
62
|
+
}
|
|
60
63
|
|
|
61
|
-
export const CardHeader = (props:
|
|
64
|
+
export const CardHeader = (props: CardHeader.Props) => {
|
|
62
65
|
const { className, children, ...restProps } = props
|
|
63
66
|
|
|
64
67
|
const ctx = React.useContext(IdContext)
|
|
65
68
|
|
|
66
69
|
const style = `
|
|
67
70
|
text-base
|
|
71
|
+
leading-[2rem]
|
|
68
72
|
font-medium
|
|
69
73
|
first:pt-4
|
|
74
|
+
pt-2
|
|
70
75
|
last:pb-4
|
|
71
76
|
px-6
|
|
72
77
|
`
|
|
@@ -78,16 +83,20 @@ export const CardHeader = (props: CardHeaderProps) => {
|
|
|
78
83
|
)
|
|
79
84
|
}
|
|
80
85
|
|
|
81
|
-
export
|
|
86
|
+
export namespace CardBody {
|
|
87
|
+
export interface Props extends React.ComponentPropsWithoutRef<'div'> {}
|
|
88
|
+
}
|
|
82
89
|
|
|
83
|
-
export const CardBody = (props:
|
|
90
|
+
export const CardBody = (props: CardBody.Props) => {
|
|
84
91
|
const { className, children, ...restProps } = props
|
|
85
92
|
|
|
86
93
|
const ctx = React.useContext(IdContext)
|
|
87
94
|
|
|
88
95
|
const style = `
|
|
89
96
|
text-base-sm
|
|
97
|
+
leading-[1.85rem]
|
|
90
98
|
first:pt-4
|
|
99
|
+
pt-2
|
|
91
100
|
last:pb-4
|
|
92
101
|
px-6
|
|
93
102
|
`
|
|
@@ -99,15 +108,18 @@ export const CardBody = (props: CardBodyProps) => {
|
|
|
99
108
|
)
|
|
100
109
|
}
|
|
101
110
|
|
|
102
|
-
export
|
|
103
|
-
extends React.ComponentPropsWithoutRef<'div'> {}
|
|
111
|
+
export namespace CardFooter {
|
|
112
|
+
export interface Props extends React.ComponentPropsWithoutRef<'div'> {}
|
|
113
|
+
}
|
|
104
114
|
|
|
105
|
-
export const CardFooter = (props:
|
|
115
|
+
export const CardFooter = (props: CardFooter.Props) => {
|
|
106
116
|
const { className, children, ...restProps } = props
|
|
107
117
|
|
|
108
118
|
const style = `
|
|
109
119
|
text-base-sm
|
|
120
|
+
leading-[1.85rem]
|
|
110
121
|
first:pt-4
|
|
122
|
+
pt-2
|
|
111
123
|
last:pb-4
|
|
112
124
|
px-6
|
|
113
125
|
`
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { cx } from '
|
|
2
|
+
import { cx } from '@sakura-ui/helper'
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export namespace Code {
|
|
5
|
+
export interface Props extends React.ComponentPropsWithoutRef<'code'> {}
|
|
6
|
+
}
|
|
5
7
|
|
|
6
|
-
export const Code = (props:
|
|
8
|
+
export const Code = (props: Code.Props) => {
|
|
7
9
|
const { className, children, ...restProps } = props
|
|
8
10
|
|
|
9
11
|
const style = `
|
|
10
|
-
bg-
|
|
12
|
+
bg-solid-gray-50
|
|
11
13
|
font-mono
|
|
12
14
|
`
|
|
13
15
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { cx } from '
|
|
2
|
+
import { cx } from '@sakura-ui/helper'
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export namespace Faq {
|
|
5
|
+
export interface Props extends React.ComponentPropsWithoutRef<'dl'> {}
|
|
6
|
+
}
|
|
5
7
|
|
|
6
8
|
const headingStyle = `
|
|
7
9
|
text-h-med-m
|
|
8
10
|
sm:text-h-med
|
|
9
11
|
`
|
|
10
12
|
|
|
11
|
-
export const Faq = (props:
|
|
13
|
+
export const Faq = (props: Faq.Props) => {
|
|
12
14
|
const { className, children, ...restProps } = props
|
|
13
15
|
|
|
14
16
|
const style = `
|
|
@@ -31,9 +33,11 @@ export const Faq = (props: FaqProps) => {
|
|
|
31
33
|
)
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
export
|
|
36
|
+
export namespace Question {
|
|
37
|
+
export interface Props extends React.ComponentPropsWithoutRef<'dt'> {}
|
|
38
|
+
}
|
|
35
39
|
|
|
36
|
-
export const Question = (props:
|
|
40
|
+
export const Question = (props: Question.Props) => {
|
|
37
41
|
const { className, children, ...restProps } = props
|
|
38
42
|
|
|
39
43
|
const style = `
|
|
@@ -54,9 +58,11 @@ export const Question = (props: QuestionProps) => {
|
|
|
54
58
|
)
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
export
|
|
61
|
+
export namespace Answer {
|
|
62
|
+
export interface Props extends React.ComponentPropsWithoutRef<'dd'> {}
|
|
63
|
+
}
|
|
58
64
|
|
|
59
|
-
export const Answer = (props:
|
|
65
|
+
export const Answer = (props: Answer.Props) => {
|
|
60
66
|
const { className, children, ...restProps } = props
|
|
61
67
|
|
|
62
68
|
const style = `
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { cx } from '
|
|
2
|
+
import { cx } from '@sakura-ui/helper'
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export namespace H1 {
|
|
5
|
+
export interface Props extends React.ComponentPropsWithoutRef<'h1'> {}
|
|
6
|
+
}
|
|
5
7
|
|
|
6
|
-
export const H1 = (props:
|
|
8
|
+
export const H1 = (props: H1.Props) => {
|
|
7
9
|
const { className, children, ...restProps } = props
|
|
8
10
|
|
|
9
11
|
const style = `
|
|
10
12
|
text-h-lg-m
|
|
11
13
|
sm:text-h-lg
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
sm:mt-16
|
|
15
|
-
sm:mb-6
|
|
14
|
+
pt-[2rem]
|
|
15
|
+
sm:pt-[6.5rem]
|
|
16
16
|
`
|
|
17
17
|
|
|
18
18
|
return (
|
|
@@ -22,16 +22,18 @@ export const H1 = (props: HeadingProps) => {
|
|
|
22
22
|
)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export
|
|
25
|
+
export namespace H2 {
|
|
26
|
+
export interface Props extends React.ComponentPropsWithoutRef<'h2'> {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const H2 = (props: H2.Props) => {
|
|
26
30
|
const { className, children, ...restProps } = props
|
|
27
31
|
|
|
28
32
|
const style = `
|
|
29
33
|
text-h-med-m
|
|
30
34
|
sm:text-h-med
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sm:mt-16
|
|
34
|
-
sm:mb-6
|
|
35
|
+
pt-[4rem]
|
|
36
|
+
sm:pt-[4.5rem]
|
|
35
37
|
`
|
|
36
38
|
|
|
37
39
|
return (
|
|
@@ -41,16 +43,18 @@ export const H2 = (props: HeadingProps) => {
|
|
|
41
43
|
)
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
export
|
|
46
|
+
export namespace H3 {
|
|
47
|
+
export interface Props extends React.ComponentPropsWithoutRef<'h3'> {}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const H3 = (props: H3.Props) => {
|
|
45
51
|
const { className, children, ...restProps } = props
|
|
46
52
|
|
|
47
53
|
const style = `
|
|
48
54
|
text-h-sm-m
|
|
49
55
|
sm:text-h-sm
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
sm:mt-10
|
|
53
|
-
sm:mb-6
|
|
56
|
+
pt-[4rem]
|
|
57
|
+
sm:pt-[4.5rem]
|
|
54
58
|
`
|
|
55
59
|
|
|
56
60
|
return (
|
|
@@ -60,16 +64,18 @@ export const H3 = (props: HeadingProps) => {
|
|
|
60
64
|
)
|
|
61
65
|
}
|
|
62
66
|
|
|
63
|
-
export
|
|
67
|
+
export namespace H4 {
|
|
68
|
+
export interface Props extends React.ComponentPropsWithoutRef<'h4'> {}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const H4 = (props: H4.Props) => {
|
|
64
72
|
const { className, children, ...restProps } = props
|
|
65
73
|
|
|
66
74
|
const style = `
|
|
67
75
|
text-h-xs-m
|
|
68
76
|
sm:text-h-xs
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
sm:mt-10
|
|
72
|
-
sm:mb-4
|
|
77
|
+
pt-[3.5rem]
|
|
78
|
+
sm:pt-[4.5rem]
|
|
73
79
|
`
|
|
74
80
|
|
|
75
81
|
return (
|
|
@@ -79,16 +85,18 @@ export const H4 = (props: HeadingProps) => {
|
|
|
79
85
|
)
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
export
|
|
88
|
+
export namespace H5 {
|
|
89
|
+
export interface Props extends React.ComponentPropsWithoutRef<'h5'> {}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const H5 = (props: H5.Props) => {
|
|
83
93
|
const { className, children, ...restProps } = props
|
|
84
94
|
|
|
85
95
|
const style = `
|
|
86
96
|
text-h-xxs-m
|
|
87
97
|
sm:text-h-xxs
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
sm:mt-10
|
|
91
|
-
sm:mb-4
|
|
98
|
+
pt-[3rem]
|
|
99
|
+
sm:pt-[4rem]
|
|
92
100
|
`
|
|
93
101
|
|
|
94
102
|
return (
|
|
@@ -98,16 +106,18 @@ export const H5 = (props: HeadingProps) => {
|
|
|
98
106
|
)
|
|
99
107
|
}
|
|
100
108
|
|
|
101
|
-
export
|
|
109
|
+
export namespace H6 {
|
|
110
|
+
export interface Props extends React.ComponentPropsWithoutRef<'h6'> {}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const H6 = (props: H6.Props) => {
|
|
102
114
|
const { className, children, ...restProps } = props
|
|
103
115
|
|
|
104
116
|
const style = `
|
|
105
117
|
text-h-xxs-m
|
|
106
118
|
sm:text-h-xxs
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
sm:mt-6
|
|
110
|
-
sm:mb-4
|
|
119
|
+
pt-[2.5rem]
|
|
120
|
+
sm:pt-[3.5rem]
|
|
111
121
|
`
|
|
112
122
|
|
|
113
123
|
return (
|
|
@@ -1,32 +1,62 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { cx } from '
|
|
2
|
+
import { cx } from '@sakura-ui/helper'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export namespace Icon {
|
|
5
|
+
export interface Props extends React.ComponentPropsWithRef<'span'> {
|
|
6
|
+
opticalSize?: 16 | 20 | 24 | 40 | 44 | 48
|
|
7
|
+
altText?: string
|
|
8
|
+
}
|
|
7
9
|
}
|
|
8
10
|
|
|
9
|
-
export const Icon = React.forwardRef<HTMLElement,
|
|
10
|
-
const { className,
|
|
11
|
+
export const Icon = React.forwardRef<HTMLElement, Icon.Props>((props, ref) => {
|
|
12
|
+
const { className, altText = '', opticalSize = 24, children, ...rest } = props
|
|
13
|
+
|
|
14
|
+
const size = {
|
|
15
|
+
16: '!text-[16px]',
|
|
16
|
+
20: '!text-[20px]',
|
|
17
|
+
24: '!text-[24px]',
|
|
18
|
+
40: '!text-[40px]',
|
|
19
|
+
44: '!text-[44px]',
|
|
20
|
+
48: '!text-[48px]'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const fontSize = size[opticalSize]
|
|
24
|
+
|
|
25
|
+
// @see: https://developers.google.com/fonts/docs/material_symbols
|
|
26
|
+
//.material-symbols-outlined {
|
|
27
|
+
// font-family: 'Material Symbols Outlined';
|
|
28
|
+
// font-weight: normal;
|
|
29
|
+
// font-style: normal;
|
|
30
|
+
// font-size: 24px; /* Preferred icon size */
|
|
31
|
+
// display: inline-block;
|
|
32
|
+
// line-height: 1;
|
|
33
|
+
// text-transform: none;
|
|
34
|
+
// letter-spacing: normal;
|
|
35
|
+
// word-wrap: normal;
|
|
36
|
+
// white-space: nowrap;
|
|
37
|
+
// direction: ltr;
|
|
38
|
+
//}
|
|
11
39
|
|
|
12
40
|
const style = `
|
|
13
|
-
inline
|
|
14
|
-
align-middle
|
|
15
41
|
font-icon
|
|
16
|
-
|
|
42
|
+
font-light
|
|
43
|
+
inline-block
|
|
44
|
+
leading-none
|
|
45
|
+
align-middle
|
|
46
|
+
whitespace-nowrap
|
|
17
47
|
`
|
|
18
48
|
|
|
19
49
|
return (
|
|
20
50
|
<>
|
|
21
51
|
<span
|
|
22
52
|
aria-hidden="true"
|
|
23
|
-
className={cx(
|
|
24
|
-
{...
|
|
53
|
+
className={cx(className, fontSize, style)}
|
|
54
|
+
{...rest}
|
|
25
55
|
ref={ref}
|
|
26
56
|
>
|
|
27
|
-
{
|
|
57
|
+
{children}
|
|
28
58
|
</span>
|
|
29
|
-
<span className="sr-only">{
|
|
59
|
+
<span className="sr-only">{altText}</span>
|
|
30
60
|
</>
|
|
31
61
|
)
|
|
32
62
|
})
|