@kvdbil/components 13.5.0 → 13.5.1
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,21 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("styled-components"),t=require("../../shared/media-queries.js");function i(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("styled-components"),t=require("../../shared/media-queries.js");function i(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var s=i(e);const a=(o,l)=>l!=="gap"&&l!=="row-gap"||typeof o!="number"?o:`${o}rem`,n=i(r).default.div(({$direction:o,$justify:l,$align:u,$gap:$,$rowGap:c,$wrap:d,$basis:g,$grow:w,$shrink:m})=>r.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
|
|
4
|
-
${
|
|
4
|
+
${o&&["column","column-reverse"].includes(String(o))&&r.css`
|
|
5
5
|
& > * {
|
|
6
6
|
width: 100%;
|
|
7
7
|
}
|
|
8
8
|
`}
|
|
9
9
|
|
|
10
|
-
${
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${[[l,"flex-direction"],[o,"justify-content"],[p,"align-items"],[$,"gap"],[c,"row-gap"],[c,"row-gap"],[d,"flex-wrap"],[g,"flex-basis"],[w,"flex-grow"],[m,"flex-shrink"]].map(([u,f])=>typeof u=="string"||typeof u=="number"?r.css`
|
|
15
|
-
${f}: ${n(u,f)};
|
|
16
|
-
`:typeof u=="object"?Object.entries(u).map(([y,b])=>r.css`
|
|
10
|
+
${[[o,"flex-direction"],[l,"justify-content"],[u,"align-items"],[$,"gap"],[c,"row-gap"],[c,"row-gap"],[d,"flex-wrap"],[g,"flex-basis"],[w,"flex-grow"],[m,"flex-shrink"]].map(([p,f])=>typeof p=="string"||typeof p=="number"?r.css`
|
|
11
|
+
${f}: ${a(p,f)};
|
|
12
|
+
`:typeof p=="object"?Object.entries(p).map(([y,b])=>r.css`
|
|
17
13
|
${t.mq(y)} {
|
|
18
|
-
${f}: ${
|
|
14
|
+
${f}: ${a(b,f)};
|
|
19
15
|
}
|
|
20
16
|
`):"")}
|
|
21
|
-
`);exports.default=({direction:
|
|
17
|
+
`);exports.default=({direction:o,justify:l,align:u,gap:$,rowGap:c,wrap:d,basis:g,grow:w,shrink:m,...p})=>s.default.createElement(n,{$direction:o!=null?o:"row",$justify:l!=null?l:"center",$align:u!=null?u:"center",$gap:$!=null?$:"1rem",$rowGap:c,$wrap:d,$basis:g,$grow:w,$shrink:m,...p});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import w from"react";import
|
|
1
|
+
import w from"react";import x,{css as o}from"styled-components";import{mq as p}from"../../shared/media-queries.js";const b="row",h="1rem",c="center",$=(e,t)=>(t==="gap"||t==="row-gap")&&typeof e=="number"?`${e}rem`:e,y=({$direction:e,$justify:t,$align:r,$gap:l,$rowGap:a,$wrap:s,$basis:f,$grow:u,$shrink:m})=>o`
|
|
2
2
|
display: flex;
|
|
3
3
|
|
|
4
4
|
${e&&["column","column-reverse"].includes(String(e))&&o`
|
|
@@ -7,15 +7,11 @@ import w from"react";import p,{css as o}from"styled-components";import{mq as c}f
|
|
|
7
7
|
}
|
|
8
8
|
`}
|
|
9
9
|
|
|
10
|
-
${
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
${i}: ${d(n,i)};
|
|
16
|
-
`:typeof n=="object"?Object.entries(n).map(([g,x])=>o`
|
|
17
|
-
${c(g)} {
|
|
18
|
-
${i}: ${d(x,i)};
|
|
10
|
+
${[[e,"flex-direction"],[t,"justify-content"],[r,"align-items"],[l,"gap"],[a,"row-gap"],[a,"row-gap"],[s,"flex-wrap"],[f,"flex-basis"],[u,"flex-grow"],[m,"flex-shrink"]].map(([n,i])=>typeof n=="string"||typeof n=="number"?o`
|
|
11
|
+
${i}: ${$(n,i)};
|
|
12
|
+
`:typeof n=="object"?Object.entries(n).map(([d,g])=>o`
|
|
13
|
+
${p(d)} {
|
|
14
|
+
${i}: ${$(g,i)};
|
|
19
15
|
}
|
|
20
16
|
`):"")}
|
|
21
|
-
`,j=
|
|
17
|
+
`,j=x.div(y),k=({direction:e,justify:t,align:r,gap:l,rowGap:a,wrap:s,basis:f,grow:u,shrink:m,...n})=>w.createElement(j,{$direction:e!=null?e:b,$justify:t!=null?t:c,$align:r!=null?r:c,$gap:l!=null?l:h,$rowGap:a,$wrap:s,$basis:f,$grow:u,$shrink:m,...n});export{k as default};
|