@purr-react-tailwindcss/components.label 0.0.7 → 0.0.8
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/dist/index.cjs +1 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var m=require('clsx'),p=require('react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);var p__default=/*#__PURE__*/_interopDefault(p);var u=p.memo(({children:f="",required:s=false,disabled:t=false,hiddenLabel:x=false,isFocused:o=false,isError:e=false,variant:a="standard",isLabelCollapsed:l=false,htmlAttributes:r})=>x||!f?null:p__default.default.createElement("span",{className:m__default.default("transition-all","duration-200","ease-in-out","delay-100","absolute","top-1/2","transform","-translate-y-1/2",a==="standard"&&(l?"left-0 top-3 text-xs":"left-0 text-base"),a==="filled"&&(l?"left-3.5 top-3 text-xs":"left-3.5 text-base"),a==="outlined"&&(l?"left-3.5 top-3 text-xs":"left-3.5 text-base"),t&&"text-white/50",!t&&e&&"text-red-500",!t&&!e&&o&&"text-blue-300",!t&&!e&&!o&&"text-white","label"),...r},f," ",s?"*":""));u.displayName="Label";exports.Label=u;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
+
|
|
4
|
+
type TLabelVariant = "outlined" | "filled" | "standard";
|
|
5
|
+
interface ILabelProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
isFocused?: boolean;
|
|
10
|
+
hiddenLabel?: boolean;
|
|
11
|
+
variant?: TLabelVariant;
|
|
12
|
+
isLabelCollapsed?: boolean;
|
|
13
|
+
isError?: boolean;
|
|
14
|
+
htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const Label: React.MemoExoticComponent<({ children, required, disabled, hiddenLabel, isFocused, isError, variant, isLabelCollapsed, htmlAttributes, }: ILabelProps) => React.JSX.Element | null>;
|
|
18
|
+
|
|
19
|
+
export { type ILabelProps, Label, type TLabelVariant };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
+
|
|
4
|
+
type TLabelVariant = "outlined" | "filled" | "standard";
|
|
5
|
+
interface ILabelProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
isFocused?: boolean;
|
|
10
|
+
hiddenLabel?: boolean;
|
|
11
|
+
variant?: TLabelVariant;
|
|
12
|
+
isLabelCollapsed?: boolean;
|
|
13
|
+
isError?: boolean;
|
|
14
|
+
htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const Label: React.MemoExoticComponent<({ children, required, disabled, hiddenLabel, isFocused, isError, variant, isLabelCollapsed, htmlAttributes, }: ILabelProps) => React.JSX.Element | null>;
|
|
18
|
+
|
|
19
|
+
export { type ILabelProps, Label, type TLabelVariant };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m from'clsx';import p,{memo}from'react';var u=memo(({children:f="",required:s=false,disabled:t=false,hiddenLabel:x=false,isFocused:o=false,isError:e=false,variant:a="standard",isLabelCollapsed:l=false,htmlAttributes:r})=>x||!f?null:p.createElement("span",{className:m("transition-all","duration-200","ease-in-out","delay-100","absolute","top-1/2","transform","-translate-y-1/2",a==="standard"&&(l?"left-0 top-3 text-xs":"left-0 text-base"),a==="filled"&&(l?"left-3.5 top-3 text-xs":"left-3.5 text-base"),a==="outlined"&&(l?"left-3.5 top-3 text-xs":"left-3.5 text-base"),t&&"text-white/50",!t&&e&&"text-red-500",!t&&!e&&o&&"text-blue-300",!t&&!e&&!o&&"text-white","label"),...r},f," ",s?"*":""));u.displayName="Label";export{u as Label};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-tailwindcss/components.label",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"typescript": "*",
|
|
25
25
|
"react": "*",
|
|
26
26
|
"clsx": "*",
|
|
27
|
-
"@purr-core/utils.definitions": "0.0.
|
|
27
|
+
"@purr-core/utils.definitions": "0.0.12"
|
|
28
28
|
},
|
|
29
29
|
"author": "@DinhThienPhuc",
|
|
30
30
|
"license": "ISC",
|