@purr-react-styled-components/components.flex-box 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purr-react-styled-components/components.flex-box",
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",
@@ -26,8 +26,8 @@
26
26
  "styled-components": "*",
27
27
  "csstype": "*",
28
28
  "clsx": "*",
29
- "@purr-core/utils.definitions": "0.0.9",
30
- "@purr-core/utils.helpers": "0.0.9"
29
+ "@purr-core/utils.definitions": "0.0.11",
30
+ "@purr-core/utils.helpers": "0.0.11"
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
  }
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { IFlexBoxProps } from './_types';
3
-
4
- export declare const FlexBox: ({ children, className, flexDirection, alignItems, justifyContent, variant, gap, wrap, fullWidth, htmlAttributes, }: IFlexBoxProps) => React.JSX.Element;
package/dist/_style.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { IStyledFlexBoxProps } from './_types';
2
-
3
- export declare const Styled: {
4
- Div: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, IStyledFlexBoxProps>> & string;
5
- Span: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, IStyledFlexBoxProps>> & string;
6
- };
package/dist/_types.d.ts DELETED
@@ -1,24 +0,0 @@
1
- import { Property } from 'csstype';
2
- import { HTMLAttributes, JSX, ReactNode } from 'react';
3
- import { IExtendable } from '@purr-core/utils.definitions';
4
-
5
- export interface IFlexBoxProps {
6
- alignItems?: Property.AlignItems;
7
- justifyContent?: Property.JustifyContent;
8
- flexDirection?: Property.FlexDirection;
9
- variant?: keyof JSX.IntrinsicElements;
10
- gap?: Property.Gap;
11
- wrap?: Property.FlexWrap;
12
- fullWidth?: boolean;
13
- htmlAttributes?: HTMLAttributes<HTMLElement> & IExtendable;
14
- children?: ReactNode;
15
- className?: string;
16
- }
17
- export interface IStyledFlexBoxProps {
18
- $alignItems?: Property.AlignItems;
19
- $justifyContent?: Property.JustifyContent;
20
- $flexDirection?: Property.FlexDirection;
21
- $gap?: Property.Gap;
22
- $wrap?: Property.FlexWrap;
23
- $fullWidth?: boolean;
24
- }
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),y=require("clsx"),g=require("react"),$=require("@purr-core/utils.helpers"),i=require("styled-components"),c=({$alignItems:l,$justifyContent:n,$flexDirection:t,$gap:o,$wrap:s,$fullWidth:e})=>i.css(["display:flex;justify-content:",";align-items:",";flex-direction:",";gap:",";flex-wrap:",";width:",";"],n,l,t,o,s,e?"100%":"auto"),m={Div:i.div.withConfig({displayName:"_style__Div",componentId:"sc-1ds73kg-0"})(["",";"],c),Span:i.span.withConfig({displayName:"_style__Span",componentId:"sc-1ds73kg-1"})(["",";"],c)},b=({children:l,className:n,flexDirection:t="row",alignItems:o="center",justifyContent:s="center",variant:e="div",gap:r="0px",wrap:x="nowrap",fullWidth:a=!1,htmlAttributes:d})=>{const f=g.useMemo(()=>{const p=$.capitalize(e);return m[p]},[e]);return u.jsx(f,{...d,$flexDirection:t,$alignItems:o,$justifyContent:s,$gap:r,$wrap:x,$fullWidth:a,className:y("flex-box",`flex-box--direction-${t}`,`flex-box--alignItems-${o}`,`flex-box--justifyContent-${s}`,`flex-box--gap-${r}`,`flex-box--wrap-${x}`,`flex-box--variant-${e}`,n),children:l})};exports.FlexBox=b;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './_components';
2
- export * from './_types';
package/dist/index.js DELETED
@@ -1,42 +0,0 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import y from "clsx";
3
- import { useMemo as $ } from "react";
4
- import { capitalize as g } from "@purr-core/utils.helpers";
5
- import x, { css as u } from "styled-components";
6
- const f = ({
7
- $alignItems: l,
8
- $justifyContent: s,
9
- $flexDirection: o,
10
- $gap: t,
11
- $wrap: i,
12
- $fullWidth: e
13
- }) => u(["display:flex;justify-content:", ";align-items:", ";flex-direction:", ";gap:", ";flex-wrap:", ";width:", ";"], s, l, o, t, i, e ? "100%" : "auto"), b = {
14
- Div: x.div.withConfig({
15
- displayName: "_style__Div",
16
- componentId: "sc-1ds73kg-0"
17
- })(["", ";"], f),
18
- Span: x.span.withConfig({
19
- displayName: "_style__Span",
20
- componentId: "sc-1ds73kg-1"
21
- })(["", ";"], f)
22
- }, v = ({
23
- children: l,
24
- className: s,
25
- flexDirection: o = "row",
26
- alignItems: t = "center",
27
- justifyContent: i = "center",
28
- variant: e = "div",
29
- gap: n = "0px",
30
- wrap: r = "nowrap",
31
- fullWidth: p = !1,
32
- htmlAttributes: a
33
- }) => {
34
- const m = $(() => {
35
- const c = g(e);
36
- return b[c];
37
- }, [e]);
38
- return /* @__PURE__ */ d(m, { ...a, $flexDirection: o, $alignItems: t, $justifyContent: i, $gap: n, $wrap: r, $fullWidth: p, className: y("flex-box", `flex-box--direction-${o}`, `flex-box--alignItems-${t}`, `flex-box--justifyContent-${i}`, `flex-box--gap-${n}`, `flex-box--wrap-${r}`, `flex-box--variant-${e}`, s), children: l });
39
- };
40
- export {
41
- v as FlexBox
42
- };