whitehall-ui 2.2.0 → 2.3.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.
package/README.md CHANGED
@@ -13,10 +13,10 @@ Distributed two ways:
13
13
 
14
14
  ## Requirements
15
15
 
16
- These are peer dependencies — install them in your app:
16
+ Peer dependencies (your app almost certainly has these already):
17
17
 
18
18
  ```bash
19
- npm install react@^19.3 react-dom@^19.3 tailwindcss@^4.3 @base-ui/react@^1.9
19
+ npm install react@^19.3 react-dom@^19.3 tailwindcss@^4.3
20
20
  ```
21
21
 
22
22
  ---
@@ -36,10 +36,9 @@ Import the GOV.UK design tokens in your CSS entry point, **after** Tailwind:
36
36
  ```css
37
37
  @import 'tailwindcss';
38
38
  @import 'whitehall-ui/tokens.css';
39
- @source '../node_modules/whitehall-ui/dist';
40
39
  ```
41
40
 
42
- Tailwind 4 doesn't scan `node_modules`, so without the `@source` line the component classes are never generated and everything renders unstyled. The path is relative to your CSS file — adjust it if your CSS doesn't live one level below the project root.
41
+ This import also registers the package's components with Tailwind, so you don't need an `@source` line pointing into `node_modules`.
43
42
 
44
43
  ### 3. Use a component
45
44
 
@@ -4,7 +4,7 @@ import { Button as Button$1 } from '@base-ui/react/button';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const buttonVariants: (props?: ({
7
- variant?: "inverse" | "start" | "default" | "secondary" | "warning" | null | undefined;
7
+ variant?: "inverse" | "default" | "secondary" | "warning" | "start" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>['variant']>;
10
10
  interface ButtonProps extends Omit<React.ComponentProps<typeof Button$1>, 'className'>, VariantProps<typeof buttonVariants> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whitehall-ui",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "description": "GOV.UK Design System component library for React 19 + Tailwind CSS 4. Available as an npm package and a shadcn-compatible registry.",
6
6
  "license": "MIT",
@@ -31,6 +31,7 @@
31
31
  },
32
32
  "files": [
33
33
  "dist",
34
+ "tokens.css",
34
35
  "registry/default/theme/govuk-tokens.css",
35
36
  "README.md"
36
37
  ],
@@ -41,7 +42,7 @@
41
42
  "types": "./dist/index.d.ts",
42
43
  "import": "./dist/index.js"
43
44
  },
44
- "./tokens.css": "./registry/default/theme/govuk-tokens.css",
45
+ "./tokens.css": "./tokens.css",
45
46
  "./lib/utils": {
46
47
  "types": "./dist/lib/utils.d.ts",
47
48
  "import": "./dist/lib/utils.js"
@@ -62,23 +63,17 @@
62
63
  "test": "vitest --project=storybook"
63
64
  },
64
65
  "peerDependencies": {
65
- "@base-ui/react": "^1.9.0",
66
66
  "react": "^19.3.0",
67
67
  "react-dom": "^19.3.0",
68
68
  "tailwindcss": "^4.3.0"
69
69
  },
70
- "peerDependenciesMeta": {
71
- "@base-ui/react": {
72
- "optional": true
73
- }
74
- },
75
70
  "dependencies": {
71
+ "@base-ui/react": "^1.9.0",
76
72
  "class-variance-authority": "^0.7.1",
77
73
  "clsx": "^2.1.1",
78
74
  "tailwind-merge": "^3.7.0"
79
75
  },
80
76
  "devDependencies": {
81
- "@base-ui/react": "^1.9.0",
82
77
  "@chromatic-com/storybook": "^5.6.0",
83
78
  "@eslint/js": "^10.0.1",
84
79
  "@tailwindcss/vite": "^4.3.5",
package/tokens.css ADDED
@@ -0,0 +1,4 @@
1
+ /* npm entry for `whitehall-ui/tokens.css`. The @source path resolves relative to this
2
+ * file, so consumers don't need their own @source pointing into node_modules. */
3
+ @import './registry/default/theme/govuk-tokens.css';
4
+ @source './dist';