@webstudio-is/sdk-components-react-radix 0.83.0 → 0.85.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/__generated__/dialog.props.js +2120 -0
- package/lib/__generated__/popover.props.js +468 -0
- package/lib/__generated__/sheet.props.js +2159 -0
- package/lib/__generated__/tabs.props.js +1286 -0
- package/lib/__generated__/tooltip.props.js +478 -0
- package/lib/cjs/__generated__/dialog.props.js +2140 -0
- package/lib/cjs/__generated__/popover.props.js +488 -0
- package/lib/cjs/__generated__/sheet.props.js +2179 -0
- package/lib/cjs/__generated__/tabs.props.js +1306 -0
- package/lib/cjs/__generated__/tooltip.props.js +498 -0
- package/lib/cjs/collapsible.js +34 -4
- package/lib/cjs/collapsible.ws.js +14 -9
- package/lib/cjs/components.js +30 -1
- package/lib/cjs/dialog.js +57 -0
- package/lib/cjs/dialog.ws.js +311 -0
- package/lib/cjs/hooks.js +25 -0
- package/lib/cjs/metas.js +30 -1
- package/lib/cjs/popover.js +58 -0
- package/lib/cjs/popover.ws.js +141 -0
- package/lib/cjs/props.js +30 -1
- package/lib/cjs/sheet.js +63 -0
- package/lib/cjs/sheet.ws.js +317 -0
- package/lib/cjs/tabs.js +41 -0
- package/lib/cjs/tabs.ws.js +213 -0
- package/lib/cjs/theme/radix-common-types.js +16 -0
- package/lib/cjs/theme/tailwind-classes.js +547 -0
- package/lib/cjs/theme/tailwind-colors.js +35 -0
- package/lib/cjs/theme/tailwind-theme.js +46 -0
- package/lib/cjs/tooltip.js +55 -0
- package/lib/cjs/tooltip.ws.js +142 -0
- package/lib/collapsible.js +35 -7
- package/lib/collapsible.ws.js +19 -10
- package/lib/components.js +46 -1
- package/lib/dialog.js +30 -0
- package/lib/dialog.ws.js +298 -0
- package/lib/hooks.js +5 -0
- package/lib/metas.js +59 -1
- package/lib/popover.js +31 -0
- package/lib/popover.ws.js +116 -0
- package/lib/props.js +59 -1
- package/lib/sheet.js +35 -0
- package/lib/sheet.ws.js +304 -0
- package/lib/tabs.js +24 -0
- package/lib/tabs.ws.js +193 -0
- package/lib/theme/radix-common-types.js +0 -0
- package/lib/theme/tailwind-classes.js +527 -0
- package/lib/theme/tailwind-colors.js +15 -0
- package/lib/theme/tailwind-theme.js +16 -0
- package/lib/tooltip.js +28 -0
- package/lib/tooltip.ws.js +117 -0
- package/lib/types/__generated__/dialog.props.d.ts +8 -0
- package/lib/types/__generated__/popover.props.d.ts +4 -0
- package/lib/types/__generated__/sheet.props.d.ts +8 -0
- package/lib/types/__generated__/tabs.props.d.ts +5 -0
- package/lib/types/__generated__/tooltip.props.d.ts +4 -0
- package/lib/types/collapsible.d.ts +4 -3
- package/lib/types/components.d.ts +5 -0
- package/lib/types/dialog.d.ts +25 -0
- package/lib/types/dialog.ws.d.ts +23 -0
- package/lib/types/hooks.d.ts +2 -0
- package/lib/types/metas.d.ts +5 -0
- package/lib/types/popover.d.ts +21 -0
- package/lib/types/popover.ws.d.ts +15 -0
- package/lib/types/props.d.ts +5 -0
- package/lib/types/sheet.d.ts +15 -0
- package/lib/types/sheet.ws.d.ts +23 -0
- package/lib/types/tabs.d.ts +15 -0
- package/lib/types/tabs.ws.d.ts +9 -0
- package/lib/types/theme/radix-common-types.d.ts +84 -0
- package/lib/types/theme/tailwind-classes.d.ts +83 -0
- package/lib/types/theme/tailwind-colors.d.ts +21 -0
- package/lib/types/theme/tailwind-theme.d.ts +72 -0
- package/lib/types/tooltip.d.ts +21 -0
- package/lib/types/tooltip.ws.d.ts +15 -0
- package/package.json +23 -6
- package/src/__generated__/dialog.props.ts +2363 -0
- package/src/__generated__/popover.props.ts +515 -0
- package/src/__generated__/sheet.props.ts +2402 -0
- package/src/__generated__/tabs.props.ts +1434 -0
- package/src/__generated__/tooltip.props.ts +526 -0
- package/src/collapsible.stories.tsx +21 -0
- package/src/collapsible.tsx +44 -21
- package/src/collapsible.ws.ts +21 -10
- package/src/components.ts +21 -0
- package/src/dialog.tsx +66 -0
- package/src/dialog.ws.tsx +315 -0
- package/src/hooks.ts +4 -0
- package/src/metas.ts +34 -0
- package/src/popover.tsx +70 -0
- package/src/popover.ws.tsx +127 -0
- package/src/props.ts +34 -0
- package/src/sheet.stories.tsx +21 -0
- package/src/sheet.tsx +40 -0
- package/src/sheet.ws.tsx +326 -0
- package/src/tabs.stories.tsx +21 -0
- package/src/tabs.tsx +46 -0
- package/src/tabs.ws.ts +211 -0
- package/src/theme/radix-common-types.ts +495 -0
- package/src/theme/tailwind-classes.ts +695 -0
- package/src/theme/tailwind-colors.ts +45 -0
- package/src/theme/tailwind-theme.ts +24 -0
- package/src/tooltip.tsx +69 -0
- package/src/tooltip.ws.tsx +128 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Variables source:
|
|
3
|
+
* https://github.com/shadcn-ui/ui/blob/main/apps/www/registry/themes.ts#L1
|
|
4
|
+
* https://github.com/shadcn-ui/ui/blob/5e172fc34fdf015aa0d141f52cc8c082b8ae6613/apps/www/scripts/build-registry.ts#L220
|
|
5
|
+
*
|
|
6
|
+
* Attributions
|
|
7
|
+
* MIT License
|
|
8
|
+
* Copyright (c) 2023 shadcn
|
|
9
|
+
**/
|
|
10
|
+
export declare const colors: {
|
|
11
|
+
readonly transparent: "transparent";
|
|
12
|
+
readonly current: "currentColor";
|
|
13
|
+
readonly popover: "rgb(255, 255, 255)";
|
|
14
|
+
readonly popoverForeground: "rgb(2, 8, 23)";
|
|
15
|
+
readonly border: "rgb(226, 232, 240)";
|
|
16
|
+
readonly background: "rgb(255, 255, 255)";
|
|
17
|
+
readonly foreground: "hsl(222.2 84% 4.9%)";
|
|
18
|
+
readonly ring: "rgb(148, 163, 184)";
|
|
19
|
+
readonly mutedForeground: "rgb(100, 116, 139)";
|
|
20
|
+
readonly muted: "hsl(210 40% 96.1%)";
|
|
21
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { EvaluatedDefaultTheme } from "./radix-common-types";
|
|
2
|
+
export declare const theme: <T extends "height" | "maxWidth" | "width" | "colors" | "margin" | "padding" | keyof {
|
|
3
|
+
animation: Record<"none" | "spin" | "ping" | "pulse" | "bounce", string>;
|
|
4
|
+
aria: Record<"hidden" | "expanded" | "required" | "disabled" | "busy" | "checked" | "pressed" | "readonly" | "selected", string>;
|
|
5
|
+
aspectRatio: Record<"auto" | "video" | "square", string>;
|
|
6
|
+
backgroundImage: Record<"none" | "gradient-to-t" | "gradient-to-tr" | "gradient-to-r" | "gradient-to-br" | "gradient-to-b" | "gradient-to-bl" | "gradient-to-l" | "gradient-to-tl", string>;
|
|
7
|
+
backgroundPosition: Record<"top" | "center" | "right" | "bottom" | "left" | "left-bottom" | "left-top" | "right-bottom" | "right-top", string>;
|
|
8
|
+
backgroundSize: Record<"auto" | "contain" | "cover", string>;
|
|
9
|
+
blur: Record<"none" | "0" | "sm" | "DEFAULT" | "md" | "lg" | "xl" | "2xl" | "3xl", string>;
|
|
10
|
+
borderRadius: Record<"none" | "sm" | "DEFAULT" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full", string>;
|
|
11
|
+
borderWidth: Record<"0" | "2" | "4" | "8" | "DEFAULT", string>;
|
|
12
|
+
boxShadow: Record<"none" | "sm" | "DEFAULT" | "md" | "lg" | "xl" | "2xl" | "inner", string>;
|
|
13
|
+
brightness: Record<"0" | "100" | "200" | "50" | "75" | "90" | "95" | "105" | "110" | "125" | "150", string>;
|
|
14
|
+
columns: Record<"auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "3xs" | "2xs" | "xs" | "4xl" | "5xl" | "6xl" | "7xl", string>;
|
|
15
|
+
content: Record<"none", string>;
|
|
16
|
+
contrast: Record<"0" | "100" | "200" | "50" | "75" | "125" | "150", string>;
|
|
17
|
+
cursor: Record<"auto" | "none" | "progress" | "pointer" | "default" | "text" | "context-menu" | "help" | "wait" | "cell" | "crosshair" | "vertical-text" | "alias" | "copy" | "move" | "no-drop" | "not-allowed" | "e-resize" | "n-resize" | "ne-resize" | "nw-resize" | "s-resize" | "se-resize" | "sw-resize" | "w-resize" | "ew-resize" | "ns-resize" | "nesw-resize" | "nwse-resize" | "col-resize" | "row-resize" | "all-scroll" | "zoom-in" | "zoom-out" | "grab" | "grabbing", string>;
|
|
18
|
+
dropShadow: Record<"none" | "sm" | "DEFAULT" | "md" | "lg" | "xl" | "2xl", string | string[]>;
|
|
19
|
+
flex: Record<"auto" | "none" | "1" | "initial", string>;
|
|
20
|
+
flexGrow: Record<"0" | "DEFAULT", string>;
|
|
21
|
+
flexShrink: Record<"0" | "DEFAULT", string>;
|
|
22
|
+
fontFamily: Record<"serif" | "sans" | "mono", string[]>;
|
|
23
|
+
fontSize: Record<"base" | "sm" | "lg" | "xl" | "2xl" | "3xl" | "xs" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl", [string, {
|
|
24
|
+
lineHeight: string;
|
|
25
|
+
}]>;
|
|
26
|
+
fontWeight: Record<"normal" | "medium" | "black" | "bold" | "thin" | "light" | "extralight" | "semibold" | "extrabold", string>;
|
|
27
|
+
gradientColorStopPositions: Record<"0%" | "5%" | "10%" | "15%" | "20%" | "25%" | "30%" | "35%" | "40%" | "45%" | "50%" | "55%" | "60%" | "65%" | "70%" | "75%" | "80%" | "85%" | "90%" | "95%" | "100%", string>;
|
|
28
|
+
grayscale: Record<"0" | "DEFAULT", string>;
|
|
29
|
+
gridAutoColumns: Record<"fr" | "auto" | "min" | "max", string>;
|
|
30
|
+
gridAutoRows: Record<"fr" | "auto" | "min" | "max", string>;
|
|
31
|
+
gridColumn: Record<"auto" | "span-1" | "span-2" | "span-3" | "span-4" | "span-5" | "span-6" | "span-7" | "span-8" | "span-9" | "span-10" | "span-11" | "span-12" | "span-full", string>;
|
|
32
|
+
gridColumnEnd: Record<"auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13", string>;
|
|
33
|
+
gridColumnStart: Record<"auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13", string>;
|
|
34
|
+
gridRow: Record<"auto" | "span-1" | "span-2" | "span-3" | "span-4" | "span-5" | "span-6" | "span-full", string>;
|
|
35
|
+
gridRowEnd: Record<"auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7", string>;
|
|
36
|
+
gridRowStart: Record<"auto" | "1" | "2" | "3" | "4" | "5" | "6" | "7", string>;
|
|
37
|
+
gridTemplateColumns: Record<"none" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12", string>;
|
|
38
|
+
gridTemplateRows: Record<"none" | "1" | "2" | "3" | "4" | "5" | "6", string>;
|
|
39
|
+
hueRotate: Record<"0" | "15" | "90" | "30" | "60" | "180", string>;
|
|
40
|
+
invert: Record<"0" | "DEFAULT", string>;
|
|
41
|
+
letterSpacing: Record<"normal" | "tighter" | "tight" | "wide" | "wider" | "widest", string>;
|
|
42
|
+
lineHeight: Record<"normal" | "none" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "loose" | "tight" | "snug" | "relaxed", string>;
|
|
43
|
+
listStyleType: Record<"none" | "disc" | "decimal", string>;
|
|
44
|
+
listStyleImage: Record<"none", string>;
|
|
45
|
+
lineClamp: Record<"1" | "2" | "3" | "4" | "5" | "6", string>;
|
|
46
|
+
minHeight: Record<"0" | "screen" | "min" | "max" | "full" | "fit", string>;
|
|
47
|
+
minWidth: Record<"0" | "min" | "max" | "full" | "fit", string>;
|
|
48
|
+
objectPosition: Record<"top" | "center" | "right" | "bottom" | "left" | "left-bottom" | "left-top" | "right-bottom" | "right-top", string>;
|
|
49
|
+
opacity: Record<"0" | "5" | "10" | "100" | "50" | "75" | "90" | "95" | "30" | "60" | "20" | "25" | "40" | "70" | "80", string>;
|
|
50
|
+
order: Record<"none" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "first" | "last", string>;
|
|
51
|
+
outlineOffset: Record<"0" | "1" | "2" | "4" | "8", string>;
|
|
52
|
+
outlineWidth: Record<"0" | "1" | "2" | "4" | "8", string>;
|
|
53
|
+
ringOffsetWidth: Record<"0" | "1" | "2" | "4" | "8", string>;
|
|
54
|
+
ringWidth: Record<"0" | "1" | "2" | "4" | "8" | "DEFAULT", string>;
|
|
55
|
+
rotate: Record<"0" | "1" | "2" | "3" | "6" | "12" | "90" | "180" | "45", string>;
|
|
56
|
+
saturate: Record<"0" | "100" | "200" | "50" | "150", string>;
|
|
57
|
+
scale: Record<"0" | "100" | "50" | "75" | "90" | "95" | "105" | "110" | "125" | "150", string>;
|
|
58
|
+
screens: Record<"sm" | "md" | "lg" | "xl" | "2xl", string>;
|
|
59
|
+
sepia: Record<"0" | "DEFAULT", string>;
|
|
60
|
+
skew: Record<"0" | "1" | "2" | "3" | "6" | "12", string>;
|
|
61
|
+
spacing: Record<"px" | "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "60" | "20" | "40" | "80" | "24" | "28" | "32" | "36" | "44" | "48" | "52" | "56" | "64" | "72" | "96" | "0.5" | "1.5" | "2.5" | "3.5", string>;
|
|
62
|
+
strokeWidth: Record<"0" | "1" | "2", string>;
|
|
63
|
+
textDecorationThickness: Record<"auto" | "0" | "1" | "2" | "4" | "8" | "from-font", string>;
|
|
64
|
+
textUnderlineOffset: Record<"auto" | "0" | "1" | "2" | "4" | "8", string>;
|
|
65
|
+
transformOrigin: Record<"top" | "center" | "right" | "bottom" | "left" | "top-right" | "bottom-right" | "bottom-left" | "top-left", string>;
|
|
66
|
+
transitionDelay: Record<"0" | "100" | "200" | "300" | "500" | "700" | "75" | "150" | "1000", string>;
|
|
67
|
+
transitionDuration: Record<"0" | "100" | "200" | "300" | "500" | "700" | "DEFAULT" | "75" | "150" | "1000", string>;
|
|
68
|
+
transitionProperty: Record<"none" | "all" | "opacity" | "transform" | "DEFAULT" | "colors" | "shadow", string>;
|
|
69
|
+
transitionTimingFunction: Record<"in" | "linear" | "DEFAULT" | "out" | "in-out", string>;
|
|
70
|
+
willChange: Record<"auto" | "scroll" | "transform" | "contents", string>;
|
|
71
|
+
zIndex: Record<"auto" | "0" | "10" | "50" | "30" | "20" | "40", string>;
|
|
72
|
+
}>(name: T) => EvaluatedDefaultTheme[T];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* We don't have support for boolean or undefined nor in UI not at Data variables,
|
|
5
|
+
* instead of binding on "open" prop we bind variable on a isOpen prop to be able to show Tooltip in the builder
|
|
6
|
+
**/
|
|
7
|
+
type BuilderTooltipProps = {
|
|
8
|
+
isOpen: "initial" | "open" | "closed";
|
|
9
|
+
};
|
|
10
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipPrimitive.TooltipProps & BuilderTooltipProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
/**
|
|
12
|
+
* We're not exposing the 'asChild' property for the Trigger.
|
|
13
|
+
* Instead, we're enforcing 'asChild=true' for the Trigger and making it style-less.
|
|
14
|
+
* This avoids situations where the Trigger inadvertently passes all styles to its child,
|
|
15
|
+
* which would prevent us from displaying styles properly in the builder.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export declare const TooltipContent: import("react").ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type WsComponentMeta, type WsComponentPropsMeta } from "@webstudio-is/react-sdk";
|
|
2
|
+
export declare const metaTooltipTrigger: WsComponentMeta;
|
|
3
|
+
export declare const metaTooltipContent: WsComponentMeta;
|
|
4
|
+
/**
|
|
5
|
+
* Styles source without animations:
|
|
6
|
+
* https://github.com/shadcn-ui/ui/blob/main/apps/www/registry/default/ui/tooltip.tsx
|
|
7
|
+
*
|
|
8
|
+
* Attributions
|
|
9
|
+
* MIT License
|
|
10
|
+
* Copyright (c) 2023 shadcn
|
|
11
|
+
**/
|
|
12
|
+
export declare const metaTooltip: WsComponentMeta;
|
|
13
|
+
export declare const propsMetaTooltip: WsComponentPropsMeta;
|
|
14
|
+
export declare const propsMetaTooltipTrigger: WsComponentPropsMeta;
|
|
15
|
+
export declare const propsMetaTooltipContent: WsComponentPropsMeta;
|
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.85.0",
|
|
4
4
|
"description": "Webstudio wrapper for radix library",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
"types": "./lib/types/props.d.ts",
|
|
31
31
|
"import": "./lib/props.js",
|
|
32
32
|
"require": "./lib/cjs/props.js"
|
|
33
|
+
},
|
|
34
|
+
"./hooks": {
|
|
35
|
+
"source": "./src/hooks.ts",
|
|
36
|
+
"types": "./lib/types/hooks.d.ts",
|
|
37
|
+
"import": "./lib/hooks.js",
|
|
38
|
+
"require": "./lib/cjs/hooks.js"
|
|
33
39
|
}
|
|
34
40
|
},
|
|
35
41
|
"peerDependencies": {
|
|
@@ -38,18 +44,27 @@
|
|
|
38
44
|
},
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"@radix-ui/react-collapsible": "^1.0.3",
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
47
|
+
"@radix-ui/react-dialog": "^1.0.4",
|
|
48
|
+
"@radix-ui/react-popover": "^1.0.6",
|
|
49
|
+
"@radix-ui/react-tabs": "^1.0.4",
|
|
50
|
+
"@radix-ui/react-tooltip": "^1.0.6",
|
|
51
|
+
"tailwindcss": "^3.3.3",
|
|
52
|
+
"@webstudio-is/generate-arg-types": "^0.85.0",
|
|
53
|
+
"@webstudio-is/icons": "^0.85.0",
|
|
54
|
+
"@webstudio-is/css-data": "^0.85.0",
|
|
55
|
+
"@webstudio-is/react-sdk": "^0.85.0"
|
|
44
56
|
},
|
|
45
57
|
"devDependencies": {
|
|
58
|
+
"@storybook/react": "^7.2.1",
|
|
46
59
|
"@types/react": "^18.2.16",
|
|
47
60
|
"@types/react-dom": "^18.2.7",
|
|
48
61
|
"react": "^18.2.0",
|
|
49
62
|
"react-dom": "^18.2.0",
|
|
50
63
|
"typescript": "^5.1.6",
|
|
51
64
|
"@webstudio-is/scripts": "^0.0.0",
|
|
52
|
-
"@webstudio-is/
|
|
65
|
+
"@webstudio-is/sdk-components-react": "^0.85.0",
|
|
66
|
+
"@webstudio-is/storybook-config": "^0.0.0",
|
|
67
|
+
"@webstudio-is/tsconfig": "^1.0.7"
|
|
53
68
|
},
|
|
54
69
|
"scripts": {
|
|
55
70
|
"dev": "build-package --watch",
|
|
@@ -57,6 +72,8 @@
|
|
|
57
72
|
"build:args": "generate-arg-types './src/*.tsx !./src/*.stories.tsx !./src/*.ws.tsx' && prettier --write \"**/*.props.ts\"",
|
|
58
73
|
"dts": "tsc --project tsconfig.dts.json",
|
|
59
74
|
"typecheck": "tsc",
|
|
60
|
-
"checks": "pnpm typecheck"
|
|
75
|
+
"checks": "pnpm typecheck",
|
|
76
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
77
|
+
"storybook:build": "storybook build"
|
|
61
78
|
}
|
|
62
79
|
}
|