@cuvp1225/tango-mail
Version:
react mail components for tango
35 lines (34 loc) • 1.33 kB
JavaScript
import { __rest } from "tslib";
import { defineComponent } from '@music163/tango-boot';
import React from 'react';
import cx from 'classnames';
import { Placeholder } from '../placeholder';
export function ListView(_a) {
var { marker = 'disc', children, style, className } = _a, props = __rest(_a, ["marker", "children", "style", "className"]);
const classNames = cx('m-0 p-0 list-inside text-slate-900', {
'list-none': marker === 'none',
'list-disc': marker === 'disc',
}, className);
return (React.createElement("ul", Object.assign({}, props, { className: classNames, style: listStyle(style) }), children));
}
const listStyle = (style) => {
return Object.assign({}, style);
};
export const List = defineComponent(ListView, {
name: 'List',
designerConfig: {
defaultProps: {
children: React.createElement(Placeholder, null),
},
},
});
export function ListItemView(_a) {
var { text, children, style } = _a, props = __rest(_a, ["text", "children", "style"]);
return (React.createElement("li", Object.assign({}, props, { style: listItemStyle(style) }), text || children));
}
const listItemStyle = (style) => {
return Object.assign({ marginBottom: 8 }, style);
};
export const ListItem = defineComponent(ListItemView, {
name: 'ListItem',
});