@stackoverflow/stacks 1.7.1 → 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 (138) hide show
  1. package/README.md +1 -1
  2. package/dist/components/activity-indicator/activity-indicator.a11y.test.d.ts +1 -0
  3. package/dist/components/activity-indicator/activity-indicator.visual.test.d.ts +1 -0
  4. package/dist/components/avatar/avatar.a11y.test.d.ts +1 -0
  5. package/dist/components/avatar/avatar.visual.test.d.ts +1 -0
  6. package/dist/{controllers/s-banner.d.ts → components/banner/banner.d.ts} +1 -1
  7. package/dist/components/banner/banner.test.d.ts +1 -0
  8. package/dist/components/banner/banner.visual.test.d.ts +1 -0
  9. package/dist/components/button/button.a11y.test.d.ts +1 -0
  10. package/dist/components/button/button.visual.test.d.ts +1 -0
  11. package/dist/{controllers/s-expandable-control.d.ts → components/expandable/expandable.d.ts} +1 -1
  12. package/dist/components/expandable/expandable.test.d.ts +1 -0
  13. package/dist/{controllers/s-modal.d.ts → components/modal/modal.d.ts} +1 -1
  14. package/dist/{controllers/s-navigation-tablist.d.ts → components/navigation/navigation.d.ts} +1 -1
  15. package/dist/{controllers/s-popover.d.ts → components/popover/popover.d.ts} +1 -1
  16. package/dist/{controllers/s-tooltip.d.ts → components/popover/tooltip.d.ts} +1 -1
  17. package/dist/components/popover/tooltip.test.d.ts +1 -0
  18. package/dist/components/popover/tooltip.visual.test.d.ts +1 -0
  19. package/dist/{controllers/s-table.d.ts → components/table/table.d.ts} +1 -1
  20. package/dist/{controllers/s-toast.d.ts → components/toast/toast.d.ts} +1 -1
  21. package/dist/components/toast/toast.test.d.ts +1 -0
  22. package/dist/components/toast/toast.visual.test.d.ts +1 -0
  23. package/dist/{controllers/s-uploader.d.ts → components/uploader/uploader.d.ts} +1 -1
  24. package/dist/controllers.d.ts +9 -0
  25. package/dist/css/stacks.css +1351 -1171
  26. package/dist/css/stacks.min.css +1 -1
  27. package/dist/index.d.ts +1 -1
  28. package/dist/js/stacks.js +545 -545
  29. package/dist/js/stacks.min.js +1 -1
  30. package/dist/test/test-utils.d.ts +136 -0
  31. package/lib/{css/atomic/borders.less → atomic/border.less} +18 -0
  32. package/lib/base/fieldset.less +5 -0
  33. package/lib/{css/base/icons.less → base/icon.less} +0 -9
  34. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +21 -0
  35. package/lib/components/activity-indicator/activity-indicator.visual.test.ts +23 -0
  36. package/lib/components/avatar/avatar.a11y.test.ts +36 -0
  37. package/lib/components/avatar/avatar.visual.test.ts +54 -0
  38. package/lib/components/banner/banner.less +51 -0
  39. package/lib/{test/s-banner.test.ts → components/banner/banner.test.ts} +7 -3
  40. package/lib/{ts/controllers/s-banner.ts → components/banner/banner.ts} +1 -1
  41. package/lib/components/banner/banner.visual.test.ts +36 -0
  42. package/lib/components/button/button.a11y.test.ts +32 -0
  43. package/lib/{css/components/buttons.less → components/button/button.less} +7 -6
  44. package/lib/components/button/button.visual.test.ts +52 -0
  45. package/lib/{css/components/cards.less → components/card/card.less} +1 -1
  46. package/lib/components/check-control/check-control.less +17 -0
  47. package/lib/components/check-group/check-group.less +19 -0
  48. package/lib/components/checkbox_radio/checkbox_radio.less +158 -0
  49. package/lib/components/description/description.less +9 -0
  50. package/lib/{css/components → components/expandable}/expandable.less +3 -0
  51. package/lib/components/expandable/expandable.test.ts +53 -0
  52. package/lib/{ts/controllers/s-expandable-control.ts → components/expandable/expandable.ts} +1 -1
  53. package/lib/components/input-fill/input-fill.less +35 -0
  54. package/lib/components/input-icon/input-icon.less +45 -0
  55. package/lib/components/input-message/input-message.less +48 -0
  56. package/lib/components/input_textarea/input_textarea.less +166 -0
  57. package/lib/{css/components/labels.less → components/label/label.less} +4 -4
  58. package/lib/{css/components → components/link}/link.less +9 -2
  59. package/lib/{ts/controllers/s-modal.ts → components/modal/modal.ts} +1 -1
  60. package/lib/{ts/controllers/s-navigation-tablist.ts → components/navigation/navigation.ts} +1 -1
  61. package/lib/{css/components/notices.less → components/notice/notice.less} +0 -89
  62. package/lib/{css/components/popovers.less → components/popover/popover.less} +1 -0
  63. package/lib/{ts/controllers/s-popover.ts → components/popover/popover.ts} +1 -1
  64. package/lib/{test/s-tooltip.test.ts → components/popover/tooltip.test.ts} +6 -2
  65. package/lib/{ts/controllers/s-tooltip.ts → components/popover/tooltip.ts} +2 -2
  66. package/lib/{test/s-tooltip.visual.test.ts → components/popover/tooltip.visual.test.ts} +2 -2
  67. package/lib/{css/components → components/post-summary}/post-summary.less +6 -2
  68. package/lib/components/select/select.less +148 -0
  69. package/lib/{css/components/sidebar-widgets.less → components/sidebar-widget/sidebar-widget.less} +0 -1
  70. package/lib/{css/components → components/table}/table.less +0 -5
  71. package/lib/{ts/controllers/s-table.ts → components/table/table.ts} +1 -1
  72. package/lib/components/table-container/table-container.less +4 -0
  73. package/lib/{css/components/tags.less → components/tag/tag.less} +3 -3
  74. package/lib/components/toast/toast.less +35 -0
  75. package/lib/{test/s-toast.test.ts → components/toast/toast.test.ts} +7 -3
  76. package/lib/{ts/controllers/s-toast.ts → components/toast/toast.ts} +1 -1
  77. package/lib/components/toast/toast.visual.test.ts +27 -0
  78. package/lib/{css/components/toggle-switches.less → components/toggle-switch/toggle-switch.less} +8 -0
  79. package/lib/{ts/controllers/s-uploader.ts → components/uploader/uploader.ts} +1 -1
  80. package/lib/controllers.ts +33 -0
  81. package/lib/{css/exports → exports}/mixins.less +73 -11
  82. package/lib/{ts/index.ts → index.ts} +1 -1
  83. package/lib/input-utils.less +44 -0
  84. package/lib/{css/stacks-dynamic.less → stacks-dynamic.less} +1 -2
  85. package/lib/stacks-static.less +93 -0
  86. package/lib/test/test-utils.ts +444 -0
  87. package/lib/tsconfig.json +1 -1
  88. package/package.json +26 -25
  89. package/dist/controllers/index.d.ts +0 -9
  90. package/lib/css/components/inputs.less +0 -666
  91. package/lib/css/stacks-static.less +0 -97
  92. package/lib/test/s-avatar.test.ts +0 -74
  93. package/lib/test/s-banner.visual.test.ts +0 -61
  94. package/lib/test/s-button.visual.test.ts +0 -12
  95. package/lib/test/s-toast.visual.test.ts +0 -48
  96. package/lib/ts/controllers/index.ts +0 -17
  97. /package/lib/{css/atomic/colors.less → atomic/color.less} +0 -0
  98. /package/lib/{css/atomic → atomic}/flex.less +0 -0
  99. /package/lib/{css/atomic → atomic}/gap.less +0 -0
  100. /package/lib/{css/atomic → atomic}/grid.less +0 -0
  101. /package/lib/{css/atomic → atomic}/misc.less +0 -0
  102. /package/lib/{css/atomic → atomic}/spacing.less +0 -0
  103. /package/lib/{css/atomic → atomic}/typography.less +0 -0
  104. /package/lib/{css/atomic → atomic}/width-height.less +0 -0
  105. /package/lib/{css/base → base}/body.less +0 -0
  106. /package/lib/{css/base → base}/configuration-static.less +0 -0
  107. /package/lib/{css/base/internals.less → base/internal.less} +0 -0
  108. /package/lib/{css/base → base}/reset-meyer.less +0 -0
  109. /package/lib/{css/base → base}/reset-normalize.less +0 -0
  110. /package/lib/{css/base → base}/reset.less +0 -0
  111. /package/lib/{css/components → components/activity-indicator}/activity-indicator.less +0 -0
  112. /package/lib/{css/components/anchors.less → components/anchor/anchor.less} +0 -0
  113. /package/lib/{css/components/avatars.less → components/avatar/avatar.less} +0 -0
  114. /package/lib/{css/components → components/award-bling}/award-bling.less +0 -0
  115. /package/lib/{css/components/badges.less → components/badge/badge.less} +0 -0
  116. /package/lib/{css/components → components/block-link}/block-link.less +0 -0
  117. /package/lib/{css/components → components/breadcrumbs}/breadcrumbs.less +0 -0
  118. /package/lib/{css/components/button-groups.less → components/button-group/button-group.less} +0 -0
  119. /package/lib/{css/components/code-blocks.less → components/code-block/code-block.less} +0 -0
  120. /package/lib/{css/components/empty-states.less → components/empty-state/empty-state.less} +0 -0
  121. /package/lib/{css/components/link-previews.less → components/link-preview/link-preview.less} +0 -0
  122. /package/lib/{css/components → components/menu}/menu.less +0 -0
  123. /package/lib/{css/components/modals.less → components/modal/modal.less} +0 -0
  124. /package/lib/{css/components → components/navigation}/navigation.less +0 -0
  125. /package/lib/{css/components/page-titles.less → components/page-title/page-title.less} +0 -0
  126. /package/lib/{css/components → components/pagination}/pagination.less +0 -0
  127. /package/lib/{css/components/progress-bars.less → components/progress-bar/progress-bar.less} +0 -0
  128. /package/lib/{css/components → components/prose}/prose.less +0 -0
  129. /package/lib/{css/components → components/spinner}/spinner.less +0 -0
  130. /package/lib/{css/components → components/topbar}/topbar.less +0 -0
  131. /package/lib/{css/components → components/uploader}/uploader.less +0 -0
  132. /package/lib/{css/components/user-cards.less → components/user-card/user-card.less} +0 -0
  133. /package/lib/{css/exports → exports}/constants-colors.less +0 -0
  134. /package/lib/{css/exports → exports}/constants-helpers.less +0 -0
  135. /package/lib/{css/exports → exports}/constants-type.less +0 -0
  136. /package/lib/{css/exports → exports}/exports.less +0 -0
  137. /package/lib/{css/stacks.less → stacks.less} +0 -0
  138. /package/lib/{ts/stacks.ts → stacks.ts} +0 -0
