@sqrzro/admin 4.0.0-alpha.6 → 4.0.0-alpha.8

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.
@@ -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: "bg-slate-800", 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?.app.name })] }), _jsx(AppNavigation, { data: config?.navigation || [] }), _jsx(Suspense, { children: _jsx(MePanel, { userFn: userFn }) })] }) }), _jsx("main", { className: "@container mb-10 block flex flex-1 flex-col", children: children })] }));
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?.app.name })] }), _jsx(AppNavigation, { data: config?.navigation || [] }), _jsx(Suspense, { children: _jsx(MePanel, { userFn: userFn }) })] }) }), _jsx("main", { className: "mb-10 block flex flex-1 flex-col", children: children })] }));
8
8
  }
9
9
  export default AdminAppLayout;
@@ -1,7 +1,8 @@
1
1
  import type { PageProps } from '@sqrzro/ui/components';
2
2
  import { NextLayoutProps } from '@sqrzro/ui/utility';
3
- export type AdminLayoutProps<T> = Omit<PageProps<T>, 'children' | 'pageProps' | 'template'> & {
3
+ type Fn = (...args: any[]) => Promise<any>;
4
+ export type AdminLayoutProps<T extends Fn | undefined = undefined> = Omit<PageProps<T>, 'children' | 'pageProps' | 'template'> & {
4
5
  readonly layoutProps: NextLayoutProps;
5
6
  };
6
- declare function AdminLayout<T>(props: Readonly<AdminLayoutProps<T>>): React.ReactElement;
7
+ declare function AdminLayout<T extends Fn | undefined = undefined>(props: Readonly<AdminLayoutProps<T>>): React.ReactElement;
7
8
  export default AdminLayout;
@@ -1,4 +1,5 @@
1
1
  import type { PageProps } from '@sqrzro/ui/components';
2
- export type AdminPageProps<T> = Omit<PageProps<T>, 'template'>;
3
- declare function AdminPage<T>(props: Readonly<AdminPageProps<T>>): React.ReactElement;
2
+ type Fn = (...args: any[]) => Promise<any>;
3
+ export type AdminPageProps<T extends Fn | undefined = undefined> = Omit<PageProps<T>, 'template'>;
4
+ declare function AdminPage<T extends Fn | undefined = undefined>(props: Readonly<AdminPageProps<T>>): React.ReactElement;
4
5
  export default AdminPage;
@@ -3,6 +3,6 @@ import { Fragment } from 'react';
3
3
  import { Container } from '@sqrzro/ui/components';
4
4
  import { Tabs } from '@sqrzro/ui/navigation';
5
5
  function AdminPageComponent({ children, tabs, title, }) {
6
- return (_jsxs(Fragment, { children: [_jsx("header", { className: "bg-slate-800 pb-16 text-white", children: _jsxs(Container, { children: [_jsxs("div", { className: "flex items-center justify-between py-10", children: [_jsx("h1", { className: "flex min-h-10 items-center text-3xl font-semibold", children: title }), _jsx("div", { className: "flex gap-2", id: "page-actions" })] }), tabs ? _jsx(Tabs, { data: tabs }) : null] }) }), _jsx(Container, { children: _jsx("div", { className: "@container -mt-16 flex flex-col gap-8", children: children }) })] }));
6
+ return (_jsxs(Fragment, { children: [_jsx("header", { className: "bg-linear-to-b from-slate-700 to-slate-800 pb-16 text-white", children: _jsxs(Container, { children: [_jsxs("div", { className: "flex items-center justify-between py-10", children: [_jsx("h1", { className: "flex min-h-10 items-center text-3xl font-semibold", children: title }), _jsx("div", { className: "flex gap-2", id: "page-actions" })] }), tabs ? _jsx(Tabs, { data: tabs }) : null] }) }), _jsx(Container, { children: _jsx("div", { className: "-mt-16 flex flex-col gap-8 [&>.page-content-block]:relative [&>.page-content-block]:before:absolute [&>.page-content-block]:before:bottom-full [&>.page-content-block]:before:left-[calc(50%-50vw)] [&>.page-content-block]:before:-z-10 [&>.page-content-block]:before:-mb-16 [&>.page-content-block]:before:h-96 [&>.page-content-block]:before:w-screen [&>.page-content-block]:before:bg-slate-800 [&>.page-content-block~.page-content-block]:before:content-none", children: children }) })] }));
7
7
  }
8
8
  export default AdminPageComponent;
@@ -0,0 +1,7 @@
1
+ interface AdminPanelProps {
2
+ actions?: React.ReactNode;
3
+ children: React.ReactNode;
4
+ title?: React.ReactNode;
5
+ }
6
+ declare function AdminPanel({ actions, children, title }: AdminPanelProps): React.ReactElement;
7
+ export default AdminPanel;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ function AdminPanel({ actions, children, title }) {
3
+ return (_jsxs("section", { className: "page-content-block rounded bg-white p-6 shadow", children: [title ? (_jsxs("header", { className: "-mt-6 mb-6 flex h-16 items-center justify-between border-b border-slate-200", children: [_jsx("h3", { className: "text-lg font-semibold leading-none", children: title }), actions] })) : null, _jsx("div", { className: "flex flex-col gap-6", children: children })] }));
4
+ }
5
+ export default AdminPanel;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { RootLayout } from '@sqrzro/ui/components';
3
- import classNameConfig from '../../config';
3
+ import classNameConfig from '../../styles/config';
4
4
  function AdminRootLayout({ children }) {
5
5
  return _jsx(RootLayout, { classNameConfig: classNameConfig, children: children });
6
6
  }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  export * from './utility/interfaces';
2
- export { default as classNames } from './config';
2
+ export { default as classNames } from './styles/config';
3
3
  export { default as AdminAppLayout } from './components/AdminAppLayout';
4
4
  export { default as AdminAuth } from './components/AdminAuth';
5
5
  export { default as AdminLayout } from './components/AdminLayout';
6
6
  export { default as AdminPage } from './components/AdminPage';
7
7
  export { default as AdminPageActions } from './components/AdminPageActions';
8
+ export { default as AdminPanel } from './components/AdminPanel';
8
9
  export { default as AdminRootLayout } from './components/AdminRootLayout';
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  export * from './utility/interfaces';
2
- export { default as classNames } from './config';
2
+ export { default as classNames } from './styles/config';
3
3
  export { default as AdminAppLayout } from './components/AdminAppLayout';
4
4
  export { default as AdminAuth } from './components/AdminAuth';
5
5
  export { default as AdminLayout } from './components/AdminLayout';
6
6
  export { default as AdminPage } from './components/AdminPage';
7
7
  export { default as AdminPageActions } from './components/AdminPageActions';
8
+ export { default as AdminPanel } from './components/AdminPanel';
8
9
  export { default as AdminRootLayout } from './components/AdminRootLayout';
@@ -14,12 +14,35 @@ const classNames = twx({
14
14
  },
15
15
  },
16
16
  },
