@muraldevkit/ds-foundation 1.0.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.
Files changed (50) hide show
  1. package/README.md +99 -0
  2. package/assets/fonts/proximanova-bold.woff2 +0 -0
  3. package/assets/fonts/proximanova-extrabold.woff2 +0 -0
  4. package/assets/fonts/proximanova-medium.woff2 +0 -0
  5. package/assets/fonts/proximanova-regular.woff2 +0 -0
  6. package/assets/fonts/proximanova-semibold.woff2 +0 -0
  7. package/dist/android/mrl_colors.xml +9 -0
  8. package/dist/android/mrl_font_dimens.xml +9 -0
  9. package/dist/fonts.css +36 -0
  10. package/dist/fonts.css.map +1 -0
  11. package/dist/fonts.min.css +1 -0
  12. package/dist/fonts.min.css.map +1 -0
  13. package/dist/foundation.css +748 -0
  14. package/dist/foundation.css.map +1 -0
  15. package/dist/foundation.min.css +1 -0
  16. package/dist/foundation.min.css.map +1 -0
  17. package/dist/ios-swift/Mrl.swift +183 -0
  18. package/dist/tokens/border.json +39 -0
  19. package/dist/tokens/color.json +296 -0
  20. package/dist/tokens/motion.json +41 -0
  21. package/dist/tokens/shadows.json +21 -0
  22. package/dist/tokens/spacing.json +46 -0
  23. package/dist/tokens/typography.json +148 -0
  24. package/package.json +1 -0
  25. package/src/styles/_functions.scss +18 -0
  26. package/src/styles/_mixins.scss +152 -0
  27. package/src/styles/baseline.scss +157 -0
  28. package/src/styles/contextual-variables/border.scss +100 -0
  29. package/src/styles/contextual-variables/color.scss +165 -0
  30. package/src/styles/contextual-variables/index.scss +6 -0
  31. package/src/styles/contextual-variables/shadows.scss +28 -0
  32. package/src/styles/contextual-variables/spacing.scss +63 -0
  33. package/src/styles/contextual-variables/typography.scss +167 -0
  34. package/src/styles/contextual-variables/z-index.scss +24 -0
  35. package/src/styles/focus.scss +87 -0
  36. package/src/styles/fonts.scss +19 -0
  37. package/src/styles/global-variables/border.scss +40 -0
  38. package/src/styles/global-variables/breakpoints.scss +14 -0
  39. package/src/styles/global-variables/color.scss +156 -0
  40. package/src/styles/global-variables/index.scss +7 -0
  41. package/src/styles/global-variables/motion.scss +40 -0
  42. package/src/styles/global-variables/shadows.scss +28 -0
  43. package/src/styles/global-variables/spacing.scss +32 -0
  44. package/src/styles/global-variables/typography.scss +86 -0
  45. package/src/styles/grid.scss +4 -0
  46. package/src/styles/index.scss +17 -0
  47. package/src/styles/skeletons/button.scss +84 -0
  48. package/src/styles/skeletons/index.scss +10 -0
  49. package/src/styles/spacing.scss +24 -0
  50. package/src/styles/typography.scss +19 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "spacing": {
3
+ "01": {
4
+ "value": "2"
5
+ },
6
+ "02": {
7
+ "value": "4"
8
+ },
9
+ "03": {
10
+ "value": "8"
11
+ },
12
+ "04": {
13
+ "value": "12"
14
+ },
15
+ "05": {
16
+ "value": "16"
17
+ },
18
+ "06": {
19
+ "value": "20"
20
+ },
21
+ "07": {
22
+ "value": "24"
23
+ },
24
+ "08": {
25
+ "value": "32"
26
+ },
27
+ "09": {
28
+ "value": "40"
29
+ },
30
+ "10": {
31
+ "value": "48"
32
+ },
33
+ "11": {
34
+ "value": "64"
35
+ },
36
+ "12": {
37
+ "value": "80"
38
+ },
39
+ "13": {
40
+ "value": "96"
41
+ },
42
+ "14": {
43
+ "value": "160"
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,148 @@
1
+ {
2
+ "$font-family": {
3
+ "01": {
4
+ "value": "'proxima-nova'",
5
+ "comment": "Brand font family used everywhere"
6
+ }
7
+ },
8
+ "font-size": {
9
+ "01": {
10
+ "value": "11",
11
+ "comment": "11px text"
12
+ },
13
+ "02": {
14
+ "value": "12",
15
+ "comment": "12px text"
16
+ },
17
+ "03": {
18
+ "value": "14",
19
+ "comment": "14px text"
20
+ },
21
+ "04": {
22
+ "value": "16",
23
+ "comment": "16px text"
24
+ },
25
+ "05": {
26
+ "value": "18",
27
+ "comment": "18px text"
28
+ },
29
+ "06": {
30
+ "value": "20",
31
+ "comment": "20px text"
32
+ },
33
+ "07": {
34
+ "value": "24",
35
+ "comment": "24px text"
36
+ },
37
+ "08": {
38
+ "value": "32",
39
+ "comment": "32px text"
40
+ },
41
+ "09": {
42
+ "value": "40",
43
+ "comment": "40px text"
44
+ },
45
+ "10": {
46
+ "value": "48",
47
+ "comment": "48px text"
48
+ },
49
+ "11": {
50
+ "value": "64",
51
+ "comment": "64px text"
52
+ },
53
+ "12": {
54
+ "value": "80",
55
+ "comment": "80px text"
56
+ },
57
+ "13": {
58
+ "value": "96",
59
+ "comment": "96px text"
60
+ },
61
+ "14": {
62
+ "value": "120",
63
+ "comment": "120px text"
64
+ }
65
+ },
66
+ "line-height": {
67
+ "01": {
68
+ "value": "0.875"
69
+ },
70
+ "02": {
71
+ "value": "1"
72
+ },
73
+ "03": {
74
+ "value": "1.125"
75
+ },
76
+ "04": {
77
+ "value": "1.167"
78
+ },
79
+ "05": {
80
+ "value": "1.2"
81
+ },
82
+ "06": {
83
+ "value": "1.33"
84
+ },
85
+ "07": {
86
+ "value": "1.4"
87
+ },
88
+ "08": {
89
+ "value": "1.45"
90
+ },
91
+ "09": {
92
+ "value": "1.5"
93
+ },
94
+ "10": {
95
+ "value": "1.56"
96
+ },
97
+ "11": {
98
+ "value": "1.75"
99
+ },
100
+ "12": {
101
+ "value": "2"
102
+ }
103
+ },
104
+ "letter-spacing": {
105
+ "01": {
106
+ "value": "-2%",
107
+ "comment": "Condensed spacing"
108
+ },
109
+ "02": {
110
+ "value": "-1%",
111
+ "comment": "Semi-condensed spacing"
112
+ },
113
+ "03": {
114
+ "value": "0%",
115
+ "comment": "No spacing"
116
+ },
117
+ "04": {
118
+ "value": "1%",
119
+ "comment": "Semi-extended spacing"
120
+ },
121
+ "05": {
122
+ "value": "2%",
123
+ "comment": "Extended spacing"
124
+ }
125
+ },
126
+ "font-weight": {
127
+ "01": {
128
+ "value": "400",
129
+ "comment": "Regular"
130
+ },
131
+ "02": {
132
+ "value": "500",
133
+ "comment": "Medium"
134
+ },
135
+ "03": {
136
+ "value": "600",
137
+ "comment": "Semibold"
138
+ },
139
+ "04": {
140
+ "value": "700",
141
+ "comment": "Bold"
142
+ },
143
+ "05": {
144
+ "value": "800",
145
+ "comment": "Extra bold"
146
+ }
147
+ }
148
+ }
package/package.json ADDED
@@ -0,0 +1 @@
1
+ {"name":"@muraldevkit/ds-foundation","version":"1.0.0","description":"Mural's design system's Foundation package containing our design language features used across all components","license":"https://www.mural.co/terms/developer-addendum","scripts":{"copy":"npm run copy:json","copy:json":"cpy src/tokens/*.json dist/tokens/ --flat","build:minify":"npm run build:fonts:min && npm run build:foundation:min","build:transpile":"npm run build:fonts && npm run build:foundation","build:foundation":"sass src/styles/index.scss dist/foundation.css","build:foundation:min":"sass src/styles/index.scss dist/foundation.min.css --style compressed","build:fonts":"sass src/styles/fonts.scss dist/fonts.css","build:fonts:min":"sass src/styles/fonts.scss dist/fonts.min.css --style compressed","build:tokens":"style-dictionary build --config ../../node_modules/@muraldevkit/ds-utilities/lib/configs/style-dictionary.json","build:styles":"npm run build:transpile && npm run build:minify","build":"npm run clean && npm run build:tokens && npm run build:styles","postbuild":"npm run copy","clean":"rimraf dist && rimraf src/styles/_global.scss","watch":"sass src/styles/index.scss dist/foundation.css --watch","release":"npx semantic-release"},"files":["dist/","src/styles/","assets/fonts"],"publishConfig":{"access":"public"},"packageConfig":{"status":"integration-ready"},"devDependencies":{"@muraldevkit/ds-semrel-config":"1.0.0","@muraldevkit/ds-semrel-manager":"1.0.0","@muraldevkit/ds-semrel-stencil-exports":"1.0.1","@muraldevkit/ds-utilities":"1.0.0","cpy-cli":"4.2.0","rimraf":"3.0.2","sass":"1.56.2","semantic-release-monorepo":"7.0.5","style-dictionary":"3.7.1"},"release":{"extends":["semantic-release-monorepo","./config/release.config"]},"nx":{"targets":{"build":{"dependsOn":["^build"]},"inputs":["{projectRoot}/src/**/*"],"outputs":["{projectRoot}/dist"]}}}
@@ -0,0 +1,18 @@
1
+ ////
2
+ /// Mural's design system function utilities
3
+ /// @group functions
4
+ ////
5
+
6
+ @use 'sass:math';
7
+
8
+ /// Converts pixels to rems
9
+ /// @group functions
10
+ /// @param {Number} $value - Pixel value to convert
11
+ /// @param {Number} $baseline - Baseline value to use, defaults to 16
12
+ /// For the Classic theme use 10.
13
+ /// @returns {Number} The rem equivalent of $value
14
+ /// @example mrl-rem(600)
15
+ @function mrl-rem($value, $baseline: 16) {
16
+ $remValue: (math.div($value, 16)) + rem;
17
+ @return $remValue;
18
+ }
@@ -0,0 +1,152 @@
1
+ ////
2
+ /// Mural's design system mixins
3
+ /// @group mixins
4
+ ////
5
+ @forward "focus";
6
+
7
+ /// Font face mixin
8
+ /// @group mixins
9
+ /// @param {String} $font-name - Name of the font family
10
+ /// @param {String} $font-path - Path of the font file
11
+ /// @param {Number} $font-weight - Weight of the font
12
+ /// @param {String} $font-style - Style of the font - default: normal
13
+ /// @example font-face( "proxima-nova","../fonts/proximanova" , 400)
14
+ @mixin font-face($font-family, $font-path, $font-weight: 400, $font-style: normal) {
15
+ @font-face {
16
+ font-family: $font-family;
17
+ font-style : $font-style;
18
+ font-weight: $font-weight;
19
+ src: url('#{$font-path}.woff2') format('woff2');
20
+ }
21
+ }
22
+
23
+ /// Interactive text mixin
24
+ /// This mixin is for pulling related CSS with contextual tokens for
25
+ /// interactive elements, such as buttons, links, etc.
26
+ /// @group mixins
27
+ /// @param {String} $size - The desired size based on the typography scale
28
+ /// Available options are "xsmall", "small", "medium" (default), "large"
29
+ /// @example @include mrl-text-interactive("large");
30
+ @mixin mrl-text-interactive($size: 'medium') {
31
+ // we use the default token if size is medium
32
+ $size-token: '';
33
+
34
+ @if $size != 'medium' {
35
+ $size-token: '-#{$size}';
36
+ }
37
+
38
+ // xsmall has a different letter spacing than others
39
+ $spacing-token: 'text';
40
+ @if $size == 'xsmall' {
41
+ $spacing-token: 'interactive-xsmall';
42
+ }
43
+
44
+ font-family: var(--mrl-font-family-01);
45
+ font-size: var(--mrl-type-size-text#{$size-token});
46
+ font-weight: var(--mrl-type-weight-interactive);
47
+ letter-spacing: var(--mrl-type-spacing-#{$spacing-token});
48
+ line-height: var(--mrl-type-line-height-interactive#{$size-token});
49
+ }
50
+
51
+ /// Body text mixin
52
+ /// This mixin is for pulling related CSS with contextual tokens for
53
+ /// elements that use the body text design configuration.
54
+ /// @group mixins
55
+ /// @param {String} $size - The desired size based on the typography scale
56
+ /// Available options are "xsmall", "small", "medium" (default), "large"
57
+ /// @param {String} $kind - Changes the text style kind based on the available options
58
+ /// Available options are "body" (default), "title-secondary"
59
+ /// @example @include mrl-text-static("large");
60
+ @mixin mrl-text-static($size: 'medium', $kind: 'body') {
61
+ // we use the default token if size is medium
62
+ $size-token: '';
63
+ $weight-token: 'text';
64
+
65
+ @if $size != 'medium' {
66
+ $size-token: '-#{$size}';
67
+ }
68
+
69
+ @if $kind == 'title-secondary' {
70
+ $weight-token: 'title-secondary'
71
+ }
72
+
73
+ font-family: var(--mrl-text-family);
74
+ font-size: var(--mrl-type-size-text#{$size-token});
75
+ font-weight: var(--mrl-type-weight-#{$weight-token});
76
+ letter-spacing: var(--mrl-type-spacing-text);
77
+ line-height: var(--mrl-type-line-height-text#{$size-token});
78
+ }
79
+
80
+
81
+ /// Toggleable label mixin
82
+ /// This mixin is for using with icon buttons and dynamic labels withing drawers
83
+ /// @group mixins
84
+ /// @example @include mrl-text-toggleable-label();
85
+ @mixin mrl-text-toggleable-label() {
86
+ font-size: var(--mrl-type-size-toggleable-label);
87
+ font-weight: var(--mrl-type-weight-toggleable-label);
88
+ }
89
+
90
+ /// Vertical centering for immediate children of an element
91
+ /// @group mixins
92
+ /// @param {String} $display - specifies the display behavior (the type of rendering box) of an element
93
+ /// Available options are "inline", "block" (default)
94
+ /// @example @include mrl-space-center-vertical("inline");
95
+ @mixin mrl-space-center-vertical($display: 'block') {
96
+ $display-centered: flex;
97
+
98
+ @if $display == 'inline' {
99
+ $display-centered: inline-flex;
100
+ }
101
+
102
+ align-items: center;
103
+ display: $display-centered;
104
+
105
+ > * {
106
+ display: inline-flex;
107
+ }
108
+ }
109
+
110
+ /// Horizontal centering for immediate children of an element
111
+ /// @group mixins
112
+ /// @param {String} $display - specifies the display behavior (the type of rendering box) of an element
113
+ /// Available options are "inline", "block" (default)
114
+ /// @example @include mrl-space-center-horizontal("inline");
115
+ @mixin mrl-space-center-horizontal($display: 'block') {
116
+ $display-centered: flex;
117
+
118
+ @if $display == 'inline' {
119
+ $display-centered: inline-flex;
120
+ }
121
+
122
+ display: $display-centered;
123
+ }
124
+
125
+ /// Drop shadow mixin
126
+ /// This mixin is for creating drop shadows using `filter: drop-shadow(...)`.
127
+ /// This method is preferred over `box-shadow` in instances like the canvas where
128
+ /// the shadows will rerender continuously on drag. Note, filters get applied to all
129
+ /// child elements as well. To work around affecting children, use a pseudo element
130
+ /// to apply the filter instead.
131
+ /// @group mixins
132
+ /// @param {String} $type - The desired type based on the shadow tokens.
133
+ /// Available options are "lifted" (default), "raised", "floating", "hover", "drag"
134
+ /// @example @include mrl-shadow("raised");
135
+ @mixin mrl-shadow($type: 'lifted') {
136
+ // Set a filter for "raised", "floating", "hover", or "drag" if they are passed, otherwise use "lifted"
137
+ // We use hard coded rgba values here because CSS variables don't render in the filter.
138
+ @if $type == 'raised' {
139
+ filter: drop-shadow(0 0 1px rgba(0, 0, 0, 8%)) drop-shadow(0 5px 8px rgba(0, 0, 0, 8%));
140
+ } @else if $type == 'floating' {
141
+ filter: drop-shadow(0 0 1px rgba(0, 0, 0, 8%)) drop-shadow(0 25px 20px rgba(0, 0, 0, 12%));
142
+ } @else if $type == 'hover' {
143
+ filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 8%));
144
+ } @else if $type == 'drag' {
145
+ filter: drop-shadow(0 20px 12px rgba(0, 0, 0, 12%));
146
+ } @else {
147
+ // The box-shadow version of this shadow contains a spread value which is not supported
148
+ // in the drop-shadow filter. The values of the first shadow have been manually tweaked
149
+ // with design to create alignment as much as possible between the two implementations.
150
+ filter: drop-shadow(0 0 1px rgba(0, 0, 0, 28%)) drop-shadow(0 4px 4px rgba(0, 0, 0, 4%));
151
+ }
152
+ }
@@ -0,0 +1,157 @@
1
+ ////
2
+ /// Mural's design system baseline and normalizer styles
3
+ /// @group baseline
4
+ ////
5
+
6
+ /// http://meyerweb.com/eric/tools/css/reset/
7
+ /// v2.0 | 20110126
8
+ /// License: none (public domain)
9
+ /// Start vendor reset
10
+ body,
11
+ div,
12
+ span,
13
+ applet,
14
+ object,
15
+ iframe,
16
+ h1,
17
+ h2,
18
+ h3,
19
+ h4,
20
+ h5,
21
+ h6,
22
+ p,
23
+ blockquote,
24
+ pre,
25
+ a,
26
+ abbr,
27
+ acronym,
28
+ address,
29
+ big,
30
+ cite,
31
+ code,
32
+ del,
33
+ dfn,
34
+ img,
35
+ ins,
36
+ kbd,
37
+ q,
38
+ samp,
39
+ small,
40
+ tt,
41
+ var,
42
+ center,
43
+ dl,
44
+ dt,
45
+ dd,
46
+ ol,
47
+ ul,
48
+ li,
49
+ fieldset,
50
+ form,
51
+ label,
52
+ legend,
53
+ table,
54
+ caption,
55
+ tbody,
56
+ tfoot,
57
+ thead,
58
+ tr,
59
+ th,
60
+ td,
61
+ article,
62
+ aside,
63
+ canvas,
64
+ details,
65
+ embed,
66
+ figure,
67
+ figcaption,
68
+ footer,
69
+ header,
70
+ hgroup,
71
+ menu,
72
+ nav,
73
+ output,
74
+ ruby,
75
+ section,
76
+ summary,
77
+ time,
78
+ mark,
79
+ audio,
80
+ video {
81
+ border: 0;
82
+ margin: 0;
83
+ padding: 0;
84
+ vertical-align: baseline;
85
+ }
86
+
87
+ b,
88
+ em,
89
+ i,
90
+ strike,
91
+ strong,
92
+ sub,
93
+ sup,
94
+ u {
95
+ border: 0;
96
+ font-family: inherit;
97
+ margin: 0;
98
+ padding: 0;
99
+ vertical-align: baseline;
100
+ }
101
+
102
+ /* HTML5 display-role reset for older browsers */
103
+ article,
104
+ aside,
105
+ details,
106
+ figcaption,
107
+ figure,
108
+ footer,
109
+ header,
110
+ hgroup,
111
+ menu,
112
+ nav,
113
+ section {
114
+ display: block;
115
+ }
116
+
117
+ ol,
118
+ ul {
119
+ list-style: none;
120
+ }
121
+
122
+ blockquote,
123
+ q {
124
+ quotes: none;
125
+ }
126
+
127
+ blockquote::before,
128
+ blockquote::after,
129
+ q::before,
130
+ q::after {
131
+ content: none;
132
+ }
133
+
134
+ table {
135
+ border-collapse: collapse;
136
+ border-spacing: 0;
137
+ }
138
+
139
+ /// End vendor reset
140
+
141
+ html {
142
+ border: 0;
143
+ box-sizing: border-box;
144
+ font: inherit;
145
+ font-family: var(--mrl-font-family-01), sans-serif;
146
+ font-size: var(--mrl-font-size, 100%);
147
+ -webkit-font-smoothing: antialiased;
148
+ margin: 0;
149
+ padding: 0;
150
+ vertical-align: baseline;
151
+ }
152
+
153
+ *,
154
+ *::before,
155
+ *::after {
156
+ box-sizing: inherit;
157
+ }
@@ -0,0 +1,100 @@
1
+ ////
2
+ /// Contextual Border Tokens
3
+ /// @group variables
4
+ ////
5
+
6
+ $mrl-contextual-border-width-vars: (
7
+ "border": "01",
8
+ "border-selected": "01",
9
+ "focus": "01",
10
+ "control": "01",
11
+ "divider": "01",
12
+ );
13
+ $mrl-contextual-border-radius-vars: (
14
+ "tight": "01",
15
+ "content": "02",
16
+ "content-large": "03",
17
+ "functional": "03",
18
+ "functional-large": "04",
19
+ "container": "04",
20
+ "container-large": "05",
21
+ "rounded": "07",
22
+ "rounded-large": "08",
23
+ );
24
+
25
+ // Setup for contextual border stroke and color combinations
26
+ $mrl-contextual-border-sets: (
27
+ "", // default color set
28
+ "emph",
29
+ "inverse"
30
+ );
31
+ $mrl-contextual-border-states: (
32
+ "", // default element state
33
+ "hover",
34
+ "active",
35
+ "selected",
36
+ "disabled"
37
+ );
38
+ $mrl-contextual-border-unique: (
39
+ "focus",
40
+ "divider"
41
+ );
42
+
43
+ :root {
44
+ // Border Width
45
+ @each $token-name, $token-value in $mrl-contextual-border-width-vars {
46
+ --mrl-line-width-#{$token-name}: var(--mrl-stroke-#{$token-value});
47
+ }
48
+
49
+ // Border Radius
50
+ @each $token-name, $token-value in $mrl-contextual-border-radius-vars {
51
+ --mrl-border-radius-#{$token-name}: var(--mrl-radii-#{$token-value});
52
+ }
53
+
54
+ // Disabling stylelint rule because this is an intentional nesting to keep DRY code to create a list of CSS variables
55
+ // stylelint-disable max-nesting-depth
56
+
57
+ // Border combinations
58
+ @each $set in $mrl-contextual-border-sets {
59
+ @each $state in $mrl-contextual-border-states {
60
+ $set-token: '-#{$set}';
61
+ $state-token: '-#{$state}';
62
+ $width-token: '';
63
+
64
+ @if $set == '' {
65
+ $set-token: '';
66
+ }
67
+
68
+ @if $state == '' {
69
+ $state-token: '';
70
+ }
71
+
72
+ $color-token: $state-token;
73
+
74
+ @if $state == 'selected' {
75
+ $width-token: '-#{$state}'
76
+ }
77
+
78
+ @if $set == 'inverse' {
79
+ @if $state != 'disabled' {
80
+ $color-token: '';
81
+ }
82
+ }
83
+
84
+ --mrl-border#{$set-token}#{$state-token}: var(--mrl-line-width-border#{$width-token}) solid var(--mrl-color-line#{$set-token}#{$color-token});
85
+ }
86
+ }
87
+
88
+
89
+ // Unique border combinations
90
+ @each $use-case in $mrl-contextual-border-unique {
91
+ $color-token: 'line-#{$use-case}';
92
+
93
+ @if $use-case == 'focus' {
94
+ $color-token: 'focus';
95
+ }
96
+
97
+ --mrl-border-#{$use-case}: var(--mrl-line-width-#{$use-case}) solid var(--mrl-color-#{$color-token});
98
+ }
99
+ // stylelint-enable max-nesting-depth
100
+ }