@purr-react-styled-components/components.post-adornment 0.0.6 → 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/package.json +6 -4
- package/dist/_components.d.ts +0 -4
- package/dist/_style.d.ts +0 -6
- package/dist/_types.d.ts +0 -17
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-styled-components/components.post-adornment",
|
|
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",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"react": "*",
|
|
26
26
|
"styled-components": "*",
|
|
27
27
|
"clsx": "*",
|
|
28
|
-
"@purr-core/utils.definitions": "0.0.
|
|
29
|
-
"@purr-react-styled-components/utils.helpers": "0.0.
|
|
30
|
-
"@purr-react-styled-components/components.icon": "0.0.
|
|
28
|
+
"@purr-core/utils.definitions": "0.0.11",
|
|
29
|
+
"@purr-react-styled-components/utils.helpers": "0.0.7",
|
|
30
|
+
"@purr-react-styled-components/components.icon": "0.0.8"
|
|
31
31
|
},
|
|
32
32
|
"author": "@DinhThienPhuc",
|
|
33
33
|
"license": "ISC",
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"dev": "vite build --watch",
|
|
38
38
|
"build": "tsc && vite build",
|
|
39
|
+
"build:vite": "tsc && vite build",
|
|
40
|
+
"build:tsup": "tsup",
|
|
39
41
|
"lint": "eslint . --ext ts,tsx --max-warnings 0"
|
|
40
42
|
}
|
|
41
43
|
}
|
package/dist/_components.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { IPostAdornmentProps } from './_types';
|
|
3
|
-
|
|
4
|
-
export declare const PostAdornment: React.MemoExoticComponent<({ className, children, variant, clearIcon, hasLabel, htmlAttributes, clear, }: IPostAdornmentProps) => React.JSX.Element | null>;
|
package/dist/_style.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IStyledContainerProps } from './_types';
|
|
2
|
-
|
|
3
|
-
export declare const Styled: {
|
|
4
|
-
Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IStyledContainerProps>> & string;
|
|
5
|
-
ButtonContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, IStyledContainerProps>> & string;
|
|
6
|
-
};
|
package/dist/_types.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
-
|
|
4
|
-
export type TPostAdornmentVariant = "outlined" | "filled" | "standard";
|
|
5
|
-
export interface IPostAdornmentProps {
|
|
6
|
-
className?: string;
|
|
7
|
-
variant?: TPostAdornmentVariant;
|
|
8
|
-
children?: ReactNode;
|
|
9
|
-
clearIcon?: ReactNode;
|
|
10
|
-
hasLabel?: boolean;
|
|
11
|
-
htmlAttributes?: HTMLAttributes<HTMLSpanElement & HTMLButtonElement> & IExtendable;
|
|
12
|
-
clear?: () => void;
|
|
13
|
-
}
|
|
14
|
-
export interface IStyledContainerProps {
|
|
15
|
-
$adornmentVariant: TPostAdornmentVariant;
|
|
16
|
-
$hasLabel: boolean;
|
|
17
|
-
}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var y=Object.create;var c=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var _=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!h.call(n,o)&&o!==e&&c(n,o,{get:()=>t[o],enumerable:!(r=x(t,o))||r.enumerable});return n};var g=(n,t,e)=>(e=n!=null?y(b(n)):{},_(t||!n||!n.__esModule?c(e,"default",{value:n,enumerable:!0}):e,n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("clsx"),u=require("react"),a=require("styled-components"),q=require("@purr-react-styled-components/utils.helpers"),d=n=>a.css(["display:flex;position:absolute;transform:translateY(-50%);color:#ffffff;top:",";right:",";"],n.$hasLabel?"calc(50% + 6px)":"50%",n.$adornmentVariant==="standard"?"0px":"14px"),m={Container:a.span.withConfig({displayName:"_style__Container",componentId:"sc-1nzmnwy-0"})(["",";"],d),ButtonContainer:a.button.withConfig({displayName:"_style__ButtonContainer",componentId:"sc-1nzmnwy-1"})(["",";",";"],q.getInvisibleButton,d)},I=u.lazy(()=>import("@purr-react-styled-components/components.icon").then(n=>({default:n.Icon}))),p=u.memo(({className:n,children:t=null,variant:e="standard",clearIcon:r=null,hasLabel:o=!1,htmlAttributes:f,clear:i})=>{const l={...f,$adornmentVariant:e,$hasLabel:o,className:j("post-adornment",`post-adornment--variant-${e}`,o&&"post-adornment--hasLabel",n)};return i?s.jsx(m.ButtonContainer,{...l,onClick:i,children:r??s.jsx(I,{name:"x"})}):t?s.jsx(m.Container,{...l,children:t}):null});p.displayName="PostAdornment";exports.PostAdornment=p;
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import f from "clsx";
|
|
3
|
-
import { lazy as c, memo as u } from "react";
|
|
4
|
-
import i, { css as y } from "styled-components";
|
|
5
|
-
import { getInvisibleButton as C } from "@purr-react-styled-components/utils.helpers";
|
|
6
|
-
const m = (n) => y(["display:flex;position:absolute;transform:translateY(-50%);color:#ffffff;top:", ";right:", ";"], n.$hasLabel ? "calc(50% + 6px)" : "50%", n.$adornmentVariant === "standard" ? "0px" : "14px"), l = {
|
|
7
|
-
Container: i.span.withConfig({
|
|
8
|
-
displayName: "_style__Container",
|
|
9
|
-
componentId: "sc-1nzmnwy-0"
|
|
10
|
-
})(["", ";"], m),
|
|
11
|
-
ButtonContainer: i.button.withConfig({
|
|
12
|
-
displayName: "_style__ButtonContainer",
|
|
13
|
-
componentId: "sc-1nzmnwy-1"
|
|
14
|
-
})(["", ";", ";"], C, m)
|
|
15
|
-
}, x = c(() => import("@purr-react-styled-components/components.icon").then((n) => ({
|
|
16
|
-
default: n.Icon
|
|
17
|
-
}))), h = u(({
|
|
18
|
-
className: n,
|
|
19
|
-
children: o = null,
|
|
20
|
-
variant: a = "standard",
|
|
21
|
-
clearIcon: d = null,
|
|
22
|
-
hasLabel: r = !1,
|
|
23
|
-
htmlAttributes: p,
|
|
24
|
-
clear: e
|
|
25
|
-
}) => {
|
|
26
|
-
const s = {
|
|
27
|
-
...p,
|
|
28
|
-
$adornmentVariant: a,
|
|
29
|
-
$hasLabel: r,
|
|
30
|
-
className: f("post-adornment", `post-adornment--variant-${a}`, r && "post-adornment--hasLabel", n)
|
|
31
|
-
};
|
|
32
|
-
return e ? /* @__PURE__ */ t(l.ButtonContainer, { ...s, onClick: e, children: d ?? /* @__PURE__ */ t(x, { name: "x" }) }) : o ? /* @__PURE__ */ t(l.Container, { ...s, children: o }) : null;
|
|
33
|
-
});
|
|
34
|
-
h.displayName = "PostAdornment";
|
|
35
|
-
export {
|
|
36
|
-
h as PostAdornment
|
|
37
|
-
};
|