@purr-react-styled-components/components.flex-box 0.0.8 → 0.0.10
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 +13 -1
- package/dist/{_types.d.ts → index.d.cts} +7 -3
- package/dist/index.d.ts +28 -2
- package/dist/index.js +13 -42
- package/package.json +5 -3
- package/dist/_components.d.ts +0 -4
- package/dist/_style.d.ts +0 -6
package/dist/index.cjs
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';var c=require('clsx'),S=require('react'),utils_helpers=require('@purr-core/utils.helpers'),f=require('styled-components');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var c__default=/*#__PURE__*/_interopDefault(c);var S__default=/*#__PURE__*/_interopDefault(S);var f__default=/*#__PURE__*/_interopDefault(f);var i=({$alignItems:x,$justifyContent:l,$flexDirection:e,$gap:t,$wrap:r,$fullWidth:o})=>f.css`
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: ${l};
|
|
4
|
+
align-items: ${x};
|
|
5
|
+
flex-direction: ${e};
|
|
6
|
+
gap: ${t};
|
|
7
|
+
flex-wrap: ${r};
|
|
8
|
+
width: ${o?"100%":"auto"};
|
|
9
|
+
`,m={Div:f__default.default.div`
|
|
10
|
+
${i};
|
|
11
|
+
`,Span:f__default.default.span`
|
|
12
|
+
${i};
|
|
13
|
+
`};var T=({children:x,className:l,flexDirection:e="row",alignItems:t="center",justifyContent:r="center",variant:o="div",gap:p="0px",wrap:s="nowrap",fullWidth:n=false,htmlAttributes:$})=>{let d=S.useMemo(()=>{let a=utils_helpers.capitalize(o);return m[a]},[o]);return S__default.default.createElement(d,{...$,$flexDirection:e,$alignItems:t,$justifyContent:r,$gap:p,$wrap:s,$fullWidth:n,className:c__default.default("flex-box",`flex-box--direction-${e}`,`flex-box--alignItems-${t}`,`flex-box--justifyContent-${r}`,`flex-box--gap-${p}`,`flex-box--wrap-${s}`,`flex-box--variant-${o}`,l)},x)};exports.FlexBox=T;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import React, { JSX, HTMLAttributes, ReactNode } from 'react';
|
|
1
2
|
import { Property } from 'csstype';
|
|
2
|
-
import { HTMLAttributes, JSX, ReactNode } from 'react';
|
|
3
3
|
import { IExtendable } from '@purr-core/utils.definitions';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface IFlexBoxProps {
|
|
6
6
|
alignItems?: Property.AlignItems;
|
|
7
7
|
justifyContent?: Property.JustifyContent;
|
|
8
8
|
flexDirection?: Property.FlexDirection;
|
|
@@ -14,7 +14,7 @@ export interface IFlexBoxProps {
|
|
|
14
14
|
children?: ReactNode;
|
|
15
15
|
className?: string;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
interface IStyledFlexBoxProps {
|
|
18
18
|
$alignItems?: Property.AlignItems;
|
|
19
19
|
$justifyContent?: Property.JustifyContent;
|
|
20
20
|
$flexDirection?: Property.FlexDirection;
|
|
@@ -22,3 +22,7 @@ export interface IStyledFlexBoxProps {
|
|
|
22
22
|
$wrap?: Property.FlexWrap;
|
|
23
23
|
$fullWidth?: boolean;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
declare const FlexBox: ({ children, className, flexDirection, alignItems, justifyContent, variant, gap, wrap, fullWidth, htmlAttributes, }: IFlexBoxProps) => React.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { FlexBox, type IFlexBoxProps, type IStyledFlexBoxProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React, { JSX, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { Property } from 'csstype';
|
|
3
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
4
|
+
|
|
5
|
+
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
|
+
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
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const FlexBox: ({ children, className, flexDirection, alignItems, justifyContent, variant, gap, wrap, fullWidth, htmlAttributes, }: IFlexBoxProps) => React.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { FlexBox, type IFlexBoxProps, type IStyledFlexBoxProps };
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
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
|
-
};
|
|
1
|
+
import c from'clsx';import S,{useMemo}from'react';import {capitalize}from'@purr-core/utils.helpers';import f,{css}from'styled-components';var i=({$alignItems:x,$justifyContent:l,$flexDirection:e,$gap:t,$wrap:r,$fullWidth:o})=>css`
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: ${l};
|
|
4
|
+
align-items: ${x};
|
|
5
|
+
flex-direction: ${e};
|
|
6
|
+
gap: ${t};
|
|
7
|
+
flex-wrap: ${r};
|
|
8
|
+
width: ${o?"100%":"auto"};
|
|
9
|
+
`,m={Div:f.div`
|
|
10
|
+
${i};
|
|
11
|
+
`,Span:f.span`
|
|
12
|
+
${i};
|
|
13
|
+
`};var T=({children:x,className:l,flexDirection:e="row",alignItems:t="center",justifyContent:r="center",variant:o="div",gap:p="0px",wrap:s="nowrap",fullWidth:n=false,htmlAttributes:$})=>{let d=useMemo(()=>{let a=capitalize(o);return m[a]},[o]);return S.createElement(d,{...$,$flexDirection:e,$alignItems:t,$justifyContent:r,$gap:p,$wrap:s,$fullWidth:n,className:c("flex-box",`flex-box--direction-${e}`,`flex-box--alignItems-${t}`,`flex-box--justifyContent-${r}`,`flex-box--gap-${p}`,`flex-box--wrap-${s}`,`flex-box--variant-${o}`,l)},x)};export{T as FlexBox};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-styled-components/components.flex-box",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
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.
|
|
30
|
-
"@purr-core/utils.helpers": "0.0.
|
|
29
|
+
"@purr-core/utils.definitions": "0.0.12",
|
|
30
|
+
"@purr-core/utils.helpers": "0.0.12"
|
|
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
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
|
-
};
|