arf-react-components-npm-package 1.0.2 → 1.0.4

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,6 @@
1
+ export interface ProductButtonsProps {
2
+ className?: string;
3
+ style?: React.CSSProperties;
4
+ }
5
+ export declare const ProductButtons: ({ className, style }: ProductButtonsProps) => import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=ProductButtons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductButtons.d.ts","sourceRoot":"","sources":["../../src/components/ProductButtons.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,mBAAmB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,cAAc,GAAI,sBAAsB,mBAAmB,4CAwBvE,CAAA"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { type InitialValues, type onChangeArgs, type Product, type ProductCardHandlers, type ProductContextProps } from "../interfaces/interfaces";
3
+ export declare const ProductContext: React.Context<ProductContextProps>;
4
+ export interface ProductCardProps {
5
+ product: Product;
6
+ children: (args: ProductCardHandlers) => React.JSX.Element;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ onChange?: (args: onChangeArgs) => void;
10
+ value?: number;
11
+ initialValues?: InitialValues;
12
+ }
13
+ export declare const ProductCard: ({ product, children, className, style, onChange, value, initialValues }: ProductCardProps) => import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=ProductCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductCard.d.ts","sourceRoot":"","sources":["../../src/components/ProductCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEnJ,eAAO,MAAM,cAAc,oCAA2C,CAAA;AAGtE,MAAM,WAAW,gBAAgB;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAE,IAAI,EAAE,mBAAmB,KAAM,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAE7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAE,IAAI,EAAE,YAAY,KAAM,IAAI,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,aAAa,CAAA;CAChC;AAED,eAAO,MAAM,WAAW,GAAI,yEAAyE,gBAAgB,4CA2BpH,CAAA"}
@@ -0,0 +1,7 @@
1
+ export interface ProductImageProps {
2
+ className?: string;
3
+ img?: string;
4
+ style?: React.CSSProperties;
5
+ }
6
+ export declare const ProductImage: ({ img, className, style }: ProductImageProps) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=ProductImage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductImage.d.ts","sourceRoot":"","sources":["../../src/components/ProductImage.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,GAAI,2BAA2B,iBAAiB,4CAsBxE,CAAA"}
@@ -0,0 +1,7 @@
1
+ export interface ProductTitleProps {
2
+ className?: string;
3
+ title?: string;
4
+ style?: React.CSSProperties;
5
+ }
6
+ export declare const ProductTitle: ({ title, className, style }: ProductTitleProps) => import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=ProductTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductTitle.d.ts","sourceRoot":"","sources":["../../src/components/ProductTitle.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,GAAI,6BAA6B,iBAAiB,4CAY1E,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ProductCardHOCProps } from "../interfaces/interfaces";
2
+ export { ProductButtons } from "./ProductButtons";
3
+ export { ProductImage } from "./ProductImage";
4
+ export { ProductTitle } from "./ProductTitle";
5
+ export declare const ProductCard: ProductCardHOCProps;
6
+ export default ProductCard;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAO,MAAM,WAAW,EAAE,mBAIvB,CAAA;AAEH,eAAe,WAAW,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { InitialValues, onChangeArgs, Product } from "../interfaces/interfaces";
2
+ interface useProductArgs {
3
+ product: Product;
4
+ onChange?: (args: onChangeArgs) => void;
5
+ value?: number;
6
+ initialValues?: InitialValues;
7
+ }
8
+ export declare const useProduct: ({ onChange, product, value, initialValues }: useProductArgs) => {
9
+ increaseBy: (value: number) => void;
10
+ counter: number;
11
+ reset: () => void;
12
+ isMaxCountReached: boolean;
13
+ maxCount: number | undefined;
14
+ };
15
+ export {};
16
+ //# sourceMappingURL=useProduct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useProduct.d.ts","sourceRoot":"","sources":["../../src/hooks/useProduct.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAErF,UAAU,cAAc;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,aAAa,CAAA;CAChC;AAED,eAAO,MAAM,UAAU,GAAI,6CAAiD,cAAc;wBAM3D,MAAM;;;;;CAgCpC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export {}
1
+ export * from "./components";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,42 @@
1
+ import React from 'react';
2
+ import type { ProductCardProps } from '../components/ProductCard';
3
+ import type { ProductTitleProps } from '../components/ProductTitle';
4
+ import type { ProductImageProps } from '../components/ProductImage';
5
+ import type { ProductButtonsProps } from '../components/ProductButtons';
6
+ export interface Product {
7
+ id: string;
8
+ img?: string;
9
+ title: string;
10
+ }
11
+ export interface ProductContextProps {
12
+ counter: number;
13
+ product: Product;
14
+ increaseBy: (value: number) => void;
15
+ maxCount?: number;
16
+ }
17
+ export interface ProductCardHOCProps {
18
+ ({ product, children }: ProductCardProps): React.JSX.Element;
19
+ Title: (Props: ProductTitleProps) => React.JSX.Element;
20
+ Image: (Props: ProductImageProps) => React.JSX.Element;
21
+ Buttons: (Props: ProductButtonsProps) => React.JSX.Element;
22
+ }
23
+ export interface onChangeArgs {
24
+ product: Product;
25
+ count: number;
26
+ }
27
+ export interface ProductInCart extends Product {
28
+ count: number;
29
+ }
30
+ export interface InitialValues {
31
+ count?: number;
32
+ maxCount?: number;
33
+ }
34
+ export interface ProductCardHandlers {
35
+ count: number;
36
+ isMaxCountReached: boolean;
37
+ maxCount?: number;
38
+ product: Product;
39
+ increaseBy: (value: number) => void;
40
+ reset: () => void;
41
+ }
42
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/interfaces/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,WAAW,OAAO;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAChC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAC7D,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACvD,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IACvD,OAAO,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;CAC9D;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,OAAO;IAC1C,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,KAAK,EAAE,MAAM,IAAI,CAAC;CACrB"}
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "arf-react-components-npm-package",
3
3
  "private": false,
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "type": "module",
6
6
  "main": "./dist/arf-product-card.umd.js",
7
7
  "module": "./dist/arf-product-card.es.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/index.d.ts",
11
12
  "import": "./dist/arf-product-card.es.js",
12
- "require": "./dist/arf-product-card.umd.js",
13
- "types": "./dist/index.d.ts"
13
+ "require": "./dist/arf-product-card.umd.js"
14
14
  }
15
15
  },
16
16
  "repository": {
@@ -22,7 +22,7 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "dev": "vite",
25
- "build": "tsc -b && vite build",
25
+ "build": "vite build && tsc -p tsconfig.build.json",
26
26
  "lint": "eslint .",
27
27
  "preview": "vite preview",
28
28
  "test": "vitest",