@purr-react-tailwindcss/components.label 0.0.5 → 0.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purr-react-tailwindcss/components.label",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
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.9"
27
+ "@purr-core/utils.definitions": "0.0.11"
28
28
  },
29
29
  "author": "@DinhThienPhuc",
30
30
  "license": "ISC",
@@ -33,6 +33,8 @@
33
33
  "scripts": {
34
34
  "dev": "vite build --watch",
35
35
  "build": "tsc && vite build",
36
+ "build:vite": "tsc && vite build",
37
+ "build:tsup": "tsup",
36
38
  "lint": "eslint . --ext ts,tsx --max-warnings 0"
37
39
  }
38
40
  }
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { ILabelProps } from './_types';
3
-
4
- export declare const Label: React.MemoExoticComponent<({ children, required, disabled, hiddenLabel, isFocused, isError, variant, isLabelCollapsed, htmlAttributes, }: ILabelProps) => React.JSX.Element | null>;
package/dist/_types.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
2
- import { IExtendable } from '@purr-core/utils.definitions';
3
-
4
- export type TLabelVariant = "outlined" | "filled" | "standard";
5
- export 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
- }
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),c=require("clsx"),i=require("react"),f=i.memo(({children:s="",required:x=!1,disabled:t=!1,hiddenLabel:r=!1,isFocused:n=!1,isError:e=!1,variant:l="standard",isLabelCollapsed:a=!1,htmlAttributes:o})=>r||!s?null:u.jsxs("span",{className:c("transition-all","duration-200","ease-in-out","delay-100","absolute","top-1/2","transform","-translate-y-1/2",l==="standard"&&(a?"left-0 top-3 text-xs":"left-0 text-base"),l==="filled"&&(a?"left-3.5 top-3 text-xs":"left-3.5 text-base"),l==="outlined"&&(a?"left-3.5 top-3 text-xs":"left-3.5 text-base"),t&&"text-white/50",!t&&e&&"text-red-500",!t&&!e&&n&&"text-blue-300",!t&&!e&&!n&&"text-white","label"),...o,children:[s," ",x?"*":""]}));f.displayName="Label";exports.Label=f;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './_components';
2
- export * from './_types';
package/dist/index.js DELETED
@@ -1,48 +0,0 @@
1
- import { jsxs as m } from "react/jsx-runtime";
2
- import r from "clsx";
3
- import { memo as p } from "react";
4
- const u = p(
5
- ({
6
- children: f = "",
7
- required: x = !1,
8
- disabled: t = !1,
9
- hiddenLabel: o = !1,
10
- isFocused: s = !1,
11
- isError: e = !1,
12
- variant: l = "standard",
13
- isLabelCollapsed: a = !1,
14
- htmlAttributes: n
15
- }) => o || !f ? null : /* @__PURE__ */ m(
16
- "span",
17
- {
18
- className: r(
19
- "transition-all",
20
- "duration-200",
21
- "ease-in-out",
22
- "delay-100",
23
- "absolute",
24
- "top-1/2",
25
- "transform",
26
- "-translate-y-1/2",
27
- l === "standard" && (a ? "left-0 top-3 text-xs" : "left-0 text-base"),
28
- l === "filled" && (a ? "left-3.5 top-3 text-xs" : "left-3.5 text-base"),
29
- l === "outlined" && (a ? "left-3.5 top-3 text-xs" : "left-3.5 text-base"),
30
- t && "text-white/50",
31
- !t && e && "text-red-500",
32
- !t && !e && s && "text-blue-300",
33
- !t && !e && !s && "text-white",
34
- "label"
35
- ),
36
- ...n,
37
- children: [
38
- f,
39
- " ",
40
- x ? "*" : ""
41
- ]
42
- }
43
- )
44
- );
45
- u.displayName = "Label";
46
- export {
47
- u as Label
48
- };