@terrahq/design-system 0.6.1 → 0.10.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 (35) hide show
  1. package/README.md +31 -9
  2. package/bin/terra-ds.mjs +33 -0
  3. package/dist/icons.css +1 -0
  4. package/dist/style.css +1 -1
  5. package/package.json +1 -1
  6. package/src/scss/framework/_var/_vars.scss +33 -22
  7. package/src/scss/framework/components/btn.scss +1 -0
  8. package/src/scss/framework/foundation/font/_make-font.scss +12 -12
  9. package/src/scss/framework/foundation/gap/_make-gap.scss +10 -10
  10. package/src/scss/framework/foundation/grid/_columns.scss +51 -10
  11. package/src/scss/framework/foundation/grid/_container.scss +0 -7
  12. package/src/scss/framework/foundation/grid/_make-container.scss +3 -3
  13. package/src/scss/framework/foundation/section/_make-section.scss +18 -18
  14. package/src/scss/framework/foundation/spaces/_make-spaces.scss +10 -10
  15. package/src/scss/framework/utilities/_align-items.scss +5 -5
  16. package/src/scss/framework/utilities/_aspect-ratio.scss +5 -5
  17. package/src/scss/framework/utilities/_display.scss +6 -5
  18. package/src/scss/framework/utilities/_flex-direction.scss +5 -5
  19. package/src/scss/framework/utilities/_font-style.scss +5 -5
  20. package/src/scss/framework/utilities/_font-weight.scss +5 -5
  21. package/src/scss/framework/utilities/_height.scss +5 -5
  22. package/src/scss/framework/utilities/_justify-content.scss +5 -5
  23. package/src/scss/framework/utilities/_offsets.scss +2 -1
  24. package/src/scss/framework/utilities/_opacity.scss +2 -1
  25. package/src/scss/framework/utilities/_order.scss +5 -5
  26. package/src/scss/framework/utilities/_overflow.scss +6 -5
  27. package/src/scss/framework/utilities/_position.scss +5 -5
  28. package/src/scss/framework/utilities/_size.scss +14 -0
  29. package/src/scss/framework/utilities/_spacing.scss +11 -8
  30. package/src/scss/framework/utilities/_text-align.scss +7 -7
  31. package/src/scss/framework/utilities/_text-transform.scss +47 -0
  32. package/src/scss/framework/utilities/_utilities.scss +2 -0
  33. package/src/scss/framework/utilities/_width.scss +5 -5
  34. package/src/scss/framework/utilities/_z-index.scss +2 -1
  35. package/terra.config.example.js +23 -7
@@ -1,34 +1,36 @@
1
+ @use "sass:map";
1
2
  @use "@scss/framework/_var/_vars.scss" as *;
2
3
 
3
4
 
5
+ // The same names as Punky: u--p-4, u--pt-4, u--m-4, u--mt-4. px, py, mx and my are the pairs of sides.
4
6
  $space-prefixes : (
5
7
  p : padding,
6
8
  pt : padding-top,
7
9
  pr : padding-right,
8
10
  pb : padding-bottom,
9
11
  pl : padding-left,
12
+ px : (padding-left, padding-right),
13
+ py : (padding-top, padding-bottom),
10
14
  m : margin,
11
15
  mt : margin-top,
12
16
  mr : margin-right,
13
17
  mb : margin-bottom,
14
18
  ml : margin-left,
15
- px : (padding-left, padding-right),
16
- py : (padding-top, padding-bottom),
17
19
  mx : (margin-left, margin-right),
18
20
  my : (margin-top, margin-bottom),
19
21
  gap : gap,
20
22
  row-gap : row-gap,
21
- col-gap : column-gap,
23
+ column-gap : column-gap,
22
24
  ) !default;
23
25
 
