@sqrzro/admin 4.0.0-alpha.16 → 4.0.0-alpha.18

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.
@@ -1,9 +1,14 @@
1
- import type { AdminConfig, User } from '../../utility/interfaces';
1
+ import { NavigationObject } from '@sqrzro/ui/navigation';
2
+ import type { User } from '../../utility/interfaces';
2
3
  interface AdminAppLayoutProps {
3
4
  readonly children: React.ReactNode;
4
- readonly config?: AdminConfig;
5
5
  readonly logo?: React.ReactNode;
6
+ readonly navigation?: NavigationObject[];
7
+ readonly site?: {
8
+ name: string;
9
+ url: string;
10
+ };
6
11
  readonly userFn?: () => Promise<User>;
7
12
  }
8
- declare function AdminAppLayout({ children, config, logo, userFn, }: AdminAppLayoutProps): React.ReactElement;
13
+ declare function AdminAppLayout({ children, logo, navigation, site, userFn, }: AdminAppLayoutProps): React.ReactElement;
9
14
  export default AdminAppLayout;
@@ -3,7 +3,7 @@ import { Suspense } from 'react';
3
3
  import { Link } from '@sqrzro/ui/components';
4
4
  import { AppNavigation } from '@sqrzro/ui/navigation';
5
5
  import MePanel from '../MePanel';
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?.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 })] }));
6
+ function AdminAppLayout({ children, logo, navigation, site, 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: site?.name })] }), _jsx(AppNavigation, { data: 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;
@@ -89,9 +89,10 @@ const classNameConfig = twx({
89
89
  },
90
90
  dropdown: {
91
91
  item: {
92
- default: 'block border-b border-slate-100 p-3 text-sm text-slate-700',
92
+ default: 'flex flex-col items-start justify-center gap-1.5 border-b border-slate-100 p-3',
93
93
  states: { isSelected: 'bg-slate-100' },
94
94
  },
95
+ details: 'text-xs leading-none text-slate-500',
95
96
  },
96
97
  editableForm: {
97
98
  root: 'page-content-block grid grid-cols-[25%_1fr] gap-20 rounded bg-white p-8 shadow',
@@ -159,7 +160,10 @@ const classNameConfig = twx({
159
160
  },
160
161
  details: 'mb-2 text-xs font-normal text-slate-500',
161
162
  optional: 'pl-2 text-xs font-normal leading-none text-slate-500',
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',
163
+ error: {
164
+ default: 'text-error mt-2 flex items-start gap-1.5',
165
+ props: { isEditable: 'col-start-2' },
166
+ },
163
167
  },
164
168
  infoPanel: {
165
169
  root: {
@@ -254,11 +258,11 @@ const classNameConfig = twx({
254
258
  },
255
259
  staticTextInput: {
256
260
  root: {
257
- default: 'text-md flex min-h-10 flex-col justify-center rounded border border-slate-300 bg-white p-3',
261
+ default: 'text-md flex min-h-10 flex-col items-start justify-center gap-1.5 rounded border border-slate-300 bg-white p-3',
258
262
  states: { isError: 'border-red-500' },
259
263
  },
260
264
  label: 'block leading-none',
261
- details: 'mt-1.5 block text-xs leading-none text-slate-500',
265
+ details: 'block text-xs leading-none text-slate-500',
262
266
  placeholder: 'block leading-none text-slate-400',
263
267
  icon: 'mr-2 h-4 w-4 rounded-full bg-slate-500 text-white',
264
268
  clear: 'mr-2 h-4 w-4 flex-none rounded-full border border-slate-500 text-slate-600',
@@ -1,5 +1,5 @@
1
1
  import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, EyeIcon, EyeSlashIcon, XMarkIcon, } from '@heroicons/react/16/solid';
2
- import { ArrowUpTrayIcon, CheckCircleIcon, XCircleIcon } from '@heroicons/react/24/outline';
2
+ import { ArrowUpTrayIcon, CheckCircleIcon, ExclamationCircleIcon, XCircleIcon, } from '@heroicons/react/24/outline';
3
3
  const iconConfig = {
4
4
  'appNavigation.menu': ChevronDownIcon,
5
5
  'calendar.next': ChevronRightIcon,
@@ -8,6 +8,7 @@ const iconConfig = {
8
8
  'csvInput.upload': ArrowUpTrayIcon,
9
9
  'dropdown.control': ChevronDownIcon,
10
10
  'filter.clear': XCircleIcon,
11
+ 'formField.error': ExclamationCircleIcon,
11
12
  'passwordComplexity.invalid': XCircleIcon,
12
13
  'passwordComplexity.valid': CheckCircleIcon,
13
14
  'passwordInput.visible': EyeIcon,
@@ -1,8 +1,3 @@
1
- import { AppConfig } from '@sqrzro/config';
2
- import type { NavigationObject } from '@sqrzro/ui/navigation';
3
- export interface AdminConfig extends AppConfig {
4
- navigation: NavigationObject[];
5
- }
6
1
  export interface User {
7
2
  id: string;
8
3
  name: string;
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.16",
4
+ "version": "4.0.0-alpha.18",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "ISC",
@@ -23,9 +23,8 @@
23
23
  "react": "^19.2.4",
24
24
  "react-dom": "^19.2.4",
25
25
  "tailwindcss": "^4.2.1",
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"
26
+ "@sqrzro/addon-auth": "^4.0.0-alpha.8",
27
+ "@sqrzro/ui": "^4.0.0-alpha.46"
29
28
  },
30
29
  "devDependencies": {
31
30
  "@types/react": "^19.2.14",