@getflip/swirl-components 0.179.0 → 0.181.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 (55) hide show
  1. package/components.json +49 -3
  2. package/dist/cjs/index-1de6abbd.js +12 -8
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/swirl-app-icon.cjs.entry.js +1 -1
  5. package/dist/cjs/swirl-components.cjs.js +1 -1
  6. package/dist/cjs/swirl-form-control.cjs.entry.js +3 -2
  7. package/dist/cjs/{swirl-icon-info_2.cjs.entry.js → swirl-icon-info.cjs.entry.js} +0 -120
  8. package/dist/cjs/swirl-modal.cjs.entry.js +1 -1
  9. package/dist/cjs/swirl-shell-navigation-item.cjs.entry.js +3 -1
  10. package/dist/cjs/swirl-tooltip.cjs.entry.js +127 -0
  11. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  12. package/dist/collection/components/swirl-app-icon/swirl-app-icon.css +3 -3
  13. package/dist/collection/components/swirl-form-control/swirl-form-control.css +24 -0
  14. package/dist/collection/components/swirl-form-control/swirl-form-control.js +19 -1
  15. package/dist/collection/components/swirl-form-control/swirl-form-control.spec.js +14 -2
  16. package/dist/collection/components/swirl-modal/swirl-modal.css +1 -1
  17. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.stories.js +1 -1
  18. package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.css +17 -4
  19. package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.js +19 -0
  20. package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.stories.js +1 -1
  21. package/dist/collection/components/swirl-text-input/swirl-text-input.js +1 -1
  22. package/dist/collection/components/swirl-tooltip/swirl-tooltip.css +4 -0
  23. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  24. package/dist/components/swirl-app-icon.js +1 -1
  25. package/dist/components/swirl-form-control.js +20 -6
  26. package/dist/components/swirl-icon-help.js +1 -40
  27. package/dist/components/swirl-icon-help2.js +42 -0
  28. package/dist/components/swirl-modal.js +1 -1
  29. package/dist/components/swirl-shell-navigation-item.js +5 -2
  30. package/dist/components/swirl-tooltip2.js +1 -1
  31. package/dist/esm/index-59244838.js +12 -8
  32. package/dist/esm/loader.js +1 -1
  33. package/dist/esm/swirl-app-icon.entry.js +1 -1
  34. package/dist/esm/swirl-components.js +1 -1
  35. package/dist/esm/swirl-form-control.entry.js +3 -2
  36. package/dist/esm/{swirl-icon-info_2.entry.js → swirl-icon-info.entry.js} +2 -121
  37. package/dist/esm/swirl-modal.entry.js +1 -1
  38. package/dist/esm/swirl-shell-navigation-item.entry.js +3 -1
  39. package/dist/esm/swirl-tooltip.entry.js +123 -0
  40. package/dist/swirl-components/p-88364fd1.entry.js +1 -0
  41. package/dist/swirl-components/p-93bee0ae.entry.js +1 -0
  42. package/dist/swirl-components/p-957009c4.entry.js +1 -0
  43. package/dist/swirl-components/{p-60a8ff07.entry.js → p-9e705cb8.entry.js} +1 -1
  44. package/dist/swirl-components/{p-889349f6.entry.js → p-db77b27d.entry.js} +1 -1
  45. package/dist/swirl-components/p-f408c0bd.entry.js +1 -0
  46. package/dist/swirl-components/swirl-components.css +1 -1
  47. package/dist/swirl-components/swirl-components.esm.js +1 -1
  48. package/dist/types/components/swirl-form-control/swirl-form-control.d.ts +1 -0
  49. package/dist/types/components/swirl-shell-navigation-item/swirl-shell-navigation-item.d.ts +1 -0
  50. package/dist/types/components.d.ts +4 -0
  51. package/package.json +1 -1
  52. package/vscode-data.json +8 -0
  53. package/dist/swirl-components/p-7cccf85c.entry.js +0 -1
  54. package/dist/swirl-components/p-953fb8a0.entry.js +0 -1
  55. package/dist/swirl-components/p-f05b06f8.entry.js +0 -1
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-1de6abbd.js');
6
6
  const index$1 = require('./index-2ddd0598.js');
7
7
 
