@kvdbil/components 16.0.3 → 16.0.5

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,9 +1,9 @@
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,u=(i=t)&&i.__esModule?i:{default:i},d=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 n=u.default.div`
2
- ${s.default}
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"),c=require("date-fns/locale"),a=require("date-fns"),u=require("./style.js");var n,s=(n=t)&&n.__esModule?n:{default:n},i=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)}(c);const d=s.default.div`
2
+ ${u.default}
3
3
 
4
4
  .rdp-chevron {
5
5
  fill: ${({theme:e})=>e.colors.text.dark};
6
6
  }
7
7
 
8
8
  font-family: ${({theme:e})=>e.typography.fontAlternativeFamily};
9
- `,f=(e,r,t)=>{const l=t&&c.isToday(t)?o.default.colors.background.light:o.default.colors[e][r];return{selected:{color:o.default.colors.text.light,background:o.default.colors[e][r]},today:{color:l}}},y=({locale:t="sv",color:o="primary",colorShade:a="mainAlt",selectedDay:c,disabledDays:s,...i})=>{const[u,y]=r.useState(c);return e.jsx(n,{children:e.jsx(l.DayPicker,{...i,mode:"single",selected:u,onSelect:function(e){e&&y(e)},locale:d[t]||d.enGB,modifiersStyles:f(o,a,u),disabled:s})})};exports.DayPicker=y,exports.default=y;
9
+ `,f=(e,r,t)=>{const l=t&&a.isToday(t)?o.default.colors.background.light:o.default.colors[e][r];return{selected:{color:o.default.colors.text.light,background:o.default.colors[e][r]},today:{color:l}}},y=({locale:t="sv",color:o="primary",colorShade:c="mainAlt",selectedDay:a,...u})=>{const[n,s]=r.useState(a);return e.jsx(d,{children:e.jsx(l.DayPicker,{...u,mode:"single",selected:n,onSelect:function(e){e&&s(e)},locale:i[t]||i.enGB,modifiersStyles:f(o,c,n)})})};exports.DayPicker=y,exports.default=y;
@@ -8,7 +8,7 @@
8
8
  `,u=l.default.div`
9
9
  display: inline-block;
10
10
  border-radius: 50%;
11
- border-top: ${({theme:e,color:r,customColor:t,size:s})=>`${a(s)/10}em solid ${t??"neutral"===r?o.neutralColorSwap(e).mainAlt:e.colors?.[r]?.mainAlt}`};
11
+ border-top: ${({theme:e,color:r,customColor:t,size:s})=>`${a(s)/10}em solid ${t??("neutral"===r?o.neutralColorSwap(e).mainAlt:e.colors?.[r]?.mainAlt)}`};
12
12
  border-bottom: ${({size:e})=>a(e)/10+"em solid rgba(0, 0, 0, 0.1);"};
13
13
  border-right: ${({size:e})=>a(e)/10+"em solid rgba(0, 0, 0, 0.1);"};
14
14
  border-left: ${({size:e})=>a(e)/10+"em solid rgba(0, 0, 0, 0.1);"};
@@ -1,9 +1,9 @@
1
- import{jsx as i}from"react/jsx-runtime";import{useState as y}from"react";import h from"styled-components";import t from"../../theme.js";import{DayPicker as u}from"react-day-picker";import*as m from"date-fns/locale";import{isToday as g}from"date-fns";import k from"./style.js";const D=h.div`
2
- ${k}
1
+ import{jsx as a}from"react/jsx-runtime";import{useState as p}from"react";import y from"styled-components";import e from"../../theme.js";import{DayPicker as h}from"react-day-picker";import*as m from"date-fns/locale";import{isToday as k}from"date-fns";import u from"./style.js";const g=y.div`
2
+ ${u}
3
3
 
4
4
  .rdp-chevron {
5
5
  fill: ${({theme:o})=>o.colors.text.dark};
6
6
  }
7
7
 
8
8
  font-family: ${({theme:o})=>o.typography.fontAlternativeFamily};
9
- `,$=(o,r,e)=>{const l=e&&g(e)?t.colors.background.light:t.colors[o][r];return{selected:{color:t.colors.text.light,background:t.colors[o][r]},today:{color:l}}},s=({locale:o="sv",color:r="primary",colorShade:e="mainAlt",selectedDay:l,disabledDays:d,...n})=>{const[a,f]=y(l);function p(c){c&&f(c)}return i(D,{children:i(u,{...n,mode:"single",selected:a,onSelect:p,locale:m[o]||m.enGB,modifiersStyles:$(r,e,a),disabled:d})})};export{s as DayPicker,s as default};
9
+ `,v=(o,r,t)=>{const l=t&&k(t)?e.colors.background.light:e.colors[o][r];return{selected:{color:e.colors.text.light,background:e.colors[o][r]},today:{color:l}}},s=({locale:o="sv",color:r="primary",colorShade:t="mainAlt",selectedDay:l,...n})=>{const[i,d]=p(l);function f(c){c&&d(c)}return a(g,{children:a(h,{...n,mode:"single",selected:i,onSelect:f,locale:m[o]||m.enGB,modifiersStyles:v(r,t,i)})})};export{s as DayPicker,s as default};
@@ -8,7 +8,7 @@ import{jsx as i}from"react/jsx-runtime";import s,{keyframes as m}from"styled-com
8
8
  `,p=s.div`
9
9
  display: inline-block;
10
10
  border-radius: 50%;
11
- border-top: ${({theme:e,color:r,customColor:t,size:a})=>`${o(a)/10}em solid ${t??r==="neutral"?n(e).mainAlt:e.colors?.[r]?.mainAlt}`};
11
+ border-top: ${({theme:e,color:r,customColor:t,size:a})=>`${o(a)/10}em solid ${t??(r==="neutral"?n(e).mainAlt:e.colors?.[r]?.mainAlt)}`};
12
12
  border-bottom: ${({size:e})=>`${o(e)/10}em solid rgba(0, 0, 0, 0.1);`};
13
13
  border-right: ${({size:e})=>`${o(e)/10}em solid rgba(0, 0, 0, 0.1);`};
14
14
  border-left: ${({size:e})=>`${o(e)/10}em solid rgba(0, 0, 0, 0.1);`};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "16.0.3",
3
+ "version": "16.0.5",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
package/package.json.tmp CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "16.0.3",
3
+ "version": "16.0.5",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -5,8 +5,7 @@ export interface DayPickerProps extends Omit<PropsBase, 'locale'> {
5
5
  locale?: Locale;
6
6
  color?: Color;
7
7
  selectedDay?: Date;
8
- disabledDays?: Date[];
9
8
  colorShade?: ColorShade;
10
9
  }
11
- export declare const DayPicker: ({ locale, color, colorShade, selectedDay, disabledDays, ...props }: DayPickerProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const DayPicker: ({ locale, color, colorShade, selectedDay, ...props }: DayPickerProps) => import("react/jsx-runtime").JSX.Element;
12
11
  export default DayPicker;