@openedx/paragon 23.0.0-alpha.1 → 23.0.0-alpha.2

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.
Files changed (54) hide show
  1. package/README.md +31 -22
  2. package/dist/Button/index.scss +0 -2
  3. package/dist/Chip/index.scss +6 -5
  4. package/dist/Chip/mixins.scss +4 -4
  5. package/dist/Collapsible/index.scss +3 -3
  6. package/dist/Stepper/index.scss +3 -2
  7. package/dist/Tabs/index.scss +9 -6
  8. package/dist/core.css +19 -30
  9. package/dist/core.css.map +1 -1
  10. package/dist/core.min.css +1 -1
  11. package/dist/light.css +11 -11
  12. package/dist/light.css.map +1 -1
  13. package/dist/light.min.css +1 -1
  14. package/lib/build-tokens.js +18 -4
  15. package/package.json +2 -1
  16. package/src/Button/index.scss +0 -2
  17. package/src/Chip/index.scss +6 -5
  18. package/src/Chip/mixins.scss +4 -4
  19. package/src/Collapsible/index.scss +3 -3
  20. package/src/Stepper/index.scss +3 -2
  21. package/src/Tabs/index.scss +9 -6
  22. package/styles/css/core/variables.css +11 -22
  23. package/styles/css/themes/light/variables.css +11 -11
  24. package/styles/scss/core/_variables.scss +4 -5
  25. package/styles/scss/core/core.scss +1 -1
  26. package/tokens/README.md +1 -2
  27. package/tokens/src/core/alias/size.json +3 -3
  28. package/tokens/src/core/components/Breadcrumb.json +0 -14
  29. package/tokens/src/core/components/Card.json +6 -1
  30. package/tokens/src/core/components/Chip.json +4 -6
  31. package/tokens/src/core/components/ColorPicker.json +2 -2
  32. package/tokens/src/core/components/DataTable.json +1 -1
  33. package/tokens/src/core/components/Form/size.json +3 -7
  34. package/tokens/src/core/components/Nav.json +0 -3
  35. package/tokens/src/core/components/Pagination.json +0 -4
  36. package/tokens/src/core/components/ProductTour.json +0 -5
  37. package/tokens/src/core/global/display.json +2 -1
  38. package/tokens/src/core/global/spacing.json +7 -5
  39. package/tokens/src/themes/light/alias/color.json +2 -2
  40. package/tokens/src/themes/light/components/Alert.json +0 -9
  41. package/tokens/src/themes/light/components/Annotation.json +11 -11
  42. package/tokens/src/themes/light/components/Avatar.json +1 -1
  43. package/tokens/src/themes/light/components/Breadcrumb.json +0 -1
  44. package/tokens/src/themes/light/components/Card.json +2 -6
  45. package/tokens/src/themes/light/components/DataTable.json +1 -1
  46. package/tokens/src/themes/light/components/Form/color.json +4 -4
  47. package/tokens/src/themes/light/components/Form/elevation.json +1 -1
  48. package/tokens/src/themes/light/components/Form/other.json +3 -3
  49. package/tokens/src/themes/light/components/general/input.json +1 -1
  50. package/tokens/src/themes/light/components/general/link.json +1 -1
  51. package/tokens/src/themes/light/components/general/list.json +1 -1
  52. package/tokens/src/themes/light/components/general/text.json +7 -1
  53. package/tokens/src/themes/light/global/color.json +2 -2
  54. package/tokens/style-dictionary.js +6 -0
@@ -46,9 +46,6 @@
46
46
  "x": { "value": "1rem", "type": "dimension", "source": "$nav-link-padding-x" }
47
47
  },
48
48
  "distance-to-border": { "value": "4px", "type": "dimension", "source": "$nav-tabs-link-distance-to-border" }
49
- },
50
- "divider": {
51
- "margin-y": { "value": "calc({spacing.spacer.base} / 2)", "type": "dimension", "source": "$nav-divider-margin-y" }
52
49
  }
53
50
  }
54
51
  }
@@ -20,9 +20,6 @@
20
20
  "sm": { "value": ".6rem", "type": "dimension", "source": "$pagination-padding-x-sm" },
21
21
  "lg": { "value": "1.5rem", "type": "dimension", "source": "$pagination-padding-x-lg" }
