;
14 |
15 | export default TimePicker;
16 |
--------------------------------------------------------------------------------
/components/select/commo.module.less:
--------------------------------------------------------------------------------
1 | //删除多选项目按键
2 | .delete {
3 | width: 11px;
4 | height: 11px;
5 | cursor: pointer;
6 | margin-left: 4px;
7 | fill: var(--ayong-plaster-grey);
8 | }
9 |
10 | /* Add other styles as needed */
11 |
12 | .item {
13 | margin-top: 4px;
14 | margin-right: 4px;
15 | display: flex;
16 | align-items: center;
17 | padding: 2px 4px;
18 | color: var(--ayong-stone-gray);
19 | background: var(--ayong-grey-crescent);
20 | border-color: var(--ayong-grey);
21 | border-radius: 4px;
22 | }
23 |
24 |
25 |
--------------------------------------------------------------------------------
/components/select/components/lefticon/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import selectStyle from '../../index.module.less';
3 | import {Wrongs, Under, Search} from '../../../icon/icon.ts'
4 |
5 | const LeftIcon = ({
6 | search,
7 | showClearable,
8 | onClearValue,
9 | isDropdownVisible,
10 | }) => {
11 |
12 |
13 | return (
14 |
15 |
16 | {showClearable ? (
17 | {
18 | e.stopPropagation();
19 | onClearValue()
20 | }} className={selectStyle.icon}/>
21 | ) : search && isDropdownVisible ? (
22 |
23 | ) : (
24 |
29 | )}
30 |
31 |
32 | )
33 | }
34 |
35 |
36 | export default LeftIcon;
37 |
--------------------------------------------------------------------------------
/components/select/components/multiple/components/itme/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import selectStyle from '../../../../commo.module.less';
3 | import {Wrong} from "../../../../../icon/icon.ts";
4 |
5 | const Item = ({value, index, mode, deleteValue, handleOptionClick}) => {
6 | return
7 | {value}
8 | handleOptionClick(value)}
10 | >
11 | deleteValue(e, index)}/>
12 |
13 |
14 | }
15 | export default Item;
16 |
--------------------------------------------------------------------------------
/components/select/components/option/index.module.less:
--------------------------------------------------------------------------------
1 |
2 | .customOption {
3 | display: flex;
4 | justify-content: space-between;
5 | align-items: center;
6 | font: 400 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
7 | padding: 3px 5px;
8 | border-radius: 4px;
9 | cursor: pointer;
10 | margin: 3px 0;
11 | //超出隐藏
12 | overflow: hidden;
13 | text-overflow: ellipsis;
14 | white-space: nowrap;
15 |
16 | &:hover {
17 | background: var(--ayong-premium-grey);
18 | }
19 | }
20 |
21 | .selectOption {
22 | color: var(--ayong-primary);
23 | font-weight: bold;
24 | background: var(--ayong-primary-grey);
25 | }
26 |
27 |
28 | .disabled {
29 | background: var(--ayong-grey-crescent);
30 | color: var(--ayong-grey);
31 | cursor: not-allowed;
32 | }
33 |
34 |
35 | //基础icon
36 | .icon {
37 | width: 13px;
38 | height: 13px;
39 | fill: var(--ayong-stone-gray);
40 | }
41 |
42 | //动态icon样式
43 | .iconActive {
44 | fill: var(--ayong-primary);
45 | }
46 |
47 |
48 | .emptyBox {
49 | display: flex;
50 | flex-direction: column;
51 | align-items: center;
52 | color: var(--ayong-stone-gray);
53 | font: 400 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
54 |
55 | }
56 |
57 | .empty {
58 | width: 10%;
59 | height: 10%;
60 | margin-bottom: 10px;
61 | }
62 |
63 | .stickyOption {
64 | position: sticky;
65 | top: 50%; /* 垂直居中 */
66 | transform: translateY(-50%);
67 | background-color: lightblue;
68 | padding: 10px;
69 | }
70 |
--------------------------------------------------------------------------------
/components/select/components/single/index.module.less:
--------------------------------------------------------------------------------
1 |
2 | .selectValue {
3 | width: 100%;
4 | display: flex;
5 | margin-top: 4px;
6 | }
7 | .customSelectSelectionSearchInput {
8 | flex: 1;
9 | width: 10px;
10 | outline: none;
11 | padding: 4px;
12 | border: none;
13 | border-radius: 4px;
14 | box-sizing: border-box;
15 | background: transparent;
16 | }
17 |
--------------------------------------------------------------------------------
/components/select/components/single/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import selectStyle from "./index.module.less";
3 |
4 | const Single = ({ search, optionsMap, selectedValues, searchTerm, onInputClick, handleOnKeyDown, onBlur = () => {}, onFocus = () => {}, onChange = () => {} }) => {
5 | return (
6 |
7 | {optionsMap.get(selectedValues) ?? "请选择"}
8 | {search && (
9 | <>
10 |
20 |
21 | >
22 | )}
23 |
24 | );
25 | };
26 |
27 | export default Single;
28 |
--------------------------------------------------------------------------------
/components/select/index.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 |
4 | export interface keyValue {
5 | [key: string| number]: string| number;
6 | }
7 | export interface Options {
8 | value: keyValue;
9 | label: keyValue;
10 | disabled?: boolean;
11 | }
12 |
13 | export interface SelectProps {
14 | className?: string;// 类名
15 | defaultValue?: string | string[];// 默认值
16 | value?: string | string[];// 选中值
17 | style?: React.CSSProperties;// 样式
18 | mode?: 'multiple' | 'tags' | 'single';// 模式
19 | onChange?: (value: string | string[]) => void;// 选中值改变时的回调
20 | options: Options[];// 选项数据
21 | disabled?: boolean;// 是否禁用
22 | clearable?: boolean;// 是否可清空
23 | search?: boolean;// 是否可搜索
24 | collapseTags?: boolean;//是否折叠多选
25 | optionRender?: (opt: options) => React.FC | null //自定义下拉模版
26 | optionHeaderRender?: (opt: options) => React.FC | null //自定义下来模版
27 | }
28 |
29 | export interface OptionsParma {
30 | options: Options[];// 选项数据
31 | onClick: Function;// 点击事件
32 | selectedValues?: string[];// 选中值
33 | }
34 |
35 | declare const Select: React.FC;
36 |
37 | export default Select;
38 |
--------------------------------------------------------------------------------
/components/skeleton/skeleton.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/skeleton/skeleton.js
--------------------------------------------------------------------------------
/components/slider/slider.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/slider/slider.js
--------------------------------------------------------------------------------
/components/spin/spin.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/spin/spin.js
--------------------------------------------------------------------------------
/components/style-animation/directionenter.module.less:
--------------------------------------------------------------------------------
1 | .top {
2 | animation: enterTop 0.5s ease-in-out;
3 | }
4 |
5 | .bottom {
6 | animation: enterBottom 0.5s ease-in-out;
7 | }
8 |
9 | .left {
10 | animation: enterLeft 0.5s ease-in-out;
11 | }
12 |
13 | .right {
14 | animation: enterRight 0.5s ease-in-out;
15 | }
16 |
17 | @keyframes enterTop {
18 | from {
19 | opacity: 0;
20 | transform: translateY(-100%);;
21 | }
22 | to {
23 | opacity: 1;
24 | transform: translateY(0); /* 向下偏移一些距离 */
25 | }
26 | }
27 |
28 | @keyframes enterBottom {
29 | from {
30 | opacity: 0;
31 | transform: translateY(100%);
32 | }
33 | to {
34 | opacity: 1;
35 | transform: translateY(0); /* 向下偏移一些距离 */
36 | }
37 | }
38 |
39 | @keyframes enterLeft {
40 | from {
41 | opacity: 0;
42 | transform: translateX(-100%);;
43 | }
44 | to {
45 | opacity: 1;
46 | transform: translateX(0); /* 向下偏移一些距离 */
47 | }
48 | }
49 |
50 | @keyframes enterRight {
51 | from {
52 | opacity: 0;
53 | transform: translateX(100%);;
54 | }
55 | to {
56 | opacity: 1;
57 | transform: translateX(0); /* 向下偏移一些距离 */
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/components/style-animation/directionout.module.less:
--------------------------------------------------------------------------------
1 | .top {
2 | animation: enterTop 1s ease-in-out;
3 | }
4 |
5 | .bottom {
6 | animation: enterBottom 1s ease-in-out;
7 | }
8 |
9 | .left {
10 | animation: enterLeft 1s ease-in-out;
11 | }
12 |
13 | .right {
14 | animation: enterRight 1s ease-in-out;
15 | }
16 |
17 | @keyframes enterTop {
18 | from {
19 | opacity: 0;
20 | transform: translateY(0);
21 | }
22 | to {
23 | opacity: 1;
24 | transform: translateY(-100%); /* 向下偏移一些距离 */
25 | background: #0a0e13;
26 | }
27 | }
28 |
29 | @keyframes enterBottom {
30 | from {
31 | opacity: 0;
32 | transform: translateY(0);;
33 | }
34 | to {
35 | opacity: 1;
36 | transform: translateY(100%); /* 向下偏移一些距离 */
37 | }
38 | }
39 |
40 | @keyframes enterLeft {
41 | from {
42 | opacity: 0;
43 | transform: translateX(0);;
44 | }
45 | to {
46 | opacity: 1;
47 | transform: translateX(-100%); /* 向下偏移一些距离 */
48 | }
49 | }
50 |
51 | @keyframes enterRight {
52 | from {
53 | opacity: 0;
54 | transform: translateX(0);;
55 | }
56 | to {
57 | opacity: 1;
58 | transform: translateX(100%); /* 向下偏移一些距离 */
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/components/switch/index.d.ts:
--------------------------------------------------------------------------------
1 | export interface SwitchProps {
2 | value?: boolean;// 默认值
3 | style?: React.CSSProperties;// 样式
4 | title?: string;// 标题
5 | className?: string;// 样式类名
6 | disabled?: boolean;// 是否禁用
7 | activeColor?: string;//打开时的颜色
8 | inactiveColor?: string;// 关闭时的颜色
9 | onChange?: (value: boolean) => void;// 状态改变时的回调
10 |
11 | }
12 |
13 | declare const Switch: React.FC;
14 |
15 | export default Switch;
16 |
--------------------------------------------------------------------------------
/components/switch/index.module.less:
--------------------------------------------------------------------------------
1 | @import "../../config/style.module.less";
2 |
3 | .ayongSwitch {
4 | background: var(--ayong-stone-gray);
5 | height: 22px;
6 | line-height: 22px;
7 | min-width: 44px;
8 | vertical-align: middle;
9 | border-radius: 100px;
10 | position: relative;
11 |
12 | .handle {
13 | position: absolute;
14 | top: 2px;
15 | inset-inline-start: 2px;
16 | width: 43%;
17 | height: 82%;
18 | transition: all 0.2s ease-in-out;
19 |
20 | &::before {
21 | position: absolute;
22 | top: 0;
23 | inset-inline-end: 0;
24 | bottom: 0;
25 | inset-inline-start: 0;
26 | background-color: var(--ayong-light);
27 | border-radius: 9px;
28 | transition: all 0.2s ease-in-out;
29 | content: "";
30 | }
31 | }
32 |
33 | .inner {
34 |
35 | }
36 |
37 | &.checked {
38 | background-color: var(--ayong-primary);
39 |
40 | .handle {
41 | inset-inline-start: calc(100% - 20px);
42 | }
43 | }
44 | }
45 |
46 | .title {
47 | margin-left: 10px;
48 | font-size: 14px;
49 | color: var(--ayong-font-dark);
50 | }
51 |
52 |
--------------------------------------------------------------------------------
/components/switch/index.tsx:
--------------------------------------------------------------------------------
1 | import styles from "./index.module.less";
2 | import {useState} from "react";
3 | import {SwitchProps} from "./index.d";
4 | import '../../config/style.module.less'
5 |
6 | export default function Switch(props: SwitchProps) {
7 | const {
8 | value = false,
9 | style,
10 | title,
11 | className,
12 | disabled,
13 | activeColor = '#8aabec',
14 | inactiveColor = '#9b9ea4',
15 | onChange = (value: boolean) => {
16 |
17 | },
18 | } = props
19 |
20 | const [isChecked, setIsChecked] = useState(value)
21 |
22 | const handleButtonClick = (): void => {
23 | setIsChecked(!isChecked);
24 | onChange(value)
25 | }
26 |
27 |
28 | const wrapClassName = `${styles.ayongSwitch} ${isChecked ? styles.checked : ''} ${disabled ? 'disabled' : ''} $`
29 |
30 | return
31 |
43 |
{title}
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/components/table/components/empty/empty.tsx:
--------------------------------------------------------------------------------
1 | import ConditionalRender from "../../../conditional-render/conditional-render.tsx";
2 |
3 | /**
4 | * 空数据组件
5 | * @param length
6 | * @constructor
7 | */
8 | const Empty = ({length = 1}: { length: number }) => (
9 |
10 |
11 |
12 | 暂无数据
13 | |
14 |
15 |
16 |
17 | )
18 | export default Empty;
--------------------------------------------------------------------------------
/components/table/components/group-child-th/group-child-th.tsx:
--------------------------------------------------------------------------------
1 | import ConditionalRender from "../../../conditional-render/conditional-render.tsx";
2 | import React from "react";
3 | import {Column, ColumnGroup} from "../../index.d";
4 |
5 | /**
6 | * 表头分组组件 th
7 | * @constructor
8 | */
9 | function renderSubHeaders(columns: Column[]) {
10 | return (
11 | <>
12 | {columns.map((column: Column) => (
13 |
14 | {column.title}
15 | |
16 | ))}
17 | >
18 | );
19 | }
20 |
21 | const GroupChildTh = ({tableColumns}: { tableColumns: Column[] }) => (
22 |
23 | {tableColumns.map((column: Column | ColumnGroup) => (
24 |
25 | {column.type === 'columnGroup' && (
26 | // 如果是列分组,则递归渲染子级表头
27 | renderSubHeaders((column as ColumnGroup).children, (column as ColumnGroup).children.length)
28 | )}
29 |
30 | ))}
31 |
32 | )
33 | export default GroupChildTh;
34 |
--------------------------------------------------------------------------------
/components/table/components/unfold-button/index.module.less:
--------------------------------------------------------------------------------
1 | .rotate180 {
2 | transition: transform 0.3s ease; /* 添加过渡效果 */
3 | }
4 |
5 | .rotate {
6 | transform: rotate(180deg); /* 在此添加按钮旋转的效果 */
7 | }
8 |
--------------------------------------------------------------------------------
/components/table/components/unfold-td/unfold-td.tsx:
--------------------------------------------------------------------------------
1 | import ConditionalRender from "../../../conditional-render/conditional-render.tsx";
2 | import {DataItem, UnfoldTdProps} from "../../index.d";
3 |
4 | const UnfoldTd = ({expandable = {}, ayonEexpandedRowKeys, index, item}: UnfoldTdProps) => {
5 | const {expandedRowRender, expandedRowKeys} = expandable;
6 | const renderExpandContent = (index: number, item: DataItem): string => {
7 | if (Array.isArray(expandedRowKeys) && expandedRowKeys.includes(index)) {
8 | return typeof expandedRowRender === 'function' ? expandedRowRender(item) : expandedRowRender;
9 | }
10 | return '';
11 | };
12 |
13 | return (
14 |
15 | {expandable?.expandedRowKeys && expandable?.expandedRowKeys.map((rowKeys: number | string, rowKeysIndex: number) => {
16 | return Number(rowKeys) === index ?
17 |
18 |
19 | {renderExpandContent(index, item)}
20 | |
21 |
: null
22 | })}
23 |
24 | )
25 | }
26 | export default UnfoldTd;
27 |
--------------------------------------------------------------------------------
/components/tag/tag.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/tag/tag.js
--------------------------------------------------------------------------------
/components/time-picker/time-picker.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/time-picker/time-picker.js
--------------------------------------------------------------------------------
/components/tooltip/components/trigger/trigger.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 |
4 | type placementType =
5 | 'topLeft'
6 | | 'top'
7 | | 'topRight'
8 | | 'bottomLeft'
9 | | 'bottom'
10 | | 'bottomRight'
11 | | 'leftTop'
12 | | 'left'
13 | | 'leftBottom'
14 | | 'rightTop'
15 | | 'right'
16 | | 'rightBottom';
17 |
18 | export interface TriggerWrapProps {
19 | popupPlacement: placementType;
20 | action: Array<'hover' | 'click'>;
21 | popupTransitionName: string;
22 | popupVisible?: boolean;
23 | popup: React.ReactNode;
24 | onPopupVisibleChange?: (visible: boolean) => void;
25 | popupClassName?: string;
26 | popupAlign?: object;
27 | getPopupContainer?: () => HTMLElement;
28 | onPopupAlign?: (domNode: HTMLElement, align: object) => void;
29 | children: React.ReactNode;
30 | }
31 |
--------------------------------------------------------------------------------
/components/tooltip/components/trigger/trigger.module.less:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/tooltip/components/trigger/trigger.module.less
--------------------------------------------------------------------------------
/components/tooltip/index.d.ts:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | // export interface TooltipProps {
4 | // title?: string;
5 | // /** 是否显示箭头 */
6 | // arrow?: boolean;
7 | // /** 主题风格 */
8 | // theme?: 'light' | 'dark';
9 | // /** 弹出层 */
10 | // popup: ReactNode;
11 | // /** 弹出层类名 */
12 | // popupClassName?: string;
13 | // /** 弹出层方向,默认左上 */
14 | // placement?: string;
15 | // /** 自定义样式 */
16 | // customStyle?: {
17 | // /** 弹出层外层 padding */
18 | // popupWrapperPadding?: string;
19 | // };
20 | // visible?: boolean;
21 | // /** children */
22 | // children?: any;
23 | // }
24 |
25 | // export interface ClientRect {
26 | // x: number;
27 | // y: number;
28 | // width: number;
29 | // height: number;
30 | // top: number;
31 | // right: number;
32 | // bottom: number;
33 | // left: number;
34 | // }
35 |
36 | export interface TooltipProps {
37 | title?: string; //title为空 不显示
38 | style?: React.CSSProperties; // 自定义样式
39 | className?: string; // 自定义样式类名
40 | children: React.ReactNode; // 按钮内容
41 | disabled?: boolean; // 禁用
42 | width?: string; // 宽度
43 | color?: string; // 颜色
44 | whiteSpace?: 'normal' | 'nowrap'; // 换行
45 | arrow?: boolean;
46 | size?: string; //大小
47 | open?: boolean; // 是否打开, 默认false
48 | onOpenChange?: (open: boolean) => void; // 打开关闭回调
49 | placement?: 'top' | 'bottom' | 'left' | 'right';
50 | }
51 |
52 | declare const ToolTip: React.FC;
53 |
54 | export default ToolTip;
55 |
--------------------------------------------------------------------------------
/components/transfer/transfer.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/transfer/transfer.js
--------------------------------------------------------------------------------
/components/tree-select/tree-select.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/tree-select/tree-select.js
--------------------------------------------------------------------------------
/components/tree/tree.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AyongNice/ayongUI/d06a6ea9048e3109fb6e2d3f5285f980ccfb633f/components/tree/tree.js
--------------------------------------------------------------------------------
/components/upload/components/avatar-list/index.less:
--------------------------------------------------------------------------------
1 | .fileListItemExit {
2 | //css阻止用户交互属性 不能点击
3 | //pointer-events: none;
4 | animation: fadeOutDown 0.5s ease-in-out; /* 渐出效果 */
5 | }
6 |
7 | //删除file 向下滑动动画
8 | @keyframes fadeOutDown {
9 | from {
10 | opacity: 1;
11 | transform: translateY(0);
12 | }
13 | to {
14 | opacity: 0;
15 | transform: translateY(20px); /* 向下偏移一些距离 */
16 | }
17 | }
18 |
19 |
20 |
--------------------------------------------------------------------------------
/components/upload/components/avatar-list/index.module.less:
--------------------------------------------------------------------------------
1 |
2 |
3 | .avatar {
4 | //虚线边框
5 | border-radius: 50%;
6 | display: flex;
7 | justify-content: center;
8 | align-items: center;
9 | border: 1px dashed #d9d9d9;
10 | cursor: pointer;
11 | position: relative;
12 | overflow: hidden;
13 | margin-left: 20px;
14 |
15 | span {
16 | font-size: 28px;
17 | font-weight: 100;
18 | }
19 | }
20 |
21 | .avatar:hover {
22 | border-color: #409EFF;
23 |
24 | .deleteIconBox {
25 | opacity: 0.5;
26 | }
27 |
28 | .deleteIcon {
29 | opacity: 1;
30 | fill: var(--ayong-light);
31 | }
32 | }
33 |
34 | .iconSize {
35 | width: 18px;
36 | height: 18px;
37 | }
38 |
39 | .deleteIconBox {
40 | position: absolute;
41 | width: 100%;
42 | height: 100%;
43 | background: var(--ayong-bolck);
44 | display: flex;
45 | align-items: center;
46 | justify-content: center;
47 | opacity: 0;
48 | }
49 |
50 | .deleteIcon {
51 | position: absolute;
52 | left: 50%;
53 | top: 50%;
54 | transform: translate(-50%, -50%);
55 | //触摸时的小手
56 | cursor: pointer;
57 | opacity: 0;
58 | }
59 |
60 | .box {
61 | width: 100%;
62 | height: 100%;
63 | display: flex;
64 | flex-wrap: wrap;
65 | }
66 |
67 |
68 | //添加file 向上滑动动画
69 | @keyframes fadeInUp {
70 | from {
71 | opacity: 0;
72 | transform: translateY(20px); /* 初始位置,向上偏移一些距离 */
73 | }
74 | to {
75 | opacity: 1;
76 | transform: translateY(0); /* 最终位置,无偏移 */
77 | }
78 | }
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/components/upload/components/file-list/index.less:
--------------------------------------------------------------------------------
1 | .fileListItemExit {
2 | //css阻止用户交互属性 不能点击
3 | //pointer-events: none;
4 | animation: fadeOutDown 0.5s ease-in-out; /* 渐出效果 */
5 | }
6 |
7 | //删除file 向下滑动动画
8 | @keyframes fadeOutDown {
9 | from {
10 | opacity: 1;
11 | transform: translateY(0);
12 | }
13 | to {
14 | opacity: 0;
15 | transform: translateY(20px); /* 向下偏移一些距离 */
16 | }
17 | }
18 |
19 |
20 |
--------------------------------------------------------------------------------
/components/upload/index.module.less:
--------------------------------------------------------------------------------
1 |
2 | .add {
3 | width: 30px;
4 | height: 30px;
5 | transform: rotate(45deg);
6 | }
7 |
8 |
9 |
--------------------------------------------------------------------------------
/config/style-const.ts:
--------------------------------------------------------------------------------
1 | const defaults: string = '5px';
2 | const butSmall: string = '2px';
3 | const butLarge: string = '10px';
4 | export const widthMap: { [key: string]: string } = {
5 | default: defaults,
6 | small: butSmall,
7 | large: butLarge
8 | }
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ayongui",
3 | "version": "1.0.4",
4 | "main": "./cjs/index.js",
5 | "module": "./es/index.js",
6 | "browser": "./umd/index.js",
7 | "typings": "./index.d.ts",
8 | "style": "./style.css",
9 | "scripts": {
10 | "build": "vite build"
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/AyongNice/ayongUI.git"
15 | },
16 | "publishConfig": {
17 | "registry": "https://registry.npmjs.org/"
18 | },
19 | "keywords": [
20 | "react",
21 | "react-component",
22 | "react-components",
23 | "react-ui",
24 | "react-ui-components",
25 | "react-component-library",
26 | "react-components-library",
27 | "react-ui-library",
28 | "轻量级",
29 | "简单好用",
30 | "react组件库"
31 | ],
32 | "license": "ISC",
33 | "devDependencies": {
34 | "@vitejs/plugin-react-refresh": "^1.3.6",
35 | "vite": "^4.5.0",
36 | "vite-plugin-dts": "^3.6.3",
37 | "vite-plugin-style-import": "^2.0.0"
38 | },
39 | "peerDependencies": {
40 | "@types/react": "^18.3.1",
41 | "react": ">=16.8.3",
42 | "react-dom": ">=16.8.3"
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": [
6 | "ES2020",
7 | "DOM",
8 | "DOM.Iterable"
9 | ],
10 | "module": "ESNext",
11 | "declaration": true,
12 | "declarationDir": "types",
13 | /* Bundler mode */
14 | "moduleResolution": "bundler",
15 | "allowImportingTsExtensions": true,
16 | "resolveJsonModule": true,
17 | "isolatedModules": true,
18 | "noEmit": true,
19 | "jsx": "react-jsx",
20 | /* Linting */
21 | "noImplicitAny": false,
22 | "strict": false, // 关闭 strict 模式
23 | "skipLibCheck": true, // 跳过检查引入的库文件
24 | "esModuleInterop": true, // 启用 CommonJS 模块的导入
25 | "allowJs": true, // 允许编译 JavaScript 文件
26 | "noUnusedLocals": true,
27 | "noUnusedParameters": true,
28 | "noFallthroughCasesInSwitch": true,
29 | "paths": {
30 | "ayongUI": ["./src/ayongUI/dist/index.d.ts"]
31 | }
32 | },
33 | "include": [
34 | "components/**/*.tsx",
35 | "/**/*.ts",
36 | "types",
37 | "components/**/*.d.ts",
38 | "./typings/index.d.ts"
39 | ],
40 | "exclude": [
41 | "node_modules"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/typings/index.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.less' {
2 | const resource: {[key: string]: string};
3 | export = resource;
4 | }
5 |
--------------------------------------------------------------------------------