@johngarcia9110/invariant 0.1.0 → 0.1.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
@@ -25,9 +25,9 @@ Create or update your `postcss.config.js`:
25
25
  ```js
26
26
  export default {
27
27
  plugins: {
28
- '@tailwindcss/postcss': {}
29
- }
30
- }
28
+ '@tailwindcss/postcss': {},
29
+ },
30
+ };
31
31
  ```
32
32
 
33
33
  ### 3. Import Styles
@@ -35,14 +35,20 @@ export default {
35
35
  In your main CSS file:
36
36
 
37
37
  ```css
38
- @import "tailwindcss";
39
- @import "@johngarcia9110/invariant/style.css";
38
+ @import 'tailwindcss';
39
+ @import '@johngarcia9110/invariant/style.css';
40
40
  ```
41
41
 
42
42
  ## Usage
43
43
 
44
44
  ```tsx
45
- import { Button, Card, CardHeader, CardBody, Input } from '@johngarcia9110/invariant'
45
+ import {
46
+ Button,
47
+ Card,
48
+ CardHeader,
49
+ CardBody,
50
+ Input,
51
+ } from '@johngarcia9110/invariant';
46
52
 
47
53
  function App() {
48
54
  return (
@@ -58,7 +64,7 @@ function App() {
58
64
  </Button>
59
65
  </CardBody>
60
66
  </Card>
61
- )
67
+ );
62
68
  }
63
69
  ```
64
70
 
@@ -73,6 +79,7 @@ function App() {
73
79
  ```
74
80
 
75
81
  **Props:**
82
+
76
83
  - `variant`: `'primary'` | `'secondary'` | `'outline'` (default: `'primary'`)
77
84
  - `size`: `'sm'` | `'md'` | `'lg'` (default: `'md'`)
78
85
  - All standard button HTML attributes
@@ -103,6 +110,7 @@ function App() {
103
110
  ```
104
111
 
105
112
  **Props:**
113
+
106
114
  - `label`: Optional label text
107
115
  - `error`: Error message (shows red styling)
108
116
  - `helperText`: Helper text below input
@@ -153,7 +161,11 @@ The library includes built-in dark mode styles that automatically apply when the
153
161
  Types are included and exported from the package:
154
162
 
155
163
  ```tsx
156
- import type { ButtonProps, CardProps, InputProps } from '@johngarcia9110/invariant'
164
+ import type {
165
+ ButtonProps,
166
+ CardProps,
167
+ InputProps,
168
+ } from '@johngarcia9110/invariant';
157
169
  ```
158
170
 
159
171
  ## License
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAG7D,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAA;IAC7C,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CAC1B;AAcD,eAAO,MAAM,MAAM,2GAoBlB,CAAA"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAG9D,MAAM,WAAW,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IAC1E,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAeD,eAAO,MAAM,MAAM,2GA8BlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAGvD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAEpE,eAAO,MAAM,IAAI,sGAehB,CAAA;AAID,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAE1E,eAAO,MAAM,UAAU,4GAUtB,CAAA;AAID,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAExE,eAAO,MAAM,QAAQ,0GAUpB,CAAA;AAID,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAE1E,eAAO,MAAM,UAAU,4GAUtB,CAAA"}
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAGxD,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAEpE,eAAO,MAAM,IAAI,sGAehB,CAAC;AAIF,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAE1E,eAAO,MAAM,UAAU,4GAUtB,CAAC;AAIF,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAExE,eAAO,MAAM,QAAQ,0GAIpB,CAAC;AAIF,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAE1E,eAAO,MAAM,UAAU,4GAUtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,UAAU,EACV,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,UAAU,EACV,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,QAAQ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAG5D,MAAM,WAAW,UAAW,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,KAAK,yGA8CjB,CAAA"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAG7D,MAAM,WAAW,UAAW,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,KAAK,yGAkDjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAErB,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC"}
package/dist/invariant.js CHANGED
@@ -2283,7 +2283,14 @@ const Fe = {
2283
2283
  md: "px-4 py-2 text-base",
2284
2284
  lg: "px-6 py-3 text-lg"
2285
2285
  }, _e = G(
2286
- ({ className: e, variant: r = "primary", size: t = "md", disabled: o, children: a, ...s }, i) => /* @__PURE__ */ z(
2286
+ ({
2287
+ className: e,
2288
+ variant: r = "primary",
2289
+ size: t = "md",
2290
+ disabled: o,
2291
+ children: a,
2292
+ ...s
2293
+ }, i) => /* @__PURE__ */ z(
2287
2294
  "button",
2288
2295
  {
2289
2296
  ref: i,
@@ -2329,14 +2336,7 @@ const qe = G(
2329
2336
  );
2330
2337
  qe.displayName = "CardHeader";
2331
2338
  const He = G(
2332
- ({ className: e, ...r }, t) => /* @__PURE__ */ z(
2333
- "div",
2334
- {
2335
- ref: t,
2336
- className: I("px-6 py-4", e),
2337
- ...r
2338
- }
2339
- )
2339
+ ({ className: e, ...r }, t) => /* @__PURE__ */ z("div", { ref: t, className: I("px-6 py-4", e), ...r })
2340
2340
  );
2341
2341
  He.displayName = "CardBody";
2342
2342
  const Je = G(
@@ -1 +1 @@
1
- {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/utils/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johngarcia9110/invariant",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A reusable React component library with Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/invariant.cjs",
@@ -30,13 +30,16 @@
30
30
  "lint": "eslint . --ext ts,tsx",
31
31
  "prepublishOnly": "npm run build",
32
32
  "storybook": "storybook dev -p 6006",
33
- "build-storybook": "storybook build"
33
+ "build-storybook": "storybook build",
34
+ "format": "prettier --write .",
35
+ "format:check": "prettier --check ."
34
36
  },
35
37
  "peerDependencies": {
36
38
  "react": "^18.0.0 || ^19.0.0",
37
39
  "react-dom": "^18.0.0 || ^19.0.0"
38
40
  },
39
41
  "devDependencies": {
42
+ "@storybook/addon-docs": "^10.2.0",
40
43
  "@storybook/addon-onboarding": "^10.2.0",
41
44
  "@storybook/react": "^10.2.0",
42
45
  "@storybook/react-vite": "^10.2.0",
@@ -45,6 +48,7 @@
45
48
  "@types/react-dom": "^18.2.0",
46
49
  "@vitejs/plugin-react": "^4.2.0",
47
50
  "postcss": "^8.4.32",
51
+ "prettier": "^3.8.1",
48
52
  "react": "^18.2.0",
49
53
  "react-dom": "^18.2.0",
50
54
  "storybook": "^10.2.0",
@@ -52,8 +56,7 @@
52
56
  "tw-animate-css": "^1.0.0",
53
57
  "typescript": "^5.3.0",
54
58
  "vite": "^5.0.0",
55
- "vite-plugin-dts": "^3.7.0",
56
- "@storybook/addon-docs": "^10.2.0"
59
+ "vite-plugin-dts": "^3.7.0"
57
60
  },
58
61
  "dependencies": {
59
62
  "clsx": "^2.1.0",
@@ -1,4 +1,4 @@
1
1
  /** @type {import('tailwindcss').Config} */
2
2
  export default {
3
3
  content: ['./src/**/*.{js,ts,jsx,tsx}'],
4
- }
4
+ };