@tamagui/core 1.0.6 → 1.0.8
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/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +4 -24
- package/dist/cjs/helpers/ThemeManager.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +11 -16
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/expandStyles.js +10 -3
- package/dist/cjs/helpers/expandStyles.js.map +3 -3
- package/dist/cjs/helpers/getSplitStyles.js +8 -0
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +16 -37
- package/dist/cjs/helpers/normalizeColor.js.map +3 -3
- package/dist/cjs/helpers/normalizeValueWithProperty.js +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +4 -5
- package/dist/esm/helpers/ThemeManager.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +11 -16
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/expandStyles.js +5 -4
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +8 -0
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/normalizeColor.js +14 -35
- package/dist/esm/helpers/normalizeColor.js.map +3 -3
- package/dist/esm/helpers/normalizeValueWithProperty.js +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
- package/package.json +11 -11
- package/src/createComponent.tsx +1 -0
- package/src/helpers/ThemeManager.tsx +4 -4
- package/src/helpers/createPropMapper.ts +12 -16
- package/src/helpers/expandStyles.ts +5 -4
- package/src/helpers/getSplitStyles.tsx +10 -0
- package/src/helpers/normalizeColor.ts +14 -38
- package/src/helpers/normalizeValueWithProperty.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +1 -1
- package/types/helpers/normalizeColor.d.ts +2 -2
- package/dist/cjs/Pressability.js +0 -32
- package/dist/cjs/Pressability.js.map +0 -7
- package/dist/cjs/Pressability.native.js +0 -32
- package/dist/cjs/Pressability.native.js.map +0 -7
- package/dist/cjs/ThemeContext.js +0 -30
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js +0 -211
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js +0 -70
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/platform.js +0 -59
- package/dist/cjs/constants/platform.js.map +0 -7
- package/dist/cjs/constants/platform.native.js +0 -62
- package/dist/cjs/constants/platform.native.js.map +0 -7
- package/dist/cjs/constants/rnw.native.js +0 -28
- package/dist/cjs/constants/rnw.native.js.map +0 -7
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +0 -30
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +0 -7
- package/dist/cjs/contexts/ThemeContext.js +0 -30
- package/dist/cjs/contexts/ThemeContext.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -2
- package/dist/cjs/defaultComponentState.js.map +0 -7
- package/dist/cjs/helpers/Unwrap.js +0 -29
- package/dist/cjs/helpers/Unwrap.js.map +0 -7
- package/dist/cjs/helpers/areEqualSets.js +0 -38
- package/dist/cjs/helpers/areEqualSets.js.map +0 -7
- package/dist/cjs/helpers/assignNativePropsToWeb.js +0 -188
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +0 -7
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +0 -30
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +0 -7
- package/dist/cjs/helpers/cache.js +0 -39
- package/dist/cjs/helpers/cache.js.map +0 -7
- package/dist/cjs/helpers/calc.js +0 -71
- package/dist/cjs/helpers/calc.js.map +0 -7
- package/dist/cjs/helpers/createShallowUpdate.js +0 -41
- package/dist/cjs/helpers/createShallowUpdate.js.map +0 -7
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -65
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/cssHash.js +0 -51
- package/dist/cjs/helpers/cssHash.js.map +0 -7
- package/dist/cjs/helpers/expandStyle.test.js +0 -10
- package/dist/cjs/helpers/expandStyle.test.js.map +0 -7
- package/dist/cjs/helpers/getFont.js +0 -62
- package/dist/cjs/helpers/getFont.js.map +0 -7
- package/dist/cjs/helpers/getSize.js +0 -48
- package/dist/cjs/helpers/getSize.js.map +0 -7
- package/dist/cjs/helpers/getStackSize.js +0 -46
- package/dist/cjs/helpers/getStackSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js +0 -19
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/startTransition.js +0 -33
- package/dist/cjs/helpers/startTransition.js.map +0 -7
- package/dist/cjs/helpers/validate.js +0 -2
- package/dist/cjs/helpers/validate.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -37
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useConstant.js +0 -36
- package/dist/cjs/hooks/useConstant.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -201
- package/dist/cjs/hooks/useFeatures.js.map +0 -7
- package/dist/cjs/hooks/useIsMounted.js +0 -40
- package/dist/cjs/hooks/useIsMounted.js.map +0 -7
- package/dist/cjs/hooks/useIsSSR.js +0 -42
- package/dist/cjs/hooks/useIsSSR.js.map +0 -7
- package/dist/cjs/hooks/usePressable.js +0 -36
- package/dist/cjs/hooks/usePressable.js.map +0 -7
- package/dist/cjs/hooks/usePrevious.js +0 -1
- package/dist/cjs/hooks/usePrevious.js.map +0 -7
- package/dist/cjs/hooks/useUnmountEffect.js +0 -32
- package/dist/cjs/hooks/useUnmountEffect.js.map +0 -7
- package/dist/cjs/injectStyles.js +0 -40
- package/dist/cjs/injectStyles.js.map +0 -7
- package/dist/cjs/views/TextAncestorContext.js +0 -44
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/cjs/views/ThemeInverse.js +0 -55
- package/dist/cjs/views/ThemeInverse.js.map +0 -7
- package/dist/cjs/views/ThemeReset.js +0 -64
- package/dist/cjs/views/ThemeReset.js.map +0 -7
- package/dist/esm/Pressability.js +0 -7
- package/dist/esm/Pressability.js.map +0 -7
- package/dist/esm/Pressability.native.js +0 -7
- package/dist/esm/Pressability.native.js.map +0 -7
- package/dist/esm/ThemeContext.js +0 -6
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js +0 -185
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js +0 -39
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/platform.js +0 -26
- package/dist/esm/constants/platform.js.map +0 -7
- package/dist/esm/constants/platform.native.js +0 -28
- package/dist/esm/constants/platform.native.js.map +0 -7
- package/dist/esm/constants/rnw.native.js +0 -5
- package/dist/esm/constants/rnw.native.js.map +0 -7
- package/dist/esm/contexts/ButtonInsideButtonContext.js +0 -6
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +0 -7
- package/dist/esm/contexts/ThemeContext.js +0 -6
- package/dist/esm/contexts/ThemeContext.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/Unwrap.js +0 -5
- package/dist/esm/helpers/Unwrap.js.map +0 -7
- package/dist/esm/helpers/areEqualSets.js +0 -14
- package/dist/esm/helpers/areEqualSets.js.map +0 -7
- package/dist/esm/helpers/assignNativePropsToWeb.js +0 -164
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +0 -7
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +0 -6
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +0 -7
- package/dist/esm/helpers/cache.js +0 -15
- package/dist/esm/helpers/cache.js.map +0 -7
- package/dist/esm/helpers/calc.js +0 -47
- package/dist/esm/helpers/calc.js.map +0 -7
- package/dist/esm/helpers/createShallowUpdate.js +0 -17
- package/dist/esm/helpers/createShallowUpdate.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -38
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/cssHash.js +0 -27
- package/dist/esm/helpers/cssHash.js.map +0 -7
- package/dist/esm/helpers/expandStyle.test.js +0 -9
- package/dist/esm/helpers/expandStyle.test.js.map +0 -7
- package/dist/esm/helpers/getFont.js +0 -38
- package/dist/esm/helpers/getFont.js.map +0 -7
- package/dist/esm/helpers/getSize.js +0 -23
- package/dist/esm/helpers/getSize.js.map +0 -7
- package/dist/esm/helpers/getStackSize.js +0 -22
- package/dist/esm/helpers/getStackSize.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.native.js +0 -2
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/helpers/startTransition.js +0 -6
- package/dist/esm/helpers/startTransition.js.map +0 -7
- package/dist/esm/helpers/validate.js +0 -1
- package/dist/esm/helpers/validate.js.map +0 -7
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -11
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useConstant.js +0 -12
- package/dist/esm/hooks/useConstant.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -174
- package/dist/esm/hooks/useFeatures.js.map +0 -7
- package/dist/esm/hooks/useIsMounted.js +0 -16
- package/dist/esm/hooks/useIsMounted.js.map +0 -7
- package/dist/esm/hooks/useIsSSR.js +0 -18
- package/dist/esm/hooks/useIsSSR.js.map +0 -7
- package/dist/esm/hooks/usePressable.js +0 -12
- package/dist/esm/hooks/usePressable.js.map +0 -7
- package/dist/esm/hooks/usePrevious.js +0 -1
- package/dist/esm/hooks/usePrevious.js.map +0 -7
- package/dist/esm/hooks/useUnmountEffect.js +0 -8
- package/dist/esm/hooks/useUnmountEffect.js.map +0 -7
- package/dist/esm/injectStyles.js +0 -16
- package/dist/esm/injectStyles.js.map +0 -7
- package/dist/esm/views/TextAncestorContext.js +0 -15
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/views/ThemeInverse.js +0 -27
- package/dist/esm/views/ThemeInverse.js.map +0 -7
- package/dist/esm/views/ThemeReset.js +0 -37
- package/dist/esm/views/ThemeReset.js.map +0 -7
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { accessibilityRoleToWebRole, processIDRefList } from "../createComponent";
|
|
2
|
-
function assignNativePropsToWeb(elementType, viewProps, nativeProps) {
|
|
3
|
-
if (!viewProps.role && nativeProps.accessibilityRole) {
|
|
4
|
-
if (nativeProps.accessibilityRole === "none") {
|
|
5
|
-
viewProps.role = "presentation";
|
|
6
|
-
} else {
|
|
7
|
-
const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole];
|
|
8
|
-
if (webRole != null) {
|
|
9
|
-
viewProps.role = webRole || nativeProps.accessibilityRole;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
if (nativeProps.accessibilityActiveDescendant != null) {
|
|
14
|
-
viewProps["aria-activedescendant"] = nativeProps.accessibilityActiveDescendant;
|
|
15
|
-
}
|
|
16
|
-
if (nativeProps.accessibilityAtomic != null) {
|
|
17
|
-
viewProps["aria-atomic"] = nativeProps.accessibilityAtomic;
|
|
18
|
-
}
|
|
19
|
-
if (nativeProps.accessibilityAutoComplete != null) {
|
|
20
|
-
viewProps["aria-autocomplete"] = nativeProps.accessibilityAutoComplete;
|
|
21
|
-
}
|
|
22
|
-
if (nativeProps.accessibilityBusy != null) {
|
|
23
|
-
viewProps["aria-busy"] = nativeProps.accessibilityBusy;
|
|
24
|
-
}
|
|
25
|
-
if (nativeProps.accessibilityChecked != null) {
|
|
26
|
-
viewProps["aria-checked"] = nativeProps.accessibilityChecked;
|
|
27
|
-
}
|
|
28
|
-
if (nativeProps.accessibilityColumnCount != null) {
|
|
29
|
-
viewProps["aria-colcount"] = nativeProps.accessibilityColumnCount;
|
|
30
|
-
}
|
|
31
|
-
if (nativeProps.accessibilityColumnIndex != null) {
|
|
32
|
-
viewProps["aria-colindex"] = nativeProps.accessibilityColumnIndex;
|
|
33
|
-
}
|
|
34
|
-
if (nativeProps.accessibilityColumnSpan != null) {
|
|
35
|
-
viewProps["aria-colspan"] = nativeProps.accessibilityColumnSpan;
|
|
36
|
-
}
|
|
37
|
-
if (nativeProps.accessibilityControls != null) {
|
|
38
|
-
viewProps["aria-controls"] = processIDRefList(nativeProps.accessibilityControls);
|
|
39
|
-
}
|
|
40
|
-
if (nativeProps.accessibilityCurrent != null) {
|
|
41
|
-
viewProps["aria-current"] = nativeProps.accessibilityCurrent;
|
|
42
|
-
}
|
|
43
|
-
if (nativeProps.accessibilityDescribedBy != null) {
|
|
44
|
-
viewProps["aria-describedby"] = processIDRefList(nativeProps.accessibilityDescribedBy);
|
|
45
|
-
}
|
|
46
|
-
if (nativeProps.accessibilityDetails != null) {
|
|
47
|
-
viewProps["aria-details"] = nativeProps.accessibilityDetails;
|
|
48
|
-
}
|
|
49
|
-
if (nativeProps.disabled === true) {
|
|
50
|
-
viewProps["aria-disabled"] = true;
|
|
51
|
-
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
52
|
-
viewProps.disabled = true;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (nativeProps.accessibilityErrorMessage != null) {
|
|
56
|
-
viewProps["aria-errormessage"] = nativeProps.accessibilityErrorMessage;
|
|
57
|
-
}
|
|
58
|
-
if (nativeProps.accessibilityExpanded != null) {
|
|
59
|
-
viewProps["aria-expanded"] = nativeProps.accessibilityExpanded;
|
|
60
|
-
}
|
|
61
|
-
if (nativeProps.accessibilityFlowTo != null) {
|
|
62
|
-
viewProps["aria-flowto"] = processIDRefList(nativeProps.accessibilityFlowTo);
|
|
63
|
-
}
|
|
64
|
-
if (nativeProps.accessibilityHasPopup != null) {
|
|
65
|
-
viewProps["aria-haspopup"] = nativeProps.accessibilityHasPopup;
|
|
66
|
-
}
|
|
67
|
-
if (nativeProps.accessibilityHidden === true) {
|
|
68
|
-
viewProps["aria-hidden"] = nativeProps.accessibilityHidden;
|
|
69
|
-
}
|
|
70
|
-
if (nativeProps.accessibilityInvalid != null) {
|
|
71
|
-
viewProps["aria-invalid"] = nativeProps.accessibilityInvalid;
|
|
72
|
-
}
|
|
73
|
-
if (nativeProps.accessibilityKeyShortcuts != null && Array.isArray(nativeProps.accessibilityKeyShortcuts)) {
|
|
74
|
-
viewProps["aria-keyshortcuts"] = nativeProps.accessibilityKeyShortcuts.join(" ");
|
|
75
|
-
}
|
|
76
|
-
if (nativeProps.accessibilityLabel != null) {
|
|
77
|
-
viewProps["aria-label"] = nativeProps.accessibilityLabel;
|
|
78
|
-
}
|
|
79
|
-
if (nativeProps.accessibilityLabelledBy != null) {
|
|
80
|
-
viewProps["aria-labelledby"] = processIDRefList(nativeProps.accessibilityLabelledBy);
|
|
81
|
-
}
|
|
82
|
-
if (nativeProps.accessibilityLevel != null) {
|
|
83
|
-
viewProps["aria-level"] = nativeProps.accessibilityLevel;
|
|
84
|
-
}
|
|
85
|
-
if (nativeProps.accessibilityLiveRegion != null) {
|
|
86
|
-
viewProps["aria-live"] = nativeProps.accessibilityLiveRegion === "none" ? "off" : nativeProps.accessibilityLiveRegion;
|
|
87
|
-
}
|
|
88
|
-
if (nativeProps.accessibilityModal != null) {
|
|
89
|
-
viewProps["aria-modal"] = nativeProps.accessibilityModal;
|
|
90
|
-
}
|
|
91
|
-
if (nativeProps.accessibilityMultiline != null) {
|
|
92
|
-
viewProps["aria-multiline"] = nativeProps.accessibilityMultiline;
|
|
93
|
-
}
|
|
94
|
-
if (nativeProps.accessibilityMultiSelectable != null) {
|
|
95
|
-
viewProps["aria-multiselectable"] = nativeProps.accessibilityMultiSelectable;
|
|
96
|
-
}
|
|
97
|
-
if (nativeProps.accessibilityOrientation != null) {
|
|
98
|
-
viewProps["aria-orientation"] = nativeProps.accessibilityOrientation;
|
|
99
|
-
}
|
|
100
|
-
if (nativeProps.accessibilityOwns != null) {
|
|
101
|
-
viewProps["aria-owns"] = processIDRefList(nativeProps.accessibilityOwns);
|
|
102
|
-
}
|
|
103
|
-
if (nativeProps.accessibilityPlaceholder != null) {
|
|
104
|
-
viewProps["aria-placeholder"] = nativeProps.accessibilityPlaceholder;
|
|
105
|
-
}
|
|
106
|
-
if (nativeProps.accessibilityPosInSet != null) {
|
|
107
|
-
viewProps["aria-posinset"] = nativeProps.accessibilityPosInSet;
|
|
108
|
-
}
|
|
109
|
-
if (nativeProps.accessibilityPressed != null) {
|
|
110
|
-
viewProps["aria-pressed"] = nativeProps.accessibilityPressed;
|
|
111
|
-
}
|
|
112
|
-
if (nativeProps.accessibilityReadOnly != null) {
|
|
113
|
-
viewProps["aria-readonly"] = nativeProps.accessibilityReadOnly;
|
|
114
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
115
|
-
viewProps.readOnly = true;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (nativeProps.accessibilityRequired != null) {
|
|
119
|
-
viewProps["aria-required"] = nativeProps.accessibilityRequired;
|
|
120
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
121
|
-
viewProps.required = true;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (nativeProps.accessibilityRoleDescription != null) {
|
|
125
|
-
viewProps["aria-roledescription"] = nativeProps.accessibilityRoleDescription;
|
|
126
|
-
}
|
|
127
|
-
if (nativeProps.accessibilityRowCount != null) {
|
|
128
|
-
viewProps["aria-rowcount"] = nativeProps.accessibilityRowCount;
|
|
129
|
-
}
|
|
130
|
-
if (nativeProps.accessibilityRowIndex != null) {
|
|
131
|
-
viewProps["aria-rowindex"] = nativeProps.accessibilityRowIndex;
|
|
132
|
-
}
|
|
133
|
-
if (nativeProps.accessibilityRowSpan != null) {
|
|
134
|
-
viewProps["aria-rowspan"] = nativeProps.accessibilityRowSpan;
|
|
135
|
-
}
|
|
136
|
-
if (nativeProps.accessibilitySelected != null) {
|
|
137
|
-
viewProps["aria-selected"] = nativeProps.accessibilitySelected;
|
|
138
|
-
}
|
|
139
|
-
if (nativeProps.accessibilitySetSize != null) {
|
|
140
|
-
viewProps["aria-setsize"] = nativeProps.accessibilitySetSize;
|
|
141
|
-
}
|
|
142
|
-
if (nativeProps.accessibilitySort != null) {
|
|
143
|
-
viewProps["aria-sort"] = nativeProps.accessibilitySort;
|
|
144
|
-
}
|
|
145
|
-
if (nativeProps.accessibilityValueMax != null) {
|
|
146
|
-
viewProps["aria-valuemax"] = nativeProps.accessibilityValueMax;
|
|
147
|
-
}
|
|
148
|
-
if (nativeProps.accessibilityValueMin != null) {
|
|
149
|
-
viewProps["aria-valuemin"] = nativeProps.accessibilityValueMin;
|
|
150
|
-
}
|
|
151
|
-
if (nativeProps.accessibilityValueNow != null) {
|
|
152
|
-
viewProps["aria-valuenow"] = nativeProps.accessibilityValueNow;
|
|
153
|
-
}
|
|
154
|
-
if (nativeProps.accessibilityValueText != null) {
|
|
155
|
-
viewProps["aria-valuetext"] = nativeProps.accessibilityValueText;
|
|
156
|
-
}
|
|
157
|
-
if (nativeProps.nativeID) {
|
|
158
|
-
viewProps.id = nativeProps.nativeID;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
export {
|
|
162
|
-
assignNativePropsToWeb
|
|
163
|
-
};
|
|
164
|
-
//# sourceMappingURL=assignNativePropsToWeb.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/assignNativePropsToWeb.tsx"],
|
|
4
|
-
"sourcesContent": ["import { accessibilityRoleToWebRole, processIDRefList } from '../createComponent'\n\n// adapted from react-native-web\n\nexport function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {\n if (!viewProps.role && nativeProps.accessibilityRole) {\n if (nativeProps.accessibilityRole === 'none') {\n viewProps.role = 'presentation'\n } else {\n const webRole = accessibilityRoleToWebRole[nativeProps.accessibilityRole]\n if (webRole != null) {\n viewProps.role = webRole || nativeProps.accessibilityRole\n }\n }\n }\n\n if (nativeProps.accessibilityActiveDescendant != null) {\n viewProps['aria-activedescendant'] = nativeProps.accessibilityActiveDescendant\n }\n if (nativeProps.accessibilityAtomic != null) {\n viewProps['aria-atomic'] = nativeProps.accessibilityAtomic\n }\n if (nativeProps.accessibilityAutoComplete != null) {\n viewProps['aria-autocomplete'] = nativeProps.accessibilityAutoComplete\n }\n if (nativeProps.accessibilityBusy != null) {\n viewProps['aria-busy'] = nativeProps.accessibilityBusy\n }\n if (nativeProps.accessibilityChecked != null) {\n viewProps['aria-checked'] = nativeProps.accessibilityChecked\n }\n if (nativeProps.accessibilityColumnCount != null) {\n viewProps['aria-colcount'] = nativeProps.accessibilityColumnCount\n }\n if (nativeProps.accessibilityColumnIndex != null) {\n viewProps['aria-colindex'] = nativeProps.accessibilityColumnIndex\n }\n if (nativeProps.accessibilityColumnSpan != null) {\n viewProps['aria-colspan'] = nativeProps.accessibilityColumnSpan\n }\n if (nativeProps.accessibilityControls != null) {\n viewProps['aria-controls'] = processIDRefList(nativeProps.accessibilityControls)\n }\n if (nativeProps.accessibilityCurrent != null) {\n viewProps['aria-current'] = nativeProps.accessibilityCurrent\n }\n if (nativeProps.accessibilityDescribedBy != null) {\n viewProps['aria-describedby'] = processIDRefList(nativeProps.accessibilityDescribedBy)\n }\n if (nativeProps.accessibilityDetails != null) {\n viewProps['aria-details'] = nativeProps.accessibilityDetails\n }\n if (nativeProps.disabled === true) {\n viewProps['aria-disabled'] = true\n // Enhance with native semantics\n if (\n elementType === 'button' ||\n elementType === 'form' ||\n elementType === 'input' ||\n elementType === 'select' ||\n elementType === 'textarea'\n ) {\n viewProps.disabled = true\n }\n }\n if (nativeProps.accessibilityErrorMessage != null) {\n viewProps['aria-errormessage'] = nativeProps.accessibilityErrorMessage\n }\n if (nativeProps.accessibilityExpanded != null) {\n viewProps['aria-expanded'] = nativeProps.accessibilityExpanded\n }\n if (nativeProps.accessibilityFlowTo != null) {\n viewProps['aria-flowto'] = processIDRefList(nativeProps.accessibilityFlowTo)\n }\n if (nativeProps.accessibilityHasPopup != null) {\n viewProps['aria-haspopup'] = nativeProps.accessibilityHasPopup\n }\n if (nativeProps.accessibilityHidden === true) {\n viewProps['aria-hidden'] = nativeProps.accessibilityHidden\n }\n if (nativeProps.accessibilityInvalid != null) {\n viewProps['aria-invalid'] = nativeProps.accessibilityInvalid\n }\n if (\n nativeProps.accessibilityKeyShortcuts != null &&\n Array.isArray(nativeProps.accessibilityKeyShortcuts)\n ) {\n viewProps['aria-keyshortcuts'] = nativeProps.accessibilityKeyShortcuts.join(' ')\n }\n if (nativeProps.accessibilityLabel != null) {\n viewProps['aria-label'] = nativeProps.accessibilityLabel\n }\n if (nativeProps.accessibilityLabelledBy != null) {\n viewProps['aria-labelledby'] = processIDRefList(nativeProps.accessibilityLabelledBy)\n }\n if (nativeProps.accessibilityLevel != null) {\n viewProps['aria-level'] = nativeProps.accessibilityLevel\n }\n if (nativeProps.accessibilityLiveRegion != null) {\n viewProps['aria-live'] =\n nativeProps.accessibilityLiveRegion === 'none' ? 'off' : nativeProps.accessibilityLiveRegion\n }\n if (nativeProps.accessibilityModal != null) {\n viewProps['aria-modal'] = nativeProps.accessibilityModal\n }\n if (nativeProps.accessibilityMultiline != null) {\n viewProps['aria-multiline'] = nativeProps.accessibilityMultiline\n }\n if (nativeProps.accessibilityMultiSelectable != null) {\n viewProps['aria-multiselectable'] = nativeProps.accessibilityMultiSelectable\n }\n if (nativeProps.accessibilityOrientation != null) {\n viewProps['aria-orientation'] = nativeProps.accessibilityOrientation\n }\n if (nativeProps.accessibilityOwns != null) {\n viewProps['aria-owns'] = processIDRefList(nativeProps.accessibilityOwns)\n }\n if (nativeProps.accessibilityPlaceholder != null) {\n viewProps['aria-placeholder'] = nativeProps.accessibilityPlaceholder\n }\n if (nativeProps.accessibilityPosInSet != null) {\n viewProps['aria-posinset'] = nativeProps.accessibilityPosInSet\n }\n if (nativeProps.accessibilityPressed != null) {\n viewProps['aria-pressed'] = nativeProps.accessibilityPressed\n }\n if (nativeProps.accessibilityReadOnly != null) {\n viewProps['aria-readonly'] = nativeProps.accessibilityReadOnly\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.readOnly = true\n }\n }\n if (nativeProps.accessibilityRequired != null) {\n viewProps['aria-required'] = nativeProps.accessibilityRequired\n // Enhance with native semantics\n if (elementType === 'input' || elementType === 'select' || elementType === 'textarea') {\n viewProps.required = true\n }\n }\n if (nativeProps.accessibilityRoleDescription != null) {\n viewProps['aria-roledescription'] = nativeProps.accessibilityRoleDescription\n }\n if (nativeProps.accessibilityRowCount != null) {\n viewProps['aria-rowcount'] = nativeProps.accessibilityRowCount\n }\n if (nativeProps.accessibilityRowIndex != null) {\n viewProps['aria-rowindex'] = nativeProps.accessibilityRowIndex\n }\n if (nativeProps.accessibilityRowSpan != null) {\n viewProps['aria-rowspan'] = nativeProps.accessibilityRowSpan\n }\n if (nativeProps.accessibilitySelected != null) {\n viewProps['aria-selected'] = nativeProps.accessibilitySelected\n }\n if (nativeProps.accessibilitySetSize != null) {\n viewProps['aria-setsize'] = nativeProps.accessibilitySetSize\n }\n if (nativeProps.accessibilitySort != null) {\n viewProps['aria-sort'] = nativeProps.accessibilitySort\n }\n if (nativeProps.accessibilityValueMax != null) {\n viewProps['aria-valuemax'] = nativeProps.accessibilityValueMax\n }\n if (nativeProps.accessibilityValueMin != null) {\n viewProps['aria-valuemin'] = nativeProps.accessibilityValueMin\n }\n if (nativeProps.accessibilityValueNow != null) {\n viewProps['aria-valuenow'] = nativeProps.accessibilityValueNow\n }\n if (nativeProps.accessibilityValueText != null) {\n viewProps['aria-valuetext'] = nativeProps.accessibilityValueText\n }\n\n if (nativeProps.nativeID) {\n viewProps.id = nativeProps.nativeID\n }\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/assignNativePropsToWeb.native.tsx"],
|
|
4
|
-
"sourcesContent": ["export function assignNativePropsToWeb(elementType: string, viewProps: any, nativeProps: any) {}\n"],
|
|
5
|
-
"mappings": "AAAO,gCAAgC,aAAqB,WAAgB,aAAkB;AAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const v = {};
|
|
2
|
-
const cache = {
|
|
3
|
-
get: (key, valStr) => {
|
|
4
|
-
var _a;
|
|
5
|
-
return (_a = v[key]) == null ? void 0 : _a[valStr];
|
|
6
|
-
},
|
|
7
|
-
set: (key, valStr, object) => {
|
|
8
|
-
v[key] ??= {};
|
|
9
|
-
v[key][valStr] = object;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
cache
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=cache.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/cache.ts"],
|
|
4
|
-
"sourcesContent": ["type Value = Object | Array<any> | string | number\n\nexport type Style = { [key: string]: Value }\n\nconst v: Record<string, any> = {}\n\nexport const cache = {\n get: (key: string, valStr: string) => v[key]?.[valStr],\n set: (key: string, valStr: string, object: any) => {\n v[key] ??= {}\n v[key][valStr] = object\n },\n}\n"],
|
|
5
|
-
"mappings": "AAIA,MAAM,IAAyB,CAAC;AAEzB,MAAM,QAAQ;AAAA,EACnB,KAAK,CAAC,KAAa,WAAgB;AAPrC;AAOwC,mBAAE,SAAF,mBAAS;AAAA;AAAA,EAC/C,KAAK,CAAC,KAAa,QAAgB,WAAgB;AACjD,MAAE,SAAS,CAAC;AACZ,MAAE,KAAK,UAAU;AAAA,EACnB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/esm/helpers/calc.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { isWeb } from "../constants/platform";
|
|
2
|
-
import { getVariableVariable } from "../createVariable";
|
|
3
|
-
const operators = {
|
|
4
|
-
"+": (a, b) => a + b,
|
|
5
|
-
"-": (a, b) => a - b,
|
|
6
|
-
"/": (a, b) => a / b,
|
|
7
|
-
"*": (a, b) => a * b
|
|
8
|
-
};
|
|
9
|
-
const calc = (...valuesAndOperators) => {
|
|
10
|
-
if (isWeb) {
|
|
11
|
-
let res2 = "calc(";
|
|
12
|
-
for (const cur of valuesAndOperators) {
|
|
13
|
-
if (operators[cur]) {
|
|
14
|
-
res2 += " " + cur + " ";
|
|
15
|
-
} else {
|
|
16
|
-
res2 += convertToVariableOrNumber(cur);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return res2 + ")";
|
|
20
|
-
}
|
|
21
|
-
let res = 0;
|
|
22
|
-
let nextOp = null;
|
|
23
|
-
for (const cur of valuesAndOperators) {
|
|
24
|
-
if (operators[cur]) {
|
|
25
|
-
nextOp = operators[cur];
|
|
26
|
-
} else {
|
|
27
|
-
if (nextOp) {
|
|
28
|
-
res = nextOp(res, cur);
|
|
29
|
-
nextOp = null;
|
|
30
|
-
} else {
|
|
31
|
-
res = +cur;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return res;
|
|
36
|
-
};
|
|
37
|
-
const convertToVariableOrNumber = (v) => {
|
|
38
|
-
const varOrVal = getVariableVariable(v);
|
|
39
|
-
if (typeof varOrVal === "number") {
|
|
40
|
-
return `${varOrVal}px`;
|
|
41
|
-
}
|
|
42
|
-
return varOrVal;
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
calc
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=calc.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/calc.ts"],
|
|
4
|
-
"sourcesContent": ["import { isWeb } from '../constants/platform'\nimport { getVariableVariable } from '../createVariable'\nimport { FontLineHeightTokens, FontSizeTokens, SizeTokens, SpaceTokens } from '../types'\n\n/**\n * Simple calc() that handles native + web\n * on web: outputs a calc() string\n * on native: outputs a plain number\n */\n\nexport type CalcVal =\n | string\n | number\n | SizeTokens\n | SpaceTokens\n | FontSizeTokens\n | FontLineHeightTokens\n\nconst operators = {\n '+': (a: number, b: number) => a + b,\n '-': (a: number, b: number) => a - b,\n '/': (a: number, b: number) => a / b,\n '*': (a: number, b: number) => a * b,\n}\n\ntype Operator = keyof typeof operators\n\nexport const calc = (...valuesAndOperators: (CalcVal | Operator)[]) => {\n if (isWeb) {\n let res = 'calc('\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n // spaces are significant\n res += ' ' + cur + ' '\n } else {\n res += convertToVariableOrNumber(cur)\n }\n }\n return res + ')'\n }\n\n let res = 0\n let nextOp: any = null\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n nextOp = operators[cur as any]\n } else {\n if (nextOp) {\n res = nextOp(res, cur)\n nextOp = null\n } else {\n res = +cur\n }\n }\n }\n return res\n}\n\nconst convertToVariableOrNumber = (v: any) => {\n const varOrVal = getVariableVariable(v)\n if (typeof varOrVal === 'number') {\n return `${varOrVal}px`\n }\n return varOrVal\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AACA;AAiBA,MAAM,YAAY;AAAA,EAChB,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AACrC;AAIO,MAAM,OAAO,IAAI,uBAA+C;AACrE,MAAI,OAAO;AACT,QAAI,OAAM;AACV,eAAW,OAAO,oBAAoB;AACpC,UAAI,UAAU,MAAa;AAEzB,gBAAO,MAAM,MAAM;AAAA,MACrB,OAAO;AACL,gBAAO,0BAA0B,GAAG;AAAA,MACtC;AAAA,IACF;AACA,WAAO,OAAM;AAAA,EACf;AAEA,MAAI,MAAM;AACV,MAAI,SAAc;AAClB,aAAW,OAAO,oBAAoB;AACpC,QAAI,UAAU,MAAa;AACzB,eAAS,UAAU;AAAA,IACrB,OAAO;AACL,UAAI,QAAQ;AACV,cAAM,OAAO,KAAK,GAAG;AACrB,iBAAS;AAAA,MACX,OAAO;AACL,cAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,4BAA4B,CAAC,MAAW;AAC5C,QAAM,WAAW,oBAAoB,CAAC;AACtC,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,GAAG;AAAA,EACZ;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
|
-
function createShallowUpdate(setter) {
|
|
3
|
-
return useCallback((next) => {
|
|
4
|
-
setter((prev) => {
|
|
5
|
-
for (const key in next) {
|
|
6
|
-
if (prev[key] !== next[key]) {
|
|
7
|
-
return { ...prev, ...next };
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
return prev;
|
|
11
|
-
});
|
|
12
|
-
}, [setter]);
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
createShallowUpdate
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=createShallowUpdate.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/createShallowUpdate.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react'\n\nexport function createShallowUpdate<State extends Object>(\n setter: React.Dispatch<React.SetStateAction<State>>\n) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useCallback(\n (next: Partial<State>) => {\n setter((prev) => {\n for (const key in next) {\n if (prev[key] !== next[key]) {\n return { ...prev, ...next }\n }\n }\n return prev\n })\n },\n [setter]\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAEO,6BACL,QACA;AAEA,SAAO,YACL,CAAC,SAAyB;AACxB,WAAO,CAAC,SAAS;AACf,iBAAW,OAAO,MAAM;AACtB,YAAI,KAAK,SAAS,KAAK,MAAM;AAC3B,iBAAO,EAAE,GAAG,MAAM,GAAG,KAAK;AAAA,QAC5B;AAAA,MACF;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH,GACA,CAAC,MAAM,CACT;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { isClient } from "../constants/platform";
|
|
3
|
-
import { ButtonInsideButtonContext } from "../contexts/ButtonInsideButtonContext";
|
|
4
|
-
import { TextAncestorProvider } from "../views/TextAncestorContext";
|
|
5
|
-
import { ThemeProvider } from "../views/ThemeProvider";
|
|
6
|
-
function createTamaguiProvider(config) {
|
|
7
|
-
return function TamaguiProvider({
|
|
8
|
-
disableInjectCSS,
|
|
9
|
-
children,
|
|
10
|
-
...themePropsProvider
|
|
11
|
-
}) {
|
|
12
|
-
if (isClient) {
|
|
13
|
-
React.useLayoutEffect(() => {
|
|
14
|
-
if (disableInjectCSS)
|
|
15
|
-
return;
|
|
16
|
-
const style = document.createElement("style");
|
|
17
|
-
style.appendChild(document.createTextNode(config.getCSS()));
|
|
18
|
-
document.head.appendChild(style);
|
|
19
|
-
return () => {
|
|
20
|
-
document.head.removeChild(style);
|
|
21
|
-
};
|
|
22
|
-
}, [disableInjectCSS]);
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ React.createElement(ButtonInsideButtonContext.Provider, {
|
|
25
|
-
value: false
|
|
26
|
-
}, /* @__PURE__ */ React.createElement(TextAncestorProvider, null, /* @__PURE__ */ React.createElement(ThemeProvider, {
|
|
27
|
-
themes: config.themes,
|
|
28
|
-
defaultTheme: config.defaultTheme || "light",
|
|
29
|
-
themeClassNameOnRoot: config.themeClassNameOnRoot,
|
|
30
|
-
disableRootThemeClass: config.disableRootThemeClass,
|
|
31
|
-
...themePropsProvider
|
|
32
|
-
}, children)));
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
createTamaguiProvider
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=createTamaguiProvider.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/createTamaguiProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\n\nimport { isClient } from '../constants/platform'\nimport { ButtonInsideButtonContext } from '../contexts/ButtonInsideButtonContext'\nimport { TamaguiInternalConfig, TamaguiProviderProps } from '../types'\nimport { TextAncestorProvider } from '../views/TextAncestorContext'\nimport { ThemeProvider } from '../views/ThemeProvider'\n\nexport function createTamaguiProvider(config: TamaguiInternalConfig) {\n return function TamaguiProvider({\n disableInjectCSS,\n children,\n ...themePropsProvider\n }: TamaguiProviderProps) {\n // inject CSS if asked to (not SSR compliant)\n if (isClient) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useLayoutEffect(() => {\n if (disableInjectCSS) return\n const style = document.createElement('style')\n style.appendChild(document.createTextNode(config.getCSS()))\n document.head.appendChild(style)\n return () => {\n document.head.removeChild(style)\n }\n }, [disableInjectCSS])\n }\n\n return (\n <ButtonInsideButtonContext.Provider value={false}>\n <TextAncestorProvider>\n <ThemeProvider\n themes={config.themes}\n defaultTheme={config.defaultTheme || 'light'}\n themeClassNameOnRoot={config.themeClassNameOnRoot}\n disableRootThemeClass={config.disableRootThemeClass}\n {...themePropsProvider}\n >\n {children}\n </ThemeProvider>\n </TextAncestorProvider>\n </ButtonInsideButtonContext.Provider>\n )\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAEA;AACA;AAEA;AACA;AAEO,+BAA+B,QAA+B;AACnE,SAAO,yBAAyB;AAAA,IAC9B;AAAA,IACA;AAAA,OACG;AAAA,KACoB;AAEvB,QAAI,UAAU;AAEZ,YAAM,gBAAgB,MAAM;AAC1B,YAAI;AAAkB;AACtB,cAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,cAAM,YAAY,SAAS,eAAe,OAAO,OAAO,CAAC,CAAC;AAC1D,iBAAS,KAAK,YAAY,KAAK;AAC/B,eAAO,MAAM;AACX,mBAAS,KAAK,YAAY,KAAK;AAAA,QACjC;AAAA,MACF,GAAG,CAAC,gBAAgB,CAAC;AAAA,IACvB;AAEA,WACE,oCAAC,0BAA0B,UAA1B;AAAA,MAAmC,OAAO;AAAA,OACzC,oCAAC,4BACC,oCAAC;AAAA,MACC,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO,gBAAgB;AAAA,MACrC,sBAAsB,OAAO;AAAA,MAC7B,uBAAuB,OAAO;AAAA,MAC7B,GAAG;AAAA,OAEH,QACH,CACF,CACF;AAAA,EAEJ;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { simpleHash } from "@tamagui/helpers";
|
|
2
|
-
function cssHash(val, maxLen = 10) {
|
|
3
|
-
if (val.length < maxLen) {
|
|
4
|
-
let res = "";
|
|
5
|
-
for (let i = 0; i < val.length; i++) {
|
|
6
|
-
const char = val[i];
|
|
7
|
-
if (specials[char]) {
|
|
8
|
-
res += specials[char];
|
|
9
|
-
} else {
|
|
10
|
-
res += validCSS.test(char) ? char : "_" + char.charCodeAt(0).toString();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return res;
|
|
14
|
-
}
|
|
15
|
-
return simpleHash(val);
|
|
16
|
-
}
|
|
17
|
-
const validCSS = /[a-z0-9]/i;
|
|
18
|
-
const specials = {
|
|
19
|
-
".": "dot",
|
|
20
|
-
",": "_",
|
|
21
|
-
"%": "pct",
|
|
22
|
-
"-": "neg"
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
cssHash
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=cssHash.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/cssHash.ts"],
|
|
4
|
-
"sourcesContent": ["import { simpleHash } from '@tamagui/helpers'\n\n// not sure it's worth the extra weight, could be dev time though\n// affordances for simple values\nexport function cssHash(val: string, maxLen = 10) {\n if (val.length < maxLen) {\n let res = ''\n for (let i = 0; i < val.length; i++) {\n const char = val[i]\n if (specials[char]) {\n res += specials[char]\n } else {\n res += validCSS.test(char) ? char : '_' + char.charCodeAt(0).toString()\n }\n }\n return res\n }\n return simpleHash(val)\n}\n\nconst validCSS = /[a-z0-9]/i\n\nconst specials = {\n '.': 'dot',\n ',': '_',\n '%': 'pct',\n '-': 'neg',\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAIO,iBAAiB,KAAa,SAAS,IAAI;AAChD,MAAI,IAAI,SAAS,QAAQ;AACvB,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,YAAM,OAAO,IAAI;AACjB,UAAI,SAAS,OAAO;AAClB,eAAO,SAAS;AAAA,MAClB,OAAO;AACL,eAAO,SAAS,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,CAAC,EAAE,SAAS;AAAA,MACxE;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACA,SAAO,WAAW,GAAG;AACvB;AAEA,MAAM,WAAW;AAEjB,MAAM,WAAW;AAAA,EACf,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACP;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "vitest";
|
|
2
|
-
import { expandStyle } from "./expandStyle";
|
|
3
|
-
test(`should expand webkit user-select`, () => {
|
|
4
|
-
expect(expandStyle("userSelect", "none")).toStrictEqual([
|
|
5
|
-
["userSelect", "none"],
|
|
6
|
-
["WebkitUserSelect", "none"]
|
|
7
|
-
]);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=expandStyle.test.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/expandStyle.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { expect, test } from 'vitest'\n\nimport { expandStyle } from './expandStyle'\n\ntest(`should expand webkit user-select`, () => {\n expect(expandStyle('userSelect', 'none')).toStrictEqual([\n ['userSelect', 'none'],\n ['WebkitUserSelect', 'none'],\n ])\n})\n"],
|
|
5
|
-
"mappings": "AAAA;AAEA;AAEA,KAAK,oCAAoC,MAAM;AAC7C,SAAO,YAAY,cAAc,MAAM,CAAC,EAAE,cAAc;AAAA,IACtD,CAAC,cAAc,MAAM;AAAA,IACrB,CAAC,oBAAoB,MAAM;AAAA,EAC7B,CAAC;AACH,CAAC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getVariableValue } from "../createVariable";
|
|
2
|
-
const getFont = (val = "$4", { fonts, theme, props }) => {
|
|
3
|
-
var _a, _b, _c;
|
|
4
|
-
const family = getVariableValue(props.fontFamily) || "$body";
|
|
5
|
-
const font = fonts[family] || fonts["$body"];
|
|
6
|
-
if (!font) {
|
|
7
|
-
console.warn("\u26A0\uFE0F no font found", { family, fontTokens: Object.keys(fonts), val });
|
|
8
|
-
return {};
|
|
9
|
-
}
|
|
10
|
-
const fontFamily = font.family;
|
|
11
|
-
const fontSize = props.fontSize || font.size[val];
|
|
12
|
-
const lineHeight = props.lineHeight || font.lineHeight[val];
|
|
13
|
-
const fontWeight = props.fontWeight || font.weight[val];
|
|
14
|
-
const letterSpacing = props.letterSpacing || font.letterSpacing[val];
|
|
15
|
-
const fontStyle = props.fontStyle || ((_a = font.style) == null ? void 0 : _a[val]);
|
|
16
|
-
const textTransform = props.textTransform || ((_b = font.transform) == null ? void 0 : _b[val]);
|
|
17
|
-
const color = props.color || ((_c = font.color) == null ? void 0 : _c[val]) || theme.color;
|
|
18
|
-
const style = {
|
|
19
|
-
color,
|
|
20
|
-
fontStyle,
|
|
21
|
-
textTransform,
|
|
22
|
-
fontFamily,
|
|
23
|
-
fontWeight,
|
|
24
|
-
letterSpacing,
|
|
25
|
-
fontSize,
|
|
26
|
-
lineHeight
|
|
27
|
-
};
|
|
28
|
-
if (process.env.NODE_ENV === "development") {
|
|
29
|
-
if (props["debug"]) {
|
|
30
|
-
console.log("getFont", val, style, "from props", props);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return style;
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
getFont
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=getFont.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getFont.tsx"],
|
|
4
|
-
"sourcesContent": ["import { getVariableValue } from '../createVariable'\nimport { FontSizeTokens, TextProps, VariantSpreadFunction } from '../types'\n\nexport const getFont: VariantSpreadFunction<TextProps, FontSizeTokens> = (\n val = '$4',\n { fonts, theme, props }\n) => {\n const family = getVariableValue(props.fontFamily) || '$body'\n const font = fonts[family] || fonts['$body']\n if (!font) {\n console.warn('\u26A0\uFE0F no font found', { family, fontTokens: Object.keys(fonts), val })\n return {} as any\n }\n const fontFamily = font.family\n const fontSize = props.fontSize || font.size[val]\n const lineHeight = props.lineHeight || font.lineHeight[val]\n const fontWeight = props.fontWeight || font.weight[val]\n const letterSpacing = props.letterSpacing || font.letterSpacing[val]\n const fontStyle = props.fontStyle || font.style?.[val]\n const textTransform = props.textTransform || font.transform?.[val]\n const color = props.color || font.color?.[val] || theme.color\n const style = {\n color,\n fontStyle,\n textTransform,\n fontFamily,\n fontWeight,\n letterSpacing,\n fontSize,\n lineHeight,\n }\n if (process.env.NODE_ENV === 'development') {\n if (props['debug']) {\n console.log('getFont', val, style, 'from props', props)\n }\n }\n return style\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAGO,MAAM,UAA4D,CACvE,MAAM,MACN,EAAE,OAAO,OAAO,YACb;AANL;AAOE,QAAM,SAAS,iBAAiB,MAAM,UAAU,KAAK;AACrD,QAAM,OAAO,MAAM,WAAW,MAAM;AACpC,MAAI,CAAC,MAAM;AACT,YAAQ,KAAK,8BAAoB,EAAE,QAAQ,YAAY,OAAO,KAAK,KAAK,GAAG,IAAI,CAAC;AAChF,WAAO,CAAC;AAAA,EACV;AACA,QAAM,aAAa,KAAK;AACxB,QAAM,WAAW,MAAM,YAAY,KAAK,KAAK;AAC7C,QAAM,aAAa,MAAM,cAAc,KAAK,WAAW;AACvD,QAAM,aAAa,MAAM,cAAc,KAAK,OAAO;AACnD,QAAM,gBAAgB,MAAM,iBAAiB,KAAK,cAAc;AAChE,QAAM,YAAY,MAAM,aAAa,YAAK,UAAL,mBAAa;AAClD,QAAM,gBAAgB,MAAM,iBAAiB,YAAK,cAAL,mBAAiB;AAC9D,QAAM,QAAQ,MAAM,SAAS,YAAK,UAAL,mBAAa,SAAQ,MAAM;AACxD,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,MAAM,UAAU;AAClB,cAAQ,IAAI,WAAW,KAAK,OAAO,cAAc,KAAK;AAAA,IACxD;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { getTokens } from "../config";
|
|
2
|
-
const getSize = (size, shift = 0, bounds = [0]) => {
|
|
3
|
-
return stepTokenUpOrDown(getTokens(true).size, size, shift, bounds);
|
|
4
|
-
};
|
|
5
|
-
const cache = /* @__PURE__ */ new WeakMap();
|
|
6
|
-
const stepTokenUpOrDown = (tokens, current, shift = 0, bounds = [0]) => {
|
|
7
|
-
if (!cache.has(tokens)) {
|
|
8
|
-
cache.set(tokens, Object.keys(tokens));
|
|
9
|
-
}
|
|
10
|
-
const sizeNames = cache.get(tokens);
|
|
11
|
-
const currentKey = current || "$true";
|
|
12
|
-
const min = bounds[0] ?? 0;
|
|
13
|
-
const max = bounds[1] ?? sizeNames.length - 1;
|
|
14
|
-
const currentIndex = sizeNames.indexOf(currentKey);
|
|
15
|
-
const index = Math.min(max, Math.max(min, currentIndex + shift));
|
|
16
|
-
const key = sizeNames[index];
|
|
17
|
-
return tokens[key] || tokens["$true"];
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
getSize,
|
|
21
|
-
stepTokenUpOrDown
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=getSize.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getSize.ts"],
|
|
4
|
-
"sourcesContent": ["import { getTokens } from '../config'\nimport { SizeTokens, SpaceTokens } from '../types'\n\nexport const getSize = (size?: SizeTokens | undefined, shift = 0, bounds = [0]) => {\n return stepTokenUpOrDown(getTokens(true).size, size, shift, bounds)\n}\n\nconst cache = new WeakMap()\n\nexport const stepTokenUpOrDown = (\n tokens: Object,\n current?: SizeTokens | SpaceTokens | string,\n shift = 0,\n bounds = [0]\n) => {\n if (!cache.has(tokens)) {\n cache.set(tokens, Object.keys(tokens))\n }\n const sizeNames = cache.get(tokens)!\n const currentKey = current || '$true'\n const min = bounds[0] ?? 0\n const max = bounds[1] ?? sizeNames.length - 1\n const currentIndex = sizeNames.indexOf(currentKey)\n const index = Math.min(max, Math.max(min, currentIndex + shift))\n const key = sizeNames[index]\n return tokens[key] || tokens['$true']\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,iBAAiB;AAGnB,MAAM,UAAU,CAAC,MAA+B,QAAQ,GAAG,SAAS,CAAC,CAAC,MAAM;AACjF,SAAO,kBAAkB,UAAU,IAAI,EAAE,MAAM,MAAM,OAAO,MAAM;AACpE;AAEA,MAAM,QAAQ,oBAAI,QAAQ;AAEnB,MAAM,oBAAoB,CAC/B,QACA,SACA,QAAQ,GACR,SAAS,CAAC,CAAC,MACR;AACH,MAAI,CAAC,MAAM,IAAI,MAAM,GAAG;AACtB,UAAM,IAAI,QAAQ,OAAO,KAAK,MAAM,CAAC;AAAA,EACvC;AACA,QAAM,YAAY,MAAM,IAAI,MAAM;AAClC,QAAM,aAAa,WAAW;AAC9B,QAAM,MAAM,OAAO,MAAM;AACzB,QAAM,MAAM,OAAO,MAAM,UAAU,SAAS;AAC5C,QAAM,eAAe,UAAU,QAAQ,UAAU;AACjD,QAAM,QAAQ,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,eAAe,KAAK,CAAC;AAC/D,QAAM,MAAM,UAAU;AACtB,SAAO,OAAO,QAAQ,OAAO;AAC/B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { getSize, stepTokenUpOrDown } from "./getSize";
|
|
2
|
-
const getButtonSize = (val, { tokens }) => {
|
|
3
|
-
if (typeof val === "number") {
|
|
4
|
-
return {
|
|
5
|
-
paddingHorizontal: val * 0.25,
|
|
6
|
-
height: val,
|
|
7
|
-
borderRadius: val * 0.2
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
const ySize = getSize(val, 0);
|
|
11
|
-
const xSize = stepTokenUpOrDown(tokens.space, val);
|
|
12
|
-
const radiusToken = tokens.radius[val] ?? tokens.radius["$4"];
|
|
13
|
-
return {
|
|
14
|
-
paddingHorizontal: xSize,
|
|
15
|
-
height: ySize,
|
|
16
|
-
borderRadius: radiusToken
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
getButtonSize
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=getStackSize.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/getStackSize.ts"],
|
|
4
|
-
"sourcesContent": ["import { SizeTokens, VariantSpreadExtras } from '../types'\nimport { getSize, stepTokenUpOrDown } from './getSize'\n\nexport type ScaleVariantExtras = Pick<VariantSpreadExtras<any>, 'tokens' | 'props' | 'fonts'>\n\nexport const getButtonSize = (val: SizeTokens | number, { tokens }: VariantSpreadExtras<any>) => {\n if (typeof val === 'number') {\n return {\n paddingHorizontal: val * 0.25,\n height: val,\n borderRadius: val * 0.2,\n }\n }\n const ySize = getSize(val, 0)\n const xSize = stepTokenUpOrDown(tokens.space, val)\n const radiusToken = tokens.radius[val] ?? tokens.radius['$4']\n return {\n paddingHorizontal: xSize,\n height: ySize,\n borderRadius: radiusToken,\n }\n}\n"],
|
|
5
|
-
"mappings": "AACA;AAIO,MAAM,gBAAgB,CAAC,KAA0B,EAAE,aAAuC;AAC/F,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO;AAAA,MACL,mBAAmB,MAAM;AAAA,MACzB,QAAQ;AAAA,MACR,cAAc,MAAM;AAAA,IACtB;AAAA,EACF;AACA,QAAM,QAAQ,QAAQ,KAAK,CAAC;AAC5B,QAAM,QAAQ,kBAAkB,OAAO,OAAO,GAAG;AACjD,QAAM,cAAc,OAAO,OAAO,QAAQ,OAAO,OAAO;AACxD,SAAO;AAAA,IACL,mBAAmB;AAAA,IACnB,QAAQ;AAAA,IACR,cAAc;AAAA,EAChB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/startTransition.ts"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
|
|
5
|
-
"mappings": "AAAA;AAGO,MAAM,kBAAkB,MAAM,mBAAoB,EAAC,OAAO,GAAG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=validate.js.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ThemeManagerContext } from "../ThemeManager";
|
|
3
|
-
function wrapThemeManagerContext(children, themeManager) {
|
|
4
|
-
return themeManager ? /* @__PURE__ */ React.createElement(ThemeManagerContext.Provider, {
|
|
5
|
-
value: themeManager
|
|
6
|
-
}, children) : children;
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
wrapThemeManagerContext
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=wrapThemeManagerContext.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/helpers/wrapThemeManagerContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect } from 'react'\n\nimport { ThemeManager, ThemeManagerContext } from '../ThemeManager'\n\nexport function wrapThemeManagerContext(children: any, themeManager?: ThemeManager | null) {\n return themeManager ? (\n <ThemeManagerContext.Provider value={themeManager}>{children}</ThemeManagerContext.Provider>\n ) : (\n children\n )\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAEA;AAEO,iCAAiC,UAAe,cAAoC;AACzF,SAAO,eACL,oCAAC,oBAAoB,UAApB;AAAA,IAA6B,OAAO;AAAA,KAAe,QAAS,IAE7D;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useConstant.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useRef } from 'react'\n\ntype ResultBox<T> = { v: T }\nexport function useConstant<T>(fn: () => T): T {\n const ref = useRef<ResultBox<T>>()\n if (!ref.current) {\n ref.current = { v: fn() }\n }\n return ref.current.v\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAGO,qBAAwB,IAAgB;AAC7C,QAAM,MAAM,OAAqB;AACjC,MAAI,CAAC,IAAI,SAAS;AAChB,QAAI,UAAU,EAAE,GAAG,GAAG,EAAE;AAAA,EAC1B;AACA,SAAO,IAAI,QAAQ;AACrB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|