jett.admin.npmpackage 2.0.22 → 2.0.23
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/Inter-Bold-UGVMS3V6-UGVMS3V6.woff2 +0 -0
- package/dist/Inter-Medium-5IRUMIHZ-5IRUMIHZ.woff2 +0 -0
- package/dist/Inter-Regular-GS5EHSMB-GS5EHSMB.woff2 +0 -0
- package/dist/Inter-SemiBold-SVBZ7NC6-SVBZ7NC6.woff2 +0 -0
- package/dist/index.css +25 -19
- package/dist/index.js +172 -22
- package/dist/index.mjs +168 -19
- package/package.json +2 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.css
CHANGED
|
@@ -2,23 +2,6 @@
|
|
|
2
2
|
@layer properties;
|
|
3
3
|
:root,
|
|
4
4
|
:host {
|
|
5
|
-
--font-sans:
|
|
6
|
-
ui-sans-serif,
|
|
7
|
-
system-ui,
|
|
8
|
-
sans-serif,
|
|
9
|
-
"Apple Color Emoji",
|
|
10
|
-
"Segoe UI Emoji",
|
|
11
|
-
"Segoe UI Symbol",
|
|
12
|
-
"Noto Color Emoji";
|
|
13
|
-
--font-mono:
|
|
14
|
-
ui-monospace,
|
|
15
|
-
SFMono-Regular,
|
|
16
|
-
Menlo,
|
|
17
|
-
Monaco,
|
|
18
|
-
Consolas,
|
|
19
|
-
"Liberation Mono",
|
|
20
|
-
"Courier New",
|
|
21
|
-
monospace;
|
|
22
5
|
--color-red-50: oklch(97.1% 0.013 17.38);
|
|
23
6
|
--color-red-100: oklch(93.6% 0.032 17.717);
|
|
24
7
|
--color-red-200: oklch(88.5% 0.062 18.334);
|
|
@@ -172,6 +155,9 @@
|
|
|
172
155
|
.mb-6 {
|
|
173
156
|
margin-bottom: calc(var(--spacing) * 6);
|
|
174
157
|
}
|
|
158
|
+
.ml-0\.5 {
|
|
159
|
+
margin-left: calc(var(--spacing) * 0.5);
|
|
160
|
+
}
|
|
175
161
|
.ml-2 {
|
|
176
162
|
margin-left: calc(var(--spacing) * 2);
|
|
177
163
|
}
|
|
@@ -866,6 +852,10 @@
|
|
|
866
852
|
var(--tw-ring-shadow),
|
|
867
853
|
var(--tw-shadow);
|
|
868
854
|
}
|
|
855
|
+
.outline {
|
|
856
|
+
outline-style: var(--tw-outline-style);
|
|
857
|
+
outline-width: 1px;
|
|
858
|
+
}
|
|
869
859
|
.outline-offset-2 {
|
|
870
860
|
outline-offset: 2px;
|
|
871
861
|
}
|
|
@@ -961,6 +951,22 @@
|
|
|
961
951
|
background-color: var(--color-primary);
|
|
962
952
|
}
|
|
963
953
|
}
|
|
954
|
+
.placeholder\:text-\[14px\] {
|
|
955
|
+
&::placeholder {
|
|
956
|
+
font-size: 14px;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
.placeholder\:font-normal {
|
|
960
|
+
&::placeholder {
|
|
961
|
+
--tw-font-weight: var(--font-weight-normal);
|
|
962
|
+
font-weight: var(--font-weight-normal);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
.placeholder\:text-\[\#6b7280\] {
|
|
966
|
+
&::placeholder {
|
|
967
|
+
color: #6b7280;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
964
970
|
.focus-within\:outline-2 {
|
|
965
971
|
&:focus-within {
|
|
966
972
|
outline-style: var(--tw-outline-style);
|
|
@@ -1395,9 +1401,9 @@ body {
|
|
|
1395
1401
|
@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }
|
|
1396
1402
|
@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }
|
|
1397
1403
|
@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }
|
|
1404
|
+
@property --tw-outline-style { syntax: "*"; inherits: false; initial-value: solid; }
|
|
1398
1405
|
@property --tw-duration { syntax: "*"; inherits: false; }
|
|
1399
1406
|
@property --tw-ease { syntax: "*"; inherits: false; }
|
|
1400
|
-
@property --tw-outline-style { syntax: "*"; inherits: false; initial-value: solid; }
|
|
1401
1407
|
@property --tw-space-x-reverse { syntax: "*"; inherits: false; initial-value: 0; }
|
|
1402
1408
|
@layer properties {
|
|
1403
1409
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
@@ -1431,9 +1437,9 @@ body {
|
|
|
1431
1437
|
--tw-ring-offset-width: 0px;
|
|
1432
1438
|
--tw-ring-offset-color: #fff;
|
|
1433
1439
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
1440
|
+
--tw-outline-style: solid;
|
|
1434
1441
|
--tw-duration: initial;
|
|
1435
1442
|
--tw-ease: initial;
|
|
1436
|
-
--tw-outline-style: solid;
|
|
1437
1443
|
--tw-space-x-reverse: 0;
|
|
1438
1444
|
}
|
|
1439
1445
|
}
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ __export(index_exports, {
|
|
|
41
41
|
CustomTable: () => CustomTable,
|
|
42
42
|
CustomTextarea: () => CustomTextarea,
|
|
43
43
|
CustomUpload: () => CustomUpload,
|
|
44
|
+
Dropdown: () => Dropdown,
|
|
44
45
|
Pagination: () => Pagination,
|
|
45
46
|
ProgressBar: () => ProgressBar,
|
|
46
47
|
RightSheet: () => RightSheet
|
|
@@ -320,6 +321,7 @@ var CustomInput = ({
|
|
|
320
321
|
"input",
|
|
321
322
|
{
|
|
322
323
|
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
324
|
+
placeholder:text-[14px] placeholder:font-normal placeholder:text-[#6b7280]
|
|
323
325
|
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
324
326
|
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
325
327
|
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-500 border-gray-300" : error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)]"}
|
|
@@ -1654,8 +1656,155 @@ var CustomTable = ({
|
|
|
1654
1656
|
)), /* @__PURE__ */ import_react16.default.createElement("tbody", { id: `${id}-tbody-1` }, children))));
|
|
1655
1657
|
};
|
|
1656
1658
|
|
|
1657
|
-
// src/
|
|
1659
|
+
// src/inputs/Dropdown.jsx
|
|
1658
1660
|
var import_react17 = __toESM(require("react"));
|
|
1661
|
+
var import_react_select = __toESM(require("react-select"));
|
|
1662
|
+
var isDarkMode = () => typeof document !== "undefined" && document.documentElement.classList.contains("dark");
|
|
1663
|
+
function buildStyles(isDark, error) {
|
|
1664
|
+
return {
|
|
1665
|
+
control: (base, state) => ({
|
|
1666
|
+
...base,
|
|
1667
|
+
minHeight: "40px !important",
|
|
1668
|
+
fontSize: 14,
|
|
1669
|
+
borderRadius: "6px",
|
|
1670
|
+
boxShadow: "none",
|
|
1671
|
+
backgroundColor: state.isDisabled ? "#f3f4f6" : error ? "#fef2f2" : isDark ? "#18181b" : "#ffffff",
|
|
1672
|
+
borderColor: state.isDisabled ? "#d1d5db" : error ? "#ef4444" : isDark ? "#303036" : "#e5e5e5",
|
|
1673
|
+
outline: state.isFocused ? "2px solid #000" : "none",
|
|
1674
|
+
outlineOffset: "2px",
|
|
1675
|
+
"&:hover": {
|
|
1676
|
+
borderColor: error ? "#ef4444" : "none"
|
|
1677
|
+
}
|
|
1678
|
+
}),
|
|
1679
|
+
menu: (base) => ({
|
|
1680
|
+
...base,
|
|
1681
|
+
backgroundColor: isDark ? "#18181b" : "#ffffff",
|
|
1682
|
+
zIndex: 9999
|
|
1683
|
+
}),
|
|
1684
|
+
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
|
|
1685
|
+
option: (base, state) => ({
|
|
1686
|
+
...base,
|
|
1687
|
+
fontSize: 14,
|
|
1688
|
+
cursor: "pointer",
|
|
1689
|
+
backgroundColor: state.isSelected ? "#0087FA" : state.isFocused ? isDark ? "#303036" : "#EBF5FF" : "transparent",
|
|
1690
|
+
color: state.isSelected ? "#ffffff" : isDark ? "#f3f4f6" : "#111827",
|
|
1691
|
+
"&:active": { backgroundColor: "#0087FA", color: "#ffffff" }
|
|
1692
|
+
}),
|
|
1693
|
+
singleValue: (base, state) => ({
|
|
1694
|
+
...base,
|
|
1695
|
+
fontSize: 14,
|
|
1696
|
+
fontWeight: 400,
|
|
1697
|
+
color: state.isDisabled ? "#6b7280" : isDark ? "#f3f4f6" : "#111827"
|
|
1698
|
+
}),
|
|
1699
|
+
multiValue: (base) => ({
|
|
1700
|
+
...base,
|
|
1701
|
+
backgroundColor: isDark ? "#303036" : "#EBF5FF"
|
|
1702
|
+
}),
|
|
1703
|
+
multiValueLabel: (base) => ({
|
|
1704
|
+
...base,
|
|
1705
|
+
fontSize: 12,
|
|
1706
|
+
color: isDark ? "#f3f4f6" : "#0087FA"
|
|
1707
|
+
}),
|
|
1708
|
+
multiValueRemove: (base) => ({
|
|
1709
|
+
...base,
|
|
1710
|
+
color: isDark ? "#9ca3af" : "#0087FA",
|
|
1711
|
+
"&:hover": { backgroundColor: "#0087FA", color: "#ffffff" }
|
|
1712
|
+
}),
|
|
1713
|
+
placeholder: (base) => ({
|
|
1714
|
+
...base,
|
|
1715
|
+
fontSize: 14,
|
|
1716
|
+
fontWeight: 400,
|
|
1717
|
+
color: "#6b7280"
|
|
1718
|
+
}),
|
|
1719
|
+
input: (base) => ({
|
|
1720
|
+
...base,
|
|
1721
|
+
fontSize: 14,
|
|
1722
|
+
fontWeight: 400,
|
|
1723
|
+
color: isDark ? "#f3f4f6" : "#111827"
|
|
1724
|
+
}),
|
|
1725
|
+
indicatorSeparator: () => ({ display: "none" }),
|
|
1726
|
+
dropdownIndicator: (base) => ({
|
|
1727
|
+
...base,
|
|
1728
|
+
padding: "0 6px",
|
|
1729
|
+
color: isDark ? "#9ca3af" : "#6b7280"
|
|
1730
|
+
}),
|
|
1731
|
+
clearIndicator: (base) => ({
|
|
1732
|
+
...base,
|
|
1733
|
+
padding: "0 4px",
|
|
1734
|
+
color: isDark ? "#9ca3af" : "#6b7280",
|
|
1735
|
+
cursor: "pointer",
|
|
1736
|
+
"&:hover": { color: "#0087FA" }
|
|
1737
|
+
}),
|
|
1738
|
+
valueContainer: (base) => ({ ...base, padding: "2px 16px" })
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
var Dropdown = import_react17.default.forwardRef(
|
|
1742
|
+
({
|
|
1743
|
+
id = "dropdown",
|
|
1744
|
+
options,
|
|
1745
|
+
placeholder = "Select...",
|
|
1746
|
+
isDisabled = false,
|
|
1747
|
+
isClearable = true,
|
|
1748
|
+
isLoading = false,
|
|
1749
|
+
error = false,
|
|
1750
|
+
label,
|
|
1751
|
+
heading,
|
|
1752
|
+
isRequired = false,
|
|
1753
|
+
name,
|
|
1754
|
+
menuPortalTarget,
|
|
1755
|
+
menuPosition = "absolute",
|
|
1756
|
+
className,
|
|
1757
|
+
style,
|
|
1758
|
+
isMulti = false,
|
|
1759
|
+
value,
|
|
1760
|
+
onChange
|
|
1761
|
+
}, ref) => {
|
|
1762
|
+
const reactId = (0, import_react17.useId)();
|
|
1763
|
+
const isDark = isDarkMode();
|
|
1764
|
+
const styles = (0, import_react17.useMemo)(() => buildStyles(isDark, !!error), [isDark, error]);
|
|
1765
|
+
const selectedValue = isMulti ? options.filter((o) => (value ?? []).includes(o.value)) : options.find((o) => o.value === value) ?? null;
|
|
1766
|
+
const handleChange = (selected) => {
|
|
1767
|
+
if (isMulti) {
|
|
1768
|
+
onChange((selected ?? []).map((o) => o.value));
|
|
1769
|
+
} else {
|
|
1770
|
+
onChange((selected == null ? void 0 : selected.value) ?? null);
|
|
1771
|
+
}
|
|
1772
|
+
};
|
|
1773
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { className: `flex flex-col gap-1 w-full ${className ?? ""}`, style, id: `${id}-div-1` }, heading && /* @__PURE__ */ import_react17.default.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), label && /* @__PURE__ */ import_react17.default.createElement(
|
|
1774
|
+
"label",
|
|
1775
|
+
{
|
|
1776
|
+
htmlFor: reactId,
|
|
1777
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`,
|
|
1778
|
+
id: `${id}-label-1`
|
|
1779
|
+
},
|
|
1780
|
+
label,
|
|
1781
|
+
isRequired && /* @__PURE__ */ import_react17.default.createElement("span", { className: "text-red-500 ml-0.5", id: `${id}-span-1` }, "*")
|
|
1782
|
+
), /* @__PURE__ */ import_react17.default.createElement(
|
|
1783
|
+
import_react_select.default,
|
|
1784
|
+
{
|
|
1785
|
+
ref,
|
|
1786
|
+
inputId: reactId,
|
|
1787
|
+
name,
|
|
1788
|
+
options,
|
|
1789
|
+
value: selectedValue,
|
|
1790
|
+
onChange: handleChange,
|
|
1791
|
+
placeholder,
|
|
1792
|
+
isDisabled,
|
|
1793
|
+
isClearable,
|
|
1794
|
+
isLoading,
|
|
1795
|
+
isMulti,
|
|
1796
|
+
styles,
|
|
1797
|
+
menuPortalTarget,
|
|
1798
|
+
menuPosition,
|
|
1799
|
+
classNamePrefix: "jett-dropdown"
|
|
1800
|
+
}
|
|
1801
|
+
));
|
|
1802
|
+
}
|
|
1803
|
+
);
|
|
1804
|
+
Dropdown.displayName = "Dropdown";
|
|
1805
|
+
|
|
1806
|
+
// src/Pagination/Pagination.jsx
|
|
1807
|
+
var import_react18 = __toESM(require("react"));
|
|
1659
1808
|
var import_lucide_react9 = require("lucide-react");
|
|
1660
1809
|
var Pagination = ({
|
|
1661
1810
|
id = "pagination",
|
|
@@ -1680,26 +1829,26 @@ var Pagination = ({
|
|
|
1680
1829
|
componentProps = {},
|
|
1681
1830
|
...restProps
|
|
1682
1831
|
}) => {
|
|
1683
|
-
const [internalCurrentPage, setInternalCurrentPage] = (0,
|
|
1684
|
-
const [internalItemsPerPage, setInternalItemsPerPage] = (0,
|
|
1832
|
+
const [internalCurrentPage, setInternalCurrentPage] = (0, import_react18.useState)(1);
|
|
1833
|
+
const [internalItemsPerPage, setInternalItemsPerPage] = (0, import_react18.useState)(itemsPerPage);
|
|
1685
1834
|
const isControlled = controlledCurrentPage !== void 0;
|
|
1686
1835
|
const isItemsPerPageControlled = controlledOnItemsPerPageChange !== void 0;
|
|
1687
1836
|
const currentPage = isControlled ? controlledCurrentPage : internalCurrentPage;
|
|
1688
1837
|
const activeItemsPerPage = isItemsPerPageControlled ? itemsPerPage : internalItemsPerPage;
|
|
1689
1838
|
const totalItems = legacyTotalItems !== void 0 ? legacyTotalItems : data.length;
|
|
1690
|
-
const calculatedTotalPages = (0,
|
|
1839
|
+
const calculatedTotalPages = (0, import_react18.useMemo)(() => {
|
|
1691
1840
|
if (totalItems > 0 && activeItemsPerPage > 0) {
|
|
1692
1841
|
return Math.ceil(totalItems / activeItemsPerPage);
|
|
1693
1842
|
}
|
|
1694
1843
|
return 1;
|
|
1695
1844
|
}, [totalItems, activeItemsPerPage]);
|
|
1696
|
-
const paginatedData = (0,
|
|
1845
|
+
const paginatedData = (0, import_react18.useMemo)(() => {
|
|
1697
1846
|
if (!data || data.length === 0) return [];
|
|
1698
1847
|
const startIndex = (currentPage - 1) * activeItemsPerPage;
|
|
1699
1848
|
const endIndex = startIndex + activeItemsPerPage;
|
|
1700
1849
|
return data.slice(startIndex, endIndex);
|
|
1701
1850
|
}, [data, currentPage, activeItemsPerPage]);
|
|
1702
|
-
(0,
|
|
1851
|
+
(0, import_react18.useEffect)(() => {
|
|
1703
1852
|
if (!isControlled && currentPage > calculatedTotalPages && calculatedTotalPages > 0) {
|
|
1704
1853
|
setInternalCurrentPage(1);
|
|
1705
1854
|
}
|
|
@@ -1732,11 +1881,11 @@ var Pagination = ({
|
|
|
1732
1881
|
const endItem = totalItems !== void 0 ? Math.min(currentPage * activeItemsPerPage, totalItems) : null;
|
|
1733
1882
|
const renderContent = () => {
|
|
1734
1883
|
if (Component) {
|
|
1735
|
-
if (
|
|
1884
|
+
if (import_react18.default.isValidElement(Component)) {
|
|
1736
1885
|
const ComponentType = Component.type;
|
|
1737
1886
|
const elementProps = Component.props;
|
|
1738
1887
|
if (isTable) {
|
|
1739
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1740
1889
|
CustomTable,
|
|
1741
1890
|
{
|
|
1742
1891
|
tableHeader,
|
|
@@ -1744,7 +1893,7 @@ var Pagination = ({
|
|
|
1744
1893
|
id: `${id}-custom-table-1`
|
|
1745
1894
|
},
|
|
1746
1895
|
data.map((item, index) => {
|
|
1747
|
-
return /* @__PURE__ */
|
|
1896
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1748
1897
|
ComponentType,
|
|
1749
1898
|
{
|
|
1750
1899
|
key: item.id || item._id || index,
|
|
@@ -1759,7 +1908,7 @@ var Pagination = ({
|
|
|
1759
1908
|
);
|
|
1760
1909
|
} else {
|
|
1761
1910
|
if (isTable) {
|
|
1762
|
-
return /* @__PURE__ */
|
|
1911
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1763
1912
|
CustomTable,
|
|
1764
1913
|
{
|
|
1765
1914
|
tableHeader,
|
|
@@ -1767,7 +1916,7 @@ var Pagination = ({
|
|
|
1767
1916
|
id: `${id}-custom-table-2`
|
|
1768
1917
|
},
|
|
1769
1918
|
paginatedData.map((item, index) => {
|
|
1770
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1771
1920
|
ComponentType,
|
|
1772
1921
|
{
|
|
1773
1922
|
key: item.id || item._id || index,
|
|
@@ -1783,7 +1932,7 @@ var Pagination = ({
|
|
|
1783
1932
|
}
|
|
1784
1933
|
}
|
|
1785
1934
|
} else {
|
|
1786
|
-
return /* @__PURE__ */
|
|
1935
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1787
1936
|
CustomTable,
|
|
1788
1937
|
{
|
|
1789
1938
|
tableHeader,
|
|
@@ -1791,7 +1940,7 @@ var Pagination = ({
|
|
|
1791
1940
|
id: `${id}-custom-table-3`
|
|
1792
1941
|
},
|
|
1793
1942
|
paginatedData.map((item, index) => {
|
|
1794
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1795
1944
|
Component,
|
|
1796
1945
|
{
|
|
1797
1946
|
key: item.id || item._id || index,
|
|
@@ -1807,7 +1956,7 @@ var Pagination = ({
|
|
|
1807
1956
|
}
|
|
1808
1957
|
return null;
|
|
1809
1958
|
};
|
|
1810
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, /* @__PURE__ */ import_react18.default.createElement(import_react18.default.Fragment, null, renderContent()), /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex flex-col sm:flex-row justify-between items-center gap-4 px-4 py-3 border-t border-[#e5e5e5] dark:border-[#303036] bg-white dark:bg-[#18181b] z-10", id: `${id}-div-1` }, totalItems !== void 0 && /* @__PURE__ */ import_react18.default.createElement("div", { className: "text-sm text-[#737373] dark:text-white", id: `${id}-div-2` }, "Showing ", startItem, " to ", endItem, " of ", totalItems, " entries"), /* @__PURE__ */ import_react18.default.createElement("div", { className: "flex items-center gap-2", id: `${id}-div-3` }, /* @__PURE__ */ import_react18.default.createElement(
|
|
1811
1960
|
"button",
|
|
1812
1961
|
{
|
|
1813
1962
|
onClick: () => handlePageChange(1),
|
|
@@ -1816,8 +1965,8 @@ var Pagination = ({
|
|
|
1816
1965
|
title: "First page",
|
|
1817
1966
|
id: `${id}-button-1`
|
|
1818
1967
|
},
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
), /* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react9.ChevronsLeft, { size: 16 })
|
|
1969
|
+
), /* @__PURE__ */ import_react18.default.createElement(
|
|
1821
1970
|
"button",
|
|
1822
1971
|
{
|
|
1823
1972
|
onClick: () => handlePageChange(currentPage - 1),
|
|
@@ -1826,8 +1975,8 @@ var Pagination = ({
|
|
|
1826
1975
|
title: "Previous page",
|
|
1827
1976
|
id: `${id}-button-2`
|
|
1828
1977
|
},
|
|
1829
|
-
/* @__PURE__ */
|
|
1830
|
-
), getPageNumbers().map((pageNum) => /* @__PURE__ */
|
|
1978
|
+
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react9.ChevronLeft, { size: 16 })
|
|
1979
|
+
), getPageNumbers().map((pageNum) => /* @__PURE__ */ import_react18.default.createElement(
|
|
1831
1980
|
"button",
|
|
1832
1981
|
{
|
|
1833
1982
|
key: pageNum,
|
|
@@ -1836,7 +1985,7 @@ var Pagination = ({
|
|
|
1836
1985
|
id: `${id}-button-3`
|
|
1837
1986
|
},
|
|
1838
1987
|
pageNum
|
|
1839
|
-
)), /* @__PURE__ */
|
|
1988
|
+
)), /* @__PURE__ */ import_react18.default.createElement(
|
|
1840
1989
|
"button",
|
|
1841
1990
|
{
|
|
1842
1991
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -1845,8 +1994,8 @@ var Pagination = ({
|
|
|
1845
1994
|
title: "Next page",
|
|
1846
1995
|
id: `${id}-button-4`
|
|
1847
1996
|
},
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
), /* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react9.ChevronRight, { size: 16 })
|
|
1998
|
+
), /* @__PURE__ */ import_react18.default.createElement(
|
|
1850
1999
|
"button",
|
|
1851
2000
|
{
|
|
1852
2001
|
onClick: () => handlePageChange(calculatedTotalPages),
|
|
@@ -1855,7 +2004,7 @@ var Pagination = ({
|
|
|
1855
2004
|
title: "Last page",
|
|
1856
2005
|
id: `${id}-button-5`
|
|
1857
2006
|
},
|
|
1858
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ import_react18.default.createElement(import_lucide_react9.ChevronsRight, { size: 16 })
|
|
1859
2008
|
))));
|
|
1860
2009
|
};
|
|
1861
2010
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1872,6 +2021,7 @@ var Pagination = ({
|
|
|
1872
2021
|
CustomTable,
|
|
1873
2022
|
CustomTextarea,
|
|
1874
2023
|
CustomUpload,
|
|
2024
|
+
Dropdown,
|
|
1875
2025
|
Pagination,
|
|
1876
2026
|
ProgressBar,
|
|
1877
2027
|
RightSheet
|
package/dist/index.mjs
CHANGED
|
@@ -271,6 +271,7 @@ var CustomInput = ({
|
|
|
271
271
|
"input",
|
|
272
272
|
{
|
|
273
273
|
className: `border border-gray-200 rounded-md h-10 px-4 py-2 w-full text-[14px]
|
|
274
|
+
placeholder:text-[14px] placeholder:font-normal placeholder:text-[#6b7280]
|
|
274
275
|
focus:outline-2 outline-black dark:outline-white outline-offset-2
|
|
275
276
|
dark:bg-transparent dark:text-white dark:border-[#303036]
|
|
276
277
|
${disabled ? "bg-gray-100 cursor-not-allowed text-gray-500 border-gray-300" : error ? "border-red-500 bg-red-50" : "bg-white border-[hsl(0_0%_89.8%)]"}
|
|
@@ -1622,8 +1623,155 @@ var CustomTable = ({
|
|
|
1622
1623
|
)), /* @__PURE__ */ React16.createElement("tbody", { id: `${id}-tbody-1` }, children))));
|
|
1623
1624
|
};
|
|
1624
1625
|
|
|
1626
|
+
// src/inputs/Dropdown.jsx
|
|
1627
|
+
import React17, { useId, useMemo } from "react";
|
|
1628
|
+
import ReactSelect from "react-select";
|
|
1629
|
+
var isDarkMode = () => typeof document !== "undefined" && document.documentElement.classList.contains("dark");
|
|
1630
|
+
function buildStyles(isDark, error) {
|
|
1631
|
+
return {
|
|
1632
|
+
control: (base, state) => ({
|
|
1633
|
+
...base,
|
|
1634
|
+
minHeight: "40px !important",
|
|
1635
|
+
fontSize: 14,
|
|
1636
|
+
borderRadius: "6px",
|
|
1637
|
+
boxShadow: "none",
|
|
1638
|
+
backgroundColor: state.isDisabled ? "#f3f4f6" : error ? "#fef2f2" : isDark ? "#18181b" : "#ffffff",
|
|
1639
|
+
borderColor: state.isDisabled ? "#d1d5db" : error ? "#ef4444" : isDark ? "#303036" : "#e5e5e5",
|
|
1640
|
+
outline: state.isFocused ? "2px solid #000" : "none",
|
|
1641
|
+
outlineOffset: "2px",
|
|
1642
|
+
"&:hover": {
|
|
1643
|
+
borderColor: error ? "#ef4444" : "none"
|
|
1644
|
+
}
|
|
1645
|
+
}),
|
|
1646
|
+
menu: (base) => ({
|
|
1647
|
+
...base,
|
|
1648
|
+
backgroundColor: isDark ? "#18181b" : "#ffffff",
|
|
1649
|
+
zIndex: 9999
|
|
1650
|
+
}),
|
|
1651
|
+
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
|
|
1652
|
+
option: (base, state) => ({
|
|
1653
|
+
...base,
|
|
1654
|
+
fontSize: 14,
|
|
1655
|
+
cursor: "pointer",
|
|
1656
|
+
backgroundColor: state.isSelected ? "#0087FA" : state.isFocused ? isDark ? "#303036" : "#EBF5FF" : "transparent",
|
|
1657
|
+
color: state.isSelected ? "#ffffff" : isDark ? "#f3f4f6" : "#111827",
|
|
1658
|
+
"&:active": { backgroundColor: "#0087FA", color: "#ffffff" }
|
|
1659
|
+
}),
|
|
1660
|
+
singleValue: (base, state) => ({
|
|
1661
|
+
...base,
|
|
1662
|
+
fontSize: 14,
|
|
1663
|
+
fontWeight: 400,
|
|
1664
|
+
color: state.isDisabled ? "#6b7280" : isDark ? "#f3f4f6" : "#111827"
|
|
1665
|
+
}),
|
|
1666
|
+
multiValue: (base) => ({
|
|
1667
|
+
...base,
|
|
1668
|
+
backgroundColor: isDark ? "#303036" : "#EBF5FF"
|
|
1669
|
+
}),
|
|
1670
|
+
multiValueLabel: (base) => ({
|
|
1671
|
+
...base,
|
|
1672
|
+
fontSize: 12,
|
|
1673
|
+
color: isDark ? "#f3f4f6" : "#0087FA"
|
|
1674
|
+
}),
|
|
1675
|
+
multiValueRemove: (base) => ({
|
|
1676
|
+
...base,
|
|
1677
|
+
color: isDark ? "#9ca3af" : "#0087FA",
|
|
1678
|
+
"&:hover": { backgroundColor: "#0087FA", color: "#ffffff" }
|
|
1679
|
+
}),
|
|
1680
|
+
placeholder: (base) => ({
|
|
1681
|
+
...base,
|
|
1682
|
+
fontSize: 14,
|
|
1683
|
+
fontWeight: 400,
|
|
1684
|
+
color: "#6b7280"
|
|
1685
|
+
}),
|
|
1686
|
+
input: (base) => ({
|
|
1687
|
+
...base,
|
|
1688
|
+
fontSize: 14,
|
|
1689
|
+
fontWeight: 400,
|
|
1690
|
+
color: isDark ? "#f3f4f6" : "#111827"
|
|
1691
|
+
}),
|
|
1692
|
+
indicatorSeparator: () => ({ display: "none" }),
|
|
1693
|
+
dropdownIndicator: (base) => ({
|
|
1694
|
+
...base,
|
|
1695
|
+
padding: "0 6px",
|
|
1696
|
+
color: isDark ? "#9ca3af" : "#6b7280"
|
|
1697
|
+
}),
|
|
1698
|
+
clearIndicator: (base) => ({
|
|
1699
|
+
...base,
|
|
1700
|
+
padding: "0 4px",
|
|
1701
|
+
color: isDark ? "#9ca3af" : "#6b7280",
|
|
1702
|
+
cursor: "pointer",
|
|
1703
|
+
"&:hover": { color: "#0087FA" }
|
|
1704
|
+
}),
|
|
1705
|
+
valueContainer: (base) => ({ ...base, padding: "2px 16px" })
|
|
1706
|
+
};
|
|
1707
|
+
}
|
|
1708
|
+
var Dropdown = React17.forwardRef(
|
|
1709
|
+
({
|
|
1710
|
+
id = "dropdown",
|
|
1711
|
+
options,
|
|
1712
|
+
placeholder = "Select...",
|
|
1713
|
+
isDisabled = false,
|
|
1714
|
+
isClearable = true,
|
|
1715
|
+
isLoading = false,
|
|
1716
|
+
error = false,
|
|
1717
|
+
label,
|
|
1718
|
+
heading,
|
|
1719
|
+
isRequired = false,
|
|
1720
|
+
name,
|
|
1721
|
+
menuPortalTarget,
|
|
1722
|
+
menuPosition = "absolute",
|
|
1723
|
+
className,
|
|
1724
|
+
style,
|
|
1725
|
+
isMulti = false,
|
|
1726
|
+
value,
|
|
1727
|
+
onChange
|
|
1728
|
+
}, ref) => {
|
|
1729
|
+
const reactId = useId();
|
|
1730
|
+
const isDark = isDarkMode();
|
|
1731
|
+
const styles = useMemo(() => buildStyles(isDark, !!error), [isDark, error]);
|
|
1732
|
+
const selectedValue = isMulti ? options.filter((o) => (value ?? []).includes(o.value)) : options.find((o) => o.value === value) ?? null;
|
|
1733
|
+
const handleChange = (selected) => {
|
|
1734
|
+
if (isMulti) {
|
|
1735
|
+
onChange((selected ?? []).map((o) => o.value));
|
|
1736
|
+
} else {
|
|
1737
|
+
onChange((selected == null ? void 0 : selected.value) ?? null);
|
|
1738
|
+
}
|
|
1739
|
+
};
|
|
1740
|
+
return /* @__PURE__ */ React17.createElement("div", { className: `flex flex-col gap-1 w-full ${className ?? ""}`, style, id: `${id}-div-1` }, heading && /* @__PURE__ */ React17.createElement("h3", { className: "text-lg font-semibold", id: `${id}-h3-1` }, heading), label && /* @__PURE__ */ React17.createElement(
|
|
1741
|
+
"label",
|
|
1742
|
+
{
|
|
1743
|
+
htmlFor: reactId,
|
|
1744
|
+
className: `font-[500] text-sm ${heading ? "text-[#737373]" : "text-black"} dark:text-white`,
|
|
1745
|
+
id: `${id}-label-1`
|
|
1746
|
+
},
|
|
1747
|
+
label,
|
|
1748
|
+
isRequired && /* @__PURE__ */ React17.createElement("span", { className: "text-red-500 ml-0.5", id: `${id}-span-1` }, "*")
|
|
1749
|
+
), /* @__PURE__ */ React17.createElement(
|
|
1750
|
+
ReactSelect,
|
|
1751
|
+
{
|
|
1752
|
+
ref,
|
|
1753
|
+
inputId: reactId,
|
|
1754
|
+
name,
|
|
1755
|
+
options,
|
|
1756
|
+
value: selectedValue,
|
|
1757
|
+
onChange: handleChange,
|
|
1758
|
+
placeholder,
|
|
1759
|
+
isDisabled,
|
|
1760
|
+
isClearable,
|
|
1761
|
+
isLoading,
|
|
1762
|
+
isMulti,
|
|
1763
|
+
styles,
|
|
1764
|
+
menuPortalTarget,
|
|
1765
|
+
menuPosition,
|
|
1766
|
+
classNamePrefix: "jett-dropdown"
|
|
1767
|
+
}
|
|
1768
|
+
));
|
|
1769
|
+
}
|
|
1770
|
+
);
|
|
1771
|
+
Dropdown.displayName = "Dropdown";
|
|
1772
|
+
|
|
1625
1773
|
// src/Pagination/Pagination.jsx
|
|
1626
|
-
import
|
|
1774
|
+
import React18, { useMemo as useMemo2, useState as useState6, useEffect as useEffect4 } from "react";
|
|
1627
1775
|
import { ChevronLeft, ChevronRight as ChevronRight2, ChevronsLeft, ChevronsRight } from "lucide-react";
|
|
1628
1776
|
var Pagination = ({
|
|
1629
1777
|
id = "pagination",
|
|
@@ -1655,13 +1803,13 @@ var Pagination = ({
|
|
|
1655
1803
|
const currentPage = isControlled ? controlledCurrentPage : internalCurrentPage;
|
|
1656
1804
|
const activeItemsPerPage = isItemsPerPageControlled ? itemsPerPage : internalItemsPerPage;
|
|
1657
1805
|
const totalItems = legacyTotalItems !== void 0 ? legacyTotalItems : data.length;
|
|
1658
|
-
const calculatedTotalPages =
|
|
1806
|
+
const calculatedTotalPages = useMemo2(() => {
|
|
1659
1807
|
if (totalItems > 0 && activeItemsPerPage > 0) {
|
|
1660
1808
|
return Math.ceil(totalItems / activeItemsPerPage);
|
|
1661
1809
|
}
|
|
1662
1810
|
return 1;
|
|
1663
1811
|
}, [totalItems, activeItemsPerPage]);
|
|
1664
|
-
const paginatedData =
|
|
1812
|
+
const paginatedData = useMemo2(() => {
|
|
1665
1813
|
if (!data || data.length === 0) return [];
|
|
1666
1814
|
const startIndex = (currentPage - 1) * activeItemsPerPage;
|
|
1667
1815
|
const endIndex = startIndex + activeItemsPerPage;
|
|
@@ -1700,11 +1848,11 @@ var Pagination = ({
|
|
|
1700
1848
|
const endItem = totalItems !== void 0 ? Math.min(currentPage * activeItemsPerPage, totalItems) : null;
|
|
1701
1849
|
const renderContent = () => {
|
|
1702
1850
|
if (Component) {
|
|
1703
|
-
if (
|
|
1851
|
+
if (React18.isValidElement(Component)) {
|
|
1704
1852
|
const ComponentType = Component.type;
|
|
1705
1853
|
const elementProps = Component.props;
|
|
1706
1854
|
if (isTable) {
|
|
1707
|
-
return /* @__PURE__ */
|
|
1855
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1708
1856
|
CustomTable,
|
|
1709
1857
|
{
|
|
1710
1858
|
tableHeader,
|
|
@@ -1712,7 +1860,7 @@ var Pagination = ({
|
|
|
1712
1860
|
id: `${id}-custom-table-1`
|
|
1713
1861
|
},
|
|
1714
1862
|
data.map((item, index) => {
|
|
1715
|
-
return /* @__PURE__ */
|
|
1863
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1716
1864
|
ComponentType,
|
|
1717
1865
|
{
|
|
1718
1866
|
key: item.id || item._id || index,
|
|
@@ -1727,7 +1875,7 @@ var Pagination = ({
|
|
|
1727
1875
|
);
|
|
1728
1876
|
} else {
|
|
1729
1877
|
if (isTable) {
|
|
1730
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1731
1879
|
CustomTable,
|
|
1732
1880
|
{
|
|
1733
1881
|
tableHeader,
|
|
@@ -1735,7 +1883,7 @@ var Pagination = ({
|
|
|
1735
1883
|
id: `${id}-custom-table-2`
|
|
1736
1884
|
},
|
|
1737
1885
|
paginatedData.map((item, index) => {
|
|
1738
|
-
return /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1739
1887
|
ComponentType,
|
|
1740
1888
|
{
|
|
1741
1889
|
key: item.id || item._id || index,
|
|
@@ -1751,7 +1899,7 @@ var Pagination = ({
|
|
|
1751
1899
|
}
|
|
1752
1900
|
}
|
|
1753
1901
|
} else {
|
|
1754
|
-
return /* @__PURE__ */
|
|
1902
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1755
1903
|
CustomTable,
|
|
1756
1904
|
{
|
|
1757
1905
|
tableHeader,
|
|
@@ -1759,7 +1907,7 @@ var Pagination = ({
|
|
|
1759
1907
|
id: `${id}-custom-table-3`
|
|
1760
1908
|
},
|
|
1761
1909
|
paginatedData.map((item, index) => {
|
|
1762
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1763
1911
|
Component,
|
|
1764
1912
|
{
|
|
1765
1913
|
key: item.id || item._id || index,
|
|
@@ -1775,7 +1923,7 @@ var Pagination = ({
|
|
|
1775
1923
|
}
|
|
1776
1924
|
return null;
|
|
1777
1925
|
};
|
|
1778
|
-
return /* @__PURE__ */
|
|
1926
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(React18.Fragment, null, renderContent()), /* @__PURE__ */ React18.createElement("div", { className: "flex flex-col sm:flex-row justify-between items-center gap-4 px-4 py-3 border-t border-[#e5e5e5] dark:border-[#303036] bg-white dark:bg-[#18181b] z-10", id: `${id}-div-1` }, totalItems !== void 0 && /* @__PURE__ */ React18.createElement("div", { className: "text-sm text-[#737373] dark:text-white", id: `${id}-div-2` }, "Showing ", startItem, " to ", endItem, " of ", totalItems, " entries"), /* @__PURE__ */ React18.createElement("div", { className: "flex items-center gap-2", id: `${id}-div-3` }, /* @__PURE__ */ React18.createElement(
|
|
1779
1927
|
"button",
|
|
1780
1928
|
{
|
|
1781
1929
|
onClick: () => handlePageChange(1),
|
|
@@ -1784,8 +1932,8 @@ var Pagination = ({
|
|
|
1784
1932
|
title: "First page",
|
|
1785
1933
|
id: `${id}-button-1`
|
|
1786
1934
|
},
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
), /* @__PURE__ */
|
|
1935
|
+
/* @__PURE__ */ React18.createElement(ChevronsLeft, { size: 16 })
|
|
1936
|
+
), /* @__PURE__ */ React18.createElement(
|
|
1789
1937
|
"button",
|
|
1790
1938
|
{
|
|
1791
1939
|
onClick: () => handlePageChange(currentPage - 1),
|
|
@@ -1794,8 +1942,8 @@ var Pagination = ({
|
|
|
1794
1942
|
title: "Previous page",
|
|
1795
1943
|
id: `${id}-button-2`
|
|
1796
1944
|
},
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
), getPageNumbers().map((pageNum) => /* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ React18.createElement(ChevronLeft, { size: 16 })
|
|
1946
|
+
), getPageNumbers().map((pageNum) => /* @__PURE__ */ React18.createElement(
|
|
1799
1947
|
"button",
|
|
1800
1948
|
{
|
|
1801
1949
|
key: pageNum,
|
|
@@ -1804,7 +1952,7 @@ var Pagination = ({
|
|
|
1804
1952
|
id: `${id}-button-3`
|
|
1805
1953
|
},
|
|
1806
1954
|
pageNum
|
|
1807
|
-
)), /* @__PURE__ */
|
|
1955
|
+
)), /* @__PURE__ */ React18.createElement(
|
|
1808
1956
|
"button",
|
|
1809
1957
|
{
|
|
1810
1958
|
onClick: () => handlePageChange(currentPage + 1),
|
|
@@ -1813,8 +1961,8 @@ var Pagination = ({
|
|
|
1813
1961
|
title: "Next page",
|
|
1814
1962
|
id: `${id}-button-4`
|
|
1815
1963
|
},
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
-
), /* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ React18.createElement(ChevronRight2, { size: 16 })
|
|
1965
|
+
), /* @__PURE__ */ React18.createElement(
|
|
1818
1966
|
"button",
|
|
1819
1967
|
{
|
|
1820
1968
|
onClick: () => handlePageChange(calculatedTotalPages),
|
|
@@ -1823,7 +1971,7 @@ var Pagination = ({
|
|
|
1823
1971
|
title: "Last page",
|
|
1824
1972
|
id: `${id}-button-5`
|
|
1825
1973
|
},
|
|
1826
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ React18.createElement(ChevronsRight, { size: 16 })
|
|
1827
1975
|
))));
|
|
1828
1976
|
};
|
|
1829
1977
|
export {
|
|
@@ -1839,6 +1987,7 @@ export {
|
|
|
1839
1987
|
CustomTable,
|
|
1840
1988
|
CustomTextarea,
|
|
1841
1989
|
CustomUpload,
|
|
1990
|
+
Dropdown,
|
|
1842
1991
|
Pagination,
|
|
1843
1992
|
ProgressBar,
|
|
1844
1993
|
RightSheet
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jett.admin.npmpackage",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"js-cookie": "^3.0.5",
|
|
28
28
|
"lucide-react": "^0.544.0",
|
|
29
29
|
"node-forge": "^1.4.0",
|
|
30
|
+
"react-select": "^5.10.2",
|
|
30
31
|
"tailwind-merge": "^3.3.1",
|
|
31
32
|
"tsup": "^8.5.0"
|
|
32
33
|
},
|