@stackshift-ui/section 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,31 @@
1
+ // src/section.tsx
2
+ import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
3
+ import cn from "classnames";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var displayName = "Section";
6
+ var Section = ({
7
+ children,
8
+ className,
9
+ maxWidth = "full",
10
+ as,
11
+ ...props
12
+ }) => {
13
+ const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
14
+ const widthVariants = {
15
+ sm: "384px",
16
+ md: "448px",
17
+ lg: "512px",
18
+ xl: "576px",
19
+ "2xl": "672px",
20
+ full: "100%"
21
+ };
22
+ const widthClass = typeof maxWidth === "number" ? `${maxWidth.toString()}px` : widthVariants[maxWidth];
23
+ const width = widthClass != null ? widthClass : "80rem";
24
+ const classes = "mx-auto w-full px-4";
25
+ return /* @__PURE__ */ jsx(Component, { as, className: cn(classes, className), style: { maxWidth: width }, ...props, children });
26
+ };
27
+ Section.displayName = displayName;
28
+
29
+ export {
30
+ Section
31
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackshift-ui/section",
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",
@@ -34,11 +34,11 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "classnames": "^2.5.1",
37
- "@stackshift-ui/system": "6.1.0-beta.1",
38
- "@stackshift-ui/scripts": "6.1.0-beta.0"
37
+ "@stackshift-ui/system": "6.1.0-beta.3",
38
+ "@stackshift-ui/scripts": "6.1.0-beta.2"
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",