@digdir/designsystemet 0.1.0-next.20 → 0.1.0-next.22

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 (79) hide show
  1. package/dist/bin/designsystemet.js +3 -3
  2. package/dist/src/colors/colorUtils.js +33 -21
  3. package/dist/src/colors/themeUtils.js +2 -1
  4. package/dist/src/init/createTokensPackage.js +3 -3
  5. package/dist/src/init/generateMetadataJson.js +1 -3
  6. package/dist/src/init/generateThemesJson.js +2 -9
  7. package/dist/src/migrations/codemods/css/plugins.js +15 -16
  8. package/dist/src/migrations/codemods/css/run.js +2 -2
  9. package/dist/src/migrations/codemods/jsx/classname-prefix.js +8 -7
  10. package/dist/src/migrations/codemods/jsx/run.js +1 -1
  11. package/dist/src/tokens/actions.js +4 -4
  12. package/dist/src/tokens/build.js +30 -19
  13. package/dist/src/tokens/configs.js +24 -20
  14. package/dist/src/tokens/formats/css.js +40 -27
  15. package/dist/src/tokens/formats/js-tokens.js +9 -5
  16. package/dist/src/tokens/transformers.js +7 -3
  17. package/dist/src/tokens/utils/entryfile.js +31 -0
  18. package/dist/src/tokens/utils/noCase.js +1 -5
  19. package/dist/src/tokens/utils/permutateThemes.js +5 -4
  20. package/dist/src/tokens/utils/utils.js +11 -0
  21. package/dist/types/bin/designsystemet.d.ts +3 -0
  22. package/dist/types/bin/designsystemet.d.ts.map +1 -0
  23. package/dist/types/src/colors/colorUtils.d.ts +126 -0
  24. package/dist/types/src/colors/colorUtils.d.ts.map +1 -0
  25. package/dist/types/src/colors/index.d.ts +4 -0
  26. package/dist/types/src/colors/index.d.ts.map +1 -0
  27. package/dist/types/src/colors/themeUtils.d.ts +102 -0
  28. package/dist/types/src/colors/themeUtils.d.ts.map +1 -0
  29. package/dist/types/src/colors/types.d.ts +16 -0
  30. package/dist/types/src/colors/types.d.ts.map +1 -0
  31. package/dist/types/src/init/createTokensPackage.d.ts +5 -0
  32. package/dist/types/src/init/createTokensPackage.d.ts.map +1 -0
  33. package/dist/types/src/init/generateMetadataJson.d.ts +6 -0
  34. package/dist/types/src/init/generateMetadataJson.d.ts.map +1 -0
  35. package/dist/types/src/init/generateThemesJson.d.ts +3 -0
  36. package/dist/types/src/init/generateThemesJson.d.ts.map +1 -0
  37. package/dist/types/src/init/index.d.ts +3 -0
  38. package/dist/types/src/init/index.d.ts.map +1 -0
  39. package/dist/types/src/init/nextStepsMarkdown.d.ts +3 -0
  40. package/dist/types/src/init/nextStepsMarkdown.d.ts.map +1 -0
  41. package/dist/types/src/init/template/prettier.config.d.mts +9 -0
  42. package/dist/types/src/init/template/prettier.config.d.mts.map +1 -0
  43. package/dist/types/src/init/utils.d.ts +4 -0
  44. package/dist/types/src/init/utils.d.ts.map +1 -0
  45. package/dist/types/src/migrations/beta-to-v1.d.ts +3 -0
  46. package/dist/types/src/migrations/beta-to-v1.d.ts.map +1 -0
  47. package/dist/types/src/migrations/codemods/css/plugins.d.ts +6 -0
  48. package/dist/types/src/migrations/codemods/css/plugins.d.ts.map +1 -0
  49. package/dist/types/src/migrations/codemods/css/run.d.ts +8 -0
  50. package/dist/types/src/migrations/codemods/css/run.d.ts.map +1 -0
  51. package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts +10 -0
  52. package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts.map +1 -0
  53. package/dist/types/src/migrations/codemods/jsx/run.d.ts +7 -0
  54. package/dist/types/src/migrations/codemods/jsx/run.d.ts.map +1 -0
  55. package/dist/types/src/migrations/index.d.ts +6 -0
  56. package/dist/types/src/migrations/index.d.ts.map +1 -0
  57. package/dist/types/src/migrations/react-beta-to-v1.d.ts +3 -0
  58. package/dist/types/src/migrations/react-beta-to-v1.d.ts.map +1 -0
  59. package/dist/types/src/tokens/actions.d.ts +6 -0
  60. package/dist/types/src/tokens/actions.d.ts.map +1 -0
  61. package/dist/types/src/tokens/build.d.ts +11 -0
  62. package/dist/types/src/tokens/build.d.ts.map +1 -0
  63. package/dist/types/src/tokens/configs.d.ts +31 -0
  64. package/dist/types/src/tokens/configs.d.ts.map +1 -0
  65. package/dist/types/src/tokens/formats/css.d.ts +5 -0
  66. package/dist/types/src/tokens/formats/css.d.ts.map +1 -0
  67. package/dist/types/src/tokens/formats/js-tokens.d.ts +6 -0
  68. package/dist/types/src/tokens/formats/js-tokens.d.ts.map +1 -0
  69. package/dist/types/src/tokens/transformers.d.ts +5 -0
  70. package/dist/types/src/tokens/transformers.d.ts.map +1 -0
  71. package/dist/types/src/tokens/utils/entryfile.d.ts +11 -0
  72. package/dist/types/src/tokens/utils/entryfile.d.ts.map +1 -0
  73. package/dist/types/src/tokens/utils/noCase.d.ts +11 -0
  74. package/dist/types/src/tokens/utils/noCase.d.ts.map +1 -0
  75. package/dist/types/src/tokens/utils/permutateThemes.d.ts +17 -0
  76. package/dist/types/src/tokens/utils/permutateThemes.d.ts.map +1 -0
  77. package/dist/types/src/tokens/utils/utils.d.ts +25 -0
  78. package/dist/types/src/tokens/utils/utils.d.ts.map +1 -0
  79. package/package.json +26 -30
