@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.
Files changed (51) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +13 -13
  3. package/icons.json +170 -170
  4. package/package.json +71 -71
  5. package/src/api/client.ts +139 -139
  6. package/src/components/ConfirmIdentityModal.tsx +82 -82
  7. package/src/components/ConfirmModal.tsx +83 -83
  8. package/src/components/CopyButton.tsx +71 -71
  9. package/src/components/CredentialSection.tsx +270 -270
  10. package/src/components/ErrorBoundary.tsx +47 -47
  11. package/src/components/ModalShell.tsx +160 -160
  12. package/src/components/ResetTwoFactorModal.tsx +74 -74
  13. package/src/components/SidePanel.tsx +96 -96
  14. package/src/components/SingleSignOnModal.tsx +161 -161
  15. package/src/components/SsoConfirmation.tsx +96 -96
  16. package/src/components/VaultTypePicker.tsx +131 -131
  17. package/src/components/WhatsNew.tsx +84 -84
  18. package/src/components/formParts.tsx +59 -59
  19. package/src/components/ui/Alert.tsx +45 -45
  20. package/src/components/ui/DataTable.tsx +225 -225
  21. package/src/components/ui/Field.tsx +63 -63
  22. package/src/components/ui/PageHeader.tsx +36 -36
  23. package/src/components/ui/Pagination.tsx +37 -37
  24. package/src/components/ui/QuickStartPanel.tsx +57 -57
  25. package/src/components/ui/StateViews.tsx +135 -135
  26. package/src/components/ui/Switch.tsx +65 -65
  27. package/src/components/ui/Toast.tsx +104 -104
  28. package/src/components/ui/index.ts +9 -9
  29. package/src/config.ts +46 -46
  30. package/src/hooks/useDarkMode.ts +38 -38
  31. package/src/hooks/useDebouncedValue.ts +22 -22
  32. package/src/index.ts +42 -42
  33. package/src/lib/changelog.ts +93 -93
  34. package/src/lib/dateFormat.ts +90 -90
  35. package/src/navigation.ts +6 -6
  36. package/src/pages/ApiTokens.tsx +361 -361
  37. package/src/pages/AuditLog.tsx +388 -388
  38. package/src/pages/Backups.tsx +170 -170
  39. package/src/pages/ChangePassword.tsx +84 -84
  40. package/src/pages/Login.tsx +275 -275
  41. package/src/pages/Settings.tsx +264 -264
  42. package/src/pages/Setup.tsx +438 -438
  43. package/src/pages/SsoConfirm.tsx +26 -26
  44. package/src/pages/SsoTestResult.tsx +104 -104
  45. package/src/pages/Users.tsx +426 -426
  46. package/src/pages/Vault.tsx +1036 -1036
  47. package/src/shell/AdminShell.tsx +256 -256
  48. package/src/shell/guards.tsx +88 -88
  49. package/styles/base.css +521 -521
  50. package/styles/icons.css +4 -4
  51. package/tailwind-preset.js +79 -79
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 BetterStatusPage contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BetterStatusPage contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # @better-forge/ui
2
-
3
- The interface the Better products share: React components, the API client, hooks and the look.
4
-
5
- - **Components and helpers**: `Modal`, `ConfirmModal`, `CopyButton`, `SidePanelFrame`, the form and state components (`Alert`, `Field`, `Switch`, `Toast`, ...), `useDarkMode`, `useDebouncedValue`, date formatting and the changelog parser.
6
- - **API client** (`api`): cookie session, CSRF header, typed errors.
7
- - **Look**: `@better-forge/ui/styles.css` (the Material 3 colour tokens for light and dark, base styles, buttons, inputs, the navigation, bundled fonts) and `@better-forge/ui/tailwind-preset` (colours backed by those variables, type faces). An application imports the stylesheet first in its own CSS (`@import '@better-forge/ui/styles.css';`), uses the preset in its Tailwind config and adds `packages/ui/src` to Tailwind's `content`.
8
- - **`configureUi({ storagePrefix, apiBase, csrfCookie, basePath, redirectAfterSignIn })`** tells the interface what application it is part of: what it keeps in the browser, where the API answers and where the sign-in page is. Call it before anything is rendered.
9
-
10
- - **Pages**: sign-in and first-run setup, change password, settings, users, API tokens, audit log, vault, backups and the SSO test result. What is the product's comes in as props (roles, the API's permissions, audit entity names, the sign-in copy) or as `texts` and `brand` of `configureUi`.
11
- - **Shell**: `createAdminShell(config)` is the signed-in layout (sidebar and drawer, role-filtered sections, footer links, what's new).
12
-
13
- Depends on `@better-forge/contracts`; React 19, `react-dom`, `react-router-dom`, `@tanstack/react-query` and `clsx` are peer dependencies.
1
+ # @better-forge/ui
2
+
3
+ The interface the Better products share: React components, the API client, hooks and the look.
4
+
5
+ - **Components and helpers**: `Modal`, `ConfirmModal`, `CopyButton`, `SidePanelFrame`, the form and state components (`Alert`, `Field`, `Switch`, `Toast`, ...), `useDarkMode`, `useDebouncedValue`, date formatting and the changelog parser.
6
+ - **API client** (`api`): cookie session, CSRF header, typed errors.
7
+ - **Look**: `@better-forge/ui/styles.css` (the Material 3 colour tokens for light and dark, base styles, buttons, inputs, the navigation, bundled fonts) and `@better-forge/ui/tailwind-preset` (colours backed by those variables, type faces). An application imports the stylesheet first in its own CSS (`@import '@better-forge/ui/styles.css';`), uses the preset in its Tailwind config and adds `packages/ui/src` to Tailwind's `content`.
8
+ - **`configureUi({ storagePrefix, apiBase, csrfCookie, basePath, redirectAfterSignIn })`** tells the interface what application it is part of: what it keeps in the browser, where the API answers and where the sign-in page is. Call it before anything is rendered.
9
+
10
+ - **Pages**: sign-in and first-run setup, change password, settings, users, API tokens, audit log, vault, backups and the SSO test result. What is the product's comes in as props (roles, the API's permissions, audit entity names, the sign-in copy) or as `texts` and `brand` of `configureUi`.
11
+ - **Shell**: `createAdminShell(config)` is the signed-in layout (sidebar and drawer, role-filtered sections, footer links, what's new).
12
+
13
+ Depends on `@better-forge/contracts`; React 19, `react-dom`, `react-router-dom`, `@tanstack/react-query` and `clsx` are peer dependencies.
package/icons.json CHANGED
@@ -1,170 +1,170 @@
1
- [
2
- "accessible",
3
- "add",
4
- "add_link",
5
- "animation",
6
- "api",
7
- "archive",
8
- "article",
9
- "backup",
10
- "badge",
11
- "block",
12
- "box",
13
- "call",
14
- "cancel",
15
- "celebration",
16
- "check",
17
- "check_circle",
18
- "circle",
19
- "class",
20
- "clear",
21
- "close",
22
- "cloud",
23
- "cloud_off",
24
- "code",
25
- "colors",
26
- "compare",
27
- "content_copy",
28
- "cookie",
29
- "create",
30
- "cut",
31
- "dark_mode",
32
- "data_object",
33
- "database",
34
- "delete",
35
- "description",
36
- "details",
37
- "dialogs",
38
- "docs",
39
- "done",
40
- "download",
41
- "dropdown",
42
- "email",
43
- "enable",
44
- "error",
45
- "event",
46
- "expand",
47
- "expand_more",
48
- "explicit",
49
- "feedback",
50
- "files",
51
- "filter",
52
- "function",
53
- "gradient",
54
- "group",
55
- "groups",
56
- "height",
57
- "help",
58
- "hide",
59
- "history",
60
- "home",
61
- "host",
62
- "html",
63
- "http",
64
- "https",
65
- "inbox",
66
- "info",
67
- "input",
68
- "join",
69
- "keep",
70
- "key",
71
- "key_off",
72
- "label",
73
- "light_mode",
74
- "link",
75
- "list",
76
- "lists",
77
- "lock",
78
- "lock_reset",
79
- "login",
80
- "logout",
81
- "mail",
82
- "manage_accounts",
83
- "map",
84
- "markdown",
85
- "menu",
86
- "message",
87
- "mobile",
88
- "mode",
89
- "more",
90
- "moving",
91
- "navigation",
92
- "network_check",
93
- "no_encryption",
94
- "note",
95
- "notes",
96
- "opacity",
97
- "pace",
98
- "package",
99
- "padding",
100
- "pages",
101
- "passkey",
102
- "password",
103
- "pending",
104
- "person",
105
- "person_add",
106
- "phone",
107
- "place",
108
- "post",
109
- "progress_activity",
110
- "public",
111
- "radio_button_checked",
112
- "refresh",
113
- "remove",
114
- "repeat",
115
- "resize",
116
- "restore",
117
- "router",
118
- "save",
119
- "scan",
120
- "schedule",
121
- "script",
122
- "search",
123
- "security",
124
- "select",
125
- "send",
126
- "settings",
127
- "shadow",
128
- "share",
129
- "shield_lock",
130
- "shift",
131
- "sort",
132
- "source",
133
- "stack",
134
- "start",
135
- "step",
136
- "steps",
137
- "stop",
138
- "storage",
139
- "store",
140
- "style",
141
- "summarize",
142
- "switch",
143
- "tab",
144
- "table",
145
- "tabs",
146
- "target",
147
- "timer",
148
- "title",
149
- "toast",
150
- "token",
151
- "toolbar",
152
- "transform",
153
- "translate",
154
- "trip",
155
- "try",
156
- "tune",
157
- "unfold_more",
158
- "update",
159
- "upload",
160
- "uppercase",
161
- "variables",
162
- "verified",
163
- "visibility",
164
- "visibility_off",
165
- "vpn_key",
166
- "warning",
167
- "width",
168
- "window",
169
- "work"
170
- ]
1
+ [
2
+ "accessible",
3
+ "add",
4
+ "add_link",
5
+ "animation",
6
+ "api",
7
+ "archive",
8
+ "article",
9
+ "backup",
10
+ "badge",
11
+ "block",
12
+ "box",
13
+ "call",
14
+ "cancel",
15
+ "celebration",
16
+ "check",
17
+ "check_circle",
18
+ "circle",
19
+ "class",
20
+ "clear",
21
+ "close",
22
+ "cloud",
23
+ "cloud_off",
24
+ "code",
25
+ "colors",
26
+ "compare",
27
+ "content_copy",
28
+ "cookie",
29
+ "create",
30
+ "cut",
31
+ "dark_mode",
32
+ "data_object",
33
+ "database",
34
+ "delete",
35
+ "description",
36
+ "details",
37
+ "dialogs",
38
+ "docs",
39
+ "done",
40
+ "download",
41
+ "dropdown",
42
+ "email",
43
+ "enable",
44
+ "error",
45
+ "event",
46
+ "expand",
47
+ "expand_more",
48
+ "explicit",
49
+ "feedback",
50
+ "files",
51
+ "filter",
52
+ "function",
53
+ "gradient",
54
+ "group",
55
+ "groups",
56
+ "height",
57
+ "help",
58
+ "hide",
59
+ "history",
60
+ "home",
61
+ "host",
62
+ "html",
63
+ "http",
64
+ "https",
65
+ "inbox",
66
+ "info",
67
+ "input",
68
+ "join",
69
+ "keep",
70
+ "key",
71
+ "key_off",
72
+ "label",
73
+ "light_mode",
74
+ "link",
75
+ "list",
76
+ "lists",
77
+ "lock",
78
+ "lock_reset",
79
+ "login",
80
+ "logout",
81
+ "mail",
82
+ "manage_accounts",
83
+ "map",
84
+ "markdown",
85
+ "menu",
86
+ "message",
87
+ "mobile",
88
+ "mode",
89
+ "more",
90
+ "moving",
91
+ "navigation",
92
+ "network_check",
93
+ "no_encryption",
94
+ "note",
95
+ "notes",
96
+ "opacity",
97
+ "pace",
98
+ "package",
99
+ "padding",
100
+ "pages",
101
+ "passkey",
102
+ "password",
103
+ "pending",
104
+ "person",
105
+ "person_add",
106
+ "phone",
107
+ "place",
108
+ "post",
109
+ "progress_activity",
110
+ "public",
111
+ "radio_button_checked",
112
+ "refresh",
113
+ "remove",
114
+ "repeat",
115
+ "resize",
116
+ "restore",
117
+ "router",
118
+ "save",
119
+ "scan",
120
+ "schedule",
121
+ "script",
122
+ "search",
123
+ "security",
124
+ "select",
125
+ "send",
126
+ "settings",
127
+ "shadow",
128
+ "share",
129
+ "shield_lock",
130
+ "shift",
131
+ "sort",
132
+ "source",
133
+ "stack",
134
+ "start",
135
+ "step",
136
+ "steps",
137
+ "stop",
138
+ "storage",
139
+ "store",
140
+ "style",
141
+ "summarize",
142
+ "switch",
143
+ "tab",
144
+ "table",
145
+ "tabs",
146
+ "target",
147
+ "timer",
148
+ "title",
149
+ "toast",
150
+ "token",
151
+ "toolbar",
152
+ "transform",
153
+ "translate",
154
+ "trip",
155
+ "try",
156
+ "tune",
157
+ "unfold_more",
158
+ "update",
159
+ "upload",
160
+ "uppercase",
161
+ "variables",
162
+ "verified",
163
+ "visibility",
164
+ "visibility_off",
165
+ "vpn_key",
166
+ "warning",
167
+ "width",
168
+ "window",
169
+ "work"
170
+ ]
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
- {
2
- "name": "@better-forge/ui",
3
- "version": "0.1.0",
4
- "description": "React admin shell, UI components, API client and shared pages.",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/BElluu/Better-Forge.git",
9
- "directory": "packages/ui"
10
- },
11
- "homepage": "https://github.com/BElluu/Better-Forge/tree/main/packages/ui#readme",
12
- "bugs": {
13
- "url": "https://github.com/BElluu/Better-Forge/issues"
14
- },
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
- "type": "module",
19
- "main": "./dist/index.js",
20
- "types": "./dist/index.d.ts",
21
- "exports": {
22
- ".": {
23
- "types": "./dist/index.d.ts",
24
- "import": "./dist/index.js"
25
- },
26
- "./styles.css": "./styles/base.css",
27
- "./icons.css": "./styles/icons.css",
28
- "./icons.json": "./icons.json",
29
- "./tailwind-preset": "./tailwind-preset.js",
30
- "./package.json": "./package.json"
31
- },
32
- "files": [
33
- "dist",
34
- "src",
35
- "!src/**/*.test.*",
36
- "!src/testing",
37
- "styles",
38
- "tailwind-preset.js",
39
- "icons.json"
40
- ],
41
- "scripts": {
42
- "build": "tsc -p tsconfig.json",
43
- "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput"
44
- },
45
- "peerDependencies": {
46
- "react": "^19.0.0",
47
- "react-dom": "^19.0.0",
48
- "clsx": "^2.1.1",
49
- "react-router-dom": "^7.5.0",
50
- "@tanstack/react-query": "^5.74.4"
51
- },
52
- "devDependencies": {
53
- "typescript": "^5.7.3",
54
- "@types/react": "^19.0.10",
55
- "@types/react-dom": "^19.0.4",
56
- "clsx": "^2.1.1",
57
- "react": "^19.0.0",
58
- "react-dom": "^19.0.0",
59
- "react-router-dom": "^7.5.0",
60
- "@tanstack/react-query": "^5.74.4"
61
- },
62
- "sideEffects": [
63
- "*.css"
64
- ],
65
- "dependencies": {
66
- "@better-forge/contracts": "0.1.0"
67
- },
68
- "engines": {
69
- "node": ">=26.10.0"
70
- }
71
- }
1
+ {
2
+ "name": "@better-forge/ui",
3
+ "version": "0.1.1",
4
+ "description": "React admin shell, UI components, API client and shared pages.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/BElluu/Better-Forge.git",
9
+ "directory": "packages/ui"
10
+ },
11
+ "homepage": "https://github.com/BElluu/Better-Forge/tree/main/packages/ui#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/BElluu/Better-Forge/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "type": "module",
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ },
26
+ "./styles.css": "./styles/base.css",
27
+ "./icons.css": "./styles/icons.css",
28
+ "./icons.json": "./icons.json",
29
+ "./tailwind-preset": "./tailwind-preset.js",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "src",
35
+ "!src/**/*.test.*",
36
+ "!src/testing",
37
+ "styles",
38
+ "tailwind-preset.js",
39
+ "icons.json"
40
+ ],
41
+ "scripts": {
42
+ "build": "tsc -p tsconfig.json",
43
+ "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput"
44
+ },
45
+ "peerDependencies": {
46
+ "react": "^19.0.0",
47
+ "react-dom": "^19.0.0",
48
+ "clsx": "^2.1.1",
49
+ "react-router-dom": "^7.5.0",
50
+ "@tanstack/react-query": "^5.74.4"
51
+ },
52
+ "devDependencies": {
53
+ "typescript": "^5.7.3",
54
+ "@types/react": "^19.0.10",
55
+ "@types/react-dom": "^19.0.4",
56
+ "clsx": "^2.1.1",
57
+ "react": "^19.0.0",
58
+ "react-dom": "^19.0.0",
59
+ "react-router-dom": "^7.5.0",
60
+ "@tanstack/react-query": "^5.74.4"
61
+ },
62
+ "sideEffects": [
63
+ "*.css"
64
+ ],
65
+ "dependencies": {
66
+ "@better-forge/contracts": "0.1.1"
67
+ },
68
+ "engines": {
69
+ "node": ">=26.10.0"
70
+ }
71
+ }