@sybilion/uilib 1.4.8 → 1.4.10

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 (140) hide show
  1. package/dist/agent-glossary/content-prompt.generated.ts +32 -31
  2. package/dist/agent-glossary/content.generated.ts +32 -31
  3. package/dist/agent-glossary/content.index.md +5 -1
  4. package/dist/agent-glossary/content.md +32 -31
  5. package/dist/agent-glossary/content.prompt.md +32 -31
  6. package/dist/agent-glossary/workspace.generated.ts +26 -27
  7. package/dist/agent-glossary/workspace.index.md +25 -26
  8. package/dist/agent-glossary/workspace.md +25 -26
  9. package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.js +2 -2
  10. package/dist/esm/components/ui/Button/Button.styl.js +1 -1
  11. package/dist/esm/components/ui/ButtonGroup/ButtonGroup.js +9 -0
  12. package/dist/esm/components/ui/ButtonGroup/ButtonGroup.styl.js +7 -0
  13. package/dist/esm/components/ui/Chart/Chart.js +3 -3
  14. package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.styl.js +1 -1
  15. package/dist/esm/components/ui/Chat/ChatPrompt/ChatPromptComposer.js +1 -1
  16. package/dist/esm/components/ui/Chat/ChatSheet/ChatSheet.js +13 -0
  17. package/dist/esm/components/ui/Chat/ChatSheet/useChatPanelChromeModel.js +10 -7
  18. package/dist/esm/components/ui/Chip/Chip.js +3 -4
  19. package/dist/esm/components/ui/Chip/Chip.styl.js +2 -2
  20. package/dist/esm/components/ui/FileChip/FileChip.js +1 -1
  21. package/dist/esm/components/ui/Page/pageScrollRestoration.js +22 -0
  22. package/dist/esm/components/ui/Page/usePageScrollRestoration.js +73 -0
  23. package/dist/esm/components/ui/Renamer/Renamer.js +1 -1
  24. package/dist/esm/components/ui/Renamer/Renamer.styl.js +1 -1
  25. package/dist/esm/components/ui/Sidebar/Sidebar.js +91 -73
  26. package/dist/esm/components/widgets/DriverCard/DriverCard.js +7 -7
  27. package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +3 -3
  28. package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.js +2 -2
  29. package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.js +1 -1
  30. package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.js +1 -0
  31. package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +1 -0
  32. package/dist/esm/components/widgets/SybilionAppHeader/SybilionAppHeader.styl.js +1 -1
  33. package/dist/esm/index.js +4 -2
  34. package/dist/esm/types/src/components/ui/ButtonGroup/ButtonGroup.d.ts +3 -0
  35. package/dist/esm/types/src/components/ui/ButtonGroup/ButtonGroup.types.d.ts +3 -0
  36. package/dist/esm/types/src/components/ui/ButtonGroup/index.d.ts +2 -0
  37. package/dist/esm/types/src/components/ui/Chip/Chip.d.ts +1 -1
  38. package/dist/esm/types/src/components/ui/Chip/Chip.types.d.ts +4 -2
  39. package/dist/esm/types/src/components/ui/Page/index.d.ts +2 -0
  40. package/dist/esm/types/src/components/ui/Page/pageScrollRestoration.d.ts +2 -0
  41. package/dist/esm/types/src/components/ui/Page/usePageScrollRestoration.d.ts +2 -0
  42. package/dist/esm/types/src/components/ui/Sidebar/Sidebar.d.ts +13 -6
  43. package/dist/esm/types/src/docs/pages/ButtonGroupPage.d.ts +1 -0
  44. package/dist/esm/types/src/index.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +3 -3
  47. package/src/components/ui/AnalysisLineIcon/AGENT.md +1 -1
  48. package/src/components/ui/Avatar/AGENT.md +1 -1
  49. package/src/components/ui/Button/Button.styl +11 -5
  50. package/src/components/ui/ButtonGroup/AGENT.md +29 -0
  51. package/src/components/ui/ButtonGroup/ButtonGroup.styl +21 -0
  52. package/src/components/ui/{Badge/Badge.styl.d.ts → ButtonGroup/ButtonGroup.styl.d.ts} +0 -6
  53. package/src/components/ui/ButtonGroup/ButtonGroup.tsx +17 -0
  54. package/src/components/ui/ButtonGroup/ButtonGroup.types.ts +3 -0
  55. package/src/components/ui/ButtonGroup/index.ts +2 -0
  56. package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl +2 -0
  57. package/src/components/ui/Chat/ChatPrompt/ChatPromptComposer.tsx +1 -0
  58. package/src/components/ui/Chat/ChatSheet/ChatSheet.tsx +15 -0
  59. package/src/components/ui/Chat/ChatSheet/useChatPanelChromeModel.tsx +21 -9
  60. package/src/components/ui/Chip/AGENT.md +4 -3
  61. package/src/components/ui/Chip/Chip.styl +17 -0
  62. package/src/components/ui/Chip/Chip.styl.d.ts +2 -0
  63. package/src/components/ui/Chip/Chip.tsx +10 -6
  64. package/src/components/ui/Chip/Chip.types.ts +5 -2
  65. package/src/components/ui/FileChip/FileChip.tsx +1 -1
  66. package/src/components/ui/Gap/AGENT.md +11 -0
  67. package/src/components/ui/Page/AGENT.md +5 -31
  68. package/src/components/ui/Page/index.ts +2 -0
  69. package/src/components/ui/Page/pageScrollRestoration.ts +22 -0
  70. package/src/components/ui/Page/usePageScrollRestoration.ts +90 -0
  71. package/src/components/ui/Renamer/Renamer.styl +1 -1
  72. package/src/components/ui/Renamer/Renamer.tsx +1 -0
  73. package/src/{docs/agent-guidance/sidebar.md → components/ui/Sidebar/AGENT.md} +1 -1
  74. package/src/components/ui/Sidebar/Sidebar.tsx +158 -99
  75. package/src/{docs/agent-guidance/table.md → components/ui/Table/AGENT.md} +1 -2
  76. package/src/{docs/agent-guidance/tabs.md → components/ui/Tabs/AGENT.md} +1 -1
  77. package/src/{docs/agent-guidance/text-shimmer.md → components/ui/TextShimmer/AGENT.md} +1 -1
  78. package/src/components/widgets/DriverCard/DriverCard.tsx +12 -10
  79. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl +1 -0
  80. package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.tsx +3 -3
  81. package/src/components/widgets/SybilionAppHeader/SybilionAppHeader.styl +2 -2
  82. package/src/docs/pages/ButtonGroupPage.tsx +45 -0
  83. package/src/docs/pages/ChipPage.tsx +37 -0
  84. package/src/docs/pages/LegacyPlatformLinkPage.tsx +0 -3
  85. package/src/docs/pages/LightweightChartPage.tsx +1 -1
  86. package/src/docs/pages/ProgressPage.tsx +1 -1
  87. package/src/docs/pages/PullQuotePage.tsx +1 -1
  88. package/src/docs/pages/RegionCoordsPage.tsx +1 -1
  89. package/src/docs/pages/RenamerPage.tsx +1 -1
  90. package/src/docs/pages/SelectPage.tsx +1 -1
  91. package/src/docs/pages/SeparatorPage.tsx +1 -1
  92. package/src/docs/pages/SidebarDatasetsItemsGroupedPage.tsx +1 -1
  93. package/src/docs/pages/SidebarPage.tsx +1 -1
  94. package/src/docs/pages/SkeletonPage.tsx +1 -1
  95. package/src/docs/pages/SliderPage.tsx +1 -1
  96. package/src/docs/pages/SmartTextTruncatePage.tsx +1 -1
  97. package/src/docs/pages/SparklinePage.tsx +1 -1
  98. package/src/docs/pages/TablePage.tsx +1 -1
  99. package/src/docs/pages/TabsPage.tsx +1 -1
  100. package/src/docs/pages/TextShimmerPage.tsx +1 -1
  101. package/src/docs/pages/TextWithDeferTooltipPage.tsx +1 -1
  102. package/src/docs/pages/TimeRangeControlsPage.tsx +1 -1
  103. package/src/docs/pages/ToggleGroupPage.tsx +1 -1
  104. package/src/docs/pages/VimeoEmbedPage.tsx +4 -5
  105. package/src/docs/pages/WorldMapPage.tsx +1 -1
  106. package/src/docs/registry.ts +6 -12
  107. package/src/index.ts +1 -1
  108. package/dist/esm/components/ui/Badge/Badge.js +0 -11
  109. package/dist/esm/components/ui/Badge/Badge.styl.js +0 -7
  110. package/dist/esm/types/src/components/ui/Badge/Badge.d.ts +0 -3
  111. package/dist/esm/types/src/components/ui/Badge/Badge.types.d.ts +0 -6
  112. package/dist/esm/types/src/components/ui/Badge/index.d.ts +0 -2
  113. package/dist/esm/types/src/docs/pages/BadgePage.d.ts +0 -1
  114. package/dist/esm/types/src/docs/pages/TogglePage.d.ts +0 -1
  115. package/src/components/ui/Badge/AGENT.md +0 -16
  116. package/src/components/ui/Badge/Badge.styl +0 -95
  117. package/src/components/ui/Badge/Badge.tsx +0 -31
  118. package/src/components/ui/Badge/Badge.types.ts +0 -7
  119. package/src/components/ui/Badge/index.ts +0 -2
  120. package/src/components/ui/LegacyPlatformLink/AGENT.md +0 -15
  121. package/src/docs/agent-guidance/sidebar-datasets-items-grouped.md +0 -11
  122. package/src/docs/pages/BadgePage.tsx +0 -30
  123. package/src/docs/pages/TogglePage.tsx +0 -27
  124. /package/src/{docs/agent-guidance/lightweight-forecast-chart.md → components/ui/Chart/lightweight/AGENT.md} +0 -0
  125. /package/src/{docs/agent-guidance/progress.md → components/ui/Progress/AGENT.md} +0 -0
  126. /package/src/{docs/agent-guidance/pull-quote.md → components/ui/PullQuote/AGENT.md} +0 -0
  127. /package/src/{docs/agent-guidance/region-coords.md → components/ui/RegionCoords/AGENT.md} +0 -0
  128. /package/src/{docs/agent-guidance/renamer.md → components/ui/Renamer/AGENT.md} +0 -0
  129. /package/src/{docs/agent-guidance/select.md → components/ui/Select/AGENT.md} +0 -0
  130. /package/src/{docs/agent-guidance/separator.md → components/ui/Separator/AGENT.md} +0 -0
  131. /package/src/{docs/agent-guidance/skeleton.md → components/ui/Skeleton/AGENT.md} +0 -0
  132. /package/src/{docs/agent-guidance/slider.md → components/ui/Slider/AGENT.md} +0 -0
  133. /package/src/{docs/agent-guidance/smart-text-truncate.md → components/ui/SmartTextTruncate/AGENT.md} +0 -0
  134. /package/src/{docs/agent-guidance/sparkline.md → components/ui/Sparkline/AGENT.md} +0 -0
  135. /package/src/{docs/agent-guidance/text-with-defer-tooltip.md → components/ui/TextWithDeferTooltip/AGENT.md} +0 -0
  136. /package/src/{docs/agent-guidance/time-range-controls.md → components/ui/TimeRangeControls/AGENT.md} +0 -0
  137. /package/src/{docs/agent-guidance/toggle.md → components/ui/Toggle/AGENT.md} +0 -0
  138. /package/src/{docs/agent-guidance/toggle-group.md → components/ui/ToggleGroup/AGENT.md} +0 -0
  139. /package/src/{docs/agent-guidance/vimeo-embed.md → components/ui/VimeoEmbed/AGENT.md} +0 -0
  140. /package/src/{docs/agent-guidance/world-map.md → components/ui/WorldMap/AGENT.md} +0 -0
