@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
@@ -32,7 +32,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
32
32
|
var persona_exports = {};
|
33
33
|
__export(persona_exports, {
|
34
34
|
Persona: () => Persona,
|
35
|
-
PersonaAvatar: () => PersonaAvatar2
|
35
|
+
PersonaAvatar: () => PersonaAvatar2,
|
36
|
+
defaultPresenceOptions: () => defaultPresenceOptions
|
36
37
|
});
|
37
38
|
module.exports = __toCommonJS(persona_exports);
|
38
39
|
|
@@ -40,22 +41,64 @@ module.exports = __toCommonJS(persona_exports);
|
|
40
41
|
var React2 = __toESM(require("react"), 1);
|
41
42
|
|
42
43
|
// src/components/persona/persona-primitive.tsx
|
44
|
+
var import_react4 = require("react");
|
45
|
+
var import_react5 = require("@chakra-ui/react");
|
46
|
+
var import_utils = require("@saas-ui/core/utils");
|
47
|
+
|
48
|
+
// src/components/avatar/avatar.tsx
|
43
49
|
var import_react = require("react");
|
44
50
|
var import_react2 = require("@chakra-ui/react");
|
45
|
-
var import_utils = require("@saas-ui/core/utils");
|
46
51
|
var import_jsx_runtime = require("react/jsx-runtime");
|
52
|
+
var Avatar = (0, import_react.forwardRef)(
|
53
|
+
function Avatar2(props, ref) {
|
54
|
+
const { name, src, srcSet, loading, icon, fallback, children, ...rest } = props;
|
55
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react2.Avatar.Root, { ref, ...rest, children: [
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AvatarFallback, { name, icon, children: fallback }),
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Avatar.Image, { src, srcSet, loading }),
|
58
|
+
children
|
59
|
+
] });
|
60
|
+
}
|
61
|
+
);
|
62
|
+
var AvatarFallback = (0, import_react.forwardRef)(
|
63
|
+
function AvatarFallback2(props, ref) {
|
64
|
+
const { name, icon, children, ...rest } = props;
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react2.Avatar.Fallback, { ref, ...rest, children: [
|
66
|
+
children,
|
67
|
+
name != null && children == null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: getInitials(name) }),
|
68
|
+
name == null && children == null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Avatar.Icon, { asChild: !!icon, children: icon })
|
69
|
+
] });
|
70
|
+
}
|
71
|
+
);
|
72
|
+
function getInitials(name) {
|
73
|
+
const names = name.trim().split(" ");
|
74
|
+
const firstName = names[0] != null ? names[0] : "";
|
75
|
+
const lastName = names.length > 1 ? names[names.length - 1] : "";
|
76
|
+
return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
|
77
|
+
}
|
78
|
+
var AvatarGroup = (0, import_react.forwardRef)(
|
79
|
+
function AvatarGroup2(props, ref) {
|
80
|
+
const { size, variant, borderless, ...rest } = props;
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Avatar.PropsProvider, { value: { size, variant, borderless }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Group, { gap: "0", spaceX: "-3", ref, ...rest }) });
|
82
|
+
}
|
83
|
+
);
|
84
|
+
|
85
|
+
// src/components/persona/persona.context.ts
|
86
|
+
var import_react3 = require("@chakra-ui/react");
|
47
87
|
var {
|
48
88
|
useStyles: usePersonaStyles,
|
49
89
|
withProvider,
|
50
90
|
withContext
|
51
|
-
} = (0,
|
52
|
-
key: "
|
91
|
+
} = (0, import_react3.createSlotRecipeContext)({
|
92
|
+
key: "suiPersona"
|
53
93
|
});
|
94
|
+
|
95
|
+
// src/components/persona/persona-primitive.tsx
|
96
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
54
97
|
var PersonaRoot = withProvider(
|
55
|
-
(0,
|
98
|
+
(0, import_react4.forwardRef)((props, ref) => {
|
56
99
|
const { outOfOffice, presence, ...rest } = props;
|
57
|
-
return /* @__PURE__ */ (0,
|
58
|
-
|
100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
101
|
+
import_react5.chakra.div,
|
59
102
|
{
|
60
103
|
ref,
|
61
104
|
...rest,
|
@@ -72,11 +115,11 @@ var PersonaRoot = withProvider(
|
|
72
115
|
}),
|
73
116
|
"root"
|
74
117
|
);
|
75
|
-
var PersonaAvatar = (0,
|
118
|
+
var PersonaAvatar = (0, import_react4.forwardRef)(
|
76
119
|
(props, ref) => {
|
77
120
|
const {
|
78
121
|
name,
|
79
|
-
getInitials = (name2) => name2 == null ? void 0 : name2[0],
|
122
|
+
getInitials: getInitials2 = (name2) => name2 == null ? void 0 : name2[0],
|
80
123
|
icon,
|
81
124
|
loading,
|
82
125
|
onError,
|
@@ -85,19 +128,7 @@ var PersonaAvatar = (0, import_react.forwardRef)(
|
|
85
128
|
children,
|
86
129
|
...rest
|
87
130
|
} = props;
|
88
|
-
return /* @__PURE__ */ (0,
|
89
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Avatar.Fallback, { children: getInitials(name) }),
|
90
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
91
|
-
import_react2.Avatar.Image,
|
92
|
-
{
|
93
|
-
src,
|
94
|
-
srcSet,
|
95
|
-
loading,
|
96
|
-
onError
|
97
|
-
}
|
98
|
-
),
|
99
|
-
children
|
100
|
-
] });
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Avatar, { ref, ...rest, children });
|
101
132
|
}
|
102
133
|
);
|
103
134
|
var PersonaPresenceBadge = withContext("span", "presence");
|
@@ -110,11 +141,17 @@ var PersonaLabel = withContext(
|
|
110
141
|
"label"
|
111
142
|
);
|
112
143
|
PersonaLabel.displayName = "PersonaLabel";
|
113
|
-
var PersonaSecondaryLabel = withContext(
|
114
|
-
|
144
|
+
var PersonaSecondaryLabel = withContext(
|
145
|
+
"span",
|
146
|
+
"secondaryLabel"
|
147
|
+
);
|
148
|
+
var PersonaTertiaryLabel = withContext(
|
149
|
+
"span",
|
150
|
+
"tertiaryLabel"
|
151
|
+
);
|
115
152
|
|
116
153
|
// src/components/persona/persona.tsx
|
117
|
-
var
|
154
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
118
155
|
var Persona = React2.forwardRef(
|
119
156
|
(props, ref) => {
|
120
157
|
const {
|
@@ -129,40 +166,43 @@ var Persona = React2.forwardRef(
|
|
129
166
|
hideDetails,
|
130
167
|
children,
|
131
168
|
/** Avatar props */
|
132
|
-
getInitials,
|
169
|
+
getInitials: getInitials2,
|
133
170
|
icon,
|
134
171
|
loading,
|
135
172
|
onError,
|
136
173
|
src,
|
137
174
|
srcSet,
|
175
|
+
fallback,
|
138
176
|
...rest
|
139
177
|
} = props;
|
140
|
-
return /* @__PURE__ */ (0,
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
141
179
|
PersonaRoot,
|
142
180
|
{
|
143
181
|
ref,
|
144
182
|
outOfOffice: isOutOfOffice,
|
145
183
|
presence,
|
184
|
+
size,
|
146
185
|
...rest,
|
147
186
|
children: [
|
148
|
-
/* @__PURE__ */ (0,
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
149
188
|
PersonaAvatar,
|
150
189
|
{
|
151
190
|
name,
|
152
191
|
size,
|
153
|
-
getInitials,
|
192
|
+
getInitials: getInitials2,
|
154
193
|
icon,
|
155
194
|
loading,
|
156
195
|
onError,
|
157
196
|
src,
|
158
197
|
srcSet,
|
159
|
-
|
198
|
+
fallback,
|
199
|
+
children: presence ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PersonaPresenceBadge, { children: presenceIcon }) : null
|
160
200
|
}
|
161
201
|
),
|
162
|
-
!hideDetails && /* @__PURE__ */ (0,
|
163
|
-
/* @__PURE__ */ (0,
|
164
|
-
secondaryLabel && /* @__PURE__ */ (0,
|
165
|
-
tertiaryLabel && /* @__PURE__ */ (0,
|
202
|
+
!hideDetails && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PersonaDetails, { children: [
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PersonaLabel, { children: label || name }),
|
204
|
+
secondaryLabel && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PersonaSecondaryLabel, { children: secondaryLabel }),
|
205
|
+
tertiaryLabel && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PersonaTertiaryLabel, { children: tertiaryLabel }),
|
166
206
|
children
|
167
207
|
] })
|
168
208
|
]
|
@@ -172,10 +212,35 @@ var Persona = React2.forwardRef(
|
|
172
212
|
);
|
173
213
|
Persona.displayName = "Persona";
|
174
214
|
var PersonaAvatar2 = React2.forwardRef(function PersonaAvatar3(props, ref) {
|
175
|
-
return /* @__PURE__ */ (0,
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Persona, { ref, ...props, hideDetails: true });
|
176
216
|
});
|
217
|
+
|
218
|
+
// src/components/persona/presence.ts
|
219
|
+
var defaultPresenceOptions = {
|
220
|
+
online: {
|
221
|
+
label: "Online",
|
222
|
+
color: "presence.online"
|
223
|
+
},
|
224
|
+
offline: {
|
225
|
+
label: "Offline",
|
226
|
+
color: "presence.offline"
|
227
|
+
},
|
228
|
+
busy: {
|
229
|
+
label: "Busy",
|
230
|
+
color: "presence.busy"
|
231
|
+
},
|
232
|
+
dnd: {
|
233
|
+
label: "Do-not-disturb",
|
234
|
+
color: "presence.dnd"
|
235
|
+
},
|
236
|
+
away: {
|
237
|
+
label: "Away",
|
238
|
+
color: "presence.away"
|
239
|
+
}
|
240
|
+
};
|
177
241
|
// Annotate the CommonJS export names for ESM import in node:
|
178
242
|
0 && (module.exports = {
|
179
243
|
Persona,
|
180
|
-
PersonaAvatar
|
244
|
+
PersonaAvatar,
|
245
|
+
defaultPresenceOptions
|
181
246
|
});
|
@@ -1,9 +1,135 @@
|
|
1
1
|
import * as react from 'react';
|
2
2
|
import react__default from 'react';
|
3
|
-
import
|
3
|
+
import * as _chakra_ui_react from '@chakra-ui/react';
|
4
|
+
import { RecipeVariantProps, HTMLChakraProps, SlotRecipeProps, ImageProps } from '@chakra-ui/react';
|
5
|
+
import { AvatarProps } from '../avatar/index.cjs';
|
6
|
+
|
7
|
+
declare const personaSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"presence" | "root" | "label" | "avatar" | "details" | "secondaryLabel" | "tertiaryLabel", {
|
8
|
+
size: {
|
9
|
+
'2xs': {
|
10
|
+
details: {
|
11
|
+
ms: number;
|
12
|
+
};
|
13
|
+
label: {
|
14
|
+
fontSize: "xs";
|
15
|
+
};
|
16
|
+
secondaryLabel: {
|
17
|
+
display: "none";
|
18
|
+
};
|
19
|
+
tertiaryLabel: {
|
20
|
+
display: "none";
|
21
|
+
};
|
22
|
+
};
|
23
|
+
xs: {
|
24
|
+
details: {
|
25
|
+
ms: number;
|
26
|
+
};
|
27
|
+
label: {
|
28
|
+
fontSize: "xs";
|
29
|
+
};
|
30
|
+
secondaryLabel: {
|
31
|
+
display: "none";
|
32
|
+
};
|
33
|
+
tertiaryLabel: {
|
34
|
+
display: "none";
|
35
|
+
};
|
36
|
+
};
|
37
|
+
sm: {
|
38
|
+
details: {
|
39
|
+
ms: number;
|
40
|
+
};
|
41
|
+
label: {
|
42
|
+
fontSize: "sm";
|
43
|
+
};
|
44
|
+
secondaryLabel: {
|
45
|
+
fontSize: "xs";
|
46
|
+
};
|
47
|
+
tertiaryLabel: {
|
48
|
+
display: "none";
|
49
|
+
};
|
50
|
+
};
|
51
|
+
md: {
|
52
|
+
details: {
|
53
|
+
ms: number;
|
54
|
+
};
|
55
|
+
label: {
|
56
|
+
fontSize: "sm";
|
57
|
+
};
|
58
|
+
secondaryLabel: {
|
59
|
+
fontSize: "xs";
|
60
|
+
};
|
61
|
+
tertiaryLabel: {
|
62
|
+
display: "none";
|
63
|
+
};
|
64
|
+
};
|
65
|
+
lg: {
|
66
|
+
details: {
|
67
|
+
ms: number;
|
68
|
+
};
|
69
|
+
label: {
|
70
|
+
fontSize: "md";
|
71
|
+
};
|
72
|
+
secondaryLabel: {
|
73
|
+
fontSize: "sm";
|
74
|
+
};
|
75
|
+
tertiaryLabel: {
|
76
|
+
fontSize: "sm";
|
77
|
+
};
|
78
|
+
};
|
79
|
+
xl: {
|
80
|
+
details: {
|
81
|
+
ms: number;
|
82
|
+
};
|
83
|
+
label: {
|
84
|
+
fontSize: "lg";
|
85
|
+
};
|
86
|
+
secondaryLabel: {
|
87
|
+
fontSize: "md";
|
88
|
+
};
|
89
|
+
tertiaryLabel: {
|
90
|
+
fontSize: "md";
|
91
|
+
};
|
92
|
+
};
|
93
|
+
'2xl': {
|
94
|
+
details: {
|
95
|
+
ms: number;
|
96
|
+
};
|
97
|
+
label: {
|
98
|
+
fontSize: "xl";
|
99
|
+
};
|
100
|
+
secondaryLabel: {
|
101
|
+
fontSize: "lg";
|
102
|
+
};
|
103
|
+
tertiaryLabel: {
|
104
|
+
fontSize: "lg";
|
105
|
+
};
|
106
|
+
};
|
107
|
+
};
|
108
|
+
}>;
|
109
|
+
type PersonaVariantProps = RecipeVariantProps<typeof personaSlotRecipe>;
|
4
110
|
|
5
111
|
type Presence = 'online' | 'offline' | 'busy' | 'dnd' | 'away';
|
6
|
-
interface
|
112
|
+
interface PresenceConfig {
|
113
|
+
label: string;
|
114
|
+
color: string;
|
115
|
+
}
|
116
|
+
type PresenceOptions<P extends string = Presence> = Record<P, PresenceConfig>;
|
117
|
+
/**
|
118
|
+
* The presence configuration object.
|
119
|
+
*
|
120
|
+
* Default presence values: online, offline, busy, dnd, away
|
121
|
+
*
|
122
|
+
* You can overwrite colors in the theme semantic tokens.
|
123
|
+
* theme.semanticTokens.colors['presence.online'] = 'cyan.500'
|
124
|
+
*
|
125
|
+
* Or add a custom presence value
|
126
|
+
* theme.semanticTokens.colors['presence.vacay'] = 'blue.500'
|
127
|
+
*
|
128
|
+
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
129
|
+
*/
|
130
|
+
declare const defaultPresenceOptions: PresenceOptions;
|
131
|
+
|
132
|
+
interface PersonaRootProps extends HTMLChakraProps<'div'>, SlotRecipeProps<'suiPersona'>, PersonaVariantProps {
|
7
133
|
/**
|
8
134
|
* Indicates that a person is out of office. Changes the presence badge style.
|
9
135
|
*/
|
@@ -22,7 +148,7 @@ interface PersonaAvatarOptions {
|
|
22
148
|
*/
|
23
149
|
name?: string;
|
24
150
|
}
|
25
|
-
interface PersonaAvatarProps$1 extends PersonaAvatarOptions,
|
151
|
+
interface PersonaAvatarProps$1 extends PersonaAvatarOptions, AvatarProps {
|
26
152
|
src?: string;
|
27
153
|
srcSet?: string;
|
28
154
|
loading?: ImageProps['loading'];
|
@@ -78,7 +204,7 @@ interface PersonaOptions {
|
|
78
204
|
*/
|
79
205
|
hideDetails?: boolean;
|
80
206
|
}
|
81
|
-
interface PersonaProps extends PersonaOptions, Omit<PersonaAvatarProps$1, 'size'>, PersonaRootProps {
|
207
|
+
interface PersonaProps extends PersonaOptions, Omit<PersonaAvatarProps$1, 'size'>, PersonaRootProps, PersonaVariantProps {
|
82
208
|
}
|
83
209
|
/**
|
84
210
|
* The wrapper component that handles default composition.
|
@@ -90,4 +216,4 @@ interface PersonaAvatarProps extends Omit<PersonaProps, 'hideDetails' | 'label'
|
|
90
216
|
}
|
91
217
|
declare const PersonaAvatar: react.ForwardRefExoticComponent<PersonaAvatarProps & react.RefAttributes<HTMLDivElement>>;
|
92
218
|
|
93
|
-
export { Persona, PersonaAvatar, type PersonaAvatarProps, type PersonaProps };
|
219
|
+
export { Persona, PersonaAvatar, type PersonaAvatarProps, type PersonaProps, type Presence, type PresenceConfig, defaultPresenceOptions };
|
@@ -1,9 +1,135 @@
|
|
1
1
|
import * as react from 'react';
|
2
2
|
import react__default from 'react';
|
3
|
-
import
|
3
|
+
import * as _chakra_ui_react from '@chakra-ui/react';
|
4
|
+
import { RecipeVariantProps, HTMLChakraProps, SlotRecipeProps, ImageProps } from '@chakra-ui/react';
|
5
|
+
import { AvatarProps } from '../avatar/index.js';
|
6
|
+
|
7
|
+
declare const personaSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"presence" | "root" | "label" | "avatar" | "details" | "secondaryLabel" | "tertiaryLabel", {
|
8
|
+
size: {
|
9
|
+
'2xs': {
|
10
|
+
details: {
|
11
|
+
ms: number;
|
12
|
+
};
|
13
|
+
label: {
|
14
|
+
fontSize: "xs";
|
15
|
+
};
|
16
|
+
secondaryLabel: {
|
17
|
+
display: "none";
|
18
|
+
};
|
19
|
+
tertiaryLabel: {
|
20
|
+
display: "none";
|
21
|
+
};
|
22
|
+
};
|
23
|
+
xs: {
|
24
|
+
details: {
|
25
|
+
ms: number;
|
26
|
+
};
|
27
|
+
label: {
|
28
|
+
fontSize: "xs";
|
29
|
+
};
|
30
|
+
secondaryLabel: {
|
31
|
+
display: "none";
|
32
|
+
};
|
33
|
+
tertiaryLabel: {
|
34
|
+
display: "none";
|
35
|
+
};
|
36
|
+
};
|
37
|
+
sm: {
|
38
|
+
details: {
|
39
|
+
ms: number;
|
40
|
+
};
|
41
|
+
label: {
|
42
|
+
fontSize: "sm";
|
43
|
+
};
|
44
|
+
secondaryLabel: {
|
45
|
+
fontSize: "xs";
|
46
|
+
};
|
47
|
+
tertiaryLabel: {
|
48
|
+
display: "none";
|
49
|
+
};
|
50
|
+
};
|
51
|
+
md: {
|
52
|
+
details: {
|
53
|
+
ms: number;
|
54
|
+
};
|
55
|
+
label: {
|
56
|
+
fontSize: "sm";
|
57
|
+
};
|
58
|
+
secondaryLabel: {
|
59
|
+
fontSize: "xs";
|
60
|
+
};
|
61
|
+
tertiaryLabel: {
|
62
|
+
display: "none";
|
63
|
+
};
|
64
|
+
};
|
65
|
+
lg: {
|
66
|
+
details: {
|
67
|
+
ms: number;
|
68
|
+
};
|
69
|
+
label: {
|
70
|
+
fontSize: "md";
|
71
|
+
};
|
72
|
+
secondaryLabel: {
|
73
|
+
fontSize: "sm";
|
74
|
+
};
|
75
|
+
tertiaryLabel: {
|
76
|
+
fontSize: "sm";
|
77
|
+
};
|
78
|
+
};
|
79
|
+
xl: {
|
80
|
+
details: {
|
81
|
+
ms: number;
|
82
|
+
};
|
83
|
+
label: {
|
84
|
+
fontSize: "lg";
|
85
|
+
};
|
86
|
+
secondaryLabel: {
|
87
|
+
fontSize: "md";
|
88
|
+
};
|
89
|
+
tertiaryLabel: {
|
90
|
+
fontSize: "md";
|
91
|
+
};
|
92
|
+
};
|
93
|
+
'2xl': {
|
94
|
+
details: {
|
95
|
+
ms: number;
|
96
|
+
};
|
97
|
+
label: {
|
98
|
+
fontSize: "xl";
|
99
|
+
};
|
100
|
+
secondaryLabel: {
|
101
|
+
fontSize: "lg";
|
102
|
+
};
|
103
|
+
tertiaryLabel: {
|
104
|
+
fontSize: "lg";
|
105
|
+
};
|
106
|
+
};
|
107
|
+
};
|
108
|
+
}>;
|
109
|
+
type PersonaVariantProps = RecipeVariantProps<typeof personaSlotRecipe>;
|
4
110
|
|
5
111
|
type Presence = 'online' | 'offline' | 'busy' | 'dnd' | 'away';
|
6
|
-
interface
|
112
|
+
interface PresenceConfig {
|
113
|
+
label: string;
|
114
|
+
color: string;
|
115
|
+
}
|
116
|
+
type PresenceOptions<P extends string = Presence> = Record<P, PresenceConfig>;
|
117
|
+
/**
|
118
|
+
* The presence configuration object.
|
119
|
+
*
|
120
|
+
* Default presence values: online, offline, busy, dnd, away
|
121
|
+
*
|
122
|
+
* You can overwrite colors in the theme semantic tokens.
|
123
|
+
* theme.semanticTokens.colors['presence.online'] = 'cyan.500'
|
124
|
+
*
|
125
|
+
* Or add a custom presence value
|
126
|
+
* theme.semanticTokens.colors['presence.vacay'] = 'blue.500'
|
127
|
+
*
|
128
|
+
* @see Docs https://saas-ui.dev/docs/components/data-display/persona
|
129
|
+
*/
|
130
|
+
declare const defaultPresenceOptions: PresenceOptions;
|
131
|
+
|
132
|
+
interface PersonaRootProps extends HTMLChakraProps<'div'>, SlotRecipeProps<'suiPersona'>, PersonaVariantProps {
|
7
133
|
/**
|
8
134
|
* Indicates that a person is out of office. Changes the presence badge style.
|
9
135
|
*/
|
@@ -22,7 +148,7 @@ interface PersonaAvatarOptions {
|
|
22
148
|
*/
|
23
149
|
name?: string;
|
24
150
|
}
|
25
|
-
interface PersonaAvatarProps$1 extends PersonaAvatarOptions,
|
151
|
+
interface PersonaAvatarProps$1 extends PersonaAvatarOptions, AvatarProps {
|
26
152
|
src?: string;
|
27
153
|
srcSet?: string;
|
28
154
|
loading?: ImageProps['loading'];
|
@@ -78,7 +204,7 @@ interface PersonaOptions {
|
|
78
204
|
*/
|
79
205
|
hideDetails?: boolean;
|
80
206
|
}
|
81
|
-
interface PersonaProps extends PersonaOptions, Omit<PersonaAvatarProps$1, 'size'>, PersonaRootProps {
|
207
|
+
interface PersonaProps extends PersonaOptions, Omit<PersonaAvatarProps$1, 'size'>, PersonaRootProps, PersonaVariantProps {
|
82
208
|
}
|
83
209
|
/**
|
84
210
|
* The wrapper component that handles default composition.
|
@@ -90,4 +216,4 @@ interface PersonaAvatarProps extends Omit<PersonaProps, 'hideDetails' | 'label'
|
|
90
216
|
}
|
91
217
|
declare const PersonaAvatar: react.ForwardRefExoticComponent<PersonaAvatarProps & react.RefAttributes<HTMLDivElement>>;
|
92
218
|
|
93
|
-
export { Persona, PersonaAvatar, type PersonaAvatarProps, type PersonaProps };
|
219
|
+
export { Persona, PersonaAvatar, type PersonaAvatarProps, type PersonaProps, type Presence, type PresenceConfig, defaultPresenceOptions };
|
@@ -1,149 +1,13 @@
|
|
1
1
|
'use client'
|
2
|
-
import "../../chunk-RTMS5TJN.js";
|
3
|
-
|
4
|
-
// src/components/persona/persona.tsx
|
5
|
-
import * as React2 from "react";
|
6
|
-
|
7
|
-
// src/components/persona/persona-primitive.tsx
|
8
|
-
import { forwardRef } from "react";
|
9
2
|
import {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
} from "
|
14
|
-
import
|
15
|
-
import
|
16
|
-
var {
|
17
|
-
useStyles: usePersonaStyles,
|
18
|
-
withProvider,
|
19
|
-
withContext
|
20
|
-
} = createSlotRecipeContext({
|
21
|
-
key: "persona"
|
22
|
-
});
|
23
|
-
var PersonaRoot = withProvider(
|
24
|
-
forwardRef((props, ref) => {
|
25
|
-
const { outOfOffice, presence, ...rest } = props;
|
26
|
-
return /* @__PURE__ */ jsx(
|
27
|
-
chakra.div,
|
28
|
-
{
|
29
|
-
ref,
|
30
|
-
...rest,
|
31
|
-
"data-out-of-office": dataAttr(outOfOffice),
|
32
|
-
"data-presence": presence,
|
33
|
-
css: [
|
34
|
-
presence ? {
|
35
|
-
"--persona-presence": `colors.presence.${presence}`
|
36
|
-
} : void 0,
|
37
|
-
rest.css
|
38
|
-
]
|
39
|
-
}
|
40
|
-
);
|
41
|
-
}),
|
42
|
-
"root"
|
43
|
-
);
|
44
|
-
var PersonaAvatar = forwardRef(
|
45
|
-
(props, ref) => {
|
46
|
-
const {
|
47
|
-
name,
|
48
|
-
getInitials = (name2) => name2 == null ? void 0 : name2[0],
|
49
|
-
icon,
|
50
|
-
loading,
|
51
|
-
onError,
|
52
|
-
src,
|
53
|
-
srcSet,
|
54
|
-
children,
|
55
|
-
...rest
|
56
|
-
} = props;
|
57
|
-
return /* @__PURE__ */ jsxs(Avatar.Root, { ref, ...rest, children: [
|
58
|
-
/* @__PURE__ */ jsx(Avatar.Fallback, { children: getInitials(name) }),
|
59
|
-
/* @__PURE__ */ jsx(
|
60
|
-
Avatar.Image,
|
61
|
-
{
|
62
|
-
src,
|
63
|
-
srcSet,
|
64
|
-
loading,
|
65
|
-
onError
|
66
|
-
}
|
67
|
-
),
|
68
|
-
children
|
69
|
-
] });
|
70
|
-
}
|
71
|
-
);
|
72
|
-
var PersonaPresenceBadge = withContext("span", "presence");
|
73
|
-
var PersonaDetails = withContext(
|
74
|
-
"div",
|
75
|
-
"details"
|
76
|
-
);
|
77
|
-
var PersonaLabel = withContext(
|
78
|
-
"span",
|
79
|
-
"label"
|
80
|
-
);
|
81
|
-
PersonaLabel.displayName = "PersonaLabel";
|
82
|
-
var PersonaSecondaryLabel = withContext("span", "secondaryLabel");
|
83
|
-
var PersonaTertiaryLabel = withContext("span", "tertiaryLabel");
|
84
|
-
|
85
|
-
// src/components/persona/persona.tsx
|
86
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
87
|
-
var Persona = React2.forwardRef(
|
88
|
-
(props, ref) => {
|
89
|
-
const {
|
90
|
-
name,
|
91
|
-
presence,
|
92
|
-
presenceIcon,
|
93
|
-
isOutOfOffice,
|
94
|
-
label,
|
95
|
-
secondaryLabel,
|
96
|
-
tertiaryLabel,
|
97
|
-
size,
|
98
|
-
hideDetails,
|
99
|
-
children,
|
100
|
-
/** Avatar props */
|
101
|
-
getInitials,
|
102
|
-
icon,
|
103
|
-
loading,
|
104
|
-
onError,
|
105
|
-
src,
|
106
|
-
srcSet,
|
107
|
-
...rest
|
108
|
-
} = props;
|
109
|
-
return /* @__PURE__ */ jsxs2(
|
110
|
-
PersonaRoot,
|
111
|
-
{
|
112
|
-
ref,
|
113
|
-
outOfOffice: isOutOfOffice,
|
114
|
-
presence,
|
115
|
-
...rest,
|
116
|
-
children: [
|
117
|
-
/* @__PURE__ */ jsx2(
|
118
|
-
PersonaAvatar,
|
119
|
-
{
|
120
|
-
name,
|
121
|
-
size,
|
122
|
-
getInitials,
|
123
|
-
icon,
|
124
|
-
loading,
|
125
|
-
onError,
|
126
|
-
src,
|
127
|
-
srcSet,
|
128
|
-
children: /* @__PURE__ */ jsx2(PersonaPresenceBadge, { children: presenceIcon })
|
129
|
-
}
|
130
|
-
),
|
131
|
-
!hideDetails && /* @__PURE__ */ jsxs2(PersonaDetails, { children: [
|
132
|
-
/* @__PURE__ */ jsx2(PersonaLabel, { children: label || name }),
|
133
|
-
secondaryLabel && /* @__PURE__ */ jsx2(PersonaSecondaryLabel, { children: secondaryLabel }),
|
134
|
-
tertiaryLabel && /* @__PURE__ */ jsx2(PersonaTertiaryLabel, { children: tertiaryLabel }),
|
135
|
-
children
|
136
|
-
] })
|
137
|
-
]
|
138
|
-
}
|
139
|
-
);
|
140
|
-
}
|
141
|
-
);
|
142
|
-
Persona.displayName = "Persona";
|
143
|
-
var PersonaAvatar2 = React2.forwardRef(function PersonaAvatar3(props, ref) {
|
144
|
-
return /* @__PURE__ */ jsx2(Persona, { ref, ...props, hideDetails: true });
|
145
|
-
});
|
3
|
+
Persona,
|
4
|
+
PersonaAvatar,
|
5
|
+
defaultPresenceOptions
|
6
|
+
} from "../../chunk-GWC5GCMW.js";
|
7
|
+
import "../../chunk-JO4WJVYO.js";
|
8
|
+
import "../../chunk-RTMS5TJN.js";
|
146
9
|
export {
|
147
10
|
Persona,
|
148
|
-
|
11
|
+
PersonaAvatar,
|
12
|
+
defaultPresenceOptions
|
149
13
|
};
|