@getflip/swirl-components 0.152.0 → 0.153.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 (29) hide show
  1. package/components.json +25 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/swirl-button.cjs.entry.js +1 -1
  4. package/dist/cjs/swirl-components.cjs.js +1 -1
  5. package/dist/cjs/swirl-popover_2.cjs.entry.js +3 -0
  6. package/dist/cjs/swirl-text-input.cjs.entry.js +6 -0
  7. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  8. package/dist/collection/components/swirl-button/swirl-button.css +8 -8
  9. package/dist/collection/components/swirl-popover-trigger/swirl-popover-trigger.js +3 -0
  10. package/dist/collection/components/swirl-text-input/swirl-text-input.js +43 -1
  11. package/dist/collection/components/swirl-text-input/swirl-text-input.spec.js +22 -0
  12. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  13. package/dist/components/swirl-button2.js +1 -1
  14. package/dist/components/swirl-popover-trigger2.js +3 -0
  15. package/dist/components/swirl-text-input2.js +9 -1
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/swirl-button.entry.js +1 -1
  18. package/dist/esm/swirl-components.js +1 -1
  19. package/dist/esm/swirl-popover_2.entry.js +3 -0
  20. package/dist/esm/swirl-text-input.entry.js +6 -0
  21. package/dist/swirl-components/{p-dc42011e.entry.js → p-944662a7.entry.js} +1 -1
  22. package/dist/swirl-components/p-b953063e.entry.js +1 -0
  23. package/dist/swirl-components/{p-66890b1c.entry.js → p-d6de0aa2.entry.js} +1 -1
  24. package/dist/swirl-components/swirl-components.css +3 -1
  25. package/dist/swirl-components/swirl-components.esm.js +1 -1
  26. package/dist/types/components/swirl-text-input/swirl-text-input.d.ts +2 -0
  27. package/dist/types/components.d.ts +2 -0
  28. package/package.json +1 -1
  29. package/dist/swirl-components/p-d249be2e.entry.js +0 -1
@@ -218,37 +218,37 @@
218
218
  .button--variant-plain {
219
219
  padding: 0;
220
220
  border-radius: 0;
221
- color: var(--s-interactive-neutral-default);
221
+ color: var(--swirl-plain-button-text-color-default);
222
222
  background-color: transparent;
223
223
  }
224
224
 
225
225
  .button--variant-plain:hover:not(:disabled) {
226
- color: var(--s-interactive-neutral-default);
226
+ color: var(--swirl-plain-button-text-color-hovered);
227
227
  background-color: transparent;
228
228
  text-decoration: underline;
229
229
  text-underline-offset: var(--s-space-4);
230
230
  }
231
231
 
232
232
  .button--variant-plain:hover:not(:disabled) .button__icon {
233
- color: var(--s-interactive-neutral-default);
233
+ color: var(--swirl-plain-button-text-color-hovered);
234
234
  }
235
235
 
236
236
  .button--variant-plain:active:not(:disabled) {
237
- color: var(--s-interactive-neutral-hovered);
237
+ color: var(--swirl-plain-button-text-color-pressed);
238
238
  background-color: transparent;
239
239
  }
240
240
 
241
241
  .button--variant-plain:active:not(:disabled) .button__icon {
242
- color: var(--s-interactive-neutral-hovered);
242
+ color: var(--swirl-plain-button-text-color-pressed);
243
243
  }
244
244
 
245
245
  .button--variant-plain:disabled {
246
- color: var(--s-interactive-neutral-disabled);
246
+ color: var(--swirl-plain-button-text-color-disabled);
247
247
  background-color: transparent;
248
248
  }
249
249
 
250
250
  .button--variant-plain:disabled .button__icon {
251
- color: var(--s-interactive-neutral-disabled);
251
+ color: var(--swirl-plain-button-text-color-disabled);
252
252
  }
253
253
 