@@ -0,0 +1,9 @@
1
+ export default config;
2
+ /**
3
+ * NOTE: This config exists to ensure files in the template dir are
4
+ * formatted using the default prettier rules
5
+ * @see https://prettier.io/docs/en/configuration.html
6
+ * @type {import("prettier").Config}
7
+ */
8
+ declare const config: import("prettier").Config;
9
+ //# sourceMappingURL=prettier.config.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prettier.config.d.mts","sourceRoot":"","sources":["../../../../../src/init/template/prettier.config.mjs"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,sBAFU,OAAO,UAAU,EAAE,MAAM,CAEjB"}
@@ -0,0 +1,4 @@
1
+ export declare function normalizeTokenSetName(name: string): string;
2
+ export declare function toGeneratedCssFileName(name: string): string;
3
+ export declare function toValidPackageName(projectName: string): string;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/init/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,UAOrD"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (glob?: string) => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=beta-to-v1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/beta-to-v1.ts"],"names":[],"mappings":"gCAGuB,MAAM;AAA7B,wBAmVK"}
@@ -0,0 +1,6 @@
1
+ import type { Plugin } from 'postcss';
2
+ type PluginGenerator = (dictionary: Record<string, string>) => Plugin;
3
+ export declare const cssClassRename: PluginGenerator;
4
+ export declare const cssVarRename: PluginGenerator;
5
+ export {};
6
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/css/plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAe,MAAM,EAAE,MAAM,SAAS,CAAC;AAGnD,KAAK,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC;AAOtE,eAAO,MAAM,cAAc,EAAE,eAe3B,CAAC;AAEH,eAAO,MAAM,YAAY,EAAE,eA2BzB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { AcceptedPlugin } from 'postcss';
2
+ type CssCodemodProps = {
3
+ plugins: AcceptedPlugin[];
4
+ globPattern?: string;
5
+ };
6
+ export declare const runCssCodemod: ({ plugins, globPattern }: CssCodemodProps) => Promise<void>;
7
+ export {};
8
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/css/run.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,aAAa,6BAAwD,eAAe,kBAkBhG,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { API, FileInfo } from 'jscodeshift';
2
+ /**
3
+ * Replace all class prefixes from 'fds-' to 'ds-'
4
+ * @param file
5
+ * @param api
6
+ * @returns
7
+ */
8
+ declare function replaceClassNamePrefix(file: FileInfo, api: API): string | undefined;
9
+ export default replaceClassNamePrefix;
10
+ //# sourceMappingURL=classname-prefix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classname-prefix.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/jsx/classname-prefix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAmB,MAAM,aAAa,CAAC;AAoElE;;;;;GAKG;AACH,iBAAS,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS,CAiB5E;AAED,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ type CssCodemodProps = {
2
+ globPattern?: string;
3
+ dry?: boolean;
4
+ };
5
+ export declare const runJSXCodemod: ({ globPattern, dry }: CssCodemodProps) => Promise<void>;
6
+ export {};
7
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../../../src/migrations/codemods/jsx/run.ts"],"names":[],"mappings":"AAKA,KAAK,eAAe,GAAG;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAIF,eAAO,MAAM,aAAa,yBAA+C,eAAe,kBAiBvF,CAAC"}
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ 'css-beta-to-v1': (glob?: string) => Promise<void>;
3
+ 'react-beta-to-v1': (glob?: string) => Promise<void>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/migrations/index.ts"],"names":[],"mappings":";;;;AAGA,wBAGE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: (glob?: string) => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=react-beta-to-v1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-beta-to-v1.d.ts","sourceRoot":"","sources":["../../../../src/migrations/react-beta-to-v1.ts"],"names":[],"mappings":"gCAEuB,MAAM;AAA7B,wBAAuE"}
@@ -0,0 +1,6 @@
1
+ import type { Action } from 'style-dictionary/types';
2
+ /**
3
+ * Creates a CSS entry file that imports base CSS files for a theme
4
+ */
5
+ export declare const makeEntryFile: Action;
6
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/tokens/actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AASrD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAuB3B,CAAC"}
@@ -0,0 +1,11 @@
1
+ type Options = {
2
+ /** Design tokens path */
3
+ tokens: string;
4
+ /** Output directoru for built tokens */
5
+ out: string;
6
+ /** Generate preview tokens */
7
+ preview: boolean;
8
+ };
9
+ export declare function run(options: Options): Promise<void>;
10
+ export {};
11
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/tokens/build.ts"],"names":[],"mappings":"AAaA,KAAK,OAAO,GAAG;IACb,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAMF,wBAAsB,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FzD"}
@@ -0,0 +1,31 @@
1
+ import type { ThemeObject } from '@tokens-studio/types';
2
+ import type { Config, TransformedToken } from 'style-dictionary/types';
3
+ import type { PermutatedThemes } from './utils/permutateThemes.js';
4
+ export declare const prefix = "ds";
5
+ export declare const basePxFontSize = 16;
6
+ export declare const separator = "_";
7
+ export type IsCalculatedToken = (token: TransformedToken, options?: Config) => boolean;
8
+ export declare const permutateThemes: ($themes: ThemeObject[]) => PermutatedThemes;
9
+ type GetConfig = (options: {
10
+ mode?: string;
11
+ theme?: string;
12
+ semantic?: string;
13
+ size?: string;
14
+ typography?: string;
15
+ outPath?: string;
16
+ }) => Config;
17
+ export declare const colorModeVariables: GetConfig;
18
+ export declare const semanticVariables: GetConfig;
19
+ export declare const typescriptTokens: GetConfig;
20
+ export declare const typographyCSS: GetConfig;
21
+ type getConfigs = (getConfig: GetConfig, outPath: string, tokensDir: string, themes: PermutatedThemes) => {
22
+ mode: string;
23
+ theme: string;
24
+ semantic: string;
25
+ size: string;
26
+ typography: string;
27
+ config: Config;
28
+ }[];
29
+ export declare const getConfigs: getConfigs;
30
+ export {};
31
+ //# sourceMappingURL=configs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../../src/tokens/configs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAOvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQnE,eAAO,MAAM,MAAM,OAAO,CAAC;AAC3B,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,SAAS,MAAM,CAAC;AAyC7B,MAAM,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;AAEvF,eAAO,MAAM,eAAe,YAAa,WAAW,EAAE,qBAGlD,CAAC;AAEL,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAK,MAAM,CAAC;AAEb,eAAO,MAAM,kBAAkB,EAAE,SAkChC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,SA+C/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAqC9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SA2C3B,CAAC;AAEF,KAAK,UAAU,GAAG,CAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,KACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC;AAE3G,eAAO,MAAM,UAAU,EAAE,UAqCd,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Format } from 'style-dictionary/types';
2
+ export declare const colormode: Format;
3
+ export declare const semantic: Format;
4
+ export declare const typography: Format;
5
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/css.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAarD,eAAO,MAAM,SAAS,EAAE,MA4BvB,CAAC;AAIF,eAAO,MAAM,QAAQ,EAAE,MAsCtB,CAAC;AAsCF,eAAO,MAAM,UAAU,EAAE,MAyFxB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Format } from 'style-dictionary/types';
2
+ /**
3
+ * Format for displaying tokens in storefront
4
+ */
5
+ export declare const jsTokens: Format;
6
+ //# sourceMappingURL=js-tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"js-tokens.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/formats/js-tokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAoB,MAAM,wBAAwB,CAAC;AAkBvE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MA2BtB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Transform } from 'style-dictionary/types';
2
+ export declare const sizeRem: Transform;
3
+ export declare const nameKebab: Transform;
4
+ export declare const typographyShorthand: Transform;
5
+ //# sourceMappingURL=transformers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../../../src/tokens/transformers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAOxD,eAAO,MAAM,OAAO,EAAE,SAyBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC;AASF,eAAO,MAAM,mBAAmB,EAAE,SASjC,CAAC"}
@@ -0,0 +1,11 @@
1
+ type EntryFile = (options: {
2
+ outPath: string;
3
+ buildPath: string;
4
+ theme: string;
5
+ }) => Promise<undefined>;
6
+ /**
7
+ * Creates a CSS entry file that imports base CSS files for a theme
8
+ */
9
+ export declare const makeEntryFile: EntryFile;
10
+ export {};
11
+ //# sourceMappingURL=entryfile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entryfile.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/entryfile.ts"],"names":[],"mappings":"AA2BA,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAO3B,CAAC"}
@@ -0,0 +1,11 @@
1
+ export interface Options {
2
+ splitRegexp?: RegExp | RegExp[];
3
+ stripRegexp?: RegExp | RegExp[];
4
+ delimiter?: string;
5
+ transform?: (part: string, index: number, parts: string[]) => string;
6
+ }
7
+ /**
8
+ * Normalize the string into something other libraries can manipulate easier.
9
+ */
10
+ export declare function noCase(input: string, options?: Options): string;
11
+ //# sourceMappingURL=noCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noCase.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/noCase.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,OAAO;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;CACtE;AAQD;;GAEG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,UAkB1D"}
@@ -0,0 +1,17 @@
1
+ import type { ThemeObject } from '@tokens-studio/types';
2
+ declare interface Options {
3
+ separator?: string;
4
+ }
5
+ export type PermutatedTheme = {
6
+ mode?: string;
7
+ semantic?: string;
8
+ size?: string;
9
+ theme?: string;
10
+ typography?: string;
11
+ name: string;
12
+ selectedTokenSets: string[];
13
+ };
14
+ export type PermutatedThemes = PermutatedTheme[];
15
+ export declare function permutateThemes(themes: ThemeObject[], { separator }?: Options): PermutatedThemes;
16
+ export {};
17
+ //# sourceMappingURL=permutateThemes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permutateThemes.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/permutateThemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,WAAW,OAAO;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC;AAMjD,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,SAAe,EAAE,GAAS,OAAO,GAAG,gBAAgB,CAoD5G"}
@@ -0,0 +1,25 @@
1
+ import type { DesignToken, TransformedToken } from 'style-dictionary/types';
2
+ /**
3
+ * Returns type based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
4
+ * @param token Transformed token
5
+ * @returns type
6
+ */
7
+ export declare const getType: (token: TransformedToken) => string;
8
+ /**
9
+ * Returns value based on design token format used. Read more:https://v4.styledictionary.com/info/dtcg/
10
+ *
11
+ * Use generic (`<T>`) to define return value type
12
+ * @param token Transformed or Design token
13
+ * @returns value
14
+ */
15
+ export declare const getValue: <T>(token: TransformedToken | DesignToken) => T;
16
+ /**
17
+ * Check if token type matches provided type
18
+ * This function is curried
19
+ * @param types Type or array of types to check against
20
+ * @param token Transformed token
21
+ * @returns boolean
22
+ */
23
+ export declare const typeEquals: import("ts-toolbelt/out/Function/Curry").Curry<(types: string[] | string, token: TransformedToken) => boolean>;
24
+ export declare const pathStartsWithOneOf: import("ts-toolbelt/out/Function/Curry").Curry<(paths: string[], token: TransformedToken) => boolean>;
25
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/utils/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM5E;;;;GAIG;AACH,eAAO,MAAM,OAAO,UAAW,gBAAgB,WAAkD,CAAC;AAElG;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,gBAAgB,GAAG,WAAW,KAAG,CAAuC,CAAC;AAE5G;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,yDAAmB,MAAM,EAAE,GAAG,MAAM,SAAS,gBAAgB,aAMlF,CAAC;AAEH,eAAO,MAAM,mBAAmB,yDAAmB,MAAM,EAAE,SAAS,gBAAgB,aASlF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digdir/designsystemet",
3
- "version": "0.1.0-next.20",
3
+ "version": "0.1.0-next.22",
4
4
  "description": "CLI for Designsystemet",
