menhir 0.1.3 → 0.1.5
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/LICENSE +6 -0
- package/README.md +9 -2
- package/dist/context-menu/index.js +2 -0
- package/dist/context-menu/index.parts.js +13 -0
- package/dist/context-menu/popup/ContextMenuPopup.js +30 -0
- package/dist/context-menu/root/ContextMenuContext.js +11 -0
- package/dist/context-menu/root/ContextMenuRoot.js +23 -0
- package/dist/context-menu/trigger/ContextMenuTrigger.js +47 -0
- package/dist/core/createControllableSignal.js +11 -2
- package/dist/core/listValue.js +2 -7
- package/dist/core/mergeElementProps.js +7 -1
- package/dist/floating/dismissal/escape.js +2 -1
- package/dist/floating/list-navigation/activeDescendant.js +29 -0
- package/dist/floating/list-navigation/listNavigation.js +108 -0
- package/dist/floating/list-navigation/roving.js +27 -0
- package/dist/floating/typeahead/match.js +24 -0
- package/dist/floating/typeahead/typeahead.js +56 -0
- package/dist/menu/checkbox-item/MenuCheckboxItem.js +28 -0
- package/dist/menu/group/MenuGroup.js +40 -0
- package/dist/menu/group/MenuGroupContext.js +10 -0
- package/dist/menu/group-label/MenuGroupLabel.js +27 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.parts.js +13 -0
- package/dist/menu/item/MenuItem.js +30 -0
- package/dist/menu/item/menuItemProps.js +77 -0
- package/dist/menu/item/renderCheckedItem.js +52 -0
- package/dist/menu/item-indicator/MenuItemIndicator.js +23 -0
- package/dist/menu/item-indicator/MenuItemIndicatorContext.js +10 -0
- package/dist/menu/popup/MenuPopup.js +123 -0
- package/dist/menu/radio-group/MenuRadioGroup.js +39 -0
- package/dist/menu/radio-item/MenuRadioItem.js +21 -0
- package/dist/menu/root/MenuContext.js +114 -0
- package/dist/menu/root/MenuRoot.js +19 -0
- package/dist/menu/submenu/MenuSubmenu.js +18 -0
- package/dist/menu/submenu-trigger/MenuSubmenuTrigger.js +114 -0
- package/dist/menu/trigger/MenuTrigger.js +67 -0
- package/dist/menubar/index.js +2 -0
- package/dist/menubar/index.parts.js +14 -0
- package/dist/menubar/menu/MenubarMenu.js +30 -0
- package/dist/menubar/root/MenubarContext.js +10 -0
- package/dist/menubar/root/MenubarRoot.js +68 -0
- package/dist/menubar/trigger/MenubarTrigger.js +73 -0
- package/dist/navigation-menu/index.js +2 -0
- package/dist/navigation-menu/index.parts.js +6 -0
- package/dist/navigation-menu/item/NavigationMenuItem.js +83 -0
- package/dist/navigation-menu/item/NavigationMenuItemContext.js +10 -0
- package/dist/navigation-menu/link/NavigationMenuLink.js +26 -0
- package/dist/navigation-menu/panel/NavigationMenuPanel.js +31 -0
- package/dist/navigation-menu/root/NavigationMenuRoot.js +100 -0
- package/dist/navigation-menu/root/NavigationMenuRootContext.js +10 -0
- package/dist/navigation-menu/trigger/NavigationMenuTrigger.js +36 -0
- package/dist/source/context-menu/index.d.ts +1 -0
- package/dist/source/context-menu/index.js +1 -0
- package/dist/source/context-menu/index.parts.d.ts +12 -0
- package/dist/source/context-menu/index.parts.js +13 -0
- package/dist/source/context-menu/popup/ContextMenuPopup.d.ts +12 -0
- package/dist/source/context-menu/popup/ContextMenuPopup.jsx +36 -0
- package/dist/source/context-menu/root/ContextMenuContext.d.ts +18 -0
- package/dist/source/context-menu/root/ContextMenuContext.js +12 -0
- package/dist/source/context-menu/root/ContextMenuRoot.d.ts +12 -0
- package/dist/source/context-menu/root/ContextMenuRoot.jsx +16 -0
- package/dist/source/context-menu/trigger/ContextMenuTrigger.d.ts +15 -0
- package/dist/source/context-menu/trigger/ContextMenuTrigger.jsx +46 -0
- package/dist/source/core/createControllableSignal.d.ts +9 -1
- package/dist/source/core/createControllableSignal.js +7 -2
- package/dist/source/core/listValue.js +4 -10
- package/dist/source/core/mergeElementProps.d.ts +8 -0
- package/dist/source/core/mergeElementProps.js +7 -1
- package/dist/source/floating/dismissal/escape.d.ts +2 -1
- package/dist/source/floating/dismissal/escape.js +2 -1
- package/dist/source/floating/dismissal/reason.d.ts +11 -2
- package/dist/source/floating/list-navigation/activeDescendant.d.ts +30 -0
- package/dist/source/floating/list-navigation/activeDescendant.js +24 -0
- package/dist/source/floating/list-navigation/listNavigation.d.ts +68 -0
- package/dist/source/floating/list-navigation/listNavigation.js +148 -0
- package/dist/source/floating/list-navigation/roving.d.ts +23 -0
- package/dist/source/floating/list-navigation/roving.js +25 -0
- package/dist/source/floating/typeahead/match.d.ts +14 -0
- package/dist/source/floating/typeahead/match.js +32 -0
- package/dist/source/floating/typeahead/typeahead.d.ts +41 -0
- package/dist/source/floating/typeahead/typeahead.js +81 -0
- package/dist/source/menu/checkbox-item/MenuCheckboxItem.d.ts +20 -0
- package/dist/source/menu/checkbox-item/MenuCheckboxItem.jsx +26 -0
- package/dist/source/menu/group/MenuGroup.d.ts +16 -0
- package/dist/source/menu/group/MenuGroup.jsx +31 -0
- package/dist/source/menu/group/MenuGroupContext.d.ts +10 -0
- package/dist/source/menu/group/MenuGroupContext.js +12 -0
- package/dist/source/menu/group-label/MenuGroupLabel.d.ts +11 -0
- package/dist/source/menu/group-label/MenuGroupLabel.jsx +25 -0
- package/dist/source/menu/index.d.ts +1 -0
- package/dist/source/menu/index.js +1 -0
- package/dist/source/menu/index.parts.d.ts +12 -0
- package/dist/source/menu/index.parts.js +12 -0
- package/dist/source/menu/item/MenuItem.d.ts +11 -0
- package/dist/source/menu/item/MenuItem.jsx +21 -0
- package/dist/source/menu/item/menuItemProps.d.ts +35 -0
- package/dist/source/menu/item/menuItemProps.js +78 -0
- package/dist/source/menu/item/renderCheckedItem.d.ts +22 -0
- package/dist/source/menu/item/renderCheckedItem.jsx +41 -0
- package/dist/source/menu/item-indicator/MenuItemIndicator.d.ts +12 -0
- package/dist/source/menu/item-indicator/MenuItemIndicator.jsx +17 -0
- package/dist/source/menu/item-indicator/MenuItemIndicatorContext.d.ts +11 -0
- package/dist/source/menu/item-indicator/MenuItemIndicatorContext.js +12 -0
- package/dist/source/menu/popup/MenuPopup.d.ts +41 -0
- package/dist/source/menu/popup/MenuPopup.jsx +156 -0
- package/dist/source/menu/radio-group/MenuRadioGroup.d.ts +27 -0
- package/dist/source/menu/radio-group/MenuRadioGroup.jsx +36 -0
- package/dist/source/menu/radio-item/MenuRadioItem.d.ts +14 -0
- package/dist/source/menu/radio-item/MenuRadioItem.jsx +19 -0
- package/dist/source/menu/root/MenuContext.d.ts +114 -0
- package/dist/source/menu/root/MenuContext.js +123 -0
- package/dist/source/menu/root/MenuRoot.d.ts +11 -0
- package/dist/source/menu/root/MenuRoot.jsx +9 -0
- package/dist/source/menu/submenu/MenuSubmenu.d.ts +22 -0
- package/dist/source/menu/submenu/MenuSubmenu.jsx +10 -0
- package/dist/source/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +14 -0
- package/dist/source/menu/submenu-trigger/MenuSubmenuTrigger.jsx +121 -0
- package/dist/source/menu/trigger/MenuTrigger.d.ts +13 -0
- package/dist/source/menu/trigger/MenuTrigger.jsx +73 -0
- package/dist/source/menubar/index.d.ts +1 -0
- package/dist/source/menubar/index.js +1 -0
- package/dist/source/menubar/index.parts.d.ts +13 -0
- package/dist/source/menubar/index.parts.js +14 -0
- package/dist/source/menubar/menu/MenubarMenu.d.ts +11 -0
- package/dist/source/menubar/menu/MenubarMenu.jsx +24 -0
- package/dist/source/menubar/root/MenubarContext.d.ts +30 -0
- package/dist/source/menubar/root/MenubarContext.js +12 -0
- package/dist/source/menubar/root/MenubarRoot.d.ts +11 -0
- package/dist/source/menubar/root/MenubarRoot.jsx +77 -0
- package/dist/source/menubar/trigger/MenubarTrigger.d.ts +11 -0
- package/dist/source/menubar/trigger/MenubarTrigger.jsx +78 -0
- package/dist/source/navigation-menu/index.d.ts +1 -0
- package/dist/source/navigation-menu/index.js +1 -0
- package/dist/source/navigation-menu/index.parts.d.ts +5 -0
- package/dist/source/navigation-menu/index.parts.js +5 -0
- package/dist/source/navigation-menu/item/NavigationMenuItem.d.ts +16 -0
- package/dist/source/navigation-menu/item/NavigationMenuItem.jsx +85 -0
- package/dist/source/navigation-menu/item/NavigationMenuItemContext.d.ts +27 -0
- package/dist/source/navigation-menu/item/NavigationMenuItemContext.js +12 -0
- package/dist/source/navigation-menu/link/NavigationMenuLink.d.ts +12 -0
- package/dist/source/navigation-menu/link/NavigationMenuLink.jsx +18 -0
- package/dist/source/navigation-menu/panel/NavigationMenuPanel.d.ts +11 -0
- package/dist/source/navigation-menu/panel/NavigationMenuPanel.jsx +26 -0
- package/dist/source/navigation-menu/root/NavigationMenuRoot.d.ts +37 -0
- package/dist/source/navigation-menu/root/NavigationMenuRoot.jsx +103 -0
- package/dist/source/navigation-menu/root/NavigationMenuRootContext.d.ts +33 -0
- package/dist/source/navigation-menu/root/NavigationMenuRootContext.js +13 -0
- package/dist/source/navigation-menu/trigger/NavigationMenuTrigger.d.ts +12 -0
- package/dist/source/navigation-menu/trigger/NavigationMenuTrigger.jsx +32 -0
- package/package.json +23 -2
- package/skills/menhir-styling/SKILL.md +35 -0
- package/skills/menhir-styling/looks/shadcn/LICENSE +24 -0
- package/skills/menhir-styling/looks/shadcn/LOOK.md +106 -0
- package/skills/menhir-styling/looks/shadcn/dialog.md +63 -0
- package/skills/menhir-styling/looks/shadcn/popover.md +39 -0
- package/skills/menhir-styling/looks/shadcn/switch.md +26 -0
- package/skills/menhir-styling/looks/shadcn/tabs.md +62 -0
- package/skills/menhir-styling/looks/shadcn/tokens.css +80 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!-- Generated by website/styling-skill.ts from website/src/examples/dialog/shadcn/. Edit those files, then run `pnpm --filter website skill`. -->
|
|
2
|
+
|
|
3
|
+
# Dialog in the shadcn look
|
|
4
|
+
|
|
5
|
+
Its parts, props and data attributes: [Dialog](https://menhir-ui.com/docs/components/dialog.md).
|
|
6
|
+
|
|
7
|
+
## DialogExample.tsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Dialog } from "menhir/dialog";
|
|
11
|
+
|
|
12
|
+
export default function DialogExample() {
|
|
13
|
+
return (
|
|
14
|
+
<Dialog.Root>
|
|
15
|
+
<Dialog.Trigger class="inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:bg-input/50 motion-reduce:transition-none">
|
|
16
|
+
Edit profile
|
|
17
|
+
</Dialog.Trigger>
|
|
18
|
+
<Dialog.Popup class="m-auto w-full max-w-[calc(100%-2rem)] rounded-lg border bg-background p-6 text-foreground shadow-lg transition-[opacity,scale] duration-200 outline-none backdrop:bg-black/50 backdrop:transition-opacity backdrop:duration-200 data-closed:scale-95 data-closed:opacity-0 data-closed:backdrop:opacity-0 motion-reduce:transition-none sm:max-w-lg starting:data-open:scale-95 starting:data-open:opacity-0 starting:data-open:backdrop:opacity-0">
|
|
19
|
+
<div class="grid gap-4">
|
|
20
|
+
<div class="flex flex-col gap-2 text-center sm:text-left">
|
|
21
|
+
<Dialog.Title class="m-0 text-lg leading-none font-semibold">
|
|
22
|
+
Edit profile
|
|
23
|
+
</Dialog.Title>
|
|
24
|
+
<Dialog.Description class="m-0 text-sm text-muted-foreground">
|
|
25
|
+
Your name is shown on your posts.
|
|
26
|
+
</Dialog.Description>
|
|
27
|
+
</div>
|
|
28
|
+
<label class="grid gap-3 text-sm leading-none font-medium">
|
|
29
|
+
Name
|
|
30
|
+
<input
|
|
31
|
+
name="name"
|
|
32
|
+
value="Ada Lovelace"
|
|
33
|
+
class="h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base font-normal shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 md:text-sm dark:bg-input/30 motion-reduce:transition-none"
|
|
34
|
+
/>
|
|
35
|
+
</label>
|
|
36
|
+
<div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
|
|
37
|
+
<Dialog.Close class="inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 text-sm font-medium whitespace-nowrap text-primary-foreground transition-all outline-none hover:bg-primary/90 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 motion-reduce:transition-none">
|
|
38
|
+
Done
|
|
39
|
+
</Dialog.Close>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
{/* Last, so that opening focuses the field. A modal <dialog> is
|
|
43
|
+
position: fixed, which positions the button against it. */}
|
|
44
|
+
<Dialog.Close class="absolute top-4 right-4 rounded-xs opacity-70 transition-opacity outline-none hover:opacity-100 focus-visible:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 motion-reduce:transition-none">
|
|
45
|
+
<svg
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
viewBox="0 0 24 24"
|
|
48
|
+
fill="none"
|
|
49
|
+
stroke="currentColor"
|
|
50
|
+
stroke-width="2"
|
|
51
|
+
stroke-linecap="round"
|
|
52
|
+
stroke-linejoin="round"
|
|
53
|
+
class="block size-4"
|
|
54
|
+
>
|
|
55
|
+
<path d="M18 6 6 18M6 6l12 12" />
|
|
56
|
+
</svg>
|
|
57
|
+
<span class="sr-only">Close</span>
|
|
58
|
+
</Dialog.Close>
|
|
59
|
+
</Dialog.Popup>
|
|
60
|
+
</Dialog.Root>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!-- Generated by website/styling-skill.ts from website/src/examples/popover/shadcn/. Edit those files, then run `pnpm --filter website skill`. -->
|
|
2
|
+
|
|
3
|
+
# Popover in the shadcn look
|
|
4
|
+
|
|
5
|
+
Its parts, props and data attributes: [Popover](https://menhir-ui.com/docs/components/popover.md).
|
|
6
|
+
|
|
7
|
+
## PopoverExample.tsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Popover } from "menhir/popover";
|
|
11
|
+
|
|
12
|
+
export default function PopoverExample() {
|
|
13
|
+
return (
|
|
14
|
+
<Popover.Root>
|
|
15
|
+
<Popover.Trigger class="inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:bg-input/50 motion-reduce:transition-none">
|
|
16
|
+
Notifications
|
|
17
|
+
</Popover.Trigger>
|
|
18
|
+
<Popover.Popup
|
|
19
|
+
sideOffset={4}
|
|
20
|
+
class="w-72 origin-(--transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md transition-[opacity,scale] duration-150 outline-hidden data-closed:scale-95 data-closed:opacity-0 motion-reduce:transition-none starting:data-open:scale-95 starting:data-open:opacity-0"
|
|
21
|
+
>
|
|
22
|
+
<div class="flex flex-col gap-1 text-sm">
|
|
23
|
+
<Popover.Title class="m-0 text-sm font-medium">
|
|
24
|
+
Notifications
|
|
25
|
+
</Popover.Title>
|
|
26
|
+
<Popover.Description class="m-0 text-muted-foreground">
|
|
27
|
+
You are all caught up.
|
|
28
|
+
</Popover.Description>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="mt-4 flex justify-end">
|
|
31
|
+
<Popover.Close class="inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border bg-background px-3 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 dark:border-input dark:bg-input/30 dark:hover:bg-input/50 motion-reduce:transition-none">
|
|
32
|
+
Close
|
|
33
|
+
</Popover.Close>
|
|
34
|
+
</div>
|
|
35
|
+
</Popover.Popup>
|
|
36
|
+
</Popover.Root>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!-- Generated by website/styling-skill.ts from website/src/examples/switch/shadcn/. Edit those files, then run `pnpm --filter website skill`. -->
|
|
2
|
+
|
|
3
|
+
# Switch in the shadcn look
|
|
4
|
+
|
|
5
|
+
Its parts, props and data attributes: [Switch](https://menhir-ui.com/docs/components/switch.md).
|
|
6
|
+
|
|
7
|
+
## SwitchExample.tsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Switch } from "menhir/switch";
|
|
11
|
+
|
|
12
|
+
export default function SwitchExample() {
|
|
13
|
+
return (
|
|
14
|
+
<label class="flex items-center gap-2 text-sm leading-none font-medium select-none">
|
|
15
|
+
<Switch.Root
|
|
16
|
+
name="wifi"
|
|
17
|
+
defaultChecked
|
|
18
|
+
class="inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-checked:bg-primary data-disabled:pointer-events-none data-disabled:opacity-50 data-unchecked:bg-input motion-reduce:transition-none dark:data-unchecked:bg-input/80"
|
|
19
|
+
>
|
|
20
|
+
<Switch.Thumb class="pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-checked:translate-x-[calc(100%-2px)] data-unchecked:translate-x-0 motion-reduce:transition-none dark:data-checked:bg-primary-foreground dark:data-unchecked:bg-foreground" />
|
|
21
|
+
</Switch.Root>
|
|
22
|
+
Wi-Fi
|
|
23
|
+
</label>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!-- Generated by website/styling-skill.ts from website/src/examples/tabs/shadcn/. Edit those files, then run `pnpm --filter website skill`. -->
|
|
2
|
+
|
|
3
|
+
# Tabs in the shadcn look
|
|
4
|
+
|
|
5
|
+
Its parts, props and data attributes: [Tabs](https://menhir-ui.com/docs/components/tabs.md).
|
|
6
|
+
|
|
7
|
+
## TabsExample.tsx
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Tabs } from "menhir/tabs";
|
|
11
|
+
import { For } from "solid-js";
|
|
12
|
+
|
|
13
|
+
const sections = [
|
|
14
|
+
{
|
|
15
|
+
value: "account",
|
|
16
|
+
name: "Account",
|
|
17
|
+
content: "Your name, email address and language.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "billing",
|
|
21
|
+
name: "Billing",
|
|
22
|
+
content: "Your plan, payment method and invoices.",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "security",
|
|
26
|
+
name: "Security",
|
|
27
|
+
content: "Your password, passkeys and signed-in devices.",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export default function TabsExample() {
|
|
32
|
+
return (
|
|
33
|
+
<Tabs.Root class="flex w-80 flex-col gap-2">
|
|
34
|
+
<Tabs.List
|
|
35
|
+
aria-label="Settings"
|
|
36
|
+
class="inline-flex h-9 w-fit items-center justify-center rounded-lg bg-muted p-[3px] text-muted-foreground"
|
|
37
|
+
>
|
|
38
|
+
<For each={sections}>
|
|
39
|
+
{(section) => (
|
|
40
|
+
<Tabs.Tab
|
|
41
|
+
value={section.value}
|
|
42
|
+
class="inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 data-disabled:pointer-events-none data-disabled:opacity-50 data-selected:bg-background data-selected:text-foreground data-selected:shadow-sm motion-reduce:transition-none dark:text-muted-foreground dark:hover:text-foreground dark:data-selected:border-input dark:data-selected:bg-input/30 dark:data-selected:text-foreground"
|
|
43
|
+
>
|
|
44
|
+
{section.name}
|
|
45
|
+
</Tabs.Tab>
|
|
46
|
+
)}
|
|
47
|
+
</For>
|
|
48
|
+
</Tabs.List>
|
|
49
|
+
<For each={sections}>
|
|
50
|
+
{(section) => (
|
|
51
|
+
<Tabs.Panel
|
|
52
|
+
value={section.value}
|
|
53
|
+
class="rounded-xl border bg-card p-6 text-sm text-card-foreground shadow-sm outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
54
|
+
>
|
|
55
|
+
{section.content}
|
|
56
|
+
</Tabs.Panel>
|
|
57
|
+
)}
|
|
58
|
+
</For>
|
|
59
|
+
</Tabs.Root>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* Generated by website/styling-skill.ts from website/src/looks/shadcn/tokens.css. Edit that file, then run `pnpm --filter website skill`. */
|
|
2
|
+
|
|
3
|
+
/* The shadcn look's tokens: the default theme of shadcn/ui (neutral), from
|
|
4
|
+
https://ui.shadcn.com/docs/theming. Import this file after
|
|
5
|
+
`@import "tailwindcss";`, and put data-look="shadcn" on <html>, or on the
|
|
6
|
+
element whose content takes the look.
|
|
7
|
+
|
|
8
|
+
Two changes from shadcn/ui's file. The tokens are set on
|
|
9
|
+
[data-look="shadcn"] instead of :root, so that a page can show the look in
|
|
10
|
+
one part only, as the Menhir site does. Each colour gives its light and
|
|
11
|
+
its dark value through light-dark(), so the look follows the CSS
|
|
12
|
+
color-scheme instead of a .dark class. The chart and sidebar tokens are
|
|
13
|
+
left out until a component needs them. */
|
|
14
|
+
|
|
15
|
+
@theme inline {
|
|
16
|
+
--color-background: var(--background);
|
|
17
|
+
--color-foreground: var(--foreground);
|
|
18
|
+
--color-card: var(--card);
|
|
19
|
+
--color-card-foreground: var(--card-foreground);
|
|
20
|
+
--color-popover: var(--popover);
|
|
21
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
22
|
+
--color-primary: var(--primary);
|
|
23
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
24
|
+
--color-secondary: var(--secondary);
|
|
25
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
26
|
+
--color-muted: var(--muted);
|
|
27
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
28
|
+
--color-accent: var(--accent);
|
|
29
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
30
|
+
--color-destructive: var(--destructive);
|
|
31
|
+
--color-border: var(--border);
|
|
32
|
+
--color-input: var(--input);
|
|
33
|
+
--color-ring: var(--ring);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[data-look="shadcn"] {
|
|
37
|
+
/* Tailwind's radius scale, from one radius: rounded-md is 0.5rem. */
|
|
38
|
+
--radius: 0.625rem;
|
|
39
|
+
--radius-sm: calc(var(--radius) * 0.6);
|
|
40
|
+
--radius-md: calc(var(--radius) * 0.8);
|
|
41
|
+
--radius-lg: var(--radius);
|
|
42
|
+
--radius-xl: calc(var(--radius) * 1.4);
|
|
43
|
+
--radius-2xl: calc(var(--radius) * 1.8);
|
|
44
|
+
|
|
45
|
+
/* light-dark(light value, dark value) */
|
|
46
|
+
--background: light-dark(oklch(1 0 0), oklch(0.145 0 0));
|
|
47
|
+
--foreground: light-dark(oklch(0.145 0 0), oklch(0.985 0 0));
|
|
48
|
+
--card: light-dark(oklch(1 0 0), oklch(0.205 0 0));
|
|
49
|
+
--card-foreground: light-dark(oklch(0.145 0 0), oklch(0.985 0 0));
|
|
50
|
+
--popover: light-dark(oklch(1 0 0), oklch(0.205 0 0));
|
|
51
|
+
--popover-foreground: light-dark(oklch(0.145 0 0), oklch(0.985 0 0));
|
|
52
|
+
--primary: light-dark(oklch(0.205 0 0), oklch(0.922 0 0));
|
|
53
|
+
--primary-foreground: light-dark(oklch(0.985 0 0), oklch(0.205 0 0));
|
|
54
|
+
--secondary: light-dark(oklch(0.97 0 0), oklch(0.269 0 0));
|
|
55
|
+
--secondary-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
56
|
+
--muted: light-dark(oklch(0.97 0 0), oklch(0.269 0 0));
|
|
57
|
+
--muted-foreground: light-dark(oklch(0.556 0 0), oklch(0.708 0 0));
|
|
58
|
+
--accent: light-dark(oklch(0.97 0 0), oklch(0.269 0 0));
|
|
59
|
+
--accent-foreground: light-dark(oklch(0.205 0 0), oklch(0.985 0 0));
|
|
60
|
+
--destructive: light-dark(
|
|
61
|
+
oklch(0.577 0.245 27.325),
|
|
62
|
+
oklch(0.704 0.191 22.216)
|
|
63
|
+
);
|
|
64
|
+
--border: light-dark(oklch(0.922 0 0), oklch(1 0 0 / 10%));
|
|
65
|
+
--input: light-dark(oklch(0.922 0 0), oklch(1 0 0 / 15%));
|
|
66
|
+
--ring: light-dark(oklch(0.708 0 0), oklch(0.556 0 0));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* shadcn/ui's base styles: the text colour, and every border and outline in
|
|
70
|
+
the look's colours unless a class says otherwise. The page's background is
|
|
71
|
+
the app's: bg-background on <body>. */
|
|
72
|
+
@layer base {
|
|
73
|
+
[data-look="shadcn"] {
|
|
74
|
+
color: var(--foreground);
|
|
75
|
+
}
|
|
76
|
+
[data-look="shadcn"] :where(*, ::before, ::after) {
|
|
77
|
+
border-color: var(--border);
|
|
78
|
+
outline-color: color-mix(in oklab, var(--ring) 50%, transparent);
|
|
79
|
+
}
|
|
80
|
+
}
|