@purr-react-tailwindcss/components.pre-adornment 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.
- package/dist/_components.d.ts +4 -0
- package/dist/_types.d.ts +15 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +34 -0
- package/package.json +38 -0
package/dist/_types.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
4
|
+
|
|
5
|
+
export type TPreAdornmentVariant = "standard" | "outlined" | "filled";
|
|
6
|
+
export interface IPreAdornmentClasses {
|
|
7
|
+
container?: ClassValue;
|
|
8
|
+
}
|
|
9
|
+
export interface IPreAdornmentProps {
|
|
10
|
+
classes?: IPreAdornmentClasses;
|
|
11
|
+
variant?: TPreAdornmentVariant;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
hasLabel?: boolean;
|
|
14
|
+
htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
15
|
+
}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("clsx"),d=require("react"),r=d.memo(({classes:e,children:t=null,variant:n="standard",hasLabel:o=!1,htmlAttributes:a})=>t?l.jsx("span",{className:u("flex","absolute","text-white","top-1/2","transform","-translate-y-1/2",n==="standard"?"left-0":"left-3.5","pre-adornment",e==null?void 0:e.container),style:o?{top:"calc(50% + 6px)"}:void 0,...a,children:t}):null);r.displayName="PreAdornment";exports.PreAdornment=r;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import a from "clsx";
|
|
3
|
+
import { memo as l } from "react";
|
|
4
|
+
const p = l(
|
|
5
|
+
({
|
|
6
|
+
classes: t,
|
|
7
|
+
children: r = null,
|
|
8
|
+
variant: o = "standard",
|
|
9
|
+
hasLabel: e = !1,
|
|
10
|
+
htmlAttributes: n
|
|
11
|
+
}) => r ? /* @__PURE__ */ m(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
className: a(
|
|
15
|
+
"flex",
|
|
16
|
+
"absolute",
|
|
17
|
+
"text-white",
|
|
18
|
+
"top-1/2",
|
|
19
|
+
"transform",
|
|
20
|
+
"-translate-y-1/2",
|
|
21
|
+
o === "standard" ? "left-0" : "left-3.5",
|
|
22
|
+
"pre-adornment",
|
|
23
|
+
t == null ? void 0 : t.container
|
|
24
|
+
),
|
|
25
|
+
style: e ? { top: "calc(50% + 6px)" } : void 0,
|
|
26
|
+
...n,
|
|
27
|
+
children: r
|
|
28
|
+
}
|
|
29
|
+
) : null
|
|
30
|
+
);
|
|
31
|
+
p.displayName = "PreAdornment";
|
|
32
|
+
export {
|
|
33
|
+
p as PreAdornment
|
|
34
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@purr-react-tailwindcss/components.pre-adornment",
|
|
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
|
+
}
|