@akinon/ui-tag 1.2.1 → 1.3.1
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.
- package/dist/cjs/constants.d.ts +30 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +32 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/types.d.ts +1 -34
- package/dist/esm/constants.d.ts +30 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +29 -0
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/types.d.ts +1 -34
- package/package.json +9 -8
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the predefined statuses for the Tag component.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TagStatus: {
|
|
5
|
+
/**
|
|
6
|
+
* Represents a successful status.
|
|
7
|
+
*/
|
|
8
|
+
readonly Success: "success";
|
|
9
|
+
/**
|
|
10
|
+
* Represents the first informational status.
|
|
11
|
+
*/
|
|
12
|
+
readonly Info1: "info-1";
|
|
13
|
+
/**
|
|
14
|
+
* Represents the second informational status.
|
|
15
|
+
*/
|
|
16
|
+
readonly Info2: "info-2";
|
|
17
|
+
/**
|
|
18
|
+
* Represents the third informational status.
|
|
19
|
+
*/
|
|
20
|
+
readonly Info3: "info-3";
|
|
21
|
+
/**
|
|
22
|
+
* Represents an error status.
|
|
23
|
+
*/
|
|
24
|
+
readonly Error: "error";
|
|
25
|
+
/**
|
|
26
|
+
* Represents an empty status.
|
|
27
|
+
*/
|
|
28
|
+
readonly Empty: "empty";
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;IACpB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TagStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing the predefined statuses for the Tag component.
|
|
6
|
+
*/
|
|
7
|
+
exports.TagStatus = {
|
|
8
|
+
/**
|
|
9
|
+
* Represents a successful status.
|
|
10
|
+
*/
|
|
11
|
+
Success: 'success',
|
|
12
|
+
/**
|
|
13
|
+
* Represents the first informational status.
|
|
14
|
+
*/
|
|
15
|
+
Info1: 'info-1',
|
|
16
|
+
/**
|
|
17
|
+
* Represents the second informational status.
|
|
18
|
+
*/
|
|
19
|
+
Info2: 'info-2',
|
|
20
|
+
/**
|
|
21
|
+
* Represents the third informational status.
|
|
22
|
+
*/
|
|
23
|
+
Info3: 'info-3',
|
|
24
|
+
/**
|
|
25
|
+
* Represents an error status.
|
|
26
|
+
*/
|
|
27
|
+
Error: 'error',
|
|
28
|
+
/**
|
|
29
|
+
* Represents an empty status.
|
|
30
|
+
*/
|
|
31
|
+
Empty: 'empty'
|
|
32
|
+
};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { type AntTagProps, type TagProps, TagStatus } from './types.d';
|
|
2
|
+
import type { TagProps } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* Tag component for Akinon UI.
|
|
6
5
|
*
|
|
@@ -13,4 +12,6 @@ export { type AntTagProps, type TagProps, TagStatus } from './types.d';
|
|
|
13
12
|
* filtering, or highlighting content within an application.
|
|
14
13
|
*/
|
|
15
14
|
export declare const Tag: ({ children, status, className, color, ...restTagProps }: TagProps) => React.JSX.Element;
|
|
15
|
+
export { TagStatus } from './constants';
|
|
16
|
+
export type * from './types';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAsB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAoB5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,GAAG,GAAI,yDAMjB,QAAQ,sBAyGV,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,mBAAmB,SAAS,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.TagStatus = exports.Tag = void 0;
|
|
15
15
|
const ui_theme_1 = require("@akinon/ui-theme");
|
|
16
16
|
const cssinjs_1 = require("@ant-design/cssinjs");
|
|
17
17
|
const antd_1 = require("antd");
|
|
@@ -19,9 +19,7 @@ const antd_style_1 = require("antd-style");
|
|
|
19
19
|
const clsx_1 = require("clsx");
|
|
20
20
|
const color_1 = require("color");
|
|
21
21
|
const React = require("react");
|
|
22
|
-
const
|
|
23
|
-
var types_d_2 = require("./types.d");
|
|
24
|
-
Object.defineProperty(exports, "TagStatus", { enumerable: true, get: function () { return types_d_2.TagStatus; } });
|
|
22
|
+
const constants_1 = require("./constants");
|
|
25
23
|
// It is necessary for dynamic styles to be created in this way.
|
|
26
24
|
const useDynamicStyles = (0, antd_style_1.createStyles)(({ css }, { prefixClsWithoutHash, color, status }) => ({
|
|
27
25
|
dynamicStyles: css `
|
|
@@ -78,7 +76,7 @@ const Tag = (_a) => {
|
|
|
78
76
|
[`${prefixClsWithoutHash}-borderless`]: {
|
|
79
77
|
border: customTokens.border.borderNone
|
|
80
78
|
},
|
|
81
|
-
[`${prefixClsWithoutHash}-${
|
|
79
|
+
[`${prefixClsWithoutHash}-${constants_1.TagStatus.Success}`]: {
|
|
82
80
|
color: tagToken.defaultColorSuccess,
|
|
83
81
|
borderColor: tagToken.defaultBorderColorSuccess,
|
|
84
82
|
backgroundColor: tagToken.defaultBgSuccess,
|
|
@@ -86,7 +84,7 @@ const Tag = (_a) => {
|
|
|
86
84
|
color: tagToken.defaultColorSuccess
|
|
87
85
|
}
|
|
88
86
|
},
|
|
89
|
-
[`${prefixClsWithoutHash}-${
|
|
87
|
+
[`${prefixClsWithoutHash}-${constants_1.TagStatus.Info1}`]: {
|
|
90
88
|
color: tagToken.defaultColorWaiting1,
|
|
91
89
|
borderColor: tagToken.defaultBorderColorWaiting1,
|
|
92
90
|
backgroundColor: tagToken.defaultBgWaiting1,
|
|
@@ -94,7 +92,7 @@ const Tag = (_a) => {
|
|
|
94
92
|
color: tagToken.defaultColorWaiting1
|
|
95
93
|
}
|
|
96
94
|
},
|
|
97
|
-
[`${prefixClsWithoutHash}-${
|
|
95
|
+
[`${prefixClsWithoutHash}-${constants_1.TagStatus.Info2}`]: {
|
|
98
96
|
color: tagToken.defaultColorWaiting2,
|
|
99
97
|
borderColor: tagToken.defaultBorderColorWaiting2,
|
|
100
98
|
backgroundColor: tagToken.defaultBgWaiting2,
|
|
@@ -102,7 +100,7 @@ const Tag = (_a) => {
|
|
|
102
100
|
color: tagToken.defaultColorWaiting2
|
|
103
101
|
}
|
|
104
102
|
},
|
|
105
|
-
[`${prefixClsWithoutHash}-${
|
|
103
|
+
[`${prefixClsWithoutHash}-${constants_1.TagStatus.Info3}`]: {
|
|
106
104
|
color: tagToken.defaultColorWaiting3,
|
|
107
105
|
borderColor: tagToken.defaultBorderColorWaiting3,
|
|
108
106
|
backgroundColor: tagToken.defaultBgWaiting3,
|
|
@@ -110,7 +108,7 @@ const Tag = (_a) => {
|
|
|
110
108
|
color: tagToken.defaultColorWaiting3
|
|
111
109
|
}
|
|
112
110
|
},
|
|
113
|
-
[`${prefixClsWithoutHash}-${
|
|
111
|
+
[`${prefixClsWithoutHash}-${constants_1.TagStatus.Error}`]: {
|
|
114
112
|
color: tagToken.defaultColorFailed,
|
|
115
113
|
borderColor: tagToken.defaultBorderColorFailed,
|
|
116
114
|
backgroundColor: tagToken.defaultBgFailed,
|
|
@@ -118,7 +116,7 @@ const Tag = (_a) => {
|
|
|
118
116
|
color: tagToken.defaultColorFailed
|
|
119
117
|
}
|
|
120
118
|
},
|
|
121
|
-
[`${prefixClsWithoutHash}-${
|
|
119
|
+
[`${prefixClsWithoutHash}-${constants_1.TagStatus.Empty}`]: {
|
|
122
120
|
color: tagToken.defaultColorEmpty,
|
|
123
121
|
borderColor: tagToken.defaultBorderColorEmpty,
|
|
124
122
|
backgroundColor: tagToken.defaultBgEmpty
|
|
@@ -133,3 +131,5 @@ const Tag = (_a) => {
|
|
|
133
131
|
return useStyle(React.createElement(antd_1.Tag, Object.assign({ className: (0, clsx_1.default)(status && `${getPrefixCls()}-tag-${status}`, styles.dynamicStyles, className) }, restTagProps), children));
|
|
134
132
|
};
|
|
135
133
|
exports.Tag = Tag;
|
|
134
|
+
var constants_2 = require("./constants");
|
|
135
|
+
Object.defineProperty(exports, "TagStatus", { enumerable: true, get: function () { return constants_2.TagStatus; } });
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Enum representing the predefined statuses for the Tag component.
|
|
3
|
-
*/
|
|
4
|
-
export enum TagStatus {
|
|
5
|
-
/**
|
|
6
|
-
* Represents a successful status.
|
|
7
|
-
*/
|
|
8
|
-
Success = 'success',
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents the first informational status.
|
|
12
|
-
*/
|
|
13
|
-
Info1 = 'info-1',
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Represents the second informational status.
|
|
17
|
-
*/
|
|
18
|
-
Info2 = 'info-2',
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Represents the third informational status.
|
|
22
|
-
*/
|
|
23
|
-
Info3 = 'info-3',
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Represents an error status.
|
|
27
|
-
*/
|
|
28
|
-
Error = 'error',
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Represents an empty status.
|
|
32
|
-
*/
|
|
33
|
-
Empty = 'empty'
|
|
34
|
-
}
|
|
1
|
+
import { TagStatus } from './constants';
|
|
35
2
|
|
|
36
3
|
/**
|
|
37
4
|
* Props for the Tag component, extending AntTagProps and adding status support.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the predefined statuses for the Tag component.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TagStatus: {
|
|
5
|
+
/**
|
|
6
|
+
* Represents a successful status.
|
|
7
|
+
*/
|
|
8
|
+
readonly Success: "success";
|
|
9
|
+
/**
|
|
10
|
+
* Represents the first informational status.
|
|
11
|
+
*/
|
|
12
|
+
readonly Info1: "info-1";
|
|
13
|
+
/**
|
|
14
|
+
* Represents the second informational status.
|
|
15
|
+
*/
|
|
16
|
+
readonly Info2: "info-2";
|
|
17
|
+
/**
|
|
18
|
+
* Represents the third informational status.
|
|
19
|
+
*/
|
|
20
|
+
readonly Info3: "info-3";
|
|
21
|
+
/**
|
|
22
|
+
* Represents an error status.
|
|
23
|
+
*/
|
|
24
|
+
readonly Error: "error";
|
|
25
|
+
/**
|
|
26
|
+
* Represents an empty status.
|
|
27
|
+
*/
|
|
28
|
+
readonly Empty: "empty";
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS;IACpB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEK,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the predefined statuses for the Tag component.
|
|
3
|
+
*/
|
|
4
|
+
export const TagStatus = {
|
|
5
|
+
/**
|
|
6
|
+
* Represents a successful status.
|
|
7
|
+
*/
|
|
8
|
+
Success: 'success',
|
|
9
|
+
/**
|
|
10
|
+
* Represents the first informational status.
|
|
11
|
+
*/
|
|
12
|
+
Info1: 'info-1',
|
|
13
|
+
/**
|
|
14
|
+
* Represents the second informational status.
|
|
15
|
+
*/
|
|
16
|
+
Info2: 'info-2',
|
|
17
|
+
/**
|
|
18
|
+
* Represents the third informational status.
|
|
19
|
+
*/
|
|
20
|
+
Info3: 'info-3',
|
|
21
|
+
/**
|
|
22
|
+
* Represents an error status.
|
|
23
|
+
*/
|
|
24
|
+
Error: 'error',
|
|
25
|
+
/**
|
|
26
|
+
* Represents an empty status.
|
|
27
|
+
*/
|
|
28
|
+
Empty: 'empty'
|
|
29
|
+
};
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export { type AntTagProps, type TagProps, TagStatus } from './types.d';
|
|
2
|
+
import type { TagProps } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* Tag component for Akinon UI.
|
|
6
5
|
*
|
|
@@ -13,4 +12,6 @@ export { type AntTagProps, type TagProps, TagStatus } from './types.d';
|
|
|
13
12
|
* filtering, or highlighting content within an application.
|
|
14
13
|
*/
|
|
15
14
|
export declare const Tag: ({ children, status, className, color, ...restTagProps }: TagProps) => React.JSX.Element;
|
|
15
|
+
export { TagStatus } from './constants';
|
|
16
|
+
export type * from './types';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAsB,QAAQ,EAAE,MAAM,SAAS,CAAC;AAoB5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,GAAG,GAAI,yDAMjB,QAAQ,sBAyGV,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,mBAAmB,SAAS,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -16,8 +16,7 @@ import { createStyles } from 'antd-style';
|
|
|
16
16
|
import clsx from 'clsx';
|
|
17
17
|
import Color from 'color';
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import { TagStatus } from './
|
|
20
|
-
export { TagStatus } from './types.d';
|
|
19
|
+
import { TagStatus } from './constants';
|
|
21
20
|
// It is necessary for dynamic styles to be created in this way.
|
|
22
21
|
const useDynamicStyles = createStyles(({ css }, { prefixClsWithoutHash, color, status }) => ({
|
|
23
22
|
dynamicStyles: css `
|
|
@@ -128,3 +127,4 @@ export const Tag = (_a) => {
|
|
|
128
127
|
});
|
|
129
128
|
return useStyle(React.createElement(AntTag, Object.assign({ className: clsx(status && `${getPrefixCls()}-tag-${status}`, styles.dynamicStyles, className) }, restTagProps), children));
|
|
130
129
|
};
|
|
130
|
+
export { TagStatus } from './constants';
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Enum representing the predefined statuses for the Tag component.
|
|
3
|
-
*/
|
|
4
|
-
export enum TagStatus {
|
|
5
|
-
/**
|
|
6
|
-
* Represents a successful status.
|
|
7
|
-
*/
|
|
8
|
-
Success = 'success',
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Represents the first informational status.
|
|
12
|
-
*/
|
|
13
|
-
Info1 = 'info-1',
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Represents the second informational status.
|
|
17
|
-
*/
|
|
18
|
-
Info2 = 'info-2',
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Represents the third informational status.
|
|
22
|
-
*/
|
|
23
|
-
Info3 = 'info-3',
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Represents an error status.
|
|
27
|
-
*/
|
|
28
|
-
Error = 'error',
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Represents an empty status.
|
|
32
|
-
*/
|
|
33
|
-
Empty = 'empty'
|
|
34
|
-
}
|
|
1
|
+
import { TagStatus } from './constants';
|
|
35
2
|
|
|
36
3
|
/**
|
|
37
4
|
* Props for the Tag component, extending AntTagProps and adding status support.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/ui-tag",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -9,11 +9,12 @@
|
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
12
|
+
"@ant-design/cssinjs": "^1.24.0",
|
|
13
|
+
"antd": "^5.27.0",
|
|
13
14
|
"antd-style": "^3.7.1",
|
|
14
15
|
"clsx": "^2.0.0",
|
|
15
16
|
"color": "4.2.3",
|
|
16
|
-
"@akinon/ui-theme": "1.
|
|
17
|
+
"@akinon/ui-theme": "1.1.1"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"@types/color": "4.2.0",
|
|
@@ -21,11 +22,11 @@
|
|
|
21
22
|
"copyfiles": "^2.4.1",
|
|
22
23
|
"rimraf": "^5.0.5",
|
|
23
24
|
"typescript": "*",
|
|
24
|
-
"@akinon/typescript-config": "1.0
|
|
25
|
+
"@akinon/typescript-config": "1.1.0"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
|
-
"react": "
|
|
28
|
-
"react-dom": "
|
|
28
|
+
"react": "^18 || ^19",
|
|
29
|
+
"react-dom": "^18 || ^19"
|
|
29
30
|
},
|
|
30
31
|
"clean-package": "../../../clean-package.config.json",
|
|
31
32
|
"types": "dist/esm/index.d.ts",
|
|
@@ -39,10 +40,10 @@
|
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
41
42
|
"build": "pnpm run build:esm && pnpm run build:commonjs && pnpm run copy:files",
|
|
42
|
-
"build:esm": "tsc --outDir dist/esm",
|
|
43
43
|
"build:commonjs": "tsc --module commonjs --outDir dist/cjs",
|
|
44
|
-
"
|
|
44
|
+
"build:esm": "tsc --outDir dist/esm",
|
|
45
45
|
"clean": "rimraf dist/",
|
|
46
|
+
"copy:files": "copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/esm && copyfiles -u 1 \"src/**/*.!(ts|tsx)\" dist/cjs",
|
|
46
47
|
"typecheck": "tsc --noEmit"
|
|
47
48
|
}
|
|
48
49
|
}
|