@codecademy/gamut-styles 17.11.1-alpha.f03f14.0 → 17.11.1-alpha.fb9da9.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.
@@ -338,12 +338,20 @@ export declare const providerProps: import("@codecademy/variance/dist/types/conf
338
338
  readonly scale: "spacing";
339
339
  };
340
340
  readonly mr: {
341
- readonly property: "marginRight";
341
+ readonly property: {
342
+ readonly physical: "marginRight";
343
+ readonly logical: "marginInlineEnd";
344
+ };
342
345
  readonly scale: "spacing";
346
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
343
347
  };
344
348
  readonly ml: {
345
- readonly property: "marginLeft";
349
+ readonly property: {
350
+ readonly physical: "marginLeft";
351
+ readonly logical: "marginInlineStart";
352
+ };
346
353
  readonly scale: "spacing";
354
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
347
355
  };
348
356
  }>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
349
357
  readonly border: {
@@ -801,12 +809,20 @@ export declare const VariableProvider: import("@emotion/styled").StyledComponent
801
809
  readonly scale: "spacing";
802
810
  }>;
803
811
  mr?: import("@codecademy/variance/dist/types/config").Scale<{
804
- readonly property: "marginRight";
812
+ readonly property: {
813
+ readonly physical: "marginRight";
814
+ readonly logical: "marginInlineEnd";
815
+ };
805
816
  readonly scale: "spacing";
817
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
806
818
  }>;
807
819
  ml?: import("@codecademy/variance/dist/types/config").Scale<{
808
- readonly property: "marginLeft";
820
+ readonly property: {
821
+ readonly physical: "marginLeft";
822
+ readonly logical: "marginInlineStart";
823
+ };
809
824
  readonly scale: "spacing";
825
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
810
826
  }>;
811
827
  borderX?: import("@codecademy/variance/dist/types/config").Scale<{
812
828
  readonly property: "border";
@@ -1211,12 +1227,20 @@ export declare const ColorMode: import("react").ForwardRefExoticComponent<Omit<O
1211
1227
  readonly scale: "spacing";
1212
1228
  }>;
1213
1229
  mr?: import("@codecademy/variance/dist/types/config").Scale<{
1214
- readonly property: "marginRight";
1230
+ readonly property: {
1231
+ readonly physical: "marginRight";
1232
+ readonly logical: "marginInlineEnd";
1233
+ };
1215
1234
  readonly scale: "spacing";
1235
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1216
1236
  }>;
1217
1237
  ml?: import("@codecademy/variance/dist/types/config").Scale<{
1218
- readonly property: "marginLeft";
1238
+ readonly property: {
1239
+ readonly physical: "marginLeft";
1240
+ readonly logical: "marginInlineStart";
1241
+ };
1219
1242
  readonly scale: "spacing";
1243
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1220
1244
  }>;
