@umami/shiso 0.55.0 → 0.61.0
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/CHANGELOG.md +12 -0
- package/README.md +9 -49
- package/bin/shiso.mjs +132 -0
- package/docs.schema.json +835 -0
- package/mdx.config.ts +143 -0
- package/package.json +73 -83
- package/scripts/check-package.mjs +18 -0
- package/scripts/generate-icon-registry.mjs +196 -0
- package/scripts/generate-last-modified.mjs +128 -0
- package/scripts/generate-search-index.mjs +252 -0
- package/scripts/load-docs-config.mjs +244 -0
- package/scripts/prerender.mjs +187 -0
- package/scripts/validate-config.mjs +104 -0
- package/scripts/vite-docs-config.mjs +60 -0
- package/src/App.tsx +39 -0
- package/src/components/Banner.tsx +69 -0
- package/src/components/CodeBlock.tsx +46 -0
- package/src/components/ConfiguredIcon.tsx +15 -0
- package/src/components/ContextualMenu.tsx +93 -0
- package/src/components/DocContent.tsx +100 -0
- package/src/components/Docs.tsx +126 -0
- package/src/components/Footer.tsx +84 -0
- package/src/components/Header.tsx +72 -0
- package/src/components/Layout.tsx +16 -0
- package/src/components/PageLinks.tsx +71 -0
- package/src/components/Search.tsx +208 -0
- package/src/components/SideNav.tsx +347 -0
- package/src/components/SocialIcon.tsx +88 -0
- package/src/components/ThemeToggle.tsx +34 -0
- package/src/components/TopNav.tsx +127 -0
- package/src/components/docs/Accordion.tsx +68 -0
- package/src/components/docs/Badge.tsx +171 -0
- package/src/components/docs/Callout.tsx +73 -0
- package/src/components/docs/Card.tsx +158 -0
- package/src/components/docs/CodeGroup.tsx +73 -0
- package/src/components/docs/Columns.tsx +20 -0
- package/src/components/docs/Expandable.tsx +28 -0
- package/src/components/docs/Frame.tsx +56 -0
- package/src/components/docs/Icon.tsx +30 -0
- package/src/components/docs/ParamField.tsx +45 -0
- package/src/components/docs/PropertiesTable.tsx +84 -0
- package/src/components/docs/ResponseField.tsx +36 -0
- package/src/components/docs/Steps.tsx +47 -0
- package/src/components/docs/Tabs.tsx +116 -0
- package/src/components/docs/Tooltip.tsx +21 -0
- package/src/components/docs/index.ts +15 -0
- package/src/components/docs/styles.ts +82 -0
- package/src/components/docs/utils.ts +118 -0
- package/src/components/icons/index.ts +17 -0
- package/src/components/ui/accordion.tsx +69 -0
- package/src/components/ui/alert.tsx +69 -0
- package/src/components/ui/badge.tsx +49 -0
- package/src/components/ui/button.tsx +58 -0
- package/src/components/ui/card.tsx +88 -0
- package/src/components/ui/collapsible.tsx +15 -0
- package/src/components/ui/command.tsx +173 -0
- package/src/components/ui/dialog.tsx +137 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/scroll-area.tsx +71 -0
- package/src/components/ui/sheet.tsx +124 -0
- package/src/components/ui/tabs.tsx +73 -0
- package/src/components/ui/tooltip.tsx +52 -0
- package/src/declarations.d.ts +9 -0
- package/src/entry-client.tsx +17 -0
- package/src/entry-server.tsx +77 -0
- package/src/generated/last-modified.ts +2 -0
- package/src/lib/content.ts +44 -0
- package/src/lib/docs-config.ts +682 -0
- package/src/lib/head.ts +220 -0
- package/src/lib/icon-registry.generated.ts +4 -0
- package/src/lib/icons.ts +29 -0
- package/src/lib/inline-markdown.tsx +86 -0
- package/src/lib/mdast.ts +56 -0
- package/src/lib/paths.ts +86 -0
- package/src/lib/remark-toc.ts +71 -0
- package/src/lib/search/config.ts +43 -0
- package/src/lib/search/provider.ts +80 -0
- package/src/lib/search/providers/local.ts +15 -0
- package/src/lib/search-index.generated.ts +4 -0
- package/src/lib/search.ts +100 -0
- package/src/lib/site-config.ts +104 -0
- package/src/lib/site-model.ts +221 -0
- package/src/lib/slug.ts +38 -0
- package/src/lib/types.ts +478 -0
- package/src/lib/utils.ts +6 -0
- package/src/pages/DocPage.tsx +33 -0
- package/src/styles/global.css +268 -0
- package/src/styles/tokens.css +114 -0
- package/types/client.d.ts +3 -0
- package/types/search.d.ts +17 -0
- package/vite.config.ts +342 -0
- package/LICENSE +0 -21
- package/dist/index.css +0 -189
- package/dist/index.d.ts +0 -57
- package/dist/index.js +0 -464
- package/dist/index.mjs +0 -437
- package/server/index.d.ts +0 -30
- package/server/index.js +0 -189
- package/styles.css +0 -4766
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu';
|
|
4
|
+
import { CheckIcon, ChevronRightIcon } from 'lucide-react';
|
|
5
|
+
import type * as React from 'react';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
9
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
13
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
17
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function DropdownMenuContent({
|
|
21
|
+
align = 'start',
|
|
22
|
+
alignOffset = 0,
|
|
23
|
+
side = 'bottom',
|
|
24
|
+
sideOffset = 4,
|
|
25
|
+
className,
|
|
26
|
+
...props
|
|
27
|
+
}: MenuPrimitive.Popup.Props &
|
|
28
|
+
Pick<MenuPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
29
|
+
return (
|
|
30
|
+
<MenuPrimitive.Portal>
|
|
31
|
+
<MenuPrimitive.Positioner
|
|
32
|
+
className="isolate z-50 outline-none"
|
|
33
|
+
align={align}
|
|
34
|
+
alignOffset={alignOffset}
|
|
35
|
+
side={side}
|
|
36
|
+
sideOffset={sideOffset}
|
|
37
|
+
>
|
|
38
|
+
<MenuPrimitive.Popup
|
|
39
|
+
data-slot="dropdown-menu-content"
|
|
40
|
+
className={cn(
|
|
41
|
+
'z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
</MenuPrimitive.Positioner>
|
|
47
|
+
</MenuPrimitive.Portal>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
52
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function DropdownMenuLabel({
|
|
56
|
+
className,
|
|
57
|
+
inset,
|
|
58
|
+
...props
|
|
59
|
+
}: MenuPrimitive.GroupLabel.Props & {
|
|
60
|
+
inset?: boolean;
|
|
61
|
+
}) {
|
|
62
|
+
return (
|
|
63
|
+
<MenuPrimitive.GroupLabel
|
|
64
|
+
data-slot="dropdown-menu-label"
|
|
65
|
+
data-inset={inset}
|
|
66
|
+
className={cn(
|
|
67
|
+
'px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7',
|
|
68
|
+
className,
|
|
69
|
+
)}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function DropdownMenuItem({
|
|
76
|
+
className,
|
|
77
|
+
inset,
|
|
78
|
+
variant = 'default',
|
|
79
|
+
...props
|
|
80
|
+
}: MenuPrimitive.Item.Props & {
|
|
81
|
+
inset?: boolean;
|
|
82
|
+
variant?: 'default' | 'destructive';
|
|
83
|
+
}) {
|
|
84
|
+
return (
|
|
85
|
+
<MenuPrimitive.Item
|
|
86
|
+
data-slot="dropdown-menu-item"
|
|
87
|
+
data-inset={inset}
|
|
88
|
+
data-variant={variant}
|
|
89
|
+
className={cn(
|
|
90
|
+
"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
99
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function DropdownMenuSubTrigger({
|
|
103
|
+
className,
|
|
104
|
+
inset,
|
|
105
|
+
children,
|
|
106
|
+
...props
|
|
107
|
+
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
108
|
+
inset?: boolean;
|
|
109
|
+
}) {
|
|
110
|
+
return (
|
|
111
|
+
<MenuPrimitive.SubmenuTrigger
|
|
112
|
+
data-slot="dropdown-menu-sub-trigger"
|
|
113
|
+
data-inset={inset}
|
|
114
|
+
className={cn(
|
|
115
|
+
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
116
|
+
className,
|
|
117
|
+
)}
|
|
118
|
+
{...props}
|
|
119
|
+
>
|
|
120
|
+
{children}
|
|
121
|
+
<ChevronRightIcon className="ml-auto" />
|
|
122
|
+
</MenuPrimitive.SubmenuTrigger>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function DropdownMenuSubContent({
|
|
127
|
+
align = 'start',
|
|
128
|
+
alignOffset = -3,
|
|
129
|
+
side = 'right',
|
|
130
|
+
sideOffset = 0,
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}: React.ComponentProps<typeof DropdownMenuContent>) {
|
|
134
|
+
return (
|
|
135
|
+
<DropdownMenuContent
|
|
136
|
+
data-slot="dropdown-menu-sub-content"
|
|
137
|
+
className={cn(
|
|
138
|
+
'w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
139
|
+
className,
|
|
140
|
+
)}
|
|
141
|
+
align={align}
|
|
142
|
+
alignOffset={alignOffset}
|
|
143
|
+
side={side}
|
|
144
|
+
sideOffset={sideOffset}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function DropdownMenuCheckboxItem({
|
|
151
|
+
className,
|
|
152
|
+
children,
|
|
153
|
+
checked,
|
|
154
|
+
inset,
|
|
155
|
+
...props
|
|
156
|
+
}: MenuPrimitive.CheckboxItem.Props & {
|
|
157
|
+
inset?: boolean;
|
|
158
|
+
}) {
|
|
159
|
+
return (
|
|
160
|
+
<MenuPrimitive.CheckboxItem
|
|
161
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
162
|
+
data-inset={inset}
|
|
163
|
+
className={cn(
|
|
164
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
165
|
+
className,
|
|
166
|
+
)}
|
|
167
|
+
checked={checked}
|
|
168
|
+
{...props}
|
|
169
|
+
>
|
|
170
|
+
<span
|
|
171
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
172
|
+
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
173
|
+
>
|
|
174
|
+
<MenuPrimitive.CheckboxItemIndicator>
|
|
175
|
+
<CheckIcon />
|
|
176
|
+
</MenuPrimitive.CheckboxItemIndicator>
|
|
177
|
+
</span>
|
|
178
|
+
{children}
|
|
179
|
+
</MenuPrimitive.CheckboxItem>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
184
|
+
return <MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function DropdownMenuRadioItem({
|
|
188
|
+
className,
|
|
189
|
+
children,
|
|
190
|
+
inset,
|
|
191
|
+
...props
|
|
192
|
+
}: MenuPrimitive.RadioItem.Props & {
|
|
193
|
+
inset?: boolean;
|
|
194
|
+
}) {
|
|
195
|
+
return (
|
|
196
|
+
<MenuPrimitive.RadioItem
|
|
197
|
+
data-slot="dropdown-menu-radio-item"
|
|
198
|
+
data-inset={inset}
|
|
199
|
+
className={cn(
|
|
200
|
+
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
201
|
+
className,
|
|
202
|
+
)}
|
|
203
|
+
{...props}
|
|
204
|
+
>
|
|
205
|
+
<span
|
|
206
|
+
className="pointer-events-none absolute right-2 flex items-center justify-center"
|
|
207
|
+
data-slot="dropdown-menu-radio-item-indicator"
|
|
208
|
+
>
|
|
209
|
+
<MenuPrimitive.RadioItemIndicator>
|
|
210
|
+
<CheckIcon />
|
|
211
|
+
</MenuPrimitive.RadioItemIndicator>
|
|
212
|
+
</span>
|
|
213
|
+
{children}
|
|
214
|
+
</MenuPrimitive.RadioItem>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
|
|
219
|
+
return (
|
|
220
|
+
<MenuPrimitive.Separator
|
|
221
|
+
data-slot="dropdown-menu-separator"
|
|
222
|
+
className={cn('-mx-1 my-1 h-px bg-border', className)}
|
|
223
|
+
{...props}
|
|
224
|
+
/>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
229
|
+
return (
|
|
230
|
+
<span
|
|
231
|
+
data-slot="dropdown-menu-shortcut"
|
|
232
|
+
className={cn(
|
|
233
|
+
'ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground',
|
|
234
|
+
className,
|
|
235
|
+
)}
|
|
236
|
+
{...props}
|
|
237
|
+
/>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export {
|
|
242
|
+
DropdownMenu,
|
|
243
|
+
DropdownMenuCheckboxItem,
|
|
244
|
+
DropdownMenuContent,
|
|
245
|
+
DropdownMenuGroup,
|
|
246
|
+
DropdownMenuItem,
|
|
247
|
+
DropdownMenuLabel,
|
|
248
|
+
DropdownMenuPortal,
|
|
249
|
+
DropdownMenuRadioGroup,
|
|
250
|
+
DropdownMenuRadioItem,
|
|
251
|
+
DropdownMenuSeparator,
|
|
252
|
+
DropdownMenuShortcut,
|
|
253
|
+
DropdownMenuSub,
|
|
254
|
+
DropdownMenuSubContent,
|
|
255
|
+
DropdownMenuSubTrigger,
|
|
256
|
+
DropdownMenuTrigger,
|
|
257
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
|
|
7
|
+
type ScrollAreaProps = ScrollAreaPrimitive.Root.Props & {
|
|
8
|
+
scrollbars?: 'vertical' | 'horizontal' | 'both';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
function ScrollArea({ className, children, scrollbars = 'vertical', ...props }: ScrollAreaProps) {
|
|
12
|
+
const hasHorizontalScrollbar = scrollbars === 'horizontal' || scrollbars === 'both';
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<ScrollAreaPrimitive.Root
|
|
16
|
+
data-slot="scroll-area"
|
|
17
|
+
className={cn(
|
|
18
|
+
'group/scrollarea relative overflow-hidden [--scroll-area-corner-height:0px] [--scroll-area-corner-width:0px]',
|
|
19
|
+
className,
|
|
20
|
+
)}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
<ScrollAreaPrimitive.Viewport
|
|
24
|
+
data-slot="scroll-area-viewport"
|
|
25
|
+
className="box-border h-full w-full max-w-full rounded-[inherit] overscroll-contain outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
|
|
26
|
+
>
|
|
27
|
+
<ScrollAreaPrimitive.Content
|
|
28
|
+
data-slot="scroll-area-content"
|
|
29
|
+
className={cn(
|
|
30
|
+
'box-border min-w-0',
|
|
31
|
+
hasHorizontalScrollbar ? 'w-max min-w-full max-w-none' : 'w-full max-w-full',
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</ScrollAreaPrimitive.Content>
|
|
36
|
+
</ScrollAreaPrimitive.Viewport>
|
|
37
|
+
{scrollbars !== 'horizontal' && <ScrollBar />}
|
|
38
|
+
{hasHorizontalScrollbar && <ScrollBar orientation="horizontal" />}
|
|
39
|
+
<ScrollAreaPrimitive.Corner />
|
|
40
|
+
</ScrollAreaPrimitive.Root>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function ScrollBar({
|
|
45
|
+
className,
|
|
46
|
+
orientation = 'vertical',
|
|
47
|
+
...props
|
|
48
|
+
}: ScrollAreaPrimitive.Scrollbar.Props) {
|
|
49
|
+
return (
|
|
50
|
+
<ScrollAreaPrimitive.Scrollbar
|
|
51
|
+
data-slot="scroll-area-scrollbar"
|
|
52
|
+
data-orientation={orientation}
|
|
53
|
+
orientation={orientation}
|
|
54
|
+
className={cn(
|
|
55
|
+
'absolute z-[1] flex touch-none rounded-full bg-muted opacity-0 transition-opacity duration-150 select-none group-hover/scrollarea:opacity-100 data-[hovering]:opacity-100 data-[scrolling]:opacity-100',
|
|
56
|
+
orientation === 'vertical'
|
|
57
|
+
? 'inset-y-0 right-0 w-1.5 flex-col p-px'
|
|
58
|
+
: 'right-0 bottom-0 left-0 h-1.5 flex-row p-px',
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
<ScrollAreaPrimitive.Thumb
|
|
64
|
+
data-slot="scroll-area-thumb"
|
|
65
|
+
className="relative shrink-0 rounded-full bg-input transition-colors hover:bg-muted-foreground"
|
|
66
|
+
/>
|
|
67
|
+
</ScrollAreaPrimitive.Scrollbar>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { ScrollArea, type ScrollAreaProps, ScrollBar };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
|
|
4
|
+
import { XIcon } from 'lucide-react';
|
|
5
|
+
import type * as React from 'react';
|
|
6
|
+
import { Button } from '@/components/ui/button';
|
|
7
|
+
import { cn } from '@/lib/utils';
|
|
8
|
+
|
|
9
|
+
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
10
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
|
|
14
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
|
|
18
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
|
|
22
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
|
|
26
|
+
return (
|
|
27
|
+
<SheetPrimitive.Backdrop
|
|
28
|
+
data-slot="sheet-overlay"
|
|
29
|
+
className={cn(
|
|
30
|
+
'fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs',
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function SheetContent({
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
side = 'right',
|
|
42
|
+
showCloseButton = true,
|
|
43
|
+
...props
|
|
44
|
+
}: SheetPrimitive.Popup.Props & {
|
|
45
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
46
|
+
showCloseButton?: boolean;
|
|
47
|
+
}) {
|
|
48
|
+
return (
|
|
49
|
+
<SheetPortal>
|
|
50
|
+
<SheetOverlay />
|
|
51
|
+
<SheetPrimitive.Popup
|
|
52
|
+
data-slot="sheet-content"
|
|
53
|
+
data-side={side}
|
|
54
|
+
className={cn(
|
|
55
|
+
'fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm',
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
{showCloseButton && (
|
|
62
|
+
<SheetPrimitive.Close
|
|
63
|
+
data-slot="sheet-close"
|
|
64
|
+
render={<Button variant="ghost" className="absolute top-3 right-3" size="icon-sm" />}
|
|
65
|
+
>
|
|
66
|
+
<XIcon />
|
|
67
|
+
<span className="sr-only">Close</span>
|
|
68
|
+
</SheetPrimitive.Close>
|
|
69
|
+
)}
|
|
70
|
+
</SheetPrimitive.Popup>
|
|
71
|
+
</SheetPortal>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function SheetHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
data-slot="sheet-header"
|
|
79
|
+
className={cn('flex flex-col gap-0.5 p-4', className)}
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function SheetFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
data-slot="sheet-footer"
|
|
89
|
+
className={cn('mt-auto flex flex-col gap-2 p-4', className)}
|
|
90
|
+
{...props}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
96
|
+
return (
|
|
97
|
+
<SheetPrimitive.Title
|
|
98
|
+
data-slot="sheet-title"
|
|
99
|
+
className={cn('text-base font-medium text-foreground', className)}
|
|
100
|
+
{...props}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props) {
|
|
106
|
+
return (
|
|
107
|
+
<SheetPrimitive.Description
|
|
108
|
+
data-slot="sheet-description"
|
|
109
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
110
|
+
{...props}
|
|
111
|
+
/>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
Sheet,
|
|
117
|
+
SheetClose,
|
|
118
|
+
SheetContent,
|
|
119
|
+
SheetDescription,
|
|
120
|
+
SheetFooter,
|
|
121
|
+
SheetHeader,
|
|
122
|
+
SheetTitle,
|
|
123
|
+
SheetTrigger,
|
|
124
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from '@base-ui/react/tabs';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
function Tabs({ className, orientation = 'horizontal', ...props }: TabsPrimitive.Root.Props) {
|
|
7
|
+
return (
|
|
8
|
+
<TabsPrimitive.Root
|
|
9
|
+
data-slot="tabs"
|
|
10
|
+
data-orientation={orientation}
|
|
11
|
+
className={cn('group/tabs flex gap-2 data-[orientation=horizontal]:flex-col', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const tabsListVariants = cva(
|
|
18
|
+
'group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-8 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none',
|
|
19
|
+
{
|
|
20
|
+
variants: {
|
|
21
|
+
variant: {
|
|
22
|
+
default: 'bg-muted',
|
|
23
|
+
line: 'gap-1 bg-transparent',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: 'default',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
function TabsList({
|
|
33
|
+
className,
|
|
34
|
+
variant = 'default',
|
|
35
|
+
...props
|
|
36
|
+
}: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>) {
|
|
37
|
+
return (
|
|
38
|
+
<TabsPrimitive.List
|
|
39
|
+
data-slot="tabs-list"
|
|
40
|
+
data-variant={variant}
|
|
41
|
+
className={cn(tabsListVariants({ variant }), className)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
|
|
48
|
+
return (
|
|
49
|
+
<TabsPrimitive.Tab
|
|
50
|
+
data-slot="tabs-trigger"
|
|
51
|
+
className={cn(
|
|
52
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
53
|
+
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',
|
|
54
|
+
'data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground',
|
|
55
|
+
'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-0 group-data-[orientation=horizontal]/tabs:after:h-px group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:right-0 group-data-[orientation=vertical]/tabs:after:w-px group-data-[variant=line]/tabs-list:data-active:after:opacity-100',
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
|
|
64
|
+
return (
|
|
65
|
+
<TabsPrimitive.Panel
|
|
66
|
+
data-slot="tabs-content"
|
|
67
|
+
className={cn('flex-1 text-sm outline-none', className)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger, tabsListVariants };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
|
|
5
|
+
function TooltipProvider({ delay = 0, ...props }: TooltipPrimitive.Provider.Props) {
|
|
6
|
+
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delay={delay} {...props} />;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
|
|
10
|
+
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
|
|
14
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function TooltipContent({
|
|
18
|
+
className,
|
|
19
|
+
side = 'top',
|
|
20
|
+
sideOffset = 4,
|
|
21
|
+
align = 'center',
|
|
22
|
+
alignOffset = 0,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}: TooltipPrimitive.Popup.Props &
|
|
26
|
+
Pick<TooltipPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
27
|
+
return (
|
|
28
|
+
<TooltipPrimitive.Portal>
|
|
29
|
+
<TooltipPrimitive.Positioner
|
|
30
|
+
align={align}
|
|
31
|
+
alignOffset={alignOffset}
|
|
32
|
+
side={side}
|
|
33
|
+
sideOffset={sideOffset}
|
|
34
|
+
className="isolate z-50"
|
|
35
|
+
>
|
|
36
|
+
<TooltipPrimitive.Popup
|
|
37
|
+
data-slot="tooltip-content"
|
|
38
|
+
className={cn(
|
|
39
|
+
'z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-sm text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />
|
|
46
|
+
</TooltipPrimitive.Popup>
|
|
47
|
+
</TooltipPrimitive.Positioner>
|
|
48
|
+
</TooltipPrimitive.Portal>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { hydrateRoot } from 'react-dom/client';
|
|
2
|
+
import { BrowserRouter } from 'react-router';
|
|
3
|
+
import { App } from '@/App';
|
|
4
|
+
import { BASE_URL } from '@/lib/paths';
|
|
5
|
+
|
|
6
|
+
export function mount(element: HTMLElement | null = document.getElementById('root')) {
|
|
7
|
+
if (!element) {
|
|
8
|
+
throw new Error('Shiso could not find the root element.');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return hydrateRoot(
|
|
12
|
+
element,
|
|
13
|
+
<BrowserRouter basename={BASE_URL || undefined}>
|
|
14
|
+
<App />
|
|
15
|
+
</BrowserRouter>,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { renderToString } from 'react-dom/server';
|
|
2
|
+
import { StaticRouter } from 'react-router';
|
|
3
|
+
import { App } from '@/App';
|
|
4
|
+
import { getDocModule, getLastModified } from '@/lib/content';
|
|
5
|
+
import { buildHead, renderHeadToString } from '@/lib/head';
|
|
6
|
+
import { BASE_URL, toAbsoluteUrl } from '@/lib/paths';
|
|
7
|
+
import { docsConfig, getRedirects, getSeo, siteName } from '@/lib/site-config';
|
|
8
|
+
|
|
9
|
+
export interface RenderResult {
|
|
10
|
+
html: string;
|
|
11
|
+
head: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface SitemapEntry {
|
|
15
|
+
url: string;
|
|
16
|
+
lastmod?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Base-relative routes. The prerenderer prepends the deploy base itself. */
|
|
20
|
+
export function getRoutes(): string[] {
|
|
21
|
+
return docsConfig.pages.map(page => page.url);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Redirect rules with exact-match sources, for static redirect pages. */
|
|
25
|
+
export { getRedirects };
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Source file for every routed page, so the prerenderer can publish raw
|
|
29
|
+
* markdown next to each HTML page (used by the contextual menu's copy/view
|
|
30
|
+
* options and by AI tools). `filePath` is a module key like
|
|
31
|
+
* "/content/docs/index.mdx", resolved against the project root.
|
|
32
|
+
*/
|
|
33
|
+
export function getMarkdownPages(): { route: string; filePath: string }[] {
|
|
34
|
+
return docsConfig.pages.map(page => ({ route: page.url, filePath: page.filePath }));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Absolute URLs for the sitemap, honoring `seo.indexing` and per-page
|
|
39
|
+
* noindex. Empty when `$shiso.siteUrl` is not configured, since a sitemap
|
|
40
|
+
* of relative URLs is invalid.
|
|
41
|
+
*/
|
|
42
|
+
export function getSitemapEntries(): SitemapEntry[] {
|
|
43
|
+
const { indexing } = getSeo();
|
|
44
|
+
const entries: SitemapEntry[] = [];
|
|
45
|
+
|
|
46
|
+
for (const page of docsConfig.pages) {
|
|
47
|
+
if (page.hidden && indexing !== 'all') {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (getDocModule(page.filePath)?.frontmatter?.noindex === true) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const url = toAbsoluteUrl(page.url);
|
|
56
|
+
|
|
57
|
+
if (url) {
|
|
58
|
+
entries.push({ url, lastmod: getLastModified(page.filePath) });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return entries;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function render(url: string): RenderResult {
|
|
66
|
+
// basename must match the client's BrowserRouter, or every <Link> in the
|
|
67
|
+
// prerendered HTML would omit the deploy base and mismatch on hydration.
|
|
68
|
+
const html = renderToString(
|
|
69
|
+
<StaticRouter basename={BASE_URL || undefined} location={`${BASE_URL}${url}`}>
|
|
70
|
+
<App />
|
|
71
|
+
</StaticRouter>,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return { html, head: renderHeadToString(buildHead(url)) };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { siteName };
|