8
- const swirlShellNavigationItemCss = "/**\n* seems the container query does not work as expected\n*/\n\n:host {\n display: inline-flex;\n width: 100%;\n}\n\n:host * {\n box-sizing: border-box;\n }\n\n.shell-navigation-item {\n position: relative;\n display: flex;\n width: 100%;\n height: 3rem;\n padding: var(--s-space-12);\n flex-shrink: 0;\n justify-content: flex-start;\n align-items: center;\n border: none;\n border-radius: var(--s-border-radius-sm);\n color: var(--s-text-default);\n background-color: var(--s-surface-overlay-default);\n font: inherit;\n font-size: var(--s-font-size-sm);\n font-weight: var(--s-font-weight-medium);\n line-height: var(--s-line-height-sm);\n text-decoration: none;\n cursor: pointer;\n container-type: size;\n gap: var(--s-space-16);\n}\n\n.shell-navigation-item:hover {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item:hover .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item:active {\n background-color: var(--s-surface-sunken-pressed);\n }\n\n.shell-navigation-item:active .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-pressed);\n }\n\n.shell-navigation-item:focus {\n outline: none;\n }\n\n.shell-navigation-item:focus-visible {\n z-index: 1;\n box-shadow: 0 0 0 0.125rem var(--s-focus-default);\n }\n\n.shell-navigation-item.shell-navigation-item--active {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active:hover {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active:hover .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active:active {\n background-color: var(--s-surface-sunken-pressed);\n }\n\n.shell-navigation-item.shell-navigation-item--active:active .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-pressed);\n }\n\n@media (min-width: 992px) {\n\n.shell-navigation-item {\n background-color: var(--s-surface-sunken-default)\n}\n }\n\n.shell-navigation-item__icon {\n display: inline-flex;\n min-width: 1.5rem;\n min-height: 1.5rem;\n justify-content: center;\n align-items: center;\n}\n\n.shell-navigation-item__label {\n overflow: hidden;\n min-width: 0;\n flex-grow: 1;\n text-align: start;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.shell-navigation-item__badge {\n --swirl-badge-border-color: var(--swirl-shell-background);\n}\n\n@container (max-width: 4rem) {\n .shell-navigation-item__label {\n display: none;\n }\n\n .shell-navigation-item__badge {\n position: absolute;\n top: var(--s-space-4);\n right: var(--s-space-4);\n padding: var(--s-space-2);\n }\n\n .shell-navigation-item__badge--dot {\n top: var(--s-space-8);\n right: var(--s-space-8);\n }\n}\n\n@container (min-width: 10rem) {\n .shell-navigation-item__badge--dot {\n padding-right: var(--s-space-4);\n }\n}\n";
8
+ const swirlShellNavigationItemCss = "/**\n* seems the container query does not work as expected\n*/\n\n:host {\n display: inline-flex;\n width: 100%;\n}\n\n:host * {\n box-sizing: border-box;\n }\n\n.shell-navigation-item {\n position: relative;\n display: flex;\n width: 100%;\n height: 3rem;\n padding: var(--s-space-8);\n flex-shrink: 0;\n justify-content: flex-start;\n align-items: center;\n border: none;\n border-radius: var(--s-border-radius-sm);\n color: var(--s-text-default);\n background-color: var(--s-surface-overlay-default);\n font: inherit;\n font-size: var(--s-font-size-sm);\n font-weight: var(--s-font-weight-medium);\n line-height: var(--s-line-height-sm);\n text-decoration: none;\n cursor: pointer;\n container-type: size;\n gap: var(--s-space-12);\n}\n\n.shell-navigation-item:hover {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item:hover .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item:active {\n background-color: var(--s-surface-sunken-pressed);\n }\n\n.shell-navigation-item:active .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-pressed);\n }\n\n.shell-navigation-item:focus {\n outline: none;\n }\n\n.shell-navigation-item:focus-visible {\n z-index: 1;\n box-shadow: 0 0 0 0.125rem var(--s-focus-default);\n }\n\n.shell-navigation-item.shell-navigation-item--boxed .shell-navigation-item__icon {\n background-color: var(--s-background-default);\n border-color: var(--s-border-default);\n border-radius: var(--s-border-radius-sm);\n border-width: var(--s-border-width-default);\n border-style: solid;\n }\n\n.shell-navigation-item.shell-navigation-item--boxed {\n\n --swirl-app-icon-size: calc(2rem - 2 * var(--s-border-width-default));\n}\n\n.shell-navigation-item.shell-navigation-item--active {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active:hover {\n background-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active:hover .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-hovered);\n }\n\n.shell-navigation-item.shell-navigation-item--active:active {\n background-color: var(--s-surface-sunken-pressed);\n }\n\n.shell-navigation-item.shell-navigation-item--active:active .shell-navigation-item__badge {\n --swirl-badge-border-color: var(--s-surface-sunken-pressed);\n }\n\n@media (min-width: 992px) {\n\n.shell-navigation-item {\n background-color: var(--s-surface-sunken-default)\n}\n }\n\n.shell-navigation-item__icon {\n display: inline-flex;\n min-width: 2rem;\n min-height: 2rem;\n justify-content: center;\n align-items: center;\n}\n\n.shell-navigation-item__label {\n overflow: hidden;\n min-width: 0;\n flex-grow: 1;\n text-align: start;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.shell-navigation-item__badge {\n --swirl-badge-border-color: var(--swirl-shell-background);\n}\n\n@container (max-width: 4rem) {\n .shell-navigation-item__label {\n display: none;\n }\n\n .shell-navigation-item__badge {\n position: absolute;\n top: var(--s-space-4);\n right: var(--s-space-4);\n padding: var(--s-space-2);\n }\n\n .shell-navigation-item__badge--dot {\n top: var(--s-space-8);\n right: var(--s-space-8);\n }\n}\n\n@container (min-width: 10rem) {\n .shell-navigation-item__badge--dot {\n padding-right: var(--s-space-4);\n }\n}\n";
9
9
 
