@purr-react-tailwindcss/components.helper-text 0.0.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.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { IHelperTextProps } from './_types';
3
+
4
+ export declare const HelperText: React.MemoExoticComponent<({ classes, children, variant, isError, hasLabel, htmlAttributes, }: IHelperTextProps) => React.JSX.Element | null>;
@@ -0,0 +1,16 @@
1
+ import { ClassValue } from 'clsx';
2
+ import { HTMLAttributes, ReactNode } from 'react';
3
+ import { IExtendable } from '@purr-core/utils.definitions';
4
+
5
+ export type THelperTextVariant = "outlined" | "filled" | "standard";
6
+ export interface IHelperTextClasses {
7
+ container?: ClassValue;
8
+ }
9
+ export interface IHelperTextProps {
10
+ classes?: IHelperTextClasses;
11
+ variant?: THelperTextVariant;
12
+ children?: ReactNode;
13
+ isError?: boolean;
14
+ hasLabel?: boolean;
15
+ htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
16
+ }
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("clsx"),x=require("react"),r=x.memo(({classes:e,children:t="",variant:n="standard",isError:l=!1,hasLabel:o=!1,htmlAttributes:a})=>t?i.jsx("span",{className:u("inline-block","absolute","text-xs",o?"top-12":"top-14",n==="standard"?"left-0":"left-3.5",l?"text-red-500":"text-gray-200","helper-text",e==null?void 0:e.container),...a,children:t}):null);r.displayName="HelperText";exports.HelperText=r;
@@ -0,0 +1,2 @@
1
+ export * from './_components';
2
+ export * from './_types';
package/dist/index.js ADDED
@@ -0,0 +1,33 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import m from "clsx";
3
+ import { memo as n } from "react";
4
+ const x = n(
5
+ ({
6
+ classes: t,
7
+ children: e = "",
8
+ variant: r = "standard",
9
+ isError: o = !1,
10
+ hasLabel: p = !1,
11
+ htmlAttributes: a
12
+ }) => e ? /* @__PURE__ */ l(
13
+ "span",
14
+ {
15
+ className: m(
16
+ "inline-block",
17
+ "absolute",
18
+ "text-xs",
19
+ p ? "top-12" : "top-14",
20
+ r === "standard" ? "left-0" : "left-3.5",
21
+ o ? "text-red-500" : "text-gray-200",
22
+ "helper-text",
23
+ t == null ? void 0 : t.container
24
+ ),
25
+ ...a,
26
+ children: e
27
+ }
28
+ ) : null
29
+ );
30
+ x.displayName = "HelperText";
31
+ export {
32
+ x as HelperText
33
+ };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@purr-react-tailwindcss/components.helper-text",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.cjs"
17
+ }
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "peerDependencies": {
24
+ "typescript": "*",
25
+ "react": "*",
26
+ "clsx": "*",
27
+ "@purr-core/utils.definitions": "0.0.5"
28
+ },
29
+ "author": "@DinhThienPhuc",
30
+ "license": "ISC",
31
+ "description": "",
32
+ "sideEffects": false,
33
+ "scripts": {
34
+ "dev": "vite build --watch",
35
+ "build": "tsc && vite build",
36
+ "lint": "eslint . --ext ts,tsx --max-warnings 0"
37
+ }
38
+ }