@elliemae/ds-legacy-system 1.0.0-rc.1
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/arithmetic.js +61 -0
- package/dist/cjs/arithmetic.js.map +7 -0
- package/dist/cjs/constants.js +48 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/globalStyles.js +66 -0
- package/dist/cjs/globalStyles.js.map +7 -0
- package/dist/cjs/index.js +53 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/mobileUtilities.js +71 -0
- package/dist/cjs/mobileUtilities.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/spaceUtilities.js +97 -0
- package/dist/cjs/spaceUtilities.js.map +7 -0
- package/dist/cjs/styled/checkNamingConvention.js +49 -0
- package/dist/cjs/styled/checkNamingConvention.js.map +7 -0
- package/dist/cjs/styled/coerceWithDefaultTheme.js +46 -0
- package/dist/cjs/styled/coerceWithDefaultTheme.js.map +7 -0
- package/dist/cjs/styled/expressions/genStyleOverridesExpression.js +44 -0
- package/dist/cjs/styled/expressions/genStyleOverridesExpression.js.map +7 -0
- package/dist/cjs/styled/expressions/genVariantOverridesExpression.js +63 -0
- package/dist/cjs/styled/expressions/genVariantOverridesExpression.js.map +7 -0
- package/dist/cjs/styled/expressions/index.js +38 -0
- package/dist/cjs/styled/expressions/index.js.map +7 -0
- package/dist/cjs/styled/fixStyleArg.js +48 -0
- package/dist/cjs/styled/fixStyleArg.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/generateAttributes.js +71 -0
- package/dist/cjs/styled/generated-attributes/generateAttributes.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/generateAutoCalculated.js +42 -0
- package/dist/cjs/styled/generated-attributes/generateAutoCalculated.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/generateDisplayName.js +41 -0
- package/dist/cjs/styled/generated-attributes/generateDisplayName.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/index.js +36 -0
- package/dist/cjs/styled/generated-attributes/index.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/utils/callbackMerger.js +50 -0
- package/dist/cjs/styled/generated-attributes/utils/callbackMerger.js.map +7 -0
- package/dist/cjs/styled/generated-attributes/utils/refMerger.js +54 -0
- package/dist/cjs/styled/generated-attributes/utils/refMerger.js.map +7 -0
- package/dist/cjs/styled/helpers.js +57 -0
- package/dist/cjs/styled/helpers.js.map +7 -0
- package/dist/cjs/styled/index.js +55 -0
- package/dist/cjs/styled/index.js.map +7 -0
- package/dist/cjs/styled/styled.js +38 -0
- package/dist/cjs/styled/styled.js.map +7 -0
- package/dist/cjs/styled/styledFunction.js +78 -0
- package/dist/cjs/styled/styledFunction.js.map +7 -0
- package/dist/cjs/styled/styledObject.js +42 -0
- package/dist/cjs/styled/styledObject.js.map +7 -0
- package/dist/cjs/styled/system-types.js +28 -0
- package/dist/cjs/styled/system-types.js.map +7 -0
- package/dist/cjs/styled/system-utilities/background.js +45 -0
- package/dist/cjs/styled/system-utilities/background.js.map +7 -0
- package/dist/cjs/styled/system-utilities/border.js +188 -0
- package/dist/cjs/styled/system-utilities/border.js.map +7 -0
- package/dist/cjs/styled/system-utilities/color.js +47 -0
- package/dist/cjs/styled/system-utilities/color.js.map +7 -0
- package/dist/cjs/styled/system-utilities/index.js +50 -0
- package/dist/cjs/styled/system-utilities/index.js.map +7 -0
- package/dist/cjs/styled/system-utilities/sizing.js +67 -0
- package/dist/cjs/styled/system-utilities/sizing.js.map +7 -0
- package/dist/cjs/styled/system-utilities/space.js +37 -0
- package/dist/cjs/styled/system-utilities/space.js.map +7 -0
- package/dist/cjs/styled/system.js +40 -0
- package/dist/cjs/styled/system.js.map +7 -0
- package/dist/cjs/styled/transformers/index.js +36 -0
- package/dist/cjs/styled/transformers/index.js.map +7 -0
- package/dist/cjs/styled/transformers/magicCssTransform.js +66 -0
- package/dist/cjs/styled/transformers/magicCssTransform.js.map +7 -0
- package/dist/cjs/styled/types.js +28 -0
- package/dist/cjs/styled/types.js.map +7 -0
- package/dist/cjs/th.js +86 -0
- package/dist/cjs/th.js.map +7 -0
- package/dist/cjs/theme.js +37 -0
- package/dist/cjs/theme.js.map +7 -0
- package/dist/cjs/themeProviderHOC.js +42 -0
- package/dist/cjs/themeProviderHOC.js.map +7 -0
- package/dist/cjs/utils.js +292 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/xStyledWrapper.js +62 -0
- package/dist/cjs/xStyledWrapper.js.map +7 -0
- package/dist/esm/arithmetic.js +31 -0
- package/dist/esm/arithmetic.js.map +7 -0
- package/dist/esm/constants.js +18 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/globalStyles.js +36 -0
- package/dist/esm/globalStyles.js.map +7 -0
- package/dist/esm/index.js +22 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/mobileUtilities.js +41 -0
- package/dist/esm/mobileUtilities.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/spaceUtilities.js +67 -0
- package/dist/esm/spaceUtilities.js.map +7 -0
- package/dist/esm/styled/checkNamingConvention.js +19 -0
- package/dist/esm/styled/checkNamingConvention.js.map +7 -0
- package/dist/esm/styled/coerceWithDefaultTheme.js +16 -0
- package/dist/esm/styled/coerceWithDefaultTheme.js.map +7 -0
- package/dist/esm/styled/expressions/genStyleOverridesExpression.js +14 -0
- package/dist/esm/styled/expressions/genStyleOverridesExpression.js.map +7 -0
- package/dist/esm/styled/expressions/genVariantOverridesExpression.js +33 -0
- package/dist/esm/styled/expressions/genVariantOverridesExpression.js.map +7 -0
- package/dist/esm/styled/expressions/index.js +8 -0
- package/dist/esm/styled/expressions/index.js.map +7 -0
- package/dist/esm/styled/fixStyleArg.js +18 -0
- package/dist/esm/styled/fixStyleArg.js.map +7 -0
- package/dist/esm/styled/generated-attributes/generateAttributes.js +41 -0
- package/dist/esm/styled/generated-attributes/generateAttributes.js.map +7 -0
- package/dist/esm/styled/generated-attributes/generateAutoCalculated.js +12 -0
- package/dist/esm/styled/generated-attributes/generateAutoCalculated.js.map +7 -0
- package/dist/esm/styled/generated-attributes/generateDisplayName.js +11 -0
- package/dist/esm/styled/generated-attributes/generateDisplayName.js.map +7 -0
- package/dist/esm/styled/generated-attributes/index.js +6 -0
- package/dist/esm/styled/generated-attributes/index.js.map +7 -0
- package/dist/esm/styled/generated-attributes/utils/callbackMerger.js +20 -0
- package/dist/esm/styled/generated-attributes/utils/callbackMerger.js.map +7 -0
- package/dist/esm/styled/generated-attributes/utils/refMerger.js +24 -0
- package/dist/esm/styled/generated-attributes/utils/refMerger.js.map +7 -0
- package/dist/esm/styled/helpers.js +27 -0
- package/dist/esm/styled/helpers.js.map +7 -0
- package/dist/esm/styled/index.js +35 -0
- package/dist/esm/styled/index.js.map +7 -0
- package/dist/esm/styled/styled.js +8 -0
- package/dist/esm/styled/styled.js.map +7 -0
- package/dist/esm/styled/styledFunction.js +48 -0
- package/dist/esm/styled/styledFunction.js.map +7 -0
- package/dist/esm/styled/styledObject.js +12 -0
- package/dist/esm/styled/styledObject.js.map +7 -0
- package/dist/esm/styled/system-types.js +2 -0
- package/dist/esm/styled/system-types.js.map +7 -0
- package/dist/esm/styled/system-utilities/background.js +15 -0
- package/dist/esm/styled/system-utilities/background.js.map +7 -0
- package/dist/esm/styled/system-utilities/border.js +158 -0
- package/dist/esm/styled/system-utilities/border.js.map +7 -0
- package/dist/esm/styled/system-utilities/color.js +17 -0
- package/dist/esm/styled/system-utilities/color.js.map +7 -0
- package/dist/esm/styled/system-utilities/index.js +20 -0
- package/dist/esm/styled/system-utilities/index.js.map +7 -0
- package/dist/esm/styled/system-utilities/sizing.js +37 -0
- package/dist/esm/styled/system-utilities/sizing.js.map +7 -0
- package/dist/esm/styled/system-utilities/space.js +7 -0
- package/dist/esm/styled/system-utilities/space.js.map +7 -0
- package/dist/esm/styled/system.js +10 -0
- package/dist/esm/styled/system.js.map +7 -0
- package/dist/esm/styled/transformers/index.js +6 -0
- package/dist/esm/styled/transformers/index.js.map +7 -0
- package/dist/esm/styled/transformers/magicCssTransform.js +36 -0
- package/dist/esm/styled/transformers/magicCssTransform.js.map +7 -0
- package/dist/esm/styled/types.js +2 -0
- package/dist/esm/styled/types.js.map +7 -0
- package/dist/esm/th.js +56 -0
- package/dist/esm/th.js.map +7 -0
- package/dist/esm/theme.js +7 -0
- package/dist/esm/theme.js.map +7 -0
- package/dist/esm/themeProviderHOC.js +12 -0
- package/dist/esm/themeProviderHOC.js.map +7 -0
- package/dist/esm/utils.js +262 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/xStyledWrapper.js +43 -0
- package/dist/esm/xStyledWrapper.js.map +7 -0
- package/dist/types/arithmetic.d.ts +5 -0
- package/dist/types/constants.d.ts +11 -0
- package/dist/types/globalStyles.d.ts +3 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/mobileUtilities.d.ts +4 -0
- package/dist/types/spaceUtilities.d.ts +8 -0
- package/dist/types/styled/checkNamingConvention.d.ts +1 -0
- package/dist/types/styled/coerceWithDefaultTheme.d.ts +2 -0
- package/dist/types/styled/expressions/genStyleOverridesExpression.d.ts +3 -0
- package/dist/types/styled/expressions/genVariantOverridesExpression.d.ts +3 -0
- package/dist/types/styled/expressions/index.d.ts +2 -0
- package/dist/types/styled/fixStyleArg.d.ts +2 -0
- package/dist/types/styled/generated-attributes/generateAttributes.d.ts +2 -0
- package/dist/types/styled/generated-attributes/generateAutoCalculated.d.ts +2 -0
- package/dist/types/styled/generated-attributes/generateDisplayName.d.ts +2 -0
- package/dist/types/styled/generated-attributes/index.d.ts +1 -0
- package/dist/types/styled/generated-attributes/utils/callbackMerger.d.ts +3 -0
- package/dist/types/styled/generated-attributes/utils/refMerger.d.ts +7 -0
- package/dist/types/styled/helpers.d.ts +5 -0
- package/dist/types/styled/index.d.ts +6 -0
- package/dist/types/styled/styled.d.ts +7 -0
- package/dist/types/styled/styledFunction.d.ts +9 -0
- package/dist/types/styled/styledObject.d.ts +6 -0
- package/dist/types/styled/system-types.d.ts +74 -0
- package/dist/types/styled/system-utilities/background.d.ts +2 -0
- package/dist/types/styled/system-utilities/border.d.ts +1 -0
- package/dist/types/styled/system-utilities/color.d.ts +2 -0
- package/dist/types/styled/system-utilities/index.d.ts +6 -0
- package/dist/types/styled/system-utilities/sizing.d.ts +1 -0
- package/dist/types/styled/system-utilities/space.d.ts +3 -0
- package/dist/types/styled/system.d.ts +1 -0
- package/dist/types/styled/transformers/index.d.ts +1 -0
- package/dist/types/styled/transformers/magicCssTransform.d.ts +4 -0
- package/dist/types/styled/types.d.ts +42 -0
- package/dist/types/tests/arithmetic.test.d.ts +1 -0
- package/dist/types/th.d.ts +19 -0
- package/dist/types/theme.d.ts +2 -0
- package/dist/types/themeProviderHOC.d.ts +2 -0
- package/dist/types/utils.d.ts +41 -0
- package/dist/types/xStyledWrapper.d.ts +3 -0
- package/package.json +123 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var utils_exports = {};
|
|
30
|
+
__export(utils_exports, {
|
|
31
|
+
active: () => active,
|
|
32
|
+
animation: () => animation,
|
|
33
|
+
border: () => border,
|
|
34
|
+
boxShadow: () => boxShadow,
|
|
35
|
+
buttonLink: () => buttonLink,
|
|
36
|
+
clearFocus: () => clearFocus,
|
|
37
|
+
disabled: () => disabled,
|
|
38
|
+
fakeActive: () => fakeActive,
|
|
39
|
+
fakeBorder: () => fakeBorder,
|
|
40
|
+
flexCenter: () => flexCenter,
|
|
41
|
+
focus: () => focus,
|
|
42
|
+
focusAfter: () => focusAfter,
|
|
43
|
+
hover: () => hover,
|
|
44
|
+
iconColor: () => iconColor,
|
|
45
|
+
keyframes: () => keyframes,
|
|
46
|
+
kfrm: () => import_styled_components.keyframes,
|
|
47
|
+
onlyFirefox: () => onlyFirefox,
|
|
48
|
+
onlySafari: () => onlySafari,
|
|
49
|
+
onlySafariAndFirefox: () => onlySafariAndFirefox,
|
|
50
|
+
rgba: () => import_polished.rgba,
|
|
51
|
+
safariAndFirefoxBold: () => safariAndFirefoxBold,
|
|
52
|
+
textStyle: () => textStyle,
|
|
53
|
+
transition: () => transition,
|
|
54
|
+
truncate: () => truncate,
|
|
55
|
+
useTheme: () => import_styled_components.useTheme,
|
|
56
|
+
withTheme: () => import_styled_components.withTheme
|
|
57
|
+
});
|
|
58
|
+
module.exports = __toCommonJS(utils_exports);
|
|
59
|
+
var React = __toESM(require("react"));
|
|
60
|
+
var import_polished = require("polished");
|
|
61
|
+
var import_lodash = require("lodash");
|
|
62
|
+
var import_styled_components = require("@xstyled/styled-components");
|
|
63
|
+
var import_theme = require("./theme.js");
|
|
64
|
+
var import_mobileUtilities = require("./mobileUtilities.js");
|
|
65
|
+
var import_th = require("./th.js");
|
|
66
|
+
function truncate(width) {
|
|
67
|
+
return (props) => import_styled_components.css`
|
|
68
|
+
${!!width || props.width ? `width: ${props.width || width};` : ""}
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
function flexCenter() {
|
|
75
|
+
return `
|
|
76
|
+
display: flex;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-items: center;
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
function disabled() {
|
|
82
|
+
return `
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
function keyframes(obj) {
|
|
88
|
+
return import_styled_components.keyframes`${(0, import_lodash.reduce)(
|
|
89
|
+
obj,
|
|
90
|
+
(result, value, key) => `
|
|
91
|
+
${result}
|
|
92
|
+
${key}% {
|
|
93
|
+
${value}
|
|
94
|
+
}
|
|
95
|
+
`,
|
|
96
|
+
""
|
|
97
|
+
)}
|
|
98
|
+
`;
|
|
99
|
+
}
|
|
100
|
+
function boxShadow(top, left, blur, color, inset = false) {
|
|
101
|
+
return `box-shadow: ${inset ? "inset" : ""} ${top} ${left} ${blur} ${color};`;
|
|
102
|
+
}
|
|
103
|
+
function border(color = import_theme.theme.colors.brand[600], size = "1px", type = "solid") {
|
|
104
|
+
return `${size} ${type} ${color}`;
|
|
105
|
+
}
|
|
106
|
+
function animation(animationKeyframes, animationLength, animationTimingFn) {
|
|
107
|
+
return (props) => import_styled_components.css`
|
|
108
|
+
animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}
|
|
109
|
+
${props.animationTimingFn || animationTimingFn};
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
function focus(color = import_theme.theme.colors.brand[600]) {
|
|
113
|
+
return () => import_styled_components.css`
|
|
114
|
+
outline: none;
|
|
115
|
+
border: 1px solid ${color};
|
|
116
|
+
box-shadow: inset 0 0 0 1px ${(0, import_polished.lighten)(0.3, color)};
|
|
117
|
+
border-radius: 2px;
|
|
118
|
+
`;
|
|
119
|
+
}
|
|
120
|
+
function focusAfter(color) {
|
|
121
|
+
return import_styled_components.css`
|
|
122
|
+
outline: none;
|
|
123
|
+
position: relative;
|
|
124
|
+
&:after {
|
|
125
|
+
content: '';
|
|
126
|
+
z-index: 10;
|
|
127
|
+
position: absolute;
|
|
128
|
+
top: 0;
|
|
129
|
+
left: 0;
|
|
130
|
+
width: 100%;
|
|
131
|
+
height: 100%;
|
|
132
|
+
pointer-events: none;
|
|
133
|
+
${focus(color)}
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
function active() {
|
|
138
|
+
return (props) => import_styled_components.css`
|
|
139
|
+
outline: none;
|
|
140
|
+
border: 1px solid ${props.theme.colors.brand[700]};
|
|
141
|
+
border-radius: 2px;
|
|
142
|
+
`;
|
|
143
|
+
}
|
|
144
|
+
function hover() {
|
|
145
|
+
return (props) => import_styled_components.css`
|
|
146
|
+
outline: 1px solid ${props.theme.colors.brand[600]};
|
|
147
|
+
outline-offset: -1px;
|
|
148
|
+
`;
|
|
149
|
+
}
|
|
150
|
+
function textStyle(type, weight = "regular") {
|
|
151
|
+
return (props) => {
|
|
152
|
+
let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;
|
|
153
|
+
switch (type) {
|
|
154
|
+
case "h1":
|
|
155
|
+
cssVar += `
|
|
156
|
+
font-size: ${(0, import_mobileUtilities.toMobile)("2.7692rem")};
|
|
157
|
+
line-height: normal;
|
|
158
|
+
`;
|
|
159
|
+
break;
|
|
160
|
+
case "h2":
|
|
161
|
+
cssVar += `
|
|
162
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.title[800])};
|
|
163
|
+
line-height: normal;
|
|
164
|
+
`;
|
|
165
|
+
break;
|
|
166
|
+
case "h3":
|
|
167
|
+
cssVar += `
|
|
168
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.title[700])};
|
|
169
|
+
line-height: 1.2;
|
|
170
|
+
`;
|
|
171
|
+
break;
|
|
172
|
+
case "h4":
|
|
173
|
+
cssVar += `
|
|
174
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.title[600])};
|
|
175
|
+
line-height: normal;
|
|
176
|
+
`;
|
|
177
|
+
break;
|
|
178
|
+
case "h5":
|
|
179
|
+
cssVar += `
|
|
180
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.title[500])};
|
|
181
|
+
line-height: normal;
|
|
182
|
+
`;
|
|
183
|
+
break;
|
|
184
|
+
case "section-header":
|
|
185
|
+
cssVar += `
|
|
186
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.title[500])};
|
|
187
|
+
line-height: normal;
|
|
188
|
+
text-transform: uppercase;
|
|
189
|
+
`;
|
|
190
|
+
break;
|
|
191
|
+
case "body":
|
|
192
|
+
cssVar += `
|
|
193
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.value[400])};
|
|
194
|
+
line-height: normal;
|
|
195
|
+
`;
|
|
196
|
+
break;
|
|
197
|
+
case "body-small":
|
|
198
|
+
cssVar += `
|
|
199
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.value[300])};
|
|
200
|
+
line-height: normal;
|
|
201
|
+
`;
|
|
202
|
+
break;
|
|
203
|
+
case "body-micro":
|
|
204
|
+
cssVar += `
|
|
205
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.microText[200])};
|
|
206
|
+
line-height: normal;
|
|
207
|
+
`;
|
|
208
|
+
break;
|
|
209
|
+
case "list":
|
|
210
|
+
cssVar += `
|
|
211
|
+
font-size: ${(0, import_mobileUtilities.toMobile)(props.theme.fontSizes.value[400])};
|
|
212
|
+
line-height: normal;
|
|
213
|
+
`;
|
|
214
|
+
break;
|
|
215
|
+
case "link":
|
|
216
|
+
cssVar += `
|
|
217
|
+
line-height: ${props.theme.space.xl};
|
|
218
|
+
color: ${props.theme.colors.brand[600]};
|
|
219
|
+
cursor: pointer;
|
|
220
|
+
`;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
return cssVar;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function iconColor(variant = "neutral", type = 400) {
|
|
227
|
+
return import_styled_components.css`
|
|
228
|
+
fill: ${import_th.th.color(`${variant}-${type}`)};
|
|
229
|
+
`;
|
|
230
|
+
}
|
|
231
|
+
function fakeBorder() {
|
|
232
|
+
return import_styled_components.css`
|
|
233
|
+
box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};
|
|
234
|
+
border-radius: 2px;
|
|
235
|
+
`;
|
|
236
|
+
}
|
|
237
|
+
function fakeActive() {
|
|
238
|
+
return import_styled_components.css`
|
|
239
|
+
outline: none;
|
|
240
|
+
box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};
|
|
241
|
+
border-radius: 2px;
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
function clearFocus() {
|
|
245
|
+
return `
|
|
246
|
+
border: none;
|
|
247
|
+
box-shadow: none;
|
|
248
|
+
`;
|
|
249
|
+
}
|
|
250
|
+
function buttonLink() {
|
|
251
|
+
return `
|
|
252
|
+
background-color: transparent;
|
|
253
|
+
border: 1px solid transparent;
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
`;
|
|
256
|
+
}
|
|
257
|
+
function transition(t = "all 1s ease") {
|
|
258
|
+
return `
|
|
259
|
+
transition: ${t};
|
|
260
|
+
`;
|
|
261
|
+
}
|
|
262
|
+
const onlySafariAndFirefox = (styles) => import_styled_components.css`
|
|
263
|
+
@media not all and (min-resolution: 0.001dpcm) {
|
|
264
|
+
${styles}
|
|
265
|
+
}
|
|
266
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
267
|
+
${styles}
|
|
268
|
+
}
|
|
269
|
+
`;
|
|
270
|
+
const onlySafari = (styles) => `
|
|
271
|
+
@media not all and (min-resolution: 0.001dpcm) {
|
|
272
|
+
${styles}
|
|
273
|
+
}
|
|
274
|
+
`;
|
|
275
|
+
const onlyFirefox = (styles) => `
|
|
276
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
277
|
+
${styles}
|
|
278
|
+
}
|
|
279
|
+
`;
|
|
280
|
+
const safariAndFirefoxBold = (color) => `
|
|
281
|
+
@media not all and (min-resolution: 0.001dpcm) {
|
|
282
|
+
font-weight: 400;
|
|
283
|
+
-webkit-font-smoothing: subpixel-antialiased;
|
|
284
|
+
-webkit-text-stroke: 0.4px ${color};
|
|
285
|
+
}
|
|
286
|
+
@media screen and (min--moz-device-pixel-ratio: 0) {
|
|
287
|
+
font-weight: 400;
|
|
288
|
+
-webkit-font-smoothing: subpixel-antialiased;
|
|
289
|
+
-webkit-text-stroke: 0.4px ${color};
|
|
290
|
+
}
|
|
291
|
+
`;
|
|
292
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-shadow */\n\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\n\nimport type { Theme } from '@elliemae/pui-theme';\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport type { Keyframes, FlattenSimpleInterpolation } from 'styled-components';\nimport { css, withTheme, keyframes as kfrm, useTheme } from '@xstyled/styled-components';\nimport { theme } from './theme.js';\nimport { toMobile } from './mobileUtilities.js';\nimport { th } from './th.js';\n\nexport { withTheme, rgba, useTheme, kfrm };\n\ntype PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport function truncate(width?: string) {\n return (props: PropsWithTheme<{ width?: string }>) => css`\n ${!!width || props.width ? `width: ${(props.width || width) as string};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, string>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\n// export function color(variant = 'neutral', type: string | number = 400) {\n// return css`\n// color: ${th.color(`${variant}-${type}`)};\n// `;\n// }\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props: { animationKeyframes?: string; animationLength?: string; animationTimingFn?: string }) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props: PropsWithTheme) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props: PropsWithTheme) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight: keyof Theme['fontWeights'] = 'regular') {\n // eslint-disable-next-line complexity\n return (props: { theme: Theme }): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.space.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): FlattenSimpleInterpolation => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;A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;AAAA;AAAA;AAAA;AAAA,iCAI9B;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKA;AAAA;AAAA;",
|
|
6
|
+
"names": ["kfrm", "kfrm"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var xStyledWrapper_exports = {};
|
|
30
|
+
__export(xStyledWrapper_exports, {
|
|
31
|
+
XStyledWrapper: () => XStyledWrapper,
|
|
32
|
+
default: () => xStyledWrapper_default,
|
|
33
|
+
xStyledCommonProps: () => xStyledCommonProps
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(xStyledWrapper_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_index = require("./index.js");
|
|
38
|
+
var import_system = require("@xstyled/system");
|
|
39
|
+
const XStyledWrapper = (0, import_index.styled)("div")`
|
|
40
|
+
${import_index.typography}
|
|
41
|
+
${import_index.layout}
|
|
42
|
+
${import_index.space}
|
|
43
|
+
${import_index.sizing}
|
|
44
|
+
${import_index.background}
|
|
45
|
+
${import_index.borders}
|
|
46
|
+
${import_index.boxShadows}
|
|
47
|
+
${import_index.flexboxes}
|
|
48
|
+
${import_index.color}
|
|
49
|
+
`;
|
|
50
|
+
const xStyledCommonProps = (0, import_system.compose)(
|
|
51
|
+
import_index.typography,
|
|
52
|
+
import_index.background,
|
|
53
|
+
import_index.borders,
|
|
54
|
+
import_index.sizing,
|
|
55
|
+
import_index.space,
|
|
56
|
+
import_index.boxShadows,
|
|
57
|
+
import_index.flexboxes,
|
|
58
|
+
import_index.layout,
|
|
59
|
+
import_index.color
|
|
60
|
+
);
|
|
61
|
+
var xStyledWrapper_default = XStyledWrapper;
|
|
62
|
+
//# sourceMappingURL=xStyledWrapper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/xStyledWrapper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import {\n styled,\n typography,\n background,\n borders,\n sizing,\n space,\n boxShadows,\n flexboxes,\n layout,\n color,\n} from './index.js';\nimport type {} from '@xstyled/util';\nimport type {} from '@xstyled/system';\nimport { compose } from '@xstyled/system';\n\nexport const XStyledWrapper = styled('div')`\n ${typography}\n ${layout}\n ${space}\n ${sizing}\n ${background}\n ${borders}\n ${boxShadows}\n ${flexboxes}\n ${color}\n`;\n\nexport const xStyledCommonProps = compose(\n typography,\n background,\n borders,\n sizing,\n space,\n boxShadows,\n flexboxes,\n layout,\n color,\n);\n\nexport default XStyledWrapper;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAWO;AAGP,oBAAwB;AAEjB,MAAM,qBAAiB,qBAAO,KAAK;AAAA,IACtC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGG,MAAM,yBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function getNumberAndUnit(numberStrWithUnit) {
|
|
3
|
+
const matchResult = String(numberStrWithUnit).match(/[a-z]+|[(/^\-?\d*.\d+|\d+),?]+/gi);
|
|
4
|
+
let number = "0";
|
|
5
|
+
let unit = "px";
|
|
6
|
+
if (matchResult) {
|
|
7
|
+
[number, unit] = matchResult;
|
|
8
|
+
}
|
|
9
|
+
return { number, unit };
|
|
10
|
+
}
|
|
11
|
+
function op(operator, n1, n2) {
|
|
12
|
+
const { number, unit } = getNumberAndUnit(n1);
|
|
13
|
+
const { number: number2, unit: unit2 } = getNumberAndUnit(n2);
|
|
14
|
+
switch (operator) {
|
|
15
|
+
case "*":
|
|
16
|
+
return `${Number(number) * Number(number2)}${unit || unit2}`;
|
|
17
|
+
case "+":
|
|
18
|
+
return `${Number(number) + Number(number2)}${unit || unit2}`;
|
|
19
|
+
case "-":
|
|
20
|
+
return `${Number(number) - Number(number2)}${unit || unit2}`;
|
|
21
|
+
case "/":
|
|
22
|
+
return `${Number(number) / Number(number2)}${unit || unit2}`;
|
|
23
|
+
default:
|
|
24
|
+
return `${Number(number) + Number(number2)}${unit || unit2}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
getNumberAndUnit,
|
|
29
|
+
op
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=arithmetic.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/arithmetic.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export function getNumberAndUnit(numberStrWithUnit: string | number): { number: string; unit: string } {\n const matchResult = String(numberStrWithUnit).match(/[a-z]+|[(/^\\-?\\d*.\\d+|\\d+),?]+/gi);\n let number = '0';\n let unit = 'px';\n if (matchResult) {\n [number, unit] = matchResult;\n }\n\n return { number, unit };\n}\n\nexport function op(operator: string, n1: string, n2: string | number): string {\n const { number, unit } = getNumberAndUnit(n1);\n const { number: number2, unit: unit2 } = getNumberAndUnit(n2);\n switch (operator) {\n case '*':\n return `${Number(number) * Number(number2)}${unit || unit2}`;\n case '+':\n return `${Number(number) + Number(number2)}${unit || unit2}`;\n case '-':\n return `${Number(number) - Number(number2)}${unit || unit2}`;\n case '/':\n return `${Number(number) / Number(number2)}${unit || unit2}`;\n default:\n return `${Number(number) + Number(number2)}${unit || unit2}`;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,SAAS,iBAAiB,mBAAsE;AACrG,QAAM,cAAc,OAAO,iBAAiB,EAAE,MAAM,kCAAkC;AACtF,MAAI,SAAS;AACb,MAAI,OAAO;AACX,MAAI,aAAa;AACf,KAAC,QAAQ,IAAI,IAAI;AAAA,EACnB;AAEA,SAAO,EAAE,QAAQ,KAAK;AACxB;AAEO,SAAS,GAAG,UAAkB,IAAY,IAA6B;AAC5E,QAAM,EAAE,QAAQ,KAAK,IAAI,iBAAiB,EAAE;AAC5C,QAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,iBAAiB,EAAE;AAC5D,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD;AACE,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,EACzD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const desktopBaseFont = 13;
|
|
3
|
+
const mobileBaseFont = 16;
|
|
4
|
+
const translateUnits = {
|
|
5
|
+
"8px": "4px",
|
|
6
|
+
"16px": "8px",
|
|
7
|
+
"32px": "16px",
|
|
8
|
+
"48px": "24px",
|
|
9
|
+
"56px": "32px",
|
|
10
|
+
"64px": "48px",
|
|
11
|
+
"72px": "64px"
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
desktopBaseFont,
|
|
15
|
+
mobileBaseFont,
|
|
16
|
+
translateUnits
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/constants.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const desktopBaseFont = 13;\n\nexport const mobileBaseFont = 16;\n\nexport const translateUnits = {\n '8px': '4px',\n '16px': '8px',\n '32px': '16px',\n '48px': '24px',\n '56px': '32px',\n '64px': '48px',\n '72px': '64px',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,kBAAkB;AAExB,MAAM,iBAAiB;AAEvB,MAAM,iBAAiB;AAAA,EAC5B,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AACV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createGlobalStyle } from "./styled/index.js";
|
|
3
|
+
import { th } from "./th.js";
|
|
4
|
+
const GlobalStyles = createGlobalStyle`
|
|
5
|
+
// Here we setup the root font-sizes for mobile vs desktop
|
|
6
|
+
:root {
|
|
7
|
+
font-size: ${(props) => props.device === "desktop" ? "81.25%" : "100%"};
|
|
8
|
+
|
|
9
|
+
@media(min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
10
|
+
font-size: ${(props) => props.device === "mobile" ? "100%" : "81.25%"};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
overscroll-behavior-y: none;
|
|
16
|
+
|
|
17
|
+
font-size: 1rem; // since we correctly have set up the root font-sizes, we can use 1rem
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* fix sanitize */
|
|
21
|
+
::placeholder {
|
|
22
|
+
font-weight: ${th.fontWeight("regular")};
|
|
23
|
+
color: ${th.color("neutral-500")};
|
|
24
|
+
}
|
|
25
|
+
::-webkit-input-placeholder {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:where(svg:not([fill])) {
|
|
30
|
+
fill: unset;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
export {
|
|
34
|
+
GlobalStyles
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=globalStyles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/globalStyles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createGlobalStyle } from './styled/index.js';\nimport { th } from './th.js';\n\nexport const GlobalStyles = createGlobalStyle<{ device: 'desktop' | 'mobile' }>`\n // Here we setup the root font-sizes for mobile vs desktop\n :root {\n font-size: ${(props) => (props.device === 'desktop' ? '81.25%' : '100%')};\n\n @media(min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => (props.device === 'mobile' ? '100%' : '81.25%')};\n }\n }\n\n body {\n overscroll-behavior-y: none;\n\n font-size: 1rem; // since we correctly have set up the root font-sizes, we can use 1rem\n }\n\n /* fix sanitize */\n ::placeholder {\n font-weight: ${th.fontWeight('regular')};\n color: ${th.color('neutral-500')};\n }\n ::-webkit-input-placeholder {\n opacity: 1;\n }\n\n :where(svg:not([fill])) {\n fill: unset;\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAAyB;AAClC,SAAS,UAAU;AAEZ,MAAM,eAAe;AAAA;AAAA;AAAA,iBAGX,CAAC,UAAW,MAAM,WAAW,YAAY,WAAW;AAAA;AAAA,wBAE7C,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACtC,CAAC,UAAW,MAAM,WAAW,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAYjD,GAAG,WAAW,SAAS;AAAA,aAC7B,GAAG,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./globalStyles.js";
|
|
3
|
+
export * from "./spaceUtilities.js";
|
|
4
|
+
export * from "./mobileUtilities.js";
|
|
5
|
+
export * from "./utils.js";
|
|
6
|
+
export * from "./arithmetic.js";
|
|
7
|
+
export * from "./th.js";
|
|
8
|
+
export * from "./theme.js";
|
|
9
|
+
export * from "./styled/index.js";
|
|
10
|
+
import { position, typography } from "@xstyled/system";
|
|
11
|
+
import { themeProviderHOC } from "./themeProviderHOC.js";
|
|
12
|
+
import { ThemeContext } from "@xstyled/styled-components";
|
|
13
|
+
import { xStyledCommonProps, XStyledWrapper } from "./xStyledWrapper.js";
|
|
14
|
+
export {
|
|
15
|
+
ThemeContext,
|
|
16
|
+
XStyledWrapper,
|
|
17
|
+
position,
|
|
18
|
+
themeProviderHOC,
|
|
19
|
+
typography,
|
|
20
|
+
xStyledCommonProps
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './globalStyles.js';\nexport * from './spaceUtilities.js';\nexport * from './mobileUtilities.js';\nexport * from './utils.js';\nexport * from './arithmetic.js';\nexport * from './th.js';\nexport * from './theme.js';\nexport * from './styled/index.js';\nexport { position, typography } from '@xstyled/system';\nexport { themeProviderHOC } from './themeProviderHOC.js';\nexport { ThemeContext } from '@xstyled/styled-components';\nexport { xStyledCommonProps, XStyledWrapper } from './xStyledWrapper.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,UAAU,kBAAkB;AACrC,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { theme } from "./theme.js";
|
|
4
|
+
import { desktopBaseFont, mobileBaseFont, translateUnits } from "./constants.js";
|
|
5
|
+
function __UNSAFE_SPACE_TO_DIMSUM(unit) {
|
|
6
|
+
if (unit in translateUnits)
|
|
7
|
+
return translateUnits[unit];
|
|
8
|
+
return `${parseFloat(unit) * (mobileBaseFont / desktopBaseFont) / 2}px`;
|
|
9
|
+
}
|
|
10
|
+
const isMobile = () => {
|
|
11
|
+
if (!window)
|
|
12
|
+
return false;
|
|
13
|
+
return Number(theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
14
|
+
};
|
|
15
|
+
function toMobile(unit) {
|
|
16
|
+
if (!isMobile())
|
|
17
|
+
return unit;
|
|
18
|
+
return `${parseFloat(unit) * (desktopBaseFont / mobileBaseFont)}rem`;
|
|
19
|
+
}
|
|
20
|
+
const useIsMobile = () => {
|
|
21
|
+
const [mobile, setMobile] = useState(isMobile());
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
function handleResize() {
|
|
24
|
+
setMobile(isMobile());
|
|
25
|
+
}
|
|
26
|
+
window?.addEventListener("resize", handleResize);
|
|
27
|
+
return () => {
|
|
28
|
+
window?.removeEventListener("resize", handleResize);
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
|
+
if (!window)
|
|
32
|
+
return false;
|
|
33
|
+
return mobile;
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
__UNSAFE_SPACE_TO_DIMSUM,
|
|
37
|
+
isMobile,
|
|
38
|
+
toMobile,
|
|
39
|
+
useIsMobile
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=mobileUtilities.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/mobileUtilities.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/naming-convention */\nimport { useState, useEffect } from 'react';\nimport { theme } from './theme.js';\nimport { desktopBaseFont, mobileBaseFont, translateUnits } from './constants.js';\n\n// eslint-disable-next-line no-underscore-dangle\nexport function __UNSAFE_SPACE_TO_DIMSUM(unit: string): string {\n if (unit in translateUnits) return translateUnits[unit as keyof typeof translateUnits];\n return `${(parseFloat(unit) * (mobileBaseFont / desktopBaseFont)) / 2}px`;\n}\n\nexport const isMobile = (): boolean => {\n if (!window) return false;\n return Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;\n};\n\nexport function toMobile(unit: string): string {\n if (!isMobile()) return unit;\n return `${parseFloat(unit) * (desktopBaseFont / mobileBaseFont)}rem`;\n}\n\nexport const useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n window?.addEventListener('resize', handleResize);\n return () => {\n window?.removeEventListener('resize', handleResize);\n };\n }, []);\n\n if (!window) return false;\n return mobile;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,UAAU,iBAAiB;AACpC,SAAS,aAAa;AACtB,SAAS,iBAAiB,gBAAgB,sBAAsB;AAGzD,SAAS,yBAAyB,MAAsB;AAC7D,MAAI,QAAQ;AAAgB,WAAO,eAAe,IAAmC;AACrF,SAAO,GAAI,WAAW,IAAI,KAAK,iBAAiB,mBAAoB;AACtE;AAEO,MAAM,WAAW,MAAe;AACrC,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,OAAO,MAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEO,SAAS,SAAS,MAAsB;AAC7C,MAAI,CAAC,SAAS;AAAG,WAAO;AACxB,SAAO,GAAG,WAAW,IAAI,KAAK,kBAAkB;AAClD;AAEO,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAkB,SAAS,CAAC;AAExD,YAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|