@liguelead/design-system 0.0.8 → 0.0.10
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/components/Button/Button.appearance.ts +62 -62
- package/components/Button/Button.sizes.ts +41 -41
- package/components/Button/Button.styles.ts +50 -50
- package/components/Button/Button.tsx +76 -76
- package/components/Button/Button.types.ts +23 -23
- package/components/Button/index.ts +1 -1
- package/components/Checkbox/Checkbox.styles.ts +66 -66
- package/components/Checkbox/Checkbox.tsx +40 -40
- package/components/Checkbox/Checkbox.types.ts +11 -11
- package/components/Checkbox/index.tsx +2 -2
- package/components/DatePicker/DatePicker.styles.ts +66 -66
- package/components/DatePicker/DatePicker.tsx +135 -135
- package/components/DatePicker/DatePicker.types.ts +29 -29
- package/components/DatePicker/index.ts +1 -1
- package/components/IconButton/IconButton.sizes.ts +41 -41
- package/components/IconButton/IconButton.tsx +70 -70
- package/components/IconButton/index.ts +1 -1
- package/components/PageWrapper/PageWrapper.tsx +31 -31
- package/components/PageWrapper/index.ts +1 -1
- package/components/SegmentedButton/SegmentedButton.styles.ts +29 -29
- package/components/SegmentedButton/SegmentedButton.tsx +49 -49
- package/components/SegmentedButton/SegmentedButton.types.ts +20 -20
- package/components/SegmentedButton/index.ts +1 -1
- package/components/Select/Select.sizes.ts +56 -56
- package/components/Select/Select.states.tsx +69 -69
- package/components/Select/Select.styles.ts +148 -148
- package/components/Select/Select.tsx +145 -144
- package/components/Select/Select.types.ts +36 -36
- package/components/Select/index.ts +1 -1
- package/components/Text/Text.styles.ts +43 -43
- package/components/Text/Text.tsx +27 -27
- package/components/Text/Text.types.ts +42 -42
- package/components/Text/index.ts +1 -1
- package/components/TextField/TextField.sizes.ts +58 -58
- package/components/TextField/TextField.states.tsx +53 -76
- package/components/TextField/TextField.styles.ts +81 -98
- package/components/TextField/TextField.tsx +105 -108
- package/components/TextField/TextField.types.ts +22 -21
- package/components/TextField/index.ts +2 -2
- package/components/TextField/utils/getState.ts +7 -0
- package/components/ThemeProvider/ThemeProvider.tsx +21 -21
- package/components/ThemeProvider/index.ts +1 -1
- package/components/ThemeProvider/style.ts +969 -969
- package/components/Wizard/StepContent.tsx +28 -28
- package/components/Wizard/StepMenuItem.tsx +33 -33
- package/components/Wizard/Wizard.context.tsx +76 -76
- package/components/Wizard/Wizard.styles.ts +126 -126
- package/components/Wizard/Wizard.tsx +55 -55
- package/components/Wizard/index.ts +1 -1
- package/components/index.ts +11 -11
- package/package.json +41 -39
- package/scripts/createTypes.js +70 -70
- package/utils/colorDarken.ts +10 -10
- package/utils/colorLighten.ts +10 -10
- package/utils/darkenOrLighen.ts +19 -19
- package/utils/getTextColor.ts +12 -12
- package/utils/index.ts +5 -5
- package/utils/parseColor.ts +7 -7
|
@@ -1,144 +1,145 @@
|
|
|
1
|
-
import { forwardRef, useState } from 'react'
|
|
2
|
-
import * as RadixSelect from '@radix-ui/react-select'
|
|
3
|
-
import { CaretDown, Plus } from '@phosphor-icons/react'
|
|
4
|
-
import {
|
|
5
|
-
FloatingLabel,
|
|
6
|
-
HelperText,
|
|
7
|
-
IconWrapper,
|
|
8
|
-
InputWrapper,
|
|
9
|
-
StyledContent,
|
|
10
|
-
StyledInput,
|
|
11
|
-
StyledItem,
|
|
12
|
-
Wrapper
|
|
13
|
-
} from './Select.styles'
|
|
14
|
-
import { SelectStates } from './Select.states'
|
|
15
|
-
import { textFieldSizes } from './Select.sizes'
|
|
16
|
-
import TextField
|
|
17
|
-
import { SelectProps, StateInterface } from './Select.types'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
1
|
+
import { forwardRef, useState } from 'react'
|
|
2
|
+
import * as RadixSelect from '@radix-ui/react-select'
|
|
3
|
+
import { CaretDown, Plus } from '@phosphor-icons/react'
|
|
4
|
+
import {
|
|
5
|
+
FloatingLabel,
|
|
6
|
+
HelperText,
|
|
7
|
+
IconWrapper,
|
|
8
|
+
InputWrapper,
|
|
9
|
+
StyledContent,
|
|
10
|
+
StyledInput,
|
|
11
|
+
StyledItem,
|
|
12
|
+
Wrapper
|
|
13
|
+
} from './Select.styles'
|
|
14
|
+
import { SelectStates } from './Select.states'
|
|
15
|
+
import { textFieldSizes } from './Select.sizes'
|
|
16
|
+
import TextField from '../TextField/TextField'
|
|
17
|
+
import { SelectProps, StateInterface } from './Select.types'
|
|
18
|
+
import getState from '../TextField/utils/getState'
|
|
19
|
+
|
|
20
|
+
const Select = forwardRef<HTMLInputElement, SelectProps>(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
label,
|
|
24
|
+
defaultValue,
|
|
25
|
+
error,
|
|
26
|
+
helperText,
|
|
27
|
+
leftIcon,
|
|
28
|
+
size = 'md',
|
|
29
|
+
options,
|
|
30
|
+
className,
|
|
31
|
+
disabled = false,
|
|
32
|
+
handleLeftIcon,
|
|
33
|
+
register
|
|
34
|
+
},
|
|
35
|
+
ref
|
|
36
|
+
) => {
|
|
37
|
+
const [selectValue, setSelectValue] = useState(
|
|
38
|
+
defaultValue ?? options[0]?.value
|
|
39
|
+
)
|
|
40
|
+
const [open, setOpen] = useState(false)
|
|
41
|
+
|
|
42
|
+
const handleOnChange = (value: string) => {
|
|
43
|
+
if (value) {
|
|
44
|
+
setSelectValue(value)
|
|
45
|
+
register?.onChange({
|
|
46
|
+
target: {
|
|
47
|
+
name: register.name,
|
|
48
|
+
value
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const state = getState(disabled, !!error)
|
|
55
|
+
const textFieldState: StateInterface = SelectStates(state)
|
|
56
|
+
const textFieldSize = textFieldSizes(size, !!leftIcon, false)
|
|
57
|
+
const selectedLabel =
|
|
58
|
+
options.find(option => option.value === selectValue)?.label ?? ''
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Wrapper
|
|
62
|
+
className={className}
|
|
63
|
+
size={textFieldSize}
|
|
64
|
+
$themefication={textFieldState}>
|
|
65
|
+
<input
|
|
66
|
+
type="hidden"
|
|
67
|
+
value={selectValue}
|
|
68
|
+
ref={instance => {
|
|
69
|
+
if (typeof ref === 'function') {
|
|
70
|
+
ref(instance)
|
|
71
|
+
} else if (ref) {
|
|
72
|
+
ref.current = instance
|
|
73
|
+
}
|
|
74
|
+
register?.ref(instance)
|
|
75
|
+
}}
|
|
76
|
+
onChange={register?.onChange}
|
|
77
|
+
onBlur={register?.onBlur}
|
|
78
|
+
/>
|
|
79
|
+
{!disabled ? (
|
|
80
|
+
<RadixSelect.Root
|
|
81
|
+
value={selectValue}
|
|
82
|
+
onOpenChange={open => setOpen(open)}
|
|
83
|
+
defaultValue={defaultValue}
|
|
84
|
+
onValueChange={(value: string) =>
|
|
85
|
+
handleOnChange(value)
|
|
86
|
+
}>
|
|
87
|
+
<RadixSelect.Trigger asChild>
|
|
88
|
+
<InputWrapper>
|
|
89
|
+
{leftIcon && (
|
|
90
|
+
<IconWrapper onClick={handleLeftIcon}>
|
|
91
|
+
{leftIcon}
|
|
92
|
+
</IconWrapper>
|
|
93
|
+
)}
|
|
94
|
+
<IconWrapper $right $error={!!error}>
|
|
95
|
+
<CaretDown weight="fill" size={14} />
|
|
96
|
+
</IconWrapper>
|
|
97
|
+
<StyledInput
|
|
98
|
+
readOnly
|
|
99
|
+
style={{ cursor: 'pointer !important' }}
|
|
100
|
+
value={selectedLabel}
|
|
101
|
+
placeholder=" "
|
|
102
|
+
className={open ? 'is-open' : ''}
|
|
103
|
+
/>
|
|
104
|
+
<FloatingLabel
|
|
105
|
+
className={open ? 'is-open' : ''}>
|
|
106
|
+
{label}
|
|
107
|
+
</FloatingLabel>
|
|
108
|
+
</InputWrapper>
|
|
109
|
+
</RadixSelect.Trigger>
|
|
110
|
+
<StyledContent
|
|
111
|
+
asChild
|
|
112
|
+
sideOffset={0}
|
|
113
|
+
position="popper"
|
|
114
|
+
align="start"
|
|
115
|
+
className="RadixSelectContent">
|
|
116
|
+
<RadixSelect.Viewport className="RadixSelectViewport">
|
|
117
|
+
{options.map(option => (
|
|
118
|
+
<StyledItem
|
|
119
|
+
key={option.value}
|
|
120
|
+
value={option.value}>
|
|
121
|
+
<Plus width={20} />
|
|
122
|
+
{option.label}
|
|
123
|
+
</StyledItem>
|
|
124
|
+
))}
|
|
125
|
+
</RadixSelect.Viewport>
|
|
126
|
+
</StyledContent>
|
|
127
|
+
</RadixSelect.Root>
|
|
128
|
+
) : (
|
|
129
|
+
<TextField
|
|
130
|
+
leftIcon={leftIcon}
|
|
131
|
+
rightIcon={<CaretDown weight="fill" size={14} />}
|
|
132
|
+
label={label}
|
|
133
|
+
size={size}
|
|
134
|
+
disabled
|
|
135
|
+
/>
|
|
136
|
+
)}
|
|
137
|
+
{(helperText || error) && (
|
|
138
|
+
<HelperText>{error?.message || helperText}</HelperText>
|
|
139
|
+
)}
|
|
140
|
+
</Wrapper>
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
export default Select
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { FieldValues, UseFormRegisterReturn } from 'react-hook-form'
|
|
2
|
-
export interface SelectProps<TFieldValues extends FieldValues = FieldValues> {
|
|
3
|
-
className?: string
|
|
4
|
-
disabled?: boolean
|
|
5
|
-
error?: TFieldValues
|
|
6
|
-
label: string
|
|
7
|
-
options: Array<{ label: string; value: string }>
|
|
8
|
-
value?: string
|
|
9
|
-
defaultValue?: string
|
|
10
|
-
handleLeftIcon?: () => void
|
|
11
|
-
helperText?: string
|
|
12
|
-
leftIcon?: React.ReactNode
|
|
13
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
14
|
-
size?: 'sm' | 'md' | 'lg'
|
|
15
|
-
register?: UseFormRegisterReturn<string>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface StateInterface {
|
|
19
|
-
input: string
|
|
20
|
-
label: string
|
|
21
|
-
helperText: string
|
|
22
|
-
animation?: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TextFieldStates {
|
|
26
|
-
error: StateInterface
|
|
27
|
-
default: StateInterface
|
|
28
|
-
disabled: StateInterface
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type TextFieldSize = 'sm' | 'md' | 'lg'
|
|
32
|
-
|
|
33
|
-
export type TextFieldSizeType = {
|
|
34
|
-
input: string
|
|
35
|
-
label: string
|
|
36
|
-
}
|
|
1
|
+
import { FieldValues, UseFormRegisterReturn } from 'react-hook-form'
|
|
2
|
+
export interface SelectProps<TFieldValues extends FieldValues = FieldValues> {
|
|
3
|
+
className?: string
|
|
4
|
+
disabled?: boolean
|
|
5
|
+
error?: TFieldValues
|
|
6
|
+
label: string
|
|
7
|
+
options: Array<{ label: string; value: string }>
|
|
8
|
+
value?: string
|
|
9
|
+
defaultValue?: string
|
|
10
|
+
handleLeftIcon?: () => void
|
|
11
|
+
helperText?: string
|
|
12
|
+
leftIcon?: React.ReactNode
|
|
13
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
|
|
14
|
+
size?: 'sm' | 'md' | 'lg'
|
|
15
|
+
register?: UseFormRegisterReturn<string>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StateInterface {
|
|
19
|
+
input: string
|
|
20
|
+
label: string
|
|
21
|
+
helperText: string
|
|
22
|
+
animation?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TextFieldStates {
|
|
26
|
+
error: StateInterface
|
|
27
|
+
default: StateInterface
|
|
28
|
+
disabled: StateInterface
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type TextFieldSize = 'sm' | 'md' | 'lg'
|
|
32
|
+
|
|
33
|
+
export type TextFieldSizeType = {
|
|
34
|
+
input: string
|
|
35
|
+
label: string
|
|
36
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Select'
|
|
1
|
+
export { default } from './Select'
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { parseColor } from '../../utils'
|
|
2
|
-
import styled, { css } from 'styled-components'
|
|
3
|
-
import {
|
|
4
|
-
fontSize,
|
|
5
|
-
fontWeight,
|
|
6
|
-
lineHeight,
|
|
7
|
-
fontFamily
|
|
8
|
-
} from '@liguelead/foundation'
|
|
9
|
-
import { TextProps } from './Text.types'
|
|
10
|
-
|
|
11
|
-
type BodyProps = Omit<TextProps, 'tag'>
|
|
12
|
-
|
|
13
|
-
const Body = styled.p.withConfig({
|
|
14
|
-
shouldForwardProp: prop =>
|
|
15
|
-
!['color', 'margin', 'isTitle', 'size', 'align', 'weight'].includes(
|
|
16
|
-
prop
|
|
17
|
-
)
|
|
18
|
-
})<BodyProps>`
|
|
19
|
-
position: relative;
|
|
20
|
-
|
|
21
|
-
${({
|
|
22
|
-
align = 'left',
|
|
23
|
-
color = 'neutral800',
|
|
24
|
-
isTitle,
|
|
25
|
-
theme,
|
|
26
|
-
size = 'body01'
|
|
27
|
-
}) => css`
|
|
28
|
-
text-align: ${align};
|
|
29
|
-
color: ${parseColor(theme.colors[color] || theme.colors.neutral800)};
|
|
30
|
-
font-family: '${isTitle
|
|
31
|
-
? fontFamily[theme.fonts.headings]
|
|
32
|
-
: fontFamily[theme.fonts.default]}',
|
|
33
|
-
sans-serif;
|
|
34
|
-
font-weight: ${fontWeight[theme.typography[size]?.fontWeight] ||
|
|
35
|
-
'normal'};
|
|
36
|
-
font-size: ${fontSize[theme.typography[size]?.fontSize] ||
|
|
37
|
-
fontSize.fontSize16}px;
|
|
38
|
-
line-height: ${lineHeight[theme.typography[size]?.lineHeight] ||
|
|
39
|
-
lineHeight.lineHeight24}px;
|
|
40
|
-
`}
|
|
41
|
-
`
|
|
42
|
-
|
|
43
|
-
export { Body }
|
|
1
|
+
import { parseColor } from '../../utils'
|
|
2
|
+
import styled, { css } from 'styled-components'
|
|
3
|
+
import {
|
|
4
|
+
fontSize,
|
|
5
|
+
fontWeight,
|
|
6
|
+
lineHeight,
|
|
7
|
+
fontFamily
|
|
8
|
+
} from '@liguelead/foundation'
|
|
9
|
+
import { TextProps } from './Text.types'
|
|
10
|
+
|
|
11
|
+
type BodyProps = Omit<TextProps, 'tag'>
|
|
12
|
+
|
|
13
|
+
const Body = styled.p.withConfig({
|
|
14
|
+
shouldForwardProp: prop =>
|
|
15
|
+
!['color', 'margin', 'isTitle', 'size', 'align', 'weight'].includes(
|
|
16
|
+
prop
|
|
17
|
+
)
|
|
18
|
+
})<BodyProps>`
|
|
19
|
+
position: relative;
|
|
20
|
+
|
|
21
|
+
${({
|
|
22
|
+
align = 'left',
|
|
23
|
+
color = 'neutral800',
|
|
24
|
+
isTitle,
|
|
25
|
+
theme,
|
|
26
|
+
size = 'body01'
|
|
27
|
+
}) => css`
|
|
28
|
+
text-align: ${align};
|
|
29
|
+
color: ${parseColor(theme.colors[color] || theme.colors.neutral800)};
|
|
30
|
+
font-family: '${isTitle
|
|
31
|
+
? fontFamily[theme.fonts.headings]
|
|
32
|
+
: fontFamily[theme.fonts.default]}',
|
|
33
|
+
sans-serif;
|
|
34
|
+
font-weight: ${fontWeight[theme.typography[size]?.fontWeight] ||
|
|
35
|
+
'normal'};
|
|
36
|
+
font-size: ${fontSize[theme.typography[size]?.fontSize] ||
|
|
37
|
+
fontSize.fontSize16}px;
|
|
38
|
+
line-height: ${lineHeight[theme.typography[size]?.lineHeight] ||
|
|
39
|
+
lineHeight.lineHeight24}px;
|
|
40
|
+
`}
|
|
41
|
+
`
|
|
42
|
+
|
|
43
|
+
export { Body }
|
package/components/Text/Text.tsx
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Body } from './Text.styles'
|
|
3
|
-
import { TextProps } from './Text.types'
|
|
4
|
-
|
|
5
|
-
const Text: React.FC<TextProps> = ({
|
|
6
|
-
align,
|
|
7
|
-
children,
|
|
8
|
-
color = 'neutral1000',
|
|
9
|
-
isTitle = false,
|
|
10
|
-
tag = 'p',
|
|
11
|
-
size,
|
|
12
|
-
...rest
|
|
13
|
-
}) => {
|
|
14
|
-
return (
|
|
15
|
-
<Body
|
|
16
|
-
as={isTitle ? 'h2' : tag}
|
|
17
|
-
align={align}
|
|
18
|
-
color={color}
|
|
19
|
-
size={size}
|
|
20
|
-
isTitle={isTitle}
|
|
21
|
-
{...rest}>
|
|
22
|
-
{children}
|
|
23
|
-
</Body>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default Text
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Body } from './Text.styles'
|
|
3
|
+
import { TextProps } from './Text.types'
|
|
4
|
+
|
|
5
|
+
const Text: React.FC<TextProps> = ({
|
|
6
|
+
align,
|
|
7
|
+
children,
|
|
8
|
+
color = 'neutral1000',
|
|
9
|
+
isTitle = false,
|
|
10
|
+
tag = 'p',
|
|
11
|
+
size,
|
|
12
|
+
...rest
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<Body
|
|
16
|
+
as={isTitle ? 'h2' : tag}
|
|
17
|
+
align={align}
|
|
18
|
+
color={color}
|
|
19
|
+
size={size}
|
|
20
|
+
isTitle={isTitle}
|
|
21
|
+
{...rest}>
|
|
22
|
+
{children}
|
|
23
|
+
</Body>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default Text
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { colorType } from 'types'
|
|
2
|
-
import { ReactNode } from 'react'
|
|
3
|
-
|
|
4
|
-
type AlignType = 'left' | 'center' | 'right' | 'justify'
|
|
5
|
-
|
|
6
|
-
type SizeType =
|
|
7
|
-
| 'span01'
|
|
8
|
-
| 'body01'
|
|
9
|
-
| 'body02'
|
|
10
|
-
| 'heading01'
|
|
11
|
-
| 'heading02'
|
|
12
|
-
| 'heading03'
|
|
13
|
-
| 'heading04'
|
|
14
|
-
|
|
15
|
-
type TagType =
|
|
16
|
-
| 'h1'
|
|
17
|
-
| 'h2'
|
|
18
|
-
| 'h3'
|
|
19
|
-
| 'h4'
|
|
20
|
-
| 'h5'
|
|
21
|
-
| 'h6'
|
|
22
|
-
| 'p'
|
|
23
|
-
| 'span'
|
|
24
|
-
| 'label'
|
|
25
|
-
| 'small'
|
|
26
|
-
| 'b'
|
|
27
|
-
| 'i'
|
|
28
|
-
| 'em'
|
|
29
|
-
| 'td'
|
|
30
|
-
| 'div'
|
|
31
|
-
| 'a'
|
|
32
|
-
|
|
33
|
-
export interface TextProps {
|
|
34
|
-
align?: AlignType
|
|
35
|
-
children?: ReactNode
|
|
36
|
-
color?: colorType
|
|
37
|
-
isTitle?: boolean
|
|
38
|
-
tag?: TagType
|
|
39
|
-
size?: SizeType
|
|
40
|
-
weight?: string
|
|
41
|
-
className?: string
|
|
42
|
-
}
|
|
1
|
+
import { colorType } from 'types'
|
|
2
|
+
import { ReactNode } from 'react'
|
|
3
|
+
|
|
4
|
+
type AlignType = 'left' | 'center' | 'right' | 'justify'
|
|
5
|
+
|
|
6
|
+
type SizeType =
|
|
7
|
+
| 'span01'
|
|
8
|
+
| 'body01'
|
|
9
|
+
| 'body02'
|
|
10
|
+
| 'heading01'
|
|
11
|
+
| 'heading02'
|
|
12
|
+
| 'heading03'
|
|
13
|
+
| 'heading04'
|
|
14
|
+
|
|
15
|
+
type TagType =
|
|
16
|
+
| 'h1'
|
|
17
|
+
| 'h2'
|
|
18
|
+
| 'h3'
|
|
19
|
+
| 'h4'
|
|
20
|
+
| 'h5'
|
|
21
|
+
| 'h6'
|
|
22
|
+
| 'p'
|
|
23
|
+
| 'span'
|
|
24
|
+
| 'label'
|
|
25
|
+
| 'small'
|
|
26
|
+
| 'b'
|
|
27
|
+
| 'i'
|
|
28
|
+
| 'em'
|
|
29
|
+
| 'td'
|
|
30
|
+
| 'div'
|
|
31
|
+
| 'a'
|
|
32
|
+
|
|
33
|
+
export interface TextProps {
|
|
34
|
+
align?: AlignType
|
|
35
|
+
children?: ReactNode
|
|
36
|
+
color?: colorType
|
|
37
|
+
isTitle?: boolean
|
|
38
|
+
tag?: TagType
|
|
39
|
+
size?: SizeType
|
|
40
|
+
weight?: string
|
|
41
|
+
className?: string
|
|
42
|
+
}
|
package/components/Text/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Text'
|
|
1
|
+
export { default } from './Text'
|