@@ -0,0 +1,148 @@
1
+ .s-select {
2
+ --_se-arrow-bc: currentColor transparent;
3
+ --_se-arrow-size: var(--su-static4); // Constant
4
+ --_se-select-bc: var(--bc-darker);
5
+ --_se-select-bc-focus: var(--theme-secondary-300);
6
+ --_se-select-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring);
7
+ --_se-select-bg: var(--white);
8
+ --_se-select-br: var(--br-sm);
9
+ --_se-select-fc: var(--black);
10
+ --_se-select-px: 0.7em;
11
+ --_se-select-py: 0.6em;
12
+ --_se-select-fs: var(--fs-body1);
13
+
14
+ // CONTEXTUAL STYLES
15
+ @supports (-webkit-overflow-scrolling: touch) {
16
+ --_se-select-fs: 16px; // Increase font size for mobile safari. This keeps our inputs from zooming the page while focused
17
+ --_se-select-px: 0.55em; // Compensate for the larger font size so we generally keep the input the same size
18
+ --_se-select-py: 0.4em; // Compensate for the larger font size so we generally keep the input the same size
19
+ }
20
+
21
+ // MODIFIERS
22
+ .input-states({
23
+ position: relative;
24
+ });
25
+
26
+ .validation-states(se-select);
27
+
28
+ .is-disabled & {
29
+ --_se-arrow-bc: var(--bc-darker) transparent;
30
+ }
31
+
32
+ &&__sm {
33
+ .size-styles(sm; se-select; @styles: fs);
34
+ // --_se-select-fs: var(--fs-caption);
35
+ }
36
+
37
+ &&__md {
38
+ .size-styles(md; se-select; @styles: br, fs);
39
+ --_se-select-py: 0.5em;
40
+ }
41
+
42
+ &&__lg {
43
+ .size-styles(lg; se-select; @styles: br, fs);
44
+ --_se-select-px: 0.6em;
45
+ --_se-select-py: 0.45em;
46
+ }
47
+
48
+ &&__xl {
49
+ .size-styles(xl; se-select; @styles: br, fs);
50
+ --_se-select-px: 0.5em;
51
+ --_se-select-py: 0.4em;
52
+ }
53
+
54
+ // CHILD ELEMENTS
55
+ select&,
56
+ & > select {
57
+ .webkit-autofill();
58
+ }
59
+
60
+ &:before,
61
+ &:after { // menu arrows
62
+ border-color: var(--_se-arrow-bc);
63
+ border-style: solid;
64
+ border-width: var(--_se-arrow-size);
65
+ content: "";
66
+ pointer-events: none;
67
+ position: absolute;
68
+ right: calc(var(--su-static12) + var(--su-static1));
69
+ z-index: var(--zi-selected);
70
+ }
71
+
72
+ &:after {
73
+ border-bottom-width: 0;
74
+ top: calc(50% + var(--su-static1));
75
+ }
76
+
77
+ &:before {
78
+ border-top-width: 0;
79
+ top: calc(50% - calc(var(--_se-arrow-size) + var(--su-static1)));
80
+ }
81
+
82
+ > select { // Menu
83
+ // CONTEXTUAL STYLES
84
+ fieldset[disabled] &,
85
+ &[disabled] {
86
+ cursor: not-allowed;
87
+ opacity: var(--_o-disabled-static);
88
+ }
89
+
90
+ &[readonly],
91
+ .is-readonly & { // [1]
92
+ --_se-select-bc: var(--bc-light);
93
+ --_se-select-bg: var(--black-050);
94
+ --_se-select-fc: var(--black-200);
95
+
96
+ .highcontrast-mode({
97
+ --_se-select-fc: var(--fc-light);
98
+ });
99
+
100
+ cursor: not-allowed;
101
+ }
102
+
103
+ // CHILD ELEMENTS
104
+ &::-moz-focus-inner {
105
+ outline: none !important;
106
+ }
107
+
108
+ // INTERACTION
109
+ &:focus {
110
+ .highcontrast-mode({
111
+ --_se-select-bc-focus: var(--black);
112
+ });
113
+
114
+ border-color: var(--_se-select-bc-focus);
115
+ box-shadow: var(--_se-select-bs-focus);
116
+
117
+ color: var(--black);
118
+ outline: 0;
119
+ }
120
+
121
+ background-color: var(--_se-select-bg);
122
+ border: var(--su-static1) solid var(--_se-select-bc);
123
+ border-radius: var(--_se-select-br);
124
+ color: var(--_se-select-fc);
125
+ font-size: var(--_se-select-fs);
126
+ padding: var(--_se-select-py) var(--_se-select-px);
127
+
128
+ appearance: none;
129
+ font-family: inherit;
130
+ height: 100%; // Fill the height of its parent
131
+ line-height: var(--lh-sm);
132
+ outline: 0;
133
+ padding-right: var(--su32);
134
+ position: relative; // This prevents Firefox from requiring a second click to select options
135
+ width: 100%;
136
+ }
137
+
138
+ .s-input-icon {
139
+ right: var(--su32);
140
+ }
141
+
142
+ color: var(--fc-dark);
143
+ position: relative;
144
+ }
145
+
146
+ // [1] The readonly attribute is not supported on select elements
147
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly
148
+ // and https://github.com/StackExchange/Stacks/pull/1040#discussion_r931144086
@@ -213,7 +213,6 @@
213
213
  position: relative; // so that it's the positioning parent for the :after
