@stackoverflow/stacks 1.8.0 → 1.9.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.
Files changed (137) hide show
  1. package/dist/components/activity-indicator/activity-indicator.a11y.test.d.ts +1 -0
  2. package/dist/components/activity-indicator/activity-indicator.visual.test.d.ts +1 -0
  3. package/dist/components/avatar/avatar.a11y.test.d.ts +1 -0
  4. package/dist/components/avatar/avatar.visual.test.d.ts +1 -0
  5. package/dist/{controllers/s-banner.d.ts → components/banner/banner.d.ts} +1 -1
  6. package/dist/components/banner/banner.test.d.ts +1 -0
  7. package/dist/components/banner/banner.visual.test.d.ts +1 -0
  8. package/dist/components/button/button.a11y.test.d.ts +1 -0
  9. package/dist/components/button/button.visual.test.d.ts +1 -0
  10. package/dist/{controllers/s-expandable-control.d.ts → components/expandable/expandable.d.ts} +1 -1
  11. package/dist/components/expandable/expandable.test.d.ts +1 -0
  12. package/dist/{controllers/s-modal.d.ts → components/modal/modal.d.ts} +1 -1
  13. package/dist/{controllers/s-navigation-tablist.d.ts → components/navigation/navigation.d.ts} +1 -1
  14. package/dist/{controllers/s-popover.d.ts → components/popover/popover.d.ts} +1 -1
  15. package/dist/{controllers/s-tooltip.d.ts → components/popover/tooltip.d.ts} +1 -1
  16. package/dist/components/popover/tooltip.test.d.ts +1 -0
  17. package/dist/components/popover/tooltip.visual.test.d.ts +1 -0
  18. package/dist/{controllers/s-table.d.ts → components/table/table.d.ts} +1 -1
  19. package/dist/{controllers/s-toast.d.ts → components/toast/toast.d.ts} +1 -1
  20. package/dist/components/toast/toast.test.d.ts +1 -0
  21. package/dist/components/toast/toast.visual.test.d.ts +1 -0
  22. package/dist/{controllers/s-uploader.d.ts → components/uploader/uploader.d.ts} +1 -1
  23. package/dist/controllers.d.ts +9 -0
  24. package/dist/css/stacks.css +2043 -1989
  25. package/dist/css/stacks.min.css +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/js/stacks.js +545 -545
  28. package/dist/js/stacks.min.js +1 -1
  29. package/dist/test/test-utils.d.ts +136 -0
  30. package/lib/{css/atomic/borders.less → atomic/border.less} +18 -0
  31. package/lib/{css/base/icons.less → base/icon.less} +0 -9
  32. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +21 -0
  33. package/lib/components/activity-indicator/activity-indicator.visual.test.ts +23 -0
  34. package/lib/components/avatar/avatar.a11y.test.ts +36 -0
  35. package/lib/components/avatar/avatar.visual.test.ts +54 -0
  36. package/lib/components/banner/banner.less +51 -0
  37. package/lib/{test/s-banner.test.ts → components/banner/banner.test.ts} +7 -3
  38. package/lib/{ts/controllers/s-banner.ts → components/banner/banner.ts} +1 -1
  39. package/lib/components/banner/banner.visual.test.ts +36 -0
  40. package/lib/components/button/button.a11y.test.ts +32 -0
  41. package/lib/{css/components/buttons.less → components/button/button.less} +3 -2
  42. package/lib/components/button/button.visual.test.ts +52 -0
  43. package/lib/{css/components/cards.less → components/card/card.less} +1 -1
  44. package/lib/components/check-control/check-control.less +17 -0
  45. package/lib/components/check-group/check-group.less +19 -0
  46. package/lib/{css/components → components/expandable}/expandable.less +3 -0
  47. package/lib/components/expandable/expandable.test.ts +53 -0
  48. package/lib/{ts/controllers/s-expandable-control.ts → components/expandable/expandable.ts} +1 -1
  49. package/lib/components/input-fill/input-fill.less +35 -0
  50. package/lib/components/input-icon/input-icon.less +45 -0
  51. package/lib/components/input-message/input-message.less +48 -0
  52. package/lib/{css/components/inputs.less → components/input_textarea/input_textarea.less} +0 -131
  53. package/lib/{css/components → components/link}/link.less +2 -2
  54. package/lib/{ts/controllers/s-modal.ts → components/modal/modal.ts} +1 -1
  55. package/lib/{ts/controllers/s-navigation-tablist.ts → components/navigation/navigation.ts} +1 -1
  56. package/lib/{css/components/notices.less → components/notice/notice.less} +0 -89
  57. package/lib/{css/components/popovers.less → components/popover/popover.less} +1 -0
  58. package/lib/{ts/controllers/s-popover.ts → components/popover/popover.ts} +1 -1
  59. package/lib/{test/s-tooltip.test.ts → components/popover/tooltip.test.ts} +6 -2
  60. package/lib/{ts/controllers/s-tooltip.ts → components/popover/tooltip.ts} +2 -2
  61. package/lib/{test/s-tooltip.visual.test.ts → components/popover/tooltip.visual.test.ts} +2 -2
  62. package/lib/{css/components/sidebar-widgets.less → components/sidebar-widget/sidebar-widget.less} +0 -1
  63. package/lib/{css/components → components/table}/table.less +0 -5
  64. package/lib/{ts/controllers/s-table.ts → components/table/table.ts} +1 -1
  65. package/lib/components/table-container/table-container.less +4 -0
  66. package/lib/components/toast/toast.less +35 -0
  67. package/lib/{test/s-toast.test.ts → components/toast/toast.test.ts} +7 -3
  68. package/lib/{ts/controllers/s-toast.ts → components/toast/toast.ts} +1 -1
  69. package/lib/components/toast/toast.visual.test.ts +27 -0
  70. package/lib/{ts/controllers/s-uploader.ts → components/uploader/uploader.ts} +1 -1
  71. package/lib/controllers.ts +33 -0
  72. package/lib/{ts/index.ts → index.ts} +1 -1
  73. package/lib/{css/stacks-dynamic.less → stacks-dynamic.less} +1 -2
  74. package/lib/stacks-static.less +93 -0
  75. package/lib/test/test-utils.ts +444 -0
  76. package/lib/tsconfig.json +1 -1
  77. package/package.json +17 -17
  78. package/dist/controllers/index.d.ts +0 -9
  79. package/lib/css/stacks-static.less +0 -87
  80. package/lib/test/s-avatar.a11y.test.ts +0 -77
  81. package/lib/test/s-banner.visual.test.ts +0 -61
  82. package/lib/test/s-btn.a11y.test.ts +0 -123
  83. package/lib/test/s-btn.visual.test.ts +0 -16
  84. package/lib/test/s-toast.visual.test.ts +0 -48
  85. package/lib/ts/controllers/index.ts +0 -17
  86. /package/lib/{css/atomic/colors.less → atomic/color.less} +0 -0
  87. /package/lib/{css/atomic → atomic}/flex.less +0 -0
  88. /package/lib/{css/atomic → atomic}/gap.less +0 -0
  89. /package/lib/{css/atomic → atomic}/grid.less +0 -0
  90. /package/lib/{css/atomic → atomic}/misc.less +0 -0
  91. /package/lib/{css/atomic → atomic}/spacing.less +0 -0
  92. /package/lib/{css/atomic → atomic}/typography.less +0 -0
  93. /package/lib/{css/atomic → atomic}/width-height.less +0 -0
  94. /package/lib/{css/base → base}/body.less +0 -0
  95. /package/lib/{css/base → base}/configuration-static.less +0 -0
  96. /package/lib/{css/base → base}/fieldset.less +0 -0
  97. /package/lib/{css/base/internals.less → base/internal.less} +0 -0
  98. /package/lib/{css/base → base}/reset-meyer.less +0 -0
  99. /package/lib/{css/base → base}/reset-normalize.less +0 -0
  100. /package/lib/{css/base → base}/reset.less +0 -0
  101. /package/lib/{css/components → components/activity-indicator}/activity-indicator.less +0 -0
  102. /package/lib/{css/components/anchors.less → components/anchor/anchor.less} +0 -0
  103. /package/lib/{css/components/avatars.less → components/avatar/avatar.less} +0 -0
  104. /package/lib/{css/components → components/award-bling}/award-bling.less +0 -0
  105. /package/lib/{css/components/badges.less → components/badge/badge.less} +0 -0
  106. /package/lib/{css/components → components/block-link}/block-link.less +0 -0
  107. /package/lib/{css/components → components/breadcrumbs}/breadcrumbs.less +0 -0
  108. /package/lib/{css/components/button-groups.less → components/button-group/button-group.less} +0 -0
  109. /package/lib/{css/components/checkboxes-radios.less → components/checkbox_radio/checkbox_radio.less} +0 -0
  110. /package/lib/{css/components/code-blocks.less → components/code-block/code-block.less} +0 -0
  111. /package/lib/{css/components → components/description}/description.less +0 -0
  112. /package/lib/{css/components/empty-states.less → components/empty-state/empty-state.less} +0 -0
  113. /package/lib/{css/components/labels.less → components/label/label.less} +0 -0
  114. /package/lib/{css/components/link-previews.less → components/link-preview/link-preview.less} +0 -0
  115. /package/lib/{css/components → components/menu}/menu.less +0 -0
  116. /package/lib/{css/components/modals.less → components/modal/modal.less} +0 -0
  117. /package/lib/{css/components → components/navigation}/navigation.less +0 -0
  118. /package/lib/{css/components/page-titles.less → components/page-title/page-title.less} +0 -0
  119. /package/lib/{css/components → components/pagination}/pagination.less +0 -0
  120. /package/lib/{css/components → components/post-summary}/post-summary.less +0 -0
  121. /package/lib/{css/components/progress-bars.less → components/progress-bar/progress-bar.less} +0 -0
  122. /package/lib/{css/components → components/prose}/prose.less +0 -0
  123. /package/lib/{css/components → components/select}/select.less +0 -0
  124. /package/lib/{css/components → components/spinner}/spinner.less +0 -0
  125. /package/lib/{css/components/tags.less → components/tag/tag.less} +0 -0
  126. /package/lib/{css/components/toggle-switches.less → components/toggle-switch/toggle-switch.less} +0 -0
  127. /package/lib/{css/components → components/topbar}/topbar.less +0 -0
  128. /package/lib/{css/components → components/uploader}/uploader.less +0 -0
  129. /package/lib/{css/components/user-cards.less → components/user-card/user-card.less} +0 -0
  130. /package/lib/{css/exports → exports}/constants-colors.less +0 -0
  131. /package/lib/{css/exports → exports}/constants-helpers.less +0 -0
  132. /package/lib/{css/exports → exports}/constants-type.less +0 -0
  133. /package/lib/{css/exports → exports}/exports.less +0 -0
  134. /package/lib/{css/exports → exports}/mixins.less +0 -0
  135. /package/lib/{css/input-utils.less → input-utils.less} +0 -0
  136. /package/lib/{css/stacks.less → stacks.less} +0 -0
  137. /package/lib/{ts/stacks.ts → stacks.ts} +0 -0
