@charcoal-ui/react 6.1.0-beta.5 → 6.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/dist/components/Notification/NotificationRegion.cjs +11 -6
- package/dist/components/Notification/NotificationRegion.cjs.map +1 -1
- package/dist/components/Notification/NotificationRegion.d.ts +2 -1
- package/dist/components/Notification/NotificationRegion.d.ts.map +1 -1
- package/dist/components/Notification/NotificationRegion.js +12 -7
- package/dist/components/Notification/NotificationRegion.js.map +1 -1
- package/dist/components/Notification/Snackbar/index.d.ts +1 -0
- package/dist/components/Notification/Snackbar/index.d.ts.map +1 -1
- package/dist/components/Notification/Snackbar/index2.cjs.map +1 -1
- package/dist/components/Notification/Snackbar/index2.js.map +1 -1
- package/dist/components/Notification/types.d.ts +5 -0
- package/dist/components/Notification/types.d.ts.map +1 -1
- package/dist/components/TextField/index.d.ts +0 -2
- package/dist/components/TextField/index.d.ts.map +1 -1
- package/dist/components/TextField/index2.cjs.map +1 -1
- package/dist/components/TextField/index2.js.map +1 -1
- package/dist/index.css +1518 -1515
- package/dist/layered.css +1518 -1515
- package/dist/layered.css.map +1 -1
- package/package.json +4 -7
- package/src/components/Notification/NotificationRegion.browser.test.tsx +120 -0
- package/src/components/Notification/NotificationRegion.tsx +14 -8
- package/src/components/Notification/Snackbar/__snapshots__/index.css.snap +5 -6
- package/src/components/Notification/Snackbar/index.css +7 -6
- package/src/components/Notification/Snackbar/index.story.tsx +4 -1
- package/src/components/Notification/Snackbar/index.test.tsx +5 -2
- package/src/components/Notification/Snackbar/index.tsx +1 -0
- package/src/components/Notification/Toast/__snapshots__/index.css.snap +5 -5
- package/src/components/Notification/Toast/index.css +7 -5
- package/src/components/Notification/Toast/index.story.tsx +4 -1
- package/src/components/Notification/Toast/index.test.tsx +5 -2
- package/src/components/Notification/__snapshots__/layout.css.snap +8 -4
- package/src/components/Notification/layout.css +8 -4
- package/src/components/Notification/types.ts +5 -0
- package/src/components/TextField/index.tsx +0 -1
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
.charcoal-
|
|
1
|
+
.charcoal-notification-region {
|
|
2
2
|
--charcoal-snackbar-offset: 16px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.charcoal-snackbar-region[data-position='top'] {
|
|
6
6
|
--charcoal-snackbar-enter-offset: calc(-1 * var(--charcoal-space-30));
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
);
|
|
7
|
+
position: sticky;
|
|
8
|
+
top: calc(env(safe-area-inset-top, 0px) + var(--charcoal-snackbar-offset));
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.charcoal-snackbar-region[data-position='bottom'] {
|
|
13
12
|
--charcoal-snackbar-enter-offset: var(--charcoal-space-30);
|
|
13
|
+
position: fixed;
|
|
14
14
|
bottom: calc(
|
|
15
|
-
env(safe-area-inset-bottom, 0px) +
|
|
16
|
-
max(var(--charcoal-snackbar-offset), 16px)
|
|
15
|
+
env(safe-area-inset-bottom, 0px) + var(--charcoal-snackbar-offset)
|
|
17
16
|
);
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
.charcoal-
|
|
1
|
+
.charcoal-notification-region {
|
|
2
2
|
--charcoal-snackbar-offset: 16px;
|
|
3
|
+
}
|
|
3
4
|
|
|
5
|
+
.charcoal-snackbar-region {
|
|
4
6
|
&[data-position='top'] {
|
|
5
7
|
--charcoal-snackbar-enter-offset: calc(-1 * var(--charcoal-space-30));
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
);
|
|
9
|
+
position: sticky;
|
|
10
|
+
top: calc(env(safe-area-inset-top, 0px) + var(--charcoal-snackbar-offset));
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
&[data-position='bottom'] {
|
|
13
14
|
--charcoal-snackbar-enter-offset: var(--charcoal-space-30);
|
|
14
15
|
|
|
16
|
+
position: fixed;
|
|
15
17
|
bottom: calc(
|
|
16
|
-
env(safe-area-inset-bottom, 0px) +
|
|
17
|
-
max(var(--charcoal-snackbar-offset), 16px)
|
|
18
|
+
env(safe-area-inset-bottom, 0px) + var(--charcoal-snackbar-offset)
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -34,7 +34,6 @@ export default {
|
|
|
34
34
|
args: {
|
|
35
35
|
message: '保存しました',
|
|
36
36
|
position: 'bottom',
|
|
37
|
-
offset: 16,
|
|
38
37
|
duration: 5000,
|
|
39
38
|
order: 'queue',
|
|
40
39
|
dim: false,
|
|
@@ -50,6 +49,10 @@ export default {
|
|
|
50
49
|
control: { type: 'number', min: 0, step: 1 },
|
|
51
50
|
table: { category: 'Hook', defaultValue: { summary: '16' } },
|
|
52
51
|
},
|
|
52
|
+
headerOffset: {
|
|
53
|
+
control: { type: 'number', min: 0, step: 1 },
|
|
54
|
+
table: { category: 'Hook', defaultValue: { summary: '0' } },
|
|
55
|
+
},
|
|
53
56
|
duration: {
|
|
54
57
|
control: { type: 'number', min: 0, step: 500 },
|
|
55
58
|
description: '表示時間(ミリ秒)',
|
|
@@ -288,7 +288,7 @@ describe('Snackbar', () => {
|
|
|
288
288
|
action: <button type="button">取り消す</button>,
|
|
289
289
|
})
|
|
290
290
|
|
|
291
|
-
expect(
|
|
291
|
+
expect(document.querySelector('.charcoal-snackbar-region')).toHaveAttribute(
|
|
292
292
|
'data-position',
|
|
293
293
|
'bottom',
|
|
294
294
|
)
|
|
@@ -299,7 +299,10 @@ describe('Snackbar', () => {
|
|
|
299
299
|
|
|
300
300
|
show('保存しました')
|
|
301
301
|
|
|
302
|
-
expect(
|
|
302
|
+
expect(document.querySelector('.charcoal-snackbar-region')).toHaveAttribute(
|
|
303
|
+
'data-position',
|
|
304
|
+
'top',
|
|
305
|
+
)
|
|
303
306
|
})
|
|
304
307
|
|
|
305
308
|
it('supports a custom z-index and portal container', () => {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.charcoal-
|
|
1
|
+
.charcoal-notification-region {
|
|
2
2
|
--charcoal-toast-offset: 16px;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.charcoal-toast-region[data-position='top'] {
|
|
6
|
+
position: sticky;
|
|
6
7
|
--charcoal-toast-enter-offset: calc(-1 * var(--charcoal-space-30));
|
|
7
|
-
top: calc(
|
|
8
|
-
env(safe-area-inset-top, 0px) + max(var(--charcoal-toast-offset), 16px)
|
|
9
|
-
);
|
|
8
|
+
top: calc(env(safe-area-inset-top, 0px) + var(--charcoal-toast-offset));
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.charcoal-toast-region[data-position='bottom'] {
|
|
12
|
+
position: fixed;
|
|
13
13
|
--charcoal-toast-enter-offset: var(--charcoal-space-30);
|
|
14
14
|
bottom: calc(
|
|
15
|
-
env(safe-area-inset-bottom, 0px) +
|
|
15
|
+
env(safe-area-inset-bottom, 0px) + var(--charcoal-toast-offset)
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
.charcoal-
|
|
1
|
+
.charcoal-notification-region {
|
|
2
2
|
--charcoal-toast-offset: 16px;
|
|
3
|
+
}
|
|
3
4
|
|
|
5
|
+
.charcoal-toast-region {
|
|
4
6
|
&[data-position='top'] {
|
|
7
|
+
position: sticky;
|
|
5
8
|
--charcoal-toast-enter-offset: calc(-1 * var(--charcoal-space-30));
|
|
6
9
|
|
|
7
|
-
top: calc(
|
|
8
|
-
env(safe-area-inset-top, 0px) + max(var(--charcoal-toast-offset), 16px)
|
|
9
|
-
);
|
|
10
|
+
top: calc(env(safe-area-inset-top, 0px) + var(--charcoal-toast-offset));
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
&[data-position='bottom'] {
|
|
14
|
+
position: fixed;
|
|
13
15
|
--charcoal-toast-enter-offset: var(--charcoal-space-30);
|
|
14
16
|
|
|
15
17
|
bottom: calc(
|
|
16
|
-
env(safe-area-inset-bottom, 0px) +
|
|
18
|
+
env(safe-area-inset-bottom, 0px) + var(--charcoal-toast-offset)
|
|
17
19
|
);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -34,7 +34,6 @@ export default {
|
|
|
34
34
|
args: {
|
|
35
35
|
message: '保存しました',
|
|
36
36
|
position: 'top',
|
|
37
|
-
offset: 16,
|
|
38
37
|
duration: 5000,
|
|
39
38
|
order: 'queue',
|
|
40
39
|
zIndex: 20,
|
|
@@ -50,6 +49,10 @@ export default {
|
|
|
50
49
|
control: { type: 'number', min: 0, step: 1 },
|
|
51
50
|
table: { category: 'Hook', defaultValue: { summary: '16' } },
|
|
52
51
|
},
|
|
52
|
+
headerOffset: {
|
|
53
|
+
control: { type: 'number', min: 0, step: 1 },
|
|
54
|
+
table: { category: 'Hook', defaultValue: { summary: '0' } },
|
|
55
|
+
},
|
|
53
56
|
duration: {
|
|
54
57
|
control: { type: 'number', min: 0, step: 500 },
|
|
55
58
|
description: '表示時間(ミリ秒)',
|
|
@@ -177,7 +177,10 @@ describe('Toast', () => {
|
|
|
177
177
|
|
|
178
178
|
show('保存しました', { type: 'success' })
|
|
179
179
|
|
|
180
|
-
expect(
|
|
180
|
+
expect(document.querySelector('.charcoal-toast-region')).toHaveAttribute(
|
|
181
|
+
'data-position',
|
|
182
|
+
'top',
|
|
183
|
+
)
|
|
181
184
|
})
|
|
182
185
|
|
|
183
186
|
it('places a toast at the bottom when requested', () => {
|
|
@@ -185,7 +188,7 @@ describe('Toast', () => {
|
|
|
185
188
|
|
|
186
189
|
show('保存しました', { type: 'success' })
|
|
187
190
|
|
|
188
|
-
expect(
|
|
191
|
+
expect(document.querySelector('.charcoal-toast-region')).toHaveAttribute(
|
|
189
192
|
'data-position',
|
|
190
193
|
'bottom',
|
|
191
194
|
)
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
.charcoal-notification-region {
|
|
2
|
-
position: fixed;
|
|
3
2
|
left: 0;
|
|
4
3
|
right: 0;
|
|
5
|
-
display: grid;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
pointer-events: none;
|
|
8
4
|
box-sizing: border-box;
|
|
5
|
+
position: absolute;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
top: 0;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
.charcoal-notification {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
.charcoal-notification-region {
|
|
2
|
-
position: fixed;
|
|
3
2
|
left: 0;
|
|
4
3
|
right: 0;
|
|
5
|
-
display: grid;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
pointer-events: none;
|
|
8
4
|
box-sizing: border-box;
|
|
5
|
+
position: absolute;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
top: 0;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
.charcoal-notification {
|