@pimolu/core 0.1.0-beta.1 → 0.1.0-beta.2

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.
Files changed (4) hide show
  1. package/README.fr.md +21 -8
  2. package/README.md +21 -8
  3. package/package.json +35 -34
  4. package/LICENSE +0 -21
package/README.fr.md CHANGED
@@ -1,29 +1,42 @@
1
1
  # @pimolu/core
2
2
 
3
- Utilitaires de variantes de classes, indépendants du framework, utilisés par Pimolu UI.
3
+ Un petit utilitaire indépendant du framework pour composer des classes CSS à partir de variantes nommées. Il permet d'obtenir des noms de classes prévisibles sans runtime CSS-in-JS.
4
4
 
5
- > **0.1.0-beta.1** — version de prévisualisation.
5
+ > **0.1.0-beta.2** est une version de prévisualisation.
6
+
7
+ ## Installation
6
8
 
7
9
  ```bash
8
- pnpm add @pimolu/core
10
+ pnpm add @pimolu/core@beta
9
11
  ```
10
12
 
13
+ ## Utilisation
14
+
11
15
  ```ts
12
16
  import { createVariants, type VariantProps } from "@pimolu/core";
13
17
 
14
- const button = createVariants({
18
+ const buttonClass = createVariants({
15
19
  base: "pimolu-button",
16
20
  variants: {
17
- size: { sm: "pimolu-button--sm", md: "pimolu-button--md" },
21
+ size: {
22
+ sm: "pimolu-button--sm",
23
+ md: "pimolu-button--md",
24
+ },
18
25
  },
19
26
  defaultVariants: { size: "md" },
20
27
  });
21
28
 
22
- button({ size: "sm" }); // "pimolu-button pimolu-button--sm"
29
+ type ButtonVariants = VariantProps<typeof buttonClass>;
30
+
31
+ const options: ButtonVariants = { size: "sm" };
32
+ buttonClass(options); // "pimolu-button pimolu-button--sm"
33
+ buttonClass({}, "my-class"); // "pimolu-button pimolu-button--md my-class"
23
34
  ```
24
35
 
25
- Le package est ESM uniquement et n'a aucune dépendance d'exécution.
36
+ `createVariants` renvoie une chaîne de classes. Le package n'a aucune dépendance d'exécution et ne génère pas de CSS : fournissez les styles correspondants ou utilisez les styles publiés avec les composants Pimolu.
37
+
38
+ ## Liens
26
39
 
27
- Documentation : <https://github.com/pimoludev/ui>
40
+ [Documentation des composants](https://pimolu.com/components) · [Tous les packages npm](https://www.npmjs.com/org/pimolu) · [Code source](https://github.com/pimoludev/ui/tree/main/packages/core)
28
41
 
29
42
  MIT © Pimolu
package/README.md CHANGED
@@ -1,29 +1,42 @@
1
1
  # @pimolu/core
2
2
 
3
- Framework-agnostic class variant utilities used by Pimolu UI.
3
+ A small, framework-independent utility for composing CSS classes from named variants. It is useful when your components need predictable class names without a CSS-in-JS runtime.
4
4
 
5
- > **0.1.0-beta.1** — preview release.
5
+ > **0.1.0-beta.2** is a preview release.
6
+
7
+ ## Install
6
8
 
7
9
  ```bash
8
- pnpm add @pimolu/core
10
+ pnpm add @pimolu/core@beta
9
11
  ```
10
12
 
13
+ ## Use
14
+
11
15
  ```ts
12
16
  import { createVariants, type VariantProps } from "@pimolu/core";
13
17
 
14
- const button = createVariants({
18
+ const buttonClass = createVariants({
15
19
  base: "pimolu-button",
16
20
  variants: {
17
- size: { sm: "pimolu-button--sm", md: "pimolu-button--md" },
21
+ size: {
22
+ sm: "pimolu-button--sm",
23
+ md: "pimolu-button--md",
24
+ },
18
25
  },
19
26
  defaultVariants: { size: "md" },
20
27
  });
21
28
 
22
- button({ size: "sm" }); // "pimolu-button pimolu-button--sm"
29
+ type ButtonVariants = VariantProps<typeof buttonClass>;
30
+
31
+ const options: ButtonVariants = { size: "sm" };
32
+ buttonClass(options); // "pimolu-button pimolu-button--sm"
33
+ buttonClass({}, "my-class"); // "pimolu-button pimolu-button--md my-class"
23
34
  ```
24
35
 
25
- The package is ESM-only and has no runtime dependency.
36
+ `createVariants` returns a class-name string. It has no runtime dependencies and does not generate CSS: provide the matching styles yourself, or use Pimolu's published styles with Pimolu components.
37
+
38
+ ## Links
26
39
 
27
- Documentation: <https://github.com/pimoludev/ui>
40
+ [Component documentation](https://pimolu.com/components) · [All npm packages](https://www.npmjs.com/org/pimolu) · [Source](https://github.com/pimoludev/ui/tree/main/packages/core)
28
41
 
29
42
  MIT © Pimolu
package/package.json CHANGED
@@ -1,34 +1,35 @@
1
- {
2
- "name": "@pimolu/core",
3
- "version": "0.1.0-beta.1",
4
- "description": "Framework-agnostic Pimolu UI class variant utilities.",
5
- "license": "MIT",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/pimoludev/ui.git",
9
- "directory": "packages/core"
10
- },
11
- "publishConfig": {
12
- "access": "public"
13
- },
14
- "type": "module",
15
- "main": "./dist/index.js",
16
- "types": "./dist/index.d.ts",
17
- "files": [
18
- "dist"
19
- ],
20
- "exports": {
21
- ".": {
22
- "types": "./dist/index.d.ts",
23
- "import": "./dist/index.js",
24
- "default": "./dist/index.js"
25
- },
26
- "./package.json": "./package.json"
27
- },
28
- "devDependencies": {
29
- "typescript": "^6.0.3"
30
- },
31
- "scripts": {
32
- "build": "tsc -p tsconfig.build.json"
33
- }
34
- }
1
+ {
2
+ "name": "@pimolu/core",
3
+ "version": "0.1.0-beta.2",
4
+ "description": "Framework-agnostic Pimolu UI class variant utilities.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/pimoludev/ui.git",
9
+ "directory": "packages/core"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "type": "module",
15
+ "main": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.build.json",
22
+ "prepack": "pnpm build"
23
+ },
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "default": "./dist/index.js"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "devDependencies": {
33
+ "typescript": "^6.0.3"
34
+ }
35
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 pimoludev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.