Skip to content

Commit

Permalink
feat: add dedicated export for tokens to all themes (#4054)
Browse files Browse the repository at this point in the history
* feat: add dedicated export for tokens to all themes

* Create lucky-bugs-repair.md
  • Loading branch information
sebald authored Jul 29, 2024
1 parent c23dbda commit 0fb763d
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 22 deletions.
7 changes: 7 additions & 0 deletions .changeset/lucky-bugs-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@marigold/theme-b2b": minor
"@marigold/theme-core": minor
"@marigold/theme-docs": minor
---

feat: add dedicated export for tokens to all themes (`@marigold/<theme-name>/tokens`)
8 changes: 4 additions & 4 deletions themes/theme-b2b/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./preset": {
"require": "./dist/preset.js",
"import": "./dist/preset.mjs",
"types": "./dist/preset.d.ts"
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs",
"types": "./dist/*.d.ts"
},
"./styles.css": "./dist/styles.css"
},
Expand Down
6 changes: 3 additions & 3 deletions themes/theme-b2b/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const colors = {
DEFAULT: blue[400],
},
},
};
} as const;

// Shadow
// ---------------
Expand All @@ -290,7 +290,7 @@ export const shadow = {
overlay: boxShadow.lg,
sunken: boxShadow.none,
},
};
} as const;

// Component Height
// ---------------
Expand All @@ -300,4 +300,4 @@ export const height = {
sm: '24px', // not used at all
lg: '48px', // used in button
},
};
} as const;
2 changes: 1 addition & 1 deletion themes/theme-b2b/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts', 'src/preset.ts'],
entry: ['src/index.ts', 'src/preset.ts', 'src/tokens.ts'],
format: ['esm', 'cjs'],
tsconfig: './tsconfig.build.json',
dts: true,
Expand Down
8 changes: 4 additions & 4 deletions themes/theme-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./preset": {
"require": "./dist/preset.js",
"import": "./dist/preset.mjs",
"types": "./dist/preset.d.ts"
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs",
"types": "./dist/*.d.ts"
},
"./styles.css": "./dist/styles.css"
},
Expand Down
6 changes: 3 additions & 3 deletions themes/theme-core/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export const colors = {
DEFAULT: blue[500],
},
},
};
} as const;

export const shadow = {
surface: {
Expand All @@ -286,12 +286,12 @@ export const shadow = {
overlay: boxShadow.md,
sunken: boxShadow.none,
},
};
} as const;

export const height = {
component: {
DEFAULT: '24px',
sm: '16px',
lg: '32px',
},
};
} as const;
2 changes: 1 addition & 1 deletion themes/theme-core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts', 'src/preset.ts'],
entry: ['src/index.ts', 'src/preset.ts', 'src/tokens.ts'],
format: ['esm', 'cjs'],
tsconfig: './tsconfig.build.json',
dts: true,
Expand Down
8 changes: 4 additions & 4 deletions themes/theme-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./preset": {
"require": "./dist/preset.js",
"import": "./dist/preset.mjs",
"types": "./dist/preset.d.ts"
"./*": {
"require": "./dist/*.js",
"import": "./dist/*.mjs",
"types": "./dist/*.d.ts"
},
"./styles.css": "./dist/styles.css"
},
Expand Down
2 changes: 1 addition & 1 deletion themes/theme-docs/src/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ export const colors = {
success: green[600],
error: red[600],
},
};
} as const;
2 changes: 1 addition & 1 deletion themes/theme-docs/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts', 'src/preset.ts'],
entry: ['src/index.ts', 'src/preset.ts', 'src/tokens.ts'],
format: ['esm', 'cjs'],
tsconfig: './tsconfig.build.json',
dts: true,
Expand Down

0 comments on commit 0fb763d

Please sign in to comment.