@marigold/system 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +32 -9
- package/dist/index.mjs +28 -9
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -18,6 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
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.
|
|
21
25
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
26
|
mod
|
|
23
27
|
));
|
|
@@ -82,6 +86,7 @@ var pseudos = {
|
|
|
82
86
|
"&:error": createteSelector([selector.self], state.error),
|
|
83
87
|
"&:expanded": createteSelector([selector.self], state.expanded),
|
|
84
88
|
"&:required": createteSelector([selector.self], state.required),
|
|
89
|
+
// Selector for elements that are part of a group
|
|
85
90
|
"&:in-group": createteSelector(selector.grouped, state.none, selector.self),
|
|
86
91
|
"&:hover-group": createteSelector(
|
|
87
92
|
selector.grouped,
|
|
@@ -166,11 +171,7 @@ function ThemeProvider({
|
|
|
166
171
|
theme,
|
|
167
172
|
children
|
|
168
173
|
}) {
|
|
169
|
-
return /* @__PURE__ */ import_react3.default.createElement(import_react4.ThemeProvider, {
|
|
170
|
-
theme
|
|
171
|
-
}, /* @__PURE__ */ import_react3.default.createElement(InternalContext.Provider, {
|
|
172
|
-
value: theme
|
|
173
|
-
}, children));
|
|
174
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react4.ThemeProvider, { theme }, /* @__PURE__ */ import_react3.default.createElement(InternalContext.Provider, { value: theme }, children));
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
// src/components/Global/normalize.ts
|
|
@@ -179,13 +180,25 @@ var document = {
|
|
|
179
180
|
height: "100%"
|
|
180
181
|
},
|
|
181
182
|
html: {
|
|
183
|
+
/**
|
|
184
|
+
* Prevent Mobile Safari from zooming stuff ...
|
|
185
|
+
* Source: https://css-tricks.com/your-css-reset-needs-text-size-adjust-probably/
|
|
186
|
+
*/
|
|
182
187
|
textSizeAdjust: "none"
|
|
183
188
|
},
|
|
184
189
|
body: {
|
|
185
190
|
lineHeight: 1.5,
|
|
186
191
|
WebkitFontSmoothing: "antialiased",
|
|
192
|
+
/**
|
|
193
|
+
* We have to duplicate this here, since the "*" selector will not be
|
|
194
|
+
* applied to the body element if a custom `selector` is used.
|
|
195
|
+
*/
|
|
187
196
|
margin: 0
|
|
188
197
|
},
|
|
198
|
+
/**
|
|
199
|
+
* CSS snippet and idea from:
|
|
200
|
+
* https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/
|
|
201
|
+
*/
|
|
189
202
|
"@media screen and (prefers-reduced-motion: reduce), (update: slow)": {
|
|
190
203
|
"*": {
|
|
191
204
|
animationDuration: "0.001ms !important",
|
|
@@ -211,6 +224,10 @@ var element = {
|
|
|
211
224
|
display: "block",
|
|
212
225
|
maxWidth: "100%"
|
|
213
226
|
},
|
|
227
|
+
/**
|
|
228
|
+
* No `maxWidth` for SVG since this makes them responsive
|
|
229
|
+
* and will cause icons to shrink.
|
|
230
|
+
*/
|
|
214
231
|
svg: {
|
|
215
232
|
display: "block",
|
|
216
233
|
fill: "currentColor"
|
|
@@ -249,17 +266,23 @@ var element = {
|
|
|
249
266
|
};
|
|
250
267
|
|
|
251
268
|
// src/components/Global/Global.tsx
|
|
269
|
+
var mergeRoot = ({ body, ...rest }) => typeof body === "object" ? {
|
|
270
|
+
...body,
|
|
271
|
+
...rest
|
|
272
|
+
} : {
|
|
273
|
+
body,
|
|
274
|
+
...rest
|
|
275
|
+
};
|
|
252
276
|
var Global = ({ normalizeDocument = true, selector: selector2 }) => {
|
|
253
277
|
const { css, theme } = useTheme();
|
|
254
278
|
const rootStyles = css((theme == null ? void 0 : theme.root) || {});
|
|
255
279
|
const styles = [
|
|
256
280
|
normalizeDocument ? document : {},
|
|
281
|
+
// Prefix normalization and root styles with selector if provided.
|
|
257
282
|
selector2 ? { [`:where(${selector2})`]: element } : element,
|
|
258
|
-
selector2 ? { [`:where(${selector2})`]: rootStyles } : rootStyles
|
|
283
|
+
selector2 ? { [`:where(${selector2})`]: mergeRoot(rootStyles) } : rootStyles
|
|
259
284
|
];
|
|
260
|
-
return /* @__PURE__ */ import_react5.default.createElement(import_react6.Global, {
|
|
261
|
-
styles
|
|
262
|
-
});
|
|
285
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_react6.Global, { styles });
|
|
263
286
|
};
|
|
264
287
|
|
|
265
288
|
// src/components/SVG/SVG.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -42,6 +42,7 @@ var pseudos = {
|
|
|
42
42
|
"&:error": createteSelector([selector.self], state.error),
|
|
43
43
|
"&:expanded": createteSelector([selector.self], state.expanded),
|
|
44
44
|
"&:required": createteSelector([selector.self], state.required),
|
|
45
|
+
// Selector for elements that are part of a group
|
|
45
46
|
"&:in-group": createteSelector(selector.grouped, state.none, selector.self),
|
|
46
47
|
"&:hover-group": createteSelector(
|
|
47
48
|
selector.grouped,
|
|
@@ -133,11 +134,7 @@ function ThemeProvider({
|
|
|
133
134
|
theme,
|
|
134
135
|
children
|
|
135
136
|
}) {
|
|
136
|
-
return /* @__PURE__ */ React.createElement(EmotionProvider, {
|
|
137
|
-
theme
|
|
138
|
-
}, /* @__PURE__ */ React.createElement(InternalContext.Provider, {
|
|
139
|
-
value: theme
|
|
140
|
-
}, children));
|
|
137
|
+
return /* @__PURE__ */ React.createElement(EmotionProvider, { theme }, /* @__PURE__ */ React.createElement(InternalContext.Provider, { value: theme }, children));
|
|
141
138
|
}
|
|
142
139
|
|
|
143
140
|
// src/components/Global/normalize.ts
|
|
@@ -146,13 +143,25 @@ var document = {
|
|
|
146
143
|
height: "100%"
|
|
147
144
|
},
|
|
148
145
|
html: {
|
|
146
|
+
/**
|
|
147
|
+
* Prevent Mobile Safari from zooming stuff ...
|
|
148
|
+
* Source: https://css-tricks.com/your-css-reset-needs-text-size-adjust-probably/
|
|
149
|
+
*/
|
|
149
150
|
textSizeAdjust: "none"
|
|
150
151
|
},
|
|
151
152
|
body: {
|
|
152
153
|
lineHeight: 1.5,
|
|
153
154
|
WebkitFontSmoothing: "antialiased",
|
|
155
|
+
/**
|
|
156
|
+
* We have to duplicate this here, since the "*" selector will not be
|
|
157
|
+
* applied to the body element if a custom `selector` is used.
|
|
158
|
+
*/
|
|
154
159
|
margin: 0
|
|
155
160
|
},
|
|
161
|
+
/**
|
|
162
|
+
* CSS snippet and idea from:
|
|
163
|
+
* https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/
|
|
164
|
+
*/
|
|
156
165
|
"@media screen and (prefers-reduced-motion: reduce), (update: slow)": {
|
|
157
166
|
"*": {
|
|
158
167
|
animationDuration: "0.001ms !important",
|
|
@@ -178,6 +187,10 @@ var element = {
|
|
|
178
187
|
display: "block",
|
|
179
188
|
maxWidth: "100%"
|
|
180
189
|
},
|
|
190
|
+
/**
|
|
191
|
+
* No `maxWidth` for SVG since this makes them responsive
|
|
192
|
+
* and will cause icons to shrink.
|
|
193
|
+
*/
|
|
181
194
|
svg: {
|
|
182
195
|
display: "block",
|
|
183
196
|
fill: "currentColor"
|
|
@@ -216,17 +229,23 @@ var element = {
|
|
|
216
229
|
};
|
|
217
230
|
|
|
218
231
|
// src/components/Global/Global.tsx
|
|
232
|
+
var mergeRoot = ({ body, ...rest }) => typeof body === "object" ? {
|
|
233
|
+
...body,
|
|
234
|
+
...rest
|
|
235
|
+
} : {
|
|
236
|
+
body,
|
|
237
|
+
...rest
|
|
238
|
+
};
|
|
219
239
|
var Global = ({ normalizeDocument = true, selector: selector2 }) => {
|
|
220
240
|
const { css, theme } = useTheme();
|
|
221
241
|
const rootStyles = css((theme == null ? void 0 : theme.root) || {});
|
|
222
242
|
const styles = [
|
|
223
243
|
normalizeDocument ? document : {},
|
|
244
|
+
// Prefix normalization and root styles with selector if provided.
|
|
224
245
|
selector2 ? { [`:where(${selector2})`]: element } : element,
|
|
225
|
-
selector2 ? { [`:where(${selector2})`]: rootStyles } : rootStyles
|
|
246
|
+
selector2 ? { [`:where(${selector2})`]: mergeRoot(rootStyles) } : rootStyles
|
|
226
247
|
];
|
|
227
|
-
return /* @__PURE__ */ React2.createElement(EmotionGlobal, {
|
|
228
|
-
styles
|
|
229
|
-
});
|
|
248
|
+
return /* @__PURE__ */ React2.createElement(EmotionGlobal, { styles });
|
|
230
249
|
};
|
|
231
250
|
|
|
232
251
|
// src/components/SVG/SVG.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/system",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Marigold System Library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"directory": "packages/system"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@emotion/react": "11.10.
|
|
29
|
+
"@emotion/react": "11.10.6",
|
|
30
30
|
"@theme-ui/css": "0.15.4",
|
|
31
31
|
"csstype": "3.1.1",
|
|
32
32
|
"deepmerge": "^4.2.2",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/core": "7.20.12",
|
|
42
42
|
"react": "18.2.0",
|
|
43
|
-
"tsup": "6.
|
|
43
|
+
"tsup": "6.6.3",
|
|
44
44
|
"@marigold/tsconfig": "0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|