@dt-dds/react-message 1.0.0-beta.89 → 1.0.0-beta.91

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @dt-ui/react-message
2
2
 
3
+ ## 1.0.0-beta.91
4
+
5
+ ### Minor Changes
6
+
7
+ - feat: add breakpoint to message
8
+
9
+ ### Patch Changes
10
+
11
+ - @dt-dds/react-button@1.0.0-beta.75
12
+
13
+ ## 1.0.0-beta.90
14
+
15
+ ### Patch Changes
16
+
17
+ - fix: set full width on message
18
+ - @dt-dds/react-button@1.0.0-beta.74
19
+
3
20
  ## 1.0.0-beta.89
4
21
 
5
22
  ### Minor Changes
package/README.md CHANGED
@@ -39,7 +39,7 @@ export const App = () => {
39
39
  | `title` | `string` | - | Optional Text to be presented as Title within the Message.Content, It should have text character count limit: 50. |
40
40
  | `description` | `string` | - | Text to be presented as Description within the Message.Content, It should have text character count limit: 230. |
41
41
  | `onClose` | `function` | - | When provided, a close button is displayed and, when clicked, it triggers this function. |
42
- | `orientation` | `Orientation` | `'horizontal'` | Sets the orientation of the message component. |
42
+ | `orientation` | `Orientation` | `'horizontal'` | Sets the orientation of the message component. On mobile the orientation is vertical |
43
43
 
44
44
  ### Message.Actions
45
45
 
package/dist/index.d.mts CHANGED
@@ -23,7 +23,7 @@ interface ActionsProps extends BaseProps {
23
23
  }
24
24
 
25
25
  declare const Message: {
26
- ({ children, dataTestId, style, type, onClose, description, title, orientation, }: MessageProps): react_jsx_runtime.JSX.Element;
26
+ ({ children, dataTestId, style, type, onClose, description, title, orientation: propOrientation, }: MessageProps): react_jsx_runtime.JSX.Element;
27
27
  Actions({ children, dataTestId, type }: ActionsProps): react_jsx_runtime.JSX.Element;
28
28
  };
29
29
 
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@ interface ActionsProps extends BaseProps {
23
23
  }
24
24
 
25
25
  declare const Message: {
26
- ({ children, dataTestId, style, type, onClose, description, title, orientation, }: MessageProps): react_jsx_runtime.JSX.Element;
26
+ ({ children, dataTestId, style, type, onClose, description, title, orientation: propOrientation, }: MessageProps): react_jsx_runtime.JSX.Element;
27
27
  Actions({ children, dataTestId, type }: ActionsProps): react_jsx_runtime.JSX.Element;
28
28
  };
29
29
 
package/dist/index.js CHANGED
@@ -110,6 +110,7 @@ module.exports = __toCommonJS(index_exports);
110
110
 
111
111
  // src/Message.tsx
112
112
  var import_react_box = __toESM(require_dist());
113
+ var import_react_core = require("@dt-dds/react-core");
113
114
  var import_react_icon = require("@dt-dds/react-icon");
114
115
  var import_react_typography = require("@dt-dds/react-typography");
115
116
  var import_react = require("@emotion/react");
@@ -136,6 +137,7 @@ var MESSAGE_ICONS = {
136
137
  var import_styled = __toESM(require("@emotion/styled"));
137
138
  var MessageStyled = import_styled.default.div`
138
139
  display: grid;
140
+ width: 100%;
139
141
  padding: ${({ theme }) => `${theme.spacing.spacing_40} ${theme.spacing.spacing_50}`};
140
142
  border-radius: ${({ theme }) => theme.shape.message};
141
143
 
@@ -232,10 +234,12 @@ var Message = ({
232
234
  onClose,
233
235
  description,
234
236
  title,
235
- orientation = "horizontal"
237
+ orientation: propOrientation = "horizontal"
236
238
  }) => {
237
239
  const theme = (0, import_react.useTheme)();
238
240
  const isDefault = type === OMessageType.Default;
241
+ const isMobile = (0, import_react_core.useMedia)(`(max-width: ${theme.breakpoints.mq2}px)`);
242
+ const orientation = isMobile ? "vertical" : propOrientation || "horizontal";
239
243
  const isHorizontal = orientation === "horizontal";
240
244
  const isDismissible = !!onClose;
241
245
  const textColor = isDefault ? "content.default" : `${type}.dark`;
@@ -276,10 +280,16 @@ var Message = ({
276
280
  alignItems: isHorizontal ? "center" : "start"
277
281
  },
278
282
  children: [
279
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_box.Box, { style: { alignItems: "flex-start" }, children: [
280
- title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_typography.Typography, { color: textColor, fontStyles: "bodyLgBold", children: title }) : null,
281
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_typography.Typography, { color: textColor, fontStyles: "bodyLgRegular", children: description })
282
- ] }),
283
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
284
+ import_react_box.Box,
285
+ {
286
+ style: { alignItems: "flex-start", gap: theme.spacing.spacing_10 },
287
+ children: [
288
+ title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_typography.Typography, { color: textColor, fontStyles: "bodyLgBold", children: title }) : null,
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_typography.Typography, { color: textColor, fontStyles: "bodyLgRegular", children: description })
290
+ ]
291
+ }
292
+ ),
283
293
  clonedChildren
284
294
  ]
285
295
  }
package/dist/index.mjs CHANGED
@@ -103,6 +103,7 @@ var require_dist = __commonJS({
103
103
 
104
104
  // src/Message.tsx
105
105
  var import_react_box = __toESM(require_dist());
106
+ import { useMedia } from "@dt-dds/react-core";
106
107
  import { Icon } from "@dt-dds/react-icon";
107
108
  import { Typography } from "@dt-dds/react-typography";
108
109
  import { useTheme } from "@emotion/react";
@@ -129,6 +130,7 @@ var MESSAGE_ICONS = {
129
130
  import styled from "@emotion/styled";
130
131
  var MessageStyled = styled.div`
131
132
  display: grid;
133
+ width: 100%;
132
134
  padding: ${({ theme }) => `${theme.spacing.spacing_40} ${theme.spacing.spacing_50}`};
133
135
  border-radius: ${({ theme }) => theme.shape.message};
134
136
 
@@ -225,10 +227,12 @@ var Message = ({
225
227
  onClose,
226
228
  description,
227
229
  title,
228
- orientation = "horizontal"
230
+ orientation: propOrientation = "horizontal"
229
231
  }) => {
230
232
  const theme = useTheme();
231
233
  const isDefault = type === OMessageType.Default;
234
+ const isMobile = useMedia(`(max-width: ${theme.breakpoints.mq2}px)`);
235
+ const orientation = isMobile ? "vertical" : propOrientation || "horizontal";
232
236
  const isHorizontal = orientation === "horizontal";
233
237
  const isDismissible = !!onClose;
234
238
  const textColor = isDefault ? "content.default" : `${type}.dark`;
@@ -269,10 +273,16 @@ var Message = ({
269
273
  alignItems: isHorizontal ? "center" : "start"
270
274
  },
271
275
  children: [
272
- /* @__PURE__ */ jsxs(import_react_box.Box, { style: { alignItems: "flex-start" }, children: [
273
- title ? /* @__PURE__ */ jsx(Typography, { color: textColor, fontStyles: "bodyLgBold", children: title }) : null,
274
- /* @__PURE__ */ jsx(Typography, { color: textColor, fontStyles: "bodyLgRegular", children: description })
275
- ] }),
276
+ /* @__PURE__ */ jsxs(
277
+ import_react_box.Box,
278
+ {
279
+ style: { alignItems: "flex-start", gap: theme.spacing.spacing_10 },
280
+ children: [
281
+ title ? /* @__PURE__ */ jsx(Typography, { color: textColor, fontStyles: "bodyLgBold", children: title }) : null,
282
+ /* @__PURE__ */ jsx(Typography, { color: textColor, fontStyles: "bodyLgRegular", children: description })
283
+ ]
284
+ }
285
+ ),
276
286
  clonedChildren
277
287
  ]
278
288
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-dds/react-message",
3
- "version": "1.0.0-beta.89",
3
+ "version": "1.0.0-beta.91",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js"
@@ -20,7 +20,7 @@
20
20
  "test:update:snapshot": "jest -u"
21
21
  },
22
22
  "dependencies": {
23
- "@dt-dds/react-button": "1.0.0-beta.73",
23
+ "@dt-dds/react-button": "1.0.0-beta.75",
24
24
  "@dt-dds/react-core": "1.0.0-beta.50",
25
25
  "@dt-dds/react-icon": "1.0.0-beta.51",
26
26
  "@dt-dds/react-typography": "1.0.0-beta.41",