@css-hooks/solid 1.0.1 → 1.1.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
@@ -7,7 +7,7 @@
7
7
 
8
8
  <p align="center">
9
9
  <a href="https://github.com/css-hooks/css-hooks/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/css-hooks/css-hooks/ci.yml?branch=master" alt="Build Status"></a>
10
- <a href="https://github.com/css-hooks/css-hooks/releases"><img src="https://img.shields.io/npm/v/@css-hooks%2Fcore.svg" alt="Latest Release"></a>
10
+ <a href="https://www.npmjs.com/org/css-hooks"><img src="https://img.shields.io/npm/v/@css-hooks%2Fcore.svg" alt="Latest Release"></a>
11
11
  <a href="https://github.com/css-hooks/css-hooks/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/css-hooks.svg" alt="License"></a>
12
12
  </p>
13
13
 
@@ -50,7 +50,7 @@ Please visit [css-hooks.com](https://css-hooks.com) to get started.
50
50
  - [@css-hooks/react](packages/react): React framework integration
51
51
  - [@css-hooks/solid](packages/solid): Solid framework integration
52
52
  - [@css-hooks/preact](packages/preact): Preact framework integration
53
- - [@css-hooks/core](packages/core): Core package (internal use only)
53
+ - [@css-hooks/core](packages/core): Core package (internal / advanced use cases)
54
54
 
55
55
  ## Contributing
56
56
 
package/cjs/index.js CHANGED
@@ -3,16 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.recommended = exports.createHooks = exports.stringifyValue = void 0;
4
4
  const core_1 = require("@css-hooks/core");
5
5
  /** @internal */
6
- function stringifyValue(_, value) {
7
- if (typeof value === "string") {
8
- return value;
9
- }
10
- if (typeof value === "number") {
11
- return `${value}`;
12
- }
13
- return null;
14
- }
15
- exports.stringifyValue = stringifyValue;
6
+ exports.stringifyValue = core_1.genericStringify;
16
7
  /**
17
8
  * Creates the hooks specified in the configuration.
18
9
  *
@@ -20,7 +11,7 @@ exports.stringifyValue = stringifyValue;
20
11
  *
21
12
  * @returns The CSS required to enable the configured hooks, along with the corresponding `hooks` function for use in components.
22
13
  */
23
- exports.createHooks = (0, core_1.buildHooksSystem)(stringifyValue);
14
+ exports.createHooks = (0, core_1.buildHooksSystem)(exports.stringifyValue);
24
15
  function keybab(r) {
25
16
  /* eslint-disable @typescript-eslint/no-unsafe-return,@typescript-eslint/no-explicit-any */
26
17
  return Object.fromEntries(Object.entries(r).map(([key, value]) => [
package/esm/index.js CHANGED
@@ -1,14 +1,6 @@
1
- import { buildHooksSystem, recommended as coreRecommended, } from "@css-hooks/core";
1
+ import { buildHooksSystem, recommended as coreRecommended, genericStringify, } from "@css-hooks/core";
2
2
  /** @internal */
3
- export function stringifyValue(_, value) {
4
- if (typeof value === "string") {
5
- return value;
6
- }
7
- if (typeof value === "number") {
8
- return `${value}`;
9
- }
10
- return null;
11
- }
3
+ export const stringifyValue = genericStringify;
12
4
  /**
13
5
  * Creates the hooks specified in the configuration.
14
6
  *
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@css-hooks/solid",
3
3
  "description": "CSS Hooks for Solid",
4
- "version": "1.0.1",
4
+ "version": "1.1.0",
5
5
  "author": "Nick Saunders",
6
6
  "dependencies": {
7
- "@css-hooks/core": "^1.0.1",
7
+ "@css-hooks/core": "^1.1.0",
8
8
  "ts-toolbelt": "^9.6.0"
9
9
  },
10
10
  "devDependencies": {
package/types/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { JSX } from "solid-js";
2
+ import { genericStringify } from "@css-hooks/core";
2
3
  /** @internal */
3
- export declare function stringifyValue(_: string, value: unknown): string | null;
4
+ export declare const stringifyValue: typeof genericStringify;
4
5
  /**
5
6
  * Creates the hooks specified in the configuration.
6
7
  *