@equinor/cpl-error-snackbar-react 0.0.4 → 0.0.6

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/dist/index.d.mts CHANGED
@@ -132,7 +132,7 @@ interface ErrorSnackbarsFixedListProps {
132
132
  removeErrorSnackbarObjectById: (errorSnackbarId: string) => void;
133
133
  }
134
134
  declare const ERROR_SNACKBARS_FIXED_LIST_TESTID = "error-snackbars-fixed-wrapper";
135
- declare function ErrorSnackbarFixedList({ disablePositionFixed, errorSnackbarObjects, removeErrorSnackbarObjectById, }: ErrorSnackbarsFixedListProps): react_jsx_runtime.JSX.Element;
135
+ declare function ErrorSnackbarFixedList({ disablePositionFixed, errorSnackbarObjects, removeErrorSnackbarObjectById, }: ErrorSnackbarsFixedListProps): react_jsx_runtime.JSX.Element | null;
136
136
 
137
137
  interface ErrorSnackbarsContainerProps {
138
138
  /**
package/dist/index.d.ts CHANGED
@@ -132,7 +132,7 @@ interface ErrorSnackbarsFixedListProps {
132
132
  removeErrorSnackbarObjectById: (errorSnackbarId: string) => void;
133
133
  }
134
134
  declare const ERROR_SNACKBARS_FIXED_LIST_TESTID = "error-snackbars-fixed-wrapper";
135
- declare function ErrorSnackbarFixedList({ disablePositionFixed, errorSnackbarObjects, removeErrorSnackbarObjectById, }: ErrorSnackbarsFixedListProps): react_jsx_runtime.JSX.Element;
135
+ declare function ErrorSnackbarFixedList({ disablePositionFixed, errorSnackbarObjects, removeErrorSnackbarObjectById, }: ErrorSnackbarsFixedListProps): react_jsx_runtime.JSX.Element | null;
136
136
 
137
137
  interface ErrorSnackbarsContainerProps {
138
138
  /**
package/dist/index.js CHANGED
@@ -182,11 +182,13 @@ var MainColumn = import_styled_components2.default.div`
182
182
  gap: 1rem;
183
183
  `;
184
184
  var HeaderWrapper = import_styled_components2.default.div`
185
+ flex: 1;
185
186
  display: flex;
186
187
  justify-content: space-between;
187
188
  `;
188
189
  var BodyTypography = (0, import_styled_components2.default)(import_eds_core_react2.Typography)`
189
190
  font-size: 0.857rem; // 14px
191
+ word-break: break-word;
190
192
  `;
191
193
  var MetadataWrapper = import_styled_components2.default.div`
192
194
  display: flex;
@@ -278,6 +280,9 @@ function ErrorSnackbarFixedList({
278
280
  errorSnackbarObjects,
279
281
  removeErrorSnackbarObjectById
280
282
  }) {
283
+ if (errorSnackbarObjects.length === 0) {
284
+ return null;
285
+ }
281
286
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FixedWrapper, { $disablePositionFixed: disablePositionFixed, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SnackbarList, { "data-testid": ERROR_SNACKBARS_FIXED_LIST_TESTID, children: errorSnackbarObjects.map((errorSnackbarObject) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
282
287
  ErrorSnackbar,
283
288
  {
package/dist/index.mjs CHANGED
@@ -139,11 +139,13 @@ var MainColumn = styled2.div`
139
139
  gap: 1rem;
140
140
  `;
141
141
  var HeaderWrapper = styled2.div`
142
+ flex: 1;
142
143
  display: flex;
143
144
  justify-content: space-between;
144
145
  `;
145
146
  var BodyTypography = styled2(Typography)`
146
147
  font-size: 0.857rem; // 14px
148
+ word-break: break-word;
147
149
  `;
148
150
  var MetadataWrapper = styled2.div`
149
151
  display: flex;
@@ -235,6 +237,9 @@ function ErrorSnackbarFixedList({
235
237
  errorSnackbarObjects,
236
238
  removeErrorSnackbarObjectById
237
239
  }) {
240
+ if (errorSnackbarObjects.length === 0) {
241
+ return null;
242
+ }
238
243
  return /* @__PURE__ */ jsx4(FixedWrapper, { $disablePositionFixed: disablePositionFixed, children: /* @__PURE__ */ jsx4(SnackbarList, { "data-testid": ERROR_SNACKBARS_FIXED_LIST_TESTID, children: errorSnackbarObjects.map((errorSnackbarObject) => /* @__PURE__ */ jsx4("li", { children: /* @__PURE__ */ jsx4(
239
244
  ErrorSnackbar,
240
245
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/cpl-error-snackbar-react",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -13,7 +13,7 @@
13
13
  "@equinor/eds-tokens": "^0.9.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@equinor/eds-core-react": "^0.40.0",
16
+ "@equinor/eds-core-react": "^0.42.1",
17
17
  "@storybook/react": "^8.1.11",
18
18
  "@storybook/test": "^8.1.11",
19
19
  "@types/react": "^18.3.3",
@@ -28,7 +28,7 @@
28
28
  "tsconfig": "0.0.1"
29
29
  },
30
30
  "peerDependencies": {
31
- "@equinor/eds-core-react": ">=0.35.1",
31
+ "@equinor/eds-core-react": ">=0.42.1",
32
32
  "react": ">=18.2.0",
33
33
  "react-dom": ">=18.2.0",
34
34
  "styled-components": ">=5.3.11"