@yuntijs/ui 1.0.0-beta.10 → 1.0.0-beta.12

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,14 @@
1
+ import { Descriptions as AntdDescriptions, type DescriptionsProps as AntdDescriptionsProps } from 'antd';
2
+ import React from 'react';
3
+ export interface CustomDescriptionsProps {
4
+ borderedBottom?: boolean;
5
+ borderedBottomDashed?: boolean;
6
+ borderedTop?: boolean;
7
+ borderedTopDashed?: boolean;
8
+ }
9
+ export interface DescriptionsProps extends AntdDescriptionsProps, CustomDescriptionsProps {
10
+ }
11
+ export declare const Descriptions: React.FC<DescriptionsProps> & {
12
+ Item: typeof AntdDescriptions.Item;
13
+ };
14
+ export default Descriptions;
@@ -0,0 +1,31 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["className", "borderedBottom", "borderedBottomDashed", "borderedTop", "borderedTopDashed"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { Descriptions as AntdDescriptions } from 'antd';
7
+ import React from 'react';
8
+ import { useStyles } from "./style";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ export var Descriptions = function Descriptions(props) {
11
+ var className = props.className,
12
+ borderedBottom = props.borderedBottom,
13
+ borderedBottomDashed = props.borderedBottomDashed,
14
+ borderedTop = props.borderedTop,
15
+ borderedTopDashed = props.borderedTopDashed,
16
+ otherProps = _objectWithoutProperties(props, _excluded);
17
+ var _useStyles = useStyles({
18
+ borderedBottom: borderedBottom,
19
+ borderedBottomDashed: borderedBottomDashed,
20
+ borderedTop: borderedTop,
21
+ borderedTopDashed: borderedTopDashed,
22
+ size: otherProps.size
23
+ }),
24
+ styles = _useStyles.styles,
25
+ cx = _useStyles.cx;
26
+ return /*#__PURE__*/_jsx(AntdDescriptions, _objectSpread(_objectSpread({}, otherProps), {}, {
27
+ className: cx(styles.custom, className)
28
+ }));
29
+ };
30
+ export default Descriptions;
31
+ Descriptions.Item = AntdDescriptions.Item;
@@ -0,0 +1,4 @@
1
+ import { DescriptionsProps } from './index';
2
+ export declare const useStyles: (props?: DescriptionsProps | undefined) => import("antd-style").ReturnStyles<{
3
+ custom: import("antd-style").SerializedStyles;
4
+ }>;
@@ -0,0 +1,24 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
3
+ import { createStyles } from 'antd-style';
4
+ export var useStyles = createStyles(function (_ref, _ref2) {
5
+ var css = _ref.css,
6
+ token = _ref.token,
7
+ prefixCls = _ref.prefixCls;
8
+ var borderedBottom = _ref2.borderedBottom,
9
+ borderedBottomDashed = _ref2.borderedBottomDashed,
10
+ borderedTop = _ref2.borderedTop,
11
+ borderedTopDashed = _ref2.borderedTopDashed,
12
+ size = _ref2.size;
13
+ var descriptionsContentPadding = {
14
+ small: "".concat(token.paddingXS, "px ").concat(token.padding, "px"),
15
+ middle: "".concat(token.padding, "px ").concat(token.paddingLG, "px"),
16
+ default: "".concat(token.paddingSM, "px ").concat(token.paddingLG, "px")
17
+ };
18
+ var hasCustomSizeStyle = borderedBottom || borderedBottomDashed;
19
+ return {
20
+ custom: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-descriptions-item-content {\n align-items: center !important;\n }\n .", "-descriptions-row > td {\n padding-top: 8px !important;\n padding-bottom: 8px !important;\n }\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), prefixCls, prefixCls, hasCustomSizeStyle && size && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", "-descriptions-item-label, .", "-descriptions-item-content {\n padding: ", ";\n }\n .", "-descriptions-item {\n padding-bottom: 0 !important;\n }\n table {\n border-spacing: 0 !important;\n }\n "])), prefixCls, prefixCls, descriptionsContentPadding[size], prefixCls), borderedBottom && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", "-descriptions-item {\n border-bottom: 1px solid ", ";\n }\n "])), prefixCls, token.colorSplit), borderedBottomDashed && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", "-descriptions-item {\n border-bottom: 1px dashed ", ";\n }\n "])), prefixCls, token.colorSplit), borderedTop && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", "-descriptions-item {\n border-top: 1px solid ", ";\n }\n "])), prefixCls, token.colorSplit), borderedTopDashed && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .", "-descriptions-item {\n border-top: 1px dashed ", ";\n }\n "])), prefixCls, token.colorSplit))
21
+ };
22
+ }, {
23
+ hashPriority: 'low'
24
+ });
@@ -0,0 +1,38 @@
1
+ import { type DividerProps as AntdDividerProps } from 'antd';
2
+ import React from 'react';
3
+ export interface CustomDividerProps {
4
+ /**
5
+ * @description type of the divider
6
+ * @default 'default'
7
+ */
8
+ mode?: 'expanded' | 'line' | 'default';
9
+ /**
10
+ * @description Default whether to expand. This parameter is available only when mode is expanded
11
+ * @default 'false'
12
+ */
13
+ defaultOpen?: boolean;
14
+ /**
15
+ * @description Expand content. This parameter is available only when mode is expanded
16
+ * @default '-'
17
+ */
18
+ content?: React.ReactNode;
19
+ /**
20
+ * @description The position of icon. This parameter is available only when mode is expanded and default
21
+ * @default 'left'
22
+ */
23
+ iconPlacement?: 'left' | 'right';
24
+ /**
25
+ * @description custom open icon. This parameter is available only when mode is expanded
26
+ * @default '-'
27
+ */
28
+ openIcon?: React.ReactNode;
29
+ /**
30
+ * @description custom close icon. This parameter is available only when mode is expanded
31
+ * @default '-'
32
+ */
33
+ closeIcon?: React.ReactNode;
34
+ }
35
+ export interface DividerProps extends AntdDividerProps, CustomDividerProps {
36
+ }
37
+ export declare const Divider: React.FC<DividerProps>;
38
+ export default Divider;
@@ -0,0 +1,59 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
+ var _excluded = ["mode", "content", "defaultOpen", "iconPlacement", "openIcon", "closeIcon"];
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons';
8
+ import { Divider as AntdDivider, Space } from 'antd';
9
+ import React, { useState } from 'react';
10
+ import { useStyles } from "./style";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ export var Divider = function Divider(props) {
15
+ var mode = props.mode,
16
+ content = props.content,
17
+ defaultOpen = props.defaultOpen,
18
+ iconPlacement = props.iconPlacement,
19
+ openIcon = props.openIcon,
20
+ closeIcon = props.closeIcon,
21
+ otherProps = _objectWithoutProperties(props, _excluded);
22
+ var _useStyles = useStyles({}),
23
+ styles = _useStyles.styles;
24
+ var canExpanded = mode === 'expanded';
25
+ var _useState = useState(defaultOpen),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ open = _useState2[0],
28
+ setOpen = _useState2[1];
29
+ var closeIconDom = closeIcon ? closeIcon : /*#__PURE__*/_jsx(MinusSquareOutlined, {});
30
+ var openIconDom = openIcon ? openIcon : /*#__PURE__*/_jsx(PlusSquareOutlined, {});
31
+ var iconDom = canExpanded && /*#__PURE__*/_jsx("span", {
32
+ children: open ? closeIconDom : openIconDom
33
+ });
34
+ if (mode === 'line') {
35
+ return /*#__PURE__*/_jsx(AntdDivider, _objectSpread({}, otherProps));
36
+ }
37
+ return /*#__PURE__*/_jsxs(_Fragment, {
38
+ children: [/*#__PURE__*/_jsx(AntdDivider, _objectSpread(_objectSpread({}, otherProps), {}, {
39
+ children: /*#__PURE__*/_jsx("span", {
40
+ className: canExpanded ? styles.custom : '',
41
+ onClick: function onClick() {
42
+ setOpen(!open);
43
+ },
44
+ children: /*#__PURE__*/_jsxs(Space, {
45
+ size: 6,
46
+ children: [iconPlacement !== 'right' && iconDom, /*#__PURE__*/_jsx("span", {
47
+ children: props.children
48
+ }), iconPlacement === 'right' && iconDom]
49
+ })
50
+ })
51
+ })), canExpanded && /*#__PURE__*/_jsx("div", {
52
+ style: {
53
+ display: open ? 'block' : 'none'
54
+ },
55
+ children: content
56
+ })]
57
+ });
58
+ };
59
+ export default Divider;
@@ -0,0 +1,3 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ custom: import("antd-style").SerializedStyles;
3
+ }>;
@@ -0,0 +1,12 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { createStyles } from 'antd-style';
4
+ export var useStyles = createStyles(function (_ref) {
5
+ var css = _ref.css,
6
+ token = _ref.token;
7
+ return {
8
+ custom: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n color: ", ";\n &:hover {\n color: ", ";\n }\n "])), token.colorPrimary, token.colorPrimaryHover)
9
+ };
10
+ }, {
11
+ hashPriority: 'low'
12
+ });
package/es/index.d.ts CHANGED
@@ -6,7 +6,11 @@ export * from './SliderInput';
6
6
  export * from './Tree';
