@stackshift-ui/flex 7.0.0-beta.1 → 7.0.0-beta.3

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.
@@ -0,0 +1,51 @@
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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackshift-ui/flex",
3
3
  "description": "",
4
- "version": "7.0.0-beta.1",
4
+ "version": "7.0.0-beta.3",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -29,16 +29,16 @@
29
29
  "typescript": "^5.6.2",
30
30
  "vite-tsconfig-paths": "^5.0.1",
31
31
  "vitest": "^2.1.1",
32
- "@stackshift-ui/eslint-config": "6.0.10",
33
- "@stackshift-ui/typescript-config": "6.0.10"
32
+ "@stackshift-ui/typescript-config": "6.0.10",
33
+ "@stackshift-ui/eslint-config": "6.0.10"
34
34
  },
35
35
  "dependencies": {
36
36
  "classnames": "^2.5.1",
37
- "@stackshift-ui/scripts": "6.1.0-beta.0",
38
- "@stackshift-ui/system": "6.1.0-beta.1"
37
+ "@stackshift-ui/scripts": "6.1.0-beta.2",
38
+ "@stackshift-ui/system": "6.1.0-beta.3"
39
39
  },
40
40
  "peerDependencies": {
41
- "@stackshift-ui/system": ">=6.1.0-beta.1",
41
+ "@stackshift-ui/system": ">=6.1.0-beta.3",
42
42
  "@types/react": "16.8 - 19",
43
43
  "next": "10 - 14",
44
44
  "react": "16.8 - 19",