@abgov/react-components 4.0.0-alpha.68 → 4.0.0-alpha.69

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.
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  export declare type SkeletonType = "image" | "text" | "title" | "text-small" | "avatar" | "header" | "paragraph" | "thumbnail" | "card" | "profile";
3
+ declare type SkeletonSize = 1 | 2 | 3 | 4;
3
4
  interface WCProps {
4
- size: number;
5
+ maxwidth?: string;
6
+ size?: SkeletonSize;
7
+ linecount?: number;
5
8
  type: SkeletonType;
6
9
  }
7
10
  declare global {
@@ -12,8 +15,10 @@ declare global {
12
15
  }
13
16
  }
14
17
  export interface SkeletonProps {
18
+ maxWidth?: string;
19
+ size?: SkeletonSize;
20
+ lineCount?: number;
15
21
  type: SkeletonType;
16
- size?: number;
17
22
  }
18
- export declare const GoASkeleton: ({ type, size }: SkeletonProps) => JSX.Element;
23
+ export declare const GoASkeleton: ({ maxWidth, size, lineCount, type }: SkeletonProps) => JSX.Element;
19
24
  export default GoASkeleton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.68",
3
+ "version": "4.0.0-alpha.69",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -1241,7 +1241,7 @@ function instance$A($$self, $$props, $$invalidate) {
1241
1241
  class AppHeader extends SvelteElement {
1242
1242
  constructor(options) {
1243
1243
  super();
1244
- this.shadowRoot.innerHTML = `<style>*{box-sizing:border-box;font-family:var(--font-family)}.app-header{margin:0 auto;border-bottom:1px solid var(--color-gray-100)}@media(max-width: 640px){.app-header{padding:1rem 1rem}}.content{margin:0 auto;width:min(var(--max-content-width), 100%);display:flex;align-items:center;justify-content:space-between}@media(min-width: 640px){.content{padding:2rem 1.5rem}}.app-link{display:flex;align-items:center;text-decoration:none;color:inherit}.title{margin-left:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.image-desktop{display:none}.image-mobile{display:block}@media(min-width: 640px){.image-desktop{display:block}.image-mobile{display:none}.title{margin-left:1.75rem}.image-desktop{display:block}.image-mobile{display:none}}</style>`;
1244
+ this.shadowRoot.innerHTML = `<style>*{box-sizing:border-box;font-family:var(--font-family)}.app-header{margin:0 auto;border-bottom:1px solid var(--color-gray-100)}@media(max-width: 640px){.app-header{padding:1rem 1rem}}.content{margin:0 auto;width:min(var(--max-content-width), 100%);display:flex;align-items:center;justify-content:space-between}@media(min-width: 640px){.content{padding:1.5rem 1.125rem}}.app-link{display:flex;align-items:center;text-decoration:none;color:inherit}.title{margin-left:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.image-desktop{display:none}.image-mobile{display:block}@media(min-width: 640px){.image-desktop{display:block}.image-mobile{display:none}.title{margin-left:1.75rem}.image-desktop{display:block}.image-mobile{display:none}}</style>`;
1245
1245
  init(this, {
1246
1246
  target: this.shadowRoot,
1247
1247
  props: attribute_to_object(this.attributes),
@@ -12056,9 +12056,9 @@ function create_if_block$3(ctx) {
12056
12056
  attr(div1, "class", div1_class_value = "card card-" +
12057
12057
  /*size*/
12058
12058
  ctx[1]);
12059
- set_style(div1, "--width",
12060
- /*width*/
12061
- ctx[0] + "px");
12059
+ set_style(div1, "--max-width",
12060
+ /*maxwidth*/
12061
+ ctx[0]);
12062
12062
  },
12063
12063
 
12064
12064
  m(target, anchor) {
@@ -12104,11 +12104,11 @@ function create_if_block$3(ctx) {
12104
12104
  }
12105
12105
 
12106
12106
  if (!current || dirty &
12107
- /*width*/
12107
+ /*maxwidth*/
12108
12108
  1) {
12109
- set_style(div1, "--width",
12110
- /*width*/
12111
- ctx[0] + "px");
12109
+ set_style(div1, "--max-width",
12110
+ /*maxwidth*/
12111
+ ctx[0]);
12112
12112
  }
12113
12113
  },
12114
12114
 
@@ -12278,7 +12278,7 @@ function create_fragment$7(ctx) {
12278
12278
 
12279
12279
  function instance$5($$self, $$props, $$invalidate) {
12280
12280
  let {
12281
- width = 320
12281
+ maxwidth
12282
12282
  } = $$props;
12283
12283
  let {
12284
12284
  size = 1
@@ -12291,25 +12291,25 @@ function instance$5($$self, $$props, $$invalidate) {
12291
12291
  } = $$props;
12292
12292
 
12293
12293
  $$self.$$set = $$props => {
12294
- if ('width' in $$props) $$invalidate(0, width = $$props.width);
12294
+ if ('maxwidth' in $$props) $$invalidate(0, maxwidth = $$props.maxwidth);
12295
12295
  if ('size' in $$props) $$invalidate(1, size = $$props.size);
12296
12296
  if ('linecount' in $$props) $$invalidate(2, linecount = $$props.linecount);
12297
12297
  if ('type' in $$props) $$invalidate(3, type = $$props.type);
12298
12298
  };
12299
12299
 
12300
- return [width, size, linecount, type];
12300
+ return [maxwidth, size, linecount, type];
12301
12301
  }
12302
12302
 
12303
12303
  class Skeleton extends SvelteElement {
12304
12304
  constructor(options) {
12305
12305
  super();
12306
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}@keyframes pulse{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}.skeleton{background-color:var(--color-gray-100);animation:pulse 2s infinite ease-in-out;overflow:hidden;margin:10px 0}.image,.image-1{background-color:var(--color-gray-100);flex:1 1 100px;height:100px;margin:0}.image-2{height:140px}.image-3{height:200px}.image-4{height:300px}.text,.text-1,.text-2,.text-3,.text-4{width:100%;height:.75rem;border-radius:0.25rem;margin:6px 0}.title,.title-1,.title-2{width:100%;height:.75rem;border-radius:0.25rem}.title-3{height:.8rem}.title-4{height:1rem}.text-small,.text-small-1{width:30%;height:6px;border-radius:2px}.text-small-2{width:40%;height:8px;border-radius:2px}.text-small-3{width:50%;height:10px;border-radius:3px}.text-small-4{width:70%;height:12px;border-radius:4px}.paragraph{width:100%;height:70px;border-radius:4px}.header,.header-1{width:50%;height:18px;margin:12px 0;border-radius:0.25rem}.header-2{width:60%;height:20px;margin:14px 0;border-radius:0.25rem}.header-3{width:70%;height:22px;margin:16px 0;border-radius:0.25rem}.header-4{width:80%;height:24px;margin:18px 0;border-radius:0.3rem}.avatar{display:inline-block}.avatar,.avatar-1{width:40px;height:40px;border-radius:50%}.avatar-2{width:60px;height:60px;border-radius:50%}.avatar-3{width:80px;height:80px;border-radius:50%}.avatar-4{width:120px;height:120px;border-radius:50%}.thumbnail{display:inline-block}.thumbnail,.thumbnail-1{width:40px;height:40px;border-radius:4px}.thumbnail-2{width:60px;height:60px;border-radius:4px}.thumbnail-3{width:80px;height:80px;border-radius:4px}.thumbnail-4{width:120px;height:120px;border-radius:4px}.card{display:inline-block}.card,.card-1,.card-2,.card-3,.card-4{border:1px solid var(--color-gray-100);border-radius:4px}.card{width:100%}@media(min-width: 320px){.card{width:var(--width)}}.card-content{flex:1 1 auto;padding:1rem}.profile{display:flex;flex-direction:row;align-items:center}.profile-1{max-width:280px;gap:1rem}.profile-2{max-width:360px;gap:1rem}.profile-3{max-width:480px;gap:1rem}.profile-4{max-width:560px;gap:1rem}.profile .profile-avatar{flex-shrink:0}.profile .profile-name{flex:1 1 auto}</style>`;
12306
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}@keyframes pulse{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}.skeleton{background-color:var(--color-gray-100);animation:pulse 2s infinite ease-in-out;overflow:hidden;margin:10px 0}.image,.image-1{background-color:var(--color-gray-100);flex:1 1 100px;height:100px;margin:0}.image-2{height:140px}.image-3{height:200px}.image-4{height:300px}.text,.text-1,.text-2,.text-3,.text-4{width:100%;height:.75rem;border-radius:0.25rem;margin:6px 0}.title,.title-1,.title-2{width:100%;height:.75rem;border-radius:0.25rem}.title-3{height:.8rem}.title-4{height:1rem}.text-small,.text-small-1{width:30%;height:6px;border-radius:2px}.text-small-2{width:40%;height:8px;border-radius:2px}.text-small-3{width:50%;height:10px;border-radius:3px}.text-small-4{width:70%;height:12px;border-radius:4px}.paragraph{width:100%;height:70px;border-radius:4px}.header,.header-1{width:50%;height:18px;margin:12px 0;border-radius:0.25rem}.header-2{width:60%;height:20px;margin:14px 0;border-radius:0.25rem}.header-3{width:70%;height:22px;margin:16px 0;border-radius:0.25rem}.header-4{width:80%;height:24px;margin:18px 0;border-radius:0.3rem}.avatar{display:inline-block}.avatar,.avatar-1{width:40px;height:40px;border-radius:50%}.avatar-2{width:60px;height:60px;border-radius:50%}.avatar-3{width:80px;height:80px;border-radius:50%}.avatar-4{width:120px;height:120px;border-radius:50%}.thumbnail{display:inline-block}.thumbnail,.thumbnail-1{width:40px;height:40px;border-radius:4px}.thumbnail-2{width:60px;height:60px;border-radius:4px}.thumbnail-3{width:80px;height:80px;border-radius:4px}.thumbnail-4{width:120px;height:120px;border-radius:4px}.card{display:inline-block}.card,.card-1,.card-2,.card-3,.card-4{border:1px solid var(--color-gray-100);border-radius:4px}.card{width:100%}@media(min-width: 480px){.card{max-width:var(--max-width)}}.card-content{flex:1 1 auto;padding:1rem}.profile{display:flex;flex-direction:row;align-items:center}.profile-1{max-width:280px;gap:1rem}.profile-2{max-width:360px;gap:1rem}.profile-3{max-width:480px;gap:1rem}.profile-4{max-width:560px;gap:1rem}.profile .profile-avatar{flex-shrink:0}.profile .profile-name{flex:1 1 auto}</style>`;
12307
12307
  init(this, {
12308
12308
  target: this.shadowRoot,
12309
12309
  props: attribute_to_object(this.attributes),
12310
12310
  customElement: true
12311
12311
  }, instance$5, create_fragment$7, safe_not_equal, {
12312
- width: 0,
12312
+ maxwidth: 0,
12313
12313
  size: 1,
12314
12314
  linecount: 2,
12315
12315
  type: 3
@@ -12328,16 +12328,16 @@ class Skeleton extends SvelteElement {
12328
12328
  }
12329
12329
 
12330
12330
  static get observedAttributes() {
12331
- return ["width", "size", "linecount", "type"];
12331
+ return ["maxwidth", "size", "linecount", "type"];
12332
12332
  }
12333
12333
 
12334
- get width() {
12334
+ get maxwidth() {
12335
12335
  return this.$$.ctx[0];
12336
12336
  }
12337
12337
 
12338
- set width(width) {
12338
+ set maxwidth(maxwidth) {
12339
12339
  this.$$set({
12340
- width
12340
+ maxwidth
12341
12341
  });
12342
12342
  flush();
12343
12343
  }
@@ -15110,12 +15110,16 @@ const GoARadioGroup = ({
15110
15110
  };
15111
15111
 
15112
15112
  const GoASkeleton = ({
15113
- type,
15114
- size: _size = 1
15113
+ maxWidth,
15114
+ size,
15115
+ lineCount,
15116
+ type
15115
15117
  }) => {
15116
15118
  return jsx("goa-skeleton", {
15119
+ maxwidth: maxWidth,
15120
+ linecount: lineCount,
15117
15121
  type: type,
15118
- size: _size
15122
+ size: size
15119
15123
  }, void 0);
15120
15124
  };
15121
15125
 
@@ -1282,7 +1282,7 @@
1282
1282
  class AppHeader extends SvelteElement {
1283
1283
  constructor(options) {
1284
1284
  super();
1285
- this.shadowRoot.innerHTML = `<style>*{box-sizing:border-box;font-family:var(--font-family)}.app-header{margin:0 auto;border-bottom:1px solid var(--color-gray-100)}@media(max-width: 640px){.app-header{padding:1rem 1rem}}.content{margin:0 auto;width:min(var(--max-content-width), 100%);display:flex;align-items:center;justify-content:space-between}@media(min-width: 640px){.content{padding:2rem 1.5rem}}.app-link{display:flex;align-items:center;text-decoration:none;color:inherit}.title{margin-left:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.image-desktop{display:none}.image-mobile{display:block}@media(min-width: 640px){.image-desktop{display:block}.image-mobile{display:none}.title{margin-left:1.75rem}.image-desktop{display:block}.image-mobile{display:none}}</style>`;
1285
+ this.shadowRoot.innerHTML = `<style>*{box-sizing:border-box;font-family:var(--font-family)}.app-header{margin:0 auto;border-bottom:1px solid var(--color-gray-100)}@media(max-width: 640px){.app-header{padding:1rem 1rem}}.content{margin:0 auto;width:min(var(--max-content-width), 100%);display:flex;align-items:center;justify-content:space-between}@media(min-width: 640px){.content{padding:1.5rem 1.125rem}}.app-link{display:flex;align-items:center;text-decoration:none;color:inherit}.title{margin-left:0.5rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.image-desktop{display:none}.image-mobile{display:block}@media(min-width: 640px){.image-desktop{display:block}.image-mobile{display:none}.title{margin-left:1.75rem}.image-desktop{display:block}.image-mobile{display:none}}</style>`;
1286
1286
  init(this, {
1287
1287
  target: this.shadowRoot,
1288
1288
  props: attribute_to_object(this.attributes),
@@ -12105,9 +12105,9 @@
12105
12105
  attr(div1, "class", div1_class_value = "card card-" +
12106
12106
  /*size*/
12107
12107
  ctx[1]);
12108
- set_style(div1, "--width",
12109
- /*width*/
12110
- ctx[0] + "px");
12108
+ set_style(div1, "--max-width",
12109
+ /*maxwidth*/
12110
+ ctx[0]);
12111
12111
  },
12112
12112
 
12113
12113
  m(target, anchor) {
@@ -12153,11 +12153,11 @@
12153
12153
  }
12154
12154
 
12155
12155
  if (!current || dirty &
12156
- /*width*/
12156
+ /*maxwidth*/
12157
12157
  1) {
12158
- set_style(div1, "--width",
12159
- /*width*/
12160
- ctx[0] + "px");
12158
+ set_style(div1, "--max-width",
12159
+ /*maxwidth*/
12160
+ ctx[0]);
12161
12161
  }
12162
12162
  },
12163
12163
 
@@ -12327,7 +12327,7 @@
12327
12327
 
12328
12328
  function instance$5($$self, $$props, $$invalidate) {
12329
12329
  let {
12330
- width = 320
12330
+ maxwidth
12331
12331
  } = $$props;
12332
12332
  let {
12333
12333
  size = 1
@@ -12340,25 +12340,25 @@
12340
12340
  } = $$props;
12341
12341
 
12342
12342
  $$self.$$set = $$props => {
12343
- if ('width' in $$props) $$invalidate(0, width = $$props.width);
12343
+ if ('maxwidth' in $$props) $$invalidate(0, maxwidth = $$props.maxwidth);
12344
12344
  if ('size' in $$props) $$invalidate(1, size = $$props.size);
12345
12345
  if ('linecount' in $$props) $$invalidate(2, linecount = $$props.linecount);
12346
12346
  if ('type' in $$props) $$invalidate(3, type = $$props.type);
12347
12347
  };
12348
12348
 
12349
- return [width, size, linecount, type];
12349
+ return [maxwidth, size, linecount, type];
12350
12350
  }
12351
12351
 
12352
12352
  class Skeleton extends SvelteElement {
12353
12353
  constructor(options) {
12354
12354
  super();
12355
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}@keyframes pulse{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}.skeleton{background-color:var(--color-gray-100);animation:pulse 2s infinite ease-in-out;overflow:hidden;margin:10px 0}.image,.image-1{background-color:var(--color-gray-100);flex:1 1 100px;height:100px;margin:0}.image-2{height:140px}.image-3{height:200px}.image-4{height:300px}.text,.text-1,.text-2,.text-3,.text-4{width:100%;height:.75rem;border-radius:0.25rem;margin:6px 0}.title,.title-1,.title-2{width:100%;height:.75rem;border-radius:0.25rem}.title-3{height:.8rem}.title-4{height:1rem}.text-small,.text-small-1{width:30%;height:6px;border-radius:2px}.text-small-2{width:40%;height:8px;border-radius:2px}.text-small-3{width:50%;height:10px;border-radius:3px}.text-small-4{width:70%;height:12px;border-radius:4px}.paragraph{width:100%;height:70px;border-radius:4px}.header,.header-1{width:50%;height:18px;margin:12px 0;border-radius:0.25rem}.header-2{width:60%;height:20px;margin:14px 0;border-radius:0.25rem}.header-3{width:70%;height:22px;margin:16px 0;border-radius:0.25rem}.header-4{width:80%;height:24px;margin:18px 0;border-radius:0.3rem}.avatar{display:inline-block}.avatar,.avatar-1{width:40px;height:40px;border-radius:50%}.avatar-2{width:60px;height:60px;border-radius:50%}.avatar-3{width:80px;height:80px;border-radius:50%}.avatar-4{width:120px;height:120px;border-radius:50%}.thumbnail{display:inline-block}.thumbnail,.thumbnail-1{width:40px;height:40px;border-radius:4px}.thumbnail-2{width:60px;height:60px;border-radius:4px}.thumbnail-3{width:80px;height:80px;border-radius:4px}.thumbnail-4{width:120px;height:120px;border-radius:4px}.card{display:inline-block}.card,.card-1,.card-2,.card-3,.card-4{border:1px solid var(--color-gray-100);border-radius:4px}.card{width:100%}@media(min-width: 320px){.card{width:var(--width)}}.card-content{flex:1 1 auto;padding:1rem}.profile{display:flex;flex-direction:row;align-items:center}.profile-1{max-width:280px;gap:1rem}.profile-2{max-width:360px;gap:1rem}.profile-3{max-width:480px;gap:1rem}.profile-4{max-width:560px;gap:1rem}.profile .profile-avatar{flex-shrink:0}.profile .profile-name{flex:1 1 auto}</style>`;
12355
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}@keyframes pulse{0%{opacity:0.5}50%{opacity:1}100%{opacity:0.5}}.skeleton{background-color:var(--color-gray-100);animation:pulse 2s infinite ease-in-out;overflow:hidden;margin:10px 0}.image,.image-1{background-color:var(--color-gray-100);flex:1 1 100px;height:100px;margin:0}.image-2{height:140px}.image-3{height:200px}.image-4{height:300px}.text,.text-1,.text-2,.text-3,.text-4{width:100%;height:.75rem;border-radius:0.25rem;margin:6px 0}.title,.title-1,.title-2{width:100%;height:.75rem;border-radius:0.25rem}.title-3{height:.8rem}.title-4{height:1rem}.text-small,.text-small-1{width:30%;height:6px;border-radius:2px}.text-small-2{width:40%;height:8px;border-radius:2px}.text-small-3{width:50%;height:10px;border-radius:3px}.text-small-4{width:70%;height:12px;border-radius:4px}.paragraph{width:100%;height:70px;border-radius:4px}.header,.header-1{width:50%;height:18px;margin:12px 0;border-radius:0.25rem}.header-2{width:60%;height:20px;margin:14px 0;border-radius:0.25rem}.header-3{width:70%;height:22px;margin:16px 0;border-radius:0.25rem}.header-4{width:80%;height:24px;margin:18px 0;border-radius:0.3rem}.avatar{display:inline-block}.avatar,.avatar-1{width:40px;height:40px;border-radius:50%}.avatar-2{width:60px;height:60px;border-radius:50%}.avatar-3{width:80px;height:80px;border-radius:50%}.avatar-4{width:120px;height:120px;border-radius:50%}.thumbnail{display:inline-block}.thumbnail,.thumbnail-1{width:40px;height:40px;border-radius:4px}.thumbnail-2{width:60px;height:60px;border-radius:4px}.thumbnail-3{width:80px;height:80px;border-radius:4px}.thumbnail-4{width:120px;height:120px;border-radius:4px}.card{display:inline-block}.card,.card-1,.card-2,.card-3,.card-4{border:1px solid var(--color-gray-100);border-radius:4px}.card{width:100%}@media(min-width: 480px){.card{max-width:var(--max-width)}}.card-content{flex:1 1 auto;padding:1rem}.profile{display:flex;flex-direction:row;align-items:center}.profile-1{max-width:280px;gap:1rem}.profile-2{max-width:360px;gap:1rem}.profile-3{max-width:480px;gap:1rem}.profile-4{max-width:560px;gap:1rem}.profile .profile-avatar{flex-shrink:0}.profile .profile-name{flex:1 1 auto}</style>`;
12356
12356
  init(this, {
12357
12357
  target: this.shadowRoot,
12358
12358
  props: attribute_to_object(this.attributes),
12359
12359
  customElement: true
12360
12360
  }, instance$5, create_fragment$7, safe_not_equal, {
12361
- width: 0,
12361
+ maxwidth: 0,
12362
12362
  size: 1,
12363
12363
  linecount: 2,
12364
12364
  type: 3
@@ -12377,16 +12377,16 @@
12377
12377
  }
12378
12378
 
12379
12379
  static get observedAttributes() {
12380
- return ["width", "size", "linecount", "type"];
12380
+ return ["maxwidth", "size", "linecount", "type"];
12381
12381
  }
12382
12382
 
12383
- get width() {
12383
+ get maxwidth() {
12384
12384
  return this.$$.ctx[0];
12385
12385
  }
12386
12386
 
12387
- set width(width) {
12387
+ set maxwidth(maxwidth) {
12388
12388
  this.$$set({
12389
- width
12389
+ maxwidth
12390
12390
  });
12391
12391
  flush();
12392
12392
  }
@@ -15153,10 +15153,13 @@
15153
15153
  };
15154
15154
 
15155
15155
  var GoASkeleton = function GoASkeleton(_a) {
15156
- var type = _a.type,
15157
- _b = _a.size,
15158
- size = _b === void 0 ? 1 : _b;
15156
+ var maxWidth = _a.maxWidth,
15157
+ size = _a.size,
15158
+ lineCount = _a.lineCount,
15159
+ type = _a.type;
15159
15160
  return jsxRuntime.jsx("goa-skeleton", {
15161
+ maxwidth: maxWidth,
15162
+ linecount: lineCount,
15160
15163
  type: type,
15161
15164
  size: size
15162
15165
  }, void 0);