1221
1245
  borderX?: import("@codecademy/variance/dist/types/config").Scale<{
1222
1246
  readonly property: "border";
@@ -15,6 +15,10 @@ export interface GamutProviderProps {
15
15
  * Pass a nonce to the cache to prevent CSP errors
16
16
  */
17
17
  nonce?: string;
18
+ /**
19
+ * Whether to use logical properties for the theme
20
+ */
21
+ useLogicalProperties?: boolean;
18
22
  }
19
23
  export declare const GamutContext: React.Context<{
20
24
  hasGlobals?: boolean | undefined;
@@ -18,7 +18,8 @@ export const GamutProvider = ({
18
18
  variables,
19
19
  useGlobals = true,
20
20
  useCache = true,
21
- nonce
21
+ nonce,
22
+ useLogicalProperties = true
22
23
  }) => {
23
24
  const {
24
25
  hasGlobals,
@@ -33,7 +34,8 @@ export const GamutProvider = ({
33
34
  } : {})));
34
35
  const contextValue = {
35
36
  hasGlobals: shouldInsertGlobals,
36
- hasCache: shouldCreateCache
37
+ hasCache: shouldCreateCache,
38
+ useLogicalProperties
37
39
  };
38
40
  const globals = shouldInsertGlobals && /*#__PURE__*/_jsxs(_Fragment, {
39
41
  children: [/*#__PURE__*/_jsx(Typography, {
@@ -46,13 +48,19 @@ export const GamutProvider = ({
46
48
  variables: variables
47
49
  })]
48
50
  });
51
+
52
+ // Merge useLogicalProperties into theme so variance can access it via props.theme
53
+ const themeWithLogicalProperties = {
54
+ ...theme,
55
+ useLogicalProperties
56
+ };
49
57
  if (activeCache.current) {
50
58
  return /*#__PURE__*/_jsx(GamutContext.Provider, {
51
59
  value: contextValue,
52
60
  children: /*#__PURE__*/_jsxs(CacheProvider, {
53
61
  value: activeCache.current,
54
62
  children: [globals, /*#__PURE__*/_jsx(ThemeProvider, {
55
- theme: theme,
63
+ theme: themeWithLogicalProperties,
56
64
  children: children
57
65
  })]
58
66
  })
@@ -61,7 +69,7 @@ export const GamutProvider = ({
61
69
  return /*#__PURE__*/_jsxs(GamutContext.Provider, {
62
70
  value: contextValue,
63
71
  children: [globals, /*#__PURE__*/_jsx(ThemeProvider, {
64
- theme: theme,
72
+ theme: themeWithLogicalProperties,
65
73
  children: children
66
74
  })]
67
75
  });
@@ -494,12 +494,20 @@ export declare const margin: {
494
494
  readonly scale: "spacing";
495
495
  };
496
496
  readonly mr: {
497
- readonly property: "marginRight";
497
+ readonly property: {
498
+ readonly physical: "marginRight";
499
+ readonly logical: "marginInlineEnd";
500
+ };
498
501
  readonly scale: "spacing";
502
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
499
503
  };
500
504
  readonly ml: {
501
- readonly property: "marginLeft";
505
+ readonly property: {
506
+ readonly physical: "marginLeft";
507
+ readonly logical: "marginInlineStart";
508
+ };
502
509
  readonly scale: "spacing";
510
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
503
511
  };
504
512
  };
505
513
  export declare const padding: {
@@ -588,12 +596,20 @@ export declare const space: {
588
596
  readonly scale: "spacing";
589
597
  };
590
598
  readonly mr: {
591
- readonly property: "marginRight";
599
+ readonly property: {
600
+ readonly physical: "marginRight";
601
+ readonly logical: "marginInlineEnd";
602
+ };
592
603
  readonly scale: "spacing";
604
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
593
605
  };
594
606
  readonly ml: {
595
- readonly property: "marginLeft";
607
+ readonly property: {
608
+ readonly physical: "marginLeft";
609
+ readonly logical: "marginInlineStart";
610
+ };
596
611
  readonly scale: "spacing";
612
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
597
613
  };
598
614
  };
599
615
  export declare const all: {
@@ -1008,12 +1024,20 @@ export declare const all: {
1008
1024
  readonly scale: "spacing";
1009
1025
  };
1010
1026
  mr: {
1011
- readonly property: "marginRight";
1027
+ readonly property: {
1028
+ readonly physical: "marginRight";
1029
+ readonly logical: "marginInlineEnd";
1030
+ };
1012
1031
  readonly scale: "spacing";
1032
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1013
1033
  };
1014
1034
  ml: {
1015
- readonly property: "marginLeft";
1035
+ readonly property: {
1036
+ readonly physical: "marginLeft";
1037
+ readonly logical: "marginInlineStart";
1038
+ };
1016
1039
  readonly scale: "spacing";
1040
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1017
1041
  };
1018
1042
  fontFamily: {
1019
1043
  readonly property: "fontFamily";
@@ -1,4 +1,4 @@
1
- import { transformSize } from '@codecademy/variance';
1
+ import { getPropertyMode, transformSize } from '@codecademy/variance';
2
2
  export const color = {
3
3
  color: {
4
4
  property: 'color',
@@ -455,12 +455,20 @@ export const margin = {
455
455
  scale: 'spacing'
456
456
  },
457
457
  mr: {
458
- property: 'marginRight',
459
- scale: 'spacing'
458
+ property: {
459
+ physical: 'marginRight',
460
+ logical: 'marginInlineEnd'
461
+ },
462
+ scale: 'spacing',
463
+ resolveProperty: getPropertyMode
460
464
  },
461
465
  ml: {
462
- property: 'marginLeft',
463
- scale: 'spacing'
466
+ property: {
467
+ physical: 'marginLeft',
468
+ logical: 'marginInlineStart'
469
+ },
470
+ scale: 'spacing',
471
+ resolveProperty: getPropertyMode
464
472
  }
465
473
  };
466
474
  export const padding = {
@@ -393,12 +393,20 @@ export declare const space: import("@codecademy/variance/dist/types/config").Par
393
393
  readonly scale: "spacing";
394
394
  };
395
395
  readonly mr: {
396
- readonly property: "marginRight";
396
+ readonly property: {
397
+ readonly physical: "marginRight";
398
+ readonly logical: "marginInlineEnd";
399
+ };
397
400
  readonly scale: "spacing";
401
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
398
402
  };
399
403
  readonly ml: {
400
- readonly property: "marginLeft";
404
+ readonly property: {
405
+ readonly physical: "marginLeft";
406
+ readonly logical: "marginInlineStart";
407
+ };
401
408
  readonly scale: "spacing";
409
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
402
410
  };
403
411
  }>>;
404
412
  export declare const border: import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
@@ -590,12 +598,20 @@ export declare const margin: import("@codecademy/variance/dist/types/config").Pa
590
598
  readonly scale: "spacing";
591
599
  };
592
600
  readonly mr: {
593
- readonly property: "marginRight";
601
+ readonly property: {
602
+ readonly physical: "marginRight";
603
+ readonly logical: "marginInlineEnd";
604
+ };
594
605
  readonly scale: "spacing";
606
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
595
607
  };
596
608
  readonly ml: {
597
- readonly property: "marginLeft";
609
+ readonly property: {
610
+ readonly physical: "marginLeft";
611
+ readonly logical: "marginInlineStart";
612
+ };
598
613
  readonly scale: "spacing";
614
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
599
615
  };
600
616
  }>>;
601
617
  /** CSS */
@@ -1011,12 +1027,20 @@ export declare const css: import("@codecademy/variance/dist/types/config").CSS<i
1011
1027
  readonly scale: "spacing";
1012
1028
  };
1013
1029
  mr: {
1014
- readonly property: "marginRight";
1030
+ readonly property: {
1031
+ readonly physical: "marginRight";
1032
+ readonly logical: "marginInlineEnd";
1033
+ };
1015
1034
  readonly scale: "spacing";
1035
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1016
1036
  };
1017
1037
  ml: {
1018
- readonly property: "marginLeft";
1038
+ readonly property: {
1039
+ readonly physical: "marginLeft";
1040
+ readonly logical: "marginInlineStart";
1041
+ };
1019
1042
  readonly scale: "spacing";
1043
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1020
1044
  };
1021
1045
  fontFamily: {
1022
1046
  readonly property: "fontFamily";
@@ -1465,12 +1489,20 @@ export declare const variant: import("@codecademy/variance/dist/types/config").V
1465
1489
  readonly scale: "spacing";
1466
1490
  };
1467
1491
  mr: {
1468
- readonly property: "marginRight";
1492
+ readonly property: {
1493
+ readonly physical: "marginRight";
1494
+ readonly logical: "marginInlineEnd";
1495
+ };
1469
1496
  readonly scale: "spacing";
1497
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1470
1498
  };
1471
1499
  ml: {
1472
- readonly property: "marginLeft";
1500
+ readonly property: {
1501
+ readonly physical: "marginLeft";
1502
+ readonly logical: "marginInlineStart";
1503
+ };
1473
1504
  readonly scale: "spacing";
1505
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1474
1506
  };
1475
1507
  fontFamily: {
1476
1508
  readonly property: "fontFamily";
@@ -1919,12 +1951,20 @@ export declare const states: import("@codecademy/variance/dist/types/config").St
1919
1951
  readonly scale: "spacing";
1920
1952
  };
1921
1953
  mr: {
1922
- readonly property: "marginRight";
1954
+ readonly property: {
1955
+ readonly physical: "marginRight";
1956
+ readonly logical: "marginInlineEnd";
1957
+ };
1923
1958
  readonly scale: "spacing";
1959
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1924
1960
  };
1925
1961
  ml: {
1926
- readonly property: "marginLeft";
1962
+ readonly property: {
1963
+ readonly physical: "marginLeft";
1964
+ readonly logical: "marginInlineStart";
1965
+ };
1927
1966
  readonly scale: "spacing";
1967
+ readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
1928
1968
  };
1929
1969
  fontFamily: {
1930
1970
  readonly property: "fontFamily";
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@codecademy/gamut-styles",
3
3
  "description": "Styleguide & Component library for codecademy.com",
4
- "version": "17.11.1-alpha.f03f14.0",
4
+ "version": "17.11.1-alpha.fb9da9.0",
5
5
  "author": "Jake Hiller <jake@codecademy.com>",
6
6
  "dependencies": {
7
- "@codecademy/variance": "0.25.1-alpha.f03f14.0",
7
+ "@codecademy/variance": "0.25.1-alpha.fb9da9.0",
8
8
  "@emotion/is-prop-valid": "^1.1.0",
9
9
  "polished": "^4.1.2"
10
10
  },
@@ -34,5 +34,5 @@
34
34
  "scripts": {
35
35
  "build": "nx build @codecademy/gamut-styles"
36
36
  },
37
- "gitHead": "feb192c5ea19fd0c702a59d2f00c3a78533f1ca5"
37
+ "gitHead": "4d8170b39849e26fa1cb3d1ab5bbe9135e8a87b0"
38
38
  }