10
10
  const SwirlShellNavigationItem = class {
11
11
  constructor(hostRef) {
@@ -15,10 +15,12 @@ const SwirlShellNavigationItem = class {
15
15
  this.href = undefined;
16
16
  this.label = undefined;
17
17
  this.target = undefined;
18
+ this.boxed = undefined;
18
19
  }
19
20
  render() {
20
21
  const className = index$1.classnames("shell-navigation-item", {
21
22
  "shell-navigation-item--active": this.active,
23
+ "shell-navigation-item--boxed": this.boxed,
22
24
  });
23
25
  const isLink = Boolean(this.href);
24
26
  const Tag = isLink ? "a" : "button";
@@ -0,0 +1,127 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-1de6abbd.js');
6
+ const floatingUi_dom_esm = require('./floating-ui.dom.esm-d4123549.js');
7
+ const index$1 = require('./index-2ddd0598.js');
8
+
9
+ const swirlTooltipCss = ":host{display:contents;font-weight:var(--s-font-weight-normal)}:host *{box-sizing:border-box}.tooltip{display:contents}.tooltip--visible .tooltip__popper{animation:tooltip-fade-in 0.15s;animation-delay:0.1s;animation-fill-mode:forwards;opacity:0}.tooltip--actual-placement-top .tooltip__arrow{top:calc(100% - 0.0625rem);transform:translate3d(0, -50%, 0) rotate(45deg)}.tooltip--actual-placement-bottom .tooltip__arrow{bottom:calc(100% - 0.0625rem);transform:translate3d(0, 50%, 0) rotate(45deg)}.tooltip--actual-placement-left .tooltip__arrow{left:calc(100% - 0.0625rem);transform:translate3d(-50%, 0, 0) rotate(45deg)}.tooltip--actual-placement-right .tooltip__arrow{right:calc(100% - 0.0625rem);transform:translate3d(50%, 0, 0) rotate(45deg)}.tooltip .tooltip__reference{display:contents}.tooltip__popper{position:absolute;z-index:var(--s-z-40);max-width:17.5rem;opacity:0}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:calc(var(--s-space-8) + 0.0625rem);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);box-shadow:var(--s-shadow-level-2)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.tooltip__bubble{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.tooltip__content{white-space:normal}.tooltip__arrow{position:absolute;width:0.6875rem;height:0.6875rem;border-radius:0.125rem;background-color:var(--s-surface-neutral-default)}@keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}";
10
+
11
+ const SwirlTooltip = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.onKeydown = (event) => {
15
+ if (event.code === "Escape") {
16
+ this.hide();
17
+ }
18
+ };
19
+ this.reposition = async () => {
20
+ const referenceElement = this.el.children[0];
21
+ if (!Boolean(referenceElement) || !Boolean(this.popperEl)) {
22
+ return;
23
+ }
24
+ const middleware = [
25
+ ...this.options.middleware.filter((middleware) => middleware.name !== "arrow"),
26
+ floatingUi_dom_esm.arrow({ element: this.arrowElement, padding: 12 }),
27
+ ];
28
+ this.actualPosition = await floatingUi_dom_esm.computePosition(referenceElement, this.popperEl, { ...this.options, middleware });
29
+ const arrowX = this.actualPosition.middlewareData.arrow?.x;
30
+ const arrowY = this.actualPosition.middlewareData.arrow?.y;
31
+ this.arrowStyles = {
32
+ left: Boolean(arrowX) ? arrowX + "px" : undefined,
33
+ top: Boolean(arrowY) ? arrowY + "px" : undefined,
34
+ };
35
+ };
36
+ this.show = () => {
37
+ this.visible = true;
38
+ requestAnimationFrame(() => {
39
+ const referenceElement = this.el.children[0];
40
+ if (!Boolean(referenceElement)) {
41
+ return;
42
+ }
43
+ this.reposition();
44
+ this.disableAutoUpdate = floatingUi_dom_esm.autoUpdate(referenceElement, this.popperEl, this.reposition.bind(this));
45
+ });
46
+ };
47
+ this.showWithDelay = () => {
48
+ if (Boolean(this.showTimeout)) {
49
+ clearTimeout(this.showTimeout);
50
+ this.showTimeout = undefined;
51
+ }
52
+ this.showTimeout = setTimeout(() => {
53
+ this.show();
54
+ }, this.delay);
55
+ };
56
+ this.hide = () => {
57
+ if (Boolean(this.showTimeout)) {
58
+ clearTimeout(this.showTimeout);
59
+ this.showTimeout = undefined;
60
+ }
61
+ this.visible = false;
62
+ this.disableAutoUpdate?.();
63
+ };
64
+ this.updateOptions = () => {
65
+ const margin = +getComputedStyle(document.documentElement)
66
+ .getPropertyValue("--s-space-12")
67
+ .replace("rem", "") * 16;
68
+ this.options = {
69
+ middleware: [floatingUi_dom_esm.offset(margin), floatingUi_dom_esm.shift(), floatingUi_dom_esm.flip()],
70
+ placement: this.position,
71
+ strategy: this.positioning,
72
+ };
73
+ };
74
+ this.content = undefined;
75
+ this.delay = 300;
76
+ this.position = "top";
77
+ this.positioning = "absolute";
78
+ this.actualPosition = undefined;
79
+ this.arrowStyles = undefined;
80
+ this.visible = false;
81
+ }
82
+ watchPosition() {
83
+ this.updateOptions();
84
+ }
85
+ onMouseEnter() {
86
+ this.showWithDelay();
87
+ }
88
+ onMouseLeave() {
89
+ this.hide();
90
+ }
91
+ onWindowResize() {
92
+ this.reposition();
93
+ }
94
+ onWindowScroll() {
95
+ this.reposition();
96
+ }
97
+ componentWillLoad() {
98
+ this.reposition();
99
+ }
100
+ componentDidLoad() {
101
+ this.updateOptions();
102
+ }
103
+ render() {
104
+ const className = index$1.classnames("tooltip", `tooltip--actual-placement-${this.actualPosition?.placement}`, {
105
+ "tooltip--visible": this.visible,
106
+ });
107
+ return (index.h(index.Host, { onKeydown: this.onKeydown }, index.h("span", { class: className }, index.h("span", { class: "tooltip__reference", "aria-describedby": "tooltip", onFocusout: this.hide, onClick: this.hide, onFocusin: this.show }, index.h("slot", null)), index.h("span", { class: "tooltip__popper", ref: (el) => (this.popperEl = el), style: {
108
+ top: Boolean(this.actualPosition)
109
+ ? `${this.actualPosition?.y}px`
110
+ : "",
111
+ left: Boolean(this.actualPosition)
112
+ ? `${this.actualPosition?.x}px`
113
+ : "",
114
+ position: this.positioning,
115
+ } }, this.visible && (index.h("span", { class: "tooltip__bubble", id: "tooltip", part: "tooltip__bubble", role: "tooltip" }, index.h("span", { class: "tooltip__content", innerHTML: this.content }))), index.h("span", { class: "tooltip__arrow", ref: (el) => (this.arrowElement = el), style: {
116
+ ...this.arrowStyles,
117
+ visibility: this.visible ? "visible" : "hidden",
118
+ } })))));
119
+ }
120
+ get el() { return index.getElement(this); }
121
+ static get watchers() { return {
122
+ "position": ["watchPosition"]
123
+ }; }
124
+ };
125
+ SwirlTooltip.style = swirlTooltipCss;
126
+
127
+ exports.swirl_tooltip = SwirlTooltip;