@better-forge/ui 0.1.0 → 0.1.1
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/LICENSE +21 -21
- package/README.md +13 -13
- package/icons.json +170 -170
- package/package.json +71 -71
- package/src/api/client.ts +139 -139
- package/src/components/ConfirmIdentityModal.tsx +82 -82
- package/src/components/ConfirmModal.tsx +83 -83
- package/src/components/CopyButton.tsx +71 -71
- package/src/components/CredentialSection.tsx +270 -270
- package/src/components/ErrorBoundary.tsx +47 -47
- package/src/components/ModalShell.tsx +160 -160
- package/src/components/ResetTwoFactorModal.tsx +74 -74
- package/src/components/SidePanel.tsx +96 -96
- package/src/components/SingleSignOnModal.tsx +161 -161
- package/src/components/SsoConfirmation.tsx +96 -96
- package/src/components/VaultTypePicker.tsx +131 -131
- package/src/components/WhatsNew.tsx +84 -84
- package/src/components/formParts.tsx +59 -59
- package/src/components/ui/Alert.tsx +45 -45
- package/src/components/ui/DataTable.tsx +225 -225
- package/src/components/ui/Field.tsx +63 -63
- package/src/components/ui/PageHeader.tsx +36 -36
- package/src/components/ui/Pagination.tsx +37 -37
- package/src/components/ui/QuickStartPanel.tsx +57 -57
- package/src/components/ui/StateViews.tsx +135 -135
- package/src/components/ui/Switch.tsx +65 -65
- package/src/components/ui/Toast.tsx +104 -104
- package/src/components/ui/index.ts +9 -9
- package/src/config.ts +46 -46
- package/src/hooks/useDarkMode.ts +38 -38
- package/src/hooks/useDebouncedValue.ts +22 -22
- package/src/index.ts +42 -42
- package/src/lib/changelog.ts +93 -93
- package/src/lib/dateFormat.ts +90 -90
- package/src/navigation.ts +6 -6
- package/src/pages/ApiTokens.tsx +361 -361
- package/src/pages/AuditLog.tsx +388 -388
- package/src/pages/Backups.tsx +170 -170
- package/src/pages/ChangePassword.tsx +84 -84
- package/src/pages/Login.tsx +275 -275
- package/src/pages/Settings.tsx +264 -264
- package/src/pages/Setup.tsx +438 -438
- package/src/pages/SsoConfirm.tsx +26 -26
- package/src/pages/SsoTestResult.tsx +104 -104
- package/src/pages/Users.tsx +426 -426
- package/src/pages/Vault.tsx +1036 -1036
- package/src/shell/AdminShell.tsx +256 -256
- package/src/shell/guards.tsx +88 -88
- package/styles/base.css +521 -521
- package/styles/icons.css +4 -4
- package/tailwind-preset.js +79 -79
package/styles/icons.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* The Material Symbols font cut down to the icons the shared interface (and the template) use. A product that draws
|
|
2
|
-
icons of its own builds a font that also holds the names listed in `@better-forge/ui/icons.json` and declares it
|
|
3
|
-
instead of importing this file. */
|
|
4
|
-
@font-face { font-family: 'Material Symbols Outlined'; font-style: normal; font-weight: 400; font-display: block; src: url('./fonts/material-symbols-outlined-fill.woff2') format('woff2'); }
|
|
1
|
+
/* The Material Symbols font cut down to the icons the shared interface (and the template) use. A product that draws
|
|
2
|
+
icons of its own builds a font that also holds the names listed in `@better-forge/ui/icons.json` and declares it
|
|
3
|
+
instead of importing this file. */
|
|
4
|
+
@font-face { font-family: 'Material Symbols Outlined'; font-style: normal; font-weight: 400; font-display: block; src: url('./fonts/material-symbols-outlined-fill.woff2') format('woff2'); }
|
package/tailwind-preset.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The look of the Better interfaces as a Tailwind preset: colours are CSS variables (so branding and dark mode can swap
|
|
3
|
-
* them at runtime), the type faces and the entrance animation. Wrapping each colour in color-mix with Tailwind's
|
|
4
|
-
* <alpha-value> placeholder keeps opacity modifiers such as `bg-primary/10` working; without a modifier the mix is
|
|
5
|
-
* 100% and renders the variable unchanged.
|
|
6
|
-
*/
|
|
7
|
-
import { fileURLToPath, URL } from 'node:url'
|
|
8
|
-
|
|
9
|
-
const token = (name) => `color-mix(in srgb, var(${name}) calc(<alpha-value> * 100%), transparent)`
|
|
10
|
-
|
|
11
|
-
/** @type {import('tailwindcss').Config} */
|
|
12
|
-
export default {
|
|
13
|
-
darkMode: 'class',
|
|
14
|
-
theme: {
|
|
15
|
-
extend: {
|
|
16
|
-
colors: {
|
|
17
|
-
// Branding aliases (runtime overrideable)
|
|
18
|
-
primary: token('--color-primary'),
|
|
19
|
-
accent: token('--color-accent'),
|
|
20
|
-
// M3 surface tokens (CSS-var backed → respond to dark mode)
|
|
21
|
-
surface: token('--m3-surface'),
|
|
22
|
-
'surface-dim': token('--m3-surface-dim'),
|
|
23
|
-
'surface-bright': token('--m3-surface-bright'),
|
|
24
|
-
'surface-container-lowest': token('--m3-surface-container-lowest'),
|
|
25
|
-
'surface-container-low': token('--m3-surface-container-low'),
|
|
26
|
-
'surface-container': token('--m3-surface-container'),
|
|
27
|
-
'surface-container-high': token('--m3-surface-container-high'),
|
|
28
|
-
'surface-container-highest': token('--m3-surface-container-highest'),
|
|
29
|
-
// M3 on-surface tokens
|
|
30
|
-
'on-surface': token('--m3-on-surface'),
|
|
31
|
-
'on-surface-variant': token('--m3-on-surface-variant'),
|
|
32
|
-
// M3 misc
|
|
33
|
-
secondary: token('--m3-secondary'),
|
|
34
|
-
outline: token('--m3-outline'),
|
|
35
|
-
'outline-variant': token('--m3-outline-variant'),
|
|
36
|
-
'on-primary': token('--m3-on-primary'),
|
|
37
|
-
'on-primary-container': token('--m3-on-primary-container'),
|
|
38
|
-
'primary-fixed': token('--m3-primary-fixed'),
|
|
39
|
-
'primary-container': token('--m3-primary-container'),
|
|
40
|
-
'surface-tint': token('--m3-surface-tint'),
|
|
41
|
-
'secondary-container': token('--m3-secondary-container'),
|
|
42
|
-
'on-secondary-container': token('--m3-on-secondary-container'),
|
|
43
|
-
'secondary-fixed': token('--m3-secondary-fixed'),
|
|
44
|
-
error: token('--m3-error'),
|
|
45
|
-
'error-container': token('--m3-error-container'),
|
|
46
|
-
'on-error-container': token('--m3-on-error-container'),
|
|
47
|
-
// Status colors
|
|
48
|
-
'status-up': token('--m3-up'),
|
|
49
|
-
'status-down': token('--m3-down'),
|
|
50
|
-
'status-degraded': token('--m3-degraded'),
|
|
51
|
-
'status-partial': token('--m3-partial'),
|
|
52
|
-
},
|
|
53
|
-
fontFamily: {
|
|
54
|
-
headline: ['Manrope', 'system-ui', 'sans-serif'],
|
|
55
|
-
display: ['Manrope', 'system-ui', 'sans-serif'],
|
|
56
|
-
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
57
|
-
// Small uppercase eyebrow labels (Dashboard, Setup); same face as body text.
|
|
58
|
-
label: ['Inter', 'system-ui', 'sans-serif'],
|
|
59
|
-
mono: ['JetBrains Mono', 'Menlo', 'monospace'],
|
|
60
|
-
},
|
|
61
|
-
animation: {
|
|
62
|
-
'fade-up': 'fadeUp 0.45s ease forwards',
|
|
63
|
-
},
|
|
64
|
-
keyframes: {
|
|
65
|
-
fadeUp: {
|
|
66
|
-
'0%': { opacity: '0', transform: 'translateY(12px)' },
|
|
67
|
-
'100%': { opacity: '1', transform: 'translateY(0)' },
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
borderRadius: {
|
|
71
|
-
'3xl': '1.5rem',
|
|
72
|
-
'4xl': '2rem',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Where the classes of the shared components are written, to add to a product's `content`. */
|
|
79
|
-
export const uiContent = `${fileURLToPath(new URL('./dist', import.meta.url)).replaceAll('\\', '/')}/**/*.js`
|
|
1
|
+
/**
|
|
2
|
+
* The look of the Better interfaces as a Tailwind preset: colours are CSS variables (so branding and dark mode can swap
|
|
3
|
+
* them at runtime), the type faces and the entrance animation. Wrapping each colour in color-mix with Tailwind's
|
|
4
|
+
* <alpha-value> placeholder keeps opacity modifiers such as `bg-primary/10` working; without a modifier the mix is
|
|
5
|
+
* 100% and renders the variable unchanged.
|
|
6
|
+
*/
|
|
7
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
8
|
+
|
|
9
|
+
const token = (name) => `color-mix(in srgb, var(${name}) calc(<alpha-value> * 100%), transparent)`
|
|
10
|
+
|
|
11
|
+
/** @type {import('tailwindcss').Config} */
|
|
12
|
+
export default {
|
|
13
|
+
darkMode: 'class',
|
|
14
|
+
theme: {
|
|
15
|
+
extend: {
|
|
16
|
+
colors: {
|
|
17
|
+
// Branding aliases (runtime overrideable)
|
|
18
|
+
primary: token('--color-primary'),
|
|
19
|
+
accent: token('--color-accent'),
|
|
20
|
+
// M3 surface tokens (CSS-var backed → respond to dark mode)
|
|
21
|
+
surface: token('--m3-surface'),
|
|
22
|
+
'surface-dim': token('--m3-surface-dim'),
|
|
23
|
+
'surface-bright': token('--m3-surface-bright'),
|
|
24
|
+
'surface-container-lowest': token('--m3-surface-container-lowest'),
|
|
25
|
+
'surface-container-low': token('--m3-surface-container-low'),
|
|
26
|
+
'surface-container': token('--m3-surface-container'),
|
|
27
|
+
'surface-container-high': token('--m3-surface-container-high'),
|
|
28
|
+
'surface-container-highest': token('--m3-surface-container-highest'),
|
|
29
|
+
// M3 on-surface tokens
|
|
30
|
+
'on-surface': token('--m3-on-surface'),
|
|
31
|
+
'on-surface-variant': token('--m3-on-surface-variant'),
|
|
32
|
+
// M3 misc
|
|
33
|
+
secondary: token('--m3-secondary'),
|
|
34
|
+
outline: token('--m3-outline'),
|
|
35
|
+
'outline-variant': token('--m3-outline-variant'),
|
|
36
|
+
'on-primary': token('--m3-on-primary'),
|
|
37
|
+
'on-primary-container': token('--m3-on-primary-container'),
|
|
38
|
+
'primary-fixed': token('--m3-primary-fixed'),
|
|
39
|
+
'primary-container': token('--m3-primary-container'),
|
|
40
|
+
'surface-tint': token('--m3-surface-tint'),
|
|
41
|
+
'secondary-container': token('--m3-secondary-container'),
|
|
42
|
+
'on-secondary-container': token('--m3-on-secondary-container'),
|
|
43
|
+
'secondary-fixed': token('--m3-secondary-fixed'),
|
|
44
|
+
error: token('--m3-error'),
|
|
45
|
+
'error-container': token('--m3-error-container'),
|
|
46
|
+
'on-error-container': token('--m3-on-error-container'),
|
|
47
|
+
// Status colors
|
|
48
|
+
'status-up': token('--m3-up'),
|
|
49
|
+
'status-down': token('--m3-down'),
|
|
50
|
+
'status-degraded': token('--m3-degraded'),
|
|
51
|
+
'status-partial': token('--m3-partial'),
|
|
52
|
+
},
|
|
53
|
+
fontFamily: {
|
|
54
|
+
headline: ['Manrope', 'system-ui', 'sans-serif'],
|
|
55
|
+
display: ['Manrope', 'system-ui', 'sans-serif'],
|
|
56
|
+
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
57
|
+
// Small uppercase eyebrow labels (Dashboard, Setup); same face as body text.
|
|
58
|
+
label: ['Inter', 'system-ui', 'sans-serif'],
|
|
59
|
+
mono: ['JetBrains Mono', 'Menlo', 'monospace'],
|
|
60
|
+
},
|
|
61
|
+
animation: {
|
|
62
|
+
'fade-up': 'fadeUp 0.45s ease forwards',
|
|
63
|
+
},
|
|
64
|
+
keyframes: {
|
|
65
|
+
fadeUp: {
|
|
66
|
+
'0%': { opacity: '0', transform: 'translateY(12px)' },
|
|
67
|
+
'100%': { opacity: '1', transform: 'translateY(0)' },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
borderRadius: {
|
|
71
|
+
'3xl': '1.5rem',
|
|
72
|
+
'4xl': '2rem',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Where the classes of the shared components are written, to add to a product's `content`. */
|
|
79
|
+
export const uiContent = `${fileURLToPath(new URL('./dist', import.meta.url)).replaceAll('\\', '/')}/**/*.js`
|