@alepha/ui 0.25.1 → 0.25.2

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 (74) hide show
  1. package/package.json +3 -3
  2. package/src/components/account/__tests__/account-router.spec.ts +201 -0
  3. package/src/components/account/account-connections.tsx +103 -0
  4. package/src/components/account/account-delete-dialog.tsx +184 -0
  5. package/src/components/account/account-header.tsx +57 -0
  6. package/src/components/account/account-keys.tsx +221 -0
  7. package/src/components/account/account-layout.tsx +63 -0
  8. package/src/components/account/account-password-dialog.tsx +152 -0
  9. package/src/components/account/account-profile.tsx +229 -0
  10. package/src/components/account/account-router-options.tsx +74 -0
  11. package/src/components/account/account-router-page.tsx +69 -0
  12. package/src/components/account/account-router.tsx +214 -0
  13. package/src/components/account/account-security.tsx +150 -0
  14. package/src/components/account/account-sessions.tsx +140 -0
  15. package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +62 -0
  16. package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +82 -0
  17. package/src/components/admin/__tests__/admin-router-page.spec.ts +54 -0
  18. package/src/components/admin/__tests__/admin-router.spec.ts +208 -0
  19. package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +99 -0
  20. package/src/components/admin/__tests__/admin-user-detail.spec.ts +29 -0
  21. package/src/components/admin/admin-analytics-query-panel.tsx +149 -0
  22. package/src/components/admin/admin-analytics-results.tsx +95 -0
  23. package/src/components/admin/admin-analytics.tsx +104 -0
  24. package/src/components/admin/admin-audits.tsx +12 -15
  25. package/src/components/admin/admin-files.tsx +10 -18
  26. package/src/components/admin/admin-jobs-executions-panel.tsx +2 -1
  27. package/src/components/admin/admin-jobs.tsx +3 -1
  28. package/src/components/admin/admin-keys-token-dialog.tsx +123 -0
  29. package/src/components/admin/admin-keys.tsx +54 -3
  30. package/src/components/admin/admin-layout.tsx +107 -0
  31. package/src/components/admin/admin-payments.tsx +4 -5
  32. package/src/components/admin/admin-router-options.tsx +130 -0
  33. package/src/components/admin/admin-router-page.tsx +74 -0
  34. package/src/components/admin/admin-router.tsx +379 -0
  35. package/src/components/admin/admin-sessions.tsx +2 -16
  36. package/src/components/admin/admin-user-cell.tsx +70 -0
  37. package/src/components/admin/admin-user-detail-overview-tab.tsx +28 -0
  38. package/src/components/admin/admin-user-detail-profile-policy.spec.ts +146 -0
  39. package/src/components/admin/admin-user-detail-profile-policy.ts +147 -0
  40. package/src/components/admin/admin-user-detail-security-tab.tsx +1 -1
  41. package/src/components/admin/admin-user-detail.tsx +76 -32
  42. package/src/components/admin/admin-users-status-filter.tsx +2 -0
  43. package/src/components/admin/admin-workflows-execution-sheet.tsx +277 -0
  44. package/src/components/admin/admin-workflows-executions-panel.tsx +170 -0
  45. package/src/components/admin/admin-workflows-status-badge.tsx +40 -0
  46. package/src/components/admin/admin-workflows.tsx +207 -0
  47. package/src/components/alepha-table/alepha-table.tsx +73 -17
  48. package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +79 -0
  49. package/src/components/app-actions/app-actions.tsx +113 -0
  50. package/src/components/app-shell/app-shell.tsx +122 -0
  51. package/src/components/auth/auth-reset-password.tsx +81 -8
  52. package/src/components/button-user/button-user.tsx +58 -1
  53. package/src/components/control/control.tsx +14 -71
  54. package/src/components/control-password/control-password.tsx +87 -0
  55. package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +101 -0
  56. package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +142 -0
  57. package/src/components/control-select/control-select.tsx +78 -111
  58. package/src/components/control-upload/control-upload.tsx +27 -1
  59. package/src/components/markdown-view/markdown-view.tsx +6 -0
  60. package/src/components/nav-shell/nav-page.tsx +3 -3
  61. package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +123 -0
  62. package/src/components/settings/__tests__/settings-section.browser.spec.tsx +130 -0
  63. package/src/components/settings/settings-danger-section.tsx +59 -0
  64. package/src/components/settings/settings-layout.tsx +56 -0
  65. package/src/components/settings/settings-nav.tsx +131 -0
  66. package/src/components/settings/settings-row.tsx +81 -0
  67. package/src/components/settings/settings-section.tsx +64 -0
  68. package/src/components/ui/dropdown-menu.tsx +9 -1
  69. package/src/lib/__tests__/rehype-safe-img.spec.ts +121 -0
  70. package/src/lib/i18n-fr.ts +68 -0
  71. package/src/lib/rehype-safe-img.ts +150 -0
  72. package/src/lib/resize-image.ts +135 -0
  73. package/src/styles.css +126 -1
  74. /package/src/components/{admin/admin-user-detail-provider-labels.ts → auth/provider-labels.ts} +0 -0
package/src/styles.css CHANGED
@@ -24,6 +24,7 @@
24
24
  --color-accent: var(--accent);
25
25
  --color-accent-foreground: var(--accent-foreground);
26
26
  --color-destructive: var(--destructive);
27
+ --color-destructive-foreground: var(--destructive-foreground);
27
28
  --color-border: var(--border);
28
29
  --color-input: var(--input);
29
30
  --color-ring: var(--ring);
@@ -66,6 +67,7 @@
66
67
  --accent: oklch(0.97 0 0);
67
68
  --accent-foreground: oklch(0.205 0 0);
68
69
  --destructive: oklch(0.577 0.245 27.325);
70
+ --destructive-foreground: oklch(0.985 0 0);
69
71
  --border: oklch(0.922 0 0);
70
72
  --input: oklch(0.922 0 0);
71
73
  --ring: oklch(0.708 0 0);
@@ -100,6 +102,7 @@
100
102
  --accent: oklch(0.269 0 0);
101
103
  --accent-foreground: oklch(0.985 0 0);
102
104
  --destructive: oklch(0.704 0.191 22.216);
105
+ --destructive-foreground: oklch(0.985 0 0);
103
106
  --border: oklch(1 0 0 / 10%);
104
107
  --input: oklch(1 0 0 / 15%);
105
108
  --ring: oklch(0.556 0 0);
@@ -112,7 +115,7 @@
112
115
  --sidebar-foreground: oklch(0.985 0 0);
113
116
  --sidebar-primary: oklch(0.488 0.243 264.376);
114
117
  --sidebar-primary-foreground: oklch(0.985 0 0);
115
- --sidebar-accent: oklch(0.269 0 0);
118
+ --sidebar-accent: oklch(0.308 0 0);
116
119
  --sidebar-accent-foreground: oklch(0.985 0 0);
117
120
  --sidebar-border: oklch(1 0 0 / 10%);
118
121
  --sidebar-ring: oklch(0.556 0 0);
@@ -127,3 +130,125 @@
127
130
  @apply bg-background text-foreground;
128
131
  }
129
132
  }
