@sqrzro/admin 2.1.0-bz.16 → 2.1.0-bz.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.
Files changed (89) hide show
  1. package/dist/index.cjs +205 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +169 -0
  4. package/dist/index.d.ts +169 -3
  5. package/dist/index.js +16 -3
  6. package/dist/index.js.map +1 -0
  7. package/package.json +28 -14
  8. package/dist/components/AppLayout/index.d.ts +0 -9
  9. package/dist/components/AppLayout/index.js +0 -14
  10. package/dist/components/AppNavigation/index.d.ts +0 -6
  11. package/dist/components/AppNavigation/index.js +0 -16
  12. package/dist/components/Auth/index.d.ts +0 -5
  13. package/dist/components/Auth/index.js +0 -15
  14. package/dist/components/Badge/index.d.ts +0 -8
  15. package/dist/components/Badge/index.js +0 -11
  16. package/dist/components/BooleanFilter/index.d.ts +0 -5
  17. package/dist/components/BooleanFilter/index.js +0 -19
  18. package/dist/components/Config/index.d.ts +0 -6
  19. package/dist/components/Config/index.js +0 -9
  20. package/dist/components/Dashboard/index.d.ts +0 -7
  21. package/dist/components/Dashboard/index.js +0 -5
  22. package/dist/components/DateFilter/index.d.ts +0 -6
  23. package/dist/components/DateFilter/index.js +0 -31
  24. package/dist/components/DropdownFilter/index.d.ts +0 -6
  25. package/dist/components/DropdownFilter/index.js +0 -9
  26. package/dist/components/FilterBar/index.d.ts +0 -9
  27. package/dist/components/FilterBar/index.js +0 -21
  28. package/dist/components/FilterBarItem/index.d.ts +0 -15
  29. package/dist/components/FilterBarItem/index.js +0 -31
  30. package/dist/components/GridList/index.d.ts +0 -5
  31. package/dist/components/GridList/index.js +0 -7
  32. package/dist/components/GridListItem/index.d.ts +0 -4
  33. package/dist/components/GridListItem/index.js +0 -8
  34. package/dist/components/Icon/index.d.ts +0 -8
  35. package/dist/components/Icon/index.js +0 -23
  36. package/dist/components/InfoPanel/index.d.ts +0 -8
  37. package/dist/components/InfoPanel/index.js +0 -22
  38. package/dist/components/List/index.d.ts +0 -25
  39. package/dist/components/List/index.js +0 -39
  40. package/dist/components/ListAction/index.d.ts +0 -7
  41. package/dist/components/ListAction/index.js +0 -9
  42. package/dist/components/ListActions/index.d.ts +0 -8
  43. package/dist/components/ListActions/index.js +0 -12
  44. package/dist/components/ListItem/index.d.ts +0 -18
  45. package/dist/components/ListItem/index.js +0 -16
  46. package/dist/components/MeActions/index.d.ts +0 -3
  47. package/dist/components/MeActions/index.js +0 -6
  48. package/dist/components/MePanel/index.d.ts +0 -8
  49. package/dist/components/MePanel/index.js +0 -6
  50. package/dist/components/Page/index.d.ts +0 -12
  51. package/dist/components/Page/index.js +0 -12
  52. package/dist/components/PageActions/index.d.ts +0 -6
  53. package/dist/components/PageActions/index.js +0 -13
  54. package/dist/components/Panel/index.d.ts +0 -7
  55. package/dist/components/Panel/index.js +0 -5
  56. package/dist/components/RootLayout/index.d.ts +0 -9
  57. package/dist/components/RootLayout/index.js +0 -21
  58. package/dist/components/SettingsForm/index.d.ts +0 -9
  59. package/dist/components/SettingsForm/index.js +0 -14
  60. package/dist/components/SettingsPage/index.d.ts +0 -3
  61. package/dist/components/SettingsPage/index.js +0 -9
  62. package/dist/components/Table/index.d.ts +0 -9
  63. package/dist/components/Table/index.js +0 -17
  64. package/dist/components/TableClientComponent/index.d.ts +0 -16
  65. package/dist/components/TableClientComponent/index.js +0 -57
  66. package/dist/components/Tabs/index.d.ts +0 -8
  67. package/dist/components/Tabs/index.js +0 -11
  68. package/dist/components/index.d.ts +0 -33
  69. package/dist/components/index.js +0 -17
  70. package/dist/icons/ErrorIcon/index.d.ts +0 -3
  71. package/dist/icons/ErrorIcon/index.js +0 -5
  72. package/dist/icons/InfoIcon/index.d.ts +0 -3
  73. package/dist/icons/InfoIcon/index.js +0 -5
  74. package/dist/icons/SuccessIcon/index.d.ts +0 -3
  75. package/dist/icons/SuccessIcon/index.js +0 -5
  76. package/dist/icons/WarningIcon/index.d.ts +0 -3
  77. package/dist/icons/WarningIcon/index.js +0 -5
  78. package/dist/interfaces.d.ts +0 -4
  79. package/dist/interfaces.js +0 -1
  80. package/dist/services/ConfigService.d.ts +0 -11
  81. package/dist/services/ConfigService.js +0 -14
  82. package/dist/services/LayoutService.d.ts +0 -7
  83. package/dist/services/LayoutService.js +0 -9
  84. package/dist/styles/config.d.ts +0 -3
  85. package/dist/styles/config.js +0 -145
  86. package/dist/styles/postcss.d.ts +0 -6
  87. package/dist/styles/postcss.js +0 -4
  88. package/dist/styles/tailwind.d.ts +0 -10
  89. package/dist/styles/tailwind.js +0 -72
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare function SuccessIcon(): React.ReactElement;
3
- export default SuccessIcon;
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- function SuccessIcon() {
3
- return (_jsx("svg", { "aria-hidden": "true", className: "h-5 w-5 text-green-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { clipRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z", fillRule: "evenodd" }) }));
4
- }
5
- export default SuccessIcon;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- declare function WarningIcon(): React.ReactElement;
3
- export default WarningIcon;
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- function WarningIcon() {
3
- return (_jsx("svg", { "aria-hidden": "true", className: "h-5 w-5 text-yellow-400", fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { clipRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", fillRule: "evenodd" }) }));
4
- }
5
- export default WarningIcon;
@@ -1,4 +0,0 @@
1
- import type { InputProps, SimpleObject } from '@sqrzro/interfaces';
2
- export type FilterComponentProps = InputProps<string> & {
3
- data?: SimpleObject[];
4
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- export interface Config {
3
- app: {
4
- name: string;
5
- url: string;
6
- };
7
- logo?: () => React.ReactElement;
8
- navigation: Record<string, string>;
9
- }
10
- export declare function setConfig(cfg: Config, logo?: () => React.ReactElement): Config;
11
- export declare function getConfig(): Config;
@@ -1,14 +0,0 @@
1
- let config = {
2
- app: {
3
- name: 'Square Zero',
4
- url: 'http://localhost:8080',
5
- },
6
- navigation: {},
7
- };
8
- export function setConfig(cfg, logo) {
9
- config = { ...cfg, logo };
10
- return config;
11
- }
12
- export function getConfig() {
13
- return config;
14
- }
@@ -1,7 +0,0 @@
1
- import type { SerializedErrorable } from '@sqrzro/interfaces';
2
- type Layout = 'sidebar' | 'topbar';
3
- export declare function getLayout(): Promise<string>;
4
- export declare function submitLayoutForm(formData: {
5
- layout: Layout;
6
- }): Promise<SerializedErrorable<boolean>>;
7
- export {};
@@ -1,9 +0,0 @@
1
- 'use server';
2
- import { cookies } from 'next/headers';
3
- export async function getLayout() {
4
- return Promise.resolve(cookies().get('layout')?.value || 'topbar');
5
- }
6
- export async function submitLayoutForm(formData) {
7
- cookies().set('layout', formData.layout);
8
- return Promise.resolve([true, null]);
9
- }
@@ -1,3 +0,0 @@
1
- import type { RegisteredClassNames } from '@sqrzro/components';
2
- declare const classNames: RegisteredClassNames;
3
- export default classNames;
@@ -1,145 +0,0 @@
1
- 'use client';
2
- import { tw, twx } from '@sqrzro/components';
3
- const classNames = twx({
4
- actionList: () => ({
5
- root: 'flex gap-2',
6
- }),
7
- button: (props) => ({
8
- root: {
9
- danger: 'border-red-500 bg-red-500 text-white',
10
- default: tw('text-md h-10 rounded border border-slate-300 bg-white px-5 text-slate-600', props?.isFullWidth ? 'w-full' : null),
11
- primary: 'bg-button-bg text-button-text border-none font-semibold',
12
- },
13
- }),
14
- calendar: () => ({
15
- root: 'p-4 pb-3 text-sm text-slate-600',
16
- head: 'pb-2 text-center text-xs text-slate-400',
17
- month: 'w-full table-fixed',
18
- day: {
19
- default: 'h-10 border border-slate-200',
20
- highlighted: 'bg-slate-100',
21
- selected: 'bg-slate-200',
22
- },
23
- }),
24
- calendarNavigation: () => ({
25
- root: 'mb-6 flex items-center justify-between',
26
- title: 'text-base font-semibold',
27
- control: 'h-6 w-6 rounded-full border border-slate-300',
28
- previous: '-order-1',
29
- }),
30
- codeInput: () => ({
31
- input: {
32
- default: 'focus:border-primary h-10 rounded border border-slate-300 text-center',
33
- error: 'border-red-500',
34
- },
35
- }),
36
- editableFieldset: () => ({
37
- root: 'bg-panel grid grid-cols-[30%_1fr] gap-8 rounded p-8 shadow',
38
- title: 'mb-8 text-lg font-semibold leading-none text-slate-700',
39
- description: 'text-slate-600',
40
- actions: 'flex justify-end gap-2 border-t border-slate-200 pt-4',
41
- }),
42
- editableFormField: () => ({
43
- root: 'grid grid-cols-[25%_1fr] border-t border-slate-200 py-4',
44
- label: 'flex items-center font-semibold leading-none',
45
- field: 'flex min-h-10 items-center',
46
- }),
47
- emptyMessage: (props) => ({
48
- root: tw('relative mx-auto mt-4 w-full max-w-2xl p-16 text-center text-slate-500', props?.isMinimal
49
- ? null
50
- : 'rounded bg-white shadow before:pointer-events-none before:absolute before:inset-2 before:border-2 before:border-dashed'),
51
- title: 'mb-2 text-pretty text-xl font-semibold leading-tight',
52
- description: 'text-pretty',
53
- action: 'mt-6 flex justify-center',
54
- }),
55
- dropdown: () => ({
56
- item: { default: 'block p-3 text-sm text-slate-700', selected: 'bg-slate-100' },
57
- title: 'block leading-none',
58
- meta: 'mt-0.5 block text-xs leading-none text-slate-500',
59
- }),
60
- fieldset: () => ({
61
- root: 'rounded bg-white p-8 shadow',
62
- title: 'mb-8 text-lg font-semibold leading-none text-slate-700',
63
- }),
64
- form: () => ({
65
- root: 'flex flex-col gap-6',
66
- }),
67
- formField: (props) => ({
68
- root: {
69
- default: props?.isEditable
70
- ? 'grid grid-cols-[25%_1fr] border-t border-slate-200 py-4'
71
- : '',
72
- },
73
- label: tw('flex font-semibold leading-none', props?.isEditable ? 'items-center' : 'mb-2 justify-between'),
74
- details: 'mb-2 text-xs font-normal leading-none text-slate-500',
75
- optional: 'pl-2 text-xs font-normal leading-none text-slate-500',
76
- error: 'mt-2 flex items-center gap-2 text-red-700 before:h-4 before:w-4 before:rounded-full before:bg-[url(/admin/images/error.svg)]',
77
- }),
78
- imageInput: () => ({
79
- root: 'h-64 rounded border border-slate-300 bg-slate-50 p-8',
80
- icon: 'mx-auto mb-2 block h-12 w-12 rounded-full border-2 border-slate-300',
81
- title: 'mb-1 font-semibold',
82
- description: 'text-xs italic text-slate-700',
83
- }),
84
- inputPanel: () => ({
85
- root: 'show mt-1 origin-top rounded border border-slate-300 bg-white shadow-md',
86
- }),
87
- modal: () => ({
88
- root: 'open:backdrop:fade py-16 backdrop:bg-slate-700/50 backdrop:backdrop-blur-sm',
89
- panel: 'show bg-panel row-start-2 mx-auto w-full max-w-lg rounded p-6 text-left shadow-xl',
90
- title: 'mb-6 text-lg font-semibold',
91
- actions: 'flex justify-end',
92
- }),
93
- multiInput: () => ({
94
- root: 'flex flex-col gap-2',
95
- row: 'grid grid-cols-[1fr_auto] has-[>_button]:gap-2',
96
- }),
97
- passwordInput: () => ({
98
- action: {
99
- default: 'mr-2 h-6 w-6 overflow-hidden bg-[url(/admin/images/eye.svg)] bg-no-repeat indent-12',
100
- selected: 'bg-bottom',
101
- },
102
- }),
103
- staticTextInput: () => ({
104
- root: {
105
- default: 'text-md h-10 rounded border border-slate-300 bg-white px-3',
106
- error: 'border-red-500',
107
- },
108
- }),
109
- switch: () => ({
110
- root: 'flex gap-4',
111
- input: {
112
- default: 'h-6 w-10 flex-none cursor-pointer rounded-full bg-slate-300 p-1 transition-colors',
113
- checked: 'bg-green-500',
114
- },
115
- control: {
116
- default: 'h-4 w-4 translate-x-0 transform rounded-full bg-white shadow-md transition-transform',
117
- checked: 'translate-x-full',
118
- },
119
- label: 'font-semibold',
120
- details: 'block text-xs text-slate-500',
121
- }),
122
- textArea: () => ({
123
- root: {
124
- default: 'text-md focus:border-primary rounded border border-slate-300 px-3 py-2',
125
- error: 'border-red-500',
126
- },
127
- }),
128
- textButton: () => ({
129
- root: { danger: 'text-red-600' },
130
- }),
131
- textInput: () => ({
132
- root: {
133
- default: 'text-md focus:border-primary h-10 rounded border border-slate-300 px-3',
134
- error: 'border-red-500',
135
- },
136
- }),
137
- toast: () => ({
138
- root: {
139
- default: 'rounded border px-4 py-2',
140
- success: 'border-green-300 bg-green-100 text-green-700',
141
- error: 'border-red-300 bg-red-100 text-red-700',
142
- },
143
- }),
144
- });
145
- export default classNames;
@@ -1,6 +0,0 @@
1
- declare const config: {
2
- plugins: {
3
- tailwindcss: {};
4
- };
5
- };
6
- export default config;
@@ -1,4 +0,0 @@
1
- const config = {
2
- plugins: { tailwindcss: {} },
3
- };
4
- export default config;
@@ -1,10 +0,0 @@
1
- interface Theme {
2
- colors?: Partial<{
3
- 'button-bg': string;
4
- 'button-text': string;
5
- link: string;
6
- primary: string;
7
- }>;
8
- }
9
- declare function config(resolves: string[], customization?: Theme): Record<string, unknown>;
10
- export default config;
@@ -1,72 +0,0 @@
1
- import path from 'path';
2
- import plugin from 'tailwindcss/plugin';
3
- function config(resolves, customization) {
4
- return {
5
- content: [
6
- './app/**/*.tsx',
7
- './src/**/*.tsx',
8
- ...resolves.map((item) => path.join(item, '**/*.js')),
9
- ],
10
- darkMode: 'class',
11
- mode: 'jit',
12
- theme: {
13
- extend: {
14
- colors: {
15
- 'button-bg': 'var(--color-button-bg)',
16
- 'button-text': 'var(--color-button-text)',
17
- link: 'var(--color-link)',
18
- panel: 'var(--color-panel)',
19
- primary: 'var(--color-primary)',
20
- },
21
- fontFamily: {
22
- sans: ['var(--font-inter)'],
23
- },
24
- },
25
- },
26
- plugins: [
27
- plugin(({ addBase, addUtilities, theme }) => {
28
- addBase({
29
- body: {
30
- '--color-button-bg': customization?.colors?.['button-bg'] ||
31
- customization?.colors?.primary ||
32
- theme('colors.indigo.800'),
33
- '--color-button-text': customization?.colors?.['button-text'] || theme('colors.white'),
34
- '--color-link': customization?.colors?.link || theme('colors.indigo.800'),
35
- '--color-panel': theme('colors.white'),
36
- '--color-primary': customization?.colors?.primary || theme('colors.indigo.800'),
37
- },
38
- 'body.dark': {
39
- '--color-panel': theme('colors.gray.700'),
40
- },
41
- });
42
- addUtilities({
43
- '@keyframes show': {
44
- from: {
45
- opacity: '0',
46
- transform: 'scale3d(.9,.9,.9)',
47
- },
48
- to: {
49
- opacity: '1',
50
- transform: 'scale3d(1,1,1)',
51
- },
52
- },
53
- '.show': {
54
- animation: 'show 0.1s ease-in-out',
55
- },
56
- '@keyframes fade': {
57
- from: {
58
- opacity: '0',
59
- },
60
- to: {
61
- opacity: '1',
62
- },
63
- },
64
- '.fade': {
65
- animation: 'fade 0.2s ease-in-out',
66
- },
67
- });
68
- }),
69
- ],
70
- };
71
- }
72
- export default config;