@unofficialbox/box-open-elements 0.17.0 → 0.19.0

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.
Files changed (146) hide show
  1. package/dist/components/actions/button-group.js +6 -0
  2. package/dist/components/actions/button.js +6 -0
  3. package/dist/components/actions/icon-button.js +6 -0
  4. package/dist/components/actions/link-button.js +6 -0
  5. package/dist/components/actions/menu-item.js +6 -0
  6. package/dist/components/actions/menu.js +6 -0
  7. package/dist/components/actions/segmented-control.js +6 -0
  8. package/dist/components/actions/toolbar.js +6 -0
  9. package/dist/components/collections/card.js +6 -0
  10. package/dist/components/collections/carousel.js +6 -0
  11. package/dist/components/collections/datalist-item.js +6 -0
  12. package/dist/components/collections/draggable-list.js +6 -0
  13. package/dist/components/collections/grid-view.js +6 -0
  14. package/dist/components/collections/pagination.js +6 -0
  15. package/dist/components/collections/table.js +6 -0
  16. package/dist/components/collections/thumbnail-card.js +6 -0
  17. package/dist/components/collections/tree-grid.js +6 -0
  18. package/dist/components/collections/tree.js +6 -0
  19. package/dist/components/feedback/alert.js +1 -1
  20. package/dist/components/feedback/badge.js +1 -1
  21. package/dist/components/feedback/badgeable.js +6 -0
  22. package/dist/components/feedback/chip.js +6 -0
  23. package/dist/components/feedback/due-badge.js +6 -0
  24. package/dist/components/feedback/empty-state.js +6 -0
  25. package/dist/components/feedback/error-mask.js +6 -0
  26. package/dist/components/feedback/help-text.js +6 -0
  27. package/dist/components/feedback/indicator.js +1 -1
  28. package/dist/components/feedback/nudge.js +6 -0
  29. package/dist/components/feedback/path.js +6 -0
  30. package/dist/components/feedback/progress-bar.js +6 -0
  31. package/dist/components/feedback/progress-ring.js +6 -0
  32. package/dist/components/feedback/progress-steps.js +6 -0
  33. package/dist/components/feedback/skeleton.js +6 -0
  34. package/dist/components/feedback/spinner.js +6 -0
  35. package/dist/components/feedback/toast.js +1 -1
  36. package/dist/components/files/drop-zone.d.ts +26 -5
  37. package/dist/components/files/drop-zone.js +181 -22
  38. package/dist/components/forms/calendar.js +6 -0
  39. package/dist/components/forms/category-selector.js +6 -0
  40. package/dist/components/forms/checkbox-group.js +6 -0
  41. package/dist/components/forms/checkbox.js +6 -0
  42. package/dist/components/forms/color-picker.js +6 -0
  43. package/dist/components/forms/combobox.js +6 -0
  44. package/dist/components/forms/date-field.js +6 -0
  45. package/dist/components/forms/dropdown.js +6 -0
  46. package/dist/components/forms/dual-listbox.js +6 -0
  47. package/dist/components/forms/fieldset.js +6 -0
  48. package/dist/components/forms/multi-select.js +6 -0
  49. package/dist/components/forms/number-input.js +6 -0
  50. package/dist/components/forms/pill-cloud.js +6 -0
  51. package/dist/components/forms/pill-selector-dropdown.js +6 -0
  52. package/dist/components/forms/radio-group.js +6 -0
  53. package/dist/components/forms/range-slider.js +6 -0
  54. package/dist/components/forms/rating.js +6 -0
  55. package/dist/components/forms/rich-text-input.js +6 -0
  56. package/dist/components/forms/search-field.js +6 -0
  57. package/dist/components/forms/select.js +6 -0
  58. package/dist/components/forms/slider.js +6 -0
  59. package/dist/components/forms/spin-button.js +6 -0
  60. package/dist/components/forms/switch.js +6 -0
  61. package/dist/components/forms/tag-input.js +6 -0
  62. package/dist/components/forms/text-area.js +6 -0
  63. package/dist/components/forms/text-field.js +6 -0
  64. package/dist/components/forms/tile-group.js +1 -1
  65. package/dist/components/forms/time-field.js +6 -0
  66. package/dist/components/identity/avatar.js +6 -0
  67. package/dist/components/identity/contact-datalist-item.js +6 -0
  68. package/dist/components/identity/persona.js +6 -0
  69. package/dist/components/layout/app-shell.js +6 -0
  70. package/dist/components/layout/divider.js +6 -0
  71. package/dist/components/layout/grid.js +1 -1
  72. package/dist/components/layout/nav-sidebar.js +6 -0
  73. package/dist/components/layout/section.js +6 -0
  74. package/dist/components/layout/sidebar-toggle-button.js +6 -0
  75. package/dist/components/layout/split-view.js +6 -0
  76. package/dist/components/navigation/accordion.js +6 -0
  77. package/dist/components/navigation/breadcrumb.js +6 -0
  78. package/dist/components/navigation/tabs.js +6 -0
  79. package/dist/components/output/code-block.js +1 -1
  80. package/dist/components/output/formatted-value.js +1 -1
  81. package/dist/components/overlays/command-palette.js +6 -0
  82. package/dist/components/overlays/context-menu.js +6 -0
  83. package/dist/components/overlays/guide-tooltip.js +6 -0
  84. package/dist/components/overlays/popover.js +6 -0
  85. package/dist/components/overlays/shortcuts-overlay.js +6 -0
  86. package/dist/components/overlays/tooltip.js +6 -0
  87. package/dist/components/visuals/illustration.js +6 -0
  88. package/dist/foundations/tokens/box-defaults.js +36 -0
  89. package/dist/patterns/agent-chat/agent-chat.js +6 -0
  90. package/dist/patterns/audit/activity-density.js +6 -0
  91. package/dist/patterns/audit/audit-log.js +6 -0
  92. package/dist/patterns/comments/comment-thread.js +6 -0
  93. package/dist/patterns/content-explorer/adapters/action-menu.js +6 -0
  94. package/dist/patterns/content-explorer/adapters/breadcrumbs.js +6 -0
  95. package/dist/patterns/content-explorer/adapters/list.js +6 -0
  96. package/dist/patterns/content-explorer/adapters/table.js +6 -0
  97. package/dist/patterns/content-explorer/adapters/toolbar.js +6 -0
  98. package/dist/patterns/content-explorer/content-explorer.js +6 -0
  99. package/dist/patterns/content-picker/content-picker.js +6 -0
  100. package/dist/patterns/content-sidebar/content-sidebar.js +6 -0
  101. package/dist/patterns/content-uploader/content-uploader.d.ts +33 -0
  102. package/dist/patterns/content-uploader/content-uploader.js +181 -16
  103. package/dist/patterns/diff/compare-view.js +6 -0
  104. package/dist/patterns/diff/diff-viewer.js +6 -0
  105. package/dist/patterns/file-request/file-request-builder.js +6 -0
  106. package/dist/patterns/form-wizard/form-wizard.js +6 -0
  107. package/dist/patterns/form-wizard/wizard-summary.js +6 -0
  108. package/dist/patterns/governance/governance-panel.js +6 -0
  109. package/dist/patterns/insights/bar-chart.js +6 -0
  110. package/dist/patterns/insights/chart-panel.js +6 -0
  111. package/dist/patterns/insights/donut-chart.js +6 -0
  112. package/dist/patterns/insights/line-chart.js +6 -0
  113. package/dist/patterns/insights/metric-card.js +6 -0
  114. package/dist/patterns/item/bulk-action-bar.js +6 -0
  115. package/dist/patterns/item/item-details-panel.js +6 -0
  116. package/dist/patterns/item/item-form.js +6 -0
  117. package/dist/patterns/item/preview-header.js +6 -0
  118. package/dist/patterns/lineage/lineage-graph.js +6 -0
  119. package/dist/patterns/lineage/provenance-strip.js +6 -0
  120. package/dist/patterns/metadata/metadata-filter-builder.js +6 -0
  121. package/dist/patterns/metadata/metadata-inspector.js +6 -0
  122. package/dist/patterns/notifications/notification-bell.js +6 -0
  123. package/dist/patterns/notifications/notification-inbox.js +6 -0
  124. package/dist/patterns/preview/annotation-inspector.js +6 -0
  125. package/dist/patterns/preview/annotation-toolbar.js +6 -0
  126. package/dist/patterns/preview/preview-element.js +6 -0
  127. package/dist/patterns/run/run-trace.js +6 -0
  128. package/dist/patterns/search/filter-bar.js +6 -0
  129. package/dist/patterns/search/saved-view-picker.js +6 -0
  130. package/dist/patterns/search/search-results-header.js +6 -0
  131. package/dist/patterns/share/access-stats.js +6 -0
  132. package/dist/patterns/share/collaborator-avatars.js +6 -0
  133. package/dist/patterns/share/invite-collaborators-modal.js +6 -0
  134. package/dist/patterns/share/permission-matrix.js +6 -0
  135. package/dist/patterns/share/presence.js +6 -0
  136. package/dist/patterns/share/share-panel.js +6 -0
  137. package/dist/patterns/share/unified-share-modal.js +6 -0
  138. package/dist/patterns/signature/signature-ceremony.js +6 -0
  139. package/dist/patterns/task/review-queue-item.js +6 -0
  140. package/dist/patterns/task/task-assignment-panel.js +6 -0
  141. package/dist/patterns/timeline/timeline.js +6 -0
  142. package/dist/patterns/versions/version-graph.js +6 -0
  143. package/dist/patterns/versions/version-list.js +6 -0
  144. package/dist/patterns/work-queue/work-queue.js +6 -0
  145. package/dist/patterns/work-queue/workload-board.js +6 -0
  146. package/package.json +1 -1
