@kvdbil/components 16.0.0 → 16.0.2

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,23 +1,23 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),r=require("styled-components"),s=require("../../theme.js"),t=require("../Spinner/index.js"),l=require("../../typography/ButtonText/index.js"),o=require("./styles.js");function a(e){return e&&e.__esModule?e:{default:e}}require("../../utils/utils.js");var n=a(i),d=a(r);const u=d.default.button`
2
- ${l.BasicButtonFontStyle}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("react"),r=require("styled-components"),s=require("../../theme.js"),t=require("../Spinner/index.js"),o=require("../../typography/ButtonText/index.js"),l=require("./styles.js");function a(e){return e&&e.__esModule?e:{default:e}}require("../../utils/utils.js");var n=a(i),d=a(r);const u=d.default.button`
2
+ ${o.BasicButtonFontStyle}
3
3
  box-sizing: border-box;
4
4
  outline: none;
5
5
  cursor: pointer;
6
6
  user-select: none;
7
7
  position: relative;
8
8
  border: none;
9
- border-radius: 0.5rem;
9
+ ${({$noRadius:e})=>!e&&"border-radius: 0.5rem;"}
10
10
  min-width: ${({minWidth:e})=>e||"auto"};
11
11
  width: ${({fullWidth:e})=>e&&"100%"};
12
12
  display: flex;
13
13
  align-items: center;
14
14
  justify-content: ${({sufixIcon:e,prefixIcon:i,isLoading:r})=>r||!e&&!i?"center":"space-between"};
15
15
 
16
- ${({$size:e="small"})=>o.fontSizes[e]||l.ButtonRegularTextStyle}
16
+ ${({$size:e})=>l.fontSizes[e]||o.ButtonRegularTextStyle}
17
17
  ${({$size:e})=>r.css`
18
- ${"small"===e&&o.smallSizeStyles()}
19
- ${"regular"===e&&o.regularSizeStyles()}
20
- ${"large"===e&&o.largeSizeStyles()}
18
+ ${"small"===e&&l.smallSizeStyles()}
19
+ ${"regular"===e&&l.regularSizeStyles()}
20
+ ${"large"===e&&l.largeSizeStyles()}
21
21
  `}
22
22
  background-color: transparent;
23
23
  transition:
@@ -25,8 +25,8 @@
25
25
  background-color 0.3s ease,
26
26
  border 0.3s ease,
27
27
  filter 0.3s;
28
- ${({$variant:e="solid",$color:i,$colorShade:s="main",disabled:t,theme:l})=>r.css`
29
- ${t?o.disabledColorStyles(l,e):o.colorStyles[e]({theme:l,$color:i,$colorShade:s,$variant:e})}
28
+ ${({$variant:e="solid",$color:i,$colorShade:s="main",disabled:t,theme:o})=>r.css`
29
+ ${t?l.disabledColorStyles(o,e):l.colorStyles[e]({theme:o,$color:i,$colorShade:s,$variant:e})}
30
30
  `}
31
31
  &:focus-visible {
32
32
  box-shadow: 0px 0px 0px 1px
@@ -38,8 +38,8 @@
38
38
  margin-left: ${({type:e,size:i})=>"sufix"===e?f[i]:0};
39
39
  font-size: ${({size:e})=>c[e]};
40
40
  opacity: ${({isLoading:e})=>e?0:1};
41
- `,m=d.default(t.default)`
41
+ `,g=d.default(t.default)`
42
42
  position: absolute;
43
- `,g=d.default.span`
43
+ `,m=d.default.span`
44
44
  opacity: ${({isLoading:e})=>e?0:1};
45
- `,x={small:1,regular:1.25,large:1.5},y=i.forwardRef((({size:i="small",color:r,colorShade:t="mainAlt",variant:l="solid",fullWidth:o=!1,isDisabled:a=!1,isLoading:d=!1,children:c,sufixIcon:f,prefixIcon:y,minWidth:$,as:h="button",...b},z)=>{return e.jsx(u,{...b,as:h,minWidth:$,$color:r,$colorShade:t,disabled:a||d,fullWidth:o,theme:s.default,$variant:l,$size:i,isLoading:d,ref:z,prefixIcon:y,sufixIcon:f,children:e.jsxs(e.Fragment,{children:[y&&e.jsx(p,{size:i,type:"prefix",isLoading:d,children:y}),(S=c,j=d,"string"==typeof S||"number"==typeof S?e.jsx(g,{isLoading:j,children:S}):n.default.isValidElement(S)?n.default.cloneElement(S,{style:{...S.props.style,opacity:j?0:1}}):S),f&&e.jsx(p,{size:i,type:"sufix",isLoading:d,children:f}),d&&e.jsx(m,{customColor:s.default.colors.grayscaleToned.light1,size:x[i]})]})});var S,j}));y.displayName="Button",exports.Button=y,exports.default=y;
45
+ `,x={small:1,regular:1.25,large:1.5},$=i.forwardRef((({size:i="regular",color:r,colorShade:t="mainAlt",variant:o="solid",fullWidth:l=!1,isDisabled:a=!1,isLoading:d=!1,children:c,sufixIcon:f,prefixIcon:$,minWidth:y,as:h="button",noRadius:b=!1,...z},S)=>{return e.jsx(u,{...z,as:h,minWidth:y,$color:r,$colorShade:t,disabled:a||d,fullWidth:l,theme:s.default,$variant:o,$size:i,isLoading:d,ref:S,prefixIcon:$,sufixIcon:f,$noRadius:b,children:e.jsxs(e.Fragment,{children:[$&&e.jsx(p,{size:i,type:"prefix",isLoading:d,children:$}),(j=c,v=d,"string"==typeof j||"number"==typeof j?e.jsx(m,{isLoading:v,children:j}):n.default.isValidElement(j)?n.default.cloneElement(j,{style:{...j.props.style,opacity:v?0:1}}):j),f&&e.jsx(p,{size:i,type:"sufix",isLoading:d,children:f}),d&&e.jsx(g,{customColor:s.default.colors.grayscaleToned.light1,size:x[i]})]})});var j,v}));$.displayName="Button",exports.Button=$,exports.default=$;
@@ -1,5 +1,9 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react-day-picker"),t=require("styled-components"),o=require("../../theme.js"),a=require("./DayPickerNavBar.js"),l=require("./localeUtils.js"),s=require("./style.js");function i(e){return e&&e.__esModule?e:{default:e}}require("../Icons/Arrow.js"),require("../../typography/BodyText/index.js"),require("../../shared/media-queries.js");var u=i(r);const d=i(t).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("styled-components"),o=require("../../theme.js"),l=require("react-day-picker"),a=require("date-fns/locale"),c=require("date-fns"),s=require("./style.js");var i,n=(i=t)&&i.__esModule?i:{default:i},u=function(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}(a);const d=n.default.div`
2
2
  ${s.default}
3
3
 
4
+ .rdp-chevron {
5
+ fill: ${({theme:e})=>e.colors.text.dark};
6
+ }
7
+
4
8
  font-family: ${({theme:e})=>e.typography.fontAlternativeFamily};
5
- `,c=e=>({selected:{color:o.default.colors.text.light,background:o.default.colors[e].main},today:{color:o.default.colors[e].main}}),n=({locale:r="sv",color:t="primary",...o})=>e.jsx(d,{color:t,children:e.jsx(u.default,{...o,locale:r,months:l.MONTHS[r],weekdaysLong:l.WEEKDAYS_LONG[r],weekdaysShort:l.WEEKDAYS_SHORT[r],firstDayOfWeek:l.FIRST_DAY_OF_THE_WEEK[r],navbarElement:t=>e.jsx(a.default,{...t,locale:r}),captionElement:e.jsx("div",{}),modifiersStyles:c(t)})});exports.DayPicker=n,exports.default=n;
9
+ `,f=(e,r)=>{const t=r&&c.isToday(r)?o.default.colors.background.light:o.default.colors[e].main;return{selected:{color:o.default.colors.text.light,background:o.default.colors[e].main},today:{color:t}}},y=({locale:t="sv",color:o="primary",selectedDay:a,disabledDays:c,...s})=>{const[i,n]=r.useState(a);return e.jsx(d,{children:e.jsx(l.DayPicker,{...s,mode:"single",selected:i,onSelect:function(e){e&&n(e)},locale:u[t]||u.enGB,modifiersStyles:f(o,i),disabled:c})})};exports.DayPicker=y,exports.default=y;