@purr-react-styled-components/components.divider 0.0.3 → 0.0.5

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,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),c=require("clsx"),r=require("styled-components"),u=({$width:e="100%"})=>r.css(["width:",";"],typeof e=="number"?`${e}px`:e),y=({$height:e=1})=>r.css(["height:",";"],typeof e=="number"?`${e}px`:e),l=({$borderRadius:e=0})=>r.css(["border-radius:",";"],typeof e=="number"?`${e}px`:e),a=({$color:e="inherit"})=>r.css(["background-color:",";"],e),p={Container:r.div.withConfig({displayName:"_style__Container",componentId:"sc-1p7mpoe-0"})(["",";",";",";",";"],u,y,l,a)},f=({width:e="100%",height:i=1,className:o,borderRadius:t=0,htmlAttributes:n,color:s="inherit"})=>d.jsx(p.Container,{...n,$color:s,$width:e,$height:i,$borderRadius:t,className:c("divider",`divider__width--${e}`,`divider__height--${i}`,`divider__borderRadius--${t}`,o)});exports.Divider=f;
1
+ 'use strict';var v=require('clsx'),c=require('react'),s=require('styled-components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var v__default=/*#__PURE__*/_interopDefault(v);var c__default=/*#__PURE__*/_interopDefault(c);var s__default=/*#__PURE__*/_interopDefault(s);var m=({$width:r="100%"})=>s.css`
2
+ width: ${typeof r=="number"?`${r}px`:r};
3
+ `,y=({$height:r=1})=>s.css`
4
+ height: ${typeof r=="number"?`${r}px`:r};
5
+ `,f=({$borderRadius:r=0})=>s.css`
6
+ border-radius: ${typeof r=="number"?`${r}px`:r};
7
+ `,l=({$color:r="inherit"})=>s.css`
8
+ background-color: ${r};
9
+ `,t={Container:s__default.default.div`
10
+ ${m};
11
+ ${y};
12
+ ${f};
13
+ ${l};
14
+ `};var P=({width:r="100%",height:i=1,className:d,borderRadius:e=0,htmlAttributes:p,color:n="inherit"})=>c__default.default.createElement(t.Container,{...p,$color:n,$width:r,$height:i,$borderRadius:e,className:v__default.default("divider",`divider__width--${r}`,`divider__height--${i}`,`divider__borderRadius--${e}`,d)});exports.Divider=P;
@@ -1,7 +1,7 @@
1
- import { HTMLAttributes } from 'react';
1
+ import React, { HTMLAttributes } from 'react';
2
2
  import { IExtendable } from '@purr-core/utils.definitions';
3
3
 
4
- export interface IDividerProps extends HTMLAttributes<HTMLElement> {
4
+ interface IDividerProps extends HTMLAttributes<HTMLElement> {
5
5
  className?: string;
6
6
  width?: number | string;
7
7
  height?: number | string;
@@ -9,9 +9,13 @@ export interface IDividerProps extends HTMLAttributes<HTMLElement> {
9
9
  borderRadius?: number | string;
10
10
  htmlAttributes?: HTMLAttributes<HTMLElement> & IExtendable;
11
11
  }
12
- export interface IStyledDividerProps extends HTMLAttributes<HTMLElement>, IExtendable {
12
+ interface IStyledDividerProps extends HTMLAttributes<HTMLElement>, IExtendable {
13
13
  $width?: number | string;
14
14
  $height?: number | string;
15
15
  $borderRadius?: number | string;
16
16
  $color?: string;
17
17
  }
18
+
19
+ declare const Divider: ({ width, height, className, borderRadius, htmlAttributes, color, }: IDividerProps) => React.JSX.Element;
20
+
21
+ export { Divider, type IDividerProps, type IStyledDividerProps };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,21 @@
1
- export * from './_components';
2
- export * from './_types';
1
+ import React, { HTMLAttributes } from 'react';
2
+ import { IExtendable } from '@purr-core/utils.definitions';
3
+
4
+ interface IDividerProps extends HTMLAttributes<HTMLElement> {
5
+ className?: string;
6
+ width?: number | string;
7
+ height?: number | string;
8
+ color?: string;
9
+ borderRadius?: number | string;
10
+ htmlAttributes?: HTMLAttributes<HTMLElement> & IExtendable;
11
+ }
12
+ interface IStyledDividerProps extends HTMLAttributes<HTMLElement>, IExtendable {
13
+ $width?: number | string;
14
+ $height?: number | string;
15
+ $borderRadius?: number | string;
16
+ $color?: string;
17
+ }
18
+
19
+ declare const Divider: ({ width, height, className, borderRadius, htmlAttributes, color, }: IDividerProps) => React.JSX.Element;
20
+
21
+ export { Divider, type IDividerProps, type IStyledDividerProps };
package/dist/index.js CHANGED
@@ -1,27 +1,14 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import c from "clsx";
3
- import p, { css as o } from "styled-components";
4
- const m = ({
5
- $width: r = "100%"
6
- }) => o(["width:", ";"], typeof r == "number" ? `${r}px` : r), f = ({
7
- $height: r = 1
8
- }) => o(["height:", ";"], typeof r == "number" ? `${r}px` : r), y = ({
9
- $borderRadius: r = 0
10
- }) => o(["border-radius:", ";"], typeof r == "number" ? `${r}px` : r), u = ({
11
- $color: r = "inherit"
12
- }) => o(["background-color:", ";"], r), a = {
13
- Container: p.div.withConfig({
14
- displayName: "_style__Container",
15
- componentId: "sc-1p7mpoe-0"
16
- })(["", ";", ";", ";", ";"], m, f, y, u)
17
- }, v = ({
18
- width: r = "100%",
19
- height: e = 1,
20
- className: t,
21
- borderRadius: i = 0,
22
- htmlAttributes: n,
23
- color: d = "inherit"
24
- }) => /* @__PURE__ */ s(a.Container, { ...n, $color: d, $width: r, $height: e, $borderRadius: i, className: c("divider", `divider__width--${r}`, `divider__height--${e}`, `divider__borderRadius--${i}`, t) });
25
- export {
26
- v as Divider
27
- };
1
+ import v from'clsx';import c from'react';import s,{css}from'styled-components';var m=({$width:r="100%"})=>css`
2
+ width: ${typeof r=="number"?`${r}px`:r};
3
+ `,y=({$height:r=1})=>css`
4
+ height: ${typeof r=="number"?`${r}px`:r};
5
+ `,f=({$borderRadius:r=0})=>css`
6
+ border-radius: ${typeof r=="number"?`${r}px`:r};
7
+ `,l=({$color:r="inherit"})=>css`
8
+ background-color: ${r};
9
+ `,t={Container:s.div`
10
+ ${m};
11
+ ${y};
12
+ ${f};
13
+ ${l};
14
+ `};var P=({width:r="100%",height:i=1,className:d,borderRadius:e=0,htmlAttributes:p,color:n="inherit"})=>c.createElement(t.Container,{...p,$color:n,$width:r,$height:i,$borderRadius:e,className:v("divider",`divider__width--${r}`,`divider__height--${i}`,`divider__borderRadius--${e}`,d)});export{P as Divider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purr-react-styled-components/components.divider",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
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 { IDividerProps } from './_types';
3
-
4
- export declare const Divider: ({ width, height, className, borderRadius, htmlAttributes, color, }: IDividerProps) => React.JSX.Element;
package/dist/_style.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { IStyledDividerProps } 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<HTMLDivElement>, HTMLDivElement>, IStyledDividerProps>> & string;
5
- };