@stackoverflow/stacks 1.9.0 → 1.9.2

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 (132) hide show
  1. package/README.md +161 -153
  2. package/dist/components/table/table.d.ts +26 -4
  3. package/dist/css/stacks.css +21 -6
  4. package/dist/css/stacks.min.css +1 -1
  5. package/dist/js/stacks.js +93 -64
  6. package/dist/js/stacks.min.js +1 -1
  7. package/lib/atomic/border.less +397 -397
  8. package/lib/atomic/color.less +210 -210
  9. package/lib/atomic/flex.less +426 -426
  10. package/lib/atomic/gap.less +44 -44
  11. package/lib/atomic/grid.less +139 -139
  12. package/lib/atomic/misc.less +343 -343
  13. package/lib/atomic/spacing.less +342 -342
  14. package/lib/atomic/typography.less +267 -267
  15. package/lib/atomic/width-height.less +194 -194
  16. package/lib/base/body.less +44 -44
  17. package/lib/base/configuration-static.less +61 -61
  18. package/lib/base/fieldset.less +5 -5
  19. package/lib/base/icon.less +11 -11
  20. package/lib/base/internal.less +220 -220
  21. package/lib/base/reset-meyer.less +64 -64
  22. package/lib/base/reset-normalize.less +449 -449
  23. package/lib/base/reset.less +20 -20
  24. package/lib/components/activity-indicator/activity-indicator.a11y.test.ts +21 -21
  25. package/lib/components/activity-indicator/activity-indicator.less +40 -40
  26. package/lib/components/activity-indicator/activity-indicator.visual.test.ts +23 -23
  27. package/lib/components/anchor/anchor.less +61 -61
  28. package/lib/components/avatar/avatar.a11y.test.ts +36 -36
  29. package/lib/components/avatar/avatar.less +108 -108
  30. package/lib/components/avatar/avatar.visual.test.ts +54 -54
  31. package/lib/components/award-bling/award-bling.a11y.test.ts +17 -0
  32. package/lib/components/award-bling/award-bling.less +31 -31
  33. package/lib/components/award-bling/award-bling.visual.test.ts +26 -0
  34. package/lib/components/badge/badge.less +251 -251
  35. package/lib/components/banner/banner.a11y.test.ts +37 -0
  36. package/lib/components/banner/banner.less +51 -51
  37. package/lib/components/banner/banner.test.ts +73 -77
  38. package/lib/components/banner/banner.ts +149 -149
  39. package/lib/components/banner/banner.visual.test.ts +37 -36
  40. package/lib/components/block-link/block-link.a11y.test.ts +68 -0
  41. package/lib/components/block-link/block-link.less +80 -80
  42. package/lib/components/block-link/block-link.visual.test.ts +61 -0
  43. package/lib/components/breadcrumbs/breadcrumbs.a11y.test.ts +37 -0
  44. package/lib/components/breadcrumbs/breadcrumbs.less +41 -41
  45. package/lib/components/breadcrumbs/breadcrumbs.visual.test.ts +37 -0
  46. package/lib/components/button/button.a11y.test.ts +32 -32
  47. package/lib/components/button/button.less +502 -502
  48. package/lib/components/button/button.visual.test.ts +52 -52
  49. package/lib/components/button-group/button-group.less +83 -83
  50. package/lib/components/card/card.a11y.test.ts +13 -0
  51. package/lib/components/card/card.less +29 -29
  52. package/lib/components/card/card.visual.test.ts +54 -0
  53. package/lib/components/check-control/check-control.less +17 -17
  54. package/lib/components/check-group/check-group.less +19 -19
  55. package/lib/components/checkbox_radio/checkbox_radio.less +158 -158
  56. package/lib/components/code-block/code-block.less +116 -116
  57. package/lib/components/description/description.less +9 -9
  58. package/lib/components/empty-state/empty-state.less +16 -16
  59. package/lib/components/expandable/expandable.less +118 -118
  60. package/lib/components/expandable/expandable.test.ts +51 -53
  61. package/lib/components/expandable/expandable.ts +238 -238
  62. package/lib/components/input-fill/input-fill.less +35 -35
  63. package/lib/components/input-icon/input-icon.less +45 -45
  64. package/lib/components/input-message/input-message.less +48 -48
  65. package/lib/components/input_textarea/input_textarea.less +166 -166
  66. package/lib/components/label/label.less +111 -111
  67. package/lib/components/link/link.less +119 -119
  68. package/lib/components/link-preview/link-preview.less +139 -139
  69. package/lib/components/menu/menu.less +41 -41
  70. package/lib/components/modal/modal.less +113 -113
  71. package/lib/components/modal/modal.ts +379 -379
  72. package/lib/components/navigation/navigation.less +134 -134
  73. package/lib/components/navigation/navigation.ts +128 -128
  74. package/lib/components/notice/notice.less +203 -203
  75. package/lib/components/page-title/page-title.less +51 -51
  76. package/lib/components/pagination/pagination.less +52 -52
  77. package/lib/components/popover/popover.less +148 -148
  78. package/lib/components/popover/popover.ts +651 -651
  79. package/lib/components/popover/tooltip.test.ts +62 -66
  80. package/lib/components/popover/tooltip.ts +343 -343
  81. package/lib/components/popover/tooltip.visual.test.ts +31 -31
  82. package/lib/components/post-summary/post-summary.less +415 -415
  83. package/lib/components/progress-bar/progress-bar.less +291 -291
  84. package/lib/components/prose/prose.less +452 -452
  85. package/lib/components/select/select.less +148 -148
  86. package/lib/components/sidebar-widget/sidebar-widget.less +257 -258
  87. package/lib/components/spinner/spinner.less +103 -103
  88. package/lib/components/table/table.less +307 -292
  89. package/lib/components/table/table.test.ts +366 -0
  90. package/lib/components/table/table.ts +296 -263
  91. package/lib/components/table-container/table-container.less +4 -4
  92. package/lib/components/tag/tag.less +213 -213
  93. package/lib/components/toast/toast.less +35 -35
  94. package/lib/components/toast/toast.test.ts +63 -67
  95. package/lib/components/toast/toast.ts +357 -357
  96. package/lib/components/toast/toast.visual.test.ts +27 -27
  97. package/lib/components/toggle-switch/toggle-switch.less +110 -110
  98. package/lib/components/topbar/topbar.less +436 -435
  99. package/lib/components/uploader/uploader.less +195 -195
  100. package/lib/components/uploader/uploader.ts +205 -205
  101. package/lib/components/user-card/user-card.less +129 -129
  102. package/lib/controllers.ts +33 -33
  103. package/lib/exports/constants-colors.less +1112 -1111
  104. package/lib/exports/constants-helpers.less +108 -108
  105. package/lib/exports/constants-type.less +153 -153
  106. package/lib/exports/exports.less +15 -15
  107. package/lib/exports/mixins.less +299 -299
  108. package/lib/index.ts +32 -32
  109. package/lib/input-utils.less +44 -44
  110. package/lib/stacks-dynamic.less +24 -24
  111. package/lib/stacks-static.less +93 -93
  112. package/lib/stacks.less +13 -13
  113. package/lib/stacks.ts +113 -113
  114. package/lib/test/open-wc-testing-patch.d.ts +26 -0
  115. package/lib/test/test-utils.ts +466 -444
  116. package/lib/tsconfig.build.json +4 -0
  117. package/lib/tsconfig.json +16 -13
  118. package/package.json +106 -105
  119. package/dist/components/activity-indicator/activity-indicator.a11y.test.d.ts +0 -1
  120. package/dist/components/activity-indicator/activity-indicator.visual.test.d.ts +0 -1
  121. package/dist/components/avatar/avatar.a11y.test.d.ts +0 -1
  122. package/dist/components/avatar/avatar.visual.test.d.ts +0 -1
  123. package/dist/components/banner/banner.test.d.ts +0 -1
  124. package/dist/components/banner/banner.visual.test.d.ts +0 -1
  125. package/dist/components/button/button.a11y.test.d.ts +0 -1
  126. package/dist/components/button/button.visual.test.d.ts +0 -1
  127. package/dist/components/expandable/expandable.test.d.ts +0 -1
  128. package/dist/components/popover/tooltip.test.d.ts +0 -1
  129. package/dist/components/popover/tooltip.visual.test.d.ts +0 -1
  130. package/dist/components/toast/toast.test.d.ts +0 -1
  131. package/dist/components/toast/toast.visual.test.d.ts +0 -1
  132. package/dist/test/test-utils.d.ts +0 -136
