@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.
Files changed (89) hide show
  1. package/babel.config.js +7 -0
  2. package/dist/cjs/index.css +1 -1
  3. package/dist/cjs/index.js +75 -4
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +4 -0
  6. package/dist/cjs/types/components/Checkbox/index.d.ts +1 -0
  7. package/dist/cjs/types/components/Checkbox/types.d.ts +11 -0
  8. package/dist/cjs/types/components/Modal/Modal.d.ts +3 -0
  9. package/dist/cjs/types/components/Modal/index.d.ts +1 -0
  10. package/dist/cjs/types/components/Modal/types.d.ts +21 -0
  11. package/dist/cjs/types/components/Radio/Radio.d.ts +4 -0
  12. package/dist/cjs/types/components/Radio/index.d.ts +1 -0
  13. package/dist/cjs/types/components/Radio/types.d.ts +11 -0
  14. package/dist/cjs/types/components/Switch/Switch.d.ts +4 -0
  15. package/dist/cjs/types/components/Switch/index.d.ts +1 -0
  16. package/dist/cjs/types/components/Switch/types.d.ts +7 -0
  17. package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +3 -0
  18. package/dist/cjs/types/components/Tooltip/index.d.ts +1 -0
  19. package/dist/cjs/types/components/Tooltip/types.d.ts +8 -0
  20. package/dist/cjs/types/components/index.d.ts +6 -1
  21. package/dist/esm/index.css +1 -1
  22. package/dist/esm/index.js +73 -7
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/types/components/Checkbox/Checkbox.d.ts +4 -0
  25. package/dist/esm/types/components/Checkbox/index.d.ts +1 -0
  26. package/dist/esm/types/components/Checkbox/types.d.ts +11 -0
  27. package/dist/esm/types/components/Modal/Modal.d.ts +3 -0
  28. package/dist/esm/types/components/Modal/index.d.ts +1 -0
  29. package/dist/esm/types/components/Modal/types.d.ts +21 -0
  30. package/dist/esm/types/components/Radio/Radio.d.ts +4 -0
  31. package/dist/esm/types/components/Radio/index.d.ts +1 -0
  32. package/dist/esm/types/components/Radio/types.d.ts +11 -0
  33. package/dist/esm/types/components/Switch/Switch.d.ts +4 -0
  34. package/dist/esm/types/components/Switch/index.d.ts +1 -0
  35. package/dist/esm/types/components/Switch/types.d.ts +7 -0
  36. package/dist/esm/types/components/Tooltip/Tooltip.d.ts +3 -0
  37. package/dist/esm/types/components/Tooltip/index.d.ts +1 -0
  38. package/dist/esm/types/components/Tooltip/types.d.ts +8 -0
  39. package/dist/esm/types/components/index.d.ts +6 -1
  40. package/dist/types/components/Button/Button.d.ts +4 -0
  41. package/dist/types/components/Button/Button.test.d.ts +1 -0
  42. package/dist/types/components/Button/index.d.ts +1 -0
  43. package/dist/{index.d.ts → types/components/Button/types.d.ts} +1 -7
  44. package/dist/types/components/Checkbox/Checkbox.d.ts +4 -0
  45. package/dist/types/components/Checkbox/index.d.ts +1 -0
  46. package/dist/types/components/Checkbox/types.d.ts +11 -0
  47. package/dist/types/components/Modal/Modal.d.ts +3 -0
  48. package/dist/types/components/Modal/index.d.ts +1 -0
  49. package/dist/types/components/Modal/types.d.ts +21 -0
  50. package/dist/types/components/Radio/Radio.d.ts +4 -0
  51. package/dist/types/components/Radio/index.d.ts +1 -0
  52. package/dist/types/components/Radio/types.d.ts +11 -0
  53. package/dist/types/components/Switch/Switch.d.ts +4 -0
  54. package/dist/types/components/Switch/index.d.ts +1 -0
  55. package/dist/types/components/Switch/types.d.ts +7 -0
  56. package/dist/types/components/Tooltip/Tooltip.d.ts +3 -0
  57. package/dist/types/components/Tooltip/index.d.ts +1 -0
  58. package/dist/types/components/Tooltip/types.d.ts +8 -0
  59. package/dist/types/components/index.d.ts +6 -0
  60. package/dist/types/index.d.ts +1 -0
  61. package/jest.config.js +12 -0
  62. package/package.json +88 -53
  63. package/rollup.config.mjs +6 -6
  64. package/setupTests.ts +1 -0
  65. package/src/components/Button/Button.test.tsx +90 -0
  66. package/src/components/Button/Button.tsx +2 -1
  67. package/src/components/Checkbox/Checkbox.module.scss +141 -0
  68. package/src/components/Checkbox/Checkbox.tsx +56 -0
  69. package/src/components/Checkbox/index.ts +1 -0
  70. package/src/components/Checkbox/types.ts +12 -0
  71. package/src/components/Modal/Modal.module.scss +61 -0
  72. package/src/components/Modal/Modal.tsx +103 -0
  73. package/src/components/Modal/index.ts +1 -0
  74. package/src/components/Modal/types.ts +21 -0
  75. package/src/components/Radio/Radio.module.scss +103 -0
  76. package/src/components/Radio/Radio.tsx +54 -0
  77. package/src/components/Radio/index.ts +1 -0
  78. package/src/components/Radio/types.ts +12 -0
  79. package/src/components/Switch/Switch.module.scss +17 -0
  80. package/src/components/Switch/Switch.tsx +37 -0
  81. package/src/components/Switch/index.ts +1 -0
  82. package/src/components/Switch/types.ts +12 -0
  83. package/src/components/Tooltip/Tooltip.module.scss +12 -0
  84. package/src/components/Tooltip/Tooltip.tsx +29 -0
  85. package/src/components/Tooltip/index.ts +1 -0
  86. package/src/components/Tooltip/types.ts +21 -0
  87. package/src/components/index.ts +7 -1
  88. package/src/types/jest.d.ts +10 -0
  89. package/tsconfig.json +39 -37
