@bikdotai/bik-component-library 0.0.316 → 0.0.317

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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../../datePicker/DatePickerWrapper.js");const s=s=>{let{val:a,onChange:i,nativeID:n,disabled:l}=s;const d=Array.isArray(a)?new Date(null==a?void 0:a[0]):a;return t.useEffect((()=>{d||i(new Date((new Date).setHours(0,0,0,0)))}),[]),e.jsx("div",Object.assign({style:{position:"relative",width:200}},{children:e.jsx(r.default,{pickerStyles:{zIndex:3},disabled:l,val:d,onChange:i})}))};exports.default=t=>e.jsx(s,Object.assign({},t));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../../../datePicker/DatePickerWrapper.js");const a=a=>{let{val:s,onChange:i,nativeID:n,disabled:l}=a;const d=Array.isArray(s)?new Date(null==s?void 0:s[0]):s;return t.useEffect((()=>{d||i(new Date((new Date).setHours(0,0,0,0)))}),[]),e.jsx("div",Object.assign({style:{position:"relative",width:200}},{children:e.jsx(r.default,{maxDate:new Date,pickerStyles:{zIndex:3},disabled:l,val:d,onChange:i})}))};exports.default=t=>e.jsx(a,Object.assign({},t));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../../../../datePicker/DatePickerWrapper.js");const s=s=>{let{val:r,onChange:n,disabled:i}=s;return t.useEffect((()=>{if(!r){const e=new Date((new Date).setHours(0,0,0,0)),t=new Date(new Date((new Date).setHours(23,59,59,999)).setDate((new Date).getDate()+1));t.setDate(e.getDate()+1),n([e,t])}}),[]),e.jsx("div",Object.assign({style:{position:"relative"}},{children:e.jsx(a.default,{pickerStyles:{zIndex:3},disabled:i,val:r,onChange:n,calendarProps:{selectRange:!0}})}))};exports.default=t=>e.jsx(s,Object.assign({},t));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("../../../../datePicker/DatePickerWrapper.js");const s=s=>{let{val:r,onChange:n,disabled:i}=s;return t.useEffect((()=>{if(!r){const e=new Date((new Date).setHours(0,0,0,0)),t=new Date(new Date((new Date).setHours(23,59,59,999)).setDate((new Date).getDate()+1));t.setDate(e.getDate()+1),n([e,t])}}),[]),e.jsx("div",Object.assign({style:{position:"relative"}},{children:e.jsx(a.default,{maxDate:new Date,pickerStyles:{zIndex:3},disabled:i,val:r,onChange:n,calendarProps:{selectRange:!0}})}))};exports.default=t=>e.jsx(s,Object.assign({},t));
@@ -8,5 +8,7 @@ declare const DatePickerWrapper: React.FC<{
8
8
  pickerStyles?: CSSProperties;
9
9
  nativeID?: string;
10
10
  disabled?: boolean;
11
+ maxDate?: Date;
12
+ minDate?: Date;
11
13
  }>;
