@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.
- package/components.json +49 -3
- package/dist/cjs/index-1de6abbd.js +12 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-app-icon.cjs.entry.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-form-control.cjs.entry.js +3 -2
- package/dist/cjs/{swirl-icon-info_2.cjs.entry.js → swirl-icon-info.cjs.entry.js} +0 -120
- package/dist/cjs/swirl-modal.cjs.entry.js +1 -1
- package/dist/cjs/swirl-shell-navigation-item.cjs.entry.js +3 -1
- package/dist/cjs/swirl-tooltip.cjs.entry.js +127 -0
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-app-icon/swirl-app-icon.css +3 -3
- package/dist/collection/components/swirl-form-control/swirl-form-control.css +24 -0
- package/dist/collection/components/swirl-form-control/swirl-form-control.js +19 -1
- package/dist/collection/components/swirl-form-control/swirl-form-control.spec.js +14 -2
- package/dist/collection/components/swirl-modal/swirl-modal.css +1 -1
- package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.stories.js +1 -1
- package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.css +17 -4
- package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.js +19 -0
- package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.stories.js +1 -1
- package/dist/collection/components/swirl-text-input/swirl-text-input.js +1 -1
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.css +4 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-app-icon.js +1 -1
- package/dist/components/swirl-form-control.js +20 -6
- package/dist/components/swirl-icon-help.js +1 -40
- package/dist/components/swirl-icon-help2.js +42 -0
- package/dist/components/swirl-modal.js +1 -1
- package/dist/components/swirl-shell-navigation-item.js +5 -2
- package/dist/components/swirl-tooltip2.js +1 -1
- package/dist/esm/index-59244838.js +12 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-app-icon.entry.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-form-control.entry.js +3 -2
- package/dist/esm/{swirl-icon-info_2.entry.js → swirl-icon-info.entry.js} +2 -121
- package/dist/esm/swirl-modal.entry.js +1 -1
- package/dist/esm/swirl-shell-navigation-item.entry.js +3 -1
- package/dist/esm/swirl-tooltip.entry.js +123 -0
- package/dist/swirl-components/p-88364fd1.entry.js +1 -0
- package/dist/swirl-components/p-93bee0ae.entry.js +1 -0
- package/dist/swirl-components/p-957009c4.entry.js +1 -0
- package/dist/swirl-components/{p-60a8ff07.entry.js → p-9e705cb8.entry.js} +1 -1
- package/dist/swirl-components/{p-889349f6.entry.js → p-db77b27d.entry.js} +1 -1
- package/dist/swirl-components/p-f408c0bd.entry.js +1 -0
- package/dist/swirl-components/swirl-components.css +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-form-control/swirl-form-control.d.ts +1 -0
- package/dist/types/components/swirl-shell-navigation-item/swirl-shell-navigation-item.d.ts +1 -0
- package/dist/types/components.d.ts +4 -0
- package/package.json +1 -1
- package/vscode-data.json +8 -0
- package/dist/swirl-components/p-7cccf85c.entry.js +0 -1
- package/dist/swirl-components/p-953fb8a0.entry.js +0 -1
- package/dist/swirl-components/p-f05b06f8.entry.js +0 -1
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
.app-icon {
|
|
10
10
|
position: relative;
|
|
11
11
|
overflow: hidden;
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
14
|
-
border-radius: var(--s-border-radius-
|
|
12
|
+
width: var(--swirl-app-icon-size);
|
|
13
|
+
height: var(--swirl-app-icon-size);
|
|
14
|
+
border-radius: var(--s-border-radius-sm);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.app-icon > img {
|
|
@@ -135,6 +135,30 @@
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px) {
|
|
139
|
+
|
|
140
|
+
.form-control--label-position-outside .form-control__label-text {
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.form-control--label-position-outside .form-control__label-text .form-control__tooltip {
|
|
147
|
+
display: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px) {
|
|
151
|
+
|
|
152
|
+
.form-control--label-position-outside .form-control__label-text .form-control__tooltip {
|
|
153
|
+
display: flex;
|
|
154
|
+
margin-left: var(--s-space-4)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.form-control--label-position-outside .form-control__label-text .form-control__tooltip:hover {
|
|
158
|
+
cursor: default;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
138
162
|
.form-control--invalid.form-control--has-focus:not(.form-control--disabled) .form-control__label {
|
|
139
163
|
border-color: var(--s-border-critical);
|
|
140
164
|
box-shadow: 0 0 0 var(--s-border-width-default) var(--s-border-critical);
|
|
@@ -43,6 +43,7 @@ export class SwirlFormControl {
|
|
|
43
43
|
this.invalid = undefined;
|
|
44
44
|
this.label = undefined;
|
|
45
45
|
this.labelPosition = "inside";
|
|
46
|
+
this.tooltip = undefined;
|
|
46
47
|
this.hasFocus = undefined;
|
|
47
48
|
this.inputValue = undefined;
|
|
48
49
|
}
|
|
@@ -152,7 +153,7 @@ export class SwirlFormControl {
|
|
|
152
153
|
"form-control--is-select": isSelect,
|
|
153
154
|
});
|
|
154
155
|
const LabelTag = hasContenteditableControl ? "div" : "label";
|
|
155
|
-
return (h(Host, { onFocusin: this.onFocusIn, onFocusout: this.onFocusOut, onKeyDown: this.onKeyDown }, h("div", { class: className, role: "group" }, h("span", { class: "form-control__controls" }, h("span", { class: "form-control__prefix" }, h("slot", { name: "prefix" })), h(LabelTag, { class: "form-control__label", onClick: this.onLabelClick }, h("span", { class: "form-control__label-text", id: this.labelId }, this.label), h("span", { class: "form-control__input" }, h("slot", null)))), showDescription && (h("span", { class: "form-control__description", id: this.descriptionId }, this.description)), showErrorMessage && (h("span", { "aria-live": "polite", class: "form-control__error-message", id: this.descriptionId }, h("swirl-inline-error", { message: this.errorMessage, size: "s" }))))));
|
|
156
|
+
return (h(Host, { onFocusin: this.onFocusIn, onFocusout: this.onFocusOut, onKeyDown: this.onKeyDown }, h("div", { class: className, role: "group" }, h("span", { class: "form-control__controls" }, h("span", { class: "form-control__prefix" }, h("slot", { name: "prefix" })), h(LabelTag, { class: "form-control__label", onClick: this.onLabelClick }, h("span", { class: "form-control__label-text", id: this.labelId }, this.label, this.tooltip && this.labelPosition === "outside" && (h("span", { class: "form-control__tooltip" }, h("swirl-tooltip", { content: this.tooltip, positioning: "fixed", position: "top" }, h("swirl-icon-help", { size: 16, tabindex: "0" }))))), h("span", { class: "form-control__input" }, h("slot", null)))), showDescription && (h("span", { class: "form-control__description", id: this.descriptionId }, this.description)), showErrorMessage && (h("span", { "aria-live": "polite", class: "form-control__error-message", id: this.descriptionId }, h("swirl-inline-error", { message: this.errorMessage, size: "s" }))))));
|
|
156
157
|
}
|
|
157
158
|
static get is() { return "swirl-form-control"; }
|
|
158
159
|
static get encapsulation() { return "scoped"; }
|
|
@@ -309,6 +310,23 @@ export class SwirlFormControl {
|
|
|
309
310
|
"attribute": "label-position",
|
|
310
311
|
"reflect": false,
|
|
311
312
|
"defaultValue": "\"inside\""
|
|
313
|
+
},
|
|
314
|
+
"tooltip": {
|
|
315
|
+
"type": "string",
|
|
316
|
+
"mutable": false,
|
|
317
|
+
"complexType": {
|
|
318
|
+
"original": "string",
|
|
319
|
+
"resolved": "string",
|
|
320
|
+
"references": {}
|
|
321
|
+
},
|
|
322
|
+
"required": false,
|
|
323
|
+
"optional": true,
|
|
324
|
+
"docs": {
|
|
325
|
+
"tags": [],
|
|
326
|
+
"text": ""
|
|
327
|
+
},
|
|
328
|
+
"attribute": "tooltip",
|
|
329
|
+
"reflect": false
|
|
312
330
|
}
|
|
313
331
|
};
|
|
314
332
|
}
|
|
@@ -94,7 +94,7 @@ describe("swirl-form-control", () => {
|
|
|
94
94
|
page.root.dispatchEvent(new KeyboardEvent("keydown", { key: "Tab" }));
|
|
95
95
|
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
96
96
|
await page.waitForChanges();
|
|
97
|
-
expect(formControl.classList.contains(
|
|
97
|
+
expect(formControl.classList.contains("form-control--has-focus")).toBeTruthy();
|
|
98
98
|
});
|
|
99
99
|
it("doesn't keep focus when Tab is pressed and the active element is not descendent of the input", async () => {
|
|
100
100
|
const page = await newSpecPage({
|
|
@@ -113,6 +113,18 @@ describe("swirl-form-control", () => {
|
|
|
113
113
|
page.root.dispatchEvent(new KeyboardEvent("keydown", { key: "Tab" }));
|
|
114
114
|
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
115
115
|
await page.waitForChanges();
|
|
116
|
-
expect(formControl.classList.contains(
|
|
116
|
+
expect(formControl.classList.contains("form-control--has-focus")).toBeFalsy();
|
|
117
|
+
});
|
|
118
|
+
it("renders a tooltip icon when tooltip is set an label position is outside", async () => {
|
|
119
|
+
const page = await newSpecPage({
|
|
120
|
+
components: [SwirlFormControl],
|
|
121
|
+
html: `
|
|
122
|
+
<swirl-form-control label="Label" label-position="outside" tooltip="This is a tooltip">
|
|
123
|
+
<swirl-text-input></swirl-text-input>
|
|
124
|
+
</swirl-form-control>
|
|
125
|
+
`,
|
|
126
|
+
});
|
|
127
|
+
const tooltip = page.root.querySelector("swirl-tooltip");
|
|
128
|
+
expect(tooltip).not.toBeNull();
|
|
117
129
|
});
|
|
118
130
|
});
|
|
@@ -59,7 +59,7 @@ const Template = (args) => {
|
|
|
59
59
|
</swirl-shell-navigation-item>
|
|
60
60
|
</li>
|
|
61
61
|
<li>
|
|
62
|
-
<swirl-shell-navigation-item label="Employee directory">
|
|
62
|
+
<swirl-shell-navigation-item label="Employee directory" boxed="true">
|
|
63
63
|
<swirl-app-icon icon="<swirl-icon-groups-filled size="20"></swirl-icon-groups-filled>" slot="icon"></swirl-app-icon>
|
|
64
64
|
</swirl-shell-navigation-item>
|
|
65
65
|
</li>
|
package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.css
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
display: flex;
|
|
17
17
|
width: 100%;
|
|
18
18
|
height: 3rem;
|
|
19
|
-
padding: var(--s-space-
|
|
19
|
+
padding: var(--s-space-8);
|
|
20
20
|
flex-shrink: 0;
|
|
21
21
|
justify-content: flex-start;
|
|
22
22
|
align-items: center;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
text-decoration: none;
|
|
32
32
|
cursor: pointer;
|
|
33
33
|
container-type: size;
|
|
34
|
-
gap: var(--s-space-
|
|
34
|
+
gap: var(--s-space-12);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.shell-navigation-item:hover {
|
|
@@ -59,6 +59,19 @@
|
|
|
59
59
|
box-shadow: 0 0 0 0.125rem var(--s-focus-default);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
.shell-navigation-item.shell-navigation-item--boxed .shell-navigation-item__icon {
|
|
63
|
+
background-color: var(--s-background-default);
|
|
64
|
+
border-color: var(--s-border-default);
|
|
65
|
+
border-radius: var(--s-border-radius-sm);
|
|
66
|
+
border-width: var(--s-border-width-default);
|
|
67
|
+
border-style: solid;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.shell-navigation-item.shell-navigation-item--boxed {
|
|
71
|
+
|
|
72
|
+
--swirl-app-icon-size: calc(2rem - 2 * var(--s-border-width-default));
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
.shell-navigation-item.shell-navigation-item--active {
|
|
63
76
|
background-color: var(--s-surface-sunken-hovered);
|
|
64
77
|
}
|
|
@@ -92,8 +105,8 @@
|
|
|
92
105
|
|
|
93
106
|
.shell-navigation-item__icon {
|
|
94
107
|
display: inline-flex;
|
|
95
|
-
min-width:
|
|
96
|
-
min-height:
|
|
108
|
+
min-width: 2rem;
|
|
109
|
+
min-height: 2rem;
|
|
97
110
|
justify-content: center;
|
|
98
111
|
align-items: center;
|
|
99
112
|
}
|
package/dist/collection/components/swirl-shell-navigation-item/swirl-shell-navigation-item.js
CHANGED
|
@@ -10,10 +10,12 @@ export class SwirlShellNavigationItem {
|
|
|
10
10
|
this.href = undefined;
|
|
11
11
|
this.label = undefined;
|
|
12
12
|
this.target = undefined;
|
|
13
|
+
this.boxed = undefined;
|
|
13
14
|
}
|
|
14
15
|
render() {
|
|
15
16
|
const className = classnames("shell-navigation-item", {
|
|
16
17
|
"shell-navigation-item--active": this.active,
|
|
18
|
+
"shell-navigation-item--boxed": this.boxed,
|
|
17
19
|
});
|
|
18
20
|
const isLink = Boolean(this.href);
|
|
19
21
|
const Tag = isLink ? "a" : "button";
|
|
@@ -119,6 +121,23 @@ export class SwirlShellNavigationItem {
|
|
|
119
121
|
},
|
|
120
122
|
"attribute": "target",
|
|
121
123
|
"reflect": false
|
|
124
|
+
},
|
|
125
|
+
"boxed": {
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"complexType": {
|
|
129
|
+
"original": "boolean",
|
|
130
|
+
"resolved": "boolean",
|
|
131
|
+
"references": {}
|
|
132
|
+
},
|
|
133
|
+
"required": false,
|
|
134
|
+
"optional": true,
|
|
135
|
+
"docs": {
|
|
136
|
+
"tags": [],
|
|
137
|
+
"text": ""
|
|
138
|
+
},
|
|
139
|
+
"attribute": "boxed",
|
|
140
|
+
"reflect": false
|
|
122
141
|
}
|
|
123
142
|
};
|
|
124
143
|
}
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
const Template = (args) => {
|
|
14
14
|
const element = generateStoryElement("swirl-shell-navigation-item", args);
|
|
15
15
|
element.innerHTML = `
|
|
16
|
-
<swirl-app-icon slot="icon" label="link" src="https://
|
|
16
|
+
<swirl-app-icon slot="icon" label="link" src="https://cdn-icons-png.flaticon.com/512/1076/1076744.png"></swirl-app-icon>
|
|
17
17
|
`;
|
|
18
18
|
return element;
|
|
19
19
|
};
|