@sqrzro/admin 4.0.0-alpha.2 → 4.0.0-alpha.4

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.
@@ -0,0 +1,4 @@
1
+ import type { AuthProps } from '@sqrzro/auth';
2
+ type AdminAuthProps = Omit<AuthProps, 'classNameProps' | 'classNames'>;
3
+ declare function AdminAuth(props: AdminAuthProps): React.ReactElement;
4
+ export default AdminAuth;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Auth } from '@sqrzro/auth';
3
+ import { twx } from '@sqrzro/ui/styles';
4
+ const authClassNames = twx({
5
+ actions: 'mt-2 w-full',
6
+ footer: 'mt-2 text-center',
7
+ form: 'flex flex-col gap-6',
8
+ link: 'text-link font-semibold',
9
+ logo: 'row-start-2 mx-auto mx-auto flex h-12 w-32 w-48 items-end',
10
+ panel: 'row-start-3 flex w-screen max-w-sm flex-col gap-6 rounded-lg bg-white p-6 py-8 shadow-lg',
11
+ root: 'grid flex-1 grid-rows-[1fr_auto_auto_3fr] justify-center gap-8 bg-slate-800',
12
+ title: 'mb-1 text-center text-lg font-semibold leading-none',
13
+ });
14
+ function AdminAuth(props) {
15
+ return _jsx(Auth, { classNames: authClassNames, ...props });
16
+ }
17
+ export default AdminAuth;
package/dist/config.js CHANGED
@@ -1,9 +1,7 @@
1
- import { tw, twx } from '@sqrzro/ui/styles';
2
- const showClosed = 'transition-discrete transition-all duration-100 invisible opacity-0 ease-in-out scale-90';
3
- const showOpen = 'starting:opacity-0 starting:scale-90 visible opacity-100 scale-100';
1
+ import { twx } from '@sqrzro/ui/styles';
4
2
  const classNames = twx({
5
3
  actionList: {
6
- root: tw('flex items-center gap-2 [&_li]:first:mr-auto'),
4
+ root: 'flex items-center gap-2 [&_li]:first:mr-auto',
7
5
  },
8
6
  appNavigation: {
9
7
  root: 'h-full pl-6',
@@ -11,15 +9,18 @@ const classNames = twx({
11
9
  item: { default: 'relative h-full' },
12
10
  link: {
13
11
  default: 'relative flex h-full items-center px-1 font-semibold text-white/80 hover:text-white',
14
- highlighted: 'before:bg-primary text-white before:absolute before:bottom-0 before:left-0 before:right-0 before:h-1',
12
+ states: {
13
+ isHighlighted: 'before:bg-primary text-white before:absolute before:bottom-0 before:left-0 before:right-0 before:h-1',
14
+ },
15
15
  },
16
16
  },
17
17
  button: {
18
18
  root: {
19
- danger: 'border-red-500 bg-white text-red-500',
20
19
  default: 'h-10 rounded border border-slate-300 bg-white px-5 text-sm text-slate-600',
21
- primary: 'bg-button-bg hover:bg-button-bg-hover text-button-text border-none font-semibold transition-colors',
22
- link: 'text-link h-auto w-auto border-0 bg-transparent p-0',
20
+ props: {
21
+ 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',
23
+ },
23
24
  },
24
25
  icon: '-ml-1.5 h-4 w-4',
25
26
  },
@@ -29,7 +30,7 @@ const classNames = twx({
29
30
  dropdown: {
30
31
  item: {
31
32
  default: 'block border-b border-slate-100 p-3 text-sm text-slate-700',
32
- selected: 'bg-slate-100',
33
+ states: { isSelected: 'bg-slate-100' },
33
34
  },
34
35
  },
35
36
  editableForm: {
@@ -55,12 +56,19 @@ const classNames = twx({
55
56
  optional: 'pl-2 text-xs font-normal leading-none text-slate-500',
56
57
  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',
57
58
  },
59
+ list: {
60
+ root: 'flex flex-col gap-4',
61
+ },
58
62
  listItem: {
59
- root: { default: 'bg-red-500' },
63
+ root: 'rounded bg-white p-4 shadow',
64
+ title: 'text-base font-semibold',
65
+ },
66
+ listItemMeta: {
67
+ root: 'mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-slate-500',
60
68
  },
61
69
  modal: {
62
70
  root: 'starting:open:backdrop:opacity-0 py-16 backdrop:bg-slate-700/50 backdrop:transition-all backdrop:duration-500 open:backdrop:opacity-100',
63
- panel: `${showOpen} row-start-2 mx-auto flex w-full max-w-lg flex-col gap-6 rounded bg-white p-6 shadow-xl`,
71
+ panel: 'show-open row-start-2 mx-auto flex w-full max-w-lg flex-col gap-6 rounded bg-white p-6 shadow-xl',
64
72
  content: 'flex flex-col gap-6 [&_p]:text-pretty',
65
73
  icon: 'text-slate-400',
66
74
  title: 'flex items-center gap-2 border-b border-slate-200 pb-6 text-lg font-semibold',
@@ -71,43 +79,42 @@ const classNames = twx({
71
79
  list: 'mx-auto flex flex-row items-center gap-1',
72
80
  link: {
73
81
  default: 'inline-flex h-9 w-9 items-center justify-center whitespace-nowrap rounded-md border border-transparent text-sm font-medium hover:bg-slate-100 disabled:pointer-events-none disabled:opacity-30',
74
- highlighted: 'border-slate-200 bg-white shadow-sm',
82
+ states: { isHighlighted: 'border-slate-200 bg-white shadow-sm' },
75
83
  },
76
84
  gap: 'flex h-9 w-9 items-center justify-center text-xs text-slate-400',
77
85
  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',
78
86
  },
79
87
  popover: {
80
88
  root: {
81
- default: `${showClosed} z-20 my-1.5 w-full rounded border border-slate-300 bg-white text-slate-700 shadow-md`,
82
- focused: `${showOpen}`,
89
+ default: 'show-closed z-20 my-1.5 w-full rounded border border-slate-300 bg-white text-slate-700 shadow-md',
90
+ states: { isFocused: 'show-open' },
83
91
  },
84
92
  },
85
93
  rootLayout: {
86
- root: 'overflow-x-hidden overflow-y-scroll bg-slate-50 font-sans text-sm text-slate-800 has-[[data-modal][open]]:overflow-hidden',
87
- content: 'flex min-h-screen flex-col',
94
+ root: 'bg-slate-50 font-sans text-sm text-slate-800',
88
95
  },
89
96
  staticTextInput: {
90
97
  root: {
91
98
  default: 'text-md flex min-h-10 flex-col justify-center rounded border border-slate-300 bg-white p-3',
92
- error: 'border-red-500',
99
+ states: { isError: 'border-red-500' },
93
100
  },
94
101
  label: 'block leading-none',
95
- meta: 'mt-1.5 block text-xs leading-none text-slate-500',
102
+ details: 'mt-1.5 block text-xs leading-none text-slate-500',
96
103
  placeholder: 'block leading-none text-slate-400',
97
104
  },
98
105
  switch: {
99
- root: tw('flex', 'gap-4'),
100
- control: tw('relative flex-none', 'h-6 w-10'),
106
+ root: 'flex gap-4',
107
+ control: 'relative h-6 w-10 flex-none',
101
108
  input: {
102
- default: tw('block h-full w-full cursor-pointer rounded-full transition-colors', 'bg-slate-300'),
103
- checked: tw('bg-primary'),
109
+ default: 'block h-full w-full cursor-pointer rounded-full bg-slate-300 transition-colors',
110
+ states: { isChecked: 'bg-primary' },
104
111
  },
105
112
  icon: {
106
- default: tw('pointer-events-none absolute top-1/2 -translate-y-1/2 translate-x-0 transform rounded-full transition-transform duration-100', 'left-1 h-4 w-4 bg-white shadow-md'),
107
- checked: tw('translate-x-full'),
113
+ default: 'pointer-events-none absolute left-1 top-1/2 h-4 w-4 -translate-y-1/2 translate-x-0 transform rounded-full bg-white shadow-md transition-transform duration-100',
114
+ states: { isChecked: 'translate-x-full' },
108
115
  },
109
- label: 'flex min-h-6 flex-col justify-center',
110
- details: 'mt-1 block text-xs text-slate-500',
116
+ // label: 'flex min-h-6 flex-col justify-center',
117
+ // details: 'mt-1 block text-xs text-slate-500',
111
118
  },
112
119
  table: {
113
120
  root: 'rounded bg-white p-8 shadow',
@@ -121,13 +128,13 @@ const classNames = twx({
121
128
  list: 'flex gap-4',
122
129
  link: {
123
130
  default: 'block border-b-4 border-transparent px-1 pb-2 font-semibold opacity-80 hover:opacity-100',
124
- highlighted: 'border-primary opacity-100',
131
+ states: { isHighlighted: 'border-primary opacity-100' },
125
132
  },
126
133
  },
127
134
  textInput: {
128
135
  root: {
129
136
  default: 'text-md focus:border-primary h-10 rounded border border-slate-300 px-3 placeholder-slate-400',
130
- error: 'border-red-500',
137
+ states: { isError: 'border-red-500' },
131
138
  },
132
139
  prefix: {
133
140
  default: 'peer-focus:border-primary relative -mr-1 rounded-l border border-slate-300 bg-white px-3 text-sm text-slate-600',
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './utility/interfaces';
2
2
  export { default as classNames } from './config';
3
3
  export { default as AdminAppLayout } from './components/AdminAppLayout';
4
+ export { default as AdminAuth } from './components/AdminAuth';
4
5
  export { default as AdminLayout } from './components/AdminLayout';
5
6
  export { default as AdminPage } from './components/AdminPage';
6
7
  export { default as AdminPageActions } from './components/AdminPageActions';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './utility/interfaces';
2
2
  export { default as classNames } from './config';
3
3
  export { default as AdminAppLayout } from './components/AdminAppLayout';
4
+ export { default as AdminAuth } from './components/AdminAuth';
4
5
  export { default as AdminLayout } from './components/AdminLayout';
5
6
  export { default as AdminPage } from './components/AdminPage';
6
7
  export { default as AdminPageActions } from './components/AdminPageActions';
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.2",
4
+ "version": "4.0.0-alpha.4",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "ISC",
@@ -12,8 +12,8 @@
12
12
  "next": "^16.1.6",
13
13
  "react": "^19.2.4",
14
14
  "react-dom": "^19.2.1",
15
- "@sqrzro/ui": "^4.0.0-alpha.5",
16
- "@sqrzro/auth": "^4.0.0-alpha.5"
15
+ "@sqrzro/auth": "^4.0.0-alpha.9",
16
+ "@sqrzro/ui": "^4.0.0-alpha.15"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/react": "^19.2.7",