@sybilion/uilib 1.4.4 → 1.4.6

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 (40) hide show
  1. package/dist/agent-glossary/workspace.generated.ts +2 -1
  2. package/dist/agent-glossary/workspace.index.md +2 -1
  3. package/dist/agent-glossary/workspace.md +2 -1
  4. package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.js +5 -5
  5. package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.styl.js +2 -2
  6. package/dist/esm/components/ui/InfoIconTooltip/InfoIconTooltip.js +10 -0
  7. package/dist/esm/components/ui/InfoIconTooltip/InfoIconTooltip.styl.js +7 -0
  8. package/dist/esm/components/ui/Input/Input.styl.js +2 -2
  9. package/dist/esm/components/ui/LabelWithId/LabelWithId.js +1 -1
  10. package/dist/esm/components/ui/LabelWithId/LabelWithId.styl.js +2 -2
  11. package/dist/esm/components/ui/NavUserHeader/NavUserHeader.js +1 -1
  12. package/dist/esm/components/widgets/PerformanceChart/performanceChart.helpers.js +12 -0
  13. package/dist/esm/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.js +1 -1
  14. package/dist/esm/index.js +1 -0
  15. package/dist/esm/types/src/docs/pages/InfoIconTooltipPage.d.ts +1 -0
  16. package/dist/esm/types/src/index.d.ts +1 -0
  17. package/dist/esm/types/tests/performanceChart.helpers.test.d.ts +1 -0
  18. package/dist/esm/utils/chartConnectionPoint.js +26 -8
  19. package/package.json +3 -1
  20. package/src/components/ui/AnalysesSelector/AnalysesSelector.styl +0 -3
  21. package/src/components/ui/AnalysesSelector/AnalysesSelector.styl.d.ts +0 -1
  22. package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +11 -11
  23. package/src/components/ui/InfoIconTooltip/AGENT.md +27 -0
  24. package/src/components/ui/InfoIconTooltip/InfoIconTooltip.styl.d.ts +1 -1
  25. package/src/components/ui/InfoIconTooltip/InfoIconTooltip.tsx +1 -1
  26. package/src/components/ui/Input/Input.styl +7 -1
  27. package/src/components/ui/Input/Input.styl.d.ts +1 -0
  28. package/src/components/ui/LabelWithId/AGENT.md +3 -3
  29. package/src/components/ui/LabelWithId/LabelWithId.styl +3 -0
  30. package/src/components/ui/LabelWithId/LabelWithId.styl.d.ts +1 -0
  31. package/src/components/ui/LabelWithId/LabelWithId.tsx +4 -1
  32. package/src/components/ui/NavUserHeader/NavUserHeader.tsx +6 -2
  33. package/src/components/widgets/PerformanceChart/performanceChart.helpers.ts +23 -0
  34. package/src/components/widgets/SidebarDatasetsItemsGrouped/SidebarDatasetsItemsGrouped.tsx +3 -1
  35. package/src/docs/components/DocsGuidance/DocsGuidance.styl +80 -2
  36. package/src/docs/components/DocsGuidance/DocsGuidance.tsx +29 -2
  37. package/src/docs/pages/InfoIconTooltipPage.tsx +26 -0
  38. package/src/docs/registry.ts +6 -0
  39. package/src/index.ts +1 -0
  40. package/src/utils/chartConnectionPoint.ts +28 -8