24
26
  $space-breakpoints: (
25
27
  all: $all,
26
- desktop: $desktop,
27
- laptop: $laptop,
28
- tabletl: $tabletl,
29
- tabletm: $tabletm,
30
28
  tablets: $tablets,
31
- mobile: $mobile,
29
+ tabletm: $tabletm,
30
+ tabletl: $tabletl,
31
+ laptop: $laptop,
32
+ desktop: $desktop,
33
+ wide: $wide,
32
34
  );
33
35
 
34
36
  @mixin make-spaces($values, $prefixes, $breakpoints) {
@@ -61,6 +63,7 @@
61
63
 
62
64
  @include make-spaces($space-values, $space-prefixes,$space-breakpoints);
63
65
 
66
+
64
67
  .u--mx-auto { margin-left: auto; margin-right: auto; }
65
68
  .u--my-auto { margin-top: auto; margin-bottom: auto; }
66
69
  .u--m-auto { margin: auto; }
@@ -9,26 +9,26 @@ $text-align-values: (
9
9
 
10
10
  $text-align-breakpoints: (
11
11
  all: $all,
12
- desktop: $desktop,
13
- laptop: $laptop,
14
- tabletl: $tabletl,
15
- tabletm: $tabletm,
16
12
  tablets: $tablets,
17
- mobile: $mobile,
13
+ tabletm: $tabletm,
14
+ tabletl: $tabletl,
15
+ laptop: $laptop,
16
+ desktop: $desktop,
17
+ wide: $wide,
18
18
  );
19
19
 
20
20
  @mixin text-align-utility($text-prop, $breakpoints) {
21
21
  @each $breakpoint-name, $breakpoint-value in $breakpoints {
22
22
  @if ($breakpoint-value == 0) {
23
23
  @each $name, $property in $text-prop {
24
- .u--text-align-#{$name} {
24
+ .u--text-#{$name} {
25
25
  text-align: $property;
26
26
  }
27
27
  }
28
28
  } @else {
29
29
  @media screen and ($viewport-type: $breakpoint-value) {
30
30
  @each $name, $property in $text-prop {
31
- .u--text-align-#{$breakpoint-name}-#{$name} {
31
+ .u--text-#{$breakpoint-name}-#{$name} {
32
32
  text-align: $property;
33
33
  }
34
34
  }
@@ -0,0 +1,47 @@
1
+ @use "@scss/framework/_var/_vars.scss" as *;
2
+ @use "sass:meta";
3
+
4
+ $text-transform-values: (
5
+ // capitalize: capitalize,
6
+ uppercase: uppercase,
7
+ // lowercase:lowercase,
8
+ // none:none,
9
+ );
10
+
11
+ $text-transform-breakpoints: (
12
+ all: $all,
13
+ // tablets: $tablets,
14
+ // tabletm: $tabletm,
15
+ //tabletl: $tabletl,
16
+ // laptop: $laptop,
17
+ // desktop: $desktop,
18
+ // wide: $wide,
19
+ );
20
+
21
+ @mixin text-transform-utility($text-prop, $breakpoints) {
22
+ @each $breakpoint-name, $breakpoint-value in $breakpoints {
23
+ @if ($breakpoint-value == 0) {
24
+ @each $name, $property in $text-prop {
25
+ .u--text-#{$name} {
26
+ text-transform: $property;
27
+ }
28
+ }
29
+ } @else {
30
+ @media screen and ($viewport-type: $breakpoint-value) {
31
+ @each $name, $property in $text-prop {
32
+ .u--text-#{$breakpoint-name}-#{$name} {
33
+ text-transform: $property;
34
+ }
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ @if meta.variable-exists(text-transform-breakpoints) {
41
+ @include text-transform-utility(
42
+ $text-transform-values,
43
+ $text-transform-breakpoints
44
+ );
45
+ } @else {
46
+ @include text-transform-utility($text-transform-values, $breakpoints-grid);
47
+ }
@@ -25,3 +25,5 @@
25
25
  @forward './z-index.scss';
26
26
  @forward './min-width.scss';
27
27
  @forward './cursor.scss';
28
+ @forward './size.scss';
29
+ @forward './text-transform.scss';
@@ -11,12 +11,12 @@ $width-values: (
11
11
 
12
12
  $width-breakpoints: (
13
13
  all: $all,
14
- desktop: $desktop,
15
- laptop: $laptop,
16
- tabletl: $tabletl,
17
- tabletm: $tabletm,
18
14
  tablets: $tablets,
19
- mobile: $mobile,
15
+ tabletm: $tabletm,
16
+ tabletl: $tabletl,
17
+ laptop: $laptop,
18
+ desktop: $desktop,
19
+ wide: $wide,
20
20
  );
21
21
 
22
22
  @mixin width-utility($width-prop, $breakpoints) {
@@ -1,5 +1,6 @@
1
+ @use "@scss/framework/_var/_vars.scss" as *;
2
+
1
3
  // u--z-index-{n}: stacking order. 20 = sticky bars, 40 = dropdowns and popovers over them.
2
- $z-index-values: (0, 10, 20, 40) !default;
3
4
 
4
5
  @each $value in $z-index-values {
5
6
  .u--z-index-#{$value} {
@@ -1,10 +1,26 @@
1
1
  // Copy to your project as terra.config.js, then: npx terra-ds build
2
+ // Every key is optional: what you leave out keeps the value Terra ships with, shown here as a comment.
2
3
  export default {
3
- colors: { a: '#0f0f0f', b: '#ffffff' }, // replaces the palette; "a" and "b" are required
4
- backgrounds: ['a', 'b'], // which colors also get f--background-*
5
- spacing: [0, 1, 2, 4, 8], // replaces the u--p-* / u--m-* steps
6
- minWidth: [10, 20, 30, 40], // u--min-width-* steps (x 8px): 10 = 5rem, 30 = 15rem
7
- font: "'Uncut Sans', system-ui, sans-serif", // font-family used by f--font-* (this is already the default)
8
- radius: { a: '4px', full: '999px' }, // replaces f--radius-*
9
- output: 'public/terra.css',
4
+ // Palette and type
5
+ colors: { a: '#0f0f0f', b: '#ffffff' }, // replaces the palette; "a" and "b" are required
6
+ backgrounds: ['a', 'b'], // which colors also get f--background-* (default a to e)
7
+ font: "'Uncut Sans', system-ui, sans-serif", // font-family of f--font-* (this is the default)
8
+
9
+ // Shape and depth
10
+ radius: { a: '4px', full: '999px' }, // replaces f--radius-* (default a 8px, b 12px, c 16px, d 20px, full, round)
11
+ shadows: { a: '0 1px 2px rgb(15 15 15 / .06), 0 4px 16px rgb(15 15 15 / .08)' }, // f--shadow-* (default a, b, c)
12
+
13
+ // Scales of the utilities (each step is a class)
14
+ spacing: [0, 1, 2, 4, 8], // u--padding-*, u--margin-*, u--gap-* (x 8px; default 0 to 10, 12 and 15)
15
+ sizes: [2, 4, 5, 6, 8], // u--height-*, u--width-* (x 8px; default 2, 3, 4, 5, 6, 8, 10, 12)
16
+ minWidth: [10, 20, 30, 40], // u--min-width-* (x 8px; this is the default)
17
+ opacity: { 100: 1, 85: 0.85, 70: 0.7, 50: 0.5 }, // u--opacity-* (this is the default)
18
+ zIndex: [0, 10, 20, 40], // u--z-index-* (this is the default)
19
+ offsets: { 0: '0', 100: '100%' }, // u--top-*, u--right-*, u--bottom-*, u--left-* (this is the default)
20
+
21
+ // Motion
22
+ time: { a: '0.1s', b: '0.3s', c: '0.6s' }, // micro-interactions, expansion, background dimming (this is the default)
23
+ ease: { 'standard-a': 'cubic-bezier(0.2, 0, 0.38, 0.9)' }, // also standard-b, entrance-a/b, exit-a/b
24
+
25
+ output: 'public/terra.css', // where the CSS is written
10
26
  }