22
22
  }
23
- },
24
- "margin": {
25
- "x": { "value": ".5rem", "type": "dimension", "source": "$pagination-margin-x" }
26
23
  }
27
24
  }
28
25
  },
@@ -62,7 +59,6 @@
62
59
  }
63
60
  },
64
61
  "focus": {
65
- "border-width": { "value": ".125rem", "type": "dimension", "source": "$pagination-focus-border-width" },
66
62
  "outline": { "value": "0", "type": "dimension", "source": "$pagination-focus-outline" }
67
63
  }
68
64
  }
@@ -8,11 +8,6 @@
8
8
  "max": { "value": "480px", "type": "dimension", "source": "$checkpoint-max-width" }
9
9
  },
10
10
  "arrow": {
11
- "bottom": {
12
- "value": "{size.product-tour.checkpoint.width.arrow} {size.product-tour.checkpoint.width.border}",
13
- "type": "dimension",
14
- "source": "$checkpoint-arrow-border-bottom"
15
- },
16
11
  "top": {
17
12
  "value": "{size.product-tour.checkpoint.width.arrow}",
18
13
  "type": "dimension",
@@ -16,6 +16,7 @@
16
16
  "3": { "value": "{typography.font.weight.bold}", "type": "fontWeight", "source": "$display3-weight", "description": "Font weight of level 3." },
17
17
  "4": { "value": "{typography.font.weight.bold}", "type": "fontWeight", "source": "$display4-weight", "description": "Font weight of level 4." }
18
18
  }
19
- }
19
+ },
20
+ "print-page-size": { "value": "a3", "type": "dimension", "source": "$print-page-size" }
20
21
  }
21
22
  }
@@ -8,21 +8,23 @@
8
8
  "2": { "value": "calc({spacing.spacer.base} * .5)", "type": "dimension", "description": "Space value of level 2" },
9
9
  "2,5": { "value": "calc({spacing.spacer.base} * .75)", "type": "dimension", "description": "Space value of level 2.5" },
10
10
  "3": { "value": "{spacing.spacer.base}", "type": "dimension", "description": "Space value of level 3" },
11
- "3,5": { "value": "calc({spacing.spacer.base} * 1.25)", "type": "dimension", "description": "Space value of level 3.5"},
11
+ "3,5": { "value": "calc({spacing.spacer.base} * 1.25)", "type": "dimension", "description": "Space value of level 3.5" },
12
12
  "4": { "value": "calc({spacing.spacer.base} * 1.5)", "type": "dimension", "description": "Space value of level 4" },
13
13
  "4,5": { "value": "calc({spacing.spacer.base} * 2)", "type": "dimension", "description": "Space value of level 4.5" },
14
14
  "5": { "value": "calc({spacing.spacer.base} * 3)", "type": "dimension", "description": "Space value of level 5" },
15
- "5,5": { "value": "calc({spacing.spacer.base} * 4)", "type": "dimension", "description": "Space value of level 5.5"},
15
+ "5,5": { "value": "calc({spacing.spacer.base} * 4)", "type": "dimension", "description": "Space value of level 5.5" },
16
16
  "6": { "value": "calc({spacing.spacer.base} * 5)", "type": "dimension", "description": "Space value of level 6" }
17
17
  },
18
18
  "label": {
19
- "margin-bottom": { "value": ".5rem", "type": "dimension", "description": "Margin bottom for label." }
19
+ "margin-bottom": {
20
+ "value": ".5rem", "type": "dimension", "source": "$label-margin-bottom", "description": "Margin bottom for label."
21
+ }
20
22
  },
21
23
  "table": {
22
24
  "cell": {
23
25
  "padding": {
24
- "base": { "value": "75rem", "type": "dimension", "description": "Padding for tables." },
25
- "sm": { "value": ".3rem", "type": "dimension", "description": "Padding sm for tables." }
26
+ "base": { "value": ".75rem", "type": "dimension", "source": "$table-cell-padding", "description": "Padding for tables." },
27
+ "sm": { "value": ".3rem", "type": "dimension", "source": "$table-cell-padding-sm", "description": "Padding sm for tables." }
26
28
  }
27
29
  }
28
30
  },
@@ -29,10 +29,10 @@
29
29
  },