@@ -35,12 +35,13 @@ Entry point for \`@sybilion/uilib\`. Open linked AGENT.md before using a compone
35
35
  - [GridLayout](src/components/ui/GridLayout/AGENT.md) — GridLayout is a responsive CSS grid that fits as many columns as the container allows, with each cell keeping at leas…
36
36
  - [Image](src/components/ui/Image/AGENT.md) — Image is a thin wrapper around the native img element that loads a remote URL and accepts a fallback for when the req…
37
37
  - [ImageWithFallback](src/components/ui/ImageWithFallback/AGENT.md) — ImageWithFallback renders an image from a URL and swaps in the provided fallback content when the image fails to load…
38
+ - [InfoIconTooltip](src/components/ui/InfoIconTooltip/AGENT.md) — Question-icon trigger with a capped-width tooltip for inline supplementary help.
38
39
  - [Input](src/components/ui/Input/AGENT.md) — Input is the standard single-line text field. Pair it with a Label linked via htmlFor and id, and control the value t…
39
40
  - [InteractiveContent](src/components/ui/InteractiveContent/AGENT.md) — InteractiveContent renders assistant-style plain text with inline formatting: bold and italic emphasis, inline code v…
40
41
  - [Kicker](src/components/ui/Kicker/AGENT.md) — Kicker is a small eyebrow label rendered above a heading, card, or section. It uses the 12px Manrope label style in s…
41
42
  - [Label](src/components/ui/Label/AGENT.md) — Label is the styled form label used across the library. Link it to its control with htmlFor so clicking the label foc…
42
43
  - [LabeledInput](src/components/ui/LabeledInput/AGENT.md) — LabeledInput combines a Label and an Input into a single row, wiring the label to the field automatically via the id …
43
- - [LabelWithId](src/components/ui/LabelWithId/AGENT.md) — LabelWithId renders a text label preceded by a small numeric id badge, giving entities such as analyses a stable, sca…
44
+ - [LabelWithId](src/components/ui/LabelWithId/AGENT.md) — LabelWithId always renders the user-facing label. The label span carries \`data-analysis-id\` so PostHog session replay…
44
45
  - [LegacyPlatformLink](src/components/ui/LegacyPlatformLink/AGENT.md) — LegacyPlatformLink is an anchor that points at the legacy platform, building the destination from the API domain plus…
45
46
  - [Logo](src/components/ui/Logo/AGENT.md) — Logo renders the brand mark with an optional wordmark. Choose a size that fits the surrounding chrome and hide the te…
46
47
  - [MobileAdaptiveSelector](src/components/ui/MobileAdaptiveSelector/AGENT.md) — MobileAdaptiveSelector presents a single-choice control that renders as a toggle group on desktop and switches to a s…
@@ -34,12 +34,13 @@ Entry point for `@sybilion/uilib`. Open linked AGENT.md before using a component
34
34
  - [GridLayout](src/components/ui/GridLayout/AGENT.md) — GridLayout is a responsive CSS grid that fits as many columns as the container allows, with each cell keeping at leas…
35
35
  - [Image](src/components/ui/Image/AGENT.md) — Image is a thin wrapper around the native img element that loads a remote URL and accepts a fallback for when the req…
36
36
  - [ImageWithFallback](src/components/ui/ImageWithFallback/AGENT.md) — ImageWithFallback renders an image from a URL and swaps in the provided fallback content when the image fails to load…
37
+ - [InfoIconTooltip](src/components/ui/InfoIconTooltip/AGENT.md) — Question-icon trigger with a capped-width tooltip for inline supplementary help.
37
38
  - [Input](src/components/ui/Input/AGENT.md) — Input is the standard single-line text field. Pair it with a Label linked via htmlFor and id, and control the value t…
38
39
  - [InteractiveContent](src/components/ui/InteractiveContent/AGENT.md) — InteractiveContent renders assistant-style plain text with inline formatting: bold and italic emphasis, inline code v…
39
40
  - [Kicker](src/components/ui/Kicker/AGENT.md) — Kicker is a small eyebrow label rendered above a heading, card, or section. It uses the 12px Manrope label style in s…
40
41
  - [Label](src/components/ui/Label/AGENT.md) — Label is the styled form label used across the library. Link it to its control with htmlFor so clicking the label foc…
41
42
  - [LabeledInput](src/components/ui/LabeledInput/AGENT.md) — LabeledInput combines a Label and an Input into a single row, wiring the label to the field automatically via the id …
42
- - [LabelWithId](src/components/ui/LabelWithId/AGENT.md) — LabelWithId renders a text label preceded by a small numeric id badge, giving entities such as analyses a stable, sca…
43
+ - [LabelWithId](src/components/ui/LabelWithId/AGENT.md) — LabelWithId always renders the user-facing label. The label span carries `data-analysis-id` so PostHog session replay…
43
44
  - [LegacyPlatformLink](src/components/ui/LegacyPlatformLink/AGENT.md) — LegacyPlatformLink is an anchor that points at the legacy platform, building the destination from the API domain plus…
44
45
  - [Logo](src/components/ui/Logo/AGENT.md) — Logo renders the brand mark with an optional wordmark. Choose a size that fits the surrounding chrome and hide the te…
45
46
  - [MobileAdaptiveSelector](src/components/ui/MobileAdaptiveSelector/AGENT.md) — MobileAdaptiveSelector presents a single-choice control that renders as a toggle group on desktop and switches to a s…
@@ -34,12 +34,13 @@ Entry point for `@sybilion/uilib`. Open linked AGENT.md before using a component
34
34
  - [GridLayout](src/components/ui/GridLayout/AGENT.md) — GridLayout is a responsive CSS grid that fits as many columns as the container allows, with each cell keeping at leas…
35
35
  - [Image](src/components/ui/Image/AGENT.md) — Image is a thin wrapper around the native img element that loads a remote URL and accepts a fallback for when the req…
36
36
  - [ImageWithFallback](src/components/ui/ImageWithFallback/AGENT.md) — ImageWithFallback renders an image from a URL and swaps in the provided fallback content when the image fails to load…
37
+ - [InfoIconTooltip](src/components/ui/InfoIconTooltip/AGENT.md) — Question-icon trigger with a capped-width tooltip for inline supplementary help.
37
38
  - [Input](src/components/ui/Input/AGENT.md) — Input is the standard single-line text field. Pair it with a Label linked via htmlFor and id, and control the value t…
38
39
  - [InteractiveContent](src/components/ui/InteractiveContent/AGENT.md) — InteractiveContent renders assistant-style plain text with inline formatting: bold and italic emphasis, inline code v…
39
40
  - [Kicker](src/components/ui/Kicker/AGENT.md) — Kicker is a small eyebrow label rendered above a heading, card, or section. It uses the 12px Manrope label style in s…
40
41
  - [Label](src/components/ui/Label/AGENT.md) — Label is the styled form label used across the library. Link it to its control with htmlFor so clicking the label foc…
41
42
  - [LabeledInput](src/components/ui/LabeledInput/AGENT.md) — LabeledInput combines a Label and an Input into a single row, wiring the label to the field automatically via the id …
42
- - [LabelWithId](src/components/ui/LabelWithId/AGENT.md) — LabelWithId renders a text label preceded by a small numeric id badge, giving entities such as analyses a stable, sca…
43
+ - [LabelWithId](src/components/ui/LabelWithId/AGENT.md) — LabelWithId always renders the user-facing label. The label span carries `data-analysis-id` so PostHog session replay…
43
44
  - [LegacyPlatformLink](src/components/ui/LegacyPlatformLink/AGENT.md) — LegacyPlatformLink is an anchor that points at the legacy platform, building the destination from the API domain plus…
44
45
  - [Logo](src/components/ui/Logo/AGENT.md) — Logo renders the brand mark with an optional wordmark. Choose a size that fits the surrounding chrome and hide the te…
45
46
  - [MobileAdaptiveSelector](src/components/ui/MobileAdaptiveSelector/AGENT.md) — MobileAdaptiveSelector presents a single-choice control that renders as a toggle group on desktop and switches to a s…
@@ -183,17 +183,17 @@ function AnalysesSelector({ items, selectedIds, onItemToggle, inlineMode = false
183
183
  return null;
184
184
  return hiddenSeries.has(`forecast_${item.id}`) ? (jsx(EyeClosedIcon, {})) : (jsx(EyeIcon, {}));
185
185
  };
186
- const renderLabelWithId = (item) => (jsx(LabelWithId, { className: cn(S.label, S.itemLabelWithId), id: String(item.id), label: isAnalysisInProgressProp(item.status) ? (jsx(TextShimmer, { as: "span", children: item.label })) : (item.label) }));
187
- const renderSelectItem = (item) => (jsxs("div", { className: S.selectItemContent, children: [renderItemContent(item), renderIcon(item.icon), renderLabelWithId(item), renderEyeIcon(item)] }));
186
+ const renderItemLabel = (item) => (jsx(LabelWithId, { id: item.id, label: isAnalysisInProgressProp(item.status) ? (jsx(TextShimmer, { as: "span", children: item.label })) : (item.label), className: cn(S.label, S.itemLabelWithId) }));
187
+ const renderSelectItem = (item) => (jsxs("div", { className: S.selectItemContent, children: [renderItemContent(item), renderIcon(item.icon), renderItemLabel(item), renderEyeIcon(item)] }));
188
188
  if (inlineMode) {
189
- return (jsxs("div", { className: cn(S.root, S[`variant-${variant}`], selectedItems.length === 1 && S.single, className), children: [selectedItems.map(item => (jsxs("div", { className: cn(S.item, disabled && S.disabled, item.id === -1 && S.historical, item.dimmed && S.dimmed), onClick: () => !disabled && handleItemClick(item), children: [renderIcon(item.icon), renderItemContent(item), renderLabelWithId(item)] }, item.id))), unselectedItems.length > 0 && (jsxs(Select, { value: "", onValueChange: handleSelectValue, disabled: disabled, children: [jsx(SelectTrigger, { size: size, variant: variant, className: S.selectTrigger, darker: darker, style: {
189
+ return (jsxs("div", { className: cn(S.root, S[`variant-${variant}`], selectedItems.length === 1 && S.single, className), children: [selectedItems.map(item => (jsxs("div", { className: cn(S.item, disabled && S.disabled, item.id === -1 && S.historical, item.dimmed && S.dimmed), onClick: () => !disabled && handleItemClick(item), children: [renderIcon(item.icon), renderItemContent(item), renderItemLabel(item)] }, item.id))), unselectedItems.length > 0 && (jsxs(Select, { value: "", onValueChange: handleSelectValue, disabled: disabled, children: [jsx(SelectTrigger, { size: size, variant: variant, className: S.selectTrigger, darker: darker, style: {
190
190
  minWidth: 'auto',
191
191
  height: 'auto',
192
192
  fontSize: 'var(--text-xs)',
193
193
  pointerEvents: items.length < 2 && unselectedItems.length === 0
194
194
  ? 'none'
195
195
  : undefined,
196
- }, children: jsx(SelectValue, { placeholder: selectPlaceholder }) }), jsx(SelectContent, { children: unselectedItems.map(item => (jsx(SelectItem, { value: String(item.id), children: renderSelectItem(item) }, item.id))) })] }))] }));
196
+ }, children: jsx(SelectValue, { placeholder: selectPlaceholder }) }), jsx(SelectContent, { children: unselectedItems.map(item => (jsx(SelectItem, { value: String(item.id), textValue: item.label, children: renderSelectItem(item) }, item.id))) })] }))] }));
197
197
  }
198
198
  if (items.length === 0)
199
199
  return null;
@@ -229,7 +229,7 @@ function AnalysesSelector({ items, selectedIds, onItemToggle, inlineMode = false
229
229
  e.preventDefault();
230
230
  e.stopPropagation();
231
231
  }
232
- }, children: renamerTriggerContent })) : (jsx(LabelWithId, { className: S.selectTriggerLabelWithId, id: selectValue, label: jsx(SelectValue, { placeholder: selectPlaceholder }) })) }), jsx(SelectContent, { children: items.map(item => (jsx(SelectItem, { value: String(item.id), selected: selectedSet.has(item.id), textValue: item.label, children: renderSelectItem(item) }, item.id))) })] }) }));
232
+ }, children: renamerTriggerContent })) : (jsx(SelectValue, { placeholder: selectPlaceholder })) }), jsx(SelectContent, { children: items.map(item => (jsx(SelectItem, { value: String(item.id), selected: selectedSet.has(item.id), textValue: item.label, children: renderSelectItem(item) }, item.id))) })] }) }));
233
233
  }
234
234
 
235
235
  export { AnalysesSelector };
@@ -1,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = ".AnalysesSelector_root__V8v0T{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.AnalysesSelector_selectTriggerRenamer__rZmCN{min-width:0}.AnalysesSelector_selectInlineRenamer__pGAz0{align-items:center;display:flex;min-width:0}.AnalysesSelector_selectInlineRenamerInput__7al7v{border-radius:var(--p-2);margin-left:calc(var(--p-2)*-1);max-width:calc(100% - var(--p-4))!important;padding:0 var(--p-2)}.AnalysesSelector_renamerEditButton__lJ-8-{flex-shrink:0;opacity:.5;transition:opacity .2s ease-out}.AnalysesSelector_selectInlineRenamer__pGAz0:hover .AnalysesSelector_renamerEditButton__lJ-8-{opacity:1}.AnalysesSelector_variant-default__lbURP.AnalysesSelector_single__rAPT6{background-color:var(--background);border-radius:var(--p-4);padding:0 var(--p-2)}.AnalysesSelector_item__d3pDt{align-items:center;cursor:pointer;display:flex;gap:var(--p-2);margin:var(--p-1);transition:opacity .2s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}.AnalysesSelector_item__d3pDt.AnalysesSelector_disabled__6JhJQ,.AnalysesSelector_item__d3pDt:hover{opacity:.5}.AnalysesSelector_item__d3pDt.AnalysesSelector_disabled__6JhJQ:hover{opacity:.8}.AnalysesSelector_item__d3pDt.AnalysesSelector_historical__hAqpN{pointer-events:none}.AnalysesSelector_item__d3pDt.AnalysesSelector_dimmed__mYWY7{opacity:.5}.AnalysesSelector_itemBadge__WImMg{margin-bottom:-2px;margin-top:-2px}.AnalysesSelector_icon__1Tb0U{flex-shrink:0;height:16px;max-height:16px;max-width:16px;overflow:hidden;width:16px}.AnalysesSelector_iconImage__r9yJx{display:block;-o-object-fit:contain;object-fit:contain}.AnalysesSelector_iconWrapper__2Kx8j{align-items:center;display:flex;justify-content:center;position:relative}.AnalysesSelector_iconWrapper__2Kx8j>img{height:100%;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;width:100%}[data-slot=select-item] [data-slot=analysis-icon]{flex-shrink:0;height:16px!important;max-height:16px!important;max-width:16px!important;-o-object-fit:contain;object-fit:contain;overflow:hidden;width:16px!important}.AnalysesSelector_label__m-9Ml{flex:1 1 auto;font-size:var(--text-xs);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AnalysesSelector_selectItemContent__iRsNR{align-items:center;display:flex;flex:1;flex-direction:row;flex-wrap:nowrap;gap:var(--p-2);min-width:0;width:100%}.AnalysesSelector_selectTrigger__Avjkd{font-size:var(--text-xs);height:auto;min-width:auto}.AnalysesSelector_selectTriggerRenaming__w0xCm{max-width:100%!important;width:100%!important}.AnalysesSelector_selectTriggerRenaming__w0xCm .AnalysesSelector_selectTriggerContent__RwRJL{flex:1;min-width:0;width:100%}.AnalysesSelector_selectTriggerRenaming__w0xCm .AnalysesSelector_selectTriggerRenamer__rZmCN{min-width:0}.AnalysesSelector_selectTriggerLabelWithId__C32ph{display:flex}.AnalysesSelector_selectTriggerContent__RwRJL{align-items:center;display:flex;gap:var(--p-2);min-height:var(--p-9);min-width:0}.AnalysesSelector_selectTriggerContent__RwRJL>:last-child{flex-shrink:0;max-width:100%;min-width:0}.AnalysesSelector_selectTriggerRenamerDisabled__bA8-G button{pointer-events:none}.AnalysesSelector_itemLabelWithId__8c0mY{align-items:center;display:flex;flex-grow:1;min-width:0}";
4
- var S = {"root":"AnalysesSelector_root__V8v0T","selectTriggerRenamer":"AnalysesSelector_selectTriggerRenamer__rZmCN","selectInlineRenamer":"AnalysesSelector_selectInlineRenamer__pGAz0","selectInlineRenamerInput":"AnalysesSelector_selectInlineRenamerInput__7al7v","renamerEditButton":"AnalysesSelector_renamerEditButton__lJ-8-","variant-default":"AnalysesSelector_variant-default__lbURP","single":"AnalysesSelector_single__rAPT6","item":"AnalysesSelector_item__d3pDt","disabled":"AnalysesSelector_disabled__6JhJQ","historical":"AnalysesSelector_historical__hAqpN","dimmed":"AnalysesSelector_dimmed__mYWY7","itemBadge":"AnalysesSelector_itemBadge__WImMg","icon":"AnalysesSelector_icon__1Tb0U","iconImage":"AnalysesSelector_iconImage__r9yJx","iconWrapper":"AnalysesSelector_iconWrapper__2Kx8j","label":"AnalysesSelector_label__m-9Ml","selectItemContent":"AnalysesSelector_selectItemContent__iRsNR","selectTrigger":"AnalysesSelector_selectTrigger__Avjkd","selectTriggerRenaming":"AnalysesSelector_selectTriggerRenaming__w0xCm","selectTriggerContent":"AnalysesSelector_selectTriggerContent__RwRJL","selectTriggerLabelWithId":"AnalysesSelector_selectTriggerLabelWithId__C32ph","selectTriggerRenamerDisabled":"AnalysesSelector_selectTriggerRenamerDisabled__bA8-G","itemLabelWithId":"AnalysesSelector_itemLabelWithId__8c0mY"};
3
+ var css_248z = ".AnalysesSelector_root__V8v0T{align-items:center;display:flex;flex-wrap:wrap;justify-content:flex-start}.AnalysesSelector_selectTriggerRenamer__rZmCN{min-width:0}.AnalysesSelector_selectInlineRenamer__pGAz0{align-items:center;display:flex;min-width:0}.AnalysesSelector_selectInlineRenamerInput__7al7v{border-radius:var(--p-2);margin-left:calc(var(--p-2)*-1);max-width:calc(100% - var(--p-4))!important;padding:0 var(--p-2)}.AnalysesSelector_renamerEditButton__lJ-8-{flex-shrink:0;opacity:.5;transition:opacity .2s ease-out}.AnalysesSelector_selectInlineRenamer__pGAz0:hover .AnalysesSelector_renamerEditButton__lJ-8-{opacity:1}.AnalysesSelector_variant-default__lbURP.AnalysesSelector_single__rAPT6{background-color:var(--background);border-radius:var(--p-4);padding:0 var(--p-2)}.AnalysesSelector_item__d3pDt{align-items:center;cursor:pointer;display:flex;gap:var(--p-2);margin:var(--p-1);transition:opacity .2s ease;-webkit-user-select:none;-moz-user-select:none;user-select:none}.AnalysesSelector_item__d3pDt.AnalysesSelector_disabled__6JhJQ,.AnalysesSelector_item__d3pDt:hover{opacity:.5}.AnalysesSelector_item__d3pDt.AnalysesSelector_disabled__6JhJQ:hover{opacity:.8}.AnalysesSelector_item__d3pDt.AnalysesSelector_historical__hAqpN{pointer-events:none}.AnalysesSelector_item__d3pDt.AnalysesSelector_dimmed__mYWY7{opacity:.5}.AnalysesSelector_itemBadge__WImMg{margin-bottom:-2px;margin-top:-2px}.AnalysesSelector_icon__1Tb0U{flex-shrink:0;height:16px;max-height:16px;max-width:16px;overflow:hidden;width:16px}.AnalysesSelector_iconImage__r9yJx{display:block;-o-object-fit:contain;object-fit:contain}.AnalysesSelector_iconWrapper__2Kx8j{align-items:center;display:flex;justify-content:center;position:relative}.AnalysesSelector_iconWrapper__2Kx8j>img{height:100%;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain;width:100%}[data-slot=select-item] [data-slot=analysis-icon]{flex-shrink:0;height:16px!important;max-height:16px!important;max-width:16px!important;-o-object-fit:contain;object-fit:contain;overflow:hidden;width:16px!important}.AnalysesSelector_label__m-9Ml{flex:1 1 auto;font-size:var(--text-xs);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.AnalysesSelector_selectItemContent__iRsNR{align-items:center;display:flex;flex:1;flex-direction:row;flex-wrap:nowrap;gap:var(--p-2);min-width:0;width:100%}.AnalysesSelector_selectTrigger__Avjkd{font-size:var(--text-xs);height:auto;min-width:auto}.AnalysesSelector_selectTriggerRenaming__w0xCm{max-width:100%!important;width:100%!important}.AnalysesSelector_selectTriggerRenaming__w0xCm .AnalysesSelector_selectTriggerContent__RwRJL{flex:1;min-width:0;width:100%}.AnalysesSelector_selectTriggerRenaming__w0xCm .AnalysesSelector_selectTriggerRenamer__rZmCN{min-width:0}.AnalysesSelector_selectTriggerContent__RwRJL{align-items:center;display:flex;gap:var(--p-2);min-height:var(--p-9);min-width:0}.AnalysesSelector_selectTriggerContent__RwRJL>:last-child{flex-shrink:0;max-width:100%;min-width:0}.AnalysesSelector_selectTriggerRenamerDisabled__bA8-G button{pointer-events:none}.AnalysesSelector_itemLabelWithId__8c0mY{align-items:center;display:flex;flex-grow:1;min-width:0}";
4
+ var S = {"root":"AnalysesSelector_root__V8v0T","selectTriggerRenamer":"AnalysesSelector_selectTriggerRenamer__rZmCN","selectInlineRenamer":"AnalysesSelector_selectInlineRenamer__pGAz0","selectInlineRenamerInput":"AnalysesSelector_selectInlineRenamerInput__7al7v","renamerEditButton":"AnalysesSelector_renamerEditButton__lJ-8-","variant-default":"AnalysesSelector_variant-default__lbURP","single":"AnalysesSelector_single__rAPT6","item":"AnalysesSelector_item__d3pDt","disabled":"AnalysesSelector_disabled__6JhJQ","historical":"AnalysesSelector_historical__hAqpN","dimmed":"AnalysesSelector_dimmed__mYWY7","itemBadge":"AnalysesSelector_itemBadge__WImMg","icon":"AnalysesSelector_icon__1Tb0U","iconImage":"AnalysesSelector_iconImage__r9yJx","iconWrapper":"AnalysesSelector_iconWrapper__2Kx8j","label":"AnalysesSelector_label__m-9Ml","selectItemContent":"AnalysesSelector_selectItemContent__iRsNR","selectTrigger":"AnalysesSelector_selectTrigger__Avjkd","selectTriggerRenaming":"AnalysesSelector_selectTriggerRenaming__w0xCm","selectTriggerContent":"AnalysesSelector_selectTriggerContent__RwRJL","selectTriggerRenamerDisabled":"AnalysesSelector_selectTriggerRenamerDisabled__bA8-G","itemLabelWithId":"AnalysesSelector_itemLabelWithId__8c0mY"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -0,0 +1,10 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip/Tooltip.js';
3
+ import { QuestionIcon } from '@phosphor-icons/react';
4
+ import S from './InfoIconTooltip.styl.js';
5
+
6
+ function InfoIconTooltip({ children }) {
7
+ return (jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { children: jsx(QuestionIcon, { size: 16, className: S.infoIcon }) }) }), jsx(TooltipContent, { maxWidth: 300, children: children })] }));
8
+ }
9
+
10
+ export { InfoIconTooltip };
@@ -0,0 +1,7 @@
1
+ import styleInject from 'style-inject';
2
+
3
+ var css_248z = ".InfoIconTooltip_infoIcon__98O2C{color:var(--muted-foreground);cursor:help;transform:translateY(1px)}";
4
+ var S = {"infoIcon":"InfoIconTooltip_infoIcon__98O2C"};
5
+ styleInject(css_248z);
6
+
7
+ export { S as default };
@@ -1,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = ".Input_root__IY-8R{background-color:transparent;display:flex;min-width:0;outline:none;transition:color,box-shadow;transition-duration:.15s;width:100%}.Input_root__IY-8R.Input_variant-default__nISPW{border-radius:var(--radius-input);box-shadow:0 0 0 1px var(--border);padding:11px 14px}.Input_root__IY-8R.Input_variant-default__nISPW:focus{box-shadow:inset 0 0 0 2px var(--brand-color-400)}.Input_root__IY-8R.Input_size-sm__mhl1Y{font-size:var(--text-xs);height:32px}.Input_root__IY-8R.Input_size-md__L5iKp{font-size:var(--text-sm);height:40px}.Input_root__IY-8R.Input_size-lg__0l--u{font-size:var(--text-base);height:48px}.Input_root__IY-8R:placeholder{color:var(--muted-foreground)}.Input_root__IY-8R::-moz-selection{background-color:var(--primary);color:var(--primary-foreground)}.Input_root__IY-8R::selection{background-color:var(--primary);color:var(--primary-foreground)}.Input_root__IY-8R.Input_variant-default__nISPW:focus-visible{border-color:var(--ring);ring:3px var(--ring)/.5}.Input_root__IY-8R.Input_variant-default__nISPW[aria-invalid=true]{border-color:var(--destructive);ring:3px var(--destructive)/.2}.Input_root__IY-8R:disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.Input_root__IY-8R[type=file]::file-selector-button{background-color:transparent;border:0;color:var(--foreground);display:inline-flex;font-size:14px;font-weight:500;height:28px}.dark .Input_root__IY-8R{background-color:var(--input)/.3}.dark .Input_root__IY-8R[aria-invalid=true]{ring:3px var(--destructive)/.4}";
4
- var S = {"root":"Input_root__IY-8R","variant-default":"Input_variant-default__nISPW","size-sm":"Input_size-sm__mhl1Y","size-md":"Input_size-md__L5iKp","size-lg":"Input_size-lg__0l--u"};
3
+ var css_248z = ".Input_root__IY-8R{background-color:transparent;display:flex;min-width:0;outline:none;transition:color,box-shadow;transition-duration:.15s;width:100%}.Input_root__IY-8R.Input_variant-clean__xr6Bi,.Input_root__IY-8R.Input_variant-default__nISPW{padding-left:14px;padding-right:14px}.Input_root__IY-8R.Input_variant-default__nISPW{border-radius:var(--radius-input);box-shadow:0 0 0 1px var(--border);padding-bottom:11px;padding-top:11px}.Input_root__IY-8R.Input_variant-default__nISPW:focus{box-shadow:inset 0 0 0 2px var(--brand-color-400)}.Input_root__IY-8R.Input_size-sm__mhl1Y{font-size:var(--text-xs);height:32px}.Input_root__IY-8R.Input_size-md__L5iKp{font-size:var(--text-sm);height:40px}.Input_root__IY-8R.Input_size-lg__0l--u{font-size:var(--text-base);height:48px}.Input_root__IY-8R:placeholder{color:var(--muted-foreground)}.Input_root__IY-8R::-moz-selection{background-color:var(--primary);color:var(--primary-foreground)}.Input_root__IY-8R::selection{background-color:var(--primary);color:var(--primary-foreground)}.Input_root__IY-8R.Input_variant-default__nISPW:focus-visible{border-color:var(--ring);ring:3px var(--ring)/.5}.Input_root__IY-8R.Input_variant-default__nISPW[aria-invalid=true]{border-color:var(--destructive);ring:3px var(--destructive)/.2}.Input_root__IY-8R:disabled{cursor:not-allowed;opacity:.5;pointer-events:none}.Input_root__IY-8R[type=file]::file-selector-button{background-color:transparent;border:0;color:var(--foreground);display:inline-flex;font-size:14px;font-weight:500;height:28px}.dark .Input_root__IY-8R{background-color:var(--input)/.3}.dark .Input_root__IY-8R[aria-invalid=true]{ring:3px var(--destructive)/.4}";
4
+ var S = {"root":"Input_root__IY-8R","variant-default":"Input_variant-default__nISPW","variant-clean":"Input_variant-clean__xr6Bi","size-sm":"Input_size-sm__mhl1Y","size-md":"Input_size-md__L5iKp","size-lg":"Input_size-lg__0l--u"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -3,7 +3,7 @@ import cn from 'classnames';
3
3
  import S from './LabelWithId.styl.js';
4
4
 
5
5
  function LabelWithId({ id, label, className }) {
6
- return (jsxs("span", { "data-slot": "label-with-id", className: cn(S.root, className), children: [String(id) !== '-1' && jsx("div", { className: S.id, children: id }), " ", label] }));
6
+ return (jsxs("span", { "data-slot": "label-with-id", className: cn(S.root, className), children: [String(id) !== '-1' && jsx("div", { className: S.id, children: id }), jsx("span", { className: S.label, "data-analysis-id": id, children: label })] }));
7
7
  }
8
8
 
9
9
  export { LabelWithId };
@@ -1,7 +1,7 @@
1
1
  import styleInject from 'style-inject';
2
2
 
3
- var css_248z = ".LabelWithId_root__czAKK{display:inline-block}.LabelWithId_root__czAKK .LabelWithId_id__RDTFH{align-items:center;background-color:var(--muted);border-radius:var(--p-2);display:none;font-size:80%;margin-right:var(--p-1);padding:0 4px}.alt .LabelWithId_root__czAKK .LabelWithId_id__RDTFH{display:inline-flex}";
4
- var S = {"root":"LabelWithId_root__czAKK","id":"LabelWithId_id__RDTFH"};
3
+ var css_248z = ".LabelWithId_root__czAKK{display:inline-block}.LabelWithId_root__czAKK .LabelWithId_label__sQYx9{display:inline}.LabelWithId_root__czAKK .LabelWithId_id__RDTFH{align-items:center;background-color:var(--muted);border-radius:var(--p-2);display:none;font-size:80%;margin-right:var(--p-1);padding:0 4px}.alt .LabelWithId_root__czAKK .LabelWithId_id__RDTFH{display:inline-flex}";
4
+ var S = {"root":"LabelWithId_root__czAKK","label":"LabelWithId_label__sQYx9","id":"LabelWithId_id__RDTFH"};
5
5
  styleInject(css_248z);
6
6
 
7
7
  export { S as default };
@@ -30,7 +30,7 @@ function NavUserHeader({ variant, isLoading = false, isAuthenticated, user = nul
30
30
  .join('');
31
31
  return (jsxs(Avatar, { className: S.avatar, children: [jsx(AvatarImage, { src: avatarUrl || undefined, alt: userName }), jsx(AvatarFallback, { children: initials })] }));
32
32
  }, [avatarUrl, userName]);
33
- const userIdentity = useMemo(() => (jsxs("div", { className: S.userInfo, children: [jsx("span", { className: `${S.userName} ph-no-capture`, children: userName }), jsx("span", { className: S.userEmail, children: userEmail })] })), [userEmail, userName]);
33
+ const userIdentity = useMemo(() => (jsxs("div", { className: S.userInfo, children: [jsx("span", { className: `${S.userName} ph-no-capture`, "data-user-name": true, children: userName }), jsx("span", { className: `${S.userEmail} ph-no-capture`, "data-user-email": true, children: userEmail })] })), [userEmail, userName]);
34
34
  if (isLoading) {
35
35
  return (jsxs(Button, { variant: "ghost", size: "sm", disabled: true, className: S.loadingButton, children: [jsx("div", { className: S.avatarSkeleton }), jsx("div", { className: S.textSkeleton })] }));
36
36
  }
@@ -182,8 +182,20 @@ function extendCustomPerformanceDriftSeedToHistoricalEnd(seed, historicalByDate)
182
182
  let lastOrigin = dates[dates.length - 1];
183
183
  if (!lastOrigin)
184
184
  return seed;
185
+ const MAX_MONTH_EXTENSIONS = 500;
186
+ let iterations = 0;
185
187
  while (lastOrigin.localeCompare(latest) < 0) {
188
+ iterations += 1;
189
+ if (iterations > MAX_MONTH_EXTENSIONS) {
190
+ console.warn('extendCustomPerformanceDriftSeedToHistoricalEnd: exceeded max month extensions', { lastOrigin, latest });
191
+ break;
192
+ }
186
193
  const nextOrigin = norm(getNextMonth(lastOrigin));
194
+ if (nextOrigin === lastOrigin ||
195
+ nextOrigin.localeCompare(lastOrigin) <= 0) {
196
+ console.warn('extendCustomPerformanceDriftSeedToHistoricalEnd: month did not advance', { lastOrigin, nextOrigin, latest });
197
+ break;
198
+ }
187
199
  const prevPh = perHorizonDates[perHorizonDates.length - 1];
188
200
  const newPh = prevPh.length === horizonCount
189
201
  ? prevPh.map(d => norm(getNextMonth(norm(d))))
@@ -47,7 +47,7 @@ function SidebarDatasetsItemsGrouped({ groupBy, datasets, preItems, postItems, s
47
47
  return (jsxs(SidebarMenuItem, { children: [jsxs(SidebarMenuButton, { type: "button", isActive: parentActive, onClick: () => toggleGroup(groupName), children: [jsx(PackageOpen, { strokeWidth: 1.5, size: 16 }), jsx(SmartTextTruncate, { children: groupName }), jsx("div", { className: S.chevronContainer, children: isExpanded ? (jsx(ChevronDown, { size: 12 })) : (jsx(ChevronRight, { size: 12 })) })] }), isExpanded && (jsxs(SidebarMenuSub, { className: S.subMenuContainer, children: [jsx("div", { className: S.subMenuBorder }), groupDatasets.map(dataset => (jsx(SidebarMenuSubItem, { className: S.subMenuItem, children: jsx(SidebarMenuSubButton, { href: `#dataset-${dataset.id}`, isActive: dataset.id === selectedDatasetId, onClick: e => {
