@raulaguila/maat-ui 0.4.0 → 0.6.0
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/README.md +137 -2
- package/dist/account-menu.d.ts +10 -0
- package/dist/account-menu.js +17 -0
- package/dist/auth-card.d.ts +22 -0
- package/dist/auth-card.js +14 -0
- package/dist/badge.d.ts +1 -1
- package/dist/breadcrumb.d.ts +15 -0
- package/dist/breadcrumb.js +24 -0
- package/dist/button.d.ts +5 -2
- package/dist/button.js +4 -3
- package/dist/device.d.ts +5 -0
- package/dist/device.js +23 -0
- package/dist/error-screens.d.ts +14 -0
- package/dist/error-screens.js +18 -0
- package/dist/form-error.d.ts +6 -0
- package/dist/form-error.js +8 -0
- package/dist/form-field.d.ts +4 -2
- package/dist/form-field.js +10 -2
- package/dist/format.d.ts +12 -0
- package/dist/format.js +46 -0
- package/dist/hooks.d.ts +26 -0
- package/dist/hooks.js +87 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +15 -0
- package/dist/labels.d.ts +66 -3
- package/dist/labels.js +55 -5
- package/dist/notification-bell.d.ts +5 -0
- package/dist/notification-bell.js +11 -0
- package/dist/password-strength.d.ts +7 -0
- package/dist/password-strength.js +27 -0
- package/dist/pre-paint.d.ts +9 -0
- package/dist/pre-paint.js +12 -0
- package/dist/save-bar.d.ts +20 -0
- package/dist/save-bar.js +19 -0
- package/dist/selection-bar.d.ts +8 -0
- package/dist/selection-bar.js +11 -0
- package/dist/sessions-table.d.ts +20 -0
- package/dist/sessions-table.js +48 -0
- package/dist/skeleton.d.ts +6 -1
- package/dist/skeleton.js +6 -1
- package/dist/sonner.d.ts +13 -1
- package/dist/sonner.js +29 -2
- package/dist/sort-head.d.ts +12 -0
- package/dist/sort-head.js +10 -0
- package/dist/status-badge.d.ts +8 -0
- package/dist/status-badge.js +13 -0
- package/dist/theme-toggle.d.ts +4 -0
- package/dist/theme-toggle.js +20 -0
- package/package.json +78 -4
- package/styles.css +55 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useTheme } from "next-themes";
|
|
5
|
+
import { Moon, Sun } from "lucide-react";
|
|
6
|
+
import { useFamilyLabels } from "./labels.js";
|
|
7
|
+
/** Light/dark switch (next-themes). `onToggle` replaces setTheme, to save the choice to the account. */
|
|
8
|
+
export function ThemeToggle({ onToggle }) {
|
|
9
|
+
const labels = useFamilyLabels();
|
|
10
|
+
const { resolvedTheme, setTheme } = useTheme();
|
|
11
|
+
const [mounted, setMounted] = useState(false);
|
|
12
|
+
// Mount flag: the server cannot know the theme, so the first render matches it.
|
|
13
|
+
useEffect(() => setMounted(true), []);
|
|
14
|
+
const isDark = mounted && resolvedTheme === "dark";
|
|
15
|
+
const label = isDark ? labels.themeToLight : labels.themeToDark;
|
|
16
|
+
return (_jsx("button", { type: "button", "aria-label": label, title: label, onClick: () => { const next = isDark ? "light" : "dark"; if (onToggle)
|
|
17
|
+
onToggle(next);
|
|
18
|
+
else
|
|
19
|
+
setTheme(next); }, className: "flex size-11 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring md:size-8", children: isDark ? _jsx(Sun, { className: "size-4", "aria-hidden": true }) : _jsx(Moon, { className: "size-4", "aria-hidden": true }) }));
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raulaguila/maat-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"publishConfig": {
|
|
5
|
-
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"registry": "https://registry.npmjs.org",
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/raulaguila/maat-ui.git"
|
|
11
|
+
},
|
|
6
12
|
"description": "Maat UI — componentes React e estilos de Seshat, Thoth e Khnum",
|
|
7
13
|
"type": "module",
|
|
8
14
|
"files": [
|
|
@@ -33,6 +39,14 @@
|
|
|
33
39
|
"types": "./dist/query-error-state.d.ts",
|
|
34
40
|
"import": "./dist/query-error-state.js"
|
|
35
41
|
},
|
|
42
|
+
"./auth-card": {
|
|
43
|
+
"types": "./dist/auth-card.d.ts",
|
|
44
|
+
"import": "./dist/auth-card.js"
|
|
45
|
+
},
|
|
46
|
+
"./device": {
|
|
47
|
+
"types": "./dist/device.d.ts",
|
|
48
|
+
"import": "./dist/device.js"
|
|
49
|
+
},
|
|
36
50
|
"./avatar": {
|
|
37
51
|
"types": "./dist/avatar.d.ts",
|
|
38
52
|
"import": "./dist/avatar.js"
|
|
@@ -149,6 +163,66 @@
|
|
|
149
163
|
"./sonner": {
|
|
150
164
|
"types": "./dist/sonner.d.ts",
|
|
151
165
|
"import": "./dist/sonner.js"
|
|
166
|
+
},
|
|
167
|
+
"./status-badge": {
|
|
168
|
+
"types": "./dist/status-badge.d.ts",
|
|
169
|
+
"import": "./dist/status-badge.js"
|
|
170
|
+
},
|
|
171
|
+
"./form-error": {
|
|
172
|
+
"types": "./dist/form-error.d.ts",
|
|
173
|
+
"import": "./dist/form-error.js"
|
|
174
|
+
},
|
|
175
|
+
"./save-bar": {
|
|
176
|
+
"types": "./dist/save-bar.d.ts",
|
|
177
|
+
"import": "./dist/save-bar.js"
|
|
178
|
+
},
|
|
179
|
+
"./selection-bar": {
|
|
180
|
+
"types": "./dist/selection-bar.d.ts",
|
|
181
|
+
"import": "./dist/selection-bar.js"
|
|
182
|
+
},
|
|
183
|
+
"./sort-head": {
|
|
184
|
+
"types": "./dist/sort-head.d.ts",
|
|
185
|
+
"import": "./dist/sort-head.js"
|
|
186
|
+
},
|
|
187
|
+
"./error-screens": {
|
|
188
|
+
"types": "./dist/error-screens.d.ts",
|
|
189
|
+
"import": "./dist/error-screens.js"
|
|
190
|
+
},
|
|
191
|
+
"./account-menu": {
|
|
192
|
+
"types": "./dist/account-menu.d.ts",
|
|
193
|
+
"import": "./dist/account-menu.js"
|
|
194
|
+
},
|
|
195
|
+
"./notification-bell": {
|
|
196
|
+
"types": "./dist/notification-bell.d.ts",
|
|
197
|
+
"import": "./dist/notification-bell.js"
|
|
198
|
+
},
|
|
199
|
+
"./theme-toggle": {
|
|
200
|
+
"types": "./dist/theme-toggle.d.ts",
|
|
201
|
+
"import": "./dist/theme-toggle.js"
|
|
202
|
+
},
|
|
203
|
+
"./breadcrumb": {
|
|
204
|
+
"types": "./dist/breadcrumb.d.ts",
|
|
205
|
+
"import": "./dist/breadcrumb.js"
|
|
206
|
+
},
|
|
207
|
+
"./format": {
|
|
208
|
+
"types": "./dist/format.d.ts",
|
|
209
|
+
"import": "./dist/format.js"
|
|
210
|
+
},
|
|
211
|
+
"./hooks": {
|
|
212
|
+
"types": "./dist/hooks.d.ts",
|
|
213
|
+
"import": "./dist/hooks.js"
|
|
214
|
+
},
|
|
215
|
+
"./password-strength": {
|
|
216
|
+
"types": "./dist/password-strength.d.ts",
|
|
217
|
+
"import": "./dist/password-strength.js"
|
|
218
|
+
},
|
|
219
|
+
"./sessions-table": {
|
|
220
|
+
"types": "./dist/sessions-table.d.ts",
|
|
221
|
+
"import": "./dist/sessions-table.js"
|
|
222
|
+
},
|
|
223
|
+
"./pre-paint": {
|
|
224
|
+
"types": "./dist/pre-paint.d.ts",
|
|
225
|
+
"import": "./dist/pre-paint.js"
|
|
152
226
|
}
|
|
153
227
|
},
|
|
154
228
|
"sideEffects": [
|
|
@@ -159,7 +233,7 @@
|
|
|
159
233
|
"prepack": "pnpm build",
|
|
160
234
|
"catalog": "pnpm build && vite catalog",
|
|
161
235
|
"catalog:build": "pnpm build && vite build catalog",
|
|
162
|
-
"test": "pnpm build && node --test test/*.test.mjs"
|
|
236
|
+
"test": "pnpm build && node --test test/*.test.mjs && python3 -B -m unittest discover -s test -p 'test_*.py'"
|
|
163
237
|
},
|
|
164
238
|
"peerDependencies": {
|
|
165
239
|
"react": "^19.0.0",
|
package/styles.css
CHANGED
|
@@ -430,3 +430,58 @@ html[data-density="compact"] {
|
|
|
430
430
|
[data-ui-app-shell] { gap: 0; }
|
|
431
431
|
[data-ui-app-header] { height: 56px; padding-inline: 0; margin-bottom: 8px; }
|
|
432
432
|
}
|
|
433
|
+
|
|
434
|
+
/* Sign-in, sign-up and recovery screens (AuthLayout, AuthCard). */
|
|
435
|
+
[data-ui-auth-layout] {
|
|
436
|
+
display: flex;
|
|
437
|
+
flex-direction: column;
|
|
438
|
+
justify-content: center;
|
|
439
|
+
min-height: 100dvh;
|
|
440
|
+
width: 100%;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
[data-ui-auth-card] {
|
|
444
|
+
flex-shrink: 0;
|
|
445
|
+
display: block;
|
|
446
|
+
width: calc(100% - 32px);
|
|
447
|
+
max-width: 28rem;
|
|
448
|
+
margin: 16px auto;
|
|
449
|
+
border: 1px solid var(--border);
|
|
450
|
+
border-radius: min(16px,calc(var(--radius)*1.6));
|
|
451
|
+
overflow: hidden
|
|
452
|
+
}
|
|
453
|
+
[data-ui-auth-brand-strip] {
|
|
454
|
+
display: flex;
|
|
455
|
+
align-items: center;
|
|
456
|
+
justify-content: center;
|
|
457
|
+
height: 64px;
|
|
458
|
+
padding: 16px;
|
|
459
|
+
background: var(--card);
|
|
460
|
+
color: var(--foreground)
|
|
461
|
+
}
|
|
462
|
+
[data-ui-auth-form] {
|
|
463
|
+
min-width: 0;
|
|
464
|
+
padding: 24px
|
|
465
|
+
}
|
|
466
|
+
[data-ui-auth-card] h1 {
|
|
467
|
+
font-size: 24px;
|
|
468
|
+
line-height: 1.3
|
|
469
|
+
}
|
|
470
|
+
@media(min-width:1024px) {
|
|
471
|
+
[data-ui-auth-card] {
|
|
472
|
+
display: grid;
|
|
473
|
+
max-width: 1000px;
|
|
474
|
+
grid-template-columns: minmax(0,1fr) minmax(0,.65fr)
|
|
475
|
+
}
|
|
476
|
+
[data-ui-auth-brand-strip] {
|
|
477
|
+
display: none
|
|
478
|
+
}
|
|
479
|
+
[data-ui-auth-form] {
|
|
480
|
+
padding: 32px
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
@media(max-width:767px) {
|
|
484
|
+
[data-ui-auth-card] h1 {
|
|
485
|
+
font-size: 20px
|
|
486
|
+
}
|
|
487
|
+
}
|