@unofficialbox/box-open-elements 0.1.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,9 +1,9 @@
1
1
  {
2
2
  "name": "@unofficialbox/box-open-elements",
3
- "version": "0.1.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
- "homepage": "https://components.unofficialbox.dev",
6
+ "homepage": "https://unofficialbox.github.io/box-open-elements",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/unofficialbox/box-open-elements.git"
@@ -1,2 +0,0 @@
1
- export { boeFontFamily, boeType, boeTypeStyles, boeTypographyHostDeclaration, } from "./tokens.js";
2
- export type { BoeTypeRole } from "./tokens.js";
@@ -1 +0,0 @@
1
- export { boeFontFamily, boeType, boeTypeStyles, boeTypographyHostDeclaration, } from "./tokens.js";
@@ -1,76 +0,0 @@
1
- /** Authoritative modern Box typography stack. Lato belongs to legacy BUE only. */
2
- export declare const boeFontFamily: {
3
- readonly base: "var(--boe-token-font-family-base, InterVariable, Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif)";
4
- readonly fallback: "InterVariable, Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif";
5
- };
6
- export interface BoeTypeRole {
7
- fontSize: string;
8
- fontWeight: 400 | 500 | 600 | 700;
9
- letterSpacing: string;
10
- lineHeight: string;
11
- }
12
- /** Product type roles derived from the current Box measurements in the visual reference contract. */
13
- export declare const boeType: {
14
- readonly pageHeading: {
15
- readonly fontSize: "21px";
16
- readonly lineHeight: "32px";
17
- readonly fontWeight: 700;
18
- readonly letterSpacing: "-0.01em";
19
- };
20
- readonly dialogHeading: {
21
- readonly fontSize: "19px";
22
- readonly lineHeight: "24px";
23
- readonly fontWeight: 700;
24
- readonly letterSpacing: "-0.005em";
25
- };
26
- readonly sectionHeading: {
27
- readonly fontSize: "16px";
28
- readonly lineHeight: "24px";
29
- readonly fontWeight: 700;
30
- readonly letterSpacing: "0";
31
- };
32
- readonly button: {
33
- readonly fontSize: "16px";
34
- readonly lineHeight: "24px";
35
- readonly fontWeight: 700;
36
- readonly letterSpacing: "0";
37
- };
38
- readonly menuItem: {
39
- readonly fontSize: "15px";
40
- readonly lineHeight: "20px";
41
- readonly fontWeight: 400;
42
- readonly letterSpacing: "0";
43
- };
44
- readonly body: {
45
- readonly fontSize: "14px";
46
- readonly lineHeight: "20px";
47
- readonly fontWeight: 400;
48
- readonly letterSpacing: "0";
49
- };
50
- readonly bodyStrong: {
51
- readonly fontSize: "14px";
52
- readonly lineHeight: "20px";
53
- readonly fontWeight: 600;
54
- readonly letterSpacing: "0";
55
- };
56
- readonly label: {
57
- readonly fontSize: "13px";
58
- readonly lineHeight: "20px";
59
- readonly fontWeight: 600;
60
- readonly letterSpacing: "0";
61
- };
62
- readonly metadata: {
63
- readonly fontSize: "12px";
64
- readonly lineHeight: "16px";
65
- readonly fontWeight: 400;
66
- readonly letterSpacing: "0";
67
- };
68
- readonly caption: {
69
- readonly fontSize: "11px";
70
- readonly lineHeight: "16px";
71
- readonly fontWeight: 600;
72
- readonly letterSpacing: "0";
73
- };
74
- };
75
- export declare const boeTypographyHostDeclaration: string;
76
- export declare const boeTypeStyles: (selector: string, role: BoeTypeRole) => string;
@@ -1,27 +0,0 @@
1
- /** Authoritative modern Box typography stack. Lato belongs to legacy BUE only. */
2
- export const boeFontFamily = {
3
- base: "var(--boe-token-font-family-base, InterVariable, Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif)",
4
- fallback: "InterVariable, Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif",
5
- };
6
- /** Product type roles derived from the current Box measurements in the visual reference contract. */
7
- export const boeType = {
8
- pageHeading: { fontSize: "21px", lineHeight: "32px", fontWeight: 700, letterSpacing: "-0.01em" },
9
- dialogHeading: { fontSize: "19px", lineHeight: "24px", fontWeight: 700, letterSpacing: "-0.005em" },
10
- sectionHeading: { fontSize: "16px", lineHeight: "24px", fontWeight: 700, letterSpacing: "0" },
11
- button: { fontSize: "16px", lineHeight: "24px", fontWeight: 700, letterSpacing: "0" },
12
- menuItem: { fontSize: "15px", lineHeight: "20px", fontWeight: 400, letterSpacing: "0" },
13
- body: { fontSize: "14px", lineHeight: "20px", fontWeight: 400, letterSpacing: "0" },
14
- bodyStrong: { fontSize: "14px", lineHeight: "20px", fontWeight: 600, letterSpacing: "0" },
15
- label: { fontSize: "13px", lineHeight: "20px", fontWeight: 600, letterSpacing: "0" },
16
- metadata: { fontSize: "12px", lineHeight: "16px", fontWeight: 400, letterSpacing: "0" },
17
- caption: { fontSize: "11px", lineHeight: "16px", fontWeight: 600, letterSpacing: "0" },
18
- };
19
- export const boeTypographyHostDeclaration = `font-family: ${boeFontFamily.base};`;
20
- export const boeTypeStyles = (selector, role) => `
21
- ${selector} {
22
- font-size: ${role.fontSize};
23
- line-height: ${role.lineHeight};
24
- font-weight: ${role.fontWeight};
25
- letter-spacing: ${role.letterSpacing};
26
- }
27
- `;