@@ -0,0 +1,56 @@
1
+ import * as React from "react";
2
+ import { Checkbox as AntCheckbox } from "antd";
3
+ import clsx from "clsx";
4
+ import PropTypes from "prop-types";
5
+
6
+ import classes from "./Checkbox.module.scss";
7
+ import { CheckboxProps } from "./types";
8
+
9
+ const Checkbox: React.FC<CheckboxProps> = (props) => {
10
+ const {
11
+ className = "",
12
+ children = null,
13
+ onChange = () => {},
14
+ checked = false,
15
+ disabled = false,
16
+ size = "small",
17
+ variant = "normal",
18
+ indeterminate = false,
19
+ ...rest
20
+ } = props;
21
+ return (
22
+ <AntCheckbox
23
+ className={clsx(
24
+ classes.checkbox,
25
+ classes[`size_${size}`],
26
+ classes[`variant_${variant}`],
27
+ checked ? classes.type_checked : classes.type_unchecked,
28
+ disabled && classes.disabled,
29
+ indeterminate && classes[`variant_indeterminate`],
30
+ className
31
+ )}
32
+ onChange={onChange}
33
+ checked={checked}
34
+ disabled={disabled}
35
+ indeterminate={indeterminate}
36
+ {...rest}
37
+ >
38
+ {children}
39
+ </AntCheckbox>
40
+ );
41
+ };
42
+ ``;
43
+ Checkbox.propTypes = {
44
+ checked: PropTypes.bool,
45
+ className: PropTypes.string,
46
+ size: PropTypes.oneOf(["large", "small", "medium"]),
47
+ variant: PropTypes.oneOf(["normal", "emphasized"]),
48
+ onChange: PropTypes.func,
49
+ children: PropTypes.element,
50
+ disabled: PropTypes.bool,
51
+ indeterminate: PropTypes.bool,
52
+ };
53
+
54
+ Checkbox.displayName = "Checkbox";
55
+
56
+ export default Checkbox;
@@ -0,0 +1 @@
1
+ export { default as Checkbox } from "./Checkbox";
@@ -0,0 +1,12 @@
1
+ import { CheckboxChangeEvent } from 'antd/es/checkbox';
2
+
3
+ export interface CheckboxProps {
4
+ checked?: boolean;
5
+ className?: string;
6
+ onChange?: (e: CheckboxChangeEvent) => void;
7
+ children?: React.ReactNode;
8
+ size?: "large" | "small" | "medium",
9
+ variant?: "normal" | "emphasized",
10
+ disabled?: boolean,
11
+ indeterminate?: boolean,
12
+ }
@@ -0,0 +1,61 @@
1
+ .modal {
2
+ &.footerMargintopDisable {
3
+ .ant-modal-footer {
4
+ margin-top: 0;
5
+ @apply tw-mt-0;
6
+ }
7
+ }
8
+ :global(.ant-modal-footer) {
9
+ :global(.primaryFooter) {
10
+ padding: 24px;
11
+ @apply tw-p-6;
12
+ @apply tw-flex tw-justify-end;
13
+ .okBtn,
14
+ .cancelBtn {
15
+ min-width: 92px;
16
+ }
17
+ }
18
+ :global(.secondaryFooter) {
19
+ padding: 24px;
20
+ @apply tw-p-6;
21
+ @apply tw-pt-0;
22
+ @apply tw-flex tw-justify-end;
23
+ .okBtn,
24
+ .cancelBtn {
25
+ width: 50%;
26
+ }
27
+ }
28
+ }
29
+ :global(.ant-modal-content) {
30
+ padding: 0;
31
+ @apply tw-rounded-xl;
32
+ @apply tw-p-0;
33
+ :global(.ant-modal-header) {
34
+ @apply tw-p-4 sm:tw-p-6 tw-mb-0;
35
+ :global(.ant-modal-title) {
36
+ justify-content: flex-start;
37
+ @apply tw-font-medium tw-text-font-size-50 tw-leading-7 tw-text-color-surface-dark tw-pr-5;
38
+ }
39
+ }
40
+ :global(.ant-modal-close) {
41
+ display: flex;
42
+ @apply tw-flex tw-items-end tw-justify-center;
43
+ :global(.ant-modal-close-x) {
44
+ display: flex;
45
+ @apply tw-flex tw-items-center tw-justify-center;
46
+ }
47
+ }
48
+ :global(.ant-modal-body) {
49
+ padding: 0 1.5rem 1.5rem;
50
+ max-height: 80vh;
51
+ overflow: auto;
52
+ }
53
+ :global(.ant-modal-close) {
54
+ @apply tw-top-6 tw-right-6 tw-pb-1;
55
+ }
56
+ }
57
+ :global(.ant-btn-primary) {
58
+ margin-inline-start: 0.5rem;
59
+ @apply tw-ms-2;
60
+ }
61
+ }
@@ -0,0 +1,103 @@
1
+ import { Modal as AntModal } from "antd";
2
+ import clsx from "clsx";
3
+ import classes from "./Modal.module.scss";
4
+ import { Button } from "../Button";
5
+ import { ModalProps } from "./types";
6
+
7
+ const Close = ({ size = 14, color = "#B6BAC3", ...rest }) => {
8
+ return (
9
+ <svg
10
+ width={size}
11
+ height={size}
12
+ viewBox="0 0 14 14"
13
+ fill="none"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ {...rest}
16
+ >
17
+ <path
18
+ d="M0.292893 0.292893C0.683417 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L7 5.58579L12.2929 0.292893C12.6834 -0.0976311 13.3166 -0.0976311 13.7071 0.292893C14.0976 0.683417 14.0976 1.31658 13.7071 1.70711L8.41421 7L13.7071 12.2929C14.0976 12.6834 14.0976 13.3166 13.7071 13.7071C13.3166 14.0976 12.6834 14.0976 12.2929 13.7071L7 8.41421L1.70711 13.7071C1.31658 14.0976 0.683417 14.0976 0.292893 13.7071C-0.0976311 13.3166 -0.0976311 12.6834 0.292893 12.2929L5.58579 7L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z"
19
+ fill={color}
20
+ />
21
+ </svg>
22
+ );
23
+ };
24
+
25
+ const Modal: React.FC<ModalProps> = ({
26
+ className = "",
27
+ title = "",
28
+ children,
29
+ open = false,
30
+ handleOk,
31
+ handleCancel,
32
+ okText = "",
33
+ cancelText = "",
34
+ closeIcon = <Close color="#6B7280" />,
35
+ bodyClassName = "modalBody",
36
+ outsideClickDisable = false,
37
+ hideCross = false,
38
+ okButtonLoading = false,
39
+ okButtonDisabled = false,
40
+ variant = "primary",
41
+ okBtnClasses = "",
42
+ cancelButtonAnalytics = {},
43
+ okButtonAnalytics = {},
44
+ footerMargintopDisable = true,
45
+ ...rest
46
+ }) => {
47
+ return (
48
+ <div onClick={(e) => e.stopPropagation()}>
49
+ <AntModal
50
+ title={title}
51
+ open={open}
52
+ onOk={handleOk}
53
+ onCancel={handleCancel}
54
+ className={clsx(classes.modal, className, {
55
+ footerMargintopDisable: footerMargintopDisable,
56
+ })}
57
+ okText={okText}
58
+ cancelText={cancelText}
59
+ closeIcon={closeIcon}
60
+ closable={!hideCross}
61
+ maskClosable={!outsideClickDisable}
62
+ footer={
63
+ okText || cancelText ? (
64
+ <div
65
+ className={clsx({
66
+ primaryFooter: variant === "primary",
67
+ secondaryFooter: variant === "secondary",
68
+ })}
69
+ >
70
+ {cancelText && (
71
+ <Button
72
+ onClick={handleCancel as React.MouseEventHandler<HTMLElement>}
73
+ type="secondary"
74
+ className="cancelBtn"
75
+ variant='subtle'
76
+ {...cancelButtonAnalytics}
77
+ >
78
+ {cancelText}
79
+ </Button>
80
+ )}
81
+ {okText && (
82
+ <Button
83
+ onClick={handleOk as React.MouseEventHandler<HTMLElement>}
84
+ className={clsx(okBtnClasses, "okBtn")}
85
+ loading={okButtonLoading}
86
+ disabled={okButtonDisabled}
87
+ {...okButtonAnalytics}
88
+ >
89
+ {okText}
90
+ </Button>
91
+ )}
92
+ </div>
93
+ ) : null
94
+ }
95
+ {...rest}
96
+ >
97
+ <div className={bodyClassName}>{children}</div>
98
+ </AntModal>
99
+ </div>
100
+ );
101
+ };
102
+
103
+ export default Modal;
@@ -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,103 @@
1
+ .radio {
2
+ display: flex;
3
+ align-items: center;
4
+ &.size_small {
5
+ :global(.ant-radio) {
6
+ :global(.ant-radio-inner) {
7
+ height: 16px;;
8
+ width: 16px;;
9
+ }
10
+ }
11
+ }
12
+ &.size_medium {
13
+ :global(.ant-radio) {
14
+ :global(.ant-radio-inner) {
15
+ height: 20px;;
16
+ width: 20px;;
17
+ }
18
+ }
19
+ }
20
+ &.size_large {
21
+ :global(.ant-radio) {
22
+ :global(.ant-radio-inner) {
23
+ height: 24px;;
24
+ width: 24px;;
25
+ }
26
+ }
27
+ }
28
+
29
+ &.type_checked {
30
+ :global(.ant-radio-checked) {
31
+ :global(.ant-radio-inner) {
32
+ border-color: #EC5D25 ;
33
+ background-color: #EC5D25;
34
+ }
35
+ }
36
+
37
+ :global(.ant-radio-checked):hover {
38
+ :global(.ant-radio-inner){
39
+ border-color: #B94710 ;
40
+ background-color: #B94710 ;
41
+ }
42
+ }
43
+ :global(.ant-radio-checked):focus-visible {
44
+ outline: 2px solid #0A65E7;
45
+ }
46
+
47
+ &.disabled {
48
+ @apply tw-cursor-not-allowed;
49
+
50
+ :global(.ant-radio-checked) {
51
+ :global(.ant-radio-inner){
52
+ border-color: #B6BAC3 ;
53
+ background-color: #B6BAC3 ;
54
+ }
55
+ :global(.ant-radio-inner)::after {
56
+ transform: scale(0.375);
57
+ background-color: #FFFFFF;
58
+ }
59
+ }
60
+ }
61
+ }
62
+
63
+ &.type_unchecked {
64
+ :global(.ant-radio) {
65
+ :global(.ant-radio-inner) {
66
+ border-color: #B6BAC3 ;
67
+ }
68
+ }
69
+
70
+ :global(.ant-radio):hover {
71
+ :global(.ant-radio-inner){
72
+ border-color: #6B7280 ;
73
+ }
74
+ }
75
+ :global(.ant-radio):focus-visible {
76
+ outline: 2px solid #0A65E7;
77
+ }
78
+
79
+ &.disabled {
80
+ @apply tw-cursor-not-allowed;
81
+
82
+ :global(.ant-radio) {
83
+ :global(.ant-radio-inner){
84
+ border-color: #B6BAC3 ;
85
+ background-color: #F9FAFB;
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ &.variant_normal {
92
+ color: #363E4F;
93
+ font-weight: 400;
94
+ font-size: 0.875rem /* 14px */;
95
+ line-height: 20px;
96
+ }
97
+ &.variant_emphasized {
98
+ color: #363E4F;
99
+ font-weight: 500;
100
+ font-size: 0.875rem /* 14px */;
101
+ line-height: 20px;
102
+ }
103
+ }
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import { Radio as AntRadio } from "antd";
3
+ import clsx from "clsx";
4
+ import PropTypes from "prop-types";
5
+
6
+ import classes from "./Radio.module.scss";
7
+ import { RadioProps } from "./types";
8
+
9
+ const Radio: React.FC<RadioProps> = ({
10
+ checked = true,
11
+ className = "",
12
+ size = "small",
13
+ variant = "normal",
14
+ children,
15
+ onChange = () => {},
16
+ disabled = false,
17
+ extra = null,
18
+ ...rest
19
+ }) => (
20
+ <>
21
+ <AntRadio
22
+ className={clsx(
23
+ classes.radio,
24
+ classes[`size_${size}`],
25
+ classes[`variant_${variant}`],
26
+ checked ? classes.type_checked : classes.type_unchecked,
27
+ disabled && classes.disabled,
28
+ className
29
+ )}
30
+ onChange={onChange}
31
+ checked={checked}
32
+ disabled={disabled}
33
+ {...rest}
34
+ >
35
+ {children}
36
+ </AntRadio>
37
+ {checked && extra}
38
+ </>
39
+ );
40
+
41
+ Radio.propTypes = {
42
+ checked: PropTypes.bool,
43
+ className: PropTypes.string,
44
+ size: PropTypes.oneOf(["large", "small", "medium"]),
45
+ variant: PropTypes.oneOf(["normal", "emphasized"]),
46
+ onChange: PropTypes.func,
47
+ children: PropTypes.element,
48
+ disabled: PropTypes.bool,
49
+ extra: PropTypes.element,
50
+ };
51
+
52
+ Radio.displayName = "Radio";
53
+
54
+ export default Radio;
@@ -0,0 +1 @@
1
+ export { default as Radio } from "./Radio";
@@ -0,0 +1,12 @@
1
+ import { RadioChangeEvent } from "antd/lib/radio";
2
+
3
+ export interface RadioProps {
4
+ checked?: boolean;
5
+ className?: string;
6
+ onChange?: (event: RadioChangeEvent) => void;
7
+ children?: React.ReactNode;
8
+ size?: "large" | "small" | "medium";
9
+ variant?: "normal" | "emphasized";
10
+ disabled?: boolean;
11
+ extra?: React.ReactNode;
12
+ }
@@ -0,0 +1,17 @@
1
+ .switch {
2
+ &:global(.ant-switch.ant-switch-small) {
3
+ @apply tw-h-3 tw-min-w-6;
4
+ :global(.ant-switch-handle) {
5
+ @apply tw-h-2 tw-w-2;
6
+ }
7
+ }
8
+ &:global(.ant-switch) {
9
+ &:global(.ant-switch-checked) {
10
+ @apply tw-bg-color-action-primary;
11
+
12
+ }
13
+ &:global(.ant-switch-checked):hover{
14
+ @apply tw-bg-color-action-primary;
15
+ }
16
+ }
17
+ }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import { Switch as AntSwitch } from "antd";
3
+ import clsx from "clsx";
4
+ import PropTypes from "prop-types";
5
+
6
+ import classes from "./Switch.module.scss";
7
+ import { SwitchProps } from "./types";
8
+
9
+ const Switch: React.FC<SwitchProps> = ({
10
+ className,
11
+ onChange = () => {},
12
+ size = "default",
13
+ disabled = false,
14
+ checked = false,
15
+ ...rest
16
+ }) => {
17
+ return (
18
+ <AntSwitch
19
+ className={clsx(className, classes.switch, classes[size])}
20
+ onChange={onChange}
21
+ size={size}
22
+ disabled={disabled}
23
+ checked={checked}
24
+ {...rest}
25
+ />
26
+ );
27
+ };
28
+
29
+ Switch.propTypes = {
30
+ onChange: PropTypes.func,
31
+ size: PropTypes.oneOf(["small", "default"]),
32
+ disabled: PropTypes.bool,
33
+ checked: PropTypes.bool,
34
+ };
35
+
36
+ export default Switch;
37
+ Switch.displayName = "Switch";
@@ -0,0 +1 @@
1
+ export { default as Switch } from "./Switch";
@@ -0,0 +1,12 @@
1
+ export interface SwitchProps {
2
+ size?: "default" | "small";
3
+ className?: string | undefined;
4
+ onChange?: (
5
+ checked: boolean,
6
+ event:
7
+ | React.MouseEvent<HTMLButtonElement>
8
+ | React.KeyboardEvent<HTMLButtonElement>
9
+ ) => void;
10
+ disabled?: boolean;
11
+ checked?: boolean;
12
+ }
@@ -0,0 +1,12 @@
1
+ .light {
2
+ :global(.ant-tooltip-content) {
3
+ :global(.ant-tooltip-inner) {
4
+ background-color: white !important;
5
+ color: #111827;
6
+ @apply tw-text-color-border-dark-subtle tw-rounded-lg tw-p-2.5;
7
+ }
8
+ }
9
+ :global(.ant-tooltip-arrow:before) {
10
+ background-color: white !important;
11
+ }
12
+ }
@@ -0,0 +1,29 @@
1
+ import { Tooltip as AntTooltip } from "antd";
2
+
3
+ import classes from "./Tooltip.module.scss";
4
+ import { TooltipProps } from "./types";
5
+
6
+ const Tooltip: React.FC<TooltipProps> = ({
7
+ children,
8
+ title = "",
9
+ placement = "top",
10
+ color = "#1F2937",
11
+ className,
12
+ mode = "dark",
13
+ ...rest
14
+ }) => {
15
+ return (
16
+ <AntTooltip
17
+ className={className}
18
+ color={color}
19
+ title={title}
20
+ placement={placement}
21
+ overlayClassName={mode === "light" ? classes.light : ""}
22
+ {...rest}
23
+ >
24
+ {children}
25
+ </AntTooltip>
26
+ );
27
+ };
28
+
29
+ export default Tooltip;
@@ -0,0 +1 @@
1
+ export { default as Tooltip } from "./Tooltip";
@@ -0,0 +1,21 @@
1
+ export interface TooltipProps {
2
+ children?: React.ReactNode;
3
+ title?: string | undefined;
4
+ placement?:
5
+ | "top"
6
+ | "left"
7
+ | "right"
8
+ | "bottom"
9
+ | "topLeft"
10
+ | "topRight"
11
+ | "bottomLeft"
12
+ | "bottomRight"
13
+ | "leftTop"
14
+ | "leftBottom"
15
+ | "rightTop"
16
+ | "rightBottom"
17
+ | undefined;
18
+ color?: string | undefined;
19
+ className?: string | undefined;
20
+ mode?: "light" | "dark";
21
+ }
@@ -1 +1,7 @@
1
- export * from './Button';
1
+ export * from "./Button";
2
+ export * from "./Switch";
3
+ export * from "./Modal";
4
+ export * from "./Tooltip";
5
+
6
+ export * from './Checkbox'
7
+ export * from './Radio';
@@ -0,0 +1,10 @@
1
+ // src/types/jest.d.ts
2
+ import '@testing-library/jest-dom';
3
+
4
+ declare global {
5
+ namespace jest {
6
+ interface Matchers<R> {
7
+ toBeInTheDocument(): R;
8
+ }
9
+ }
10
+ }
package/tsconfig.json CHANGED
@@ -1,39 +1,41 @@
1
1
  {
2
2
  "compilerOptions": {
3
- /* Language and Environment */
4
- "target": "esnext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
5
- "jsx": "react-jsx" /* Specify what JSX code is generated. */,
6
-
7
- /* Modules */
8
- "module": "ESNext" /* Specify what module code is generated. */,
9
- "moduleResolution": "Node" /* Specify how TypeScript looks up a file from a given module specifier. */,
10
-
11
- /* JavaScript Support */
12
- "allowJs": false /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
13
- "maxNodeModuleJsDepth": 1 /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */,
14
-
15
- /* Emit */
16
- "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
17
- "emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */,
18
- "sourceMap": true /* Create source map files for emitted JavaScript files. */,
19
- "outDir": "dist" /* Specify an output folder for all emitted files. */,
20
- "declarationDir": "types" /* Specify the output directory for generated declaration files. */,
21
-
22
- /* Interop Constraints */
23
- "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
24
- "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
25
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
26
-
27
- /* Type Checking */
28
- "strict": true /* Enable all strict type-checking options. */,
29
- "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
30
- "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
31
- "noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
32
- "noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
33
- "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
34
- "allowUnreachableCode": false /* Disable error reporting for unreachable code. */,
35
-
36
- /* Completeness */
37
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
38
- }
39
- }
3
+ /* Language and Environment */
4
+ "target": "esnext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
5
+ "jsx": "react-jsx" /* Specify what JSX code is generated. */,
6
+
7
+ /* Modules */
8
+ "module": "ESNext" /* Specify what module code is generated. */,
9
+ "moduleResolution": "Node" /* Specify how TypeScript looks up a file from a given module specifier. */,
10
+
11
+ /* JavaScript Support */
12
+ "allowJs": false /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
13
+ "maxNodeModuleJsDepth": 1 /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */,
14
+
15
+ /* Emit */
16
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
17
+ "emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */,
18
+ "sourceMap": true /* Create source map files for emitted JavaScript files. */,
19
+ "outDir": "dist" /* Specify an output folder for all emitted files. */,
20
+ "declarationDir": "dist/types" /* Specify the output directory for generated declaration files. */,
21
+
22
+ /* Interop Constraints */
23
+ "allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
24
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
25
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
26
+
27
+ /* Type Checking */
28
+ "strict": true /* Enable all strict type-checking options. */,
29
+ "noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
30
+ "noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
31
+ "noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
32
+ "noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
33
+ "noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
34
+ "allowUnreachableCode": false /* Disable error reporting for unreachable code. */,
35
+
36
+ /* Completeness */
37
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */,
38
+ // "types": ["@testing-library/jest-dom", "jest"]
39
+ },
40
+ "include": ["src", "src/types"]
41
+ }