@@ -1,238 +1,238 @@
1
- import * as Stacks from "../../stacks";
2
-
3
- // Radio buttons only trigger a change event when they're *checked*, but not when
4
- // they're *unchecked*. Therefore, if we have an active `s-expandable-control` in
5
- // the document, we listen for change events on *all* radio buttons and find any
6
- // other radio buttons in the same `name` group, triggering a custom event on all
7
- // of them so the controller can re-evaluate.
8
- //
9
- // We're keeping a count of how many of these controllers are connected to the DOM,
10
- // so only have this global listener when we actually need it.
11
- const RADIO_OFF_EVENT = "s-expandable-control:radio-off";
12
-
13
- function globalChangeListener(e: UIEvent) {
14
- const target = e.target;
15
- if (
16
- !(target instanceof HTMLInputElement) ||
17
- target.nodeName !== "INPUT" ||
18
- target.type !== "radio"
19
- ) {
20
- return;
21
- }
22
- document
23
- .querySelectorAll('input[type="radio"][name="' + target.name + '"]')
24
- .forEach(function (other) {
25
- if (other === e.target) {
26
- return;
27
- }
28
- let customEvent;
29
- try {
30
- customEvent = new Event(RADIO_OFF_EVENT);
31
- } catch (ex) {
32
- // Internet Explorer
33
- customEvent = document.createEvent("Event");
34
- customEvent.initEvent(RADIO_OFF_EVENT, true, true);
35
- }
36
- other.dispatchEvent(customEvent);
37
- });
38
- }
39
-
40
- let refCount = 0;
41
- function globalChangeListenerRequired(required: boolean) {
42
- if (required) {
43
- refCount++;
44
- if (refCount === 1) {
45
- document.body.addEventListener(
46
- "change",
47
- globalChangeListener as EventListener
48
- );
49
- }
50
- } else {
51
- refCount--;
52
- if (refCount === 0) {
53
- document.body.removeEventListener(
54
- "change",
55
- globalChangeListener as EventListener
56
- );
57
- }
58
- }
59
- }
60
-
61
- export class ExpandableController extends Stacks.StacksController {
62
- private isCollapsed!: () => boolean;
63
- private events!: string[];
64
- private isCheckable!: boolean;
65
- private isRadio!: boolean;
66
- private lastKeydownClickTimestamp = 0;
67
-
68
- initialize() {
69
- if (
70
- this.element.nodeName === "INPUT" &&
71
- ["radio", "checkbox"].indexOf(
72
- (<HTMLInputElement>this.element).type
73
- ) >= 0
74
- ) {
75
- this.isCollapsed = this._isCollapsedForCheckable.bind(this);
76
- this.events = ["change", RADIO_OFF_EVENT];
77
- this.isCheckable = true;
78
- this.isRadio = (<HTMLInputElement>this.element).type === "radio";
79
- } else {
80
- this.isCollapsed = this._isCollapsedForClickable.bind(this);
81
- this.events = ["click", "keydown"];
82
- }
83
- this.listener = this.listener.bind(this);
84
- }
85
-
86
- // for non-checkable elements, the initial source of truth is the collapsed/expanded
87
- // state of the controlled element (unless the element doesn't exist)
88
- _isCollapsedForClickable() {
89
- const cc = this.controlledExpandables;
90
- // the element is considered collapsed if *any* target element is collapsed
91
- return cc.length > 0
92
- ? !cc.every((element) => element.classList.contains("is-expanded"))
93
- : this.element.getAttribute("aria-expanded") === "false";
94
- }
95
-
96
- // for checkable elements, the initial source of truth is the checked state
97
- _isCollapsedForCheckable() {
98
- return !(<HTMLInputElement>this.element).checked;
99
- }
100
-
101
- get controlledExpandables() {
102
- const attr = this.element.getAttribute("aria-controls");
103
- if (!attr) {
104
- throw `[aria-controls="targetId1 ... targetIdN"] attribute required`;
105
- }
106
- const result = attr
107
- .split(/\s+/g)
108
- .map((s) => document.getElementById(s))
109
- .filter((e): e is HTMLElement => !!e);
110
- if (!result.length) {
111
- throw "couldn't find controls";
112
- }
113
- return result;
114
- }
115
-
116
- _dispatchShowHideEvent(isShow: boolean) {
117
- this.triggerEvent(isShow ? "show" : "hide");
118
- }
119
-
120
- _toggleClass(doAdd: boolean) {
121
- if (!this.data.has("toggle-class")) {
122
- return;
123
- }
124
- const cl = this.element.classList;
125
- const toggleClass = this.data.get("toggle-class");
126
- if (!toggleClass) {
127
- throw "couldn't find toggle class";
128
- }
129
- toggleClass.split(/\s+/).forEach(function (cls) {
130
- cl.toggle(cls, !!doAdd);
131
- });
132
- }
133
-
134
- listener(e: Event) {
135
- let newCollapsed;
136
- if (this.isCheckable) {
137
- newCollapsed = !(<HTMLInputElement>this.element).checked;
138
- } else {
139
- if (
140
- e.type == "keydown" &&
141
- e instanceof KeyboardEvent &&
142
- e.keyCode != 13 &&
143
- e.keyCode != 32
144
- ) {
145
- return;
146
- }
147
- if (
148
- e.target !== e.currentTarget &&
149
- ["A", "BUTTON"].indexOf((<HTMLElement>e.target).nodeName) >= 0
150
- ) {
151
- return;
152
- }
153
-
154
- e.preventDefault();
155
-
156
- // Prevent "click" events from toggling the expandable within 300ms of "keydown".
157
- // e.preventDefault() should have done the same, but https://bugzilla.mozilla.org/show_bug.cgi?id=1487102
158
- // doesn't guarantee it.
159
- if (e.type == "keydown") {
160
- this.lastKeydownClickTimestamp = Date.now();
161
- } else if (
162
- e.type == "click" &&
163
- Date.now() - this.lastKeydownClickTimestamp < 300
164
- ) {
165
- return;
166
- }
167
- newCollapsed =
168
- this.element.getAttribute("aria-expanded") === "true";
169
- if (e.type === "click") {
170
- (<HTMLInputElement>this.element).blur();
171
- }
172
- }
173
- this.element.setAttribute(
174
- "aria-expanded",
175
- newCollapsed ? "false" : "true"
176
- );
177
- for (const controlledElement of this.controlledExpandables) {
178
- controlledElement.classList.toggle("is-expanded", !newCollapsed);
179
- }
180
- this._dispatchShowHideEvent(!newCollapsed);
181
- this._toggleClass(!newCollapsed);
182
- }
183
-
184
- connect() {
185
- this.events.forEach((e) => {
186
- this.element.addEventListener(e, this.listener.bind(this));
187
- }, this);
188
-
189
- if (this.isRadio) {
190
- globalChangeListenerRequired(true);
191
- }
192
-
193
- // synchronize state -- in all cases, this means setting the correct `aria-expanded`
194
- // attribute; for checkable controls this also means setting the `is-collapsed` class.
195
- // Note: aria-expanded is currently an invalid attribute on radio elements
196
- // Support for aria-expanded is being debated by the W3C https://github.com/w3c/aria/issues/1404 as recently as June 2022
197
- if (!this.isRadio) {
198
- this.element.setAttribute(
199
- "aria-expanded",
200
- this.isCollapsed() ? "false" : "true"
201
- );
202
- }
203
- if (this.isCheckable) {
204
- const cc = this.controlledExpandables;
205
- if (cc.length) {
206
- const expected = !this.isCollapsed();
207
- // if any element does not match the expected state, set them all to the expected state
208
- if (
209
- cc.some(
210
- (element) =>
211
- element.classList.contains("is-expanded") !==
212
- expected
213
- )
214
- ) {
215
- for (const controlledElement of this
216
- .controlledExpandables) {
217
- controlledElement.classList.toggle(
218
- "is-expanded",
219
- expected
220
- );
221
- }
222
- this._dispatchShowHideEvent(expected);
223
- this._toggleClass(expected);
224
- }
225
- }
226
- }
227
- }
228
-
229
- disconnect() {
230
- this.events.forEach((e) => {
231
- this.element.removeEventListener(e, this.listener.bind(this));
232
- }, this);
233
-
234
- if (this.isRadio) {
235
- globalChangeListenerRequired(false);
236
- }
237
- }
238
- }
1
+ import * as Stacks from "../../stacks";
2
+
3
+ // Radio buttons only trigger a change event when they're *checked*, but not when
4
+ // they're *unchecked*. Therefore, if we have an active `s-expandable-control` in
5
+ // the document, we listen for change events on *all* radio buttons and find any
6
+ // other radio buttons in the same `name` group, triggering a custom event on all
7
+ // of them so the controller can re-evaluate.
8
+ //
9
+ // We're keeping a count of how many of these controllers are connected to the DOM,
10
+ // so only have this global listener when we actually need it.
11
+ const RADIO_OFF_EVENT = "s-expandable-control:radio-off";
12
+
13
+ function globalChangeListener(e: UIEvent) {
14
+ const target = e.target;
15
+ if (
16
+ !(target instanceof HTMLInputElement) ||
17
+ target.nodeName !== "INPUT" ||
18
+ target.type !== "radio"
19
+ ) {
20
+ return;
21
+ }
22
+ document
23
+ .querySelectorAll('input[type="radio"][name="' + target.name + '"]')
24
+ .forEach(function (other) {
25
+ if (other === e.target) {
26
+ return;
27
+ }
28
+ let customEvent;
29
+ try {
30
+ customEvent = new Event(RADIO_OFF_EVENT);
31
+ } catch (ex) {
32
+ // Internet Explorer
33
+ customEvent = document.createEvent("Event");
34
+ customEvent.initEvent(RADIO_OFF_EVENT, true, true);
35
+ }
36
+ other.dispatchEvent(customEvent);
37
+ });
38
+ }
39
+
40
+ let refCount = 0;
41
+ function globalChangeListenerRequired(required: boolean) {
42
+ if (required) {
43
+ refCount++;
44
+ if (refCount === 1) {
45
+ document.body.addEventListener(
46
+ "change",
47
+ globalChangeListener as EventListener
48
+ );
49
+ }
50
+ } else {
51
+ refCount--;
52
+ if (refCount === 0) {
53
+ document.body.removeEventListener(
54
+ "change",
55
+ globalChangeListener as EventListener
56
+ );
57
+ }
58
+ }
59
+ }
60
+
61
+ export class ExpandableController extends Stacks.StacksController {
62
+ private isCollapsed!: () => boolean;
63
+ private events!: string[];
64
+ private isCheckable!: boolean;
65
+ private isRadio!: boolean;
66
+ private lastKeydownClickTimestamp = 0;
67
+
68
+ initialize() {
69
+ if (
70
+ this.element.nodeName === "INPUT" &&
71
+ ["radio", "checkbox"].indexOf(
72
+ (<HTMLInputElement>this.element).type
73
+ ) >= 0
74
+ ) {
75
+ this.isCollapsed = this._isCollapsedForCheckable.bind(this);
76
+ this.events = ["change", RADIO_OFF_EVENT];
77
+ this.isCheckable = true;
78
+ this.isRadio = (<HTMLInputElement>this.element).type === "radio";
79
+ } else {
80
+ this.isCollapsed = this._isCollapsedForClickable.bind(this);
81
+ this.events = ["click", "keydown"];
82
+ }
83
+ this.listener = this.listener.bind(this);
84
+ }
85
+
86
+ // for non-checkable elements, the initial source of truth is the collapsed/expanded
87
+ // state of the controlled element (unless the element doesn't exist)
88
+ _isCollapsedForClickable() {
89
+ const cc = this.controlledExpandables;
90
+ // the element is considered collapsed if *any* target element is collapsed
91
+ return cc.length > 0
92
+ ? !cc.every((element) => element.classList.contains("is-expanded"))
93
+ : this.element.getAttribute("aria-expanded") === "false";
94
+ }
95
+
96
+ // for checkable elements, the initial source of truth is the checked state
97
+ _isCollapsedForCheckable() {
98
+ return !(<HTMLInputElement>this.element).checked;
99
+ }
100
+
101
+ get controlledExpandables() {
102
+ const attr = this.element.getAttribute("aria-controls");
103
+ if (!attr) {
104
+ throw `[aria-controls="targetId1 ... targetIdN"] attribute required`;
105
+ }
106
+ const result = attr
107
+ .split(/\s+/g)
108
+ .map((s) => document.getElementById(s))
109
+ .filter((e): e is HTMLElement => !!e);
110
+ if (!result.length) {
111
+ throw "couldn't find controls";
112
+ }
113
+ return result;
114
+ }
115
+
116
+ _dispatchShowHideEvent(isShow: boolean) {
117
+ this.triggerEvent(isShow ? "show" : "hide");
118
+ }
119
+
120
+ _toggleClass(doAdd: boolean) {
121
+ if (!this.data.has("toggle-class")) {
122
+ return;
123
+ }
124
+ const cl = this.element.classList;
125
+ const toggleClass = this.data.get("toggle-class");
126
+ if (!toggleClass) {
127
+ throw "couldn't find toggle class";
128
+ }
129
+ toggleClass.split(/\s+/).forEach(function (cls) {
130
+ cl.toggle(cls, !!doAdd);
131
+ });
132
+ }
133
+
134
+ listener(e: Event) {
135
+ let newCollapsed;
136
+ if (this.isCheckable) {
137
+ newCollapsed = !(<HTMLInputElement>this.element).checked;
138
+ } else {
139
+ if (
140
+ e.type == "keydown" &&
141
+ e instanceof KeyboardEvent &&
142
+ e.keyCode != 13 &&
143
+ e.keyCode != 32
144
+ ) {
145
+ return;
146
+ }
147
+ if (
148
+ e.target !== e.currentTarget &&
149
+ ["A", "BUTTON"].indexOf((<HTMLElement>e.target).nodeName) >= 0
150
+ ) {
151
+ return;
152
+ }
153
+
154
+ e.preventDefault();
155
+
156
+ // Prevent "click" events from toggling the expandable within 300ms of "keydown".
157
+ // e.preventDefault() should have done the same, but https://bugzilla.mozilla.org/show_bug.cgi?id=1487102
158
+ // doesn't guarantee it.
159
+ if (e.type == "keydown") {
160
+ this.lastKeydownClickTimestamp = Date.now();
161
+ } else if (
162
+ e.type == "click" &&
163
+ Date.now() - this.lastKeydownClickTimestamp < 300
164
+ ) {
165
+ return;
166
+ }
167
+ newCollapsed =
168
+ this.element.getAttribute("aria-expanded") === "true";
169
+ if (e.type === "click") {
170
+ (<HTMLInputElement>this.element).blur();
171
+ }
172
+ }
173
+ this.element.setAttribute(
174
+ "aria-expanded",
175
+ newCollapsed ? "false" : "true"
176
+ );
177
+ for (const controlledElement of this.controlledExpandables) {
178
+ controlledElement.classList.toggle("is-expanded", !newCollapsed);
179
+ }
180
+ this._dispatchShowHideEvent(!newCollapsed);
181
+ this._toggleClass(!newCollapsed);
182
+ }
183
+
184
+ connect() {
185
+ this.events.forEach((e) => {
186
+ this.element.addEventListener(e, this.listener.bind(this));
187
+ }, this);
188
+
189
+ if (this.isRadio) {
190
+ globalChangeListenerRequired(true);
191
+ }
192
+
193
+ // synchronize state -- in all cases, this means setting the correct `aria-expanded`
194
+ // attribute; for checkable controls this also means setting the `is-collapsed` class.
195
+ // Note: aria-expanded is currently an invalid attribute on radio elements
196
+ // Support for aria-expanded is being debated by the W3C https://github.com/w3c/aria/issues/1404 as recently as June 2022
197
+ if (!this.isRadio) {
198
+ this.element.setAttribute(
199
+ "aria-expanded",
200
+ this.isCollapsed() ? "false" : "true"
201
+ );
202
+ }
203
+ if (this.isCheckable) {
204
+ const cc = this.controlledExpandables;
205
+ if (cc.length) {
206
+ const expected = !this.isCollapsed();
207
+ // if any element does not match the expected state, set them all to the expected state
208
+ if (
209
+ cc.some(
210
+ (element) =>
211
+ element.classList.contains("is-expanded") !==
212
+ expected
213
+ )
214
+ ) {
215
+ for (const controlledElement of this
216
+ .controlledExpandables) {
217
+ controlledElement.classList.toggle(
218
+ "is-expanded",
219
+ expected
220
+ );
221
+ }
222
+ this._dispatchShowHideEvent(expected);
223
+ this._toggleClass(expected);
224
+ }
225
+ }
226
+ }
227
+ }
228
+
229
+ disconnect() {
230
+ this.events.forEach((e) => {
231
+ this.element.removeEventListener(e, this.listener.bind(this));
232
+ }, this);
233
+
234
+ if (this.isRadio) {
235
+ globalChangeListenerRequired(false);
236
+ }
237
+ }
238
+ }
@@ -1,35 +1,35 @@
1
- .s-input-fill {
2
- --_if-bc: var(--bc-darker);
3
- --_if-bg: var(--black-050);
4
- --_if-blw: 0;
5
- --_if-blr: 0;
6
- --_if-brr: 0;
7
- --_if-brw: 0;
8
-
9
- &&__clear {
10
- --_if-bc: transparent;
11
- --_if-bg: transparent;
12
- }
13
-
14
- &.order-first {
15
- --_if-blw: var(--su-static1);
16
- --_if-blr: var(--br-sm);
17
- }
18
-
19
- &.order-last {
20
- --_if-brw: var(--su-static1);
21
- --_if-brr: var(--br-sm);
22
- }
23
-
24
- background-color: var(--_if-bg);
25
- border: var(--su-static1) solid var(--_if-bc);
26
- border-left-width: var(--_if-blw);
27
- border-right-width: var(--_if-brw);
28
- border-radius: var(--_if-blr) var(--_if-brr) var(--_if-brr) var(--_if-blr);
29
-
30
- color: var(--fc-medium);
31
- font-family: inherit;
32
- line-height: var(--lh-sm);
33
- padding: 0.6em 0.7em;
34
- white-space: nowrap;
35
- }
1
+ .s-input-fill {
2
+ --_if-bc: var(--bc-darker);
3
+ --_if-bg: var(--black-050);
4
+ --_if-blw: 0;
5
+ --_if-blr: 0;
6
+ --_if-brr: 0;
7
+ --_if-brw: 0;
8
+
9
+ &&__clear {
10
+ --_if-bc: transparent;
11
+ --_if-bg: transparent;
12
+ }
13
+
14
+ &.order-first {
15
+ --_if-blw: var(--su-static1);
16
+ --_if-blr: var(--br-sm);
17
+ }
18
+
19
+ &.order-last {
20
+ --_if-brw: var(--su-static1);
21
+ --_if-brr: var(--br-sm);
22
+ }
23
+
24
+ background-color: var(--_if-bg);
25
+ border: var(--su-static1) solid var(--_if-bc);
26
+ border-left-width: var(--_if-blw);
27
+ border-right-width: var(--_if-brw);
28
+ border-radius: var(--_if-blr) var(--_if-brr) var(--_if-brr) var(--_if-blr);
29
+
30
+ color: var(--fc-medium);
31
+ font-family: inherit;
32
+ line-height: var(--lh-sm);
33
+ padding: 0.6em 0.7em;
34
+ white-space: nowrap;
35
+ }
@@ -1,45 +1,45 @@
1
- .s-input-icon {
2
- --_ii-fc: unset;
3
- --_ii-r: 0.7em;
4
-
5
- // MODIFIERS
6
- .has-error & {
7
- --_ii-fc: var(--red-400);
8
- }
9
-
10
- .has-success & {
11
- --_ii-fc: var(--green-400);
12
- }
13
-
14
- .has-warning & {
15
- --_ii-fc: var(--yellow-600);
16
- }
17
-
18
- .is-disabled & {
19
- --_ii-fc: var(--black-400);
20
- }
21
-
22
- .is-readonly & {
23
- --_ii-fc: var(--black-200);
24
-
25
- .highcontrast-mode({
26
- --_ii-fc: var(--fc-light);
27
- });
28
- }
29
-
30
- &&__creditcard,
31
- &&__search {
32
- --_ii-r: auto;
33
-
34
- color: var(--black-400);
35
- left: 0.7em;
36
- }
37
-
38
- color: var(--_ii-fc);
39
- right: var(--_ii-r);
40
-
41
- margin-top: -9px; // Half the icon's height at 18px for centering;
42
- pointer-events: none;
43
- position: absolute;
44
- top: 50%;
45
- }
1
+ .s-input-icon {
2
+ --_ii-fc: unset;
3
+ --_ii-r: 0.7em;
4
+
5
+ // MODIFIERS
6
+ .has-error & {
7
+ --_ii-fc: var(--red-400);
8
+ }
9
+
10
+ .has-success & {
11
+ --_ii-fc: var(--green-400);
12
+ }
13
+
14
+ .has-warning & {
15
+ --_ii-fc: var(--yellow-600);
16
+ }
17
+
18
+ .is-disabled & {
19
+ --_ii-fc: var(--black-400);
20
+ }
21
+
22
+ .is-readonly & {
23
+ --_ii-fc: var(--black-200);
24
+
25
+ .highcontrast-mode({
26
+ --_ii-fc: var(--fc-light);
27
+ });
28
+ }
29
+
30
+ &&__creditcard,
31
+ &&__search {
32
+ --_ii-r: auto;
33
+
34
+ color: var(--black-400);
35
+ left: 0.7em;
36
+ }
37
+
38
+ color: var(--_ii-fc);
39
+ right: var(--_ii-r);
40
+
41
+ margin-top: -9px; // Half the icon's height at 18px for centering;
42
+ pointer-events: none;
43
+ position: absolute;
44
+ top: 50%;
45
+ }