12
14
  export default DatePickerWrapper;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("react-calendar"),a=require("../../hooks/useOutside.js"),n=require("../../utils/DateUtils.js"),o=require("../../constants/Theme.js"),i=require("../../assets/icons/calendar.svg.js"),s=require("../TypographyStyle.js"),l=require("./DatePickerWrapper.styled.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(t),u=c(r);exports.default=r=>{let{val:c,onChange:O,calendarProps:g,disabled:S,pickerStyles:v,nativeID:C}=r;var y,D,j,b;const[L,f]=t.useState(!1),h=d.default.createRef();return a.useOutside(h,(()=>{f(!1)})),e.jsxs(e.Fragment,{children:[e.jsxs(l.DateBtn,Object.assign({id:C,bgColor:S?o.COLORS.background.base:o.COLORS.surface.standard,borderColor:o.COLORS.stroke.primary,onClick:()=>f(!L)},{children:[e.jsx(s.BodySecondary,Object.assign({style:{color:S?o.COLORS.content.inactive:o.COLORS.content.secondary,flex:1}},{children:c?Array.isArray(c)?(null===(y=null==c?void 0:c[0])||void 0===y?void 0:y.toString())&&(null===(D=null==c?void 0:c[1])||void 0===D?void 0:D.toString())?`${new Date(null===(j=null==c?void 0:c[0])||void 0===j?void 0:j.toString()).toLocaleDateString()}-${new Date(null===(b=null==c?void 0:c[1])||void 0===b?void 0:b.toString()).toLocaleDateString()}`:`${n.default.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(c.toString()).toLocaleDateString():(new Date).toLocaleDateString()})),e.jsx(i.default,{width:20,height:20,color:S?o.COLORS.content.inactive:o.COLORS.content.secondary})]})),L&&!S&&e.jsx(l.PickerContainer,Object.assign({ref:h,style:Object.assign({},v),contentPrimary:o.COLORS.content.primary,subDued:o.COLORS.surface.subdued,brandColor:o.COLORS.background.brand,bgColor:o.COLORS.surface.standard,borderColor:o.COLORS.stroke.primary},{children:e.jsx(u.default,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:e=>{O(e),f(!1)},value:c?Array.isArray(c)?2===c.length?[new Date(c[0]),new Date(c[1])]:null:new Date(c):null},g))}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("react-calendar"),a=require("../../hooks/useOutside.js"),n=require("../../utils/DateUtils.js"),o=require("../../constants/Theme.js"),i=require("../../assets/icons/calendar.svg.js"),s=require("../TypographyStyle.js"),l=require("./DatePickerWrapper.styled.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(t),u=c(r);exports.default=r=>{let{val:c,onChange:O,calendarProps:g,disabled:S,pickerStyles:D,nativeID:v,maxDate:C,minDate:y}=r;var j,b,L,f;const[m,h]=t.useState(!1),p=d.default.createRef();return a.useOutside(p,(()=>{h(!1)})),e.jsxs(e.Fragment,{children:[e.jsxs(l.DateBtn,Object.assign({id:v,bgColor:S?o.COLORS.background.base:o.COLORS.surface.standard,borderColor:o.COLORS.stroke.primary,onClick:()=>h(!m)},{children:[e.jsx(s.BodySecondary,Object.assign({style:{color:S?o.COLORS.content.inactive:o.COLORS.content.secondary,flex:1}},{children:c?Array.isArray(c)?(null===(j=null==c?void 0:c[0])||void 0===j?void 0:j.toString())&&(null===(b=null==c?void 0:c[1])||void 0===b?void 0:b.toString())?`${new Date(null===(L=null==c?void 0:c[0])||void 0===L?void 0:L.toString()).toLocaleDateString()}-${new Date(null===(f=null==c?void 0:c[1])||void 0===f?void 0:f.toString()).toLocaleDateString()}`:`${n.default.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(c.toString()).toLocaleDateString():(new Date).toLocaleDateString()})),e.jsx(i.default,{width:20,height:20,color:S?o.COLORS.content.inactive:o.COLORS.content.secondary})]})),m&&!S&&e.jsx(l.PickerContainer,Object.assign({ref:p,style:Object.assign({},D),contentPrimary:o.COLORS.content.primary,subDued:o.COLORS.surface.subdued,brandColor:o.COLORS.background.brand,bgColor:o.COLORS.surface.standard,borderColor:o.COLORS.stroke.primary},{children:e.jsx(u.default,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:e=>{O(e),h(!1)},maxDate:C,minDate:y,value:c?Array.isArray(c)?2===c.length?[new Date(c[0]),new Date(c[1])]:null:new Date(c):null},g))}))]})};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import r from"../../../../datePicker/DatePickerWrapper.js";const a=a=>{let{val:i,onChange:n,nativeID:s,disabled:o}=a;const l=Array.isArray(i)?new Date(null==i?void 0:i[0]):i;return t((()=>{l||n(new Date((new Date).setHours(0,0,0,0)))}),[]),e("div",Object.assign({style:{position:"relative",width:200}},{children:e(r,{pickerStyles:{zIndex:3},disabled:o,val:l,onChange:n})}))};var i=t=>e(a,Object.assign({},t));export{i as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import a from"../../../../datePicker/DatePickerWrapper.js";const r=r=>{let{val:i,onChange:n,nativeID:s,disabled:o}=r;const l=Array.isArray(i)?new Date(null==i?void 0:i[0]):i;return t((()=>{l||n(new Date((new Date).setHours(0,0,0,0)))}),[]),e("div",Object.assign({style:{position:"relative",width:200}},{children:e(a,{maxDate:new Date,pickerStyles:{zIndex:3},disabled:o,val:l,onChange:n})}))};var i=t=>e(r,Object.assign({},t));export{i as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import a from"../../../../datePicker/DatePickerWrapper.js";const r=r=>{let{val:s,onChange:n,disabled:i}=r;return t((()=>{if(!s){const e=new Date((new Date).setHours(0,0,0,0)),t=new Date(new Date((new Date).setHours(23,59,59,999)).setDate((new Date).getDate()+1));t.setDate(e.getDate()+1),n([e,t])}}),[]),e("div",Object.assign({style:{position:"relative"}},{children:e(a,{pickerStyles:{zIndex:3},disabled:i,val:s,onChange:n,calendarProps:{selectRange:!0}})}))};var s=t=>e(r,Object.assign({},t));export{s as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import a from"../../../../datePicker/DatePickerWrapper.js";const r=r=>{let{val:n,onChange:s,disabled:i}=r;return t((()=>{if(!n){const e=new Date((new Date).setHours(0,0,0,0)),t=new Date(new Date((new Date).setHours(23,59,59,999)).setDate((new Date).getDate()+1));t.setDate(e.getDate()+1),s([e,t])}}),[]),e("div",Object.assign({style:{position:"relative"}},{children:e(a,{maxDate:new Date,pickerStyles:{zIndex:3},disabled:i,val:n,onChange:s,calendarProps:{selectRange:!0}})}))};var n=t=>e(r,Object.assign({},t));export{n as default};
@@ -8,5 +8,7 @@ declare const DatePickerWrapper: React.FC<{
8
8
  pickerStyles?: CSSProperties;
9
9
  nativeID?: string;
10
10
  disabled?: boolean;
11
+ maxDate?: Date;
12
+ minDate?: Date;
11
13
  }>;
12
14
  export default DatePickerWrapper;
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import o,{useState as a}from"react";import n from"react-calendar";import{useOutside as i}from"../../hooks/useOutside.js";import l from"../../utils/DateUtils.js";import{COLORS as s}from"../../constants/Theme.js";import c from"../../assets/icons/calendar.svg.js";import{BodySecondary as d}from"../TypographyStyle.js";import{DateBtn as m,PickerContainer as u}from"./DatePickerWrapper.styled.js";const g=g=>{let{val:D,onChange:p,calendarProps:v,disabled:b,pickerStyles:y,nativeID:f}=g;var h,S,j,w;const[C,k]=a(!1),L=o.createRef();return i(L,(()=>{k(!1)})),e(t,{children:[e(m,Object.assign({id:f,bgColor:b?s.background.base:s.surface.standard,borderColor:s.stroke.primary,onClick:()=>k(!C)},{children:[r(d,Object.assign({style:{color:b?s.content.inactive:s.content.secondary,flex:1}},{children:D?Array.isArray(D)?(null===(h=null==D?void 0:D[0])||void 0===h?void 0:h.toString())&&(null===(S=null==D?void 0:D[1])||void 0===S?void 0:S.toString())?`${new Date(null===(j=null==D?void 0:D[0])||void 0===j?void 0:j.toString()).toLocaleDateString()}-${new Date(null===(w=null==D?void 0:D[1])||void 0===w?void 0:w.toString()).toLocaleDateString()}`:`${l.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(D.toString()).toLocaleDateString():(new Date).toLocaleDateString()})),r(c,{width:20,height:20,color:b?s.content.inactive:s.content.secondary})]})),C&&!b&&r(u,Object.assign({ref:L,style:Object.assign({},y),contentPrimary:s.content.primary,subDued:s.surface.subdued,brandColor:s.background.brand,bgColor:s.surface.standard,borderColor:s.stroke.primary},{children:r(n,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:e=>{p(e),k(!1)},value:D?Array.isArray(D)?2===D.length?[new Date(D[0]),new Date(D[1])]:null:new Date(D):null},v))}))]})};export{g as default};
1
+ import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import a,{useState as o}from"react";import n from"react-calendar";import{useOutside as i}from"../../hooks/useOutside.js";import l from"../../utils/DateUtils.js";import{COLORS as s}from"../../constants/Theme.js";import c from"../../assets/icons/calendar.svg.js";import{BodySecondary as d}from"../TypographyStyle.js";import{DateBtn as m,PickerContainer as u}from"./DatePickerWrapper.styled.js";const g=g=>{let{val:D,onChange:p,calendarProps:v,disabled:b,pickerStyles:y,nativeID:f,maxDate:h,minDate:S}=g;var j,w,C,k;const[L,O]=o(!1),x=a.createRef();return i(x,(()=>{O(!1)})),e(t,{children:[e(m,Object.assign({id:f,bgColor:b?s.background.base:s.surface.standard,borderColor:s.stroke.primary,onClick:()=>O(!L)},{children:[r(d,Object.assign({style:{color:b?s.content.inactive:s.content.secondary,flex:1}},{children:D?Array.isArray(D)?(null===(j=null==D?void 0:D[0])||void 0===j?void 0:j.toString())&&(null===(w=null==D?void 0:D[1])||void 0===w?void 0:w.toString())?`${new Date(null===(C=null==D?void 0:D[0])||void 0===C?void 0:C.toString()).toLocaleDateString()}-${new Date(null===(k=null==D?void 0:D[1])||void 0===k?void 0:k.toString()).toLocaleDateString()}`:`${l.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(D.toString()).toLocaleDateString():(new Date).toLocaleDateString()})),r(c,{width:20,height:20,color:b?s.content.inactive:s.content.secondary})]})),L&&!b&&r(u,Object.assign({ref:x,style:Object.assign({},y),contentPrimary:s.content.primary,subDued:s.surface.subdued,brandColor:s.background.brand,bgColor:s.surface.standard,borderColor:s.stroke.primary},{children:r(n,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:e=>{p(e),O(!1)},maxDate:h,minDate:S,value:D?Array.isArray(D)?2===D.length?[new Date(D[0]),new Date(D[1])]:null:new Date(D):null},v))}))]})};export{g as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.316",
3
+ "version": "0.0.317",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",