@kvdbil/components 13.4.0 → 13.5.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,17 +1,21 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),
|
|
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(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var s=i(e);const n=(l,o)=>o!=="gap"&&o!=="row-gap"||typeof l!="number"?l:`${l}rem`,a=i(r).default.div(({$direction:l,$justify:o,$align:p,$gap:$,$rowGap:c,$wrap:d,$basis:g,$grow:w,$shrink:m})=>r.css`
|
|
2
2
|
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
3
|
|
|
6
|
-
${
|
|
4
|
+
${l&&["column","column-reverse"].includes(String(l))&&r.css`
|
|
5
|
+
& > * {
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
`}
|
|
9
|
+
|
|
10
|
+
${t.mq(null,"tablet")} {
|
|
7
11
|
flex-direction: column;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
${[[
|
|
11
|
-
${f}: ${
|
|
12
|
-
`:typeof
|
|
13
|
-
${
|
|
14
|
-
${f}: ${
|
|
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`
|
|
17
|
+
${t.mq(y)} {
|
|
18
|
+
${f}: ${n(b,f)};
|
|
15
19
|
}
|
|
16
20
|
`):"")}
|
|
17
|
-
`);exports.default=({direction:
|
|
21
|
+
`);exports.default=({direction:l,justify:o,align:p,gap:$,rowGap:c,wrap:d,basis:g,grow:w,shrink:m,...u})=>s.default.createElement(a,{$direction:l!=null?l:"row",$justify:o!=null?o:"center",$align:p!=null?p:"center",$gap:$!=null?$:"1rem",$rowGap:c,$wrap:d,$basis:g,$grow:w,$shrink:m,...u});
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import w from"react";import p,{css as o}from"styled-components";import{mq as c}from"../../shared/media-queries.js";const b="row",h="1rem",$="center",d=(e,t)=>(t==="gap"||t==="row-gap")&&typeof e=="number"?`${e}rem`:e,y=({$direction:e,$justify:t,$align:l,$gap:r,$rowGap:a,$wrap:s,$basis:u,$grow:f,$shrink:m})=>o`
|
|
2
2
|
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
3
|
|
|
6
|
-
${
|
|
4
|
+
${e&&["column","column-reverse"].includes(String(e))&&o`
|
|
5
|
+
& > * {
|
|
6
|
+
width: 100%;
|
|
7
|
+
}
|
|
8
|
+
`}
|
|
9
|
+
|
|
10
|
+
${c(null,"tablet")} {
|
|
7
11
|
flex-direction: column;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
|
-
${[[e,"flex-direction"],[t,"justify-content"],[l,"align-items"],[r,"gap"],[a,"row-gap"]].map(([n,i])=>typeof n=="string"||typeof n=="number"?o`
|
|
11
|
-
${i}: ${
|
|
12
|
-
`:typeof n=="object"?Object.entries(n).map(([
|
|
13
|
-
${
|
|
14
|
-
${i}: ${
|
|
14
|
+
${[[e,"flex-direction"],[t,"justify-content"],[l,"align-items"],[r,"gap"],[a,"row-gap"],[a,"row-gap"],[s,"flex-wrap"],[u,"flex-basis"],[f,"flex-grow"],[m,"flex-shrink"]].map(([n,i])=>typeof n=="string"||typeof n=="number"?o`
|
|
15
|
+
${i}: ${d(n,i)};
|
|
16
|
+
`:typeof n=="object"?Object.entries(n).map(([g,x])=>o`
|
|
17
|
+
${c(g)} {
|
|
18
|
+
${i}: ${d(x,i)};
|
|
15
19
|
}
|
|
16
20
|
`):"")}
|
|
17
|
-
`,
|
|
21
|
+
`,j=p.div(y),k=({direction:e,justify:t,align:l,gap:r,rowGap:a,wrap:s,basis:u,grow:f,shrink:m,...n})=>w.createElement(j,{$direction:e!=null?e:b,$justify:t!=null?t:$,$align:l!=null?l:$,$gap:r!=null?r:h,$rowGap:a,$wrap:s,$basis:u,$grow:f,$shrink:m,...n});export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from"react";import a from"../Flex/index.js";import"styled-components";import"../../shared/media-queries.js";const u=({...l})=>{var t,e,i;return n.createElement(a,{direction:(t=l==null?void 0:l.direction)!=null?t:"column",justify:(e=l==null?void 0:l.justify)!=null?e:"flex-start",align:(i=l==null?void 0:l.align)!=null?i:"flex-start",gap:l==null?void 0:l.spacing,...l})};export{u as default};
|
package/package.json
CHANGED
|
@@ -17,7 +17,11 @@ export interface FlexProps {
|
|
|
17
17
|
align?: CSSPropertyWithResponsive<'alignItems'>;
|
|
18
18
|
gap?: CSSPropertyWithResponsive<'gap'>;
|
|
19
19
|
rowGap?: CSSPropertyWithResponsive<'rowGap'>;
|
|
20
|
+
wrap?: CSSPropertyWithResponsive<'flexWrap'>;
|
|
21
|
+
basis?: CSSPropertyWithResponsive<'flexBasis'>;
|
|
22
|
+
grow?: CSSPropertyWithResponsive<'flexGrow'>;
|
|
23
|
+
shrink?: CSSPropertyWithResponsive<'flexShrink'>;
|
|
20
24
|
}
|
|
21
25
|
export declare type Props = FlexProps & HTMLAttributes<HTMLDivElement>;
|
|
22
|
-
declare const Flex: ({ direction, justify, align, gap, rowGap, ...props }: Props) => JSX.Element;
|
|
26
|
+
declare const Flex: ({ direction, justify, align, gap, rowGap, wrap, basis, grow, shrink, ...props }: Props) => JSX.Element;
|
|
23
27
|
export default Flex;
|