@esri/calcite-design-tokens 1.1.1-next.2 → 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.
Files changed (153) hide show
  1. package/README.md +7 -9
  2. package/dist/css/breakpoint.css +29 -0
  3. package/dist/css/classes.css +327 -0
  4. package/dist/css/core.css +311 -0
  5. package/dist/css/dark.css +47 -0
  6. package/dist/css/global.css +96 -0
  7. package/dist/css/index.css +184 -0
  8. package/dist/css/light.css +47 -0
  9. package/dist/docs/core.json +8134 -0
  10. package/dist/docs/global.json +6617 -0
  11. package/dist/es6/core.d.ts +309 -0
  12. package/dist/es6/core.js +309 -0
  13. package/dist/es6/global.d.ts +202 -0
  14. package/dist/es6/global.js +202 -0
  15. package/dist/js/core.d.ts +421 -0
  16. package/dist/js/core.js +8208 -0
  17. package/dist/js/global.d.ts +330 -0
  18. package/dist/js/global.js +6689 -0
  19. package/dist/scss/breakpoints.scss +37 -0
  20. package/dist/scss/core.scss +309 -0
  21. package/dist/scss/dark.scss +45 -0
  22. package/dist/scss/global.scss +94 -0
  23. package/dist/scss/index.scss +96 -0
  24. package/dist/scss/light.scss +45 -0
  25. package/dist/scss/mixins.scss +342 -0
  26. package/package.json +7 -21
  27. package/.eslintrc.cjs +0 -85
  28. package/.turbo/turbo-build.log +0 -7034
  29. package/.turbo/turbo-test.log +0 -15
  30. package/CHANGELOG.md +0 -33
  31. package/CONTRIBUTING.md +0 -41
  32. package/dist/css/brand-light.css +0 -9
  33. package/dist/css/calcite-dark.css +0 -504
  34. package/dist/css/calcite-headless.css +0 -2615
  35. package/dist/css/calcite-light.css +0 -507
  36. package/dist/es6/brand-light.d.ts +0 -7
  37. package/dist/es6/brand-light.js +0 -7
  38. package/dist/es6/calcite-dark.d.ts +0 -502
  39. package/dist/es6/calcite-dark.js +0 -502
  40. package/dist/es6/calcite-headless.d.ts +0 -2613
  41. package/dist/es6/calcite-headless.js +0 -2613
  42. package/dist/es6/calcite-light.d.ts +0 -505
  43. package/dist/es6/calcite-light.js +0 -505
  44. package/dist/js/brand-light.d.ts +0 -72
  45. package/dist/js/brand-light.js +0 -95
  46. package/dist/js/calcite-dark.d.ts +0 -563
  47. package/dist/js/calcite-dark.js +0 -10024
  48. package/dist/js/calcite-headless.d.ts +0 -1730
  49. package/dist/js/calcite-headless.js +0 -50082
  50. package/dist/js/calcite-light.d.ts +0 -544
  51. package/dist/js/calcite-light.js +0 -10090
  52. package/dist/scss/calcite-dark.scss +0 -535
  53. package/dist/scss/calcite-headless.scss +0 -3012
  54. package/dist/scss/calcite-light.scss +0 -538
  55. package/jest.config.json +0 -16
  56. package/src/$metadata.json +0 -76
  57. package/src/$themes.json +0 -2363
  58. package/src/brand/dark.json +0 -1
  59. package/src/brand/global.json +0 -1
  60. package/src/brand/light.json +0 -20
  61. package/src/calcite/dark.json +0 -2488
  62. package/src/calcite/light.json +0 -2508
  63. package/src/component/accordion-item.json +0 -172
  64. package/src/component/accordion.json +0 -192
  65. package/src/component/action-bar-grid.json +0 -66
  66. package/src/component/action-bar.json +0 -66
  67. package/src/component/action-pad-grid.json +0 -80
  68. package/src/component/action-pad.json +0 -80
  69. package/src/component/action.json +0 -156
  70. package/src/component/alert.json +0 -258
  71. package/src/component/avatar.json +0 -140
  72. package/src/component/block-section.json +0 -124
  73. package/src/component/block.json +0 -198
  74. package/src/component/button.json +0 -650
  75. package/src/component/card.json +0 -116
  76. package/src/component/checkbox.json +0 -110
  77. package/src/component/chip.json +0 -382
  78. package/src/component/color-picker.json +0 -148
  79. package/src/component/combobox.json +0 -152
  80. package/src/component/date-picker.json +0 -354
  81. package/src/component/dropdown-item.json +0 -384
  82. package/src/component/dropdown.json +0 -58
  83. package/src/component/fab.json +0 -490
  84. package/src/component/filter.json +0 -174
  85. package/src/component/icon.json +0 -18
  86. package/src/component/input-date-picker.json +0 -224
  87. package/src/component/input-datetime-local.json +0 -230
  88. package/src/component/input-email.json +0 -244
  89. package/src/component/input-file.json +0 -244
  90. package/src/component/input-message.json +0 -72
  91. package/src/component/input-month.json +0 -244
  92. package/src/component/input-number.json +0 -244
  93. package/src/component/input-password.json +0 -244
  94. package/src/component/input-search.json +0 -244
  95. package/src/component/input-telephone.json +0 -244
  96. package/src/component/input-text.json +0 -244
  97. package/src/component/input-time.json +0 -1
  98. package/src/component/input-week.json +0 -244
  99. package/src/component/label.json +0 -26
  100. package/src/component/link.json +0 -44
  101. package/src/component/loader.json +0 -130
  102. package/src/component/modal.json +0 -278
  103. package/src/component/notice.json +0 -280
  104. package/src/component/pagination.json +0 -152
  105. package/src/component/panel-header.json +0 -88
  106. package/src/component/popover.json +0 -170
  107. package/src/component/radio.json +0 -124
  108. package/src/component/rating.json +0 -243
  109. package/src/component/scrim.json +0 -18
  110. package/src/component/segmented-control.json +0 -154
  111. package/src/component/slider-histogram-range.json +0 -284
  112. package/src/component/slider-histogram.json +0 -280
  113. package/src/component/slider-range.json +0 -226
  114. package/src/component/slider.json +0 -226
  115. package/src/component/split-button.json +0 -830
  116. package/src/component/stepper-item.json +0 -372
  117. package/src/component/stepper.json +0 -152
  118. package/src/component/switch.json +0 -178
  119. package/src/component/tab-title.json +0 -228
  120. package/src/component/tabs.json +0 -242
  121. package/src/component/textarea.json +0 -200
  122. package/src/component/time-picker.json +0 -138
  123. package/src/component/tip-manager.json +0 -118
  124. package/src/component/tip.json +0 -114
  125. package/src/component/tooltip.json +0 -66
  126. package/src/component/tree-item.json +0 -176
  127. package/src/core.json +0 -1833
  128. package/src/semantic.json +0 -1709
  129. package/support/run.ts +0 -16
  130. package/support/tests/__snapshots__/index.spec.ts.snap +0 -88066
  131. package/support/tests/index.spec.ts +0 -102
  132. package/support/token-transformer/format/javascript.ts +0 -22
  133. package/support/token-transformer/format/scss.ts +0 -81
  134. package/support/token-transformer/getThemes.ts +0 -41
  135. package/support/token-transformer/parse/expandComposites.test.ts +0 -144
  136. package/support/token-transformer/parse/expandComposites.ts +0 -72
  137. package/support/token-transformer/sd-run.ts +0 -191
  138. package/support/token-transformer/transform/nameCamelCase.test.ts +0 -36
  139. package/support/token-transformer/transform/nameCamelCase.ts +0 -15
  140. package/support/token-transformer/transform/nameKebabCase.test.ts +0 -36
  141. package/support/token-transformer/transform/nameKebabCase.ts +0 -26
  142. package/support/token-transformer/utils/compositeTokens.test.ts +0 -133
  143. package/support/token-transformer/utils/compositeTokens.ts +0 -103
  144. package/support/token-transformer/utils/convertTokenToStyleDictionaryFormat.ts +0 -20
  145. package/support/token-transformer/utils/matchList.ts +0 -11
  146. package/support/token-transformer/utils/parseName.ts +0 -18
  147. package/support/token-transformer/utils/parseTokenPath.ts +0 -19
  148. package/support/token-transformer/utils/regex.ts +0 -9
  149. package/support/token-transformer/utils/sortAllTokens.ts +0 -12
  150. package/support/token-transformer/utils/transformOptions.ts +0 -31
  151. package/tsconfig-base.json +0 -17
  152. package/tsconfig-eslint.json +0 -4
  153. package/tsconfig.json +0 -4