7
7
  export * from './Alert';
8
8
  export * from './Card';
9
+ export * from './Descriptions';
10
+ export * from './Divider';
9
11
  export { Affix, type AffixProps, Anchor, type AnchorProps, App, type AppProps, AutoComplete, type AutoCompleteProps, Avatar, type AvatarProps, BackTop, type BackTopProps, Badge, // @todo composed type
10
12
  type BadgeProps, Button, // @todo dependence unifiedLink. link type, hover primary color, back button
11
- type ButtonProps, Calendar, type CalendarProps, Carousel, type CarouselProps, Checkbox, type CheckboxProps, ColorPicker, type ColorPickerProps, } from 'antd';
13
+ type ButtonProps, Calendar, type CalendarProps, Carousel, type CarouselProps, Cascader, type CascaderProps, Checkbox, type CheckboxProps, Col, Collapse, type CollapseProps, ColorPicker, type ColorPickerProps, type ColProps, // @todo center style
14
+ DatePicker, type DatePickerProps, } from 'antd';
15
+ export { Highlighter, type HighlighterProps, Markdown, type MarkdownProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from '@lobehub/ui';
12
16
  export { useResponsive, useTheme, useThemeMode } from 'antd-style';
package/es/index.js CHANGED
@@ -8,11 +8,18 @@ export * from "./Tree";
8
8
  // ~ custom antd
9
9
  export * from "./Alert";
10
10
  export * from "./Card";
11
+ export * from "./Descriptions";
12
+ export * from "./Divider";
11
13
 
12
14
  // ~ antd
13
15
  export { Affix, Anchor, App, AutoComplete, Avatar, BackTop, Badge // @todo composed type
14
16
  , Button // @todo dependence unifiedLink. link type, hover primary color, back button
15
- , Calendar, Carousel, Checkbox, ColorPicker } from 'antd';
17
+ , Calendar, Carousel, Cascader, Checkbox, Col, Collapse, ColorPicker,
18
+ // @todo center style
19
+ DatePicker } from 'antd';
20
+
21
+ // ~ @lobehub/ui
22
+ export { Highlighter, Markdown, SyntaxHighlighter } from '@lobehub/ui';
16
23
 
17
24
  // ~ antd-style
18
25
  export { useResponsive, useTheme, useThemeMode } from 'antd-style';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuntijs/ui",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
5
5
  "keywords": [
6
6
  "yuntijs",