@abgov/react-components 4.0.0-alpha.52 → 4.0.0-alpha.53

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/react-components",
3
- "version": "4.0.0-alpha.52",
3
+ "version": "4.0.0-alpha.53",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -4811,18 +4811,18 @@ function create_if_block$c(ctx) {
4811
4811
  }
4812
4812
 
4813
4813
  };
4814
- } // (234:4) {#each options as option, index}
4814
+ } // (239:4) {#each options as option, index}
4815
4815
 
4816
4816
 
4817
4817
  function create_each_block$4(ctx) {
4818
4818
  let li;
4819
- let t0_value = (
4819
+ let t_value = (
4820
4820
  /*option*/
4821
4821
  ctx[39].label ||
4822
4822
  /*option*/
4823
4823
  ctx[39].value) + "";
4824
- let t0;
4825
- let t1;
4824
+ let t;
4825
+ let li_id_value;
4826
4826
  let li_aria_label_value;
4827
4827
  let li_data_testid_value;
4828
4828
  let li_data_index_value;
@@ -4842,13 +4842,16 @@ function create_each_block$4(ctx) {
4842
4842
  return {
4843
4843
  c() {
4844
4844
  li = element("li");
4845
- t0 = text(t0_value);
4846
- t1 = space();
4845
+ t = text(t_value);
4846
+ attr(li, "id", li_id_value =
4847
+ /*option*/
4848
+ ctx[39].label);
4847
4849
  attr(li, "aria-label", li_aria_label_value =
4848
4850
  /*option*/
4849
4851
  ctx[39].label ||
4850
4852
  /*option*/
4851
4853
  ctx[39].value);
4854
+ attr(li, "role", "option");
4852
4855
  attr(li, "data-testid", li_data_testid_value = `${
4853
4856
  /*option*/
4854
4857
  ctx[39].value}-dropdown-item`);
@@ -4872,8 +4875,7 @@ function create_each_block$4(ctx) {
4872
4875
 
4873
4876
  m(target, anchor) {
4874
4877
  insert(target, li, anchor);
4875
- append(li, t0);
4876
- append(li, t1);
4878
+ append(li, t);
4877
4879
 
4878
4880
  if (!mounted) {
4879
4881
  dispose = listen(li, "click", click_handler);
@@ -4885,11 +4887,19 @@ function create_each_block$4(ctx) {
4885
4887
  ctx = new_ctx;
4886
4888
  if (dirty[0] &
4887
4889
  /*options*/
4888
- 1024 && t0_value !== (t0_value = (
4890
+ 1024 && t_value !== (t_value = (
4889
4891
  /*option*/
4890
4892
  ctx[39].label ||
4891
4893
  /*option*/
4892
- ctx[39].value) + "")) set_data(t0, t0_value);
4894
+ ctx[39].value) + "")) set_data(t, t_value);
4895
+
4896
+ if (dirty[0] &
4897
+ /*options*/
4898
+ 1024 && li_id_value !== (li_id_value =
4899
+ /*option*/
4900
+ ctx[39].label)) {
4901
+ attr(li, "id", li_id_value);
4902
+ }
4893
4903
 
4894
4904
  if (dirty[0] &
4895
4905
  /*options*/
@@ -4949,8 +4959,8 @@ function create_fragment$q(ctx) {
4949
4959
  let div0_data_testid_value;
4950
4960
  let t1;
4951
4961
  let ul;
4952
- let slot;
4953
4962
  let t2;
4963
+ let slot;
4954
4964
  let ul_style_value;
4955
4965
  let div1_style_value;
4956
4966
  let mounted;
@@ -4976,13 +4986,13 @@ function create_fragment$q(ctx) {
4976
4986
  goa_input = element("goa-input");
4977
4987
  t1 = space();
4978
4988
  ul = element("ul");
4979
- slot = element("slot");
4980
- t2 = space();
4981
4989
 
4982
4990
  for (let i = 0; i < each_blocks.length; i += 1) {
4983
4991
  each_blocks[i].c();
4984
4992
  }
4985
4993
 
4994
+ t2 = space();
4995
+ slot = element("slot");
4986
4996
  this.c = noop;
4987
4997
  set_custom_element_data(goa_input, "error",
4988
4998
  /*error*/
@@ -5000,11 +5010,16 @@ function create_fragment$q(ctx) {
5000
5010
  set_custom_element_data(goa_input, "id", goa_input_id_value = `${
5001
5011
  /*name*/
5002
5012
  ctx[0]}-dropdown-input`);
5013
+ set_custom_element_data(goa_input, "role", "combobox");
5003
5014
  set_custom_element_data(goa_input, "aria-label", goa_input_aria_label_value =
5004
5015
  /*arialabel*/
5005
5016
  ctx[1] ||
5006
5017
  /*name*/
5007
5018
  ctx[0]);
5019
+ set_custom_element_data(goa_input, "aria-expanded",
5020
+ /*isMenuVisible*/
5021
+ ctx[12]);
5022
+ set_custom_element_data(goa_input, "aria-controls", "menu");
5008
5023
  set_custom_element_data(goa_input, "readonly", "");
5009
5024
  set_custom_element_data(goa_input, "trailingicon", "chevron-down");
5010
5025
  set_custom_element_data(goa_input, "type", "text");
@@ -5014,6 +5029,11 @@ function create_fragment$q(ctx) {
5014
5029
  attr(div0, "data-testid", div0_data_testid_value = `${
5015
5030
  /*name*/
5016
5031
  ctx[0]}-dropdown`);
5032
+ attr(ul, "id", "menu");
5033
+ attr(ul, "role", "listbox");
5034
+ attr(ul, "aria-activedescendant",
5035
+ /*selectedLabel*/
5036
+ ctx[11]);
5017
5037
  attr(ul, "data-testid", "dropdown-menu");
5018
5038
  attr(ul, "tabindex", "0");
5019
5039
  attr(ul, "class", "goa-dropdown-list");
@@ -5042,14 +5062,14 @@ function create_fragment$q(ctx) {
5042
5062
  append(div0, goa_input);
5043
5063
  append(div1, t1);
5044
5064
  append(div1, ul);
5045
- append(ul, slot);
5046
- append(ul, t2);
5047
5065
 
5048
5066
  for (let i = 0; i < each_blocks.length; i += 1) {
5049
5067
  each_blocks[i].m(ul, null);
5050
5068
  }
5051
- /*ul_binding*/
5052
5069
 
5070
+ append(ul, t2);
5071
+ append(ul, slot);
5072
+ /*ul_binding*/
5053
5073
 
5054
5074
  ctx[23](ul);
5055
5075
  /*div1_binding*/
@@ -5130,6 +5150,14 @@ function create_fragment$q(ctx) {
5130
5150
  set_custom_element_data(goa_input, "aria-label", goa_input_aria_label_value);
5131
5151
  }
5132
5152
 
5153
+ if (dirty[0] &
5154
+ /*isMenuVisible*/
5155
+ 4096) {
5156
+ set_custom_element_data(goa_input, "aria-expanded",
5157
+ /*isMenuVisible*/
5158
+ ctx[12]);
5159
+ }
5160
+
5133
5161
  if (dirty[0] &
5134
5162
  /*selectedLabel*/
5135
5163
  2048) {
@@ -5162,7 +5190,7 @@ function create_fragment$q(ctx) {
5162
5190
  } else {
5163
5191
  each_blocks[i] = create_each_block$4(child_ctx);
5164
5192
  each_blocks[i].c();
5165
- each_blocks[i].m(ul, null);
5193
+ each_blocks[i].m(ul, t2);
5166
5194
  }
5167
5195
  }
5168
5196
 
@@ -5173,6 +5201,14 @@ function create_fragment$q(ctx) {
5173
5201
  each_blocks.length = each_value.length;
5174
5202
  }
5175
5203
 
5204
+ if (dirty[0] &
5205
+ /*selectedLabel*/
5206
+ 2048) {
5207
+ attr(ul, "aria-activedescendant",
5208
+ /*selectedLabel*/
5209
+ ctx[11]);
5210
+ }
5211
+
5176
5212
  if (dirty[0] &
5177
5213
  /*maxheight*/
5178
5214
  8 && ul_style_value !== (ul_style_value = `overflow-y: auto; max-height: ${
@@ -4853,18 +4853,18 @@
4853
4853
  }
4854
4854
 
4855
4855
  };
4856
- } // (234:4) {#each options as option, index}
4856
+ } // (239:4) {#each options as option, index}
4857
4857
 
4858
4858
 
4859
4859
  function create_each_block$4(ctx) {
4860
4860
  let li;
4861
- let t0_value = (
4861
+ let t_value = (
4862
4862
  /*option*/
4863
4863
  ctx[39].label ||
4864
4864
  /*option*/
4865
4865
  ctx[39].value) + "";
4866
- let t0;
4867
- let t1;
4866
+ let t;
4867
+ let li_id_value;
4868
4868
  let li_aria_label_value;
4869
4869
  let li_data_testid_value;
4870
4870
  let li_data_index_value;
@@ -4884,13 +4884,16 @@
4884
4884
  return {
4885
4885
  c() {
4886
4886
  li = element("li");
4887
- t0 = text(t0_value);
4888
- t1 = space();
4887
+ t = text(t_value);
4888
+ attr(li, "id", li_id_value =
4889
+ /*option*/
4890
+ ctx[39].label);
4889
4891
  attr(li, "aria-label", li_aria_label_value =
4890
4892
  /*option*/
4891
4893
  ctx[39].label ||
4892
4894
  /*option*/
4893
4895
  ctx[39].value);
4896
+ attr(li, "role", "option");
4894
4897
  attr(li, "data-testid", li_data_testid_value = `${
4895
4898
  /*option*/
4896
4899
  ctx[39].value}-dropdown-item`);
@@ -4914,8 +4917,7 @@
4914
4917
 
4915
4918
  m(target, anchor) {
4916
4919
  insert(target, li, anchor);
4917
- append(li, t0);
4918
- append(li, t1);
4920
+ append(li, t);
4919
4921
 
4920
4922
  if (!mounted) {
4921
4923
  dispose = listen(li, "click", click_handler);
@@ -4927,11 +4929,19 @@
4927
4929
  ctx = new_ctx;
4928
4930
  if (dirty[0] &
4929
4931
  /*options*/
4930
- 1024 && t0_value !== (t0_value = (
4932
+ 1024 && t_value !== (t_value = (
4931
4933
  /*option*/
4932
4934
  ctx[39].label ||
4933
4935
  /*option*/
4934
- ctx[39].value) + "")) set_data(t0, t0_value);
4936
+ ctx[39].value) + "")) set_data(t, t_value);
4937
+
4938
+ if (dirty[0] &
4939
+ /*options*/
4940
+ 1024 && li_id_value !== (li_id_value =
4941
+ /*option*/
4942
+ ctx[39].label)) {
4943
+ attr(li, "id", li_id_value);
4944
+ }
4935
4945
 
4936
4946
  if (dirty[0] &
4937
4947
  /*options*/
@@ -4991,8 +5001,8 @@
4991
5001
  let div0_data_testid_value;
4992
5002
  let t1;
4993
5003
  let ul;
4994
- let slot;
4995
5004
  let t2;
5005
+ let slot;
4996
5006
  let ul_style_value;
4997
5007
  let div1_style_value;
4998
5008
  let mounted;
@@ -5018,13 +5028,13 @@
5018
5028
  goa_input = element("goa-input");
5019
5029
  t1 = space();
5020
5030
  ul = element("ul");
5021
- slot = element("slot");
5022
- t2 = space();
5023
5031
 
5024
5032
  for (let i = 0; i < each_blocks.length; i += 1) {
5025
5033
  each_blocks[i].c();
5026
5034
  }
5027
5035
 
5036
+ t2 = space();
5037
+ slot = element("slot");
5028
5038
  this.c = noop;
5029
5039
  set_custom_element_data(goa_input, "error",
5030
5040
  /*error*/
@@ -5042,11 +5052,16 @@
5042
5052
  set_custom_element_data(goa_input, "id", goa_input_id_value = `${
5043
5053
  /*name*/
5044
5054
  ctx[0]}-dropdown-input`);
5055
+ set_custom_element_data(goa_input, "role", "combobox");
5045
5056
  set_custom_element_data(goa_input, "aria-label", goa_input_aria_label_value =
5046
5057
  /*arialabel*/
5047
5058
  ctx[1] ||
5048
5059
  /*name*/
5049
5060
  ctx[0]);
5061
+ set_custom_element_data(goa_input, "aria-expanded",
5062
+ /*isMenuVisible*/
5063
+ ctx[12]);
5064
+ set_custom_element_data(goa_input, "aria-controls", "menu");
5050
5065
  set_custom_element_data(goa_input, "readonly", "");
5051
5066
  set_custom_element_data(goa_input, "trailingicon", "chevron-down");
5052
5067
  set_custom_element_data(goa_input, "type", "text");
@@ -5056,6 +5071,11 @@
5056
5071
  attr(div0, "data-testid", div0_data_testid_value = `${
5057
5072
  /*name*/
5058
5073
  ctx[0]}-dropdown`);
5074
+ attr(ul, "id", "menu");
5075
+ attr(ul, "role", "listbox");
5076
+ attr(ul, "aria-activedescendant",
5077
+ /*selectedLabel*/
5078
+ ctx[11]);
5059
5079
  attr(ul, "data-testid", "dropdown-menu");
5060
5080
  attr(ul, "tabindex", "0");
5061
5081
  attr(ul, "class", "goa-dropdown-list");
@@ -5084,14 +5104,14 @@
5084
5104
  append(div0, goa_input);
5085
5105
  append(div1, t1);
5086
5106
  append(div1, ul);
5087
- append(ul, slot);
5088
- append(ul, t2);
5089
5107
 
5090
5108
  for (let i = 0; i < each_blocks.length; i += 1) {
5091
5109
  each_blocks[i].m(ul, null);
5092
5110
  }
5093
- /*ul_binding*/
5094
5111
 
5112
+ append(ul, t2);
5113
+ append(ul, slot);
5114
+ /*ul_binding*/
5095
5115
 
5096
5116
  ctx[23](ul);
5097
5117
  /*div1_binding*/
@@ -5172,6 +5192,14 @@
5172
5192
  set_custom_element_data(goa_input, "aria-label", goa_input_aria_label_value);
5173
5193
  }
5174
5194
 
5195
+ if (dirty[0] &
5196
+ /*isMenuVisible*/
5197
+ 4096) {
5198
+ set_custom_element_data(goa_input, "aria-expanded",
5199
+ /*isMenuVisible*/
5200
+ ctx[12]);
5201
+ }
5202
+
5175
5203
  if (dirty[0] &
5176
5204
  /*selectedLabel*/
5177
5205
  2048) {
@@ -5204,7 +5232,7 @@
5204
5232
  } else {
5205
5233
  each_blocks[i] = create_each_block$4(child_ctx);
5206
5234
  each_blocks[i].c();
5207
- each_blocks[i].m(ul, null);
5235
+ each_blocks[i].m(ul, t2);
5208
5236
  }
5209
5237
  }
5210
5238
 
@@ -5215,6 +5243,14 @@
5215
5243
  each_blocks.length = each_value.length;
5216
5244
  }
5217
5245
 
5246
+ if (dirty[0] &
5247
+ /*selectedLabel*/
5248
+ 2048) {
5249
+ attr(ul, "aria-activedescendant",
5250
+ /*selectedLabel*/
5251
+ ctx[11]);
5252
+ }
5253
+
5218
5254
  if (dirty[0] &
5219
5255
  /*maxheight*/
5220
5256
  8 && ul_style_value !== (ul_style_value = `overflow-y: auto; max-height: ${