@sybilion/uilib 1.4.9 → 1.4.11
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.
- package/dist/agent-glossary/content-prompt.generated.ts +27 -0
- package/dist/agent-glossary/content.generated.ts +27 -0
- package/dist/agent-glossary/content.index.md +4 -0
- package/dist/agent-glossary/content.md +27 -0
- package/dist/agent-glossary/content.prompt.md +27 -0
- package/dist/agent-glossary/workspace.generated.ts +2 -2
- package/dist/agent-glossary/workspace.index.md +2 -2
- package/dist/agent-glossary/workspace.md +2 -2
- package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.js +2 -2
- package/dist/esm/components/ui/Button/Button.styl.js +1 -1
- package/dist/esm/components/ui/ButtonGroup/ButtonGroup.js +9 -0
- package/dist/esm/components/ui/ButtonGroup/ButtonGroup.styl.js +7 -0
- package/dist/esm/components/ui/Chart/Chart.js +3 -3
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.styl.js +1 -1
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPromptComposer.js +1 -1
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSheet.js +13 -0
- package/dist/esm/components/ui/Chat/ChatSheet/useChatPanelChromeModel.js +10 -7
- package/dist/esm/components/ui/Chip/Chip.js +3 -4
- package/dist/esm/components/ui/Chip/Chip.styl.js +2 -2
- package/dist/esm/components/ui/FileChip/FileChip.js +1 -1
- package/dist/esm/components/ui/Page/pageScrollRestoration.js +22 -0
- package/dist/esm/components/ui/Page/usePageScrollRestoration.js +73 -0
- package/dist/esm/components/ui/Renamer/Renamer.js +2 -2
- package/dist/esm/components/ui/Renamer/Renamer.styl.js +2 -2
- package/dist/esm/components/ui/Sidebar/Sidebar.js +91 -73
- package/dist/esm/components/widgets/DriverCard/DriverCard.js +7 -7
- package/dist/esm/components/widgets/DriverCard/DriverPerformanceChart.js +3 -3
- package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.js +2 -2
- package/dist/esm/components/widgets/DriverMap/DriverIcon/DriverIcon.styl.js +1 -1
- package/dist/esm/components/widgets/DriversComparisonChart/DriversComparisonChart.js +1 -0
- package/dist/esm/components/widgets/PerformanceChart/PerformanceTable.js +1 -0
- package/dist/esm/components/widgets/SybilionAppHeader/SybilionAppHeader.styl.js +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/types/src/components/ui/ButtonGroup/ButtonGroup.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ButtonGroup/ButtonGroup.types.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ButtonGroup/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chip/Chip.d.ts +1 -1
- package/dist/esm/types/src/components/ui/Chip/Chip.types.d.ts +4 -2
- package/dist/esm/types/src/components/ui/Page/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/pageScrollRestoration.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/usePageScrollRestoration.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/Sidebar.d.ts +13 -6
- package/dist/esm/types/src/docs/pages/ButtonGroupPage.d.ts +1 -0
- package/dist/esm/types/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +3 -3
- package/src/components/ui/AnalysisLineIcon/AGENT.md +1 -1
- package/src/components/ui/Avatar/AGENT.md +1 -1
- package/src/components/ui/Button/Button.styl +11 -5
- package/src/components/ui/ButtonGroup/AGENT.md +29 -0
- package/src/components/ui/ButtonGroup/ButtonGroup.styl +21 -0
- package/src/components/ui/{Badge/Badge.styl.d.ts → ButtonGroup/ButtonGroup.styl.d.ts} +0 -6
- package/src/components/ui/ButtonGroup/ButtonGroup.tsx +17 -0
- package/src/components/ui/ButtonGroup/ButtonGroup.types.ts +3 -0
- package/src/components/ui/ButtonGroup/index.ts +2 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl +2 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPromptComposer.tsx +1 -0
- package/src/components/ui/Chat/ChatSheet/ChatSheet.tsx +15 -0
- package/src/components/ui/Chat/ChatSheet/useChatPanelChromeModel.tsx +21 -9
- package/src/components/ui/Chip/AGENT.md +4 -3
- package/src/components/ui/Chip/Chip.styl +17 -0
- package/src/components/ui/Chip/Chip.styl.d.ts +2 -0
- package/src/components/ui/Chip/Chip.tsx +10 -6
- package/src/components/ui/Chip/Chip.types.ts +5 -2
- package/src/components/ui/FileChip/FileChip.tsx +1 -1
- package/src/components/ui/Page/index.ts +2 -0
- package/src/components/ui/Page/pageScrollRestoration.ts +22 -0
- package/src/components/ui/Page/usePageScrollRestoration.ts +90 -0
- package/src/components/ui/Renamer/Renamer.styl +24 -4
- package/src/components/ui/Renamer/Renamer.styl.d.ts +2 -0
- package/src/components/ui/Renamer/Renamer.tsx +2 -1
- package/src/components/ui/Sidebar/Sidebar.tsx +158 -99
- package/src/components/widgets/DriverCard/DriverCard.tsx +12 -10
- package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.styl +1 -0
- package/src/components/widgets/DriverMap/DriverIcon/DriverIcon.tsx +3 -3
- package/src/components/widgets/SybilionAppHeader/SybilionAppHeader.styl +2 -2
- package/src/docs/pages/ButtonGroupPage.tsx +45 -0
- package/src/docs/pages/ChipPage.tsx +37 -0
- package/src/docs/pages/RenamerPage.tsx +97 -6
- package/src/docs/pages/VimeoEmbedPage.tsx +4 -5
- package/src/docs/registry.ts +6 -12
- package/src/index.ts +1 -1
- package/dist/esm/components/ui/Badge/Badge.js +0 -11
- package/dist/esm/components/ui/Badge/Badge.styl.js +0 -7
- package/dist/esm/types/src/components/ui/Badge/Badge.d.ts +0 -3
- package/dist/esm/types/src/components/ui/Badge/Badge.types.d.ts +0 -6
- package/dist/esm/types/src/components/ui/Badge/index.d.ts +0 -2
- package/dist/esm/types/src/docs/pages/BadgePage.d.ts +0 -1
- package/dist/esm/types/src/docs/pages/TogglePage.d.ts +0 -1
- package/src/components/ui/Badge/AGENT.md +0 -16
- package/src/components/ui/Badge/Badge.styl +0 -95
- package/src/components/ui/Badge/Badge.tsx +0 -31
- package/src/components/ui/Badge/Badge.types.ts +0 -7
- package/src/components/ui/Badge/index.ts +0 -2
- package/src/docs/pages/BadgePage.tsx +0 -30
- package/src/docs/pages/TogglePage.tsx +0 -27
|
@@ -3,6 +3,33 @@ export const CONTENT_AGENT_UI_PROMPT = `# Sybilion page content glossary (embedd
|
|
|
3
3
|
|
|
4
4
|
Component usage for report/dashboard LLM prompts. Paths are relative to \`@sybilion/uilib\` package root.
|
|
5
5
|
|
|
6
|
+
## ButtonGroup
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- To present a small set of related actions side by side, such as pagination or view toggles implemented with Button.
|
|
13
|
+
- To group outline buttons that share a border, such as filter presets or export format choices.
|
|
14
|
+
- When each segment needs its own label and handler but should look like one control.
|
|
15
|
+
|
|
16
|
+
## When not to use
|
|
17
|
+
|
|
18
|
+
- For mutually exclusive selection state; use ToggleGroup or Tabs instead.
|
|
19
|
+
- For a single action; use Button alone.
|
|
20
|
+
- When buttons are not direct children of the wrapper.
|
|
21
|
+
|
|
22
|
+
## Do
|
|
23
|
+
|
|
24
|
+
- Place Button elements as direct children of ButtonGroup.
|
|
25
|
+
- Use the outline variant when adjacent borders should read as one shared edge.
|
|
26
|
+
- Keep segment labels short so the group stays compact.
|
|
27
|
+
|
|
28
|
+
## Don't
|
|
29
|
+
|
|
30
|
+
- Nest ButtonGroup inside Button or wrap non-button elements expecting grouped styling.
|
|
31
|
+
- Use ButtonGroup for navigation between pages; use links or Tabs instead.
|
|
32
|
+
|
|
6
33
|
## DriverMap
|
|
7
34
|
|
|
8
35
|
DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection highlight. DriverCard shows the detail of the selected driver; both share selection state via controlled selectedDriver.
|
|
@@ -3,6 +3,33 @@ export const CONTENT_AGENT_UI_GLOSSARY = `# Sybilion page content glossary (embe
|
|
|
3
3
|
|
|
4
4
|
Component usage for report/dashboard LLM prompts. Paths are relative to \`@sybilion/uilib\` package root.
|
|
5
5
|
|
|
6
|
+
## ButtonGroup
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- To present a small set of related actions side by side, such as pagination or view toggles implemented with Button.
|
|
13
|
+
- To group outline buttons that share a border, such as filter presets or export format choices.
|
|
14
|
+
- When each segment needs its own label and handler but should look like one control.
|
|
15
|
+
|
|
16
|
+
## When not to use
|
|
17
|
+
|
|
18
|
+
- For mutually exclusive selection state; use ToggleGroup or Tabs instead.
|
|
19
|
+
- For a single action; use Button alone.
|
|
20
|
+
- When buttons are not direct children of the wrapper.
|
|
21
|
+
|
|
22
|
+
## Do
|
|
23
|
+
|
|
24
|
+
- Place Button elements as direct children of ButtonGroup.
|
|
25
|
+
- Use the outline variant when adjacent borders should read as one shared edge.
|
|
26
|
+
- Keep segment labels short so the group stays compact.
|
|
27
|
+
|
|
28
|
+
## Don't
|
|
29
|
+
|
|
30
|
+
- Nest ButtonGroup inside Button or wrap non-button elements expecting grouped styling.
|
|
31
|
+
- Use ButtonGroup for navigation between pages; use links or Tabs instead.
|
|
32
|
+
|
|
6
33
|
## DriverMap
|
|
7
34
|
|
|
8
35
|
DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection highlight. DriverCard shows the detail of the selected driver; both share selection state via controlled selectedDriver.
|
|
@@ -6,6 +6,10 @@ Entry point for report/dashboard agents using `@sybilion/uilib`. Open linked AGE
|
|
|
6
6
|
|
|
7
7
|
- [Page](src/components/ui/Page/AGENT.md) — Sybilion workspace surfaces use a small set of **Page** primitives from `@sybilion/uilib`. Agents must compose these …
|
|
8
8
|
|
|
9
|
+
## UI
|
|
10
|
+
|
|
11
|
+
- [ButtonGroup](src/components/ui/ButtonGroup/AGENT.md) — Layout wrapper that molds adjacent Button children into one segmented control.
|
|
12
|
+
|
|
9
13
|
## Widgets
|
|
10
14
|
|
|
11
15
|
- [DriverMap](src/components/widgets/DriverMap/AGENT.md) — DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection high…
|
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Component usage for report/dashboard LLM prompts. Paths are relative to `@sybilion/uilib` package root.
|
|
4
4
|
|
|
5
|
+
## ButtonGroup
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- To present a small set of related actions side by side, such as pagination or view toggles implemented with Button.
|
|
12
|
+
- To group outline buttons that share a border, such as filter presets or export format choices.
|
|
13
|
+
- When each segment needs its own label and handler but should look like one control.
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
|
|
17
|
+
- For mutually exclusive selection state; use ToggleGroup or Tabs instead.
|
|
18
|
+
- For a single action; use Button alone.
|
|
19
|
+
- When buttons are not direct children of the wrapper.
|
|
20
|
+
|
|
21
|
+
## Do
|
|
22
|
+
|
|
23
|
+
- Place Button elements as direct children of ButtonGroup.
|
|
24
|
+
- Use the outline variant when adjacent borders should read as one shared edge.
|
|
25
|
+
- Keep segment labels short so the group stays compact.
|
|
26
|
+
|
|
27
|
+
## Don't
|
|
28
|
+
|
|
29
|
+
- Nest ButtonGroup inside Button or wrap non-button elements expecting grouped styling.
|
|
30
|
+
- Use ButtonGroup for navigation between pages; use links or Tabs instead.
|
|
31
|
+
|
|
5
32
|
## DriverMap
|
|
6
33
|
|
|
7
34
|
DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection highlight. DriverCard shows the detail of the selected driver; both share selection state via controlled selectedDriver.
|
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
Component usage for report/dashboard LLM prompts. Paths are relative to `@sybilion/uilib` package root.
|
|
4
4
|
|
|
5
|
+
## ButtonGroup
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
- To present a small set of related actions side by side, such as pagination or view toggles implemented with Button.
|
|
12
|
+
- To group outline buttons that share a border, such as filter presets or export format choices.
|
|
13
|
+
- When each segment needs its own label and handler but should look like one control.
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
|
|
17
|
+
- For mutually exclusive selection state; use ToggleGroup or Tabs instead.
|
|
18
|
+
- For a single action; use Button alone.
|
|
19
|
+
- When buttons are not direct children of the wrapper.
|
|
20
|
+
|
|
21
|
+
## Do
|
|
22
|
+
|
|
23
|
+
- Place Button elements as direct children of ButtonGroup.
|
|
24
|
+
- Use the outline variant when adjacent borders should read as one shared edge.
|
|
25
|
+
- Keep segment labels short so the group stays compact.
|
|
26
|
+
|
|
27
|
+
## Don't
|
|
28
|
+
|
|
29
|
+
- Nest ButtonGroup inside Button or wrap non-button elements expecting grouped styling.
|
|
30
|
+
- Use ButtonGroup for navigation between pages; use links or Tabs instead.
|
|
31
|
+
|
|
5
32
|
## DriverMap
|
|
6
33
|
|
|
7
34
|
DriverMap renders a world map with regional driver badges, a bottom strip for world-level drivers, and selection highlight. DriverCard shows the detail of the selected driver; both share selection state via controlled selectedDriver.
|
|
@@ -13,16 +13,16 @@ Entry point for \`@sybilion/uilib\`. Open linked AGENT.md before using a compone
|
|
|
13
13
|
- [AnalysisLineIcon](src/components/ui/AnalysisLineIcon/AGENT.md) — AnalysisLineIcon renders a small solid or dashed line marker in a given colour. Use it as a legend swatch so users ca…
|
|
14
14
|
- [AppHeader](src/components/ui/AppHeader/AGENT.md) — The standalone app layout composes AppShell, Sidebar, and AppShellMainContent into the full chrome for a Sybilion sta…
|
|
15
15
|
- [Avatar](src/components/ui/Avatar/AGENT.md) — Avatar displays a user or entity image with an automatic fallback to initials when the image is missing or fails to l…
|
|
16
|
-
- [Badge](src/components/ui/Badge/AGENT.md) — Badges are compact labels that highlight a status, category, or count. Choose a variant that matches the meaning: def…
|
|
17
16
|
- [BarChart](src/components/ui/BarChart/AGENT.md) — BarChart compares values across categories. Provide rows of data, a category key, and a list of series; choose vertic…
|
|
18
17
|
- [Breadcrumb](src/components/ui/Breadcrumb/AGENT.md) — Breadcrumb shows the user’s location within the page hierarchy as an inline trail of links, with the current page ren…
|
|
19
18
|
- [Button](src/components/ui/Button/AGENT.md) — Buttons trigger an action or event, such as submitting a form or confirming a dialog. Choose a variant that matches t…
|
|
19
|
+
- [ButtonGroup](src/components/ui/ButtonGroup/AGENT.md) — Layout wrapper that molds adjacent Button children into one segmented control.
|
|
20
20
|
- [Card](src/components/ui/Card/AGENT.md) — Card groups related content and actions into a single bounded container with optional header, content, and footer slo…
|
|
21
21
|
- [Chart](src/components/ui/Chart/AGENT.md) — ChartContainer wraps Recharts charts with the library’s theming, mapping a ChartConfig of labels and colours onto CSS…
|
|
22
22
|
- [ChartAreaInteractive](src/components/ui/ChartAreaInteractive/AGENT.md) — ChartAreaInteractive is the full chart shell for time series data, combining an area chart with a time range selector…
|
|
23
23
|
- [Chat](src/components/ui/Chat/AGENT.md) — ChatChrome is the complete chat shell: message list, prompt composer, empty state, and optional preset bubbles. Drive…
|
|
24
24
|
- [Checkbox](src/components/ui/Checkbox/AGENT.md) — Checkbox is a binary control for selecting or deselecting an option. Pair it with a Label linked via htmlFor so the t…
|
|
25
|
-
- [Chip](src/components/ui/Chip/AGENT.md) — Chips are compact
|
|
25
|
+
- [Chip](src/components/ui/Chip/AGENT.md) — Chips are compact capsules for filters, status labels, version tags, and quantitative delta indicators. Use the defau…
|
|
26
26
|
- [Confirm](src/components/ui/Confirm/AGENT.md) — Confirm is a focused confirmation dialog built on Dialog, with a title, body, and paired confirm and cancel actions. …
|
|
27
27
|
- [Dialog](src/components/ui/Dialog/AGENT.md) — Dialog presents content in a modal layer above the page, with a trigger, title, optional subtitle, body content, and …
|
|
28
28
|
- [DonutChart](src/components/ui/DonutChart/AGENT.md) — DonutChart shows how a small number of categories make up a whole. Each datum carries a key, value, and optional labe…
|
|
@@ -12,16 +12,16 @@ Entry point for `@sybilion/uilib`. Open linked AGENT.md before using a component
|
|
|
12
12
|
- [AnalysisLineIcon](src/components/ui/AnalysisLineIcon/AGENT.md) — AnalysisLineIcon renders a small solid or dashed line marker in a given colour. Use it as a legend swatch so users ca…
|
|
13
13
|
- [AppHeader](src/components/ui/AppHeader/AGENT.md) — The standalone app layout composes AppShell, Sidebar, and AppShellMainContent into the full chrome for a Sybilion sta…
|
|
14
14
|
- [Avatar](src/components/ui/Avatar/AGENT.md) — Avatar displays a user or entity image with an automatic fallback to initials when the image is missing or fails to l…
|
|
15
|
-
- [Badge](src/components/ui/Badge/AGENT.md) — Badges are compact labels that highlight a status, category, or count. Choose a variant that matches the meaning: def…
|
|
16
15
|
- [BarChart](src/components/ui/BarChart/AGENT.md) — BarChart compares values across categories. Provide rows of data, a category key, and a list of series; choose vertic…
|
|
17
16
|
- [Breadcrumb](src/components/ui/Breadcrumb/AGENT.md) — Breadcrumb shows the user’s location within the page hierarchy as an inline trail of links, with the current page ren…
|
|
18
17
|
- [Button](src/components/ui/Button/AGENT.md) — Buttons trigger an action or event, such as submitting a form or confirming a dialog. Choose a variant that matches t…
|
|
18
|
+
- [ButtonGroup](src/components/ui/ButtonGroup/AGENT.md) — Layout wrapper that molds adjacent Button children into one segmented control.
|
|
19
19
|
- [Card](src/components/ui/Card/AGENT.md) — Card groups related content and actions into a single bounded container with optional header, content, and footer slo…
|
|
20
20
|
- [Chart](src/components/ui/Chart/AGENT.md) — ChartContainer wraps Recharts charts with the library’s theming, mapping a ChartConfig of labels and colours onto CSS…
|
|
21
21
|
- [ChartAreaInteractive](src/components/ui/ChartAreaInteractive/AGENT.md) — ChartAreaInteractive is the full chart shell for time series data, combining an area chart with a time range selector…
|
|
22
22
|
- [Chat](src/components/ui/Chat/AGENT.md) — ChatChrome is the complete chat shell: message list, prompt composer, empty state, and optional preset bubbles. Drive…
|
|
23
23
|
- [Checkbox](src/components/ui/Checkbox/AGENT.md) — Checkbox is a binary control for selecting or deselecting an option. Pair it with a Label linked via htmlFor so the t…
|
|
24
|
-
- [Chip](src/components/ui/Chip/AGENT.md) — Chips are compact
|
|
24
|
+
- [Chip](src/components/ui/Chip/AGENT.md) — Chips are compact capsules for filters, status labels, version tags, and quantitative delta indicators. Use the defau…
|
|
25
25
|
- [Confirm](src/components/ui/Confirm/AGENT.md) — Confirm is a focused confirmation dialog built on Dialog, with a title, body, and paired confirm and cancel actions. …
|
|
26
26
|
- [Dialog](src/components/ui/Dialog/AGENT.md) — Dialog presents content in a modal layer above the page, with a trigger, title, optional subtitle, body content, and …
|
|
27
27
|
- [DonutChart](src/components/ui/DonutChart/AGENT.md) — DonutChart shows how a small number of categories make up a whole. Each datum carries a key, value, and optional labe…
|
|
@@ -12,16 +12,16 @@ Entry point for `@sybilion/uilib`. Open linked AGENT.md before using a component
|
|
|
12
12
|
- [AnalysisLineIcon](src/components/ui/AnalysisLineIcon/AGENT.md) — AnalysisLineIcon renders a small solid or dashed line marker in a given colour. Use it as a legend swatch so users ca…
|
|
13
13
|
- [AppHeader](src/components/ui/AppHeader/AGENT.md) — The standalone app layout composes AppShell, Sidebar, and AppShellMainContent into the full chrome for a Sybilion sta…
|
|
14
14
|
- [Avatar](src/components/ui/Avatar/AGENT.md) — Avatar displays a user or entity image with an automatic fallback to initials when the image is missing or fails to l…
|
|
15
|
-
- [Badge](src/components/ui/Badge/AGENT.md) — Badges are compact labels that highlight a status, category, or count. Choose a variant that matches the meaning: def…
|
|
16
15
|
- [BarChart](src/components/ui/BarChart/AGENT.md) — BarChart compares values across categories. Provide rows of data, a category key, and a list of series; choose vertic…
|
|
17
16
|
- [Breadcrumb](src/components/ui/Breadcrumb/AGENT.md) — Breadcrumb shows the user’s location within the page hierarchy as an inline trail of links, with the current page ren…
|
|
18
17
|
- [Button](src/components/ui/Button/AGENT.md) — Buttons trigger an action or event, such as submitting a form or confirming a dialog. Choose a variant that matches t…
|
|
18
|
+
- [ButtonGroup](src/components/ui/ButtonGroup/AGENT.md) — Layout wrapper that molds adjacent Button children into one segmented control.
|
|
19
19
|
- [Card](src/components/ui/Card/AGENT.md) — Card groups related content and actions into a single bounded container with optional header, content, and footer slo…
|
|
20
20
|
- [Chart](src/components/ui/Chart/AGENT.md) — ChartContainer wraps Recharts charts with the library’s theming, mapping a ChartConfig of labels and colours onto CSS…
|
|
21
21
|
- [ChartAreaInteractive](src/components/ui/ChartAreaInteractive/AGENT.md) — ChartAreaInteractive is the full chart shell for time series data, combining an area chart with a time range selector…
|
|
22
22
|
- [Chat](src/components/ui/Chat/AGENT.md) — ChatChrome is the complete chat shell: message list, prompt composer, empty state, and optional preset bubbles. Drive…
|
|
23
23
|
- [Checkbox](src/components/ui/Checkbox/AGENT.md) — Checkbox is a binary control for selecting or deselecting an option. Pair it with a Label linked via htmlFor so the t…
|
|
24
|
-
- [Chip](src/components/ui/Chip/AGENT.md) — Chips are compact
|
|
24
|
+
- [Chip](src/components/ui/Chip/AGENT.md) — Chips are compact capsules for filters, status labels, version tags, and quantitative delta indicators. Use the defau…
|
|
25
25
|
- [Confirm](src/components/ui/Confirm/AGENT.md) — Confirm is a focused confirmation dialog built on Dialog, with a title, body, and paired confirm and cancel actions. …
|
|
26
26
|
- [Dialog](src/components/ui/Dialog/AGENT.md) — Dialog presents content in a modal layer above the page, with a trigger, title, optional subtitle, body content, and …
|
|
27
27
|
- [DonutChart](src/components/ui/DonutChart/AGENT.md) — DonutChart shows how a small number of categories make up a whole. Each datum carries a key, value, and optional labe…
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { useRef, useMemo, useEffect, useState } from 'react';
|
|
4
4
|
import { AnalysisLineIcon } from '../AnalysisLineIcon/AnalysisLineIcon.js';
|
|
5
|
-
import {
|
|
5
|
+
import { Chip } from '../Chip/Chip.js';
|
|
6
6
|
import { LabelWithId } from '../LabelWithId/LabelWithId.js';
|
|
7
7
|
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../Select/Select.js';
|
|
8
8
|
import { TextShimmer } from '../TextShimmer/TextShimmer.js';
|
|
@@ -26,7 +26,7 @@ const shouldBlockSelectKeydownWhileRenaming = (e) => {
|
|
|
26
26
|
function renderItemContent(item) {
|
|
27
27
|
const failed = isFailed(item);
|
|
28
28
|
if (failed) {
|
|
29
|
-
return (jsx(
|
|
29
|
+
return (jsx(Chip, { variant: "negative", squared: true, className: S.itemBadge, children: "failed" }));
|
|
30
30
|
}
|
|
31
31
|
const color = item.color || 'var(--foreground)';
|
|
32
32
|
return (jsx(AnalysisLineIcon, { color: color, variant: isDashedIcon(item) ? 'dashed' : 'solid' }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Button_root__NT88y{align-items:center;border:0;border-radius:var(--radius-button);cursor:pointer;display:inline-flex;flex-shrink:0;font-family:Manrope,sans-serif;font-size:15px;font-weight:500;gap:10px;justify-content:center;line-height:1;outline:none;transition:all var(--dur-base) var(--ease-standard);white-space:nowrap}.Button_root__NT88y:disabled{opacity:.5;pointer-events:none}.Button_root__NT88y:focus-visible{border-color:var(--ring);ring:3px var(--ring-50)}.Button_root__NT88y[aria-invalid=true]{border-color:var(--destructive);ring:3px var(--destructive-200)}.Button_root__NT88y svg{flex-shrink:0;pointer-events:none}.Button_default__xZ4lt{background-color:var(--primary);color:var(--primary-foreground)}.Button_default__xZ4lt:hover{background-color:var(--sb-gray-800)}.Button_destructive__g1Ume{background-color:var(--destructive-900);color:#fff}.Button_destructive__g1Ume:hover{background-color:var(--destructive-600)}.Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-200)}.dark .Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-400)}.Button_outline__E4R5l{background-color:var(--background);border:1px solid var(--border)}.Button_outline__E4R5l:hover{background-color:var(--sb-gray-50);border-color:var(--border)}.dark .Button_outline__E4R5l{background-color:var(--sb-gray-900);border-color:var(--border)}.dark .Button_outline__E4R5l:hover{background-color:var(--sb-gray-800)}.Button_secondary__ptn3U{background-color:var(--secondary);color:var(--secondary-foreground)}.Button_secondary__ptn3U:hover{background-color:var(--secondary-800)}.Button_ghost__okHgV:hover{background-color:var(--
|
|
3
|
+
var css_248z = ".Button_root__NT88y{align-items:center;border:0;border-radius:var(--radius-button);cursor:pointer;display:inline-flex;flex-shrink:0;font-family:Manrope,sans-serif;font-size:15px;font-weight:500;gap:10px;justify-content:center;line-height:1;outline:none;transition:all var(--dur-base) var(--ease-standard);white-space:nowrap}.Button_root__NT88y:active{opacity:.8}.Button_root__NT88y:disabled{opacity:.5;pointer-events:none}.Button_root__NT88y:focus-visible{border-color:var(--ring);ring:3px var(--ring-50)}.Button_root__NT88y[aria-invalid=true]{border-color:var(--destructive);ring:3px var(--destructive-200)}.Button_root__NT88y svg{flex-shrink:0;pointer-events:none}.Button_default__xZ4lt{background-color:var(--primary);color:var(--primary-foreground)}.Button_default__xZ4lt:hover{background-color:var(--sb-gray-800)}.dark .Button_default__xZ4lt:hover{background-color:var(--sb-gray-600)}.Button_destructive__g1Ume{background-color:var(--destructive-900);color:#fff}.Button_destructive__g1Ume:hover{background-color:var(--destructive-600)}.Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-200)}.dark .Button_destructive__g1Ume:focus-visible{ring:3px var(--destructive-400)}.Button_outline__E4R5l{background-color:var(--background);border:1px solid var(--border)}.Button_outline__E4R5l:hover{background-color:var(--sb-gray-50);border-color:var(--border)}.dark .Button_outline__E4R5l{background-color:var(--sb-gray-900);border-color:var(--border)}.dark .Button_outline__E4R5l:hover{background-color:var(--sb-gray-800)}.Button_secondary__ptn3U{background-color:var(--secondary);color:var(--secondary-foreground)}.Button_secondary__ptn3U:hover{background-color:var(--secondary-800)}.Button_ghost__okHgV:hover{background-color:var(--sb-gray-100);color:var(--foreground)}.dark .Button_ghost__okHgV:hover{background-color:var(--sb-gray-900)}.Button_link__yHy2o{color:var(--primary);text-decoration:underline;text-underline-offset:4px}.Button_link__yHy2o:hover{text-decoration:underline}.Button_sizeSm__skgOG{border-radius:var(--p-5);font-size:13px;height:30px;padding:0 14px}.Button_sizeMd__7MeqU{border-radius:var(--p-4);height:44px;padding:0 var(--p-4)}.Button_sizeLg__Xfon-{border-radius:var(--p-4);font-size:var(--text-base);height:48px;padding:0 var(--p-6)}.Button_sizeIcon__9ef49{height:48px;padding:0;width:48px}.Button_sizeIcon__9ef49.Button_sizeSm__skgOG{height:36px;padding:0;width:36px}.Button_sizeIcon__9ef49.Button_sizeMd__7MeqU{height:48px;padding:0;width:48px}.Button_sizeIcon__9ef49.Button_sizeLg__Xfon-{height:56px;padding:0;width:56px}";
|
|
4
4
|
var S = {"root":"Button_root__NT88y","default":"Button_default__xZ4lt","destructive":"Button_destructive__g1Ume","outline":"Button_outline__E4R5l","secondary":"Button_secondary__ptn3U","ghost":"Button_ghost__okHgV","link":"Button_link__yHy2o","sizeSm":"Button_sizeSm__skgOG","sizeMd":"Button_sizeMd__7MeqU","sizeLg":"Button_sizeLg__Xfon-","sizeIcon":"Button_sizeIcon__9ef49"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import S from './ButtonGroup.styl.js';
|
|
4
|
+
|
|
5
|
+
function ButtonGroup({ className, ...props }) {
|
|
6
|
+
return (jsx("div", { "data-slot": "button-group", className: cn(S.root, className), role: "group", ...props }));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".ButtonGroup_root__d4FKU{align-items:stretch;display:inline-flex;width:-moz-fit-content;width:fit-content}.ButtonGroup_root__d4FKU>button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}.ButtonGroup_root__d4FKU>button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ButtonGroup_root__d4FKU>button:focus-visible,.ButtonGroup_root__d4FKU>button:hover{z-index:1}.ButtonGroup_root__d4FKU>button:disabled{z-index:0}";
|
|
4
|
+
var S = {"root":"ButtonGroup_root__d4FKU"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -6,15 +6,15 @@ import 'react';
|
|
|
6
6
|
import './Chart.context.js';
|
|
7
7
|
import './Chart.styl.js';
|
|
8
8
|
import '../AnalysisLineIcon/AnalysisLineIcon.styl.js';
|
|
9
|
-
import '
|
|
10
|
-
import '../
|
|
9
|
+
import 'lucide-react';
|
|
10
|
+
import '../Chip/Chip.styl.js';
|
|
11
11
|
import '../LabelWithId/LabelWithId.styl.js';
|
|
12
12
|
import '@radix-ui/react-select';
|
|
13
|
-
import 'lucide-react';
|
|
14
13
|
import '../Select/Select.styl.js';
|
|
15
14
|
import '../TextShimmer/TextShimmer.js';
|
|
16
15
|
import '@phosphor-icons/react';
|
|
17
16
|
import '../AnalysesSelector/AnalysesSelector.styl.js';
|
|
17
|
+
import '@radix-ui/react-slot';
|
|
18
18
|
import '../Button/Button.styl.js';
|
|
19
19
|
import '../Input/Input.js';
|
|
20
20
|
import '../Tooltip/Tooltip.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.ChatPrompt_root__5G5bq{align-items:stretch;display:flex;flex-direction:column;gap:var(--p-2);padding:var(--p-3);position:relative}.ChatPrompt_composer__H3c3N{align-items:flex-end;display:flex;flex-direction:row;gap:var(--p-3);position:relative;width:100%}.ChatPrompt_fileInput__xdgPn{display:none}.ChatPrompt_attachButton__gi-qF,.ChatPrompt_submitButton__gvhDN{position:relative;top:-2px}.ChatPrompt_attachButton__gi-qF{align-self:flex-end;flex-shrink:0}.ChatPrompt_editorWrap__Q7gat{align-self:stretch;flex:1;min-width:0}.ChatPrompt_editorMount__Phh4D{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;max-height:200px;min-height:40px;min-width:0;padding:0!important}.ChatPrompt_editorMount__Phh4D:focus-within{box-shadow:none!important}.ChatPrompt_editorMount__Phh4D .ProseMirror{border:none!important;box-shadow:none!important;flex:1;margin:0;max-height:200px!important;min-height:40px!important;outline:none!important;overflow-x:hidden!important;overflow-y:auto!important;padding:var(--p-2) 0 0!important;resize:none!important;white-space:pre-wrap;word-break:break-word}.ChatPrompt_editorMount__Phh4D .ProseMirror p.is-empty.is-editor-empty:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip,.ChatPrompt_editorMount__Phh4D .ProseMirror .slash-mention{align-items:center;background:var(--muted);border-radius:var(--radius-sm);display:inline-flex;font-size:.875em;line-height:1.4;padding:0 var(--p-1);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline;white-space:nowrap}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip{color:var(--foreground)}.ChatPrompt_submitColumn__0rY1R{align-items:center;display:flex;flex-direction:column;flex-shrink:0;justify-content:flex-end}.ChatPrompt_submitColumn__0rY1R>button:focus{box-shadow:0 0 0 2px var(--brand-color-500)!important}.ChatPrompt_submitColumn__0rY1R>button:first-child{border:none;position:relative;transition:all .2s}.ChatPrompt_submitColumn__0rY1R>button:first-child:focus{transform:scale(1.2)}.ChatPrompt_submitColumn__0rY1R>button:first-child:before{bottom:-100%;content:\"\";left:-100%;position:absolute;right:-100%;top:-100%}.ChatPrompt_attachments__KG-fG{display:flex;flex-wrap:wrap;gap:var(--p-2);margin-bottom:var(--p-2)}.ChatPrompt_attachmentItem__QJk7J{flex:1 1 300px;max-width:300px;min-width:0}";
|
|
3
|
+
var css_248z = "@media (max-width:768px){:root{--page-x-padding:var(--p-6);--page-y-padding:var(--p-6)}}.ChatPrompt_root__5G5bq{align-items:stretch;display:flex;flex-direction:column;gap:var(--p-2);padding:var(--p-3);position:relative}.ChatPrompt_composer__H3c3N{align-items:flex-end;display:flex;flex-direction:row;gap:var(--p-3);position:relative;width:100%}.ChatPrompt_fileInput__xdgPn{display:none}.ChatPrompt_attachButton__gi-qF,.ChatPrompt_submitButton__gvhDN{position:relative;top:-2px}.ChatPrompt_attachButton__gi-qF{align-self:flex-end;flex-shrink:0}.ChatPrompt_editorWrap__Q7gat{align-self:stretch;flex:1;min-width:0}.ChatPrompt_editorMount__Phh4D{background:transparent;border:none;border-radius:0!important;box-shadow:none!important;display:flex;flex:1;flex-direction:column;max-height:200px;min-height:40px;min-width:0;padding:0!important}.ChatPrompt_editorMount__Phh4D:focus-within{box-shadow:none!important}.ChatPrompt_editorMount__Phh4D .ProseMirror{border:none!important;box-shadow:none!important;flex:1;margin:0;max-height:200px!important;min-height:40px!important;outline:none!important;overflow-x:hidden!important;overflow-y:auto!important;padding:var(--p-2) 0 0!important;resize:none!important;white-space:pre-wrap;word-break:break-word}.ChatPrompt_editorMount__Phh4D .ProseMirror p.is-empty.is-editor-empty:before{color:var(--muted-foreground);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip,.ChatPrompt_editorMount__Phh4D .ProseMirror .slash-mention{align-items:center;background:var(--muted);border-radius:var(--radius-sm);display:inline-flex;font-size:.875em;line-height:1.4;padding:0 var(--p-1);-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline;white-space:nowrap}.ChatPrompt_editorMount__Phh4D .ProseMirror .chat-prompt-command-chip{color:var(--foreground)}.ChatPrompt_submitColumn__0rY1R{align-items:center;display:flex;flex-direction:column;flex-shrink:0;height:100%;justify-content:flex-end;padding-bottom:2px}.ChatPrompt_submitColumn__0rY1R>button:focus{box-shadow:0 0 0 2px var(--brand-color-500)!important}.ChatPrompt_submitColumn__0rY1R>button:first-child{border:none;position:relative;transition:all .2s}.ChatPrompt_submitColumn__0rY1R>button:first-child:focus{transform:scale(1.2)}.ChatPrompt_submitColumn__0rY1R>button:first-child:before{bottom:-100%;content:\"\";left:-100%;position:absolute;right:-100%;top:-100%}.ChatPrompt_attachments__KG-fG{display:flex;flex-wrap:wrap;gap:var(--p-2);margin-bottom:var(--p-2)}.ChatPrompt_attachmentItem__QJk7J{flex:1 1 300px;max-width:300px;min-width:0}";
|
|
4
4
|
var S = {"root":"ChatPrompt_root__5G5bq","composer":"ChatPrompt_composer__H3c3N","fileInput":"ChatPrompt_fileInput__xdgPn","attachButton":"ChatPrompt_attachButton__gi-qF","submitButton":"ChatPrompt_submitButton__gvhDN","editorWrap":"ChatPrompt_editorWrap__Q7gat","editorMount":"ChatPrompt_editorMount__Phh4D","submitColumn":"ChatPrompt_submitColumn__0rY1R","attachments":"ChatPrompt_attachments__KG-fG","attachmentItem":"ChatPrompt_attachmentItem__QJk7J"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ const ChatPromptComposer = forwardRef(function ChatPromptComposer({ editor, disa
|
|
|
23
23
|
return (jsxs("div", { className: S.composer, children: [showAttachButton ? (jsxs(Fragment, { children: [jsx("input", { ref: fileInputRef, type: "file", accept: attachmentAccept, multiple: true, className: S.fileInput, disabled: disabled, onChange: handleFileInputChange }), jsx(Button, { type: "button", variant: "ghost", icon: true, size: "sm", className: S.attachButton, "aria-label": "Attach file", disabled: disabled, onClick: e => {
|
|
24
24
|
e.preventDefault();
|
|
25
25
|
fileInputRef.current?.click();
|
|
26
|
-
}, children: jsx(PaperclipIcon, { size: 16 }) })] })) : null, jsx("div", { className: S.editorWrap, children: jsx(EditorContent, { editor: editor, className: S.editorMount }) }), jsx("div", { className: S.submitColumn, children: jsx(Button, { type: "submit", size: "sm", disabled: disabled || !canSubmit, onMouseDown: e => e.preventDefault(), children: jsx(SendHorizontalIcon, { size: 16 }) }) })] }));
|
|
26
|
+
}, children: jsx(PaperclipIcon, { size: 16 }) })] })) : null, jsx("div", { className: S.editorWrap, children: jsx(EditorContent, { editor: editor, className: S.editorMount }) }), jsx("div", { className: S.submitColumn, children: jsx(Button, { type: "submit", size: "sm", icon: true, disabled: disabled || !canSubmit, onMouseDown: e => e.preventDefault(), children: jsx(SendHorizontalIcon, { size: 16 }) }) })] }));
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export { ChatPromptComposer };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
4
|
import { Button } from '../../Button/Button.js';
|
|
4
5
|
import { ChatChrome } from '../ChatChrome/ChatChrome.js';
|
|
@@ -32,10 +33,22 @@ function ChatSheet({ triggerLabel = 'Open Chat', triggerAriaLabel, actionsRef, r
|
|
|
32
33
|
openNewChatAndSubmit: model.openNewChatAndSubmit,
|
|
33
34
|
};
|
|
34
35
|
}
|
|
36
|
+
const [chromePortalReady, setChromePortalReady] = useState(false);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!model.isOpen) {
|
|
39
|
+
setChromePortalReady(false);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const frameId = requestAnimationFrame(() => {
|
|
43
|
+
setChromePortalReady(true);
|
|
44
|
+
});
|
|
45
|
+
return () => cancelAnimationFrame(frameId);
|
|
46
|
+
}, [model.isOpen]);
|
|
35
47
|
if (inline) {
|
|
36
48
|
return jsx(ChatChrome, { ...model.chromeProps });
|
|
37
49
|
}
|
|
38
50
|
return (jsxs(Fragment, { children: [renderTrigger?.(model.toggleOpen, model.isOpen) ?? (jsx(Button, { variant: "outline", "aria-label": triggerAriaLabel, onClick: model.toggleOpen, children: triggerLabel })), model.isOpen &&
|
|
51
|
+
chromePortalReady &&
|
|
39
52
|
model.chatPanelContainer &&
|
|
40
53
|
createPortal(jsx(ChatChrome, { ...model.chromeProps }), model.chatPanelContainer)] }));
|
|
41
54
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
+
import { useState, useRef, useEffect, useMemo, useCallback, startTransition } from 'react';
|
|
3
3
|
import { MessageRole } from '../Chat.types.js';
|
|
4
4
|
import { isGraphIntakeAssistantStepComplete, matchUserTextToQuickReply, isPresetScriptGraph, branchesFromPresetScriptGraph, parseScriptLine, textHasQuickReplyMarkers, branchKeysUsedFromChatHistory, branchKeysUsedByUserMessages, extractQuickReplyLabelKeyPairsFromText, entryBranchKeyBeforeLastAssistant } from '../ChatMessage/presetScript.js';
|
|
5
5
|
import { loadingLabelFromSendPayload, displayTextFromSendPayload, buildChatSendMessagePayload } from '../buildChatSendMessagePayload.js';
|
|
@@ -11,7 +11,7 @@ import { useIsMobile } from '../../../../hooks/useIsMobile.js';
|
|
|
11
11
|
import { useQueryParams } from '../../../../hooks/useQueryParams.js';
|
|
12
12
|
import logger from '../../../../lib/logger.js';
|
|
13
13
|
import { mergePresetFreeformDefaults } from '../../../../utils/chatPresetMerge.js';
|
|
14
|
-
import {
|
|
14
|
+
import { useSidebarState, useSidebarActions, DISMISS_CHAT_FOR_LAYOUT_EVENT } from '../../Sidebar/Sidebar.js';
|
|
15
15
|
import { Chat } from '../Chat.js';
|
|
16
16
|
import { shouldOpenChatFromUrl, shouldHealChatShellDesync, shouldCloseStaleLocalChatOpen, shouldCloseOrphanShellChat, shouldDismissChatAfterShellClosed, isChatPanelVisible } from './chatPanelOpenSync.js';
|
|
17
17
|
|
|
@@ -25,7 +25,8 @@ const PROMPT_QUERY_PARAM = 'prompt';
|
|
|
25
25
|
function useChatPanelChromeModel({ embedAsPage, presets, scopeId, onMessage, onScriptComplete, renderMessageChart, renderSystemMessage, emptyState, allowedAttachments, allowPdfAttachments, onAttachmentsDropped, slashCommandItems, onSlashItemCommand, copyHistoryOnNewChat = false, transformSendPayload, submitPresetsViaApi = false, }) {
|
|
26
26
|
const effectiveScopeId = scopeId ?? NO_SCOPE_FALLBACK;
|
|
27
27
|
const isMobile = useIsMobile();
|
|
28
|
-
const { chatPanelContainer, isOpen: sidebarNavOpen,
|
|
28
|
+
const { chatPanelContainer, isOpen: sidebarNavOpen, sidebarWidthPx, chatWidthPx, chatPanelOpen: shellChatPanelOpen, } = useSidebarState();
|
|
29
|
+
const { setOpen: setSidebarNavOpen, setChatWidthPx, getShellWidth, setChatPanelOpen, } = useSidebarActions();
|
|
29
30
|
const [localUiBusy, setLocalUiBusy] = useState(false);
|
|
30
31
|
const [outboundLoadingLabel, setOutboundLoadingLabel] = useState();
|
|
31
32
|
const { chats, currentChatId, setCurrentChatId, newChat, sendMessage, addMessage, removeMessageById, } = useChatsForScopeId(effectiveScopeId);
|
|
@@ -138,10 +139,12 @@ function useChatPanelChromeModel({ embedAsPage, presets, scopeId, onMessage, onS
|
|
|
138
139
|
layoutDismissedRef.current = false;
|
|
139
140
|
openedShellChatRef.current = true;
|
|
140
141
|
setChatPanelOpen(true);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
startTransition(() => {
|
|
143
|
+
setIsOpen(true);
|
|
144
|
+
if (!searchParams.has(CHAT_QUERY_PARAM)) {
|
|
145
|
+
addSearchParams({ [CHAT_QUERY_PARAM]: CHAT_OPEN_VALUE });
|
|
146
|
+
}
|
|
147
|
+
});
|
|
145
148
|
return;
|
|
146
149
|
}
|
|
147
150
|
openedShellChatRef.current = false;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import { TrendingUp, TrendingDown } from 'lucide-react';
|
|
4
3
|
import S from './Chip.styl.js';
|
|
4
|
+
import cn from 'classnames';
|
|
5
5
|
|
|
6
|
-
function Chip({ className, variant = 'neutral', dot, trend, children, ...props }) {
|
|
7
|
-
const showDot = dot ?? variant === 'neutral';
|
|
6
|
+
function Chip({ className, variant = 'neutral', dot, trend, squared = false, children, ...props }) {
|
|
8
7
|
const TrendIcon = trend === 'up' ? TrendingUp : trend === 'down' ? TrendingDown : null;
|
|
9
|
-
return (jsxs("span", { "data-slot": "chip", className: cn(S.root, S[`variant-${variant}`], className), ...props, children: [
|
|
8
|
+
return (jsxs("span", { "data-slot": "chip", className: cn(S.root, S[`variant-${variant}`], squared && S.squared, className), ...props, children: [dot && jsx("span", { className: S.dot, "aria-hidden": "true" }), TrendIcon && (jsx(TrendIcon, { className: S.arrow, strokeWidth: 1.5, "aria-hidden": "true" })), children] }));
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export { Chip };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Chip_root__ypULj{align-items:center;border-radius:var(--radius-pill);display:inline-flex;flex-shrink:0;font-family:var(--font-family-body);font-size:11px;font-weight:400;gap:6px;letter-spacing:var(--tracking-body);line-height:1rem;padding:5px 10px;transition:background-color var(--dur-base) var(--ease-standard),color var(--dur-base) var(--ease-standard),border-color var(--dur-base) var(--ease-standard);white-space:nowrap;width:-moz-fit-content;width:fit-content}.Chip_root__ypULj .Chip_dot__sz4XM{background:var(--sb-cyan-400);border-radius:50%;flex:none;height:6px;width:6px}.Chip_root__ypULj .Chip_arrow__hgcsB{flex:none;height:10px;pointer-events:none;width:10px}.Chip_root__ypULj.Chip_variant-neutral__9MWgc{background:var(--sb-slate-100);color:var(--sb-slate-800)}.dark .Chip_root__ypULj.Chip_variant-neutral__9MWgc{background:var(--sb-slate-800);color:var(--sb-slate-200)}.Chip_root__ypULj.Chip_variant-line__CsrUc{background:var(--background);border:1px solid var(--border);color:var(--sb-slate-900)}.dark .Chip_root__ypULj.Chip_variant-line__CsrUc{color:var(--sb-slate-100)}.Chip_root__ypULj.Chip_variant-active__qV9nv{background:transparent;border:1px solid var(--sb-cyan-400);color:var(--sb-slate-900)}.dark .Chip_root__ypULj.Chip_variant-active__qV9nv{color:var(--sb-slate-100)}.Chip_root__ypULj.Chip_variant-filled__z1jP9{background:var(--sb-slate-900);color:var(--sb-slate-50)}.dark .Chip_root__ypULj.Chip_variant-filled__z1jP9{background:var(--sb-slate-100);color:var(--sb-slate-900)}.Chip_root__ypULj.Chip_variant-accent__0e6P6{background:var(--sb-cyan-100);color:var(--sb-slate-900)}.Chip_root__ypULj.Chip_variant-positive__bH2ls{background:var(--status-positive-bg);color:var(--status-positive)}.Chip_root__ypULj.Chip_variant-negative__4mhBO{background:var(--status-negative-bg);color:var(--status-negative)}";
|
|
4
|
-
var S = {"root":"Chip_root__ypULj","dot":"Chip_dot__sz4XM","arrow":"Chip_arrow__hgcsB","variant-neutral":"Chip_variant-neutral__9MWgc","variant-line":"Chip_variant-line__CsrUc","variant-active":"Chip_variant-active__qV9nv","variant-filled":"Chip_variant-filled__z1jP9","variant-accent":"Chip_variant-accent__0e6P6","variant-positive":"Chip_variant-positive__bH2ls","variant-negative":"Chip_variant-negative__4mhBO"};
|
|
3
|
+
var css_248z = ".Chip_root__ypULj{align-items:center;border-radius:var(--radius-pill);display:inline-flex;flex-shrink:0;font-family:var(--font-family-body);font-size:11px;font-weight:400;gap:6px;letter-spacing:var(--tracking-body);line-height:1rem;padding:5px 10px;transition:background-color var(--dur-base) var(--ease-standard),color var(--dur-base) var(--ease-standard),border-color var(--dur-base) var(--ease-standard);white-space:nowrap;width:-moz-fit-content;width:fit-content}.Chip_root__ypULj.Chip_squared__5OY6c{border-radius:var(--p-1)}.Chip_root__ypULj>svg{height:.75rem;pointer-events:none;width:.75rem}.Chip_root__ypULj .Chip_dot__sz4XM{background:var(--sb-cyan-400);border-radius:50%;flex:none;height:6px;width:6px}.Chip_root__ypULj .Chip_arrow__hgcsB{flex:none;height:10px;pointer-events:none;width:10px}.Chip_root__ypULj.Chip_variant-neutral__9MWgc{background:var(--sb-slate-100);color:var(--sb-slate-800)}.dark .Chip_root__ypULj.Chip_variant-neutral__9MWgc{background:var(--sb-slate-800);color:var(--sb-slate-200)}.Chip_root__ypULj.Chip_variant-line__CsrUc{background:var(--background);border:1px solid var(--border);color:var(--sb-slate-900)}.dark .Chip_root__ypULj.Chip_variant-line__CsrUc{color:var(--sb-slate-100)}.Chip_root__ypULj.Chip_variant-active__qV9nv{background:transparent;border:1px solid var(--sb-cyan-400);color:var(--sb-slate-900)}.dark .Chip_root__ypULj.Chip_variant-active__qV9nv{color:var(--sb-slate-100)}.Chip_root__ypULj.Chip_variant-filled__z1jP9{background:var(--sb-slate-900);color:var(--sb-slate-50)}.dark .Chip_root__ypULj.Chip_variant-filled__z1jP9{background:var(--sb-slate-100);color:var(--sb-slate-900)}.Chip_root__ypULj.Chip_variant-accent__0e6P6{background:var(--sb-cyan-100);color:var(--sb-slate-900)}.Chip_root__ypULj.Chip_variant-positive__bH2ls{background:var(--status-positive-bg);color:var(--status-positive)}.Chip_root__ypULj.Chip_variant-negative__4mhBO{background:var(--status-negative-bg);color:var(--status-negative)}.Chip_root__ypULj.Chip_variant-yellow__zzDna{background-color:var(--sb-yellow-50);color:var(--sb-yellow-600)}.dark .Chip_root__ypULj.Chip_variant-yellow__zzDna{background-color:var(--sb-yellow-900);color:var(--sb-yellow-400)}";
|
|
4
|
+
var S = {"root":"Chip_root__ypULj","squared":"Chip_squared__5OY6c","dot":"Chip_dot__sz4XM","arrow":"Chip_arrow__hgcsB","variant-neutral":"Chip_variant-neutral__9MWgc","variant-line":"Chip_variant-line__CsrUc","variant-active":"Chip_variant-active__qV9nv","variant-filled":"Chip_variant-filled__z1jP9","variant-accent":"Chip_variant-accent__0e6P6","variant-positive":"Chip_variant-positive__bH2ls","variant-negative":"Chip_variant-negative__4mhBO","variant-yellow":"Chip_variant-yellow__zzDna"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -13,7 +13,7 @@ function FormatIcon({ format }) {
|
|
|
13
13
|
return (jsx(FileTextIcon, { size: FORMAT_ICON_SIZE, "aria-hidden": true, style: { color: 'var(--muted-foreground)' } }));
|
|
14
14
|
}
|
|
15
15
|
function FileChipHeader({ name, format, hint, icon, onRemove, }) {
|
|
16
|
-
return (jsx(CardHeader, { className: S.header, icon: icon ?? jsx(FormatIcon, { format: format }), title: name, description: hint, titleClassName: S.title, descriptionClassName: S.hint, tooltipProps: { maxWidth: 400 }, children: onRemove ? (jsx(CardAction, { children: jsx("button", { type: "button", className: S.remove, "aria-label": `Remove ${name}`, onClick: onRemove, children: jsx(XIcon, { size: 14, "aria-hidden": true }) }) })) : null }));
|
|
16
|
+
return (jsx(CardHeader, { className: S.header, icon: icon ?? jsx(FormatIcon, { format: format }), title: name, description: hint, titleClassName: S.title, descriptionClassName: S.hint, tooltipProps: { maxWidth: 400, overTrigger: true }, children: onRemove ? (jsx(CardAction, { children: jsx("button", { type: "button", className: S.remove, "aria-label": `Remove ${name}`, onClick: onRemove, children: jsx(XIcon, { size: 14, "aria-hidden": true }) }) })) : null }));
|
|
17
17
|
}
|
|
18
18
|
function FileChip({ name, format, hint, icon, onClick, onRemove, className, }) {
|
|
19
19
|
const header = (jsx(FileChipHeader, { name: name, format: format, hint: hint, icon: icon, onRemove: onRemove }));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isBrowser } from '../../../tools/env.js';
|
|
2
|
+
|
|
3
|
+
function readSavedScrollTop(key) {
|
|
4
|
+
if (!isBrowser)
|
|
5
|
+
return null;
|
|
6
|
+
const raw = sessionStorage.getItem(key);
|
|
7
|
+
if (raw == null)
|
|
8
|
+
return null;
|
|
9
|
+
const top = Number(raw);
|
|
10
|
+
return Number.isFinite(top) && top > 0 ? top : null;
|
|
11
|
+
}
|
|
12
|
+
function saveScrollTop(key, top) {
|
|
13
|
+
if (!isBrowser)
|
|
14
|
+
return;
|
|
15
|
+
if (top <= 0) {
|
|
16
|
+
sessionStorage.removeItem(key);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
sessionStorage.setItem(key, String(top));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { readSavedScrollTop, saveScrollTop };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useContext, useRef, useCallback, useEffect } from 'react';
|
|
2
|
+
import debounce from '../../../tools/debounce.js';
|
|
3
|
+
import { PageContext } from './pageContext.js';
|
|
4
|
+
import { saveScrollTop, readSavedScrollTop } from './pageScrollRestoration.js';
|
|
5
|
+
|
|
6
|
+
const SCROLL_SAVE_MS = 150;
|
|
7
|
+
/** Session scroll restoration for a PageScroll ancestor (via PageContext). */
|
|
8
|
+
function usePageScrollRestoration(scrollRestorationKey) {
|
|
9
|
+
const { getPageScrollElement } = useContext(PageContext);
|
|
10
|
+
const debouncedSaveRef = useRef(null);
|
|
11
|
+
const latestScrollTopRef = useRef(0);
|
|
12
|
+
const pendingRestoreTopRef = useRef(null);
|
|
13
|
+
const tryRestoreScroll = useCallback(() => {
|
|
14
|
+
const el = getPageScrollElement();
|
|
15
|
+
const top = pendingRestoreTopRef.current;
|
|
16
|
+
if (!el || top == null)
|
|
17
|
+
return false;
|
|
18
|
+
const maxTop = Math.max(0, el.scrollHeight - el.clientHeight);
|
|
19
|
+
const targetTop = Math.min(top, maxTop);
|
|
20
|
+
el.scrollTo({ top: targetTop, behavior: 'auto' });
|
|
21
|
+
const applied = el.scrollTop >= targetTop - 1 || maxTop <= 0;
|
|
22
|
+
if (applied && maxTop > 0) {
|
|
23
|
+
pendingRestoreTopRef.current = null;
|
|
24
|
+
}
|
|
25
|
+
return applied;
|
|
26
|
+
}, [getPageScrollElement]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
debouncedSaveRef.current?.cancel();
|
|
29
|
+
debouncedSaveRef.current = debounce((key, top) => {
|
|
30
|
+
saveScrollTop(key, top);
|
|
31
|
+
}, SCROLL_SAVE_MS, { leading: false });
|
|
32
|
+
return () => {
|
|
33
|
+
debouncedSaveRef.current?.cancel();
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const el = getPageScrollElement();
|
|
38
|
+
if (!el)
|
|
39
|
+
return;
|
|
40
|
+
const ro = new ResizeObserver(() => {
|
|
41
|
+
if (pendingRestoreTopRef.current != null) {
|
|
42
|
+
tryRestoreScroll();
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
ro.observe(el);
|
|
46
|
+
return () => ro.disconnect();
|
|
47
|
+
}, [getPageScrollElement, tryRestoreScroll]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const el = getPageScrollElement();
|
|
50
|
+
if (!el)
|
|
51
|
+
return;
|
|
52
|
+
latestScrollTopRef.current = el.scrollTop;
|
|
53
|
+
const savedTop = readSavedScrollTop(scrollRestorationKey);
|
|
54
|
+
if (savedTop != null) {
|
|
55
|
+
pendingRestoreTopRef.current = savedTop;
|
|
56
|
+
tryRestoreScroll();
|
|
57
|
+
}
|
|
58
|
+
const handleScroll = () => {
|
|
59
|
+
latestScrollTopRef.current = el.scrollTop;
|
|
60
|
+
debouncedSaveRef.current?.(scrollRestorationKey, el.scrollTop);
|
|
61
|
+
};
|
|
62
|
+
el.addEventListener('scroll', handleScroll, { passive: true });
|
|
63
|
+
return () => {
|
|
64
|
+
el.removeEventListener('scroll', handleScroll);
|
|
65
|
+
debouncedSaveRef.current?.cancel();
|
|
66
|
+
const storedTop = readSavedScrollTop(scrollRestorationKey) ?? 0;
|
|
67
|
+
const top = Math.max(latestScrollTopRef.current, storedTop);
|
|
68
|
+
saveScrollTop(scrollRestorationKey, top);
|
|
69
|
+
};
|
|
70
|
+
}, [getPageScrollElement, scrollRestorationKey, tryRestoreScroll]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { usePageScrollRestoration };
|
|
@@ -56,13 +56,13 @@ function Renamer({ value = '', onInput, onChange, children, className, placehold
|
|
|
56
56
|
md: 'md',
|
|
57
57
|
lg: 'lg',
|
|
58
58
|
};
|
|
59
|
-
return (jsx("div", { className: cn(S.root, S[`size-${size}`], !value && S.empty, className), onKeyDown: onKeyDown, children: isRenaming ? (jsx(Input, { className: S.input, autoFocus: !isMobile, variant: "clean", size: inputSizeMap[size], placeholder: placeholder, value: name, onChange: handleInputChange, onBlur: handleBlur, onKeyDown: onKeyDown })) : (jsxs(Fragment, { children: [jsx("span", { className: S.value, children: children }), jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(Button, { className: S.button, variant: "ghost", onPointerDown: e => {
|
|
59
|
+
return (jsx("div", { className: cn(S.root, S[`size-${size}`], !value && S.empty, className), onKeyDown: onKeyDown, children: isRenaming ? (jsx(Input, { className: S.input, autoFocus: !isMobile, variant: "clean", size: inputSizeMap[size], placeholder: placeholder, value: name, onChange: handleInputChange, onBlur: handleBlur, onKeyDown: onKeyDown })) : (jsxs(Fragment, { children: [jsx("span", { className: S.value, children: children }), jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(Button, { icon: true, className: S.button, variant: "ghost", onPointerDown: e => {
|
|
60
60
|
e.preventDefault();
|
|
61
61
|
e.stopPropagation();
|
|
62
62
|
}, onClick: e => {
|
|
63
63
|
e.stopPropagation();
|
|
64
64
|
handleEditClick();
|
|
65
|
-
}, size: buttonSizeMap[size], type: "button", children: jsx(PencilSimpleIcon, {
|
|
65
|
+
}, size: buttonSizeMap[size], type: "button", children: jsx(PencilSimpleIcon, { "aria-hidden": true }) }) }), jsx(TooltipContent, { side: "bottom", children: "Rename" })] })] })) }));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export { Renamer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Renamer_root__26OvT{
|
|
4
|
-
var S = {"root":"Renamer_root__26OvT","value":"Renamer_value__G8b1D","size-lg":"Renamer_size-lg__dfVhW","
|
|
3
|
+
var css_248z = ".Renamer_root__26OvT{display:inline-block;max-width:100%;vertical-align:top}.Renamer_root__26OvT:has(.Renamer_input__KRnGn){display:block;width:100%}.Renamer_value__G8b1D{display:inline}.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_input__KRnGn,.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_value__G8b1D{color:var(--foreground);font-family:var(--font-family-heading);font-size:var(--text-2xl);font-weight:300;line-height:var(--text-2xl)}.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_input__KRnGn{border-radius:var(--p-4);box-shadow:0 0 0 1px var(--border);height:auto;min-height:var(--text-2xl);padding:4px 12px 4px 0}.Renamer_empty__A7xx1.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_input__KRnGn{background-color:var(--accent)/.1}.Renamer_button__jKMLc{display:inline-flex;margin-left:var(--p-2);opacity:.5;transition:opacity .2s ease-out;vertical-align:middle}.Renamer_root__26OvT:hover .Renamer_button__jKMLc{opacity:1}.Renamer_size-sm__vycEN.Renamer_root__26OvT .Renamer_button__jKMLc svg{height:var(--icon-size-sm);width:var(--icon-size-sm)}.Renamer_size-md__aWSQi.Renamer_root__26OvT .Renamer_button__jKMLc svg{height:var(--icon-size-md);width:var(--icon-size-md)}.Renamer_size-lg__dfVhW.Renamer_root__26OvT .Renamer_button__jKMLc svg{height:var(--icon-size-lg);width:var(--icon-size-lg)}";
|
|
4
|
+
var S = {"root":"Renamer_root__26OvT","input":"Renamer_input__KRnGn","value":"Renamer_value__G8b1D","size-lg":"Renamer_size-lg__dfVhW","empty":"Renamer_empty__A7xx1","button":"Renamer_button__jKMLc","size-sm":"Renamer_size-sm__vycEN","size-md":"Renamer_size-md__aWSQi"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|