rw-elements-tools 1.2.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/LICENSE +22 -0
- package/README.md +1333 -0
- package/bin/cli.js +213 -0
- package/build-properties.js +654 -0
- package/build-shared-hooks.js +253 -0
- package/config.js +148 -0
- package/controls/Animations/AnimationEffects.js +111 -0
- package/controls/Animations/AnimationSettings.js +437 -0
- package/controls/Animations/Reveals.js +168 -0
- package/controls/Animations/ScrollAnimation_Opacity.js +15 -0
- package/controls/Animations/ScrollAnimation_Rotate.js +17 -0
- package/controls/Animations/ScrollAnimation_Scale.js +18 -0
- package/controls/Animations/ScrollAnimation_Translate.js +31 -0
- package/controls/Background/Background.js +66 -0
- package/controls/Background/BackgroundButton.js +69 -0
- package/controls/Background/BackgroundColor.js +28 -0
- package/controls/Background/BackgroundContainer.js +73 -0
- package/controls/Background/BackgroundGradient.js +149 -0
- package/controls/Background/BackgroundImage.js +108 -0
- package/controls/Background/BackgroundOnlyColor.js +53 -0
- package/controls/Background/BackgroundTransparent.js +66 -0
- package/controls/Background/BackgroundVideo.js +9 -0
- package/controls/Background/Color.js +52 -0
- package/controls/Background/Gradient.js +263 -0
- package/controls/Background/GradientContainer.js +263 -0
- package/controls/Background/Image.js +269 -0
- package/controls/Background/Image_CMS.js +305 -0
- package/controls/Background/SVG.js +235 -0
- package/controls/Background/Video.js +29 -0
- package/controls/Borders/Border.js +114 -0
- package/controls/Borders/BorderColor.js +25 -0
- package/controls/Borders/BorderRadius.js +19 -0
- package/controls/Borders/BorderStyle.js +26 -0
- package/controls/Borders/BorderWidth.js +20 -0
- package/controls/Borders/Borders.js +69 -0
- package/controls/Borders/BordersContainer.js +90 -0
- package/controls/Borders/BordersInput.js +107 -0
- package/controls/Borders/Outline.js +100 -0
- package/controls/Borders/OutlineColor.js +25 -0
- package/controls/Borders/OutlineOffset.js +13 -0
- package/controls/Borders/OutlineStyle.js +26 -0
- package/controls/Borders/OutlineWidth.js +13 -0
- package/controls/Effects/BackdropBlur.js +11 -0
- package/controls/Effects/Blur.js +11 -0
- package/controls/Effects/BoxShadow.js +15 -0
- package/controls/Effects/Brightness.js +11 -0
- package/controls/Effects/DropShadow.js +14 -0
- package/controls/Effects/Effects.js +71 -0
- package/controls/Effects/Filters.js +114 -0
- package/controls/Effects/Opacity.js +14 -0
- package/controls/Effects/Saturate.js +11 -0
- package/controls/Layout/AspectRatio.js +53 -0
- package/controls/Layout/Container.js +24 -0
- package/controls/Layout/Hidden.js +9 -0
- package/controls/Layout/Inset.js +15 -0
- package/controls/Layout/Isolation.js +25 -0
- package/controls/Layout/Layout.js +38 -0
- package/controls/Layout/Overflow.js +33 -0
- package/controls/Layout/Position.js +37 -0
- package/controls/Layout/TopRightBottomLeft.js +90 -0
- package/controls/Layout/Visibility.js +25 -0
- package/controls/Layout/ZIndex.js +36 -0
- package/controls/Overlay/Color.js +52 -0
- package/controls/Overlay/Gradient.js +298 -0
- package/controls/Overlay/Image.js +226 -0
- package/controls/Overlay/Overlay.js +66 -0
- package/controls/Sizing/Height.js +18 -0
- package/controls/Sizing/MaxHeight.js +17 -0
- package/controls/Sizing/MaxWidth.js +17 -0
- package/controls/Sizing/MinHeight.js +18 -0
- package/controls/Sizing/MinWidth.js +18 -0
- package/controls/Sizing/Sizing.js +66 -0
- package/controls/Sizing/SizingContainer.js +122 -0
- package/controls/Sizing/SizingImage.js +75 -0
- package/controls/Sizing/SizingInput.js +71 -0
- package/controls/Sizing/SizingSVG.js +74 -0
- package/controls/Sizing/Width.js +18 -0
- package/controls/Spacing/Margin.js +17 -0
- package/controls/Spacing/Padding.js +17 -0
- package/controls/Spacing/Spacing.js +23 -0
- package/controls/Spacing/SpacingButton.js +42 -0
- package/controls/Spacing/SpacingContainer.js +32 -0
- package/controls/Spacing/SpacingInput.js +42 -0
- package/controls/Transforms/Rotate.js +13 -0
- package/controls/Transforms/Scale.js +13 -0
- package/controls/Transforms/Skew.js +25 -0
- package/controls/Transforms/TransformOrigin.js +12 -0
- package/controls/Transforms/Transforms.js +98 -0
- package/controls/Transforms/Translate.js +26 -0
- package/controls/Transitions/Delay.js +13 -0
- package/controls/Transitions/Duration.js +13 -0
- package/controls/Transitions/Property.js +42 -0
- package/controls/Transitions/TimingFunction.js +44 -0
- package/controls/Transitions/Transitions.js +20 -0
- package/controls/alignment/AlignContent.js +48 -0
- package/controls/alignment/AlignItems.js +64 -0
- package/controls/alignment/AlignSelf.js +34 -0
- package/controls/alignment/JustifyContent.js +44 -0
- package/controls/alignment/JustifyItems.js +32 -0
- package/controls/alignment/JustifySelf.js +34 -0
- package/controls/core/CSSClasses.js +11 -0
- package/controls/core/ControlType.js +25 -0
- package/controls/core/HTMLTag.js +80 -0
- package/controls/core/HoverGroup.js +38 -0
- package/controls/core/ID.js +12 -0
- package/controls/core/Image.js +95 -0
- package/controls/core/MenuItem.js +187 -0
- package/controls/core/ObjectFit.js +32 -0
- package/controls/core/ObjectPosition.js +65 -0
- package/controls/grid-flex/ActAsGridOrFlexItem.js +54 -0
- package/controls/grid-flex/ColEnd.js +28 -0
- package/controls/grid-flex/ColStart.js +27 -0
- package/controls/grid-flex/Columns.js +38 -0
- package/controls/grid-flex/FlexDirection.js +27 -0
- package/controls/grid-flex/FlexItem.js +106 -0
- package/controls/grid-flex/GridItem.js +41 -0
- package/controls/grid-flex/Order.js +45 -0
- package/controls/grid-flex/RowEnd.js +28 -0
- package/controls/grid-flex/RowStart.js +27 -0
- package/controls/grid-flex/Rows.js +38 -0
- package/controls/index.js +187 -0
- package/controls/interactive/ButtonFontAndTextStyles.js +208 -0
- package/controls/interactive/Filter.js +54 -0
- package/controls/interactive/InputFontAndTextStyles.js +156 -0
- package/controls/interactive/Link.js +13 -0
- package/controls/typography/HeadingColor.js +112 -0
- package/controls/typography/TextColor.js +51 -0
- package/controls/typography/TextDecoration.js +99 -0
- package/controls/typography/TextFontsAndTextStyles.js +243 -0
- package/controls/typography/TextSimple.js +55 -0
- package/controls/typography/TextStyles.js +55 -0
- package/controls/typography/Typography.js +13 -0
- package/index.js +19 -0
- package/package.json +55 -0
- package/properties/BackgroundType.js +18 -0
- package/properties/ButtonSize.js +19 -0
- package/properties/ContainerHeights.js +23 -0
- package/properties/ContainerWidths.js +27 -0
- package/properties/FontWeight.js +16 -0
- package/properties/GradientDirection.js +39 -0
- package/properties/LetterSpacing.js +13 -0
- package/properties/LineHeight.js +13 -0
- package/properties/RevealAnimations.js +12 -0
- package/properties/Slider.js +10 -0
- package/properties/TextAlign.js +23 -0
- package/properties/TransformOrigins.js +43 -0
- package/properties/TransitionNames.js +20 -0
- package/properties/index.js +13 -0
- package/shared-hooks/animations/globalAnimations.js +141 -0
- package/shared-hooks/animations/globalReveal.js +48 -0
- package/shared-hooks/background/globalBackground.js +306 -0
- package/shared-hooks/background/globalBgImageFetchPriority.js +34 -0
- package/shared-hooks/borders/globalBorders.js +85 -0
- package/shared-hooks/borders/globalOutline.js +39 -0
- package/shared-hooks/core/addPrefixToTailwindClasses.js +24 -0
- package/shared-hooks/core/advancedClasses.js +5 -0
- package/shared-hooks/core/classnames.js +92 -0
- package/shared-hooks/core/getHoverPrefix.js +21 -0
- package/shared-hooks/core/globalHTMLTag.js +17 -0
- package/shared-hooks/core/injectPrefixOnDarkModeColors.js +6 -0
- package/shared-hooks/effects/globalEffects.js +45 -0
- package/shared-hooks/effects/globalFilters.js +80 -0
- package/shared-hooks/effects/globalOverlay.js +166 -0
- package/shared-hooks/interactive/globalFilter.js +24 -0
- package/shared-hooks/interactive/globalLink.js +23 -0
- package/shared-hooks/layout/globalActAsGridOrFlexItem.js +66 -0
- package/shared-hooks/layout/globalLayout.js +50 -0
- package/shared-hooks/navigation/globalMenuItem.js +35 -0
- package/shared-hooks/navigation/globalNavItems.js +60 -0
- package/shared-hooks/navigation/globalNavTitle.js +23 -0
- package/shared-hooks/sizing/aspectRatioClasses.js +20 -0
- package/shared-hooks/sizing/globalSizing.js +19 -0
- package/shared-hooks/sizing/globalSizingContainer.js +40 -0
- package/shared-hooks/sizing/objectClasses.js +9 -0
- package/shared-hooks/spacing/globalSpacing.js +13 -0
- package/shared-hooks/spacing/globalSpacingMargin.js +11 -0
- package/shared-hooks/spacing/globalSpacingPadding.js +11 -0
- package/shared-hooks/transforms/globalTransforms.js +78 -0
- package/shared-hooks/transitions/getAlpineTransitionAttributesDesktop.js +111 -0
- package/shared-hooks/transitions/getAlpineTransitionAttributesMobile.js +110 -0
- package/shared-hooks/transitions/globalTransitions.js +48 -0
- package/shared-hooks/typography/globalButtonFontAndTextStyles.js +65 -0
- package/shared-hooks/typography/globalHeadingColor.js +69 -0
- package/shared-hooks/typography/globalInputFontAndTextStyles.js +40 -0
- package/shared-hooks/typography/globalTextFontsAndTextStyles.js +47 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const globalTransforms = (app, args = {}) => {
|
|
2
|
+
const {
|
|
3
|
+
globalControlTypeTransforms: type,
|
|
4
|
+
globalHoverGroupTransforms: hoverGroup,
|
|
5
|
+
globalHoverGroupCustomIdTransforms: customId,
|
|
6
|
+
globalTransformsApplyTo: applyTo,
|
|
7
|
+
globalTransformOrigin: origin,
|
|
8
|
+
globalTransformScale: scale,
|
|
9
|
+
globalTransformRotate: rotate,
|
|
10
|
+
globalTransformSkewX: skewX,
|
|
11
|
+
globalTransformSkewY: skewY,
|
|
12
|
+
globalTransformTranslateX: translateX,
|
|
13
|
+
globalTransformTranslateY: translateY,
|
|
14
|
+
globalTransformScaleEnd: scaleEnd,
|
|
15
|
+
globalTransformRotateEnd: rotateEnd,
|
|
16
|
+
globalTransformSkewXEnd: skewXEnd,
|
|
17
|
+
globalTransformSkewYEnd: skewYEnd,
|
|
18
|
+
globalTransformTranslateXEnd: translateXEnd,
|
|
19
|
+
globalTransformTranslateYEnd: translateYEnd,
|
|
20
|
+
} = app.props;
|
|
21
|
+
|
|
22
|
+
const { node } = app;
|
|
23
|
+
|
|
24
|
+
node.isContainer = args.isContainer || false;
|
|
25
|
+
const wantsActive = args.active || false;
|
|
26
|
+
const wantsFocus = args.focus || false;
|
|
27
|
+
|
|
28
|
+
const prefix = getHoverPrefix(node, applyTo, hoverGroup, customId);
|
|
29
|
+
const classes = classnames();
|
|
30
|
+
|
|
31
|
+
if (type != "none") {
|
|
32
|
+
classes.add([
|
|
33
|
+
"transform",
|
|
34
|
+
origin,
|
|
35
|
+
scale,
|
|
36
|
+
rotate,
|
|
37
|
+
skewX,
|
|
38
|
+
skewY,
|
|
39
|
+
translateX,
|
|
40
|
+
translateY,
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (type == "hover") {
|
|
45
|
+
classes.add([
|
|
46
|
+
addPrefixToTailwindClasses(scaleEnd, prefix),
|
|
47
|
+
addPrefixToTailwindClasses(rotateEnd, prefix),
|
|
48
|
+
addPrefixToTailwindClasses(skewXEnd, prefix),
|
|
49
|
+
addPrefixToTailwindClasses(skewYEnd, prefix),
|
|
50
|
+
addPrefixToTailwindClasses(translateXEnd, prefix),
|
|
51
|
+
addPrefixToTailwindClasses(translateYEnd, prefix),
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
if (wantsActive) {
|
|
55
|
+
classes.add([
|
|
56
|
+
`data-[active=true]:${scaleEnd}`,
|
|
57
|
+
`data-[active=true]:${rotateEnd}`,
|
|
58
|
+
`data-[active=true]:${skewXEnd}`,
|
|
59
|
+
`data-[active=true]:${skewYEnd}`,
|
|
60
|
+
`data-[active=true]:${translateXEnd}`,
|
|
61
|
+
`data-[active=true]:${translateYEnd}`,
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (wantsFocus) {
|
|
66
|
+
classes.add([
|
|
67
|
+
`${prefix.replace(/hover/g, "focus")}:${scaleEnd}`,
|
|
68
|
+
`${prefix.replace(/hover/g, "focus")}:${rotateEnd}`,
|
|
69
|
+
`${prefix.replace(/hover/g, "focus")}:${skewXEnd}`,
|
|
70
|
+
`${prefix.replace(/hover/g, "focus")}:${skewYEnd}`,
|
|
71
|
+
`${prefix.replace(/hover/g, "focus")}:${translateXEnd}`,
|
|
72
|
+
`${prefix.replace(/hover/g, "focus")}:${translateYEnd}`,
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return classes.toString();
|
|
78
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const alpineTransitionsDesktop = {
|
|
2
|
+
fade: {
|
|
3
|
+
enter: "transition ease-out",
|
|
4
|
+
enterStart: "opacity-0",
|
|
5
|
+
enterEnd: "opacity-100",
|
|
6
|
+
leave: "transition ease-in",
|
|
7
|
+
leaveStart: "opacity-100",
|
|
8
|
+
leaveEnd: "opacity-0",
|
|
9
|
+
},
|
|
10
|
+
slideDown: {
|
|
11
|
+
enter: "transition ease-out duration-300",
|
|
12
|
+
enterStart: "opacity-0 -translate-y-3",
|
|
13
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
14
|
+
leave: "transition ease-in duration-300",
|
|
15
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
16
|
+
leaveEnd: "opacity-0 -translate-y-3",
|
|
17
|
+
},
|
|
18
|
+
slideDownShort: {
|
|
19
|
+
enter: "transition ease-out",
|
|
20
|
+
enterStart: "opacity-0 -translate-y-3",
|
|
21
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
22
|
+
leave: "transition ease-in",
|
|
23
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
24
|
+
leaveEnd: "opacity-0 -translate-y-3",
|
|
25
|
+
},
|
|
26
|
+
slideUp: {
|
|
27
|
+
enter: "transition ease-out duration-300",
|
|
28
|
+
enterStart: "opacity-0 translate-y-3",
|
|
29
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
30
|
+
leave: "transition ease-in duration-300",
|
|
31
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
32
|
+
leaveEnd: "opacity-0 translate-y-3",
|
|
33
|
+
},
|
|
34
|
+
slideUpShort: {
|
|
35
|
+
enter: "transition ease-out",
|
|
36
|
+
enterStart: "opacity-0 translate-y-3",
|
|
37
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
38
|
+
leave: "transition ease-in",
|
|
39
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
40
|
+
leaveEnd: "opacity-0 translate-y-3",
|
|
41
|
+
},
|
|
42
|
+
slideLeft: {
|
|
43
|
+
enter: "transition ease-out duration-300",
|
|
44
|
+
enterStart: "opacity-0 -translate-x-3",
|
|
45
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
46
|
+
leave: "transition ease-in duration-300",
|
|
47
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
48
|
+
leaveEnd: "opacity-0 -translate-x-3",
|
|
49
|
+
},
|
|
50
|
+
slideLeftShort: {
|
|
51
|
+
enter: "transition ease-out",
|
|
52
|
+
enterStart: "opacity-0 translate-x-3",
|
|
53
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
54
|
+
leave: "transition ease-in",
|
|
55
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
56
|
+
leaveEnd: "opacity-0 translate-x-3",
|
|
57
|
+
},
|
|
58
|
+
slideRight: {
|
|
59
|
+
enter: "transition ease-out duration-300",
|
|
60
|
+
enterStart: "opacity-0 -translate-x-3",
|
|
61
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
62
|
+
leave: "transition ease-in duration-300",
|
|
63
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
64
|
+
leaveEnd: "opacity-0 -translate-x-3",
|
|
65
|
+
},
|
|
66
|
+
slideRightShort: {
|
|
67
|
+
enter: "transition ease-out",
|
|
68
|
+
enterStart: "opacity-0 -translate-x-3",
|
|
69
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
70
|
+
leave: "transition ease-in",
|
|
71
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
72
|
+
leaveEnd: "opacity-0 -translate-x-3",
|
|
73
|
+
},
|
|
74
|
+
zoom: {
|
|
75
|
+
enter: "transition ease-out",
|
|
76
|
+
enterStart: "opacity-0 scale-95",
|
|
77
|
+
enterEnd: "opacity-100 scale-100",
|
|
78
|
+
leave: "transition ease-in",
|
|
79
|
+
leaveStart: "opacity-100 scale-100",
|
|
80
|
+
leaveEnd: "opacity-0 scale-95",
|
|
81
|
+
},
|
|
82
|
+
none: {
|
|
83
|
+
enter: "duration-0",
|
|
84
|
+
enterStart: "",
|
|
85
|
+
enterEnd: "",
|
|
86
|
+
leave: "duration-0",
|
|
87
|
+
leaveStart: "",
|
|
88
|
+
leaveEnd: "",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const getAlpineTransitionAttributesDesktop = (transitionName) => {
|
|
93
|
+
const { enter, enterStart, enterEnd, leave, leaveStart, leaveEnd } =
|
|
94
|
+
alpineTransitionsDesktop[transitionName] ||
|
|
95
|
+
alpineTransitionsDesktop.fade;
|
|
96
|
+
|
|
97
|
+
const attributes = {
|
|
98
|
+
"x-transition:enter": enter,
|
|
99
|
+
"x-transition:enter-start": enterStart,
|
|
100
|
+
"x-transition:enter-end": enterEnd,
|
|
101
|
+
"x-transition:leave": leave,
|
|
102
|
+
"x-transition:leave-start": leaveStart,
|
|
103
|
+
"x-transition:leave-end": leaveEnd,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return Object.entries(attributes)
|
|
107
|
+
.filter(([key, value]) => value)
|
|
108
|
+
.map(([key, value]) => `${key}="${value}"`)
|
|
109
|
+
.join(" ");
|
|
110
|
+
};
|
|
111
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
const alpineTransitionsMobile = {
|
|
2
|
+
fade: {
|
|
3
|
+
enter: "transition ease-out",
|
|
4
|
+
enterStart: "opacity-0",
|
|
5
|
+
enterEnd: "opacity-100",
|
|
6
|
+
leave: "transition ease-in",
|
|
7
|
+
leaveStart: "opacity-100",
|
|
8
|
+
leaveEnd: "opacity-0",
|
|
9
|
+
},
|
|
10
|
+
slideDown: {
|
|
11
|
+
enter: "transition ease-out",
|
|
12
|
+
enterStart: "opacity-0 -translate-y-full",
|
|
13
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
14
|
+
leave: "transition ease-in",
|
|
15
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
16
|
+
leaveEnd: "opacity-0 -translate-y-full",
|
|
17
|
+
},
|
|
18
|
+
slideDownShort: {
|
|
19
|
+
enter: "transition ease-out",
|
|
20
|
+
enterStart: "opacity-0 -translate-y-3",
|
|
21
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
22
|
+
leave: "transition ease-in",
|
|
23
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
24
|
+
leaveEnd: "opacity-0 -translate-y-3",
|
|
25
|
+
},
|
|
26
|
+
slideUp: {
|
|
27
|
+
enter: "transition ease-out",
|
|
28
|
+
enterStart: "opacity-0 translate-y-full",
|
|
29
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
30
|
+
leave: "transition ease-in",
|
|
31
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
32
|
+
leaveEnd: "opacity-0 translate-y-full",
|
|
33
|
+
},
|
|
34
|
+
slideUpShort: {
|
|
35
|
+
enter: "transition ease-out",
|
|
36
|
+
enterStart: "opacity-0 translate-y-3",
|
|
37
|
+
enterEnd: "opacity-100 translate-y-0",
|
|
38
|
+
leave: "transition ease-in",
|
|
39
|
+
leaveStart: "opacity-100 translate-y-0",
|
|
40
|
+
leaveEnd: "opacity-0 translate-y-3",
|
|
41
|
+
},
|
|
42
|
+
slideLeft: {
|
|
43
|
+
enter: "transition ease-out",
|
|
44
|
+
enterStart: "opacity-0 translate-x-full",
|
|
45
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
46
|
+
leave: "transition ease-in",
|
|
47
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
48
|
+
leaveEnd: "opacity-0 translate-x-full",
|
|
49
|
+
},
|
|
50
|
+
slideLeftShort: {
|
|
51
|
+
enter: "transition ease-out",
|
|
52
|
+
enterStart: "opacity-0 translate-x-3",
|
|
53
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
54
|
+
leave: "transition ease-in",
|
|
55
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
56
|
+
leaveEnd: "opacity-0 translate-x-3",
|
|
57
|
+
},
|
|
58
|
+
slideRight: {
|
|
59
|
+
enter: "transition ease-out",
|
|
60
|
+
enterStart: "opacity-0 -translate-x-full",
|
|
61
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
62
|
+
leave: "transition ease-in",
|
|
63
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
64
|
+
leaveEnd: "opacity-0 -translate-x-full",
|
|
65
|
+
},
|
|
66
|
+
slideRightShort: {
|
|
67
|
+
enter: "transition ease-out",
|
|
68
|
+
enterStart: "opacity-0 -translate-x-3",
|
|
69
|
+
enterEnd: "opacity-100 translate-x-0",
|
|
70
|
+
leave: "transition ease-in",
|
|
71
|
+
leaveStart: "opacity-100 translate-x-0",
|
|
72
|
+
leaveEnd: "opacity-0 -translate-x-3",
|
|
73
|
+
},
|
|
74
|
+
zoom: {
|
|
75
|
+
enter: "transition ease-out",
|
|
76
|
+
enterStart: "opacity-0 scale-95",
|
|
77
|
+
enterEnd: "opacity-100 scale-100",
|
|
78
|
+
leave: "transition ease-in",
|
|
79
|
+
leaveStart: "opacity-100 scale-100",
|
|
80
|
+
leaveEnd: "opacity-0 scale-95",
|
|
81
|
+
},
|
|
82
|
+
none: {
|
|
83
|
+
enter: "duration-0",
|
|
84
|
+
enterStart: "",
|
|
85
|
+
enterEnd: "",
|
|
86
|
+
leave: "duration-0",
|
|
87
|
+
leaveStart: "",
|
|
88
|
+
leaveEnd: "",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const getAlpineTransitionAttributesMobile = (transitionName) => {
|
|
93
|
+
const { enter, enterStart, enterEnd, leave, leaveStart, leaveEnd } =
|
|
94
|
+
alpineTransitionsMobile[transitionName] || alpineTransitionsMobile.fade;
|
|
95
|
+
|
|
96
|
+
const attributes = {
|
|
97
|
+
"x-transition:enter": enter,
|
|
98
|
+
"x-transition:enter-start": enterStart,
|
|
99
|
+
"x-transition:enter-end": enterEnd,
|
|
100
|
+
"x-transition:leave": leave,
|
|
101
|
+
"x-transition:leave-start": leaveStart,
|
|
102
|
+
"x-transition:leave-end": leaveEnd,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
return Object.entries(attributes)
|
|
106
|
+
.filter(([key, value]) => value)
|
|
107
|
+
.map(([key, value]) => `${key}="${value}"`)
|
|
108
|
+
.join(" ");
|
|
109
|
+
};
|
|
110
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const globalTransitions = (app, alwaysWantsHover = false) => {
|
|
2
|
+
const {
|
|
3
|
+
globalControlTypeTransforms,
|
|
4
|
+
globalControlTypeEffects,
|
|
5
|
+
globalControlTypeFilters,
|
|
6
|
+
globalFilterEnable,
|
|
7
|
+
globalControlTypeBorders,
|
|
8
|
+
globalControlTypeBg,
|
|
9
|
+
globalControlTypeOverlay,
|
|
10
|
+
globalControlTypeSVGFill,
|
|
11
|
+
globalControlTypeSVGStroke,
|
|
12
|
+
globalControlTypeOutline,
|
|
13
|
+
globalTransitionsProperty: property,
|
|
14
|
+
globalTransitionsDuration: duration,
|
|
15
|
+
globalTransitionsDelay: delay,
|
|
16
|
+
globalTransitionsTimingFunction: timingFunction,
|
|
17
|
+
globalTransitionsTimingFunctionCustom: customTimingFunction,
|
|
18
|
+
} = app.props;
|
|
19
|
+
|
|
20
|
+
const customTimingFunctionFormatted = customTimingFunction?.replace(/,\s/g, ',_');
|
|
21
|
+
|
|
22
|
+
const aControlWantsHover = () => {
|
|
23
|
+
return alwaysWantsHover || globalFilterEnable || [
|
|
24
|
+
globalControlTypeTransforms,
|
|
25
|
+
globalControlTypeEffects,
|
|
26
|
+
globalControlTypeFilters,
|
|
27
|
+
globalControlTypeBorders,
|
|
28
|
+
globalControlTypeBg,
|
|
29
|
+
globalControlTypeSVGFill,
|
|
30
|
+
globalControlTypeSVGStroke,
|
|
31
|
+
globalControlTypeOverlay,
|
|
32
|
+
globalControlTypeOutline,
|
|
33
|
+
].some(prop => {
|
|
34
|
+
const validValues = ['none', 'static', '', undefined, null];
|
|
35
|
+
return !validValues.includes(prop);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return aControlWantsHover()
|
|
40
|
+
? classnames([
|
|
41
|
+
// `transform-gpu will-change-transform`,
|
|
42
|
+
property === 'transition-default' ? 'transition' : property,
|
|
43
|
+
duration,
|
|
44
|
+
delay,
|
|
45
|
+
timingFunction === 'custom' ? customTimingFunctionFormatted : timingFunction,
|
|
46
|
+
]).toString()
|
|
47
|
+
: '';
|
|
48
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates border classes based on props.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} props - The properties object containing style definitions.
|
|
5
|
+
* @returns {string} The generated class string.
|
|
6
|
+
*/
|
|
7
|
+
const globalButtonFontAndTextStyles = (rw, args = {}) => {
|
|
8
|
+
const {
|
|
9
|
+
globalButtonFontAndTextStylesTextAlign,
|
|
10
|
+
globalButtonFontAndTextStylesColor,
|
|
11
|
+
globalButtonFontAndTextStylesColorOpacity,
|
|
12
|
+
globalButtonFontAndTextStylesFont,
|
|
13
|
+
globalButtonFontAndTextStylesFontSize,
|
|
14
|
+
globalButtonFontAndTextStylesTextShadow,
|
|
15
|
+
globalButtonFontAndTextStylesFontWeight,
|
|
16
|
+
globalButtonFontAndTextStylesLineHeight,
|
|
17
|
+
globalButtonFontAndTextStylesLetterSpacing,
|
|
18
|
+
globalButtonFontAndTextStylesItalic,
|
|
19
|
+
globalButtonFontAndTextStylesUnderline,
|
|
20
|
+
globalButtonFontAndTextStylesTextTransform,
|
|
21
|
+
globalButtonFontAndTextStylesColorHover,
|
|
22
|
+
globalButtonFontAndTextStylesColorOpacityHover,
|
|
23
|
+
globalButtonFontAndTextStylesTextShadowHover,
|
|
24
|
+
} = rw.props;
|
|
25
|
+
|
|
26
|
+
const wantsFocus = args.focus || false;
|
|
27
|
+
const wantsActive = args.active || false;
|
|
28
|
+
|
|
29
|
+
const classes = classnames([
|
|
30
|
+
globalButtonFontAndTextStylesTextAlign,
|
|
31
|
+
globalButtonFontAndTextStylesColor,
|
|
32
|
+
globalButtonFontAndTextStylesColorOpacity,
|
|
33
|
+
globalButtonFontAndTextStylesFont,
|
|
34
|
+
globalButtonFontAndTextStylesFontSize,
|
|
35
|
+
globalButtonFontAndTextStylesTextShadow,
|
|
36
|
+
globalButtonFontAndTextStylesFontWeight,
|
|
37
|
+
globalButtonFontAndTextStylesLineHeight,
|
|
38
|
+
globalButtonFontAndTextStylesLetterSpacing,
|
|
39
|
+
globalButtonFontAndTextStylesItalic,
|
|
40
|
+
globalButtonFontAndTextStylesUnderline,
|
|
41
|
+
globalButtonFontAndTextStylesTextTransform,
|
|
42
|
+
globalButtonFontAndTextStylesColorHover,
|
|
43
|
+
globalButtonFontAndTextStylesColorOpacityHover,
|
|
44
|
+
globalButtonFontAndTextStylesTextShadowHover,
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
if (wantsFocus) {
|
|
48
|
+
classes.add([
|
|
49
|
+
globalButtonFontAndTextStylesColorHover.replace('hover:', 'focus:'),
|
|
50
|
+
globalButtonFontAndTextStylesColorOpacityHover.replace('hover:', 'focus:'),
|
|
51
|
+
globalButtonFontAndTextStylesTextShadowHover.replace('hover:', 'focus:'),
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (wantsActive) {
|
|
56
|
+
classes.add([
|
|
57
|
+
globalButtonFontAndTextStylesColorHover.replace('hover:', 'data-[active=true]:'),
|
|
58
|
+
globalButtonFontAndTextStylesColorOpacityHover.replace('hover:', 'data-[active=true]:'),
|
|
59
|
+
globalButtonFontAndTextStylesTextShadowHover.replace('hover:', 'data-[active=true]:'),
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return classes.toString();
|
|
64
|
+
};
|
|
65
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const globalHeadingTextColor = (rw, type, prefix) => {
|
|
2
|
+
const {
|
|
3
|
+
globalTextColor: color,
|
|
4
|
+
globalTextColorOpacity: opacity,
|
|
5
|
+
globalTextColorHover: colorHover,
|
|
6
|
+
globalTextColorOpacityHover: opacityHover,
|
|
7
|
+
} = rw.props;
|
|
8
|
+
|
|
9
|
+
return classnames([
|
|
10
|
+
color,
|
|
11
|
+
opacity,
|
|
12
|
+
...(type == "hover"
|
|
13
|
+
? [
|
|
14
|
+
addPrefixToTailwindClasses(colorHover, prefix),
|
|
15
|
+
addPrefixToTailwindClasses(opacityHover, prefix),
|
|
16
|
+
]
|
|
17
|
+
: []),
|
|
18
|
+
]).toString();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const globalHeadingColor = (rw) => {
|
|
22
|
+
const {
|
|
23
|
+
globalBgType,
|
|
24
|
+
globalControlTypeBg: type,
|
|
25
|
+
globalHoverGroupBg: hoverGroup,
|
|
26
|
+
globalHoverGroupCustomIdBg: customId,
|
|
27
|
+
} = rw.props;
|
|
28
|
+
const { mode } = rw.project;
|
|
29
|
+
const { node } = rw;
|
|
30
|
+
|
|
31
|
+
const prefix = getHoverPrefix(node, "", hoverGroup, customId);
|
|
32
|
+
|
|
33
|
+
let classes = classnames([]);
|
|
34
|
+
switch (globalBgType) {
|
|
35
|
+
case "color":
|
|
36
|
+
classes.add(globalHeadingTextColor(rw, type, prefix));
|
|
37
|
+
break;
|
|
38
|
+
case "gradient":
|
|
39
|
+
classes
|
|
40
|
+
.add([
|
|
41
|
+
"bg-clip-text",
|
|
42
|
+
"text-[transparent]",
|
|
43
|
+
...globalBgGradient(rw, {
|
|
44
|
+
prefix: prefix,
|
|
45
|
+
prefixCallback: addPrefixToTailwindClasses,
|
|
46
|
+
})
|
|
47
|
+
.split(" ")
|
|
48
|
+
.filter(Boolean),
|
|
49
|
+
])
|
|
50
|
+
.modifier(mode == "edit" ? "[&_span]" : "");
|
|
51
|
+
break;
|
|
52
|
+
case "image":
|
|
53
|
+
classes
|
|
54
|
+
.add([
|
|
55
|
+
"bg-clip-text",
|
|
56
|
+
"text-[transparent]",
|
|
57
|
+
...globalBgImage(rw, {
|
|
58
|
+
prefix: prefix,
|
|
59
|
+
prefixCallback: addPrefixToTailwindClasses,
|
|
60
|
+
})
|
|
61
|
+
.split(" ")
|
|
62
|
+
.filter(Boolean),
|
|
63
|
+
])
|
|
64
|
+
.modifier(mode == "edit" ? "[&_span]" : "");
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return classes.toString();
|
|
69
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates border classes based on props.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} props - The properties object containing style definitions.
|
|
5
|
+
* @returns {string} The generated class string.
|
|
6
|
+
*/
|
|
7
|
+
const globalInputFontAndTextStyles = (rw) => {
|
|
8
|
+
const {
|
|
9
|
+
globalInputFontAndTextStylesColor,
|
|
10
|
+
globalInputFontAndTextStylesColorOpacity,
|
|
11
|
+
globalInputFontAndTextStylesTextShadow,
|
|
12
|
+
globalInputFontAndTextStylesTextAlign,
|
|
13
|
+
globalInputFontAndTextStylesFont,
|
|
14
|
+
globalInputFontAndTextStylesFontSize,
|
|
15
|
+
globalInputFontAndTextStylesFontWeight,
|
|
16
|
+
globalInputFontAndTextStylesLineHeight,
|
|
17
|
+
globalInputFontAndTextStylesLetterSpacing,
|
|
18
|
+
globalInputFontAndTextStylesTextTransform,
|
|
19
|
+
globalInputFontAndTextStylesItalic,
|
|
20
|
+
globalInputFontAndTextStylesUnderline,
|
|
21
|
+
} = rw.props;
|
|
22
|
+
|
|
23
|
+
const classes = classnames([
|
|
24
|
+
globalInputFontAndTextStylesColor,
|
|
25
|
+
globalInputFontAndTextStylesColorOpacity,
|
|
26
|
+
globalInputFontAndTextStylesTextShadow,
|
|
27
|
+
globalInputFontAndTextStylesTextAlign,
|
|
28
|
+
globalInputFontAndTextStylesFont,
|
|
29
|
+
globalInputFontAndTextStylesFontSize,
|
|
30
|
+
globalInputFontAndTextStylesFontWeight,
|
|
31
|
+
globalInputFontAndTextStylesLineHeight,
|
|
32
|
+
globalInputFontAndTextStylesLetterSpacing,
|
|
33
|
+
globalInputFontAndTextStylesTextTransform,
|
|
34
|
+
globalInputFontAndTextStylesItalic,
|
|
35
|
+
globalInputFontAndTextStylesUnderline,
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
return classes.toString();
|
|
39
|
+
};
|
|
40
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Object} app - The properties object containing style definitions.
|
|
3
|
+
* @returns {string} The generated class string.
|
|
4
|
+
*/
|
|
5
|
+
const globalTextFontsAndTextStyles = (app) => {
|
|
6
|
+
const {
|
|
7
|
+
globalTextFontFamily,
|
|
8
|
+
globalTextFontSize,
|
|
9
|
+
globalTextFontWeight,
|
|
10
|
+
globalTextLetterSpacing,
|
|
11
|
+
globalTextLineHeight,
|
|
12
|
+
globalTextItalic,
|
|
13
|
+
globalTextTextShadow,
|
|
14
|
+
globalTextTextTransform,
|
|
15
|
+
globalTextWhiteSpace,
|
|
16
|
+
globalTextTextDecoration,
|
|
17
|
+
globalTextTextDecorationStyle,
|
|
18
|
+
globalTextTextDecorationOffset,
|
|
19
|
+
globalTextTextDecorationColor,
|
|
20
|
+
globalTextTextDecorationOpacity,
|
|
21
|
+
} = app.props;
|
|
22
|
+
|
|
23
|
+
return classnames()
|
|
24
|
+
.add([
|
|
25
|
+
globalTextFontFamily,
|
|
26
|
+
globalTextFontSize,
|
|
27
|
+
globalTextFontWeight,
|
|
28
|
+
globalTextLetterSpacing,
|
|
29
|
+
globalTextLineHeight,
|
|
30
|
+
globalTextItalic,
|
|
31
|
+
globalTextTextShadow,
|
|
32
|
+
globalTextTextTransform,
|
|
33
|
+
globalTextWhiteSpace,
|
|
34
|
+
])
|
|
35
|
+
.add(
|
|
36
|
+
globalTextTextDecoration !== "no-underline"
|
|
37
|
+
? [
|
|
38
|
+
globalTextTextDecoration,
|
|
39
|
+
globalTextTextDecorationOffset,
|
|
40
|
+
globalTextTextDecorationStyle,
|
|
41
|
+
`${globalTextTextDecorationColor}/${globalTextTextDecorationOpacity}`,
|
|
42
|
+
]
|
|
43
|
+
: []
|
|
44
|
+
)
|
|
45
|
+
.toString();
|
|
46
|
+
};
|
|
47
|
+
|