@@ -1,87 +0,0 @@
1
- // stacks-static.less contains styles which we DO NOT allow communities to modify via variables
2
- // BASE
3
- @import "base/reset.less";
4
- @import "base/fieldset.less";
5
- @import "base/icons.less";
6
- @import "input-utils.less";
7
-
8
- // COMPONENTS
9
- @import "components/activity-indicator.less";
10
- @import "components/anchors.less";
11
- @import "components/award-bling.less";
12
- @import "components/avatars.less";
13
- @import "components/badges.less";
14
- @import "components/buttons.less";
15
- @import "components/empty-states.less";
16
- @import "components/block-link.less";
17
- @import "components/breadcrumbs.less";
18
- @import "components/button-groups.less";
19
- @import "components/cards.less";
20
- @import "components/checkboxes-radios.less";
21
- @import "components/code-blocks.less";
22
- @import "components/description.less";
23
- @import "components/expandable.less";
24
- @import "components/inputs.less";
25
- @import "components/labels.less";
26
- @import "components/link.less";
27
- @import "components/link-previews.less";
28
- @import "components/menu.less";
29
- @import "components/modals.less";
30
- @import "components/navigation.less";
31
- @import "components/notices.less";
32
- @import "components/page-titles.less";
33
- @import "components/pagination.less";
34
- @import "components/popovers.less";
35
- @import "components/post-summary.less";
36
- @import "components/progress-bars.less";
37
- @import "components/prose.less";
38
- @import "components/select.less";
39
- @import "components/sidebar-widgets.less";
40
- @import "components/spinner.less";
41
- @import "components/table.less";
42
- @import "components/tags.less";
43
- @import "components/toggle-switches.less";
44
- @import "components/topbar.less";
45
- @import "components/uploader.less";
46
- @import "components/user-cards.less";
47
-
48
- // LESS CONSTANTS AND MIXINS
49
- @import "exports/exports.less";
50
-
51
- // ATOMIC CLASSES
52
- @import "atomic/borders.less";
53
- @import "atomic/colors.less";
54
- @import "atomic/flex.less";
55
- @import "atomic/gap.less";
56
- @import "atomic/grid.less";
57
- @import "atomic/spacing.less";
58
- @import "atomic/typography.less";
59
- @import "atomic/misc.less";
60
- @import "atomic/width-height.less";
61
-
62
- /* stylelint-disable */
63
- #stacks-internals #screen-lg({
64
- #stacks-internals-collect-large();
65
- });
66
- #stacks-internals #screen-md({
67
- #stacks-internals-collect-medium();
68
- });
69
- #stacks-internals #screen-sm({
70
- #stacks-internals-collect-small();
71
- });
72
-
73
- @media print { // We need printing styles to be last so they can override all other styles.
74
- .print\:d-block & {
75
- display: block !important;
76
- }
77
- .print\:d-none & {
78
- display: none !important;
79
- }
80
- }
81
- /* stylelint-enable */
82
-
83
- // CONFIG
84
- @import "base/configuration-static.less";
85
- @import "base/internals.less";
86
-
87
- // [1] The following items are elements which we DO NOT allow communities to modify via variables.
@@ -1,77 +0,0 @@
1
- import { html, fixture, expect } from "@open-wc/testing";
2
- import { screen } from "@testing-library/dom";
3
- import "../ts/index";
4
-
5
- // TODO abstract to a helper file… maybe create a helper function to test in all themes
6
- const colorThemes = ["theme-dark", "theme-light"];
7
- const baseThemes = ["", "theme-highcontrast"];
8
-
9
- const avatarStyles = {
10
- sizes: ["24", "32", "48", "64", "96", "128"],
11
- children: ["image", "letter"],
12
- };
13
-
14
- const makeTest = ({ testid, theme, classes, child = "" }) => {
15
- it(`a11y: ${testid} should be accessible`, async () => {
16
- await fixture(html`<a
17
- href="#"
18
- class="s-avatar${classes}"
19
- data-testid="${testid}"
20
- >
21
- <div
22
- class="${child === "letter" ? "s-avatar--letter" : "d-none"}"
23
- aria-hidden="true"
24
- >
25
- S
26
- </div>
27
- <img
28
- class="${child === "image" ? "s-avatar--image" : "d-none"}"
29
- src="https://picsum.photos/48"
30
- alt="team logo"
31
- />
32
- <span class="v-visible-sr">Stack Overflow</span>
33
- </a>`);
34
-
35
- document.body.className = "";
36
- document.body.classList.add(...theme);
37
- const avatar = screen.getByTestId(testid);
38
- // TODO add conditional option for high contrast mode to test against AAA
39
- await expect(avatar).to.be.accessible();
40
- });
41
- };
42
-
43
- // TODO move to test utils
44
- const buildTestid = (arr) => arr.filter(Boolean).join("-");
45
-
46
- describe("s-avatar", () => {
47
- // Test default, high contrast themes
48
- baseThemes.forEach((baseTheme) => {
49
- // Test light, dark theme
50
- colorThemes.forEach((colorTheme) => {
51
- const theme = [baseTheme, colorTheme].filter(Boolean);
52
- const testidBase = buildTestid(["s-avatar", ...theme]);
53
-
54
- // Test each size
55
- ["", ...avatarStyles.sizes].forEach((size) => {
56
- const sizeClasses = size ? ` s-avatar__${size}` : "";
57
- const classesSize = ` ${sizeClasses}`;
58
- const testidSize = buildTestid([testidBase, size]);
59
-
60
- // Test each size with each child
61
- ["", ...avatarStyles.children].forEach((child) => {
62
- const testidChildren = buildTestid([
63
- testidSize,
64
- `with-${child}`,
65
- ]);
66
-
67
- makeTest({
68
- child,
69
- classes: classesSize,
70
- testid: testidChildren,
71
- theme,
72
- });
73
- });
74
- });
75
- });
76
- });
77
- });
@@ -1,61 +0,0 @@
1
- import { html, fixture } from "@open-wc/testing";
2
- import { visualDiff } from "@web/test-runner-visual-regression";
3
- import "../ts/index";
4
-
5
- const testBanner = (variant = "info", important = false) => {
6
- const importantClass = important ? "s-banner__important" : "";
7
-
8
- return html`<aside
9
- class="s-banner s-banner__${variant} ${importantClass} is-pinned ps-relatives"
10
- role="alert"
11
- aria-hidden="false"
12
- >
13
- <div
14
- class="d-flex flex__center jc-space-between s-banner--container"
15
- role="alertdialog"
16
- aria-describedby="banner-message"
17
- >
18
- <div aria-label="banner message">
19
- Test Banner: ${variant} ${importantClass}
20
- </div>
21
- <div class="ml-auto myn8">
22
- <span class="s-btn s-banner--btn">Close</span>
23
- </div>
24
- </div>
25
- </aside>`;
26
- };
27
-
28
- describe("s-banner", () => {
29
- it("should not introduce visual regressions for info banner", async () => {
30
- const banner = await fixture(testBanner("info"));
31
- await visualDiff(banner, "s-banner__info");
32
- });
33
- it("should not introduce visual regressions for important info banner", async () => {
34
- const banner = await fixture(testBanner("info", true));
35
- await visualDiff(banner, "s-banner__info-important");
36
- });
37
- it("should not introduce visual regressions for success banner", async () => {
38
- const banner = await fixture(testBanner("success"));
39
- await visualDiff(banner, "s-banner__success");
40
- });
41
- it("should not introduce visual regressions for important success banner", async () => {
42
- const banner = await fixture(testBanner("success", true));
43
- await visualDiff(banner, "s-banner__success-important");
44
- });
45
- it("should not introduce visual regressions for warning banner", async () => {
46
- const banner = await fixture(testBanner("warning"));
47
- await visualDiff(banner, "s-banner__warning");
48
- });
49
- it("should not introduce visual regressions for important warning banner", async () => {
50
- const banner = await fixture(testBanner("warning", true));
51
- await visualDiff(banner, "s-banner__warning-important");
52
- });
53
- it("should not introduce visual regressions for danger banner", async () => {
54
- const banner = await fixture(testBanner("danger"));
55
- await visualDiff(banner, "s-banner__danger");
56
- });
57
- it("should not introduce visual regressions for important danger banner", async () => {
58
- const banner = await fixture(testBanner("danger", true));
59
- await visualDiff(banner, "s-banner__danger-important");
60
- });
61
- });
@@ -1,123 +0,0 @@
1
- import { html, fixture, expect } from "@open-wc/testing";
2
- import { screen } from "@testing-library/dom";
3
- import "../ts/index";
4
-
5
- // TODO abstract to a helper file…
6
- // TODO reinstate "theme-dark" test once we add ability to skip tests or resolve dark mode contrast issues
7
- // const colorThemes = ["theme-dark", "theme-light"];
8
- const colorThemes = ["theme-light"];
9
- const baseThemes = ["", "theme-highcontrast"];
10
-
11
- const btnStyles = {
12
- variants: ["danger", "muted", "primary"],
13
- modifiers: ["filled", "outlined", "filled-outlined"],
14
- secondaryModifiers: ["dropdown", "icon"],
15
- globalModifiers: ["is-loading"],
16
- sizes: ["xs", "sm", "md"],
17
- resets: ["link", "unset"],
18
- social: ["facebook", "github", "google"],
19
- // TODO reinstate children test once we add ability to skip tests or resolve badge contrast issues
20
- // children: ["badge"],
21
- };
22
-
23
- const makeTest = ({ testid, theme, classes, child = "" }) => {
24
- it(`a11y: ${testid} should be accessible`, async () => {
25
- await fixture(html`<button
26
- class="s-btn${classes}"
27
- role="button"
28
- data-testid="${testid}"
29
- >
30
- Ask question
31
- <span class="${child === "badge" ? "s-btn--badge" : "d-none"}">
32
- <span class="s-btn--number">198</span>
33
- </span>
34
- </button>`);
35
-
36
- document.body.className = "";
37
- document.body.classList.add(...theme);
38
- const button = screen.getByTestId(testid);
39
- // TODO add conditional option for high contrast mode to test against AAA
40
- await expect(button).to.be.accessible();
41
- });
42
- };
43
-
44
- // TODO move to test utils
45
- const buildTestid = (arr) => arr.filter(Boolean).join("-");
46
-
47
- describe("s-btn", () => {
48
- // Test default, high contrast themes
49
- baseThemes.forEach((baseTheme) => {
50
- // Test light, dark theme
51
- colorThemes.forEach((colorTheme) => {
52
- const theme = [baseTheme, colorTheme].filter(Boolean);
53
- const testidBase = buildTestid(["s-btn", ...theme]);
54
-
55
- // Test each combination of base modifiers
56
- ["", ...btnStyles.modifiers].forEach((modifier) => {
57
- const modifierClasses = modifier
58
- ? ` s-btn__${modifier.replace("-", " s-btn__")}`
59
- : "";
60
-
61
- // Test each variant
62
- ["", ...btnStyles.variants].forEach((variant) => {
63
- const variantClasses = variant ? ` s-btn__${variant}` : "";
64
- const classesVariant = ` ${variantClasses}${modifierClasses}`;
65
- const testidVariant = buildTestid([
66
- testidBase,
67
- variant,
68
- modifier,
69
- ]);
70
-
71
- // Test each variant with each child
72
- // TODO reinstate children test once we add ability to skip tests or resolve badge contrast issues
73
- // [...btnStyles.children].forEach((child) => {
74
- // const testidChildren = `${testidVariant}${
75
- // child ? `-with-${child}` : ""
76
- // }`;
77
- // makeTest({
78
- // child,
79
- // classes: classesVariant,
80
- // testid: testidChildren,
81
- // theme,
82
- // });
83
- // });
84
-
85
- [
86
- "", // Test no additional classes
87
- ...btnStyles.sizes, // Test each size
88
- ...btnStyles.resets, // Test each reset
89
- ...btnStyles.social, // Test each social style
90
- ].forEach((style) => {
91
- const testidStyle = buildTestid([testidVariant, style]);
92
- const classesStyle = `${classesVariant}${
93
- style ? ` s-btn__${style}` : ""
94
- }`;
95
-
96
- makeTest({
97
- classes: classesStyle,
98
- testid: testidStyle,
99
- theme,
100
- });
101
- });
102
-
103
- // Test each globalModifier
104
- [...btnStyles.globalModifiers].forEach((globalModifier) => {
105
- const testidGlobal = buildTestid([
106
- testidVariant,
107
- globalModifier,
108
- ]);
109
- const classesGlobal = `${classesVariant}${
110
- globalModifier ? ` ${globalModifier}` : ""
111
- }`;
112
-
113
- makeTest({
114
- classes: classesGlobal,
115
- testid: testidGlobal,
116
- theme,
117
- });
118
- });
119
- });
120
- });
121
- });
122
- });
123
- });
@@ -1,16 +0,0 @@
1
- import { html, fixture } from "@open-wc/testing";
2
- import { visualDiff } from "@web/test-runner-visual-regression";
3
- import "../ts/index";
4
-
5
- describe("s-btn", () => {
6
- it("should not introduce visual regressions for loading button", async () => {
7
- // Adding a padded wrapper to avoid GitHub Actions diff discrepancies
8
- const btn = await fixture(html`
9
- <div style="height: 38px; width: 88px; display: inline-block;">
10
- <button class="s-btn is-loading" type="button">Loading</button>
11
- </div>
12
- `);
13
-
14
- await visualDiff(btn, "s-btn-is-loading");
15
- });
16
- });
@@ -1,48 +0,0 @@
1
- import { html, fixture } from "@open-wc/testing";
2
- import { visualDiff } from "@web/test-runner-visual-regression";
3
- import "../ts/index";
4
-
5
- const testToast = (variant = "info", important = false) => {
6
- const importantClass = important ? "s-notice__important" : "";
7
-
8
- return html`<div class="s-toast" aria-hidden="false">
9
- <aside class="s-notice s-notice__${variant} ${importantClass}">
10
- Test toast: ${variant} ${importantClass}
11
- </aside>
12
- </div>`;
13
- };
14
-
15
- describe("s-toast", () => {
16
- it("should not introduce visual regressions for info toast", async () => {
17
- const toast = await fixture(testToast("info"));
18
- await visualDiff(toast, "s-toast__info");
19
- });
20
- it("should not introduce visual regressions for important info toast", async () => {
21
- const toast = await fixture(testToast("info", true));
22
- await visualDiff(toast, "s-toast__info-important");
23
- });
24
- it("should not introduce visual regressions for success toast", async () => {
25
- const toast = await fixture(testToast("success"));
26
- await visualDiff(toast, "s-toast__success");
27
- });
28
- it("should not introduce visual regressions for important success toast", async () => {
29
- const toast = await fixture(testToast("success", true));
30
- await visualDiff(toast, "s-toast__success-important");
31
- });
32
- it("should not introduce visual regressions for warning toast", async () => {
33
- const toast = await fixture(testToast("warning"));
34
- await visualDiff(toast, "s-toast__warning");
35
- });
36
- it("should not introduce visual regressions for important warning toast", async () => {
37
- const toast = await fixture(testToast("warning", true));
38
- await visualDiff(toast, "s-toast__warning-important");
39
- });
40
- it("should not introduce visual regressions for danger toast", async () => {
41
- const toast = await fixture(testToast("danger"));
42
- await visualDiff(toast, "s-toast__danger");
43
- });
44
- it("should not introduce visual regressions for important danger toast", async () => {
45
- const toast = await fixture(testToast("danger", true));
46
- await visualDiff(toast, "s-toast__danger-important");
47
- });
48
- });
@@ -1,17 +0,0 @@
1
- // export all controllers *with helpers* so they can be bulk re-exported by the package entry point
2
- export { ExpandableController } from "./s-expandable-control";
3
- export { hideModal, ModalController, showModal } from "./s-modal";
4
- export { hideBanner, BannerController, showBanner } from "./s-banner";
5
- export { hideToast, ToastController, showToast } from "./s-toast";
6
- export { TabListController } from "./s-navigation-tablist";
7
- export {
8
- attachPopover,
9
- detachPopover,
10
- hidePopover,
11
- BasePopoverController,
12
- PopoverController,
13
- showPopover,
14
- } from "./s-popover";
15
- export { TableController } from "./s-table";
16
- export { setTooltipHtml, setTooltipText, TooltipController } from "./s-tooltip";
17
- export { UploaderController } from "./s-uploader";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes