@clef-sh/ui 0.1.20 → 0.1.21

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 (103) hide show
  1. package/dist/client/assets/index-DPWHjBbB.js +34 -0
  2. package/dist/client/assets/index-qsLTYpc9.css +2 -0
  3. package/dist/client/clef.svg +2 -0
  4. package/dist/client/index.html +3 -31
  5. package/dist/client-lib/components/Button.d.ts +1 -1
  6. package/dist/client-lib/components/Button.d.ts.map +1 -1
  7. package/dist/client-lib/components/CopyButton.d.ts.map +1 -1
  8. package/dist/client-lib/components/EnvBadge.d.ts.map +1 -1
  9. package/dist/client-lib/components/MatrixGrid.d.ts.map +1 -1
  10. package/dist/client-lib/components/Sidebar.d.ts +1 -1
  11. package/dist/client-lib/components/Sidebar.d.ts.map +1 -1
  12. package/dist/client-lib/components/StatusDot.d.ts.map +1 -1
  13. package/dist/client-lib/components/SyncPanel.d.ts.map +1 -1
  14. package/dist/client-lib/components/TopBar.d.ts +6 -0
  15. package/dist/client-lib/components/TopBar.d.ts.map +1 -1
  16. package/dist/client-lib/primitives/Badge.d.ts +11 -0
  17. package/dist/client-lib/primitives/Badge.d.ts.map +1 -0
  18. package/dist/client-lib/primitives/Card.d.ts +28 -0
  19. package/dist/client-lib/primitives/Card.d.ts.map +1 -0
  20. package/dist/client-lib/primitives/Dialog.d.ts +30 -0
  21. package/dist/client-lib/primitives/Dialog.d.ts.map +1 -0
  22. package/dist/client-lib/primitives/EmptyState.d.ts +10 -0
  23. package/dist/client-lib/primitives/EmptyState.d.ts.map +1 -0
  24. package/dist/client-lib/primitives/Field.d.ts +36 -0
  25. package/dist/client-lib/primitives/Field.d.ts.map +1 -0
  26. package/dist/client-lib/primitives/Input.d.ts +6 -0
  27. package/dist/client-lib/primitives/Input.d.ts.map +1 -0
  28. package/dist/client-lib/primitives/Stat.d.ts +11 -0
  29. package/dist/client-lib/primitives/Stat.d.ts.map +1 -0
  30. package/dist/client-lib/primitives/Table.d.ts +37 -0
  31. package/dist/client-lib/primitives/Table.d.ts.map +1 -0
  32. package/dist/client-lib/primitives/Tabs.d.ts +29 -0
  33. package/dist/client-lib/primitives/Tabs.d.ts.map +1 -0
  34. package/dist/client-lib/primitives/Toast.d.ts +16 -0
  35. package/dist/client-lib/primitives/Toast.d.ts.map +1 -0
  36. package/dist/client-lib/primitives/Toolbar.d.ts +29 -0
  37. package/dist/client-lib/primitives/Toolbar.d.ts.map +1 -0
  38. package/dist/client-lib/primitives/index.d.ts +23 -0
  39. package/dist/client-lib/primitives/index.d.ts.map +1 -0
  40. package/dist/client-lib/theme.d.ts +18 -41
  41. package/dist/client-lib/theme.d.ts.map +1 -1
  42. package/dist/server/api.d.ts.map +1 -1
  43. package/dist/server/api.js +215 -0
  44. package/dist/server/api.js.map +1 -1
  45. package/dist/server/envelope.d.ts +15 -0
  46. package/dist/server/envelope.d.ts.map +1 -0
  47. package/dist/server/envelope.js +310 -0
  48. package/dist/server/envelope.js.map +1 -0
  49. package/package.json +7 -2
  50. package/src/client/App.tsx +16 -41
  51. package/src/client/components/Button.tsx +13 -22
  52. package/src/client/components/CopyButton.tsx +5 -12
  53. package/src/client/components/EnvBadge.tsx +30 -15
  54. package/src/client/components/MatrixGrid.tsx +108 -252
  55. package/src/client/components/Sidebar.tsx +123 -199
  56. package/src/client/components/StatusDot.tsx +10 -15
  57. package/src/client/components/SyncPanel.tsx +14 -62
  58. package/src/client/components/TopBar.tsx +11 -36
  59. package/src/client/index.html +1 -30
  60. package/src/client/main.tsx +1 -0
  61. package/src/client/primitives/Badge.test.tsx +47 -0
  62. package/src/client/primitives/Badge.tsx +64 -0
  63. package/src/client/primitives/Card.test.tsx +50 -0
  64. package/src/client/primitives/Card.tsx +85 -0
  65. package/src/client/primitives/Dialog.test.tsx +55 -0
  66. package/src/client/primitives/Dialog.tsx +96 -0
  67. package/src/client/primitives/EmptyState.test.tsx +25 -0
  68. package/src/client/primitives/EmptyState.tsx +38 -0
  69. package/src/client/primitives/Field.test.tsx +46 -0
  70. package/src/client/primitives/Field.tsx +95 -0
  71. package/src/client/primitives/Input.tsx +26 -0
  72. package/src/client/primitives/Stat.test.tsx +32 -0
  73. package/src/client/primitives/Stat.tsx +52 -0
  74. package/src/client/primitives/Table.test.tsx +58 -0
  75. package/src/client/primitives/Table.tsx +113 -0
  76. package/src/client/primitives/Tabs.test.tsx +44 -0
  77. package/src/client/primitives/Tabs.tsx +100 -0
  78. package/src/client/primitives/Toast.test.tsx +77 -0
  79. package/src/client/primitives/Toast.tsx +89 -0
  80. package/src/client/primitives/Toolbar.test.tsx +50 -0
  81. package/src/client/primitives/Toolbar.tsx +86 -0
  82. package/src/client/primitives/index.ts +43 -0
  83. package/src/client/public/clef.svg +2 -0
  84. package/src/client/screens/BackendScreen.tsx +104 -363
  85. package/src/client/screens/DiffView.tsx +187 -378
  86. package/src/client/screens/EnvelopeScreen.test.tsx +542 -0
  87. package/src/client/screens/EnvelopeScreen.tsx +948 -0
  88. package/src/client/screens/GitLogView.tsx +48 -106
  89. package/src/client/screens/ImportScreen.tsx +105 -308
  90. package/src/client/screens/LintView.tsx +184 -379
  91. package/src/client/screens/ManifestScreen.tsx +283 -445
  92. package/src/client/screens/MatrixView.tsx +75 -91
  93. package/src/client/screens/NamespaceEditor.tsx +234 -609
  94. package/src/client/screens/PolicyView.tsx +183 -453
  95. package/src/client/screens/RecipientsScreen.tsx +71 -350
  96. package/src/client/screens/ResetScreen.tsx +67 -237
  97. package/src/client/screens/ScanScreen.tsx +85 -249
  98. package/src/client/screens/SchemaEditor.test.tsx +237 -0
  99. package/src/client/screens/SchemaEditor.tsx +435 -0
  100. package/src/client/screens/ServiceIdentitiesScreen.tsx +251 -788
  101. package/src/client/styles.css +77 -0
  102. package/src/client/theme.ts +27 -48
  103. package/dist/client/assets/index-Db6WgHgY.js +0 -38
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Local UI stylesheet — Tailwind v4 + shared design tokens.
3
+ *
4
+ * Imports the @theme block from @clef-sh/design so utility classes like
5
+ * `bg-ink-850`, `text-ash-dim`, `border-edge` resolve at build time. Add
6
+ * any global selectors (focus rings, scrollbar, etc.) inside `@layer base`
7
+ * so Tailwind utility classes (which live in `@layer utilities`) can still
8
+ * override them — unlayered rules would beat utilities at equal specificity.
9
+ */
10
+ @import "tailwindcss";
11
+ @import "@clef-sh/design/theme.css";
12
+
13
+ @layer base {
14
+ /* Global focus rings. Pre-Phase-3 the UI had no `:focus-visible` styling
15
+ at all — `role="button"` divs in Sidebar / MatrixGrid were invisible to
16
+ keyboard navigation. */
17
+ button:focus-visible,
18
+ a:focus-visible,
19
+ input:focus-visible,
20
+ select:focus-visible,
21
+ textarea:focus-visible,
22
+ [role="button"]:focus-visible,
23
+ [role="tab"]:focus-visible,
24
+ [role="link"]:focus-visible,
25
+ [tabindex]:not([tabindex="-1"]):focus-visible {
26
+ outline: 2px solid var(--color-gold-500);
27
+ outline-offset: 2px;
28
+ border-radius: 4px;
29
+ }
30
+
31
+ /* Body defaults — Tailwind's preflight handles margin/padding/box-sizing
32
+ resets; we only need the bg, text color, and font-family for the
33
+ pre-React paint. App.tsx's outer div re-applies these via Tailwind
34
+ classes once the React tree mounts. */
35
+ body {
36
+ background-color: var(--color-ink-950);
37
+ color: var(--color-bone);
38
+ font-family: var(--font-sans);
39
+ }
40
+
41
+ /* Scrollbar styling (webkit) — keeps the dark theme consistent inside
42
+ scrollable containers. */
43
+ ::-webkit-scrollbar {
44
+ width: 6px;
45
+ height: 6px;
46
+ }
47
+ ::-webkit-scrollbar-track {
48
+ background: transparent;
49
+ }
50
+ ::-webkit-scrollbar-thumb {
51
+ background: var(--color-edge-strong);
52
+ border-radius: 3px;
53
+ }
54
+
55
+ /* Native dropdown options inherit the OS default light background unless
56
+ forced. Match the surface scale. */
57
+ select option {
58
+ background: var(--color-ink-800);
59
+ }
60
+
61
+ input::placeholder,
62
+ textarea::placeholder {
63
+ color: var(--color-ash-dim);
64
+ }
65
+ }
66
+
67
+ /**
68
+ * SchemaEditor's row-validation spinner used to inject this keyframe via a
69
+ * style tag at module load time (see SchemaEditor.tsx around line 444). We
70
+ * lift it here so it lives in one place and can be `animate-[name]` from
71
+ * any future primitive without re-injecting the global style tag.
72
+ */
73
+ @keyframes clef-schema-spin {
74
+ to {
75
+ transform: rotate(360deg);
76
+ }
77
+ }
@@ -1,48 +1,27 @@
1
- export const theme = {
2
- bg: "#0A0B0D",
3
- surface: "#111318",
4
- surfaceHover: "#161A22",
5
- border: "#1E2330",
6
- borderLight: "#252D3D",
7
- accent: "#F0A500",
8
- accentDim: "#F0A50022",
9
- accentHover: "#FFB733",
10
- green: "#22C55E",
11
- greenDim: "#22C55E18",
12
- red: "#EF4444",
13
- redDim: "#EF444418",
14
- yellow: "#FBBF24",
15
- yellowDim: "#FBBF2418",
16
- blue: "#60A5FA",
17
- blueDim: "#60A5FA18",
18
- purple: "#A78BFA",
19
- purpleDim: "#A78BFA18",
20
- text: "#E8EAF0",
21
- textMuted: "#6B7280",
22
- textDim: "#3D4455",
23
- mono: "'JetBrains Mono', 'Fira Code', monospace",
24
- sans: "'DM Sans', system-ui, sans-serif",
25
- } as const;
26
-
27
- export type ThemeColor = (typeof theme)[keyof typeof theme];
28
-
29
- export const ENV_COLORS: Record<string, { color: string; bg: string; label: string }> = {
30
- dev: { color: theme.green, bg: theme.greenDim, label: "DEV" },
31
- staging: { color: theme.yellow, bg: theme.yellowDim, label: "STG" },
32
- production: { color: theme.red, bg: theme.redDim, label: "PRD" },
33
- };
34
-
35
- export const SEVERITY_META: Record<
36
- string,
37
- { color: string; bg: string; icon: string; label: string }
38
- > = {
39
- error: { color: theme.red, bg: theme.redDim, icon: "\u2715", label: "Error" },
40
- warning: { color: theme.yellow, bg: theme.yellowDim, icon: "\u26A0", label: "Warning" },
41
- info: { color: theme.blue, bg: theme.blueDim, icon: "i", label: "Info" },
42
- };
43
-
44
- export const CATEGORY_META: Record<string, { label: string; color: string }> = {
45
- matrix: { label: "Matrix", color: theme.accent },
46
- schema: { label: "Schema", color: theme.blue },
47
- sops: { label: "SOPS", color: theme.purple },
48
- };
1
+ /**
2
+ * Theme re-export — single source of truth lives in `@clef-sh/design`.
3
+ *
4
+ * Pre-Phase-1 this file held the canonical token table. Now that cloud and
5
+ * the local UI both consume `@clef-sh/design/theme.css` (Tailwind v4 `@theme`)
6
+ * and `@clef-sh/design` (TS), this file exists only as a stable import path
7
+ * for screens written before the migration.
8
+ *
9
+ * New code should prefer Tailwind class names (`bg-ink-850`,
10
+ * `text-ash-dim`, etc.). Reach for the TS values only when a runtime hex
11
+ * literal is genuinely required (computed SVG fills, dynamic style props
12
+ * the migration hasn't reached yet).
13
+ *
14
+ * This module will be deleted in Phase 6 once `grep -r "from \"\\.\\./theme\""`
15
+ * inside `packages/ui/src/client/` returns empty.
16
+ */
17
+ export {
18
+ theme,
19
+ radius,
20
+ shadow,
21
+ duration,
22
+ space,
23
+ ENV_COLORS,
24
+ SEVERITY_META,
25
+ CATEGORY_META,
26
+ } from "@clef-sh/design";
27
+ export type { ThemeColor } from "@clef-sh/design";