@webstudio-is/sdk-components-react-radix 0.167.0 → 0.173.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/components.js +33 -9
- package/lib/hooks.js +112 -24
- package/lib/metas.js +41 -155
- package/lib/props.js +1330 -244
- package/lib/types/accordion.d.ts +2 -5
- package/lib/types/checkbox.d.ts +1 -1
- package/lib/types/dialog.d.ts +1 -1
- package/lib/types/label.d.ts +0 -1
- package/lib/types/navigation-menu.d.ts +2 -7
- package/lib/types/select.d.ts +3 -3
- package/lib/types/sheet.d.ts +3 -4
- package/lib/types/tabs.d.ts +3 -3
- package/lib/types/theme/styles.d.ts +130 -219
- package/lib/types/theme/tailwind-classes.d.ts +1 -1
- package/package.json +9 -11
package/lib/metas.js
CHANGED
|
@@ -379,6 +379,7 @@ var propsCollapsible = {
|
|
|
379
379
|
description: "Defines the ID of a menu element which willserve as the element's context menu."
|
|
380
380
|
},
|
|
381
381
|
datatype: { required: false, control: "text", type: "string" },
|
|
382
|
+
defaultValue: { required: false, control: "text", type: "string" },
|
|
382
383
|
dir: {
|
|
383
384
|
required: false,
|
|
384
385
|
control: "text",
|
|
@@ -1081,7 +1082,11 @@ var z = (value) => {
|
|
|
1081
1082
|
};
|
|
1082
1083
|
var overflow = (value) => [
|
|
1083
1084
|
{
|
|
1084
|
-
property: "
|
|
1085
|
+
property: "overflowX",
|
|
1086
|
+
value: { type: "keyword", value }
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
property: "overflowY",
|
|
1085
1090
|
value: { type: "keyword", value }
|
|
1086
1091
|
}
|
|
1087
1092
|
];
|
|
@@ -1428,13 +1433,7 @@ var gap = (gapValue) => {
|
|
|
1428
1433
|
};
|
|
1429
1434
|
var lineClamp2 = (lineClampValue) => {
|
|
1430
1435
|
return [
|
|
1431
|
-
|
|
1432
|
-
property: "overflow",
|
|
1433
|
-
value: {
|
|
1434
|
-
type: "keyword",
|
|
1435
|
-
value: "hidden"
|
|
1436
|
-
}
|
|
1437
|
-
},
|
|
1436
|
+
...overflow("hidden"),
|
|
1438
1437
|
{
|
|
1439
1438
|
property: "display",
|
|
1440
1439
|
value: {
|
|
@@ -1535,10 +1534,31 @@ var font = (weight) => {
|
|
|
1535
1534
|
];
|
|
1536
1535
|
};
|
|
1537
1536
|
var whitespace = (value) => {
|
|
1537
|
+
let whiteSpaceCollapse = "collapse";
|
|
1538
|
+
let textWrapMode = "wrap";
|
|
1539
|
+
if (value === "normal") {
|
|
1540
|
+
[whiteSpaceCollapse, textWrapMode] = ["collapse", "wrap"];
|
|
1541
|
+
}
|
|
1542
|
+
if (value === "pre") {
|
|
1543
|
+
[whiteSpaceCollapse, textWrapMode] = ["preserve", "nowrap"];
|
|
1544
|
+
}
|
|
1545
|
+
if (value === "pre-wrap") {
|
|
1546
|
+
[whiteSpaceCollapse, textWrapMode] = ["preserve", "wrap"];
|
|
1547
|
+
}
|
|
1548
|
+
if (value === "pre-line") {
|
|
1549
|
+
[whiteSpaceCollapse, textWrapMode] = ["preserve-breaks", "wrap"];
|
|
1550
|
+
}
|
|
1551
|
+
if (value === "break-spaces") {
|
|
1552
|
+
[whiteSpaceCollapse, textWrapMode] = ["break-spaces", "wrap"];
|
|
1553
|
+
}
|
|
1538
1554
|
return [
|
|
1539
1555
|
{
|
|
1540
|
-
property: "
|
|
1541
|
-
value: { type: "keyword", value }
|
|
1556
|
+
property: "whiteSpaceCollapse",
|
|
1557
|
+
value: { type: "keyword", value: whiteSpaceCollapse }
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
property: "textWrapMode",
|
|
1561
|
+
value: { type: "keyword", value: textWrapMode }
|
|
1542
1562
|
}
|
|
1543
1563
|
];
|
|
1544
1564
|
};
|
|
@@ -1673,6 +1693,7 @@ var getButtonStyles = (variant, size = "default") => {
|
|
|
1673
1693
|
rounded("md"),
|
|
1674
1694
|
text("sm"),
|
|
1675
1695
|
font("medium"),
|
|
1696
|
+
text("current"),
|
|
1676
1697
|
focusVisible(
|
|
1677
1698
|
[outline("none"), ring("ring", 2, "background", 2)].flat()
|
|
1678
1699
|
),
|
|
@@ -1697,7 +1718,7 @@ var getButtonStyles = (variant, size = "default") => {
|
|
|
1697
1718
|
}
|
|
1698
1719
|
let sizeStyles = [];
|
|
1699
1720
|
if (size === "icon") {
|
|
1700
|
-
sizeStyles = [h(10), w(10)].flat();
|
|
1721
|
+
sizeStyles = [h(10), w(10), px(1.5), py(0)].flat();
|
|
1701
1722
|
}
|
|
1702
1723
|
if (size === "sm") {
|
|
1703
1724
|
sizeStyles = [h(10), px(3)].flat();
|
|
@@ -1735,23 +1756,7 @@ var metaCollapsible = {
|
|
|
1735
1756
|
{
|
|
1736
1757
|
type: "instance",
|
|
1737
1758
|
component: "Collapsible",
|
|
1738
|
-
|
|
1739
|
-
collapsibleOpen: { initialValue: false }
|
|
1740
|
-
},
|
|
1741
|
-
props: [
|
|
1742
|
-
{
|
|
1743
|
-
type: "expression",
|
|
1744
|
-
name: "open",
|
|
1745
|
-
code: "collapsibleOpen"
|
|
1746
|
-
},
|
|
1747
|
-
{
|
|
1748
|
-
name: "onOpenChange",
|
|
1749
|
-
type: "action",
|
|
1750
|
-
value: [
|
|
1751
|
-
{ type: "execute", args: ["open"], code: `collapsibleOpen = open` }
|
|
1752
|
-
]
|
|
1753
|
-
}
|
|
1754
|
-
],
|
|
1759
|
+
props: [],
|
|
1755
1760
|
children: [
|
|
1756
1761
|
{
|
|
1757
1762
|
type: "instance",
|
|
@@ -1896,23 +1901,6 @@ var metaDialog = {
|
|
|
1896
1901
|
{
|
|
1897
1902
|
type: "instance",
|
|
1898
1903
|
component: "Dialog",
|
|
1899
|
-
variables: {
|
|
1900
|
-
dialogOpen: { initialValue: false }
|
|
1901
|
-
},
|
|
1902
|
-
props: [
|
|
1903
|
-
{
|
|
1904
|
-
type: "expression",
|
|
1905
|
-
name: "open",
|
|
1906
|
-
code: "dialogOpen"
|
|
1907
|
-
},
|
|
1908
|
-
{
|
|
1909
|
-
name: "onOpenChange",
|
|
1910
|
-
type: "action",
|
|
1911
|
-
value: [
|
|
1912
|
-
{ type: "execute", args: ["open"], code: `dialogOpen = open` }
|
|
1913
|
-
]
|
|
1914
|
-
}
|
|
1915
|
-
],
|
|
1916
1904
|
children: [
|
|
1917
1905
|
{
|
|
1918
1906
|
type: "instance",
|
|
@@ -2092,23 +2080,7 @@ var meta = {
|
|
|
2092
2080
|
type: "instance",
|
|
2093
2081
|
component: "Dialog",
|
|
2094
2082
|
label: "Sheet",
|
|
2095
|
-
|
|
2096
|
-
sheetOpen: { initialValue: false }
|
|
2097
|
-
},
|
|
2098
|
-
props: [
|
|
2099
|
-
{
|
|
2100
|
-
type: "expression",
|
|
2101
|
-
name: "open",
|
|
2102
|
-
code: "sheetOpen"
|
|
2103
|
-
},
|
|
2104
|
-
{
|
|
2105
|
-
name: "onOpenChange",
|
|
2106
|
-
type: "action",
|
|
2107
|
-
value: [
|
|
2108
|
-
{ type: "execute", args: ["open"], code: `sheetOpen = open` }
|
|
2109
|
-
]
|
|
2110
|
-
}
|
|
2111
|
-
],
|
|
2083
|
+
props: [],
|
|
2112
2084
|
children: [
|
|
2113
2085
|
{
|
|
2114
2086
|
type: "instance",
|
|
@@ -2340,23 +2312,7 @@ var metaPopover = {
|
|
|
2340
2312
|
{
|
|
2341
2313
|
type: "instance",
|
|
2342
2314
|
component: "Popover",
|
|
2343
|
-
|
|
2344
|
-
popoverOpen: { initialValue: false }
|
|
2345
|
-
},
|
|
2346
|
-
props: [
|
|
2347
|
-
{
|
|
2348
|
-
type: "expression",
|
|
2349
|
-
name: "open",
|
|
2350
|
-
code: "popoverOpen"
|
|
2351
|
-
},
|
|
2352
|
-
{
|
|
2353
|
-
name: "onOpenChange",
|
|
2354
|
-
type: "action",
|
|
2355
|
-
value: [
|
|
2356
|
-
{ type: "execute", args: ["open"], code: `popoverOpen = open` }
|
|
2357
|
-
]
|
|
2358
|
-
}
|
|
2359
|
-
],
|
|
2315
|
+
props: [],
|
|
2360
2316
|
children: [
|
|
2361
2317
|
{
|
|
2362
2318
|
type: "instance",
|
|
@@ -2438,23 +2394,7 @@ var metaTooltip = {
|
|
|
2438
2394
|
{
|
|
2439
2395
|
type: "instance",
|
|
2440
2396
|
component: "Tooltip",
|
|
2441
|
-
|
|
2442
|
-
tooltipOpen: { initialValue: false }
|
|
2443
|
-
},
|
|
2444
|
-
props: [
|
|
2445
|
-
{
|
|
2446
|
-
type: "expression",
|
|
2447
|
-
name: "open",
|
|
2448
|
-
code: "tooltipOpen"
|
|
2449
|
-
},
|
|
2450
|
-
{
|
|
2451
|
-
name: "onOpenChange",
|
|
2452
|
-
type: "action",
|
|
2453
|
-
value: [
|
|
2454
|
-
{ type: "execute", args: ["open"], code: `tooltipOpen = open` }
|
|
2455
|
-
]
|
|
2456
|
-
}
|
|
2457
|
-
],
|
|
2397
|
+
props: [],
|
|
2458
2398
|
children: [
|
|
2459
2399
|
{
|
|
2460
2400
|
type: "instance",
|
|
@@ -2556,19 +2496,7 @@ var metaTabs = {
|
|
|
2556
2496
|
{
|
|
2557
2497
|
type: "instance",
|
|
2558
2498
|
component: "Tabs",
|
|
2559
|
-
|
|
2560
|
-
tabsValue: { initialValue: "0" }
|
|
2561
|
-
},
|
|
2562
|
-
props: [
|
|
2563
|
-
{ type: "expression", name: "value", code: "tabsValue" },
|
|
2564
|
-
{
|
|
2565
|
-
name: "onValueChange",
|
|
2566
|
-
type: "action",
|
|
2567
|
-
value: [
|
|
2568
|
-
{ type: "execute", args: ["value"], code: `tabsValue = value` }
|
|
2569
|
-
]
|
|
2570
|
-
}
|
|
2571
|
-
],
|
|
2499
|
+
props: [{ type: "string", name: "defaultValue", value: "0" }],
|
|
2572
2500
|
children: [
|
|
2573
2501
|
{
|
|
2574
2502
|
type: "instance",
|
|
@@ -3047,6 +2975,7 @@ var props = {
|
|
|
3047
2975
|
description: "Defines the ID of a menu element which willserve as the element's context menu."
|
|
3048
2976
|
},
|
|
3049
2977
|
datatype: { required: false, control: "text", type: "string" },
|
|
2978
|
+
defaultValue: { required: false, control: "text", type: "string" },
|
|
3050
2979
|
dir: {
|
|
3051
2980
|
required: false,
|
|
3052
2981
|
control: "text",
|
|
@@ -3325,23 +3254,9 @@ var metaAccordion = {
|
|
|
3325
3254
|
{
|
|
3326
3255
|
type: "instance",
|
|
3327
3256
|
component: "Accordion",
|
|
3328
|
-
variables: {
|
|
3329
|
-
accordionValue: { initialValue: "0" }
|
|
3330
|
-
},
|
|
3331
3257
|
props: [
|
|
3332
3258
|
{ type: "boolean", name: "collapsible", value: true },
|
|
3333
|
-
{ type: "
|
|
3334
|
-
{
|
|
3335
|
-
name: "onValueChange",
|
|
3336
|
-
type: "action",
|
|
3337
|
-
value: [
|
|
3338
|
-
{
|
|
3339
|
-
type: "execute",
|
|
3340
|
-
args: ["value"],
|
|
3341
|
-
code: `accordionValue = value`
|
|
3342
|
-
}
|
|
3343
|
-
]
|
|
3344
|
-
}
|
|
3259
|
+
{ type: "string", name: "defaultValue", value: "0" }
|
|
3345
3260
|
],
|
|
3346
3261
|
children: [
|
|
3347
3262
|
{
|
|
@@ -3747,23 +3662,7 @@ var metaNavigationMenu = {
|
|
|
3747
3662
|
{
|
|
3748
3663
|
type: "instance",
|
|
3749
3664
|
component: "NavigationMenu",
|
|
3750
|
-
|
|
3751
|
-
menuValue: { initialValue: "" }
|
|
3752
|
-
},
|
|
3753
|
-
props: [
|
|
3754
|
-
{ type: "expression", name: "value", code: "menuValue" },
|
|
3755
|
-
{
|
|
3756
|
-
name: "onValueChange",
|
|
3757
|
-
type: "action",
|
|
3758
|
-
value: [
|
|
3759
|
-
{
|
|
3760
|
-
type: "execute",
|
|
3761
|
-
args: ["value"],
|
|
3762
|
-
code: `menuValue = value`
|
|
3763
|
-
}
|
|
3764
|
-
]
|
|
3765
|
-
}
|
|
3766
|
-
],
|
|
3665
|
+
props: [],
|
|
3767
3666
|
// relative
|
|
3768
3667
|
// Omiting this: z-10 flex max-w-max flex-1 items-center justify-center
|
|
3769
3668
|
styles: [relative(), maxW("max")].flat(),
|
|
@@ -4022,8 +3921,7 @@ var metaSelect = {
|
|
|
4022
3921
|
type: "instance",
|
|
4023
3922
|
component: "Select",
|
|
4024
3923
|
variables: {
|
|
4025
|
-
selectValue: { initialValue: "" }
|
|
4026
|
-
selectOpen: { initialValue: false }
|
|
3924
|
+
selectValue: { initialValue: "" }
|
|
4027
3925
|
},
|
|
4028
3926
|
props: [
|
|
4029
3927
|
{
|
|
@@ -4037,18 +3935,6 @@ var metaSelect = {
|
|
|
4037
3935
|
value: [
|
|
4038
3936
|
{ type: "execute", args: ["value"], code: `selectValue = value` }
|
|
4039
3937
|
]
|
|
4040
|
-
},
|
|
4041
|
-
{
|
|
4042
|
-
name: "open",
|
|
4043
|
-
type: "expression",
|
|
4044
|
-
code: "selectOpen"
|
|
4045
|
-
},
|
|
4046
|
-
{
|
|
4047
|
-
name: "onOpenChange",
|
|
4048
|
-
type: "action",
|
|
4049
|
-
value: [
|
|
4050
|
-
{ type: "execute", args: ["open"], code: `selectOpen = open` }
|
|
4051
|
-
]
|
|
4052
3938
|
}
|
|
4053
3939
|
],
|
|
4054
3940
|
children: [
|