@getflip/swirl-components 0.19.0 → 0.20.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.
Files changed (45) hide show
  1. package/components.json +96 -16
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/swirl-app-layout_7.cjs.entry.js +10 -7
  4. package/dist/cjs/swirl-columns.cjs.entry.js +24 -0
  5. package/dist/cjs/swirl-components.cjs.js +1 -1
  6. package/dist/cjs/swirl-modal.cjs.entry.js +1 -1
  7. package/dist/cjs/swirl-shell-layout.cjs.entry.js +1 -1
  8. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  9. package/dist/collection/collection-manifest.json +1 -0
  10. package/dist/collection/components/swirl-app-layout/swirl-app-layout.css +12 -4
  11. package/dist/collection/components/swirl-box/swirl-box.css +9 -19
  12. package/dist/collection/components/swirl-box/swirl-box.js +25 -23
  13. package/dist/collection/components/swirl-columns/swirl-columns.css +12 -0
  14. package/dist/collection/components/swirl-columns/swirl-columns.js +69 -0
  15. package/dist/collection/components/swirl-columns/swirl-columns.stories.js +42 -0
  16. package/dist/collection/components/swirl-modal/swirl-modal.css +1 -0
  17. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.css +1 -5
  18. package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.stories.js +9 -3
  19. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  20. package/dist/components/swirl-app-layout2.js +1 -1
  21. package/dist/components/swirl-box2.js +10 -7
  22. package/dist/components/swirl-columns.d.ts +11 -0
  23. package/dist/components/swirl-columns.js +42 -0
  24. package/dist/components/swirl-modal.js +1 -1
  25. package/dist/components/swirl-shell-layout.js +1 -1
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm/swirl-app-layout_7.entry.js +10 -7
  28. package/dist/esm/swirl-columns.entry.js +20 -0
  29. package/dist/esm/swirl-components.js +1 -1
  30. package/dist/esm/swirl-modal.entry.js +1 -1
  31. package/dist/esm/swirl-shell-layout.entry.js +1 -1
  32. package/dist/swirl-components/{p-736d7f96.entry.js → p-13740092.entry.js} +1 -1
  33. package/dist/swirl-components/p-19a0622b.entry.js +1 -0
  34. package/dist/swirl-components/p-83392d53.entry.js +1 -0
  35. package/dist/swirl-components/p-de47bad6.entry.js +1 -0
  36. package/dist/swirl-components/swirl-components.css +1 -1
  37. package/dist/swirl-components/swirl-components.esm.js +1 -1
  38. package/dist/types/components/swirl-box/swirl-box.d.ts +1 -1
  39. package/dist/types/components/swirl-columns/swirl-columns.d.ts +6 -0
  40. package/dist/types/components/swirl-columns/swirl-columns.stories.d.ts +13 -0
  41. package/dist/types/components.d.ts +21 -2
  42. package/package.json +2 -2
  43. package/vscode-data.json +47 -4
  44. package/dist/swirl-components/p-b3212e9c.entry.js +0 -1
  45. package/dist/swirl-components/p-b66abab3.entry.js +0 -1
@@ -13,6 +13,7 @@
13
13
  "./components/swirl-button-group/swirl-button-group.js",
14
14
  "./components/swirl-checkbox/swirl-checkbox.js",
15
15
  "./components/swirl-chip/swirl-chip.js",
16
+ "./components/swirl-columns/swirl-columns.js",
16
17
  "./components/swirl-dialog/swirl-dialog.js",
17
18
  "./components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js",
18
19
  "./components/swirl-form-group/swirl-form-group.js",
@@ -17,7 +17,6 @@
17
17
  height: 100%;
18
18
  margin-right: auto;
19
19
  margin-left: auto;
20
- background-color: var(--s-border-default);
21
20
  }
22
21
 
23
22
  .app-layout__grid {
@@ -25,7 +24,6 @@
25
24
  display: grid;
26
25
  width: 100%;
27
26
  height: 100%;
28
- gap: var(--s-border-width-default);
29
27
  grid-template-columns: 100%;
30
28
  grid-template-rows: 4rem 1fr;
31
29
  grid-template-areas:
@@ -206,12 +204,20 @@
206
204
  padding-bottom: var(--s-space-12);
207
205
  padding-left: calc(var(--s-space-16) + var(--s-space-8) + 2.5rem);
208
206
  align-items: center;
207
+ border-bottom: var(--s-border-width-default) solid var(--s-border-default);
209
208
  background-color: var(--s-background-default);
210
209
  grid-area: header;
211
210
  will-change: transform;
212
211
  gap: var(--s-space-8);
213
212
  }
