tailwind-preset-antd 0.1.5 → 0.1.7

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.en-US.md CHANGED
@@ -1,6 +1,6 @@
1
1
  Use antd design token like using tailwindcss.
2
2
 
3
- Recommended to use antd v6 and tailwindcss v4, but also supports antd>=v5.12 (depends on antd cssVar variables) and tailwindcss v3.
3
+ Recommended to use antd v6 and tailwindcss v4, but also supports antd v5 and tailwindcss v3.
4
4
 
5
5
  [简体中文](./README.md) | English
6
6
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  像使用 tailwindcss 一样使用 antd design token。
2
2
 
3
- 推荐使用 antd v6 和 tailwindcss v4,但同样支持 antd>=v5.12(依赖 antd cssVar 变量) 和 tailwindcss v3。
3
+ 推荐使用 antd v6 和 tailwindcss v4,但同样支持 antd v5 和 tailwindcss v3。
4
4
 
5
5
  [English](./README.en-US.md) | 简体中文
6
6
 
@@ -1,5 +1,5 @@
1
- import { toPropertyKey } from "./toPropertyKey.js";
2
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/defineProperty.js
1
+ import toPropertyKey from "./toPropertyKey.js";
2
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/defineProperty.js
3
3
  function _defineProperty(e, r, t) {
4
4
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
5
5
  value: t,
@@ -9,4 +9,4 @@ function _defineProperty(e, r, t) {
9
9
  }) : e[r] = t, e;
10
10
  }
11
11
  //#endregion
