@unofficialbox/box-open-elements 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -116,6 +116,7 @@ The docs index is at [docs/README.md](./docs/README.md). The most important entr
116
116
  - [Taxonomy](./docs/taxonomy.md)
117
117
  - [Architecture](./docs/architecture.md)
118
118
  - [API Guidelines](./docs/api-guidelines.md)
119
+ - [Using with React, Angular, Vue, and Svelte](./docs/integration/frameworks.md)
119
120
  - [Design Tokens](./docs/foundations/tokens.md)
120
121
  - [Content Explorer](./docs/patterns/content-explorer.md)
121
122
  - [Box Server Integration](./docs/integration/box-server.md)
@@ -17,6 +17,10 @@ const elementStyles = `
17
17
  display: block;
18
18
  color: inherit;
19
19
  font: inherit;
20
+ /* The table's header row is nowrap, so its min-content width is wide.
21
+ Without this the host refuses to shrink below that width and pushes
22
+ out of grid/flex containers instead of scrolling. */
23
+ min-width: 0;
20
24
  }
21
25
 
22
26
  [part="table-shell"] {
@@ -24,7 +28,10 @@ const elementStyles = `
24
28
  border-radius: ${boePanel.radius};
25
29
  background: var(--boe-token-surface-surface, #ffffff);
26
30
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
27
- overflow: hidden;
31
+ /* Scroll the table within its own frame when the host is narrower
32
+ than the table's intrinsic width. */
33
+ overflow-x: auto;
34
+ overflow-y: hidden;
28
35
  }
29
36
 
30
37
  [part="table-shell"][aria-busy="true"] {
@@ -13,6 +13,9 @@ const elementStyles = `
13
13
  display: block;
14
14
  color: inherit;
15
15
  font: inherit;
16
+ /* Let the host shrink below its controls' intrinsic width when a
17
+ container constrains it. */
18
+ min-width: 0;
16
19
  --_obp-surface: var(--boe-token-surface-surface, #ffffff);
17
20
  --_obp-surface-muted: var(--boe-token-surface-surface-secondary, #fbfbfb);
18
21
  --_obp-border: color-mix(in srgb, var(--boe-token-stroke-stroke, #e8e8e8) 82%, transparent);
@@ -38,9 +41,17 @@ const elementStyles = `
38
41
  text-transform: uppercase;
39
42
  }
40
43
 
44
+ /* Zero track floors, not fixed rem floors. The columns still size to
45
+ their content (so a shrink-to-fit host keeps the three-up layout at
46
+ its natural width) but can compress when a container constrains the
47
+ bar, instead of forcing the host wider than its container.
48
+ auto-fit was rejected: it collapses to one column whenever the host
49
+ is shrink-to-fit. A container query was too: container-type makes
50
+ the host's width independent of its content, which collapses the bar
51
+ anywhere it isn't explicitly stretched. */
41
52
  [part="controls"] {
42
53
  display: grid;
43
- grid-template-columns: minmax(14rem, 1.4fr) repeat(2, minmax(10rem, 0.8fr));
54
+ grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.8fr));
44
55
  gap: ${boePanel.gap};
45
56
  align-items: center;
46
57
  }
@@ -100,11 +111,6 @@ const elementStyles = `
100
111
  color: var(--_obp-brand);
101
112
  }
102
113
 
103
- @media (max-width: 900px) {
104
- [part="controls"] {
105
- grid-template-columns: 1fr;
106
- }
107
- }
108
114
  `;
109
115
  export class BoxFilterBarElement extends BaseElement {
110
116
  static get observedAttributes() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unofficialbox/box-open-elements",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Box Open Elements: an open, framework-agnostic design system and web component library for Box-style experiences",
5
5
  "license": "MIT",
6
6
  "homepage": "https://unofficialbox.github.io/box-open-elements",