@purr-react-tailwindcss/components.post-adornment 0.0.1 → 0.0.3

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.
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { IPostAdornmentProps } from './_types';
3
3
 
4
- export declare const PostAdornment: React.MemoExoticComponent<({ classes, children, variant, clearIcon, hasLabel, htmlAttributes, clear, }: IPostAdornmentProps) => React.JSX.Element | null>;
4
+ export declare const PostAdornment: React.MemoExoticComponent<({ children, variant, clearIcon, hasLabel, htmlAttributes, clear, }: IPostAdornmentProps) => React.JSX.Element | null>;
package/dist/_types.d.ts CHANGED
@@ -1,13 +1,8 @@
1
- import { ClassValue } from 'clsx';
2
1
  import { HTMLAttributes, ReactNode } from 'react';
3
2
  import { IExtendable } from '@purr-core/utils.definitions';
4
3
 
5
4
  export type TPostAdornmentVariant = "outlined" | "filled" | "standard";
6
- export interface IPostAdornmentClasses {
7
- container?: ClassValue;
8
- }
9
5
  export interface IPostAdornmentProps {
10
- classes?: IPostAdornmentClasses;
11
6
  variant?: TPostAdornmentVariant;
12
7
  children?: ReactNode;
13
8
  clearIcon?: ReactNode;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("clsx"),l=require("react"),p=require("@purr-react-tailwindcss/components.icon"),u=l.memo(({classes:t,children:o=null,variant:r="standard",clearIcon:m=null,hasLabel:e=!1,htmlAttributes:i,clear:a})=>a?n.jsx("button",{className:d("flex","absolute","text-white","top-1/2","transform","-translate-y-1/2","bg-transparent","outline-none","border-none",r==="standard"?"right-0":"right-3.5","post-adornment",t==null?void 0:t.container),style:e?{top:"calc(50% + 6px)"}:void 0,onClick:a,...i,children:m??n.jsx(p.Icon,{name:"x"})}):o?n.jsx("span",{className:d("flex","absolute","text-white","top-1/2","transform","-translate-y-1/2",r==="standard"?"right-0":"right-3.5","post-adornment",t==null?void 0:t.container),style:e?{top:"calc(50% + 6px)"}:void 0,...i,children:o}):null);u.displayName="PostAdornment";exports.PostAdornment=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("clsx"),c=require("react"),d=require("@purr-react-tailwindcss/components.icon"),l=c.memo(({children:e=null,variant:n="standard",clearIcon:i=null,hasLabel:o=!1,htmlAttributes:r,clear:s})=>s?t.jsx("button",{className:a("flex","absolute","text-white","top-1/2","transform","-translate-y-1/2","bg-transparent","outline-none","border-none",n==="standard"?"right-0":"right-3.5","post-adornment"),style:o?{top:"calc(50% + 6px)"}:void 0,onClick:s,...r,children:i??t.jsx(d.Icon,{name:"x"})}):e?t.jsx("span",{className:a("flex","absolute","text-white","top-1/2","transform","-translate-y-1/2",n==="standard"?"right-0":"right-3.5","post-adornment"),style:o?{top:"calc(50% + 6px)"}:void 0,...r,children:e}):null);l.displayName="PostAdornment";exports.PostAdornment=l;
package/dist/index.js CHANGED
@@ -1,20 +1,19 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import i from "clsx";
3
- import { memo as d } from "react";
4
- import { Icon as f } from "@purr-react-tailwindcss/components.icon";
5
- const l = d(
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import s from "clsx";
3
+ import { memo as m } from "react";
4
+ import { Icon as p } from "@purr-react-tailwindcss/components.icon";
5
+ const i = m(
6
6
  ({
7
- classes: t,
8
- children: n = null,
9
- variant: r = "standard",
10
- clearIcon: p = null,
11
- hasLabel: e = !1,
12
- htmlAttributes: m,
7
+ children: o = null,
8
+ variant: n = "standard",
9
+ clearIcon: l = null,
10
+ hasLabel: r = !1,
11
+ htmlAttributes: e,
13
12
  clear: a
14
- }) => a ? /* @__PURE__ */ o(
13
+ }) => a ? /* @__PURE__ */ t(
15
14
  "button",
16
15
  {
17
- className: i(
16
+ className: s(
18
17
  "flex",
19
18
  "absolute",
20
19
  "text-white",
@@ -24,36 +23,34 @@ const l = d(
24
23
  "bg-transparent",
25
24
  "outline-none",
26
25
  "border-none",
27
- r === "standard" ? "right-0" : "right-3.5",
28
- "post-adornment",
29
- t == null ? void 0 : t.container
26
+ n === "standard" ? "right-0" : "right-3.5",
27
+ "post-adornment"
30
28
  ),
31
- style: e ? { top: "calc(50% + 6px)" } : void 0,
29
+ style: r ? { top: "calc(50% + 6px)" } : void 0,
32
30
  onClick: a,
33
- ...m,
34
- children: p ?? /* @__PURE__ */ o(f, { name: "x" })
31
+ ...e,
32
+ children: l ?? /* @__PURE__ */ t(p, { name: "x" })
35
33
  }
36
- ) : n ? /* @__PURE__ */ o(
34
+ ) : o ? /* @__PURE__ */ t(
37
35
  "span",
38
36
  {
39
- className: i(
37
+ className: s(
40
38
  "flex",
41
39
  "absolute",
42
40
  "text-white",
43
41
  "top-1/2",
44
42
  "transform",
45
43
  "-translate-y-1/2",
46
- r === "standard" ? "right-0" : "right-3.5",
47
- "post-adornment",
48
- t == null ? void 0 : t.container
44
+ n === "standard" ? "right-0" : "right-3.5",
45
+ "post-adornment"
49
46
  ),
50
- style: e ? { top: "calc(50% + 6px)" } : void 0,
51
- ...m,
52
- children: n
47
+ style: r ? { top: "calc(50% + 6px)" } : void 0,
48
+ ...e,
49
+ children: o
53
50
  }
54
51
  ) : null
55
52
  );
56
- l.displayName = "PostAdornment";
53
+ i.displayName = "PostAdornment";
57
54
  export {
58
- l as PostAdornment
55
+ i as PostAdornment
59
56
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purr-react-tailwindcss/components.post-adornment",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -24,8 +24,8 @@
24
24
  "typescript": "*",
25
25
  "react": "*",
26
26
  "clsx": "*",
27
- "@purr-core/utils.definitions": "0.0.5",
28
- "@purr-react-tailwindcss/components.icon": "0.0.1"
27
+ "@purr-core/utils.definitions": "0.0.7",
28
+ "@purr-react-tailwindcss/components.icon": "0.0.3"
29
29
  },
30
30
  "author": "@DinhThienPhuc",
31
31
  "license": "ISC",