@hopper-ui/styled-system 0.3.0 → 1.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/CHANGELOG.md +13 -0
- package/dist/StyledSystemProvider.css +34 -34
- package/dist/StyledSystemProvider.d.ts +4 -4
- package/dist/StyledSystemProvider.js +13 -13
- package/dist/{chunk-SE26VHVR.js → chunk-2BSH225N.js} +1 -1
- package/dist/{chunk-P2EJTPCQ.js → chunk-37HGVAAN.js} +48 -470
- package/dist/{chunk-T2LQYER5.js → chunk-DRFY5W7M.js} +57 -13
- package/dist/{chunk-64BX3HCB.js → chunk-FQYMSLSL.js} +18 -19
- package/dist/{chunk-TAIACQMV.js → chunk-FTYCODSC.js} +2 -2
- package/dist/{chunk-ZKEMKHXY.js → chunk-IMYR3NDP.js} +1 -1
- package/dist/{chunk-3IK64CCG.js → chunk-JKXZGQAL.js} +27 -1
- package/dist/{chunk-GM53YQQK.js → chunk-KHRJTNYB.js} +35 -1
- package/dist/{chunk-PCGVOTW3.js → chunk-KKVEOD5L.js} +1 -1
- package/dist/{chunk-I37Y2R7V.js → chunk-QMDDVBCZ.js} +1 -1
- package/dist/{chunk-XFDSFXFS.js → chunk-TJX3I2ER.js} +5 -5
- package/dist/chunk-WQHLUUDG.js +37 -0
- package/dist/{chunk-D4JUIZCP.js → chunk-YZ3QMR47.js} +2 -2
- package/dist/global-styles/BodyStyleProvider.js +2 -2
- package/dist/html-wrappers/html.css +34 -34
- package/dist/html-wrappers/html.d.ts +36 -37
- package/dist/html-wrappers/html.js +6 -6
- package/dist/html-wrappers/htmlElement.css +34 -34
- package/dist/html-wrappers/htmlElement.d.ts +6 -4
- package/dist/html-wrappers/htmlElement.js +5 -5
- package/dist/index.css +34 -34
- package/dist/index.d.ts +8 -8
- package/dist/index.js +13 -13
- package/dist/{styled-system-props.d.ts → styledSystemProps.d.ts} +4 -6
- package/dist/styledSystemProps.js +2 -0
- package/dist/{styled-system-root-css-class.js → styledSystemRootCssClass.js} +1 -1
- package/dist/tokens/TokenProvider.js +5 -5
- package/dist/tokens/generated/darkSemanticTokens.js +2 -0
- package/dist/tokens/generated/{light-semantic-tokens.d.ts → lightSemanticTokens.d.ts} +26 -0
- package/dist/tokens/generated/lightSemanticTokens.js +2 -0
- package/dist/tokens/generated/{styled-system-to-token-mappings.js → styledSystemToTokenMappings.js} +1 -1
- package/dist/tokens/{token-mappings.d.ts → tokenMappings.d.ts} +54 -11
- package/dist/tokens/{token-mappings.js → tokenMappings.js} +2 -2
- package/dist/tokens/tokens.d.ts +28 -2
- package/dist/tokens/tokens.js +3 -3
- package/dist/useStyledSystem.css +31 -31
- package/dist/useStyledSystem.d.ts +9 -6
- package/dist/useStyledSystem.js +4 -4
- package/package.json +18 -19
- package/dist/chunk-3JABKEIH.js +0 -29
- package/dist/styled-system-props.js +0 -2
- package/dist/tokens/generated/dark-semantic-tokens.js +0 -2
- package/dist/tokens/generated/light-semantic-tokens.js +0 -2
- /package/dist/{styled-system-root-css-class.d.ts → styledSystemRootCssClass.d.ts} +0 -0
- /package/dist/tokens/generated/{dark-semantic-tokens.d.ts → darkSemanticTokens.d.ts} +0 -0
- /package/dist/tokens/generated/{styled-system-to-token-mappings.d.ts → styledSystemToTokenMappings.d.ts} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { parseResponsiveSystemValue, ColorExpressionTypes, DefaultBorderWidthAndStyle, BackgroundColorMapping, BorderMapping, BorderRadiusMapping, BoxShadowMapping, TextColorMapping, SimpleMarginMapping, IconColorMapping, FontFamilyMapping, FontSizeMapping, FontWeightMapping,
|
|
1
|
+
import { parseResponsiveSystemValue, ColorExpressionTypes, DefaultBorderWidthAndStyle, SizingMapping, BackgroundColorMapping, BorderMapping, BorderRadiusMapping, BoxShadowMapping, TextColorMapping, SimpleMarginMapping, IconColorMapping, FontFamilyMapping, FontSizeMapping, FontWeightMapping, LineHeightMapping, ComplexMarginMapping, ComplexPaddingMapping, SimplePaddingMapping } from './chunk-DRFY5W7M.js';
|
|
2
2
|
import { parseResponsiveValue } from './chunk-SFOVKOPG.js';
|
|
3
3
|
import { useBreakpointContext } from './chunk-VBKLISDI.js';
|
|
4
4
|
import { isNil } from './chunk-U5R6ZXH3.js';
|
|
5
|
-
import { UnsafePrefix } from './chunk-
|
|
5
|
+
import { UnsafePrefix } from './chunk-QMDDVBCZ.js';
|
|
6
6
|
import { __privateAdd, __publicField, __privateSet, __privateGet } from './chunk-6LX4VMOV.js';
|
|
7
|
-
import { useMemo } from 'react';
|
|
8
7
|
|
|
9
8
|
// css-module:./UseStyledSystem.module.css#css-module
|
|
10
|
-
var UseStyledSystem_module_default = { "hop-b-hover": "UseStyledSystem-module__hop-b-
|
|
9
|
+
var UseStyledSystem_module_default = { "hop-b-hover": "UseStyledSystem-module__hop-b-hover___v8kki", "hop-bb-hover": "UseStyledSystem-module__hop-bb-hover___s6F81", "hop-bl-hover": "UseStyledSystem-module__hop-bl-hover___tO04m", "hop-br-hover": "UseStyledSystem-module__hop-br-hover___OWDdB", "hop-bt-hover": "UseStyledSystem-module__hop-bt-hover___vZ-JR", "hop-b-focus": "UseStyledSystem-module__hop-b-focus___eLvPm", "hop-bb-focus": "UseStyledSystem-module__hop-bb-focus___RQ0ux", "hop-bl-focus": "UseStyledSystem-module__hop-bl-focus___b4F4D", "hop-br-focus": "UseStyledSystem-module__hop-br-focus___YvZ0-", "hop-bt-focus": "UseStyledSystem-module__hop-bt-focus___kmT9B", "hop-b-active": "UseStyledSystem-module__hop-b-active___jKktg", "hop-bb-active": "UseStyledSystem-module__hop-bb-active___F9aRL", "hop-bl-active": "UseStyledSystem-module__hop-bl-active___7b6w-", "hop-br-active": "UseStyledSystem-module__hop-br-active___a76LS", "hop-bt-active": "UseStyledSystem-module__hop-bt-active___Y8R5g", "hop-bg-hover": "UseStyledSystem-module__hop-bg-hover___rjc8F", "hop-bg-focus": "UseStyledSystem-module__hop-bg-focus___0R4Lu", "hop-bg-active": "UseStyledSystem-module__hop-bg-active___pmKdb", "hop-bs-hover": "UseStyledSystem-module__hop-bs-hover___-OvG-", "hop-bs-focus": "UseStyledSystem-module__hop-bs-focus___JiReX", "hop-bs-active": "UseStyledSystem-module__hop-bs-active___Jmvvh", "hop-c-hover": "UseStyledSystem-module__hop-c-hover___YhtkL", "hop-c-focus": "UseStyledSystem-module__hop-c-focus___Aq77N", "hop-c-active": "UseStyledSystem-module__hop-c-active___QQsU9", "hop-cs-hover": "UseStyledSystem-module__hop-cs-hover___S7jfy", "hop-f-hover": "UseStyledSystem-module__hop-f-hover___5m-9L", "hop-f-focus": "UseStyledSystem-module__hop-f-focus___LLUi6", "hop-o-hover": "UseStyledSystem-module__hop-o-hover___bjLYo", "hop-o-focus": "UseStyledSystem-module__hop-o-focus___eIchf", "hop-o-active": "UseStyledSystem-module__hop-o-active___qCLhG", "hop-ol-focus": "UseStyledSystem-module__hop-ol-focus___UcPDK" };
|
|
11
10
|
|
|
12
11
|
// src/useStyledSystem.ts
|
|
13
12
|
function createSystemValueHandler(systemValues) {
|
|
@@ -88,6 +87,24 @@ var gridRowSpanHandler = (name, value, context) => {
|
|
|
88
87
|
context.addStyleValue("gridRow", `span ${parsedValue} / span ${parsedValue}`);
|
|
89
88
|
}
|
|
90
89
|
};
|
|
90
|
+
var gridTemplateDimensionsHandler = (name, value, context) => {
|
|
91
|
+
let parsedValue = parseResponsiveSystemValue(value, SizingMapping, context.matchedBreakpoints);
|
|
92
|
+
if (!isNil(parsedValue)) {
|
|
93
|
+
if (Array.isArray(parsedValue)) {
|
|
94
|
+
parsedValue = parsedValue.map((x) => parseResponsiveSystemValue(x, SizingMapping, context.matchedBreakpoints)).join(" ");
|
|
95
|
+
}
|
|
96
|
+
context.addStyleValue(name, parsedValue);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var gridTemplateAreasHandler = (name, value, context) => {
|
|
100
|
+
let parsedValue = parseResponsiveValue(value, context.matchedBreakpoints);
|
|
101
|
+
if (!isNil(parsedValue)) {
|
|
102
|
+
if (Array.isArray(parsedValue)) {
|
|
103
|
+
parsedValue = parsedValue.map((v) => `"${v}"`).join(" ");
|
|
104
|
+
}
|
|
105
|
+
context.addStyleValue("gridTemplateAreas", parsedValue);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
91
108
|
var PropsHandlers = {
|
|
92
109
|
alignContent: createPassthroughHandler(),
|
|
93
110
|
alignItems: createPassthroughHandler(),
|
|
@@ -171,9 +188,9 @@ var PropsHandlers = {
|
|
|
171
188
|
gridRowSpan: gridRowSpanHandler,
|
|
172
189
|
gridRowStart: createPassthroughHandler(),
|
|
173
190
|
gridTemplate: createPassthroughHandler(),
|
|
174
|
-
gridTemplateAreas:
|
|
175
|
-
gridTemplateColumns:
|
|
176
|
-
gridTemplateRows:
|
|
191
|
+
gridTemplateAreas: gridTemplateAreasHandler,
|
|
192
|
+
gridTemplateColumns: gridTemplateDimensionsHandler,
|
|
193
|
+
gridTemplateRows: gridTemplateDimensionsHandler,
|
|
177
194
|
height: createSystemValueHandler(SizingMapping),
|
|
178
195
|
justifyContent: createPassthroughHandler(),
|
|
179
196
|
justifyItems: createPassthroughHandler(),
|
|
@@ -244,7 +261,7 @@ var StylingContext = class {
|
|
|
244
261
|
__privateAdd(this, _style, void 0);
|
|
245
262
|
__publicField(this, "matchedBreakpoints");
|
|
246
263
|
__privateSet(this, _classes, !isNil(className) ? [className] : []);
|
|
247
|
-
__privateSet(this, _style, { ...style });
|
|
264
|
+
__privateSet(this, _style, { ...style != null ? style : {} });
|
|
248
265
|
this.matchedBreakpoints = matchedBreakpoints;
|
|
249
266
|
}
|
|
250
267
|
addClass(className) {
|
|
@@ -265,471 +282,32 @@ var StylingContext = class {
|
|
|
265
282
|
};
|
|
266
283
|
_classes = new WeakMap();
|
|
267
284
|
_style = new WeakMap();
|
|
285
|
+
function convertStyleProps(props, handlers, matchedBreakpoints) {
|
|
286
|
+
const context = new StylingContext(void 0, void 0, matchedBreakpoints);
|
|
287
|
+
Object.keys(props).forEach((key) => {
|
|
288
|
+
const value = props[key];
|
|
289
|
+
if (!isNil(value)) {
|
|
290
|
+
const cssProperty = key.toString().replace(UnsafePrefix, "");
|
|
291
|
+
const handler = handlers[cssProperty];
|
|
292
|
+
if (!isNil(handler)) {
|
|
293
|
+
handler(cssProperty, value, context);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
return context.computeStyling();
|
|
298
|
+
}
|
|
299
|
+
function removeStyledSystemProps(props) {
|
|
300
|
+
return Object.keys(props).filter((x) => !isStyledSystemProp(x)).reduce((acc, key) => {
|
|
301
|
+
acc[key] = props[key];
|
|
302
|
+
return acc;
|
|
303
|
+
}, {});
|
|
304
|
+
}
|
|
268
305
|
function useStyledSystem(props) {
|
|
269
|
-
const {
|
|
270
|
-
alignContent,
|
|
271
|
-
alignItems,
|
|
272
|
-
alignSelf,
|
|
273
|
-
aspectRatio,
|
|
274
|
-
backgroundColor,
|
|
275
|
-
backgroundColorActive,
|
|
276
|
-
backgroundColorFocus,
|
|
277
|
-
backgroundColorHover,
|
|
278
|
-
backgroundImage,
|
|
279
|
-
backgroundPosition,
|
|
280
|
-
backgroundRepeat,
|
|
281
|
-
backgroundSize,
|
|
282
|
-
border,
|
|
283
|
-
borderActive,
|
|
284
|
-
borderBottom,
|
|
285
|
-
borderBottomActive,
|
|
286
|
-
borderBottomFocus,
|
|
287
|
-
borderBottomHover,
|
|
288
|
-
borderBottomLeftRadius,
|
|
289
|
-
borderBottomRightRadius,
|
|
290
|
-
borderFocus,
|
|
291
|
-
borderHover,
|
|
292
|
-
borderLeft,
|
|
293
|
-
borderLeftActive,
|
|
294
|
-
borderLeftFocus,
|
|
295
|
-
borderLeftHover,
|
|
296
|
-
borderRadius,
|
|
297
|
-
borderRight,
|
|
298
|
-
borderRightActive,
|
|
299
|
-
borderRightFocus,
|
|
300
|
-
borderRightHover,
|
|
301
|
-
borderTop,
|
|
302
|
-
borderTopActive,
|
|
303
|
-
borderTopFocus,
|
|
304
|
-
borderTopHover,
|
|
305
|
-
borderTopLeftRadius,
|
|
306
|
-
borderTopRightRadius,
|
|
307
|
-
bottom,
|
|
308
|
-
boxShadow,
|
|
309
|
-
boxShadowActive,
|
|
310
|
-
boxShadowFocus,
|
|
311
|
-
boxShadowHover,
|
|
312
|
-
className,
|
|
313
|
-
color,
|
|
314
|
-
colorActive,
|
|
315
|
-
colorFocus,
|
|
316
|
-
colorHover,
|
|
317
|
-
columnGap,
|
|
318
|
-
content,
|
|
319
|
-
contentVisibility,
|
|
320
|
-
cursor,
|
|
321
|
-
cursorHover,
|
|
322
|
-
display,
|
|
323
|
-
fill,
|
|
324
|
-
fillFocus,
|
|
325
|
-
fillHover,
|
|
326
|
-
filter,
|
|
327
|
-
flex,
|
|
328
|
-
flexBasis,
|
|
329
|
-
flexDirection,
|
|
330
|
-
flexFlow,
|
|
331
|
-
flexGrow,
|
|
332
|
-
flexShrink,
|
|
333
|
-
flexWrap,
|
|
334
|
-
fontFamily,
|
|
335
|
-
fontSize,
|
|
336
|
-
fontStyle,
|
|
337
|
-
fontWeight,
|
|
338
|
-
gap,
|
|
339
|
-
grid,
|
|
340
|
-
gridArea,
|
|
341
|
-
gridAutoColumns,
|
|
342
|
-
gridAutoFlow,
|
|
343
|
-
gridAutoRows,
|
|
344
|
-
gridColumn,
|
|
345
|
-
gridColumnEnd,
|
|
346
|
-
gridColumnSpan,
|
|
347
|
-
gridColumnStart,
|
|
348
|
-
gridRow,
|
|
349
|
-
gridRowEnd,
|
|
350
|
-
gridRowSpan,
|
|
351
|
-
gridRowStart,
|
|
352
|
-
gridTemplate,
|
|
353
|
-
gridTemplateAreas,
|
|
354
|
-
gridTemplateColumns,
|
|
355
|
-
gridTemplateRows,
|
|
356
|
-
height,
|
|
357
|
-
justifyContent,
|
|
358
|
-
justifyItems,
|
|
359
|
-
justifySelf,
|
|
360
|
-
left,
|
|
361
|
-
letterSpacing,
|
|
362
|
-
lineHeight,
|
|
363
|
-
margin,
|
|
364
|
-
marginBottom,
|
|
365
|
-
marginLeft,
|
|
366
|
-
marginRight,
|
|
367
|
-
marginTop,
|
|
368
|
-
marginX,
|
|
369
|
-
marginY,
|
|
370
|
-
maxHeight,
|
|
371
|
-
maxWidth,
|
|
372
|
-
minHeight,
|
|
373
|
-
minWidth,
|
|
374
|
-
objectFit,
|
|
375
|
-
objectPosition,
|
|
376
|
-
opacity,
|
|
377
|
-
opacityActive,
|
|
378
|
-
opacityFocus,
|
|
379
|
-
opacityHover,
|
|
380
|
-
order,
|
|
381
|
-
outline,
|
|
382
|
-
outlineFocus,
|
|
383
|
-
overflow,
|
|
384
|
-
overflowX,
|
|
385
|
-
overflowY,
|
|
386
|
-
padding,
|
|
387
|
-
paddingBottom,
|
|
388
|
-
paddingLeft,
|
|
389
|
-
paddingRight,
|
|
390
|
-
paddingTop,
|
|
391
|
-
paddingX,
|
|
392
|
-
paddingY,
|
|
393
|
-
pointerEvents,
|
|
394
|
-
position,
|
|
395
|
-
resize,
|
|
396
|
-
right,
|
|
397
|
-
rowGap,
|
|
398
|
-
stroke,
|
|
399
|
-
style,
|
|
400
|
-
textAlign,
|
|
401
|
-
textDecoration,
|
|
402
|
-
textOverflow,
|
|
403
|
-
textTransform,
|
|
404
|
-
top,
|
|
405
|
-
transform,
|
|
406
|
-
transformOrigin,
|
|
407
|
-
transformStyle,
|
|
408
|
-
transition,
|
|
409
|
-
UNSAFE_backgroundColor,
|
|
410
|
-
UNSAFE_backgroundColorActive,
|
|
411
|
-
UNSAFE_backgroundColorFocus,
|
|
412
|
-
UNSAFE_backgroundColorHover,
|
|
413
|
-
UNSAFE_border,
|
|
414
|
-
UNSAFE_borderActive,
|
|
415
|
-
UNSAFE_borderBottom,
|
|
416
|
-
UNSAFE_borderBottomActive,
|
|
417
|
-
UNSAFE_borderBottomFocus,
|
|
418
|
-
UNSAFE_borderBottomHover,
|
|
419
|
-
UNSAFE_borderBottomLeftRadius,
|
|
420
|
-
UNSAFE_borderBottomRightRadius,
|
|
421
|
-
UNSAFE_borderFocus,
|
|
422
|
-
UNSAFE_borderHover,
|
|
423
|
-
UNSAFE_borderLeft,
|
|
424
|
-
UNSAFE_borderLeftActive,
|
|
425
|
-
UNSAFE_borderLeftFocus,
|
|
426
|
-
UNSAFE_borderLeftHover,
|
|
427
|
-
UNSAFE_borderRadius,
|
|
428
|
-
UNSAFE_borderRight,
|
|
429
|
-
UNSAFE_borderRightActive,
|
|
430
|
-
UNSAFE_borderRightFocus,
|
|
431
|
-
UNSAFE_borderRightHover,
|
|
432
|
-
UNSAFE_borderTop,
|
|
433
|
-
UNSAFE_borderTopActive,
|
|
434
|
-
UNSAFE_borderTopFocus,
|
|
435
|
-
UNSAFE_borderTopHover,
|
|
436
|
-
UNSAFE_borderTopLeftRadius,
|
|
437
|
-
UNSAFE_borderTopRightRadius,
|
|
438
|
-
UNSAFE_boxShadow,
|
|
439
|
-
UNSAFE_boxShadowActive,
|
|
440
|
-
UNSAFE_boxShadowFocus,
|
|
441
|
-
UNSAFE_boxShadowHover,
|
|
442
|
-
UNSAFE_color,
|
|
443
|
-
UNSAFE_colorActive,
|
|
444
|
-
UNSAFE_colorFocus,
|
|
445
|
-
UNSAFE_colorHover,
|
|
446
|
-
UNSAFE_columnGap,
|
|
447
|
-
UNSAFE_fill,
|
|
448
|
-
UNSAFE_fillFocus,
|
|
449
|
-
UNSAFE_fillHover,
|
|
450
|
-
UNSAFE_fontFamily,
|
|
451
|
-
UNSAFE_fontSize,
|
|
452
|
-
UNSAFE_fontWeight,
|
|
453
|
-
UNSAFE_gap,
|
|
454
|
-
UNSAFE_gridAutoColumns,
|
|
455
|
-
UNSAFE_gridAutoRows,
|
|
456
|
-
UNSAFE_gridColumnSpan,
|
|
457
|
-
UNSAFE_gridRowSpan,
|
|
458
|
-
UNSAFE_gridTemplateColumns,
|
|
459
|
-
UNSAFE_gridTemplateRows,
|
|
460
|
-
UNSAFE_height,
|
|
461
|
-
UNSAFE_lineHeight,
|
|
462
|
-
UNSAFE_margin,
|
|
463
|
-
UNSAFE_marginBottom,
|
|
464
|
-
UNSAFE_marginLeft,
|
|
465
|
-
UNSAFE_marginRight,
|
|
466
|
-
UNSAFE_marginTop,
|
|
467
|
-
UNSAFE_marginX,
|
|
468
|
-
UNSAFE_marginY,
|
|
469
|
-
UNSAFE_maxHeight,
|
|
470
|
-
UNSAFE_maxWidth,
|
|
471
|
-
UNSAFE_minHeight,
|
|
472
|
-
UNSAFE_minWidth,
|
|
473
|
-
UNSAFE_padding,
|
|
474
|
-
UNSAFE_paddingBottom,
|
|
475
|
-
UNSAFE_paddingLeft,
|
|
476
|
-
UNSAFE_paddingRight,
|
|
477
|
-
UNSAFE_paddingTop,
|
|
478
|
-
UNSAFE_paddingX,
|
|
479
|
-
UNSAFE_paddingY,
|
|
480
|
-
UNSAFE_rowGap,
|
|
481
|
-
UNSAFE_stroke,
|
|
482
|
-
UNSAFE_width,
|
|
483
|
-
verticalAlign,
|
|
484
|
-
visibility,
|
|
485
|
-
whiteSpace,
|
|
486
|
-
width,
|
|
487
|
-
willChange,
|
|
488
|
-
wordBreak,
|
|
489
|
-
zIndex,
|
|
490
|
-
...rest
|
|
491
|
-
} = props;
|
|
492
306
|
const { matchedBreakpoints } = useBreakpointContext();
|
|
493
|
-
const
|
|
494
|
-
const context = new StylingContext(className, style, matchedBreakpoints);
|
|
495
|
-
Object.keys(props).forEach((key) => {
|
|
496
|
-
const value = props[key];
|
|
497
|
-
if (!isNil(value)) {
|
|
498
|
-
const cssProperty = key.replace(UnsafePrefix, "");
|
|
499
|
-
const handler = PropsHandlers[cssProperty];
|
|
500
|
-
if (!isNil(handler)) {
|
|
501
|
-
handler(cssProperty, value, context);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
});
|
|
505
|
-
return context.computeStyling();
|
|
506
|
-
}, [
|
|
507
|
-
alignContent,
|
|
508
|
-
alignItems,
|
|
509
|
-
alignSelf,
|
|
510
|
-
aspectRatio,
|
|
511
|
-
backgroundColor,
|
|
512
|
-
backgroundColorActive,
|
|
513
|
-
backgroundColorFocus,
|
|
514
|
-
backgroundColorHover,
|
|
515
|
-
backgroundImage,
|
|
516
|
-
backgroundPosition,
|
|
517
|
-
backgroundRepeat,
|
|
518
|
-
backgroundSize,
|
|
519
|
-
border,
|
|
520
|
-
borderActive,
|
|
521
|
-
borderBottom,
|
|
522
|
-
borderBottomActive,
|
|
523
|
-
borderBottomFocus,
|
|
524
|
-
borderBottomHover,
|
|
525
|
-
borderBottomLeftRadius,
|
|
526
|
-
borderBottomRightRadius,
|
|
527
|
-
borderFocus,
|
|
528
|
-
borderHover,
|
|
529
|
-
borderLeft,
|
|
530
|
-
borderLeftActive,
|
|
531
|
-
borderLeftFocus,
|
|
532
|
-
borderLeftHover,
|
|
533
|
-
borderRadius,
|
|
534
|
-
borderRight,
|
|
535
|
-
borderRightActive,
|
|
536
|
-
borderRightFocus,
|
|
537
|
-
borderRightHover,
|
|
538
|
-
borderTop,
|
|
539
|
-
borderTopActive,
|
|
540
|
-
borderTopFocus,
|
|
541
|
-
borderTopHover,
|
|
542
|
-
borderTopLeftRadius,
|
|
543
|
-
borderTopRightRadius,
|
|
544
|
-
bottom,
|
|
545
|
-
boxShadow,
|
|
546
|
-
boxShadowActive,
|
|
547
|
-
boxShadowFocus,
|
|
548
|
-
boxShadowHover,
|
|
549
|
-
className,
|
|
550
|
-
color,
|
|
551
|
-
colorActive,
|
|
552
|
-
colorFocus,
|
|
553
|
-
colorHover,
|
|
554
|
-
columnGap,
|
|
555
|
-
content,
|
|
556
|
-
contentVisibility,
|
|
557
|
-
cursor,
|
|
558
|
-
cursorHover,
|
|
559
|
-
display,
|
|
560
|
-
fill,
|
|
561
|
-
fillFocus,
|
|
562
|
-
fillHover,
|
|
563
|
-
filter,
|
|
564
|
-
flex,
|
|
565
|
-
flexBasis,
|
|
566
|
-
flexDirection,
|
|
567
|
-
flexFlow,
|
|
568
|
-
flexGrow,
|
|
569
|
-
flexShrink,
|
|
570
|
-
flexWrap,
|
|
571
|
-
fontFamily,
|
|
572
|
-
fontSize,
|
|
573
|
-
fontStyle,
|
|
574
|
-
fontWeight,
|
|
575
|
-
gap,
|
|
576
|
-
grid,
|
|
577
|
-
gridArea,
|
|
578
|
-
gridAutoColumns,
|
|
579
|
-
gridAutoFlow,
|
|
580
|
-
gridAutoRows,
|
|
581
|
-
gridColumn,
|
|
582
|
-
gridColumnEnd,
|
|
583
|
-
gridColumnSpan,
|
|
584
|
-
gridColumnStart,
|
|
585
|
-
gridRow,
|
|
586
|
-
gridRowEnd,
|
|
587
|
-
gridRowSpan,
|
|
588
|
-
gridRowStart,
|
|
589
|
-
gridTemplate,
|
|
590
|
-
gridTemplateAreas,
|
|
591
|
-
gridTemplateColumns,
|
|
592
|
-
gridTemplateRows,
|
|
593
|
-
height,
|
|
594
|
-
justifyContent,
|
|
595
|
-
justifyItems,
|
|
596
|
-
justifySelf,
|
|
597
|
-
left,
|
|
598
|
-
letterSpacing,
|
|
599
|
-
lineHeight,
|
|
600
|
-
margin,
|
|
601
|
-
marginBottom,
|
|
602
|
-
marginLeft,
|
|
603
|
-
marginRight,
|
|
604
|
-
marginTop,
|
|
605
|
-
marginX,
|
|
606
|
-
marginY,
|
|
607
|
-
matchedBreakpoints,
|
|
608
|
-
maxHeight,
|
|
609
|
-
maxWidth,
|
|
610
|
-
minHeight,
|
|
611
|
-
minWidth,
|
|
612
|
-
objectFit,
|
|
613
|
-
objectPosition,
|
|
614
|
-
opacity,
|
|
615
|
-
opacityActive,
|
|
616
|
-
opacityFocus,
|
|
617
|
-
opacityHover,
|
|
618
|
-
order,
|
|
619
|
-
outline,
|
|
620
|
-
outlineFocus,
|
|
621
|
-
overflow,
|
|
622
|
-
overflowX,
|
|
623
|
-
overflowY,
|
|
624
|
-
padding,
|
|
625
|
-
paddingBottom,
|
|
626
|
-
paddingLeft,
|
|
627
|
-
paddingRight,
|
|
628
|
-
paddingTop,
|
|
629
|
-
paddingX,
|
|
630
|
-
paddingY,
|
|
631
|
-
pointerEvents,
|
|
632
|
-
position,
|
|
633
|
-
resize,
|
|
634
|
-
right,
|
|
635
|
-
rowGap,
|
|
636
|
-
stroke,
|
|
637
|
-
style,
|
|
638
|
-
textAlign,
|
|
639
|
-
textDecoration,
|
|
640
|
-
textOverflow,
|
|
641
|
-
textTransform,
|
|
642
|
-
top,
|
|
643
|
-
transform,
|
|
644
|
-
transformOrigin,
|
|
645
|
-
transformStyle,
|
|
646
|
-
transition,
|
|
647
|
-
UNSAFE_backgroundColor,
|
|
648
|
-
UNSAFE_backgroundColorActive,
|
|
649
|
-
UNSAFE_backgroundColorFocus,
|
|
650
|
-
UNSAFE_backgroundColorHover,
|
|
651
|
-
UNSAFE_border,
|
|
652
|
-
UNSAFE_borderActive,
|
|
653
|
-
UNSAFE_borderBottom,
|
|
654
|
-
UNSAFE_borderBottomActive,
|
|
655
|
-
UNSAFE_borderBottomFocus,
|
|
656
|
-
UNSAFE_borderBottomHover,
|
|
657
|
-
UNSAFE_borderBottomLeftRadius,
|
|
658
|
-
UNSAFE_borderBottomRightRadius,
|
|
659
|
-
UNSAFE_borderFocus,
|
|
660
|
-
UNSAFE_borderHover,
|
|
661
|
-
UNSAFE_borderLeft,
|
|
662
|
-
UNSAFE_borderLeftActive,
|
|
663
|
-
UNSAFE_borderLeftFocus,
|
|
664
|
-
UNSAFE_borderLeftHover,
|
|
665
|
-
UNSAFE_borderRadius,
|
|
666
|
-
UNSAFE_borderRight,
|
|
667
|
-
UNSAFE_borderRightActive,
|
|
668
|
-
UNSAFE_borderRightFocus,
|
|
669
|
-
UNSAFE_borderRightHover,
|
|
670
|
-
UNSAFE_borderTop,
|
|
671
|
-
UNSAFE_borderTopActive,
|
|
672
|
-
UNSAFE_borderTopFocus,
|
|
673
|
-
UNSAFE_borderTopHover,
|
|
674
|
-
UNSAFE_borderTopLeftRadius,
|
|
675
|
-
UNSAFE_borderTopRightRadius,
|
|
676
|
-
UNSAFE_boxShadow,
|
|
677
|
-
UNSAFE_boxShadowActive,
|
|
678
|
-
UNSAFE_boxShadowFocus,
|
|
679
|
-
UNSAFE_boxShadowHover,
|
|
680
|
-
UNSAFE_color,
|
|
681
|
-
UNSAFE_colorActive,
|
|
682
|
-
UNSAFE_colorFocus,
|
|
683
|
-
UNSAFE_colorHover,
|
|
684
|
-
UNSAFE_columnGap,
|
|
685
|
-
UNSAFE_fill,
|
|
686
|
-
UNSAFE_fillFocus,
|
|
687
|
-
UNSAFE_fillHover,
|
|
688
|
-
UNSAFE_fontFamily,
|
|
689
|
-
UNSAFE_fontSize,
|
|
690
|
-
UNSAFE_fontWeight,
|
|
691
|
-
UNSAFE_gap,
|
|
692
|
-
UNSAFE_gridAutoColumns,
|
|
693
|
-
UNSAFE_gridAutoRows,
|
|
694
|
-
UNSAFE_gridColumnSpan,
|
|
695
|
-
UNSAFE_gridRowSpan,
|
|
696
|
-
UNSAFE_gridTemplateColumns,
|
|
697
|
-
UNSAFE_gridTemplateRows,
|
|
698
|
-
UNSAFE_height,
|
|
699
|
-
UNSAFE_lineHeight,
|
|
700
|
-
UNSAFE_margin,
|
|
701
|
-
UNSAFE_marginBottom,
|
|
702
|
-
UNSAFE_marginLeft,
|
|
703
|
-
UNSAFE_marginRight,
|
|
704
|
-
UNSAFE_marginTop,
|
|
705
|
-
UNSAFE_marginX,
|
|
706
|
-
UNSAFE_marginY,
|
|
707
|
-
UNSAFE_maxHeight,
|
|
708
|
-
UNSAFE_maxWidth,
|
|
709
|
-
UNSAFE_minHeight,
|
|
710
|
-
UNSAFE_minWidth,
|
|
711
|
-
UNSAFE_padding,
|
|
712
|
-
UNSAFE_paddingBottom,
|
|
713
|
-
UNSAFE_paddingLeft,
|
|
714
|
-
UNSAFE_paddingRight,
|
|
715
|
-
UNSAFE_paddingTop,
|
|
716
|
-
UNSAFE_paddingX,
|
|
717
|
-
UNSAFE_paddingY,
|
|
718
|
-
UNSAFE_rowGap,
|
|
719
|
-
UNSAFE_stroke,
|
|
720
|
-
UNSAFE_width,
|
|
721
|
-
verticalAlign,
|
|
722
|
-
visibility,
|
|
723
|
-
whiteSpace,
|
|
724
|
-
width,
|
|
725
|
-
willChange,
|
|
726
|
-
wordBreak,
|
|
727
|
-
zIndex
|
|
728
|
-
]);
|
|
307
|
+
const stylingProps = convertStyleProps(props, PropsHandlers, matchedBreakpoints);
|
|
729
308
|
return {
|
|
730
|
-
...
|
|
731
|
-
|
|
732
|
-
style: styling.style
|
|
309
|
+
...removeStyledSystemProps(props),
|
|
310
|
+
stylingProps
|
|
733
311
|
};
|
|
734
312
|
}
|
|
735
313
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HopperVariablePrefix, HopperColors, DataVizColors, BackgroundColors, TextColors, IconColors, Elevation, FontSize, FontWeight, LineHeight, FontFamily, Shape, CoreSpace, SemanticSimplePaddingSpace, SemanticComplexPaddingSpace, SemanticSimpleMarginSpace, SemanticComplexMarginSpace } from './chunk-
|
|
1
|
+
import { HopperVariablePrefix, HopperColors, DataVizColors, BackgroundColors, TextColors, IconColors, Elevation, FontSize, FontWeight, LineHeight, FontFamily, Shape, CoreSpace, SemanticSimplePaddingSpace, SemanticComplexPaddingSpace, SemanticSimpleMarginSpace, SemanticComplexMarginSpace } from './chunk-KKVEOD5L.js';
|
|
2
2
|
import { parseResponsiveValue } from './chunk-SFOVKOPG.js';
|
|
3
|
-
import { isNil } from './chunk-U5R6ZXH3.js';
|
|
3
|
+
import { isNil, isObject } from './chunk-U5R6ZXH3.js';
|
|
4
4
|
|
|
5
|
-
// src/tokens/
|
|
5
|
+
// src/tokens/tokenMappings.ts
|
|
6
6
|
var ColorExpressionTypes = [
|
|
7
7
|
"#",
|
|
8
8
|
"rgb",
|
|
@@ -51,7 +51,9 @@ var FontWeightMapping = createMapping(FontWeight);
|
|
|
51
51
|
var LineHeightMapping = createMapping(LineHeight);
|
|
52
52
|
var FontFamilyMapping = createMapping(FontFamily);
|
|
53
53
|
var BorderRadiusMapping = createMapping(Shape);
|
|
54
|
-
var SpaceMapping =
|
|
54
|
+
var SpaceMapping = {
|
|
55
|
+
...createMapping(CoreSpace)
|
|
56
|
+
};
|
|
55
57
|
var SimplePaddingMapping = {
|
|
56
58
|
...createMapping(SemanticSimplePaddingSpace),
|
|
57
59
|
...SpaceMapping
|
|
@@ -69,22 +71,61 @@ var ComplexMarginMapping = {
|
|
|
69
71
|
...createMapping(SemanticComplexMarginSpace)
|
|
70
72
|
};
|
|
71
73
|
var SizingMapping = {
|
|
72
|
-
...SpaceMapping
|
|
73
|
-
//
|
|
74
|
+
...SpaceMapping,
|
|
75
|
+
// tailwind like values for scaling since we don't have scale tokens
|
|
76
|
+
"100vw": "100vw",
|
|
77
|
+
"100svw": "100svw",
|
|
78
|
+
"100lvw": "100lvw",
|
|
79
|
+
"100dvw": "100dvw",
|
|
80
|
+
"100vh": "100vh",
|
|
81
|
+
"100svh": "100svh",
|
|
82
|
+
"100lvh": "100lvh",
|
|
83
|
+
"100dvh": "100dvh",
|
|
84
|
+
"1/2": "50%",
|
|
85
|
+
"1/3": "33.333333%",
|
|
86
|
+
"2/3": "66.666667%",
|
|
87
|
+
"1/4": "25%",
|
|
88
|
+
"2/4": "50%",
|
|
89
|
+
"3/4": "75%",
|
|
90
|
+
"1/5": "20%",
|
|
91
|
+
"2/5": "40%",
|
|
92
|
+
"3/5": "60%",
|
|
93
|
+
"4/5": "80%",
|
|
94
|
+
"1/6": "16.666667%",
|
|
95
|
+
"2/6": "33.333333%",
|
|
96
|
+
"3/6": "50%",
|
|
97
|
+
"4/6": "66.666667%",
|
|
98
|
+
"5/6": "83.333333%"
|
|
74
99
|
};
|
|
75
100
|
function parseResponsiveSystemValue(value, systemValues, matchedBreakpoints) {
|
|
76
101
|
if (isNil(value)) {
|
|
77
102
|
return value;
|
|
78
103
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
104
|
+
if (!isObject(value)) {
|
|
105
|
+
if (Array.isArray(value)) {
|
|
106
|
+
const systemValueArray = value.map((x) => getSystemValue(x, systemValues));
|
|
107
|
+
if (!isNil(systemValueArray) && systemValueArray.every((x) => !isNil(x))) {
|
|
108
|
+
return systemValueArray;
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
const systemValue = getSystemValue(value, systemValues);
|
|
112
|
+
if (!isNil(systemValue)) {
|
|
113
|
+
return systemValue;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
82
116
|
}
|
|
83
117
|
const underlyingValue = parseResponsiveValue(value, matchedBreakpoints);
|
|
84
118
|
if (!isNil(underlyingValue)) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
119
|
+
if (Array.isArray(underlyingValue)) {
|
|
120
|
+
const underlyingSystemValue = underlyingValue.map((x) => getSystemValue(x, systemValues));
|
|
121
|
+
if (!isNil(underlyingSystemValue) && underlyingSystemValue.every((x) => !isNil(x))) {
|
|
122
|
+
return underlyingSystemValue;
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
const underlyingSystemValue = getSystemValue(underlyingValue, systemValues);
|
|
126
|
+
if (!isNil(underlyingSystemValue)) {
|
|
127
|
+
return underlyingSystemValue;
|
|
128
|
+
}
|
|
88
129
|
}
|
|
89
130
|
}
|
|
90
131
|
return underlyingValue;
|
|
@@ -92,5 +133,8 @@ function parseResponsiveSystemValue(value, systemValues, matchedBreakpoints) {
|
|
|
92
133
|
function getSystemValue(value, systemValues) {
|
|
93
134
|
return systemValues[value];
|
|
94
135
|
}
|
|
136
|
+
function getSizingValue(value) {
|
|
137
|
+
return SizingMapping[value] || value;
|
|
138
|
+
}
|
|
95
139
|
|
|
96
|
-
export { BackgroundColorMapping, BorderMapping, BorderRadiusMapping, BoxShadowMapping, ColorExpressionTypes, ColorMapping, ComplexMarginMapping, ComplexPaddingMapping, DataVizColorMapping, DefaultBorderWidthAndStyle, FontFamilyMapping, FontSizeMapping, FontWeightMapping, IconColorMapping, LineHeightMapping, SimpleMarginMapping, SimplePaddingMapping, SizingMapping, SpaceMapping, TextColorMapping, getSystemValue, parseResponsiveSystemValue };
|
|
140
|
+
export { BackgroundColorMapping, BorderMapping, BorderRadiusMapping, BoxShadowMapping, ColorExpressionTypes, ColorMapping, ComplexMarginMapping, ComplexPaddingMapping, DataVizColorMapping, DefaultBorderWidthAndStyle, FontFamilyMapping, FontSizeMapping, FontWeightMapping, IconColorMapping, LineHeightMapping, SimpleMarginMapping, SimplePaddingMapping, SizingMapping, SpaceMapping, TextColorMapping, getSizingValue, getSystemValue, parseResponsiveSystemValue };
|