@sakura-ui/sakura-ui 0.0.16 → 0.1.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 +8 -7
- package/package.json +3 -3
- package/packages/{react → core}/package.json +3 -3
- package/packages/{react → core}/src/components/Button.tsx +2 -2
- package/packages/{react → core}/src/components/Card.tsx +2 -2
- package/packages/{react → core}/src/components/Code.tsx +2 -2
- package/packages/{react → core}/src/components/Heading.tsx +18 -18
- package/packages/{react → core}/src/components/Icon.tsx +2 -2
- package/packages/{react → core}/src/components/IconButton.tsx +2 -2
- package/packages/{react → core}/src/components/InfoCard.tsx +4 -4
- package/packages/{react → core}/src/components/Link.tsx +6 -6
- package/packages/{react → core}/src/components/List.tsx +4 -4
- package/packages/{react → core}/src/components/Pre.tsx +2 -2
- package/packages/{react → core}/src/components/Table.tsx +14 -14
- package/packages/core/tsconfig.json +11 -0
- package/packages/forms/coverage/clover.xml +209 -0
- package/packages/forms/coverage/coverage-final.json +18 -0
- package/packages/forms/coverage/lcov-report/base.css +224 -0
- package/packages/forms/coverage/lcov-report/block-navigation.js +87 -0
- package/packages/forms/coverage/lcov-report/favicon.png +0 -0
- package/packages/forms/coverage/lcov-report/index.html +161 -0
- package/packages/forms/coverage/lcov-report/prettify.css +1 -0
- package/packages/forms/coverage/lcov-report/prettify.js +2 -0
- package/packages/forms/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/packages/forms/coverage/lcov-report/sorter.js +196 -0
- package/packages/forms/coverage/lcov-report/src/components/Checkbox.tsx.html +295 -0
- package/packages/forms/coverage/lcov-report/src/components/FieldsetControl.tsx.html +295 -0
- package/packages/forms/coverage/lcov-report/src/components/LabelControl.tsx.html +289 -0
- package/packages/forms/coverage/lcov-report/src/components/Radio.tsx.html +262 -0
- package/packages/forms/coverage/lcov-report/src/components/Select.tsx.html +253 -0
- package/packages/forms/coverage/lcov-report/src/components/Text.tsx.html +217 -0
- package/packages/forms/coverage/lcov-report/src/components/Textarea.tsx.html +226 -0
- package/packages/forms/coverage/lcov-report/src/components/context.ts.html +133 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/CheckboxGroup.tsx.html +244 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/RadioGroup.tsx.html +265 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/SelectControl.tsx.html +205 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/TextControl.tsx.html +202 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/TextareaControl.tsx.html +205 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/index.html +191 -0
- package/packages/forms/coverage/lcov-report/src/components/controlled/index.ts.html +100 -0
- package/packages/forms/coverage/lcov-report/src/components/index.html +236 -0
- package/packages/forms/coverage/lcov-report/src/components/index.ts.html +106 -0
- package/packages/forms/coverage/lcov-report/src/index.html +116 -0
- package/packages/forms/coverage/lcov-report/src/index.ts.html +136 -0
- package/packages/forms/coverage/lcov-report/src/utils/index.html +116 -0
- package/packages/forms/coverage/lcov-report/src/utils/index.ts.html +88 -0
- package/packages/forms/coverage/lcov.info +426 -0
- package/packages/forms/dist/index.cjs.js +24 -27
- package/packages/forms/dist/index.cjs.js.map +1 -1
- package/packages/forms/dist/index.es.js +593 -382
- package/packages/forms/dist/index.es.js.map +1 -1
- package/packages/forms/jest.config.ts +14 -0
- package/packages/forms/node_modules/.bin/ts-jest +2 -2
- package/packages/forms/package.json +6 -1
- package/packages/forms/src/components/Checkbox.tsx +19 -8
- package/packages/forms/src/components/FieldsetControl.tsx +70 -0
- package/packages/forms/src/components/LabelControl.tsx +65 -0
- package/packages/forms/src/components/Radio.tsx +24 -9
- package/packages/forms/src/components/Select.tsx +20 -6
- package/packages/forms/src/components/Text.tsx +13 -4
- package/packages/forms/src/components/Textarea.tsx +17 -3
- package/packages/forms/src/components/context.ts +16 -0
- package/packages/forms/src/components/controlled/CheckboxGroup.tsx +37 -15
- package/packages/forms/src/components/controlled/RadioGroup.tsx +44 -20
- package/packages/forms/src/components/controlled/SelectControl.tsx +40 -0
- package/packages/forms/src/components/controlled/TextControl.tsx +39 -0
- package/packages/forms/src/components/controlled/TextareaControl.tsx +40 -0
- package/packages/forms/src/components/controlled/index.ts +3 -3
- package/packages/forms/src/components/index.ts +2 -0
- package/packages/forms/src/index.ts +12 -4
- package/packages/forms/tests/FieldsetControl.test.tsx +54 -0
- package/packages/forms/tests/LabelControl.test.tsx +50 -0
- package/packages/forms/tests/Radio.test.tsx +99 -0
- package/packages/forms/tests/Text.test.tsx +96 -0
- package/packages/forms/tsconfig.json +1 -17
- package/packages/forms/dist/components/Checkbox.d.ts +0 -5
- package/packages/forms/dist/components/Checkbox.d.ts.map +0 -1
- package/packages/forms/dist/components/Radio.d.ts +0 -5
- package/packages/forms/dist/components/Radio.d.ts.map +0 -1
- package/packages/forms/dist/components/Select.d.ts +0 -5
- package/packages/forms/dist/components/Select.d.ts.map +0 -1
- package/packages/forms/dist/components/Text.d.ts +0 -5
- package/packages/forms/dist/components/Text.d.ts.map +0 -1
- package/packages/forms/dist/components/Textarea.d.ts +0 -5
- package/packages/forms/dist/components/Textarea.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/CheckboxGroup.d.ts +0 -9
- package/packages/forms/dist/components/controlled/CheckboxGroup.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/InputItem.d.ts +0 -5
- package/packages/forms/dist/components/controlled/InputItem.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/RadioGroup.d.ts +0 -9
- package/packages/forms/dist/components/controlled/RadioGroup.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/Select.d.ts +0 -6
- package/packages/forms/dist/components/controlled/Select.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/Text.d.ts +0 -6
- package/packages/forms/dist/components/controlled/Text.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/Textarea.d.ts +0 -6
- package/packages/forms/dist/components/controlled/Textarea.d.ts.map +0 -1
- package/packages/forms/dist/components/controlled/index.d.ts +0 -6
- package/packages/forms/dist/components/controlled/index.d.ts.map +0 -1
- package/packages/forms/dist/components/index.d.ts +0 -6
- package/packages/forms/dist/components/index.d.ts.map +0 -1
- package/packages/forms/dist/index.d.ts +0 -3
- package/packages/forms/dist/index.d.ts.map +0 -1
- package/packages/forms/dist/utils/index.d.ts +0 -2
- package/packages/forms/dist/utils/index.d.ts.map +0 -1
- package/packages/forms/src/components/controlled/Select.tsx +0 -22
- package/packages/forms/src/components/controlled/Text.tsx +0 -22
- package/packages/forms/src/components/controlled/Textarea.tsx +0 -23
- package/packages/forms/src/vite-env.d.ts +0 -1
- package/packages/react/tsconfig.json +0 -27
- /package/packages/{react → core}/src/components/index.ts +0 -0
- /package/packages/{react → core}/src/index.ts +0 -0
- /package/packages/{react → core}/src/utils/index.ts +0 -0
- /package/packages/{react → core}/tsconfig.node.json +0 -0
- /package/packages/{react → core}/vite.config.ts +0 -0
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ module.exports = {
|
|
|
17
17
|
mode: 'jit',
|
|
18
18
|
content: [
|
|
19
19
|
'./src/pages/**/*.{jsx,tsx}',
|
|
20
|
-
'./node_modules/@sakura-ui/
|
|
21
|
-
'./node_modules/@sakura-ui/
|
|
20
|
+
'./node_modules/@sakura-ui/core/**/*.{js,jsx,ts,tsx}',
|
|
21
|
+
'./node_modules/@sakura-ui/forms/**/*.{js,jsx,ts,tsx}'
|
|
22
22
|
],
|
|
23
23
|
plugins: [require('@sakura-ui/config')]
|
|
24
24
|
}
|
|
@@ -50,8 +50,7 @@ Add fonts from CDN.
|
|
|
50
50
|
## Usage
|
|
51
51
|
```ts
|
|
52
52
|
import { useState } from 'react'
|
|
53
|
-
import { H1, H2, H3, H4, H5, H6, Button } from '@sakura-ui/react'
|
|
54
|
-
import { IconButton } from '@sakura-ui/icons'
|
|
53
|
+
import { H1, H2, H3, H4, H5, H6, Button, IconButton } from '@sakura-ui/react'
|
|
55
54
|
|
|
56
55
|
const App = () => {
|
|
57
56
|
const [count, setCount] = useState(0)
|
|
@@ -99,12 +98,14 @@ export default App
|
|
|
99
98
|
- Td
|
|
100
99
|
- Code
|
|
101
100
|
- Pre
|
|
102
|
-
|
|
103
|
-
## Form components
|
|
104
101
|
- Button
|
|
105
102
|
- IconButton
|
|
103
|
+
|
|
104
|
+
## Form components
|
|
106
105
|
- Radio
|
|
107
|
-
-
|
|
106
|
+
- Checkbox
|
|
108
107
|
- Select
|
|
109
108
|
- Text
|
|
110
109
|
- Textarea
|
|
110
|
+
- LabelControl
|
|
111
|
+
- FieldsetControl
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakura-ui/sakura-ui",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "glassonion1",
|
|
6
6
|
"homepage": "https://github.com/glassonion1/sakura-ui",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"packages"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@sakura-ui/forms": "0.0.2",
|
|
17
16
|
"@sakura-ui/config": "0.0.10",
|
|
18
|
-
"@sakura-ui/
|
|
17
|
+
"@sakura-ui/forms": "0.0.3",
|
|
18
|
+
"@sakura-ui/core": "0.0.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "^18.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@sakura-ui/
|
|
3
|
-
"version": "0.0.
|
|
2
|
+
"name": "@sakura-ui/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
33
33
|
"url": "git+ssh://git@github.com:glassonion1/sakura-ui.git",
|
|
34
|
-
"directory": "packages/
|
|
34
|
+
"directory": "packages/core"
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"peerDependencies": {
|
|
@@ -9,7 +9,7 @@ export interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {
|
|
|
9
9
|
export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
10
10
|
(props, ref) => {
|
|
11
11
|
// Make sure that there is no problem even if className is specified on the side that uses the component
|
|
12
|
-
const { className, children, textAlign, variant, ...
|
|
12
|
+
const { className, children, textAlign, variant, ...restProps } = props
|
|
13
13
|
|
|
14
14
|
const align = textAlign ?? 'center'
|
|
15
15
|
|
|
@@ -68,7 +68,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
68
68
|
return (
|
|
69
69
|
<button
|
|
70
70
|
className={cx(style, styles[variant ?? 'primary'], className)}
|
|
71
|
-
{...
|
|
71
|
+
{...restProps}
|
|
72
72
|
ref={ref}
|
|
73
73
|
>
|
|
74
74
|
{children}
|
|
@@ -4,7 +4,7 @@ import { cx } from '../utils'
|
|
|
4
4
|
export interface CardProps extends React.ComponentProps<'div'> {}
|
|
5
5
|
|
|
6
6
|
export const Card = (props: CardProps) => {
|
|
7
|
-
const { className, children, ...
|
|
7
|
+
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
10
10
|
bg-sumi-50
|
|
@@ -15,7 +15,7 @@ export const Card = (props: CardProps) => {
|
|
|
15
15
|
p-4
|
|
16
16
|
`
|
|
17
17
|
return (
|
|
18
|
-
<div className={cx(style, props.className)} {...
|
|
18
|
+
<div className={cx(style, props.className)} {...restProps}>
|
|
19
19
|
{props.children}
|
|
20
20
|
</div>
|
|
21
21
|
)
|
|
@@ -4,7 +4,7 @@ import { cx } from '../utils'
|
|
|
4
4
|
export interface CodeProps extends React.ComponentProps<'code'> {}
|
|
5
5
|
|
|
6
6
|
export const Code = (props: CodeProps) => {
|
|
7
|
-
const { className, children, ...
|
|
7
|
+
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
10
10
|
bg-sumi-50
|
|
@@ -12,7 +12,7 @@ export const Code = (props: CodeProps) => {
|
|
|
12
12
|
`
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<code className={cx(style, className)} {...
|
|
15
|
+
<code className={cx(style, className)} {...restProps}>
|
|
16
16
|
{children}
|
|
17
17
|
</code>
|
|
18
18
|
)
|
|
@@ -8,7 +8,7 @@ const common = `
|
|
|
8
8
|
`
|
|
9
9
|
|
|
10
10
|
export const H1 = (props: HeadingProps) => {
|
|
11
|
-
const { className, children, ...
|
|
11
|
+
const { className, children, ...restProps } = props
|
|
12
12
|
|
|
13
13
|
const style = `
|
|
14
14
|
text-h1
|
|
@@ -17,15 +17,15 @@ export const H1 = (props: HeadingProps) => {
|
|
|
17
17
|
`
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<h1 className={cx(common, style,
|
|
21
|
-
{
|
|
20
|
+
<h1 className={cx(common, style, className)} {...restProps}>
|
|
21
|
+
{children}
|
|
22
22
|
</h1>
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const H2 = (props: HeadingProps) => {
|
|
27
27
|
// コンポーネントを使う側でclassNameを指定しても問題ないようにする
|
|
28
|
-
const { className, children, ...
|
|
28
|
+
const { className, children, ...restProps } = props
|
|
29
29
|
|
|
30
30
|
const style = `
|
|
31
31
|
text-h2
|
|
@@ -34,15 +34,15 @@ export const H2 = (props: HeadingProps) => {
|
|
|
34
34
|
`
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<h2 className={cx(common, style,
|
|
38
|
-
{
|
|
37
|
+
<h2 className={cx(common, style, className)} {...restProps}>
|
|
38
|
+
{children}
|
|
39
39
|
</h2>
|
|
40
40
|
)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export const H3 = (props: HeadingProps) => {
|
|
44
44
|
// コンポーネントを使う側でclassNameを指定しても問題ないようにする
|
|
45
|
-
const { className, children, ...
|
|
45
|
+
const { className, children, ...restProps } = props
|
|
46
46
|
|
|
47
47
|
const style = `
|
|
48
48
|
text-h3
|
|
@@ -51,15 +51,15 @@ export const H3 = (props: HeadingProps) => {
|
|
|
51
51
|
`
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
|
-
<h3 className={cx(common, style,
|
|
55
|
-
{
|
|
54
|
+
<h3 className={cx(common, style, className)} {...restProps}>
|
|
55
|
+
{children}
|
|
56
56
|
</h3>
|
|
57
57
|
)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export const H4 = (props: HeadingProps) => {
|
|
61
61
|
// コンポーネントを使う側でclassNameを指定しても問題ないようにする
|
|
62
|
-
const { className, children, ...
|
|
62
|
+
const { className, children, ...restProps } = props
|
|
63
63
|
|
|
64
64
|
const style = `
|
|
65
65
|
text-h4
|
|
@@ -68,15 +68,15 @@ export const H4 = (props: HeadingProps) => {
|
|
|
68
68
|
`
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
|
-
<h4 className={cx(common, style,
|
|
72
|
-
{
|
|
71
|
+
<h4 className={cx(common, style, className)} {...restProps}>
|
|
72
|
+
{children}
|
|
73
73
|
</h4>
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export const H5 = (props: HeadingProps) => {
|
|
78
78
|
// コンポーネントを使う側でclassNameを指定しても問題ないようにする
|
|
79
|
-
const { className, children, ...
|
|
79
|
+
const { className, children, ...restProps } = props
|
|
80
80
|
|
|
81
81
|
const style = `
|
|
82
82
|
text-h5
|
|
@@ -85,15 +85,15 @@ export const H5 = (props: HeadingProps) => {
|
|
|
85
85
|
`
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
|
-
<h5 className={cx(common, style,
|
|
89
|
-
{
|
|
88
|
+
<h5 className={cx(common, style, className)} {...restProps}>
|
|
89
|
+
{children}
|
|
90
90
|
</h5>
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export const H6 = (props: HeadingProps) => {
|
|
95
95
|
// コンポーネントを使う側でclassNameを指定しても問題ないようにする
|
|
96
|
-
const { className, children, ...
|
|
96
|
+
const { className, children, ...restProps } = props
|
|
97
97
|
|
|
98
98
|
const style = `
|
|
99
99
|
text-h6
|
|
@@ -102,8 +102,8 @@ export const H6 = (props: HeadingProps) => {
|
|
|
102
102
|
`
|
|
103
103
|
|
|
104
104
|
return (
|
|
105
|
-
<h6 className={cx(common, style,
|
|
106
|
-
{
|
|
105
|
+
<h6 className={cx(common, style, className)} {...restProps}>
|
|
106
|
+
{children}
|
|
107
107
|
</h6>
|
|
108
108
|
)
|
|
109
109
|
}
|
|
@@ -6,7 +6,7 @@ export interface IconProps extends React.ComponentProps<'span'> {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const Icon = React.forwardRef<HTMLElement, IconProps>((props, ref) => {
|
|
9
|
-
const { className, icon, ...
|
|
9
|
+
const { className, icon, ...restProps } = props
|
|
10
10
|
|
|
11
11
|
const style = `
|
|
12
12
|
inline-block
|
|
@@ -20,7 +20,7 @@ export const Icon = React.forwardRef<HTMLElement, IconProps>((props, ref) => {
|
|
|
20
20
|
`
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<span className={cx(style, className)} {...
|
|
23
|
+
<span className={cx(style, className)} {...restProps} ref={ref}>
|
|
24
24
|
{icon}
|
|
25
25
|
</span>
|
|
26
26
|
)
|
|
@@ -9,7 +9,7 @@ export interface IconButtonProps extends React.ComponentProps<'button'> {
|
|
|
9
9
|
|
|
10
10
|
export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
11
11
|
(props, ref) => {
|
|
12
|
-
const { className, children, variant, icon, iconLayout, ...
|
|
12
|
+
const { className, children, variant, icon, iconLayout, ...restProps } =
|
|
13
13
|
props
|
|
14
14
|
|
|
15
15
|
const layout = iconLayout ?? 'left'
|
|
@@ -82,7 +82,7 @@ export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
82
82
|
return (
|
|
83
83
|
<button
|
|
84
84
|
className={cx(style, styles[variant ?? 'primary'], className)}
|
|
85
|
-
{...
|
|
85
|
+
{...restProps}
|
|
86
86
|
ref={ref}
|
|
87
87
|
>
|
|
88
88
|
{layout == 'left' && <span className={cx(iconStyle)}>{icon}</span>}
|
|
@@ -6,7 +6,7 @@ export interface InfoCardProps extends React.ComponentProps<'div'> {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export const InfoCard = (props: InfoCardProps) => {
|
|
9
|
-
const { className, children, ...
|
|
9
|
+
const { className, children, title, ...restProps } = props
|
|
10
10
|
|
|
11
11
|
const style = `
|
|
12
12
|
bg-sumi-50
|
|
@@ -28,9 +28,9 @@ export const InfoCard = (props: InfoCardProps) => {
|
|
|
28
28
|
`
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<div className={cx(style,
|
|
32
|
-
<h2 className={topStyle}>{
|
|
33
|
-
<p className={bottmStyle}>{
|
|
31
|
+
<div className={cx(style, className)} {...restProps}>
|
|
32
|
+
<h2 className={topStyle}>{title}</h2>
|
|
33
|
+
<p className={bottmStyle}>{children}</p>
|
|
34
34
|
</div>
|
|
35
35
|
)
|
|
36
36
|
}
|
|
@@ -31,7 +31,7 @@ const getFileType = (url: string) => {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export const Link = (props: LinkProps) => {
|
|
34
|
-
const { className, children, ...
|
|
34
|
+
const { className, children, ...restProps } = props
|
|
35
35
|
const href = props.href ?? ''
|
|
36
36
|
const fileType = getFileType(href)
|
|
37
37
|
|
|
@@ -53,20 +53,20 @@ export const Link = (props: LinkProps) => {
|
|
|
53
53
|
if (href.startsWith('http')) {
|
|
54
54
|
return (
|
|
55
55
|
<a
|
|
56
|
-
className={cx(style,
|
|
56
|
+
className={cx(style, className)}
|
|
57
57
|
href={href}
|
|
58
58
|
target="_blank"
|
|
59
59
|
rel="noopener noreferrer"
|
|
60
|
-
{...
|
|
60
|
+
{...restProps}
|
|
61
61
|
>
|
|
62
|
-
{
|
|
62
|
+
{children}
|
|
63
63
|
{fileType ? `(${fileType})` : null}
|
|
64
64
|
</a>
|
|
65
65
|
)
|
|
66
66
|
}
|
|
67
67
|
return (
|
|
68
|
-
<a className={cx(style,
|
|
69
|
-
{
|
|
68
|
+
<a className={cx(style, className)} href={href} {...restProps}>
|
|
69
|
+
{children}
|
|
70
70
|
{fileType ? `(${fileType})` : null}
|
|
71
71
|
</a>
|
|
72
72
|
)
|
|
@@ -4,7 +4,7 @@ import { cx } from '../utils'
|
|
|
4
4
|
export interface UlProps extends React.ComponentProps<'ul'> {}
|
|
5
5
|
|
|
6
6
|
export const Ul = (props: UlProps) => {
|
|
7
|
-
const { className, children, ...
|
|
7
|
+
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
10
10
|
list-disc
|
|
@@ -14,7 +14,7 @@ export const Ul = (props: UlProps) => {
|
|
|
14
14
|
marker:text-xs
|
|
15
15
|
`
|
|
16
16
|
return (
|
|
17
|
-
<ul className={cx(style, className)} {...
|
|
17
|
+
<ul className={cx(style, className)} {...restProps}>
|
|
18
18
|
{children}
|
|
19
19
|
</ul>
|
|
20
20
|
)
|
|
@@ -23,7 +23,7 @@ export const Ul = (props: UlProps) => {
|
|
|
23
23
|
export interface OlProps extends React.ComponentProps<'ol'> {}
|
|
24
24
|
|
|
25
25
|
export const Ol = (props: OlProps) => {
|
|
26
|
-
const { className, children, ...
|
|
26
|
+
const { className, children, ...restProps } = props
|
|
27
27
|
|
|
28
28
|
const style = `
|
|
29
29
|
list-decimal
|
|
@@ -32,7 +32,7 @@ export const Ol = (props: OlProps) => {
|
|
|
32
32
|
pl-4
|
|
33
33
|
`
|
|
34
34
|
return (
|
|
35
|
-
<ol className={cx(style, className)} {...
|
|
35
|
+
<ol className={cx(style, className)} {...restProps}>
|
|
36
36
|
{children}
|
|
37
37
|
</ol>
|
|
38
38
|
)
|
|
@@ -4,7 +4,7 @@ import { cx } from '../utils'
|
|
|
4
4
|
export interface PreProps extends React.ComponentProps<'pre'> {}
|
|
5
5
|
|
|
6
6
|
export const Pre = (props: PreProps) => {
|
|
7
|
-
const { className, children, ...
|
|
7
|
+
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
10
10
|
p-4
|
|
@@ -15,7 +15,7 @@ export const Pre = (props: PreProps) => {
|
|
|
15
15
|
`
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<pre className={cx(style, className)} {...
|
|
18
|
+
<pre className={cx(style, className)} {...restProps}>
|
|
19
19
|
{children}
|
|
20
20
|
</pre>
|
|
21
21
|
)
|
|
@@ -10,7 +10,7 @@ const styleBorder = `
|
|
|
10
10
|
`
|
|
11
11
|
|
|
12
12
|
export const Table = (props: TableProps) => {
|
|
13
|
-
const { className, children, ...
|
|
13
|
+
const { className, children, ...restProps } = props
|
|
14
14
|
|
|
15
15
|
// If there is no break-all setting, the table will protrude when using a smartphone
|
|
16
16
|
const style = `
|
|
@@ -20,7 +20,7 @@ export const Table = (props: TableProps) => {
|
|
|
20
20
|
`
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<table className={cx(style, styleBorder, className)} {...
|
|
23
|
+
<table className={cx(style, styleBorder, className)} {...restProps}>
|
|
24
24
|
{children}
|
|
25
25
|
</table>
|
|
26
26
|
)
|
|
@@ -29,11 +29,11 @@ export const Table = (props: TableProps) => {
|
|
|
29
29
|
export interface CaptionProps extends React.ComponentProps<'caption'> {}
|
|
30
30
|
|
|
31
31
|
export const Caption = (props: CaptionProps) => {
|
|
32
|
-
const { className, children, ...
|
|
32
|
+
const { className, children, ...restProps } = props
|
|
33
33
|
|
|
34
34
|
const style = `text-left`
|
|
35
35
|
return (
|
|
36
|
-
<caption className={cx(style, className)} {...
|
|
36
|
+
<caption className={cx(style, className)} {...restProps}>
|
|
37
37
|
{children}
|
|
38
38
|
</caption>
|
|
39
39
|
)
|
|
@@ -42,10 +42,10 @@ export const Caption = (props: CaptionProps) => {
|
|
|
42
42
|
export interface TheadProps extends React.ComponentProps<'thead'> {}
|
|
43
43
|
|
|
44
44
|
export const Thead = (props: TheadProps) => {
|
|
45
|
-
const { className, children, ...
|
|
45
|
+
const { className, children, ...restProps } = props
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
|
-
<thead className={cx(className)} {...
|
|
48
|
+
<thead className={cx(className)} {...restProps}>
|
|
49
49
|
{children}
|
|
50
50
|
</thead>
|
|
51
51
|
)
|
|
@@ -54,10 +54,10 @@ export const Thead = (props: TheadProps) => {
|
|
|
54
54
|
export interface TbodyProps extends React.ComponentProps<'tbody'> {}
|
|
55
55
|
|
|
56
56
|
export const Tbody = (props: TbodyProps) => {
|
|
57
|
-
const { className, children, ...
|
|
57
|
+
const { className, children, ...restProps } = props
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<tbody className={cx(className)} {...
|
|
60
|
+
<tbody className={cx(className)} {...restProps}>
|
|
61
61
|
{children}
|
|
62
62
|
</tbody>
|
|
63
63
|
)
|
|
@@ -66,7 +66,7 @@ export const Tbody = (props: TbodyProps) => {
|
|
|
66
66
|
export interface ThProps extends React.ComponentProps<'th'> {}
|
|
67
67
|
|
|
68
68
|
export const Th = (props: ThProps) => {
|
|
69
|
-
const { className, children, ...
|
|
69
|
+
const { className, children, ...restProps } = props
|
|
70
70
|
|
|
71
71
|
const style = `
|
|
72
72
|
p-2
|
|
@@ -74,7 +74,7 @@ export const Th = (props: ThProps) => {
|
|
|
74
74
|
text-left
|
|
75
75
|
`
|
|
76
76
|
return (
|
|
77
|
-
<th className={cx(style, styleBorder, className)} {...
|
|
77
|
+
<th className={cx(style, styleBorder, className)} {...restProps}>
|
|
78
78
|
{children}
|
|
79
79
|
</th>
|
|
80
80
|
)
|
|
@@ -83,12 +83,12 @@ export const Th = (props: ThProps) => {
|
|
|
83
83
|
export interface TrProps extends React.ComponentProps<'tr'> {}
|
|
84
84
|
|
|
85
85
|
export const Tr = (props: TrProps) => {
|
|
86
|
-
const { className, children, ...
|
|
86
|
+
const { className, children, ...restProps } = props
|
|
87
87
|
|
|
88
88
|
const style = ``
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<tr className={cx(style, styleBorder, className)} {...
|
|
91
|
+
<tr className={cx(style, styleBorder, className)} {...restProps}>
|
|
92
92
|
{children}
|
|
93
93
|
</tr>
|
|
94
94
|
)
|
|
@@ -97,14 +97,14 @@ export const Tr = (props: TrProps) => {
|
|
|
97
97
|
export interface TdProps extends React.ComponentProps<'td'> {}
|
|
98
98
|
|
|
99
99
|
export const Td = (props: TdProps) => {
|
|
100
|
-
const { className, children, ...
|
|
100
|
+
const { className, children, ...restProps } = props
|
|
101
101
|
|
|
102
102
|
const style = `
|
|
103
103
|
p-2
|
|
104
104
|
`
|
|
105
105
|
|
|
106
106
|
return (
|
|
107
|
-
<td className={cx(style, styleBorder, className)} {...
|
|
107
|
+
<td className={cx(style, styleBorder, className)} {...restProps}>
|
|
108
108
|
{children}
|
|
109
109
|
</td>
|
|
110
110
|
)
|