@@ -15,22 +15,27 @@ export type SetSidebarOpenOptions = {
15
15
  /** Nav closed for layout (chat/width); restore when chat closes — do not persist closed cookie. */
16
16
  layoutAutoClose?: boolean;
17
17
  };
18
- type SidebarContextProps = {
19
- isOpen: boolean;
18
+ type SidebarActionsContextProps = {
20
19
  setOpen: (open: boolean, options?: SetSidebarOpenOptions) => void;
21
20
  toggleSidebar: () => void;
22
- sidebarWidthPx: number;
23
21
  setSidebarWidthPx: (px: number, options?: SetPanelWidthOptions) => void;
24
- chatWidthPx: number;
25
22
  setChatWidthPx: (px: number, options?: SetPanelWidthOptions) => void;
26
- chatPanelOpen: boolean;
27
23
  setChatPanelOpen: (open: boolean) => void;
28
24
  getShellWidth: () => number;
25
+ /** Read shell chat open without subscribing to SidebarStateContext. */
26
+ getChatPanelOpen: () => boolean;
27
+ };
28
+ type SidebarStateContextProps = {
29
+ isOpen: boolean;
30
+ sidebarWidthPx: number;
31
+ chatWidthPx: number;
32
+ chatPanelOpen: boolean;
29
33
  /** Portal target for the AI chat side panel (right column). */
30
34
  chatPanelContainer: HTMLDivElement | null;
31
35
  /** App shell wrapper; used to set `--chat-panel-width` (and `--chat-panel-height` on mobile only). */
32
36
  sidebarWrapperRef: RefObject<HTMLDivElement | null>;
33
37
  };
38
+ type SidebarContextProps = SidebarStateContextProps & SidebarActionsContextProps;
34
39
  type SidebarProps = ComponentProps<'div'> & {
35
40
  defaultOpen?: boolean;
36
41
  open?: boolean;
@@ -41,6 +46,8 @@ type SidebarProps = ComponentProps<'div'> & {
41
46
  fullHeightResizer?: boolean;
42
47
  brandText?: string;
43
48
  };
49
+ declare function useSidebarActions(): SidebarActionsContextProps;
50
+ declare function useSidebarState(): SidebarStateContextProps;
44
51
  declare function useSidebar(): SidebarContextProps;
45
52
  declare function SidebarProvider({ defaultOpen, className, style, children, userId, sidebarWidthStorageKey, persistSidebarWidthWithoutConsent, ...props }: ComponentProps<'div'> & {
46
53
  defaultOpen?: boolean;
@@ -91,4 +98,4 @@ declare function SidebarMenuSubButton({ asChild, size, isActive, tooltip, classN
91
98
  isActive?: boolean;
92
99
  tooltip?: string | ComponentProps<typeof TooltipContent>;
93
100
  }): import("react/jsx-runtime").JSX.Element;
94
- export { PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, };
101
+ export { PanelResizeHandle, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarResizeHandle, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarActions, useSidebarState, };
@@ -0,0 +1 @@
1
+ export default function ButtonGroupPage(): import("react/jsx-runtime").JSX.Element;
@@ -12,7 +12,6 @@ export * from './components/ui/AnalysesSelector';
12
12
  export * from './components/ui/AnalysisLineIcon';
13
13
  export * from './components/ui/AppHeader';
14
14
  export * from './components/ui/Avatar';
15
- export * from './components/ui/Badge';
16
15
  export * from './components/ui/Banner';
17
16
  export * from './components/ui/Chip';
18
17
  export * from './components/ui/Kicker';
@@ -20,6 +19,7 @@ export * from './components/ui/PullQuote';
20
19
  export * from './components/ui/SignalCard';
21
20
  export * from './components/ui/Breadcrumb';
22
21
  export * from './components/ui/Button';
22
+ export * from './components/ui/ButtonGroup';
23
23
  export * from './components/ui/Card';
24
24
  export * from './components/ui/Chart';
25
25
  export * from './components/ui/ChartAreaInteractive';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "description": "Sybilion Design System — React UI components (Webpack + Stylus)",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -8,8 +8,8 @@ import {
8
8
  } from 'react';
9
9
 
10
10
  import { AnalysisLineIcon } from '#uilib/components/ui/AnalysisLineIcon';
11
- import { Badge } from '#uilib/components/ui/Badge';
12
11
  import { Button } from '#uilib/components/ui/Button';
12
+ import { Chip } from '#uilib/components/ui/Chip';
13
13
  import { LabelWithId } from '#uilib/components/ui/LabelWithId';
14
14
  import {
15
15
  Select,
@@ -55,9 +55,9 @@ function renderItemContent(item: AnalysesSelectorItem) {
55
55
 
56
56
  if (failed) {
57
57
  return (
58
- <Badge variant="red" className={S.itemBadge}>
58
+ <Chip variant="negative" squared className={S.itemBadge}>
59
59
  failed
60
- </Badge>
60
+ </Chip>
61
61
  );
62
62
  }
63
63
 
@@ -8,4 +8,4 @@ AnalysisLineIcon renders a small solid or dashed line marker in a given colour.
8
8
  ## When not to use
9
9
 
10
10
  - As a generic decorative icon; it only conveys meaning next to a chart.
11
- - To indicate status or severity; use Badge instead.
11
+ - To indicate status or severity; use Chip instead.
@@ -8,7 +8,7 @@ Avatar displays a user or entity image with an automatic fallback to initials wh
8
8
  ## When not to use
9
9
 
10
10
  - For arbitrary illustrative imagery; use a plain image instead.
11
- - To convey status on its own; pair it with a Badge or status indicator.
11
+ - To convey status on its own; pair it with a Chip or status indicator.
12
12
 
13
13
  ## Do
14
14
 
@@ -16,6 +16,9 @@
16
16
  transition all var(--dur-base) var(--ease-standard)
17
17
  border 0
18
18
 
19
+ &:active
20
+ opacity 0.8
21
+
19
22
  &:disabled
20
23
  pointer-events none
21
24
  opacity 0.5
@@ -43,6 +46,9 @@
43
46
  &:hover
44
47
  background-color var(--sb-gray-800)
45
48
 
49
+ :global(.dark) &
50
+ background-color var(--sb-gray-600)
51
+
46
52
  .destructive
47
53
  background-color var(--destructive-900)
48
54
  color white
@@ -51,7 +57,7 @@
51
57
  background-color var(--destructive-600)
52
58
 
53
59
  &:focus-visible
54
- ring 3px var(--destructive-200)
60
+ ring 3px var(--destructive-200)
55
61
 
56
62
  :global(.dark) &
57
63
  ring 3px var(--destructive-400)
@@ -80,11 +86,11 @@
80
86
 
81
87
  .ghost
82
88
  &:hover
83
- background-color var(--accent)
84
- color var(--accent-foreground)
89
+ background-color var(--sb-gray-100)
90
+ color var(--foreground)
85
91
 
86
- :global(.dark) &:hover
87
- background-color var(--accent-500)
92
+ :global(.dark) &
93
+ background-color var(--sb-gray-900)
88
94
 
89
95
  .link
90
96
  color var(--primary)
@@ -0,0 +1,29 @@
1
+ ---
2
+ profiles: [workspace, content]
3
+ summary: Layout wrapper that molds adjacent Button children into one segmented control.
4
+ ---
5
+
6
+ ButtonGroup is a layout wrapper for two or more adjacent buttons. It removes gaps and inner corner radii so outline and secondary actions read as a single segmented control while each button keeps its own click handler.
7
+
8
+ ## When to use
9
+
10
+ - To present a small set of related actions side by side, such as pagination or view toggles implemented with Button.
11
+ - To group outline buttons that share a border, such as filter presets or export format choices.
12
+ - When each segment needs its own label and handler but should look like one control.
13
+
14
+ ## When not to use
15
+
16
+ - For mutually exclusive selection state; use ToggleGroup or Tabs instead.
17
+ - For a single action; use Button alone.
18
+ - When buttons are not direct children of the wrapper.
19
+
20
+ ## Do
21
+
22
+ - Place Button elements as direct children of ButtonGroup.
23
+ - Use the outline variant when adjacent borders should read as one shared edge.
24
+ - Keep segment labels short so the group stays compact.
25
+
26
+ ## Don't
27
+
28
+ - Nest ButtonGroup inside Button or wrap non-button elements expecting grouped styling.
29
+ - Use ButtonGroup for navigation between pages; use links or Tabs instead.
@@ -0,0 +1,21 @@
1
+ .root
2
+ display inline-flex
3
+ align-items stretch
4
+ width fit-content
5
+
6
+ > button
7
+ &:not(:first-child)
8
+ margin-left -1px
9
+ border-top-left-radius 0
10
+ border-bottom-left-radius 0
11
+
12
+ &:not(:last-child)
13
+ border-top-right-radius 0
14
+ border-bottom-right-radius 0
15
+
16
+ &:hover,
17
+ &:focus-visible
18
+ z-index 1
19
+
20
+ &:disabled
21
+ z-index 0
@@ -2,12 +2,6 @@
2
2
  // Please do not change this file!
3
3
  interface CssExports {
4
4
  'root': string;
5
- 'squared': string;
6
- 'variant-default': string;
7
- 'variant-green': string;
8
- 'variant-outline': string;
9
- 'variant-red': string;
10
- 'variant-yellow': string;
11
5
  }
12
6
  export const cssExports: CssExports;
13
7
  export default cssExports;
@@ -0,0 +1,17 @@
1
+ import cn from 'classnames';
2
+
3
+ import S from './ButtonGroup.styl';
4
+ import type { ButtonGroupProps } from './ButtonGroup.types';
5
+
6
+ function ButtonGroup({ className, ...props }: ButtonGroupProps) {
7
+ return (
8
+ <div
9
+ data-slot="button-group"
10
+ className={cn(S.root, className)}
11
+ role="group"
12
+ {...props}
13
+ />
14
+ );
15
+ }
16
+
17
+ export { ButtonGroup };
@@ -0,0 +1,3 @@
1
+ import type { HTMLAttributes } from 'react';
2
+
3
+ export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {}
@@ -0,0 +1,2 @@
1
+ export { ButtonGroup } from './ButtonGroup';
2
+ export type { ButtonGroupProps } from './ButtonGroup.types';
@@ -104,6 +104,8 @@ INPUT_MAX_HEIGHT = 200px
104
104
  flex-shrink 0
105
105
  align-items center
106
106
  justify-content flex-end
107
+ height 100%
108
+ padding-bottom 2px
107
109
 
108
110
  & > button:focus
109
111
  box-shadow 0 0 0 2px var(--brand-color-500) !important
@@ -105,6 +105,7 @@ export const ChatPromptComposer = forwardRef<
105
105
  <Button
106
106
  type="submit"
107
107
  size="sm"
108
+ icon
108
109
  disabled={disabled || !canSubmit}
109
110
  onMouseDown={e => e.preventDefault()}
110
111
  >
@@ -1,3 +1,4 @@
1
+ import { useEffect, useState } from 'react';
1
2
  import { createPortal } from 'react-dom';
2
3
 
3
4
  import { Button } from '../../Button';
@@ -85,6 +86,19 @@ export function ChatSheet({
85
86
  };
86
87
  }
87
88
 
89
+ const [chromePortalReady, setChromePortalReady] = useState(false);
90
+
91
+ useEffect(() => {
92
+ if (!model.isOpen) {
93
+ setChromePortalReady(false);
94
+ return;
95
+ }
96
+ const frameId = requestAnimationFrame(() => {
97
+ setChromePortalReady(true);
98
+ });
99
+ return () => cancelAnimationFrame(frameId);
100
+ }, [model.isOpen]);
101
+
88
102
  if (inline) {
89
103
  return <ChatChrome {...model.chromeProps} />;
90
104
  }
@@ -101,6 +115,7 @@ export function ChatSheet({
101
115
  </Button>
102
116
  )}
103
117
  {model.isOpen &&
118
+ chromePortalReady &&
104
119
  model.chatPanelContainer &&
105
120
  createPortal(
106
121
  <ChatChrome {...model.chromeProps} />,
@@ -1,4 +1,11 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
1
+ import {
2
+ startTransition,
3
+ useCallback,
4
+ useEffect,
5
+ useMemo,
6
+ useRef,
7
+ useState,
8
+ } from 'react';
2
9
 
3
10
  import {
4
11
  ChatPreset,
@@ -47,7 +54,8 @@ import { ScrollRef } from '@homecode/ui';
47
54
 
48
55
  import {
49
56
  DISMISS_CHAT_FOR_LAYOUT_EVENT,
50
- useSidebar,
57
+ useSidebarActions,
58
+ useSidebarState,
51
59
  } from '../../Sidebar/Sidebar';
52
60
  import { Chat } from '../Chat';
53
61
  import type { ChatChromeProps } from '../ChatChrome';
@@ -177,14 +185,16 @@ export function useChatPanelChromeModel({
177
185
  const {
178
186
  chatPanelContainer,
179
187
  isOpen: sidebarNavOpen,
180
- setOpen: setSidebarNavOpen,
181
188
  sidebarWidthPx,
182
189
  chatWidthPx,
190
+ chatPanelOpen: shellChatPanelOpen,
191
+ } = useSidebarState();
192
+ const {
193
+ setOpen: setSidebarNavOpen,
183
194
  setChatWidthPx,
184
195
  getShellWidth,
185
- chatPanelOpen: shellChatPanelOpen,
186
196
  setChatPanelOpen,
187
- } = useSidebar();
197
+ } = useSidebarActions();
188
198
  const [localUiBusy, setLocalUiBusy] = useState(false);
189
199
  const [outboundLoadingLabel, setOutboundLoadingLabel] = useState<
190
200
  string | undefined
@@ -344,10 +354,12 @@ export function useChatPanelChromeModel({
344
354
  layoutDismissedRef.current = false;
345
355
  openedShellChatRef.current = true;
346
356
  setChatPanelOpen(true);
347
- setIsOpen(true);
348
- if (!searchParams.has(CHAT_QUERY_PARAM)) {
349
- addSearchParams({ [CHAT_QUERY_PARAM]: CHAT_OPEN_VALUE });
350
- }
357
+ startTransition(() => {
358
+ setIsOpen(true);
359
+ if (!searchParams.has(CHAT_QUERY_PARAM)) {
360
+ addSearchParams({ [CHAT_QUERY_PARAM]: CHAT_OPEN_VALUE });
361
+ }
362
+ });
351
363
  return;
352
364
  }
353
365
 
@@ -1,18 +1,19 @@
1
- Chips are compact pill-shaped capsules for filters, status pills, version tags, and quantitative delta indicators. Unlike Badge, which stays general purpose, Chip carries status and delta semantics: the positive and negative variants sit outside the primary palette and are reserved for quantitative impact signals.
1
+ Chips are compact capsules for filters, status labels, version tags, and quantitative delta indicators. Use the default pill shape for filters and live status; pass `squared` for compact label badges in lists, tables, and cards.
2
2
 
3
3
  ## When to use
4
4
 
5
5
  - To present a row of filter options, with the active variant marking the current selection.
6
6
  - To flag live status, version tags, or deadlines with the neutral, accent, and filled variants.
7
+ - To label or categorise content in lists, tables, and cards with `squared` and neutral, line, yellow, positive, or negative variants.
7
8
  - To show a quantitative delta or impact direction with the positive or negative variant, optionally with a trend arrow.
8
9
 
9
10
  ## When not to use
10
11
 
11
- - For general-purpose labels without status or delta semantics; use Badge instead.
12
12
  - For file attachments; use FileChip.
13
- - As decoration; the status variants are reserved for quantitative signals only.
13
+ - As decoration; the positive and negative variants are reserved for quantitative signals and status meaning.
14
14
 
15
15
  ## Do
16
16
 
17
17
  - Keep chip labels short and in sentence case.
18
18
  - Pair the positive and negative variants with a trend arrow or delta value so the direction reads at a glance.
19
+ - Use colour variants consistently so a given colour always carries the same meaning across the product.
@@ -14,6 +14,14 @@
14
14
  letter-spacing var(--tracking-body)
15
15
  transition background-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard)
16
16
 
17
+ &.squared
18
+ border-radius var(--p-1)
19
+
20
+ & > svg
21
+ width 0.75rem
22
+ height 0.75rem
23
+ pointer-events none
24
+
17
25
  .dot
18
26
  width 6px
19
27
  height 6px
@@ -76,3 +84,12 @@
76
84
  &.variant-negative
77
85
  background var(--status-negative-bg)
78
86
  color var(--status-negative)
87
+
88
+ // Yellow variant — caution / pending status
89
+ &.variant-yellow
90
+ background-color var(--sb-yellow-50)
91
+ color var(--sb-yellow-600)
92
+
93
+ :global(.dark) &
94
+ background-color var(--sb-yellow-900)
95
+ color var(--sb-yellow-400)
@@ -4,6 +4,7 @@ interface CssExports {
4
4
  'arrow': string;
5
5
  'dot': string;
6
6
  'root': string;
7
+ 'squared': string;
7
8
  'variant-accent': string;
8
9
  'variant-active': string;
9
10
  'variant-filled': string;
@@ -11,6 +12,7 @@ interface CssExports {
11
12
  'variant-negative': string;
12
13
  'variant-neutral': string;
13
14
  'variant-positive': string;
15
+ 'variant-yellow': string;
14
16
  }
15
17
  export const cssExports: CssExports;
16
18
  export default cssExports;
@@ -1,29 +1,33 @@
1
- import cn from 'classnames';
2
-
3
1
  import { TrendingDown, TrendingUp } from 'lucide-react';
4
2
 
5
- import S from './Chip.styl';
6
3
  import { ChipProps } from './Chip.types';
4
+ import S from './Chip.styl';
5
+ import cn from 'classnames';
7
6
 
8
7
  function Chip({
9
8
  className,
10
9
  variant = 'neutral',
11
10
  dot,
12
11
  trend,
12
+ squared = false,
13
13
  children,
14
14
  ...props
15
15
  }: ChipProps) {
16
- const showDot = dot ?? variant === 'neutral';
17
16
  const TrendIcon =
18
17
  trend === 'up' ? TrendingUp : trend === 'down' ? TrendingDown : null;
19
18
 
20
19
  return (
21
20
  <span
22
21
  data-slot="chip"
23
- className={cn(S.root, S[`variant-${variant}`], className)}
22
+ className={cn(
23
+ S.root,
24
+ S[`variant-${variant}`],
25
+ squared && S.squared,
26
+ className,
27
+ )}
24
28
  {...props}
25
29
  >
26
- {showDot && <span className={S.dot} aria-hidden="true" />}
30
+ {dot && <span className={S.dot} aria-hidden="true" />}
27
31
  {TrendIcon && (
28
32
  <TrendIcon className={S.arrow} strokeWidth={1.5} aria-hidden="true" />
29
33
  )}
@@ -7,7 +7,8 @@ export type ChipVariant =
7
7
  | 'filled'
8
8
  | 'accent'
9
9
  | 'positive'
10
- | 'negative';
10
+ | 'negative'
11
+ | 'yellow';
11
12
 
12
13
  export type ChipTrend = 'up' | 'down';
13
14
 
@@ -15,9 +16,11 @@ export interface ChipProps extends ComponentProps<'span'> {
15
16
  variant?: ChipVariant;
16
17
  /**
17
18
  * Show the 6px status dot. Defaults to true for the neutral variant
18
- * and false for all others.
19
+ * (when not squared) and false for all others.
19
20
  */
20
21
  dot?: boolean;
21
22
  /** Render a Lucide trend arrow before the label. */
22
23
  trend?: ChipTrend;
24
+ /** Use compact squared corners instead of the default pill shape. */
25
+ squared?: boolean;
23
26
  }
@@ -41,7 +41,7 @@ function FileChipHeader({
41
41
  description={hint}
42
42
  titleClassName={S.title}
43
43
  descriptionClassName={S.hint}
44
- tooltipProps={{ maxWidth: 400 }}
44
+ tooltipProps={{ maxWidth: 400, overTrigger: true }}
45
45
  >
46
46
  {onRemove ? (
47
47
  <CardAction>
@@ -0,0 +1,11 @@
1
+ Gap is a flex-grow spacer that absorbs remaining horizontal or vertical space inside a flex container. Render it between siblings when one element should stay pinned and another should push to the far edge.
2
+
3
+ ## When to use
4
+
5
+ - To push toolbar actions or labels to opposite ends of a flex row.
6
+ - When a layout needs flexible empty space without hard-coded margins.
7
+
8
+ ## When not to use
9
+
10
+ - For page-level section spacing; use PageContentSection or design tokens instead.
11
+ - When fixed gaps between items are enough; use CSS gap on the flex parent.
@@ -1,17 +1,8 @@
1
1
  # Page layout system
2
2
 
3
- Sybilion workspace and report surfaces use a small set of **Page** primitives from `@sybilion/uilib`. Agents must compose these instead of inventing layout with inline styles, Tailwind structure classes, or ad-hoc wrappers.
3
+ Sybilion workspace surfaces use a small set of **Page** primitives from `@sybilion/uilib`. Agents must compose these instead of inventing layout with inline styles, Tailwind structure classes, or ad-hoc wrappers.
4
4
 
5
- ## Two modes
6
-
7
- | Mode | When | Shell |
8
- | ------------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------- |
9
- | **workspace-page** | Route inside `AppShell` / scrolled main column | `PageHeader` → `PageContent` → `PageContentSection`(s). Optional `PageTabs`. |
10
- | **content** | Report tiles, json-dashboard, embedded body only | No `PageHeader` / `AppShell` chrome. Map React blocks to dashboard tiles (see below). |
11
-
12
- Do not nest workspace shell components inside **content** mode output.
13
-
14
- ## Mandatory workspace-page skeleton
5
+ ## Mandatory page skeleton
15
6
 
16
7
  ```tsx
17
8
  <PageHeader title="…" subheader="…" breadcrumbs={[…]} actions={…} />
@@ -131,32 +122,15 @@ Centered empty state: `title`, `hint`, optional `children` (e.g. CTA button). Us
131
122
 
132
123
  ### GridLayout
133
124
 
134
- Responsive CSS grid (`repeat(auto-fit, minmax(colWidth, 1fr))`). Use for card/tile dashboards inside a section. Report mapping: dashboard **grid** rows / multi-column tile groups.
125
+ Responsive CSS grid (`repeat(auto-fit, minmax(colWidth, 1fr))`). Use for card/tile dashboards inside a section.
135
126
 
136
127
  ### Card / Foldable
137
128
 
138
129
  Use inside sections for grouped content; see package `AGENT.md` on those components when present. Do not wrap the whole page in Card.
139
130
 
140
- ## Content mode — React → json-dashboard tiles
141
-
142
- When generating **report** / dashboard specs (not workspace routes), map UI blocks to tiles:
143
-
144
- | React / intent | Dashboard tile / markdown |
145
- | ------------------------------- | ----------------------------------------------------------------- |
146
- | `PageHeader` title text | First `markdown` tile `# Title` or report title field |
147
- | `SectionHeader` `title` | `markdown` with `## …` |
148
- | `SectionHeader` `description` | markdown paragraph under that heading |
149
- | `PageContentSection` block | group of tiles or one markdown section |
150
- | `PageColumns` (N equal columns) | group of N sibling tiles in one dashboard row |
151
- | `GridLayout` children | grid row of widget tiles |
152
- | `ChartAreaInteractive` / charts | `dataset_card`, `performance_chart`, etc. (see widget `AGENT.md`) |
153
- | `PageEmptyCanvas` copy | `markdown` explanatory tile |
154
-
155
- See `AGENT.report-only-tiles.md` in the app repo for tiles without a uilib widget.
156
-
157
- ## Shell components (workspace only)
131
+ ## Shell components
158
132
 
159
- Not part of the per-route skeleton but part of **workspace-page** host wiring:
133
+ Not part of the per-route skeleton but part of host app wiring:
160
134
 
161
135
  - **AppShell** / **AppShellMainContent** — sidebar + main column + header slot + footer.
162
136
  - **PageScroll** — scroll root for the main column.
@@ -10,6 +10,8 @@ export { PageHeader } from './PageHeader/PageHeader';
10
10
  export { PageEmptyCanvas } from './PageEmptyCanvas/PageEmptyCanvas';
11
11
  export { PageContent, PageContentSection } from './PageContent/PageContent';
12
12
  export { PageScroll } from './PageScroll/PageScroll';
13
+ export { usePageScrollRestoration } from './usePageScrollRestoration';
14
+ export { readSavedScrollTop } from './pageScrollRestoration';
13
15
  export { PageXScroll } from './PageXScroll/PageXScroll';
14
16
  export { Breadcrumbs } from './Breadcrumbs/Breadcrumbs';
15
17
  export { PageFooter } from './PageFooter/PageFooter';
@@ -0,0 +1,22 @@
1
+ import { isBrowser } from '#uilib/tools/env';
2
+
3
+ export function readSavedScrollTop(key: string): number | null {
4
+ if (!isBrowser) return null;
5
+
6
+ const raw = sessionStorage.getItem(key);
7
+ if (raw == null) return null;
8
+
9
+ const top = Number(raw);
10
+ return Number.isFinite(top) && top > 0 ? top : null;
11
+ }
12
+
13
+ export function saveScrollTop(key: string, top: number): void {
14
+ if (!isBrowser) return;
15
+
16
+ if (top <= 0) {
17
+ sessionStorage.removeItem(key);
18
+ return;
19
+ }
20
+
21
+ sessionStorage.setItem(key, String(top));
22
+ }