@stackshift-ui/container 6.0.11 → 6.1.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DefaultComponent as m,useStackShiftUIComponents as i}from"@stackshift-ui/system";import c from"classnames";import{jsx as
|
|
1
|
+
import{DefaultComponent as m,useStackShiftUIComponents as i}from"@stackshift-ui/system";import c from"classnames";import{jsx as d}from"react/jsx-runtime";var n="Container",x=({children:o,className:s,maxWidth:t="full",as:a,...p})=>{let{[n]:l=m}=i(),e=typeof t=="number"?`${t.toString()}px`:{sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px",full:"100%"}[t],r=e!=null?e:"80rem";return d(l,{as:a,className:c("mx-auto w-full lg:px-4",s),style:{maxWidth:r},...p,children:o})};x.displayName=n;export{x as a};
|
package/dist/container.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var u=Object.create;var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},
|
|
1
|
+
"use strict";var u=Object.create;var a=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},r=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of C(e))!N.call(t,o)&&o!==n&&a(t,o,{get:()=>e[o],enumerable:!(s=y(e,o))||s.enumerable});return t};var T=(t,e,n)=>(n=t!=null?u(h(t)):{},r(e||!t||!t.__esModule?a(n,"default",{value:t,enumerable:!0}):n,t)),P=t=>r(a({},"__esModule",{value:!0}),t);var w={};g(w,{Container:()=>c});module.exports=P(w);var p=require("@stackshift-ui/system"),m=T(require("classnames")),x=require("react/jsx-runtime"),i="Container",c=({children:t,className:e,maxWidth:n="full",as:s,...o})=>{let{[i]:d=p.DefaultComponent}=(0,p.useStackShiftUIComponents)(),l=typeof n=="number"?`${n.toString()}px`:{sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px",full:"100%"}[n],f=l!=null?l:"80rem";return(0,x.jsx)(d,{as:s,className:(0,m.default)("mx-auto w-full lg:px-4",e),style:{maxWidth:f},...o,children:t})};c.displayName=i;0&&(module.exports={Container});
|
package/dist/container.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-TV2RODNN.mjs";export{a as Container};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var u=Object.create;var
|
|
2
|
+
"use strict";var u=Object.create;var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var o in e)p(t,o,{get:e[o],enumerable:!0})},l=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of C(e))!N.call(t,n)&&n!==o&&p(t,n,{get:()=>e[n],enumerable:!(s=y(e,n))||s.enumerable});return t};var T=(t,e,o)=>(o=t!=null?u(h(t)):{},l(e||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),P=t=>l(p({},"__esModule",{value:!0}),t);var w={};g(w,{Container:()=>c});module.exports=P(w);var r=require("@stackshift-ui/system"),m=T(require("classnames")),x=require("react/jsx-runtime"),i="Container",c=({children:t,className:e,maxWidth:o="full",as:s,...n})=>{let{[i]:d=r.DefaultComponent}=(0,r.useStackShiftUIComponents)(),a=typeof o=="number"?`${o.toString()}px`:{sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px",full:"100%"}[o],f=a!=null?a:"80rem";return(0,x.jsx)(d,{as:s,className:(0,m.default)("mx-auto w-full lg:px-4",e),style:{maxWidth:f},...n,children:t})};c.displayName=i;0&&(module.exports={Container});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as e}from"./chunk-
|
|
2
|
+
"use strict";import{a as e}from"./chunk-TV2RODNN.mjs";export{e as Container};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/container",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "6.0
|
|
4
|
+
"version": "6.1.0",
|
|
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": "6.0
|
|
38
|
-
"@stackshift-ui/system": "6.0
|
|
37
|
+
"@stackshift-ui/scripts": "6.1.0",
|
|
38
|
+
"@stackshift-ui/system": "6.1.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@stackshift-ui/system": ">=
|
|
41
|
+
"@stackshift-ui/system": ">=7.0.0",
|
|
42
42
|
"@types/react": "16.8 - 19",
|
|
43
43
|
"next": "10 - 14",
|
|
44
44
|
"react": "16.8 - 19",
|
package/src/container.test.tsx
CHANGED
|
@@ -7,7 +7,7 @@ describe.concurrent("container", () => {
|
|
|
7
7
|
|
|
8
8
|
test("Layout: Container - test if renders without errors", ({ expect }) => {
|
|
9
9
|
const clx = "container-class";
|
|
10
|
-
render(<Container className={clx} />);
|
|
10
|
+
render(<Container data-testid="div" className={clx} />);
|
|
11
11
|
expect(screen.getByTestId("div").classList).toContain(clx);
|
|
12
12
|
});
|
|
13
13
|
});
|
package/src/container.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
2
|
-
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
3
2
|
import cn from "classnames";
|
|
3
|
+
import type { ElementType, HTMLProps, ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
export interface ContainerProps extends Omit<HTMLProps<HTMLElement>, "as"> {
|
|
6
6
|
children?: ReactNode;
|
|
@@ -38,12 +38,7 @@ export const Container: React.FC<ContainerProps> = ({
|
|
|
38
38
|
const classes = "mx-auto w-full lg:px-4";
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
|
-
<Component
|
|
42
|
-
as={as}
|
|
43
|
-
className={cn(classes, className)}
|
|
44
|
-
style={{ maxWidth: width }}
|
|
45
|
-
{...props}
|
|
46
|
-
data-testid={displayName}>
|
|
41
|
+
<Component as={as} className={cn(classes, className)} style={{ maxWidth: width }} {...props}>
|
|
47
42
|
{children}
|
|
48
43
|
</Component>
|
|
49
44
|
);
|