214
213
 
214
+ @media (min-width: 768px) {
215
+
216
+ .app-layout__header {
217
+ border-right: var(--s-border-width-default) solid var(--s-border-default)
218
+ }
219
+ }
220
+
215
221
  @media (min-width: 992px) {
216
222
 
217
223
  .app-layout__header {
@@ -247,6 +253,7 @@
247
253
  .app-layout__navigation {
248
254
  z-index: 1;
249
255
  overflow-y: auto;
256
+ border-right: var(--s-border-width-default) solid var(--s-border-default);
250
257
  background-color: var(--s-background-default);
251
258
  grid-area: navigation;
252
259
  will-change: transform;
@@ -257,7 +264,6 @@
257
264
  display: grid;
258
265
  width: 100%;
259
266
  height: 100%;
260
- gap: var(--s-border-width-default);
261
267
  grid-area: body;
262
268
  grid-template-rows: 4rem 1fr;
263
269
  grid-template-areas:
@@ -274,6 +280,7 @@
274
280
  padding-bottom: var(--s-space-12);
275
281
  padding-left: calc(var(--s-space-16) + var(--s-space-8) + 2.5rem);
276
282
  align-items: center;
283
+ border-bottom: var(--s-border-width-default) solid var(--s-border-default);
277
284
  background-color: var(--s-background-default);
278
285
  grid-area: app-bar;
279
286
  gap: var(--s-space-8);
@@ -335,8 +342,8 @@
335
342
  display: grid;
336
343
  width: 100%;
337
344
  height: 100%;
345
+ border-left: var(--s-border-width-default) solid var(--s-border-default);
338
346
  will-change: transform;
339
- gap: var(--s-border-width-default);
340
347
  grid-area: sidebar;
341
348
  grid-template-rows: 4rem 1fr;
342
349
  grid-template-areas:
@@ -369,6 +376,7 @@
369
376
  padding-bottom: var(--s-space-12);
370
377
  padding-left: calc(var(--s-space-16) + var(--s-space-8) + 2.5rem);
371
378
  align-items: center;
379
+ border-bottom: var(--s-border-width-default) solid var(--s-border-default);
372
380
  background-color: var(--s-background-default);
373
381
  grid-area: sidebar-header;
374
382
  gap: var(--s-space-8);
@@ -3,25 +3,15 @@
3
3
  width: 100%;
4
4
  }
5
5
 
6
- :host * {
7
- box-sizing: border-box;
6
+ :host(.box--bordered) {
7
+ border: var(--s-border-width-default) solid var(--s-border-default);
8
8
  }
9
9
 
10
- .box--bordered {
11
- border: var(--s-border-width-default) solid var(--s-border-default);
12
- }
13
-
14
- .box--center-block {
15
- display: flex;
16
- align-items: center;
17
- }
18
-
19
- .box--center-inline {
20
- display: flex;
21
- justify-content: center;
22
- }
10
+ :host(.box--cover) {
11
+ width: 100%;
12
+ height: 100%;
13
+ }
23
14
 
24
- .box--cover {
25
- width: 100%;
26
- height: 100%;
27
- }
15
+ :host * {
16
+ box-sizing: border-box;
17
+ }
@@ -5,28 +5,31 @@ import classnames from "classnames";
5
5
  */
6
6
  export class SwirlBox {
7
7
  constructor() {
8
- this.as = "div";
9
8
  this.bordered = undefined;
10
9
  this.centerBlock = undefined;
11
10
  this.centerInline = undefined;
12
11
  this.cover = undefined;
12
+ this.maxWidth = undefined;
13
13
  this.overflow = "visible";
14
14
  this.padding = "0";
15
15
  }
16
16
  render() {
17
- const Tag = this.as;
18
17
  const styles = {
18
+ alignItems: this.centerBlock ? "center" : undefined,
19
+ display: this.centerBlock || this.centerInline ? "flex" : undefined,
20
+ height: this.cover ? "100%" : undefined,
21
+ justifyContent: this.centerInline ? "center" : undefined,
19
22
  overflow: this.overflow,
20
23
  padding: `var(--s-space-${this.padding})`,
21
24
  position: Boolean(this.overflow) ? "relative" : "",
25
+ maxWidth: this.maxWidth,
26
+ width: this.cover ? "100%" : undefined,
22
27
  };
23
28
  const className = classnames("box", {
24
29
  "box--bordered": this.bordered,
25
- "box--center-block": this.centerBlock,
26
- "box--center-inline": this.centerInline,
27
30
  "box--cover": this.cover,
28
31
  });
29
- return (h(Host, { style: this.cover ? { width: "100%", height: "100%" } : undefined }, h(Tag, { class: className, style: styles }, h("slot", null))));
32
+ return (h(Host, { class: className, style: styles }, h("slot", null)));
30
33
  }
31
34
  static get is() { return "swirl-box"; }
32
35
  static get encapsulation() { return "shadow"; }
@@ -42,24 +45,6 @@ export class SwirlBox {
42
45
  }
43
46
  static get properties() {
44
47
  return {
45
- "as": {
46
- "type": "string",
47
- "mutable": false,
48
- "complexType": {
49
- "original": "string",
50
- "resolved": "string",
51
- "references": {}
52
- },
53
- "required": false,
54
- "optional": true,
55
- "docs": {
56
- "tags": [],
57
- "text": ""
58
- },
59
- "attribute": "as",
60
- "reflect": false,
61
- "defaultValue": "\"div\""
62
- },
63
48
  "bordered": {
64
49
  "type": "boolean",
65
50
  "mutable": false,
@@ -128,6 +113,23 @@ export class SwirlBox {
128
113
  "attribute": "cover",
129
114
  "reflect": false
130
115
  },
116
+ "maxWidth": {
117
+ "type": "string",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "string",
121
+ "resolved": "string",
122
+ "references": {}
123
+ },
124
+ "required": false,
125
+ "optional": true,
126
+ "docs": {
127
+ "tags": [],
128
+ "text": ""
129
+ },
130
+ "attribute": "max-width",
131
+ "reflect": false
132
+ },
131
133
  "overflow": {
132
134
  "type": "string",
133
135
  "mutable": false,
@@ -0,0 +1,12 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ :host * {
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ .columns {
10
+ display: grid;
11
+ width: 100%;
12
+ }
@@ -0,0 +1,69 @@
1
+ import { h, Host } from "@stencil/core";
2
+ export class SwirlColumns {
3
+ constructor() {
4
+ this.columns = "repeat(3, minmax(0, 1fr))";
5
+ this.spacing = undefined;
6
+ }
7
+ render() {
8
+ return (h(Host, null, h("div", { class: "columns", style: {
9
+ gridTemplateColumns: this.columns,
10
+ gap: `var(--s-space-${this.spacing})`,
11
+ } }, h("slot", null))));
12
+ }
13
+ static get is() { return "swirl-columns"; }
14
+ static get encapsulation() { return "shadow"; }
15
+ static get originalStyleUrls() {
16
+ return {
17
+ "$": ["swirl-columns.css"]
18
+ };
19
+ }
20
+ static get styleUrls() {
21
+ return {
22
+ "$": ["swirl-columns.css"]
23
+ };
24
+ }
25
+ static get properties() {
26
+ return {
27
+ "columns": {
28
+ "type": "string",
29
+ "mutable": false,
30
+ "complexType": {
31
+ "original": "string",
32
+ "resolved": "string",
33
+ "references": {}
34
+ },
35
+ "required": false,
36
+ "optional": true,
37
+ "docs": {
38
+ "tags": [],
39
+ "text": ""
40
+ },
41
+ "attribute": "columns",
42
+ "reflect": false,
43
+ "defaultValue": "\"repeat(3, minmax(0, 1fr))\""
44
+ },
45
+ "spacing": {
46
+ "type": "string",
47
+ "mutable": false,
48
+ "complexType": {
49
+ "original": "SwirlColumnsSpacing",
50
+ "resolved": "\"0\" | \"12\" | \"16\" | \"2\" | \"24\" | \"32\" | \"4\" | \"8\"",
51
+ "references": {
52
+ "SwirlColumnsSpacing": {
53
+ "location": "local",
54
+ "path": "/home/runner/work/swirl/swirl/packages/swirl-components/src/components/swirl-columns/swirl-columns.tsx"
55
+ }
56
+ }
57
+ },
58
+ "required": false,
59
+ "optional": true,
60
+ "docs": {
61
+ "tags": [],
62
+ "text": ""
63
+ },
64
+ "attribute": "spacing",
65
+ "reflect": false
66
+ }
67
+ };
68
+ }
69
+ }
@@ -0,0 +1,42 @@
1
+ import { generateStoryElement } from "../../utils";
2
+ import Docs from "./swirl-columns.mdx";
3
+ export default {
4
+ component: "swirl-columns",
5
+ parameters: {
6
+ docs: {
7
+ page: Docs,
8
+ },
9
+ },
10
+ title: "Components/SwirlColumns",
11
+ };
12
+ const Template = (args) => {
13
+ const element = generateStoryElement("swirl-columns", args);
14
+ element.innerHTML = `
15
+ <swirl-box bordered padding="16">
16
+ <swirl-text color="subdued" size="sm">
17
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
18
+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
19
+ voluptua.
20
+ </swirl-text>
21
+ </swirl-box>
22
+ <swirl-box bordered padding="16">
23
+ <swirl-text color="subdued" size="sm">
24
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
25
+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
26
+ voluptua.
27
+ </swirl-text>
28
+ </swirl-box>
29
+ <swirl-box bordered padding="16">
30
+ <swirl-text color="subdued" size="sm">
31
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
32
+ eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
33
+ voluptua.
34
+ </swirl-text>
35
+ </swirl-box>
36
+ `;
37
+ return element;
38
+ };
39
+ export const SwirlColumns = Template.bind({});
40
+ SwirlColumns.args = {
41
+ spacing: "16",
42
+ };
@@ -108,6 +108,7 @@
108
108
  position: relative;
109
109
  z-index: var(--s-z-40);
110
110
  display: flex;
111
+ overflow: hidden;
111
112
  width: 100vw;
112
113
  height: 100vh;
113
114
  background-color: var(--s-surface-overlay-default);
@@ -14,8 +14,6 @@
14
14
  display: flex;
15
15
  width: 100%;
16
16
  min-height: 100%;
17
- background-color: var(--s-border-default);
18
- gap: var(--s-border-width-default);
19
17
  }
20
18
 
21
19
  @media (min-width: 992px) {
@@ -86,18 +84,15 @@
86
84
  width: var(--extended-sidebar-width);
87
85
  height: 100%;
88
86
  border-right: var(--s-border-width-default) solid var(--s-border-default);
89
- background-color: var(--s-border-default);
90
87
  flex-direction: column;
91
88
  transition: box-shadow 0.2s, width 0.2s;
92
89
  box-shadow: 0 0.75rem 2rem rgba(25, 26, 28, 0.12),
93
90
  0 0.25rem 0.75rem rgba(25, 26, 28, 0.08);
94
- gap: var(--s-border-width-default);
95
91
  }
96
92
 
97
93
  @media (min-width: 992px) {
98
94
 
99
95
  .shell-layout__sidebar {
100
- border-right: none;
101
96
  box-shadow: none
102
97
  }
103
98
  }
@@ -106,6 +101,7 @@
106
101
  padding: var(--s-space-8);
107
102
  flex-shrink: 0;
108
103
  background-color: var(--s-background-default);
104
+ border-bottom: var(--s-border-width-default) solid var(--s-border-default);
109
105
  }
110
106
 
111
107
  .shell-layout__logo-bar {
@@ -56,9 +56,15 @@ const Template = (args) => {
56
56
  navigation-label="Items"
57
57
  >
58
58
  <swirl-resource-list label="Items" slot="navigation">
59
- <swirl-resource-list-item description="With a description" label="This is a resource item" class="item" media="<swirl-avatar label=&quot;John Doe&quot; src=&quot;https://picsum.photos/id/433/144/144&quot;></swirl-avatar>"></swirl-resource-list-item>
60
- <swirl-resource-list-item description="With a description" label="This is a resource item" class="item" media="<swirl-avatar label=&quot;John Doe&quot; src=&quot;https://picsum.photos/id/103/144/144&quot;></swirl-avatar>"></swirl-resource-list-item>
61
- <swirl-resource-list-item description="With a description" label="This is a resource item" class="item" media="<swirl-avatar label=&quot;John Doe&quot; src=&quot;https://picsum.photos/id/1027/144/144&quot;></swirl-avatar>"></swirl-resource-list-item>
59
+ <swirl-resource-list-item description="With a description" label="This is a resource item" class="item">
60
+ <swirl-avatar label="John Doe" src="https://picsum.photos/id/433/144/144" slot="media"></swirl-avatar>
61
+ </swirl-resource-list-item>
62
+ <swirl-resource-list-item description="With a description" label="This is a resource item" class="item">
63
+ <swirl-avatar label="John Doe" src="https://picsum.photos/id/433/144/144" slot="media"></swirl-avatar>
64
+ </swirl-resource-list-item>
65
+ <swirl-resource-list-item description="With a description" label="This is a resource item" class="item">
66
+ <swirl-avatar label="John Doe" src="https://picsum.photos/id/433/144/144" slot="media"></swirl-avatar>
67
+ </swirl-resource-list-item>
62
68
  </swirl-resource-list>
63
69
  <swirl-button
64
70
  hide-label