@abgov/react-components 4.0.0-alpha.29 → 4.0.0-alpha.31

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,10 +1,12 @@
1
1
  import React, { FC, ReactNode } from 'react';
2
2
  declare type ContainerVariant = 'primary' | 'info' | 'error' | 'success' | 'warning' | 'default';
3
3
  declare type HeadingSize = 'large' | 'small' | 'none';
4
+ declare type ContainerPadding = "relaxed" | "compact";
4
5
  interface WCProps {
5
6
  variant: ContainerVariant;
6
7
  headingsize: HeadingSize;
7
8
  colored: boolean;
9
+ padding: ContainerPadding;
8
10
  }
9
11
  declare global {
10
12
  namespace JSX {
@@ -18,8 +20,8 @@ interface Props {
18
20
  variant?: ContainerVariant;
19
21
  title?: ReactNode;
20
22
  colored?: boolean;
23
+ padding: ContainerPadding;
21
24
  actions?: ReactNode;
22
- children: ReactNode;
23
25
  }
24
26
  export declare const GoAContainer: FC<Props>;
25
27
  export default GoAContainer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.29",
3
+ "version": "4.0.0-alpha.31",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -4255,7 +4255,7 @@ function get_each_context$4(ctx, list, i) {
4255
4255
  child_ctx[35] = list[i];
4256
4256
  child_ctx[37] = i;
4257
4257
  return child_ctx;
4258
- } // (175:2) {#if isMenuVisible}
4258
+ } // (179:2) {#if isMenuVisible}
4259
4259
 
4260
4260
 
4261
4261
  function create_if_block$d(ctx) {
@@ -4300,7 +4300,7 @@ function create_if_block$d(ctx) {
4300
4300
  }
4301
4301
 
4302
4302
  };
4303
- } // (211:4) {#each options as option, index (option.value)}
4303
+ } // (215:4) {#each options as option, index (option.value)}
4304
4304
 
4305
4305
 
