@abgov/react-components 4.0.0-alpha.60 → 4.0.0-alpha.62

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/index.d.ts CHANGED
@@ -26,8 +26,7 @@ export * from './lib/microsite-header/microsite-header';
26
26
  export * from './lib/modal/modal';
27
27
  export * from './lib/notification/notification';
28
28
  export * from './lib/page-block/page-block';
29
- export * from './lib/page/page';
30
- export * from './lib/page/page';
29
+ export * from './lib/one-column-layout/one-column-layout';
31
30
  export * from './lib/radio-group/radio-group';
32
31
  export * from './lib/skeleton/skeleton';
33
32
  export * from './lib/spinner/spinner';
@@ -27,7 +27,7 @@ declare type ButtonProps = {
27
27
  disabled?: boolean;
28
28
  leadingIcon?: GoAIconType;
29
29
  trailingIcon?: GoAIconType;
30
- onClick: (e: any) => void;
30
+ onClick?: (e: any) => void;
31
31
  children?: ReactNode;
32
32
  };
33
33
  export declare const GoAButton: FC<ButtonProps>;
@@ -0,0 +1,13 @@
1
+ import React, { ReactNode } from "react";
2
+ declare global {
3
+ namespace JSX {
4
+ interface IntrinsicElements {
5
+ 'goa-one-column-layout': React.HTMLAttributes<HTMLElement>;
6
+ }
7
+ }
8
+ }
9
+ export interface PageProps {
10
+ children?: ReactNode;
11
+ }
12
+ export declare function GoAOneColumnLayout(props: PageProps): JSX.Element;
13
+ export default GoAOneColumnLayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.60",
3
+ "version": "4.0.0-alpha.62",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -1328,6 +1328,10 @@ function toBoolean(value) {
1328
1328
 
1329
1329
  return !!value;
1330
1330
  }
1331
+
1332
+ function fromBoolean(value) {
1333
+ return value ? "true" : "false";
1334
+ }
1331
1335
  /* libs/web-components/src/components/badge/Badge.svelte generated by Svelte v3.49.0 */
1332
1336
 
1333
1337
 
@@ -2985,7 +2989,7 @@ function create_if_block_1$9(ctx) {
2985
2989
  }
2986
2990
 
2987
2991
  };
2988
- } // (49:4) {#if isIndeterminate}
2992
+ } // (51:4) {#if isIndeterminate}
2989
2993
 
2990
2994
 
