@yuntijs/ui 1.0.0-beta.87 → 1.0.0-beta.89

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,7 +0,0 @@
1
- import type { FC } from 'react';
2
- type OnBlurBlockProps = {
3
- onBlur?: () => void;
4
- onFocus?: () => void;
5
- };
6
- declare const OnBlurBlock: FC<OnBlurBlockProps>;
7
- export default OnBlurBlock;
@@ -1,36 +0,0 @@
1
- import { Radio as AntdRadio, type RadioGroupProps as AntdRadioGroupProps, RadioProps } from 'antd';
2
- import type { RadioRef } from 'antd/es/radio/interface';
3
- import React from 'react';
4
- export interface CustomRadioProps {
5
- /**
6
- * @description Set the button style is similar to the Segmented component
7
- * @default 'false'
8
- */
9
- segmented?: {
10
- /**
11
- * @description Set the spacing between buttons
12
- * @default 'true'
13
- */
14
- gap?: 'small' | 'middle' | 'large' | number | boolean;
15
- /**
16
- * @description Set border-radius of buttons
17
- * @default 'true'
18
- */
19
- borderRadius?: number | boolean;
20
- /**
21
- * @description Sets whether the button's border is displayed
22
- * @default 'false'
23
- */
24
- bordered?: boolean;
25
- } | boolean;
26
- }
27
- export interface RadioGroupProps extends AntdRadioGroupProps, CustomRadioProps {
28
- }
29
- type RadioType = React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<RadioRef>> & {
30
- Group: typeof Group;
31
- Button: typeof AntdRadio.Button;
32
- };
33
- export declare const Radio: RadioType;
34
- declare const Group: React.FC<RadioGroupProps>;
35
- export default Radio;
36
- export { type RadioChangeEvent, type RadioProps } from 'antd';
package/es/Radio/index.js DELETED
@@ -1,25 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className"];
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 { Radio as AntdRadio } from 'antd';
7
- import React from 'react';
8
- import { useStyles } from "./style";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- export var Radio = AntdRadio;
11
- var Group = function Group(props) {
12
- var className = props.className,
13
- otherProps = _objectWithoutProperties(props, _excluded);
14
- if (otherProps.segmented) {
15
- otherProps.optionType = 'button';
16
- }
17
- var _useStyles = useStyles(otherProps),
18
- styles = _useStyles.styles,
19
- cx = _useStyles.cx;
20
- return /*#__PURE__*/_jsx(AntdRadio.Group, _objectSpread(_objectSpread({}, otherProps), {}, {
21
- className: cx(styles.custom, className)
22
- }));
23
- };
24
- Radio.Group = Group;
25
- export default Radio;
@@ -1,4 +0,0 @@
1
- import { RadioGroupProps } from './index';
2
- export declare const useStyles: (props?: RadioGroupProps | undefined) => import("antd-style").ReturnStyles<{
3
- custom: import("antd-style").SerializedStyles;
4
- }>;
package/es/Radio/style.js DELETED
@@ -1,66 +0,0 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
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 size = _ref2.size,
9
- segmented = _ref2.segmented;
10
- var gap = function () {
11
- if (!segmented) {
12
- return 0;
13
- }
14
- if (segmented !== true) {
15
- return segmented.gap;
16
- }
17
- return true;
18
- }();
19
- var borderRadius = function () {
20
- if (!segmented) {
21
- return;
22
- }
23
- if (segmented !== true) {
24
- return segmented.borderRadius;
25
- }
26
- return true;
27
- }();
28
- var getGapSize = function getGapSize() {
29
- var gapSizeMap = {
30
- small: token.sizeSM,
31
- middle: token.size,
32
- large: token.sizeLG
33
- };
34
- if (typeof gap === 'string') {
35
- return gapSizeMap[gap];
36
- }
37
- if (gap === true) {
38
- return size ? gapSizeMap[size] : gapSizeMap['middle'];
39
- }
40
- if (!gap) {
41
- return 0;
42
- }
43
- return gap;
44
- };
45
- var getBorderRadius = function getBorderRadius() {
46
- var borderRadiusSizeMap = {
47
- small: token.controlHeightSM,
48
- middle: token.controlHeight,
49
- large: token.controlHeightLG
50
- };
51
- if (borderRadius === true) {
52
- return size ? borderRadiusSizeMap[size] : borderRadiusSizeMap['middle'];
53
- }
54
- if (borderRadius || borderRadius === 0) {
55
- return borderRadius;
56
- }
57
- };
58
- var borderRadiusStyle = getBorderRadius() && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n label {\n border-inline-start-width: 1px !important;\n border-radius: ", "px !important;\n }\n label::before {\n display: none !important;\n }\n "])), getBorderRadius());
59
- var gapStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n label {\n margin-right: ", "px !important;\n }\n label:last-child {\n margin-right: 0 !important;\n }\n "])), getGapSize());
60
- var noBorderd = segmented === true || segmented && !segmented.bordered;
61
- return {
62
- custom: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), borderRadiusStyle, gapStyle, noBorderd && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", "-radio-button-wrapper {\n border: none !important;\n }\n .", "-radio-button-wrapper-checked {\n border: 1px solid ", " !important;\n }\n "])), prefixCls, prefixCls, token.colorPrimary))
63
- };
64
- }, {
65
- hashPriority: 'low'
66
- });