@react-hive/honey-style 3.1.0 → 4.0.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/dist/css/compile-css.d.ts +2 -0
- package/dist/css/create-at-rule-transformer.d.ts +2 -0
- package/dist/css/create-media-at-rule-transformer.d.ts +6 -0
- package/dist/css/create-spacing-transformer.d.ts +7 -0
- package/dist/css/css.d.ts +0 -14
- package/dist/css/flatten-css-rules.d.ts +2 -0
- package/dist/css/index.d.ts +1 -2
- package/dist/css/resolve-spacing-value.d.ts +1 -0
- package/dist/css/transform-absolute-fill-at-rule.d.ts +1 -0
- package/dist/css/transform-center-at-rule.d.ts +10 -0
- package/dist/css/transform-ellipsis-at-rule.d.ts +1 -0
- package/dist/css/transform-inline-at-rule.d.ts +1 -0
- package/dist/css/transform-stack-at-rule.d.ts +1 -0
- package/dist/css/unwrap-params.d.ts +1 -0
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +717 -1690
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -20
- package/dist/css/middlewares/absolute-fill-at-rule.d.ts +0 -1
- package/dist/css/middlewares/center-at-rule.d.ts +0 -1
- package/dist/css/middlewares/ellipsis-at-rule.d.ts +0 -1
- package/dist/css/middlewares/factory.d.ts +0 -70
- package/dist/css/middlewares/index.d.ts +0 -8
- package/dist/css/middlewares/inline-at-rule.d.ts +0 -6
- package/dist/css/middlewares/media-at-rule.d.ts +0 -6
- package/dist/css/middlewares/spacing.d.ts +0 -7
- package/dist/css/middlewares/stack-at-rule.d.ts +0 -6
- package/dist/css/middlewares/suggest.d.ts +0 -2
- package/dist/css/middlewares/types.d.ts +0 -1
- /package/dist/css/{processor.d.ts → process-css.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-hive/honey-style",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -17,13 +17,6 @@
|
|
|
17
17
|
},
|
|
18
18
|
"author": "Mike Aliinyk <m.aliynik@gmail.com>",
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"scripts": {
|
|
21
|
-
"prepare": "husky",
|
|
22
|
-
"build": "webpack --config webpack.config.mjs",
|
|
23
|
-
"test": "jest --collect-coverage",
|
|
24
|
-
"performanceTest": "jest --testMatch **/*.performance.spec.tsx --testPathIgnorePatterns=''",
|
|
25
|
-
"diagnostics": "tsx scripts/collect-diagnostics.ts"
|
|
26
|
-
},
|
|
27
20
|
"type": "module",
|
|
28
21
|
"main": "dist/index.cjs",
|
|
29
22
|
"module": "dist/index.mjs",
|
|
@@ -45,23 +38,22 @@
|
|
|
45
38
|
},
|
|
46
39
|
"dependencies": {
|
|
47
40
|
"@mdx-js/react": "3.1.1",
|
|
48
|
-
"@react-hive/honey-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
41
|
+
"@react-hive/honey-css": "1.15.0",
|
|
42
|
+
"@react-hive/honey-utils": "3.24.0",
|
|
43
|
+
"csstype": "3.2.3"
|
|
51
44
|
},
|
|
52
45
|
"devDependencies": {
|
|
53
|
-
"@eslint/js": "
|
|
46
|
+
"@eslint/js": "10.0.1",
|
|
54
47
|
"@mdx-js/loader": "3.1.1",
|
|
55
48
|
"@testing-library/jest-dom": "6.9.1",
|
|
56
49
|
"@testing-library/react": "16.3.2",
|
|
57
50
|
"@types/jest": "29.5.14",
|
|
58
51
|
"@types/mdx": "2.0.13",
|
|
59
|
-
"@types/node": "22.19.
|
|
60
|
-
"@types/react": "^19.2.
|
|
52
|
+
"@types/node": "22.19.11",
|
|
53
|
+
"@types/react": "^19.2.14",
|
|
61
54
|
"@types/react-dom": "^19.2.3",
|
|
62
|
-
"@types/stylis": "4.2.7",
|
|
63
55
|
"copy-webpack-plugin": "13.0.1",
|
|
64
|
-
"eslint": "
|
|
56
|
+
"eslint": "10.0.1",
|
|
65
57
|
"eslint-plugin-react": "7.37.5",
|
|
66
58
|
"html-webpack-plugin": "5.6.6",
|
|
67
59
|
"husky": "9.1.7",
|
|
@@ -72,8 +64,8 @@
|
|
|
72
64
|
"ts-loader": "9.5.4",
|
|
73
65
|
"tsx": "4.21.0",
|
|
74
66
|
"typescript": "5.9.3",
|
|
75
|
-
"typescript-eslint": "8.
|
|
76
|
-
"webpack": "5.105.
|
|
67
|
+
"typescript-eslint": "8.56.0",
|
|
68
|
+
"webpack": "5.105.2",
|
|
77
69
|
"webpack-cli": "6.0.1"
|
|
78
70
|
},
|
|
79
71
|
"jest": {
|
|
@@ -92,5 +84,12 @@
|
|
|
92
84
|
"browserslist": [
|
|
93
85
|
"defaults",
|
|
94
86
|
"not IE 11"
|
|
95
|
-
]
|
|
96
|
-
|
|
87
|
+
],
|
|
88
|
+
"scripts": {
|
|
89
|
+
"clean": "rm -rf dist coverage",
|
|
90
|
+
"build": "webpack --config webpack.config.mjs",
|
|
91
|
+
"test": "jest --coverage",
|
|
92
|
+
"performanceTest": "jest --testMatch **/*.performance.spec.tsx --testPathIgnorePatterns=''",
|
|
93
|
+
"diagnostics": "tsx scripts/collect-diagnostics.ts"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createAbsoluteFillAtRuleMiddleware: () => import("stylis").Middleware;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createCenterAtRuleMiddleware: () => import("stylis").Middleware;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const createEllipsisAtRuleMiddleware: () => import("stylis").Middleware;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { Element, Middleware } from 'stylis';
|
|
2
|
-
import type { Nullable } from '../../types';
|
|
3
|
-
interface AtRuleMiddlewareOptions {
|
|
4
|
-
/**
|
|
5
|
-
* The suffix name of the custom at-rule without the `@honey-` prefix.
|
|
6
|
-
*
|
|
7
|
-
* For example, if you want to handle `@honey-stack`, set this to `"stack"`.
|
|
8
|
-
*
|
|
9
|
-
* This name is used to match the rule in the Stylis AST.
|
|
10
|
-
*/
|
|
11
|
-
name: string;
|
|
12
|
-
/**
|
|
13
|
-
* A transformation function that returns CSS declarations to be injected
|
|
14
|
-
* in place of the custom at-rule.
|
|
15
|
-
*
|
|
16
|
-
* @param args - An array of parsed arguments inside the at-rule parentheses.
|
|
17
|
-
* Arguments are split by spaces.
|
|
18
|
-
*
|
|
19
|
-
* For example:
|
|
20
|
-
* - `@honey-stack(2)` → `args = ['2']`
|
|
21
|
-
* - `@honey-inline(2 center)` → `args = ['2', 'center']`
|
|
22
|
-
*
|
|
23
|
-
* @param element - The Stylis AST element representing the current at-rule node.
|
|
24
|
-
* Can be useful for accessing raw content or children.
|
|
25
|
-
*
|
|
26
|
-
* @returns A string of one or more CSS declarations (e.g., `display:flex;gap:8px;`).
|
|
27
|
-
* This string will be injected into the compiled output in place of the at-rule.
|
|
28
|
-
*/
|
|
29
|
-
transform: (args: string[], element: Element, callback: Middleware) => Nullable<string>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Creates a Stylis middleware for transforming custom `@honey-*` at-rules into
|
|
33
|
-
* regular CSS declarations.
|
|
34
|
-
*
|
|
35
|
-
* This utility enables the definition of expressive, domain-specific at-rules
|
|
36
|
-
* such as `@honey-stack`, `@honey-inline`, or `@honey-center`, which can then be
|
|
37
|
-
* expanded into valid CSS at build time.
|
|
38
|
-
*
|
|
39
|
-
* Supports optional arguments passed via parentheses (e.g., `@honey-stack(2)`),
|
|
40
|
-
* as well as nested rule bodies (e.g., `@honey-stack { .child { ... } }`).
|
|
41
|
-
*
|
|
42
|
-
* ---
|
|
43
|
-
*
|
|
44
|
-
* ### Example
|
|
45
|
-
* ```ts
|
|
46
|
-
* createAtRuleMiddleware({
|
|
47
|
-
* name: 'stack',
|
|
48
|
-
* transform: args => {
|
|
49
|
-
* const gap = parseFloat(args[0] ?? '0') * 8;
|
|
50
|
-
*
|
|
51
|
-
* return `display:flex;flex-direction:column;gap:${gap}px;`;
|
|
52
|
-
* }
|
|
53
|
-
* });
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* ---
|
|
57
|
-
*
|
|
58
|
-
* ### Behavior
|
|
59
|
-
* - Matches only rules of the form `@honey-${name}` inside standard CSS rules.
|
|
60
|
-
* - Parses arguments from parentheses (e.g. `@honey-name (arg1 arg2)`).
|
|
61
|
-
* - Serializes nested content (children) and appends it to the output.
|
|
62
|
-
*
|
|
63
|
-
* @param options - Options for configuring the middleware:
|
|
64
|
-
* - `name`: the custom at-rule suffix, without the `@honey-` prefix.
|
|
65
|
-
* - `transform`: a function to convert parsed args and the AST node into CSS declarations.
|
|
66
|
-
*
|
|
67
|
-
* @returns A Stylis `Middleware` function that replaces the matched at-rule with the generated CSS.
|
|
68
|
-
*/
|
|
69
|
-
export declare const createAtRuleMiddleware: ({ name, transform }: AtRuleMiddlewareOptions) => Middleware;
|
|
70
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './spacing';
|
|
2
|
-
export * from './stack-at-rule';
|
|
3
|
-
export * from './inline-at-rule';
|
|
4
|
-
export * from './center-at-rule';
|
|
5
|
-
export * from './absolute-fill-at-rule';
|
|
6
|
-
export * from './ellipsis-at-rule';
|
|
7
|
-
export * from './media-at-rule';
|
|
8
|
-
export * from './suggest';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { HoneyTheme } from '../../types';
|
|
2
|
-
interface CreateInlineAtRuleMiddlewareOptions {
|
|
3
|
-
theme?: HoneyTheme;
|
|
4
|
-
}
|
|
5
|
-
export declare const createInlineAtRuleMiddleware: ({ theme }?: CreateInlineAtRuleMiddlewareOptions) => import("stylis").Middleware;
|
|
6
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Middleware } from 'stylis';
|
|
2
|
-
import type { HoneyTheme } from '../../types';
|
|
3
|
-
interface SpacingMiddlewareOptions {
|
|
4
|
-
theme?: HoneyTheme;
|
|
5
|
-
}
|
|
6
|
-
export declare const createSpacingMiddleware: ({ theme }: SpacingMiddlewareOptions) => Middleware;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type CSSDeclaration = `${string}:${string};`;
|
|
File without changes
|