@sybilion/uilib 1.4.5 → 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.
@@ -35,6 +35,7 @@ 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…
@@ -34,6 +34,7 @@ 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…
@@ -34,6 +34,7 @@ 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…
@@ -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 };
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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sybilion/uilib",
3
- "version": "1.4.5",
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",
@@ -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;
@@ -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';