ml-ui-lib 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common.css +27 -0
- package/dist/components/Accordion/Accordion.css +69 -0
- package/dist/components/Accordion/Accordion.d.ts +14 -0
- package/dist/components/Accordion/Accordion.js +28 -0
- package/dist/components/Button/Button.css +24 -0
- package/dist/components/Card/Card.css +89 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/Card.js +13 -0
- package/dist/components/DatePicker/DatePicker.css +103 -0
- package/dist/components/DatePicker2/DatePicker2.css +113 -0
- package/dist/components/Dropdown/Dropdown.css +84 -0
- package/dist/components/ExpandablePanel/ExpandablePanel.css +111 -0
- package/dist/components/ExpandablePanel/ExpandablePanel.d.ts +14 -0
- package/dist/components/ExpandablePanel/ExpandablePanel.js +54 -0
- package/dist/components/Input/Input.css +36 -0
- package/dist/components/Modal/Modal.css +81 -0
- package/dist/components/Modal/icons/error.png +0 -0
- package/dist/components/Navbar/Navbar.css +140 -0
- package/dist/components/Navbar/Navbar.d.ts +20 -0
- package/dist/components/Navbar/Navbar.js +51 -0
- package/dist/components/PhoneInput/PhoneInput.css +78 -0
- package/dist/components/SlidingPanelBottom/SlidingPanelBottom.css +171 -0
- package/dist/components/SlidingPanelBottom/SlidingPanelBottom.d.ts +13 -0
- package/dist/components/SlidingPanelBottom/SlidingPanelBottom.js +90 -0
- package/dist/components/Table/Table.css +82 -0
- package/dist/components/Table/Table.d.ts +14 -0
- package/dist/components/Table/Table.js +10 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +6 -0
- package/package.json +11 -23
- package/dist/components/Alert/Alert.d.ts +0 -10
- package/dist/components/Alert/Alert.js +0 -6
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/common.css
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
|
|
2
|
+
|
|
3
|
+
/* Common global styles for all ml-ui-lib components */
|
|
4
|
+
:root {
|
|
5
|
+
--ml-font-family: 'Poppins', sans-serif;
|
|
6
|
+
--ml-color-primary: #0070f3;
|
|
7
|
+
--ml-color-secondary: #eaeaea;
|
|
8
|
+
--ml-radius: 6px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
* {
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
body {
|
|
16
|
+
font-family: var(--ml-font-family);
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 0;
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
color: #111;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
button {
|
|
24
|
+
font-family: inherit;
|
|
25
|
+
border-radius: var(--ml-radius);
|
|
26
|
+
transition: all 0.2s ease;
|
|
27
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.accordion {
|
|
2
|
+
width: 100%;
|
|
3
|
+
font-family: "Inter", sans-serif;
|
|
4
|
+
color: #222;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.accordion-group {
|
|
8
|
+
margin-bottom: 1.5rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.accordion-group-title {
|
|
12
|
+
font-size: 1.1rem;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
color: #444;
|
|
15
|
+
margin-bottom: 0.5rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.accordion-item {
|
|
19
|
+
border: 1px solid #e5e7eb;
|
|
20
|
+
border-radius: 10px;
|
|
21
|
+
margin-bottom: 0.75rem;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
background-color: #fff;
|
|
24
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
25
|
+
transition: all 0.3s ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.accordion-header {
|
|
29
|
+
width: 100%;
|
|
30
|
+
background: #f9fafb;
|
|
31
|
+
border: none;
|
|
32
|
+
padding: 1rem 1.25rem;
|
|
33
|
+
display: flex;
|
|
34
|
+
justify-content: space-between;
|
|
35
|
+
align-items: center;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
text-align: left;
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
transition: background 0.2s ease;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.accordion-header:hover {
|
|
44
|
+
background: #f3f4f6;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.accordion-icon {
|
|
48
|
+
transition: transform 0.3s ease;
|
|
49
|
+
font-size: 1rem;
|
|
50
|
+
color: #6b7280;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.accordion-icon.open {
|
|
54
|
+
transform: rotate(180deg);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.accordion-content-wrapper {
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
max-height: 0;
|
|
60
|
+
transition: max-height 0.35s ease;
|
|
61
|
+
background: #fff;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.accordion-content {
|
|
65
|
+
padding: 1rem 1.25rem;
|
|
66
|
+
font-size: 0.95rem;
|
|
67
|
+
color: #555;
|
|
68
|
+
line-height: 1.6;
|
|
69
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Accordion.css";
|
|
3
|
+
export interface AccordionSubItem {
|
|
4
|
+
title: string;
|
|
5
|
+
content: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AccordionGroup {
|
|
8
|
+
title: string;
|
|
9
|
+
items: AccordionSubItem[];
|
|
10
|
+
}
|
|
11
|
+
export interface AccordionProps {
|
|
12
|
+
items: AccordionGroup[];
|
|
13
|
+
}
|
|
14
|
+
export declare const Accordion: React.FC<AccordionProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect } from "react";
|
|
3
|
+
import "./Accordion.css";
|
|
4
|
+
export const Accordion = ({ items }) => {
|
|
5
|
+
const [openIndexes, setOpenIndexes] = useState([]);
|
|
6
|
+
const contentRefs = useRef([]);
|
|
7
|
+
const toggleItem = (index) => {
|
|
8
|
+
setOpenIndexes((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
|
|
9
|
+
};
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
openIndexes.forEach((index) => {
|
|
12
|
+
const content = contentRefs.current[index];
|
|
13
|
+
if (content) {
|
|
14
|
+
const scrollHeight = content.scrollHeight;
|
|
15
|
+
content.style.maxHeight = `${scrollHeight}px`;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}, [openIndexes]);
|
|
19
|
+
return (_jsx("div", { className: "accordion", children: items.map((group, groupIndex) => (_jsxs("div", { className: "accordion-group", children: [group.title && _jsx("h3", { className: "accordion-group-title", children: group.title }), group.items.map((item, itemIndex) => {
|
|
20
|
+
const index = groupIndex * 1000 + itemIndex;
|
|
21
|
+
const isOpen = openIndexes.includes(index);
|
|
22
|
+
return (_jsxs("div", { className: `accordion-item ${isOpen ? "open" : ""}`, children: [_jsxs("button", { className: "accordion-header", onClick: () => toggleItem(index), children: [_jsx("span", { className: "accordion-title", children: item.title }), _jsx("span", { className: `accordion-icon ${isOpen ? "open" : ""}`, children: "\u25BC" })] }), _jsx("div", { ref: (el) => (contentRefs.current[index] = el), className: "accordion-content-wrapper", style: {
|
|
23
|
+
maxHeight: isOpen
|
|
24
|
+
? `${contentRefs.current[index]?.scrollHeight}px`
|
|
25
|
+
: "0px",
|
|
26
|
+
}, children: _jsx("div", { className: "accordion-content", children: item.content }) })] }, index));
|
|
27
|
+
})] }, groupIndex))) }));
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.btn {
|
|
2
|
+
border: none;
|
|
3
|
+
border-radius: 6px;
|
|
4
|
+
padding: 10px 16px;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
/* margin: 10px; */
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.btn-default {
|
|
11
|
+
background: #ffffff;
|
|
12
|
+
color: #5d5d5d;
|
|
13
|
+
border: solid 0.5px #5d5d5d;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.btn-red {
|
|
17
|
+
background: #ff0000;
|
|
18
|
+
color: #ffffff;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.btn-black {
|
|
22
|
+
background: #333333;
|
|
23
|
+
color: #ffffff;
|
|
24
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
background: #ffffff;
|
|
3
|
+
border-radius: 12px;
|
|
4
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
5
|
+
padding: 1.5rem;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
max-width: 100%;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
transition: box-shadow 0.25s ease, transform 0.25s ease;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Hoverable behavior only if enabled */
|
|
15
|
+
.card.hoverable:hover {
|
|
16
|
+
transform: translateY(-3px);
|
|
17
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Grid container */
|
|
22
|
+
.card-grid {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: 1.5rem;
|
|
25
|
+
align-items: start;
|
|
26
|
+
width: 100%;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
overflow-wrap: break-word;
|
|
29
|
+
word-wrap: break-word;
|
|
30
|
+
word-break: break-word;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Each section */
|
|
34
|
+
.card-section {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
justify-content: flex-start;
|
|
38
|
+
min-width: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Text elements should wrap */
|
|
42
|
+
.card-section p,
|
|
43
|
+
.card-section span,
|
|
44
|
+
.card-section li,
|
|
45
|
+
.card-section h1,
|
|
46
|
+
.card-section h2,
|
|
47
|
+
.card-section h3,
|
|
48
|
+
.card-section h4,
|
|
49
|
+
.card-section h5,
|
|
50
|
+
.card-section h6 {
|
|
51
|
+
margin: 0;
|
|
52
|
+
overflow-wrap: anywhere;
|
|
53
|
+
word-break: break-word;
|
|
54
|
+
white-space: normal;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Image / cover section */
|
|
58
|
+
.card-image-section {
|
|
59
|
+
padding: 0; /* remove text padding */
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
border-radius: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.card-image-section img {
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
object-fit: cover;
|
|
68
|
+
display: block;
|
|
69
|
+
border-radius: 12px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Responsive stacking */
|
|
73
|
+
@media (max-width: 992px) {
|
|
74
|
+
.card {
|
|
75
|
+
margin-bottom: 10px;
|
|
76
|
+
}
|
|
77
|
+
/* .card-grid {
|
|
78
|
+
grid-template-columns: 1fr !important;
|
|
79
|
+
} */
|
|
80
|
+
|
|
81
|
+
/* .card-section {
|
|
82
|
+
padding-bottom: 1rem;
|
|
83
|
+
border-bottom: 1px solid #eee;
|
|
84
|
+
} */
|
|
85
|
+
|
|
86
|
+
/* .card-section:last-child {
|
|
87
|
+
border-bottom: none;
|
|
88
|
+
} */
|
|
89
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Card.css";
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
children: React.ReactNode[] | React.ReactNode;
|
|
5
|
+
columns?: number;
|
|
6
|
+
columnWidths?: string[];
|
|
7
|
+
width?: string;
|
|
8
|
+
hoverable?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export declare const Card: React.FC<CardProps>;
|
|
13
|
+
export default Card;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "./Card.css";
|
|
4
|
+
export const Card = ({ children, columns = 1, columnWidths, width = "100%", hoverable = false, className = "", style, }) => {
|
|
5
|
+
const gridTemplateColumns = columnWidths && columnWidths.length
|
|
6
|
+
? columnWidths.map((w) => `minmax(0, ${w})`).join(" ")
|
|
7
|
+
: `repeat(${columns}, minmax(0, 1fr))`;
|
|
8
|
+
return (_jsx("div", { className: `card ${hoverable ? "hoverable" : ""} ${className}`, style: { width, ...style }, children: _jsx("div", { className: "card-grid", style: { gridTemplateColumns }, children: React.Children.map(children, (child, i) => (_jsx("div", { className: `card-section ${React.isValidElement(child) &&
|
|
9
|
+
child.props?.className?.includes("card-image")
|
|
10
|
+
? "card-image-section"
|
|
11
|
+
: ""}`, children: child }, i))) }) }));
|
|
12
|
+
};
|
|
13
|
+
export default Card;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.datepicker-wrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
font-family: "Poppins", sans-serif;
|
|
4
|
+
width: 250px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.datepicker-input-wrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
position: relative;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.datepicker-input {
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding: 10px 36px 10px 12px;
|
|
17
|
+
border: 1px solid #ddd;
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
font-size: 15px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.datepicker-icon {
|
|
24
|
+
position: absolute;
|
|
25
|
+
right: 10px;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
color: #666;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.datepicker-calendar {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 45px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
background: #fff;
|
|
35
|
+
border: 1px solid #ddd;
|
|
36
|
+
border-radius: 6px;
|
|
37
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
|
38
|
+
z-index: 10;
|
|
39
|
+
padding: 8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.datepicker-header {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
align-items: center;
|
|
46
|
+
margin-bottom: 8px;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.datepicker-weekdays {
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-columns: repeat(7, 1fr);
|
|
53
|
+
text-align: center;
|
|
54
|
+
font-weight: 500;
|
|
55
|
+
margin-bottom: 4px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.datepicker-weekday {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.datepicker-days-grid {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: repeat(7, 1fr);
|
|
65
|
+
gap: 4px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.datepicker-day {
|
|
69
|
+
text-align: center;
|
|
70
|
+
padding: 6px 0;
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
border-radius: 4px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.datepicker-day:hover {
|
|
76
|
+
background: #f0f0f0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.datepicker-day.selected {
|
|
80
|
+
background: #ff4d4d;
|
|
81
|
+
color: #fff;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.datepicker-day.today {
|
|
86
|
+
border: 1px solid #ff4d4d;
|
|
87
|
+
border-radius: 50%;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.datepicker-day.empty {
|
|
91
|
+
pointer-events: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.has-error .datepicker-input {
|
|
95
|
+
border-color: #ff4d4d;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.datepicker-error {
|
|
99
|
+
color: #ff4d4d;
|
|
100
|
+
font-size: 13px;
|
|
101
|
+
margin-top: 4px;
|
|
102
|
+
display: block;
|
|
103
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
.date-picker-wrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 8px;
|
|
4
|
+
font-family: "Poppins", sans-serif;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.full-width {
|
|
9
|
+
flex: 1 1 100px;
|
|
10
|
+
/* position: relative; */
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.date-picker-dropdown {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
background: #fff;
|
|
16
|
+
border: 1px solid #ddd;
|
|
17
|
+
border-radius: 6px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
padding: 0.4rem 0.6rem;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.date-picker-dropdown-carret {
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
color: #666;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.date-picker-grid-wrapper {
|
|
31
|
+
width: 30%;
|
|
32
|
+
position: absolute;
|
|
33
|
+
/* left: 0px; */
|
|
34
|
+
/* top: 40px;
|
|
35
|
+
background: #fff;
|
|
36
|
+
border: 1px solid #ddd;
|
|
37
|
+
border-radius: 6px;
|
|
38
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
39
|
+
z-index: 10; */
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.date-picker-header {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
position: absolute;
|
|
47
|
+
z-index: 100;
|
|
48
|
+
left: 0px;
|
|
49
|
+
padding: 10px;
|
|
50
|
+
width: 100%;
|
|
51
|
+
background-color: #f5f5f5;
|
|
52
|
+
margin-top: 5px;
|
|
53
|
+
border-top-left-radius: 8px;
|
|
54
|
+
border-top-right-radius: 8px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.date-picker-header button {
|
|
58
|
+
background-color: #ffffff;
|
|
59
|
+
color: #5f5f5f;
|
|
60
|
+
border-radius: 15px;
|
|
61
|
+
border: 0.5px solid #5f5f5f;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.date-picker-grid {
|
|
65
|
+
display: grid;
|
|
66
|
+
grid-template-columns: repeat(3, 1fr);
|
|
67
|
+
gap: 8px;
|
|
68
|
+
padding: 10px;
|
|
69
|
+
background-color: white;
|
|
70
|
+
border-radius: 8px;
|
|
71
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
|
|
72
|
+
max-height: 250px;
|
|
73
|
+
overflow-y: auto;
|
|
74
|
+
position: absolute;
|
|
75
|
+
z-index: 30;
|
|
76
|
+
width: 100%;
|
|
77
|
+
margin-top: 45px;
|
|
78
|
+
left: 0px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.date-picker-dropdown-option {
|
|
82
|
+
text-align: center;
|
|
83
|
+
padding: 10px;
|
|
84
|
+
border-radius: 6px;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
/* font-size: 14px;
|
|
87
|
+
font-weight: 500; */
|
|
88
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
|
89
|
+
user-select: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.date-picker-dropdown-option:hover {
|
|
93
|
+
background-color: #f0f0f0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.date-picker-dropdown-option.selected {
|
|
97
|
+
background-color: #333;
|
|
98
|
+
color: #fff;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.date-picker-empty {
|
|
102
|
+
gap: 8px;
|
|
103
|
+
padding: 10px;
|
|
104
|
+
background-color: white;
|
|
105
|
+
border-radius: 8px;
|
|
106
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
|
|
107
|
+
overflow-y: auto;
|
|
108
|
+
position: absolute;
|
|
109
|
+
z-index: 30;
|
|
110
|
+
/* width: 100%; */
|
|
111
|
+
margin-top: 10px;
|
|
112
|
+
left: 0px;
|
|
113
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.dropdown-wrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
font-family: "Poppins", sans-serif;
|
|
6
|
+
gap: 4px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.dropdown-label {
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
font-weight: 500;
|
|
12
|
+
color: #333;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.dropdown-trigger {
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
padding: 10px 12px;
|
|
20
|
+
border: 1px solid #ddd;
|
|
21
|
+
border-radius: 6px;
|
|
22
|
+
background: #fff;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
transition: border-color 0.2s;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dropdown-trigger:hover {
|
|
28
|
+
border-color: #888;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.dropdown-value {
|
|
32
|
+
font-size: 15px;
|
|
33
|
+
color: #333;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dropdown-caret {
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
color: #666;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dropdown-list {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 100%;
|
|
44
|
+
left: 0;
|
|
45
|
+
width: 100%;
|
|
46
|
+
background: #fff;
|
|
47
|
+
border: 1px solid #ddd;
|
|
48
|
+
border-radius: 6px;
|
|
49
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
50
|
+
z-index: 10;
|
|
51
|
+
max-height: 200px;
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
margin-top: 4px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.dropdown-option {
|
|
57
|
+
padding: 8px 12px;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
transition: background 0.2s;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.dropdown-option:hover {
|
|
63
|
+
background: #f5f5f5;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.dropdown-option.selected {
|
|
67
|
+
background: #ff4d4d10;
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.dropdown-empty {
|
|
72
|
+
padding: 8px 12px;
|
|
73
|
+
color: #999;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dropdown-error {
|
|
77
|
+
margin-top: 4px;
|
|
78
|
+
color: #ff4d4d;
|
|
79
|
+
font-size: 13px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.has-error .dropdown-trigger {
|
|
83
|
+
border-color: #ff4d4d;
|
|
84
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.expandable-panel-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 16px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.expandable-card-row {
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: 16px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.expandable-card {
|
|
13
|
+
flex: 1;
|
|
14
|
+
background: #fff;
|
|
15
|
+
border: 1px solid #e5e7eb;
|
|
16
|
+
border-radius: 12px;
|
|
17
|
+
padding: 16px;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
transition: all 0.2s ease;
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.expandable-card.active {
|
|
27
|
+
border-color: #ff4d4f;
|
|
28
|
+
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* --- Sliding subpanel --- */
|
|
32
|
+
.subpanel-wrapper {
|
|
33
|
+
width: 100%;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
max-height: 0;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transform: translateY(-10px);
|
|
38
|
+
transition:
|
|
39
|
+
max-height 0.4s ease,
|
|
40
|
+
opacity 0.3s ease,
|
|
41
|
+
transform 0.3s ease;
|
|
42
|
+
margin-top: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.subpanel-wrapper.open {
|
|
46
|
+
opacity: 1;
|
|
47
|
+
transform: translateY(0);
|
|
48
|
+
margin-top: 12px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.subpanel-content {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-wrap: wrap;
|
|
54
|
+
gap: 10px;
|
|
55
|
+
background: #f9fafb;
|
|
56
|
+
border-radius: 10px;
|
|
57
|
+
border: 1px solid #ddd;
|
|
58
|
+
padding: 16px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.sub-card {
|
|
62
|
+
flex: 1 1 calc(33.333% - 10px);
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
/* background: white;
|
|
65
|
+
border: 1px solid #eee;
|
|
66
|
+
padding: 12px; */
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* --- Responsive behavior --- */
|
|
73
|
+
@media (min-width: 993px) {
|
|
74
|
+
.expandable-card-wrapper {
|
|
75
|
+
display: flex;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.expandable-card-row {
|
|
79
|
+
grid-template-columns: repeat(3, 1fr);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.sub-card {
|
|
83
|
+
flex: 1 1 calc(33.333% - 10px);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (max-width: 992px) {
|
|
88
|
+
.expandable-card-row {
|
|
89
|
+
grid-template-columns: repeat(2, 1fr);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.sub-card {
|
|
93
|
+
flex: 1 1 calc(50% - 10px);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@media (max-width: 576px) {
|
|
98
|
+
.expandable-card-wrapper {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.expandable-card-row {
|
|
104
|
+
grid-template-columns: 1fr;
|
|
105
|
+
gap: 8px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.sub-card {
|
|
109
|
+
flex: 1 1 100%;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ExpandablePanel.css";
|
|
3
|
+
export interface ExpandablePanelItem {
|
|
4
|
+
id: string | number;
|
|
5
|
+
title: string;
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
subPanel?: React.ReactNode | React.ReactNode[];
|
|
8
|
+
}
|
|
9
|
+
export interface ExpandablePanelProps {
|
|
10
|
+
items: ExpandablePanelItem[];
|
|
11
|
+
columns?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const ExpandablePanel: React.FC<ExpandablePanelProps>;
|
|
14
|
+
export default ExpandablePanel;
|