@ndlib/component-library 1.0.46 → 1.0.48

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.
@@ -0,0 +1,10 @@
1
+ .columnWrapper {
2
+ width: 100%;
3
+ align-items: center;
4
+ justify-content: center;
5
+ }
6
+
7
+ .paragraph {
8
+ color: var(--gray);
9
+ margin-top: 0 !important;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { EmptyStateV2 } from '.';
3
+ declare const meta: Meta<typeof EmptyStateV2>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof EmptyStateV2>;
6
+ export declare const Default: Story;
7
+ export declare const Small: Story;
8
+ export declare const CustomMessage: Story;
9
+ export declare const JsxMessage: Story;
10
+ export declare const CustomIcon: Story;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { EMPTY_STATEV2_SIZE, EmptyStateV2 } from '.';
3
+ import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
4
+ import NotInterestedIcon from '@mui/icons-material/NotInterested';
5
+ import { Link } from '../../elements/Link';
6
+ import { FONT_SIZE } from '../../../theme/typography';
7
+ const meta = {
8
+ title: 'Composites/EmptyStateV2',
9
+ component: EmptyStateV2,
10
+ tags: ['autodocs'],
11
+ decorators: [UIVersion2],
12
+ };
13
+ export default meta;
14
+ export const Default = {
15
+ render: () => _jsx(EmptyStateV2, {}),
16
+ args: {},
17
+ };
18
+ export const Small = {
19
+ render: () => _jsx(EmptyStateV2, { size: EMPTY_STATEV2_SIZE.SM }),
20
+ args: {},
21
+ };
22
+ export const CustomMessage = {
23
+ render: () => _jsx(EmptyStateV2, { children: "Custom message" }),
24
+ args: {},
25
+ };
26
+ export const JsxMessage = {
27
+ render: () => (_jsxs(EmptyStateV2, { children: ["Something is wrong.", ' ', _jsx(Link, { to: "/", sx: { fontSize: FONT_SIZE.MD, fontFamily: 'inherit' }, children: "Click here to fix." })] })),
28
+ args: {},
29
+ };
30
+ export const CustomIcon = {
31
+ render: () => _jsx(EmptyStateV2, { message: "Custom icon", icon: NotInterestedIcon }),
32
+ args: {},
33
+ };
@@ -0,0 +1,15 @@
1
+ import { StyledElementPropsV2 } from '../../../theme';
2
+ import React from 'react';
3
+ export declare enum EMPTY_STATEV2_SIZE {
4
+ SM = "SM",
5
+ LG = "LG"
6
+ }
7
+ type EmptyStateV2Props = StyledElementPropsV2<HTMLDivElement, {
8
+ icon?: React.FC;
9
+ omitIcon?: boolean;
10
+ size?: EMPTY_STATEV2_SIZE;
11
+ message?: string;
12
+ }>;
13
+ export declare const DEFAULT_MESSAGEV2 = "No results found.";
14
+ export declare const EmptyStateV2: React.FC<EmptyStateV2Props>;
15
+ export {};
@@ -0,0 +1,36 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import _SearchOffIcon from '@mui/icons-material/SearchOff';
14
+ import { RowV2 } from '../../elements/RowV2';
15
+ import { ColumnV2 } from '../../elements/ColumnV2';
16
+ import { PARAGRAPHV2_SIZE, ParagraphV2 } from '../../elements/ParagraphV2';
17
+ import { COLOR } from '../../../theme/colors';
18
+ import { IconV2 } from '../../elements/IconV2';
19
+ import { FONT_SIZE } from '../../../theme/typography';
20
+ import { importedDefaultComponentShim } from '../../../utils/misc';
21
+ import * as styles from './EmptyStateV2.module.css';
22
+ const typeSafeStyles = styles;
23
+ const SearchOffIcon = importedDefaultComponentShim(_SearchOffIcon);
24
+ export var EMPTY_STATEV2_SIZE;
25
+ (function (EMPTY_STATEV2_SIZE) {
26
+ EMPTY_STATEV2_SIZE["SM"] = "SM";
27
+ EMPTY_STATEV2_SIZE["LG"] = "LG";
28
+ })(EMPTY_STATEV2_SIZE || (EMPTY_STATEV2_SIZE = {}));
29
+ export const DEFAULT_MESSAGEV2 = 'No results found.';
30
+ export const EmptyStateV2 = (_a) => {
31
+ var { omitIcon, icon, children, size: sizeProp, sx } = _a, rest = __rest(_a, ["omitIcon", "icon", "children", "size", "sx"]);
32
+ const size = sizeProp || EMPTY_STATEV2_SIZE.LG;
33
+ return (_jsxs(ColumnV2, Object.assign({ sx: Object.assign({ mt: size === EMPTY_STATEV2_SIZE.SM ? 3 : 5 }, sx), className: typeSafeStyles.columnWrapper }, rest, { children: [_jsx(RowV2, { children: omitIcon ? null : (_jsx(IconV2, { icon: icon || SearchOffIcon, size: size === EMPTY_STATEV2_SIZE.SM ? FONT_SIZE.ML : FONT_SIZE.XL, color: COLOR.GRAY })) }), _jsx(RowV2, { sx: { mt: size === EMPTY_STATEV2_SIZE.SM ? 0 : 1 }, children: _jsx(ParagraphV2, { size: size === EMPTY_STATEV2_SIZE.SM
34
+ ? PARAGRAPHV2_SIZE.MD
35
+ : PARAGRAPHV2_SIZE.LG, className: typeSafeStyles.paragraph, children: children || DEFAULT_MESSAGEV2 }) })] })));
36
+ };
@@ -72,7 +72,7 @@ export const ListV2 = ({ sx, size: sizeParam, ordered, icon, iconSize: iconSizeP
72
72
  const size = sizeParam || parentSize || LISTV2_SIZE.MD;
73
73
  const iconSize = iconSizeParam || parentIconSize || iconSizeMap[size];
74
74
  const iconColor = iconColorParam || parentIconColor || COLOR.TEXT;
75
- const processedStyles = processSx(Object.assign(Object.assign({}, defaultStyles), sx));
75
+ const processedStyles = processSx(Object.assign(Object.assign({}, sx), defaultStyles));
76
76
  return (_jsx(ListConfigContext.Provider, { value: {
77
77
  size,
78
78
  icon: icon || defaultIcon,
package/dist/index.d.ts CHANGED
@@ -69,6 +69,7 @@ export { SnackBar } from './components/composites/SnackBar';
69
69
  export { NavMenu } from './components/composites/NavMenu';
70
70
  export { NavMenuV2 } from './components/composites/NavMenuV2';
71
71
  export { EmptyState, EMPTY_STATE_SIZE, } from './components/composites/EmptyState';
72
+ export { EmptyStateV2, EMPTY_STATEV2_SIZE, } from './components/composites/EmptyStateV2';
72
73
  export { DropdownLinks } from './components/composites/DropdownLinks';
73
74
  export { DropdownLinksV2 } from './components/composites/DropdownLinksV2';
74
75
  export { Modal } from './components/composites/Modal';
package/dist/index.js CHANGED
@@ -68,6 +68,7 @@ export { SnackBar } from './components/composites/SnackBar';
68
68
  export { NavMenu } from './components/composites/NavMenu';
69
69
  export { NavMenuV2 } from './components/composites/NavMenuV2';
70
70
  export { EmptyState, EMPTY_STATE_SIZE, } from './components/composites/EmptyState';
71
+ export { EmptyStateV2, EMPTY_STATEV2_SIZE, } from './components/composites/EmptyStateV2';
71
72
  export { DropdownLinks } from './components/composites/DropdownLinks';
72
73
  export { DropdownLinksV2 } from './components/composites/DropdownLinksV2';
73
74
  export { Modal } from './components/composites/Modal';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndlib/component-library",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [