@getflip/swirl-components 0.125.1 → 0.127.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 (27) hide show
  1. package/components.json +43 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/swirl-app-layout_6.cjs.entry.js +3 -1
  4. package/dist/cjs/swirl-card.cjs.entry.js +3 -2
  5. package/dist/cjs/swirl-components.cjs.js +1 -1
  6. package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
  7. package/dist/collection/components/swirl-card/swirl-card.css +12 -2
  8. package/dist/collection/components/swirl-card/swirl-card.js +25 -1
  9. package/dist/collection/components/swirl-card/swirl-card.spec.js +3 -3
  10. package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.css +4 -0
  11. package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +19 -0
  12. package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
  13. package/dist/components/swirl-card.js +4 -2
  14. package/dist/components/swirl-resource-list-item2.js +4 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/swirl-app-layout_6.entry.js +3 -1
  17. package/dist/esm/swirl-card.entry.js +3 -2
  18. package/dist/esm/swirl-components.js +1 -1
  19. package/dist/swirl-components/p-aee1e359.entry.js +1 -0
  20. package/dist/swirl-components/{p-6da47161.entry.js → p-f25bae61.entry.js} +1 -1
  21. package/dist/swirl-components/swirl-components.esm.js +1 -1
  22. package/dist/types/components/swirl-card/swirl-card.d.ts +2 -0
  23. package/dist/types/components/swirl-resource-list-item/swirl-resource-list-item.d.ts +1 -0
  24. package/dist/types/components.d.ts +6 -2
  25. package/package.json +1 -1
  26. package/vscode-data.json +8 -0
  27. package/dist/swirl-components/p-11aa95db.entry.js +0 -1
@@ -57,10 +57,20 @@ a.card:focus-visible, button.card:focus-visible, .card--interactive:focus-visibl
57
57
 
58
58
  .card--elevated {
59
59
  border-color: transparent;
60
- box-shadow: 0 0.75rem 1rem rgba(25, 26, 28, 0.12),
61
- 0 0.25rem 0.75rem rgba(25, 26, 28, 0.08);
62
60
  }
63
61
 
62
+ .card--elevated.card--elevation-level-1 {
63
+ box-shadow: var(--s-shadow-level-1);
64
+ }
65
+
66
+ .card--elevated.card--elevation-level-2 {
67
+ box-shadow: var(--s-shadow-level-2);
68
+ }
69
+
70
+ .card--elevated.card--elevation-level-3 {
71
+ box-shadow: var(--s-shadow-level-3);
72
+ }
73
+
64
74
  .card--highlighted {
65
75
  border-width: 0.1875rem;
66
76
  border-color: var(--s-border-highlight);
@@ -9,6 +9,7 @@ export class SwirlCard {
9
9
  this.as = "div";
10
10
  this.borderRadius = "base";
11
11
  this.elevated = undefined;
12
+ this.elevationLevel = 3;
12
13
  this.height = undefined;
13
14
  this.highlighted = undefined;
14
15
  this.href = undefined;
@@ -54,7 +55,7 @@ export class SwirlCard {
54
55
  ? `var(--s-space-${this.paddingInlineStart})`
55
56
  : undefined,
56
57
  };
57
- const className = classnames("card", `card--intent-${this.intent}`, `card--justify-content-${this.justifyContent}`, {
58
+ const className = classnames("card", `card--elevation-level-${this.elevationLevel}`, `card--intent-${this.intent}`, `card--justify-content-${this.justifyContent}`, {
58
59
  "card--elevated": this.elevated,
59
60
  "card--has-image": hasImage,
60
61
  "card--highlighted": this.highlighted,
@@ -137,6 +138,29 @@ export class SwirlCard {
137
138
  "attribute": "elevated",
138
139
  "reflect": false
139
140
  },
141
+ "elevationLevel": {
142
+ "type": "number",
143
+ "mutable": false,
144
+ "complexType": {
145
+ "original": "SwirlCardElevationLevel",
146
+ "resolved": "1 | 2 | 3",
147
+ "references": {
148
+ "SwirlCardElevationLevel": {
149
+ "location": "local",
150
+ "path": "/home/runner/work/swirl/swirl/packages/swirl-components/src/components/swirl-card/swirl-card.tsx"
151
+ }
152
+ }
153
+ },
154
+ "required": false,
155
+ "optional": true,
156
+ "docs": {
157
+ "tags": [],
158
+ "text": ""
159
+ },
160
+ "attribute": "elevation-level",
161
+ "reflect": false,
162
+ "defaultValue": "3"
163
+ },
140
164
  "height": {
141
165
  "type": "string",
142
166
  "mutable": false,
@@ -9,7 +9,7 @@ describe("swirl-card", () => {
9
9
  expect(page.root).toEqualHtml(`
10
10
  <swirl-card as="article" elevated="">
11
11
  <mock:shadow-root>
12
- <article class="card card--intent-default card--elevated card--justify-content-start" style="border-radius: var(--s-border-radius-base);">
12
+ <article class="card card--elevation-level-3 card--intent-default card--elevated card--justify-content-start" style="border-radius: var(--s-border-radius-base);">
13
13
  <div class="card__image">
14
14
  <slot name="image"></slot>
15
15
  </div>
@@ -32,7 +32,7 @@ describe("swirl-card", () => {
32
32
  expect(page.root).toEqualHtml(`
33
33
  <swirl-card href="#" link-target="_blank">
34
34
  <mock:shadow-root>
35
- <a class="card card--intent-default card--interactive card--justify-content-start" href="#" rel="noreferrer" style="border-radius: var(--s-border-radius-base);" target="_blank">
35
+ <a class="card card--elevation-level-3 card--intent-default card--interactive card--justify-content-start" href="#" rel="noreferrer" style="border-radius: var(--s-border-radius-base);" target="_blank">
36
36
  <div class="card__image">
37
37
  <slot name="image"></slot>
38
38
  </div>
@@ -55,7 +55,7 @@ describe("swirl-card", () => {
55
55
  expect(page.root).toEqualHtml(`
56
56
  <swirl-card padding="16" padding-block-start="2" padding-block-end="4" padding-inline-start="8" padding-inline-end="12">
57
57
  <mock:shadow-root>
58
- <div class="card card--intent-default card--justify-content-start" style="border-radius: var(--s-border-radius-base);">
58
+ <div class="card card--elevation-level-3 card--intent-default card--justify-content-start" style="border-radius: var(--s-border-radius-base);">
59
59
  <div class="card__image">
60
60
  <slot name="image"></slot>
61
61
  </div>
@@ -173,6 +173,10 @@
173
173
  color: var(--s-text-on-status);
174
174
  }
175
175
 
176
+ .resource-list-item--wrap-label .resource-list-item__label {
177
+ white-space: normal;
178
+ }
179
+
176
180
  .resource-list-item__content {
177
181
  --swirl-avatar-group-border-color: var(--s-background-default);
178
182
  --swirl-badge-border-color: var(--s-background-default);
@@ -52,6 +52,7 @@ export class SwirlResourceListItem {
52
52
  this.interactive = true;
53
53
  this.label = undefined;
54
54
  this.labelWeight = "medium";
55
+ this.labelWrap = undefined;
55
56
  this.menuTriggerId = undefined;
56
57
  this.menuTriggerLabel = "Options";
57
58
  this.meta = undefined;
@@ -134,6 +135,7 @@ export class SwirlResourceListItem {
134
135
  "resource-list-item--selectable": this.selectable,
135
136
  "resource-list-item--show-control-on-focus": showControlOnFocus,
136
137
  "resource-list-item--show-meta": showMeta,
138
+ "resource-list-item--wrap-label": this.labelWrap,
137
139
  });
138
140
  return (h(Host, { role: "row" }, h("div", { class: className, role: "gridcell" }, h(Tag, { "aria-checked": ariaChecked, "aria-disabled": disabled ? "true" : undefined, "aria-labelledby": this.id, class: "resource-list-item__content", href: href, disabled: disabled, onClick: this.onClick, onBlur: this.onBlur, onFocus: this.onFocus, part: "resource-list-item__content", role: role, tabIndex: 0, type: Tag === "button" ? "button" : undefined }, this.hasMedia && (h("span", { class: "resource-list-item__media" }, h("slot", { name: "media" }))), h("span", { class: "resource-list-item__label-container" }, h("span", { class: "resource-list-item__label", id: this.id, innerHTML: this.label }), this.description && (h("span", { class: "resource-list-item__description", innerHTML: this.description }))), showMeta && (h("span", { class: "resource-list-item__meta" }, h("span", { class: "resource-list-item__meta-text" }, this.meta), h("span", { class: "resource-list-item__badges" }, h("slot", { name: "badges" }))))), this.selectable && (h("span", { "aria-hidden": "true", class: "resource-list-item__checkbox" }, h("span", { class: "resource-list-item__checkbox-icon" }, this.checked && (h("swirl-icon-check-strong", null))))), h("span", { class: "resource-list-item__control" }, h("slot", { name: "control" })), showMenu && (h("swirl-popover-trigger", { popover: this.menuTriggerId }, h("swirl-button", { "aria-disabled": disabled ? "true" : undefined, class: "resource-list-item__menu-trigger", disabled: disabled, hideLabel: true, icon: "<swirl-icon-more-horizontal></swirl-icon-more-horizontal>", intent: "primary", label: this.menuTriggerLabel, onClick: this.onMenuTriggerClick })))), this.allowDrag && (h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "resource-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, type: "button" }, h("swirl-icon-drag-handle", { size: this.iconSize })))));
139
141
  }
@@ -382,6 +384,23 @@ export class SwirlResourceListItem {
382
384
  "reflect": false,
383
385
  "defaultValue": "\"medium\""
384
386
  },
387
+ "labelWrap": {
388
+ "type": "boolean",
389
+ "mutable": false,
390
+ "complexType": {
391
+ "original": "boolean",
392
+ "resolved": "boolean",
393
+ "references": {}
394
+ },
395
+ "required": false,
396
+ "optional": true,
397
+ "docs": {
398
+ "tags": [],
399
+ "text": ""
400
+ },
401
+ "attribute": "label-wrap",
402
+ "reflect": false
403
+ },
385
404
  "menuTriggerId": {
386
405
  "type": "string",
387
406
  "mutable": false,