254
254
  .button--variant-plain.button--icon-only {
@@ -297,7 +297,7 @@
297
297
 
298
298
  .button--variant-plain .button__icon {
299
299
  margin-left: 0;
300
- color: var(--s-interactive-neutral-default);
300
+ color: var(--swirl-plain-button-text-color-default);
301
301
  }
302
302
 
303
303
  .button--variant-on-image {
@@ -27,6 +27,9 @@ export class SwirlPopoverTrigger {
27
27
  return;
28
28
  }
29
29
  const triggerEl = this.getTriggerEl();
30
+ if (!Boolean(triggerEl)) {
31
+ return;
32
+ }
30
33
  const popoverId = typeof this.popover === "string" ? this.popover : this.popover?.id;
31
34
  if (triggerEl.tagName.startsWith("SWIRL-")) {
32
35
  triggerEl.setAttribute("swirl-aria-controls", popoverId);
@@ -1,4 +1,4 @@
1
- import { h, Host, } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import classnames from "classnames";
3
3
  import { getDesktopMediaQuery } from "../../utils";
4
4
  export class SwirlTextInput {
@@ -114,6 +114,12 @@ export class SwirlTextInput {
114
114
  disconnectedCallback() {
115
115
  this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
116
116
  }
117
+ async blurInput() {
118
+ this.inputEl.blur();
119
+ }
120
+ async focusInput() {
121
+ this.inputEl.focus();
122
+ }
117
123
  watchValue(newValue, oldValue) {
118
124
  if (newValue !== oldValue) {
119
125
  this.valueChange.emit(newValue);
@@ -775,6 +781,42 @@ export class SwirlTextInput {
775
781
  }
776
782
  }];
777
783
  }
784
+ static get methods() {
785
+ return {
786
+ "blurInput": {
787
+ "complexType": {
788
+ "signature": "() => Promise<void>",
789
+ "parameters": [],
790
+ "references": {
791
+ "Promise": {
792
+ "location": "global"
793
+ }
794
+ },
795
+ "return": "Promise<void>"
796
+ },
797
+ "docs": {
798
+ "text": "",
799
+ "tags": []
800
+ }
801
+ },
802
+ "focusInput": {
803
+ "complexType": {
804
+ "signature": "() => Promise<void>",
805
+ "parameters": [],
806
+ "references": {
807
+ "Promise": {
808
+ "location": "global"
809
+ }
810
+ },
811
+ "return": "Promise<void>"
812
+ },
813
+ "docs": {
814
+ "text": "",
815
+ "tags": []
816
+ }
817
+ }
818
+ };
819
+ }
778
820
  static get watchers() {
779
821
  return [{
780
822
  "propName": "value",
@@ -86,4 +86,26 @@ describe("swirl-text-input", () => {
86
86
  expect(spy).toHaveBeenCalled();
87
87
  expect(spy.mock.calls[0][0].detail).toBe("New Value");
88
88
  });
89
+ it("can focus", async () => {
90
+ const page = await newSpecPage({
91
+ components: [SwirlTextInput],
92
+ html: `<swirl-text-input value="Value"></swirl-text-input>`,
93
+ });
94
+ const spy = jest.fn();
95
+ const input = page.root.querySelector(".text-input__input");
96
+ input.addEventListener("focus", spy);
97
+ page.rootInstance.focusInput();
98
+ expect(spy).toHaveBeenCalled();
99
+ });
100
+ it("can blur", async () => {
101
+ const page = await newSpecPage({
102
+ components: [SwirlTextInput],
103
+ html: `<swirl-text-input value="Value"></swirl-text-input>`,
104
+ });
105
+ const spy = jest.fn();
106
+ const input = page.root.querySelector(".text-input__input");
107
+ input.addEventListener("blur", spy);
108
+ page.rootInstance.blurInput();
109
+ expect(spy).toHaveBeenCalled();
110
+ });
89
111
  });