Skip to content

Commit

Permalink
Include tokens.css as part of the wb-tokens exports
Browse files Browse the repository at this point in the history
  • Loading branch information
jandrade committed May 16, 2024
1 parent d1df756 commit 6e0558c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 96 deletions.
4 changes: 3 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ const config: StorybookConfig = {
const mergedConfig = mergeConfig(config, {
resolve: {
// Allow us to detect changes from local wonder-blocks packages.
// NOTE: Only applies to ts(x) files to avoid conflicts with
// the tokens.css import.
alias: [
{
find: /^@khanacademy\/wonder-blocks(-.*)$/,
find: /^@khanacademy\/wonder-blocks(-.*).(ts|tsx)$/,
replacement: resolve(
__dirname,
"../packages/wonder-blocks$1/src",
Expand Down
2 changes: 2 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {ThemeSwitcherContext} from "@khanacademy/wonder-blocks-theming";
import {RenderStateRoot} from "../packages/wonder-blocks-core/src";
import {Preview} from "@storybook/react";

import "@khanacademy/wonder-blocks-tokens/css/tokens.css";

/**
* WB Official breakpoints
* @see https://khanacademy.atlassian.net/wiki/spaces/WB/pages/2099970518/Layout+Breakpoints
Expand Down
4 changes: 2 additions & 2 deletions packages/wonder-blocks-form/src/components/text-field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import * as React from "react";
// import {mix, color, spacing} from "@khanacademy/wonder-blocks-tokens";
// import {addStyle} from "@khanacademy/wonder-blocks-core";
// import {styles as typographyStyles} from "@khanacademy/wonder-blocks-typography";
import styles from "./text-field.module.css";

import type {AriaProps, StyleType} from "@khanacademy/wonder-blocks-core";

import styles from "./text-field.module.css";

export type TextFieldType = "text" | "password" | "email" | "number" | "tel";

type WithForwardRef = {
Expand Down
7 changes: 7 additions & 0 deletions packages/wonder-blocks-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"name": "@khanacademy/wonder-blocks-tokens",
"version": "1.3.0",
"description": "Core primitive design tokens for Web Wonder Blocks",
"exports": {
".": {
"import": "./dist/es/index.js",
"require": "./dist/index.js"
},
"./css/*": "./css/*"
},
"main": "dist/index.js",
"module": "dist/es/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 0 additions & 2 deletions static/sb-styles/preview.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import "tokens.css";

/**
* Overrides for the Storybook preview iframe.
*/
Expand Down
91 changes: 0 additions & 91 deletions static/sb-styles/tokens.css

This file was deleted.

0 comments on commit 6e0558c

Please sign in to comment.