4306
4306
  function create_each_block$4(key_1, ctx) {
@@ -4737,6 +4737,11 @@ function instance$o($$self, $$props, $$invalidate) {
4737
4737
  let ctx; // Hooks
4738
4738
 
4739
4739
  onMount(async () => {
4740
+ if (!name) {
4741
+ console.error("goa-dropdown: missing the required `name` attribute. It must match the children's name attribute.");
4742
+ return;
4743
+ }
4744
+
4740
4745
  el.addEventListener("focus", onFocus, true);
4741
4746
  el.addEventListener("blur", onBlur, true); // parse and convert values to strings to avoid later type comparison issues
4742
4747
 
@@ -5124,6 +5129,11 @@ function instance$n($$self, $$props, $$invalidate) {
5124
5129
  let ctx; // Hooks
5125
5130
 
5126
5131
  onMount(async () => {
5132
+ if (!name) {
5133
+ console.error("goa-dropdown-item: missing the required `name` attribute. It must match the parent's name attribute");
5134
+ return;
5135
+ }
5136
+
5127
5137
  ctx = await getContext(name);
5128
5138
  ctx.notify({
5129
5139
  type: BIND$1,
@@ -7541,13 +7551,32 @@ function fly(node, {
7541
7551
  }
7542
7552
 
7543
7553
  function noScroll(_node, opts) {
7554
+ let toggledScrolling = false;
7555
+
7544
7556
  function hideScrollbars() {
7557
+ if (!isScrollable()) {
7558
+ return;
7559
+ }
7560
+
7545
7561
  const scrollbarWidth = calculateScrollbarWidth();
7546
- document.body.style.overflow = "hidden";
7547
- document.body.style.paddingRight = scrollbarWidth + "px";
7562
+
7563
+ if (scrollbarWidth > 0) {
7564
+ toggledScrolling = true;
7565
+ document.body.style.overflow = "hidden";
7566
+ document.body.style.paddingRight = scrollbarWidth + "px";
7567
+ }
7568
+ }
7569
+
7570
+ function isScrollable() {
7571
+ return document.body.style.overflow !== "hidden";
7548
7572
  }
7549
7573
 
7550
7574
  function resetScrollbars() {
7575
+ if (!toggledScrolling) {
7576
+ return;
7577
+ }
7578
+
7579
+ toggledScrolling = false;
7551
7580
  setTimeout(() => {
7552
7581
  document.body.style.overflow = "";
7553
7582
  document.body.style.paddingRight = "0";
@@ -7576,9 +7605,7 @@ function noScroll(_node, opts) {
7576
7605
 
7577
7606
  return {
7578
7607
  update() {
7579
- if (opts.enable) {
7580
- hideScrollbars();
7581
- } else {
7608
+ if (!opts.enable) {
7582
7609
  resetScrollbars();
7583
7610
  }
7584
7611
  },
@@ -7619,12 +7646,12 @@ function create_if_block$9(ctx) {
7619
7646
  ctx[0] && create_if_block_3$2(ctx);
7620
7647
  let if_block1 =
7621
7648
  /*isClosable*/
7622
- ctx[5] && create_if_block_2$4(ctx);
7649
+ ctx[3] && create_if_block_2$4(ctx);
7623
7650
 
7624
7651
  function select_block_type(ctx, dirty) {
7625
7652
  if (
7626
7653
  /*isScrollable*/
7627
- ctx[7]) return create_if_block_1$5;
7654
+ ctx[6]) return create_if_block_1$5;
7628
7655
  return create_else_block$1;
7629
7656
  }
7630
7657
 
@@ -7657,13 +7684,11 @@ function create_if_block$9(ctx) {
7657
7684
  attr(div3, "class", "modal-pane");
7658
7685
  attr(div4, "data-testid", "modal");
7659
7686
  attr(div4, "class", "modal");
7660
- attr(div4, "style", div4_style_value = "--scroll-offset: " +
7661
- /*scrollOffset*/
7662
- ctx[4] + "px; " + (
7687
+ attr(div4, "style", div4_style_value = "" + ((
7663
7688
  /*width*/
7664
7689
  ctx[2] && `--width: ${
7665
7690
  /*width*/
7666
- ctx[2]};`) + ";");
7691
+ ctx[2]};`) + ";"));
7667
7692
  set_custom_element_data(goa_focus_trap, "active",
7668
7693
  /*open*/
7669
7694
  ctx[1]);
@@ -7690,10 +7715,10 @@ function create_if_block$9(ctx) {
7690
7715
  if (!mounted) {
7691
7716
  dispose = [listen(div0, "click",
7692
7717
  /*close*/
7693
- ctx[8]), action_destroyer(noscroll_action = noScroll.call(null, div4, {
7718
+ ctx[7]), action_destroyer(noscroll_action = noScroll.call(null, div4, {
7694
7719
  enable:
7695
7720
  /*isOpen*/
7696
- ctx[3]
7721
+ ctx[5]
7697
7722
  }))];
7698
7723
  mounted = true;
7699
7724
  }
@@ -7719,7 +7744,7 @@ function create_if_block$9(ctx) {
7719
7744
 
7720
7745
  if (
7721
7746
  /*isClosable*/
7722
- ctx[5]) {
7747
+ ctx[3]) {
7723
7748
  if (if_block1) {
7724
7749
  if_block1.p(ctx, dirty);
7725
7750
  } else {
@@ -7743,23 +7768,21 @@ function create_if_block$9(ctx) {
7743
7768
  }
7744
7769
 
7745
7770
  if (!current || dirty &
7746
- /*scrollOffset, width*/
7747
- 20 && div4_style_value !== (div4_style_value = "--scroll-offset: " +
7748
- /*scrollOffset*/
7749
- ctx[4] + "px; " + (
7771
+ /*width*/
7772
+ 4 && div4_style_value !== (div4_style_value = "" + ((
7750
7773
  /*width*/
7751
7774
  ctx[2] && `--width: ${
7752
7775
  /*width*/
7753
- ctx[2]};`) + ";")) {
7776
+ ctx[2]};`) + ";"))) {
7754
7777
  attr(div4, "style", div4_style_value);
7755
7778
  }
7756
7779
 
7757
7780
  if (noscroll_action && is_function(noscroll_action.update) && dirty &
7758
7781
  /*isOpen*/
7759
- 8) noscroll_action.update.call(null, {
7782
+ 32) noscroll_action.update.call(null, {
7760
7783
  enable:
7761
7784
  /*isOpen*/
7762
- ctx[3]
7785
+ ctx[5]
7763
7786
  });
7764
7787
 
7765
7788
  if (!current || dirty &
@@ -7778,7 +7801,7 @@ function create_if_block$9(ctx) {
7778
7801
  div3_intro = create_in_transition(div3, fly, {
7779
7802
  duration:
7780
7803
  /*_transitionTime*/
7781
- ctx[6],
7804
+ ctx[4],
7782
7805
  y: 200
7783
7806
  });
7784
7807
  div3_intro.start();
@@ -7788,7 +7811,7 @@ function create_if_block$9(ctx) {
7788
7811
  div4_intro = create_in_transition(div4, fade, {
7789
7812
  duration:
7790
7813
  /*_transitionTime*/
7791
- ctx[6]
7814
+ ctx[4]
7792
7815
  });
7793
7816
  div4_intro.start();
7794
7817
  });
@@ -7800,20 +7823,20 @@ function create_if_block$9(ctx) {
7800
7823
  div3_outro = create_out_transition(div3, fly, {
7801
7824
  delay:
7802
7825
  /*_transitionTime*/
7803
- ctx[6],
7826
+ ctx[4],
7804
7827
  duration:
7805
7828
  /*_transitionTime*/
7806
- ctx[6],
7829
+ ctx[4],
7807
7830
  y: -100
7808
7831
  });
7809
7832
  if (div4_intro) div4_intro.invalidate();
7810
7833
  div4_outro = create_out_transition(div4, fade, {
7811
7834
  delay:
7812
7835
  /*_transitionTime*/
7813
- ctx[6],
7836
+ ctx[4],
7814
7837
  duration:
7815
7838
  /*_transitionTime*/
7816
- ctx[6]
7839
+ ctx[4]
7817
7840
  });
7818
7841
  current = false;
7819
7842
  },
@@ -7830,7 +7853,7 @@ function create_if_block$9(ctx) {
7830
7853
  }
7831
7854
 
7832
7855
  };
7833
- } // (60:8) {#if heading}
7856
+ } // (58:8) {#if heading}
7834
7857
 
7835
7858
 
7836
7859
  function create_if_block_3$2(ctx) {
@@ -7864,7 +7887,7 @@ function create_if_block_3$2(ctx) {
7864
7887
  }
7865
7888
 
7866
7889
  };
7867
- } // (63:8) {#if isClosable}
7890
+ } // (61:8) {#if isClosable}
7868
7891
 
7869
7892
 
7870
7893
  function create_if_block_2$4(ctx) {
@@ -7888,7 +7911,7 @@ function create_if_block_2$4(ctx) {
7888
7911
  if (!mounted) {
7889
7912
  dispose = listen(goa_icon_button, "click",
7890
7913
  /*close*/
7891
- ctx[8]);
7914
+ ctx[7]);
7892
7915
  mounted = true;
7893
7916
  }
7894
7917
  },
@@ -7902,7 +7925,7 @@ function create_if_block_2$4(ctx) {
7902
7925
  }
7903
7926
 
7904
7927
  };
7905
- } // (77:10) {:else}
7928
+ } // (75:10) {:else}
7906
7929
 
7907
7930
 
7908
7931
  function create_else_block$1(ctx) {
@@ -7923,7 +7946,7 @@ function create_else_block$1(ctx) {
7923
7946
  }
7924
7947
 
7925
7948
  };
7926
- } // (73:10) {#if isScrollable}
7949
+ } // (71:10) {#if isScrollable}
7927
7950
 
7928
7951
 
7929
7952
  function create_if_block_1$5(ctx) {
@@ -7953,7 +7976,7 @@ function create_fragment$i(ctx) {
7953
7976
  let current;
7954
7977
  let if_block =
7955
7978
  /*isOpen*/
7956
- ctx[3] && create_if_block$9(ctx);
7979
+ ctx[5] && create_if_block$9(ctx);
7957
7980
  return {
7958
7981
  c() {
7959
7982
  if (if_block) if_block.c();
@@ -7970,13 +7993,13 @@ function create_fragment$i(ctx) {
7970
7993
  p(ctx, [dirty]) {
7971
7994
  if (
7972
7995
  /*isOpen*/
7973
- ctx[3]) {
7996
+ ctx[5]) {
7974
7997
  if (if_block) {
7975
7998
  if_block.p(ctx, dirty);
7976
7999
 
7977
8000
  if (dirty &
7978
8001
  /*isOpen*/
7979
- 8) {
8002
+ 32) {
7980
8003
  transition_in(if_block, 1);
7981
8004
  }
7982
8005
  } else {
@@ -8038,7 +8061,9 @@ function instance$g($$self, $$props, $$invalidate) {
8038
8061
  let {
8039
8062
  width
8040
8063
  } = $$props;
8041
- let scrollOffset = 0;
8064
+ onMount(() => {
8065
+ console.log("in the modal v2");
8066
+ });
8042
8067
 
8043
8068
  function close(e) {
8044
8069
  if (!isClosable) {
@@ -8053,66 +8078,56 @@ function instance$g($$self, $$props, $$invalidate) {
8053
8078
 
8054
8079
  $$self.$$set = $$props => {
8055
8080
  if ('heading' in $$props) $$invalidate(0, heading = $$props.heading);
8056
- if ('closable' in $$props) $$invalidate(9, closable = $$props.closable);
8057
- if ('scrollable' in $$props) $$invalidate(10, scrollable = $$props.scrollable);
8081
+ if ('closable' in $$props) $$invalidate(8, closable = $$props.closable);
8082
+ if ('scrollable' in $$props) $$invalidate(9, scrollable = $$props.scrollable);
8058
8083
  if ('open' in $$props) $$invalidate(1, open = $$props.open);
8059
- if ('transition' in $$props) $$invalidate(11, transition = $$props.transition);
8084
+ if ('transition' in $$props) $$invalidate(10, transition = $$props.transition);
8060
8085
  if ('width' in $$props) $$invalidate(2, width = $$props.width);
8061
8086
  };
8062
8087
 
8063
8088
  $$self.$$.update = () => {
8064
8089
  if ($$self.$$.dirty &
8065
8090
  /*closable*/
8066
- 512) {
8067
- $$invalidate(5, isClosable = toBoolean(closable));
8091
+ 256) {
8092
+ $$invalidate(3, isClosable = toBoolean(closable));
8068
8093
  }
8069
8094
 
8070
8095
  if ($$self.$$.dirty &
8071
8096
  /*scrollable*/
8072
- 1024) {
8073
- $$invalidate(7, isScrollable = toBoolean(scrollable));
8097
+ 512) {
8098
+ $$invalidate(6, isScrollable = toBoolean(scrollable));
8074
8099
  }
8075
8100
 
8076
8101
  if ($$self.$$.dirty &
8077
8102
  /*open*/
8078
8103
  2) {
8079
- $$invalidate(3, isOpen = toBoolean(open));
8080
- }
8081
-
8082
- if ($$self.$$.dirty &
8083
- /*isOpen*/
8084
- 8) {
8085
- {
8086
- if (isOpen) {
8087
- $$invalidate(4, scrollOffset = window.pageYOffset);
8088
- }
8089
- }
8104
+ $$invalidate(5, isOpen = toBoolean(open));
8090
8105
  }
8091
8106
 
8092
8107
  if ($$self.$$.dirty &
8093
8108
  /*transition*/
8094
- 2048) {
8095
- $$invalidate(6, _transitionTime = transition === "none" ? 0 : transition === "slow" ? 400 : 200);
8109
+ 1024) {
8110
+ $$invalidate(4, _transitionTime = transition === "none" ? 0 : transition === "slow" ? 400 : 200);
8096
8111
  }
8097
8112
  };
8098
8113
 
8099
- return [heading, open, width, isOpen, scrollOffset, isClosable, _transitionTime, isScrollable, close, closable, scrollable, transition];
8114
+ return [heading, open, width, isClosable, _transitionTime, isOpen, isScrollable, close, closable, scrollable, transition];
8100
8115
  }
8101
8116
 
8102
8117
  class Modal extends SvelteElement {
8103
8118
  constructor(options) {
8104
8119
  super();
8105
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.modal{font-family:var(--font-family);position:absolute;top:var(--scroll-offset, 0);left:0;display:flex;align-items:center;justify-content:center;height:100vh;width:100%;z-index:100}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.2);z-index:1000}.modal-pane{position:relative;background-color:#fff;z-index:1001;width:90%;margin:1rem;box-shadow:var(--shadow-2);border-radius:4px;max-height:90%}@media(min-width: 640px){.modal-pane{width:var(--width, 60ch);max-height:80%}}.modal-actions{text-align:right;padding:0 1.75rem;margin:1.75rem 0;flex:1 1 auto}.modal-close{position:absolute;top:1rem;right:1rem}.modal-title{font-size:var(--fs-xl);padding-bottom:1rem;padding:0 1.75rem;margin:1.75rem 0;margin-right:40px;flex:0 0 auto}</style>`;
8120
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.modal{font-family:var(--font-family);position:fixed;inset:0;display:flex;align-items:center;justify-content:center;height:100vh;width:100%;z-index:100}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.2);z-index:1000}.modal-pane{position:relative;background-color:#fff;z-index:1001;width:90%;margin:1rem;box-shadow:var(--shadow-2);border-radius:4px;max-height:90%}@media(min-width: 640px){.modal-pane{width:var(--width, 60ch);max-height:80%}}.modal-actions{text-align:right;padding:0 1.75rem;margin:1.75rem 0;flex:1 1 auto}.modal-close{position:absolute;top:1rem;right:1rem}.modal-title{font-size:var(--fs-xl);padding-bottom:1rem;padding:0 1.75rem;margin:1.75rem 0;margin-right:40px;flex:0 0 auto}</style>`;
8106
8121
  init(this, {
8107
8122
  target: this.shadowRoot,
8108
8123
  props: attribute_to_object(this.attributes),
8109
8124
  customElement: true
8110
8125
  }, instance$g, create_fragment$i, safe_not_equal, {
8111
8126
  heading: 0,
8112
- closable: 9,
8113
- scrollable: 10,
8127
+ closable: 8,
8128
+ scrollable: 9,
8114
8129
  open: 1,
8115
- transition: 11,
8130
+ transition: 10,
8116
8131
  width: 2
8117
8132
  }, null);
8118
8133
 
@@ -8144,7 +8159,7 @@ class Modal extends SvelteElement {
8144
8159
  }
8145
8160
 
8146
8161
  get closable() {
8147
- return this.$$.ctx[9];
8162
+ return this.$$.ctx[8];
8148
8163
  }
8149
8164
 
8150
8165
  set closable(closable) {
@@ -8155,7 +8170,7 @@ class Modal extends SvelteElement {
8155
8170
  }
8156
8171
 
8157
8172
  get scrollable() {
8158
- return this.$$.ctx[10];
8173
+ return this.$$.ctx[9];
8159
8174
  }
8160
8175
 
8161
8176
  set scrollable(scrollable) {
@@ -8177,7 +8192,7 @@ class Modal extends SvelteElement {
8177
8192
  }
8178
8193
 
8179
8194
  get transition() {
8180
- return this.$$.ctx[11];
8195
+ return this.$$.ctx[10];
8181
8196
  }
8182
8197
 
8183
8198
  set transition(transition) {
@@ -9064,7 +9079,7 @@ function get_each_context$3(ctx, list, i) {
9064
9079
  const child_ctx = ctx.slice();
9065
9080
  child_ctx[14] = list[i];
9066
9081
  return child_ctx;
9067
- } // (51:2) {#each options as option (option.value) }
9082
+ } // (55:2) {#each options as option (option.value) }
9068
9083
 
9069
9084
 
9070
9085
  function create_each_block$3(key_1, ctx) {
@@ -9359,6 +9374,11 @@ function instance$d($$self, $$props, $$invalidate) {
9359
9374
  let ctx;
9360
9375
  let el;
9361
9376
  onMount(() => {
9377
+ if (!name) {
9378
+ console.error("goa-radio: missing the required `name` attribute. It must match the children's name attribute.");
9379
+ return;
9380
+ }
9381
+
9362
9382
  ctx = createContext(name);
9363
9383
  ctx.subscribe(msg => {
9364
9384
  switch (msg === null || msg === void 0 ? void 0 : msg.type) {
@@ -9551,6 +9571,11 @@ function instance$c($$self, $$props, $$invalidate) {
9551
9571
  } = $$props;
9552
9572
  let ctx;
9553
9573
  onMount(async () => {
9574
+ if (!name) {
9575
+ console.error("goa-radio-item: missing the required `name` attribute. It must match the parent's name attribute.");
9576
+ return;
9577
+ }
9578
+
9554
9579
  ctx = await getContext(name);
9555
9580
  ctx.notify({
9556
9581
  type: BIND,
@@ -13960,12 +13985,14 @@ const GoAContainer = ({
13960
13985
  headingSize,
13961
13986
  title,
13962
13987
  colored: _colored = false,
13988
+ padding,
13963
13989
  children,
13964
13990
  actions,
13965
13991
  variant: _variant = 'default'
13966
13992
  }) => {
13967
13993
  return jsxs("goa-container", Object.assign({
13968
13994
  variant: _variant,
13995
+ padding: padding,
13969
13996
  headingsize: headingSize,
13970
13997
  colored: _colored
13971
13998
  }, {
@@ -4294,7 +4294,7 @@
4294
4294
  child_ctx[35] = list[i];
4295
4295
  child_ctx[37] = i;
4296
4296
  return child_ctx;
4297
- } // (175:2) {#if isMenuVisible}
4297
+ } // (179:2) {#if isMenuVisible}
4298
4298
 
4299
4299
 
4300
4300
  function create_if_block$d(ctx) {
@@ -4339,7 +4339,7 @@
4339
4339
  }
4340
4340
 
4341
4341
  };
4342
- } // (211:4) {#each options as option, index (option.value)}
4342
+ } // (215:4) {#each options as option, index (option.value)}
4343
4343
 
4344
4344
 
4345
4345
  function create_each_block$4(key_1, ctx) {
@@ -4792,6 +4792,11 @@
4792
4792
  let ctx; // Hooks
4793
4793
 
4794
4794
  onMount(_async(function () {
4795
+ if (!name) {
4796
+ console.error("goa-dropdown: missing the required `name` attribute. It must match the children's name attribute.");
4797
+ return;
4798
+ }
4799
+
4795
4800
  el.addEventListener("focus", onFocus, true);
4796
4801
  el.addEventListener("blur", onBlur, true); // parse and convert values to strings to avoid later type comparison issues
4797
4802
 
@@ -5164,7 +5169,12 @@
5164
5169
 
5165
5170
  let ctx; // Hooks
5166
5171
 
5167
- onMount(function () {
5172
+ onMount(_async(function () {
5173
+ if (!name) {
5174
+ console.error("goa-dropdown-item: missing the required `name` attribute. It must match the parent's name attribute");
5175
+ return;
5176
+ }
5177
+
5168
5178
  return _await(getContext(name), function (_getContext2) {
5169
5179
  ctx = _getContext2;
5170
5180
  ctx.notify({
@@ -5174,7 +5184,7 @@
5174
5184
  value
5175
5185
  });
5176
5186
  });
5177
- });
5187
+ }));
5178
5188
 
5179
5189
  $$self.$$set = $$props => {
5180
5190
  if ('name' in $$props) $$invalidate(0, name = $$props.name);
@@ -7584,13 +7594,32 @@
7584
7594
  }
7585
7595
 
7586
7596
  function noScroll(_node, opts) {
7597
+ let toggledScrolling = false;
7598
+
7587
7599
  function hideScrollbars() {
7600
+ if (!isScrollable()) {
7601
+ return;
7602
+ }
7603
+
7588
7604
  const scrollbarWidth = calculateScrollbarWidth();
7589
- document.body.style.overflow = "hidden";
7590
- document.body.style.paddingRight = scrollbarWidth + "px";
7605
+
7606
+ if (scrollbarWidth > 0) {
7607
+ toggledScrolling = true;
7608
+ document.body.style.overflow = "hidden";
7609
+ document.body.style.paddingRight = scrollbarWidth + "px";
7610
+ }
7611
+ }
7612
+
7613
+ function isScrollable() {
7614
+ return document.body.style.overflow !== "hidden";
7591
7615
  }
7592
7616
 
7593
7617
  function resetScrollbars() {
7618
+ if (!toggledScrolling) {
7619
+ return;
7620
+ }
7621
+
7622
+ toggledScrolling = false;
7594
7623
  setTimeout(() => {
7595
7624
  document.body.style.overflow = "";
7596
7625
  document.body.style.paddingRight = "0";
@@ -7619,9 +7648,7 @@
7619
7648
 
7620
7649
  return {
7621
7650
  update() {
7622
- if (opts.enable) {
7623
- hideScrollbars();
7624
- } else {
7651
+ if (!opts.enable) {
7625
7652
  resetScrollbars();
7626
7653
  }
7627
7654
  },
@@ -7662,12 +7689,12 @@
7662
7689
  ctx[0] && create_if_block_3$2(ctx);
7663
7690
  let if_block1 =
7664
7691
  /*isClosable*/
7665
- ctx[5] && create_if_block_2$4(ctx);
7692
+ ctx[3] && create_if_block_2$4(ctx);
7666
7693
 
7667
7694
  function select_block_type(ctx, dirty) {
7668
7695
  if (
7669
7696
  /*isScrollable*/
7670
- ctx[7]) return create_if_block_1$5;
7697
+ ctx[6]) return create_if_block_1$5;
7671
7698
  return create_else_block$1;
7672
7699
  }
7673
7700
 
@@ -7700,13 +7727,11 @@
7700
7727
  attr(div3, "class", "modal-pane");
7701
7728
  attr(div4, "data-testid", "modal");
7702
7729
  attr(div4, "class", "modal");
7703
- attr(div4, "style", div4_style_value = "--scroll-offset: " +
7704
- /*scrollOffset*/
7705
- ctx[4] + "px; " + (
7730
+ attr(div4, "style", div4_style_value = "" + ((
7706
7731
  /*width*/
7707
7732
  ctx[2] && `--width: ${
7708
7733
  /*width*/
7709
- ctx[2]};`) + ";");
7734
+ ctx[2]};`) + ";"));
7710
7735
  set_custom_element_data(goa_focus_trap, "active",
7711
7736
  /*open*/
7712
7737
  ctx[1]);
@@ -7733,10 +7758,10 @@
7733
7758
  if (!mounted) {
7734
7759
  dispose = [listen(div0, "click",
7735
7760
  /*close*/
7736
- ctx[8]), action_destroyer(noscroll_action = noScroll.call(null, div4, {
7761
+ ctx[7]), action_destroyer(noscroll_action = noScroll.call(null, div4, {
7737
7762
  enable:
7738
7763
  /*isOpen*/
7739
- ctx[3]
7764
+ ctx[5]
7740
7765
  }))];
7741
7766
  mounted = true;
7742
7767
  }
@@ -7762,7 +7787,7 @@
7762
7787
 
7763
7788
  if (
7764
7789
  /*isClosable*/
7765
- ctx[5]) {
7790
+ ctx[3]) {
7766
7791
  if (if_block1) {
7767
7792
  if_block1.p(ctx, dirty);
7768
7793
  } else {
@@ -7786,23 +7811,21 @@
7786
7811
  }
7787
7812
 
7788
7813
  if (!current || dirty &
7789
- /*scrollOffset, width*/
7790
- 20 && div4_style_value !== (div4_style_value = "--scroll-offset: " +
7791
- /*scrollOffset*/
7792
- ctx[4] + "px; " + (
7814
+ /*width*/
7815
+ 4 && div4_style_value !== (div4_style_value = "" + ((
7793
7816
  /*width*/
7794
7817
  ctx[2] && `--width: ${
7795
7818
  /*width*/
7796
- ctx[2]};`) + ";")) {
7819
+ ctx[2]};`) + ";"))) {
7797
7820
  attr(div4, "style", div4_style_value);
7798
7821
  }
7799
7822
 
7800
7823
  if (noscroll_action && is_function(noscroll_action.update) && dirty &
7801
7824
  /*isOpen*/
7802
- 8) noscroll_action.update.call(null, {
7825
+ 32) noscroll_action.update.call(null, {
7803
7826
  enable:
7804
7827
  /*isOpen*/
7805
- ctx[3]
7828
+ ctx[5]
7806
7829
  });
7807
7830
 
7808
7831
  if (!current || dirty &
@@ -7821,7 +7844,7 @@
7821
7844
  div3_intro = create_in_transition(div3, fly, {
7822
7845
  duration:
7823
7846
  /*_transitionTime*/
7824
- ctx[6],
7847
+ ctx[4],
7825
7848
  y: 200
7826
7849
  });
7827
7850
  div3_intro.start();
@@ -7831,7 +7854,7 @@
7831
7854
  div4_intro = create_in_transition(div4, fade, {
7832
7855
  duration:
7833
7856
  /*_transitionTime*/
7834
- ctx[6]
7857
+ ctx[4]
7835
7858
  });
7836
7859
  div4_intro.start();
7837
7860
  });
@@ -7843,20 +7866,20 @@
7843
7866
  div3_outro = create_out_transition(div3, fly, {
7844
7867
  delay:
7845
7868
  /*_transitionTime*/
7846
- ctx[6],
7869
+ ctx[4],
7847
7870
  duration:
7848
7871
  /*_transitionTime*/
7849
- ctx[6],
7872
+ ctx[4],
7850
7873
  y: -100
7851
7874
  });
7852
7875
  if (div4_intro) div4_intro.invalidate();
7853
7876
  div4_outro = create_out_transition(div4, fade, {
7854
7877
  delay:
7855
7878
  /*_transitionTime*/
7856
- ctx[6],
7879
+ ctx[4],
7857
7880
  duration:
7858
7881
  /*_transitionTime*/
7859
- ctx[6]
7882
+ ctx[4]
7860
7883
  });
7861
7884
  current = false;
7862
7885
  },
@@ -7873,7 +7896,7 @@
7873
7896
  }
7874
7897
 
7875
7898
  };
7876
- } // (60:8) {#if heading}
7899
+ } // (58:8) {#if heading}
7877
7900
 
7878
7901
 
7879
7902
  function create_if_block_3$2(ctx) {
@@ -7907,7 +7930,7 @@
7907
7930
  }
7908
7931
 
7909
7932
  };
7910
- } // (63:8) {#if isClosable}
7933
+ } // (61:8) {#if isClosable}
7911
7934
 
7912
7935
 
7913
7936
  function create_if_block_2$4(ctx) {
@@ -7931,7 +7954,7 @@
7931
7954
  if (!mounted) {
7932
7955
  dispose = listen(goa_icon_button, "click",
7933
7956
  /*close*/
7934
- ctx[8]);
7957
+ ctx[7]);
7935
7958
  mounted = true;
7936
7959
  }
7937
7960
  },
@@ -7945,7 +7968,7 @@
7945
7968
  }
7946
7969
 
7947
7970
  };
7948
- } // (77:10) {:else}
7971
+ } // (75:10) {:else}
7949
7972
 
7950
7973
 
7951
7974
  function create_else_block$1(ctx) {
@@ -7966,7 +7989,7 @@
7966
7989
  }
7967
7990
 
7968
7991
  };
7969
- } // (73:10) {#if isScrollable}
7992
+ } // (71:10) {#if isScrollable}
7970
7993
 
7971
7994
 
7972
7995
  function create_if_block_1$5(ctx) {
@@ -7996,7 +8019,7 @@
7996
8019
  let current;
7997
8020
  let if_block =
7998
8021
  /*isOpen*/
7999
- ctx[3] && create_if_block$9(ctx);
8022
+ ctx[5] && create_if_block$9(ctx);
8000
8023
  return {
8001
8024
  c() {
8002
8025
  if (if_block) if_block.c();
@@ -8013,13 +8036,13 @@
8013
8036
  p(ctx, [dirty]) {
8014
8037
  if (
8015
8038
  /*isOpen*/
8016
- ctx[3]) {
8039
+ ctx[5]) {
8017
8040
  if (if_block) {
8018
8041
  if_block.p(ctx, dirty);
8019
8042
 
8020
8043
  if (dirty &
8021
8044
  /*isOpen*/
8022
- 8) {
8045
+ 32) {
8023
8046
  transition_in(if_block, 1);
8024
8047
  }
8025
8048
  } else {
@@ -8081,7 +8104,9 @@
8081
8104
  let {
8082
8105
  width
8083
8106
  } = $$props;
8084
- let scrollOffset = 0;
8107
+ onMount(() => {
8108
+ console.log("in the modal v2");
8109
+ });
8085
8110
 
8086
8111
  function close(e) {
8087
8112
  if (!isClosable) {
@@ -8096,66 +8121,56 @@
8096
8121
 
8097
8122
  $$self.$$set = $$props => {
8098
8123
  if ('heading' in $$props) $$invalidate(0, heading = $$props.heading);
8099
- if ('closable' in $$props) $$invalidate(9, closable = $$props.closable);
8100
- if ('scrollable' in $$props) $$invalidate(10, scrollable = $$props.scrollable);
8124
+ if ('closable' in $$props) $$invalidate(8, closable = $$props.closable);
8125
+ if ('scrollable' in $$props) $$invalidate(9, scrollable = $$props.scrollable);
8101
8126
  if ('open' in $$props) $$invalidate(1, open = $$props.open);
8102
- if ('transition' in $$props) $$invalidate(11, transition = $$props.transition);
8127
+ if ('transition' in $$props) $$invalidate(10, transition = $$props.transition);
8103
8128
  if ('width' in $$props) $$invalidate(2, width = $$props.width);
8104
8129
  };
8105
8130
 
8106
8131
  $$self.$$.update = () => {
8107
8132
  if ($$self.$$.dirty &
8108
8133
  /*closable*/
8109
- 512) {
8110
- $$invalidate(5, isClosable = toBoolean(closable));
8134
+ 256) {
8135
+ $$invalidate(3, isClosable = toBoolean(closable));
8111
8136
  }
8112
8137
 
8113
8138
  if ($$self.$$.dirty &
8114
8139
  /*scrollable*/
8115
- 1024) {
8116
- $$invalidate(7, isScrollable = toBoolean(scrollable));
8140
+ 512) {
8141
+ $$invalidate(6, isScrollable = toBoolean(scrollable));
8117
8142
  }
8118
8143
 
8119
8144
  if ($$self.$$.dirty &
8120
8145
  /*open*/
8121
8146
  2) {
8122
- $$invalidate(3, isOpen = toBoolean(open));
8123
- }
8124
-
8125
- if ($$self.$$.dirty &
8126
- /*isOpen*/
8127
- 8) {
8128
- {
8129
- if (isOpen) {
8130
- $$invalidate(4, scrollOffset = window.pageYOffset);
8131
- }
8132
- }
8147
+ $$invalidate(5, isOpen = toBoolean(open));
8133
8148
  }
8134
8149
 
8135
8150
  if ($$self.$$.dirty &
8136
8151
  /*transition*/
8137
- 2048) {
8138
- $$invalidate(6, _transitionTime = transition === "none" ? 0 : transition === "slow" ? 400 : 200);
8152
+ 1024) {
8153
+ $$invalidate(4, _transitionTime = transition === "none" ? 0 : transition === "slow" ? 400 : 200);
8139
8154
  }
8140
8155
  };
8141
8156
 
8142
- return [heading, open, width, isOpen, scrollOffset, isClosable, _transitionTime, isScrollable, close, closable, scrollable, transition];
8157
+ return [heading, open, width, isClosable, _transitionTime, isOpen, isScrollable, close, closable, scrollable, transition];
8143
8158
  }
8144
8159
 
8145
8160
  class Modal extends SvelteElement {
8146
8161
  constructor(options) {
8147
8162
  super();
8148
- this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.modal{font-family:var(--font-family);position:absolute;top:var(--scroll-offset, 0);left:0;display:flex;align-items:center;justify-content:center;height:100vh;width:100%;z-index:100}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.2);z-index:1000}.modal-pane{position:relative;background-color:#fff;z-index:1001;width:90%;margin:1rem;box-shadow:var(--shadow-2);border-radius:4px;max-height:90%}@media(min-width: 640px){.modal-pane{width:var(--width, 60ch);max-height:80%}}.modal-actions{text-align:right;padding:0 1.75rem;margin:1.75rem 0;flex:1 1 auto}.modal-close{position:absolute;top:1rem;right:1rem}.modal-title{font-size:var(--fs-xl);padding-bottom:1rem;padding:0 1.75rem;margin:1.75rem 0;margin-right:40px;flex:0 0 auto}</style>`;
8163
+ this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}.modal{font-family:var(--font-family);position:fixed;inset:0;display:flex;align-items:center;justify-content:center;height:100vh;width:100%;z-index:100}.modal-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.2);z-index:1000}.modal-pane{position:relative;background-color:#fff;z-index:1001;width:90%;margin:1rem;box-shadow:var(--shadow-2);border-radius:4px;max-height:90%}@media(min-width: 640px){.modal-pane{width:var(--width, 60ch);max-height:80%}}.modal-actions{text-align:right;padding:0 1.75rem;margin:1.75rem 0;flex:1 1 auto}.modal-close{position:absolute;top:1rem;right:1rem}.modal-title{font-size:var(--fs-xl);padding-bottom:1rem;padding:0 1.75rem;margin:1.75rem 0;margin-right:40px;flex:0 0 auto}</style>`;
8149
8164
  init(this, {
8150
8165
  target: this.shadowRoot,
8151
8166
  props: attribute_to_object(this.attributes),
8152
8167
  customElement: true
8153
8168
  }, instance$g, create_fragment$i, safe_not_equal, {
8154
8169
  heading: 0,
8155
- closable: 9,
8156
- scrollable: 10,
8170
+ closable: 8,
8171
+ scrollable: 9,
8157
8172
  open: 1,
8158
- transition: 11,
8173
+ transition: 10,
8159
8174
  width: 2
8160
8175
  }, null);
8161
8176
 
@@ -8187,7 +8202,7 @@
8187
8202
  }
8188
8203
 
8189
8204
  get closable() {
8190
- return this.$$.ctx[9];
8205
+ return this.$$.ctx[8];
8191
8206
  }
8192
8207
 
8193
8208
  set closable(closable) {
@@ -8198,7 +8213,7 @@
8198
8213
  }
8199
8214
 
8200
8215
  get scrollable() {
8201
- return this.$$.ctx[10];
8216
+ return this.$$.ctx[9];
8202
8217
  }
8203
8218
 
8204
8219
  set scrollable(scrollable) {
@@ -8220,7 +8235,7 @@
8220
8235
  }
8221
8236
 
8222
8237
  get transition() {
8223
- return this.$$.ctx[11];
8238
+ return this.$$.ctx[10];
8224
8239
  }
8225
8240
 
8226
8241
  set transition(transition) {
@@ -9108,7 +9123,7 @@
9108
9123
  const child_ctx = ctx.slice();
9109
9124
  child_ctx[14] = list[i];
9110
9125
  return child_ctx;
9111
- } // (51:2) {#each options as option (option.value) }
9126
+ } // (55:2) {#each options as option (option.value) }
9112
9127
 
9113
9128
 
9114
9129
  function create_each_block$3(key_1, ctx) {
@@ -9403,6 +9418,11 @@
9403
9418
  let ctx;
9404
9419
  let el;
9405
9420
  onMount(() => {
9421
+ if (!name) {
9422
+ console.error("goa-radio: missing the required `name` attribute. It must match the children's name attribute.");
9423
+ return;
9424
+ }
9425
+
9406
9426
  ctx = createContext(name);
9407
9427
  ctx.subscribe(msg => {
9408
9428
  switch (msg === null || msg === void 0 ? void 0 : msg.type) {
@@ -9594,7 +9614,12 @@
9594
9614
  name
9595
9615
  } = $$props;
9596
9616
  let ctx;
9597
- onMount(function () {
9617
+ onMount(_async(function () {
9618
+ if (!name) {
9619
+ console.error("goa-radio-item: missing the required `name` attribute. It must match the parent's name attribute.");
9620
+ return;
9621
+ }
9622
+
9598
9623
  return _await(getContext(name), function (_getContext3) {
9599
9624
  ctx = _getContext3;
9600
9625
  ctx.notify({
@@ -9603,7 +9628,7 @@
9603
9628
  label
9604
9629
  });
9605
9630
  });
9606
- });
9631
+ }));
9607
9632
 
9608
9633
  $$self.$$set = $$props => {
9609
9634
  if ('value' in $$props) $$invalidate(0, value = $$props.value);
@@ -14018,12 +14043,14 @@
14018
14043
  title = _a.title,
14019
14044
  _b = _a.colored,
14020
14045
  colored = _b === void 0 ? false : _b,
14046
+ padding = _a.padding,
14021
14047
  children = _a.children,
14022
14048
  actions = _a.actions,
14023
14049
  _c = _a.variant,
14024
14050
  variant = _c === void 0 ? 'default' : _c;
14025
14051
  return jsxRuntime.jsxs("goa-container", __assign({
14026
14052
  variant: variant,
14053
+ padding: padding,
14027
14054
  headingsize: headingSize,
14028
14055
  colored: colored
14029
14056
  }, {