@bevel-software/platform-core-frontend 0.8.0 → 0.9.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 (36) hide show
  1. package/package.json +2 -2
  2. package/src/core/registry.ts +16 -4
  3. package/src/modules/admin/state/admin.context.tsx +15 -0
  4. package/src/modules/library/__tests__/PluginPage.test.tsx +97 -6
  5. package/src/modules/library/__tests__/PluginsIndexPage.test.tsx +90 -10
  6. package/src/modules/library/__tests__/PluginsSidebar.contextmenu.test.tsx +1 -0
  7. package/src/modules/library/__tests__/PluginsSidebar.locked.test.tsx +1 -0
  8. package/src/modules/library/__tests__/PluginsSidebar.test.tsx +29 -0
  9. package/src/modules/library/__tests__/library-data.test.ts +82 -0
  10. package/src/modules/library/components/LibraryCard.tsx +6 -1
  11. package/src/modules/library/components/LibraryLayout.tsx +11 -2
  12. package/src/modules/library/components/NewSkillPanel.tsx +18 -0
  13. package/src/modules/library/components/PageActions.tsx +31 -8
  14. package/src/modules/library/components/PersonalPluginPage.tsx +14 -4
  15. package/src/modules/library/components/PluginJoinRequests.tsx +22 -1
  16. package/src/modules/library/components/PluginPage.tsx +42 -5
  17. package/src/modules/library/components/PluginsIndexPage.tsx +46 -3
  18. package/src/modules/library/components/PluginsSidebar.tsx +50 -0
  19. package/src/modules/library/components/plugin-page-parts.tsx +184 -4
  20. package/src/modules/library/routes/LibraryRoutes.tsx +2 -2
  21. package/src/modules/library/state/library-data.tsx +21 -0
  22. package/src/modules/onboarding/__tests__/creator-welcome.test.tsx +318 -0
  23. package/src/modules/onboarding/components/CreatorWelcomePage.tsx +143 -0
  24. package/src/modules/onboarding/components/WelcomePage.tsx +11 -14
  25. package/src/modules/onboarding/components/WelcomeRoute.tsx +57 -0
  26. package/src/modules/onboarding/welcome-state.ts +36 -0
  27. package/src/modules/setup/__tests__/setup.test.tsx +203 -0
  28. package/src/modules/setup/components/SetupScreen.tsx +235 -68
  29. package/src/modules/workspace/components/FileRoute.tsx +8 -1
  30. package/src/modules/workspace/components/FileViewer.tsx +95 -38
  31. package/src/modules/workspace/components/__tests__/FileRoute.test.tsx +20 -0
  32. package/src/modules/workspace/components/__tests__/FileViewer.test.tsx +227 -18
  33. package/src/modules/workspace/routing/__tests__/kb-routes.test.tsx +25 -0
  34. package/src/modules/workspace/routing/kb-routes.ts +23 -1
  35. package/src/modules/workspace/utils/fileTree.ts +51 -0
  36. package/src/shared/components/Surface.tsx +15 -0
@@ -46,6 +46,13 @@ export interface SurfaceProps extends HTMLAttributes<HTMLElement> {
46
46
  * submit the form it happens to sit in.
47
47
  */
48
48
  type?: 'button' | 'submit' | 'reset';
49
+ /**
50
+ * Also only meaningful with `as="button"`, and declared for the same reason
51
+ * `type` is: `HTMLAttributes` has no `disabled`. A disabled interactive
52
+ * surface drops the hover/press affordance too — a card that still lifts
53
+ * under the cursor reads as one that would do something.
54
+ */
55
+ disabled?: boolean;
49
56
  tone?: SurfaceTone;
50
57
  radius?: SurfaceRadius;
51
58
  elevation?: SurfaceElevation;
@@ -62,10 +69,12 @@ export function Surface({
62
69
  elevation = 'card',
63
70
  interactive = false,
64
71
  padded = false,
72
+ disabled = false,
65
73
  className,
66
74
  children,
67
75
  ...rest
68
76
  }: SurfaceProps) {
77
+ const isDisabled = disabled && Tag === 'button';
69
78
  return (
70
79
  <Tag
71
80
  className={cn(
@@ -75,9 +84,15 @@ export function Surface({
75
84
  ELEVATION[elevation],
76
85
  padded && 'px-4 pt-3.5 pb-3',
77
86
  interactive &&
87
+ !isDisabled &&
78
88
  'cursor-pointer transition-[border-color,background-color,transform] hover:border-line-strong hover:bg-surface-hover active:scale-[.995]',
89
+ // Gated on the SAME condition as the attribute below: on a non-button
90
+ // tag nothing enforces the state, and a surface that looks disabled
91
+ // while still firing onClick is worse than one that looks live.
92
+ isDisabled && 'cursor-not-allowed opacity-60',
79
93
  className,
80
94
  )}
95
+ disabled={isDisabled || undefined}
81
96
  {...rest}
82
97
  >
83
98
  {children}