@kvdbil/components 16.0.3 → 16.0.4
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"),
|
|
2
|
-
${
|
|
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&&
|
|
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;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
${
|
|
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
|
-
|
|
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};
|
package/package.json
CHANGED
package/package.json.tmp
CHANGED
|
@@ -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,
|
|
10
|
+
export declare const DayPicker: ({ locale, color, colorShade, selectedDay, ...props }: DayPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export default DayPicker;
|