@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
|
@@ -9,21 +9,112 @@ import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
|
9
9
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
10
10
|
|
|
11
11
|
export default function RenamerPage() {
|
|
12
|
-
const [
|
|
12
|
+
const [smName, setSmName] = useState('Export settings');
|
|
13
|
+
const [mdName, setMdName] = useState('Dataset name');
|
|
14
|
+
const [lgName, setLgName] = useState('Release notes');
|
|
15
|
+
const [lgLongName, setLgLongName] = useState(
|
|
16
|
+
'Quarterly revenue forecast and variance analysis for North America',
|
|
17
|
+
);
|
|
13
18
|
|
|
14
19
|
return (
|
|
15
20
|
<>
|
|
16
21
|
<AppPageHeader
|
|
17
22
|
breadcrumbs={[{ label: 'Renamer' }]}
|
|
18
23
|
title="Renamer"
|
|
19
|
-
subheader="Inline rename with pencil control."
|
|
24
|
+
subheader="Inline rename with pencil control — sm, md, and lg sizes."
|
|
20
25
|
actions={<DocsHeaderActions />}
|
|
21
26
|
/>
|
|
22
27
|
<DocsGuidance source={renamerGuidance} />
|
|
23
|
-
<PageContentSection
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
<PageContentSection
|
|
29
|
+
style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}
|
|
30
|
+
>
|
|
31
|
+
<section>
|
|
32
|
+
<h3 style={{ marginBottom: '1rem' }}>Sizes</h3>
|
|
33
|
+
<p
|
|
34
|
+
style={{
|
|
35
|
+
marginBottom: '0.75rem',
|
|
36
|
+
color: 'var(--muted-foreground)',
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
Pass <code>size</code> for sm / md / lg. The pencil icon scales with
|
|
40
|
+
the size; <code>lg</code> uses page-title typography.
|
|
41
|
+
</p>
|
|
42
|
+
<div
|
|
43
|
+
style={{
|
|
44
|
+
display: 'flex',
|
|
45
|
+
flexDirection: 'column',
|
|
46
|
+
gap: '1.5rem',
|
|
47
|
+
}}
|
|
48
|
+
>
|
|
49
|
+
<div>
|
|
50
|
+
<div
|
|
51
|
+
style={{
|
|
52
|
+
marginBottom: '0.5rem',
|
|
53
|
+
fontWeight: 600,
|
|
54
|
+
fontSize: '0.875rem',
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
sm
|
|
58
|
+
</div>
|
|
59
|
+
<Renamer value={smName} onChange={setSmName} size="sm">
|
|
60
|
+
{smName}
|
|
61
|
+
</Renamer>
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
<div
|
|
65
|
+
style={{
|
|
66
|
+
marginBottom: '0.5rem',
|
|
67
|
+
fontWeight: 600,
|
|
68
|
+
fontSize: '0.875rem',
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
md
|
|
72
|
+
</div>
|
|
73
|
+
<Renamer value={mdName} onChange={setMdName} size="md">
|
|
74
|
+
{mdName}
|
|
75
|
+
</Renamer>
|
|
76
|
+
</div>
|
|
77
|
+
<div>
|
|
78
|
+
<div
|
|
79
|
+
style={{
|
|
80
|
+
marginBottom: '0.5rem',
|
|
81
|
+
fontWeight: 600,
|
|
82
|
+
fontSize: '0.875rem',
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
lg
|
|
86
|
+
</div>
|
|
87
|
+
<Renamer value={lgName} onChange={setLgName} size="lg">
|
|
88
|
+
{lgName}
|
|
89
|
+
</Renamer>
|
|
90
|
+
</div>
|
|
91
|
+
<div>
|
|
92
|
+
<div
|
|
93
|
+
style={{
|
|
94
|
+
marginBottom: '0.5rem',
|
|
95
|
+
fontWeight: 600,
|
|
96
|
+
fontSize: '0.875rem',
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
lg — wrapping title
|
|
100
|
+
</div>
|
|
101
|
+
<p
|
|
102
|
+
style={{
|
|
103
|
+
marginBottom: '0.75rem',
|
|
104
|
+
color: 'var(--muted-foreground)',
|
|
105
|
+
fontSize: '0.875rem',
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
Long titles wrap; the pencil stays inline after the last line.
|
|
109
|
+
</p>
|
|
110
|
+
<div style={{ maxWidth: '20rem' }}>
|
|
111
|
+
<Renamer value={lgLongName} onChange={setLgLongName} size="lg">
|
|
112
|
+
{lgLongName}
|
|
113
|
+
</Renamer>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</section>
|
|
27
118
|
</PageContentSection>
|
|
28
119
|
</>
|
|
29
120
|
);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
2
|
-
import { VimeoEmbed } from '#uilib/components/ui/VimeoEmbed';
|
|
3
|
-
import vimeoEmbedGuidance from '#uilib/components/ui/VimeoEmbed/AGENT.md';
|
|
4
|
-
|
|
5
1
|
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
6
2
|
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
7
3
|
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
4
|
+
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
5
|
+
import { VimeoEmbed } from '#uilib/components/ui/VimeoEmbed';
|
|
6
|
+
import vimeoEmbedGuidance from '#uilib/components/ui/VimeoEmbed/AGENT.md';
|
|
8
7
|
|
|
9
8
|
export default function VimeoEmbedPage() {
|
|
10
9
|
return (
|
|
@@ -17,7 +16,7 @@ export default function VimeoEmbedPage() {
|
|
|
17
16
|
/>
|
|
18
17
|
<DocsGuidance source={vimeoEmbedGuidance} />
|
|
19
18
|
<PageContentSection style={{ maxWidth: 560 }}>
|
|
20
|
-
<VimeoEmbed videoId="
|
|
19
|
+
<VimeoEmbed videoId="1202135779" videoHash="e26adba036" />
|
|
21
20
|
</PageContentSection>
|
|
22
21
|
</>
|
|
23
22
|
);
|
package/src/docs/registry.ts
CHANGED
|
@@ -68,6 +68,12 @@ export const DOC_REGISTRY: DocEntry[] = [
|
|
|
68
68
|
section: 'Forms',
|
|
69
69
|
load: () => import('./pages/ButtonPage'),
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
slug: 'button-group',
|
|
73
|
+
title: 'ButtonGroup',
|
|
74
|
+
section: 'Forms',
|
|
75
|
+
load: () => import('./pages/ButtonGroupPage'),
|
|
76
|
+
},
|
|
71
77
|
{
|
|
72
78
|
slug: 'analyses-selector',
|
|
73
79
|
title: 'AnalysesSelector',
|
|
@@ -86,12 +92,6 @@ export const DOC_REGISTRY: DocEntry[] = [
|
|
|
86
92
|
section: 'Data display',
|
|
87
93
|
load: () => import('./pages/AvatarPage'),
|
|
88
94
|
},
|
|
89
|
-
{
|
|
90
|
-
slug: 'badge',
|
|
91
|
-
title: 'Badge',
|
|
92
|
-
section: 'Data display',
|
|
93
|
-
load: () => import('./pages/BadgePage'),
|
|
94
|
-
},
|
|
95
95
|
{
|
|
96
96
|
slug: 'chip',
|
|
97
97
|
title: 'Chip',
|
|
@@ -495,12 +495,6 @@ export const DOC_REGISTRY: DocEntry[] = [
|
|
|
495
495
|
section: 'Forms',
|
|
496
496
|
load: () => import('./pages/TimeRangeControlsPage'),
|
|
497
497
|
},
|
|
498
|
-
{
|
|
499
|
-
slug: 'toggle',
|
|
500
|
-
title: 'Toggle',
|
|
501
|
-
section: 'Forms',
|
|
502
|
-
load: () => import('./pages/TogglePage'),
|
|
503
|
-
},
|
|
504
498
|
{
|
|
505
499
|
slug: 'toggle-group',
|
|
506
500
|
title: 'ToggleGroup',
|
package/src/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ export * from './components/ui/AnalysesSelector';
|
|
|
17
17
|
export * from './components/ui/AnalysisLineIcon';
|
|
18
18
|
export * from './components/ui/AppHeader';
|
|
19
19
|
export * from './components/ui/Avatar';
|
|
20
|
-
export * from './components/ui/Badge';
|
|
21
20
|
export * from './components/ui/Banner';
|
|
22
21
|
export * from './components/ui/Chip';
|
|
23
22
|
export * from './components/ui/Kicker';
|
|
@@ -25,6 +24,7 @@ export * from './components/ui/PullQuote';
|
|
|
25
24
|
export * from './components/ui/SignalCard';
|
|
26
25
|
export * from './components/ui/Breadcrumb';
|
|
27
26
|
export * from './components/ui/Button';
|
|
27
|
+
export * from './components/ui/ButtonGroup';
|
|
28
28
|
export * from './components/ui/Card';
|
|
29
29
|
export * from './components/ui/Chart';
|
|
30
30
|
export * from './components/ui/ChartAreaInteractive';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import cn from 'classnames';
|
|
3
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
-
import S from './Badge.styl.js';
|
|
5
|
-
|
|
6
|
-
function Badge({ className, variant = 'default', asChild = false, squared = false, ...props }) {
|
|
7
|
-
const Comp = asChild ? Slot : 'div';
|
|
8
|
-
return (jsx(Comp, { "data-slot": "badge", className: cn(S.root, variant && S[`variant-${variant}`], squared && S.squared, className), ...props }));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { Badge };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import styleInject from 'style-inject';
|
|
2
|
-
|
|
3
|
-
var css_248z = ".Badge_root__gVZZ-{align-items:center;border-color:transparent;border-radius:var(--radius-pill);display:inline-flex;flex-shrink:0;font-family:var(--font-family-body);font-size:11px;font-weight:400;gap:var(--spacing-xs);justify-content:center;line-height:1rem;overflow:hidden;padding:5px 10px;transition:background-color .2s,color .2s;white-space:nowrap;width:-moz-fit-content;width:fit-content}.Badge_root__gVZZ-.Badge_squared__dpe-t{border-radius:var(--p-1)}.Badge_root__gVZZ->svg{height:.75rem;pointer-events:none;width:.75rem}.Badge_root__gVZZ-.Badge_variant-default__pYlwv{background-color:var(--sb-slate-50);color:var(--sb-slate-600)}a.Badge_root__gVZZ-.Badge_variant-default__pYlwv:hover{background-color:var(--sb-slate-100)}.dark .Badge_root__gVZZ-.Badge_variant-default__pYlwv{background-color:var(--sb-slate-900);color:var(--sb-slate-400)}a.dark .Badge_root__gVZZ-.Badge_variant-default__pYlwv:hover{background-color:var(--sb-slate-800)}.Badge_root__gVZZ-.Badge_variant-outline__73s9y{background-color:transparent;border:1px solid var(--border);color:var(--foreground)}a.Badge_root__gVZZ-.Badge_variant-outline__73s9y:hover{background-color:var(--accent);color:var(--accent-foreground)}.Badge_root__gVZZ-.Badge_variant-red__h3aUo{background-color:var(--sb-red-50);color:var(--sb-red-600)}a.Badge_root__gVZZ-.Badge_variant-red__h3aUo:hover{background-color:var(--sb-red-100)}.dark .Badge_root__gVZZ-.Badge_variant-red__h3aUo{background-color:var(--sb-red-900);color:var(--sb-red-400)}a.dark .Badge_root__gVZZ-.Badge_variant-red__h3aUo:hover{background-color:var(--sb-red-800)}.Badge_root__gVZZ-.Badge_variant-green__u7N8I{background-color:var(--sb-green-50);color:var(--sb-green-600)}a.Badge_root__gVZZ-.Badge_variant-green__u7N8I:hover{background-color:var(--sb-green-100)}.dark .Badge_root__gVZZ-.Badge_variant-green__u7N8I{background-color:var(--sb-green-900);color:var(--sb-green-400)}a.dark .Badge_root__gVZZ-.Badge_variant-green__u7N8I:hover{background-color:var(--sb-green-800)}.Badge_root__gVZZ-.Badge_variant-yellow__jEzv5{background-color:var(--sb-yellow-50);color:var(--sb-yellow-600)}a.Badge_root__gVZZ-.Badge_variant-yellow__jEzv5:hover{background-color:var(--sb-yellow-100)}.dark .Badge_root__gVZZ-.Badge_variant-yellow__jEzv5{background-color:var(--sb-yellow-900);color:var(--sb-yellow-400)}a.dark .Badge_root__gVZZ-.Badge_variant-yellow__jEzv5:hover{background-color:var(--sb-yellow-800)}";
|
|
4
|
-
var S = {"root":"Badge_root__gVZZ-","squared":"Badge_squared__dpe-t","variant-default":"Badge_variant-default__pYlwv","variant-outline":"Badge_variant-outline__73s9y","variant-red":"Badge_variant-red__h3aUo","variant-green":"Badge_variant-green__u7N8I","variant-yellow":"Badge_variant-yellow__jEzv5"};
|
|
5
|
-
styleInject(css_248z);
|
|
6
|
-
|
|
7
|
-
export { S as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function BadgePage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function TogglePage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Badges are compact labels that highlight a status, category, or count. Choose a variant that matches the meaning: default or outline for neutral labels, red and green for negative and positive states.
|
|
2
|
-
|
|
3
|
-
## When to use
|
|
4
|
-
|
|
5
|
-
- To show the status of an item, such as active, failed, or done.
|
|
6
|
-
- To label or categorise content in lists, tables, and cards.
|
|
7
|
-
- To surface short metadata next to a title.
|
|
8
|
-
|
|
9
|
-
## When not to use
|
|
10
|
-
|
|
11
|
-
- For interactive actions; badges are not clickable, use Button instead.
|
|
12
|
-
- For long descriptive text; keep badge labels to one or two words.
|
|
13
|
-
|
|
14
|
-
## Do
|
|
15
|
-
|
|
16
|
-
- Use colour variants consistently so a given colour always carries the same meaning across the product.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
.root
|
|
2
|
-
display inline-flex
|
|
3
|
-
align-items center
|
|
4
|
-
justify-content center
|
|
5
|
-
width fit-content
|
|
6
|
-
flex-shrink 0
|
|
7
|
-
white-space nowrap
|
|
8
|
-
gap var(--spacing-xs)
|
|
9
|
-
padding 5px 10px
|
|
10
|
-
border-radius var(--radius-pill)
|
|
11
|
-
border-color transparent
|
|
12
|
-
font-size 11px
|
|
13
|
-
line-height 1rem
|
|
14
|
-
font-family var(--font-family-body)
|
|
15
|
-
font-weight 400
|
|
16
|
-
overflow hidden
|
|
17
|
-
transition background-color 0.2s, color 0.2s
|
|
18
|
-
|
|
19
|
-
&.squared
|
|
20
|
-
border-radius var(--p-1)
|
|
21
|
-
|
|
22
|
-
& > svg
|
|
23
|
-
width 0.75rem
|
|
24
|
-
height 0.75rem
|
|
25
|
-
pointer-events none
|
|
26
|
-
|
|
27
|
-
// Default variant
|
|
28
|
-
&.variant-default
|
|
29
|
-
background-color var(--sb-slate-50)
|
|
30
|
-
color var(--sb-slate-600)
|
|
31
|
-
|
|
32
|
-
a&:hover
|
|
33
|
-
background-color var(--sb-slate-100)
|
|
34
|
-
|
|
35
|
-
:global(.dark) &
|
|
36
|
-
background-color var(--sb-slate-900)
|
|
37
|
-
color var(--sb-slate-400)
|
|
38
|
-
|
|
39
|
-
a&:hover
|
|
40
|
-
background-color var(--sb-slate-800)
|
|
41
|
-
|
|
42
|
-
// Outline variant
|
|
43
|
-
&.variant-outline
|
|
44
|
-
background-color transparent
|
|
45
|
-
border 1px solid var(--border)
|
|
46
|
-
color var(--foreground)
|
|
47
|
-
|
|
48
|
-
a&:hover
|
|
49
|
-
background-color var(--accent)
|
|
50
|
-
color var(--accent-foreground)
|
|
51
|
-
|
|
52
|
-
// Red variant
|
|
53
|
-
&.variant-red
|
|
54
|
-
background-color var(--sb-red-50)
|
|
55
|
-
color var(--sb-red-600)
|
|
56
|
-
|
|
57
|
-
a&:hover
|
|
58
|
-
background-color var(--sb-red-100)
|
|
59
|
-
|
|
60
|
-
:global(.dark) &
|
|
61
|
-
background-color var(--sb-red-900)
|
|
62
|
-
color var(--sb-red-400)
|
|
63
|
-
|
|
64
|
-
a&:hover
|
|
65
|
-
background-color var(--sb-red-800)
|
|
66
|
-
|
|
67
|
-
// Green variant
|
|
68
|
-
&.variant-green
|
|
69
|
-
background-color var(--sb-green-50)
|
|
70
|
-
color var(--sb-green-600)
|
|
71
|
-
|
|
72
|
-
a&:hover
|
|
73
|
-
background-color var(--sb-green-100)
|
|
74
|
-
|
|
75
|
-
:global(.dark) &
|
|
76
|
-
background-color var(--sb-green-900)
|
|
77
|
-
color var(--sb-green-400)
|
|
78
|
-
|
|
79
|
-
a&:hover
|
|
80
|
-
background-color var(--sb-green-800)
|
|
81
|
-
|
|
82
|
-
// Yellow variant
|
|
83
|
-
&.variant-yellow
|
|
84
|
-
background-color var(--sb-yellow-50)
|
|
85
|
-
color var(--sb-yellow-600)
|
|
86
|
-
|
|
87
|
-
a&:hover
|
|
88
|
-
background-color var(--sb-yellow-100)
|
|
89
|
-
|
|
90
|
-
:global(.dark) &
|
|
91
|
-
background-color var(--sb-yellow-900)
|
|
92
|
-
color var(--sb-yellow-400)
|
|
93
|
-
|
|
94
|
-
a&:hover
|
|
95
|
-
background-color var(--sb-yellow-800)
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
|
|
3
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
-
|
|
5
|
-
import S from './Badge.styl';
|
|
6
|
-
import { BadgeProps } from './Badge.types';
|
|
7
|
-
|
|
8
|
-
function Badge({
|
|
9
|
-
className,
|
|
10
|
-
variant = 'default',
|
|
11
|
-
asChild = false,
|
|
12
|
-
squared = false,
|
|
13
|
-
...props
|
|
14
|
-
}: BadgeProps) {
|
|
15
|
-
const Comp = asChild ? Slot : 'div';
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<Comp
|
|
19
|
-
data-slot="badge"
|
|
20
|
-
className={cn(
|
|
21
|
-
S.root,
|
|
22
|
-
variant && S[`variant-${variant}`],
|
|
23
|
-
squared && S.squared,
|
|
24
|
-
className,
|
|
25
|
-
)}
|
|
26
|
-
{...props}
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { Badge };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Badge } from '#uilib/components/ui/Badge';
|
|
2
|
-
import BadgeGuidance from '#uilib/components/ui/Badge/AGENT.md';
|
|
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 BadgePage() {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
<AppPageHeader
|
|
13
|
-
breadcrumbs={[{ label: 'Badge' }]}
|
|
14
|
-
title="Badge"
|
|
15
|
-
subheader="Status and label badges."
|
|
16
|
-
actions={<DocsHeaderActions />}
|
|
17
|
-
/>
|
|
18
|
-
<DocsGuidance source={BadgeGuidance} />
|
|
19
|
-
<PageContentSection
|
|
20
|
-
style={{ display: 'flex', flexWrap: 'wrap', gap: '0.5rem' }}
|
|
21
|
-
>
|
|
22
|
-
<Badge>Default</Badge>
|
|
23
|
-
<Badge variant="outline">Outline</Badge>
|
|
24
|
-
<Badge variant="red">Red</Badge>
|
|
25
|
-
<Badge variant="green">Green</Badge>
|
|
26
|
-
<Badge squared>Squared</Badge>
|
|
27
|
-
</PageContentSection>
|
|
28
|
-
</>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PageContentSection } from '#uilib/components/ui/Page';
|
|
2
|
-
import { Toggle } from '#uilib/components/ui/Toggle';
|
|
3
|
-
import toggleGuidance from '#uilib/components/ui/Toggle/AGENT.md';
|
|
4
|
-
import { Bold } from 'lucide-react';
|
|
5
|
-
|
|
6
|
-
import { AppPageHeader } from '../components/AppPageHeader/AppPageHeader';
|
|
7
|
-
import { DocsGuidance } from '../components/DocsGuidance/DocsGuidance';
|
|
8
|
-
import { DocsHeaderActions } from '../docsHeaderActions';
|
|
9
|
-
|
|
10
|
-
export default function TogglePage() {
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<AppPageHeader
|
|
14
|
-
breadcrumbs={[{ label: 'Toggle' }]}
|
|
15
|
-
title="Toggle"
|
|
16
|
-
subheader="Pressable toggle (two-state)."
|
|
17
|
-
actions={<DocsHeaderActions />}
|
|
18
|
-
/>
|
|
19
|
-
<DocsGuidance source={toggleGuidance} />
|
|
20
|
-
<PageContentSection>
|
|
21
|
-
<Toggle aria-label="Bold" size="sm">
|
|
22
|
-
<Bold size={16} />
|
|
23
|
-
</Toggle>
|
|
24
|
-
</PageContentSection>
|
|
25
|
-
</>
|
|
26
|
-
);
|
|
27
|
-
}
|