@purr-react-styled-components/components.pre-adornment 0.0.7 → 0.0.9

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 CHANGED
@@ -1 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("clsx"),i=require("react"),d=require("styled-components"),m={Container:d.span.withConfig({displayName:"_style__Container",componentId:"sc-96m8qh-0"})(["display:flex;position:absolute;top:",";transform:translateY(-50%);left:",";"],({$hasLabel:e})=>e?"calc(50% + 6px)":"50%",({$adornmentVariant:e})=>e==="standard"?"0px":"14px")},a=i.memo(({className:e,children:n=null,variant:t="standard",hasLabel:r=!1,htmlAttributes:o})=>n?s.jsx(m.Container,{...o,$adornmentVariant:t,$hasLabel:r,className:l("pre-adornment",`pre-adornment--variant-${t}`,r&&"pre-adornment--hasLabel",e),children:n}):null);a.displayName="PreAdornment";exports.PreAdornment=a;
1
+ 'use strict';var p=require('clsx'),d=require('react'),m=require('styled-components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var p__default=/*#__PURE__*/_interopDefault(p);var d__default=/*#__PURE__*/_interopDefault(d);var m__default=/*#__PURE__*/_interopDefault(m);var e={Container:m__default.default.span`
2
+ display: flex;
3
+ position: absolute;
4
+ top: ${({$hasLabel:r})=>r?"calc(50% + 6px)":"50%"};
5
+ transform: translateY(-50%);
6
+ left: ${({$adornmentVariant:r})=>r==="standard"?"0px":"14px"};
7
+ `};var s=d.memo(({className:r,children:t=null,variant:n="standard",hasLabel:o=false,htmlAttributes:a})=>t?d__default.default.createElement(e.Container,{...a,$adornmentVariant:n,$hasLabel:o,className:p__default.default("pre-adornment",`pre-adornment--variant-${n}`,o&&"pre-adornment--hasLabel",r)},t):null);s.displayName="PreAdornment";exports.PreAdornment=s;
@@ -0,0 +1,15 @@
1
+ import React, { ReactNode, HTMLAttributes } from 'react';
2
+ import { IExtendable } from '@purr-core/utils.definitions';
3
+
4
+ type TPreAdornmentVariant = "outlined" | "filled" | "standard";
5
+ interface IPreAdornmentProps {
6
+ className?: string;
7
+ variant?: TPreAdornmentVariant;
8
+ children?: ReactNode;
9
+ hasLabel?: boolean;
10
+ htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
11
+ }
12
+
13
+ declare const PreAdornment: React.MemoExoticComponent<({ className, children, variant, hasLabel, htmlAttributes, }: IPreAdornmentProps) => React.JSX.Element | null>;
14
+
15
+ export { type IPreAdornmentProps, PreAdornment, type TPreAdornmentVariant };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,15 @@
1
- export * from './_components';
2
- export * from './_types';
1
+ import React, { ReactNode, HTMLAttributes } from 'react';
2
+ import { IExtendable } from '@purr-core/utils.definitions';
3
+
4
+ type TPreAdornmentVariant = "outlined" | "filled" | "standard";
5
+ interface IPreAdornmentProps {
6
+ className?: string;
7
+ variant?: TPreAdornmentVariant;
8
+ children?: ReactNode;
9
+ hasLabel?: boolean;
10
+ htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
11
+ }
12
+
13
+ declare const PreAdornment: React.MemoExoticComponent<({ className, children, variant, hasLabel, htmlAttributes, }: IPreAdornmentProps) => React.JSX.Element | null>;
14
+
15
+ export { type IPreAdornmentProps, PreAdornment, type TPreAdornmentVariant };
package/dist/index.js CHANGED
@@ -1,24 +1,7 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import m from "clsx";
3
- import { memo as s } from "react";
4
- import l from "styled-components";
5
- const p = {
6
- Container: l.span.withConfig({
7
- displayName: "_style__Container",
8
- componentId: "sc-96m8qh-0"
9
- })(["display:flex;position:absolute;top:", ";transform:translateY(-50%);left:", ";"], ({
10
- $hasLabel: n
11
- }) => n ? "calc(50% + 6px)" : "50%", ({
12
- $adornmentVariant: n
13
- }) => n === "standard" ? "0px" : "14px")
14
- }, d = s(({
15
- className: n,
16
- children: t = null,
17
- variant: r = "standard",
18
- hasLabel: e = !1,
19
- htmlAttributes: a
20
- }) => t ? /* @__PURE__ */ o(p.Container, { ...a, $adornmentVariant: r, $hasLabel: e, className: m("pre-adornment", `pre-adornment--variant-${r}`, e && "pre-adornment--hasLabel", n), children: t }) : null);
21
- d.displayName = "PreAdornment";
22
- export {
23
- d as PreAdornment
24
- };
1
+ import p from'clsx';import d,{memo}from'react';import m from'styled-components';var e={Container:m.span`
2
+ display: flex;
3
+ position: absolute;
4
+ top: ${({$hasLabel:r})=>r?"calc(50% + 6px)":"50%"};
5
+ transform: translateY(-50%);
6
+ left: ${({$adornmentVariant:r})=>r==="standard"?"0px":"14px"};
7
+ `};var s=memo(({className:r,children:t=null,variant:n="standard",hasLabel:o=false,htmlAttributes:a})=>t?d.createElement(e.Container,{...a,$adornmentVariant:n,$hasLabel:o,className:p("pre-adornment",`pre-adornment--variant-${n}`,o&&"pre-adornment--hasLabel",r)},t):null);s.displayName="PreAdornment";export{s as PreAdornment};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purr-react-styled-components/components.pre-adornment",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -25,7 +25,7 @@
25
25
  "react": "*",
26
26
  "styled-components": "*",
27
27
  "clsx": "*",
28
- "@purr-core/utils.definitions": "0.0.10"
28
+ "@purr-core/utils.definitions": "0.0.12"
29
29
  },
30
30
  "author": "@DinhThienPhuc",
31
31
  "license": "ISC",
@@ -34,6 +34,8 @@
34
34
  "scripts": {
35
35
  "dev": "vite build --watch",
36
36
  "build": "tsc && vite build",
37
+ "build:vite": "tsc && vite build",
38
+ "build:tsup": "tsup",
37
39
  "lint": "eslint . --ext ts,tsx --max-warnings 0"
38
40
  }
39
41
  }
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { IPreAdornmentProps } from './_types';
3
-
4
- export declare const PreAdornment: React.MemoExoticComponent<({ className, children, variant, hasLabel, htmlAttributes, }: IPreAdornmentProps) => React.JSX.Element | null>;
package/dist/_style.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { TPreAdornmentVariant } 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>, {
5
- $adornmentVariant: TPreAdornmentVariant;
6
- $hasLabel: boolean;
7
- }>> & string;
8
- };
package/dist/_types.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
2
- import { IExtendable } from '@purr-core/utils.definitions';
3
-
4
- export type TPreAdornmentVariant = "outlined" | "filled" | "standard";
5
- export interface IPreAdornmentProps {
6
- className?: string;
7
- variant?: TPreAdornmentVariant;
8
- children?: ReactNode;
9
- hasLabel?: boolean;
10
- htmlAttributes?: HTMLAttributes<HTMLSpanElement> & IExtendable;
11
- }