@webstudio-is/sdk-components-react-radix 0.269.0 → 0.270.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.
|
@@ -59,8 +59,7 @@ const e = {
|
|
|
59
59
|
description: "Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries or keeping content available in the DOM.",
|
|
60
60
|
required: !1,
|
|
61
61
|
control: "boolean",
|
|
62
|
-
type: "boolean"
|
|
63
|
-
defaultValue: !0
|
|
62
|
+
type: "boolean"
|
|
64
63
|
}
|
|
65
64
|
};
|
|
66
65
|
export {
|
package/lib/accordion.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Header as l, Trigger as g,
|
|
4
|
-
import { getIndexWithinAncestorFromProps as
|
|
5
|
-
import { getClosestInstance as
|
|
6
|
-
const S =
|
|
7
|
-
const t = o.value ?? e ?? "", [
|
|
8
|
-
return f(() =>
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useState as u, useEffect as f } from "react";
|
|
3
|
+
import { Header as l, Trigger as g, Content as A, Root as p, Item as h } from "@radix-ui/react-accordion";
|
|
4
|
+
import { getIndexWithinAncestorFromProps as P } from "@webstudio-is/sdk/runtime";
|
|
5
|
+
import { getClosestInstance as a } from "@webstudio-is/react-sdk/runtime";
|
|
6
|
+
const S = m(({ defaultValue: e, ...o }, n) => {
|
|
7
|
+
const t = o.value ?? e ?? "", [r, c] = u(t);
|
|
8
|
+
return f(() => c(t), [t]), /* @__PURE__ */ d(
|
|
9
9
|
p,
|
|
10
10
|
{
|
|
11
11
|
...o,
|
|
12
12
|
ref: n,
|
|
13
13
|
type: "single",
|
|
14
|
-
value:
|
|
15
|
-
onValueChange:
|
|
14
|
+
value: r,
|
|
15
|
+
onValueChange: c
|
|
16
16
|
}
|
|
17
17
|
);
|
|
18
|
-
}), $ =
|
|
19
|
-
const t =
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
}), k = l, w = g, y =
|
|
18
|
+
}), $ = m(({ value: e, ...o }, n) => {
|
|
19
|
+
const t = P(o);
|
|
20
|
+
return /* @__PURE__ */ d(h, { ref: n, value: e ?? t ?? "", ...o });
|
|
21
|
+
}), k = l, w = g, y = A, i = "@webstudio-is/sdk-components-react-radix", H = {
|
|
22
22
|
onNavigatorSelect: (e, o) => {
|
|
23
23
|
var n;
|
|
24
24
|
for (const t of o.instancePath)
|
|
25
25
|
if (t.component === `${i}:AccordionContent`) {
|
|
26
|
-
const
|
|
26
|
+
const r = a(
|
|
27
27
|
o.instancePath,
|
|
28
28
|
t,
|
|
29
29
|
`${i}:Accordion`
|
|
30
|
-
),
|
|
30
|
+
), c = a(
|
|
31
31
|
o.instancePath,
|
|
32
32
|
t,
|
|
33
33
|
`${i}:AccordionItem`
|
|
34
34
|
);
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
35
|
+
if (r && c) {
|
|
36
|
+
const s = e.getPropValue(c, "value") ?? ((n = e.indexesWithinAncestors.get(c.id)) == null ? void 0 : n.toString());
|
|
37
|
+
s && e.setMemoryProp(r, "value", s);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { $ as o, PlaceholderValue as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { $ as o, PlaceholderValue as a, css as t } from "@webstudio-is/template";
|
|
3
3
|
import { radix as i } from "./shared/proxy.js";
|
|
4
|
-
import { height as l, width as h, transition as
|
|
4
|
+
import { height as l, width as h, transition as s, spacing as m, weights as g, fontSize as f, fontSizeLineHeight as p, borderWidth as w, colors as u } from "./shared/theme.js";
|
|
5
5
|
import { ChevronDownIcon as y } from "@webstudio-is/icons/svg";
|
|
6
|
-
const
|
|
6
|
+
const n = (c, d) => /* @__PURE__ */ r(
|
|
7
7
|
i.AccordionItem,
|
|
8
8
|
{
|
|
9
9
|
"ws:style": t`
|
|
@@ -16,7 +16,7 @@ const r = (c, d) => /* @__PURE__ */ n(
|
|
|
16
16
|
"ws:style": t`
|
|
17
17
|
display: flex;
|
|
18
18
|
`,
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ r(
|
|
20
20
|
i.AccordionTrigger,
|
|
21
21
|
{
|
|
22
22
|
"ws:style": t`
|
|
@@ -35,7 +35,7 @@ const r = (c, d) => /* @__PURE__ */ n(
|
|
|
35
35
|
}
|
|
36
36
|
`,
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */ e(o.Text, { children: new
|
|
38
|
+
/* @__PURE__ */ e(o.Text, { children: new a(c) }),
|
|
39
39
|
/* @__PURE__ */ e(
|
|
40
40
|
o.Box,
|
|
41
41
|
{
|
|
@@ -45,7 +45,7 @@ const r = (c, d) => /* @__PURE__ */ n(
|
|
|
45
45
|
height: ${l[4]};
|
|
46
46
|
width: ${h[4]};
|
|
47
47
|
flex-shrink: 0;
|
|
48
|
-
transition: ${
|
|
48
|
+
transition: ${s.all};
|
|
49
49
|
transition-duration: 200ms;
|
|
50
50
|
`,
|
|
51
51
|
children: /* @__PURE__ */ e(o.HtmlEmbed, { "ws:label": "Chevron Icon", code: y })
|
|
@@ -64,13 +64,15 @@ const r = (c, d) => /* @__PURE__ */ n(
|
|
|
64
64
|
overflow: hidden;
|
|
65
65
|
font-size: ${f.sm};
|
|
66
66
|
line-height: ${p.sm};
|
|
67
|
-
transition: ${
|
|
68
|
-
height: var(--radix-collapsible-content-height);
|
|
67
|
+
transition: ${s.all};
|
|
69
68
|
&[data-state="closed"] {
|
|
70
69
|
height: 0;
|
|
71
70
|
}
|
|
71
|
+
&[data-state="open"] {
|
|
72
|
+
height: var(--radix-accordion-content-height);
|
|
73
|
+
}
|
|
72
74
|
`,
|
|
73
|
-
children: new
|
|
75
|
+
children: new a(d)
|
|
74
76
|
}
|
|
75
77
|
)
|
|
76
78
|
]
|
|
@@ -79,16 +81,16 @@ const r = (c, d) => /* @__PURE__ */ n(
|
|
|
79
81
|
category: "radix",
|
|
80
82
|
description: "A vertically stacked set of interactive headings that each reveal an associated section of content. Clicking on the heading will open the item and close other items.",
|
|
81
83
|
order: 3,
|
|
82
|
-
template: /* @__PURE__ */
|
|
83
|
-
|
|
84
|
+
template: /* @__PURE__ */ r(i.Accordion, { collapsible: !0, value: "0", children: [
|
|
85
|
+
n(
|
|
84
86
|
"Is it accessible?",
|
|
85
87
|
"Yes. It adheres to the WAI-ARIA design pattern."
|
|
86
88
|
),
|
|
87
|
-
|
|
89
|
+
n(
|
|
88
90
|
"Is it styled?",
|
|
89
91
|
"Yes. It comes with default styles that matches the other components' aesthetic."
|
|
90
92
|
),
|
|
91
|
-
|
|
93
|
+
n(
|
|
92
94
|
"Is it animated?",
|
|
93
95
|
"Yes. It's animated by default, but you can disable it if you prefer."
|
|
94
96
|
)
|
package/lib/types/accordion.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ForwardRefExoticComponent, type ComponentProps, type RefAttributes } from "react";
|
|
2
|
-
import { Header, Trigger } from "@radix-ui/react-accordion";
|
|
2
|
+
import { Header, Trigger, Content } from "@radix-ui/react-accordion";
|
|
3
3
|
import { type Hook } from "@webstudio-is/react-sdk/runtime";
|
|
4
4
|
export declare const Accordion: ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-accordion").AccordionSingleProps & RefAttributes<HTMLDivElement>, "ref">, "type" | "asChild"> & RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export declare const AccordionItem: ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-accordion").AccordionItemProps & RefAttributes<HTMLDivElement>, "ref">, "value"> & {
|
|
@@ -7,7 +7,5 @@ export declare const AccordionItem: ForwardRefExoticComponent<Omit<Omit<import("
|
|
|
7
7
|
} & RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export declare const AccordionHeader: ForwardRefExoticComponent<Omit<ComponentProps<typeof Header>, "asChild"> & RefAttributes<HTMLHeadingElement>>;
|
|
9
9
|
export declare const AccordionTrigger: ForwardRefExoticComponent<Omit<ComponentProps<typeof Trigger>, "asChild"> & RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
export declare const AccordionContent: ForwardRefExoticComponent<Omit<
|
|
11
|
-
forceMount?: boolean;
|
|
12
|
-
} & RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const AccordionContent: ForwardRefExoticComponent<Omit<ComponentProps<typeof Content>, "asChild"> & RefAttributes<HTMLDivElement>>;
|
|
13
11
|
export declare const hooksAccordion: Hook;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk-components-react-radix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.270.0",
|
|
4
4
|
"description": "Webstudio wrapper for radix library",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -52,22 +52,22 @@
|
|
|
52
52
|
"@radix-ui/react-tabs": "^1.1.9",
|
|
53
53
|
"@radix-ui/react-tooltip": "^1.2.4",
|
|
54
54
|
"await-interaction-response": "^0.0.2",
|
|
55
|
-
"@webstudio-is/
|
|
56
|
-
"@webstudio-is/react-sdk": "0.
|
|
57
|
-
"@webstudio-is/sdk": "0.
|
|
58
|
-
"@webstudio-is/
|
|
55
|
+
"@webstudio-is/css-engine": "0.270.0",
|
|
56
|
+
"@webstudio-is/react-sdk": "0.270.0",
|
|
57
|
+
"@webstudio-is/sdk": "0.270.0",
|
|
58
|
+
"@webstudio-is/icons": "0.270.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^18.2.70",
|
|
62
62
|
"@types/react-dom": "^18.2.25",
|
|
63
63
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
64
64
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
65
|
-
"@webstudio-is/css-data": "0.269.0",
|
|
66
65
|
"@webstudio-is/sdk-cli": "^0.94.0",
|
|
67
|
-
"@webstudio-is/sdk-components-react": "0.269.0",
|
|
68
66
|
"@webstudio-is/generate-arg-types": "0.0.0",
|
|
67
|
+
"@webstudio-is/sdk-components-react": "0.270.0",
|
|
69
68
|
"@webstudio-is/tsconfig": "1.0.7",
|
|
70
|
-
"@webstudio-is/template": "0.
|
|
69
|
+
"@webstudio-is/template": "0.270.0",
|
|
70
|
+
"@webstudio-is/css-data": "0.270.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "vite build --config ../../vite.sdk-components.config.ts",
|