@stackshift-ui/flex 7.0.0-beta.3 → 7.0.0-beta.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/package.json +4 -4
- package/dist/chunk-7OMIK5UC.mjs +0 -51
- package/dist/chunk-7ZSNH2V2.mjs +0 -1
- package/dist/flex.d.ts +0 -17
- package/dist/flex.js +0 -1
- package/dist/flex.mjs +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/flex",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.5",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
|
-
"@stackshift-ui/scripts": "
|
|
38
|
-
"@stackshift-ui/system": "
|
|
37
|
+
"@stackshift-ui/scripts": "7.0.0-beta.4",
|
|
38
|
+
"@stackshift-ui/system": "7.0.0-beta.5"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@stackshift-ui/system": ">=
|
|
41
|
+
"@stackshift-ui/system": ">=7.0.0-beta.5",
|
|
42
42
|
"@types/react": "16.8 - 19",
|
|
43
43
|
"next": "10 - 14",
|
|
44
44
|
"react": "16.8 - 19",
|
package/dist/chunk-7OMIK5UC.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// src/flex.tsx
|
|
2
|
-
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
3
|
-
import cn from "classnames";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
var displayName = "Flex";
|
|
6
|
-
var Flex = ({
|
|
7
|
-
children,
|
|
8
|
-
className,
|
|
9
|
-
align = "start",
|
|
10
|
-
direction = "row",
|
|
11
|
-
justify = "start",
|
|
12
|
-
wrap = false,
|
|
13
|
-
gap,
|
|
14
|
-
as = "div",
|
|
15
|
-
...props
|
|
16
|
-
}) => {
|
|
17
|
-
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
18
|
-
const directionVariants = {
|
|
19
|
-
row: "flex-row",
|
|
20
|
-
col: "flex-col",
|
|
21
|
-
"row-reverse": "flex-row-reverse",
|
|
22
|
-
"col-reverse": "flex-col-reverse"
|
|
23
|
-
};
|
|
24
|
-
const alignVariants = {
|
|
25
|
-
start: "items-start",
|
|
26
|
-
end: "items-end",
|
|
27
|
-
baseline: "items-baseline",
|
|
28
|
-
stretch: "items-stretch",
|
|
29
|
-
center: "items-center"
|
|
30
|
-
};
|
|
31
|
-
const justifyVariants = {
|
|
32
|
-
normal: "justify-normal",
|
|
33
|
-
start: "justify-start",
|
|
34
|
-
end: "justify-end",
|
|
35
|
-
center: "justify-center",
|
|
36
|
-
between: "justify-between",
|
|
37
|
-
around: "justify-around",
|
|
38
|
-
evenly: "justify-evenly",
|
|
39
|
-
stretch: "justify-stretch"
|
|
40
|
-
};
|
|
41
|
-
const directionClass = directionVariants[direction];
|
|
42
|
-
const alignClass = alignVariants[align];
|
|
43
|
-
const justifyClass = justifyVariants[justify];
|
|
44
|
-
const classes = `flex ${directionClass} ${alignClass} ${justifyClass} ${wrap ? "flex-wrap" : ""} gap-${gap ? gap : 0}`;
|
|
45
|
-
return /* @__PURE__ */ jsx(Component, { as, className: cn(classes, className), ...props, children });
|
|
46
|
-
};
|
|
47
|
-
Flex.displayName = displayName;
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
Flex
|
|
51
|
-
};
|
package/dist/chunk-7ZSNH2V2.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DefaultComponent as j,useStackShiftUIComponents as v}from"@stackshift-ui/system";import b from"classnames";import{jsx as h}from"react/jsx-runtime";var t="Flex",g=({children:s,className:r,align:n="start",direction:o="row",justify:a="start",wrap:i=!1,gap:e,as:l="div",...c})=>{let{[t]:f=j}=v(),m={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},y={start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"},p={normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},d=m[o],u=y[n],w=p[a],x=`flex ${d} ${u} ${w} ${i?"flex-wrap":""} gap-${e||0}`;return h(f,{as:l,className:b(x,r),...c,children:s})};g.displayName=t;export{g as a};
|
package/dist/flex.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
2
|
-
type Justify = "normal" | "start" | "end" | "center" | "between" | "around" | "evenly" | "stretch";
|
|
3
|
-
type Direction = "row" | "row-reverse" | "col" | "col-reverse";
|
|
4
|
-
type Align = "start" | "end" | "baseline" | "stretch" | "center";
|
|
5
|
-
export interface FlexProps extends Omit<HTMLProps<HTMLElement>, "as" | "wrap"> {
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
align?: Align;
|
|
9
|
-
direction?: Direction;
|
|
10
|
-
justify?: Justify;
|
|
11
|
-
wrap?: boolean;
|
|
12
|
-
gap?: number;
|
|
13
|
-
as?: ElementType;
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
}
|
|
16
|
-
export declare const Flex: React.FC<FlexProps>;
|
|
17
|
-
export {};
|
package/dist/flex.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var N=Object.create;var o=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var s in t)o(e,s,{get:t[s],enumerable:!0})},l=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of T(t))!P.call(e,r)&&r!==s&&o(e,r,{get:()=>t[r],enumerable:!(n=F(t,r))||n.enumerable});return e};var E=(e,t,s)=>(s=e!=null?N($(e)):{},l(t||!e||!e.__esModule?o(s,"default",{value:e,enumerable:!0}):s,e)),H=e=>l(o({},"__esModule",{value:!0}),e);var L={};D(L,{Flex:()=>m});module.exports=H(L);var a=require("@stackshift-ui/system"),c=E(require("classnames")),y=require("react/jsx-runtime"),f="Flex",m=({children:e,className:t,align:s="start",direction:n="row",justify:r="start",wrap:p=!1,gap:i,as:d="div",...u})=>{let{[f]:w=a.DefaultComponent}=(0,a.useStackShiftUIComponents)(),x={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},j={start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"},v={normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},b=x[n],g=j[s],h=v[r],C=`flex ${b} ${g} ${h} ${p?"flex-wrap":""} gap-${i||0}`;return(0,y.jsx)(w,{as:d,className:(0,c.default)(C,t),...u,children:e})};m.displayName=f;0&&(module.exports={Flex});
|
package/dist/flex.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-7ZSNH2V2.mjs";export{a as Flex};
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./flex";
|
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";var N=Object.create;var o=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var s in t)o(e,s,{get:t[s],enumerable:!0})},l=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of T(t))!P.call(e,r)&&r!==s&&o(e,r,{get:()=>t[r],enumerable:!(n=F(t,r))||n.enumerable});return e};var E=(e,t,s)=>(s=e!=null?N($(e)):{},l(t||!e||!e.__esModule?o(s,"default",{value:e,enumerable:!0}):s,e)),H=e=>l(o({},"__esModule",{value:!0}),e);var L={};D(L,{Flex:()=>m});module.exports=H(L);var a=require("@stackshift-ui/system"),c=E(require("classnames")),p=require("react/jsx-runtime"),f="Flex",m=({children:e,className:t,align:s="start",direction:n="row",justify:r="start",wrap:y=!1,gap:i,as:u="div",...d})=>{let{[f]:w=a.DefaultComponent}=(0,a.useStackShiftUIComponents)(),x={row:"flex-row",col:"flex-col","row-reverse":"flex-row-reverse","col-reverse":"flex-col-reverse"},j={start:"items-start",end:"items-end",baseline:"items-baseline",stretch:"items-stretch",center:"items-center"},v={normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},b=x[n],g=j[s],h=v[r],C=`flex ${b} ${g} ${h} ${y?"flex-wrap":""} gap-${i||0}`;return(0,p.jsx)(w,{as:u,className:(0,c.default)(C,t),...d,children:e})};m.displayName=f;0&&(module.exports={Flex});
|
package/dist/index.mjs
DELETED