@sqrzro/admin 4.0.0-alpha.13 → 4.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AdminAppLayout/index.js +1 -1
- package/dist/components/AdminRootLayout/index.js +3 -5
- package/dist/components/AdminUIProvider/index.d.ts +4 -0
- package/dist/components/AdminUIProvider/index.js +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles/{config.d.ts → classnames.d.ts} +2 -2
- package/dist/styles/{config.js → classnames.js} +65 -18
- package/dist/styles/icons.d.ts +3 -0
- package/dist/styles/icons.js +17 -0
- package/dist/utility/interfaces.d.ts +2 -5
- package/package.json +5 -3
|
@@ -4,6 +4,6 @@ import { Link } from '@sqrzro/ui/components';
|
|
|
4
4
|
import { AppNavigation } from '@sqrzro/ui/navigation';
|
|
5
5
|
import MePanel from '../MePanel';
|
|
6
6
|
function AdminAppLayout({ children, config, logo, userFn, }) {
|
|
7
|
-
return (_jsxs("div", { className: "flex flex-1 flex-col", children: [_jsx("header", { className: "relative bg-slate-800 shadow-lg", children: _jsxs("div", { className: "flex h-16 items-center border-b border-slate-700 px-4", children: [_jsxs(Link, { className: "h-9 w-9", href: "/", children: [logo, _jsx("span", { className: "sr-only", children: config?.
|
|
7
|
+
return (_jsxs("div", { className: "flex flex-1 flex-col", children: [_jsx("header", { className: "relative bg-slate-800 shadow-lg", children: _jsxs("div", { className: "flex h-16 items-center border-b border-slate-700 px-4", children: [_jsxs(Link, { className: "h-9 w-9", href: "/", children: [logo, _jsx("span", { className: "sr-only", children: config?.site.name })] }), _jsx(AppNavigation, { data: config?.navigation || [] }), _jsx(Suspense, { children: _jsx(MePanel, { userFn: userFn }) })] }) }), _jsx("main", { className: "mb-10 flex flex-1 flex-col", children: children })] }));
|
|
8
8
|
}
|
|
9
9
|
export default AdminAppLayout;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import classNameConfig from '../../styles/config';
|
|
5
|
-
registerClassNames(classNameConfig);
|
|
2
|
+
import { AppBody } from '@sqrzro/ui/components';
|
|
3
|
+
import AdminUIProvider from '../AdminUIProvider';
|
|
6
4
|
function AdminRootLayout({ children }) {
|
|
7
|
-
return _jsx(
|
|
5
|
+
return (_jsx("html", { lang: "en", children: _jsx("body", { className: "overflow-x-hidden overflow-y-scroll bg-slate-50 font-sans text-sm text-slate-800 has-[[data-modal][open]]:overflow-hidden", children: _jsx(AdminUIProvider, { children: _jsx(AppBody, { children: children }) }) }) }));
|
|
8
6
|
}
|
|
9
7
|
export default AdminRootLayout;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { UIProvider } from '@sqrzro/ui/styles';
|
|
4
|
+
import classNameConfig from '../../styles/classnames';
|
|
5
|
+
import iconConfig from '../../styles/icons';
|
|
6
|
+
function AdminUIProvider({ children }) {
|
|
7
|
+
return (_jsx(UIProvider, { data: { classNames: classNameConfig, icons: iconConfig }, children: children }));
|
|
8
|
+
}
|
|
9
|
+
export default AdminUIProvider;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './utility/interfaces';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as classNameConfig } from './styles/classnames';
|
|
3
3
|
export { default as AdminAppLayout } from './components/AdminAppLayout';
|
|
4
4
|
export { default as AdminLayout } from './components/AdminLayout';
|
|
5
5
|
export { default as AdminPage } from './components/AdminPage';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './utility/interfaces';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as classNameConfig } from './styles/classnames';
|
|
3
3
|
export { default as AdminAppLayout } from './components/AdminAppLayout';
|
|
4
4
|
export { default as AdminLayout } from './components/AdminLayout';
|
|
5
5
|
export { default as AdminPage } from './components/AdminPage';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { WithAuthClassNames } from '@sqrzro/addon-auth';
|
|
2
2
|
import type { UIClassNames } from '@sqrzro/ui/styles';
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
3
|
+
declare const classNameConfig: WithAuthClassNames<UIClassNames>;
|
|
4
|
+
export default classNameConfig;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { twx } from '@sqrzro/ui/styles';
|
|
2
|
-
const
|
|
2
|
+
const classNameConfig = twx({
|
|
3
3
|
actionList: {
|
|
4
4
|
root: 'flex items-center gap-2 [&_li]:first:mr-auto',
|
|
5
5
|
},
|
|
@@ -13,9 +13,14 @@ const classNames = twx({
|
|
|
13
13
|
isHighlighted: 'before:bg-primary text-white before:absolute before:bottom-0 before:left-0 before:right-0 before:h-1',
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
+
icon: {
|
|
17
|
+
default: 'ml-1.5 h-4 w-4 rounded-full bg-slate-600 text-slate-100 transition-all ease-in-out',
|
|
18
|
+
states: { isSelected: 'rotate-180' },
|
|
19
|
+
},
|
|
16
20
|
},
|
|
17
21
|
auth: {
|
|
18
22
|
actions: 'mt-2 w-full',
|
|
23
|
+
content: 'flex flex-col gap-4',
|
|
19
24
|
footer: 'mt-2 text-center',
|
|
20
25
|
form: 'flex flex-col gap-6',
|
|
21
26
|
link: 'text-link font-semibold',
|
|
@@ -52,20 +57,36 @@ const classNames = twx({
|
|
|
52
57
|
props: {
|
|
53
58
|
isDanger: 'border-red-500 bg-white text-red-500',
|
|
54
59
|
isOnDark: 'border-slate-400 bg-transparent text-white hover:bg-white/10',
|
|
55
|
-
isPrimary: 'bg-
|
|
60
|
+
isPrimary: 'bg-button-bg hover:bg-button-bg-hover text-button-text border-none font-semibold shadow-sm transition-colors',
|
|
56
61
|
},
|
|
57
62
|
},
|
|
58
63
|
icon: '-ml-1.5 h-4 w-4',
|
|
59
64
|
},
|
|
60
65
|
calendar: {
|
|
66
|
+
root: 'p-4 pb-3 text-sm text-slate-600',
|
|
61
67
|
header: 'relative mb-4 flex items-center justify-between',
|
|
62
68
|
title: 'absolute left-1/2 -translate-x-1/2 text-sm font-semibold',
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
navigation: 'h-6 w-6 rounded-full bg-slate-400 text-slate-100 hover:bg-slate-500',
|
|
70
|
+
month: 'w-full table-fixed',
|
|
71
|
+
head: 'pb-2 text-center text-xs text-slate-400',
|
|
72
|
+
day: 'border border-slate-200 py-1',
|
|
73
|
+
control: {
|
|
74
|
+
default: '-ml-px h-8 w-[calc(100%+2px)]',
|
|
75
|
+
props: { isHighlighted: 'bg-primary/30', isSelected: 'bg-primary/40' },
|
|
76
|
+
},
|
|
65
77
|
},
|
|
66
78
|
container: {
|
|
67
79
|
root: 'mx-auto w-full max-w-6xl px-8',
|
|
68
80
|
},
|
|
81
|
+
csvInput: {
|
|
82
|
+
root: 'w-full rounded border border-slate-300 bg-slate-50 p-8',
|
|
83
|
+
icon: {
|
|
84
|
+
default: 'mx-auto mb-3 block h-10 w-10 rounded-full text-slate-400',
|
|
85
|
+
states: { isHighlighted: 'text-green-500' },
|
|
86
|
+
},
|
|
87
|
+
title: 'mb-1 font-semibold',
|
|
88
|
+
description: 'mb-2 text-xs italic text-slate-700',
|
|
89
|
+
},
|
|
69
90
|
dropdown: {
|
|
70
91
|
item: {
|
|
71
92
|
default: 'block border-b border-slate-100 p-3 text-sm text-slate-700',
|
|
@@ -107,14 +128,14 @@ const classNames = twx({
|
|
|
107
128
|
root: {
|
|
108
129
|
default: 'relative inline-flex h-8 items-center gap-2 rounded-full border border-dashed border-slate-400 px-5 text-xs text-slate-300 text-white transition-all',
|
|
109
130
|
props: {
|
|
110
|
-
isFocused: 'border-solid border-slate-400 bg-slate-700 pr-
|
|
131
|
+
isFocused: 'border-solid border-slate-400 bg-slate-700 pr-9',
|
|
111
132
|
isHighlighted: 'bg-slate-700',
|
|
112
133
|
},
|
|
113
134
|
},
|
|
114
135
|
value: 'border-l border-l-slate-300 pl-2 font-semibold',
|
|
115
136
|
},
|
|
116
137
|
filterPanel: {
|
|
117
|
-
root: 'min-w-56',
|
|
138
|
+
root: { default: 'min-w-56', props: { isLarge: 'min-w-96' } },
|
|
118
139
|
title: 'flex items-center gap-2 border-b border-slate-300 p-3 text-sm font-semibold',
|
|
119
140
|
footer: 'p-3',
|
|
120
141
|
},
|
|
@@ -126,7 +147,16 @@ const classNames = twx({
|
|
|
126
147
|
root: 'flex flex-col gap-6',
|
|
127
148
|
},
|
|
128
149
|
formField: {
|
|
129
|
-
|
|
150
|
+
root: {
|
|
151
|
+
default: '',
|
|
152
|
+
props: {
|
|
153
|
+
isEditable: 'grid grid-cols-[30%_1fr] gap-x-4 border-t border-slate-200 py-4',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
label: {
|
|
157
|
+
default: 'mb-2 flex justify-between font-semibold leading-none',
|
|
158
|
+
props: { isEditable: 'mb-0 items-center' },
|
|
159
|
+
},
|
|
130
160
|
details: 'mb-2 text-xs font-normal text-slate-500',
|
|
131
161
|
optional: 'pl-2 text-xs font-normal leading-none text-slate-500',
|
|
132
162
|
error: 'text-error mt-2 flex items-start gap-1.5 before:mt-0.5 before:h-4 before:w-4 before:flex-none before:rounded-full before:bg-[url(/admin/images/danger.svg)] before:bg-contain',
|
|
@@ -167,7 +197,7 @@ const classNames = twx({
|
|
|
167
197
|
root: 'flex flex-wrap items-center gap-x-4 gap-y-1 text-slate-500',
|
|
168
198
|
},
|
|
169
199
|
menu: {
|
|
170
|
-
link: 'block min-w-36 border-b border-slate-100 p-3 text-left text-sm text-slate-700',
|
|
200
|
+
link: 'block min-w-36 whitespace-nowrap border-b border-slate-100 p-3 pr-5 text-left text-sm text-slate-700',
|
|
171
201
|
},
|
|
172
202
|
modal: {
|
|
173
203
|
root: 'starting:open:backdrop:opacity-0 py-16 backdrop:bg-slate-700/50 backdrop:transition-all backdrop:duration-500 open:backdrop:opacity-100',
|
|
@@ -187,12 +217,21 @@ const classNames = twx({
|
|
|
187
217
|
gap: 'flex h-9 w-9 items-center justify-center text-xs text-slate-400',
|
|
188
218
|
navigation: 'inline-flex h-9 items-center justify-center gap-1 whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium hover:bg-slate-100',
|
|
189
219
|
},
|
|
220
|
+
passwordComplexity: {
|
|
221
|
+
root: {
|
|
222
|
+
default: 'mt-2 rounded border border-slate-300 p-3',
|
|
223
|
+
props: { isValid: 'border-green-400 bg-green-50' },
|
|
224
|
+
},
|
|
225
|
+
list: 'flex flex-col gap-1',
|
|
226
|
+
item: {
|
|
227
|
+
default: 'flex items-center gap-2 text-slate-400',
|
|
228
|
+
props: { isValid: 'text-green-600' },
|
|
229
|
+
},
|
|
230
|
+
icon: { default: 'h-5 w-5 text-slate-400', props: { isValid: 'text-green-600' } },
|
|
231
|
+
},
|
|
190
232
|
passwordInput: {
|
|
191
233
|
action: 'absolute inset-y-0 right-0 flex items-center px-3',
|
|
192
|
-
icon:
|
|
193
|
-
default: 'h-6 w-6 overflow-hidden bg-red-500 bg-no-repeat indent-12',
|
|
194
|
-
states: { isSelected: 'bg-green-500' },
|
|
195
|
-
},
|
|
234
|
+
icon: 'h-6 w-6 overflow-hidden bg-no-repeat indent-12 text-slate-700',
|
|
196
235
|
},
|
|
197
236
|
popover: {
|
|
198
237
|
root: {
|
|
@@ -201,15 +240,12 @@ const classNames = twx({
|
|
|
201
240
|
},
|
|
202
241
|
},
|
|
203
242
|
reference: {
|
|
204
|
-
root: { default: 'flex items-center gap-2', props: { isTitle: 'gap-4' } },
|
|
243
|
+
root: { default: 'inline-flex items-center gap-2', props: { isTitle: 'gap-4' } },
|
|
205
244
|
reference: {
|
|
206
|
-
default: 'rounded bg-slate-200 px-2 py-1 text-[70%]',
|
|
245
|
+
default: 'rounded bg-slate-200 px-2 py-1 text-[70%] font-semibold',
|
|
207
246
|
props: { isTitle: 'border border-slate-400 bg-transparent text-[60%] text-white' },
|
|
208
247
|
},
|
|
209
248
|
},
|
|
210
|
-
rootLayout: {
|
|
211
|
-
root: 'bg-slate-50 font-sans text-sm text-slate-800',
|
|
212
|
-
},
|
|
213
249
|
summary: {
|
|
214
250
|
root: 'relative grid gap-6',
|
|
215
251
|
item: 'relative rounded border border-slate-500 p-4 font-semibold text-white',
|
|
@@ -224,6 +260,8 @@ const classNames = twx({
|
|
|
224
260
|
label: 'block leading-none',
|
|
225
261
|
details: 'mt-1.5 block text-xs leading-none text-slate-500',
|
|
226
262
|
placeholder: 'block leading-none text-slate-400',
|
|
263
|
+
icon: 'mr-2 h-4 w-4 rounded-full bg-slate-500 text-white',
|
|
264
|
+
clear: 'mr-2 h-4 w-4 flex-none rounded-full border border-slate-500 text-slate-600',
|
|
227
265
|
},
|
|
228
266
|
switch: {
|
|
229
267
|
root: 'flex gap-4',
|
|
@@ -276,5 +314,14 @@ const classNames = twx({
|
|
|
276
314
|
},
|
|
277
315
|
loading: 'text-slate-400',
|
|
278
316
|
},
|
|
317
|
+
toast: {
|
|
318
|
+
root: {
|
|
319
|
+
default: 'show show-open left-1/2 top-24 -translate-x-1/2 translate-y-5 rounded border px-4 py-2',
|
|
320
|
+
props: {
|
|
321
|
+
isSuccess: 'border-green-300 bg-green-100 text-green-700',
|
|
322
|
+
isError: 'border-red-300 bg-red-100 text-red-700',
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
},
|
|
279
326
|
});
|
|
280
|
-
export default
|
|
327
|
+
export default classNameConfig;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, EyeIcon, EyeSlashIcon, XMarkIcon, } from '@heroicons/react/16/solid';
|
|
2
|
+
import { ArrowUpTrayIcon, CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
const iconConfig = {
|
|
4
|
+
'appNavigation.menu': ChevronDownIcon,
|
|
5
|
+
'calendar.next': ChevronRightIcon,
|
|
6
|
+
'calendar.previous': ChevronLeftIcon,
|
|
7
|
+
'csvInput.success': CheckCircleIcon,
|
|
8
|
+
'csvInput.upload': ArrowUpTrayIcon,
|
|
9
|
+
'dropdown.control': ChevronDownIcon,
|
|
10
|
+
'filter.clear': XCircleIcon,
|
|
11
|
+
'passwordComplexity.invalid': XCircleIcon,
|
|
12
|
+
'passwordComplexity.valid': CheckCircleIcon,
|
|
13
|
+
'passwordInput.visible': EyeIcon,
|
|
14
|
+
'passwordInput.hidden': EyeSlashIcon,
|
|
15
|
+
'staticTextInput.clear': XMarkIcon,
|
|
16
|
+
};
|
|
17
|
+
export default iconConfig;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { AppConfig } from '@sqrzro/config';
|
|
1
2
|
import type { NavigationObject } from '@sqrzro/ui/navigation';
|
|
2
|
-
export interface AdminConfig {
|
|
3
|
-
app: {
|
|
4
|
-
name: string;
|
|
5
|
-
url: string;
|
|
6
|
-
};
|
|
3
|
+
export interface AdminConfig extends AppConfig {
|
|
7
4
|
navigation: NavigationObject[];
|
|
8
5
|
}
|
|
9
6
|
export interface User {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqrzro/admin",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.16",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "ISC",
|
|
@@ -18,12 +18,14 @@
|
|
|
18
18
|
"dist/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@heroicons/react": "^2.2.0",
|
|
21
22
|
"next": "^16.1.6",
|
|
22
23
|
"react": "^19.2.4",
|
|
23
24
|
"react-dom": "^19.2.4",
|
|
24
25
|
"tailwindcss": "^4.2.1",
|
|
25
|
-
"@sqrzro/addon-auth": "^4.0.0-alpha.
|
|
26
|
-
"@sqrzro/
|
|
26
|
+
"@sqrzro/addon-auth": "^4.0.0-alpha.6",
|
|
27
|
+
"@sqrzro/config": "^4.0.0-alpha.3",
|
|
28
|
+
"@sqrzro/ui": "^4.0.0-alpha.41"
|
|
27
29
|
},
|
|
28
30
|
"devDependencies": {
|
|
29
31
|
"@types/react": "^19.2.14",
|