@css-hooks/core 3.2.0-next.9 → 4.0.0-next.1

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
@@ -1,16 +1,16 @@
1
1
  <div align="center">
2
- <a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v3.2.0-next.9/.github/logomark.svg" height="128" /></a><br/><br/>
2
+ <a id="logomark" href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.1/.github/logomark.svg" height="128" /></a><br/><br/>
3
3
  <div id="wordmark">
4
- <a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v3.2.0-next.9/.github/wordmark-dark.svg" width="256"></a>
4
+ <a href="https://next.css-hooks.com"><img alt="CSS Hooks" src="https://github.com/css-hooks/css-hooks/raw/v4.0.0-next.1/.github/wordmark-dark.svg" width="256"></a>
5
5
  </div>
6
6
  </div>
7
7
 
8
8
  <br/>
9
9
 
10
10
  <div align="center" id="badges">
11
- <a href="https://github.com/css-hooks/css-hooks/tree/v3.2.0-next.9"><img src="https://img.shields.io/badge/tag-v3.2.0--next.9-ffd700" alt="tag v3.2.0-next.9"></a>
12
- <a href="https://www.npmjs.com/package/@css-hooks/core/v/3.2.0-next.9"><img src="https://img.shields.io/badge/npm-v3.2.0--next.9-ffd700" alt="npm version"></a>
13
- <a href="https://github.com/css-hooks/css-hooks/blob/v3.2.0-next.9/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
11
+ <a href="https://github.com/css-hooks/css-hooks/tree/v4.0.0-next.1"><img src="https://img.shields.io/badge/tag-v4.0.0--next.1-ffd700" alt="tag v4.0.0-next.1"></a>
12
+ <a href="https://www.npmjs.com/package/@css-hooks/core/v/4.0.0-next.1"><img src="https://img.shields.io/badge/npm-v4.0.0--next.1-ffd700" alt="npm version"></a>
13
+ <a href="https://github.com/css-hooks/css-hooks/blob/v4.0.0-next.1/LICENSE"><img src="https://img.shields.io/badge/license-MIT-ffd700" alt="license"></a>
14
14
  </div>
15
15
 
16
16
  ---
package/cjs/index.js CHANGED
@@ -9,31 +9,44 @@ exports.buildHooksSystem = buildHooksSystem;
9
9
  /**
10
10
  * Creates a flavor of CSS Hooks tailored to a specific app framework.
11
11
  *
12
+ * @remarks
13
+ * Primarily for internal use, advanced use cases, or when an appropriate
14
+ * framework integration is not provided
15
+ *
16
+ * @typeParam CSSProperties - The type of a style object, typically defined by
17
+ * an app framework (e.g., React's `CSSProperties` type)
18
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
19
+ * with which they conflict
20
+ *
12
21
  * @param stringify - The function used to stringify values when merging
13
- * conditional styles.
22
+ * override styles
14
23
  *
15
24
  * @returns The `createHooks` function used to bootstrap CSS Hooks within an app
16
- * or component library.
17
- *
18
- * @remarks
19
- * Primarily for internal use, advanced use cases, or when an appropriate
20
- * framework integration is not provided.
25
+ * or component library
21
26
  *
22
27
  * @public
23
- *
24
28
  */
