@itilite/lumina-ui 0.0.1 → 0.0.3
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/babel.config.js +7 -0
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.js +75 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/cjs/types/components/Checkbox/index.d.ts +1 -0
- package/dist/cjs/types/components/Checkbox/types.d.ts +11 -0
- package/dist/cjs/types/components/Modal/Modal.d.ts +3 -0
- package/dist/cjs/types/components/Modal/index.d.ts +1 -0
- package/dist/cjs/types/components/Modal/types.d.ts +21 -0
- package/dist/cjs/types/components/Radio/Radio.d.ts +4 -0
- package/dist/cjs/types/components/Radio/index.d.ts +1 -0
- package/dist/cjs/types/components/Radio/types.d.ts +11 -0
- package/dist/cjs/types/components/Switch/Switch.d.ts +4 -0
- package/dist/cjs/types/components/Switch/index.d.ts +1 -0
- package/dist/cjs/types/components/Switch/types.d.ts +7 -0
- package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/cjs/types/components/Tooltip/index.d.ts +1 -0
- package/dist/cjs/types/components/Tooltip/types.d.ts +8 -0
- package/dist/cjs/types/components/index.d.ts +6 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +73 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/esm/types/components/Checkbox/index.d.ts +1 -0
- package/dist/esm/types/components/Checkbox/types.d.ts +11 -0
- package/dist/esm/types/components/Modal/Modal.d.ts +3 -0
- package/dist/esm/types/components/Modal/index.d.ts +1 -0
- package/dist/esm/types/components/Modal/types.d.ts +21 -0
- package/dist/esm/types/components/Radio/Radio.d.ts +4 -0
- package/dist/esm/types/components/Radio/index.d.ts +1 -0
- package/dist/esm/types/components/Radio/types.d.ts +11 -0
- package/dist/esm/types/components/Switch/Switch.d.ts +4 -0
- package/dist/esm/types/components/Switch/index.d.ts +1 -0
- package/dist/esm/types/components/Switch/types.d.ts +7 -0
- package/dist/esm/types/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/esm/types/components/Tooltip/index.d.ts +1 -0
- package/dist/esm/types/components/Tooltip/types.d.ts +8 -0
- package/dist/esm/types/components/index.d.ts +6 -1
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Button/Button.test.d.ts +1 -0
- package/dist/types/components/Button/index.d.ts +1 -0
- package/dist/{index.d.ts → types/components/Button/types.d.ts} +1 -7
- package/dist/types/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/types/components/Checkbox/index.d.ts +1 -0
- package/dist/types/components/Checkbox/types.d.ts +11 -0
- package/dist/types/components/Modal/Modal.d.ts +3 -0
- package/dist/types/components/Modal/index.d.ts +1 -0
- package/dist/types/components/Modal/types.d.ts +21 -0
- package/dist/types/components/Radio/Radio.d.ts +4 -0
- package/dist/types/components/Radio/index.d.ts +1 -0
- package/dist/types/components/Radio/types.d.ts +11 -0
- package/dist/types/components/Switch/Switch.d.ts +4 -0
- package/dist/types/components/Switch/index.d.ts +1 -0
- package/dist/types/components/Switch/types.d.ts +7 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/types/components/Tooltip/index.d.ts +1 -0
- package/dist/types/components/Tooltip/types.d.ts +8 -0
- package/dist/types/components/index.d.ts +6 -0
- package/dist/types/index.d.ts +1 -0
- package/jest.config.js +12 -0
- package/package.json +88 -53
- package/rollup.config.mjs +6 -6
- package/setupTests.ts +1 -0
- package/src/components/Button/Button.test.tsx +90 -0
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Checkbox/Checkbox.module.scss +141 -0
- package/src/components/Checkbox/Checkbox.tsx +56 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Checkbox/types.ts +12 -0
- package/src/components/Modal/Modal.module.scss +61 -0
- package/src/components/Modal/Modal.tsx +103 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Modal/types.ts +21 -0
- package/src/components/Radio/Radio.module.scss +103 -0
- package/src/components/Radio/Radio.tsx +54 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Radio/types.ts +12 -0
- package/src/components/Switch/Switch.module.scss +17 -0
- package/src/components/Switch/Switch.tsx +37 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/Switch/types.ts +12 -0
- package/src/components/Tooltip/Tooltip.module.scss +12 -0
- package/src/components/Tooltip/Tooltip.tsx +29 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Tooltip/types.ts +21 -0
- package/src/components/index.ts +7 -1
- package/src/types/jest.d.ts +10 -0
- package/tsconfig.json +39 -37
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Switch } from "./Switch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Tooltip } from "./Tooltip";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
title?: string | undefined;
|
|
4
|
+
placement?: "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
|
|
5
|
+
color?: string | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
mode?: "light" | "dark";
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from "./Button";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface ButtonProps {
|
|
1
|
+
export interface ButtonProps {
|
|
4
2
|
type?: "primary" | "secondary" | "critical" | undefined;
|
|
5
3
|
variant?: "subtle" | "text" | "link";
|
|
6
4
|
size?: "large" | "small";
|
|
@@ -16,7 +14,3 @@ interface ButtonProps {
|
|
|
16
14
|
onHoverUnderline?: boolean;
|
|
17
15
|
analytics?: Record<string, unknown>;
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
declare const Button: React$1.FC<ButtonProps>;
|
|
21
|
-
|
|
22
|
-
export { Button };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Checkbox } from "./Checkbox";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CheckboxChangeEvent } from 'antd/es/checkbox';
|
|
2
|
+
export interface CheckboxProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
onChange?: (e: CheckboxChangeEvent) => void;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
size?: "large" | "small" | "medium";
|
|
8
|
+
variant?: "normal" | "emphasized";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
indeterminate?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Modal } from "./Modal";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ModalProps {
|
|
2
|
+
className?: string | undefined;
|
|
3
|
+
title?: string | undefined;
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
handleOk?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
|
|
7
|
+
handleCancel?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
|
|
8
|
+
okText?: string | undefined;
|
|
9
|
+
cancelText?: string | undefined;
|
|
10
|
+
closeIcon?: React.ReactNode;
|
|
11
|
+
bodyClassName?: string | undefined;
|
|
12
|
+
outsideClickDisable?: boolean;
|
|
13
|
+
hideCross?: boolean;
|
|
14
|
+
okButtonLoading?: boolean;
|
|
15
|
+
okButtonDisabled?: boolean;
|
|
16
|
+
variant?: "primary" | "secondary";
|
|
17
|
+
okBtnClasses?: string | undefined;
|
|
18
|
+
cancelButtonAnalytics?: object | undefined;
|
|
19
|
+
okButtonAnalytics?: object | undefined;
|
|
20
|
+
footerMargintopDisable?: boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Radio } from "./Radio";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RadioChangeEvent } from "antd/lib/radio";
|
|
2
|
+
export interface RadioProps {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
onChange?: (event: RadioChangeEvent) => void;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
size?: "large" | "small" | "medium";
|
|
8
|
+
variant?: "normal" | "emphasized";
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
extra?: React.ReactNode;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Switch } from "./Switch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Tooltip } from "./Tooltip";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
title?: string | undefined;
|
|
4
|
+
placement?: "top" | "left" | "right" | "bottom" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom" | undefined;
|
|
5
|
+
color?: string | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
mode?: "light" | "dark";
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: "ts-jest",
|
|
3
|
+
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
|
|
4
|
+
testEnvironment: "jsdom",
|
|
5
|
+
transform: {
|
|
6
|
+
"^.+\\.tsx?$": "ts-jest",
|
|
7
|
+
// process `*.tsx` files with `ts-jest`
|
|
8
|
+
},
|
|
9
|
+
moduleNameMapper: {
|
|
10
|
+
".(css|less|scss)$": "identity-obj-proxy",
|
|
11
|
+
},
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1,54 +1,89 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
2
|
+
"name": "@itilite/lumina-ui",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Design system",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
10
|
+
"build": "rollup -c",
|
|
11
|
+
"build:all": "rollup -c && tsc --emitDeclarationOnly",
|
|
12
|
+
"dev": "rollup -c -w",
|
|
13
|
+
"lint": "eslint ",
|
|
14
|
+
"lint:fix": "eslint ./src --ext .ts,.tsx --fix",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"publish": "npm init --scope=itilite && npm publish"
|
|
17
|
+
},
|
|
18
|
+
"author": "Itilite",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@babel/core": "^7.25.9",
|
|
22
|
+
"@babel/preset-env": "^7.25.9",
|
|
23
|
+
"@babel/preset-react": "^7.25.9",
|
|
24
|
+
"@babel/preset-typescript": "^7.25.9",
|
|
25
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
26
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
27
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
28
|
+
"@testing-library/jest-dom": "^6.6.2",
|
|
29
|
+
"@testing-library/react": "^16.0.1",
|
|
30
|
+
"@types/jest": "^29.5.12",
|
|
31
|
+
"@types/prop-types": "^15.7.12",
|
|
32
|
+
"@types/react": "^18.3.12",
|
|
33
|
+
"@types/react-dom": "^18.3.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
|
35
|
+
"@typescript-eslint/parser": "^8.2.0",
|
|
36
|
+
"antd": "^5.20.1",
|
|
37
|
+
"autoprefixer": "^10.4.20",
|
|
38
|
+
"babel-jest": "^29.7.0",
|
|
39
|
+
"clsx": "^2.1.1",
|
|
40
|
+
"eslint": "^9.9.0",
|
|
41
|
+
"eslint-config-standard-with-typescript": "^43.0.1",
|
|
42
|
+
"eslint-define-config": "^2.1.0",
|
|
43
|
+
"eslint-plugin-import": "^2.29.1",
|
|
44
|
+
"eslint-plugin-react": "^7.35.0",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
46
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
47
|
+
"eslint-plugin-unused-imports": "^4.1.3",
|
|
48
|
+
"identity-obj-proxy": "^3.0.0",
|
|
49
|
+
"jest": "^29.7.0",
|
|
50
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
51
|
+
"postcss": "^8.4.41",
|
|
52
|
+
"postcss-scss": "^4.0.9",
|
|
53
|
+
"prop-types": "^15.8.1",
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-dom": "^18.3.1",
|
|
56
|
+
"rollup": "^4.21.0",
|
|
57
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
58
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
59
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
60
|
+
"rollup-plugin-scss": "^4.0.0",
|
|
61
|
+
"sass": "^1.77.8",
|
|
62
|
+
"tailwindcss": "^3.4.10",
|
|
63
|
+
"tslib": "^2.6.3",
|
|
64
|
+
"typescript": "^5.5.3"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"react": ">=18"
|
|
68
|
+
},
|
|
69
|
+
"jest": {
|
|
70
|
+
"setupFilesAfterEnv": [
|
|
71
|
+
"<rootDir>/src/setupTests.ts"
|
|
72
|
+
],
|
|
73
|
+
"testEnvironment": "jsdom"
|
|
74
|
+
},
|
|
75
|
+
"repository": {
|
|
76
|
+
"type": "git",
|
|
77
|
+
"url": "git+https://github.com/Itilite/design-system.git"
|
|
78
|
+
},
|
|
79
|
+
"keywords": [
|
|
80
|
+
"Design",
|
|
81
|
+
"system",
|
|
82
|
+
"LuminaUI",
|
|
83
|
+
"Frontend"
|
|
84
|
+
],
|
|
85
|
+
"bugs": {
|
|
86
|
+
"url": "https://github.com/Itilite/design-system/issues"
|
|
87
|
+
},
|
|
88
|
+
"homepage": "https://github.com/Itilite/design-system#readme"
|
|
89
|
+
}
|
package/rollup.config.mjs
CHANGED
|
@@ -49,10 +49,10 @@ export default [
|
|
|
49
49
|
],
|
|
50
50
|
external: id => /^react|react-dom/.test(id), // Ignore react and react-dom from node_modules
|
|
51
51
|
},
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
52
|
+
// {
|
|
53
|
+
// input: "dist/esm/types/src/index.d.ts",
|
|
54
|
+
// output: [{ file: "dist/index.d.ts", format: "esm" }],
|
|
55
|
+
// plugins: [dts()],
|
|
56
|
+
// external: [/\.css$/],
|
|
57
|
+
// },
|
|
58
58
|
];
|
package/setupTests.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { render, screen, fireEvent } from "@testing-library/react";
|
|
2
|
+
import Button from "./Button";
|
|
3
|
+
|
|
4
|
+
describe("Button component", () => {
|
|
5
|
+
it("should render the button with the provided label", () => {
|
|
6
|
+
render(<Button>{"Click me"}</Button>);
|
|
7
|
+
|
|
8
|
+
const buttonElement = screen.getByText(/click me/i);
|
|
9
|
+
expect(buttonElement).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should call onClick handler when clicked", () => {
|
|
13
|
+
const handleClick = jest.fn();
|
|
14
|
+
render(<Button onClick={handleClick}>{"Click me"}</Button>);
|
|
15
|
+
|
|
16
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
17
|
+
fireEvent.click(buttonElement);
|
|
18
|
+
|
|
19
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("should apply the correct size class", () => {
|
|
23
|
+
render(
|
|
24
|
+
<Button onClick={() => {}} size='large'>
|
|
25
|
+
{"Large button"}
|
|
26
|
+
</Button>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
30
|
+
expect(buttonElement).toHaveClass("size_large");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("should apply the correct type class", () => {
|
|
34
|
+
render(
|
|
35
|
+
<Button onClick={() => {}} type='critical'>
|
|
36
|
+
{"Critical Button"}
|
|
37
|
+
</Button>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
41
|
+
expect(buttonElement).toHaveClass("type_critical");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("should be disabled when the disabled prop is passed", () => {
|
|
45
|
+
render(
|
|
46
|
+
<Button onClick={() => {}} disabled={true}>
|
|
47
|
+
{"Disabled Button"}
|
|
48
|
+
</Button>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
52
|
+
expect(buttonElement).toBeDisabled();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it("should not call onClick when disabled", () => {
|
|
56
|
+
const handleClick = jest.fn();
|
|
57
|
+
render(
|
|
58
|
+
<Button onClick={handleClick} disabled={true}>
|
|
59
|
+
{"Disabled Button"}
|
|
60
|
+
</Button>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
64
|
+
fireEvent.click(buttonElement);
|
|
65
|
+
|
|
66
|
+
expect(handleClick).not.toHaveBeenCalled();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("should render with the correct shape class", () => {
|
|
70
|
+
render(
|
|
71
|
+
<Button onClick={() => {}} size='large' shape='circle'>
|
|
72
|
+
{"Circle Button"}
|
|
73
|
+
</Button>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
77
|
+
expect(buttonElement).toHaveClass("shape_circle");
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("should render with the correct variant class", () => {
|
|
81
|
+
render(
|
|
82
|
+
<Button onClick={() => {}} variant='link'>
|
|
83
|
+
{"Link Button"}
|
|
84
|
+
</Button>
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const buttonElement = screen.getByTestId("lumina-button");
|
|
88
|
+
expect(buttonElement).toHaveClass("variant_link");
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -65,6 +65,7 @@ const Button: React.FC<ButtonProps> = (props) => {
|
|
|
65
65
|
disabled={disabled}
|
|
66
66
|
loading={loading}
|
|
67
67
|
href={href || undefined}
|
|
68
|
+
data-testid='lumina-button'
|
|
68
69
|
>
|
|
69
70
|
{children}
|
|
70
71
|
</AntButton>
|
|
@@ -77,7 +78,7 @@ Button.propTypes = {
|
|
|
77
78
|
variant: PropTypes.oneOf(["subtle", "text", "link"]),
|
|
78
79
|
size: PropTypes.oneOf(["large", "small"]),
|
|
79
80
|
shape: PropTypes.oneOf(["circle", "default", "round"]),
|
|
80
|
-
icon: PropTypes.
|
|
81
|
+
icon: PropTypes.element,
|
|
81
82
|
iconPosition: PropTypes.oneOf(["start", "end"]),
|
|
82
83
|
className: PropTypes.string,
|
|
83
84
|
onClick: PropTypes.func,
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
.checkbox {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
&.size_small {
|
|
5
|
+
:global(.ant-checkbox) {
|
|
6
|
+
:global(.ant-checkbox-inner) {
|
|
7
|
+
height: 16px;
|
|
8
|
+
width: 16px;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
&.size_medium {
|
|
13
|
+
:global(.ant-checkbox) {
|
|
14
|
+
:global(.ant-checkbox-inner) {
|
|
15
|
+
height: 20px;
|
|
16
|
+
width: 20px;
|
|
17
|
+
&::after {
|
|
18
|
+
inset-inline-start: 27%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&.size_large {
|
|
24
|
+
:global(.ant-checkbox) {
|
|
25
|
+
:global(.ant-checkbox-inner) {
|
|
26
|
+
height: 24px;
|
|
27
|
+
width: 24px;
|
|
28
|
+
&::after {
|
|
29
|
+
inset-inline-start: 33%;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&.type_checked {
|
|
36
|
+
:global(.ant-checkbox-checked) {
|
|
37
|
+
:global(.ant-checkbox-inner) {
|
|
38
|
+
border-color: #ec5d25;
|
|
39
|
+
background-color: #ec5d25;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
&:global(
|
|
43
|
+
.ant-checkbox-wrapper:hover
|
|
44
|
+
.ant-checkbox-checked:not(.ant-checkbox-disabled)
|
|
45
|
+
.ant-checkbox-inner
|
|
46
|
+
) {
|
|
47
|
+
@apply tw-bg-color-text-primary-hover;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:global(.ant-checkbox-checked):focus-visible {
|
|
51
|
+
outline: 2px solid #0a65e7;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.disabled {
|
|
55
|
+
@apply tw-cursor-not-allowed;
|
|
56
|
+
|
|
57
|
+
:global(.ant-checkbox-checked) {
|
|
58
|
+
:global(.ant-checkbox-inner) {
|
|
59
|
+
opacity: 0.5;
|
|
60
|
+
border-color: #ec5d25;
|
|
61
|
+
background-color: #ec5d25;
|
|
62
|
+
}
|
|
63
|
+
:global(.ant-checkbox-inner)::after {
|
|
64
|
+
border-color: #ffffff;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.type_unchecked {
|
|
71
|
+
:global(.ant-checkbox) {
|
|
72
|
+
:global(.ant-checkbox-inner) {
|
|
73
|
+
border-color: #b6bac3;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:global(.ant-checkbox):hover {
|
|
78
|
+
:global(.ant-checkbox-inner) {
|
|
79
|
+
border-color: #6b7280;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
:global(.ant-checkbox):focus-visible {
|
|
83
|
+
outline: 2px solid #0a65e7;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.disabled {
|
|
87
|
+
@apply tw-cursor-not-allowed;
|
|
88
|
+
|
|
89
|
+
:global(.ant-checkbox) {
|
|
90
|
+
:global(.ant-checkbox-inner) {
|
|
91
|
+
border-color: #b6bac3;
|
|
92
|
+
background-color: #f9fafb;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
:global(.ant-checkbox-disabled + span) {
|
|
99
|
+
color: #363e4f;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.variant_normal {
|
|
103
|
+
color: #363e4f;
|
|
104
|
+
font-weight: 400;
|
|
105
|
+
font-size: 0.875rem /* 14px */;
|
|
106
|
+
line-height: 20px;
|
|
107
|
+
}
|
|
108
|
+
&.variant_emphasized {
|
|
109
|
+
color: #363e4f;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
font-size: 0.875rem /* 14px */;
|
|
112
|
+
line-height: 20px;
|
|
113
|
+
}
|
|
114
|
+
&.variant_indeterminate {
|
|
115
|
+
&.disabled {
|
|
116
|
+
:global(.ant-checkbox-indeterminate) {
|
|
117
|
+
:global(.ant-checkbox-inner) {
|
|
118
|
+
opacity: 0.5;
|
|
119
|
+
border-color: #ec5d25;
|
|
120
|
+
background-color: #ec5d25;
|
|
121
|
+
}
|
|
122
|
+
:global(.ant-checkbox-inner)::after {
|
|
123
|
+
border-color: #ffffff;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
:global(.ant-checkbox-indeterminate) {
|
|
128
|
+
:global(.ant-checkbox-inner) {
|
|
129
|
+
border-color: #ec5d25 !important;
|
|
130
|
+
background-color: #ec5d25 !important;
|
|
131
|
+
}
|
|
132
|
+
:global(.ant-checkbox-inner)::after {
|
|
133
|
+
inset-inline-start: 50%;
|
|
134
|
+
width: 60%;
|
|
135
|
+
height: 3px;
|
|
136
|
+
border-radius: 4px;
|
|
137
|
+
background: white;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|