@datability/8ui 1.0.0 → 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/.prettierrc +8 -0
- package/.vscode/extensions.json +6 -0
- package/README.md +1 -3
- package/declaration.d.ts +10 -0
- package/docker-compose.yml +20 -0
- package/eslint.config.js +23 -0
- package/{dist/index.html → index.html} +1 -2
- package/package.json +13 -14
- package/src/App.tsx +370 -0
- package/src/components/assets/closed.svg +4 -0
- package/src/components/assets/expand-arrow.svg +3 -0
- package/src/components/assets/visibility-off.svg +5 -0
- package/src/components/assets/visibility.svg +5 -0
- package/src/components/blackdrop/index.scss +16 -0
- package/src/components/blackdrop/index.tsx +18 -0
- package/src/components/blackdrop/index.type.ts +7 -0
- package/src/components/button/index.scss +40 -0
- package/src/components/button/index.tsx +44 -0
- package/src/components/button/index.type.ts +13 -0
- package/src/components/chip/index.scss +32 -0
- package/src/components/chip/index.tsx +39 -0
- package/src/components/chip/index.type.ts +12 -0
- package/src/components/context.tsx +26 -0
- package/src/components/divider/index.scss +4 -0
- package/src/components/divider/index.tsx +13 -0
- package/src/components/index.ts +62 -0
- package/src/components/input/extend.scss +19 -0
- package/src/components/input/input-auto-complete/index.scss +53 -0
- package/src/components/input/input-auto-complete/index.tsx +140 -0
- package/src/components/input/input-auto-complete/index.type.tsx +13 -0
- package/src/components/input/input-base/index.scss +14 -0
- package/src/components/input/input-base/index.tsx +39 -0
- package/src/components/input/input-base/index.type.tsx +13 -0
- package/src/components/input/input-basic/index.scss +9 -0
- package/src/components/input/input-basic/index.tsx +47 -0
- package/src/components/input/input-basic/index.type.tsx +8 -0
- package/src/components/input/input-checkbox/index.scss +30 -0
- package/src/components/input/input-checkbox/index.tsx +69 -0
- package/src/components/input/input-checkbox/index.type.tsx +11 -0
- package/src/components/input/input-date/index.scss +102 -0
- package/src/components/input/input-date/index.tsx +354 -0
- package/src/components/input/input-date/index.type.tsx +11 -0
- package/src/components/input/input-date-range/index.scss +101 -0
- package/src/components/input/input-date-range/index.tsx +284 -0
- package/src/components/input/input-date-range/index.type.tsx +11 -0
- package/src/components/input/input-date-time/index.scss +179 -0
- package/src/components/input/input-date-time/index.tsx +367 -0
- package/src/components/input/input-date-time/index.type.tsx +11 -0
- package/src/components/input/input-number/index.scss +9 -0
- package/src/components/input/input-number/index.tsx +118 -0
- package/src/components/input/input-number/index.type.tsx +11 -0
- package/src/components/input/input-password/index.scss +22 -0
- package/src/components/input/input-password/index.tsx +60 -0
- package/src/components/input/input-password/index.type.tsx +8 -0
- package/src/components/input/input-radio/index.scss +35 -0
- package/src/components/input/input-radio/index.tsx +72 -0
- package/src/components/input/input-radio/index.type.tsx +12 -0
- package/src/components/input/input-select/index.scss +81 -0
- package/src/components/input/input-select/index.tsx +113 -0
- package/src/components/input/input-select/index.type.tsx +15 -0
- package/src/components/input/input-switch/index.scss +84 -0
- package/src/components/input/input-switch/index.tsx +44 -0
- package/src/components/input/input-switch/index.type.tsx +4 -0
- package/src/components/input/input-textarea/index.scss +10 -0
- package/src/components/input/input-textarea/index.tsx +48 -0
- package/src/components/input/input-textarea/index.type.tsx +10 -0
- package/src/components/menu/index.scss +30 -0
- package/src/components/menu/index.tsx +136 -0
- package/src/components/menu/index.type.ts +8 -0
- package/src/components/modal/index.scss +33 -0
- package/src/components/modal/index.tsx +99 -0
- package/src/components/modal/index.type.tsx +8 -0
- package/src/index.scss +44 -0
- package/src/index.ts +62 -0
- package/src/logoDownload.svg +3 -0
- package/src/main.tsx +9 -0
- package/tsconfig.app.json +28 -0
- package/tsconfig.json +42 -0
- package/tsconfig.node.json +29 -0
- package/vite.config.d.ts +2 -0
- package/vite.config.ts +35 -0
- package/dist/assets/index-BYmsRLQS.js +0 -48
- package/dist/assets/index-QxCDX2bt.css +0 -1
- /package/{dist → public}/vite.svg +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.DBui-modalContent {
|
|
2
|
+
top: 50%;
|
|
3
|
+
left: 50%;
|
|
4
|
+
transform: translate(-50%, -50%);
|
|
5
|
+
position: absolute;
|
|
6
|
+
border-radius: 1em;
|
|
7
|
+
background-color: #FFFFFF;
|
|
8
|
+
box-shadow: rgba(0, 0, 0, 0.2) 0px 11px 15px -7px, rgba(0, 0, 0, 0.14) 0px 24px 38px 3px, rgba(0, 0, 0, 0.12) 0px 9px 46px 8px;
|
|
9
|
+
min-width: 320px;
|
|
10
|
+
min-height: 150px;
|
|
11
|
+
overflow-x: hidden;
|
|
12
|
+
overflow-y: scroll;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
|
|
16
|
+
&::-webkit-scrollbar {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.DBui-close {
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 10px;
|
|
23
|
+
right: 10px;
|
|
24
|
+
width: 30px;
|
|
25
|
+
height: 30px;
|
|
26
|
+
z-index: var(--z-index-normale);
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
opacity: 0.5;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Lib
|
|
2
|
+
import React, { useContext, useEffect, useRef, type JSX } from "react"
|
|
3
|
+
|
|
4
|
+
//Images
|
|
5
|
+
import closedSVG from "../assets/closed.svg"
|
|
6
|
+
|
|
7
|
+
// Include in project
|
|
8
|
+
import "./index.scss"
|
|
9
|
+
import Blackdrop from "../blackdrop"
|
|
10
|
+
import { DBuiContext } from "../context"
|
|
11
|
+
import type { PropsModal } from "./index.type"
|
|
12
|
+
|
|
13
|
+
const Modal: React.FC<PropsModal> = ({ children, open, onClose, id }): JSX.Element => {
|
|
14
|
+
const { openModalCount, setOpenModalCount } = useContext(DBuiContext)
|
|
15
|
+
const setModalIncress = () => setOpenModalCount?.((prev) => prev + 1)
|
|
16
|
+
const setModalDecress = () => setOpenModalCount?.((prev) => prev - 1)
|
|
17
|
+
const setModalZero = () => setOpenModalCount?.(0)
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
const modalRef = useRef<any>(null)
|
|
21
|
+
|
|
22
|
+
// whitelist for portal UI
|
|
23
|
+
const WHITELIST_CLASSES = [
|
|
24
|
+
"DBui-wrapperMenuItem",
|
|
25
|
+
"DBui-inputDateWrapperCalendar",
|
|
26
|
+
"DBui-inputDateRangeRowMonthYearSelected",
|
|
27
|
+
"DBui-inputDateTimeWrapperCalendar",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
// Update the global counter and adjust the overflow style
|
|
32
|
+
if (open) {
|
|
33
|
+
setModalIncress()
|
|
34
|
+
document.body.style.overflow = "hidden"
|
|
35
|
+
} else {
|
|
36
|
+
if (openModalCount <= 0) {
|
|
37
|
+
setModalZero()
|
|
38
|
+
document.body.style.overflow = "visible"
|
|
39
|
+
} else {
|
|
40
|
+
setModalDecress()
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return () => {
|
|
45
|
+
if (openModalCount === 0) {
|
|
46
|
+
document.body.style.overflow = "visible"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}, [open])
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const modalElements = document.querySelectorAll(".DBui-modalBase")
|
|
53
|
+
const modalArray = Array.from(modalElements)
|
|
54
|
+
const showModals = modalArray.filter((modal) => modal.getAttribute("data-hidden") === "false")
|
|
55
|
+
const topModal = showModals[showModals.length - 1]
|
|
56
|
+
|
|
57
|
+
if (topModal?.getAttribute("id") !== id) return
|
|
58
|
+
|
|
59
|
+
// ---------- ESC CLOSE ----------
|
|
60
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
61
|
+
if (event.key === "Escape" || event.keyCode === 27) {
|
|
62
|
+
onClose()
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ---------- CLICK OUTSIDE CLOSE ----------
|
|
67
|
+
function handleClickOutside(e: MouseEvent) {
|
|
68
|
+
const target = e.target as HTMLElement
|
|
69
|
+
|
|
70
|
+
// ถ้า click ใน modal → ไม่ปิด
|
|
71
|
+
if (modalRef.current?.contains(target)) return
|
|
72
|
+
|
|
73
|
+
// ถ้า click ใน whitelist (menu, dropdown, select panel)
|
|
74
|
+
const isInWhitelist = WHITELIST_CLASSES.some((cls) => target.closest("." + cls))
|
|
75
|
+
if (isInWhitelist) return
|
|
76
|
+
|
|
77
|
+
onClose()
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
document.addEventListener("keydown", handleKeydown)
|
|
81
|
+
document.addEventListener("mousedown", handleClickOutside)
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
document.removeEventListener("keydown", handleKeydown)
|
|
85
|
+
document.removeEventListener("mousedown", handleClickOutside)
|
|
86
|
+
}
|
|
87
|
+
}, [openModalCount])
|
|
88
|
+
|
|
89
|
+
return (
|
|
90
|
+
<Blackdrop open={open}>
|
|
91
|
+
<div className="DBui-modalBase DBui-modalContent" data-hidden={!open} ref={modalRef} id={id}>
|
|
92
|
+
<img src={closedSVG} alt="" className="DBui-close" onClick={onClose} />
|
|
93
|
+
<div>{children}</div>
|
|
94
|
+
</div>
|
|
95
|
+
</Blackdrop>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default Modal
|
package/src/index.scss
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
* {
|
|
2
|
+
outline: none !important;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
body {
|
|
7
|
+
margin: 1em 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.row {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
width: 70%;
|
|
17
|
+
min-height: 100px;
|
|
18
|
+
background-color: #FAFAFA;
|
|
19
|
+
border: 1px solid #E3E3E8;
|
|
20
|
+
margin: 1em 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.column {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.align-center {
|
|
29
|
+
align-items: center;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.gap-sm {
|
|
33
|
+
gap: 1em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h1,
|
|
37
|
+
h2,
|
|
38
|
+
h3,
|
|
39
|
+
h4,
|
|
40
|
+
h5,
|
|
41
|
+
h6,
|
|
42
|
+
p {
|
|
43
|
+
margin: 0;
|
|
44
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export { default as Button } from "./components/button"
|
|
2
|
+
export type { PropsButton } from "./components/button/index.type"
|
|
3
|
+
|
|
4
|
+
export { default as Blackdrop } from "./components/blackdrop" // Need variable --z-index-backdrop
|
|
5
|
+
export type { PropsBlackdrop } from "./components/blackdrop/index.type"
|
|
6
|
+
|
|
7
|
+
export { default as Chip } from "./components/chip"
|
|
8
|
+
export type { PropsChip } from "./components/chip/index.type"
|
|
9
|
+
|
|
10
|
+
export { default as Divider } from "./components/divider"
|
|
11
|
+
|
|
12
|
+
export { default as Menu } from "./components/menu" // Need variable --z-index-menu
|
|
13
|
+
export type { PropsMenu } from "./components/menu/index.type"
|
|
14
|
+
|
|
15
|
+
export { default as Modal } from "./components/modal" // Need variable --z-index-normale
|
|
16
|
+
export type { PropsModal } from "./components/modal/index.type"
|
|
17
|
+
|
|
18
|
+
export { default as Input } from "./components/input/input-basic"
|
|
19
|
+
export type { PropsInputBasic as PropsInput } from "./components/input/input-basic/index.type"
|
|
20
|
+
|
|
21
|
+
export { default as InputNumber } from "./components/input/input-number"
|
|
22
|
+
export type { PropsInputNumber } from "./components/input/input-number/index.type"
|
|
23
|
+
|
|
24
|
+
export { default as InputDate } from "./components/input/input-date"
|
|
25
|
+
export type { PropsInputDate } from "./components/input/input-date/index.type"
|
|
26
|
+
|
|
27
|
+
export { default as InputDateRange } from "./components/input/input-date-range"
|
|
28
|
+
export type { PropsInputDateRange } from "./components/input/input-date-range/index.type"
|
|
29
|
+
|
|
30
|
+
export { default as InputDateTime } from "./components/input/input-date-time"
|
|
31
|
+
export type { PropsInputDateTime } from "./components/input/input-date-time/index.type"
|
|
32
|
+
|
|
33
|
+
export { default as InputPassword } from "./components/input/input-password"
|
|
34
|
+
export type { PropsInputPassword } from "./components/input/input-password/index.type"
|
|
35
|
+
|
|
36
|
+
export { default as InputRadio } from "./components/input/input-radio"
|
|
37
|
+
export type { PropsInputRadio } from "./components/input/input-radio/index.type"
|
|
38
|
+
|
|
39
|
+
export { default as InputCheckbox } from "./components/input/input-checkbox"
|
|
40
|
+
export type { PropsInputCheckbox } from "./components/input/input-checkbox/index.type"
|
|
41
|
+
|
|
42
|
+
export { default as InputTextarea } from "./components/input/input-textarea"
|
|
43
|
+
export type { PropsInputTextarea } from "./components/input/input-textarea/index.type"
|
|
44
|
+
|
|
45
|
+
export { default as InputSelect } from "./components/input/input-select"
|
|
46
|
+
export type { PropsInputSelect } from "./components/input/input-select/index.type"
|
|
47
|
+
|
|
48
|
+
export { default as InputAutoComplete } from "./components/input/input-auto-complete"
|
|
49
|
+
export type { PropsInputAutoComplete } from "./components/input/input-auto-complete/index.type"
|
|
50
|
+
|
|
51
|
+
export { default as InputSwitch } from "./components/input/input-switch"
|
|
52
|
+
export type { PropsInputSwitch } from "./components/input/input-switch/index.type"
|
|
53
|
+
|
|
54
|
+
// Type
|
|
55
|
+
export type TValueOption = string | number
|
|
56
|
+
export type TOption = {
|
|
57
|
+
label: string
|
|
58
|
+
value: TValueOption
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Context
|
|
62
|
+
export { DBuiContext, DBuiProvider } from "./components/context"
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="13" height="14" viewBox="0 0 13 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3.77508 4.84992C3.69885 4.77369 3.65602 4.6703 3.65602 4.5625C3.65602 4.4547 3.69885 4.35131 3.77508 4.27508C3.85131 4.19885 3.9547 4.15602 4.0625 4.15602C4.1703 4.15602 4.27369 4.19885 4.34992 4.27508L6.09375 6.01941V1.71875C6.09375 1.61101 6.13655 1.50767 6.21274 1.43149C6.28892 1.3553 6.39226 1.3125 6.5 1.3125C6.60774 1.3125 6.71108 1.3553 6.78726 1.43149C6.86345 1.50767 6.90625 1.61101 6.90625 1.71875V6.01941L8.65008 4.27508C8.72631 4.19885 8.8297 4.15602 8.9375 4.15602C9.0453 4.15602 9.14869 4.19885 9.22492 4.27508C9.30115 4.35131 9.34398 4.4547 9.34398 4.5625C9.34398 4.6703 9.30115 4.77369 9.22492 4.84992L6.78742 7.28742C6.74969 7.32519 6.70489 7.35516 6.65557 7.3756C6.60625 7.39605 6.55339 7.40657 6.5 7.40657C6.44661 7.40657 6.39375 7.39605 6.34443 7.3756C6.29511 7.35516 6.25031 7.32519 6.21258 7.28742L3.77508 4.84992ZM12.1875 7.40625V10.6562C12.1875 10.8717 12.1019 11.0784 11.9495 11.2308C11.7972 11.3831 11.5905 11.4688 11.375 11.4688H1.625C1.40951 11.4688 1.20285 11.3831 1.05048 11.2308C0.898102 11.0784 0.8125 10.8717 0.8125 10.6562V7.40625C0.8125 7.19076 0.898102 6.9841 1.05048 6.83173C1.20285 6.67935 1.40951 6.59375 1.625 6.59375H4.28594C4.31262 6.59373 4.33905 6.59897 4.3637 6.60916C4.38836 6.61935 4.41077 6.63431 4.42965 6.65316L5.63672 7.86328C5.74994 7.9769 5.88449 8.06705 6.03263 8.12857C6.18077 8.19008 6.3396 8.22174 6.5 8.22174C6.6604 8.22174 6.81923 8.19008 6.96737 8.12857C7.11551 8.06705 7.25006 7.9769 7.36328 7.86328L8.57188 6.65469C8.60938 6.61642 8.66048 6.59451 8.71406 6.59375H11.375C11.5905 6.59375 11.7972 6.67935 11.9495 6.83173C12.1019 6.9841 12.1875 7.19076 12.1875 7.40625ZM10.1562 9.03125C10.1562 8.91073 10.1205 8.79291 10.0536 8.6927C9.98659 8.59249 9.89142 8.51438 9.78007 8.46826C9.66872 8.42214 9.5462 8.41007 9.42799 8.43358C9.30978 8.4571 9.2012 8.51513 9.11598 8.60036C9.03076 8.68558 8.97272 8.79416 8.94921 8.91237C8.9257 9.03057 8.93776 9.1531 8.98389 9.26445C9.03001 9.3758 9.10811 9.47097 9.20832 9.53793C9.30854 9.60489 9.42635 9.64062 9.54688 9.64062C9.70849 9.64062 9.86349 9.57642 9.97777 9.46214C10.092 9.34786 10.1562 9.19287 10.1562 9.03125Z" fill="#C3C3C3"/>
|
|
3
|
+
</svg>
|
package/src/main.tsx
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
/* Bundler mode */
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
/* Linting */
|
|
20
|
+
"strict": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"erasableSyntaxOnly": true,
|
|
24
|
+
"noFallthroughCasesInSwitch": true,
|
|
25
|
+
"noUncheckedSideEffectImports": true
|
|
26
|
+
},
|
|
27
|
+
"include": ["src"]
|
|
28
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"composite": true,
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": [
|
|
7
|
+
"ES2020",
|
|
8
|
+
"DOM",
|
|
9
|
+
"DOM.Iterable"
|
|
10
|
+
],
|
|
11
|
+
"module": "ESNext",
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"allowImportingTsExtensions": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"isolatedModules": true,
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"declarationDir": "dist/types",
|
|
19
|
+
"emitDeclarationOnly": true,
|
|
20
|
+
"noEmit": false,
|
|
21
|
+
"rootDir": "src",
|
|
22
|
+
"outDir": "dist/types",
|
|
23
|
+
"jsx": "react-jsx",
|
|
24
|
+
"strict": true,
|
|
25
|
+
"noUnusedLocals": true,
|
|
26
|
+
"noUnusedParameters": true,
|
|
27
|
+
"noFallthroughCasesInSwitch": true,
|
|
28
|
+
"typeRoots": [
|
|
29
|
+
"./dist/index.d.ts",
|
|
30
|
+
"node_modules/@types"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"include": [
|
|
34
|
+
"src",
|
|
35
|
+
"./index.ts",
|
|
36
|
+
"declaration.d.ts"
|
|
37
|
+
],
|
|
38
|
+
"files": [],
|
|
39
|
+
"references": [
|
|
40
|
+
{ "path": "./tsconfig.node.json" }
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
|
|
16
|
+
"composite": true,
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"emitDeclarationOnly": true,
|
|
19
|
+
|
|
20
|
+
/* Linting */
|
|
21
|
+
"strict": true,
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
"noUnusedParameters": true,
|
|
24
|
+
"erasableSyntaxOnly": true,
|
|
25
|
+
"noFallthroughCasesInSwitch": true,
|
|
26
|
+
"noUncheckedSideEffectImports": true
|
|
27
|
+
},
|
|
28
|
+
"include": ["vite.config.ts"]
|
|
29
|
+
}
|
package/vite.config.d.ts
ADDED
package/vite.config.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import path from "path"
|
|
2
|
+
import { defineConfig } from "vite"
|
|
3
|
+
import react from "@vitejs/plugin-react"
|
|
4
|
+
import dts from "vite-plugin-dts"
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
build: {
|
|
8
|
+
lib: {
|
|
9
|
+
entry: path.resolve(__dirname, "src/index.ts"),
|
|
10
|
+
name: "iteratex-component-library",
|
|
11
|
+
fileName: (format) => `index.${format}.js`,
|
|
12
|
+
},
|
|
13
|
+
rollupOptions: {
|
|
14
|
+
external: ["react", "react-dom"],
|
|
15
|
+
output: {
|
|
16
|
+
globals: {
|
|
17
|
+
react: "React",
|
|
18
|
+
"react-dom": "ReactDOM",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
cssCodeSplit: true,
|
|
23
|
+
sourcemap: true,
|
|
24
|
+
emptyOutDir: true,
|
|
25
|
+
},
|
|
26
|
+
server: { host: true, port: 3000 },
|
|
27
|
+
plugins: [
|
|
28
|
+
react(),
|
|
29
|
+
dts({
|
|
30
|
+
insertTypesEntry: true,
|
|
31
|
+
rollupTypes: false,
|
|
32
|
+
outDir: "dist/types",
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
})
|