@ndlib/component-library 0.0.104 → 0.0.106

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.
@@ -24,9 +24,16 @@ export type StructuredDataProps = {
24
24
  };
25
25
  }[];
26
26
  news?: {
27
+ shortDescription: any;
27
28
  title: string;
28
29
  author: string;
29
- shortDescription: string;
30
+ abstract?: {
31
+ shortDescription?: {
32
+ data?: {
33
+ shortDescription: string;
34
+ };
35
+ };
36
+ };
30
37
  image?: {
31
38
  url: string;
32
39
  };
@@ -39,12 +39,12 @@ export const getStructuredDataSchemas = ({ title, pathname, description, nofollo
39
39
  }));
40
40
  });
41
41
  news === null || news === void 0 ? void 0 : news.map((article) => {
42
- var _a;
42
+ var _a, _b, _c;
43
43
  schemas.push(stringifyNewsSchema({
44
44
  title: article === null || article === void 0 ? void 0 : article.title,
45
- abstract: article === null || article === void 0 ? void 0 : article.shortDescription,
45
+ abstract: (_b = (_a = article === null || article === void 0 ? void 0 : article.shortDescription) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.shortDescription,
46
46
  author: article === null || article === void 0 ? void 0 : article.author,
47
- image: (_a = article === null || article === void 0 ? void 0 : article.image) === null || _a === void 0 ? void 0 : _a.url,
47
+ image: (_c = article === null || article === void 0 ? void 0 : article.image) === null || _c === void 0 ? void 0 : _c.url,
48
48
  url: article === null || article === void 0 ? void 0 : article.slug,
49
49
  publishedDate: article === null || article === void 0 ? void 0 : article.publishedDate,
50
50
  siteUrl: siteUrl,
@@ -4,3 +4,4 @@ declare const meta: Meta<typeof Alerts>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Alerts>;
6
6
  export declare const Default: Story;
7
+ export declare const CustomizeAlertStyles: Story;
@@ -10,3 +10,6 @@ export default meta;
10
10
  export const Default = {
11
11
  render: () => (_jsx(AlertsProvider, Object.assign({ startTime: new Date('2022-01-01').toISOString(), endTime: new Date('2022-01-01').toISOString(), endpoint: "http://localhost:1337/graphql" }, { children: _jsx(Alerts, {}) }))),
12
12
  };
13
+ export const CustomizeAlertStyles = {
14
+ render: () => (_jsx(AlertsProvider, Object.assign({ startTime: new Date('2022-01-01').toISOString(), endTime: new Date('2022-01-01').toISOString(), endpoint: "http://localhost:1337/graphql" }, { children: _jsx(Alerts, { alertStyles: { borderRadius: '0px' } }) }))),
15
+ };
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { ALERT_TYPE } from '../../providers/alerts';
3
- import { StyledElementProps } from '../../../theme';
3
+ import { StyledElementProps, StylesProp } from '../../../theme';
4
4
  type AlertsProps = StyledElementProps<HTMLDivElement, {
5
5
  pageAlerts?: string[];
6
+ alertStyles?: StylesProp;
6
7
  }>;
7
8
  export declare const Alerts: React.FC<AlertsProps>;
8
9
  type AlertProps = StyledElementProps<HTMLDivElement, {
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
9
9
  }
10
10
  return t;
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import _WarningIcon from '@mui/icons-material/Warning';
14
14
  import _InfoIcon from '@mui/icons-material/Info';
15
15
  import _SuccessIcon from '@mui/icons-material/CheckCircle';
@@ -22,17 +22,16 @@ import { useAlerts, ALERT_TYPE } from '../../providers/alerts';
22
22
  import { useTheme } from '../../../theme';
23
23
  import { BUTTON_TYPE, Button } from '../Button';
24
24
  import { importedDefaultComponentShim } from '../../../utils/misc';
25
+ import { Box } from '../layout/Box';
25
26
  const WarningIcon = importedDefaultComponentShim(_WarningIcon);
26
27
  const InfoIcon = importedDefaultComponentShim(_InfoIcon);
27
28
  const SuccessIcon = importedDefaultComponentShim(_SuccessIcon);
28
29
  export const Alerts = (_a) => {
29
- var { pageAlerts } = _a, rest = __rest(_a, ["pageAlerts"]);
30
+ var { pageAlerts, alertStyles } = _a, rest = __rest(_a, ["pageAlerts", "alertStyles"]);
30
31
  const { alerts, dismiss } = useAlerts(pageAlerts);
31
- return (_jsx("div", Object.assign({}, rest, { children: alerts.map((alert, i) => {
32
+ return (_jsx(Box, Object.assign({}, rest, { children: alerts.map((alert, i) => {
32
33
  const { type, description } = alert;
33
- return (_jsx(Alert, { type: type, description: description, css: {
34
- marginTop: i ? '4px' : 0,
35
- }, dismiss: () => {
34
+ return (_jsx(Alert, { type: type, description: description, sx: Object.assign({ mt: i ? '4px' : 0 }, alertStyles), dismiss: () => {
36
35
  dismiss(alert.uuid);
37
36
  } }, i));
38
37
  }) })));
@@ -44,7 +43,6 @@ export const Alert = (_a) => {
44
43
  backgroundColor: COLOR.ALERT_INFORMATIONAL_BG,
45
44
  boxShadow: theme.boxShadow.NORMAL,
46
45
  border: '2px solid',
47
- borderRadius: '4px',
48
46
  borderColor: COLOR.ALERT_INFORMATIONAL_BORDER,
49
47
  m: 0,
50
48
  p: '1rem',
@@ -73,9 +71,5 @@ export const Alert = (_a) => {
73
71
  pl: '.5rem',
74
72
  pr: '.5rem',
75
73
  width: '100%',
76
- '@media screen and (min-width: 1212px)': {
77
- maxWidth: '1200px',
78
- padding: '0',
79
- },
80
74
  } }, { children: [icon && _jsx(Icon, { icon: icon, sx: { mr: 4 }, size: FONT_SIZE.LG }), _jsx(Row, Object.assign({ sx: { flexGrow: 1, justifyContent: 'center' } }, { children: _jsx(Markdown, { content: description }) })), _jsx(Button, Object.assign({ type: BUTTON_TYPE.TEXT, onClick: dismiss, sx: { ml: 4 } }, { children: "Dismiss" }))] })) })));
81
75
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndlib/component-library",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [