@kvdbil/components 13.4.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,17 +1,17 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),r=require("../../shared/media-queries.js");function i(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var n=i(e);const a=(o,u)=>u!=="gap"&&u!=="row-gap"||typeof o!="number"?o:`${o}rem`,l=i(t).default.div(({$direction:o,$justify:u,$align:c,$gap:p,$rowGap:d})=>t.css`
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
- width: 100%;
4
- height: 100%;
5
3
 
6
- ${r.mq(null,"tablet")} {
7
- flex-direction: column;
8
- }
4
+ ${o&&["column","column-reverse"].includes(String(o))&&r.css`
5
+ & > * {
6
+ width: 100%;
7
+ }
8
+ `}
9
9
 
10
- ${[[o,"flex-direction"],[u,"justify-content"],[c,"align-items"],[p,"gap"],[d,"row-gap"]].map(([s,f])=>typeof s=="string"||typeof s=="number"?t.css`
11
- ${f}: ${a(s,f)};
12
- `:typeof s=="object"?Object.entries(s).map(([$,g])=>t.css`
13
- ${r.mq($)} {
14
- ${f}: ${a(g,f)};
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`
13
+ ${t.mq(y)} {
14
+ ${f}: ${a(b,f)};
15
15
  }
16
16
  `):"")}
17
- `);exports.default=({direction:o,justify:u,align:c,gap:p,rowGap:d,...s})=>n.default.createElement(l,{$direction:o!=null?o:"row",$justify:u!=null?u:"center",$align:c!=null?c:"center",$gap:p!=null?p:"1rem",$rowGap:d,...s});
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,17 +1,17 @@
1
- import d from"react";import $,{css as o}from"styled-components";import{mq as u}from"../../shared/media-queries.js";const g="row",p="1rem",f="center",m=(e,t)=>(t==="gap"||t==="row-gap")&&typeof e=="number"?`${e}rem`:e,x=({$direction:e,$justify:t,$align:l,$gap:r,$rowGap:a})=>o`
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
- width: 100%;
4
- height: 100%;
5
3
 
6
- ${u(null,"tablet")} {
7
- flex-direction: column;
8
- }
4
+ ${e&&["column","column-reverse"].includes(String(e))&&o`
5
+ & > * {
6
+ width: 100%;
7
+ }
8
+ `}
9
9
 
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}: ${m(n,i)};
12
- `:typeof n=="object"?Object.entries(n).map(([c,s])=>o`
13
- ${u(c)} {
14
- ${i}: ${m(s,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)};
15
15
  }
16
16
  `):"")}
17
- `,b=$.div(x),h=({direction:e,justify:t,align:l,gap:r,rowGap:a,...n})=>d.createElement(b,{$direction:e!=null?e:g,$justify:t!=null?t:f,$align:l!=null?l:f,$gap:r!=null?r:p,$rowGap:a,...n});export{h as default};
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};
@@ -1 +1 @@
1
- import a from"react";import u from"../Flex/index.js";import"styled-components";import"../../shared/media-queries.js";const n="flex-start",d=({...l})=>{var t,e,i;return a.createElement(u,{direction:(t=l==null?void 0:l.direction)!=null?t:"column",justify:(e=l==null?void 0:l.justify)!=null?e:n,align:(i=l==null?void 0:l.align)!=null?i:n,gap:l==null?void 0:l.spacing,...l})};export{d as default};
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "13.4.0",
3
+ "version": "13.5.1",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -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;