@saas-ui/react 3.0.0-alpha.3 → 3.0.0-alpha.31
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/CHANGELOG.md +410 -1
- package/dist/chunk-2EUACKRH.js +26 -0
- package/dist/chunk-32DD6PHF.js +63 -0
- package/dist/chunk-3JZ42NYM.js +100 -0
- package/dist/chunk-3MO37LYW.js +326 -0
- package/dist/chunk-46ISJZBS.js +119 -0
- package/dist/{chunk-VDXTEASE.js → chunk-4TPVIHNO.js} +10 -1
- package/dist/chunk-52XM5VXJ.js +9 -0
- package/dist/chunk-5MTFSSOH.js +16 -0
- package/dist/chunk-6YZ76Q2W.js +8 -0
- package/dist/chunk-6ZNR6N2K.js +45 -0
- package/dist/chunk-CQD32UVJ.js +8 -0
- package/dist/chunk-GRUMUCSL.js +109 -0
- package/dist/chunk-GWC5GCMW.js +177 -0
- package/dist/chunk-I2RXEKTB.js +38 -0
- package/dist/chunk-IEWHAXXU.js +28 -0
- package/dist/chunk-IGT224EZ.js +56 -0
- package/dist/chunk-INV6RT5B.js +8 -0
- package/dist/chunk-IVLUAUU5.js +10 -0
- package/dist/chunk-JMYI6YXR.js +1 -0
- package/dist/chunk-JO4WJVYO.js +43 -0
- package/dist/chunk-K2SPPLAY.js +231 -0
- package/dist/chunk-KE5AC3TZ.js +63 -0
- package/dist/chunk-KFXNVUEZ.js +102 -0
- package/dist/chunk-L356FPLY.js +20 -0
- package/dist/chunk-LTVFG6UC.js +54 -0
- package/dist/chunk-MLJN6IOJ.js +96 -0
- package/dist/chunk-MS2ELLDY.js +26 -0
- package/dist/chunk-NGGISORT.js +29 -0
- package/dist/chunk-NGSHWY7E.js +27 -0
- package/dist/chunk-NSD5HRIP.js +46 -0
- package/dist/chunk-Q6SNJJO2.js +63 -0
- package/dist/chunk-QSNSWCTM.js +32 -0
- package/dist/chunk-RLIAFHVM.js +66 -0
- package/dist/chunk-S5J6REMC.js +40 -0
- package/dist/chunk-SA3OGTOO.js +23 -0
- package/dist/chunk-SKXSBAOS.js +35 -0
- package/dist/{components/breadcrumbs/index.js → chunk-TT4C5VXB.js} +6 -7
- package/dist/chunk-TZBAM4AD.js +20 -0
- package/dist/chunk-U23VDAWJ.js +143 -0
- package/dist/chunk-UASXI64E.js +34 -0
- package/dist/chunk-VZG7EJ64.js +70 -0
- package/dist/chunk-WYLMBMAH.js +22 -0
- package/dist/chunk-YHQ5JGCC.js +1 -0
- package/dist/chunk-YKSY7UOM.js +20 -0
- package/dist/{chunk-FZW2DYK3.js → chunk-YXGJOOMM.js} +1 -1
- package/dist/components/app-shell/index.cjs +1 -1
- package/dist/components/app-shell/index.d.cts +1 -1
- package/dist/components/app-shell/index.d.ts +1 -1
- package/dist/components/app-shell/index.js +3 -40
- package/dist/components/avatar/index.cjs +69 -0
- package/dist/components/avatar/index.d.cts +18 -0
- package/dist/components/avatar/index.d.ts +18 -0
- package/dist/components/avatar/index.js +11 -0
- package/dist/components/badge/index.cjs +31 -0
- package/dist/components/badge/index.d.cts +7 -0
- package/dist/components/badge/index.d.ts +7 -0
- package/dist/components/badge/index.js +8 -0
- package/dist/components/{breadcrumbs → breadcrumb}/index.cjs +8 -10
- package/dist/components/{breadcrumbs → breadcrumb}/index.d.cts +3 -4
- package/dist/components/{breadcrumbs → breadcrumb}/index.d.ts +3 -4
- package/dist/components/breadcrumb/index.js +8 -0
- package/dist/components/button/index.cjs +8 -26
- package/dist/components/button/index.js +3 -40
- package/dist/components/card/index.cjs +31 -0
- package/dist/components/card/index.d.cts +1 -0
- package/dist/components/card/index.d.ts +1 -0
- package/dist/components/card/index.js +8 -0
- package/dist/components/checkbox/index.js +3 -15
- package/dist/components/close-button/index.cjs +8 -0
- package/dist/components/close-button/index.js +3 -2
- package/dist/components/command/index.cjs +13 -13
- package/dist/components/command/index.d.cts +28 -2
- package/dist/components/command/index.d.ts +28 -2
- package/dist/components/command/index.js +3 -28
- package/dist/components/data-list/index.cjs +33 -0
- package/dist/components/data-list/index.d.cts +1 -0
- package/dist/components/data-list/index.d.ts +1 -0
- package/dist/components/data-list/index.js +10 -0
- package/dist/components/dialog/index.cjs +51 -90
- package/dist/components/dialog/index.d.cts +35 -16
- package/dist/components/dialog/index.d.ts +35 -16
- package/dist/components/dialog/index.js +7 -69
- package/dist/components/drawer/index.cjs +55 -97
- package/dist/components/drawer/index.d.cts +34 -18
- package/dist/components/drawer/index.d.ts +34 -18
- package/dist/components/drawer/index.js +7 -61
- package/dist/components/empty-state/index.cjs +50 -0
- package/dist/components/empty-state/index.d.cts +11 -0
- package/dist/components/empty-state/index.d.ts +11 -0
- package/dist/components/empty-state/index.js +8 -0
- package/dist/components/file-upload/index.cjs +254 -0
- package/dist/components/file-upload/index.d.cts +43 -0
- package/dist/components/file-upload/index.d.ts +43 -0
- package/dist/components/file-upload/index.js +10 -0
- package/dist/components/grid-list/index.cjs +68 -0
- package/dist/components/grid-list/index.d.cts +84 -0
- package/dist/components/grid-list/index.d.ts +84 -0
- package/dist/components/grid-list/index.js +8 -0
- package/dist/components/icon-badge/index.cjs +1 -1
- package/dist/components/icon-badge/index.d.cts +1 -1
- package/dist/components/icon-badge/index.d.ts +1 -1
- package/dist/components/icon-badge/index.js +3 -33
- package/dist/components/icon-button/index.cjs +67 -0
- package/dist/components/icon-button/index.d.cts +9 -0
- package/dist/components/icon-button/index.d.ts +9 -0
- package/dist/components/icon-button/index.js +9 -0
- package/dist/components/icons/index.cjs +10 -0
- package/dist/components/icons/index.d.cts +2 -1
- package/dist/components/icons/index.d.ts +2 -1
- package/dist/components/icons/index.js +3 -1
- package/dist/components/input/index.cjs +37 -0
- package/dist/components/input/index.d.cts +1 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +14 -0
- package/dist/components/link/index.js +3 -14
- package/dist/components/loading-overlay/index.cjs +44 -1878
- package/dist/components/loading-overlay/index.d.cts +19 -6
- package/dist/components/loading-overlay/index.d.ts +19 -6
- package/dist/components/loading-overlay/index.js +7 -1874
- package/dist/components/menu/index.cjs +239 -0
- package/dist/components/menu/index.d.cts +39 -0
- package/dist/components/menu/index.d.ts +39 -0
- package/dist/components/menu/index.js +11 -0
- package/dist/components/navbar/index.cjs +61 -15
- package/dist/components/navbar/index.d.cts +12 -9
- package/dist/components/navbar/index.d.ts +12 -9
- package/dist/components/navbar/index.js +5 -38
- package/dist/components/number-input/index.cjs +9 -1
- package/dist/components/number-input/index.js +3 -26
- package/dist/components/pagination/index.cjs +215 -0
- package/dist/components/pagination/index.d.cts +41 -0
- package/dist/components/pagination/index.d.ts +41 -0
- package/dist/components/pagination/index.js +9 -0
- package/dist/components/password-input/index.cjs +2 -2
- package/dist/components/password-input/index.js +3 -225
- package/dist/components/persona/index.cjs +101 -36
- package/dist/components/persona/index.d.cts +131 -5
- package/dist/components/persona/index.d.ts +131 -5
- package/dist/components/persona/index.js +8 -144
- package/dist/components/pin-input/index.js +3 -21
- package/dist/components/popover/index.cjs +214 -0
- package/dist/components/popover/index.d.cts +37 -0
- package/dist/components/popover/index.d.ts +37 -0
- package/dist/components/popover/index.js +11 -0
- package/dist/components/progress/index.cjs +31 -0
- package/dist/components/progress/index.d.cts +1 -0
- package/dist/components/progress/index.d.ts +1 -0
- package/dist/components/progress/index.js +8 -0
- package/dist/components/progress-circle/index.cjs +31 -0
- package/dist/components/progress-circle/index.d.cts +1 -0
- package/dist/components/progress-circle/index.d.ts +1 -0
- package/dist/components/progress-circle/index.js +8 -0
- package/dist/components/radio/index.js +4 -16
- package/dist/components/search-input/index.cjs +8 -0
- package/dist/components/search-input/index.js +4 -114
- package/dist/components/segmented-control/index.cjs +60 -0
- package/dist/components/segmented-control/index.d.cts +14 -0
- package/dist/components/segmented-control/index.d.ts +14 -0
- package/dist/components/segmented-control/index.js +8 -0
- package/dist/components/select/index.cjs +8 -0
- package/dist/components/select/index.js +6 -95
- package/dist/components/sidebar/index.cjs +66 -32
- package/dist/components/sidebar/index.d.cts +30 -25
- package/dist/components/sidebar/index.d.ts +30 -25
- package/dist/components/sidebar/index.js +7 -101
- package/dist/components/status/index.cjs +45 -0
- package/dist/components/status/index.d.cts +17 -0
- package/dist/components/status/index.d.ts +17 -0
- package/dist/components/status/index.js +8 -0
- package/dist/components/steps/index.cjs +17 -10
- package/dist/components/steps/index.d.cts +4 -4
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/steps/index.js +6 -67
- package/dist/components/switch/index.js +3 -18
- package/dist/components/tabs/index.cjs +35 -0
- package/dist/components/tabs/index.d.cts +1 -0
- package/dist/components/tabs/index.d.ts +1 -0
- package/dist/components/tabs/index.js +12 -0
- package/dist/components/tag/index.cjs +53 -0
- package/dist/components/tag/index.d.cts +12 -0
- package/dist/components/tag/index.d.ts +12 -0
- package/dist/components/tag/index.js +8 -0
- package/dist/components/textarea/index.cjs +31 -0
- package/dist/components/textarea/index.d.cts +1 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/index.js +8 -0
- package/dist/components/toaster/index.cjs +204 -0
- package/dist/components/toaster/index.d.cts +11 -0
- package/dist/components/toaster/index.d.ts +11 -0
- package/dist/components/toaster/index.js +12 -0
- package/dist/components/tooltip/index.cjs +57 -0
- package/dist/components/tooltip/index.d.cts +14 -0
- package/dist/components/tooltip/index.d.ts +14 -0
- package/dist/components/tooltip/index.js +8 -0
- package/dist/index.cjs +8618 -5735
- package/dist/index.d.cts +50 -2
- package/dist/index.d.ts +50 -2
- package/dist/index.js +5733 -5021
- package/dist/theme/tokens/colors.cjs +349 -0
- package/dist/theme/tokens/colors.d.cts +856 -0
- package/dist/theme/tokens/colors.d.ts +856 -0
- package/dist/theme/tokens/colors.js +8 -0
- package/dist/types-DnFoUudY.d.cts +10 -0
- package/dist/types-DnFoUudY.d.ts +10 -0
- package/package.json +11 -4
- package/dist/chunk-VBIVLREP.js +0 -45
- /package/dist/{chunk-KHRLZUV4.js → chunk-O2WVT2BP.js} +0 -0
@@ -0,0 +1,215 @@
|
|
1
|
+
'use client'
|
2
|
+
"use strict";
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __export = (target, all) => {
|
8
|
+
for (var name in all)
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
10
|
+
};
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
13
|
+
for (let key of __getOwnPropNames(from))
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
16
|
+
}
|
17
|
+
return to;
|
18
|
+
};
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
20
|
+
|
21
|
+
// src/components/pagination/index.ts
|
22
|
+
var pagination_exports2 = {};
|
23
|
+
__export(pagination_exports2, {
|
24
|
+
Pagination: () => pagination_exports
|
25
|
+
});
|
26
|
+
module.exports = __toCommonJS(pagination_exports2);
|
27
|
+
|
28
|
+
// src/components/pagination/pagination.tsx
|
29
|
+
var pagination_exports = {};
|
30
|
+
__export(pagination_exports, {
|
31
|
+
Context: () => Context,
|
32
|
+
Ellipsis: () => Ellipsis,
|
33
|
+
Item: () => Item,
|
34
|
+
Items: () => Items,
|
35
|
+
NextButton: () => NextButton,
|
36
|
+
NextTrigger: () => NextTrigger,
|
37
|
+
PageText: () => PageText,
|
38
|
+
PrevButton: () => PrevButton,
|
39
|
+
PrevTrigger: () => PrevTrigger,
|
40
|
+
Root: () => Root
|
41
|
+
});
|
42
|
+
var import_react2 = require("react");
|
43
|
+
var import_react3 = require("@chakra-ui/react");
|
44
|
+
|
45
|
+
// src/components/icons/create-icon.tsx
|
46
|
+
var import_react = require("@chakra-ui/react");
|
47
|
+
var createIcon = (props) => {
|
48
|
+
return (0, import_react.createIcon)({
|
49
|
+
viewBox: "0 0 24 24",
|
50
|
+
defaultProps: {
|
51
|
+
fill: "none",
|
52
|
+
stroke: "currentColor",
|
53
|
+
strokeWidth: "2",
|
54
|
+
strokeLinecap: "round",
|
55
|
+
strokeLinejoin: "round"
|
56
|
+
},
|
57
|
+
...props
|
58
|
+
});
|
59
|
+
};
|
60
|
+
|
61
|
+
// src/components/icons/icons.tsx
|
62
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
63
|
+
var ChevronUpIcon = createIcon({
|
64
|
+
displayName: "ChevronUpIcon",
|
65
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "18 15 12 9 6 15" })
|
66
|
+
});
|
67
|
+
var ChevronDownIcon = createIcon({
|
68
|
+
displayName: "ChevronDownIcon",
|
69
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
70
|
+
});
|
71
|
+
var ChevronLeftIcon = createIcon({
|
72
|
+
displayName: "ChevronLeftIcon",
|
73
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "15 18 9 12 15 6" })
|
74
|
+
});
|
75
|
+
var ChevronRightIcon = createIcon({
|
76
|
+
displayName: "ChevronRightIcon",
|
77
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "9 18 15 12 9 6" })
|
78
|
+
});
|
79
|
+
var HamburgerIcon = createIcon({
|
80
|
+
displayName: "ChevronDownIcon",
|
81
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "none", children: [
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
|
85
|
+
] })
|
86
|
+
});
|
87
|
+
var CloseIcon = createIcon({
|
88
|
+
displayName: "CloseIcon",
|
89
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
92
|
+
] })
|
93
|
+
});
|
94
|
+
var FilterIcon = createIcon({
|
95
|
+
displayName: "FilterIcon",
|
96
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" })
|
97
|
+
});
|
98
|
+
var CalendarIcon = createIcon({
|
99
|
+
displayName: "CalendarIcon",
|
100
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
105
|
+
] })
|
106
|
+
});
|
107
|
+
var PlusIcon = createIcon({
|
108
|
+
displayName: "PlusIcon",
|
109
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
110
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
112
|
+
] })
|
113
|
+
});
|
114
|
+
var MinusIcon = createIcon({
|
115
|
+
displayName: "MinusIcon",
|
116
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) })
|
117
|
+
});
|
118
|
+
var ViewOffIcon = createIcon({
|
119
|
+
displayName: "ViewOffIcon",
|
120
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
121
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
122
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
123
|
+
] })
|
124
|
+
});
|
125
|
+
var ViewIcon = createIcon({
|
126
|
+
displayName: "ViewOffIcon",
|
127
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
130
|
+
] })
|
131
|
+
});
|
132
|
+
var SearchIcon = createIcon({
|
133
|
+
displayName: "SearchIcon",
|
134
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
137
|
+
] })
|
138
|
+
});
|
139
|
+
var CheckIcon = createIcon({
|
140
|
+
displayName: "CheckIcon",
|
141
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "20 6 9 17 4 12" }) })
|
142
|
+
});
|
143
|
+
var EllipsisIcon = createIcon({
|
144
|
+
displayName: "EllipsisIcon",
|
145
|
+
path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "1" }),
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "19", cy: "12", r: "1" }),
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5", cy: "12", r: "1" })
|
149
|
+
] })
|
150
|
+
});
|
151
|
+
|
152
|
+
// src/components/pagination/pagination.tsx
|
153
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
154
|
+
var [RootPropsProvider, useRootProps] = (0, import_react3.createContext)({
|
155
|
+
name: "RootPropsProvider"
|
156
|
+
});
|
157
|
+
var variantMap = {
|
158
|
+
outline: { default: "ghost", ellipsis: "plain", current: "outline" },
|
159
|
+
solid: { default: "outline", ellipsis: "outline", current: "solid" },
|
160
|
+
subtle: { default: "ghost", ellipsis: "plain", current: "subtle" }
|
161
|
+
};
|
162
|
+
var Root = (0, import_react2.forwardRef)(
|
163
|
+
function PaginationRoot(props, ref) {
|
164
|
+
const { size = "sm", variant = "outline", ...rest } = props;
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(RootPropsProvider, { value: { size, variantMap: variantMap[variant] }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Pagination.Root, { ref, type: "button", ...rest }) });
|
166
|
+
}
|
167
|
+
);
|
168
|
+
var Ellipsis = (0, import_react2.forwardRef)(function PaginationEllipsis(props, ref) {
|
169
|
+
var _a;
|
170
|
+
const { size, variantMap: variantMap2 } = useRootProps();
|
171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Pagination.Ellipsis, { ref, ...props, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Button, { as: "span", variant: variantMap2.ellipsis, size, children: (_a = props.children) != null ? _a : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(EllipsisIcon, {}) }) });
|
172
|
+
});
|
173
|
+
var Item = (0, import_react2.forwardRef)(
|
174
|
+
function PaginationItem(props, ref) {
|
175
|
+
const { page } = (0, import_react3.usePaginationContext)();
|
176
|
+
const { size, variantMap: variantMap2 } = useRootProps();
|
177
|
+
const current = page === props.value;
|
178
|
+
const variant = current ? variantMap2.current : variantMap2.default;
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Pagination.Item, { ref, ...props, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Button, { variant, size, children: props.value }) });
|
180
|
+
}
|
181
|
+
);
|
182
|
+
var PrevButton = (0, import_react2.forwardRef)(function PaginationPrevTrigger(props, ref) {
|
183
|
+
var _a;
|
184
|
+
const { size, variantMap: variantMap2 } = useRootProps();
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Pagination.PrevTrigger, { ref, asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.IconButton, { variant: variantMap2.default, size, children: (_a = props.children) != null ? _a : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChevronLeftIcon, {}) }) });
|
186
|
+
});
|
187
|
+
var NextButton = (0, import_react2.forwardRef)(function PaginationNextTrigger(props, ref) {
|
188
|
+
var _a;
|
189
|
+
const { size, variantMap: variantMap2 } = useRootProps();
|
190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Pagination.NextTrigger, { ref, asChild: true, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.IconButton, { variant: variantMap2.default, size, children: (_a = props.children) != null ? _a : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChevronRightIcon, {}) }) });
|
191
|
+
});
|
192
|
+
var Items = (props) => {
|
193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Pagination.Context, { children: ({ pages }) => pages.map((page, index) => {
|
194
|
+
return page.type === "ellipsis" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Ellipsis, { index, ...props }, index) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Item, { type: "page", value: page.value, ...props }, index);
|
195
|
+
}) });
|
196
|
+
};
|
197
|
+
var PageText = (0, import_react2.forwardRef)(
|
198
|
+
function PaginationPageText(props, ref) {
|
199
|
+
const { format = "compact", ...rest } = props;
|
200
|
+
const { page, pages, pageRange, count } = (0, import_react3.usePaginationContext)();
|
201
|
+
const content = (0, import_react2.useMemo)(() => {
|
202
|
+
if (format === "short") return `${page} / ${pages.length}`;
|
203
|
+
if (format === "compact") return `${page} of ${pages.length}`;
|
204
|
+
return `${pageRange.start + 1} - ${pageRange.end} of ${count}`;
|
205
|
+
}, [format, page, pages.length, pageRange, count]);
|
206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.Text, { fontWeight: "medium", ref, ...rest, children: content });
|
207
|
+
}
|
208
|
+
);
|
209
|
+
var PrevTrigger = import_react3.Pagination.PrevTrigger;
|
210
|
+
var NextTrigger = import_react3.Pagination.NextTrigger;
|
211
|
+
var Context = import_react3.Pagination.Context;
|
212
|
+
// Annotate the CommonJS export names for ESM import in node:
|
213
|
+
0 && (module.exports = {
|
214
|
+
Pagination
|
215
|
+
});
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import * as _ark_ui_react from '@ark-ui/react';
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
3
|
+
import * as react from 'react';
|
4
|
+
import { Pagination, ButtonProps, TextProps } from '@chakra-ui/react';
|
5
|
+
|
6
|
+
type PaginationVariant = 'outline' | 'solid' | 'subtle';
|
7
|
+
interface RootProps extends Omit<Pagination.RootProps, 'type'> {
|
8
|
+
size?: ButtonProps['size'];
|
9
|
+
variant?: PaginationVariant;
|
10
|
+
}
|
11
|
+
declare const Root: react.ForwardRefExoticComponent<RootProps & react.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const Ellipsis: react.ForwardRefExoticComponent<Pagination.EllipsisProps & react.RefAttributes<HTMLDivElement>>;
|
13
|
+
declare const Item: react.ForwardRefExoticComponent<Pagination.ItemProps & react.RefAttributes<HTMLButtonElement>>;
|
14
|
+
declare const PrevButton: react.ForwardRefExoticComponent<Pagination.PrevTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
15
|
+
declare const NextButton: react.ForwardRefExoticComponent<Pagination.NextTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
16
|
+
declare const Items: (props: React.HTMLAttributes<HTMLElement>) => react_jsx_runtime.JSX.Element;
|
17
|
+
interface PageTextProps extends TextProps {
|
18
|
+
format?: 'short' | 'compact' | 'long';
|
19
|
+
}
|
20
|
+
declare const PageText: react.ForwardRefExoticComponent<PageTextProps & react.RefAttributes<HTMLParagraphElement>>;
|
21
|
+
declare const PrevTrigger: react.ForwardRefExoticComponent<Pagination.PrevTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
22
|
+
declare const NextTrigger: react.ForwardRefExoticComponent<Pagination.NextTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
23
|
+
declare const Context: (props: _ark_ui_react.PaginationContextProps) => react.ReactNode;
|
24
|
+
|
25
|
+
declare const pagination_Context: typeof Context;
|
26
|
+
declare const pagination_Ellipsis: typeof Ellipsis;
|
27
|
+
declare const pagination_Item: typeof Item;
|
28
|
+
declare const pagination_Items: typeof Items;
|
29
|
+
declare const pagination_NextButton: typeof NextButton;
|
30
|
+
declare const pagination_NextTrigger: typeof NextTrigger;
|
31
|
+
declare const pagination_PageText: typeof PageText;
|
32
|
+
type pagination_PageTextProps = PageTextProps;
|
33
|
+
declare const pagination_PrevButton: typeof PrevButton;
|
34
|
+
declare const pagination_PrevTrigger: typeof PrevTrigger;
|
35
|
+
declare const pagination_Root: typeof Root;
|
36
|
+
type pagination_RootProps = RootProps;
|
37
|
+
declare namespace pagination {
|
38
|
+
export { pagination_Context as Context, pagination_Ellipsis as Ellipsis, pagination_Item as Item, pagination_Items as Items, pagination_NextButton as NextButton, pagination_NextTrigger as NextTrigger, pagination_PageText as PageText, type pagination_PageTextProps as PageTextProps, pagination_PrevButton as PrevButton, pagination_PrevTrigger as PrevTrigger, pagination_Root as Root, type pagination_RootProps as RootProps };
|
39
|
+
}
|
40
|
+
|
41
|
+
export { pagination as Pagination };
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import * as _ark_ui_react from '@ark-ui/react';
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
3
|
+
import * as react from 'react';
|
4
|
+
import { Pagination, ButtonProps, TextProps } from '@chakra-ui/react';
|
5
|
+
|
6
|
+
type PaginationVariant = 'outline' | 'solid' | 'subtle';
|
7
|
+
interface RootProps extends Omit<Pagination.RootProps, 'type'> {
|
8
|
+
size?: ButtonProps['size'];
|
9
|
+
variant?: PaginationVariant;
|
10
|
+
}
|
11
|
+
declare const Root: react.ForwardRefExoticComponent<RootProps & react.RefAttributes<HTMLDivElement>>;
|
12
|
+
declare const Ellipsis: react.ForwardRefExoticComponent<Pagination.EllipsisProps & react.RefAttributes<HTMLDivElement>>;
|
13
|
+
declare const Item: react.ForwardRefExoticComponent<Pagination.ItemProps & react.RefAttributes<HTMLButtonElement>>;
|
14
|
+
declare const PrevButton: react.ForwardRefExoticComponent<Pagination.PrevTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
15
|
+
declare const NextButton: react.ForwardRefExoticComponent<Pagination.NextTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
16
|
+
declare const Items: (props: React.HTMLAttributes<HTMLElement>) => react_jsx_runtime.JSX.Element;
|
17
|
+
interface PageTextProps extends TextProps {
|
18
|
+
format?: 'short' | 'compact' | 'long';
|
19
|
+
}
|
20
|
+
declare const PageText: react.ForwardRefExoticComponent<PageTextProps & react.RefAttributes<HTMLParagraphElement>>;
|
21
|
+
declare const PrevTrigger: react.ForwardRefExoticComponent<Pagination.PrevTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
22
|
+
declare const NextTrigger: react.ForwardRefExoticComponent<Pagination.NextTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
23
|
+
declare const Context: (props: _ark_ui_react.PaginationContextProps) => react.ReactNode;
|
24
|
+
|
25
|
+
declare const pagination_Context: typeof Context;
|
26
|
+
declare const pagination_Ellipsis: typeof Ellipsis;
|
27
|
+
declare const pagination_Item: typeof Item;
|
28
|
+
declare const pagination_Items: typeof Items;
|
29
|
+
declare const pagination_NextButton: typeof NextButton;
|
30
|
+
declare const pagination_NextTrigger: typeof NextTrigger;
|
31
|
+
declare const pagination_PageText: typeof PageText;
|
32
|
+
type pagination_PageTextProps = PageTextProps;
|
33
|
+
declare const pagination_PrevButton: typeof PrevButton;
|
34
|
+
declare const pagination_PrevTrigger: typeof PrevTrigger;
|
35
|
+
declare const pagination_Root: typeof Root;
|
36
|
+
type pagination_RootProps = RootProps;
|
37
|
+
declare namespace pagination {
|
38
|
+
export { pagination_Context as Context, pagination_Ellipsis as Ellipsis, pagination_Item as Item, pagination_Items as Items, pagination_NextButton as NextButton, pagination_NextTrigger as NextTrigger, pagination_PageText as PageText, type pagination_PageTextProps as PageTextProps, pagination_PrevButton as PrevButton, pagination_PrevTrigger as PrevTrigger, pagination_Root as Root, type pagination_RootProps as RootProps };
|
39
|
+
}
|
40
|
+
|
41
|
+
export { pagination as Pagination };
|
@@ -179,10 +179,10 @@ function IconBase(props) {
|
|
179
179
|
|
180
180
|
// ../../node_modules/react-icons/lu/index.mjs
|
181
181
|
function LuEyeOff(props) {
|
182
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "
|
182
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }, "child": [] }, { "tag": "path", "attr": { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }, "child": [] }, { "tag": "path", "attr": { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }, "child": [] }, { "tag": "path", "attr": { "d": "m2 2 20 20" }, "child": [] }] })(props);
|
183
183
|
}
|
184
184
|
function LuEye(props) {
|
185
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M2
|
185
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }, "child": [] }, { "tag": "circle", "attr": { "cx": "12", "cy": "12", "r": "3" }, "child": [] }] })(props);
|
186
186
|
}
|
187
187
|
|
188
188
|
// src/components/input-group/input-group.tsx
|
@@ -1,231 +1,9 @@
|
|
1
1
|
'use client'
|
2
2
|
import {
|
3
|
-
|
4
|
-
} from "../../chunk-
|
3
|
+
PasswordInput
|
4
|
+
} from "../../chunk-K2SPPLAY.js";
|
5
|
+
import "../../chunk-PKI6YH2V.js";
|
5
6
|
import "../../chunk-RTMS5TJN.js";
|
6
|
-
|
7
|
-
// src/components/password-input/password-input.tsx
|
8
|
-
import { forwardRef, useRef } from "react";
|
9
|
-
import {
|
10
|
-
IconButton,
|
11
|
-
Input,
|
12
|
-
mergeRefs,
|
13
|
-
useControllableState
|
14
|
-
} from "@chakra-ui/react";
|
15
|
-
|
16
|
-
// ../../node_modules/react-icons/lib/iconBase.mjs
|
17
|
-
import React2 from "react";
|
18
|
-
|
19
|
-
// ../../node_modules/react-icons/lib/iconContext.mjs
|
20
|
-
import React from "react";
|
21
|
-
var DefaultContext = {
|
22
|
-
color: void 0,
|
23
|
-
size: void 0,
|
24
|
-
className: void 0,
|
25
|
-
style: void 0,
|
26
|
-
attr: void 0
|
27
|
-
};
|
28
|
-
var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
|
29
|
-
|
30
|
-
// ../../node_modules/react-icons/lib/iconBase.mjs
|
31
|
-
var _excluded = ["attr", "size", "title"];
|
32
|
-
function _objectWithoutProperties(source, excluded) {
|
33
|
-
if (source == null) return {};
|
34
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
35
|
-
var key, i;
|
36
|
-
if (Object.getOwnPropertySymbols) {
|
37
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
38
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
39
|
-
key = sourceSymbolKeys[i];
|
40
|
-
if (excluded.indexOf(key) >= 0) continue;
|
41
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
42
|
-
target[key] = source[key];
|
43
|
-
}
|
44
|
-
}
|
45
|
-
return target;
|
46
|
-
}
|
47
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
48
|
-
if (source == null) return {};
|
49
|
-
var target = {};
|
50
|
-
for (var key in source) {
|
51
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
52
|
-
if (excluded.indexOf(key) >= 0) continue;
|
53
|
-
target[key] = source[key];
|
54
|
-
}
|
55
|
-
}
|
56
|
-
return target;
|
57
|
-
}
|
58
|
-
function _extends() {
|
59
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
60
|
-
for (var i = 1; i < arguments.length; i++) {
|
61
|
-
var source = arguments[i];
|
62
|
-
for (var key in source) {
|
63
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
64
|
-
target[key] = source[key];
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
return target;
|
69
|
-
};
|
70
|
-
return _extends.apply(this, arguments);
|
71
|
-
}
|
72
|
-
function ownKeys(e, r) {
|
73
|
-
var t = Object.keys(e);
|
74
|
-
if (Object.getOwnPropertySymbols) {
|
75
|
-
var o = Object.getOwnPropertySymbols(e);
|
76
|
-
r && (o = o.filter(function(r2) {
|
77
|
-
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
78
|
-
})), t.push.apply(t, o);
|
79
|
-
}
|
80
|
-
return t;
|
81
|
-
}
|
82
|
-
function _objectSpread(e) {
|
83
|
-
for (var r = 1; r < arguments.length; r++) {
|
84
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
85
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
86
|
-
_defineProperty(e, r2, t[r2]);
|
87
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
88
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
89
|
-
});
|
90
|
-
}
|
91
|
-
return e;
|
92
|
-
}
|
93
|
-
function _defineProperty(obj, key, value) {
|
94
|
-
key = _toPropertyKey(key);
|
95
|
-
if (key in obj) {
|
96
|
-
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
97
|
-
} else {
|
98
|
-
obj[key] = value;
|
99
|
-
}
|
100
|
-
return obj;
|
101
|
-
}
|
102
|
-
function _toPropertyKey(t) {
|
103
|
-
var i = _toPrimitive(t, "string");
|
104
|
-
return "symbol" == typeof i ? i : i + "";
|
105
|
-
}
|
106
|
-
function _toPrimitive(t, r) {
|
107
|
-
if ("object" != typeof t || !t) return t;
|
108
|
-
var e = t[Symbol.toPrimitive];
|
109
|
-
if (void 0 !== e) {
|
110
|
-
var i = e.call(t, r || "default");
|
111
|
-
if ("object" != typeof i) return i;
|
112
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
113
|
-
}
|
114
|
-
return ("string" === r ? String : Number)(t);
|
115
|
-
}
|
116
|
-
function Tree2Element(tree) {
|
117
|
-
return tree && tree.map((node, i) => /* @__PURE__ */ React2.createElement(node.tag, _objectSpread({
|
118
|
-
key: i
|
119
|
-
}, node.attr), Tree2Element(node.child)));
|
120
|
-
}
|
121
|
-
function GenIcon(data) {
|
122
|
-
return (props) => /* @__PURE__ */ React2.createElement(IconBase, _extends({
|
123
|
-
attr: _objectSpread({}, data.attr)
|
124
|
-
}, props), Tree2Element(data.child));
|
125
|
-
}
|
126
|
-
function IconBase(props) {
|
127
|
-
var elem = (conf) => {
|
128
|
-
var {
|
129
|
-
attr,
|
130
|
-
size,
|
131
|
-
title
|
132
|
-
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
133
|
-
var computedSize = size || conf.size || "1em";
|
134
|
-
var className;
|
135
|
-
if (conf.className) className = conf.className;
|
136
|
-
if (props.className) className = (className ? className + " " : "") + props.className;
|
137
|
-
return /* @__PURE__ */ React2.createElement("svg", _extends({
|
138
|
-
stroke: "currentColor",
|
139
|
-
fill: "currentColor",
|
140
|
-
strokeWidth: "0"
|
141
|
-
}, conf.attr, attr, svgProps, {
|
142
|
-
className,
|
143
|
-
style: _objectSpread(_objectSpread({
|
144
|
-
color: props.color || conf.color
|
145
|
-
}, conf.style), props.style),
|
146
|
-
height: computedSize,
|
147
|
-
width: computedSize,
|
148
|
-
xmlns: "http://www.w3.org/2000/svg"
|
149
|
-
}), title && /* @__PURE__ */ React2.createElement("title", null, title), props.children);
|
150
|
-
};
|
151
|
-
return IconContext !== void 0 ? /* @__PURE__ */ React2.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
152
|
-
}
|
153
|
-
|
154
|
-
// ../../node_modules/react-icons/lu/index.mjs
|
155
|
-
function LuEyeOff(props) {
|
156
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M9.88 9.88a3 3 0 1 0 4.24 4.24" }, "child": [] }, { "tag": "path", "attr": { "d": "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }, "child": [] }, { "tag": "path", "attr": { "d": "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }, "child": [] }, { "tag": "line", "attr": { "x1": "2", "x2": "22", "y1": "2", "y2": "22" }, "child": [] }] })(props);
|
157
|
-
}
|
158
|
-
function LuEye(props) {
|
159
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }, "child": [] }, { "tag": "circle", "attr": { "cx": "12", "cy": "12", "r": "3" }, "child": [] }] })(props);
|
160
|
-
}
|
161
|
-
|
162
|
-
// src/components/password-input/password-input.tsx
|
163
|
-
import { jsx } from "react/jsx-runtime";
|
164
|
-
var PasswordInput = forwardRef(
|
165
|
-
function PasswordInput2(props, ref) {
|
166
|
-
const {
|
167
|
-
rootProps,
|
168
|
-
defaultVisible,
|
169
|
-
visible: visibleProp,
|
170
|
-
onVisibleChange,
|
171
|
-
visibilityIcon = { on: /* @__PURE__ */ jsx(LuEye, {}), off: /* @__PURE__ */ jsx(LuEyeOff, {}) },
|
172
|
-
...rest
|
173
|
-
} = props;
|
174
|
-
const [visible, setVisible] = useControllableState({
|
175
|
-
value: visibleProp,
|
176
|
-
defaultValue: defaultVisible || false,
|
177
|
-
onChange: onVisibleChange
|
178
|
-
});
|
179
|
-
const inputRef = useRef(null);
|
180
|
-
return /* @__PURE__ */ jsx(
|
181
|
-
InputGroup,
|
182
|
-
{
|
183
|
-
width: "full",
|
184
|
-
endElement: /* @__PURE__ */ jsx(
|
185
|
-
VisibilityTrigger,
|
186
|
-
{
|
187
|
-
disabled: rest.disabled,
|
188
|
-
onPointerDown: (e) => {
|
189
|
-
if (rest.disabled) return;
|
190
|
-
if (e.button !== 0) return;
|
191
|
-
e.preventDefault();
|
192
|
-
setVisible(!visible);
|
193
|
-
},
|
194
|
-
children: visible ? visibilityIcon.off : visibilityIcon.on
|
195
|
-
}
|
196
|
-
),
|
197
|
-
...rootProps,
|
198
|
-
children: /* @__PURE__ */ jsx(
|
199
|
-
Input,
|
200
|
-
{
|
201
|
-
...rest,
|
202
|
-
ref: mergeRefs(ref, inputRef),
|
203
|
-
type: visible ? "text" : "password"
|
204
|
-
}
|
205
|
-
)
|
206
|
-
}
|
207
|
-
);
|
208
|
-
}
|
209
|
-
);
|
210
|
-
var VisibilityTrigger = forwardRef(
|
211
|
-
function VisibilityTrigger2(props, ref) {
|
212
|
-
return /* @__PURE__ */ jsx(
|
213
|
-
IconButton,
|
214
|
-
{
|
215
|
-
tabIndex: -1,
|
216
|
-
ref,
|
217
|
-
me: "-2",
|
218
|
-
aspectRatio: "square",
|
219
|
-
size: "sm",
|
220
|
-
variant: "ghost",
|
221
|
-
colorPalette: "gray",
|
222
|
-
height: "calc(100% - {spacing.2})",
|
223
|
-
"aria-label": "Toggle password visibility",
|
224
|
-
...props
|
225
|
-
}
|
226
|
-
);
|
227
|
-
}
|
228
|
-
);
|
229
7
|
export {
|
230
8
|
PasswordInput
|
231
9
|
};
|