12
- export { _defineProperty };
12
+ export { _defineProperty as default };
@@ -1,5 +1,5 @@
1
- import { _defineProperty } from "./defineProperty.js";
2
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/objectSpread2.js
1
+ import _defineProperty from "./defineProperty.js";
2
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/objectSpread2.js
3
3
  function ownKeys(e, r) {
4
4
  var t = Object.keys(e);
5
5
  if (Object.getOwnPropertySymbols) {
@@ -22,4 +22,4 @@ function _objectSpread2(e) {
22
22
  return e;
23
23
  }
24
24
  //#endregion
25
- export { _objectSpread2 };
25
+ export { _objectSpread2 as default };
@@ -1,5 +1,5 @@
1
- import { _typeof } from "./typeof.js";
2
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/toPrimitive.js
1
+ import _typeof from "./typeof.js";
2
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/toPrimitive.js
3
3
  function toPrimitive(t, r) {
4
4
  if ("object" != _typeof(t) || !t) return t;
5
5
  var e = t[Symbol.toPrimitive];
@@ -11,4 +11,4 @@ function toPrimitive(t, r) {
11
11
  return ("string" === r ? String : Number)(t);
12
12
  }
13
13
  //#endregion
14
- export { toPrimitive };
14
+ export { toPrimitive as default };
@@ -0,0 +1,9 @@
1
+ import _typeof from "./typeof.js";
2
+ import toPrimitive from "./toPrimitive.js";
3
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/toPropertyKey.js
4
+ function toPropertyKey(t) {
5
+ var i = toPrimitive(t, "string");
6
+ return "symbol" == _typeof(i) ? i : i + "";
7
+ }
8
+ //#endregion
9
+ export { toPropertyKey as default };
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/typeof.js
1
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/typeof.js
2
2
  function _typeof(o) {
3
3
  "@babel/helpers - typeof";
4
4
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -8,4 +8,4 @@ function _typeof(o) {
8
8
  }, _typeof(o);
9
9
  }
10
10
  //#endregion
11
- export { _typeof };
11
+ export { _typeof as default };
@@ -1,4 +1,4 @@
1
- import { _objectSpread2 } from "../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/objectSpread2.js";
2
2
  import * as React from "react";
3
3
  //#region src/hooks/useCompatibleInsertionEffect.ts
4
4
  const { useInsertionEffect } = _objectSpread2({}, React);
package/dist/plugin.d.ts CHANGED
@@ -18,7 +18,7 @@ interface PluginWithOptions<T> {
18
18
  __isOptionsFunction: true;
19
19
  }
20
20
  /**
21
- * @description Based on Antd Design Token to customize TailwindCSS styles, related extensions include `color`, `borderRadius`, `fontSize`, and `margin(gap)`.
21
+ * @description Based on Antd Design Token to customize TailwindCSS styles, related extensions include `color`, `borderRadius`, `fontSize`, `margin(gap)` and `boxShadow`.
22
22
  * @example `bg-colorPrimary` --> `backgroundColor: token.colorPrimary`;
23
23
  * @see https://ant.design/docs/react/customize-theme-cn#maptoken
24
24
  * @see https://github.com/tailwindlabs/tailwindcss/discussions/13292#discussioncomment-14256365
package/dist/plugin.js CHANGED
@@ -1,9 +1,9 @@
1
- import { _objectSpread2 } from "./_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/objectSpread2.js";
1
+ import _objectSpread2 from "./_virtual/_@oxc-project_runtime@0.138.0/helpers/esm/objectSpread2.js";
2
2
  import { createBorderRadius, createBoxShadow, createColorPalettes, createFontSize, createSpacing } from "./core/genTailwindTheme.js";
3
3
  import plugin from "tailwindcss/plugin";
4
4
  //#region src/plugin.ts
5
5
  /**
6
- * @description Based on Antd Design Token to customize TailwindCSS styles, related extensions include `color`, `borderRadius`, `fontSize`, and `margin(gap)`.
6
+ * @description Based on Antd Design Token to customize TailwindCSS styles, related extensions include `color`, `borderRadius`, `fontSize`, `margin(gap)` and `boxShadow`.
7
7
  * @example `bg-colorPrimary` --> `backgroundColor: token.colorPrimary`;
8
8
  * @see https://ant.design/docs/react/customize-theme-cn#maptoken
9
9
  * @see https://github.com/tailwindlabs/tailwindcss/discussions/13292#discussioncomment-14256365
@@ -8,4 +8,4 @@ type PresetColorPalettes = ColorPalettes & PresetColorKey & LegacyColorPalettes;
8
8
  */
9
9
  declare const colorPalettes: PresetColorPalettes[];
10
10
  //#endregion
11
- export { colorPalettes };
11
+ export { PresetColorPalettes, colorPalettes };
@@ -1,7 +1,5 @@
1
- /**
2
- * `['red', 'red1', 'red2', ……, 'red10', 'magenta',……]`
3
- */
4
- const colorPalettes = [
1
+ //#region src/preset/tokens/colorPalettes.ts
2
+ const colors = [
5
3
  "red",
6
4
  "volcano",
7
5
  "orange",
@@ -14,10 +12,14 @@ const colorPalettes = [
14
12
  "geekblue",
15
13
  "purple",
16
14
  "magenta"
17
- ].flatMap((color) => [
15
+ ];
16
+ /**
17
+ * `['red', 'red1', 'red2', ……, 'red10', 'magenta',……]`
18
+ */
19
+ const colorPalettes = colors.flatMap((color) => [
18
20
  color,
19
21
  ...Array.from({ length: 10 }, (_, i) => `${color}${i + 1}`),
20
22
  ...Array.from({ length: 10 }, (_, i) => `${color}-${i + 1}`)
21
23
  ]);
22
24
  //#endregion
23
- export { colorPalettes };
25
+ export { colorPalettes, colors };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-preset-antd",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Use antd design token like using tailwindcss",
5
5
  "keywords": [
6
6
  "antd",
@@ -28,29 +28,29 @@
28
28
  "hex-rgb": "^5.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@tailwindcss/vite": "^4.3.1",
31
+ "@tailwindcss/vite": "^4.3.2",
32
32
  "@testing-library/jest-dom": "^6.9.1",
33
33
  "@testing-library/react": "^16.3.2",
34
- "@types/node": "^25.9.3",
34
+ "@types/node": "^25.9.4",
35
35
  "@types/react": "^19.2.17",
36
36
  "@types/react-dom": "^19.2.3",
37
- "@vitejs/plugin-react": "^6.0.2",
38
- "@vitest/coverage-v8": "4.1.5",
37
+ "@vitejs/plugin-react": "^6.0.3",
38
+ "@vitest/coverage-v8": "^4.1.9",
39
39
  "bumpp": "^11.1.0",
40
40
  "jsdom": "^29.1.1",
41
41
  "oxfmt": "^0.54.0",
42
- "oxlint": "^1.69.0",
43
- "postcss": "^8.5.15",
42
+ "oxlint": "^1.72.0",
43
+ "postcss": "^8.5.16",
44
44
  "publint": "^0.3.21",
45
45
  "react-dom": "^19.2.7",
46
- "tailwindcss": "^4.3.1",
47
- "tsdown": "^0.22.2",
46
+ "tailwindcss": "^4.3.2",
47
+ "tsdown": "^0.22.3",
48
48
  "typescript": "^6.0.3",
49
- "vite": "^8.0.16",
50
- "vitest": "^4.1.8"
49
+ "vite": "^8.1.3",
50
+ "vitest": "^4.1.9"
51
51
  },
52
52
  "peerDependencies": {
53
- "antd": ">=5.12.0",
53
+ "antd": ">=5",
54
54
  "react": ">=16.9.0",
55
55
  "tailwindcss": "^3 || ^4"
56
56
  },
@@ -1,9 +0,0 @@
1
- import { _typeof } from "./typeof.js";
2
- import { toPrimitive } from "./toPrimitive.js";
3
- //#region \0@oxc-project+runtime@0.135.0/helpers/esm/toPropertyKey.js
4
- function toPropertyKey(t) {
5
- var i = toPrimitive(t, "string");
6
- return "symbol" == _typeof(i) ? i : i + "";
7
- }
8
- //#endregion
9
- export { toPropertyKey };