@channel.io/bezier-react 3.1.2 → 3.1.4
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/dist/cjs/components/AlphaAvatar/Avatar.js +0 -2
- package/dist/cjs/components/AlphaAvatar/Avatar.js.map +1 -1
- package/dist/cjs/components/Avatar/Avatar.js +0 -2
- package/dist/cjs/components/Avatar/Avatar.js.map +1 -1
- package/dist/cjs/components/Badge/Badge.js +0 -1
- package/dist/cjs/components/Badge/Badge.js.map +1 -1
- package/dist/cjs/components/Checkbox/Checkbox.js +2 -0
- package/dist/cjs/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/cjs/components/Divider/Divider.js +1 -1
- package/dist/cjs/components/Divider/Divider.js.map +1 -1
- package/dist/cjs/components/Emoji/Emoji.js +0 -1
- package/dist/cjs/components/Emoji/Emoji.js.map +1 -1
- package/dist/cjs/components/FormControl/FormControl.js +0 -1
- package/dist/cjs/components/FormControl/FormControl.js.map +1 -1
- package/dist/cjs/components/FormHelperText/FormHelperText.js +4 -2
- package/dist/cjs/components/FormHelperText/FormHelperText.js.map +1 -1
- package/dist/cjs/components/NavGroup/NavGroup.js +4 -2
- package/dist/cjs/components/NavGroup/NavGroup.js.map +1 -1
- package/dist/cjs/components/NavItem/NavItem.js +4 -2
- package/dist/cjs/components/NavItem/NavItem.js.map +1 -1
- package/dist/cjs/components/SegmentedControl/SegmentedControl.js +10 -3
- package/dist/cjs/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js +0 -1
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Tag/Tag.js +5 -2
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +5 -2
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/esm/components/AlphaAvatar/Avatar.mjs +1 -1
- package/dist/esm/components/AlphaAvatar/Avatar.mjs.map +1 -1
- package/dist/esm/components/Avatar/Avatar.mjs +1 -1
- package/dist/esm/components/Avatar/Avatar.mjs.map +1 -1
- package/dist/esm/components/Badge/Badge.mjs +1 -1
- package/dist/esm/components/Badge/Badge.mjs.map +1 -1
- package/dist/esm/components/Checkbox/Checkbox.mjs +2 -0
- package/dist/esm/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/esm/components/Divider/Divider.mjs +2 -1
- package/dist/esm/components/Divider/Divider.mjs.map +1 -1
- package/dist/esm/components/Emoji/Emoji.mjs +1 -1
- package/dist/esm/components/Emoji/Emoji.mjs.map +1 -1
- package/dist/esm/components/FormControl/FormControl.mjs +1 -1
- package/dist/esm/components/FormControl/FormControl.mjs.map +1 -1
- package/dist/esm/components/FormHelperText/FormHelperText.mjs +5 -1
- package/dist/esm/components/FormHelperText/FormHelperText.mjs.map +1 -1
- package/dist/esm/components/NavGroup/NavGroup.mjs +5 -1
- package/dist/esm/components/NavGroup/NavGroup.mjs.map +1 -1
- package/dist/esm/components/NavItem/NavItem.mjs +5 -1
- package/dist/esm/components/NavItem/NavItem.mjs.map +1 -1
- package/dist/esm/components/SegmentedControl/SegmentedControl.mjs +10 -3
- package/dist/esm/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
- package/dist/esm/components/Switch/Switch.mjs +1 -1
- package/dist/esm/components/Switch/Switch.mjs.map +1 -1
- package/dist/esm/components/Tag/Tag.mjs +6 -1
- package/dist/esm/components/Tag/Tag.mjs.map +1 -1
- package/dist/esm/components/TextField/TextField.mjs +6 -1
- package/dist/esm/components/TextField/TextField.mjs.map +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/types/components/AlphaAvatar/Avatar.d.ts +0 -2
- package/dist/types/components/AlphaAvatar/Avatar.d.ts.map +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +0 -2
- package/dist/types/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/types/components/Badge/Badge.d.ts +0 -1
- package/dist/types/components/Badge/Badge.d.ts.map +1 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts +2 -1
- package/dist/types/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/types/components/Divider/Divider.d.ts +0 -1
- package/dist/types/components/Divider/Divider.d.ts.map +1 -1
- package/dist/types/components/Emoji/Emoji.d.ts +0 -1
- package/dist/types/components/Emoji/Emoji.d.ts.map +1 -1
- package/dist/types/components/FormControl/FormControl.d.ts +0 -1
- package/dist/types/components/FormControl/FormControl.d.ts.map +1 -1
- package/dist/types/components/FormHelperText/FormHelperText.d.ts +0 -2
- package/dist/types/components/FormHelperText/FormHelperText.d.ts.map +1 -1
- package/dist/types/components/NavGroup/NavGroup.d.ts +0 -2
- package/dist/types/components/NavGroup/NavGroup.d.ts.map +1 -1
- package/dist/types/components/NavItem/NavItem.d.ts +0 -2
- package/dist/types/components/NavItem/NavItem.d.ts.map +1 -1
- package/dist/types/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/types/components/Switch/Switch.d.ts +0 -1
- package/dist/types/components/Switch/Switch.d.ts.map +1 -1
- package/dist/types/components/Tag/Tag.d.ts +0 -2
- package/dist/types/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/components/TextField/TextField.d.ts +0 -2
- package/dist/types/components/TextField/TextField.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/components/AlphaAvatar/Avatar.test.tsx +1 -71
- package/src/components/AlphaAvatar/Avatar.tsx +2 -2
- package/src/components/AlphaAvatarGroup/AvatarGroup.test.tsx +0 -12
- package/src/components/Avatar/Avatar.test.tsx +1 -71
- package/src/components/Avatar/Avatar.tsx +2 -2
- package/src/components/AvatarGroup/AvatarGroup.test.tsx +0 -12
- package/src/components/Badge/Badge.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +6 -1
- package/src/components/Divider/Divider.test.tsx +11 -12
- package/src/components/Divider/Divider.tsx +5 -1
- package/src/components/Emoji/Emoji.tsx +4 -1
- package/src/components/FormControl/FormControl.test.tsx +1 -39
- package/src/components/FormControl/FormControl.tsx +1 -1
- package/src/components/FormHelperText/FormHelperText.test.tsx +11 -30
- package/src/components/FormHelperText/FormHelperText.tsx +9 -2
- package/src/components/FormLabel/FormLabel.test.tsx +0 -7
- package/src/components/Help/Help.test.tsx +0 -14
- package/src/components/LegacyTooltip/LegacyTooltip.test.tsx +0 -12
- package/src/components/Modal/Modal.test.tsx +8 -1
- package/src/components/NavGroup/NavGroup.tsx +9 -2
- package/src/components/NavItem/NavItem.tsx +9 -2
- package/src/components/SegmentedControl/SegmentedControl.module.scss +1 -1
- package/src/components/SegmentedControl/SegmentedControl.tsx +16 -3
- package/src/components/Slider/Slider.test.tsx +1 -8
- package/src/components/SmoothCornersBox/SmoothCornersBox.test.tsx +0 -5
- package/src/components/Switch/Switch.test.tsx +17 -17
- package/src/components/Switch/Switch.tsx +4 -1
- package/src/components/Tag/Tag.test.tsx +11 -15
- package/src/components/Tag/Tag.tsx +10 -2
- package/src/components/TextField/TextField.test.tsx +5 -5
- package/src/components/TextField/TextField.tsx +10 -2
- package/src/components/AlphaAvatar/__snapshots__/Avatar.test.tsx.snap +0 -93
- package/src/components/AlphaAvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap +0 -215
- package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +0 -93
- package/src/components/AvatarGroup/__snapshots__/AvatarGroup.test.tsx.snap +0 -215
- package/src/components/Badge/Badge.test.tsx +0 -27
- package/src/components/Badge/__snapshots__/Badge.test.tsx.snap +0 -8
- package/src/components/Emoji/Emoji.test.tsx +0 -32
- package/src/components/Emoji/__snapshots__/Emoji.test.tsx.snap +0 -11
- package/src/components/FormControl/__snapshots__/FormControl.test.tsx.snap +0 -249
- package/src/components/FormGroup/FormGroup.test.tsx +0 -24
- package/src/components/FormGroup/__snapshots__/FormGroup.test.tsx.snap +0 -10
- package/src/components/FormHelperText/__snapshots__/FormHelperText.test.tsx.snap +0 -24
- package/src/components/FormLabel/__snapshots__/FormLabel.test.tsx.snap +0 -11
- package/src/components/Help/__snapshots__/Help.test.tsx.snap +0 -21
- package/src/components/LegacyTooltip/__snapshots__/LegacyTooltip.test.tsx.snap +0 -37
- package/src/components/NavGroup/NavGroup.test.tsx +0 -75
- package/src/components/NavGroup/__snapshots__/NavGroup.test.tsx.snap +0 -121
- package/src/components/NavItem/NavItem.test.tsx +0 -66
- package/src/components/NavItem/__snapshots__/NavItem.test.tsx.snap +0 -75
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +0 -50
- package/src/components/SmoothCornersBox/__snapshots__/SmoothCornersBox.test.tsx.snap +0 -11
- package/src/components/Tag/__snapshots__/Tag.test.tsx.snap +0 -8
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { render } from '~/src/utils/test'
|
|
2
|
-
|
|
3
|
-
import { EMOJI_TEST_ID, Emoji } from './Emoji'
|
|
4
|
-
import { type EmojiProps } from './Emoji.types'
|
|
5
|
-
|
|
6
|
-
describe('Emoji Test >', () => {
|
|
7
|
-
const defaultProps: EmojiProps = { size: '24', name: 'a' }
|
|
8
|
-
|
|
9
|
-
const renderComponent = (props?: Partial<EmojiProps>) =>
|
|
10
|
-
render(
|
|
11
|
-
<Emoji
|
|
12
|
-
{...defaultProps}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
it('snapshot', () => {
|
|
18
|
-
const { getByTestId } = renderComponent()
|
|
19
|
-
const emoji = getByTestId(EMOJI_TEST_ID)
|
|
20
|
-
|
|
21
|
-
expect(emoji).toMatchSnapshot()
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('should render with emoji image', () => {
|
|
25
|
-
const { getByTestId } = renderComponent()
|
|
26
|
-
const emoji = getByTestId(EMOJI_TEST_ID)
|
|
27
|
-
|
|
28
|
-
expect(emoji).toHaveStyle(
|
|
29
|
-
'background-image: var(--b-emoji-background-image)'
|
|
30
|
-
)
|
|
31
|
-
})
|
|
32
|
-
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Emoji Test > snapshot 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
aria-description="a"
|
|
6
|
-
class="Emoji size-24"
|
|
7
|
-
data-testid="bezier-emoji"
|
|
8
|
-
role="img"
|
|
9
|
-
style="--b-emoji-background-image: url(https://cf.exp.channel.io/asset/emoji/images/80/a.png);"
|
|
10
|
-
/>
|
|
11
|
-
`;
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`FormControl > Snapshot > With multiple field 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="Stack display-flex direction-vertical margin layout"
|
|
7
|
-
data-testid="bezier-form-control"
|
|
8
|
-
>
|
|
9
|
-
<label
|
|
10
|
-
class="Text typo-13 bold align-left margin LabelText FormLabelWrapper position-top size-m"
|
|
11
|
-
data-testid="bezier-form-label"
|
|
12
|
-
id="form-label"
|
|
13
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
14
|
-
>
|
|
15
|
-
Label
|
|
16
|
-
</label>
|
|
17
|
-
<div
|
|
18
|
-
aria-describedby="form-help-text"
|
|
19
|
-
aria-labelledby="form-label"
|
|
20
|
-
class="Stack display-flex direction-vertical justify-start align-stretch wrap margin layout"
|
|
21
|
-
data-testid="bezier-form-group"
|
|
22
|
-
id="form-group"
|
|
23
|
-
role="group"
|
|
24
|
-
style="--b-stack-spacing: 6px;"
|
|
25
|
-
>
|
|
26
|
-
<div
|
|
27
|
-
class="Stack display-flex direction-vertical margin layout"
|
|
28
|
-
data-testid="bezier-form-control"
|
|
29
|
-
>
|
|
30
|
-
<label
|
|
31
|
-
class="Text typo-13 bold align-left margin LabelText FormLabelWrapper position-top size-m"
|
|
32
|
-
data-testid="bezier-form-label"
|
|
33
|
-
for="field-:r3:"
|
|
34
|
-
id="field-:r3:-label"
|
|
35
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
36
|
-
>
|
|
37
|
-
First Inner Label
|
|
38
|
-
</label>
|
|
39
|
-
<div
|
|
40
|
-
class="TextFieldWrapper variant-primary size-m size-m"
|
|
41
|
-
data-testid="bezier-text-input"
|
|
42
|
-
>
|
|
43
|
-
<input
|
|
44
|
-
autocomplete="off"
|
|
45
|
-
class="TextFieldInput"
|
|
46
|
-
id="field-:r3:"
|
|
47
|
-
size="36"
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
<div
|
|
52
|
-
class="Stack display-flex direction-vertical margin layout"
|
|
53
|
-
data-testid="bezier-form-control"
|
|
54
|
-
>
|
|
55
|
-
<label
|
|
56
|
-
class="Text typo-13 bold align-left margin LabelText FormLabelWrapper position-top size-m"
|
|
57
|
-
data-testid="bezier-form-label"
|
|
58
|
-
for="field-:r4:"
|
|
59
|
-
id="field-:r4:-label"
|
|
60
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
61
|
-
>
|
|
62
|
-
Second Inner Label
|
|
63
|
-
</label>
|
|
64
|
-
<div
|
|
65
|
-
class="TextFieldWrapper variant-primary size-m size-m"
|
|
66
|
-
data-testid="bezier-text-input"
|
|
67
|
-
>
|
|
68
|
-
<input
|
|
69
|
-
aria-invalid="true"
|
|
70
|
-
autocomplete="off"
|
|
71
|
-
class="TextFieldInput"
|
|
72
|
-
id="field-:r4:"
|
|
73
|
-
size="36"
|
|
74
|
-
/>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
<p
|
|
79
|
-
class="Text typo-13 align-left margin FormHelperText FormHelperTextWrapper"
|
|
80
|
-
data-testid="bezier-form-helper-text"
|
|
81
|
-
id="form-help-text"
|
|
82
|
-
style="--b-text-color: var(--txt-black-dark);"
|
|
83
|
-
>
|
|
84
|
-
Description
|
|
85
|
-
</p>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
exports[`FormControl > Snapshot > With multiple field and left label position 1`] = `
|
|
91
|
-
<div>
|
|
92
|
-
<div
|
|
93
|
-
class="Grid"
|
|
94
|
-
data-testid="bezier-form-control"
|
|
95
|
-
>
|
|
96
|
-
<label
|
|
97
|
-
class="Text typo-14 bold align-left margin LabelText FormLabelWrapper position-left size-m"
|
|
98
|
-
data-testid="bezier-form-label"
|
|
99
|
-
id="form-label"
|
|
100
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
101
|
-
>
|
|
102
|
-
Label
|
|
103
|
-
</label>
|
|
104
|
-
<div
|
|
105
|
-
aria-describedby="form-help-text"
|
|
106
|
-
aria-labelledby="form-label"
|
|
107
|
-
class="Stack display-flex direction-vertical justify-start align-stretch wrap margin layout"
|
|
108
|
-
data-testid="bezier-form-group"
|
|
109
|
-
id="form-group"
|
|
110
|
-
role="group"
|
|
111
|
-
style="--b-stack-spacing: 6px;"
|
|
112
|
-
>
|
|
113
|
-
<div
|
|
114
|
-
class="Stack display-flex direction-vertical margin layout"
|
|
115
|
-
data-testid="bezier-form-control"
|
|
116
|
-
>
|
|
117
|
-
<label
|
|
118
|
-
class="Text typo-13 bold align-left margin LabelText FormLabelWrapper position-top size-m"
|
|
119
|
-
data-testid="bezier-form-label"
|
|
120
|
-
for="field-:r6:"
|
|
121
|
-
id="field-:r6:-label"
|
|
122
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
123
|
-
>
|
|
124
|
-
First Inner Label
|
|
125
|
-
</label>
|
|
126
|
-
<div
|
|
127
|
-
class="TextFieldWrapper variant-primary size-m size-m"
|
|
128
|
-
data-testid="bezier-text-input"
|
|
129
|
-
>
|
|
130
|
-
<input
|
|
131
|
-
autocomplete="off"
|
|
132
|
-
class="TextFieldInput"
|
|
133
|
-
id="field-:r6:"
|
|
134
|
-
size="36"
|
|
135
|
-
/>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
<div
|
|
139
|
-
class="Stack display-flex direction-vertical margin layout"
|
|
140
|
-
data-testid="bezier-form-control"
|
|
141
|
-
>
|
|
142
|
-
<label
|
|
143
|
-
class="Text typo-13 bold align-left margin LabelText FormLabelWrapper position-top size-m"
|
|
144
|
-
data-testid="bezier-form-label"
|
|
145
|
-
for="field-:r7:"
|
|
146
|
-
id="field-:r7:-label"
|
|
147
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
148
|
-
>
|
|
149
|
-
Second Inner Label
|
|
150
|
-
</label>
|
|
151
|
-
<div
|
|
152
|
-
class="TextFieldWrapper variant-primary size-m size-m"
|
|
153
|
-
data-testid="bezier-text-input"
|
|
154
|
-
>
|
|
155
|
-
<input
|
|
156
|
-
aria-invalid="true"
|
|
157
|
-
autocomplete="off"
|
|
158
|
-
class="TextFieldInput"
|
|
159
|
-
id="field-:r7:"
|
|
160
|
-
size="36"
|
|
161
|
-
/>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
<p
|
|
166
|
-
class="Text typo-13 align-left margin FormHelperText FormHelperTextWrapper position-left"
|
|
167
|
-
data-testid="bezier-form-helper-text"
|
|
168
|
-
id="form-help-text"
|
|
169
|
-
style="--b-text-color: var(--txt-black-dark);"
|
|
170
|
-
>
|
|
171
|
-
Description
|
|
172
|
-
</p>
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
`;
|
|
176
|
-
|
|
177
|
-
exports[`FormControl > Snapshot > With single field 1`] = `
|
|
178
|
-
<div
|
|
179
|
-
class="Stack display-flex direction-vertical margin layout"
|
|
180
|
-
data-testid="bezier-form-control"
|
|
181
|
-
>
|
|
182
|
-
<label
|
|
183
|
-
class="Text typo-13 bold align-left margin LabelText FormLabelWrapper position-top size-m"
|
|
184
|
-
data-testid="bezier-form-label"
|
|
185
|
-
for="form"
|
|
186
|
-
id="form-label"
|
|
187
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
188
|
-
>
|
|
189
|
-
Label
|
|
190
|
-
</label>
|
|
191
|
-
<div
|
|
192
|
-
class="TextFieldWrapper variant-primary size-m size-m"
|
|
193
|
-
data-testid="bezier-text-input"
|
|
194
|
-
>
|
|
195
|
-
<input
|
|
196
|
-
aria-describedby="form-help-text"
|
|
197
|
-
autocomplete="off"
|
|
198
|
-
class="TextFieldInput"
|
|
199
|
-
id="form"
|
|
200
|
-
size="36"
|
|
201
|
-
/>
|
|
202
|
-
</div>
|
|
203
|
-
<p
|
|
204
|
-
class="Text typo-13 align-left margin FormHelperText FormHelperTextWrapper"
|
|
205
|
-
data-testid="bezier-form-helper-text"
|
|
206
|
-
id="form-help-text"
|
|
207
|
-
style="--b-text-color: var(--txt-black-dark);"
|
|
208
|
-
>
|
|
209
|
-
Description
|
|
210
|
-
</p>
|
|
211
|
-
</div>
|
|
212
|
-
`;
|
|
213
|
-
|
|
214
|
-
exports[`FormControl > Snapshot > With single field and left label position 1`] = `
|
|
215
|
-
<div
|
|
216
|
-
class="Grid"
|
|
217
|
-
data-testid="bezier-form-control"
|
|
218
|
-
>
|
|
219
|
-
<label
|
|
220
|
-
class="Text typo-14 bold align-left margin LabelText FormLabelWrapper position-left size-m"
|
|
221
|
-
data-testid="bezier-form-label"
|
|
222
|
-
for="form"
|
|
223
|
-
id="form-label"
|
|
224
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
225
|
-
>
|
|
226
|
-
Label
|
|
227
|
-
</label>
|
|
228
|
-
<div
|
|
229
|
-
class="TextFieldWrapper variant-primary size-m size-m"
|
|
230
|
-
data-testid="bezier-text-input"
|
|
231
|
-
>
|
|
232
|
-
<input
|
|
233
|
-
aria-describedby="form-help-text"
|
|
234
|
-
autocomplete="off"
|
|
235
|
-
class="TextFieldInput"
|
|
236
|
-
id="form"
|
|
237
|
-
size="36"
|
|
238
|
-
/>
|
|
239
|
-
</div>
|
|
240
|
-
<p
|
|
241
|
-
class="Text typo-13 align-left margin FormHelperText FormHelperTextWrapper position-left"
|
|
242
|
-
data-testid="bezier-form-helper-text"
|
|
243
|
-
id="form-help-text"
|
|
244
|
-
style="--b-text-color: var(--txt-black-dark);"
|
|
245
|
-
>
|
|
246
|
-
Description
|
|
247
|
-
</p>
|
|
248
|
-
</div>
|
|
249
|
-
`;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { render } from '~/src/utils/test'
|
|
2
|
-
|
|
3
|
-
import { FormGroup } from './FormGroup'
|
|
4
|
-
import { type FormGroupProps } from './FormGroup.types'
|
|
5
|
-
|
|
6
|
-
describe('FormGroup >', () => {
|
|
7
|
-
let props: FormGroupProps
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
props = {
|
|
11
|
-
spacing: 6,
|
|
12
|
-
direction: 'vertical',
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const renderComponent = () => render(<FormGroup {...props} />)
|
|
17
|
-
|
|
18
|
-
it('Snapshot >', () => {
|
|
19
|
-
const { getByRole } = renderComponent()
|
|
20
|
-
const rendered = getByRole('group')
|
|
21
|
-
|
|
22
|
-
expect(rendered).toMatchSnapshot()
|
|
23
|
-
})
|
|
24
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`FormGroup > Snapshot > 1`] = `
|
|
4
|
-
<div
|
|
5
|
-
class="Stack display-flex direction-vertical justify-start align-stretch wrap margin layout"
|
|
6
|
-
data-testid="bezier-form-group"
|
|
7
|
-
role="group"
|
|
8
|
-
style="--b-stack-spacing: 6px;"
|
|
9
|
-
/>
|
|
10
|
-
`;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`FormErrorMessage > Snapshot > 1`] = `
|
|
4
|
-
<p
|
|
5
|
-
aria-live="polite"
|
|
6
|
-
class="Text typo-13 align-left margin FormHelperText"
|
|
7
|
-
data-testid="bezier-form-error-message"
|
|
8
|
-
id="test"
|
|
9
|
-
style="--b-text-color: var(--bgtxt-orange-normal);"
|
|
10
|
-
>
|
|
11
|
-
Lorem ipsum
|
|
12
|
-
</p>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`FormHelperText > Snapshot > 1`] = `
|
|
16
|
-
<p
|
|
17
|
-
class="Text typo-13 align-left margin FormHelperText"
|
|
18
|
-
data-testid="bezier-form-helper-text"
|
|
19
|
-
id="test"
|
|
20
|
-
style="--b-text-color: var(--txt-black-dark);"
|
|
21
|
-
>
|
|
22
|
-
Lorem ipsum
|
|
23
|
-
</p>
|
|
24
|
-
`;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`FormLabel > Snapshot > 1`] = `
|
|
4
|
-
<label
|
|
5
|
-
class="Text typo-13 bold align-left margin LabelText"
|
|
6
|
-
data-testid="bezier-form-label"
|
|
7
|
-
style="--b-text-color: var(--txt-black-darkest);"
|
|
8
|
-
>
|
|
9
|
-
label
|
|
10
|
-
</label>
|
|
11
|
-
`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Help > Snapshot > 1`] = `
|
|
4
|
-
<svg
|
|
5
|
-
class="Icon size-xs margin Icon"
|
|
6
|
-
data-testid="bezier-help"
|
|
7
|
-
fill="none"
|
|
8
|
-
height="1em"
|
|
9
|
-
style="--b-icon-color: var(--txt-black-dark);"
|
|
10
|
-
viewBox="0 0 24 24"
|
|
11
|
-
width="1em"
|
|
12
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
-
>
|
|
14
|
-
<path
|
|
15
|
-
clip-rule="evenodd"
|
|
16
|
-
d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m.83 12.541h-1.9v-.708c0-1.156.625-2.24 1.672-2.9.867-.546 1.337-.939 1.337-1.447 0-1.014-1-1.561-1.94-1.561-1.035 0-1.942.73-1.942 1.56h-1.9c0-1.875 1.758-3.46 3.841-3.46 2.154 0 3.842 1.52 3.842 3.46 0 1.655-1.392 2.533-2.225 3.056-.236.15-.784.573-.784 1.292zm-.889 3.631a1.244 1.244 0 1 1 0-2.487 1.244 1.244 0 0 1 0 2.487"
|
|
17
|
-
fill="currentColor"
|
|
18
|
-
fill-rule="evenodd"
|
|
19
|
-
/>
|
|
20
|
-
</svg>
|
|
21
|
-
`;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Tooltip test > Tooltip with default props 1`] = `
|
|
4
|
-
<body>
|
|
5
|
-
<div>
|
|
6
|
-
<div
|
|
7
|
-
class="LegacyTooltip"
|
|
8
|
-
data-testid="bezier-tooltip"
|
|
9
|
-
>
|
|
10
|
-
Text
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
<div
|
|
14
|
-
class="LegacyTooltipContentWrapper"
|
|
15
|
-
data-bezier-theme="dark"
|
|
16
|
-
style="position: fixed; top: 4px; left: 0px; transform: translate(-50%, 0%);"
|
|
17
|
-
>
|
|
18
|
-
<div
|
|
19
|
-
class="LegacyTooltipContent"
|
|
20
|
-
data-testid="bezier-tooltip-content"
|
|
21
|
-
>
|
|
22
|
-
<span
|
|
23
|
-
class="Text typo-13 multi-line-truncated margin"
|
|
24
|
-
data-testid="bezier-text"
|
|
25
|
-
style="--b-text-color: var(--txt-black-darkest); --b-text-line-clamp: 20;"
|
|
26
|
-
>
|
|
27
|
-
<span
|
|
28
|
-
class="Text typo-14 margin"
|
|
29
|
-
data-testid="bezier-text"
|
|
30
|
-
>
|
|
31
|
-
Hovered
|
|
32
|
-
</span>
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</body>
|
|
37
|
-
`;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { DotIcon } from '@channel.io/bezier-icons'
|
|
2
|
-
|
|
3
|
-
import { render } from '~/src/utils/test'
|
|
4
|
-
|
|
5
|
-
import { Icon } from '~/src/components/Icon'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
NAV_GROUP_LEFT_ICON_TEST_ID,
|
|
9
|
-
NAV_GROUP_TEST_ID,
|
|
10
|
-
NavGroup,
|
|
11
|
-
} from './NavGroup'
|
|
12
|
-
import type { NavGroupProps } from './NavGroup.types'
|
|
13
|
-
|
|
14
|
-
describe('NavGroup Test >', () => {
|
|
15
|
-
let props: NavGroupProps
|
|
16
|
-
|
|
17
|
-
beforeEach(() => {
|
|
18
|
-
props = {
|
|
19
|
-
leftContent: DotIcon,
|
|
20
|
-
name: 'general',
|
|
21
|
-
content: 'test-content',
|
|
22
|
-
rightContent: (
|
|
23
|
-
<Icon
|
|
24
|
-
source={DotIcon}
|
|
25
|
-
size="xs"
|
|
26
|
-
color="bgtxt-orange-normal"
|
|
27
|
-
/>
|
|
28
|
-
),
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const renderNavItem = (optionProps?: Partial<NavGroupProps>) =>
|
|
33
|
-
render(
|
|
34
|
-
<NavGroup
|
|
35
|
-
{...props}
|
|
36
|
-
{...optionProps}
|
|
37
|
-
/>
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
describe('Snapshot >', () => {
|
|
41
|
-
it('Active', () => {
|
|
42
|
-
const { getByTestId } = renderNavItem({ active: true })
|
|
43
|
-
|
|
44
|
-
const rendered = getByTestId(NAV_GROUP_TEST_ID)
|
|
45
|
-
|
|
46
|
-
expect(rendered).toMatchSnapshot()
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('Not active', () => {
|
|
50
|
-
const { getByTestId } = renderNavItem({ active: false })
|
|
51
|
-
|
|
52
|
-
const rendered = getByTestId(NAV_GROUP_TEST_ID)
|
|
53
|
-
|
|
54
|
-
expect(rendered).toMatchSnapshot()
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
describe('LeftIcon Color', () => {
|
|
59
|
-
it('Icon color should be "bgtxt-blue-normal" when active prop is true', () => {
|
|
60
|
-
const { getByTestId } = renderNavItem({ active: true })
|
|
61
|
-
|
|
62
|
-
const rendered = getByTestId(NAV_GROUP_LEFT_ICON_TEST_ID)
|
|
63
|
-
|
|
64
|
-
expect(rendered).toHaveStyle('--b-icon-color: var(--bgtxt-blue-normal)')
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
it('Icon color should be "txt-black-dark" when active prop is false', () => {
|
|
68
|
-
const { getByTestId } = renderNavItem({ active: false })
|
|
69
|
-
|
|
70
|
-
const rendered = getByTestId(NAV_GROUP_LEFT_ICON_TEST_ID)
|
|
71
|
-
|
|
72
|
-
expect(rendered).toHaveStyle('--b-icon-color: var(--txt-black-dark)')
|
|
73
|
-
})
|
|
74
|
-
})
|
|
75
|
-
})
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`NavGroup Test > Snapshot > Active 1`] = `
|
|
4
|
-
<button
|
|
5
|
-
aria-controls="generalMenu"
|
|
6
|
-
aria-haspopup="false"
|
|
7
|
-
class="BaseButton Item active"
|
|
8
|
-
data-testid="bezier-nav-group"
|
|
9
|
-
role="menuitem"
|
|
10
|
-
type="button"
|
|
11
|
-
>
|
|
12
|
-
<div
|
|
13
|
-
class="LeftIconWrapper"
|
|
14
|
-
>
|
|
15
|
-
<svg
|
|
16
|
-
class="Icon size-s margin"
|
|
17
|
-
data-testid="bezier-nav-group-left-icon"
|
|
18
|
-
fill="none"
|
|
19
|
-
height="1em"
|
|
20
|
-
style="--b-icon-color: var(--bgtxt-blue-normal);"
|
|
21
|
-
viewBox="0 0 24 24"
|
|
22
|
-
width="1em"
|
|
23
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
24
|
-
>
|
|
25
|
-
<path
|
|
26
|
-
clip-rule="evenodd"
|
|
27
|
-
d="M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0"
|
|
28
|
-
fill="currentColor"
|
|
29
|
-
fill-rule="evenodd"
|
|
30
|
-
/>
|
|
31
|
-
</svg>
|
|
32
|
-
</div>
|
|
33
|
-
<span
|
|
34
|
-
class="Text typo-14 truncated margin"
|
|
35
|
-
data-testid="bezier-text"
|
|
36
|
-
>
|
|
37
|
-
test-content
|
|
38
|
-
</span>
|
|
39
|
-
<div
|
|
40
|
-
class="RightContentWrapper"
|
|
41
|
-
>
|
|
42
|
-
<svg
|
|
43
|
-
class="Icon size-xs margin"
|
|
44
|
-
data-testid="bezier-icon"
|
|
45
|
-
fill="none"
|
|
46
|
-
height="1em"
|
|
47
|
-
style="--b-icon-color: var(--bgtxt-orange-normal);"
|
|
48
|
-
viewBox="0 0 24 24"
|
|
49
|
-
width="1em"
|
|
50
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
-
>
|
|
52
|
-
<path
|
|
53
|
-
clip-rule="evenodd"
|
|
54
|
-
d="M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0"
|
|
55
|
-
fill="currentColor"
|
|
56
|
-
fill-rule="evenodd"
|
|
57
|
-
/>
|
|
58
|
-
</svg>
|
|
59
|
-
</div>
|
|
60
|
-
</button>
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
exports[`NavGroup Test > Snapshot > Not active 1`] = `
|
|
64
|
-
<button
|
|
65
|
-
aria-controls="generalMenu"
|
|
66
|
-
aria-haspopup="false"
|
|
67
|
-
class="BaseButton Item"
|
|
68
|
-
data-testid="bezier-nav-group"
|
|
69
|
-
role="menuitem"
|
|
70
|
-
type="button"
|
|
71
|
-
>
|
|
72
|
-
<div
|
|
73
|
-
class="LeftIconWrapper"
|
|
74
|
-
>
|
|
75
|
-
<svg
|
|
76
|
-
class="Icon size-s margin"
|
|
77
|
-
data-testid="bezier-nav-group-left-icon"
|
|
78
|
-
fill="none"
|
|
79
|
-
height="1em"
|
|
80
|
-
style="--b-icon-color: var(--txt-black-dark);"
|
|
81
|
-
viewBox="0 0 24 24"
|
|
82
|
-
width="1em"
|
|
83
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
84
|
-
>
|
|
85
|
-
<path
|
|
86
|
-
clip-rule="evenodd"
|
|
87
|
-
d="M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0"
|
|
88
|
-
fill="currentColor"
|
|
89
|
-
fill-rule="evenodd"
|
|
90
|
-
/>
|
|
91
|
-
</svg>
|
|
92
|
-
</div>
|
|
93
|
-
<span
|
|
94
|
-
class="Text typo-14 truncated margin"
|
|
95
|
-
data-testid="bezier-text"
|
|
96
|
-
>
|
|
97
|
-
test-content
|
|
98
|
-
</span>
|
|
99
|
-
<div
|
|
100
|
-
class="RightContentWrapper"
|
|
101
|
-
>
|
|
102
|
-
<svg
|
|
103
|
-
class="Icon size-xs margin"
|
|
104
|
-
data-testid="bezier-icon"
|
|
105
|
-
fill="none"
|
|
106
|
-
height="1em"
|
|
107
|
-
style="--b-icon-color: var(--bgtxt-orange-normal);"
|
|
108
|
-
viewBox="0 0 24 24"
|
|
109
|
-
width="1em"
|
|
110
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
111
|
-
>
|
|
112
|
-
<path
|
|
113
|
-
clip-rule="evenodd"
|
|
114
|
-
d="M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0"
|
|
115
|
-
fill="currentColor"
|
|
116
|
-
fill-rule="evenodd"
|
|
117
|
-
/>
|
|
118
|
-
</svg>
|
|
119
|
-
</div>
|
|
120
|
-
</button>
|
|
121
|
-
`;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { DotIcon } from '@channel.io/bezier-icons'
|
|
2
|
-
|
|
3
|
-
import { render } from '~/src/utils/test'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
NAV_ITEM_LEFT_ICON_TEST_ID,
|
|
7
|
-
NAV_ITEM_TEST_ID,
|
|
8
|
-
NavItem,
|
|
9
|
-
} from './NavItem'
|
|
10
|
-
import type { NavItemProps } from './NavItem.types'
|
|
11
|
-
|
|
12
|
-
describe('NavItem Test >', () => {
|
|
13
|
-
let props: NavItemProps
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
props = {
|
|
17
|
-
leftContent: DotIcon,
|
|
18
|
-
name: 'general',
|
|
19
|
-
content: 'test-content',
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const renderNavItem = (optionProps?: Partial<NavItemProps>) =>
|
|
24
|
-
render(
|
|
25
|
-
<NavItem
|
|
26
|
-
{...props}
|
|
27
|
-
{...optionProps}
|
|
28
|
-
/>
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
describe('Snapshot >', () => {
|
|
32
|
-
it('Active', () => {
|
|
33
|
-
const { getByTestId } = renderNavItem({ active: true })
|
|
34
|
-
|
|
35
|
-
const rendered = getByTestId(NAV_ITEM_TEST_ID)
|
|
36
|
-
|
|
37
|
-
expect(rendered).toMatchSnapshot()
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it('Not active', () => {
|
|
41
|
-
const { getByTestId } = renderNavItem({ active: false })
|
|
42
|
-
|
|
43
|
-
const rendered = getByTestId(NAV_ITEM_TEST_ID)
|
|
44
|
-
|
|
45
|
-
expect(rendered).toMatchSnapshot()
|
|
46
|
-
})
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
describe('LeftIcon Color', () => {
|
|
50
|
-
it('Icon color should be "bgtxt-blue-normal" when active prop is true', () => {
|
|
51
|
-
const { getByTestId } = renderNavItem({ active: true })
|
|
52
|
-
|
|
53
|
-
const rendered = getByTestId(NAV_ITEM_LEFT_ICON_TEST_ID)
|
|
54
|
-
|
|
55
|
-
expect(rendered).toHaveStyle('--b-icon-color: var(--bgtxt-blue-normal);')
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
it('Icon color should be "txt-black-dark" when active prop is false', () => {
|
|
59
|
-
const { getByTestId } = renderNavItem({ active: false })
|
|
60
|
-
|
|
61
|
-
const rendered = getByTestId(NAV_ITEM_LEFT_ICON_TEST_ID)
|
|
62
|
-
|
|
63
|
-
expect(rendered).toHaveStyle('--b-icon-color: var(--txt-black-dark);')
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
})
|