@sakura-ui/sakura-ui 0.1.13 → 0.1.16
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 +3 -3
- package/package.json +1 -1
- package/packages/config/package.json +1 -1
- package/packages/config/src/index.ts +47 -48
- package/packages/core/.eslintrc.json +25 -0
- package/packages/core/coverage/coverage-final.json +2699 -14
- package/packages/core/coverage/lcov-report/base.css +261 -123
- package/packages/core/coverage/lcov-report/block-navigation.js +68 -70
- package/packages/core/coverage/lcov-report/index.html +198 -128
- package/packages/core/coverage/lcov-report/prettify.css +101 -1
- package/packages/core/coverage/lcov-report/prettify.js +1003 -1
- package/packages/core/coverage/lcov-report/sorter.js +169 -174
- package/packages/core/coverage/lcov-report/src/components/Button.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Card.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Code.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Heading.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Icon.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/IconButton.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/InfoCard.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Link.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/List.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Pre.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/Table.tsx.html +70 -68
- package/packages/core/coverage/lcov-report/src/components/index.html +369 -254
- package/packages/core/coverage/lcov-report/src/components/index.ts.html +70 -68
- package/packages/core/coverage/lcov-report/src/index.html +159 -99
- package/packages/core/coverage/lcov-report/src/index.ts.html +70 -68
- package/packages/core/coverage/lcov-report/src/utils/class.ts.html +70 -68
- package/packages/core/coverage/lcov-report/src/utils/index.html +159 -99
- package/packages/core/package.json +12 -2
- package/packages/core/src/components/Button.tsx +31 -31
- package/packages/core/src/components/Card.tsx +12 -14
- package/packages/core/src/components/Code.tsx +1 -1
- package/packages/core/src/components/Faq.tsx +84 -0
- package/packages/core/src/components/Heading.tsx +42 -30
- package/packages/core/src/components/Icon.tsx +1 -4
- package/packages/core/src/components/IconButton.tsx +78 -68
- package/packages/core/src/components/InfoCard.tsx +4 -5
- package/packages/core/src/components/Link.tsx +23 -24
- package/packages/core/src/components/List.tsx +3 -3
- package/packages/core/src/components/Pre.tsx +1 -1
- package/packages/core/src/components/Table.tsx +7 -9
- package/packages/core/src/components/index.ts +1 -0
- package/packages/core/src/index.ts +3 -0
- package/packages/forms/dist/components/Checkbox.d.ts +1 -1
- package/packages/forms/dist/components/Checkbox.d.ts.map +1 -1
- package/packages/forms/dist/components/Checkbox.js.map +1 -1
- package/packages/forms/dist/components/FieldsetControl.d.ts +1 -1
- package/packages/forms/dist/components/FieldsetControl.d.ts.map +1 -1
- package/packages/forms/dist/components/FieldsetControl.js +1 -1
- package/packages/forms/dist/components/FieldsetControl.js.map +1 -1
- package/packages/forms/dist/components/Input.d.ts +1 -1
- package/packages/forms/dist/components/Input.d.ts.map +1 -1
- package/packages/forms/dist/components/Input.js.map +1 -1
- package/packages/forms/dist/components/LabelControl.d.ts +1 -1
- package/packages/forms/dist/components/LabelControl.d.ts.map +1 -1
- package/packages/forms/dist/components/LabelControl.js +1 -1
- package/packages/forms/dist/components/LabelControl.js.map +1 -1
- package/packages/forms/dist/components/Radio.d.ts +1 -1
- package/packages/forms/dist/components/Radio.d.ts.map +1 -1
- package/packages/forms/dist/components/Radio.js.map +1 -1
- package/packages/forms/dist/components/Select.d.ts +1 -1
- package/packages/forms/dist/components/Select.d.ts.map +1 -1
- package/packages/forms/dist/components/Select.js.map +1 -1
- package/packages/forms/dist/components/Textarea.d.ts +1 -1
- package/packages/forms/dist/components/Textarea.d.ts.map +1 -1
- package/packages/forms/dist/components/Textarea.js +1 -1
- package/packages/forms/dist/components/Textarea.js.map +1 -1
- package/packages/forms/dist/components/controlled/CheckboxGroup.d.ts +1 -1
- package/packages/forms/dist/components/controlled/CheckboxGroup.d.ts.map +1 -1
- package/packages/forms/dist/components/controlled/CheckboxGroup.js.map +1 -1
- package/packages/forms/dist/components/controlled/RadioGroup.d.ts +1 -1
- package/packages/forms/dist/components/controlled/RadioGroup.d.ts.map +1 -1
- package/packages/forms/dist/components/controlled/RadioGroup.js.map +1 -1
- package/packages/forms/dist/components/controlled/SelectControl.d.ts +1 -1
- package/packages/forms/dist/components/controlled/SelectControl.d.ts.map +1 -1
- package/packages/forms/dist/components/controlled/SelectControl.js.map +1 -1
- package/packages/forms/dist/components/controlled/TextareaControl.d.ts +1 -1
- package/packages/forms/dist/components/controlled/TextareaControl.d.ts.map +1 -1
- package/packages/forms/dist/components/controlled/TextareaControl.js.map +1 -1
- package/packages/forms/dist/index.cjs.js +1 -1
- package/packages/forms/dist/index.cjs.js.map +1 -1
- package/packages/forms/dist/index.es.js +123 -116
- package/packages/forms/dist/index.es.js.map +1 -1
- package/packages/forms/package.json +1 -1
- package/packages/forms/src/components/Checkbox.tsx +35 -36
- package/packages/forms/src/components/FieldsetControl.tsx +57 -58
- package/packages/forms/src/components/Input.tsx +23 -24
- package/packages/forms/src/components/LabelControl.tsx +54 -52
- package/packages/forms/src/components/Radio.tsx +32 -33
- package/packages/forms/src/components/Select.tsx +32 -33
- package/packages/forms/src/components/Textarea.tsx +42 -43
- package/packages/forms/src/components/controlled/CheckboxGroup.tsx +36 -34
- package/packages/forms/src/components/controlled/RadioGroup.tsx +1 -1
- package/packages/forms/src/components/controlled/SelectControl.tsx +26 -24
- package/packages/forms/src/components/controlled/TextareaControl.tsx +26 -24
|
@@ -3,7 +3,7 @@ import { cx } from '../utils/class'
|
|
|
3
3
|
|
|
4
4
|
export interface CodeProps extends React.ComponentPropsWithoutRef<'code'> {}
|
|
5
5
|
|
|
6
|
-
export const Code
|
|
6
|
+
export const Code = (props: CodeProps) => {
|
|
7
7
|
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cx } from '../utils/class'
|
|
3
|
+
|
|
4
|
+
export interface FaqProps extends React.ComponentPropsWithoutRef<'dl'> {}
|
|
5
|
+
|
|
6
|
+
const headingStyle = `
|
|
7
|
+
text-h-med-m
|
|
8
|
+
sm:text-h-med
|
|
9
|
+
!leading-none
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export const Faq = (props: FaqProps) => {
|
|
13
|
+
const { className, children, ...restProps } = props
|
|
14
|
+
|
|
15
|
+
const style = `
|
|
16
|
+
flex
|
|
17
|
+
flex-col
|
|
18
|
+
gap-8
|
|
19
|
+
`
|
|
20
|
+
return (
|
|
21
|
+
<article itemScope itemType="https://schema.org/FAQPage">
|
|
22
|
+
<dl
|
|
23
|
+
className={cx(style, className)}
|
|
24
|
+
itemScope
|
|
25
|
+
itemProp="mainEntity"
|
|
26
|
+
itemType="https://schema.org/Question"
|
|
27
|
+
{...restProps}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</dl>
|
|
31
|
+
</article>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface QuestionProps extends React.ComponentPropsWithoutRef<'dt'> {}
|
|
36
|
+
|
|
37
|
+
export const Question = (props: QuestionProps) => {
|
|
38
|
+
const { className, children, ...restProps } = props
|
|
39
|
+
|
|
40
|
+
const style = `
|
|
41
|
+
flex
|
|
42
|
+
flex-row
|
|
43
|
+
gap-8
|
|
44
|
+
mt-10
|
|
45
|
+
first:mt-0
|
|
46
|
+
`
|
|
47
|
+
return (
|
|
48
|
+
<dt
|
|
49
|
+
className={cx(style, headingStyle, className)}
|
|
50
|
+
itemProp="name"
|
|
51
|
+
{...restProps}
|
|
52
|
+
>
|
|
53
|
+
<span aria-hidden="true">Q</span>
|
|
54
|
+
<span>{children}</span>
|
|
55
|
+
</dt>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface AnswerProps extends React.ComponentPropsWithoutRef<'dd'> {}
|
|
60
|
+
|
|
61
|
+
export const Answer = (props: AnswerProps) => {
|
|
62
|
+
const { className, children, ...restProps } = props
|
|
63
|
+
|
|
64
|
+
const style = `
|
|
65
|
+
flex
|
|
66
|
+
flex-row
|
|
67
|
+
items-start
|
|
68
|
+
gap-8
|
|
69
|
+
`
|
|
70
|
+
return (
|
|
71
|
+
<dd
|
|
72
|
+
className={cx(style, className)}
|
|
73
|
+
itemScope
|
|
74
|
+
itemProp="acceptedAnswer"
|
|
75
|
+
itemType="https://schema.org/Answer"
|
|
76
|
+
{...restProps}
|
|
77
|
+
>
|
|
78
|
+
<span className={headingStyle} aria-hidden="true">
|
|
79
|
+
A
|
|
80
|
+
</span>
|
|
81
|
+
<span itemProp="text">{children}</span>
|
|
82
|
+
</dd>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
@@ -3,14 +3,16 @@ import { cx } from '../utils/class'
|
|
|
3
3
|
|
|
4
4
|
export interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'> {}
|
|
5
5
|
|
|
6
|
-
export const H1
|
|
6
|
+
export const H1 = (props: HeadingProps) => {
|
|
7
7
|
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
10
|
-
text-
|
|
11
|
-
sm:text-
|
|
12
|
-
mt-
|
|
13
|
-
mb-
|
|
10
|
+
text-h-lg-m
|
|
11
|
+
sm:text-h-lg
|
|
12
|
+
mt-8
|
|
13
|
+
mb-3
|
|
14
|
+
sm:mt-16
|
|
15
|
+
sm:mb-6
|
|
14
16
|
`
|
|
15
17
|
|
|
16
18
|
return (
|
|
@@ -20,14 +22,16 @@ export const H1: React.ElementType<HeadingProps> = (props: HeadingProps) => {
|
|
|
20
22
|
)
|
|
21
23
|
}
|
|
22
24
|
|
|
23
|
-
export const H2
|
|
25
|
+
export const H2 = (props: HeadingProps) => {
|
|
24
26
|
const { className, children, ...restProps } = props
|
|
25
27
|
|
|
26
28
|
const style = `
|
|
27
|
-
text-
|
|
28
|
-
sm:text-
|
|
29
|
-
mt-
|
|
30
|
-
mb-
|
|
29
|
+
text-h-med-m
|
|
30
|
+
sm:text-h-med
|
|
31
|
+
mt-8
|
|
32
|
+
mb-3
|
|
33
|
+
sm:mt-16
|
|
34
|
+
sm:mb-6
|
|
31
35
|
`
|
|
32
36
|
|
|
33
37
|
return (
|
|
@@ -37,14 +41,16 @@ export const H2: React.ElementType<HeadingProps> = (props: HeadingProps) => {
|
|
|
37
41
|
)
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
export const H3
|
|
44
|
+
export const H3 = (props: HeadingProps) => {
|
|
41
45
|
const { className, children, ...restProps } = props
|
|
42
46
|
|
|
43
47
|
const style = `
|
|
44
|
-
text-
|
|
45
|
-
sm:text-
|
|
46
|
-
mt-
|
|
47
|
-
mb-
|
|
48
|
+
text-h-sm-m
|
|
49
|
+
sm:text-h-sm
|
|
50
|
+
mt-5
|
|
51
|
+
mb-3
|
|
52
|
+
sm:mt-10
|
|
53
|
+
sm:mb-6
|
|
48
54
|
`
|
|
49
55
|
|
|
50
56
|
return (
|
|
@@ -54,14 +60,16 @@ export const H3: React.ElementType<HeadingProps> = (props: HeadingProps) => {
|
|
|
54
60
|
)
|
|
55
61
|
}
|
|
56
62
|
|
|
57
|
-
export const H4
|
|
63
|
+
export const H4 = (props: HeadingProps) => {
|
|
58
64
|
const { className, children, ...restProps } = props
|
|
59
65
|
|
|
60
66
|
const style = `
|
|
61
|
-
text-
|
|
62
|
-
sm:text-
|
|
63
|
-
mt-
|
|
64
|
-
mb-
|
|
67
|
+
text-h-xs-m
|
|
68
|
+
sm:text-h-xs
|
|
69
|
+
mt-5
|
|
70
|
+
mb-2
|
|
71
|
+
sm:mt-10
|
|
72
|
+
sm:mb-4
|
|
65
73
|
`
|
|
66
74
|
|
|
67
75
|
return (
|
|
@@ -71,14 +79,16 @@ export const H4: React.ElementType<HeadingProps> = (props: HeadingProps) => {
|
|
|
71
79
|
)
|
|
72
80
|
}
|
|
73
81
|
|
|
74
|
-
export const H5
|
|
82
|
+
export const H5 = (props: HeadingProps) => {
|
|
75
83
|
const { className, children, ...restProps } = props
|
|
76
84
|
|
|
77
85
|
const style = `
|
|
78
|
-
text-
|
|
79
|
-
sm:text-
|
|
80
|
-
mt-
|
|
81
|
-
mb-
|
|
86
|
+
text-h-xxs-m
|
|
87
|
+
sm:text-h-xxs
|
|
88
|
+
mt-5
|
|
89
|
+
mb-2
|
|
90
|
+
sm:mt-10
|
|
91
|
+
sm:mb-4
|
|
82
92
|
`
|
|
83
93
|
|
|
84
94
|
return (
|
|
@@ -88,14 +98,16 @@ export const H5: React.ElementType<HeadingProps> = (props: HeadingProps) => {
|
|
|
88
98
|
)
|
|
89
99
|
}
|
|
90
100
|
|
|
91
|
-
export const H6
|
|
101
|
+
export const H6 = (props: HeadingProps) => {
|
|
92
102
|
const { className, children, ...restProps } = props
|
|
93
103
|
|
|
94
104
|
const style = `
|
|
95
|
-
text-
|
|
96
|
-
sm:text-
|
|
97
|
-
mt-
|
|
98
|
-
mb-
|
|
105
|
+
text-h-xxs-m
|
|
106
|
+
sm:text-h-xxs
|
|
107
|
+
mt-3
|
|
108
|
+
mb-2
|
|
109
|
+
sm:mt-6
|
|
110
|
+
sm:mb-4
|
|
99
111
|
`
|
|
100
112
|
|
|
101
113
|
return (
|
|
@@ -5,10 +5,7 @@ export interface IconProps extends React.ComponentPropsWithRef<'span'> {
|
|
|
5
5
|
icon: string
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const Icon
|
|
9
|
-
HTMLElement,
|
|
10
|
-
IconProps
|
|
11
|
-
>((props, ref) => {
|
|
8
|
+
export const Icon = React.forwardRef<HTMLElement, IconProps>((props, ref) => {
|
|
12
9
|
const { className, icon, ...restProps } = props
|
|
13
10
|
|
|
14
11
|
const style = `
|
|
@@ -8,90 +8,100 @@ export interface IconButtonProps extends React.ComponentPropsWithRef<'button'> {
|
|
|
8
8
|
icon: string
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const IconButton
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...restProps
|
|
23
|
-
} = props
|
|
11
|
+
export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
12
|
+
(props, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
className,
|
|
15
|
+
children,
|
|
16
|
+
variant,
|
|
17
|
+
icon,
|
|
18
|
+
iconLayout,
|
|
19
|
+
rounded,
|
|
20
|
+
...restProps
|
|
21
|
+
} = props
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
const layout = iconLayout ?? 'left'
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
const align = 'center'
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
const style = `
|
|
28
|
+
${rounded === 'full' ? 'aspect-square' : ''}
|
|
29
|
+
inline-block
|
|
30
|
+
p-4
|
|
31
|
+
text-button
|
|
32
|
+
text-${align}
|
|
33
|
+
rounded-${rounded ? rounded : 'lg'}
|
|
34
|
+
cursor-pointer
|
|
35
|
+
whitespace-nowrap
|
|
36
|
+
border
|
|
37
|
+
border-solid
|
|
38
|
+
border-sea-800
|
|
39
|
+
active:enabled:border-sea-800/[.8]
|
|
40
|
+
hover:enabled:border-sea-800/[.85]
|
|
41
|
+
focus:outline
|
|
42
|
+
focus:outline-2
|
|
43
|
+
focus:outline-wood-600
|
|
44
|
+
disabled:border-sumi-500
|
|
45
|
+
disabled:cursor-not-allowed
|
|
46
|
+
`
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
const primary = `
|
|
51
49
|
text-white-1000
|
|
52
50
|
bg-sea-800
|
|
53
|
-
active:enabled:bg-sea-800
|
|
54
|
-
hover:enabled:bg-sea-800
|
|
51
|
+
active:enabled:bg-sea-800/[.8]
|
|
52
|
+
hover:enabled:bg-sea-800/[.85]
|
|
55
53
|
disabled:bg-sumi-500
|
|
56
54
|
disabled:text-white-1000
|
|
57
55
|
`
|
|
58
|
-
|
|
56
|
+
const secondary = `
|
|
59
57
|
text-sea-800
|
|
60
58
|
bg-transparent
|
|
61
|
-
active:enabled:bg-sea-50
|
|
59
|
+
active:enabled:bg-sea-50/[.60]
|
|
62
60
|
hover:enabled:bg-sea-50
|
|
63
|
-
active:enabled:text-sea-800
|
|
64
|
-
hover:enabled:text-sea-800
|
|
61
|
+
active:enabled:text-sea-800/[.85]
|
|
62
|
+
hover:enabled:text-sea-800/[.85]
|
|
65
63
|
disabled:text-sumi-500
|
|
66
64
|
`
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
const styles = {
|
|
67
|
+
primary: primary,
|
|
68
|
+
secondary: secondary
|
|
69
|
+
}
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
`
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
82
|
+
// When text is specified on a button, set the 'aria-hidden' attribute of the icon to true.
|
|
83
|
+
const ariaHidden = children ? true : false
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<button
|
|
87
|
+
className={cx(style, styles[variant ?? 'primary'], className)}
|
|
88
|
+
{...restProps}
|
|
89
|
+
ref={ref}
|
|
90
|
+
>
|
|
91
|
+
{layout == 'left' && (
|
|
92
|
+
<span className={cx(iconStyle)} aria-hidden={ariaHidden}>
|
|
93
|
+
{icon}
|
|
94
|
+
</span>
|
|
95
|
+
)}
|
|
96
|
+
{children && <span className="mx-1 inline-block">{children}</span>}
|
|
97
|
+
{layout == 'right' && (
|
|
98
|
+
<span className={cx(iconStyle)} aria-hidden={ariaHidden}>
|
|
99
|
+
{icon}
|
|
100
|
+
</span>
|
|
101
|
+
)}
|
|
102
|
+
</button>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
)
|
|
96
106
|
|
|
97
107
|
IconButton.displayName = 'IconButton'
|
|
@@ -6,9 +6,7 @@ export interface InfoCardProps
|
|
|
6
6
|
title?: string
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const InfoCard:
|
|
10
|
-
props: InfoCardProps
|
|
11
|
-
) => {
|
|
9
|
+
export const InfoCard = (props: InfoCardProps) => {
|
|
12
10
|
const { className, children, title, ...restProps } = props
|
|
13
11
|
|
|
14
12
|
const style = `
|
|
@@ -16,14 +14,15 @@ export const InfoCard: React.ElementType<InfoCardProps> = (
|
|
|
16
14
|
border-solid
|
|
17
15
|
border-sumi-300
|
|
18
16
|
rounded-2xl
|
|
19
|
-
|
|
17
|
+
sm:rounded-3xl
|
|
20
18
|
text-sumi-900
|
|
21
19
|
`
|
|
22
20
|
|
|
23
21
|
const topStyle = `
|
|
24
22
|
pt-6
|
|
25
23
|
px-6
|
|
26
|
-
text-
|
|
24
|
+
text-h-xxs-m
|
|
25
|
+
sm:text-h-xxs
|
|
27
26
|
leading-none
|
|
28
27
|
mb-2
|
|
29
28
|
`
|
|
@@ -30,15 +30,13 @@ const getFileType = (url: string) => {
|
|
|
30
30
|
|
|
31
31
|
export interface LinkProps extends React.ComponentPropsWithRef<'a'> {}
|
|
32
32
|
|
|
33
|
-
export const Link
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const href = props.href ?? ''
|
|
39
|
-
const fileType = getFileType(href)
|
|
33
|
+
export const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
|
|
34
|
+
(props, ref) => {
|
|
35
|
+
const { className, children, ...restProps } = props
|
|
36
|
+
const href = props.href ?? ''
|
|
37
|
+
const fileType = getFileType(href)
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
const style = `
|
|
42
40
|
rounded-sm
|
|
43
41
|
cursor-pointer
|
|
44
42
|
text-sea-600
|
|
@@ -53,27 +51,28 @@ export const Link: React.ElementType<LinkProps> = React.forwardRef<
|
|
|
53
51
|
disabled:border-sumi-500
|
|
54
52
|
`
|
|
55
53
|
|
|
56
|
-
|
|
54
|
+
if (href.startsWith('http')) {
|
|
55
|
+
return (
|
|
56
|
+
<a
|
|
57
|
+
className={cx(style, className)}
|
|
58
|
+
href={href}
|
|
59
|
+
target="_blank"
|
|
60
|
+
rel="noopener noreferrer"
|
|
61
|
+
{...restProps}
|
|
62
|
+
ref={ref}
|
|
63
|
+
>
|
|
64
|
+
{children}
|
|
65
|
+
{fileType ? `(${fileType})` : null}
|
|
66
|
+
</a>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
57
69
|
return (
|
|
58
|
-
<a
|
|
59
|
-
className={cx(style, className)}
|
|
60
|
-
href={href}
|
|
61
|
-
target="_blank"
|
|
62
|
-
rel="noopener noreferrer"
|
|
63
|
-
{...restProps}
|
|
64
|
-
ref={ref}
|
|
65
|
-
>
|
|
70
|
+
<a className={cx(style, className)} href={href} {...restProps} ref={ref}>
|
|
66
71
|
{children}
|
|
67
72
|
{fileType ? `(${fileType})` : null}
|
|
68
73
|
</a>
|
|
69
74
|
)
|
|
70
75
|
}
|
|
71
|
-
|
|
72
|
-
<a className={cx(style, className)} href={href} {...restProps} ref={ref}>
|
|
73
|
-
{children}
|
|
74
|
-
{fileType ? `(${fileType})` : null}
|
|
75
|
-
</a>
|
|
76
|
-
)
|
|
77
|
-
})
|
|
76
|
+
)
|
|
78
77
|
|
|
79
78
|
Link.displayName = 'Link'
|
|
@@ -3,7 +3,7 @@ import { cx } from '../utils/class'
|
|
|
3
3
|
|
|
4
4
|
export interface UlProps extends React.ComponentPropsWithoutRef<'ul'> {}
|
|
5
5
|
|
|
6
|
-
export const Ul
|
|
6
|
+
export const Ul = (props: UlProps) => {
|
|
7
7
|
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
@@ -11,7 +11,7 @@ export const Ul: React.ElementType<UlProps> = (props: UlProps) => {
|
|
|
11
11
|
list-inside
|
|
12
12
|
-indent-4
|
|
13
13
|
pl-4
|
|
14
|
-
marker:text-
|
|
14
|
+
marker:text-base-sm
|
|
15
15
|
`
|
|
16
16
|
return (
|
|
17
17
|
<ul className={cx(style, className)} {...restProps}>
|
|
@@ -22,7 +22,7 @@ export const Ul: React.ElementType<UlProps> = (props: UlProps) => {
|
|
|
22
22
|
|
|
23
23
|
export interface OlProps extends React.ComponentPropsWithoutRef<'ol'> {}
|
|
24
24
|
|
|
25
|
-
export const Ol
|
|
25
|
+
export const Ol = (props: OlProps) => {
|
|
26
26
|
const { className, children, ...restProps } = props
|
|
27
27
|
|
|
28
28
|
const style = `
|
|
@@ -3,7 +3,7 @@ import { cx } from '../utils/class'
|
|
|
3
3
|
|
|
4
4
|
export interface PreProps extends React.ComponentPropsWithoutRef<'pre'> {}
|
|
5
5
|
|
|
6
|
-
export const Pre
|
|
6
|
+
export const Pre = (props: PreProps) => {
|
|
7
7
|
const { className, children, ...restProps } = props
|
|
8
8
|
|
|
9
9
|
const style = `
|
|
@@ -9,7 +9,7 @@ const styleBorder = `
|
|
|
9
9
|
border-sumi-900
|
|
10
10
|
`
|
|
11
11
|
|
|
12
|
-
export const Table
|
|
12
|
+
export const Table = (props: TableProps) => {
|
|
13
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
|
|
@@ -29,9 +29,7 @@ export const Table: React.ElementType<TableProps> = (props: TableProps) => {
|
|
|
29
29
|
export interface CaptionProps
|
|
30
30
|
extends React.ComponentPropsWithoutRef<'caption'> {}
|
|
31
31
|
|
|
32
|
-
export const Caption:
|
|
33
|
-
props: CaptionProps
|
|
34
|
-
) => {
|
|
32
|
+
export const Caption = (props: CaptionProps) => {
|
|
35
33
|
const { className, children, ...restProps } = props
|
|
36
34
|
|
|
37
35
|
const style = `text-left`
|
|
@@ -44,7 +42,7 @@ export const Caption: React.ElementType<CaptionProps> = (
|
|
|
44
42
|
|
|
45
43
|
export interface TheadProps extends React.ComponentPropsWithoutRef<'thead'> {}
|
|
46
44
|
|
|
47
|
-
export const Thead
|
|
45
|
+
export const Thead = (props: TheadProps) => {
|
|
48
46
|
const { className, children, ...restProps } = props
|
|
49
47
|
|
|
50
48
|
return (
|
|
@@ -56,7 +54,7 @@ export const Thead: React.ElementType<TheadProps> = (props: TheadProps) => {
|
|
|
56
54
|
|
|
57
55
|
export interface TbodyProps extends React.ComponentPropsWithoutRef<'tbody'> {}
|
|
58
56
|
|
|
59
|
-
export const Tbody
|
|
57
|
+
export const Tbody = (props: TbodyProps) => {
|
|
60
58
|
const { className, children, ...restProps } = props
|
|
61
59
|
|
|
62
60
|
return (
|
|
@@ -68,7 +66,7 @@ export const Tbody: React.ElementType<TbodyProps> = (props: TbodyProps) => {
|
|
|
68
66
|
|
|
69
67
|
export interface ThProps extends React.ComponentPropsWithoutRef<'th'> {}
|
|
70
68
|
|
|
71
|
-
export const Th
|
|
69
|
+
export const Th = (props: ThProps) => {
|
|
72
70
|
const { className, children, ...restProps } = props
|
|
73
71
|
|
|
74
72
|
const style = `
|
|
@@ -85,7 +83,7 @@ export const Th: React.ElementType<ThProps> = (props: ThProps) => {
|
|
|
85
83
|
|
|
86
84
|
export interface TrProps extends React.ComponentPropsWithoutRef<'tr'> {}
|
|
87
85
|
|
|
88
|
-
export const Tr
|
|
86
|
+
export const Tr = (props: TrProps) => {
|
|
89
87
|
const { className, children, ...restProps } = props
|
|
90
88
|
|
|
91
89
|
const style = ``
|
|
@@ -99,7 +97,7 @@ export const Tr: React.ElementType<TrProps> = (props: TrProps) => {
|
|
|
99
97
|
|
|
100
98
|
export interface TdProps extends React.ComponentPropsWithoutRef<'td'> {}
|
|
101
99
|
|
|
102
|
-
export const Td
|
|
100
|
+
export const Td = (props: TdProps) => {
|
|
103
101
|
const { className, children, ...restProps } = props
|
|
104
102
|
|
|
105
103
|
const style = `
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Button } from './Button'
|
|
2
2
|
export { Card, CardHeader, CardBody, CardFooter } from './Card'
|
|
3
3
|
export { Code } from './Code'
|
|
4
|
+
export { Faq, Question, Answer } from './Faq'
|
|
4
5
|
export { H1, H2, H3, H4, H5, H6 } from './Heading'
|
|
5
6
|
export { Icon } from './Icon'
|
|
6
7
|
export { IconButton } from './IconButton'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export interface CheckboxProps extends React.ComponentPropsWithRef<'input'> {
|
|
3
3
|
}
|
|
4
|
-
export declare const Checkbox: React.
|
|
4
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
5
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC;CAAG;AAE9E,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC;CAAG;AAE9E,eAAO,MAAM,QAAQ,qGA8DpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C,MAAM,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IACnD,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC/C,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAA;KAC1B;IACD,IAAI,GAAG,CAAC,SAAS,EAAE;QACjB,SAAS,CAAC,IAAI,GAAG,GAAG,CAAC,SAAS,CAAA;KAC/B;IAED,MAAM,KAAK,GAAG;;;;;;GAMf,CAAA;IAEC,MAAM,UAAU,GAAG;;;GAGpB,CAAA;IAEC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;GAcpB,CAAA;IAEC,OAAO,CACL,gBAAO,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,YAC3D,gBAAM,SAAS,EAAC,mBAAmB,aACjC,gBACE,SAAS,EAAE,UAAU,EACrB,IAAI,EAAC,UAAU,sBACG,GAAG,CAAC,YAAY,uBACf,GAAG,CAAC,cAAc,kBACvB,GAAG,CAAC,SAAS,IAAI,KAAK,KAChC,SAAS,EACb,GAAG,EAAE,GAAG,GACR,EACF,eAAM,SAAS,EAAE,UAAU,YACzB,cAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YAC5D,eAAM,CAAC,EAAC,wEAAwE,GAAG,GAC/E,GACD,EACP,eAAM,SAAS,EAAC,6BAA6B,YAAE,QAAQ,GAAQ,IAC1D,GACD,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA"}
|
|
@@ -7,5 +7,5 @@ export interface FieldsetControlProps extends React.ComponentPropsWithRef<'field
|
|
|
7
7
|
isRequired?: boolean;
|
|
8
8
|
direction?: 'flex-col' | 'flex-row';
|
|
9
9
|
}
|
|
10
|
-
export declare const FieldsetControl: React.
|
|
10
|
+
export declare const FieldsetControl: React.ForwardRefExoticComponent<Omit<FieldsetControlProps, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
11
11
|
//# sourceMappingURL=FieldsetControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldsetControl.d.ts","sourceRoot":"","sources":["../../src/components/FieldsetControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,oBACf,SAAQ,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;CACpC;AAED,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"FieldsetControl.d.ts","sourceRoot":"","sources":["../../src/components/FieldsetControl.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,oBACf,SAAQ,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,UAAU,GAAG,UAAU,CAAA;CACpC;AAED,eAAO,MAAM,eAAe,+GA4D1B,CAAA"}
|
|
@@ -14,7 +14,7 @@ export const FieldsetControl = React.forwardRef((props, ref) => {
|
|
|
14
14
|
isRequired: isRequired ?? false
|
|
15
15
|
};
|
|
16
16
|
const styleDirection = direction ?? 'flex-col';
|
|
17
|
-
return (_jsx(ControllerContext.Provider, { value: context, children: _jsxs("fieldset", { className: cx('mb-4', className), ref: ref, ...restProps, children: [_jsx("legend", { children: _jsxs("p", { className: cx('block mb-2 text-label', isInvalid && 'text-sun-800'), children: [labelText, isRequired && _jsx("span", { className: "text-sun-800", children: "\u00A0*" })] }) }), _jsx("div", { className: cx('inline-flex', styleDirection), children: children }), helperText && (_jsx("p", { id: context.helperTextId, className: "text-
|
|
17
|
+
return (_jsx(ControllerContext.Provider, { value: context, children: _jsxs("fieldset", { className: cx('mb-4', className), ref: ref, ...restProps, children: [_jsx("legend", { children: _jsxs("p", { className: cx('block mb-2 text-label', isInvalid && 'text-sun-800'), children: [labelText, isRequired && _jsx("span", { className: "text-sun-800", children: "\u00A0*" })] }) }), _jsx("div", { className: cx('inline-flex', styleDirection), children: children }), helperText && (_jsx("p", { id: context.helperTextId, className: "text-sup text-sumi-700 mt-2", children: helperText })), isInvalid && (_jsx("p", { id: context.errorMessageId, className: cx('text-sup text-sun-800', helperText ? 'mt-1' : 'mt-2'), children: errorMessage }))] }) }));
|
|
18
18
|
});
|
|
19
19
|
FieldsetControl.displayName = 'FieldsetControl';
|
|
20
20
|
//# sourceMappingURL=FieldsetControl.js.map
|