@primer/view-components 0.35.0-rc.ab9e1260 → 0.35.0-rc.adcb1989

Sign up to get free protection for your applications and to get access to all the features.
@@ -145,7 +145,7 @@ let SelectPanelElement = class SelectPanelElement extends HTMLElement {
145
145
  updateAnchorPosition() {
146
146
  // If the selectPanel is removed from the screen on resize close the dialog
147
147
  if (this && this.offsetParent === null) {
148
- this.dialog.close();
148
+ this.hide();
149
149
  }
150
150
  if (this.invokerElement) {
151
151
  const { top, left } = getAnchoredPosition(this.dialog, this.invokerElement, {
@@ -254,6 +254,12 @@ let SelectPanelElement = class SelectPanelElement extends HTMLElement {
254
254
  // Remove data-ready so it can be set the next time the panel is opened
255
255
  this.dialog.removeAttribute('data-ready');
256
256
  this.invokerElement?.setAttribute('aria-expanded', 'false');
257
+ // When we close the dialog, clear the filter input
258
+ const fireSearchEvent = this.filterInputTextField.value.length > 0;
259
+ this.filterInputTextField.value = '';
260
+ if (fireSearchEvent) {
261
+ this.filterInputTextField.dispatchEvent(new Event('input'));
262
+ }
257
263
  this.dispatchEvent(new CustomEvent('panelClosed', {
258
264
  detail: { panel: this },
259
265
  bubbles: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.35.0-rc.ab9e1260",
3
+ "version": "0.35.0-rc.adcb1989",
4
4
  "description": "ViewComponents for the Primer Design System",
5
5
  "main": "app/assets/javascripts/primer_view_components.js",
6
6
  "module": "app/components/primer/primer.js",
@@ -84,7 +84,7 @@
84
84
  "postcss": "^8.4.16",
85
85
  "postcss-cli": "^11.0.0",
86
86
  "postcss-import": "^16.0.0",
87
- "postcss-mixins": "^10.0.0",
87
+ "postcss-mixins": "^11.0.1",
88
88
  "postcss-preset-env": "^10.0.2",
89
89
  "prettier": "^3.3.2",
90
90
  "rollup": "^2.79.1",
@@ -2468,6 +2468,18 @@
2468
2468
  "default": "`:outside_bottom`",
2469
2469
  "description": "The side to anchor the Overlay to. One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
2470
2470
  },
2471
+ {
2472
+ "name": "loading_label",
2473
+ "type": "String",
2474
+ "default": "`\"Loading content...\"`",
2475
+ "description": "The aria-label to use when the panel is loading, defaults to 'Loading content...'."
2476
+ },
2477
+ {
2478
+ "name": "loading_description",
2479
+ "type": "String",
2480
+ "default": "`nil`",
2481
+ "description": "The description to use when the panel is loading. If not provided, no description will be used."
2482
+ },
2471
2483
  {
2472
2484
  "name": "banner_scheme",
2473
2485
  "type": "Symbol",
@@ -7653,6 +7653,18 @@
7653
7653
  "default": "`:outside_bottom`",
7654
7654
  "description": "The side to anchor the Overlay to. One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`."
7655
7655
  },
7656
+ {
7657
+ "name": "loading_label",
7658
+ "type": "String",
7659
+ "default": "`\"Loading content...\"`",
7660
+ "description": "The aria-label to use when the panel is loading, defaults to 'Loading content...'."
7661
+ },
7662
+ {
7663
+ "name": "loading_description",
7664
+ "type": "String",
7665
+ "default": "`nil`",
7666
+ "description": "The description to use when the panel is loading. If not provided, no description will be used."
7667
+ },
7656
7668
  {
7657
7669
  "name": "banner_scheme",
7658
7670
  "type": "Symbol",
@@ -7901,6 +7913,32 @@
7901
7913
  ]
7902
7914
  }
7903
7915
  },
7916
+ {
7917
+ "preview_path": "primer/alpha/select_panel/custom_loading_label",
7918
+ "name": "custom_loading_label",
7919
+ "snapshot": "interactive",
7920
+ "skip_rules": {
7921
+ "wont_fix": [
7922
+ "region"
7923
+ ],
7924
+ "will_fix": [
7925
+ "color-contrast"
7926
+ ]
7927
+ }
7928
+ },
7929
+ {
7930
+ "preview_path": "primer/alpha/select_panel/custom_loading_description",
7931
+ "name": "custom_loading_description",
7932
+ "snapshot": "interactive",
7933
+ "skip_rules": {
7934
+ "wont_fix": [
7935
+ "region"
7936
+ ],
7937
+ "will_fix": [
7938
+ "color-contrast"
7939
+ ]
7940
+ }
7941
+ },
7904
7942
  {
7905
7943
  "preview_path": "primer/alpha/select_panel/local_fetch_no_results",
7906
7944
  "name": "local_fetch_no_results",
@@ -5940,6 +5940,32 @@
5940
5940
  ]
5941
5941
  }
5942
5942
  },
5943
+ {
5944
+ "preview_path": "primer/alpha/select_panel/custom_loading_label",
5945
+ "name": "custom_loading_label",
5946
+ "snapshot": "interactive",
5947
+ "skip_rules": {
5948
+ "wont_fix": [
5949
+ "region"
5950
+ ],
5951
+ "will_fix": [
5952
+ "color-contrast"
5953
+ ]
5954
+ }
5955
+ },
5956
+ {
5957
+ "preview_path": "primer/alpha/select_panel/custom_loading_description",
5958
+ "name": "custom_loading_description",
5959
+ "snapshot": "interactive",
5960
+ "skip_rules": {
5961
+ "wont_fix": [
5962
+ "region"
5963
+ ],
5964
+ "will_fix": [
5965
+ "color-contrast"
5966
+ ]
5967
+ }
5968
+ },
5943
5969
  {
5944
5970
  "preview_path": "primer/alpha/select_panel/local_fetch_no_results",
5945
5971
  "name": "local_fetch_no_results",