@webstudio-is/sdk-components-react-radix 0.194.0 → 0.196.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/lib/dialog.ws.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { TriggerIcon as p, OverlayIcon as g, ContentIcon as d, HeadingIcon as y, TextIcon as m, ButtonElementIcon as D, DialogIcon as u, LargeXIcon as h } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as f } from "@webstudio-is/react-sdk";
3
3
  import { button as v, div as b, h2 as C, p as x } from "@webstudio-is/sdk/normalize.css";
4
- import { fixed as T, inset as $, z as n, bg as t, backdropBlur as q, flex as e, overflow as I, w as i, gap as a, m as P, maxW as S, border as l, p as w, shadow as B, relative as M, my as r, leading as O, text as o, tracking as k, absolute as H, right as E, top as j, rounded as z, opacity as c, items as F, justify as L, h as R, outline as W, hover as X, focus as A, ring as G } from "./theme/tailwind-classes.js";
4
+ import { fixed as T, inset as $, z as n, bg as t, backdropBlur as q, flex as e, overflow as I, w as a, gap as i, m as P, maxW as S, border as l, p as w, shadow as B, relative as M, my as r, leading as O, text as o, tracking as k, absolute as H, right as E, top as j, rounded as z, opacity as s, items as F, justify as L, h as R, outline as W, hover as X, focus as A, ring as G } from "./theme/tailwind-classes.js";
5
5
  import { propsDialog as J, propsDialogTrigger as K, propsDialogContent as N, propsDialogOverlay as Q, propsDialogClose as U, propsDialogTitle as V, propsDialogDescription as Y } from "./__generated__/dialog.props.js";
6
6
  import { buttonReset as Z, getButtonStyles as _ } from "./theme/styles.js";