5
5
  "author": "Designsystemet team",
6
6
  "repository": {
@@ -14,24 +14,21 @@
14
14
  "files": [
15
15
  "./dist/**"
16
16
  ],
17
+ "bin": "dist/bin/designsystemet.js",
17
18
  "exports": {
18
- "./color": "./src/colors/index.ts"
19
+ "./color": {
20
+ "types": "./dist/types/src/colors/index.d.ts",
21
+ "import": "./dist/src/colors/index.js"
22
+ }
19
23
  },
20
- "bin": "bin/designsystemet.js",
21
24
  "publishConfig": {
22
- "access": "public",
23
- "bin": {
24
- "designsystemet": "dist/bin/designsystemet.js"
25
- },
26
- "exports": {
27
- "./color": "./dist/src/colors/index.js"
28
- }
25
+ "access": "public"
29
26
  },
30
27
  "scripts": {
31
28
  "designsystemet": "tsx ./bin/designsystemet.ts",
32
29
  "build:tokens": "yarn clean:theme && yarn designsystemet tokens -p -t ../../design-tokens -o ../../packages/theme/brand",
33
30
  "build:tokens:debug": "yarn clean:theme && tsx --inspect-brk ./bin/designsystemet.ts tokens -p -t ../../design-tokens -o ../../packages/theme/brand",
34
- "build": "tsup",
31
+ "build": "tsup && yarn build:types",
35
32
  "build:swc": "yarn clean && swc src bin --copy-files -d dist && yarn build:types",
36
33
  "build:types": "tsc --emitDeclarationOnly --declaration",
37
34
  "clean": "rimraf dist",
@@ -39,37 +36,36 @@
39
36
  },
40
37
  "dependencies": {
41
38
  "@adobe/leonardo-contrast-colors": "^1.0.0",
42
- "@commander-js/extra-typings": "^12.0.1",
43
- "@tokens-studio/sd-transforms": "^0.16.1",
39
+ "@commander-js/extra-typings": "^12.1.0",
40
+ "@tokens-studio/sd-transforms": "1.2.2",
44
41
  "apca-w3": "^0.1.9",
45
42
  "chalk": "^5.3.0",
46
- "change-case": "^5.3.0",
47
- "chroma-js": "^2.4.2",
48
- "commander": "^12.0.0",
43
+ "change-case": "^5.4.4",
44
+ "chroma-js": "^2.6.0",
45
+ "commander": "^12.1.0",
49
46
  "fast-glob": "^3.3.2",
50
47
  "hsluv": "^1.0.1",
51
- "jscodeshift": "^0.15.2",
48
+ "jscodeshift": "^0.16.1",
52
49
  "object-hash": "^3.0.0",
53
- "postcss": "^8.4.38",
54
- "prompts": "^2.4.0",
55
- "ramda": "^0.29.1",
56
- "rimraf": "^5.0.5",
57
- "style-dictionary": "^4.0.0-prerelease.34"
50
+ "postcss": "^8.4.41",
51
+ "prompts": "^2.4.2",
52
+ "ramda": "^0.30.1",
53
+ "rimraf": "^6.0.1",
54
+ "style-dictionary": "^4.0.1"
58
55
  },
59
56
  "devDependencies": {
60
- "@swc/cli": "^0.3.14",
61
- "@swc/core": "^1.6.5",
62
57
  "@types/apca-w3": "^0.1.3",
63
58
  "@types/fs-extra": "^11.0.4",
64
59
  "@types/glob": "^8.1.0",
65
60
  "@types/jscodeshift": "^0.11.11",
66
- "@types/node": "^20.12.7",
67
- "@types/object-hash": "^3",
61
+ "@types/node": "^22.1.0",
62
+ "@types/object-hash": "^3.0.6",
68
63
  "@types/prompts": "^2.4.9",
69
- "@types/ramda": "^0.29.9",
64
+ "@types/ramda": "^0.30.1",
70
65
  "fs-extra": "^11.2.0",
71
- "tsup": "^8.1.0",
72
- "tsx": "^4.11.2",
73
- "typescript": "^5.4.5"
66
+ "tslib": "^2.6.3",
67
+ "tsup": "^8.2.4",
68
+ "tsx": "^4.16.5",
69
+ "typescript": "^5.5.4"
74
70
  }
75
71
  }