@jotnar_dev/core 0.0.3

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.
@@ -0,0 +1,16 @@
1
+ /* Button.module.css — usa las variables de tokens.css */
2
+ .button {
3
+ padding: var(--kamui-space-2) var(--kamui-space-4);
4
+ border-radius: var(--kamui-radius-md);
5
+ font-size: var(--kamui-font-size-md);
6
+ border: none;
7
+ cursor: pointer;
8
+ }
9
+ .primary {
10
+ background: var(--kamui-color-primary-500);
11
+ color: var(--kamui-color-white);
12
+ }
13
+ .secondary {
14
+ background: var(--kamui-color-gray-100);
15
+ color: var(--kamui-color-gray-900);
16
+ }
@@ -0,0 +1,25 @@
1
+ .input {
2
+ width: 100%;
3
+ padding: var(--kamui-space-2) var(--kamui-space-3);
4
+ font-size: var(--kamui-font-size-md);
5
+ color: var(--kamui-color-gray-900);
6
+ background-color: transparent;
7
+ border: 1px solid var(--kamui-color-gray-300);
8
+ border-radius: var(--kamui-radius-md);
9
+ outline: none;
10
+ transition:
11
+ border-color 0.2s ease,
12
+ box-shadow 0.2s ease;
13
+ }
14
+
15
+ .input:focus {
16
+ border-color: var(--kamui-color-primary-500);
17
+ box-shadow: 0 0 0 1px var(--kamui-color-primary-500);
18
+ }
19
+
20
+ .input:disabled {
21
+ background-color: var(--kamui-color-gray-100);
22
+ color: var(--kamui-color-gray-500);
23
+ border-color: var(--kamui-color-gray-300);
24
+ cursor: not-allowed;
25
+ }
@@ -0,0 +1,12 @@
1
+ import * as react from 'react';
2
+ import react__default, { ButtonHTMLAttributes, InputHTMLAttributes } from 'react';
3
+
4
+ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
5
+ variant?: 'primary' | 'secondary';
6
+ };
7
+ declare function Button({ variant, className, ...props }: ButtonProps): react.JSX.Element;
8
+
9
+ type InputProps = InputHTMLAttributes<HTMLInputElement>;
10
+ declare const Input: react__default.FC<InputProps>;
11
+
12
+ export { Button, Input };
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ // src/components/Button/Button.tsx
2
+ import styles from "./Button.module.css";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function Button({
5
+ variant = "primary",
6
+ className = "",
7
+ ...props
8
+ }) {
9
+ return /* @__PURE__ */ jsx(
10
+ "button",
11
+ {
12
+ className: `${styles.button} ${styles[variant]} ${className}`.trim(),
13
+ ...props
14
+ }
15
+ );
16
+ }
17
+
18
+ // src/components/Input/Input.tsx
19
+ import styles2 from "./Input.module.css";
20
+ import { jsx as jsx2 } from "react/jsx-runtime";
21
+ var Input = ({ className, ...props }) => {
22
+ return /* @__PURE__ */ jsx2("input", { className: `${styles2.input} ${className || ""}`.trim(), ...props });
23
+ };
24
+ export {
25
+ Button,
26
+ Input
27
+ };
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Button/Button.tsx","../src/components/Input/Input.tsx"],"sourcesContent":["import styles from './Button.module.css';\nimport type { ButtonHTMLAttributes } from 'react';\n\ntype ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n variant?: 'primary' | 'secondary';\n};\n\nexport function Button({\n variant = 'primary',\n className = '',\n ...props\n}: ButtonProps) {\n return (\n <button\n className={`${styles.button} ${styles[variant]} ${className}`.trim()}\n {...props}\n />\n );\n}\n","import React, { InputHTMLAttributes } from 'react';\nimport styles from './Input.module.css';\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement>;\n\nexport const Input: React.FC<InputProps> = ({ className, ...props }) => {\n return (\n <input className={`${styles.input} ${className || ''}`.trim()} {...props} />\n );\n};\n"],"mappings":";AAAA,OAAO,YAAY;AAaf;AANG,SAAS,OAAO;AAAA,EACrB,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,GAAG;AACL,GAAgB;AACd,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,CAAC,IAAI,SAAS,GAAG,KAAK;AAAA,MAClE,GAAG;AAAA;AAAA,EACN;AAEJ;;;ACjBA,OAAOA,aAAY;AAMf,gBAAAC,YAAA;AAFG,IAAM,QAA8B,CAAC,EAAE,WAAW,GAAG,MAAM,MAAM;AACtE,SACE,gBAAAA,KAAC,WAAM,WAAW,GAAGD,QAAO,KAAK,IAAI,aAAa,EAAE,GAAG,KAAK,GAAI,GAAG,OAAO;AAE9E;","names":["styles","jsx"]}
@@ -0,0 +1,27 @@
1
+ :root {
2
+ --kamui-color-white: #ffffff;
3
+ --kamui-color-gray-100: #f5f5f5;
4
+ --kamui-color-gray-300: #d4d4d4;
5
+ --kamui-color-gray-500: #737373;
6
+ --kamui-color-gray-700: #404040;
7
+ --kamui-color-gray-900: #171717;
8
+ --kamui-color-primary-100: #e0e7ff;
9
+ --kamui-color-primary-300: #a5b4fc;
10
+ --kamui-color-primary-500: #6366f1;
11
+ --kamui-color-primary-700: #4338ca;
12
+ --kamui-color-primary-900: #312e81;
13
+ --kamui-space-1: 4px;
14
+ --kamui-space-2: 8px;
15
+ --kamui-space-3: 12px;
16
+ --kamui-space-4: 16px;
17
+ --kamui-space-6: 24px;
18
+ --kamui-space-8: 32px;
19
+ --kamui-font-size-sm: 14px;
20
+ --kamui-font-size-md: 16px;
21
+ --kamui-font-size-lg: 20px;
22
+ --kamui-font-size-xl: 24px;
23
+ --kamui-radius-sm: 4px;
24
+ --kamui-radius-md: 8px;
25
+ --kamui-radius-lg: 16px;
26
+ --kamui-radius-full: 9999px;
27
+ }
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@jotnar_dev/core",
3
+ "version": "0.0.3",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./tokens.css": "./dist/tokens/tokens.css"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "scripts": {
21
+ "tokens:build": "tsx scripts/build-tokens.ts",
22
+ "build": "pnpm tokens:build && tsup && mkdir -p dist/tokens && cp src/components/*/*.module.css dist/ && cp src/tokens/tokens.css dist/tokens/",
23
+ "typecheck": "tsc --noEmit",
24
+ "lint": "eslint . && pnpm lint:css",
25
+ "lint:css": "pnpm tokens:build && stylelint 'src/**/*.module.css'"
26
+ },
27
+ "devDependencies": {
28
+ "@types/react": "^19.2.18",
29
+ "react": "^19.2.8",
30
+ "stylelint": "17.14.1",
31
+ "stylelint-declaration-strict-value": "1.12.1",
32
+ "stylelint-value-no-unknown-custom-properties": "6.1.1",
33
+ "tsup": "^8.5.1"
34
+ },
35
+ "peerDependencies": {
36
+ "react": ">=18"
37
+ }
38
+ }