@bikdotai/bik-component-library 0.0.331 → 0.0.332-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.
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("styled-components"),t=require("../../../../TypographyStyle.js"),s=require("./IntegerPositiveSingle.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const n=i(r).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("styled-components"),t=require("../../../../TypographyStyle.js"),n=require("./IntegerPositiveSingle.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const i=s(r).default.div`
2
2
  flex-direction: row;
3
3
  display: flex;
4
4
  align-items: center;
5
5
  gap: 8px;
6
- `,l=r=>{let{val:i,onChange:l,errors:a,disabled:o}=r;return e.jsxs(n,{children:[e.jsx(s.default,{disabled:o,val:i,onChange:l,errors:a}),e.jsx(t.BodySecondary,{children:"time(s)"})]})};exports.default=r=>e.jsx(l,Object.assign({},r));
6
+ `,o=r=>{let{val:s,onChange:o,errors:l,disabled:a,connectorType:d}=r;return e.jsxs(i,{children:[e.jsx(n.default,{disabled:a,val:s,onChange:o,errors:l,connectorType:d}),e.jsx(t.BodySecondary,{children:"time(s)"})]})};exports.default=r=>e.jsx(o,Object.assign({},r));
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../../TypographyStyle.js"),s=require("./IntegerPositiveSingle.js");const t=t=>{let{val:i,onChange:n,errors:a,nativeID:l,disabled:d}=t;const o=parseInt(null==i?void 0:i.toString())>1?"days":"day";return e.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8,alignItems:"center"}},{children:[e.jsx(s.default,{disabled:d,nativeID:l,val:null!=i?i:1,onChange:n,errors:a}),e.jsx("div",{children:e.jsx(r.BodySecondary,{children:o})})]}))};exports.default=r=>e.jsx(t,Object.assign({},r));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../../../TypographyStyle.js"),n=require("./IntegerPositiveSingle.js");const s=s=>{let{val:t,onChange:i,errors:a,nativeID:l,disabled:o,connectorType:d}=s;const c=parseInt(null==t?void 0:t.toString())>1?"days":"day";return e.jsxs("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8,alignItems:"center"}},{children:[e.jsx(n.default,{connectorType:d,disabled:o,nativeID:l,val:null!=t?t:1,onChange:i,errors:a}),e.jsx("div",{children:e.jsx(r.BodySecondary,{children:c})})]}))};exports.default=r=>e.jsx(s,Object.assign({},r));
@@ -1,7 +1,7 @@
1
1
  import { Placement } from '@popperjs/core';
2
2
  import React from 'react';
3
3
  export interface CustomTimeProps {
4
- time: string;
4
+ time?: string;
5
5
  date: Date;
6
6
  minDate?: Date;
7
7
  onChange: (date: Date) => void;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("date-fns"),t=require("react"),o=require("./DateSelector/DateSelector.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js");require("../../constants/Theme.js"),require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../input/Input.js");require("../dropdown/MenuItem/MenuItem.js");var d=require("../../utils/DateUtils.js"),u=require("../../assets/icons/chevronDown.svg.js"),a=require("../../assets/icons/clock.svg.js"),l=require("./CustomDateTime.styled.js");const c=()=>{const e=[];for(let r=0;r<2;r++)for(let t=0;t<12;t++){let o;o=0===t?"12":t<10?`0${t}`:`${t}`;const s=`${o}:00 ${0===r?"AM":"PM"}`,n=`${o}:30 ${0===r?"AM":"PM"}`;e.push({label:s,value:s,selected:!1},{label:n,value:n,selected:!1})}return e};exports.CustomDateTime=p=>{const[m,j]=t.useState(p.time),[D,w]=t.useState(p.date);t.useEffect((()=>{p.setError(void 0);const e=d.default.convert12HourTimeTo24Hour(m),t=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&e<t)return void p.setError("Selected time should be later than current time");p.setError(void 0);const[o,s]=e.split(":"),n=new Date(D.getTime());n.setHours(+o,+s),p.onChange(n)}),[D,m]);return e.jsxs(l.CustomDateTimeStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(o.default,{customDate:D,setCustomDate:w,placement:p.placement,minDate:p.minDate})})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(s.DropdownPopover,Object.assign({options:c(),onSelect:e=>{j(e.value)}},{children:e.jsx(i.Input,{value:m,leftIcon:{icon:a.default},rightIcon:{icon:u.default},onChangeText:e=>(e=>{if(d.default.timeFormatValidation(e)){const t=d.default.convert12HourTimeTo24Hour(e),o=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&t<o)return void p.setError("Selected time should be later than current time");p.setError(void 0),j(e)}else p.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),p.error&&e.jsx(n.BodySecondary,Object.assign({style:{paddingTop:8}},{children:p.error}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("date-fns"),t=require("react"),o=require("./DateSelector/DateSelector.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js");require("../../constants/Theme.js"),require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../input/Input.js");require("../dropdown/MenuItem/MenuItem.js");var d=require("../../utils/DateUtils.js"),u=require("../../assets/icons/chevronDown.svg.js"),a=require("../../assets/icons/clock.svg.js"),l=require("./CustomDateTime.styled.js");const c=()=>{const e=[];for(let r=0;r<2;r++)for(let t=0;t<12;t++){let o;o=0===t?"12":t<10?`0${t}`:`${t}`;const s=`${o}:00 ${0===r?"AM":"PM"}`,n=`${o}:30 ${0===r?"AM":"PM"}`;e.push({label:s,value:s,selected:!1},{label:n,value:n,selected:!1})}return e};exports.CustomDateTime=p=>{const[m,j]=t.useState(p.time),[D,w]=t.useState(p.date);t.useEffect((()=>{p.setError(void 0);const e=d.default.convert12HourTimeTo24Hour(m),t=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&e<t)return void p.setError("Selected time should be later than current time");p.setError(void 0);const[o,s]=e.split(":"),n=new Date(D.getTime());n.setHours(+o,+s),p.onChange(n)}),[D,m]);return e.jsxs(l.CustomDateTimeStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(o.default,{customDate:D,setCustomDate:w,placement:p.placement,minDate:p.minDate})})),p.time&&e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(s.DropdownPopover,Object.assign({options:c(),onSelect:e=>{j(e.value)}},{children:e.jsx(i.Input,{value:m,leftIcon:{icon:a.default},rightIcon:{icon:u.default},onChangeText:e=>(e=>{if(d.default.timeFormatValidation(e)){const t=d.default.convert12HourTimeTo24Hour(e),o=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&t<o)return void p.setError("Selected time should be later than current time");p.setError(void 0),j(e)}else p.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),p.error&&e.jsx(n.BodySecondary,Object.assign({style:{paddingTop:8}},{children:p.error}))]})};
@@ -1,6 +1,6 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import t from"styled-components";import{BodySecondary as i}from"../../../../TypographyStyle.js";import o from"./IntegerPositiveSingle.js";const n=t.div`
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"styled-components";import{BodySecondary as t}from"../../../../TypographyStyle.js";import n from"./IntegerPositiveSingle.js";const i=o.div`
2
2
  flex-direction: row;
3
3
  display: flex;
4
4
  align-items: center;
5
5
  gap: 8px;
6
- `,s=t=>{let{val:s,onChange:a,errors:l,disabled:m}=t;return r(n,{children:[e(o,{disabled:m,val:s,onChange:a,errors:l}),e(i,{children:"time(s)"})]})};var a=r=>e(s,Object.assign({},r));export{a as default};
6
+ `,s=o=>{let{val:s,onChange:a,errors:l,disabled:p,connectorType:c}=o;return r(i,{children:[e(n,{disabled:p,val:s,onChange:a,errors:l,connectorType:c}),e(t,{children:"time(s)"})]})};var a=r=>e(s,Object.assign({},r));export{a as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{BodySecondary as t}from"../../../../TypographyStyle.js";import i from"./IntegerPositiveSingle.js";const n=n=>{let{val:a,onChange:l,errors:s,nativeID:o,disabled:d}=n;const c=parseInt(null==a?void 0:a.toString())>1?"days":"day";return r("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8,alignItems:"center"}},{children:[e(i,{disabled:d,nativeID:o,val:null!=a?a:1,onChange:l,errors:s}),e("div",{children:e(t,{children:c})})]}))};var a=r=>e(n,Object.assign({},r));export{a as default};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{BodySecondary as n}from"../../../../TypographyStyle.js";import t from"./IntegerPositiveSingle.js";const i=i=>{let{val:o,onChange:a,errors:l,nativeID:s,disabled:c,connectorType:d}=i;const p=parseInt(null==o?void 0:o.toString())>1?"days":"day";return r("div",Object.assign({style:{flexDirection:"row",display:"flex",gap:8,alignItems:"center"}},{children:[e(t,{connectorType:d,disabled:c,nativeID:s,val:null!=o?o:1,onChange:a,errors:l}),e("div",{children:e(n,{children:p})})]}))};var o=r=>e(i,Object.assign({},r));export{o as default};
@@ -1,7 +1,7 @@
1
1
  import { Placement } from '@popperjs/core';
2
2
  import React from 'react';
3
3
  export interface CustomTimeProps {
4
- time: string;
4
+ time?: string;
5
5
  date: Date;
6
6
  minDate?: Date;
7
7
  onChange: (date: Date) => void;
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o}from"react/jsx-runtime";import{format as t,isToday as r}from"date-fns";import{useState as n,useEffect as s}from"react";import i from"./DateSelector/DateSelector.js";import{DropdownPopover as m}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{BodySecondary as p}from"../TypographyStyle.js";import"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as d}from"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import l from"../../utils/DateUtils.js";import c from"../../assets/icons/chevronDown.svg.js";import a from"../../assets/icons/clock.svg.js";import{CustomDateTimeStyle as u}from"./CustomDateTime.styled.js";const j=()=>{const e=[];for(let o=0;o<2;o++)for(let t=0;t<12;t++){let r;r=0===t?"12":t<10?`0${t}`:`${t}`;const n=`${r}:00 ${0===o?"AM":"PM"}`,s=`${r}:30 ${0===o?"AM":"PM"}`;e.push({label:n,value:n,selected:!1},{label:s,value:s,selected:!1})}return e},w=w=>{const[D,f]=n(w.time),[h,v]=n(w.date);s((()=>{w.setError(void 0);const e=l.convert12HourTimeTo24Hour(D),o=t(new Date,"HH:mm:ss");if(r(h)&&e<o)return void w.setError("Selected time should be later than current time");w.setError(void 0);const[n,s]=e.split(":"),i=new Date(h.getTime());i.setHours(+n,+s),w.onChange(i)}),[h,D]);return e(u,{children:[e("div",Object.assign({style:{display:"flex",gap:16}},{children:[o("div",Object.assign({style:{flex:1}},{children:o(i,{customDate:h,setCustomDate:v,placement:w.placement,minDate:w.minDate})})),o("div",Object.assign({style:{flex:1}},{children:o(m,Object.assign({options:j(),onSelect:e=>{f(e.value)}},{children:o(d,{value:D,leftIcon:{icon:a},rightIcon:{icon:c},onChangeText:e=>(e=>{if(l.timeFormatValidation(e)){const o=l.convert12HourTimeTo24Hour(e),n=t(new Date,"HH:mm:ss");if(r(h)&&o<n)return void w.setError("Selected time should be later than current time");w.setError(void 0),f(e)}else w.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),w.error&&o(p,Object.assign({style:{paddingTop:8}},{children:w.error}))]})};export{w as CustomDateTime};
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{format as t,isToday as r}from"date-fns";import{useState as n,useEffect as s}from"react";import i from"./DateSelector/DateSelector.js";import{DropdownPopover as m}from"../dropdown/DropdownPopover/index.js";import"../dropdown/Dropdown.js";import"../dropdown/ChipDropdown.js";import"../zeroState/ZeroState.js";import{BodySecondary as p}from"../TypographyStyle.js";import"../../constants/Theme.js";import"../dropdown/OpenedDropdown/components/description/Description.styled.js";import"../checkBox/CheckBox.styled.js";import"../list-item/ListItem.js";import"../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js";import"../dropdown/OpenedDropdown/components/menu/MenuItem.js";import"../dropdown/OpenedDropdown/components/menu/MenuList.styled.js";import"../button/Button.js";import"../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js";import"../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js";import{Input as d}from"../input/Input.js";import"../dropdown/MenuItem/MenuItem.js";import l from"../../utils/DateUtils.js";import c from"../../assets/icons/chevronDown.svg.js";import a from"../../assets/icons/clock.svg.js";import{CustomDateTimeStyle as u}from"./CustomDateTime.styled.js";const j=()=>{const e=[];for(let o=0;o<2;o++)for(let t=0;t<12;t++){let r;r=0===t?"12":t<10?`0${t}`:`${t}`;const n=`${r}:00 ${0===o?"AM":"PM"}`,s=`${r}:30 ${0===o?"AM":"PM"}`;e.push({label:n,value:n,selected:!1},{label:s,value:s,selected:!1})}return e},w=w=>{const[D,f]=n(w.time),[h,v]=n(w.date);s((()=>{w.setError(void 0);const e=l.convert12HourTimeTo24Hour(D),o=t(new Date,"HH:mm:ss");if(r(h)&&e<o)return void w.setError("Selected time should be later than current time");w.setError(void 0);const[n,s]=e.split(":"),i=new Date(h.getTime());i.setHours(+n,+s),w.onChange(i)}),[h,D]);return e(u,{children:[e("div",Object.assign({style:{display:"flex",gap:16}},{children:[o("div",Object.assign({style:{flex:1}},{children:o(i,{customDate:h,setCustomDate:v,placement:w.placement,minDate:w.minDate})})),w.time&&o("div",Object.assign({style:{flex:1}},{children:o(m,Object.assign({options:j(),onSelect:e=>{f(e.value)}},{children:o(d,{value:D,leftIcon:{icon:a},rightIcon:{icon:c},onChangeText:e=>(e=>{if(l.timeFormatValidation(e)){const o=l.convert12HourTimeTo24Hour(e),n=t(new Date,"HH:mm:ss");if(r(h)&&o<n)return void w.setError("Selected time should be later than current time");w.setError(void 0),f(e)}else w.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),w.error&&o(p,Object.assign({style:{paddingTop:8}},{children:w.error}))]})};export{w as CustomDateTime};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikdotai/bik-component-library",
3
- "version": "0.0.331",
3
+ "version": "0.0.332-1",
4
4
  "description": "Bik Component Library",
5
5
  "repository": {
6
6
  "type": "git",