17
+ badge: {
18
+ root: {
19
+ default: 'inline-flex items-center gap-1.5 rounded-full bg-slate-100 px-2 py-1 text-xs font-medium text-slate-600',
20
+ props: {
21
+ isDanger: 'bg-red-100 text-red-700',
22
+ isError: 'bg-red-100 text-red-700',
23
+ isInfo: 'bg-sky-100 text-sky-700',
24
+ isWarning: 'bg-yellow-100 text-yellow-700',
25
+ isSuccess: 'bg-green-100 text-green-700',
26
+ },
27
+ },
28
+ dot: {
29
+ default: 'h-1.5 w-1.5 fill-slate-400',
30
+ props: {
31
+ isDanger: 'fill-red-400',
32
+ isError: 'fill-red-400',
33
+ isInfo: 'fill-sky-400',
34
+ isWarning: 'fill-yellow-400',
35
+ isSuccess: 'fill-green-400',
36
+ },
37
+ },
38
+ },
17
39
  button: {
18
40
  root: {
19
41
  default: 'h-10 rounded border border-slate-300 bg-white px-5 text-sm text-slate-600',
20
42
  props: {
21
43
  isDanger: 'border-red-500 bg-white text-red-500',
22
- isPrimary: 'bg-button-bg hover:bg-button-bg-hover text-button-text border-none font-semibold transition-colors',
44
+ isOnDark: 'border-slate-400 bg-transparent text-white hover:bg-white/10',
45
+ isPrimary: 'bg-linear-to-b hover:bg-button-bg-hover border border-none border-fuchsia-500 from-fuchsia-300 to-fuchsia-400 font-semibold text-slate-700 shadow-sm transition-colors',
23
46
  },
24
47
  },
25
48
  icon: '-ml-1.5 h-4 w-4',
@@ -34,7 +57,7 @@ const classNames = twx({
34
57
  },
35
58
  },
36
59
  editableForm: {
37
- root: 'grid grid-cols-[25%_1fr] gap-20 rounded bg-white p-8 shadow',
60
+ root: 'page-content-block grid grid-cols-[25%_1fr] gap-20 rounded bg-white p-8 shadow',
38
61
  title: 'mb-8 text-lg font-semibold leading-none text-slate-700',
39
62
  description: 'text-slate-600',
40
63
  actions: 'flex justify-end gap-2 border-t border-slate-200 pt-4',
@@ -56,15 +79,33 @@ const classNames = twx({
56
79
  optional: 'pl-2 text-xs font-normal leading-none text-slate-500',
57
80
  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',
58
81
  },
82
+ infoPanel: {
83
+ root: {
84
+ default: 'flex w-full gap-2 rounded p-4 text-left',
85
+ props: {
86
+ isDanger: 'bg-red-100 text-red-700',
87
+ isError: 'bg-red-100 text-red-700',
88
+ isInfo: 'bg-sky-100 text-sky-700',
89
+ isSuccess: 'bg-green-100 text-green-700',
90
+ isWarning: 'border border-yellow-300 bg-gradient-to-br from-yellow-100 to-yellow-200 text-yellow-700',
91
+ },
92
+ },
93
+ },
59
94
  list: {
60
- root: 'flex flex-col gap-4',
95
+ root: {
96
+ default: 'page-content-block flex flex-col gap-4',
97
+ props: { isMinimal: 'gap-0 border-t border-slate-200' },
98
+ },
61
99
  },
62
100
  listItem: {
63
- root: 'rounded bg-white p-4 shadow',
101
+ root: {
102
+ default: 'rounded bg-white p-4 shadow',
103
+ props: { isMinimal: 'border-b border-slate-200 px-0 shadow-none' },
104
+ },
64
105
  title: 'text-base font-semibold',
65
106
  },
66
107
  listItemMeta: {
67
- root: 'mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-slate-500',
108
+ root: 'mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-slate-500',
68
109
  },
69
110
  modal: {
70
111
  root: 'starting:open:backdrop:opacity-0 py-16 backdrop:bg-slate-700/50 backdrop:transition-all backdrop:duration-500 open:backdrop:opacity-100',
@@ -100,6 +141,12 @@ const classNames = twx({
100
141
  rootLayout: {
101
142
  root: 'bg-slate-50 font-sans text-sm text-slate-800',
102
143
  },
144
+ summary: {
145
+ root: 'relative grid gap-6',
146
+ item: 'relative rounded border border-slate-500 p-4 font-semibold text-white',
147
+ label: 'text-slate-300',
148
+ value: 'flex min-h-8 items-center text-2xl',
149
+ },
103
150
  staticTextInput: {
104
151
  root: {
105
152
  default: 'text-md flex min-h-10 flex-col justify-center rounded border border-slate-300 bg-white p-3',
@@ -124,7 +171,7 @@ const classNames = twx({
124
171
  // details: 'mt-1 block text-xs text-slate-500',
125
172
  },
126
173
  table: {
127
- root: 'rounded bg-white p-8 shadow',
174
+ root: 'page-content-block rounded bg-white p-8 shadow',
128
175
  row: {
129
176
  default: 'odd:bg-slate-100',
130
177
  },
@@ -0,0 +1,5 @@
1
+ @import "@sqrzro/ui/styles.css";
2
+
3
+ @theme {
4
+ --color-primary: var(--color-teal-600);
5
+ }
@@ -1,4 +1,4 @@
1
- import { NavigationObject } from 'node_modules/@sqrzro/ui/dist/navigation/interfaces';
1
+ import type { NavigationObject } from '@sqrzro/ui/navigation';
2
2
  export interface AdminConfig {
3
3
  app: {
4
4
  name: string;
package/package.json CHANGED
@@ -1,10 +1,19 @@
1
1
  {
2
2
  "name": "@sqrzro/admin",
3
3
  "type": "module",
4
- "version": "4.0.0-alpha.6",
4
+ "version": "4.0.0-alpha.8",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "ISC",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./styles.css": {
14
+ "default": "./dist/styles/styles.css"
15
+ }
16
+ },
8
17
  "files": [
9
18
  "dist/**/*"
10
19
  ],
@@ -12,13 +21,15 @@
12
21
  "next": "^16.1.6",
13
22
  "react": "^19.2.4",
14
23
  "react-dom": "^19.2.1",
24
+ "tailwindcss": "^4.2.1",
15
25
  "@sqrzro/auth": "^4.0.0-alpha.11",
16
- "@sqrzro/ui": "^4.0.0-alpha.20"
26
+ "@sqrzro/ui": "^4.0.0-alpha.26"
17
27
  },
18
28
  "devDependencies": {
19
29
  "@types/react": "^19.2.7",
20
30
  "@types/react-dom": "^19.2.3",
21
31
  "concurrently": "^9.2.1",
32
+ "cpx": "^1.5.0",
22
33
  "prettier": "^3.7.4",
23
34
  "rimraf": "^6.1.2",
24
35
  "tsc-alias": "^1.8.16",
@@ -26,8 +37,9 @@
26
37
  "@sqrzro/prettier-config": "^4.0.0-alpha.1"
27
38
  },
28
39
  "scripts": {
29
- "build": "pnpm clean && tsc -p tsconfig.build.json && tsc-alias",
40
+ "build": "pnpm clean && tsc -p tsconfig.build.json && tsc-alias && pnpm build:css",
41
+ "build:css": "cpx \"./src/**/*.css\" ./dist",
30
42
  "clean": "rimraf ./dist",
31
- "dev": "(concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc-alias -w\")"
43
+ "dev": "pnpm build:css && (concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc-alias -w\")"
32
44
  }
33
45
  }
File without changes