7
- const s = {
7
+ const c = {
8
8
  div: b
9
9
  }, ee = {
10
10
  h2: C
11
11
  }, te = {
12
12
  p: x
13
- }, ce = {
13
+ }, se = {
14
14
  category: "hidden",
15
15
  type: "container",
16
16
  icon: p,
@@ -19,10 +19,10 @@ const s = {
19
19
  relation: "ancestor",
20
20
  component: { $eq: "Dialog" }
21
21
  }
22
- }, se = {
22
+ }, ce = {
23
23
  category: "hidden",
24
24
  type: "container",
25
- presetStyle: s,
25
+ presetStyle: c,
26
26
  icon: g,
27
27
  constraints: [
28
28
  {
@@ -37,21 +37,25 @@ const s = {
37
37
  }, pe = {
38
38
  category: "hidden",
39
39
  type: "container",
40
- presetStyle: s,
40
+ presetStyle: c,
41
41
  icon: d,
42
42
  constraints: [
43
43
  {
44
44
  relation: "ancestor",
45
45
  component: { $eq: "DialogOverlay" }
46
46
  },
47
+ // often deleted by users
48
+ // though radix starts throwing warnings in console
49
+ /*
47
50
  {
48
51
  relation: "descendant",
49
- component: { $eq: "DialogTitle" }
52
+ component: { $eq: "DialogTitle" },
50
53
  },
51
54
  {
52
55
  relation: "descendant",
53
- component: { $eq: "DialogDescription" }
56
+ component: { $eq: "DialogDescription" },
54
57
  },
58
+ */
55
59
  {
56
60
  relation: "descendant",
57
61
  component: { $eq: "DialogClose" }
@@ -150,11 +154,11 @@ const s = {
150
154
  * border bg-background p-6 shadow-lg
151
155
  **/
152
156
  styles: [
153
- i("full"),
157
+ a("full"),
154
158
  n(50),
155
159
  e(),
156
160
  e("col"),
157
- a(4),
161
+ i(4),
158
162
  P("auto"),
159
163
  S("lg"),
160
164
  l(),
@@ -168,7 +172,7 @@ const s = {
168
172
  type: "instance",
169
173
  component: "Box",
170
174
  label: "Dialog Header",
171
- styles: [e(), e("col"), a(1)].flat(),
175
+ styles: [e(), e("col"), i(1)].flat(),
172
176
  children: [
173
177
  {
174
178
  type: "instance",
@@ -237,16 +241,16 @@ const s = {
237
241
  E(4),
238
242
  j(4),
239
243
  z("sm"),
240
- c(70),
244
+ s(70),
241
245
  e(),
242
246
  F("center"),
243
247
  L("center"),
244
248
  R(4),
245
- i(4),
249
+ a(4),
246
250
  l(0),
247
251
  t("transparent"),
248
252
  W(),
249
- X(c(100)),
253
+ X(s(100)),
250
254
  A(G("ring", 2, "background", 2))
251
255
  ].flat(),
252
256
  children: [
@@ -298,9 +302,9 @@ export {
298
302
  ye as metaDialogClose,
299
303
  pe as metaDialogContent,
300
304
  de as metaDialogDescription,
301
- se as metaDialogOverlay,
305
+ ce as metaDialogOverlay,
302
306
  ge as metaDialogTitle,
303
- ce as metaDialogTrigger,
307
+ se as metaDialogTrigger,
304
308
  De as propsMetaDialog,
305
309
  ve as propsMetaDialogClose,
306
310
  he as propsMetaDialogContent,
package/lib/hooks.js CHANGED
@@ -2,12 +2,11 @@ import { hooksCollapsible as o } from "./collapsible.js";
2
2
  import { hooksTabs as r } from "./tabs.js";
3
3
  import { hooksDialog as m } from "./dialog.js";
4
4
  import { hooksPopover as i } from "./popover.js";
5
- import { hooksSheet as t } from "./sheet.js";
6
- import { hooksTooltip as p } from "./tooltip.js";
7
- import { hooksAccordion as s } from "./accordion.js";
8
- import { hooksNavigationMenu as h } from "./navigation-menu.js";
9
- import { hooksSelect as k } from "./select.js";
10
- const S = [
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 = [
11
10
  o,
12
11
  r,
13
12
  m,
@@ -15,9 +14,8 @@ const S = [
15
14
  t,
16
15
  p,
17
16
  s,
18
- h,
19
- k
17
+ h
20
18
  ];
21
19
  export {
22
- S as hooks
20
+ g as hooks
23
21
  };
@@ -387,7 +387,7 @@ const o = {
387
387
  component: { $eq: "NavigationMenu" }
388
388
  },
389
389
  {
390
- relation: "child",
390
+ relation: "descendant",
391
391
  component: { $eq: "NavigationMenuItem" }
392
392
  }
393
393
  ],
@@ -398,7 +398,7 @@ const o = {
398
398
  type: "container",
399
399
  icon: I,
400
400
  constraints: {
401
- relation: "parent",
401
+ relation: "ancestor",
402
402
  component: { $eq: "NavigationMenuList" }
403
403
  },
404
404
  presetStyle: o,
@@ -1,12 +1,12 @@
1
- import { RadioCheckedIcon as p, ItemIcon as i, TriggerIcon as s, RadioDotIcon as l } from "@webstudio-is/icons/svg";
1
+ import { RadioGroupIcon as c, ItemIcon as i, TriggerIcon as s, DotIcon as l } from "@webstudio-is/icons/svg";
2
2
  import { defaultStates as o } from "@webstudio-is/react-sdk";
3
3
  import { div as d, button as u, span as m } from "@webstudio-is/sdk/normalize.css";
4
- import { flex as t, gap as n, items as y, aspect as b, h as f, w as h, rounded as G, border as a, text as R, focusVisible as I, outline as g, ring as v, disabled as k, cursor as x, opacity as q } from "./theme/tailwind-classes.js";
4
+ import { flex as t, gap as n, items as y, aspect as b, h as f, w as G, rounded as h, border as a, text as I, focusVisible as R, outline as g, ring as v, disabled as k, cursor as x, opacity as q } from "./theme/tailwind-classes.js";
5
5
  import { buttonReset as V } from "./theme/styles.js";
6
- import { propsRadioGroup as C, propsRadioGroupItem as w, propsRadioGroupIndicator as S } from "./__generated__/radio-group.props.js";
6
+ import { propsRadioGroup as w, propsRadioGroupItem as C, propsRadioGroupIndicator as S } from "./__generated__/radio-group.props.js";
7
7
  const e = ({
8
8
  value: r,
9
- label: c
9
+ label: p
10
10
  }) => ({
11
11
  type: "instance",
12
12
  component: "Label",
@@ -24,12 +24,12 @@ const e = ({
24
24
  styles: [
25
25
  b("square"),
26
26
  f(4),
27
- h(4),
28
- G("full"),
27
+ G(4),
28
+ h("full"),
29
29
  a(),
30
30
  a("primary"),
31
- R("primary"),
32
- I(
31
+ I("primary"),
32
+ R(
33
33
  [g(), v("ring", 2, "background", 2)].flat()
34
34
  ),
35
35
  k([x("not-allowed"), q(50)].flat())
@@ -59,7 +59,7 @@ const e = ({
59
59
  {
60
60
  type: "instance",
61
61
  component: "Text",
62
- children: [{ type: "text", value: c, placeholder: !0 }]
62
+ children: [{ type: "text", value: p, placeholder: !0 }]
63
63
  }
64
64
  ]
65
65
  }), E = {
@@ -71,7 +71,7 @@ const e = ({
71
71
  component: { $eq: "RadioGroupItem" }
72
72
  },
73
73
  description: "A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.",
74
- icon: p,
74
+ icon: c,
75
75
  states: [
76
76
  ...o,
77
77
  {
@@ -153,10 +153,10 @@ const e = ({
153
153
  span: m
154
154
  }
155
155
  }, N = {
156
- props: C,
156
+ props: w,
157
157
  initialProps: ["id", "className", "name", "value", "required"]
158
158
  }, U = {
159
- props: w,
159
+ props: C,
160
160
  initialProps: ["value"]
161
161
  }, j = {
162
162
  props: S
package/lib/sheet.ws.js CHANGED
@@ -1,5 +1,5 @@
1
- import { HamburgerMenuIcon as o, LargeXIcon as p } from "@webstudio-is/icons/svg";
2
- import { fixed as m, inset as g, z as l, bg as t, backdropBlur as d, flex as e, overflow as y, w as a, gap as r, border as i, p as u, shadow as h, relative as b, mr as f, maxW as v, grow as x, my as c, leading as S, text as n, tracking as D, absolute as T, right as B, top as k, rounded as C, opacity as s, items as H, justify as w, h as I, outline as E, hover as M, focus as O, ring as j } from "./theme/tailwind-classes.js";
1
+ import { MenuIcon as o, LargeXIcon as p } from "@webstudio-is/icons/svg";
2
+ import { fixed as m, inset as d, z as l, bg as t, backdropBlur as g, flex as e, overflow as y, w as a, gap as i, border as r, p as h, shadow as u, relative as b, mr as f, maxW as v, grow as x, my as c, leading as S, text as n, tracking as D, absolute as T, right as B, top as k, rounded as C, opacity as s, items as w, justify as H, h as I, outline as E, hover as M, focus as O, ring as j } from "./theme/tailwind-classes.js";
3
3
  import { getButtonStyles as z } from "./theme/styles.js";
4
4
  const U = {
5
5
  category: "radix",
@@ -52,10 +52,10 @@ const U = {
52
52
  **/
53
53
  styles: [
54
54
  m(),
55
- g(0),
55
+ d(0),
56
56
  l(50),
57
57
  t("background", 80),
58
- d("sm"),
58
+ g("sm"),
59
59
  // To allow positioning Content
60
60
  e(),
61
61
  e("col"),
@@ -77,11 +77,11 @@ const U = {
77
77
  l(50),
78
78
  e(),
79
79
  e("col"),
80
- r(4),
81
- i(),
80
+ i(4),
81
+ r(),
82
82
  t("background"),
83
- u(6),
84
- h("lg"),
83
+ h(6),
84
+ u("lg"),
85
85
  b(),
86
86
  // side=left
87
87
  f("auto"),
@@ -102,7 +102,7 @@ const U = {
102
102
  type: "instance",
103
103
  component: "Box",
104
104
  label: "Sheet Header",
105
- styles: [e(), e("col"), r(1)].flat(),
105
+ styles: [e(), e("col"), i(1)].flat(),
106
106
  children: [
107
107
  {
108
108
  type: "instance",
@@ -178,11 +178,11 @@ const U = {
178
178
  C("sm"),
179
179
  s(70),
180
180
  e(),
181
- H("center"),
182
181
  w("center"),
182
+ H("center"),
183
183
  I(4),
184
184
  a(4),
185
- i(0),
185
+ r(0),
186
186
  t("transparent"),
187
187
  E(),
188
188
  M(s(100)),
@@ -0,0 +1 @@
1
+
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-radix",
3
- "version": "0.194.0",
3
+ "version": "0.196.0",
4
4
  "description": "Webstudio wrapper for radix library",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -53,10 +53,10 @@
53
53
  "@radix-ui/react-tooltip": "^1.1.4",
54
54
  "@radix-ui/react-use-controllable-state": "^1.1.0",
55
55
  "await-interaction-response": "^0.0.2",
56
- "@webstudio-is/css-engine": "0.194.0",
57
- "@webstudio-is/react-sdk": "0.194.0",
58
- "@webstudio-is/icons": "0.194.0",
59
- "@webstudio-is/sdk": "0.194.0"
56
+ "@webstudio-is/css-engine": "0.196.0",
57
+ "@webstudio-is/icons": "0.196.0",
58
+ "@webstudio-is/react-sdk": "0.196.0",
59
+ "@webstudio-is/sdk": "0.196.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/node": "^22.9.3",
@@ -66,9 +66,9 @@
66
66
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
67
67
  "tailwindcss": "^3.3.3",
68
68
  "@webstudio-is/css-data": "0.0.0",
69
- "@webstudio-is/sdk-components-react": "0.194.0",
70
69
  "@webstudio-is/generate-arg-types": "0.0.0",
71
70
  "@webstudio-is/sdk-cli": "^0.94.0",
71
+ "@webstudio-is/sdk-components-react": "0.196.0",
72
72
  "@webstudio-is/tsconfig": "1.0.7"
73
73
  },
74
74
  "scripts": {
package/lib/sheet.js DELETED
@@ -1,43 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import { forwardRef as f } from "react";
3
- import { getClosestInstance as r } from "@webstudio-is/react-sdk/runtime";
4
- import { DialogContent as h } from "./dialog.js";
5
- f(
6
- ({ tag: n = "nav", side: t = "left", role: e = "navigation", children: o, ...i }, c) => /* @__PURE__ */ s(
7
- h,
8
- {
9
- asChild: !0,
10
- "data-side": t,
11
- role: e,
12
- ...i,
13
- children: /* @__PURE__ */ s(n, { ref: c, children: o })
14
- }
15
- )
16
- );
17
- const a = "@webstudio-is/sdk-components-react-radix", P = {
18
- onNavigatorUnselect: (n, t) => {
19
- for (const e of t.instancePath)
20
- if (e.component === `${a}:SheetOverlay`) {
21
- const o = r(
22
- t.instancePath,
23
- e,
24
- `${a}:Sheet`
25
- );
26
- o && n.setMemoryProp(o, "open", void 0);
27
- }
28
- },
29
- onNavigatorSelect: (n, t) => {
30
- for (const e of t.instancePath)
31
- if (e.component === `${a}:SheetOverlay`) {
32
- const o = r(
33
- t.instancePath,
34
- e,
35
- `${a}:Sheet`
36
- );
37
- o && n.setMemoryProp(o, "open", !0);
38
- }
39
- }
40
- };
41
- export {
42
- P as hooksSheet
43
- };
@@ -1,16 +0,0 @@
1
- import { type Hook } from "@webstudio-is/react-sdk/runtime";
2
- export declare const Sheet: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogProps, "defaultOpen"> & import("react").RefAttributes<HTMLDivElement>>;
3
- export declare const SheetTrigger: import("react").ForwardRefExoticComponent<{
4
- children: import("react").ReactNode;
5
- } & import("react").RefAttributes<HTMLButtonElement>>;
6
- export declare const SheetOverlay: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
7
- export declare const SheetClose: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
8
- export declare const SheetTitle: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement> & {
9
- tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
10
- }, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
11
- export declare const SheetDescription: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
12
- export declare const SheetContent: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dialog").DialogContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
13
- tag?: "div" | "nav";
14
- side?: "top" | "right" | "bottom" | "left";
15
- } & import("react").RefAttributes<HTMLDivElement>>;
16
- export declare const hooksSheet: Hook;