2991
2995
  function create_if_block$f(ctx) {
@@ -3256,8 +3260,10 @@ function instance$t($$self, $$props, $$invalidate) {
3256
3260
  // out of sync with the events.
3257
3261
  const newCheckStatus = !isChecked;
3258
3262
 
3259
- const _value = newCheckStatus ? `${value || "checked"}` : "";
3263
+ const _value = newCheckStatus ? `${value || "checked"}` : ""; // set the local state
3260
3264
 
3265
+
3266
+ $$invalidate(9, checked = fromBoolean(newCheckStatus));
3261
3267
  e.target.dispatchEvent(new CustomEvent("_change", {
3262
3268
  composed: true,
3263
3269
  detail: {
@@ -5310,7 +5316,7 @@ function create_fragment$r(ctx) {
5310
5316
  };
5311
5317
  }
5312
5318
 
5313
- const MAX_HEIGHT = "300px";
5319
+ const MAX_HEIGHT = "276px";
5314
5320
 
5315
5321
  function instance$p($$self, $$props, $$invalidate) {
5316
5322
  let _disabled;
@@ -13545,9 +13551,60 @@ class TextArea extends SvelteElement {
13545
13551
  }
13546
13552
 
13547
13553
  customElements.define("goa-textarea", TextArea);
13548
- /* libs/web-components/src/layouts/two-column-layout/TwoColumnLayout.svelte generated by Svelte v3.49.0 */
13554
+ /* libs/web-components/src/layouts/one-column-layout/OneColumnLayout.svelte generated by Svelte v3.49.0 */
13549
13555
 
13550
13556
  function create_fragment$4(ctx) {
13557
+ let div;
13558
+ return {
13559
+ c() {
13560
+ div = element("div");
13561
+ div.innerHTML = `<section class="header"><slot name="header"></slot></section>
13562
+
13563
+ <main><slot></slot></main>
13564
+
13565
+ <section class="footer"><slot name="footer"></slot></section>`;
13566
+ this.c = noop;
13567
+ attr(div, "class", "page");
13568
+ },
13569
+
13570
+ m(target, anchor) {
13571
+ insert(target, div, anchor);
13572
+ },
13573
+
13574
+ p: noop,
13575
+ i: noop,
13576
+ o: noop,
13577
+
13578
+ d(detaching) {
13579
+ if (detaching) detach(div);
13580
+ }
13581
+
13582
+ };
13583
+ }
13584
+
13585
+ class OneColumnLayout extends SvelteElement {
13586
+ constructor(options) {
13587
+ super();
13588
+ this.shadowRoot.innerHTML = `<style>.page{height:100vh;display:flex;flex-direction:column}.header,.footer{flex:0 0 auto}main{flex:1 1 auto}</style>`;
13589
+ init(this, {
13590
+ target: this.shadowRoot,
13591
+ props: attribute_to_object(this.attributes),
13592
+ customElement: true
13593
+ }, null, create_fragment$4, safe_not_equal, {}, null);
13594
+
13595
+ if (options) {
13596
+ if (options.target) {
13597
+ insert(options.target, this, options.anchor);
13598
+ }
13599
+ }
13600
+ }
13601
+
13602
+ }
13603
+
13604
+ customElements.define("goa-one-column-layout", OneColumnLayout);
13605
+ /* libs/web-components/src/layouts/two-column-layout/TwoColumnLayout.svelte generated by Svelte v3.49.0 */
13606
+
13607
+ function create_fragment$3(ctx) {
13551
13608
  let div;
13552
13609
  let header;
13553
13610
  let t0;
@@ -13641,7 +13698,7 @@ class TwoColumnLayout extends SvelteElement {
13641
13698
  target: this.shadowRoot,
13642
13699
  props: attribute_to_object(this.attributes),
13643
13700
  customElement: true
13644
- }, instance$2, create_fragment$4, safe_not_equal, {
13701
+ }, instance$2, create_fragment$3, safe_not_equal, {
13645
13702
  navcolumnwidth: 0,
13646
13703
  maxcontentwidth: 1
13647
13704
  }, null);
@@ -13689,7 +13746,7 @@ class TwoColumnLayout extends SvelteElement {
13689
13746
  customElements.define("goa-two-column-layout", TwoColumnLayout);
13690
13747
  /* libs/web-components/src/layouts/FullScreenNavbarLayout.svelte generated by Svelte v3.49.0 */
13691
13748
 
13692
- function create_fragment$3(ctx) {
13749
+ function create_fragment$2(ctx) {
13693
13750
  let div;
13694
13751
  return {
13695
13752
  c() {
@@ -13733,7 +13790,7 @@ class FullScreenNavbarLayout extends SvelteElement {
13733
13790
  target: this.shadowRoot,
13734
13791
  props: attribute_to_object(this.attributes),
13735
13792
  customElement: true
13736
- }, null, create_fragment$3, safe_not_equal, {}, null);
13793
+ }, null, create_fragment$2, safe_not_equal, {}, null);
13737
13794
 
13738
13795
  if (options) {
13739
13796
  if (options.target) {
@@ -13812,7 +13869,7 @@ function create_if_block(ctx) {
13812
13869
  };
13813
13870
  }
13814
13871
 
13815
- function create_fragment$2(ctx) {
13872
+ function create_fragment$1(ctx) {
13816
13873
  let goa_container;
13817
13874
  let t0;
13818
13875
  let t1;
@@ -13955,7 +14012,7 @@ class ContainerWrapper_test extends SvelteElement {
13955
14012
  target: this.shadowRoot,
13956
14013
  props: attribute_to_object(this.attributes),
13957
14014
  customElement: true
13958
- }, instance$1, create_fragment$2, safe_not_equal, {
14015
+ }, instance$1, create_fragment$1, safe_not_equal, {
13959
14016
  title: 0,
13960
14017
  actions: 1,
13961
14018
  content: 2,
@@ -14039,7 +14096,7 @@ class ContainerWrapper_test extends SvelteElement {
14039
14096
  customElements.define("test-container", ContainerWrapper_test);
14040
14097
  /* libs/web-components/src/components/divider/Divider.svelte generated by Svelte v3.49.0 */
14041
14098
 
14042
- function create_fragment$1(ctx) {
14099
+ function create_fragment(ctx) {
14043
14100
  let hr;
14044
14101
  return {
14045
14102
  c() {
@@ -14119,7 +14176,7 @@ class Divider extends SvelteElement {
14119
14176
  target: this.shadowRoot,
14120
14177
  props: attribute_to_object(this.attributes),
14121
14178
  customElement: true
14122
- }, instance, create_fragment$1, safe_not_equal, {
14179
+ }, instance, create_fragment, safe_not_equal, {
14123
14180
  spacing: 1
14124
14181
  }, null);
14125
14182
 
@@ -14153,57 +14210,6 @@ class Divider extends SvelteElement {
14153
14210
  }
14154
14211
 
14155
14212
  customElements.define("goa-divider", Divider);
14156
- /* libs/web-components/src/components/page/Page.svelte generated by Svelte v3.49.0 */
14157
-
14158
- function create_fragment(ctx) {
14159
- let div;
14160
- return {
14161
- c() {
14162
- div = element("div");
14163
- div.innerHTML = `<section class="header"><slot name="header"></slot></section>
14164
-
14165
- <main><slot></slot></main>
14166
-
14167
- <section class="footer"><slot name="footer"></slot></section>`;
14168
- this.c = noop;
14169
- attr(div, "class", "page");
14170
- },
14171
-
14172
- m(target, anchor) {
14173
- insert(target, div, anchor);
14174
- },
14175
-
14176
- p: noop,
14177
- i: noop,
14178
- o: noop,
14179
-
14180
- d(detaching) {
14181
- if (detaching) detach(div);
14182
- }
14183
-
14184
- };
14185
- }
14186
-
14187
- class Page extends SvelteElement {
14188
- constructor(options) {
14189
- super();
14190
- this.shadowRoot.innerHTML = `<style>.page{height:100vh;display:flex;flex-direction:column}.header,.footer{flex:0 0 auto}main{flex:1 1 auto}</style>`;
14191
- init(this, {
14192
- target: this.shadowRoot,
14193
- props: attribute_to_object(this.attributes),
14194
- customElement: true
14195
- }, null, create_fragment, safe_not_equal, {}, null);
14196
-
14197
- if (options) {
14198
- if (options.target) {
14199
- insert(options.target, this, options.anchor);
14200
- }
14201
- }
14202
- }
14203
-
14204
- }
14205
-
14206
- customElements.define("goa-page", Page);
14207
14213
 
14208
14214
  const GoAAppHeader = ({
14209
14215
  heading,
@@ -14342,6 +14348,10 @@ const GoAButton = ({
14342
14348
  return;
14343
14349
  }
14344
14350
 
14351
+ if (!onClick) {
14352
+ return;
14353
+ }
14354
+
14345
14355
  const current = el.current;
14346
14356
 
14347
14357
  const listener = e => {
@@ -15003,8 +15013,8 @@ const GoAPageBlock = props => {
15003
15013
  }), void 0);
15004
15014
  };
15005
15015
 
15006
- function GoAPage(props) {
15007
- return jsx("goa-page", {
15016
+ function GoAOneColumnLayout(props) {
15017
+ return jsx("goa-one-column-layout", {
15008
15018
  children: props.children
15009
15019
  }, void 0);
15010
15020
  }
@@ -15172,4 +15182,4 @@ function GoATwoColumnLayout(props) {
15172
15182
  }), void 0);
15173
15183
  }
15174
15184
 
15175
- export { GoAAppFooter, GoAAppFooterMetaSection, GoAAppFooterNavSection, GoAAppHeader, GoABadge, GoAButton, GoAButtonGroup, GoACallout, GoACheckbox, GoAChip, GoACircularProgress, GoAContainer, GoADivider, GoADropdown, GoADropdownOption, GoAEmergencyBadge, GoAFlexCol, GoAFlexRow, GoAFormItem, GoAHeroBanner, GoAHeroBannerActions, GoAIcon, GoAIconButton, GoAImportantBadge, GoAInfoBadge, GoAInput, GoAInputDate, GoAInputDateTime, GoAInputEmail, GoAInputFile, GoAInputMonth, GoAInputNumber, GoAInputPassword, GoAInputRange, GoAInputSearch, GoAInputTel, GoAInputText, GoAInputTime, GoAInputUrl, GoAMicrositeHeader, GoAModal, GoANotification, GoAPage, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoATwoColumnLayout };
15185
+ export { GoAAppFooter, GoAAppFooterMetaSection, GoAAppFooterNavSection, GoAAppHeader, GoABadge, GoAButton, GoAButtonGroup, GoACallout, GoACheckbox, GoAChip, GoACircularProgress, GoAContainer, GoADivider, GoADropdown, GoADropdownOption, GoAEmergencyBadge, GoAFlexCol, GoAFlexRow, GoAFormItem, GoAHeroBanner, GoAHeroBannerActions, GoAIcon, GoAIconButton, GoAImportantBadge, GoAInfoBadge, GoAInput, GoAInputDate, GoAInputDateTime, GoAInputEmail, GoAInputFile, GoAInputMonth, GoAInputNumber, GoAInputPassword, GoAInputRange, GoAInputSearch, GoAInputTel, GoAInputText, GoAInputTime, GoAInputUrl, GoAMicrositeHeader, GoAModal, GoANotification, GoAOneColumnLayout, GoAPageBlock, GoARadioGroup, GoARadioItem, GoASkeleton, GoASpinner, GoASuccessBadge, GoATextArea, GoATwoColumnLayout };
@@ -1369,6 +1369,10 @@
1369
1369
 
1370
1370
  return !!value;
1371
1371
  }
1372
+
1373
+ function fromBoolean(value) {
1374
+ return value ? "true" : "false";
1375
+ }
1372
1376
  /* libs/web-components/src/components/badge/Badge.svelte generated by Svelte v3.49.0 */
1373
1377
 
1374
1378
 
@@ -3026,7 +3030,7 @@
3026
3030
  }
3027
3031
 
3028
3032
  };
3029
- } // (49:4) {#if isIndeterminate}
3033
+ } // (51:4) {#if isIndeterminate}
3030
3034
 
3031
3035
 
3032
3036
  function create_if_block$f(ctx) {
@@ -3297,8 +3301,10 @@
3297
3301
  // out of sync with the events.
3298
3302
  const newCheckStatus = !isChecked;
3299
3303
 
3300
- const _value = newCheckStatus ? `${value || "checked"}` : "";
3304
+ const _value = newCheckStatus ? `${value || "checked"}` : ""; // set the local state
3301
3305
 
3306
+
3307
+ $$invalidate(9, checked = fromBoolean(newCheckStatus));
3302
3308
  e.target.dispatchEvent(new CustomEvent("_change", {
3303
3309
  composed: true,
3304
3310
  detail: {
@@ -5352,7 +5358,7 @@
5352
5358
  };
5353
5359
  }
5354
5360
 
5355
- const MAX_HEIGHT = "300px";
5361
+ const MAX_HEIGHT = "276px";
5356
5362
 
5357
5363
  function instance$p($$self, $$props, $$invalidate) {
5358
5364
  const showMenu = _async(function () {
@@ -13594,9 +13600,60 @@
13594
13600
  }
13595
13601
 
13596
13602
  customElements.define("goa-textarea", TextArea);
13597
- /* libs/web-components/src/layouts/two-column-layout/TwoColumnLayout.svelte generated by Svelte v3.49.0 */
13603
+ /* libs/web-components/src/layouts/one-column-layout/OneColumnLayout.svelte generated by Svelte v3.49.0 */
13598
13604
 
13599
13605
  function create_fragment$4(ctx) {
13606
+ let div;
13607
+ return {
13608
+ c() {
13609
+ div = element("div");
13610
+ div.innerHTML = `<section class="header"><slot name="header"></slot></section>
13611
+
13612
+ <main><slot></slot></main>
13613
+
13614
+ <section class="footer"><slot name="footer"></slot></section>`;
13615
+ this.c = noop;
13616
+ attr(div, "class", "page");
13617
+ },
13618
+
13619
+ m(target, anchor) {
13620
+ insert(target, div, anchor);
13621
+ },
13622
+
13623
+ p: noop,
13624
+ i: noop,
13625
+ o: noop,
13626
+
13627
+ d(detaching) {
13628
+ if (detaching) detach(div);
13629
+ }
13630
+
13631
+ };
13632
+ }
13633
+
13634
+ class OneColumnLayout extends SvelteElement {
13635
+ constructor(options) {
13636
+ super();
13637
+ this.shadowRoot.innerHTML = `<style>.page{height:100vh;display:flex;flex-direction:column}.header,.footer{flex:0 0 auto}main{flex:1 1 auto}</style>`;
13638
+ init(this, {
13639
+ target: this.shadowRoot,
13640
+ props: attribute_to_object(this.attributes),
13641
+ customElement: true
13642
+ }, null, create_fragment$4, safe_not_equal, {}, null);
13643
+
13644
+ if (options) {
13645
+ if (options.target) {
13646
+ insert(options.target, this, options.anchor);
13647
+ }
13648
+ }
13649
+ }
13650
+
13651
+ }
13652
+
13653
+ customElements.define("goa-one-column-layout", OneColumnLayout);
13654
+ /* libs/web-components/src/layouts/two-column-layout/TwoColumnLayout.svelte generated by Svelte v3.49.0 */
13655
+
13656
+ function create_fragment$3(ctx) {
13600
13657
  let div;
13601
13658
  let header;
13602
13659
  let t0;
@@ -13690,7 +13747,7 @@
13690
13747
  target: this.shadowRoot,
13691
13748
  props: attribute_to_object(this.attributes),
13692
13749
  customElement: true
13693
- }, instance$2, create_fragment$4, safe_not_equal, {
13750
+ }, instance$2, create_fragment$3, safe_not_equal, {
13694
13751
  navcolumnwidth: 0,
13695
13752
  maxcontentwidth: 1
13696
13753
  }, null);
@@ -13738,7 +13795,7 @@
13738
13795
  customElements.define("goa-two-column-layout", TwoColumnLayout);
13739
13796
  /* libs/web-components/src/layouts/FullScreenNavbarLayout.svelte generated by Svelte v3.49.0 */
13740
13797
 
13741
- function create_fragment$3(ctx) {
13798
+ function create_fragment$2(ctx) {
13742
13799
  let div;
13743
13800
  return {
13744
13801
  c() {
@@ -13782,7 +13839,7 @@
13782
13839
  target: this.shadowRoot,
13783
13840
  props: attribute_to_object(this.attributes),
13784
13841
  customElement: true
13785
- }, null, create_fragment$3, safe_not_equal, {}, null);
13842
+ }, null, create_fragment$2, safe_not_equal, {}, null);
13786
13843
 
13787
13844
  if (options) {
13788
13845
  if (options.target) {
@@ -13861,7 +13918,7 @@
13861
13918
  };
13862
13919
  }
13863
13920
 
13864
- function create_fragment$2(ctx) {
13921
+ function create_fragment$1(ctx) {
13865
13922
  let goa_container;
13866
13923
  let t0;
13867
13924
  let t1;
@@ -14004,7 +14061,7 @@
14004
14061
  target: this.shadowRoot,
14005
14062
  props: attribute_to_object(this.attributes),
14006
14063
  customElement: true
14007
- }, instance$1, create_fragment$2, safe_not_equal, {
14064
+ }, instance$1, create_fragment$1, safe_not_equal, {
14008
14065
  title: 0,
14009
14066
  actions: 1,
14010
14067
  content: 2,
@@ -14088,7 +14145,7 @@
14088
14145
  customElements.define("test-container", ContainerWrapper_test);
14089
14146
  /* libs/web-components/src/components/divider/Divider.svelte generated by Svelte v3.49.0 */
14090
14147
 
14091
- function create_fragment$1(ctx) {
14148
+ function create_fragment(ctx) {
14092
14149
  let hr;
14093
14150
  return {
14094
14151
  c() {
@@ -14168,7 +14225,7 @@
14168
14225
  target: this.shadowRoot,
14169
14226
  props: attribute_to_object(this.attributes),
14170
14227
  customElement: true
14171
- }, instance, create_fragment$1, safe_not_equal, {
14228
+ }, instance, create_fragment, safe_not_equal, {
14172
14229
  spacing: 1
14173
14230
  }, null);
14174
14231
 
@@ -14202,57 +14259,6 @@
14202
14259
  }
14203
14260
 
14204
14261
  customElements.define("goa-divider", Divider);
14205
- /* libs/web-components/src/components/page/Page.svelte generated by Svelte v3.49.0 */
14206
-
14207
- function create_fragment(ctx) {
14208
- let div;
14209
- return {
14210
- c() {
14211
- div = element("div");
14212
- div.innerHTML = `<section class="header"><slot name="header"></slot></section>
14213
-
14214
- <main><slot></slot></main>
14215
-
14216
- <section class="footer"><slot name="footer"></slot></section>`;
14217
- this.c = noop;
14218
- attr(div, "class", "page");
14219
- },
14220
-
14221
- m(target, anchor) {
14222
- insert(target, div, anchor);
14223
- },
14224
-
14225
- p: noop,
14226
- i: noop,
14227
- o: noop,
14228
-
14229
- d(detaching) {
14230
- if (detaching) detach(div);
14231
- }
14232
-
14233
- };
14234
- }
14235
-
14236
- class Page extends SvelteElement {
14237
- constructor(options) {
14238
- super();
14239
- this.shadowRoot.innerHTML = `<style>.page{height:100vh;display:flex;flex-direction:column}.header,.footer{flex:0 0 auto}main{flex:1 1 auto}</style>`;
14240
- init(this, {
14241
- target: this.shadowRoot,
14242
- props: attribute_to_object(this.attributes),
14243
- customElement: true
14244
- }, null, create_fragment, safe_not_equal, {}, null);
14245
-
14246
- if (options) {
14247
- if (options.target) {
14248
- insert(options.target, this, options.anchor);
14249
- }
14250
- }
14251
- }
14252
-
14253
- }
14254
-
14255
- customElements.define("goa-page", Page);
14256
14262
 
14257
14263
  /*! *****************************************************************************
14258
14264
  Copyright (c) Microsoft Corporation.
@@ -14423,6 +14429,10 @@
14423
14429
  return;
14424
14430
  }
14425
14431
 
14432
+ if (!onClick) {
14433
+ return;
14434
+ }
14435
+
14426
14436
  var current = el.current;
14427
14437
 
14428
14438
  var listener = function listener(e) {
@@ -15042,8 +15052,8 @@
15042
15052
  }), void 0);
15043
15053
  };
15044
15054
 
15045
- function GoAPage(props) {
15046
- return jsxRuntime.jsx("goa-page", {
15055
+ function GoAOneColumnLayout(props) {
15056
+ return jsxRuntime.jsx("goa-one-column-layout", {
15047
15057
  children: props.children
15048
15058
  }, void 0);
15049
15059
  }
@@ -15251,7 +15261,7 @@
15251
15261
  exports.GoAMicrositeHeader = GoAMicrositeHeader;
15252
15262
  exports.GoAModal = GoAModal;
15253
15263
  exports.GoANotification = GoANotification;
15254
- exports.GoAPage = GoAPage;
15264
+ exports.GoAOneColumnLayout = GoAOneColumnLayout;
15255
15265
  exports.GoAPageBlock = GoAPageBlock;
15256
15266
  exports.GoARadioGroup = GoARadioGroup;
15257
15267
  exports.GoARadioItem = GoARadioItem;
@@ -1,13 +0,0 @@
1
- import React, { ReactNode } from "react";
2
- declare global {
3
- namespace JSX {
4
- interface IntrinsicElements {
5
- 'goa-page': React.HTMLAttributes<HTMLElement>;
6
- }
7
- }
8
- }
9
- export interface PageProps {
10
- children?: ReactNode;
11
- }
12
- export declare function GoAPage(props: PageProps): JSX.Element;
13
- export default GoAPage;