@ceed/ads 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
@@ -323,10 +323,20 @@ var MotionAlert = (0, import_joy4.styled)((0, import_framer_motion3.motion)(impo
323
323
  alignItems: "flex-start",
324
324
  fontWeight: "unset"
325
325
  });
326
+ var titleLevelMapping = {
327
+ sm: "title-sm",
328
+ md: "title-md",
329
+ lg: "title-lg"
330
+ };
331
+ var contentLevelMapping = {
332
+ sm: "body-xs",
333
+ md: "body-sm",
334
+ lg: "body-md"
335
+ };
326
336
  function Alert(props) {
327
- const { title, content, actions, color = "primary", ...innerProps } = props;
337
+ const { title, content, actions, color = "primary", size = "md", ...innerProps } = props;
328
338
  const invertedColors = props.invertedColors || props.variant === "solid";
329
- 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)));
339
+ 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)));
330
340
  }
331
341
  Alert.displayName = "Alert";
332
342
 
package/dist/index.js CHANGED
@@ -219,10 +219,20 @@ var MotionAlert = styled(motion3(JoyAlert))({
219
219
  alignItems: "flex-start",
220
220
  fontWeight: "unset"
221
221
  });
222
+ var titleLevelMapping = {
223
+ sm: "title-sm",
224
+ md: "title-md",
225
+ lg: "title-lg"
226
+ };
227
+ var contentLevelMapping = {
228
+ sm: "body-xs",
229
+ md: "body-sm",
230
+ lg: "body-md"
231
+ };
222
232
  function Alert(props) {
223
- const { title, content, actions, color = "primary", ...innerProps } = props;
233
+ const { title, content, actions, color = "primary", size = "md", ...innerProps } = props;
224
234
  const invertedColors = props.invertedColors || props.variant === "solid";
225
- 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)));
235
+ 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)));
226
236
  }
227
237
  Alert.displayName = "Alert";
228
238