@bikdotai/bik-component-library 0.0.635-0 → 0.0.635-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.
@@ -10,6 +10,7 @@ export declare const DatePickerWrapper: React.FC<{
10
10
  onChange: (val: Date | Date[]) => void;
11
11
  calendarProps?: CalendarProps;
12
12
  pickerStyles?: CSSProperties;
13
+ dateButtonStyles?: CSSProperties;
13
14
  nativeID?: string;
14
15
  disabled?: boolean;
15
16
  maxDate?: Date;
@@ -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 u,d=c(t),O=c(r);exports.DateButtonType=void 0,(u=exports.DateButtonType||(exports.DateButtonType={})).DEFAULT="default",u.LARGE="large";exports.DatePickerWrapper=r=>{let{val:c,onChange:u,calendarProps:D,disabled:p,pickerStyles:y,nativeID:g,maxDate:S,minDate:L,dateButtonType:v}=r;const[C,j]=t.useState(!1),x=d.default.createRef();a.useOutside(x,(()=>{j(!1)}));const b=()=>{var e,t,r,a;return c?Array.isArray(c)?(null===(e=null==c?void 0:c[0])||void 0===e?void 0:e.toString())&&(null===(t=null==c?void 0:c[1])||void 0===t?void 0:t.toString())?`${new Date(null===(r=null==c?void 0:c[0])||void 0===r?void 0:r.toString()).toLocaleDateString()}-${new Date(null===(a=null==c?void 0:c[1])||void 0===a?void 0:a.toString()).toLocaleDateString()}`:`${n.default.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(c.toString()).toLocaleDateString():(new Date).toLocaleDateString()};return e.jsxs(e.Fragment,{children:[e.jsxs(l.DateBtn,Object.assign({id:g,bgColor:p?o.COLORS.background.base:o.COLORS.surface.standard,borderColor:o.COLORS.stroke.primary,onClick:()=>j(!C),dateButtonType:v||exports.DateButtonType.DEFAULT},{children:[v===exports.DateButtonType.LARGE?e.jsx(s.BodyPrimary,Object.assign({style:{color:p?o.COLORS.content.inactive:o.COLORS.content.primary,flex:1}},{children:b()})):e.jsx(s.BodySecondary,Object.assign({style:{color:p?o.COLORS.content.inactive:o.COLORS.content.primary,flex:1}},{children:b()})),e.jsx(i.default,{width:v===exports.DateButtonType.LARGE?24:20,height:v===exports.DateButtonType.LARGE?24:20,color:p?o.COLORS.content.inactive:o.COLORS.content.primary})]})),C&&!p&&e.jsx(l.PickerContainer,Object.assign({ref:x,style:Object.assign({},y),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(O.default,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:e=>{u(e),j(!1)},maxDate:S,minDate:L,value:c?Array.isArray(c)?2===c.length?[new Date(c[0]),new Date(c[1])]:null:new Date(c):null},D))}))]})};
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 u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c,d=u(t),O=u(r);exports.DateButtonType=void 0,(c=exports.DateButtonType||(exports.DateButtonType={})).DEFAULT="default",c.LARGE="large";exports.DatePickerWrapper=r=>{let{val:u,onChange:c,calendarProps:y,disabled:D,pickerStyles:p,nativeID:g,maxDate:S,minDate:L,dateButtonType:v,dateButtonStyles:C}=r;const[j,x]=t.useState(!1),b=d.default.createRef();a.useOutside(b,(()=>{x(!1)}));const m=()=>{var e,t,r,a;return u?Array.isArray(u)?(null===(e=null==u?void 0:u[0])||void 0===e?void 0:e.toString())&&(null===(t=null==u?void 0:u[1])||void 0===t?void 0:t.toString())?`${new Date(null===(r=null==u?void 0:u[0])||void 0===r?void 0:r.toString()).toLocaleDateString()}-${new Date(null===(a=null==u?void 0:u[1])||void 0===a?void 0:a.toString()).toLocaleDateString()}`:`${n.default.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(u.toString()).toLocaleDateString():(new Date).toLocaleDateString()};return e.jsxs(e.Fragment,{children:[e.jsxs(l.DateBtn,Object.assign({id:g,bgColor:D?o.COLORS.background.base:o.COLORS.surface.standard,borderColor:o.COLORS.stroke.primary,onClick:()=>x(!j),dateButtonType:v||exports.DateButtonType.DEFAULT,style:C},{children:[v===exports.DateButtonType.LARGE?e.jsx(s.BodyPrimary,Object.assign({style:{color:D?o.COLORS.content.inactive:o.COLORS.content.primary,flex:1}},{children:m()})):e.jsx(s.BodySecondary,Object.assign({style:{color:D?o.COLORS.content.inactive:o.COLORS.content.primary,flex:1}},{children:m()})),e.jsx(i.default,{width:v===exports.DateButtonType.LARGE?24:20,height:v===exports.DateButtonType.LARGE?24:20,color:D?o.COLORS.content.inactive:o.COLORS.content.primary})]})),j&&!D&&e.jsx(l.PickerContainer,Object.assign({ref:b,style:Object.assign({},p),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(O.default,Object.assign({tileClassName:["custom__tile"],className:["custom__calendar"],onChange:e=>{c(e),x(!1)},maxDate:S,minDate:L,value:u?Array.isArray(u)?2===u.length?[new Date(u[0]),new Date(u[1])]:null:new Date(u):null},y))}))]})};
@@ -10,6 +10,7 @@ export declare const DatePickerWrapper: React.FC<{
10
10
  onChange: (val: Date | Date[]) => void;
11
11
  calendarProps?: CalendarProps;
12
12
  pickerStyles?: CSSProperties;
13
+ dateButtonStyles?: CSSProperties;
13
14
  nativeID?: string;
14
15
  disabled?: boolean;
15
16
  maxDate?: Date;
@@ -1 +1 @@
1
- import{jsxs as t,Fragment as e,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{BodyPrimary as d,BodySecondary as m}from"../TypographyStyle.js";import{DateBtn as u,PickerContainer as g}from"./DatePickerWrapper.styled.js";var D;!function(t){t.DEFAULT="default",t.LARGE="large"}(D||(D={}));const p=p=>{let{val:v,onChange:y,calendarProps:b,disabled:f,pickerStyles:h,nativeID:j,maxDate:S,minDate:L,dateButtonType:w}=p;const[A,C]=o(!1),k=a.createRef();i(k,(()=>{C(!1)}));const O=()=>{var t,e,r,a;return v?Array.isArray(v)?(null===(t=null==v?void 0:v[0])||void 0===t?void 0:t.toString())&&(null===(e=null==v?void 0:v[1])||void 0===e?void 0:e.toString())?`${new Date(null===(r=null==v?void 0:v[0])||void 0===r?void 0:r.toString()).toLocaleDateString()}-${new Date(null===(a=null==v?void 0:v[1])||void 0===a?void 0:a.toString()).toLocaleDateString()}`:`${l.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(v.toString()).toLocaleDateString():(new Date).toLocaleDateString()};return t(e,{children:[t(u,Object.assign({id:j,bgColor:f?s.background.base:s.surface.standard,borderColor:s.stroke.primary,onClick:()=>C(!A),dateButtonType:w||D.DEFAULT},{children:[w===D.LARGE?r(d,Object.assign({style:{color:f?s.content.inactive:s.content.primary,flex:1}},{children:O()})):r(m,Object.assign({style:{color:f?s.content.inactive:s.content.primary,flex:1}},{children:O()})),r(c,{width:w===D.LARGE?24:20,height:w===D.LARGE?24:20,color:f?s.content.inactive:s.content.primary})]})),A&&!f&&r(g,Object.assign({ref:k,style:Object.assign({},h),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:t=>{y(t),C(!1)},maxDate:S,minDate:L,value:v?Array.isArray(v)?2===v.length?[new Date(v[0]),new Date(v[1])]:null:new Date(v):null},b))}))]})};export{D as DateButtonType,p as DatePickerWrapper};
1
+ import{jsxs as t,Fragment as e,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{BodyPrimary as d,BodySecondary as m}from"../TypographyStyle.js";import{DateBtn as u,PickerContainer as g}from"./DatePickerWrapper.styled.js";var D;!function(t){t.DEFAULT="default",t.LARGE="large"}(D||(D={}));const p=p=>{let{val:y,onChange:v,calendarProps:b,disabled:f,pickerStyles:h,nativeID:S,maxDate:j,minDate:L,dateButtonType:w,dateButtonStyles:A}=p;const[C,k]=o(!1),O=a.createRef();i(O,(()=>{k(!1)}));const x=()=>{var t,e,r,a;return y?Array.isArray(y)?(null===(t=null==y?void 0:y[0])||void 0===t?void 0:t.toString())&&(null===(e=null==y?void 0:y[1])||void 0===e?void 0:e.toString())?`${new Date(null===(r=null==y?void 0:y[0])||void 0===r?void 0:r.toString()).toLocaleDateString()}-${new Date(null===(a=null==y?void 0:y[1])||void 0===a?void 0:a.toString()).toLocaleDateString()}`:`${l.getPastDate(new Date,30).toLocaleDateString()}-${(new Date).toLocaleDateString()}`:new Date(y.toString()).toLocaleDateString():(new Date).toLocaleDateString()};return t(e,{children:[t(u,Object.assign({id:S,bgColor:f?s.background.base:s.surface.standard,borderColor:s.stroke.primary,onClick:()=>k(!C),dateButtonType:w||D.DEFAULT,style:A},{children:[w===D.LARGE?r(d,Object.assign({style:{color:f?s.content.inactive:s.content.primary,flex:1}},{children:x()})):r(m,Object.assign({style:{color:f?s.content.inactive:s.content.primary,flex:1}},{children:x()})),r(c,{width:w===D.LARGE?24:20,height:w===D.LARGE?24:20,color:f?s.content.inactive:s.content.primary})]})),C&&!f&&r(g,Object.assign({ref:O,style:Object.assign({},h),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:t=>{v(t),k(!1)},maxDate:j,minDate:L,value:y?Array.isArray(y)?2===y.length?[new Date(y[0]),new Date(y[1])]:null:new Date(y):null},b))}))]})};export{D as DateButtonType,p as DatePickerWrapper};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.635-0",
3
+ "version": "0.0.635-1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",