48
48
  e.preventDefault();
49
49
  onDatasetClick?.(dataset.id);
50
- }, children: jsx(SmartTextTruncate, { children: dataset.name }) }) }, dataset.id)))] }))] }, groupName));
50
+ }, children: jsx(SmartTextTruncate, { "data-dataset-id": dataset.id, children: dataset.name }) }) }, dataset.id)))] }))] }, groupName));
51
51
  }), postItems] }) }));
52
52
  }
53
53
 
package/dist/esm/index.js CHANGED
@@ -57,6 +57,7 @@ export { Foldable } from './components/ui/Foldable/Foldable.js';
57
57
  export { Gap } from './components/ui/Gap/Gap.js';
58
58
  export { GridLayout } from './components/ui/GridLayout/GridLayout.js';
59
59
  export { Image } from './components/ui/Image/Image.js';
60
+ export { InfoIconTooltip } from './components/ui/InfoIconTooltip/InfoIconTooltip.js';
60
61
  export { ImageWithFallback } from './components/ui/ImageWithFallback/ImageWithFallback.js';
61
62
  export { Input } from './components/ui/Input/Input.js';
62
63
  export { InteractiveContent } from './components/ui/InteractiveContent/InteractiveContent.js';
@@ -0,0 +1 @@
1
+ export default function InfoIconTooltipPage(): import("react/jsx-runtime").JSX.Element;
@@ -38,6 +38,7 @@ export * from './components/ui/Foldable';
38
38
  export * from './components/ui/Gap/Gap';