25
29
  function buildHooksSystem(stringify = String) {
26
30
  return (...selectors) => {
27
- const [space, newline] =
28
- // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
29
- process.env.NODE_ENV === "development" ? [" ", "\n"] : ["", ""];
31
+ let space = "";
32
+ let newline = "";
33
+ try {
34
+ // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
35
+ if (process.env.NODE_ENV === "development") {
36
+ space = " ";
37
+ newline = "\n";
38
+ }
39
+ }
40
+ catch {
41
+ // `process.env.NODE_ENV` is absent in unbundled browser environments
42
+ }
30
43
  return {
31
44
  styleSheet() {
32
45
  const indent = Array(2).fill(space).join("");
33
46
  return `*${space}{${newline}${selectors
34
47
  .flatMap(selector => [
35
- `${indent}--${createHash(selector)}-0:${space}initial;`,
36
- `${indent}--${createHash(selector)}-1:${space};`,
48
+ `${indent}--${createHash(selector)}0:${space}initial;`,
49
+ `${indent}--${createHash(selector)}1:${space};`,
37
50
  ])
38
51
  .join(newline)}${newline}}${newline}${selectors
39
52
  .flatMap(def => {
@@ -41,16 +54,16 @@ function buildHooksSystem(stringify = String) {
41
54
  return [
42
55
  `${def} {`,
43
56
  `${indent}* {`,
44
- `${indent}${indent}--${createHash(def)}-0:${space};`,
45
- `${indent}${indent}--${createHash(def)}-1:${space}initial;`,
57
+ `${indent}${indent}--${createHash(def)}0:${space};`,
58
+ `${indent}${indent}--${createHash(def)}1:${space}initial;`,
46
59
  `${indent}}`,
47
60
  "}",
48
61
  ];
49
62
  }
50
63
  return [
51
64
  `${def.replace(/&/g, "*")}${space}{`,
52
- `${indent}--${createHash(def)}-0:${space};`,
53
- `${indent}--${createHash(def)}-1:${space}initial;`,
65
+ `${indent}--${createHash(def)}0:${space};`,
66
+ `${indent}--${createHash(def)}1:${space}initial;`,
54
67
  "}",
55
68
  ];
56
69
  })
@@ -60,7 +73,7 @@ function buildHooksSystem(stringify = String) {
60
73
  or: (...or) => ({ or }),
61
74
  not: not => ({ not }),
62
75
  on(condition, overrideStyle) {
63
- return fallbackStyle => {
76
+ return (fallbackStyle) => {
64
77
  const style = { ...fallbackStyle };
65
78
  for (const property in overrideStyle) {
66
79
  const overrideValue = stringify(overrideStyle[property], property);
@@ -93,7 +106,7 @@ function buildHooksSystem(stringify = String) {
93
106
  valFalse = `var(--${hash})`;
94
107
  }
95
108
  return [
96
- `var(--${createHash(condition)}-1,${space}${valTrue})${space}var(--${createHash(condition)}-0,${space}${valFalse})`,
109
+ `var(--${createHash(condition)}1,${space}${valTrue})${space}var(--${createHash(condition)}0,${space}${valFalse})`,
97
110
  extraDecls,
98
111
  ];
99
112
  }
@@ -122,14 +135,26 @@ function buildHooksSystem(stringify = String) {
122
135
  };
123
136
  };
124
137
  }
125
- function createHash(obj) {
126
- const jsonString = JSON.stringify(obj);
127
- let hashValue = 0;
128
- for (let i = 0; i < jsonString.length; i++) {
129
- const charCode = jsonString.charCodeAt(i);
130
- hashValue = (hashValue << 5) - hashValue + charCode;
131
- hashValue &= 0x7fffffff;
138
+ const hashAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
139
+ function createHash(value) {
140
+ let h1 = 0xdeadbeef;
141
+ let h2 = 0x41c6ce57;
142
+ for (let i = 0; i < value.length; i++) {
143
+ const code = value.charCodeAt(i);
144
+ h1 = Math.imul(h1 ^ code, 0x9e3779b1);
145
+ h2 = Math.imul(h2 ^ code, 0x5f356495);
146
+ }
147
+ h1 =
148
+ Math.imul(h1 ^ (h1 >>> 16), 0x85ebca6b) ^
149
+ Math.imul(h2 ^ (h2 >>> 13), 0xc2b2ae35);
150
+ h2 =
151
+ Math.imul(h2 ^ (h2 >>> 16), 0x85ebca6b) ^
152
+ Math.imul(h1 ^ (h1 >>> 13), 0xc2b2ae35);
153
+ let hash = (h1 >>> 0) + 0x100000000 * (h2 & 0xf);
154
+ let encoded = "";
155
+ for (let i = 0; i < 6; i++) {
156
+ encoded = hashAlphabet.charAt(hash % 64) + encoded;
157
+ hash = Math.floor(hash / 64);
132
158
  }
133
- const str = hashValue.toString(36);
134
- return /^[0-9]/.test(str) ? `a${str}` : str;
159
+ return encoded;
135
160
  }
package/esm/index.js CHANGED
@@ -6,31 +6,44 @@
6
6
  /**
7
7
  * Creates a flavor of CSS Hooks tailored to a specific app framework.
8
8
  *
9
+ * @remarks
10
+ * Primarily for internal use, advanced use cases, or when an appropriate
11
+ * framework integration is not provided
12
+ *
13
+ * @typeParam CSSProperties - The type of a style object, typically defined by
14
+ * an app framework (e.g., React's `CSSProperties` type)
15
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
16
+ * with which they conflict
17
+ *
9
18
  * @param stringify - The function used to stringify values when merging
10
- * conditional styles.
19
+ * override styles
11
20
  *
12
21
  * @returns The `createHooks` function used to bootstrap CSS Hooks within an app
13
- * or component library.
14
- *
15
- * @remarks
16
- * Primarily for internal use, advanced use cases, or when an appropriate
17
- * framework integration is not provided.
22
+ * or component library
18
23
  *
19
24
  * @public
20
- *
21
25
  */
22
26
  export function buildHooksSystem(stringify = String) {
23
27
  return (...selectors) => {
24
- const [space, newline] =
25
- // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
26
- process.env.NODE_ENV === "development" ? [" ", "\n"] : ["", ""];
28
+ let space = "";
29
+ let newline = "";
30
+ try {
31
+ // @ts-expect-error bundler expected to replace `process.env.NODE_ENV` expression
32
+ if (process.env.NODE_ENV === "development") {
33
+ space = " ";
34
+ newline = "\n";
35
+ }
36
+ }
37
+ catch {
38
+ // `process.env.NODE_ENV` is absent in unbundled browser environments
39
+ }
27
40
  return {
28
41
  styleSheet() {
29
42
  const indent = Array(2).fill(space).join("");
30
43
  return `*${space}{${newline}${selectors
31
44
  .flatMap(selector => [
32
- `${indent}--${createHash(selector)}-0:${space}initial;`,
33
- `${indent}--${createHash(selector)}-1:${space};`,
45
+ `${indent}--${createHash(selector)}0:${space}initial;`,
46
+ `${indent}--${createHash(selector)}1:${space};`,
34
47
  ])
35
48
  .join(newline)}${newline}}${newline}${selectors
36
49
  .flatMap(def => {
@@ -38,16 +51,16 @@ export function buildHooksSystem(stringify = String) {
38
51
  return [
39
52
  `${def} {`,
40
53
  `${indent}* {`,
41
- `${indent}${indent}--${createHash(def)}-0:${space};`,
42
- `${indent}${indent}--${createHash(def)}-1:${space}initial;`,
54
+ `${indent}${indent}--${createHash(def)}0:${space};`,
55
+ `${indent}${indent}--${createHash(def)}1:${space}initial;`,
43
56
  `${indent}}`,
44
57
  "}",
45
58
  ];
46
59
  }
47
60
  return [
48
61
  `${def.replace(/&/g, "*")}${space}{`,
49
- `${indent}--${createHash(def)}-0:${space};`,
50
- `${indent}--${createHash(def)}-1:${space}initial;`,
62
+ `${indent}--${createHash(def)}0:${space};`,
63
+ `${indent}--${createHash(def)}1:${space}initial;`,
51
64
  "}",
52
65
  ];
53
66
  })
@@ -57,7 +70,7 @@ export function buildHooksSystem(stringify = String) {
57
70
  or: (...or) => ({ or }),
58
71
  not: not => ({ not }),
59
72
  on(condition, overrideStyle) {
60
- return fallbackStyle => {
73
+ return (fallbackStyle) => {
61
74
  const style = { ...fallbackStyle };
62
75
  for (const property in overrideStyle) {
63
76
  const overrideValue = stringify(overrideStyle[property], property);
@@ -90,7 +103,7 @@ export function buildHooksSystem(stringify = String) {
90
103
  valFalse = `var(--${hash})`;
91
104
  }
92
105
  return [
93
- `var(--${createHash(condition)}-1,${space}${valTrue})${space}var(--${createHash(condition)}-0,${space}${valFalse})`,
106
+ `var(--${createHash(condition)}1,${space}${valTrue})${space}var(--${createHash(condition)}0,${space}${valFalse})`,
94
107
  extraDecls,
95
108
  ];
96
109
  }
@@ -119,14 +132,26 @@ export function buildHooksSystem(stringify = String) {
119
132
  };
120
133
  };
121
134
  }
122
- function createHash(obj) {
123
- const jsonString = JSON.stringify(obj);
124
- let hashValue = 0;
125
- for (let i = 0; i < jsonString.length; i++) {
126
- const charCode = jsonString.charCodeAt(i);
127
- hashValue = (hashValue << 5) - hashValue + charCode;
128
- hashValue &= 0x7fffffff;
135
+ const hashAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
136
+ function createHash(value) {
137
+ let h1 = 0xdeadbeef;
138
+ let h2 = 0x41c6ce57;
139
+ for (let i = 0; i < value.length; i++) {
140
+ const code = value.charCodeAt(i);
141
+ h1 = Math.imul(h1 ^ code, 0x9e3779b1);
142
+ h2 = Math.imul(h2 ^ code, 0x5f356495);
143
+ }
144
+ h1 =
145
+ Math.imul(h1 ^ (h1 >>> 16), 0x85ebca6b) ^
146
+ Math.imul(h2 ^ (h2 >>> 13), 0xc2b2ae35);
147
+ h2 =
148
+ Math.imul(h2 ^ (h2 >>> 16), 0x85ebca6b) ^
149
+ Math.imul(h1 ^ (h1 >>> 13), 0xc2b2ae35);
150
+ let hash = (h1 >>> 0) + 0x100000000 * (h2 & 0xf);
151
+ let encoded = "";
152
+ for (let i = 0; i < 6; i++) {
153
+ encoded = hashAlphabet.charAt(hash % 64) + encoded;
154
+ hash = Math.floor(hash / 64);
129
155
  }
130
- const str = hashValue.toString(36);
131
- return /^[0-9]/.test(str) ? `a${str}` : str;
156
+ return encoded;
132
157
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@css-hooks/core",
3
3
  "description": "CSS Hooks core library",
4
- "version": "3.2.0-next.9",
4
+ "version": "4.0.0-next.1",
5
5
  "author": "Nick Saunders",
6
6
  "devDependencies": {
7
7
  "color": "^5.0.3",
package/types/index.d.ts CHANGED
@@ -6,8 +6,7 @@
6
6
  /**
7
7
  * Represents the conditions under which a given hook or declaration applies.
8
8
  *
9
- * @typeParam S - The basic type of condition to enhance with boolean
10
- * operations.
9
+ * @typeParam S - The basic type of condition to enhance with boolean operations
11
10
  *
12
11
  * @public
13
12
  */
@@ -19,18 +18,16 @@ export type Condition<S> = S | {
19
18
  not: Condition<S>;
20
19
  };
21
20
  /**
22
- * Function to convert a value into a string.
21
+ * Function to convert a value into a string
23
22
  *
24
- * @param value - The value to stringify
23
+ * @remarks
24
+ * Used for merging a conditional property value with the fallback value
25
25
  *
26
+ * @param value - The value to stringify
26
27
  * @param propertyName - The property name corresponding to the value being
27
- * stringified
28
+ * stringified
28
29
  *
29
- * @remarks
30
- * Used for merging a conditional property value with the fallback value.
31
- *
32
- * @returns The stringified value, or `undefined` if the value cannot be
33
- * stringified
30
+ * @returns The stringified value, or `null` if the value cannot be stringified
34
31
  *
35
32
  * @public
36
33
  */
@@ -39,57 +36,66 @@ export type StringifyFn = (value: unknown, propertyName: string) => string | nul
39
36
  * Represents the selector logic used to create a hook.
40
37
  *
41
38
  * @remarks
42
- * Two types are supported:
43
- * 1. A basic selector, where `&` is used as a placeholder for the element to
44
- * which the condition applies. The `&` character must appear somewhere.
45
- * 2. A `@media`, `@container`, or `@supports` at-rule. The value must begin
46
- * with one of these keywords, followed by a space.
47
- * 3. The `@starting-style` at-rule (exactly, with no additional parameters).
39
+ * Three forms are supported:
40
+ *
41
+ * 1. A basic selector, where `&` is used as a placeholder for the element to which
42
+ * the condition applies. The `&` character must appear somewhere.
43
+ * 2. `@media`, `@container`, and `@supports` at-rules. Each value must begin with
44
+ * its keyword, followed by a space.
45
+ * 3. `@starting-style` with no additional parameters
48
46
  *
49
47
  * @public
50
48
  */
51
49
  export type Selector = `${string}&${string}` | `@${"media" | "container" | "supports"} ${string}` | "@starting-style";
52
50
  /**
53
- * Enhances a style object by merging in conditional declarations.
54
- *
55
- * @typeParam CSSProperties - The type of a standard (flat) style object,
56
- * typically defined by an app framework (e.g., React's `CSSProperties` type).
51
+ * Resolves the CSS property names that conflict with an override style.
57
52
  *
58
- * @param style - The original style object containing default/fallback values
59
- *
60
- * @returns An enhanced style object with conditional styles applied
53
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
54
+ * they conflict with
55
+ * @typeParam OverrideCSSProperties - The conditional declarations for which
56
+ * conflicting properties are resolved
57
+ */
58
+ type CSSPropertyConflictKeys<CSSPropertyConflicts extends object, OverrideCSSProperties> = CSSPropertyConflicts[keyof OverrideCSSProperties & keyof CSSPropertyConflicts] & PropertyKey;
59
+ /**
60
+ * Prevents conflicting CSS properties from being assigned values in a base
61
+ * style.
61
62
  *
62
- * @public
63
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
64
+ * with which they conflict
65
+ * @typeParam OverrideCSSProperties - The conditional declarations for which
66
+ * conflicting properties are forbidden
63
67
  */
64
- export type EnhanceStyleFn<CSSProperties> = (style: CSSProperties) => CSSProperties;
68
+ type ForbidCSSPropertyConflicts<CSSPropertyConflicts extends object, OverrideCSSProperties> = {
69
+ [P in CSSPropertyConflictKeys<CSSPropertyConflicts, OverrideCSSProperties>]?: never;
70
+ };
65
71
  /**
66
72
  * An object containing the functions needed to support and use the configured
67
- * hooks.
73
+ * hooks
68
74
  *
69
75
  * @typeParam S - The type of the selector logic for which to generate hooks
70
- *
71
- * @typeParam CSSProperties - The type of a standard (flat) style object,
72
- * typically defined by an app framework (e.g., React's `CSSProperties` type).
73
- *
74
- * @public
76
+ * @typeParam CSSProperties - The type of a style object, typically defined by
77
+ * an app framework (e.g., React's `CSSProperties` type)
78
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
79
+ * with which they conflict
75
80
  */
76
- export interface CreateHooksResult<S, CSSProperties> {
81
+ interface CreateHooksResult<S, CSSProperties, CSSPropertyConflicts extends object> {
77
82
  /**
78
- * Enhances a style object with conditional styles.
83
+ * Creates a function that enhances a style object with conditional override
84
+ * styles.
79
85
  */
80
- on: (condition: Condition<S>, style: CSSProperties) => EnhanceStyleFn<CSSProperties>;
86
+ on: <OverrideCSSProperties extends CSSProperties, BaseCSSProperties extends Omit<CSSProperties, CSSPropertyConflictKeys<CSSPropertyConflicts, OverrideCSSProperties>>>(condition: Condition<S>, overrideStyle: OverrideCSSProperties) => (style: CSSProperties & BaseCSSProperties & ForbidCSSPropertyConflicts<CSSPropertyConflicts, OverrideCSSProperties>) => BaseCSSProperties & OverrideCSSProperties;
81
87
  /**
82
88
  * Combines a list of conditions into a single condition which is true when
83
89
  * all of the specified conditions are true.
84
90
  *
85
91
  * @typeParam C - The type of the conditions which must all be true in order
86
- * for the condition to be true.
92
+ * for the condition to be true
87
93
  *
88
94
  * @param conditions - The conditions which must all be true in order for the
89
- * condition to be true.
95
+ * condition to be true
90
96
  *
91
97
  * @returns A condition that is true when all of the specified conditions are
92
- * true.
98
+ * true
93
99
  */
94
100
  and: <C extends Condition<S>[]>(...conditions: C) => {
95
101
  and: C;
@@ -99,13 +105,13 @@ export interface CreateHooksResult<S, CSSProperties> {
99
105
  * any of the specified conditions are true.
100
106
  *
101
107
  * @typeParam C - The type of the conditions any one of which must be true in
102
- * order for the condition to be true.
108
+ * order for the condition to be true
103
109
  *
104
110
  * @param conditions - The conditions any one of which must be true in order
105
- * for the condition to be true.
111
+ * for the condition to be true
106
112
  *
107
113
  * @returns A condition that is true when any of the specified conditions are
108
- * true.
114
+ * true
109
115
  */
110
116
  or: <C extends Condition<S>[]>(...conditions: C) => {
111
117
  or: C;
@@ -113,54 +119,58 @@ export interface CreateHooksResult<S, CSSProperties> {
113
119
  /**
114
120
  * Negates a condition.
115
121
  *
116
- * @typeParam condition - The type of the condition which must be false in
117
- * order for the resulting condition to be true.
122
+ * @typeParam C - The type of the condition which must be false in order for
123
+ * the resulting condition to be true
118
124
  *
119
125
  * @param condition - The condition which must be false in order for the
120
- * resulting condition to be true.
126
+ * resulting condition to be true
121
127
  *
122
128
  * @returns A condition that is true when the specified condition is false.
123
129
  */
124
130
  not: <C extends Condition<S>>(condition: C) => {
125
131
  not: C;
126
132
  };
127
- /**
128
- * The style sheet required to support the configured hooks.
129
- */
133
+ /** Returns the style sheet required to support the configured hooks. */
130
134
  styleSheet: () => string;
131
135
  }
132
136
  /**
133
137
  * Represents the function used to define hooks and related configuration.
134
138
  *
135
- * @typeParam CSSProperties - The type of a standard (flat) style object,
136
- * typically defined by an app framework (e.g., React's `CSSProperties` type).
139
+ * @typeParam CSSProperties - The type of a style object, typically defined by
140
+ * an app framework (e.g., React's `CSSProperties` type)
141
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
142
+ * with which they conflict
143
+ * @typeParam S - The type of selectors for which to create hooks
137
144
  *
138
- * @typeParam S - The type of selectors for which to create hooks.
139
- *
140
- * @param selectors - The selectors for which to create hooks.
145
+ * @param selectors - The selectors for which to create hooks
141
146
  *
142
147
  * @returns An object containing the functions needed to support and use the
143
- * configured hooks.
148
+ * configured hooks
144
149
  *
145
150
  * @public
146
151
  */
147
- export type CreateHooksFn<CSSProperties> = <S extends Selector>(...selectors: S[]) => CreateHooksResult<S, CSSProperties>;
152
+ export type CreateHooksFn<CSSProperties, CSSPropertyConflicts extends object = object> = <S extends Selector>(...selectors: S[]) => CreateHooksResult<S, CSSProperties, CSSPropertyConflicts>;
148
153
  /**
149
154
  * Creates a flavor of CSS Hooks tailored to a specific app framework.
150
155
  *
156
+ * @remarks
157
+ * Primarily for internal use, advanced use cases, or when an appropriate
158
+ * framework integration is not provided
159
+ *
160
+ * @typeParam CSSProperties - The type of a style object, typically defined by
161
+ * an app framework (e.g., React's `CSSProperties` type)
162
+ * @typeParam CSSPropertyConflicts - A map from CSS properties to the properties
163
+ * with which they conflict
164
+ *
151
165
  * @param stringify - The function used to stringify values when merging
152
- * conditional styles.
166
+ * override styles
153
167
  *
154
168
  * @returns The `createHooks` function used to bootstrap CSS Hooks within an app
155
- * or component library.
156
- *
157
- * @remarks
158
- * Primarily for internal use, advanced use cases, or when an appropriate
159
- * framework integration is not provided.
169
+ * or component library
160
170
  *
161
171
  * @public
162
- *
163
172
  */
164
173
  export declare function buildHooksSystem<CSSProperties extends {
165
174
  [P: string]: any;
166
- } = Record<string, unknown>>(stringify?: StringifyFn): CreateHooksFn<CSSProperties>;
175
+ } = Record<string, unknown>, CSSPropertyConflicts extends object = object>(stringify?: StringifyFn): CreateHooksFn<CSSProperties, CSSPropertyConflicts>;
176
+ export {};