@purr-react-styled-components/components.flex-box 0.0.9 → 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 ADDED
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,28 @@
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 };
@@ -0,0 +1,28 @@
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 ADDED
@@ -0,0 +1,13 @@
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.9",
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.11",
30
- "@purr-core/utils.helpers": "0.0.11"
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",