@itilite/lumina-ui 1.0.1 → 1.1.0
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/README.md +43 -10
- package/dist/Tag.d.mts +13 -0
- package/dist/Tag.d.ts +13 -0
- package/dist/Tag.js +108 -0
- package/dist/Tag.mjs +9 -0
- package/dist/atom/Avatar/Avatar.d.mts +17 -0
- package/dist/atom/Avatar/Avatar.d.ts +17 -0
- package/dist/atom/Avatar/Avatar.js +121 -0
- package/dist/atom/Avatar/Avatar.mjs +9 -0
- package/dist/atom/Button/Button.d.mts +25 -0
- package/dist/atom/Button/Button.d.ts +25 -0
- package/dist/atom/Button/Button.js +111 -0
- package/dist/atom/Button/Button.mjs +9 -0
- package/dist/atom/Checkbox/Checkbox.d.mts +20 -0
- package/dist/atom/Checkbox/Checkbox.d.ts +20 -0
- package/dist/atom/Checkbox/Checkbox.js +121 -0
- package/dist/atom/Checkbox/Checkbox.mjs +9 -0
- package/dist/atom/Modal/Modal.d.mts +25 -0
- package/dist/atom/Modal/Modal.d.ts +25 -0
- package/dist/atom/Modal/Modal.js +267 -0
- package/dist/atom/Modal/Modal.mjs +10 -0
- package/dist/atom/Radio/Radio.d.mts +17 -0
- package/dist/atom/Radio/Radio.d.ts +17 -0
- package/dist/atom/Radio/Radio.js +122 -0
- package/dist/atom/Radio/Radio.mjs +9 -0
- package/dist/atom/Switch/Switch.d.mts +13 -0
- package/dist/atom/Switch/Switch.d.ts +13 -0
- package/dist/atom/Switch/Switch.js +102 -0
- package/dist/atom/Switch/Switch.mjs +9 -0
- package/dist/atom/Tag/Tag.d.mts +13 -0
- package/dist/atom/Tag/Tag.d.ts +13 -0
- package/dist/atom/Tag/Tag.js +108 -0
- package/dist/atom/Tag/Tag.mjs +9 -0
- package/dist/atom/Tooltip/Tooltip.d.mts +12 -0
- package/dist/atom/Tooltip/Tooltip.d.ts +12 -0
- package/dist/atom/Tooltip/Tooltip.js +97 -0
- package/dist/atom/Tooltip/Tooltip.mjs +9 -0
- package/dist/chunk-4VZB2KR2.mjs +51 -0
- package/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +46 -3
- package/dist/index.mjs +10 -6
- package/dist/styles.css +232 -930
- package/package.json +6 -31
- package/dist/chunk-2O2IH2FG.mjs +0 -83
- package/dist/styles.d.mts +0 -2
- package/dist/styles.d.ts +0 -2
package/README.md
CHANGED
|
@@ -22,6 +22,43 @@ npm install react antd
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
+
### Prerequisites
|
|
26
|
+
|
|
27
|
+
This component library requires Tailwind CSS to be set up in your consuming application. The components use Tailwind utility classes and will not be styled without it.
|
|
28
|
+
|
|
29
|
+
#### Setting up Tailwind CSS in your app
|
|
30
|
+
|
|
31
|
+
1. Install Tailwind CSS:
|
|
32
|
+
```bash
|
|
33
|
+
npm install -D tailwindcss postcss autoprefixer
|
|
34
|
+
npx tailwindcss init
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
2. Configure Tailwind to scan your app (you don't need to scan the component library):
|
|
38
|
+
```js
|
|
39
|
+
// tailwind.config.js
|
|
40
|
+
module.exports = {
|
|
41
|
+
content: [
|
|
42
|
+
"./src/**/*.{js,ts,jsx,tsx}",
|
|
43
|
+
// No need to scan node_modules - component utilities are pre-compiled
|
|
44
|
+
],
|
|
45
|
+
theme: {
|
|
46
|
+
extend: {},
|
|
47
|
+
},
|
|
48
|
+
plugins: [],
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
3. Add Tailwind directives to your main CSS file:
|
|
53
|
+
```css
|
|
54
|
+
/* app.css or index.css */
|
|
55
|
+
@tailwind base;
|
|
56
|
+
@tailwind components;
|
|
57
|
+
@tailwind utilities;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Important:** The component library includes only the Tailwind utilities it uses. Your app must provide the base/reset styles via `@tailwind base`.
|
|
61
|
+
|
|
25
62
|
### Importing Components
|
|
26
63
|
|
|
27
64
|
You can import components individually (recommended for tree-shaking):
|
|
@@ -29,21 +66,20 @@ You can import components individually (recommended for tree-shaking):
|
|
|
29
66
|
```tsx
|
|
30
67
|
import { Button } from '@itilite/lumina-ui/button';
|
|
31
68
|
import { Checkbox } from '@itilite/lumina-ui/checkbox';
|
|
32
|
-
import '@itilite/lumina-ui/styles.css';
|
|
69
|
+
import '@itilite/lumina-ui/styles.css'; // Import component styles
|
|
33
70
|
```
|
|
34
71
|
|
|
35
72
|
Or import all components from the main entry point:
|
|
36
73
|
|
|
37
74
|
```tsx
|
|
38
75
|
import { Button, Checkbox } from '@itilite/lumina-ui';
|
|
39
|
-
import '@itilite/lumina-ui/styles.css';
|
|
76
|
+
import '@itilite/lumina-ui/styles.css'; // Import component styles
|
|
40
77
|
```
|
|
41
78
|
|
|
42
79
|
### Button Component
|
|
43
80
|
|
|
44
81
|
```tsx
|
|
45
82
|
import { Button } from '@itilite/lumina-ui/button';
|
|
46
|
-
import '@itilite/lumina-ui/styles.css';
|
|
47
83
|
|
|
48
84
|
function App() {
|
|
49
85
|
return (
|
|
@@ -58,7 +94,6 @@ function App() {
|
|
|
58
94
|
|
|
59
95
|
```tsx
|
|
60
96
|
import { Checkbox } from '@itilite/lumina-ui/checkbox';
|
|
61
|
-
import '@itilite/lumina-ui/styles.css';
|
|
62
97
|
|
|
63
98
|
function App() {
|
|
64
99
|
return (
|
|
@@ -69,13 +104,11 @@ function App() {
|
|
|
69
104
|
}
|
|
70
105
|
```
|
|
71
106
|
|
|
72
|
-
##
|
|
107
|
+
## Requirements
|
|
73
108
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
import '@itilite/lumina-ui/styles.css';
|
|
78
|
-
```
|
|
109
|
+
- **Tailwind CSS**: This library requires Tailwind CSS to be configured in your consuming application
|
|
110
|
+
- **React**: 18+
|
|
111
|
+
- **Ant Design**: 5.13.1
|
|
79
112
|
|
|
80
113
|
## Available Components
|
|
81
114
|
|
package/dist/Tag.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
interface TagProps {
|
|
4
|
+
type?: "success" | "warning" | "blue" | "processing" | "failed";
|
|
5
|
+
className?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
icon?: React.ReactElement;
|
|
8
|
+
size?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const Tag: React$1.FC<TagProps>;
|
|
12
|
+
|
|
13
|
+
export { Tag, Tag as default };
|
package/dist/Tag.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
interface TagProps {
|
|
4
|
+
type?: "success" | "warning" | "blue" | "processing" | "failed";
|
|
5
|
+
className?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
icon?: React.ReactElement;
|
|
8
|
+
size?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const Tag: React$1.FC<TagProps>;
|
|
12
|
+
|
|
13
|
+
export { Tag, Tag as default };
|
package/dist/Tag.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/atom/Tag/Tag.tsx
|
|
60
|
+
var Tag_exports = {};
|
|
61
|
+
__export(Tag_exports, {
|
|
62
|
+
Tag: () => Tag,
|
|
63
|
+
default: () => Tag_default
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(Tag_exports);
|
|
66
|
+
var import_antd = require("antd");
|
|
67
|
+
var import_clsx = __toESM(require("clsx"));
|
|
68
|
+
|
|
69
|
+
// src/atom/Tag/Tag.module.scss
|
|
70
|
+
var Tag_module_default = { "tag": "Tag-module__tag___PIkhI", "small": "Tag-module__small___nG5XQ", "success": "Tag-module__success___99fad", "blue": "Tag-module__blue___Zky2Z", "warning": "Tag-module__warning___KXsly", "processing": "Tag-module__processing___OssXC", "bookingConfirmed": "Tag-module__bookingConfirmed___potR4", "bookingRescheduled": "Tag-module__bookingRescheduled___ynrwI", "bookingRescheduledPending": "Tag-module__bookingRescheduledPending___K3GqS", "failed": "Tag-module__failed___dvpyQ", "bookingPending": "Tag-module__bookingPending___64umX" };
|
|
71
|
+
|
|
72
|
+
// src/atom/Tag/Tag.tsx
|
|
73
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
74
|
+
var Tag = (_a) => {
|
|
75
|
+
var _b = _a, {
|
|
76
|
+
type = "success",
|
|
77
|
+
className = "",
|
|
78
|
+
title = "",
|
|
79
|
+
icon = null,
|
|
80
|
+
size = ""
|
|
81
|
+
} = _b, rest = __objRest(_b, [
|
|
82
|
+
"type",
|
|
83
|
+
"className",
|
|
84
|
+
"title",
|
|
85
|
+
"icon",
|
|
86
|
+
"size"
|
|
87
|
+
]);
|
|
88
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
89
|
+
import_antd.Tag,
|
|
90
|
+
__spreadProps(__spreadValues({
|
|
91
|
+
className: (0, import_clsx.default)(
|
|
92
|
+
Tag_module_default.tag,
|
|
93
|
+
size === "small" && Tag_module_default.small,
|
|
94
|
+
Tag_module_default[type],
|
|
95
|
+
className
|
|
96
|
+
),
|
|
97
|
+
icon
|
|
98
|
+
}, rest), {
|
|
99
|
+
children: title
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
Tag.displayName = "Tag";
|
|
104
|
+
var Tag_default = Tag;
|
|
105
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
106
|
+
0 && (module.exports = {
|
|
107
|
+
Tag
|
|
108
|
+
});
|
package/dist/Tag.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AvatarProps {
|
|
4
|
+
img?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
size?: "small" | "normal";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare function Avatar({ img, className, name, height, width, size, }: AvatarProps): React.JSX.Element;
|
|
13
|
+
declare namespace Avatar {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Avatar, Avatar as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface AvatarProps {
|
|
4
|
+
img?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
size?: "small" | "normal";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare function Avatar({ img, className, name, height, width, size, }: AvatarProps): React.JSX.Element;
|
|
13
|
+
declare namespace Avatar {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Avatar, Avatar as default };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/atom/Avatar/Avatar.tsx
|
|
31
|
+
var Avatar_exports = {};
|
|
32
|
+
__export(Avatar_exports, {
|
|
33
|
+
Avatar: () => Avatar,
|
|
34
|
+
default: () => Avatar_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(Avatar_exports);
|
|
37
|
+
var import_clsx = __toESM(require("clsx"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var COLOR_MAP = {
|
|
40
|
+
A: "#6455BF",
|
|
41
|
+
B: "#C46273",
|
|
42
|
+
C: "#52A79E",
|
|
43
|
+
D: "#DF8654",
|
|
44
|
+
E: "#B8639F",
|
|
45
|
+
F: "#6455BF",
|
|
46
|
+
G: "#C46273",
|
|
47
|
+
H: "#52A79E",
|
|
48
|
+
I: "#DF8654",
|
|
49
|
+
J: "#B8639F",
|
|
50
|
+
K: "#6455BF",
|
|
51
|
+
L: "#C46273",
|
|
52
|
+
M: "#52A79E",
|
|
53
|
+
N: "#DF8654",
|
|
54
|
+
O: "#B8639F",
|
|
55
|
+
P: "#6455BF",
|
|
56
|
+
Q: "#C46273",
|
|
57
|
+
R: "#52A79E",
|
|
58
|
+
S: "#DF8654",
|
|
59
|
+
T: "#B8639F",
|
|
60
|
+
U: "#6455BF",
|
|
61
|
+
V: "#C46273",
|
|
62
|
+
W: "#52A79E",
|
|
63
|
+
X: "#DF8654",
|
|
64
|
+
Y: "#B8639F",
|
|
65
|
+
Z: "#6455BF",
|
|
66
|
+
0: "#6455BF",
|
|
67
|
+
1: "#C46273",
|
|
68
|
+
6: "#C46273",
|
|
69
|
+
2: "#52A79E",
|
|
70
|
+
7: "#52A79E",
|
|
71
|
+
3: "#DF8654",
|
|
72
|
+
8: "#DF8654",
|
|
73
|
+
4: "#B8639F",
|
|
74
|
+
9: "#B8639F"
|
|
75
|
+
};
|
|
76
|
+
function Avatar({
|
|
77
|
+
img,
|
|
78
|
+
className,
|
|
79
|
+
name,
|
|
80
|
+
height = 28,
|
|
81
|
+
width = 28,
|
|
82
|
+
size = "normal"
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
style: { height, width },
|
|
88
|
+
className: "tw-rounded-full tw-flex tw-items-center",
|
|
89
|
+
children: !img && name ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
style: {
|
|
93
|
+
backgroundColor: COLOR_MAP[name[0]],
|
|
94
|
+
height,
|
|
95
|
+
width
|
|
96
|
+
},
|
|
97
|
+
className: (0, import_clsx.default)(
|
|
98
|
+
{ "tw-text-font-size-10": size === "small" },
|
|
99
|
+
`tw-text-white tw-font-medium tw-rounded-full tw-flex tw-items-center tw-justify-center`,
|
|
100
|
+
className
|
|
101
|
+
),
|
|
102
|
+
children: name[0]
|
|
103
|
+
}
|
|
104
|
+
) : img ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
+
"img",
|
|
106
|
+
{
|
|
107
|
+
src: img,
|
|
108
|
+
style: { height, width },
|
|
109
|
+
alt: name,
|
|
110
|
+
className: (0, import_clsx.default)("tw-rounded-full tw-object-cover", className)
|
|
111
|
+
}
|
|
112
|
+
) : null
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
Avatar.displayName = "Avatar";
|
|
117
|
+
var Avatar_default = Avatar;
|
|
118
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
119
|
+
0 && (module.exports = {
|
|
120
|
+
Avatar
|
|
121
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonProps {
|
|
4
|
+
type?: "primary" | "secondary" | "critical" | undefined;
|
|
5
|
+
variant?: "subtle" | "text" | "link";
|
|
6
|
+
size?: "large" | "small";
|
|
7
|
+
shape?: "circle" | "default" | "round";
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
iconPosition?: "start" | "end";
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
13
|
+
href?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
onHoverUnderline?: boolean;
|
|
17
|
+
analytics?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare function Button(props: ButtonProps): React$1.JSX.Element;
|
|
21
|
+
declare namespace Button {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { Button, Button as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
interface ButtonProps {
|
|
4
|
+
type?: "primary" | "secondary" | "critical" | undefined;
|
|
5
|
+
variant?: "subtle" | "text" | "link";
|
|
6
|
+
size?: "large" | "small";
|
|
7
|
+
shape?: "circle" | "default" | "round";
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
iconPosition?: "start" | "end";
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
13
|
+
href?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
onHoverUnderline?: boolean;
|
|
17
|
+
analytics?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare function Button(props: ButtonProps): React$1.JSX.Element;
|
|
21
|
+
declare namespace Button {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { Button, Button as default };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/atom/Button/Button.tsx
|
|
31
|
+
var Button_exports = {};
|
|
32
|
+
__export(Button_exports, {
|
|
33
|
+
Button: () => Button,
|
|
34
|
+
default: () => Button_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(Button_exports);
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_clsx = __toESM(require("clsx"));
|
|
39
|
+
|
|
40
|
+
// src/atom/Button/Button.module.scss
|
|
41
|
+
var Button_module_default = { "button": "Button-module__button___cLCyl", "size_large": "Button-module__size_large___S-mbU", "shape_circle": "Button-module__shape_circle___sPUS5", "size_normal": "Button-module__size_normal___qJUMj", "size_small": "Button-module__size_small___IUeei", "type_primary": "Button-module__type_primary___Tauz-", "variant_subtle": "Button-module__variant_subtle___BMbbd", "variant_text": "Button-module__variant_text___Pc5Ia", "variant_link": "Button-module__variant_link___Cj1O9", "type_secondary": "Button-module__type_secondary___CLmrA", "type_critical": "Button-module__type_critical___6ILOp", "onHoverUnderline": "Button-module__onHoverUnderline___LOfXo" };
|
|
42
|
+
|
|
43
|
+
// src/atom/Button/Button.tsx
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
function Button(props) {
|
|
46
|
+
const {
|
|
47
|
+
type = "primary",
|
|
48
|
+
variant = "default",
|
|
49
|
+
size = "normal",
|
|
50
|
+
shape = "default",
|
|
51
|
+
className = "",
|
|
52
|
+
icon = null,
|
|
53
|
+
children,
|
|
54
|
+
onClick,
|
|
55
|
+
href = "",
|
|
56
|
+
disabled = false,
|
|
57
|
+
loading = false,
|
|
58
|
+
onHoverUnderline = false
|
|
59
|
+
} = props;
|
|
60
|
+
const buttonMap = {
|
|
61
|
+
default: "primary",
|
|
62
|
+
subtle: "default",
|
|
63
|
+
text: "text",
|
|
64
|
+
link: "link"
|
|
65
|
+
};
|
|
66
|
+
const sizeMap = {
|
|
67
|
+
small: "small",
|
|
68
|
+
normal: "middle",
|
|
69
|
+
// Map "default" to "middle"
|
|
70
|
+
large: "large"
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
|
+
import_antd.Button,
|
|
74
|
+
{
|
|
75
|
+
className: (0, import_clsx.default)(
|
|
76
|
+
Button_module_default.button,
|
|
77
|
+
Button_module_default[`size_${size}`],
|
|
78
|
+
Button_module_default[`variant_${variant}`],
|
|
79
|
+
Button_module_default[`shape_${shape}`],
|
|
80
|
+
Button_module_default[`type_${type}`],
|
|
81
|
+
`size_${size}`,
|
|
82
|
+
`variant_${variant}`,
|
|
83
|
+
`shape_${shape}`,
|
|
84
|
+
`type_${type}`,
|
|
85
|
+
className,
|
|
86
|
+
{
|
|
87
|
+
"tw-cursor-not-allowed": disabled,
|
|
88
|
+
"tw-opacity-40": disabled
|
|
89
|
+
},
|
|
90
|
+
disabled && Button_module_default.disabled,
|
|
91
|
+
onHoverUnderline && Button_module_default.onHoverUnderline
|
|
92
|
+
),
|
|
93
|
+
"data-testid": "lumina-button",
|
|
94
|
+
disabled,
|
|
95
|
+
href: href || void 0,
|
|
96
|
+
icon,
|
|
97
|
+
loading,
|
|
98
|
+
onClick,
|
|
99
|
+
shape,
|
|
100
|
+
size: sizeMap[size],
|
|
101
|
+
type: buttonMap[variant],
|
|
102
|
+
children
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
Button.displayName = "Button";
|
|
107
|
+
var Button_default = Button;
|
|
108
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
+
0 && (module.exports = {
|
|
110
|
+
Button
|
|
111
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { CheckboxChangeEvent } from 'antd/es/checkbox';
|
|
3
|
+
|
|
4
|
+
interface CheckboxProps {
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
onChange?: (e: CheckboxChangeEvent) => void;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
size?: "large" | "small" | "medium";
|
|
10
|
+
variant?: "normal" | "emphasized";
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
indeterminate?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare function Checkbox(props: CheckboxProps): React$1.JSX.Element;
|
|
16
|
+
declare namespace Checkbox {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { Checkbox, Checkbox as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { CheckboxChangeEvent } from 'antd/es/checkbox';
|
|
3
|
+
|
|
4
|
+
interface CheckboxProps {
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
onChange?: (e: CheckboxChangeEvent) => void;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
size?: "large" | "small" | "medium";
|
|
10
|
+
variant?: "normal" | "emphasized";
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
indeterminate?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare function Checkbox(props: CheckboxProps): React$1.JSX.Element;
|
|
16
|
+
declare namespace Checkbox {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { Checkbox, Checkbox as default };
|