30
30
  "table": {
31
31
  "caption": {
32
- "value": "{color.text-muted}", "type": "color", "description": "Table caption color."
32
+ "value": "{color.text-muted}", "type": "color", "source": "$table-caption-color", "description": "Table caption color."
33
33
  },
34
34
  "border": {
35
- "value": "{color.border}", "type": "color", "description": "Table border color."
35
+ "value": "{color.border}", "type": "color", "source": "$table-border-color", "description": "Table border color."
36
36
  }
37
37
  },
38
38
  "border": { "value": "{color.gray.200}", "type": "color", "source": "$border-color", "description": "Border color." },
@@ -34,14 +34,5 @@
34
34
  }
35
35
  }
36
36
  }
37
- },
38
- "elevation": {
39
- "alert": {
40
- "box-shadow": {
41
- "value": "0 1px 2px rgba(0, 0, 0, .15), 0 1px 4px rgba(0, 0, 0, .15)",
42
- "type": "shadow",
43
- "source": "$alert-box-shadow"
44
- }
45
- }
46
37
  }
47
38
  }
@@ -2,7 +2,7 @@
2
2
  "elevation": {
3
3
  "annotation": {
4
4
  "box-shadow": {
5
- "value": "drop-shadow(0 2px 4px rgba(0, 0, 0, .15)) drop-shadow(0 2px 8px rgba(0, 0, 0, .15))",
5
+ "value": "drop-shadow(0 2px 4px rgba(0, 0, 0, .15)) drop-shadow(0 2px 8px rgba(0, 0, 0, .15))",
6
6
  "type": "shadow",
7
7
  "source": "$annotation-box-shadow"
8
8
  }
@@ -11,18 +11,18 @@
11
11
  "color": {
12
12
  "annotation": {
13
13
  "text": {
14
- "success": { "value": "{color.white}", "type": "color", "source": "$annotation-success-color"},
15
- "warning": { "value": "{color.black}", "type": "color", "source": "$annotation-warning-color"},
16
- "error": { "value": "{color.white}", "type": "color", "source": "$annotation-error-color"},
17
- "light": { "value": "{color.primary.500}", "type": "color", "source": "$annotation-light-color"},
18
- "dark": { "value": "{color.white}", "type": "color", "source": "$annotation-dark-color"}
14
+ "success": { "value": "{color.white}", "type": "color", "source": "$annotation-success-color" },
15
+ "warning": { "value": "{color.black}", "type": "color", "source": "$annotation-warning-color" },
16
+ "error": { "value": "{color.white}", "type": "color", "source": "$annotation-error-color" },
17
+ "light": { "value": "{color.primary.500}", "type": "color", "source": "$annotation-light-color" },
18
+ "dark": { "value": "{color.white}", "type": "color", "source": "$annotation-dark-color" }
19
19
  },
20
20
  "bg": {
21
- "success": { "value": "{color.success.base}", "type": "color", "source": "$annotation-success-bg"},
22
- "warning": { "value": "{color.accent.b}", "type": "color", "source": "$annotation-warning-bg"},
23
- "error": { "value": "{color.danger.base}", "type": "color", "source": "$annotation-error-bg"},
24
- "light": { "value": "{color.white}", "type": "color", "source": "$annotation-light-bg"},
25
- "dark": { "value": "{color.dark.base}", "type": "color", "source": "$annotation-dark-bg"}
21
+ "success": { "value": "{color.success.base}", "type": "color", "source": "$annotation-success-bg" },
22
+ "warning": { "value": "{color.accent.b}", "type": "color", "source": "$annotation-warning-bg" },
23
+ "error": { "value": "{color.danger.base}", "type": "color", "source": "$annotation-error-bg" },
24
+ "light": { "value": "{color.white}", "type": "color", "source": "$annotation-light-bg" },
25
+ "dark": { "value": "{color.dark.base}", "type": "color", "source": "$annotation-dark-bg" }
26
26
  }
27
27
  }
28
28
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "color": {
3
3
  "avatar": {
4
- "border": { "value": "{color.light.300}", "type": "color", "source": "$avatar-color-border" }
4
+ "border": { "value": "{color.light.300}", "type": "color" }
5
5
  }
6
6
  }
7
7
  }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "color": {
3
3
  "breadcrumb": {
4
- "bg": { "value": "{color.gray.200}", "type": "color", "source": "$breadcrumb-bg" },
5
4
  "base": { "value": "{color.primary.500}", "type": "color", "source": "$breadcrumb-color" },
6
5
  "active": { "value": "{color.gray.500}", "type": "color", "source": "$breadcrumb-active-color" },
7
6
  "inverse": {
@@ -8,7 +8,7 @@
8
8
  "muted": { "value": "{color.light.200}", "type": "color", "source": "$card-bg-muted" }
9
9
  },
10
10
  "border": {
11
- "base": {
11
+ "base": {
12
12
  "value": "{color.black}",
13
13
  "type": "color",
14
14
  "source": "$card-border-color",
@@ -21,11 +21,7 @@
21
21
  "base": {
22
22
  "value": "{color.primary.500}",
23
23
  "type": "color",
24
- "source": "$card-border-focus-color",
25
- "modify": [{
26
- "type": "alpha",
27
- "amount": 0.5
28
- }]
24
+ "source": "$card-border-focus-color"
29
25
  },
30
26
  "dark": {
31
27
  "value": "{color.theme.focus.primary}",
@@ -15,7 +15,7 @@
15
15
  ]
16
16
  }
17
17
  },
18
- "border": { "value": "{color.gray.200}", "type": "color", "source": "$data-table-border-color" }
18
+ "border": { "value": "{color.light.300}", "type": "color", "source": "$data-table-border-color" }
19
19
  }
20
20
  },
21
21
  "elevation": {
@@ -30,7 +30,7 @@
30
30
  "border": {
31
31
  "value": "{color.gray.700}", "type": "color", "source": "$custom-control-indicator-border-color"
32
32
  },
33
- "bg": {
33
+ "bg": {
34
34
  "base": {
35
35
  "value": "{color.form.input.bg.base}", "type": "color", "source": "$custom-control-indicator-bg"
36
36
  },
@@ -68,7 +68,7 @@
68
68
  }
69
69
  }
70
70
  },
71
- "active": {
71
+ "active": {
72
72
  "base": {
73
73
  "value": "{color.active}", "type": "color", "source": "$custom-control-indicator-active-color"
74
74
  },
@@ -88,7 +88,7 @@
88
88
  "value": "{color.disabled}", "type": "color", "source": "$custom-control-label-disabled-color"
89
89
  },
90
90
  "floating": {
91
- "text": {
91
+ "text": {
92
92
  "value": "{color.form.input.bg.base}",
93
93
  "type": "color",
94
94
  "source": "$form-control-floating-label-text-bg",
@@ -217,7 +217,7 @@
217
217
  "value": "{color.form.feedback.valid}",
218
218
  "type": "color",
219
219
  "source": "$form-feedback-tooltip-valid-color",
220
- "modify": [{"type": "color-yiq"}]
220
+ "modify": [{ "type": "color-yiq" }]
221
221
  },
222
222
  "bg": {
223
223
  "valid": {
@@ -4,7 +4,7 @@
4
4
  "input": {
5
5
  "base": { "value": "none", "type": "shadow", "source": "$input-box-shadow" },
6
6
  "focus": {
7
- "value": "none",
7
+ "value": "0 0 0 1px {color.primary.500}",
8
8
  "type": "shadow",
9
9
  "source": "$input-focus-box-shadow"
10
10
  }
@@ -52,21 +52,21 @@
52
52
  "type": "file",
53
53
  "source": "$custom-radio-indicator-icon-checked",
54
54
  "outputReferences": false,
55
- "modify": [{ "type": "str-replace", "toReplace": "#", "replaceWith": "%23"}]
55
+ "modify": [{ "type": "str-replace", "toReplace": "#", "replaceWith": "%23" }]
56
56
  },
57
57
  "valid": {
58
58
  "value": "url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='{color.form.control.indicator.checked.valid}'/%3e%3c/svg%3e\")",
59
59
  "type": "file",
60
60
  "source": "$custom-radio-indicator-icon-valid-checked",
61
61
  "outputReferences": false,
62
- "modify": [{ "type": "str-replace", "toReplace": "#", "replaceWith": "%23"}]
62
+ "modify": [{ "type": "str-replace", "toReplace": "#", "replaceWith": "%23" }]
63
63
  },
64
64
  "invalid": {
65
65
  "value": "url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='{color.form.control.indicator.checked.invalid}'/%3e%3c/svg%3e\")",
66
66
  "type": "file",
67
67
  "source": "$custom-radio-indicator-icon-invalid-checked",
68
68
  "outputReferences": false,
69
- "modify": [{ "type": "str-replace", "toReplace": "#", "replaceWith": "%23"}]
69
+ "modify": [{ "type": "str-replace", "toReplace": "#", "replaceWith": "%23" }]
70
70
  }
71
71
  }
72
72
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "color": {
3
3
  "input": {
4
- "btn-focus": { "value": "{color.input.focus}", "type": "color", "source": "$input-btn-focus-color" }
4
+ "btn-focus": { "value": "{color.bg.active}", "type": "color", "source": "$input-btn-focus-color" }
5
5
  }
6
6
  },
7
7
  "elevation": {
@@ -37,7 +37,7 @@
37
37
  "value": "{color.link.muted.base}",
38
38
  "type": "color",
39
39
  "source": "$muted-link-hover-color",
40
- "modify": [{ "type": "darken", "amount": 0.15}]
40
+ "modify": [{ "type": "darken", "amount": 0.15 }]
41
41
  },
42
42
  "inline": {
43
43
  "base": { "value": "{color.primary.500}", "type": "color", "source": "$muted-inline-link-color" },
@@ -3,7 +3,7 @@
3
3
  "list-group": {
4
4
  "base": { "value": "inherit", "type": "color", "source": "$list-group-color" },
5
5
  "bg": {
6
- "base": { "value": "{color.bg.base}", "type": "color", "source": "$list-group-bg" },
6
+ "base": { "value": "{color.white}", "type": "color", "source": "$list-group-bg" },
7
7
  "hover": { "value": "{color.gray.100}", "type": "color", "source": "$list-group-hover-bg" }
8
8
  },
9
9
  "border": {
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "color": {
3
3
  "text-muted": { "value": "{color.gray.500}", "type": "color", "source": "$text-muted" },
4
- "mark-bg": { "value": "#FFF243", "type": "color", "source": "$mark-bg" }
4
+ "mark-bg": { "value": "#FFF243", "type": "color", "source": "$mark-bg" },
5
+ "blockquote": {
6
+ "small": {
7
+ "value": "{color.gray.500}", "type": "color", "source": "$blockquote-small-color"
8
+ }
9
+ },
10
+ "yiq-light": { "value": "{color.white}", "type": "color", "source": "$yiq-text-light" }
5
11
  }
6
12
  }
@@ -153,7 +153,7 @@
153
153
  "value": "{color.primary.base}",
154
154
  "type": "color",
155
155
  "source": "$primary-300",
156
- "modify": [{ "type": "mix", "otherColor": "white", "amount": "0.50"}],
156
+ "modify": [{ "type": "mix", "otherColor": "white", "amount": "0.50" }],
157
157
  "description": "Primary color of level 300.",
158
158
  "actions": {
159
159
  "default": "{color.action.default.primary.300}"
@@ -602,7 +602,7 @@
602
602
  "value": "{color.info.base}",
603
603
  "type": "color",
604
604
  "source": "$info-800",
605
- "modify": [{ "type": "mix", "otherColor": "black", "amount": "0.25"}],
605
+ "modify": [{ "type": "mix", "otherColor": "black", "amount": "0.25" }],
606
606
  "description": "Info color of level 800.",
607
607
  "actions": {
608
608
  "default": "{color.action.default.info.800}"
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This module creates and exports custom StyleDictionary instance for Paragon.
3
3
  */
4
+ const toml = require('js-toml');
4
5
  const StyleDictionary = require('style-dictionary');
5
6
  const chroma = require('chroma-js');
6
7
  const { colorYiq, darken, lighten } = require('./sass-helpers');
@@ -216,6 +217,11 @@ StyleDictionary.registerFilter({
216
217
  matcher: token => token?.isSource === true,
217
218
  });
218
219
 
220
+ StyleDictionary.registerParser({
221
+ pattern: /\.toml$/,
222
+ parse: ({ contents }) => toml.load(contents),
223
+ });
224
+
219
225
  module.exports = {
220
226
  StyleDictionary,
221
227
  createCustomCSSVariables,