@getflip/swirl-components 0.107.0 → 0.108.1
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.
- package/components.json +19 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-heading.cjs.entry.js +3 -15
- package/dist/cjs/swirl-popover_2.cjs.entry.js +4 -2
- package/dist/cjs/swirl-text.cjs.entry.js +765 -8
- package/dist/cjs/swirl-tooltip.cjs.entry.js +2 -2
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-heading/swirl-heading.css +4 -0
- package/dist/collection/components/swirl-heading/swirl-heading.js +2 -23
- package/dist/collection/components/swirl-heading/swirl-heading.spec.js +2 -2
- package/dist/collection/components/swirl-popover/swirl-popover.js +22 -2
- package/dist/collection/components/swirl-popover/swirl-popover.stories.js +3 -0
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.stories.js +1 -0
- package/dist/collection/components/swirl-search/swirl-search.stories.js +0 -3
- package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.stories.js +0 -3
- package/dist/collection/components/swirl-time-input/swirl-time-input.stories.js +0 -3
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.css +1 -1
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +1 -1
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-heading2.js +4 -16
- package/dist/components/swirl-popover2.js +5 -2
- package/dist/components/swirl-text2.js +759 -2
- package/dist/components/swirl-tooltip2.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-heading.entry.js +3 -15
- package/dist/esm/swirl-popover_2.entry.js +4 -2
- package/dist/esm/swirl-text.entry.js +759 -2
- package/dist/esm/swirl-tooltip.entry.js +2 -2
- package/dist/swirl-components/p-39cf2a0f.entry.js +8 -0
- package/dist/swirl-components/p-bd58af17.entry.js +1 -0
- package/dist/swirl-components/p-bff41b61.entry.js +1 -0
- package/dist/swirl-components/p-e2870d0c.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-heading/swirl-heading.d.ts +0 -4
- package/dist/types/components/swirl-popover/swirl-popover.d.ts +1 -0
- package/dist/types/components/swirl-popover/swirl-popover.stories.d.ts +3 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +2 -3
- package/vscode-data.json +4 -0
- package/dist/cjs/balancetext-562c7a48.js +0 -763
- package/dist/components/balancetext.js +0 -761
- package/dist/esm/balancetext-fa49c64f.js +0 -761
- package/dist/swirl-components/p-52282426.entry.js +0 -8
- package/dist/swirl-components/p-8d3d2f60.entry.js +0 -1
- package/dist/swirl-components/p-d7af31e3.entry.js +0 -1
- package/dist/swirl-components/p-f6698af0.entry.js +0 -1
- package/dist/swirl-components/p-f83a5757.js +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-99d0060d.js';
|
|
2
2
|
import { c as classnames } from './index-d280dafb.js';
|
|
3
|
-
import { b as balancetext } from './balancetext-fa49c64f.js';
|
|
4
3
|
|
|
5
|
-
const swirlHeadingCss = ".sc-swirl-heading-h{display:block;width:100%}.sc-swirl-heading-h *.sc-swirl-heading{box-sizing:border-box}.heading.sc-swirl-heading{display:block;width:100%;margin:0;padding:0;text-align:start}.heading--align-start.sc-swirl-heading{text-align:start}.heading--align-center.sc-swirl-heading{text-align:center}.heading--align-end.sc-swirl-heading{text-align:end}.heading--level-1.sc-swirl-heading{font-size:var(--s-font-size-2xl);font-weight:var(--s-font-weight-bold);line-height:var(--s-line-height-2xl);letter-spacing:var(--s-letter-spacing-tight)}.heading--level-2.sc-swirl-heading{font-size:var(--s-font-size-xl);font-weight:var(--s-font-weight-bold);line-height:var(--s-line-height-xl)}.heading--level-3.sc-swirl-heading{font-size:var(--s-font-size-lg);font-weight:var(--s-font-weight-semibold);line-height:var(--s-line-height-lg)}.heading--level-4.sc-swirl-heading{font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-semibold);line-height:var(--s-line-height-base)}.heading--level-5.sc-swirl-heading,.heading--level-6.sc-swirl-heading{font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-semibold);line-height:var(--s-line-height-sm)}.heading--truncate.sc-swirl-heading{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";
|
|
4
|
+
const swirlHeadingCss = ".sc-swirl-heading-h{display:block;width:100%}.sc-swirl-heading-h *.sc-swirl-heading{box-sizing:border-box}.heading.sc-swirl-heading{display:block;width:100%;margin:0;padding:0;text-align:start}.heading--balanced.sc-swirl-heading{text-wrap:balance}.heading--align-start.sc-swirl-heading{text-align:start}.heading--align-center.sc-swirl-heading{text-align:center}.heading--align-end.sc-swirl-heading{text-align:end}.heading--level-1.sc-swirl-heading{font-size:var(--s-font-size-2xl);font-weight:var(--s-font-weight-bold);line-height:var(--s-line-height-2xl);letter-spacing:var(--s-letter-spacing-tight)}.heading--level-2.sc-swirl-heading{font-size:var(--s-font-size-xl);font-weight:var(--s-font-weight-bold);line-height:var(--s-line-height-xl)}.heading--level-3.sc-swirl-heading{font-size:var(--s-font-size-lg);font-weight:var(--s-font-weight-semibold);line-height:var(--s-line-height-lg)}.heading--level-4.sc-swirl-heading{font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-semibold);line-height:var(--s-line-height-base)}.heading--level-5.sc-swirl-heading,.heading--level-6.sc-swirl-heading{font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-semibold);line-height:var(--s-line-height-sm)}.heading--truncate.sc-swirl-heading{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";
|
|
6
5
|
|
|
7
6
|
const SwirlHeading = class {
|
|
8
7
|
constructor(hostRef) {
|
|
@@ -16,18 +15,6 @@ const SwirlHeading = class {
|
|
|
16
15
|
this.text = undefined;
|
|
17
16
|
this.truncate = undefined;
|
|
18
17
|
}
|
|
19
|
-
componentDidRender() {
|
|
20
|
-
this.rebalance();
|
|
21
|
-
}
|
|
22
|
-
onWindowResize() {
|
|
23
|
-
this.rebalance();
|
|
24
|
-
}
|
|
25
|
-
rebalance() {
|
|
26
|
-
if (!this.balance || !Boolean(this.headingEl) || Boolean(this.lines)) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
balancetext(this.headingEl);
|
|
30
|
-
}
|
|
31
18
|
render() {
|
|
32
19
|
const Tag = this.as || `h${this.level}`;
|
|
33
20
|
const styles = Boolean(this.lines)
|
|
@@ -40,9 +27,10 @@ const SwirlHeading = class {
|
|
|
40
27
|
}
|
|
41
28
|
: undefined;
|
|
42
29
|
const className = classnames("heading", `heading--align-${this.align}`, `heading--level-${this.level}`, {
|
|
30
|
+
"heading--balanced": this.balance,
|
|
43
31
|
"heading--truncate": this.truncate,
|
|
44
32
|
});
|
|
45
|
-
return (h(Host, null, h(Tag, { class: className, id: this.headingId,
|
|
33
|
+
return (h(Host, null, h(Tag, { class: className, id: this.headingId, style: styles }, this.text)));
|
|
46
34
|
}
|
|
47
35
|
};
|
|
48
36
|
SwirlHeading.style = swirlHeadingCss;
|
|
@@ -59,6 +59,7 @@ const SwirlPopover = class {
|
|
|
59
59
|
this.offset = 8;
|
|
60
60
|
this.popoverId = undefined;
|
|
61
61
|
this.placement = "bottom-start";
|
|
62
|
+
this.returnFocusToTrigger = true;
|
|
62
63
|
this.trigger = undefined;
|
|
63
64
|
this.triggerContainer = undefined;
|
|
64
65
|
this.useContainerWidth = undefined;
|
|
@@ -134,14 +135,15 @@ const SwirlPopover = class {
|
|
|
134
135
|
this.updateTriggerAttributes();
|
|
135
136
|
}, 150);
|
|
136
137
|
this.unlockBodyScroll();
|
|
137
|
-
this.
|
|
138
|
+
if (this.returnFocusToTrigger) {
|
|
139
|
+
this.getNativeTriggerElement()?.focus();
|
|
140
|
+
}
|
|
138
141
|
}
|
|
139
142
|
/**
|
|
140
143
|
* Open the popover.
|
|
141
144
|
* @returns
|
|
142
145
|
*/
|
|
143
146
|
async open(triggerEl) {
|
|
144
|
-
console.log("open", triggerEl);
|
|
145
147
|
this.triggerEl = triggerEl || this.triggerEl;
|
|
146
148
|
if (this.active || !Boolean(this.triggerEl)) {
|
|
147
149
|
return;
|