39
39
  export * from './components/ui/GridLayout/GridLayout';
40
40
  export * from './components/ui/Image';
41
+ export * from './components/ui/InfoIconTooltip/InfoIconTooltip';
41
42
  export * from './components/ui/ImageWithFallback';
42
43
  export * from './components/ui/Input';
43
44
  export * from './components/ui/InteractiveContent';
@@ -110,28 +110,46 @@ function findLastValidHistoricalChartPoint(historical) {
110
110
  const validPoints = historical.filter(point => point.historical !== null && point.historical !== undefined);
111
111
  return validPoints.length > 0 ? validPoints[validPoints.length - 1] : null;
112
112
  }
113
+ function parseYearMonth(date) {
114
+ const datePart = String(date).split(' ')[0] ?? date;
115
+ const match = datePart.match(/^(\d{4})-(\d{1,2})/);
116
+ if (!match) {
117
+ throw new Error(`Invalid date format: ${date}`);
118
+ }
119
+ return {
120
+ year: parseInt(match[1], 10),
121
+ month: parseInt(match[2], 10),
122
+ };
123
+ }
124
+ function formatMonthStart(year, month) {
125
+ return `${year}-${String(month).padStart(2, '0')}-01`;
126
+ }
113
127
  /**
114
128
  * Normalize date to first day of month for comparison (YYYY-MM-01)
115
129
  */
