@servicetitan/hammer-token 1.3.5 → 2.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @servicetitan/hammer-token@1.3.5 build /home/runner/work/hammer/hammer/packages/hammer-token
2
+ > @servicetitan/hammer-token@2.0.0 build /home/runner/work/hammer/hammer/packages/hammer-token
3
3
  > node ./config.js
4
4
 
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @servicetitan/hammer-token
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#945](https://github.com/servicetitan/hammer/pull/945) [`87e0760`](https://github.com/servicetitan/hammer/commit/87e0760c3615268e28444d109479d9502bfa0788) Thanks [@w-a-t-s-o-n](https://github.com/w-a-t-s-o-n)! - Update `border-radius-*` tokens and add `radius-*` primitives
8
+
9
+ ## 1.3.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [#913](https://github.com/servicetitan/hammer/pull/913) [`3246da5`](https://github.com/servicetitan/hammer/commit/3246da57b0b41ad823acf6c45fa4bea0fe8fca84) Thanks [@tounsoo](https://github.com/tounsoo)! - Fix font family base not using CSS variables
14
+
3
15
  ## 1.3.5
4
16
 
5
17
  ### Patch Changes
@@ -4,10 +4,11 @@
4
4
  .border-color-strong {border-color: light-dark(var(--color-neutral-200, #444445), var(--color-neutral-60, #dfe0e1))}
5
5
  .border-color-subdued {border-color: light-dark(var(--color-neutral-60, #dfe0e1), var(--color-neutral-200, #444445))}
6
6
  .border-radius-circular {border-radius: 100%}
7
- .border-radius-none {border-radius: var(--size-0, 0rem)}
8
- .border-radius-pill {border-radius: 500px}
9
- .border-radius-rounded {border-radius: 0.375rem}
10
- .border-radius-rounded-strong {border-radius: 1rem}
7
+ .border-radius-large {border-radius: var(--radius-4, 0.75rem)}
8
+ .border-radius-medium {border-radius: var(--radius-2, 0.375rem)}
9
+ .border-radius-none {border-radius: var(--radius-0, 0)}
10
+ .border-radius-small {border-radius: var(--radius-1, 0.1875rem)}
11
+ .border-radius-xlarge {border-radius: var(--radius-8, 1.5rem)}
11
12
  .border-width-default {border-width: var(--size-quarter, 0.0625rem)}
12
13
  .border-width-none {border-width: var(--size-0, 0rem)}
13
14
  .border-width-strong {border-width: var(--size-half, 0.125rem)}
@@ -34,10 +34,11 @@
34
34
  .border-color-strong {border-color: light-dark(var(--color-neutral-200, #444445), var(--color-neutral-60, #dfe0e1))}
35
35
  .border-color-subdued {border-color: light-dark(var(--color-neutral-60, #dfe0e1), var(--color-neutral-200, #444445))}
36
36
  .border-radius-circular {border-radius: 100%}
37
- .border-radius-none {border-radius: var(--size-0, 0rem)}
38
- .border-radius-pill {border-radius: 500px}
39
- .border-radius-rounded {border-radius: 0.375rem}
40
- .border-radius-rounded-strong {border-radius: 1rem}
37
+ .border-radius-large {border-radius: var(--radius-4, 0.75rem)}
38
+ .border-radius-medium {border-radius: var(--radius-2, 0.375rem)}
39
+ .border-radius-none {border-radius: var(--radius-0, 0)}
40
+ .border-radius-small {border-radius: var(--radius-1, 0.1875rem)}
41
+ .border-radius-xlarge {border-radius: var(--radius-8, 1.5rem)}
41
42
  .border-width-default {border-width: var(--size-quarter, 0.0625rem)}
42
43
  .border-width-none {border-width: var(--size-0, 0rem)}
43
44
  .border-width-strong {border-width: var(--size-half, 0.125rem)}
@@ -77,6 +77,8 @@ $token: (
77
77
  duration-instant: 0ms,
78
78
  duration-fast: 100ms,
79
79
  duration-slow: 300ms,
80
+ font-family-base: "'Nunito Sans', sans-serif",
81
+ font-family-display: "'Sofia Pro', SofiaPro, sans-serif",
80
82
  font-line-height-base: 1.5,
81
83
  font-line-height-display: 1.25,
82
84
  font-weight-normal: 400,
@@ -91,6 +93,15 @@ $token: (
91
93
  font-size-700: 1.75rem,
92
94
  font-size-800: 2rem,
93
95
  font-size-900: 2.25rem,
96
+ radius-0: 0,
97
+ radius-1: 0.1875rem,
98
+ radius-2: 0.375rem,
99
+ radius-3: 0.5625rem,
100
+ radius-4: 0.75rem,
101
+ radius-5: 0.9375rem,
102
+ radius-6: 1.125rem,
103
+ radius-7: 1.3125rem,
104
+ radius-8: 1.5rem,
94
105
  size-0: 0rem,
95
106
  size-1: 0.25rem,
96
107
  size-2: 0.5rem,
@@ -92,6 +92,15 @@ export const FontSize600 = { value: "1.5rem" };
92
92
  export const FontSize700 = { value: "1.75rem" };
93
93
  export const FontSize800 = { value: "2rem" };
94
94
  export const FontSize900 = { value: "2.25rem" };
95
+ export const Radius0 = { value: "0" };
96
+ export const Radius1 = { value: "0.1875rem" };
97
+ export const Radius2 = { value: "0.375rem" };
98
+ export const Radius3 = { value: "0.5625rem" };
99
+ export const Radius4 = { value: "0.75rem" };
100
+ export const Radius5 = { value: "0.9375rem" };
101
+ export const Radius6 = { value: "1.125rem" };
102
+ export const Radius7 = { value: "1.3125rem" };
103
+ export const Radius8 = { value: "1.5rem" };
95
104
  export const Size0 = { value: "0rem" };
96
105
  export const Size1 = { value: "0.25rem" };
97
106
  export const Size2 = { value: "0.5rem" };
@@ -76,8 +76,8 @@ $duration: 200ms;
76
76
  $duration-instant: 0ms;
77
77
  $duration-fast: 100ms;
78
78
  $duration-slow: 300ms;
79
- $font-family-base: 'Nunito Sans', sans-serif;
80
- $font-family-display: 'Sofia Pro', SofiaPro, sans-serif;
79
+ $font-family-base: var(--font-family-base, 'Nunito Sans', sans-serif);
80
+ $font-family-display: var(--font-family-display, 'Sofia Pro', SofiaPro, sans-serif);
81
81
  $font-line-height-base: 1.5;
82
82
  $font-line-height-display: 1.25;
83
83
  $font-weight-normal: 400;
@@ -92,6 +92,15 @@ $font-size-600: 1.5rem;
92
92
  $font-size-700: 1.75rem;
93
93
  $font-size-800: 2rem;
94
94
  $font-size-900: 2.25rem;
95
+ $radius-0: 0;
96
+ $radius-1: 0.1875rem;
97
+ $radius-2: 0.375rem;
98
+ $radius-3: 0.5625rem;
99
+ $radius-4: 0.75rem;
100
+ $radius-5: 0.9375rem;
101
+ $radius-6: 1.125rem;
102
+ $radius-7: 1.3125rem;
103
+ $radius-8: 1.5rem;
95
104
  $size-0: 0rem;
96
105
  $size-1: 0.25rem;
97
106
  $size-2: 0.5rem;
@@ -1,8 +1,9 @@
1
1
  export const common = {
2
- BorderRadiusNone: "0rem",
3
- BorderRadiusRounded: "0.375rem",
4
- BorderRadiusRoundedStrong: "1rem",
5
- BorderRadiusPill: "500px",
2
+ BorderRadiusNone: "0",
3
+ BorderRadiusSmall: "0.1875rem",
4
+ BorderRadiusMedium: "0.375rem",
5
+ BorderRadiusLarge: "0.75rem",
6
+ BorderRadiusXlarge: "1.5rem",
6
7
  BorderRadiusCircular: "100%",
7
8
  BorderWidthNone: "0rem",
8
9
  BorderWidth: "0.0625rem",
@@ -89,10 +89,11 @@ $dark: (
89
89
  status-color-warning: #ffe278,
90
90
  );
91
91
  $nonColor: (
92
- border-radius-none: 0rem,
93
- border-radius-rounded: 0.375rem,
94
- border-radius-rounded-strong: 1rem,
95
- border-radius-pill: 500px,
92
+ border-radius-none: 0,
93
+ border-radius-small: 0.1875rem,
94
+ border-radius-medium: 0.375rem,
95
+ border-radius-large: 0.75rem,
96
+ border-radius-xlarge: 1.5rem,
96
97
  border-radius-circular: 100%,
97
98
  border-width-none: 0rem,
98
99
  border-width: 0.0625rem,
@@ -107,16 +108,19 @@ $nonColor: (
107
108
  typography-paragraph-size-large: 1.25rem,
108
109
  typography-paragraph-size-xlarge: 1.5rem,
109
110
  typography-paragraph-font-weight: 400,
111
+ typography-paragraph-font-family: "'Nunito Sans', sans-serif",
110
112
  typography-heading-size-xsmall: 0.875rem,
111
113
  typography-heading-size-small: 1rem,
112
114
  typography-heading-size: 1.25rem,
113
115
  typography-heading-size-large: 1.5rem,
114
116
  typography-heading-size-xlarge: 2rem,
115
117
  typography-heading-font-weight: 700,
118
+ typography-heading-font-family: "'Sofia Pro', SofiaPro, sans-serif",
116
119
  typography-label-size-xsmall: 0.625rem,
117
120
  typography-label-size-small: 0.75rem,
118
121
  typography-label-size: 0.875rem,
119
122
  typography-label-size-large: 1rem,
120
123
  typography-label-size-xlarge: 1.25rem,
121
124
  typography-label-font-weight: 600,
125
+ typography-label-font-family: "'Nunito Sans', sans-serif",
122
126
  );
@@ -108,10 +108,11 @@ export const BackgroundColorInvertedStrong = {
108
108
  }
109
109
  }
110
110
  };
111
- export const BorderRadiusNone = { value: "0rem" };
112
- export const BorderRadiusRounded = { value: "0.375rem" };
113
- export const BorderRadiusRoundedStrong = { value: "1rem" };
114
- export const BorderRadiusPill = { value: "500px" };
111
+ export const BorderRadiusNone = { value: "0" };
112
+ export const BorderRadiusSmall = { value: "0.1875rem" };
113
+ export const BorderRadiusMedium = { value: "0.375rem" };
114
+ export const BorderRadiusLarge = { value: "0.75rem" };
115
+ export const BorderRadiusXlarge = { value: "1.5rem" };
115
116
  export const BorderRadiusCircular = { value: "100%" };
116
117
  export const BorderWidthNone = { value: "0rem" };
117
118
  export const BorderWidth = { value: "0.0625rem" };
@@ -9,10 +9,11 @@ $background-color-warning: var(--background-color-warning, #ffbe00);
9
9
  $background-color-disabled: var(--background-color-disabled, #606162);
10
10
  $background-color-inverted: var(--background-color-inverted, #2d2e31);
11
11
  $background-color-inverted-strong: var(--background-color-inverted-strong, #141414);
12
- $border-radius-none: 0rem;
13
- $border-radius-rounded: 0.375rem;
14
- $border-radius-rounded-strong: 1rem;
15
- $border-radius-pill: 500px;
12
+ $border-radius-none: 0;
13
+ $border-radius-small: 0.1875rem;
14
+ $border-radius-medium: 0.375rem;
15
+ $border-radius-large: 0.75rem;
16
+ $border-radius-xlarge: 1.5rem;
16
17
  $border-radius-circular: 100%;
17
18
  $border-width-none: 0rem;
18
19
  $border-width: 0.0625rem;
@@ -59,18 +60,18 @@ $typography-paragraph-size: 1rem;
59
60
  $typography-paragraph-size-large: 1.25rem;
60
61
  $typography-paragraph-size-xlarge: 1.5rem;
61
62
  $typography-paragraph-font-weight: 400;
62
- $typography-paragraph-font-family: 'Nunito Sans', sans-serif;
63
+ $typography-paragraph-font-family: var(--typography-paragraph-font-family, 'Nunito Sans', sans-serif);
63
64
  $typography-heading-size-xsmall: 0.875rem;
64
65
  $typography-heading-size-small: 1rem;
65
66
  $typography-heading-size: 1.25rem;
66
67
  $typography-heading-size-large: 1.5rem;
67
68
  $typography-heading-size-xlarge: 2rem;
68
69
  $typography-heading-font-weight: 700;
69
- $typography-heading-font-family: 'Sofia Pro', SofiaPro, sans-serif;
70
+ $typography-heading-font-family: var(--typography-heading-font-family, 'Sofia Pro', SofiaPro, sans-serif);
70
71
  $typography-label-size-xsmall: 0.625rem;
71
72
  $typography-label-size-small: 0.75rem;
72
73
  $typography-label-size: 0.875rem;
73
74
  $typography-label-size-large: 1rem;
74
75
  $typography-label-size-xlarge: 1.25rem;
75
76
  $typography-label-font-weight: 600;
76
- $typography-label-font-family: 'Nunito Sans', sans-serif;
77
+ $typography-label-font-family: var(--typography-label-font-family, 'Nunito Sans', sans-serif);
package/config.js CHANGED
@@ -17,6 +17,8 @@ StyleDictionary.registerFormat({
17
17
  .map((token) => {
18
18
  let value = token.value;
19
19
  let name = `${token.name.replace("-default", "")}`;
20
+ if (token.name.includes("font-family"))
21
+ return `$${name}: var(--${name}, ${value});`;
20
22
  if (token.attributes.appearance) {
21
23
  return `$${name}: var(--${name}, ${value});`;
22
24
  }
@@ -82,12 +84,12 @@ StyleDictionary.registerFormat({
82
84
  isColor = false;
83
85
  }
84
86
  });
85
- if (token.name.includes("font-family")) return false;
86
87
  return !isColor;
87
88
  })
88
89
  .map((token) => {
89
90
  let value = token.value;
90
91
  let name = `${token.name.replace("-default", "")}`;
92
+ if (token.name.includes("font-family")) return ` ${name}: "${value}",`;
91
93
  return ` ${name}: ${value},`;
92
94
  })
93
95
  .join(`\n`);
@@ -110,10 +112,10 @@ StyleDictionary.registerFormat({
110
112
  name: `custom/primitive-variables`,
111
113
  formatter: function ({ dictionary }) {
112
114
  const vars = dictionary.allTokens
113
- .filter((token) => !token.name.includes("font-family"))
114
115
  .map((token) => {
115
116
  let value = token.value;
116
117
  let name = `${token.name.replace("-default", "")}`;
118
+ if (token.name.includes("font-family")) return ` ${name}: "${value}",`;
117
119
  return ` ${name}: ${value},`;
118
120
  })
119
121
  .join(`\n`);
@@ -284,6 +286,7 @@ themes.forEach((theme) => {
284
286
  // referenced tokens
285
287
  token.filePath.includes("primitive/color") ||
286
288
  token.filePath.includes("primitive/size") ||
289
+ token.filePath.includes("primitive/radius") ||
287
290
  token.filePath.includes("status")
288
291
  );
289
292
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/hammer-token",
3
- "version": "1.3.5",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "build/web/index.js",
6
6
  "types": "build/web/index.d.ts",
@@ -0,0 +1,31 @@
1
+ {
2
+ "radius": {
3
+ "0": {
4
+ "value": "0"
5
+ },
6
+ "1": {
7
+ "value": "0.1875rem"
8
+ },
9
+ "2": {
10
+ "value": "0.375rem"
11
+ },
12
+ "3": {
13
+ "value": "0.5625rem"
14
+ },
15
+ "4": {
16
+ "value": "0.75rem"
17
+ },
18
+ "5": {
19
+ "value": "0.9375rem"
20
+ },
21
+ "6": {
22
+ "value": "1.125rem"
23
+ },
24
+ "7": {
25
+ "value": "1.3125rem"
26
+ },
27
+ "8": {
28
+ "value": "1.5rem"
29
+ }
30
+ }
31
+ }
@@ -2,16 +2,19 @@
2
2
  "border": {
3
3
  "radius": {
4
4
  "none": {
5
- "value": "{size.0}"
5
+ "value": "{radius.0}"
6
+ },
7
+ "small": {
8
+ "value": "{radius.1}"
6
9
  },
7
- "rounded": {
8
- "value": "0.375rem"
10
+ "medium": {
11
+ "value": "{radius.2}"
9
12
  },
10
- "rounded-strong": {
11
- "value": "1rem"
13
+ "large": {
14
+ "value": "{radius.4}"
12
15
  },
13
- "pill": {
14
- "value": "500px"
16
+ "xlarge": {
17
+ "value": "{radius.8}"
15
18
  },
16
19
  "circular": {
17
20
  "value": "100%"