133
+
134
+ /* ────────────────────────────────────────────────────────────────────────
135
+ * Interaction state layer — light mode.
136
+ *
137
+ * shadcn spends ABSOLUTE colors on interaction states: `--accent`, `--muted`
138
+ * and `--sidebar-accent` are all `oklch(0.97 0 0)`, i.e. 3% off white. Dark
139
+ * mode gets a 12% step (0.145 → 0.269), which is why only light mode reads as
140
+ * broken — this whole block is scoped to light and leaves dark bit-for-bit.
141
+ *
142
+ * An absolute fill cannot track a surface that varies, so the step shrinks to
143
+ * nothing as the surface darkens: on `--sidebar` (0.985) it is 1.5%, and a
144
+ * `hover:bg-muted` child sitting on a `bg-muted` panel is a 0% step — the
145
+ * state is literally invisible. Below 0.97 it inverts and hovering BRIGHTENS.
146
+ *
147
+ * So the state fill is an ALPHA WASH rather than a color. Alpha composites
148
+ * over whatever it lands on, which turns the step into a constant ratio of the
149
+ * surface instead of a fixed color: the same weight on white, on a card, on
150
+ * the sidebar and on every Lore theme, and never lighter than its own
151
+ * background. Same idiom the stock `secondary` button variant already uses
152
+ * (`color-mix(in oklch, var(--secondary), var(--foreground) 5%)`).
153
+ *
154
+ * ⚠️ This file is the durable place for it. `src/components/ui/` is
155
+ * overwritten wholesale by `yarn w @alepha/ui sync`, so the same fix written
156
+ * into a primitive's classes would not survive the next sync. This file is not
157
+ * sync-managed.
158
+ * ──────────────────────────────────────────────────────────────────────── */
159
+
160
+ :root:not(.dark) {
161
+ --state-layer: color-mix(in oklch, var(--foreground) 10%, transparent);
162
+ --state-layer-weak: color-mix(in oklch, var(--foreground) 5%, transparent);
163
+
164
+ /* `--accent` and `--sidebar-accent` are PURE interaction tokens across this
165
+ * package and apps/lore — every single use is hover/focus/open/selected,
166
+ * never an opaque surface (verified by grep, incl. the bare `bg-accent`
167
+ * selected-state uses). So the wash goes on the token itself and reaches
168
+ * every state variant at once — hover, focus, data-open, data-highlighted,
169
+ * data-active, aria-expanded — with no selector list to keep in sync.
170
+ *
171
+ * This deliberately overrides the per-theme `--accent` values in Lore's
172
+ * main.css: those were hand-tuned per surface, which is exactly the approach
173
+ * that does not scale. Specificity (0,2,0) beats a bare `.theme-*` (0,1,0). */
174
+ --accent: var(--state-layer);
175
+ --sidebar-accent: var(--state-layer);
176
+ }
177
+
178
+ /* `--muted` is the exception: it is BOTH a state fill and an opaque surface
179
+ * (progress track, tabs list, kbd, card footer, slider). It must stay opaque,
180
+ * so its state variants are reached by selector instead of via the token.
181
+ *
182
+ * Unlayered on purpose — Tailwind's utilities live in `@layer utilities`, and
183
+ * unlayered styles beat layered ones whatever the specificity, so this wins
184
+ * without `!important` and without racing selector counts.
185
+ *
186
+ * Every match is `[class~=]`, the exact space-separated token — never
187
+ * `[class*=]`. A substring match looks equivalent and is not: it also matches
188
+ * `dark:hover:bg-muted/50`, so a ghost button rendered in LIGHT mode picked up
189
+ * the weak layer off its dark-mode class and came out at half strength. Exact
190
+ * tokens cannot do that. The cost is that the fractional list below is
191
+ * enumerated rather than wildcarded — a fraction nobody listed keeps today's
192
+ * behaviour, which is a no-op, not a wrong result. */
193
+ :root:not(.dark)
194
+ :is(
195
+ [class~="hover:bg-muted"]:hover,
196
+ [class~="focus:bg-muted"]:focus,
197
+ [class~="aria-expanded:bg-muted"][aria-expanded="true"]
198
+ ) {
199
+ background-color: var(--state-layer);
200
+ }
201
+
202
+ :root:not(.dark)
203
+ :is(
204
+ [class~="hover:bg-muted/30"]:hover,
205
+ [class~="hover:bg-muted/40"]:hover,
206
+ [class~="hover:bg-muted/50"]:hover,
207
+ [class~="hover:bg-muted/60"]:hover,
208
+ [class~="hover:bg-muted/70"]:hover,
209
+ [class~="data-open:bg-muted/50"][data-open],
210
+ [class~="data-active:bg-muted/50"][data-active],
211
+ [class~="data-popup-open:bg-muted/50"][data-popup-open],
212
+ [class~="aria-expanded:bg-muted/50"][aria-expanded="true"]
213
+ ) {
214
+ background-color: var(--state-layer-weak);
215
+ }
216
+
217
+ /* ────────────────────────────────────────────────────────────────────────
218
+ * Sidebar active item — a left bar, not a heavier fill.
219
+ *
220
+ * The state layer above deliberately gives the active item the SAME weight as
221
+ * a hovered one, because shadcn spends one token on both. That leaves two
222
+ * adjacent rows — the current page and the one under the pointer — rendering
223
+ * as a single merged shape with no way to tell them apart.
224
+ *
225
+ * The bar resolves it without touching the fill. Presence/absence of a shape
226
+ * is not a color distinction, so it survives where two fills never would: low
227
+ * vision, a bad display, or any theme whose surface drifts. Hover stays purely
228
+ * a fill, so the two states never encode the same way.
229
+ *
230
+ * Both modes, unlike the state layer above: the collision it fixes is
231
+ * shadcn's one-token design, which is present in dark too — dark just happens
232
+ * to render both at `oklch(0.308 0 0)` instead of both at a 10% wash.
233
+ *
234
+ * `--sidebar-primary` rather than a fixed color, so every Lore theme carries
235
+ * its own hue with no per-theme values. Lives here rather than in
236
+ * `sidebar.tsx`, which `yarn w @alepha/ui sync` overwrites wholesale.
237
+ * ──────────────────────────────────────────────────────────────────────── */
238
+
239
+ [data-slot="sidebar-menu-button"][data-active],
240
+ [data-slot="sidebar-menu-sub-button"][data-active] {
241
+ position: relative;
242
+ }
243
+
244
+ [data-slot="sidebar-menu-button"][data-active]::after,
245
+ [data-slot="sidebar-menu-sub-button"][data-active]::after {
246
+ content: "";
247
+ position: absolute;
248
+ top: 0.25rem;
249
+ bottom: 0.25rem;
250
+ left: 0;
251
+ width: 3px;
252
+ border-radius: 9999px;
253
+ background-color: var(--sidebar-primary);
254
+ }