@webstudio-is/sdk-components-react-radix 0.0.0-021f2d4
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 +661 -0
- package/README.md +4 -0
- package/lib/__generated__/accordion.props.js +2631 -0
- package/lib/__generated__/checkbox.props.js +1084 -0
- package/lib/__generated__/collapsible.props.js +1024 -0
- package/lib/__generated__/dialog.props.js +2599 -0
- package/lib/__generated__/label.props.js +519 -0
- package/lib/__generated__/navigation-menu.props.js +3660 -0
- package/lib/__generated__/popover.props.js +564 -0
- package/lib/__generated__/radio-group.props.js +1619 -0
- package/lib/__generated__/select.props.js +3687 -0
- package/lib/__generated__/switch.props.js +1084 -0
- package/lib/__generated__/tabs.props.js +2121 -0
- package/lib/__generated__/tooltip.props.js +575 -0
- package/lib/accordion.js +36 -0
- package/lib/accordion.template.js +95 -0
- package/lib/accordion.ws.js +117 -0
- package/lib/checkbox.js +8 -0
- package/lib/checkbox.template.js +63 -0
- package/lib/checkbox.ws.js +51 -0
- package/lib/collapsible.js +37 -0
- package/lib/collapsible.template.js +16 -0
- package/lib/collapsible.ws.js +59 -0
- package/lib/components.js +62 -0
- package/lib/dialog.js +102 -0
- package/lib/dialog.template.js +119 -0
- package/lib/dialog.ws.js +138 -0
- package/lib/hooks.js +21 -0
- package/lib/label.js +7 -0
- package/lib/label.template.js +23 -0
- package/lib/label.ws.js +19 -0
- package/lib/metas.js +62 -0
- package/lib/navigation-menu.js +59 -0
- package/lib/navigation-menu.template.js +283 -0
- package/lib/navigation-menu.ws.js +124 -0
- package/lib/popover.js +48 -0
- package/lib/popover.template.js +33 -0
- package/lib/popover.ws.js +50 -0
- package/lib/props.js +62 -0
- package/lib/radio-group.js +9 -0
- package/lib/radio-group.template.js +66 -0
- package/lib/radio-group.ws.js +73 -0
- package/lib/select.js +46 -0
- package/lib/select.template.js +121 -0
- package/lib/select.ws.js +155 -0
- package/lib/shared/preset-styles.js +38 -0
- package/lib/shared/proxy.js +5 -0
- package/lib/shared/styles.js +51 -0
- package/lib/shared/theme.js +162 -0
- package/lib/sheet.template.js +129 -0
- package/lib/switch.js +8 -0
- package/lib/switch.template.js +63 -0
- package/lib/switch.ws.js +63 -0
- package/lib/tabs.js +65 -0
- package/lib/tabs.template.js +66 -0
- package/lib/tabs.ws.js +88 -0
- package/lib/templates.js +28 -0
- package/lib/tooltip.js +45 -0
- package/lib/tooltip.template.js +33 -0
- package/lib/tooltip.ws.js +50 -0
- package/lib/types/__generated__/accordion.props.d.ts +6 -0
- package/lib/types/__generated__/checkbox.props.d.ts +3 -0
- package/lib/types/__generated__/collapsible.props.d.ts +4 -0
- package/lib/types/__generated__/dialog.props.d.ts +8 -0
- package/lib/types/__generated__/label.props.d.ts +2 -0
- package/lib/types/__generated__/navigation-menu.props.d.ts +8 -0
- package/lib/types/__generated__/popover.props.d.ts +4 -0
- package/lib/types/__generated__/radio-group.props.d.ts +4 -0
- package/lib/types/__generated__/select.props.d.ts +9 -0
- package/lib/types/__generated__/switch.props.d.ts +3 -0
- package/lib/types/__generated__/tabs.props.d.ts +5 -0
- package/lib/types/__generated__/tooltip.props.d.ts +4 -0
- package/lib/types/accordion.d.ts +11 -0
- package/lib/types/accordion.template.d.ts +10 -0
- package/lib/types/accordion.ws.d.ts +11 -0
- package/lib/types/checkbox.d.ts +9 -0
- package/lib/types/checkbox.template.d.ts +2 -0
- package/lib/types/checkbox.ws.d.ts +5 -0
- package/lib/types/collapsible.d.ts +15 -0
- package/lib/types/collapsible.template.d.ts +2 -0
- package/lib/types/collapsible.ws.d.ts +7 -0
- package/lib/types/components.d.ts +12 -0
- package/lib/types/dialog.d.ts +23 -0
- package/lib/types/dialog.template.d.ts +10 -0
- package/lib/types/dialog.ws.d.ts +15 -0
- package/lib/types/hooks.d.ts +2 -0
- package/lib/types/label.d.ts +2 -0
- package/lib/types/label.template.d.ts +10 -0
- package/lib/types/label.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +12 -0
- package/lib/types/navigation-menu.d.ts +10 -0
- package/lib/types/navigation-menu.template.d.ts +2 -0
- package/lib/types/navigation-menu.ws.d.ts +15 -0
- package/lib/types/popover.d.ts +15 -0
- package/lib/types/popover.template.d.ts +10 -0
- package/lib/types/popover.ws.d.ts +7 -0
- package/lib/types/props-descriptions.d.ts +29 -0
- package/lib/types/props.d.ts +12 -0
- package/lib/types/radio-group.d.ts +5 -0
- package/lib/types/radio-group.template.d.ts +2 -0
- package/lib/types/radio-group.ws.d.ts +7 -0
- package/lib/types/select.d.ts +14 -0
- package/lib/types/select.template.d.ts +2 -0
- package/lib/types/select.ws.d.ts +17 -0
- package/lib/types/shared/preset-styles.d.ts +2 -0
- package/lib/types/shared/proxy.d.ts +15 -0
- package/lib/types/shared/styles.d.ts +2 -0
- package/lib/types/shared/theme.d.ts +212 -0
- package/lib/types/sheet.template.d.ts +10 -0
- package/lib/types/switch.d.ts +4 -0
- package/lib/types/switch.template.d.ts +2 -0
- package/lib/types/switch.ws.d.ts +5 -0
- package/lib/types/tabs.d.ts +13 -0
- package/lib/types/tabs.template.d.ts +2 -0
- package/lib/types/tabs.ws.d.ts +9 -0
- package/lib/types/templates.d.ts +13 -0
- package/lib/types/tooltip.d.ts +15 -0
- package/lib/types/tooltip.template.d.ts +10 -0
- package/lib/types/tooltip.ws.d.ts +7 -0
- package/package.json +85 -0
package/lib/dialog.ws.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { TriggerIcon as t, OverlayIcon as n, ContentIcon as e, HeadingIcon as i, TextIcon as a, ButtonElementIcon as r, DialogIcon as s } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as p } from "@webstudio-is/sdk";
|
|
3
|
+
import { div as o, h2 as l, p as c, button as g } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { propsDialog as D, propsDialogTrigger as m, propsDialogContent as y, propsDialogOverlay as C, propsDialogClose as d, propsDialogTitle as q, propsDialogDescription as $ } from "./__generated__/dialog.props.js";
|
|
5
|
+
import { buttonReset as T } from "./shared/preset-styles.js";
|
|
6
|
+
const O = {
|
|
7
|
+
type: "container",
|
|
8
|
+
icon: t,
|
|
9
|
+
constraints: {
|
|
10
|
+
relation: "ancestor",
|
|
11
|
+
component: { $eq: "Dialog" }
|
|
12
|
+
}
|
|
13
|
+
}, P = {
|
|
14
|
+
type: "container",
|
|
15
|
+
presetStyle: {
|
|
16
|
+
div: o
|
|
17
|
+
},
|
|
18
|
+
icon: n,
|
|
19
|
+
constraints: [
|
|
20
|
+
{
|
|
21
|
+
relation: "ancestor",
|
|
22
|
+
component: { $eq: "Dialog" }
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
relation: "descendant",
|
|
26
|
+
component: { $eq: "DialogContent" }
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}, S = {
|
|
30
|
+
type: "container",
|
|
31
|
+
presetStyle: {
|
|
32
|
+
div: o
|
|
33
|
+
},
|
|
34
|
+
icon: e,
|
|
35
|
+
constraints: [
|
|
36
|
+
{
|
|
37
|
+
relation: "ancestor",
|
|
38
|
+
component: { $eq: "DialogOverlay" }
|
|
39
|
+
},
|
|
40
|
+
// often deleted by users
|
|
41
|
+
// though radix starts throwing warnings in console
|
|
42
|
+
/*
|
|
43
|
+
{
|
|
44
|
+
relation: "descendant",
|
|
45
|
+
component: { $eq: "DialogTitle" },
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
relation: "descendant",
|
|
49
|
+
component: { $eq: "DialogDescription" },
|
|
50
|
+
},
|
|
51
|
+
*/
|
|
52
|
+
{
|
|
53
|
+
relation: "descendant",
|
|
54
|
+
component: { $eq: "DialogClose" }
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}, b = {
|
|
58
|
+
type: "container",
|
|
59
|
+
presetStyle: {
|
|
60
|
+
h2: l
|
|
61
|
+
},
|
|
62
|
+
icon: i,
|
|
63
|
+
constraints: {
|
|
64
|
+
relation: "ancestor",
|
|
65
|
+
component: { $eq: "DialogContent" }
|
|
66
|
+
}
|
|
67
|
+
}, x = {
|
|
68
|
+
type: "container",
|
|
69
|
+
presetStyle: {
|
|
70
|
+
p: c
|
|
71
|
+
},
|
|
72
|
+
icon: a,
|
|
73
|
+
constraints: {
|
|
74
|
+
relation: "ancestor",
|
|
75
|
+
component: { $eq: "DialogContent" }
|
|
76
|
+
}
|
|
77
|
+
}, B = {
|
|
78
|
+
type: "container",
|
|
79
|
+
presetStyle: {
|
|
80
|
+
button: [T, g].flat()
|
|
81
|
+
},
|
|
82
|
+
states: p,
|
|
83
|
+
icon: r,
|
|
84
|
+
label: "Close Button",
|
|
85
|
+
constraints: {
|
|
86
|
+
relation: "ancestor",
|
|
87
|
+
component: { $eq: "DialogContent" }
|
|
88
|
+
}
|
|
89
|
+
}, h = {
|
|
90
|
+
type: "container",
|
|
91
|
+
icon: s,
|
|
92
|
+
constraints: [
|
|
93
|
+
{
|
|
94
|
+
relation: "descendant",
|
|
95
|
+
component: { $eq: "DialogTrigger" }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
relation: "descendant",
|
|
99
|
+
component: { $eq: "DialogOverlay" }
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}, E = {
|
|
103
|
+
props: D,
|
|
104
|
+
initialProps: []
|
|
105
|
+
}, H = {
|
|
106
|
+
props: m
|
|
107
|
+
}, R = {
|
|
108
|
+
props: y,
|
|
109
|
+
initialProps: []
|
|
110
|
+
}, j = {
|
|
111
|
+
props: C,
|
|
112
|
+
initialProps: []
|
|
113
|
+
}, k = {
|
|
114
|
+
props: d,
|
|
115
|
+
initialProps: []
|
|
116
|
+
}, w = {
|
|
117
|
+
props: q,
|
|
118
|
+
initialProps: []
|
|
119
|
+
}, z = {
|
|
120
|
+
props: $,
|
|
121
|
+
initialProps: []
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
h as metaDialog,
|
|
125
|
+
B as metaDialogClose,
|
|
126
|
+
S as metaDialogContent,
|
|
127
|
+
x as metaDialogDescription,
|
|
128
|
+
P as metaDialogOverlay,
|
|
129
|
+
b as metaDialogTitle,
|
|
130
|
+
O as metaDialogTrigger,
|
|
131
|
+
E as propsMetaDialog,
|
|
132
|
+
k as propsMetaDialogClose,
|
|
133
|
+
R as propsMetaDialogContent,
|
|
134
|
+
z as propsMetaDialogDescription,
|
|
135
|
+
j as propsMetaDialogOverlay,
|
|
136
|
+
w as propsMetaDialogTitle,
|
|
137
|
+
H as propsMetaDialogTrigger
|
|
138
|
+
};
|
package/lib/hooks.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { hooksCollapsible as o } from "./collapsible.js";
|
|
2
|
+
import { hooksTabs as r } from "./tabs.js";
|
|
3
|
+
import { hooksDialog as m } from "./dialog.js";
|
|
4
|
+
import { hooksPopover as i } from "./popover.js";
|
|
5
|
+
import { hooksTooltip as t } from "./tooltip.js";
|
|
6
|
+
import { hooksAccordion as p } from "./accordion.js";
|
|
7
|
+
import { hooksNavigationMenu as s } from "./navigation-menu.js";
|
|
8
|
+
import { hooksSelect as h } from "./select.js";
|
|
9
|
+
const g = [
|
|
10
|
+
o,
|
|
11
|
+
r,
|
|
12
|
+
m,
|
|
13
|
+
i,
|
|
14
|
+
t,
|
|
15
|
+
p,
|
|
16
|
+
s,
|
|
17
|
+
h
|
|
18
|
+
];
|
|
19
|
+
export {
|
|
20
|
+
g as hooks
|
|
21
|
+
};
|
package/lib/label.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { css as t, PlaceholderValue as o } from "@webstudio-is/template";
|
|
3
|
+
import { radix as i } from "./shared/proxy.js";
|
|
4
|
+
import { fontSize as r, lineHeight as n, weights as h } from "./shared/theme.js";
|
|
5
|
+
const p = {
|
|
6
|
+
category: "radix",
|
|
7
|
+
description: "An accessible label to describe the purpose of an input. Match the “For” property on the label with the “ID” of the input to connect them.",
|
|
8
|
+
order: 102,
|
|
9
|
+
template: /* @__PURE__ */ e(
|
|
10
|
+
i.Label,
|
|
11
|
+
{
|
|
12
|
+
"ws:style": t`
|
|
13
|
+
font-size: ${r.sm};
|
|
14
|
+
line-height: ${n.none};
|
|
15
|
+
font-weight: ${h.medium};
|
|
16
|
+
`,
|
|
17
|
+
children: new o("Form Label")
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
p as meta
|
|
23
|
+
};
|
package/lib/label.ws.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LabelIcon as t } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as o } from "@webstudio-is/sdk";
|
|
3
|
+
import { label as r } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
+
import { props as e } from "./__generated__/label.props.js";
|
|
5
|
+
const p = {
|
|
6
|
+
label: r
|
|
7
|
+
}, l = {
|
|
8
|
+
type: "container",
|
|
9
|
+
icon: t,
|
|
10
|
+
presetStyle: p,
|
|
11
|
+
states: o
|
|
12
|
+
}, n = {
|
|
13
|
+
props: e,
|
|
14
|
+
initialProps: ["id", "className", "htmlFor"]
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
l as meta,
|
|
18
|
+
n as propsMeta
|
|
19
|
+
};
|
package/lib/metas.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { metaCollapsible as t, metaCollapsibleContent as o, metaCollapsibleTrigger as i } from "./collapsible.ws.js";
|
|
2
|
+
import { metaDialog as n, metaDialogClose as m, metaDialogContent as s, metaDialogDescription as l, metaDialogOverlay as g, metaDialogTitle as c, metaDialogTrigger as p } from "./dialog.ws.js";
|
|
3
|
+
import { metaPopover as C, metaPopoverContent as d, metaPopoverTrigger as u } from "./popover.ws.js";
|
|
4
|
+
import { metaTooltip as b, metaTooltipContent as S, metaTooltipTrigger as x } from "./tooltip.ws.js";
|
|
5
|
+
import { metaTabs as D, metaTabsContent as M, metaTabsList as N, metaTabsTrigger as f } from "./tabs.ws.js";
|
|
6
|
+
import { meta as A } from "./label.ws.js";
|
|
7
|
+
import { metaAccordion as L, metaAccordionContent as k, metaAccordionHeader as G, metaAccordionItem as P, metaAccordionTrigger as R } from "./accordion.ws.js";
|
|
8
|
+
import { metaNavigationMenu as y, metaNavigationMenuContent as H, metaNavigationMenuItem as O, metaNavigationMenuLink as j, metaNavigationMenuList as q, metaNavigationMenuTrigger as z, metaNavigationMenuViewport as B } from "./navigation-menu.ws.js";
|
|
9
|
+
import { metaSelect as F, metaSelectContent as J, metaSelectItem as K, metaSelectItemIndicator as Q, metaSelectItemText as U, metaSelectTrigger as W, metaSelectValue as X, metaSelectViewport as Y } from "./select.ws.js";
|
|
10
|
+
import { metaSwitch as _, metaSwitchThumb as $ } from "./switch.ws.js";
|
|
11
|
+
import { metaCheckbox as ae, metaCheckboxIndicator as te } from "./checkbox.ws.js";
|
|
12
|
+
import { metaRadioGroup as ie, metaRadioGroupIndicator as re, metaRadioGroupItem as ne } from "./radio-group.ws.js";
|
|
13
|
+
export {
|
|
14
|
+
L as Accordion,
|
|
15
|
+
k as AccordionContent,
|
|
16
|
+
G as AccordionHeader,
|
|
17
|
+
P as AccordionItem,
|
|
18
|
+
R as AccordionTrigger,
|
|
19
|
+
ae as Checkbox,
|
|
20
|
+
te as CheckboxIndicator,
|
|
21
|
+
t as Collapsible,
|
|
22
|
+
o as CollapsibleContent,
|
|
23
|
+
i as CollapsibleTrigger,
|
|
24
|
+
n as Dialog,
|
|
25
|
+
m as DialogClose,
|
|
26
|
+
s as DialogContent,
|
|
27
|
+
l as DialogDescription,
|
|
28
|
+
g as DialogOverlay,
|
|
29
|
+
c as DialogTitle,
|
|
30
|
+
p as DialogTrigger,
|
|
31
|
+
A as Label,
|
|
32
|
+
y as NavigationMenu,
|
|
33
|
+
H as NavigationMenuContent,
|
|
34
|
+
O as NavigationMenuItem,
|
|
35
|
+
j as NavigationMenuLink,
|
|
36
|
+
q as NavigationMenuList,
|
|
37
|
+
z as NavigationMenuTrigger,
|
|
38
|
+
B as NavigationMenuViewport,
|
|
39
|
+
C as Popover,
|
|
40
|
+
d as PopoverContent,
|
|
41
|
+
u as PopoverTrigger,
|
|
42
|
+
ie as RadioGroup,
|
|
43
|
+
re as RadioGroupIndicator,
|
|
44
|
+
ne as RadioGroupItem,
|
|
45
|
+
F as Select,
|
|
46
|
+
J as SelectContent,
|
|
47
|
+
K as SelectItem,
|
|
48
|
+
Q as SelectItemIndicator,
|
|
49
|
+
U as SelectItemText,
|
|
50
|
+
W as SelectTrigger,
|
|
51
|
+
X as SelectValue,
|
|
52
|
+
Y as SelectViewport,
|
|
53
|
+
_ as Switch,
|
|
54
|
+
$ as SwitchThumb,
|
|
55
|
+
D as Tabs,
|
|
56
|
+
M as TabsContent,
|
|
57
|
+
N as TabsList,
|
|
58
|
+
f as TabsTrigger,
|
|
59
|
+
b as Tooltip,
|
|
60
|
+
S as TooltipContent,
|
|
61
|
+
x as TooltipTrigger
|
|
62
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "@radix-ui/react-navigation-menu";
|
|
3
|
+
import { ReactSdkContext as v, getIndexWithinAncestorFromComponentProps as l, getClosestInstance as d } from "@webstudio-is/react-sdk/runtime";
|
|
4
|
+
import { forwardRef as c, useContext as f, Children as m } from "react";
|
|
5
|
+
const p = c(({ value: o, ...n }, e) => {
|
|
6
|
+
const { renderer: t } = f(v);
|
|
7
|
+
let i = o;
|
|
8
|
+
return t === "canvas" && (i = i === "" ? "-1" : i), /* @__PURE__ */ r(a.Root, { ref: e, value: i, ...n });
|
|
9
|
+
}), C = a.List, P = a.Viewport, k = a.Content, x = c(({ value: o, ...n }, e) => {
|
|
10
|
+
const t = l(n);
|
|
11
|
+
return /* @__PURE__ */ r(a.Item, { ref: e, value: o ?? t, ...n });
|
|
12
|
+
}), A = c(({ children: o, ...n }, e) => {
|
|
13
|
+
const t = m.toArray(o)[0];
|
|
14
|
+
return /* @__PURE__ */ r(a.Link, { asChild: !0, ref: e, ...n, children: t ?? /* @__PURE__ */ r("a", { children: "Add link component" }) });
|
|
15
|
+
}), I = c(({ children: o, ...n }, e) => {
|
|
16
|
+
const t = m.toArray(o)[0];
|
|
17
|
+
return /* @__PURE__ */ r(a.Trigger, { asChild: !0, ref: e, ...n, children: t ?? /* @__PURE__ */ r("button", { children: "Add button or link" }) });
|
|
18
|
+
}), s = "@webstudio-is/sdk-components-react-radix", $ = {
|
|
19
|
+
onNavigatorUnselect: (o, n) => {
|
|
20
|
+
for (const e of n.instancePath)
|
|
21
|
+
if (e.component === `${s}:NavigationMenuContent`) {
|
|
22
|
+
const t = d(
|
|
23
|
+
n.instancePath,
|
|
24
|
+
e,
|
|
25
|
+
`${s}:NavigationMenu`
|
|
26
|
+
);
|
|
27
|
+
t && o.setMemoryProp(t, "value", void 0);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
onNavigatorSelect: (o, n) => {
|
|
31
|
+
var e;
|
|
32
|
+
for (const t of n.instancePath)
|
|
33
|
+
if (t.component === `${s}:NavigationMenuContent`) {
|
|
34
|
+
const i = d(
|
|
35
|
+
n.instancePath,
|
|
36
|
+
t,
|
|
37
|
+
`${s}:NavigationMenu`
|
|
38
|
+
), u = d(
|
|
39
|
+
n.instancePath,
|
|
40
|
+
t,
|
|
41
|
+
`${s}:NavigationMenuItem`
|
|
42
|
+
);
|
|
43
|
+
if (u === void 0 || i === void 0)
|
|
44
|
+
return;
|
|
45
|
+
const g = o.getPropValue(u, "value") ?? ((e = o.indexesWithinAncestors.get(u.id)) == null ? void 0 : e.toString());
|
|
46
|
+
g && o.setMemoryProp(i, "value", g);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
p as NavigationMenu,
|
|
52
|
+
k as NavigationMenuContent,
|
|
53
|
+
x as NavigationMenuItem,
|
|
54
|
+
A as NavigationMenuLink,
|
|
55
|
+
C as NavigationMenuList,
|
|
56
|
+
I as NavigationMenuTrigger,
|
|
57
|
+
P as NavigationMenuViewport,
|
|
58
|
+
$ as hooksNavigationMenu
|
|
59
|
+
};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDownIcon as w } from "@webstudio-is/icons/svg";
|
|
3
|
+
import { $ as n, css as t, PlaceholderValue as l } from "@webstudio-is/template";
|
|
4
|
+
import { radix as r } from "./shared/proxy.js";
|
|
5
|
+
import { getButtonStyle as u } from "./shared/styles.js";
|
|
6
|
+
import { spacing as i, colors as a, width as h, borderRadius as p, borderWidth as v, boxShadow as b, height as y, transition as x, lineHeight as c, fontSize as m, weights as $ } from "./shared/theme.js";
|
|
7
|
+
const k = [
|
|
8
|
+
{
|
|
9
|
+
title: "Sheet",
|
|
10
|
+
href: "/docs/components/sheet",
|
|
11
|
+
description: "Extends the Dialog component to display content that complements the main content of the screen."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
title: "Navigation Menu",
|
|
15
|
+
href: "/docs/components/navigation-menu",
|
|
16
|
+
description: "A collection of links for navigating websites."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: "Tabs",
|
|
20
|
+
href: "/docs/components/tabs",
|
|
21
|
+
description: "A set of layered sections of content—known as tab panels—that are displayed one at a time."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: "Accordion",
|
|
25
|
+
href: "/docs/components/accordion",
|
|
26
|
+
description: "A vertically stacked set of interactive headings that each reveal a section of content."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: "Dialog",
|
|
30
|
+
href: "/docs/components/dialog",
|
|
31
|
+
description: "A window overlaid on either the primary window or another dialog window, rendering the content underneath inert."
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: "Collapsible",
|
|
35
|
+
href: "/docs/components/collapsible",
|
|
36
|
+
description: "An interactive component which expands/collapses a panel."
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: "Popover",
|
|
40
|
+
href: "/docs/components/popover",
|
|
41
|
+
description: "Displays rich content in a portal, triggered by a button."
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: "Tooltip",
|
|
45
|
+
href: "/docs/components/tooltip",
|
|
46
|
+
description: "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: "Button",
|
|
50
|
+
href: "/docs/components/button",
|
|
51
|
+
description: "Displays a button or a component that looks like a button."
|
|
52
|
+
}
|
|
53
|
+
], M = (o) => /* @__PURE__ */ e(r.NavigationMenuLink, { children: /* @__PURE__ */ s(
|
|
54
|
+
n.Link,
|
|
55
|
+
{
|
|
56
|
+
href: `https://ui.shadcn.com${o.href}`,
|
|
57
|
+
"ws:style": t`
|
|
58
|
+
color: inherit;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
user-select: none;
|
|
62
|
+
gap: ${i[1]};
|
|
63
|
+
border-radius: ${p.md};
|
|
64
|
+
padding: ${i[3]};
|
|
65
|
+
line-height: ${c.none};
|
|
66
|
+
text-decoration-line: none;
|
|
67
|
+
outline: none;
|
|
68
|
+
&:hover,
|
|
69
|
+
&:focus {
|
|
70
|
+
background-color: ${a.accent};
|
|
71
|
+
color: ${a.accentForeground};
|
|
72
|
+
}
|
|
73
|
+
`,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
n.Text,
|
|
77
|
+
{
|
|
78
|
+
"ws:style": t`
|
|
79
|
+
font-size: ${m.sm};
|
|
80
|
+
font-weight: ${$.medium};
|
|
81
|
+
line-height: ${c.none};
|
|
82
|
+
`,
|
|
83
|
+
children: new l(o.title)
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
n.Paragraph,
|
|
88
|
+
{
|
|
89
|
+
"ws:style": t`
|
|
90
|
+
margin: 0;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
display: -webkit-box;
|
|
93
|
+
-webkit-box-orient: vertical;
|
|
94
|
+
-webkit-line-clamp: 2;
|
|
95
|
+
font-size: ${m.sm};
|
|
96
|
+
line-height: ${c.snug};
|
|
97
|
+
color: ${a.mutedForeground};
|
|
98
|
+
`,
|
|
99
|
+
children: new l(o.description)
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
) }, o.title), d = (o) => /* @__PURE__ */ e(
|
|
105
|
+
n.Box,
|
|
106
|
+
{
|
|
107
|
+
"ws:label": "Flex Column",
|
|
108
|
+
"ws:style": t`
|
|
109
|
+
width: ${h[64]};
|
|
110
|
+
display: flex;
|
|
111
|
+
gap: ${i[4]};
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
`,
|
|
114
|
+
children: k.slice(o.offset, o.offset + o.count).map(M)
|
|
115
|
+
}
|
|
116
|
+
), C = /* @__PURE__ */ s(
|
|
117
|
+
n.Box,
|
|
118
|
+
{
|
|
119
|
+
"ws:label": "Content",
|
|
120
|
+
"ws:style": t`
|
|
121
|
+
display: flex;
|
|
122
|
+
gap: ${i[4]};
|
|
123
|
+
padding: ${i[2]};
|
|
124
|
+
`,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ e(
|
|
127
|
+
n.Box,
|
|
128
|
+
{
|
|
129
|
+
"ws:style": t`
|
|
130
|
+
background-color: ${a.border};
|
|
131
|
+
padding: ${i[4]};
|
|
132
|
+
width: ${h[48]};
|
|
133
|
+
border-radius: ${p.md};
|
|
134
|
+
`,
|
|
135
|
+
children: new l("")
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
d({ count: 3, offset: 0 })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
), A = /* @__PURE__ */ s(
|
|
142
|
+
n.Box,
|
|
143
|
+
{
|
|
144
|
+
"ws:label": "Content",
|
|
145
|
+
"ws:style": t`
|
|
146
|
+
display: flex;
|
|
147
|
+
gap: ${i[4]};
|
|
148
|
+
`,
|
|
149
|
+
children: [
|
|
150
|
+
d({ count: 3, offset: 3 }),
|
|
151
|
+
d({ count: 3, offset: 6 })
|
|
152
|
+
]
|
|
153
|
+
}
|
|
154
|
+
), g = (o, f) => /* @__PURE__ */ s(r.NavigationMenuItem, { children: [
|
|
155
|
+
/* @__PURE__ */ e(r.NavigationMenuTrigger, { children: /* @__PURE__ */ s(
|
|
156
|
+
n.Button,
|
|
157
|
+
{
|
|
158
|
+
"ws:style": [
|
|
159
|
+
...u("ghost", "sm"),
|
|
160
|
+
...t`
|
|
161
|
+
--navigation-menu-trigger-icon-transform: 0deg;
|
|
162
|
+
&[data-state="open"] {
|
|
163
|
+
--navigation-menu-trigger-icon-transform: 180deg;
|
|
164
|
+
}
|
|
165
|
+
`
|
|
166
|
+
],
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ e(n.Text, { children: new l(o) }),
|
|
169
|
+
/* @__PURE__ */ e(
|
|
170
|
+
n.Box,
|
|
171
|
+
{
|
|
172
|
+
"ws:label": "Icon Container",
|
|
173
|
+
"ws:style": t`
|
|
174
|
+
margin-left: ${i[1]};
|
|
175
|
+
rotate: var(--navigation-menu-trigger-icon-transform);
|
|
176
|
+
height: ${y[4]};
|
|
177
|
+
width: ${h[4]};
|
|
178
|
+
flex-shrink: 0;
|
|
179
|
+
transition: ${x.all};
|
|
180
|
+
transition-duration: 200ms;
|
|
181
|
+
`,
|
|
182
|
+
children: /* @__PURE__ */ e(n.HtmlEmbed, { "ws:label": "Chevron Icon", code: w })
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
) }),
|
|
188
|
+
/* @__PURE__ */ e(
|
|
189
|
+
r.NavigationMenuContent,
|
|
190
|
+
{
|
|
191
|
+
"ws:style": t`
|
|
192
|
+
left: 0;
|
|
193
|
+
top: 0;
|
|
194
|
+
positon: absolute;
|
|
195
|
+
width: max-content;
|
|
196
|
+
padding: ${i[4]};
|
|
197
|
+
`,
|
|
198
|
+
children: f
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
] }), N = (o) => /* @__PURE__ */ e(r.NavigationMenuItem, { children: /* @__PURE__ */ e(r.NavigationMenuLink, { children: /* @__PURE__ */ e(
|
|
202
|
+
n.Link,
|
|
203
|
+
{
|
|
204
|
+
"ws:style": [
|
|
205
|
+
...u("ghost", "sm"),
|
|
206
|
+
...t`
|
|
207
|
+
text-decoration-line: none;
|
|
208
|
+
color: currentColor;
|
|
209
|
+
`
|
|
210
|
+
],
|
|
211
|
+
children: new l(o)
|
|
212
|
+
}
|
|
213
|
+
) }) }), S = {
|
|
214
|
+
category: "radix",
|
|
215
|
+
description: "A collection of links for navigating websites.",
|
|
216
|
+
order: 2,
|
|
217
|
+
template: /* @__PURE__ */ s(
|
|
218
|
+
r.NavigationMenu,
|
|
219
|
+
{
|
|
220
|
+
"ws:style": t`
|
|
221
|
+
position: relative;
|
|
222
|
+
max-width: max-content;
|
|
223
|
+
`,
|
|
224
|
+
children: [
|
|
225
|
+
/* @__PURE__ */ s(
|
|
226
|
+
r.NavigationMenuList,
|
|
227
|
+
{
|
|
228
|
+
"ws:style": t`
|
|
229
|
+
/* ul defaults in tailwind */
|
|
230
|
+
padding: 0;
|
|
231
|
+
margin: 0;
|
|
232
|
+
/* shadcdn styles */
|
|
233
|
+
display: flex;
|
|
234
|
+
flex: 1 1 0;
|
|
235
|
+
list-style-type: none;
|
|
236
|
+
align-items: center;
|
|
237
|
+
justify-content: center;
|
|
238
|
+
gap: ${i[1]};
|
|
239
|
+
`,
|
|
240
|
+
children: [
|
|
241
|
+
g("About", C),
|
|
242
|
+
g("Components", A),
|
|
243
|
+
N("Standalone")
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ e(
|
|
248
|
+
n.Box,
|
|
249
|
+
{
|
|
250
|
+
"ws:label": "Viewport Container",
|
|
251
|
+
"ws:style": t`
|
|
252
|
+
position: absolute;
|
|
253
|
+
left: 0;
|
|
254
|
+
top: 100%;
|
|
255
|
+
display: flex;
|
|
256
|
+
justify-content: center;
|
|
257
|
+
`,
|
|
258
|
+
children: /* @__PURE__ */ e(
|
|
259
|
+
r.NavigationMenuViewport,
|
|
260
|
+
{
|
|
261
|
+
"ws:style": t`
|
|
262
|
+
position: relative;
|
|
263
|
+
margin-top: ${i[1.5]};
|
|
264
|
+
overflow: hidden;
|
|
265
|
+
border-radius: ${p.md};
|
|
266
|
+
border: ${v.DEFAULT} solid ${a.border};
|
|
267
|
+
background-color: ${a.popover};
|
|
268
|
+
color: ${a.popoverForeground};
|
|
269
|
+
box-shadow: ${b.lg};
|
|
270
|
+
height: var(--radix-navigation-menu-viewport-height);
|
|
271
|
+
width: var(--radix-navigation-menu-viewport-width);
|
|
272
|
+
`
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
};
|
|
281
|
+
export {
|
|
282
|
+
S as meta
|
|
283
|
+
};
|