Skip to content

Commit 6b0f84b

Browse files
devongovettLFDanLu
andauthored
feat: S2 toast (#7975)
* wip * wip * tmp * update * wip * fix * fix * updates * fix * updates * wip * Move to css module * Accessibility improvements * Fixes and cleanup * more refinement * ts * exports * more cleanup * add intl * hide extra toast story to fix multiple toast container issue in docs was breaking animations * Move storybook config to be global * Only apply view transition classes when in a stack * Mark as unstable --------- Co-authored-by: Daniel Lu <[email protected]>
1 parent 58d96ca commit 6b0f84b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1045
-63
lines changed

.storybook-s2/preview.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { addons } from '@storybook/preview-api';
66
import { DocsContainer } from '@storybook/addon-docs';
77
import React, { useEffect, useState } from 'react';
88
import {withProviderSwitcher} from './custom-addons/provider';
9+
import {Controls, Description, Primary, Stories, Subtitle, Title} from '@storybook/blocks';
910
import './global.css';
1011

1112
const channel = addons.getChannel();
@@ -42,7 +43,17 @@ const preview = {
4243
}
4344
return code;
4445
}
45-
}
46+
},
47+
page: () => (
48+
<>
49+
<Title />
50+
<Subtitle />
51+
<Description />
52+
<Primary />
53+
<Controls />
54+
<Stories includePrimary={false} />
55+
</>
56+
)
4657
},
4758
darkMode: {
4859
light: {

lib/viewTransitions.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
*/
1212

1313
interface Document {
14-
startViewTransition(fn: () => void): ViewTransition;
14+
startViewTransition(update: (() => void) | {update: () => void, types: string[]}): ViewTransition;
1515
}
1616

1717
interface ViewTransition {
1818
ready: Promise<void>;
19+
finished: Promise<void>;
1920
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
"packages/@react-spectrum/style-macro-s1/**",
247247
"packages/@react-spectrum/tree/**",
248248
"packages/@react-spectrum/color/src/*.tsx",
249-
"packages/@react-spectrum/s2/**",
249+
"packages/@react-spectrum/s2/**/*.{js,ts,tsx}",
250250
".storybook-s2/**"
251251
]
252252
},

packages/@react-spectrum/s2/intl/ar-AE.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.actions": "الإجراءات",
3232
"tag.hideButtonLabel": "إظهار أقل",
3333
"tag.noTags": "بدون",
34-
"tag.showAllButtonLabel": "عرض الكل ({tagCount, number})"
34+
"tag.showAllButtonLabel": "عرض الكل ({tagCount, number})",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

packages/@react-spectrum/s2/intl/bg-BG.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.actions": "Действия",
3232
"tag.hideButtonLabel": "Показване на по-малко",
3333
"tag.noTags": "Нито един",
34-
"tag.showAllButtonLabel": "Показване на всички ({tagCount, number})"
34+
"tag.showAllButtonLabel": "Показване на всички ({tagCount, number})",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

packages/@react-spectrum/s2/intl/cs-CZ.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.actions": "Akce",
3232
"tag.hideButtonLabel": "Zobrazit méně",
3333
"tag.noTags": "Žádný",
34-
"tag.showAllButtonLabel": "Zobrazit vše ({tagCount, number})"
34+
"tag.showAllButtonLabel": "Zobrazit vše ({tagCount, number})",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

packages/@react-spectrum/s2/intl/da-DK.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.actions": "Handlinger",
3232
"tag.hideButtonLabel": "Vis mindre",
3333
"tag.noTags": "Ingen",
34-
"tag.showAllButtonLabel": "Vis alle ({tagCount, number})"
34+
"tag.showAllButtonLabel": "Vis alle ({tagCount, number})",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

packages/@react-spectrum/s2/intl/de-DE.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.actions": "Aktionen",
3232
"tag.hideButtonLabel": "Weniger zeigen",
3333
"tag.noTags": "Keine",
34-
"tag.showAllButtonLabel": "Alle anzeigen ({tagCount, number})"
34+
"tag.showAllButtonLabel": "Alle anzeigen ({tagCount, number})",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

packages/@react-spectrum/s2/intl/el-GR.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.actions": "Ενέργειες",
3232
"tag.hideButtonLabel": "Εμφάνιση λιγότερων",
3333
"tag.noTags": "Κανένα",
34-
"tag.showAllButtonLabel": "Εμφάνιση όλων ({tagCount, number})"
34+
"tag.showAllButtonLabel": "Εμφάνιση όλων ({tagCount, number})",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

packages/@react-spectrum/s2/intl/en-US.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"tag.hideButtonLabel": "Show less",
3232
"tag.actions": "Actions",
3333
"tag.noTags": "None",
34-
"breadcrumbs.more": "More items"
34+
"breadcrumbs.more": "More items",
35+
"toast.clearAll": "Clear all",
36+
"toast.collapse": "Collapse",
37+
"toast.showAll": "Show all"
3538
}

0 commit comments

Comments
 (0)