116
130
  function normalizeToMonthStart(date) {
117
- const d = new Date(date);
118
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-01`;
131
+ const { year, month } = parseYearMonth(date);
132
+ return formatMonthStart(year, month);
119
133
  }
120
134
  /**
121
135
  * Get the previous month date (first day of previous month)
122
136
  */
123
137
  function getPreviousMonth(date) {
124
- const d = new Date(date);
125
- d.setMonth(d.getMonth() - 1);
126
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-01`;
138
+ const { year, month } = parseYearMonth(date);
139
+ if (month === 1) {
140
+ return formatMonthStart(year - 1, 12);
141
+ }
142
+ return formatMonthStart(year, month - 1);
127
143
  }
128
144
  /**
129
145
  * Get the next month date (first day of next month)
130
146
  */
131
147
  function getNextMonth(date) {
132
- const d = new Date(date);
133
- d.setMonth(d.getMonth() + 1);
134
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-01`;
148
+ const { year, month } = parseYearMonth(date);
149
+ if (month === 12) {
150
+ return formatMonthStart(year + 1, 1);
151
+ }
152
+ return formatMonthStart(year, month + 1);
135
153
  }
136
154
 
137
155
  export { ensureChartForecastBridge, findLastValidHistoricalChartPoint, getNextMonth, getPreviousMonth, normalizeToMonthStart };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Sybilion Design System — React UI components (Webpack + Stylus)",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -187,8 +187,10 @@
187
187
  "prettier": "^3.6.2",
188
188
  "react": "^19.0.0",
189
189
  "react-dom": "^19.1.1",
190
+ "react-markdown": "^10.1.0",
190
191
  "react-refresh": "^0.17.0",
191
192
  "react-router-dom": "^6.28.0",
193
+ "remark-gfm": "^4.0.1",
192
194
  "rollup": "^3.17.1",
193
195
  "rollup-plugin-delete": "^2.0.0",
194
196
  "rollup-plugin-dts": "^6.1.1",
@@ -129,9 +129,6 @@
129
129
  .selectTriggerRenamer
130
130
  min-width 0
131
131
 
132
- .selectTriggerLabelWithId
133
- display flex
134
-
135
132
  .selectTriggerContent
136
133
  display flex
137
134
  align-items center
@@ -18,7 +18,6 @@ interface CssExports {
18
18
  'selectItemContent': string;
19
19
  'selectTrigger': string;
20
20
  'selectTriggerContent': string;
21
- 'selectTriggerLabelWithId': string;
22
21
  'selectTriggerRenamer': string;
23
22
  'selectTriggerRenamerDisabled': string;
24
23
  'selectTriggerRenaming': string;
@@ -288,10 +288,9 @@ export function AnalysesSelector({
288
288
  );
289
289
  };
290
290
 
291
- const renderLabelWithId = (item: AnalysesSelectorItem) => (
291
+ const renderItemLabel = (item: AnalysesSelectorItem) => (
292
292
  <LabelWithId
293
- className={cn(S.label, S.itemLabelWithId)}
294
- id={String(item.id)}
293
+ id={item.id}
295
294
  label={
296
295
  isAnalysisInProgressProp(item.status) ? (
297
296
  <TextShimmer as="span">{item.label}</TextShimmer>
@@ -299,6 +298,7 @@ export function AnalysesSelector({
299
298
  item.label
300
299
  )
301
300
  }
301
+ className={cn(S.label, S.itemLabelWithId)}
302
302
  />
303
303
  );
304
304
 
@@ -306,7 +306,7 @@ export function AnalysesSelector({
306
306
  <div className={S.selectItemContent}>
307
307
  {renderItemContent(item)}
308
308
  {renderIcon(item.icon)}
309
- {renderLabelWithId(item)}
309
+ {renderItemLabel(item)}
310
310
  {renderEyeIcon(item)}
311
311
  </div>
312
312
  );
@@ -334,7 +334,7 @@ export function AnalysesSelector({
334
334
  >
335
335
  {renderIcon(item.icon)}
336
336
  {renderItemContent(item)}
337
- {renderLabelWithId(item)}
337
+ {renderItemLabel(item)}
338
338
  </div>
339
339
  ))}
340
340
  {unselectedItems.length > 0 && (
@@ -362,7 +362,11 @@ export function AnalysesSelector({
362
362
  </SelectTrigger>
363
363
  <SelectContent>
364
364
  {unselectedItems.map(item => (
365
- <SelectItem key={item.id} value={String(item.id)}>
365
+ <SelectItem
366
+ key={item.id}
367
+ value={String(item.id)}
368
+ textValue={item.label}
369
+ >
366
370
  {renderSelectItem(item)}
367
371
  </SelectItem>
368
372
  ))}
@@ -465,11 +469,7 @@ export function AnalysesSelector({
465
469
  {renamerTriggerContent}
466
470
  </div>
467
471
  ) : (
468
- <LabelWithId
469
- className={S.selectTriggerLabelWithId}
470
- id={selectValue}
471
- label={<SelectValue placeholder={selectPlaceholder} />}
472
- />
472
+ <SelectValue placeholder={selectPlaceholder} />
473
473
  )}
474
474
  </SelectTrigger>
475
475
  <SelectContent>
@@ -0,0 +1,27 @@
1
+ ---
2
+ summary: Question-icon trigger with a capped-width tooltip for inline supplementary help.
3
+ ---
4
+
5
+ InfoIconTooltip renders a small question icon that opens a Tooltip on hover or focus. Pass `children` as the tooltip body; content is capped at 300px width. Use this for the standard “info next to a label” pattern instead of composing Tooltip, TooltipTrigger, and TooltipContent yourself.
6
+
7
+ ## When to use
8
+
9
+ - To add brief help next to a label, setting name, or metric without expanding the layout.
10
+ - When users expect a familiar info-icon affordance for optional, non-critical context.
11
+ - For short explanatory copy that supplements visible UI text.
12
+
13
+ ## When not to use
14
+
15
+ - When you need a custom trigger (button, link, truncated text); compose Tooltip directly.
16
+ - For information users must read to complete a task; show it in the layout instead.
17
+ - For rich or interactive content; use Popover or HoverCard instead.
18
+
19
+ ## Do
20
+
21
+ - Keep tooltip text concise; one or two sentences is usually enough.
22
+ - Place the icon immediately after the label or control it explains.
23
+
24
+ ## Don't
25
+
26
+ - Repeat text that is already visible next to the icon.
27
+ - Use multiple info icons in a row when a single tooltip or inline description would suffice.
@@ -1,7 +1,7 @@
1
1
  // This file is automatically generated.
2
2
  // Please do not change this file!
3
3
  interface CssExports {
4
- infoIcon: string;
4
+ 'infoIcon': string;
5
5
  }
6
6
  export const cssExports: CssExports;
7
7
  export default cssExports;
@@ -3,8 +3,8 @@ import {
3
3
  TooltipContent,
4
4
  TooltipTrigger,
5
5
  } from '#uilib/components/ui/Tooltip';
6
- import { QuestionIcon } from '@phosphor-icons/react';
7
6
 
7
+ import { QuestionIcon } from '@phosphor-icons/react';
8
8
  import S from './InfoIconTooltip.styl';
9
9
 
10
10
  export function InfoIconTooltip({ children }: { children: React.ReactNode }) {
@@ -7,8 +7,14 @@
7
7
  transition color, box-shadow
8
8
  transition-duration 150ms
9
9
 
10
+ &.variant-default,
11
+ &.variant-clean
12
+ padding-left 14px
13
+ padding-right 14px
14
+
10
15
  &.variant-default
11
- padding 11px 14px
16
+ padding-top 11px
17
+ padding-bottom 11px
12
18
  border-radius var(--radius-input)
13
19
  box-shadow 0 0 0 1px var(--border)
14
20
 
@@ -5,6 +5,7 @@ interface CssExports {
5
5
  'size-lg': string;
6
6
  'size-md': string;
7
7
  'size-sm': string;
8
+ 'variant-clean': string;
8
9
  'variant-default': string;
9
10
  }
10
11
  export const cssExports: CssExports;
@@ -1,9 +1,9 @@
1
- LabelWithId renders a text label preceded by a small numeric id badge, giving entities such as analyses a stable, scannable reference. Passing an id of -1 hides the badge and shows the label alone.
1
+ LabelWithId always renders the user-facing label. The label span carries `data-analysis-id` so PostHog session replay `maskTextFn` substitutes the id at capture time (users still see the label). Hold Alt (debug mode via AltKeyProvider) to show an id badge alongside the label — additive debug, not a swap. Passing an id of -1 omits the badge entirely.
2
2
 
3
3
  ## When to use
4
4
 
5
- - To display entities that users reference by number, such as analyses or saved items.
6
- - In lists, selectors, or breadcrumbs where the id helps users match items across views.
5
+ - To display entity labels (analyses, drivers, etc.) while recording stable ids in PostHog replay.
6
+ - In lists, selectors, or breadcrumbs where the label is user-facing and the id is for analytics/debug only.
7
7
 
8
8
  ## When not to use
9
9
 
@@ -1,6 +1,9 @@
1
1
  .root
2
2
  display inline-block
3
3
 
4
+ .label
5
+ display inline
6
+
4
7
  .id
5
8
  display none
6
9
  align-items center
@@ -2,6 +2,7 @@
2
2
  // Please do not change this file!
3
3
  interface CssExports {
4
4
  'id': string;
5
+ 'label': string;
5
6
  'root': string;
6
7
  }
7
8
  export const cssExports: CssExports;
@@ -6,7 +6,10 @@ import type { LabelWithIdProps } from './LabelWithId.types';
6
6
  export function LabelWithId({ id, label, className }: LabelWithIdProps) {
7
7
  return (
8
8
  <span data-slot="label-with-id" className={cn(S.root, className)}>
9
- {String(id) !== '-1' && <div className={S.id}>{id}</div>} {label}
9
+ {String(id) !== '-1' && <div className={S.id}>{id}</div>}
10
+ <span className={S.label} data-analysis-id={id}>
11
+ {label}
12
+ </span>
10
13
  </span>
11
14
  );
12
15
  }
@@ -69,8 +69,12 @@ export function NavUserHeader({
69
69
  const userIdentity = useMemo(
70
70
  () => (
71
71
  <div className={S.userInfo}>
72
- <span className={`${S.userName} ph-no-capture`}>{userName}</span>
73
- <span className={S.userEmail}>{userEmail}</span>
72
+ <span className={`${S.userName} ph-no-capture`} data-user-name>
73
+ {userName}
74
+ </span>
75
+ <span className={`${S.userEmail} ph-no-capture`} data-user-email>
76
+ {userEmail}
77
+ </span>
74
78
  </div>
75
79
  ),
76
80
  [userEmail, userName],
@@ -266,8 +266,31 @@ export function extendCustomPerformanceDriftSeedToHistoricalEnd(
266
266
  let lastOrigin = dates[dates.length - 1];
267
267
  if (!lastOrigin) return seed;
268
268
 
269
+ const MAX_MONTH_EXTENSIONS = 500;
270
+ let iterations = 0;
271
+
269
272
  while (lastOrigin.localeCompare(latest) < 0) {
273
+ iterations += 1;
274
+ if (iterations > MAX_MONTH_EXTENSIONS) {
275
+ console.warn(
276
+ 'extendCustomPerformanceDriftSeedToHistoricalEnd: exceeded max month extensions',
277
+ { lastOrigin, latest },
278
+ );
279
+ break;
280
+ }
281
+
270
282
  const nextOrigin = norm(getNextMonth(lastOrigin));
283
+ if (
284
+ nextOrigin === lastOrigin ||
285
+ nextOrigin.localeCompare(lastOrigin) <= 0
286
+ ) {
287
+ console.warn(
288
+ 'extendCustomPerformanceDriftSeedToHistoricalEnd: month did not advance',
289
+ { lastOrigin, nextOrigin, latest },
290
+ );
291
+ break;
292
+ }
293
+
271
294
  const prevPh = perHorizonDates[perHorizonDates.length - 1];
272
295
  const newPh =
273
296
  prevPh.length === horizonCount
@@ -131,7 +131,9 @@ export function SidebarDatasetsItemsGrouped({
131
131
  onDatasetClick?.(dataset.id);
132
132
  }}
133
133
  >
134
- <SmartTextTruncate>{dataset.name}</SmartTextTruncate>
134
+ <SmartTextTruncate data-dataset-id={dataset.id}>
135
+ {dataset.name}
136
+ </SmartTextTruncate>
135
137
  </SidebarMenuSubButton>
136
138
  </SidebarMenuSubItem>
137
139
  ))}
@@ -8,8 +8,14 @@
8
8
  max-width 720px
9
9
  line-height 1.6
10
10
 
11
- :global(.interactive-content)
12
- display block
11
+ :global(h1)
12
+ margin var(--p-4) 0 var(--p-2)
13
+ font-size var(--text-lg)
14
+ font-weight 600
15
+ color var(--foreground)
16
+
17
+ &:first-child
18
+ margin-top 0
13
19
 
14
20
  :global(h2)
15
21
  margin var(--p-4) 0 var(--p-2)
@@ -20,6 +26,15 @@
20
26
  &:first-child
21
27
  margin-top 0
22
28
 
29
+ :global(h3)
30
+ margin var(--p-3) 0 var(--p-2)
31
+ font-size var(--text-sm)
32
+ font-weight 600
33
+ color var(--foreground)
34
+
35
+ &:first-child
36
+ margin-top 0
37
+
23
38
  :global(ul)
24
39
  margin 0 0 var(--p-3)
25
40
  padding-left var(--p-5)
@@ -27,8 +42,71 @@
27
42
  li + li
28
43
  margin-top 2px
29
44
 
45
+ :global(ol)
46
+ margin 0 0 var(--p-3)
47
+ padding-left var(--p-5)
48
+
49
+ li + li
50
+ margin-top 2px
51
+
30
52
  :global(p)
31
53
  margin 0 0 var(--p-3)
32
54
 
33
55
  &:last-child
34
56
  margin-bottom 0
57
+
58
+ :global(code)
59
+ font-family ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace
60
+ font-size 0.875em
61
+ padding 0.2em 0.35em
62
+ border-radius var(--p-1)
63
+ background-color var(--background)
64
+ color var(--foreground)
65
+ box-shadow 0 0 1px var(--foreground)
66
+
67
+ :global(pre)
68
+ margin 0 0 var(--p-3)
69
+ padding var(--p-3)
70
+ overflow-x auto
71
+ border-radius var(--p-2)
72
+ background-color var(--background)
73
+ box-shadow 0 0 1px var(--foreground)
74
+
75
+ code
76
+ padding 0
77
+ box-shadow none
78
+ background none
79
+
80
+ :global(a)
81
+ color var(--sb-green-600)
82
+ text-decoration underline
83
+ text-underline-offset 2px
84
+
85
+ &:hover
86
+ color var(--sb-green-700)
87
+
88
+ :global(.dark) &
89
+ color var(--sb-green-400)
90
+
91
+ &:hover
92
+ color var(--sb-green-300)
93
+
94
+ :global(table)
95
+ width 100%
96
+ margin 0 0 var(--p-3)
97
+ border-collapse collapse
98
+ font-size var(--text-sm)
99
+
100
+ :global(th),
101
+ :global(td)
102
+ padding var(--p-2) var(--p-3)
103
+ border 1px solid var(--border)
104
+ text-align left
105
+ vertical-align top
106
+
107
+ :global(th)
108
+ font-weight 600
109
+ background-color var(--background)
110
+
111
+ :global(strong)
112
+ font-weight 600
@@ -1,5 +1,8 @@
1
- import { InteractiveContent } from '#uilib/components/ui/InteractiveContent';
1
+ import type { Components } from 'react-markdown';
2
+ import ReactMarkdown from 'react-markdown';
3
+
2
4
  import { PageContentSection } from '#uilib/components/ui/Page';
5
+ import remarkGfm from 'remark-gfm';
3
6
 
4
7
  import { stripAgentFrontmatter } from '../../agent-guidance/agent-md-utils';
5
8
  import S from './DocsGuidance.styl';
@@ -9,13 +12,37 @@ export interface DocsGuidanceProps {
9
12
  source: string;
10
13
  }
11
14
 
15
+ function linkTargetRelForHref(href: string): { target?: string; rel?: string } {
16
+ if (/^https?:\/\//i.test(href) || /^mailto:/i.test(href)) {
17
+ return { target: '_blank', rel: 'noopener noreferrer' };
18
+ }
19
+ return {};
20
+ }
21
+
22
+ const markdownComponents: Components = {
23
+ a: ({ href, children, ...props }) => {
24
+ const safeHref = href ?? '';
25
+ const { target, rel } = linkTargetRelForHref(safeHref);
26
+ return (
27
+ <a href={safeHref} target={target} rel={rel} {...props}>
28
+ {children}
29
+ </a>
30
+ );
31
+ },
32
+ };
33
+
12
34
  export function DocsGuidance({ source }: DocsGuidanceProps) {
13
35
  const body = stripAgentFrontmatter(source);
14
36
 
15
37
  return (
16
38
  <PageContentSection grow={false} className={S.root}>
17
39
  <div className={S.markdown}>
18
- <InteractiveContent text={body} variant="full" />
40
+ <ReactMarkdown
41
+ remarkPlugins={[remarkGfm]}
42
+ components={markdownComponents}
43
+ >
44
+ {body}
45
+ </ReactMarkdown>
19
46
  </div>
20
47
  </PageContentSection>
21
48
  );
@@ -0,0 +1,26 @@
1
+ import InfoIconTooltipGuidance from '#uilib/components/ui/InfoIconTooltip/AGENT.md';
2
+ import { InfoIconTooltip } from '#uilib/components/ui/InfoIconTooltip/InfoIconTooltip';
3
+ import { PageContentSection } from '#uilib/components/ui/Page';
4
+
5
+ import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
6
+ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
7
+ import { DocsHeaderActions } from '../docsHeaderActions';
8
+
9
+ export default function InfoIconTooltipPage() {
10
+ return (
11
+ <>
12
+ <AppPageHeader
13
+ breadcrumbs={[{ label: 'InfoIconTooltip' }]}
14
+ title="InfoIconTooltip"
15
+ subheader="Question icon with supplementary tooltip."
16
+ actions={<DocsHeaderActions />}
17
+ />
18
+ <DocsGuidance source={InfoIconTooltipGuidance} />
19
+ <PageContentSection>
20
+ <div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
21
+ <InfoIconTooltip>Test tooltip content.</InfoIconTooltip>
22
+ </div>
23
+ </PageContentSection>
24
+ </>
25
+ );
26
+ }
@@ -507,6 +507,12 @@ export const DOC_REGISTRY: DocEntry[] = [
507
507
  section: 'Forms',
508
508
  load: () => import('./pages/ToggleGroupPage'),
509
509
  },
510
+ {
511
+ slug: 'info-icon-tooltip',
512
+ title: 'InfoIconTooltip',
513
+ section: 'Overlays',
514
+ load: () => import('./pages/InfoIconTooltipPage'),
515
+ },
510
516
  {
511
517
  slug: 'tooltip',
512
518
  title: 'Tooltip',
package/src/index.ts CHANGED
@@ -43,6 +43,7 @@ export * from './components/ui/Foldable';
43
43
  export * from './components/ui/Gap/Gap';
44
44
  export * from './components/ui/GridLayout/GridLayout';
45
45
  export * from './components/ui/Image';
46
+ export * from './components/ui/InfoIconTooltip/InfoIconTooltip';
46
47
  export * from './components/ui/ImageWithFallback';
47
48
  export * from './components/ui/Input';
48
49
  export * from './components/ui/InteractiveContent';
@@ -187,12 +187,28 @@ export function isSameMonth(date1: string, date2: string): boolean {
187
187
  );
188
188
  }
189
189
 
190
+ function parseYearMonth(date: string): { year: number; month: number } {
191
+ const datePart = String(date).split(' ')[0] ?? date;
192
+ const match = datePart.match(/^(\d{4})-(\d{1,2})/);
193
+ if (!match) {
194
+ throw new Error(`Invalid date format: ${date}`);
195
+ }
196
+ return {
197
+ year: parseInt(match[1], 10),
198
+ month: parseInt(match[2], 10),
199
+ };
200
+ }
201
+
202
+ function formatMonthStart(year: number, month: number): string {
203
+ return `${year}-${String(month).padStart(2, '0')}-01`;
204
+ }
205
+
190
206
  /**
191
207
  * Normalize date to first day of month for comparison (YYYY-MM-01)
192
208
  */
193
209
  export function normalizeToMonthStart(date: string): string {
194
- const d = new Date(date);
195
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-01`;
210
+ const { year, month } = parseYearMonth(date);
211
+ return formatMonthStart(year, month);
196
212
  }
197
213
 
198
214
  /**
@@ -225,18 +241,22 @@ export function findLatestForecastDate(
225
241
  * Get the previous month date (first day of previous month)
226
242
  */
227
243
  export function getPreviousMonth(date: string): string {
228
- const d = new Date(date);
229
- d.setMonth(d.getMonth() - 1);
230
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-01`;
244
+ const { year, month } = parseYearMonth(date);
245
+ if (month === 1) {
246
+ return formatMonthStart(year - 1, 12);
247
+ }
248
+ return formatMonthStart(year, month - 1);
231
249
  }
232
250
 
233
251
  /**
234
252
  * Get the next month date (first day of next month)
235
253
  */
236
254
  export function getNextMonth(date: string): string {
237
- const d = new Date(date);
238
- d.setMonth(d.getMonth() + 1);
239
- return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-01`;
255
+ const { year, month } = parseYearMonth(date);
256
+ if (month === 12) {
257
+ return formatMonthStart(year + 1, 1);
258
+ }
259
+ return formatMonthStart(year, month + 1);
240
260
  }
241
261
 
242
262
  /**