@ceed/cds 1.11.0-next.1 → 1.11.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.
@@ -1,11 +1,20 @@
1
1
  import React from 'react';
2
2
  import { AlertProps } from '@mui/joy';
3
3
  import { MotionProps } from 'framer-motion';
4
- declare function Alert(props: {
4
+ declare const titleLevelMapping: {
5
+ readonly sm: "title-sm";
6
+ readonly md: "title-md";
7
+ readonly lg: "title-lg";
8
+ };
9
+ type AlertSize = keyof typeof titleLevelMapping;
10
+ interface CustomAlertProps {
5
11
  content: React.ReactNode;
6
12
  actions?: React.ReactNode;
7
13
  title?: string;
8
- } & AlertProps & MotionProps): React.JSX.Element;
14
+ size?: AlertSize;
15
+ }
16
+ type AlertComponentProps = CustomAlertProps & Omit<AlertProps, 'content' | 'actions' | 'title' | 'size'> & Omit<MotionProps, 'children'>;
17
+ declare function Alert(props: AlertComponentProps): React.JSX.Element;
9
18
  declare namespace Alert {
10
19
  var displayName: string;
11
20
  }
package/dist/index.cjs CHANGED
@@ -320,10 +320,20 @@ var MotionAlert = (0, import_joy4.styled)((0, import_framer_motion3.motion)(impo
320
320
  alignItems: "flex-start",
321
321
  fontWeight: "unset"
322
322
  });
323
+ var titleLevelMapping = {
324
+ sm: "title-sm",
325
+ md: "title-md",
326
+ lg: "title-lg"
327
+ };
328
+ var contentLevelMapping = {
329
+ sm: "body-xs",
330
+ md: "body-sm",
331
+ lg: "body-md"
332
+ };
323
333
  function Alert(props) {
324
- const { title, content, actions, color = "primary", ...innerProps } = props;
334
+ const { title, content, actions, color = "primary", size = "md", ...innerProps } = props;
325
335
  const invertedColors = props.invertedColors || props.variant === "solid";
326
- return /* @__PURE__ */ import_react3.default.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors }, /* @__PURE__ */ import_react3.default.createElement(Stack_default, null, title && /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content)));
336
+ return /* @__PURE__ */ import_react3.default.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors, size }, /* @__PURE__ */ import_react3.default.createElement(Stack_default, null, title && /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: titleLevelMapping[size], fontWeight: "bold", color }, title), /* @__PURE__ */ import_react3.default.createElement(Typography_default, { level: contentLevelMapping[size], fontWeight: 500, color }, content)));
327
337
  }
328
338
  Alert.displayName = "Alert";
329
339
 
package/dist/index.js CHANGED
@@ -224,10 +224,20 @@ var MotionAlert = styled(motion3(JoyAlert))({
224
224
  alignItems: "flex-start",
225
225
  fontWeight: "unset"
226
226
  });
227
+ var titleLevelMapping = {
228
+ sm: "title-sm",
229
+ md: "title-md",
230
+ lg: "title-lg"
231
+ };
232
+ var contentLevelMapping = {
233
+ sm: "body-xs",
234
+ md: "body-sm",
235
+ lg: "body-md"
236
+ };
227
237
  function Alert(props) {
228
- const { title, content, actions, color = "primary", ...innerProps } = props;
238
+ const { title, content, actions, color = "primary", size = "md", ...innerProps } = props;
229
239
  const invertedColors = props.invertedColors || props.variant === "solid";
230
- return /* @__PURE__ */ React3.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors }, /* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(Typography_default, { level: "title-md", fontWeight: "bold", color }, title), /* @__PURE__ */ React3.createElement(Typography_default, { level: "body-sm", fontWeight: 500, color }, content)));
240
+ return /* @__PURE__ */ React3.createElement(MotionAlert, { ...innerProps, color, endDecorator: actions, invertedColors, size }, /* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(Typography_default, { level: titleLevelMapping[size], fontWeight: "bold", color }, title), /* @__PURE__ */ React3.createElement(Typography_default, { level: contentLevelMapping[size], fontWeight: 500, color }, content)));
231
241
  }
232
242
  Alert.displayName = "Alert";
233
243