@@ -11,12 +11,19 @@ const dropZoneStyles = `
11
11
  font: inherit;
12
12
  }
13
13
 
14
+ /* Without this, the host's own display:block beats the UA rule for [hidden]
15
+ and the element stays visible when a host hides it. */
16
+ :host([hidden]) {
17
+ display: none !important;
18
+ }
19
+
14
20
  [part="zone"] {
15
21
  position: relative;
16
22
  display: grid;
17
23
  gap: 0.55rem;
18
24
  justify-items: start;
19
25
  padding: 0.75rem;
26
+ text-align: start;
20
27
  border: 1.5px dashed color-mix(in srgb, var(--boe-token-surface-surface-brand, #0061d5) 16%, var(--boe-token-stroke-stroke, #e8e8e8) 84%);
21
28
  border-radius: ${boeRadius.large};
22
29
  background: var(--boe-token-surface-surface-secondary, #fbfbfb);
@@ -49,7 +56,9 @@ const dropZoneStyles = `
49
56
  0 14px 28px rgba(15, 23, 42, 0.05);
50
57
  }
51
58
 
52
- [part="input"] {
59
+ /* The inputs are never the focusable control — the browse buttons are — so
60
+ they are taken out of the tab order rather than merely hidden. */
61
+ [part~="file-input"] {
53
62
  position: absolute;
54
63
  inline-size: 1px;
55
64
  block-size: 1px;
@@ -57,8 +66,6 @@ const dropZoneStyles = `
57
66
  pointer-events: none;
58
67
  }
59
68
 
60
- ${boeFocusVisibleStyles('[part="input"]')}
61
-
62
69
  [part="label"] {
63
70
  font-size: 1rem;
64
71
  font-weight: 700;
@@ -70,17 +77,99 @@ const dropZoneStyles = `
70
77
  line-height: 1.5;
71
78
  max-width: 34ch;
72
79
  }
80
+
81
+ [part="actions"] {
82
+ display: flex;
83
+ flex-wrap: wrap;
84
+ align-items: baseline;
85
+ gap: 0.25rem 0.5rem;
86
+ }
87
+
88
+ [part~="browse"] {
89
+ appearance: none;
90
+ margin: 0;
91
+ padding: 0;
92
+ border: 0;
93
+ background: none;
94
+ font: inherit;
95
+ font-weight: 600;
96
+ color: var(--boe-token-surface-surface-brand, #0061d5);
97
+ text-decoration: none;
98
+ cursor: pointer;
99
+ border-radius: ${boeRadius.control};
100
+ }
101
+
102
+ [part~="browse"]:hover {
103
+ text-decoration: underline;
104
+ }
105
+
106
+ ${boeFocusVisibleStyles('[part~="browse"]')}
107
+
108
+ [part="separator"] {
109
+ color: var(--boe-token-text-text-secondary, #6f6f6f);
110
+ }
111
+
112
+ /* Hero: the full-height empty state, centred, with room for an illustration.
113
+ Matches the shape box-ui-elements gives its uploader. */
114
+ :host([variant="hero"]) [part="zone"] {
115
+ justify-items: center;
116
+ align-content: center;
117
+ gap: 0.35rem;
118
+ min-block-size: 18rem;
119
+ padding: 2rem 1.5rem;
120
+ text-align: center;
121
+ }
122
+
123
+ :host([variant="hero"]) [part="label"] {
124
+ font-size: 1.0625rem;
125
+ }
126
+
127
+ :host([variant="hero"]) [part~="description"] {
128
+ max-width: 42ch;
129
+ }
130
+
131
+ [part="illustration"] {
132
+ display: none;
133
+ }
134
+
135
+ :host([variant="hero"]) [part="illustration"] {
136
+ display: block;
137
+ /* The art carries its own padding inside the viewBox, so the box is set a
138
+ little larger than the 130px box-ui-elements uses for the drawn area. */
139
+ inline-size: min(10.5rem, 70%);
140
+ margin-block-end: 0.15rem;
141
+ }
142
+
143
+ ::slotted([slot="illustration"]) {
144
+ display: block;
145
+ inline-size: 100%;
146
+ block-size: auto;
147
+ }
73
148
  `;
74
149
  export class DropZone extends BaseElement {
75
150
  static tagName = DEFAULT_TAG_NAME;
76
151
  static get observedAttributes() {
77
- return ["accept", "description", "directories", "label", "message"];
152
+ return [
153
+ "accept",
154
+ "browse-label",
155
+ "description",
156
+ "directories",
157
+ "folder-label",
158
+ "label",
159
+ "message",
160
+ "variant",
161
+ ];
78
162
  }
79
163
  dragging = false;
80
164
  zoneEl;
81
165
  inputEl;
166
+ folderInputEl;
82
167
  labelEl;
83
168
  messageEl;
169
+ browseEl;
170
+ folderBrowseEl;
171
+ separatorEl;
172
+ illustrationEl;
84
173
  get label() {
85
174
  return this.getAttribute("label") ?? "Upload files";
86
175
  }
@@ -100,12 +189,15 @@ export class DropZone extends BaseElement {
100
189
  this.setAttribute("description", value);
101
190
  }
102
191
  /**
103
- * Make the browse dialog pick a folder rather than files.
192
+ * Offer folder selection from the browse controls as well as files.
193
+ *
194
+ * A single `<input>` is either a file picker or a folder picker, never both —
195
+ * so this adds a *second* control backed by its own `webkitdirectory` input
196
+ * rather than converting the first, which is how box-ui-elements does it and
197
+ * means a person is never made to choose between the two.
104
198
  *
105
- * Drag-and-drop reads folders regardless — a dropped directory is always
106
- * traversed. This only governs the click-to-browse path, where the platform
107
- * makes it either/or: an input is a file picker or a folder picker, never
108
- * both.
199
+ * Drag-and-drop reads folders regardless; a dropped directory is always
200
+ * traversed whatever this is set to.
109
201
  */
110
202
  get directories() {
111
203
  return this.hasAttribute("directories");
@@ -113,6 +205,31 @@ export class DropZone extends BaseElement {
113
205
  set directories(value) {
114
206
  this.toggleAttribute("directories", value);
115
207
  }
208
+ /** Text of the file-browse control. */
209
+ get browseLabel() {
210
+ return this.getAttribute("browse-label") ?? "Browse your device";
211
+ }
212
+ set browseLabel(value) {
213
+ this.setAttribute("browse-label", value);
214
+ }
215
+ /** Text of the folder-browse control, shown only when `directories` is set. */
216
+ get folderLabel() {
217
+ return this.getAttribute("folder-label") ?? "Select folders";
218
+ }
219
+ set folderLabel(value) {
220
+ this.setAttribute("folder-label", value);
221
+ }
222
+ /**
223
+ * `"compact"` (default) keeps the small inline target; `"hero"` is the tall
224
+ * centred empty state, with room for an illustration in the `illustration`
225
+ * slot.
226
+ */
227
+ get variant() {
228
+ return this.getAttribute("variant") === "hero" ? "hero" : "compact";
229
+ }
230
+ set variant(value) {
231
+ this.setAttribute("variant", value);
232
+ }
116
233
  /**
117
234
  * What the browse dialog offers, in the `<input accept>` syntax —
118
235
  * `".pdf,.docx"` or `"image/*"`.
@@ -135,16 +252,31 @@ export class DropZone extends BaseElement {
135
252
  if (!this.shadowRoot) {
136
253
  return;
137
254
  }
255
+ // A div rather than a label wrapping the input: the browse controls are
256
+ // real buttons, and a button inside a label is both ambiguous to assistive
257
+ // technology and prone to firing the picker twice.
138
258
  this.shadowRoot.innerHTML = `
139
259
  <style>${dropZoneStyles}</style>
140
- <label part="zone">
141
- <input type="file" part="input" multiple />
260
+ <div part="zone">
261
+ <input type="file" part="input file-input" multiple tabindex="-1" aria-hidden="true" />
262
+ <input type="file" part="folder-input file-input" multiple tabindex="-1" aria-hidden="true" webkitdirectory />
263
+ <span part="illustration"><slot name="illustration"></slot></span>
142
264
  <strong part="label"></strong>
143
265
  <span part="description message"></span>
144
- </label>
266
+ <span part="actions">
267
+ <button type="button" part="browse browse-files"></button>
268
+ <span part="separator" hidden>or</span>
269
+ <button type="button" part="browse browse-folders" hidden></button>
270
+ </span>
271
+ </div>
145
272
  `;
146
273
  this.zoneEl = this.shadowRoot.querySelector('[part="zone"]');
147
- this.inputEl = this.shadowRoot.querySelector('[part="input"]');
274
+ this.inputEl = this.shadowRoot.querySelector('[part~="input"]');
275
+ this.folderInputEl = this.shadowRoot.querySelector('[part~="folder-input"]');
276
+ this.browseEl = this.shadowRoot.querySelector('[part~="browse-files"]');
277
+ this.folderBrowseEl = this.shadowRoot.querySelector('[part~="browse-folders"]');
278
+ this.separatorEl = this.shadowRoot.querySelector('[part="separator"]');
279
+ this.illustrationEl = this.shadowRoot.querySelector('[part="illustration"]');
148
280
  this.labelEl = this.shadowRoot.querySelector('[part="label"]');
149
281
  this.messageEl = this.shadowRoot.querySelector('[part~="description"]');
150
282
  }
@@ -177,11 +309,30 @@ export class DropZone extends BaseElement {
177
309
  this.emitSelection(entries, skipped);
178
310
  });
179
311
  });
180
- this.inputEl.addEventListener("change", () => {
181
- // `webkitdirectory` reports the tree through each file's
182
- // webkitRelativePath rather than through entries.
183
- this.emitSelection(entriesFromFileList(Array.from(this.inputEl.files ?? [])));
312
+ // Clicking the body of the zone still opens the file picker, as it did when
313
+ // the zone was a label. Clicks that land on a button are left alone, or the
314
+ // picker would be asked to open twice.
315
+ this.zoneEl.addEventListener("click", event => {
316
+ if (event.target.closest('[part~="browse"]')) {
317
+ return;
318
+ }
319
+ this.inputEl.click();
320
+ });
321
+ this.browseEl.addEventListener("click", () => {
322
+ this.inputEl.click();
323
+ });
324
+ this.folderBrowseEl.addEventListener("click", () => {
325
+ this.folderInputEl.click();
184
326
  });
327
+ for (const input of [this.inputEl, this.folderInputEl]) {
328
+ input.addEventListener("change", () => {
329
+ // A folder picked through `webkitdirectory` reports its tree through
330
+ // each file's webkitRelativePath rather than through entries.
331
+ this.emitSelection(entriesFromFileList(Array.from(input.files ?? [])));
332
+ // Cleared so choosing the same folder twice in a row still fires.
333
+ input.value = "";
334
+ });
335
+ }
185
336
  }
186
337
  /**
187
338
  * Report a selection.
@@ -213,13 +364,21 @@ export class DropZone extends BaseElement {
213
364
  this.zoneEl.dataset.dragging = String(this.dragging);
214
365
  this.labelEl.textContent = this.label;
215
366
  this.messageEl.textContent = this.message;
216
- // webkitdirectory turns the browse dialog into a folder picker. It is a
217
- // property as well as an attribute, and only the property is honoured
218
- // reliably once the input exists.
367
+ // Hidden rather than left empty, so it does not open a gap in the stack.
368
+ this.messageEl.hidden = this.message.trim() === "";
369
+ this.browseEl.textContent = this.browseLabel;
370
+ this.folderBrowseEl.textContent = this.folderLabel;
371
+ // The folder control is a second input rather than a mode on the first, so
372
+ // files and folders are both reachable instead of mutually exclusive.
219
373
  const directories = this.directories;
220
- this.inputEl.toggleAttribute("webkitdirectory", directories);
221
- this.inputEl.webkitdirectory = directories;
374
+ this.folderBrowseEl.hidden = !directories;
375
+ this.separatorEl.hidden = !directories;
376
+ // webkitdirectory is a property as well as an attribute, and only the
377
+ // property is honoured reliably once the input exists.
378
+ this.folderInputEl.webkitdirectory = true;
379
+ // A folder picker offers folders, so an extension filter would only mislead.
222
380
  this.inputEl.accept = this.accept;
381
+ this.illustrationEl.hidden = this.variant !== "hero";
223
382
  }
224
383
  }
225
384
  DropZone.register();
@@ -54,6 +54,12 @@ const calendarStyles = `
54
54
  font: inherit;
55
55
  }
56
56
 
57
+ /* The host's own display would otherwise beat the UA rule for [hidden],
58
+ leaving the element on screen when a host hides it. */
59
+ :host([hidden]) {
60
+ display: none !important;
61
+ }
62
+
57
63
  [part="calendar"] {
58
64
  display: grid;
59
65
  gap: 0.55rem;
@@ -17,6 +17,12 @@ const categorySelectorStyles = `
17
17
  font: inherit;
18
18
  }
19
19
 
20
+ /* The host's own display would otherwise beat the UA rule for [hidden],
21
+ leaving the element on screen when a host hides it. */
22
+ :host([hidden]) {
23
+ display: none !important;
24
+ }
25
+
20
26
  [part="group"] {
21
27
  display: flex;
22
28
  flex-wrap: wrap;
@@ -16,6 +16,12 @@ const checkboxGroupStyles = `
16
16
  font: inherit;
17
17
  }
18
18
 
19
+ /* The host's own display would otherwise beat the UA rule for [hidden],
20
+ leaving the element on screen when a host hides it. */
21
+ :host([hidden]) {
22
+ display: none !important;
23
+ }
24
+
19
25
  [part="group"] {
20
26
  margin: 0;
21
27
  padding: 0;
@@ -12,6 +12,12 @@ const checkboxStyles = `
12
12
  font: inherit;
13
13
  }
14
14
 
15
+ /* The host's own display would otherwise beat the UA rule for [hidden],
16
+ leaving the element on screen when a host hides it. */
17
+ :host([hidden]) {
18
+ display: none !important;
19
+ }
20
+
15
21
  [part="field"] {
16
22
  display: inline-flex;
17
23
  align-items: center;
@@ -22,6 +22,12 @@ const colorPickerStyles = `
22
22
  font: inherit;
23
23
  }
24
24
 
25
+ /* The host's own display would otherwise beat the UA rule for [hidden],
26
+ leaving the element on screen when a host hides it. */
27
+ :host([hidden]) {
28
+ display: none !important;
29
+ }
30
+
25
31
  [part="field"] {
26
32
  display: grid;
27
33
  gap: 0.5rem;
@@ -17,6 +17,12 @@ const comboboxStyles = `
17
17
  font: inherit;
18
18
  }
19
19
 
20
+ /* The host's own display would otherwise beat the UA rule for [hidden],
21
+ leaving the element on screen when a host hides it. */
22
+ :host([hidden]) {
23
+ display: none !important;
24
+ }
25
+
20
26
  [part="field"] {
21
27
  display: grid;
22
28
  gap: 0.45rem;
@@ -10,6 +10,12 @@ const dateFieldStyles = `
10
10
  font: inherit;
11
11
  }
12
12
 
13
+ /* The host's own display would otherwise beat the UA rule for [hidden],
14
+ leaving the element on screen when a host hides it. */
15
+ :host([hidden]) {
16
+ display: none !important;
17
+ }
18
+
13
19
  [part="field"] {
14
20
  display: grid;
15
21
  gap: 0.45rem;
@@ -18,6 +18,12 @@ const dropdownStyles = `
18
18
  font: inherit;
19
19
  }
20
20
 
21
+ /* The host's own display would otherwise beat the UA rule for [hidden],
22
+ leaving the element on screen when a host hides it. */
23
+ :host([hidden]) {
24
+ display: none !important;
25
+ }
26
+
21
27
  [part="dropdown"] {
22
28
  position: relative;
23
29
  display: inline-block;
@@ -20,6 +20,12 @@ const dualListboxStyles = `
20
20
  font: inherit;
21
21
  }
22
22
 
23
+ /* The host's own display would otherwise beat the UA rule for [hidden],
24
+ leaving the element on screen when a host hides it. */
25
+ :host([hidden]) {
26
+ display: none !important;
27
+ }
28
+
23
29
  [part="field"] {
24
30
  margin: 0;
25
31
  padding: 0;
@@ -8,6 +8,12 @@ const fieldsetStyles = `
8
8
  font: inherit;
9
9
  }
10
10
 
11
+ /* The host's own display would otherwise beat the UA rule for [hidden],
12
+ leaving the element on screen when a host hides it. */
13
+ :host([hidden]) {
14
+ display: none !important;
15
+ }
16
+
11
17
  [part="fieldset"] {
12
18
  margin: 0;
13
19
  padding: 0;
@@ -16,6 +16,12 @@ const multiSelectStyles = `
16
16
  font: inherit;
17
17
  }
18
18
 
19
+ /* The host's own display would otherwise beat the UA rule for [hidden],
20
+ leaving the element on screen when a host hides it. */
21
+ :host([hidden]) {
22
+ display: none !important;
23
+ }
24
+
19
25
  [part="field"] {
20
26
  margin: 0;
21
27
  padding: 0;
@@ -17,6 +17,12 @@ const numberInputStyles = `
17
17
  font: inherit;
18
18
  }
19
19
 
20
+ /* The host's own display would otherwise beat the UA rule for [hidden],
21
+ leaving the element on screen when a host hides it. */
22
+ :host([hidden]) {
23
+ display: none !important;
24
+ }
25
+
20
26
  [part="field"] {
21
27
  display: grid;
22
28
  gap: 0.45rem;
@@ -14,6 +14,12 @@ const pillCloudStyles = `
14
14
  font: inherit;
15
15
  }
16
16
 
17
+ /* The host's own display would otherwise beat the UA rule for [hidden],
18
+ leaving the element on screen when a host hides it. */
19
+ :host([hidden]) {
20
+ display: none !important;
21
+ }
22
+
17
23
  [part="cloud"] {
18
24
  display: flex;
19
25
  flex-wrap: wrap;
@@ -14,6 +14,12 @@ const pillSelectorStyles = `
14
14
  font: inherit;
15
15
  }
16
16
 
17
+ /* The host's own display would otherwise beat the UA rule for [hidden],
18
+ leaving the element on screen when a host hides it. */
19
+ :host([hidden]) {
20
+ display: none !important;
21
+ }
22
+
17
23
  [part="field"] {
18
24
  display: flex;
19
25
  flex-wrap: wrap;
@@ -16,6 +16,12 @@ const radioGroupStyles = `
16
16
  font: inherit;
17
17
  }
18
18
 
19
+ /* The host's own display would otherwise beat the UA rule for [hidden],
20
+ leaving the element on screen when a host hides it. */
21
+ :host([hidden]) {
22
+ display: none !important;
23
+ }
24
+
19
25
  [part="group"] {
20
26
  margin: 0;
21
27
  padding: 0;
@@ -15,6 +15,12 @@ const rangeSliderStyles = `
15
15
  font: inherit;
16
16
  }
17
17
 
18
+ /* The host's own display would otherwise beat the UA rule for [hidden],
19
+ leaving the element on screen when a host hides it. */
20
+ :host([hidden]) {
21
+ display: none !important;
22
+ }
23
+
18
24
  [part="field"] {
19
25
  display: grid;
20
26
  gap: 0.45rem;
@@ -9,6 +9,12 @@ const ratingStyles = `
9
9
  font: inherit;
10
10
  }
11
11
 
12
+ /* The host's own display would otherwise beat the UA rule for [hidden],
13
+ leaving the element on screen when a host hides it. */
14
+ :host([hidden]) {
15
+ display: none !important;
16
+ }
17
+
12
18
  [part="field"] {
13
19
  display: grid;
14
20
  gap: 0.5rem;
@@ -92,6 +92,12 @@ const richTextStyles = `
92
92
  font: inherit;
93
93
  }
94
94
 
95
+ /* The host's own display would otherwise beat the UA rule for [hidden],
96
+ leaving the element on screen when a host hides it. */
97
+ :host([hidden]) {
98
+ display: none !important;
99
+ }
100
+
95
101
  [part="field"] {
96
102
  margin: 0;
97
103
  padding: 0;
@@ -10,6 +10,12 @@ const searchFieldStyles = `
10
10
  font: inherit;
11
11
  }
12
12
 
13
+ /* The host's own display would otherwise beat the UA rule for [hidden],
14
+ leaving the element on screen when a host hides it. */
15
+ :host([hidden]) {
16
+ display: none !important;
17
+ }
18
+
13
19
  [part="field"] {
14
20
  display: grid;
15
21
  gap: 0.45rem;
@@ -24,6 +24,12 @@ const selectStyles = `
24
24
  font: inherit;
25
25
  }
26
26
 
27
+ /* The host's own display would otherwise beat the UA rule for [hidden],
28
+ leaving the element on screen when a host hides it. */
29
+ :host([hidden]) {
30
+ display: none !important;
31
+ }
32
+
27
33
  [part="field"] {
28
34
  display: grid;
29
35
  gap: ${boeSpace[2]};
@@ -15,6 +15,12 @@ const sliderStyles = `
15
15
  font: inherit;
16
16
  }
17
17
 
18
+ /* The host's own display would otherwise beat the UA rule for [hidden],
19
+ leaving the element on screen when a host hides it. */
20
+ :host([hidden]) {
21
+ display: none !important;
22
+ }
23
+
18
24
  [part="field"] {
19
25
  display: grid;
20
26
  gap: 0.45rem;
@@ -16,6 +16,12 @@ const spinButtonStyles = `
16
16
  font: inherit;
17
17
  }
18
18
 
19
+ /* The host's own display would otherwise beat the UA rule for [hidden],
20
+ leaving the element on screen when a host hides it. */
21
+ :host([hidden]) {
22
+ display: none !important;
23
+ }
24
+
19
25
  [part="field"] {
20
26
  display: grid;
21
27
  gap: 0.45rem;
@@ -17,6 +17,12 @@ const switchStyles = `
17
17
  font: inherit;
18
18
  }
19
19
 
20
+ /* The host's own display would otherwise beat the UA rule for [hidden],
21
+ leaving the element on screen when a host hides it. */
22
+ :host([hidden]) {
23
+ display: none !important;
24
+ }
25
+
20
26
  [part="switch"] {
21
27
  appearance: none;
22
28
  border: none;
@@ -19,6 +19,12 @@ const tagInputStyles = `
19
19
  font: inherit;
20
20
  }
21
21
 
22
+ /* The host's own display would otherwise beat the UA rule for [hidden],
23
+ leaving the element on screen when a host hides it. */
24
+ :host([hidden]) {
25
+ display: none !important;
26
+ }
27
+
22
28
  [part="field"] {
23
29
  display: grid;
24
30
  gap: 0.45rem;
@@ -9,6 +9,12 @@ const textAreaStyles = `
9
9
  font: inherit;
10
10
  }
11
11
 
12
+ /* The host's own display would otherwise beat the UA rule for [hidden],
13
+ leaving the element on screen when a host hides it. */
14
+ :host([hidden]) {
15
+ display: none !important;
16
+ }
17
+
12
18
  [part="field"] {
13
19
  display: grid;
14
20
  gap: 0.45rem;
@@ -13,6 +13,12 @@ const textFieldStyles = `
13
13
  font: inherit;
14
14
  }
15
15
 
16
+ /* The host's own display would otherwise beat the UA rule for [hidden],
17
+ leaving the element on screen when a host hides it. */
18
+ :host([hidden]) {
19
+ display: none !important;
20
+ }
21
+
16
22
  [part="field"] {
17
23
  display: grid;
18
24
  gap: ${boeSpace[2]};
@@ -24,7 +24,7 @@ const tileStyles = `
24
24
  }
25
25
 
26
26
  :host([hidden]) {
27
- display: none;
27
+ display: none !important;
28
28
  }
29
29
 
30
30
  [part="group"] {
@@ -9,6 +9,12 @@ const timeFieldStyles = `
9
9
  font: inherit;
10
10
  }
11
11
 
12
+ /* The host's own display would otherwise beat the UA rule for [hidden],
13
+ leaving the element on screen when a host hides it. */
14
+ :host([hidden]) {
15
+ display: none !important;
16
+ }
17
+
12
18
  [part="field"] {
13
19
  display: grid;
14
20
  gap: 0.45rem;