@saas-ui/react 3.0.0-alpha.3 → 3.0.0-alpha.30
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 +402 -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-6ZNR6N2K.js +45 -0
- package/dist/chunk-7VSTNV2B.js +53 -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-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 +3 -0
- package/dist/components/badge/index.d.ts +3 -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/link/index.js +3 -14
- package/dist/components/loading-overlay/index.cjs +42 -1879
- 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/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/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 +8277 -5428
- package/dist/index.d.cts +47 -2
- package/dist/index.d.ts +47 -2
- package/dist/index.js +5416 -4732
- 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,177 @@
|
|
1
|
+
'use client'
|
2
|
+
import {
|
3
|
+
Avatar
|
4
|
+
} from "./chunk-JO4WJVYO.js";
|
5
|
+
|
6
|
+
// src/components/persona/persona.tsx
|
7
|
+
import * as React2 from "react";
|
8
|
+
|
9
|
+
// src/components/persona/persona-primitive.tsx
|
10
|
+
import { forwardRef } from "react";
|
11
|
+
import {
|
12
|
+
chakra
|
13
|
+
} from "@chakra-ui/react";
|
14
|
+
import { dataAttr } from "@saas-ui/core/utils";
|
15
|
+
|
16
|
+
// src/components/persona/persona.context.ts
|
17
|
+
import { createSlotRecipeContext } from "@chakra-ui/react";
|
18
|
+
var {
|
19
|
+
useStyles: usePersonaStyles,
|
20
|
+
withProvider,
|
21
|
+
withContext
|
22
|
+
} = createSlotRecipeContext({
|
23
|
+
key: "suiPersona"
|
24
|
+
});
|
25
|
+
|
26
|
+
// src/components/persona/persona-primitive.tsx
|
27
|
+
import { jsx } from "react/jsx-runtime";
|
28
|
+
var PersonaRoot = withProvider(
|
29
|
+
forwardRef((props, ref) => {
|
30
|
+
const { outOfOffice, presence, ...rest } = props;
|
31
|
+
return /* @__PURE__ */ jsx(
|
32
|
+
chakra.div,
|
33
|
+
{
|
34
|
+
ref,
|
35
|
+
...rest,
|
36
|
+
"data-out-of-office": dataAttr(outOfOffice),
|
37
|
+
"data-presence": presence,
|
38
|
+
css: [
|
39
|
+
presence ? {
|
40
|
+
"--persona-presence": `colors.presence.${presence}`
|
41
|
+
} : void 0,
|
42
|
+
rest.css
|
43
|
+
]
|
44
|
+
}
|
45
|
+
);
|
46
|
+
}),
|
47
|
+
"root"
|
48
|
+
);
|
49
|
+
var PersonaAvatar = forwardRef(
|
50
|
+
(props, ref) => {
|
51
|
+
const {
|
52
|
+
name,
|
53
|
+
getInitials = (name2) => name2 == null ? void 0 : name2[0],
|
54
|
+
icon,
|
55
|
+
loading,
|
56
|
+
onError,
|
57
|
+
src,
|
58
|
+
srcSet,
|
59
|
+
children,
|
60
|
+
...rest
|
61
|
+
} = props;
|
62
|
+
return /* @__PURE__ */ jsx(Avatar, { ref, ...rest, children });
|
63
|
+
}
|
64
|
+
);
|
65
|
+
var PersonaPresenceBadge = withContext("span", "presence");
|
66
|
+
var PersonaDetails = withContext(
|
67
|
+
"div",
|
68
|
+
"details"
|
69
|
+
);
|
70
|
+
var PersonaLabel = withContext(
|
71
|
+
"span",
|
72
|
+
"label"
|
73
|
+
);
|
74
|
+
PersonaLabel.displayName = "PersonaLabel";
|
75
|
+
var PersonaSecondaryLabel = withContext(
|
76
|
+
"span",
|
77
|
+
"secondaryLabel"
|
78
|
+
);
|
79
|
+
var PersonaTertiaryLabel = withContext(
|
80
|
+
"span",
|
81
|
+
"tertiaryLabel"
|
82
|
+
);
|
83
|
+
|
84
|
+
// src/components/persona/persona.tsx
|
85
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
86
|
+
var Persona = React2.forwardRef(
|
87
|
+
(props, ref) => {
|
88
|
+
const {
|
89
|
+
name,
|
90
|
+
presence,
|
91
|
+
presenceIcon,
|
92
|
+
isOutOfOffice,
|
93
|
+
label,
|
94
|
+
secondaryLabel,
|
95
|
+
tertiaryLabel,
|
96
|
+
size,
|
97
|
+
hideDetails,
|
98
|
+
children,
|
99
|
+
/** Avatar props */
|
100
|
+
getInitials,
|
101
|
+
icon,
|
102
|
+
loading,
|
103
|
+
onError,
|
104
|
+
src,
|
105
|
+
srcSet,
|
106
|
+
fallback,
|
107
|
+
...rest
|
108
|
+
} = props;
|
109
|
+
return /* @__PURE__ */ jsxs(
|
110
|
+
PersonaRoot,
|
111
|
+
{
|
112
|
+
ref,
|
113
|
+
outOfOffice: isOutOfOffice,
|
114
|
+
presence,
|
115
|
+
size,
|
116
|
+
...rest,
|
117
|
+
children: [
|
118
|
+
/* @__PURE__ */ jsx2(
|
119
|
+
PersonaAvatar,
|
120
|
+
{
|
121
|
+
name,
|
122
|
+
size,
|
123
|
+
getInitials,
|
124
|
+
icon,
|
125
|
+
loading,
|
126
|
+
onError,
|
127
|
+
src,
|
128
|
+
srcSet,
|
129
|
+
fallback,
|
130
|
+
children: presence ? /* @__PURE__ */ jsx2(PersonaPresenceBadge, { children: presenceIcon }) : null
|
131
|
+
}
|
132
|
+
),
|
133
|
+
!hideDetails && /* @__PURE__ */ jsxs(PersonaDetails, { children: [
|
134
|
+
/* @__PURE__ */ jsx2(PersonaLabel, { children: label || name }),
|
135
|
+
secondaryLabel && /* @__PURE__ */ jsx2(PersonaSecondaryLabel, { children: secondaryLabel }),
|
136
|
+
tertiaryLabel && /* @__PURE__ */ jsx2(PersonaTertiaryLabel, { children: tertiaryLabel }),
|
137
|
+
children
|
138
|
+
] })
|
139
|
+
]
|
140
|
+
}
|
141
|
+
);
|
142
|
+
}
|
143
|
+
);
|
144
|
+
Persona.displayName = "Persona";
|
145
|
+
var PersonaAvatar2 = React2.forwardRef(function PersonaAvatar3(props, ref) {
|
146
|
+
return /* @__PURE__ */ jsx2(Persona, { ref, ...props, hideDetails: true });
|
147
|
+
});
|
148
|
+
|
149
|
+
// src/components/persona/presence.ts
|
150
|
+
var defaultPresenceOptions = {
|
151
|
+
online: {
|
152
|
+
label: "Online",
|
153
|
+
color: "presence.online"
|
154
|
+
},
|
155
|
+
offline: {
|
156
|
+
label: "Offline",
|
157
|
+
color: "presence.offline"
|
158
|
+
},
|
159
|
+
busy: {
|
160
|
+
label: "Busy",
|
161
|
+
color: "presence.busy"
|
162
|
+
},
|
163
|
+
dnd: {
|
164
|
+
label: "Do-not-disturb",
|
165
|
+
color: "presence.dnd"
|
166
|
+
},
|
167
|
+
away: {
|
168
|
+
label: "Away",
|
169
|
+
color: "presence.away"
|
170
|
+
}
|
171
|
+
};
|
172
|
+
|
173
|
+
export {
|
174
|
+
Persona,
|
175
|
+
PersonaAvatar2 as PersonaAvatar,
|
176
|
+
defaultPresenceOptions
|
177
|
+
};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
'use client'
|
2
|
+
|
3
|
+
// src/components/icon-badge/icon-badge.tsx
|
4
|
+
import * as React from "react";
|
5
|
+
import { cloneElement, isValidElement } from "react";
|
6
|
+
import {
|
7
|
+
chakra,
|
8
|
+
useRecipe
|
9
|
+
} from "@chakra-ui/react";
|
10
|
+
import { cx } from "@saas-ui/core/utils";
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
12
|
+
var IconBadge = React.forwardRef(
|
13
|
+
(props, ref) => {
|
14
|
+
const { icon, children, ...rest } = props;
|
15
|
+
const recipe = useRecipe({ key: "suiIconBadge", recipe: props.recipe });
|
16
|
+
const [variantProps, localProps] = recipe.splitVariantProps(rest);
|
17
|
+
const styles = recipe(variantProps);
|
18
|
+
const element = icon || children;
|
19
|
+
const _children = isValidElement(element) ? cloneElement(element, {
|
20
|
+
"aria-hidden": true,
|
21
|
+
focusable: false
|
22
|
+
}) : null;
|
23
|
+
return /* @__PURE__ */ jsx(
|
24
|
+
chakra.div,
|
25
|
+
{
|
26
|
+
ref,
|
27
|
+
...localProps,
|
28
|
+
css: [styles, props.css],
|
29
|
+
className: cx(recipe.className, props.className),
|
30
|
+
children: _children
|
31
|
+
}
|
32
|
+
);
|
33
|
+
}
|
34
|
+
);
|
35
|
+
|
36
|
+
export {
|
37
|
+
IconBadge
|
38
|
+
};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
'use client'
|
2
|
+
|
3
|
+
// src/components/tag/tag.tsx
|
4
|
+
import { forwardRef } from "react";
|
5
|
+
import { Tag as ChakraTag } from "@chakra-ui/react";
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
7
|
+
var Tag = forwardRef(
|
8
|
+
function Tag2(props, ref) {
|
9
|
+
const {
|
10
|
+
startElement,
|
11
|
+
endElement,
|
12
|
+
onClose,
|
13
|
+
closable = !!onClose,
|
14
|
+
children,
|
15
|
+
...rest
|
16
|
+
} = props;
|
17
|
+
return /* @__PURE__ */ jsxs(ChakraTag.Root, { ref, ...rest, children: [
|
18
|
+
startElement && /* @__PURE__ */ jsx(ChakraTag.StartElement, { children: startElement }),
|
19
|
+
/* @__PURE__ */ jsx(ChakraTag.Label, { children }),
|
20
|
+
endElement && /* @__PURE__ */ jsx(ChakraTag.EndElement, { children: endElement }),
|
21
|
+
closable && /* @__PURE__ */ jsx(ChakraTag.EndElement, { children: /* @__PURE__ */ jsx(ChakraTag.CloseTrigger, { onClick: onClose }) })
|
22
|
+
] });
|
23
|
+
}
|
24
|
+
);
|
25
|
+
|
26
|
+
export {
|
27
|
+
Tag
|
28
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
'use client'
|
@@ -0,0 +1,43 @@
|
|
1
|
+
'use client'
|
2
|
+
|
3
|
+
// src/components/avatar/avatar.tsx
|
4
|
+
import { forwardRef } from "react";
|
5
|
+
import { Avatar as ChakraAvatar, Group } from "@chakra-ui/react";
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
7
|
+
var Avatar = forwardRef(
|
8
|
+
function Avatar2(props, ref) {
|
9
|
+
const { name, src, srcSet, loading, icon, fallback, children, ...rest } = props;
|
10
|
+
return /* @__PURE__ */ jsxs(ChakraAvatar.Root, { ref, ...rest, children: [
|
11
|
+
/* @__PURE__ */ jsx(AvatarFallback, { name, icon, children: fallback }),
|
12
|
+
/* @__PURE__ */ jsx(ChakraAvatar.Image, { src, srcSet, loading }),
|
13
|
+
children
|
14
|
+
] });
|
15
|
+
}
|
16
|
+
);
|
17
|
+
var AvatarFallback = forwardRef(
|
18
|
+
function AvatarFallback2(props, ref) {
|
19
|
+
const { name, icon, children, ...rest } = props;
|
20
|
+
return /* @__PURE__ */ jsxs(ChakraAvatar.Fallback, { ref, ...rest, children: [
|
21
|
+
children,
|
22
|
+
name != null && children == null && /* @__PURE__ */ jsx(Fragment, { children: getInitials(name) }),
|
23
|
+
name == null && children == null && /* @__PURE__ */ jsx(ChakraAvatar.Icon, { asChild: !!icon, children: icon })
|
24
|
+
] });
|
25
|
+
}
|
26
|
+
);
|
27
|
+
function getInitials(name) {
|
28
|
+
const names = name.trim().split(" ");
|
29
|
+
const firstName = names[0] != null ? names[0] : "";
|
30
|
+
const lastName = names.length > 1 ? names[names.length - 1] : "";
|
31
|
+
return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
|
32
|
+
}
|
33
|
+
var AvatarGroup = forwardRef(
|
34
|
+
function AvatarGroup2(props, ref) {
|
35
|
+
const { size, variant, borderless, ...rest } = props;
|
36
|
+
return /* @__PURE__ */ jsx(ChakraAvatar.PropsProvider, { value: { size, variant, borderless }, children: /* @__PURE__ */ jsx(Group, { gap: "0", spaceX: "-3", ref, ...rest }) });
|
37
|
+
}
|
38
|
+
);
|
39
|
+
|
40
|
+
export {
|
41
|
+
Avatar,
|
42
|
+
AvatarGroup
|
43
|
+
};
|
@@ -0,0 +1,231 @@
|
|
1
|
+
'use client'
|
2
|
+
import {
|
3
|
+
InputGroup
|
4
|
+
} from "./chunk-PKI6YH2V.js";
|
5
|
+
|
6
|
+
// src/components/password-input/password-input.tsx
|
7
|
+
import { forwardRef, useRef } from "react";
|
8
|
+
import {
|
9
|
+
IconButton,
|
10
|
+
Input,
|
11
|
+
mergeRefs,
|
12
|
+
useControllableState
|
13
|
+
} from "@chakra-ui/react";
|
14
|
+
|
15
|
+
// ../../node_modules/react-icons/lib/iconBase.mjs
|
16
|
+
import React2 from "react";
|
17
|
+
|
18
|
+
// ../../node_modules/react-icons/lib/iconContext.mjs
|
19
|
+
import React from "react";
|
20
|
+
var DefaultContext = {
|
21
|
+
color: void 0,
|
22
|
+
size: void 0,
|
23
|
+
className: void 0,
|
24
|
+
style: void 0,
|
25
|
+
attr: void 0
|
26
|
+
};
|
27
|
+
var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
|
28
|
+
|
29
|
+
// ../../node_modules/react-icons/lib/iconBase.mjs
|
30
|
+
var _excluded = ["attr", "size", "title"];
|
31
|
+
function _objectWithoutProperties(source, excluded) {
|
32
|
+
if (source == null) return {};
|
33
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
34
|
+
var key, i;
|
35
|
+
if (Object.getOwnPropertySymbols) {
|
36
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
37
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
38
|
+
key = sourceSymbolKeys[i];
|
39
|
+
if (excluded.indexOf(key) >= 0) continue;
|
40
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
41
|
+
target[key] = source[key];
|
42
|
+
}
|
43
|
+
}
|
44
|
+
return target;
|
45
|
+
}
|
46
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
47
|
+
if (source == null) return {};
|
48
|
+
var target = {};
|
49
|
+
for (var key in source) {
|
50
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
51
|
+
if (excluded.indexOf(key) >= 0) continue;
|
52
|
+
target[key] = source[key];
|
53
|
+
}
|
54
|
+
}
|
55
|
+
return target;
|
56
|
+
}
|
57
|
+
function _extends() {
|
58
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
59
|
+
for (var i = 1; i < arguments.length; i++) {
|
60
|
+
var source = arguments[i];
|
61
|
+
for (var key in source) {
|
62
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
63
|
+
target[key] = source[key];
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
return target;
|
68
|
+
};
|
69
|
+
return _extends.apply(this, arguments);
|
70
|
+
}
|
71
|
+
function ownKeys(e, r) {
|
72
|
+
var t = Object.keys(e);
|
73
|
+
if (Object.getOwnPropertySymbols) {
|
74
|
+
var o = Object.getOwnPropertySymbols(e);
|
75
|
+
r && (o = o.filter(function(r2) {
|
76
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
77
|
+
})), t.push.apply(t, o);
|
78
|
+
}
|
79
|
+
return t;
|
80
|
+
}
|
81
|
+
function _objectSpread(e) {
|
82
|
+
for (var r = 1; r < arguments.length; r++) {
|
83
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
84
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
85
|
+
_defineProperty(e, r2, t[r2]);
|
86
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
87
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
88
|
+
});
|
89
|
+
}
|
90
|
+
return e;
|
91
|
+
}
|
92
|
+
function _defineProperty(obj, key, value) {
|
93
|
+
key = _toPropertyKey(key);
|
94
|
+
if (key in obj) {
|
95
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
96
|
+
} else {
|
97
|
+
obj[key] = value;
|
98
|
+
}
|
99
|
+
return obj;
|
100
|
+
}
|
101
|
+
function _toPropertyKey(t) {
|
102
|
+
var i = _toPrimitive(t, "string");
|
103
|
+
return "symbol" == typeof i ? i : i + "";
|
104
|
+
}
|
105
|
+
function _toPrimitive(t, r) {
|
106
|
+
if ("object" != typeof t || !t) return t;
|
107
|
+
var e = t[Symbol.toPrimitive];
|
108
|
+
if (void 0 !== e) {
|
109
|
+
var i = e.call(t, r || "default");
|
110
|
+
if ("object" != typeof i) return i;
|
111
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
112
|
+
}
|
113
|
+
return ("string" === r ? String : Number)(t);
|
114
|
+
}
|
115
|
+
function Tree2Element(tree) {
|
116
|
+
return tree && tree.map((node, i) => /* @__PURE__ */ React2.createElement(node.tag, _objectSpread({
|
117
|
+
key: i
|
118
|
+
}, node.attr), Tree2Element(node.child)));
|
119
|
+
}
|
120
|
+
function GenIcon(data) {
|
121
|
+
return (props) => /* @__PURE__ */ React2.createElement(IconBase, _extends({
|
122
|
+
attr: _objectSpread({}, data.attr)
|
123
|
+
}, props), Tree2Element(data.child));
|
124
|
+
}
|
125
|
+
function IconBase(props) {
|
126
|
+
var elem = (conf) => {
|
127
|
+
var {
|
128
|
+
attr,
|
129
|
+
size,
|
130
|
+
title
|
131
|
+
} = props, svgProps = _objectWithoutProperties(props, _excluded);
|
132
|
+
var computedSize = size || conf.size || "1em";
|
133
|
+
var className;
|
134
|
+
if (conf.className) className = conf.className;
|
135
|
+
if (props.className) className = (className ? className + " " : "") + props.className;
|
136
|
+
return /* @__PURE__ */ React2.createElement("svg", _extends({
|
137
|
+
stroke: "currentColor",
|
138
|
+
fill: "currentColor",
|
139
|
+
strokeWidth: "0"
|
140
|
+
}, conf.attr, attr, svgProps, {
|
141
|
+
className,
|
142
|
+
style: _objectSpread(_objectSpread({
|
143
|
+
color: props.color || conf.color
|
144
|
+
}, conf.style), props.style),
|
145
|
+
height: computedSize,
|
146
|
+
width: computedSize,
|
147
|
+
xmlns: "http://www.w3.org/2000/svg"
|
148
|
+
}), title && /* @__PURE__ */ React2.createElement("title", null, title), props.children);
|
149
|
+
};
|
150
|
+
return IconContext !== void 0 ? /* @__PURE__ */ React2.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
|
151
|
+
}
|
152
|
+
|
153
|
+
// ../../node_modules/react-icons/lu/index.mjs
|
154
|
+
function LuEyeOff(props) {
|
155
|
+
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);
|
156
|
+
}
|
157
|
+
function LuEye(props) {
|
158
|
+
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);
|
159
|
+
}
|
160
|
+
|
161
|
+
// src/components/password-input/password-input.tsx
|
162
|
+
import { jsx } from "react/jsx-runtime";
|
163
|
+
var PasswordInput = forwardRef(
|
164
|
+
function PasswordInput2(props, ref) {
|
165
|
+
const {
|
166
|
+
rootProps,
|
167
|
+
defaultVisible,
|
168
|
+
visible: visibleProp,
|
169
|
+
onVisibleChange,
|
170
|
+
visibilityIcon = { on: /* @__PURE__ */ jsx(LuEye, {}), off: /* @__PURE__ */ jsx(LuEyeOff, {}) },
|
171
|
+
...rest
|
172
|
+
} = props;
|
173
|
+
const [visible, setVisible] = useControllableState({
|
174
|
+
value: visibleProp,
|
175
|
+
defaultValue: defaultVisible || false,
|
176
|
+
onChange: onVisibleChange
|
177
|
+
});
|
178
|
+
const inputRef = useRef(null);
|
179
|
+
return /* @__PURE__ */ jsx(
|
180
|
+
InputGroup,
|
181
|
+
{
|
182
|
+
width: "full",
|
183
|
+
endElement: /* @__PURE__ */ jsx(
|
184
|
+
VisibilityTrigger,
|
185
|
+
{
|
186
|
+
disabled: rest.disabled,
|
187
|
+
onPointerDown: (e) => {
|
188
|
+
if (rest.disabled) return;
|
189
|
+
if (e.button !== 0) return;
|
190
|
+
e.preventDefault();
|
191
|
+
setVisible(!visible);
|
192
|
+
},
|
193
|
+
children: visible ? visibilityIcon.off : visibilityIcon.on
|
194
|
+
}
|
195
|
+
),
|
196
|
+
...rootProps,
|
197
|
+
children: /* @__PURE__ */ jsx(
|
198
|
+
Input,
|
199
|
+
{
|
200
|
+
...rest,
|
201
|
+
ref: mergeRefs(ref, inputRef),
|
202
|
+
type: visible ? "text" : "password"
|
203
|
+
}
|
204
|
+
)
|
205
|
+
}
|
206
|
+
);
|
207
|
+
}
|
208
|
+
);
|
209
|
+
var VisibilityTrigger = forwardRef(
|
210
|
+
function VisibilityTrigger2(props, ref) {
|
211
|
+
return /* @__PURE__ */ jsx(
|
212
|
+
IconButton,
|
213
|
+
{
|
214
|
+
tabIndex: -1,
|
215
|
+
ref,
|
216
|
+
me: "-2",
|
217
|
+
aspectRatio: "square",
|
218
|
+
size: "sm",
|
219
|
+
variant: "ghost",
|
220
|
+
colorPalette: "gray",
|
221
|
+
height: "calc(100% - {spacing.2})",
|
222
|
+
"aria-label": "Toggle password visibility",
|
223
|
+
...props
|
224
|
+
}
|
225
|
+
);
|
226
|
+
}
|
227
|
+
);
|
228
|
+
|
229
|
+
export {
|
230
|
+
PasswordInput
|
231
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
'use client'
|
2
|
+
import {
|
3
|
+
CloseButton
|
4
|
+
} from "./chunk-YXGJOOMM.js";
|
5
|
+
import {
|
6
|
+
__export
|
7
|
+
} from "./chunk-RTMS5TJN.js";
|
8
|
+
|
9
|
+
// src/components/popover/popover.tsx
|
10
|
+
var popover_exports = {};
|
11
|
+
__export(popover_exports, {
|
12
|
+
Arrow: () => Arrow,
|
13
|
+
Body: () => Body,
|
14
|
+
CloseButton: () => CloseButton2,
|
15
|
+
CloseTrigger: () => CloseTrigger,
|
16
|
+
Content: () => Content,
|
17
|
+
Description: () => Description,
|
18
|
+
Footer: () => Footer,
|
19
|
+
Header: () => Header,
|
20
|
+
Root: () => Root,
|
21
|
+
Title: () => Title,
|
22
|
+
Trigger: () => Trigger
|
23
|
+
});
|
24
|
+
import * as React from "react";
|
25
|
+
import { Popover as ChakraPopover, Portal } from "@chakra-ui/react";
|
26
|
+
import { jsx } from "react/jsx-runtime";
|
27
|
+
var Content = React.forwardRef(
|
28
|
+
function PopoverContent(props, ref) {
|
29
|
+
const { portalled = true, portalRef, ...rest } = props;
|
30
|
+
return /* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(ChakraPopover.Positioner, { children: /* @__PURE__ */ jsx(ChakraPopover.Content, { ref, ...rest }) }) });
|
31
|
+
}
|
32
|
+
);
|
33
|
+
var Arrow = React.forwardRef(
|
34
|
+
function PopoverArrow(props, ref) {
|
35
|
+
return /* @__PURE__ */ jsx(ChakraPopover.Arrow, { ...props, ref, children: /* @__PURE__ */ jsx(ChakraPopover.ArrowTip, {}) });
|
36
|
+
}
|
37
|
+
);
|
38
|
+
var CloseButton2 = React.forwardRef(function PopoverCloseTrigger(props, ref) {
|
39
|
+
return /* @__PURE__ */ jsx(
|
40
|
+
ChakraPopover.CloseTrigger,
|
41
|
+
{
|
42
|
+
position: "absolute",
|
43
|
+
top: "1",
|
44
|
+
insetEnd: "1",
|
45
|
+
...props,
|
46
|
+
asChild: true,
|
47
|
+
ref,
|
48
|
+
children: /* @__PURE__ */ jsx(CloseButton, { size: "sm" })
|
49
|
+
}
|
50
|
+
);
|
51
|
+
});
|
52
|
+
var CloseTrigger = ChakraPopover.CloseTrigger;
|
53
|
+
var Title = ChakraPopover.Title;
|
54
|
+
var Description = ChakraPopover.Description;
|
55
|
+
var Footer = ChakraPopover.Footer;
|
56
|
+
var Header = ChakraPopover.Header;
|
57
|
+
var Root = ChakraPopover.Root;
|
58
|
+
var Body = ChakraPopover.Body;
|
59
|
+
var Trigger = ChakraPopover.Trigger;
|
60
|
+
|
61
|
+
export {
|
62
|
+
popover_exports
|
63
|
+
};
|