214
214
  }
215
215
 
216
-
217
216
  // COLOR ALTERNATIVES
218
217
  .alternate-color(@name) {
219
218
  &.s-sidebarwidget__@{name} {
@@ -1,8 +1,3 @@
1
- .s-table-container {
2
- overflow-x: auto;
3
- @scrollbar-styles();
4
- }
5
-
6
1
  .s-table {
7
2
  @ta-cell-border: var(--su-static1) solid var(--bc-medium);
8
3
  @ta-columns: (100% / 12);
@@ -1,4 +1,4 @@
1
- import * as Stacks from "../stacks";
1
+ import * as Stacks from "../../stacks";
2
2
 
3
3
  export class TableController extends Stacks.StacksController {
4
4
  static targets = ["column"];
@@ -0,0 +1,4 @@
1
+ .s-table-container {
2
+ overflow-x: auto;
3
+ @scrollbar-styles();
4
+ }
@@ -42,12 +42,12 @@
42
42
  // MODIFIERS
43
43
  // Sizes
44
44
  &&__xs {
45
- --_ta-fs: var(--fs-fine);
45
+ .size-styles(xs; ta; @styles: fs);
46
46
  --_ta-lh: 1.4;
47
47
  --_ta-px: var(--su2);
48
48
  }
49
49
  &&__sm {
50
- --_ta-fs: var(--fs-caption);
50
+ .size-styles(sm; ta; @styles: fs);
51
51
  --_ta-lh: 1.5;
52
52
  }
53
53
  &&__md {
@@ -56,7 +56,7 @@
56
56
  --_ta-lh: 1.733333333;
57
57
  }
58
58
  &&__lg {
59
- --_ta-br: calc(var(--br-sm) + 1px);
59
+ --_ta-br: calc(var(--br-sm) + var(--su-static1));
60
60
  --_ta-fs: var(--fs-subheading);
61
61
  --_ta-lh: 1.684210526;
62
62
  --_ta-px: var(--su6);
@@ -0,0 +1,35 @@
1
+ // See also ./lib/components/notice/notice.less
2
+ .s-toast {
3
+ @media (prefers-reduced-motion) {
4
+ transform: none !important;
5
+ }
6
+
7
+ &[aria-hidden="false"] {
8
+ opacity: 1;
9
+ transform: translate3d(0, 0, 0);
10
+ transition: visibility 0s 0s, opacity 100ms var(--te-smooth) 0s, transform 100ms var(--te-smooth) 0s;
11
+ visibility: visible;
12
+ }
13
+
14
+ .s-notice {
15
+ box-shadow: var(--bs-sm);
16
+ max-width: 44rem;
17
+ padding-bottom: var(--su8);
18
+ padding-top: var(--su8);
19
+ pointer-events: all;
20
+ width: 100%;
21
+ }
22
+
23
+ display: flex;
24
+ justify-content: center;
25
+ left: var(--su8);
26
+ opacity: 0;
27
+ pointer-events: none;
28
+ position: fixed;
29
+ right: var(--su8);
30
+ top: var(--su16);
31
+ transform: translate3d(0, -66px, 0);
32
+ transition: transform 100ms var(--te-smooth-slow) 0s, opacity 60ms var(--te-smooth-slow) 0ms, visibility 0s 150ms;
33
+ visibility: hidden;
34
+ z-index: calc(var(--zi-modals) + 1); // Toasts should appear above modals
35
+ }
@@ -1,8 +1,8 @@
1
1
  import { html, fixture, expect } from "@open-wc/testing";
2
2
  import { screen } from "@testing-library/dom";
3
3
  import userEvent from "@testing-library/user-event";
4
- import "../ts/index";
5
- import { showToast, hideToast } from "../ts/index";
4
+ import "../../index";
5
+ import { showToast, hideToast } from "../../controllers";
6
6
 
7
7
  const user = userEvent.setup();
8
8
 
@@ -30,17 +30,19 @@ const testToast = (hidden = true) => html` <button
30
30
  </aside>
31
31
  </div>`;
32
32
 
33
- describe("s-toast", () => {
33
+ describe("toast", () => {
34
34
  it("trigger should make toast visible", async () => {
35
35
  await fixture(testToast(true));
36
36
 
37
37
  const button = screen.getAllByRole("button")[0]; // Trigger button
38
38
  const toast = screen.getByTestId("test-toast");
39
39
 
40
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
40
41
  expect(toast).to.have.attribute("aria-hidden", "true");
41
42
  button.addEventListener("click", () => showToast(toast));
42
43
 
43
44
  await user.click(button);
45
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
44
46
  expect(toast).to.have.attribute("aria-hidden", "false");
45
47
  });
46
48
 
@@ -50,10 +52,12 @@ describe("s-toast", () => {
50
52
  const button = screen.getAllByRole("button")[1]; // Close button
51
53
  const toast = screen.getByTestId("test-toast");
52
54
 
55
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
53
56
  expect(toast).to.have.attribute("aria-hidden", "false");
54
57
  button.addEventListener("click", () => hideToast(toast));
55
58
 
56
59
  await user.click(button);
60
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
57
61
  expect(toast).to.have.attribute("aria-hidden", "true");
58
62
  });
59
63
 
@@ -1,4 +1,4 @@
1
- import * as Stacks from "../stacks";
1
+ import * as Stacks from "../../stacks";
2
2
 
3
3
  export class ToastController extends Stacks.StacksController {
4
4
  static targets = ["toast", "initialFocus"];
@@ -0,0 +1,27 @@
1
+ import { runComponentTests } from "../../test/test-utils";
2
+ import { html } from "@open-wc/testing";
3
+ import "../../index";
4
+
5
+ describe("toast > notice", () => {
6
+ // This is a test of notice component wrapped in a toast component
7
+ runComponentTests({
8
+ type: "visual",
9
+ baseClass: "s-notice", // s-toast is a wrapper around s-notice
10
+ variants: ["info", "success", "warning", "danger"],
11
+ modifiers: {
12
+ primary: ["important"],
13
+ },
14
+ attributes: {
15
+ ariaHidden: "false",
16
+ },
17
+ children: {
18
+ toast: "Test toast",
19
+ },
20
+ tag: "aside",
21
+ template: ({ component, testid }) => html`
22
+ <div data-testid="${testid}" class="s-toast" aria-hidden="false">
23
+ ${component}
24
+ </div>
25
+ `,
26
+ });
27
+ });
@@ -5,6 +5,14 @@
5
5
  --_ts-multiple-bg: unset;
6
6
  --_ts-multiple-fc: var(--black-500);
7
7
 
8
+ fieldset[disabled] & {
9
+ &,
10
+ & label {
11
+ cursor: not-allowed;
12
+ opacity: var(--_o-disabled-static);
13
+ }
14
+ }
15
+
8
16
  &&__multiple { // TODO split single and multiple toggle into two seperate components
9
17
  input[type="radio"] {
10
18
  &:checked {
@@ -1,4 +1,4 @@
1
- import * as Stacks from "../stacks";
1
+ import * as Stacks from "../../stacks";
2
2
 
3
3
  interface FilePreview {
4
4
  data?: string | ArrayBuffer;
@@ -0,0 +1,33 @@
1
+ // export all controllers *with helpers* so they can be bulk re-exported by the package entry point
2
+ export {
3
+ BannerController,
4
+ hideBanner,
5
+ showBanner,
6
+ } from "./components/banner/banner";
7
+ export { ExpandableController } from "./components/expandable/expandable";
8
+ export {
9
+ ModalController,
10
+ hideModal,
11
+ showModal,
12
+ } from "./components/modal/modal";
13
+ export { TabListController } from "./components/navigation/navigation";
14
+ export {
15
+ attachPopover,
16
+ detachPopover,
17
+ hidePopover,
18
+ BasePopoverController,
19
+ PopoverController,
20
+ showPopover,
21
+ } from "./components/popover/popover";
22
+ export { TableController } from "./components/table/table";
23
+ export {
24
+ ToastController,
25
+ hideToast,
26
+ showToast,
27
+ } from "./components/toast/toast";
28
+ export {
29
+ setTooltipHtml,
30
+ setTooltipText,
31
+ TooltipController,
32
+ } from "./components/popover/tooltip";
33
+ export { UploaderController } from "./components/uploader/uploader";
@@ -88,17 +88,6 @@
88
88
  }
89
89
  }
90
90
 
91
- // ===========================================================================
92
- // -- APPEARANCE
93
- // Use this to overwrite the default appearance properties
94
- // ---------------------------------------------------------------------------
95
- .appearance(@all) {
96
- -webkit-appearance: @all;
97
- -moz-appearance: @all;
98
- appearance: @all;
99
- }
100
-
101
-
102
91
  // ===========================================================================
103
92
  // -- FONT FACE
104
93
  // Used to load hosted, custom webfonts. You must provide the font's
@@ -194,6 +183,79 @@
194
183
  @amountDecimal);
195
184
  }
196
185
 
186
+ // =============================================================================
187
+ // -- SIZE STYLES
188
+ // The following mixins let us generate pseudo-private custom properties
189
+ // for common sizes. They expect a size (@size), a prefix for the custom
190
+ // property (@prefix), and an array of comma-separates abbreviated styles
191
+ // (@styles).
192
+ // -----------------------------------------------------------------------------
193
+
194
+ .size-styles(@size, @prefix, @styles, @index: length(@styles)) {
195
+ & when (@index > 0) {
196
+ @style: extract(@styles, @index);
197
+
198
+ // xs
199
+ & when (@size = xs) and (@style = fs) {
200
+ --_@{prefix}-fs: var(--fs-fine);
201
+ }
202
+
203
+ // sm
204
+ & when (@size = sm) and (@style = fs) {
205
+ --_@{prefix}-fs: var(--fs-caption);
206
+ }
207
+
208
+ // md
209
+ & when (@size = md) and (@style = br) {
210
+ --_@{prefix}-br: calc(var(--br-sm) + var(--su-static1));
211
+ }
212
+ & when (@size = md) and (@style = fs) {
213
+ --_@{prefix}-fs: var(--fs-body3);
214
+ }
215
+
216
+ // lg
217
+ & when (@size = lg) and (@style = br) {
218
+ --_@{prefix}-br: calc(var(--br-sm) + var(--su-static1));
219
+ }
220
+ & when (@size = lg) and (@style = fs) {
221
+ --_@{prefix}-fs: var(--fs-title);
222
+ }
223
+
224
+ // xl
225
+ & when (@size = xl) and (@style = br) {
226
+ --_@{prefix}-br: var(--br-md);
227
+ }
228
+ & when (@size = xl) and (@style = fs) {
229
+ --_@{prefix}-fs: var(--fs-headline1);
230
+ }
231
+
232
+ .size-styles(@size, @prefix, @styles, @index: @index - 1);
233
+ }
234
+ }
235
+
236
+ // =============================================================================
237
+ // -- WEBKIT AUTOFILL
238
+ // -----------------------------------------------------------------------------
239
+ .webkit-autofill() {
240
+ &:-webkit-autofill {
241
+ &:focus {
242
+ border-color: var(--blue-300);
243
+ // Since the box shadow is overwritten to show a background, we have to re-add the focus outline
244
+ -webkit-box-shadow: 0 0 0 1000px var(--blue-050) inset, 0 0 0 var(--su-static4) var(--focus-ring);
245
+ }
246
+
247
+ -webkit-box-shadow: 0 0 0 1000px var(--theme-secondary-050) inset; // This acts as a background color by stretching an inset box shadow across the input
248
+ -webkit-text-fill-color: var(--black);
249
+ border-color: var(--blue-300);
250
+ transition: background-color 0s 50000s; // A hack to infinitely delay background styles that come from the browser.
251
+ }
252
+
253
+ &::-webkit-contacts-auto-fill-button {
254
+ background-color: var(--black); // In Safari, make the autocomplete button darkmode-aware
255
+ }
256
+
257
+ }
258
+
197
259
  // ===========================================================================
198
260
  // Internals only beyond this point -- helpers for .font-face()
199
261
  // ---------------------------------------------------------------------------
@@ -1,4 +1,4 @@
1
- import "../css/stacks.less";
1
+ import "./stacks.less";
2
2
  import {
3
3
  BannerController,
4
4
  ExpandableController,
@@ -0,0 +1,44 @@
1
+ .input-states(@rules) {
2
+ .is-disabled &,
3
+ .is-readonly &,
4
+ .has-success &,
5
+ .has-error &,
6
+ .has-warning & {
7
+ @rules();
8
+ }
9
+ };
10
+
11
+ .validation-states(@prefix, @error: {}, @success: {}, @warning: {}) {
12
+ .has-error &,
13
+ .has-success &,
14
+ .has-warning & {
15
+ --_@{prefix}-bc-focus: ~"var(--_@{prefix}-bc)";
16
+ }
17
+
18
+ .has-error & {
19
+ --_@{prefix}-bc: var(--red-400);
20
+ --_@{prefix}-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring-error);
21
+ @error();
22
+ }
23
+
24
+ .has-success & {
25
+ --_@{prefix}-bc: var(--green-400);
26
+ --_@{prefix}-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring-success);
27
+ @success();
28
+ }
29
+
30
+ .has-warning & {
31
+ --_@{prefix}-bc: var(--yellow-600);
32
+ --_@{prefix}-bs-focus: 0 0 0 var(--su-static4) var(--focus-ring-warning);
33
+ @warning();
34
+ }
35
+ }
36
+
37
+ .is-disabled,
38
+ .is-readonly,
39
+ .has-success,
40
+ .has-error,
41
+ .has-warning {
42
+ position: relative;
43
+ }
44
+
@@ -16,10 +16,9 @@
16
16
  // ----------------------------------------------------------------------------
17
17
  // -- SET BASIC STYLES FOR BODY
18
18
  @import "base/body.less";
19
-
20
19
  // -- LESS CONSTANTS AND MIXINS
21
20
  @import "exports/exports.less";
22
21
 
23
22
  // -- CONFIG
24
23
  @import "base/configuration-static.less";
25
- @import "base/internals.less";
24
+ @import "base/internal.less";
@@ -0,0 +1,93 @@
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/icon.less";
6
+ @import "input-utils.less";
7
+
8
+ // -- COMPONENTS
9
+ @import "components/activity-indicator/activity-indicator.less";
10
+ @import "components/anchor/anchor.less";
11
+ @import "components/avatar/avatar.less";
12
+ @import "components/award-bling/award-bling.less";
13
+ @import "components/badge/badge.less";
14
+ @import "components/banner/banner.less";
15
+ @import "components/block-link/block-link.less";
16
+ @import "components/breadcrumbs/breadcrumbs.less";
17
+ @import "components/button/button.less";
18
+ @import "components/button-group/button-group.less";
19
+ @import "components/card/card.less";
20
+ @import "components/check-control/check-control.less";
21
+ @import "components/check-group/check-group.less";
22
+ @import "components/checkbox_radio/checkbox_radio.less";
23
+ @import "components/code-block/code-block.less";
24
+ @import "components/description/description.less";
25
+ @import "components/empty-state/empty-state.less";
26
+ @import "components/expandable/expandable.less";
27
+ @import "components/input_textarea/input_textarea.less";
28
+ @import "components/input-fill/input-fill.less";
29
+ @import "components/input-icon/input-icon.less";
30
+ @import "components/input-message/input-message.less";
31
+ @import "components/label/label.less";
32
+ @import "components/link/link.less";
33
+ @import "components/link-preview/link-preview.less";
34
+ @import "components/menu/menu.less";
35
+ @import "components/modal/modal.less";
36
+ @import "components/navigation/navigation.less";
37
+ @import "components/notice/notice.less";
38
+ @import "components/page-title/page-title.less";
39
+ @import "components/pagination/pagination.less";
40
+ @import "components/popover/popover.less";
41
+ @import "components/post-summary/post-summary.less";
42
+ @import "components/progress-bar/progress-bar.less";
43
+ @import "components/prose/prose.less";
44
+ @import "components/select/select.less";
45
+ @import "components/sidebar-widget/sidebar-widget.less";
46
+ @import "components/spinner/spinner.less";
47
+ @import "components/table/table.less";
48
+ @import "components/table-container/table-container.less";
49
+ @import "components/tag/tag.less";
50
+ @import "components/toast/toast.less";
51
+ @import "components/toggle-switch/toggle-switch.less";
52
+ @import "components/topbar/topbar.less";
53
+ @import "components/uploader/uploader.less";
54
+ @import "components/user-card/user-card.less";
55
+
56
+ // LESS CONSTANTS AND MIXINS
57
+ @import "exports/exports.less";
58
+
59
+ // -- ATOMIC CLASSES
60
+ @import "atomic/border.less";
61
+ @import "atomic/color.less";
62
+ @import "atomic/flex.less";
63
+ @import "atomic/gap.less";
64
+ @import "atomic/grid.less";
65
+ @import "atomic/spacing.less";
66
+ @import "atomic/typography.less";
67
+ @import "atomic/misc.less";
68
+ @import "atomic/width-height.less";
69
+
70
+ /* stylelint-disable */
71
+ #stacks-internals #screen-lg({
72
+ #stacks-internals-collect-large();
73
+ });
74
+ #stacks-internals #screen-md({
75
+ #stacks-internals-collect-medium();
76
+ });
77
+ #stacks-internals #screen-sm({
78
+ #stacks-internals-collect-small();
79
+ });
80
+
81
+ @media print { // We need printing styles to be last so they can override all other styles.
82
+ .print\:d-block & {
83
+ display: block !important;
84
+ }
85
+ .print\:d-none & {
86
+ display: none !important;
87
+ }
88
+ }
89
+ /* stylelint-enable */
90
+
91
+ // CONFIG
92
+ @import "base/configuration-static.less";
93
+ @import "base/internal.less";