@abgov/web-components 1.0.0-alpha.92 → 1.0.0-alpha.95

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/web-components",
3
- "version": "1.0.0-alpha.92",
3
+ "version": "1.0.0-alpha.95",
4
4
  "description": "Government of Alberta - UI Web components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -1732,9 +1732,9 @@ function clickHandler(e) {
1732
1732
  function instance$w($$self, $$props, $$invalidate) {
1733
1733
  let isDisabled;
1734
1734
  let isButtonDark;
1735
- const BUTTON_TYPES = ["primary", "secondary", "tertiary", "start"];
1736
- const SIZES = ["", "compact"];
1737
- const VARIANTS = ["", "destructive"];
1735
+ const BUTTON_TYPES = ["primary", "submit", "secondary", "tertiary", "start"];
1736
+ const SIZES = ["normal", "compact"];
1737
+ const VARIANTS = ["normal", "destructive"];
1738
1738
 
1739
1739
  // type check functions
1740
1740
  function isButtonType(value) {
@@ -1750,8 +1750,8 @@ function instance$w($$self, $$props, $$invalidate) {
1750
1750
  }
1751
1751
 
1752
1752
  let { type = "primary" } = $$props;
1753
- let { size = "" } = $$props;
1754
- let { variant = "" } = $$props;
1753
+ let { size = "normal" } = $$props;
1754
+ let { variant = "normal" } = $$props;
1755
1755
  let { title = "" } = $$props;
1756
1756
  let { disabled = "false" } = $$props;
1757
1757
  let { leadingicon = null } = $$props;
@@ -1812,7 +1812,7 @@ class Button extends SvelteElement {
1812
1812
  super();
1813
1813
 
1814
1814
  this.shadowRoot.innerHTML = `<style>:host{box-sizing:border-box;font-family:var(--font-family)}@media(max-width: 480px){:host{width:100%}button{width:100%}}button{display:inline-flex;box-sizing:border-box;border-radius:0.25rem;border:2px solid var(--goa-color-interactive);box-sizing:border-box;cursor:pointer;font-family:var(--font-family);font-size:var(--fs-lg);font-weight:400;height:var(--button-height);letter-spacing:0.5px;line-height:100%;padding:0 0.75rem;gap:0.5rem;align-items:center;justify-content:center;transition:transform 0.1s ease-in-out, background-color 0.2s ease-in-out,
1815
- border-color 0.2s ease-in-out}.text{padding-bottom:var(--font-valign-fix)}button:disabled{pointer-events:none;opacity:0.5}button.compact{height:var(--button-height-compact);font-size:var(--fs-base)}button.start{height:var(--button-height-tall);font-weight:var(--fw-bold)}button.start,button.primary{border:2px solid var(--goa-color-interactive);background:var(--goa-color-interactive);color:var(--goa-color-text-light)}button.start:hover,button.primary:hover{border-color:var(--goa-color-interactive--hover);background:var(--goa-color-interactive--hover)}button.start:focus,button.start:active,button.primary:focus,button.primary:active{box-shadow:0 0 0 3px var(--goa-color-interactive--focus);border-color:var(--goa-color-interactive--active);background:var(--goa-color-interactive--active);outline:none}button.secondary{border:2px solid var(--goa-color-interactive);background:var(--color-white);color:var(--goa-color-interactive)}button.secondary:hover{border-color:var(--goa-color-interactive--hover);color:var(--goa-color-interactive--hover);background:var(--color-gray-100)}button.secondary:focus,button.secondary:active{border-color:var(--goa-color-interactive--active);box-shadow:0 0 0 3px var(--goa-color-interactive--focus);background:var(--color-gray-100);outline:none}button.tertiary{border:1px solid transparent;background:transparent;color:var(--goa-color-interactive);text-decoration:underline}button.tertiary:hover{border-color:var(--color-gray-100);color:var(--goa-color-interactive--hover);background:var(--color-gray-100)}button.tertiary:focus,button.tertiary:active{border-color:var(--color-gray-100);background:var(--color-gray-100);color:var(--goa-color-interactive--active);box-shadow:0 0 0 3px var(--goa-color-interactive--focus);outline:none}.primary.destructive{color:var(--color-white);background:var(--goa-color-status-emergency);border-color:var(--goa-color-status-emergency)}.primary.destructive:hover{background:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark)}.primary.destructive:focus,.primary.destructive:active{background:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark)}.secondary.destructive{color:var(--goa-color-status-emergency);border-color:var(--goa-color-status-emergency);background:var(--color-white)}.secondary.destructive:hover{border-color:var(--goa-color-status-emergency-dark);color:var(--goa-color-status-emergency-dark);background:var(--color-white)}.secondary.destructive:focus,.secondary.destructive:active{color:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark);background:var(--color-white)}.tertiary.destructive{color:var(--goa-color-status-emergency);border-color:var(--color-gray-200);background:var(--color-white)}.tertiary.destructive:hover{border-color:var(--goa-color-status-emergency-dark);color:var(--goa-color-status-emergency-dark);background:var(--color-white)}.tertiary.destructive:focus,.tertiary.destructive:active{color:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark);background:var(--color-white)}</style>`;
1815
+ border-color 0.2s ease-in-out}.text{padding-bottom:var(--font-valign-fix)}button:disabled{pointer-events:none;opacity:0.5}button.compact{height:var(--button-height-compact);font-size:var(--fs-base)}button.start{height:var(--button-height-tall);font-weight:var(--fw-bold)}button.start,button.submit,button.primary{border:2px solid var(--goa-color-interactive);background:var(--goa-color-interactive);color:var(--goa-color-text-light)}button.start:hover,button.submit:hover,button.primary:hover{border-color:var(--goa-color-interactive--hover);background:var(--goa-color-interactive--hover)}button.start:focus,button.start:active,button.submit:focus,button.submit:active,button.primary:focus,button.primary:active{box-shadow:0 0 0 3px var(--goa-color-interactive--focus);border-color:var(--goa-color-interactive--active);background:var(--goa-color-interactive--active);outline:none}button.secondary{border:2px solid var(--goa-color-interactive);background:var(--color-white);color:var(--goa-color-interactive)}button.secondary:hover{border-color:var(--goa-color-interactive--hover);color:var(--goa-color-interactive--hover);background:var(--color-gray-100)}button.secondary:focus,button.secondary:active{border-color:var(--goa-color-interactive--active);box-shadow:0 0 0 3px var(--goa-color-interactive--focus);background:var(--color-gray-100);outline:none}button.tertiary{border:1px solid transparent;background:transparent;color:var(--goa-color-interactive);text-decoration:underline}button.tertiary:hover{border-color:var(--color-gray-100);color:var(--goa-color-interactive--hover);background:var(--color-gray-100)}button.tertiary:focus,button.tertiary:active{border-color:var(--color-gray-100);background:var(--color-gray-100);color:var(--goa-color-interactive--active);box-shadow:0 0 0 3px var(--goa-color-interactive--focus);outline:none}.submit.destructive,.primary.destructive{color:var(--color-white);background:var(--goa-color-status-emergency);border-color:var(--goa-color-status-emergency)}.submit.destructive:hover,.primary.destructive:hover{background:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark)}.submit.destructive:focus,.primary.destructive:focus,.primary.destructive:active{background:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark)}.secondary.destructive{color:var(--goa-color-status-emergency);border-color:var(--goa-color-status-emergency);background:var(--color-white)}.secondary.destructive:hover{border-color:var(--goa-color-status-emergency-dark);color:var(--goa-color-status-emergency-dark);background:var(--color-white)}.secondary.destructive:focus,.secondary.destructive:active{color:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark);background:var(--color-white)}.tertiary.destructive{color:var(--goa-color-status-emergency);border-color:var(--color-gray-200);background:var(--color-white)}.tertiary.destructive:hover{border-color:var(--goa-color-status-emergency-dark);color:var(--goa-color-status-emergency-dark);background:var(--color-white)}.tertiary.destructive:focus,.tertiary.destructive:active{color:var(--goa-color-status-emergency-dark);border-color:var(--goa-color-status-emergency-dark);background:var(--color-white)}</style>`;
1816
1816
 
1817
1817
  init(
1818
1818
  this,
@@ -3527,7 +3527,7 @@ function writable(value, start = noop) {
3527
3527
  }
3528
3528
 
3529
3529
  const stores = {};
3530
- class ContextStore {
3530
+ class ContextStoreInternal {
3531
3531
  constructor() {
3532
3532
  this.store = writable();
3533
3533
  }
@@ -3541,22 +3541,12 @@ class ContextStore {
3541
3541
  }
3542
3542
  }
3543
3543
  function createContext(name) {
3544
- const ctx = new ContextStore();
3544
+ const ctx = new ContextStoreInternal();
3545
3545
  stores[name] = ctx;
3546
3546
  return ctx;
3547
3547
  }
3548
- async function getContext(name) {
3549
- return await _getContext(name, 0);
3550
- }
3551
- async function _getContext(name, attempts) {
3552
- if (attempts > 10) {
3553
- throw new Error(`Could not find context ${name}`);
3554
- }
3555
- if (stores[name]) {
3556
- return stores[name];
3557
- }
3558
- await tick();
3559
- return _getContext(name, attempts + 1);
3548
+ function getContext(name) {
3549
+ return stores[name];
3560
3550
  }
3561
3551
  function deleteContext(name) {
3562
3552
  const store = stores[name];
@@ -3571,12 +3561,12 @@ const BIND$1 = "bind";
3571
3561
 
3572
3562
  function get_each_context$4(ctx, list, i) {
3573
3563
  const child_ctx = ctx.slice();
3574
- child_ctx[36] = list[i];
3575
- child_ctx[38] = i;
3564
+ child_ctx[39] = list[i];
3565
+ child_ctx[41] = i;
3576
3566
  return child_ctx;
3577
3567
  }
3578
3568
 
3579
- // (180:2) {#if isMenuVisible}
3569
+ // (198:2) {#if isMenuVisible}
3580
3570
  function create_if_block$d(ctx) {
3581
3571
  let div;
3582
3572
  let div_data_testid_value;
@@ -3610,10 +3600,10 @@ function create_if_block$d(ctx) {
3610
3600
  };
3611
3601
  }
3612
3602
 
3613
- // (216:4) {#each options as option, index (option.value)}
3614
- function create_each_block$4(key_1, ctx) {
3603
+ // (234:4) {#each options as option, index}
3604
+ function create_each_block$4(ctx) {
3615
3605
  let li;
3616
- let t0_value = /*option*/ ctx[36].label + "";
3606
+ let t0_value = (/*option*/ ctx[39].label || /*option*/ ctx[39].value) + "";
3617
3607
  let t0;
3618
3608
  let t1;
3619
3609
  let li_aria_label_value;
@@ -3624,25 +3614,22 @@ function create_each_block$4(key_1, ctx) {
3624
3614
  let dispose;
3625
3615
 
3626
3616
  function click_handler() {
3627
- return /*click_handler*/ ctx[22](/*option*/ ctx[36]);
3617
+ return /*click_handler*/ ctx[22](/*option*/ ctx[39]);
3628
3618
  }
3629
3619
 
3630
3620
  return {
3631
- key: key_1,
3632
- first: null,
3633
3621
  c() {
3634
3622
  li = element("li");
3635
3623
  t0 = text(t0_value);
3636
3624
  t1 = space();
3637
- attr(li, "aria-label", li_aria_label_value = /*option*/ ctx[36].label || /*option*/ ctx[36].value);
3638
- attr(li, "data-testid", li_data_testid_value = `${/*option*/ ctx[36].value}-dropdown-item`);
3639
- attr(li, "data-index", li_data_index_value = /*index*/ ctx[38]);
3625
+ attr(li, "aria-label", li_aria_label_value = /*option*/ ctx[39].label || /*option*/ ctx[39].value);
3626
+ attr(li, "data-testid", li_data_testid_value = `${/*option*/ ctx[39].value}-dropdown-item`);
3627
+ attr(li, "data-index", li_data_index_value = /*index*/ ctx[41]);
3640
3628
  attr(li, "class", "goa-dropdown-option");
3641
3629
  attr(li, "style", li_style_value = `display: ${"block"}`);
3642
3630
  toggle_class(li, "goa-dropdown-option--disabled", false);
3643
- toggle_class(li, "goa-dropdown-option--tabbed", /*index*/ ctx[38] === /*highlightedIndex*/ ctx[13]);
3644
- toggle_class(li, "goa-dropdown-option--selected", /*_values*/ ctx[9].includes(/*option*/ ctx[36].value));
3645
- this.first = li;
3631
+ toggle_class(li, "goa-dropdown-option--tabbed", /*index*/ ctx[41] === /*highlightedIndex*/ ctx[13]);
3632
+ toggle_class(li, "goa-dropdown-option--selected", /*_values*/ ctx[9].includes(/*option*/ ctx[39].value));
3646
3633
  },
3647
3634
  m(target, anchor) {
3648
3635
  insert(target, li, anchor);
@@ -3656,26 +3643,22 @@ function create_each_block$4(key_1, ctx) {
3656
3643
  },
3657
3644
  p(new_ctx, dirty) {
3658
3645
  ctx = new_ctx;
3659
- if (dirty[0] & /*options*/ 1024 && t0_value !== (t0_value = /*option*/ ctx[36].label + "")) set_data(t0, t0_value);
3646
+ if (dirty[0] & /*options*/ 1024 && t0_value !== (t0_value = (/*option*/ ctx[39].label || /*option*/ ctx[39].value) + "")) set_data(t0, t0_value);
3660
3647
 
3661
- if (dirty[0] & /*options*/ 1024 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[36].label || /*option*/ ctx[36].value)) {
3648
+ if (dirty[0] & /*options*/ 1024 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[39].label || /*option*/ ctx[39].value)) {
3662
3649
  attr(li, "aria-label", li_aria_label_value);
3663
3650
  }
3664
3651
 
3665
- if (dirty[0] & /*options*/ 1024 && li_data_testid_value !== (li_data_testid_value = `${/*option*/ ctx[36].value}-dropdown-item`)) {
3652
+ if (dirty[0] & /*options*/ 1024 && li_data_testid_value !== (li_data_testid_value = `${/*option*/ ctx[39].value}-dropdown-item`)) {
3666
3653
  attr(li, "data-testid", li_data_testid_value);
3667
3654
  }
3668
3655
 
3669
- if (dirty[0] & /*options*/ 1024 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[38])) {
3670
- attr(li, "data-index", li_data_index_value);
3671
- }
3672
-
3673
- if (dirty[0] & /*options, highlightedIndex*/ 9216) {
3674
- toggle_class(li, "goa-dropdown-option--tabbed", /*index*/ ctx[38] === /*highlightedIndex*/ ctx[13]);
3656
+ if (dirty[0] & /*highlightedIndex*/ 8192) {
3657
+ toggle_class(li, "goa-dropdown-option--tabbed", /*index*/ ctx[41] === /*highlightedIndex*/ ctx[13]);
3675
3658
  }
3676
3659
 
3677
3660
  if (dirty[0] & /*_values, options*/ 1536) {
3678
- toggle_class(li, "goa-dropdown-option--selected", /*_values*/ ctx[9].includes(/*option*/ ctx[36].value));
3661
+ toggle_class(li, "goa-dropdown-option--selected", /*_values*/ ctx[9].includes(/*option*/ ctx[39].value));
3679
3662
  }
3680
3663
  },
3681
3664
  d(detaching) {
@@ -3698,20 +3681,16 @@ function create_fragment$q(ctx) {
3698
3681
  let ul;
3699
3682
  let slot;
3700
3683
  let t2;
3701
- let each_blocks = [];
3702
- let each_1_lookup = new Map();
3703
3684
  let ul_style_value;
3704
3685
  let div1_style_value;
3705
3686
  let mounted;
3706
3687
  let dispose;
3707
3688
  let if_block = /*isMenuVisible*/ ctx[12] && create_if_block$d(ctx);
3708
3689
  let each_value = /*options*/ ctx[10];
3709
- const get_key = ctx => /*option*/ ctx[36].value;
3690
+ let each_blocks = [];
3710
3691
 
3711
3692
  for (let i = 0; i < each_value.length; i += 1) {
3712
- let child_ctx = get_each_context$4(ctx, each_value, i);
3713
- let key = get_key(child_ctx);
3714
- each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx));
3693
+ each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3715
3694
  }
3716
3695
 
3717
3696
  return {
@@ -3823,7 +3802,25 @@ function create_fragment$q(ctx) {
3823
3802
 
3824
3803
  if (dirty[0] & /*options, highlightedIndex, _values, onSelect*/ 534016) {
3825
3804
  each_value = /*options*/ ctx[10];
3826
- each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, ul, destroy_block, create_each_block$4, null, get_each_context$4);
3805
+ let i;
3806
+
3807
+ for (i = 0; i < each_value.length; i += 1) {
3808
+ const child_ctx = get_each_context$4(ctx, each_value, i);
3809
+
3810
+ if (each_blocks[i]) {
3811
+ each_blocks[i].p(child_ctx, dirty);
3812
+ } else {
3813
+ each_blocks[i] = create_each_block$4(child_ctx);
3814
+ each_blocks[i].c();
3815
+ each_blocks[i].m(ul, null);
3816
+ }
3817
+ }
3818
+
3819
+ for (; i < each_blocks.length; i += 1) {
3820
+ each_blocks[i].d(1);
3821
+ }
3822
+
3823
+ each_blocks.length = each_value.length;
3827
3824
  }
3828
3825
 
3829
3826
  if (dirty[0] & /*maxheight*/ 8 && ul_style_value !== (ul_style_value = `overflow-y: auto; max-height: ${/*maxheight*/ ctx[3]}`)) {
@@ -3847,11 +3844,7 @@ function create_fragment$q(ctx) {
3847
3844
  d(detaching) {
3848
3845
  if (detaching) detach(div1);
3849
3846
  if (if_block) if_block.d();
3850
-
3851
- for (let i = 0; i < each_blocks.length; i += 1) {
3852
- each_blocks[i].d();
3853
- }
3854
-
3847
+ destroy_each(each_blocks, detaching);
3855
3848
  /*ul_binding*/ ctx[23](null);
3856
3849
  /*div1_binding*/ ctx[24](null);
3857
3850
  mounted = false;
@@ -3891,15 +3884,47 @@ function instance$o($$self, $$props, $$invalidate) {
3891
3884
  let ctx;
3892
3885
 
3893
3886
  // Hooks
3894
- onMount(async () => {
3895
- if (!name) {
3896
- console.error("goa-dropdown: missing the required `name` attribute. It must match the children's name attribute.");
3897
- return;
3898
- }
3887
+ onMount(() => {
3888
+ const maxAttempts = 10;
3889
+ let attempts = 0;
3890
+
3891
+ const fn = setInterval(
3892
+ async () => {
3893
+ attempts++;
3894
+
3895
+ if (name && el) {
3896
+ addEventListeners();
3897
+ parseValues();
3898
+ bindContext();
3899
+ clearInterval(fn);
3900
+ }
3899
3901
 
3902
+ if (attempts > maxAttempts) {
3903
+ console.error("goa-dropdown: missing the required `name` attribute. It must match the children's name attribute.");
3904
+ clearInterval(fn);
3905
+ }
3906
+ },
3907
+ 10
3908
+ );
3909
+ });
3910
+
3911
+ onDestroy(() => {
3912
+ removeEventListeners();
3913
+ deleteContext(name);
3914
+ });
3915
+
3916
+ // Functions
3917
+ function addEventListeners() {
3900
3918
  el.addEventListener("focus", onFocus, true);
3901
3919
  el.addEventListener("blur", onBlur, true);
3920
+ }
3902
3921
 
3922
+ function removeEventListeners() {
3923
+ el.removeEventListener("focus", onFocus, true);
3924
+ el.removeEventListener("blur", onBlur, true);
3925
+ }
3926
+
3927
+ function parseValues() {
3903
3928
  // parse and convert values to strings to avoid later type comparison issues
3904
3929
  let rawValue;
3905
3930
 
@@ -3913,17 +3938,8 @@ function instance$o($$self, $$props, $$invalidate) {
3913
3938
 
3914
3939
  // convert all values to strings to avoid later type comparison issues
3915
3940
  $$invalidate(9, _values = rawValues.map(val => `${val}`));
3941
+ }
3916
3942
 
3917
- bindContext();
3918
- });
3919
-
3920
- onDestroy(() => {
3921
- el.removeEventListener("focus", onFocus, true);
3922
- el.removeEventListener("blur", onBlur, true);
3923
- deleteContext(name);
3924
- });
3925
-
3926
- // Functions
3927
3943
  function bindContext() {
3928
3944
  ctx = createContext(name);
3929
3945
 
@@ -4311,15 +4327,23 @@ function instance$n($$self, $$props, $$invalidate) {
4311
4327
  // private
4312
4328
  let ctx;
4313
4329
 
4314
- // Hooks
4315
- onMount(async () => {
4316
- if (!name) {
4317
- console.error("goa-dropdown-item: missing the required `name` attribute. It must match the parent's name attribute");
4318
- return;
4319
- }
4330
+ onMount(() => {
4331
+
4332
+ const fn = setInterval(
4333
+ () => {
4334
+ if (name && value) {
4335
+ ctx = getContext(name);
4320
4336
 
4321
- ctx = await getContext(name);
4322
- ctx.notify({ type: BIND$1, name, label, value });
4337
+ if (!ctx) {
4338
+ return;
4339
+ }
4340
+
4341
+ ctx.notify({ type: BIND$1, name, label, value });
4342
+ clearInterval(fn);
4343
+ }
4344
+ },
4345
+ 10
4346
+ );
4323
4347
  });
4324
4348
 
4325
4349
  $$self.$$set = $$props => {
@@ -7614,7 +7638,7 @@ function get_each_context$3(ctx, list, i) {
7614
7638
  return child_ctx;
7615
7639
  }
7616
7640
 
7617
- // (55:2) {#each options as option (option.value) }
7641
+ // (63:2) {#each options as option (option.value) }
7618
7642
  function create_each_block$3(key_1, ctx) {
7619
7643
  let label;
7620
7644
  let input;
@@ -7802,21 +7826,35 @@ function instance$d($$self, $$props, $$invalidate) {
7802
7826
  let el;
7803
7827
 
7804
7828
  onMount(() => {
7805
- if (!name) {
7806
- console.error("goa-radio: missing the required `name` attribute. It must match the children's name attribute.");
7807
- return;
7808
- }
7829
+ const maxAttempts = 10;
7830
+ let attempts = 0;
7831
+
7832
+ const fn = setInterval(
7833
+ async () => {
7834
+ attempts++;
7835
+
7836
+ if (name) {
7837
+ ctx = createContext(name);
7838
+
7839
+ ctx.subscribe(msg => {
7840
+ switch (msg === null || msg === void 0 ? void 0 : msg.type) {
7841
+ case BIND:
7842
+ {
7843
+ $$invalidate(4, options = [...options, msg]);
7844
+ }
7845
+ }
7846
+ });
7809
7847
 
7810
- ctx = createContext(name);
7848
+ clearInterval(fn);
7849
+ }
7811
7850
 
7812
- ctx.subscribe(msg => {
7813
- switch (msg === null || msg === void 0 ? void 0 : msg.type) {
7814
- case BIND:
7815
- {
7816
- $$invalidate(4, options = [...options, msg]);
7817
- }
7818
- }
7819
- });
7851
+ if (attempts > maxAttempts) {
7852
+ console.error("goa-radio: missing the required `name` attribute. It must match the children's name attribute.");
7853
+ clearInterval(fn);
7854
+ }
7855
+ },
7856
+ 10
7857
+ );
7820
7858
  });
7821
7859
 
7822
7860
  function onChange(newValue) {
@@ -7994,14 +8032,32 @@ function instance$c($$self, $$props, $$invalidate) {
7994
8032
  let { name } = $$props;
7995
8033
  let ctx;
7996
8034
 
7997
- onMount(async () => {
7998
- if (!name) {
7999
- console.error("goa-radio-item: missing the required `name` attribute. It must match the parent's name attribute.");
8000
- return;
8001
- }
8035
+ onMount(() => {
8036
+ const maxAttempts = 10;
8037
+ let attempts = 0;
8038
+
8039
+ const fn = setInterval(
8040
+ () => {
8041
+ attempts++;
8042
+
8043
+ if (name) {
8044
+ ctx = getContext(name);
8045
+
8046
+ if (!ctx) {
8047
+ return;
8048
+ }
8049
+
8050
+ ctx.notify({ type: BIND, value, label });
8051
+ clearInterval(fn);
8052
+ }
8002
8053
 
8003
- ctx = await getContext(name);
8004
- ctx.notify({ type: BIND, value, label });
8054
+ if (attempts > maxAttempts) {
8055
+ console.error("goa-radio-item: missing the required `name` attribute. It must match the parent's name attribute.");
8056
+ clearInterval(fn);
8057
+ }
8058
+ },
8059
+ 10
8060
+ );
8005
8061
  });
8006
8062
 
8007
8063
  $$self.$$set = $$props => {