@cloudscape-design/board-components 3.0.5 → 3.0.7

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.
@@ -1,7 +1,7 @@
1
1
  ## React components for Cloudscape Design System
2
2
 
3
3
  This package contains the source code of dashboard-oriented components in the [Cloudscape Design System](https://cloudscape.design/).
4
- For more information about board components, see [the documentation](todo).
4
+ For more information about board components, see [the documentation](https://cloudscape.design/components/board-components/).
5
5
 
6
6
  Cloudscape is an open source design system for building intuitive, engaging, and inclusive user experiences at scale. It consists of an extensive set of guidelines to create web applications, along with the design resources and front-end components to streamline implementation.
7
7
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ## React components for Cloudscape Design System
2
2
 
3
3
  This package contains the source code of dashboard-oriented components in the [Cloudscape Design System](https://cloudscape.design/).
4
- For more information about board components, see [the documentation](todo).
4
+ For more information about board components, see [the documentation](https://cloudscape.design/components/board-components/).
5
5
 
6
6
  Cloudscape is an open source design system for building intuitive, engaging, and inclusive user experiences at scale. It consists of an extensive set of guidelines to create web applications, along with the design resources and front-end components to streamline implementation.
7
7
 
package/board/internal.js CHANGED
@@ -156,7 +156,7 @@ export function InternalBoard({ items, renderItem, onItemsChange, empty, i18nStr
156
156
  const announcement = transitionAnnouncement
157
157
  ? announcementToString(transitionAnnouncement, items, i18nStrings, columns)
158
158
  : "";
159
- return (_jsxs("div", { ref: __internalRootRef, children: [_jsx(ScreenReaderGridNavigation, { items: items, itemsLayout: itemsLayout, ariaLabel: i18nStrings.navigationAriaLabel, ariaDescription: i18nStrings.navigationAriaDescription, itemAriaLabel: i18nStrings.navigationItemAriaLabel, onActivateItem: focusItem }), _jsx("div", { ref: containerRef, className: clsx(styles.root, { [styles.empty]: rows === 0 }), children: rows > 0 ? (_jsx(Grid, { columns: columns, rows: rows, layout: [...placeholdersLayout.items, ...itemsLayout.items], children: (gridContext) => {
159
+ return (_jsxs("div", { ref: __internalRootRef, children: [_jsx(ScreenReaderGridNavigation, { items: items, itemsLayout: itemsLayout, ariaLabel: i18nStrings.navigationAriaLabel, ariaDescription: i18nStrings.navigationAriaDescription, itemAriaLabel: i18nStrings.navigationItemAriaLabel, onActivateItem: focusItem }), _jsx("div", { ref: containerRef, className: clsx(styles.root, { [styles.empty]: rows === 0 }), children: rows > 0 ? (_jsx(Grid, { columns: columns, layout: [...placeholdersLayout.items, ...itemsLayout.items], children: (gridContext) => {
160
160
  var _a;
161
161
  const layoutShift = (_a = transition === null || transition === void 0 ? void 0 : transition.layoutShift) !== null && _a !== void 0 ? _a : removeTransition === null || removeTransition === void 0 ? void 0 : removeTransition.layoutShift;
162
162
  const transforms = layoutShift ? createTransforms(itemsLayout, layoutShift.moves, gridContext) : {};
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "board-components";
2
- export var PACKAGE_VERSION = "3.0.0 (167acfe9)";
2
+ export var PACKAGE_VERSION = "3.0.0 (280b452c)";
3
3
  export var THEME = "default";
4
4
  export var ALWAYS_VISUAL_REFRESH = false;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { GridProps } from "./interfaces";
3
- export default function Grid({ layout, children: render, columns, rows }: GridProps): JSX.Element;
3
+ export default function Grid({ layout, children: render, columns }: GridProps): JSX.Element;
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import { useContainerQuery } from "@cloudscape-design/component-toolkit";
5
+ import clsx from "clsx";
5
6
  import { Children } from "react";
6
7
  import { zipTwoArrays } from "../utils/zip-arrays";
7
8
  import GridItem from "./item";
@@ -10,7 +11,7 @@ import styles from "./styles.css.js";
10
11
  const GRID_GAP = 16;
11
12
  /* Matches grid-auto-rows in CSS. */
12
13
  const ROWSPAN_HEIGHT = 100;
13
- export default function Grid({ layout, children: render, columns, rows }) {
14
+ export default function Grid({ layout, children: render, columns }) {
14
15
  const [gridWidth, containerQueryRef] = useContainerQuery((entry) => entry.contentBoxWidth, []);
15
16
  // The below getters translate relative grid units into size/offset values in pixels.
16
17
  const getWidth = (colspan) => {
@@ -24,5 +25,5 @@ export default function Grid({ layout, children: render, columns, rows }) {
24
25
  const gridContext = { getWidth, getHeight, getColOffset, getRowOffset };
25
26
  const children = render === null || render === void 0 ? void 0 : render(gridContext);
26
27
  const zipped = zipTwoArrays(layout, Children.toArray(children));
27
- return (_jsx("div", { ref: containerQueryRef, "data-columns": columns, "data-rows": rows, className: styles.grid, children: zipped.map(([item, children]) => (_jsx(GridItem, { item: item, children: children }, item.id))) }));
28
+ return (_jsx("div", { ref: containerQueryRef, className: clsx(styles.grid, styles[`columns-${columns}`]), children: zipped.map(([item, children]) => (_jsx(GridItem, { item: item, children: children }, item.id))) }));
28
29
  }
@@ -3,7 +3,6 @@ import { GridLayoutItem } from "../interfaces";
3
3
  export interface GridProps {
4
4
  layout: GridLayoutItem[];
5
5
  columns: number;
6
- rows: number;
7
6
  children?: (context: GridContext) => ReactNode;
8
7
  }
9
8
  export interface GridContext {
@@ -5,6 +5,11 @@ import { memo } from "react";
5
5
  import styles from "./styles.css.js";
6
6
  const GridItem = ({ children, item }) => {
7
7
  // Grid row start can not be set as part of a CSS class names, since we have a potentially infinite height grid.
8
- return (_jsx("div", { "data-column-span": item.width, "data-row-span": item.height, "data-column-offset": item.x + 1, "data-row-offset": item.y + 1, className: styles.grid__item, style: { gridRowStart: item.y + 1, gridRowEnd: `span ${item.height}` }, children: children }));
8
+ return (_jsx("div", { className: styles.grid__item, style: {
9
+ gridRowStart: item.y + 1,
10
+ gridRowEnd: `span ${item.height}`,
11
+ gridColumnStart: item.x + 1,
12
+ gridColumnEnd: `span ${item.width}`,
13
+ }, children: children }));
9
14
  };
10
15
  export default memo(GridItem);
@@ -1,7 +1,11 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "grid": "awsui_grid_1hw7z_67wyf_1",
5
- "grid__item": "awsui_grid__item_1hw7z_67wyf_26"
4
+ "grid": "awsui_grid_1hw7z_yec0l_1",
5
+ "columns-1": "awsui_columns-1_1hw7z_yec0l_10",
6
+ "columns-2": "awsui_columns-2_1hw7z_yec0l_14",
7
+ "columns-4": "awsui_columns-4_1hw7z_yec0l_18",
8
+ "columns-6": "awsui_columns-6_1hw7z_yec0l_22",
9
+ "grid__item": "awsui_grid__item_1hw7z_yec0l_26"
6
10
  };
7
11
 
@@ -1,4 +1,4 @@
1
- .awsui_grid_1hw7z_67wyf_1:not(#\9) {
1
+ .awsui_grid_1hw7z_yec0l_1:not(#\9) {
2
2
  display: grid;
3
3
  /* Matches GRID_GAP constant used for calculations. */
4
4
  /* TODO: consider using different gaps for comfortable/compact which would require a mode observer. */
@@ -7,215 +7,23 @@
7
7
  grid-auto-rows: 100px;
8
8
  }
9
9
 
10
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"]:not(#\9) {
10
+ .awsui_grid_1hw7z_yec0l_1.awsui_columns-1_1hw7z_yec0l_10:not(#\9) {
11
11
  grid-template-columns: minmax(0, 1fr);
12
12
  }
13
13
 
14
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"]:not(#\9) {
14
+ .awsui_grid_1hw7z_yec0l_1.awsui_columns-2_1hw7z_yec0l_14:not(#\9) {
15
15
  grid-template-columns: repeat(2, minmax(0, 1fr));
16
16
  }
17
17
 
18
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"]:not(#\9) {
18
+ .awsui_grid_1hw7z_yec0l_1.awsui_columns-4_1hw7z_yec0l_18:not(#\9) {
19
19
  grid-template-columns: repeat(4, minmax(0, 1fr));
20
20
  }
21
21
 
22
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"]:not(#\9) {
22
+ .awsui_grid_1hw7z_yec0l_1.awsui_columns-6_1hw7z_yec0l_22:not(#\9) {
23
23
  grid-template-columns: repeat(6, minmax(0, 1fr));
24
24
  }
25
25
 
26
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="1"]:not(#\9) {
27
- grid-column-end: span 1;
28
- }
29
-
30
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="1"]:not(#\9) {
31
- grid-column-end: span 1;
32
- }
33
-
34
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="1"]:not(#\9) {
35
- grid-column-end: span 1;
36
- }
37
-
38
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="1"]:not(#\9) {
39
- grid-column-end: span 1;
40
- }
41
-
42
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="2"]:not(#\9) {
43
- grid-column-end: span 1;
44
- }
45
-
46
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="2"]:not(#\9) {
47
- grid-column-end: span 2;
48
- }
49
-
50
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="2"]:not(#\9) {
51
- grid-column-end: span 2;
52
- }
53
-
54
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="2"]:not(#\9) {
55
- grid-column-end: span 2;
56
- }
57
-
58
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="3"]:not(#\9) {
59
- grid-column-end: span 1;
60
- }
61
-
62
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="3"]:not(#\9) {
63
- grid-column-end: span 3;
64
- }
65
-
66
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="3"]:not(#\9) {
67
- grid-column-end: span 3;
68
- }
69
-
70
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="3"]:not(#\9) {
71
- grid-column-end: span 3;
72
- }
73
-
74
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="4"]:not(#\9) {
75
- grid-column-end: span 1;
76
- }
77
-
78
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="4"]:not(#\9) {
79
- grid-column-end: span 4;
80
- }
81
-
82
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="4"]:not(#\9) {
83
- grid-column-end: span 4;
84
- }
85
-
86
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="4"]:not(#\9) {
87
- grid-column-end: span 4;
88
- }
89
-
90
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="5"]:not(#\9) {
91
- grid-column-end: span 1;
92
- }
93
-
94
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="5"]:not(#\9) {
95
- grid-column-end: span 5;
96
- }
97
-
98
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="5"]:not(#\9) {
99
- grid-column-end: span 5;
100
- }
101
-
102
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="5"]:not(#\9) {
103
- grid-column-end: span 5;
104
- }
105
-
106
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="6"]:not(#\9) {
107
- grid-column-end: span 1;
108
- }
109
-
110
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="6"]:not(#\9) {
111
- grid-column-end: span 6;
112
- }
113
-
114
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="6"]:not(#\9) {
115
- grid-column-end: span 6;
116
- }
117
-
118
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-span="6"]:not(#\9) {
119
- grid-column-end: span 6;
120
- }
121
-
122
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="1"]:not(#\9) {
123
- grid-column-start: 1;
124
- }
125
-
126
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="1"]:not(#\9) {
127
- grid-column-start: 1;
128
- }
129
-
130
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="1"]:not(#\9) {
131
- grid-column-start: 1;
132
- }
133
-
134
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="1"]:not(#\9) {
135
- grid-column-start: 1;
136
- }
137
-
138
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="2"]:not(#\9) {
139
- grid-column-start: 1;
140
- }
141
-
142
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="2"]:not(#\9) {
143
- grid-column-start: 2;
144
- }
145
-
146
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="2"]:not(#\9) {
147
- grid-column-start: 2;
148
- }
149
-
150
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="2"]:not(#\9) {
151
- grid-column-start: 2;
152
- }
153
-
154
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="3"]:not(#\9) {
155
- grid-column-start: 1;
156
- }
157
-
158
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="3"]:not(#\9) {
159
- grid-column-start: 3;
160
- }
161
-
162
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="3"]:not(#\9) {
163
- grid-column-start: 3;
164
- }
165
-
166
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="3"]:not(#\9) {
167
- grid-column-start: 3;
168
- }
169
-
170
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="4"]:not(#\9) {
171
- grid-column-start: 1;
172
- }
173
-
174
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="4"]:not(#\9) {
175
- grid-column-start: 4;
176
- }
177
-
178
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="4"]:not(#\9) {
179
- grid-column-start: 4;
180
- }
181
-
182
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="4"]:not(#\9) {
183
- grid-column-start: 4;
184
- }
185
-
186
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="5"]:not(#\9) {
187
- grid-column-start: 1;
188
- }
189
-
190
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="5"]:not(#\9) {
191
- grid-column-start: 5;
192
- }
193
-
194
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="5"]:not(#\9) {
195
- grid-column-start: 5;
196
- }
197
-
198
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="5"]:not(#\9) {
199
- grid-column-start: 5;
200
- }
201
-
202
- .awsui_grid_1hw7z_67wyf_1[data-columns="1"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="6"]:not(#\9) {
203
- grid-column-start: 1;
204
- }
205
-
206
- .awsui_grid_1hw7z_67wyf_1[data-columns="2"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="6"]:not(#\9) {
207
- grid-column-start: 6;
208
- }
209
-
210
- .awsui_grid_1hw7z_67wyf_1[data-columns="4"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="6"]:not(#\9) {
211
- grid-column-start: 6;
212
- }
213
-
214
- .awsui_grid_1hw7z_67wyf_1[data-columns="6"] > .awsui_grid__item_1hw7z_67wyf_26[data-column-offset="6"]:not(#\9) {
215
- grid-column-start: 6;
216
- }
217
-
218
- .awsui_grid__item_1hw7z_67wyf_26:not(#\9) {
26
+ .awsui_grid__item_1hw7z_yec0l_26:not(#\9) {
219
27
  display: block;
220
28
  position: relative;
221
29
  }
@@ -2,7 +2,11 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "grid": "awsui_grid_1hw7z_67wyf_1",
6
- "grid__item": "awsui_grid__item_1hw7z_67wyf_26"
5
+ "grid": "awsui_grid_1hw7z_yec0l_1",
6
+ "columns-1": "awsui_columns-1_1hw7z_yec0l_10",
7
+ "columns-2": "awsui_columns-2_1hw7z_yec0l_14",
8
+ "columns-4": "awsui_columns-4_1hw7z_yec0l_18",
9
+ "columns-6": "awsui_columns-6_1hw7z_yec0l_22",
10
+ "grid__item": "awsui_grid__item_1hw7z_yec0l_26"
7
11
  };
8
12
 
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "167acfe902f7261d5eccec460314c81c702f07a7"
2
+ "commit": "280b452c4e3e2e483d7f06f42b42639f89848327"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/board-components",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/board-components.git"