@@ -1,36 +0,0 @@
1
- import { nameCamelCase } from "./nameCamelCase";
2
-
3
- describe("transform names to camel case", () => {
4
- it("should transform a token path to token name in a camel case format", () => {
5
- const mockToken = {
6
- name: "current-name",
7
- path: ["test", "token", "name"],
8
- value: "fake-value",
9
- filePath: "./fakePath.json",
10
- original: {
11
- value: "fake-value",
12
- type: "composite",
13
- },
14
- isSource: true,
15
- };
16
- expect(nameCamelCase(mockToken, {})).toBe("testTokenName");
17
- });
18
-
19
- it("should add prefix to token name", () => {
20
- const mockToken = {
21
- name: "current-name",
22
- path: ["test", "token", "name"],
23
- value: "fake-value",
24
- filePath: "./fakePath.json",
25
- original: {
26
- value: "fake-value",
27
- type: "composite",
28
- },
29
- isSource: true,
30
- };
31
- const mockOptions = {
32
- prefix: "calcite",
33
- };
34
- expect(nameCamelCase(mockToken, mockOptions)).toBe("calciteTestTokenName");
35
- });
36
- });
@@ -1,15 +0,0 @@
1
- import { camelCase } from "change-case";
2
- import { TransformedToken } from "style-dictionary/types/TransformedToken.js";
3
- import { Options } from "style-dictionary/types/Options.js";
4
- import { parseTokenPath } from "../utils/parseTokenPath.js";
5
-
6
- /**
7
- * Convert token name to camel case
8
- *
9
- * @param {TransformedToken} token Style Dictionary token object
10
- * @param {Options} options Style Dictionary format options
11
- * @returns {string} an updated name for the token which will be used for the final output
12
- */
13
- export function nameCamelCase(token: TransformedToken, options: Options): string {
14
- return camelCase([options.prefix].concat(parseTokenPath(token.path)).join(" "));
15
- }
@@ -1,36 +0,0 @@
1
- import { nameKebabCase } from "./nameKebabCase";
2
-
3
- describe("transform names to kebab case", () => {
4
- it("should transform a token path to token name in a kebab case format", () => {
5
- const mockToken = {
6
- name: "current-name",
7
- path: ["test", "token", "name"],
8
- value: "fake-value",
9
- filePath: "./fakePath.json",
10
- original: {
11
- value: "fake-value",
12
- type: "composite",
13
- },
14
- isSource: true,
15
- };
16
- expect(nameKebabCase(mockToken, {})).toBe("test-token-name");
17
- });
18
-
19
- it("should add prefix to token name", () => {
20
- const mockToken = {
21
- name: "current-name",
22
- path: ["test", "token", "name"],
23
- value: "fake-value",
24
- filePath: "./fakePath.json",
25
- original: {
26
- value: "fake-value",
27
- type: "composite",
28
- },
29
- isSource: true,
30
- };
31
- const mockOptions = {
32
- prefix: "calcite",
33
- };
34
- expect(nameKebabCase(mockToken, mockOptions)).toBe("calcite-test-token-name");
35
- });
36
- });
@@ -1,26 +0,0 @@
1
- import { paramCase } from "change-case";
2
- import { TransformedToken } from "style-dictionary/types/TransformedToken.js";
3
- import { Options } from "style-dictionary/types/Options.js";
4
- import { parseTokenPath } from "../utils/parseTokenPath.js";
5
-
6
- /**
7
- * convert token name to kebab case
8
- *
9
- * @param {TransformedToken} token Style Dictionary token object
10
- * @param {Options} options Style Dictionary format options
11
- * @returns {string} an updated name for the token which will be used for the final output
12
- */
13
- export function nameKebabCase(token: TransformedToken, options: Options): string {
14
- const paths = token.path.reduce((acc, p, idx) => {
15
- if (p === "core") {
16
- acc.push("app");
17
- } else if (typeof token.path[idx + 1] === "string" && !new RegExp(`${p}`).test(token.path[idx + 1])) {
18
- acc.push(p);
19
- } else if (idx === token.path.length - 1) {
20
- acc.push(p);
21
- }
22
- return acc;
23
- }, []);
24
-
25
- return paramCase([options.prefix].concat(parseTokenPath(paths)).join(" "));
26
- }
@@ -1,133 +0,0 @@
1
- import { expandToken, shouldExpand } from "./compositeTokens";
2
-
3
- const mockHandleValue = jest.fn((val) => val);
4
-
5
- describe("expand composite token", () => {
6
- it("should expand a non-shadow token", () => {
7
- const mockTypographyToken = {
8
- value: {
9
- fontFamily: "$core.font.font-family.primary",
10
- fontWeight: "$core.font.font-weight.light",
11
- lineHeight: "$core.font.line-height.fixed.0",
12
- fontSize: "$core.font.font-size.0",
13
- letterSpacing: "$core.font.letter-spacing.normal",
14
- paragraphSpacing: "$core.font.paragraph-spacing.normal",
15
- textDecoration: "$core.font.text-decoration.none",
16
- textCase: "$core.font.text-case.none",
17
- },
18
- type: "typography",
19
- };
20
- const mockExpandedTypographyToken = {
21
- "font-family": {
22
- value: "$core.font.font-family.primary",
23
- type: "font-family",
24
- },
25
- "font-weight": {
26
- value: "$core.font.font-weight.light",
27
- type: "font-weights",
28
- },
29
- "line-height": {
30
- value: "$core.font.line-height.fixed.0",
31
- type: "line-heights",
32
- },
33
- "font-size": {
34
- value: "$core.font.font-size.0",
35
- type: "font-size",
36
- },
37
- "letter-spacing": {
38
- value: "$core.font.letter-spacing.normal",
39
- type: "letter-spacing",
40
- },
41
- "paragraph-spacing": {
42
- value: "$core.font.paragraph-spacing.normal",
43
- type: "paragraph-spacing",
44
- },
45
- "text-decoration": {
46
- value: "$core.font.text-decoration.none",
47
- type: "font-style",
48
- },
49
- "text-case": {
50
- value: "$core.font.text-case.none",
51
- type: "text-case",
52
- },
53
- };
54
- const testExpandToken = expandToken(mockTypographyToken, false, mockHandleValue);
55
- expect(testExpandToken).toMatchObject(mockExpandedTypographyToken);
56
- });
57
- it("should expand a shadow token", () => {
58
- const mockShadowToken = {
59
- value: [
60
- {
61
- x: "0",
62
- y: "2",
63
- blur: "8",
64
- spread: "0",
65
- color: "rgba($core.color.neutral.blk-240, $core.opacity.4)",
66
- type: "dropShadow",
67
- },
68
- {
69
- x: "0",
70
- y: "4",
71
- blur: "16",
72
- spread: "0",
73
- color: "rgba($core.color.neutral.blk-240, $core.opacity.8)",
74
- type: "dropShadow",
75
- },
76
- ],
77
- type: "boxShadow",
78
- };
79
- const mockExpandedShadowToken = {
80
- "1": {
81
- x: {
82
- type: "dimension",
83
- value: "0",
84
- },
85
- y: {
86
- type: "dimension",
87
- value: "2",
88
- },
89
- blur: {
90
- type: "dimension",
91
- value: "8",
92
- },
93
- spread: {
94
- type: "dimension",
95
- value: "0",
96
- },
97
- color: {
98
- type: "color",
99
- value: "rgba($core.color.neutral.blk-240, $core.opacity.4)",
100
- },
101
- },
102
- };
103
- const testExpandToken = expandToken(mockShadowToken, true, mockHandleValue);
104
- expect(testExpandToken).toMatchObject(mockExpandedShadowToken);
105
- });
106
- });
107
-
108
- describe("shouldExpand", () => {
109
- const filePath = "./mockFile.json";
110
- const mockToken = {
111
- name: "testToken",
112
- type: "fontFamilies",
113
- value: "san-serif",
114
- };
115
-
116
- it("should return true", () => {
117
- // @ts-expect-error - type is fine here.
118
- const testExpand = shouldExpand(mockToken, true, filePath);
119
- expect(testExpand).toBe(true);
120
- });
121
- it("should return false", () => {
122
- // @ts-expect-error - type is fine here.
123
- const testExpand = shouldExpand(mockToken, false, filePath);
124
- expect(testExpand).toBe(false);
125
- });
126
- it("should use condition function", () => {
127
- const mockExpandFunction = jest.fn(() => true);
128
- // @ts-expect-error - type is fine here.
129
- const testExpand = shouldExpand(mockToken, mockExpandFunction, filePath);
130
- expect(testExpand).toBe(true);
131
- expect(mockExpandFunction).toHaveBeenCalled();
132
- });
133
- });
@@ -1,103 +0,0 @@
1
- import { ExpandFilter } from "../utils/transformOptions";
2
- import { matchPlaceholderElement } from "./regex.js";
3
- import { DesignToken } from "style-dictionary/types/DesignToken";
4
- import { SingleToken } from "@tokens-studio/types";
5
- import { paramCase } from "change-case";
6
-
7
- // A customized type map based off Token Studio.
8
- // This determines the applied "type" associated with each Style Dictionary token value
9
- const typeMaps = {
10
- boxShadow: {
11
- x: "dimension",
12
- y: "dimension",
13
- blur: "dimension",
14
- spread: "dimension",
15
- type: "other",
16
- color: "color",
17
- },
18
- border: {
19
- width: "border-width",
20
- style: "other",
21
- },
22
- composition: {
23
- typography: "font-size",
24
- fontWeight: "font-weight",
25
- },
26
- typography: {
27
- fontFamily: "font-family",
28
- fontWeight: "font-weights",
29
- lineHeight: "line-heights",
30
- fontSize: "font-size",
31
- letterSpacing: "letter-spacing",
32
- paragraphSpacing: "paragraph-spacing",
33
- textDecoration: "font-style",
34
- textCase: "text-case",
35
- },
36
- };
37
-
38
- /**
39
- * Get type from type map
40
- *
41
- * @param {string} key type
42
- * @param {DesignToken} compositeToken a Style Dictionary token
43
- * @returns {string} approved token type
44
- */
45
- export const getType = (key: string, compositeToken: DesignToken): string => typeMaps[compositeToken.type][key] ?? key;
46
-
47
- /**
48
- * This is a recursive function to dig into composite tokens and lift up the token values in a Style Dictionary format.
49
- *
50
- * @param {DesignToken} compositeToken the composite token object
51
- * @param {boolean} isShadow is a drop shadow?
52
- * @param {Function} handleValue a function to determine how the final token value string should be passed to Style Dictionary
53
- * @returns {DesignToken} a single Style Dictionary token object
54
- */
55
- export function expandToken(compositeToken: DesignToken, isShadow = false, handleValue = (v) => v): DesignToken {
56
- const expandedObj = {} as DesignToken;
57
-
58
- if (isShadow && Array.isArray(compositeToken.value)) {
59
- compositeToken.value.forEach((shadow, index) => {
60
- expandedObj[index + 1] = {};
61
- Object.entries(shadow).forEach(([key, value]) => {
62
- if (matchPlaceholderElement.test(`${value}`) || key === "type") {
63
- return;
64
- }
65
- expandedObj[index + 1][key] = {
66
- value: `${handleValue(value)}`,
67
- type: getType(key, compositeToken),
68
- };
69
- });
70
- });
71
- } else {
72
- Object.entries(compositeToken.value).forEach(([key, value]) => {
73
- const newKey = paramCase(key);
74
- if (matchPlaceholderElement.test(`${value}`)) {
75
- return;
76
- }
77
- expandedObj[newKey] = {
78
- value: `${handleValue(value)}`,
79
- type: getType(key, compositeToken),
80
- };
81
- });
82
- }
83
-
84
- return expandedObj;
85
- }
86
-
87
- /**
88
- *
89
- * @param {DesignToken} token Style Dictionary token object
90
- * @param {boolean | ExpandFilter<SingleToken>} condition check if the token should be expanded or not
91
- * @param {string} filePath the file path where the token came from
92
- * @returns {boolean} if the token should be expanded
93
- */
94
- export function shouldExpand<T extends SingleToken>(
95
- token: T,
96
- condition: boolean | ExpandFilter<T>,
97
- filePath: string
98
- ): boolean {
99
- if (typeof condition === "function") {
100
- return condition(token, filePath);
101
- }
102
- return condition;
103
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Some tokens defined in Figma Token Studio do not used the common { [variable.name] } for token references.
3
- * This function loops over each value, finds custom token references and converts them to the expected Style Dictionary format.
4
- *
5
- * @param {RegExp} customReferenceTokenIndicator a regex to find the token references
6
- * @returns {Function} to convert the token to the reference format expected by Style Dictionary "{ [variable.name] }"
7
- */
8
- export function convertTokenToStyleDictionaryFormat(
9
- customReferenceTokenIndicator: RegExp
10
- ): (value: string | number) => string {
11
- return (value: string | number): string => {
12
- let newValue = `${value}`;
13
- const matchesArr = [...newValue.matchAll(customReferenceTokenIndicator)];
14
- matchesArr.forEach((match) => {
15
- const figmaVariable = match[0];
16
- newValue = newValue.replace(figmaVariable, `{${figmaVariable.slice(1)}}`);
17
- });
18
- return newValue;
19
- };
20
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Find the string in a list
3
- *
4
- * @param {string} str the string to find in the list
5
- * @param {string[]} list the list of strings to match with the provided string
6
- * @param {RegExp} regexExclude a regular expression defining strings that should always be excluded
7
- * @returns {boolean} does the string match the items in the list
8
- */
9
- export const matchList = (str: string, list: string[], regexExclude: RegExp): boolean => {
10
- return list.some((value) => str.includes(value) && !regexExclude.test(str));
11
- };
@@ -1,18 +0,0 @@
1
- import { paramCase } from "change-case";
2
-
3
- /**
4
- * Used to set the file name for the generated theme file.
5
- *
6
- * @param {string} name the file name passed from the themes object
7
- * @param {string} prefix an optional prefix for each file name
8
- * @returns {string} a kebab-case file name from the passed name, optionally starting with a prefix
9
- */
10
- export function parseName(name: string, prefix?: string): string {
11
- const regexWord = /^\w+$/;
12
- const themeName = `${prefix || ""} ${name}`
13
- .split(" ")
14
- .filter((word) => regexWord.test(word))
15
- .join(" ");
16
-
17
- return paramCase(themeName);
18
- }
@@ -1,19 +0,0 @@
1
- /**
2
- * Replaces the word "color" with "ui" when it is the first value in the path and removes the word "default" from the final token names.
3
- * This puts generated tokens in alignment with the theme variable names in Calcite-Colors
4
- *
5
- * @param {string[]} path the path to each token value in the Style Dictionary token object
6
- * @returns {string[]} an updated token path
7
- */
8
- export const parseTokenPath = (path: string[]): string[] =>
9
- path.reduce((acc, p, idx) => {
10
- if (idx === 0 && p === "color") {
11
- acc.push("ui");
12
- } else if (p === "default") {
13
- return acc;
14
- } else {
15
- acc.push(p);
16
- }
17
-
18
- return acc;
19
- }, []);
@@ -1,9 +0,0 @@
1
- // Match files and tokens which include "[" or "]"
2
- export const matchPlaceholderElement = new RegExp(/[\[\]]/, "g");
3
-
4
- // Match custom variable indicator created by Designers in Token Studio.
5
- // Using the ${token.name} format in Token Studio makes it much easier for Designers to search for token references while doing their work.
6
- export const tokenStudioCustomVariableIndicator = new RegExp(/\$[.\w-]+/, "g");
7
-
8
- // Match files and tokens which include "backup", "[", "]", or file extensions
9
- export const matchExclusions = /(backup|\[|\])(?=\.\w+$)/;
@@ -1,12 +0,0 @@
1
- import { Dictionary } from "style-dictionary/types/Dictionary";
2
- import { default as StyleDictionary } from "style-dictionary";
3
- import { TransformedToken } from "style-dictionary/types/TransformedToken";
4
-
5
- export function sortAllTokens(dictionary: Dictionary, outputReferences: boolean): TransformedToken[] {
6
- let tokens = dictionary.allTokens;
7
- if (outputReferences) {
8
- tokens = [...dictionary.allTokens].sort(StyleDictionary.formatHelpers["sortByReference"](dictionary));
9
- }
10
-
11
- return tokens;
12
- }
@@ -1,31 +0,0 @@
1
- import {
2
- SingleBorderToken,
3
- SingleBoxShadowToken,
4
- SingleCompositionToken,
5
- SingleToken,
6
- SingleTypographyToken,
7
- } from "@tokens-studio/types";
8
-
9
- /**
10
- * Copied from https://github.com/tokens-studio/sd-transforms/blob/main/src/TransformOptions.ts
11
- * This is needed for correct type setting and is not exported by Token Studio SD Transforms.
12
- */
13
-
14
- export type Expandables = SingleCompositionToken | SingleTypographyToken | SingleBorderToken | SingleBoxShadowToken;
15
-
16
- export const expandablesAsStringsArr = ["composition", "typography", "border", "boxShadow"];
17
- export type ExpandablesAsStrings = (typeof expandablesAsStringsArr)[number];
18
-
19
- export type ExpandFilter<T extends SingleToken> = (token: T, filePath: string) => boolean;
20
-
21
- export interface ExpandOptions {
22
- typography?: boolean | ExpandFilter<SingleTypographyToken>;
23
- border?: boolean | ExpandFilter<SingleBorderToken>;
24
- shadow?: boolean | ExpandFilter<SingleBoxShadowToken>;
25
- composition?: boolean | ExpandFilter<SingleCompositionToken>;
26
- }
27
-
28
- export interface TransformOptions {
29
- expand?: ExpandOptions | false;
30
- excludeParentKeys?: boolean;
31
- }
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowSyntheticDefaultImports": true,
4
- "allowUnreachableCode": false,
5
- "declaration": false,
6
- "esModuleInterop": true,
7
- "experimentalDecorators": true,
8
- "lib": ["dom", "dom.iterable", "ES2021"],
9
- "module": "esnext",
10
- "moduleResolution": "node",
11
- "noUnusedLocals": true,
12
- "noUnusedParameters": true,
13
- "resolveJsonModule": true,
14
- "target": "ES2021"
15
- },
16
- "exclude": ["node_modules", "dist"]
17
- }
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig-base.json",
3
- "include": ["./**/*"]
4
- }
package/tsconfig.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "extends": "./tsconfig-base",
3
- "include": ["support", "src"]
4
- }