@televet/kibble-ui 5.0.22 → 5.0.23-alpha.2
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.
- package/dist/chunks/dateTimePicker.component-BBFEwtxH.js +2 -0
- package/dist/chunks/{dateTimePicker.component-BlWhC5aT.js.map → dateTimePicker.component-BBFEwtxH.js.map} +1 -1
- package/dist/chunks/dateTimePicker.component-e_FSHVo4.js +331 -0
- package/dist/chunks/dateTimePicker.component-e_FSHVo4.js.map +1 -0
- package/dist/chunks/timePicker.component-BjA0Ax6p.js +239 -0
- package/dist/chunks/timePicker.component-BjA0Ax6p.js.map +1 -0
- package/dist/chunks/timePicker.component-DvRX0gHU.js +2 -0
- package/dist/chunks/timePicker.component-DvRX0gHU.js.map +1 -0
- package/dist/chunks/timeRange.component-BE5hGSQM.js +26 -0
- package/dist/chunks/{timeRange.component-D3Db8lvh.js.map → timeRange.component-BE5hGSQM.js.map} +1 -1
- package/dist/chunks/timeRange.component-BYa0-d6e.js +2 -0
- package/dist/chunks/{timeRange.component-BZHpZeAX.js.map → timeRange.component-BYa0-d6e.js.map} +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/index.js +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/types/components/DateTimePicker/components/DateTimePickerCustomView/dateTimePickerCustomView.component.d.ts +2 -1
- package/dist/types/components/DateTimePicker/components/DateTimePickerRangeSelector/dateTimePickerRangeSelector.component.d.ts +2 -1
- package/dist/types/components/DateTimePicker/dateTimePicker.component.d.ts +6 -1
- package/dist/types/components/TimePicker/timePicker.component.d.ts +9 -1
- package/dist/types/shared/utils/convertToTimezoneOverride.d.ts +5 -0
- package/package.json +6 -3
- package/dist/chunks/dateTimePicker.component-BlWhC5aT.js +0 -2
- package/dist/chunks/dateTimePicker.component-CLAI_Q6e.js +0 -317
- package/dist/chunks/dateTimePicker.component-CLAI_Q6e.js.map +0 -1
- package/dist/chunks/timePicker.component-BCMX6aqb.js +0 -220
- package/dist/chunks/timePicker.component-BCMX6aqb.js.map +0 -1
- package/dist/chunks/timePicker.component-D5hw80VV.js +0 -2
- package/dist/chunks/timePicker.component-D5hw80VV.js.map +0 -1
- package/dist/chunks/timeRange.component-BZHpZeAX.js +0 -19
- package/dist/chunks/timeRange.component-D3Db8lvh.js +0 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../chunks/alert.component-nhRTQ5KK.js"),b=require("../chunks/alert.types-8mtsdXr4.js"),h=require("../chunks/avatar.component-BGgZoVJS.js"),p=require("../chunks/avatar.types-Bmt5Uhfb.js"),S=require("../chunks/avatarGroup.component-CJCQSIyr.js"),k=require("../chunks/button.component-DjdgBXDC.js"),e=require("../chunks/button.types-DXP4uRV8.js"),C=require("../chunks/buttonGroup.component-pR0mvmm7.js"),P=require("../chunks/calendar.component-BFSyxaB6.js"),D=require("../chunks/card.component-BmBiYbMV.js"),M=require("../chunks/card.types-MvkQTTZF.js"),z=require("../chunks/characterCounter.component-BRHLt929.js"),x=require("../chunks/checkbox.component-C132vkan.js"),B=require("../chunks/checkboxGroup.component-2U0ZW1TD.js"),V=require("../chunks/conversationCard.component-CscMIq51.js"),f=require("../chunks/datePicker.component-BuGpHTzS.js"),I=require("../chunks/datePicker.provider-i35-VNAb.js"),n=require("../chunks/dateTimePicker.component-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../chunks/alert.component-nhRTQ5KK.js"),b=require("../chunks/alert.types-8mtsdXr4.js"),h=require("../chunks/avatar.component-BGgZoVJS.js"),p=require("../chunks/avatar.types-Bmt5Uhfb.js"),S=require("../chunks/avatarGroup.component-CJCQSIyr.js"),k=require("../chunks/button.component-DjdgBXDC.js"),e=require("../chunks/button.types-DXP4uRV8.js"),C=require("../chunks/buttonGroup.component-pR0mvmm7.js"),P=require("../chunks/calendar.component-BFSyxaB6.js"),D=require("../chunks/card.component-BmBiYbMV.js"),M=require("../chunks/card.types-MvkQTTZF.js"),z=require("../chunks/characterCounter.component-BRHLt929.js"),x=require("../chunks/checkbox.component-C132vkan.js"),B=require("../chunks/checkboxGroup.component-2U0ZW1TD.js"),V=require("../chunks/conversationCard.component-CscMIq51.js"),f=require("../chunks/datePicker.component-BuGpHTzS.js"),I=require("../chunks/datePicker.provider-i35-VNAb.js"),n=require("../chunks/dateTimePicker.component-BBFEwtxH.js"),w=require("../chunks/divider.component-BX3zyB7O.js"),r=require("../chunks/divider.types-DBNcs0IR.js"),A=require("../chunks/heading.component-DnoZOXdz.js"),W=require("../chunks/icon.component-B1hr5lLa.js"),G=require("../chunks/icon.types-2obj_NKG.js"),R=require("../chunks/link.component-_YXG8MDq.js"),u=require("../chunks/logo.types-88a31xCx.js"),d=require("../chunks/maintenanceBanner.types-BsNjAlXa.js"),L=require("../chunks/menu.component-D2V9Q1Y5.js"),t=require("../chunks/modal.types-D_t0UdS6.js"),K=require("../chunks/notificationCounter.component-CBwi5vXa.js"),m=require("../chunks/notificationCounter.types-B_-siNfi.js"),O=require("../chunks/picture.component-BA2hgdZy.js"),l=require("../chunks/pinInput.types-Can9f1Eu.js"),N=require("../chunks/popover.component-DTjA1GSd.js"),i=require("../chunks/popover.types-ChA9ccQ2.js"),a=require("../chunks/radioGroup.types-U1ep9nrN.js"),E=require("../chunks/radiomark.component-YJNr68s7.js"),F=require("../chunks/rating.component-DsHkKmA7.js"),H=require("../chunks/ratingDots.component-CZ370iI3.js"),j=require("../chunks/select.component-OrsHXCMz.js"),J=require("../chunks/sortableList.component-2yX2pXs7.js"),Q=require("../chunks/spinner.component-Dq6u4vVL.js"),U=require("../chunks/spinner.types-BCLN5-H2.js"),_=require("../chunks/styledAvatar.types-BG2G_U-W.js"),q=require("../chunks/swatch.types-AZLB8OWG.js"),X=require("../chunks/switch.component-BYEMhBCA.js"),s=require("../chunks/tab.types-B8hOk0uV.js"),Y=require("../chunks/tag.component-C98Wf07v.js"),T=require("../chunks/tag.types-BnDFgTvb.js"),v=require("../chunks/tagBlock.component-B899iqQP.js"),Z=require("../chunks/text.component-BDDz5KQP.js"),$=require("../chunks/textInput.component-CwTc0h_F.js"),ee=require("../chunks/textarea.component-BIg_XX_R.js"),y=require("../chunks/timePicker.component-DvRX0gHU.js"),te=require("../chunks/timeRange.component-BYa0-d6e.js"),oe=require("../chunks/timestamp.component-BfmZPfy5.js"),ne=require("./components/Toast/index.cjs"),re=require("../chunks/tooltip.component-DBw-hAPU.js"),ie=require("../chunks/numberInput.component-DGPEz0Fv.js"),ae=require("../chunks/withDarkMode-R08khTA6.js"),se=require("../chunks/withLightMode-Crw8xtkD.js"),ce=require("./hooks/useBreakpoint/index.cjs"),pe=require("./hooks/useColorMode/index.cjs"),ue=require("./hooks/useColorModeValue/index.cjs"),de=require("./hooks/useDeviceType/index.cjs"),o=require("./shared/types/index.cjs"),me=require("../chunks/theme-BFbOz0Jj.js"),c=require("../chunks/theme.provider-DwwXiHZn.js");exports.Alert=g.Alert;exports.alertButtonPositions=b.alertButtonPositions;exports.Avatar=h.Avatar;exports.avatarSizes=p.avatarSizes;exports.avatarVariants=p.avatarVariants;exports.AvatarGroup=S.AvatarGroup;exports.Button=k.Button;exports.buttonConfigVariants=e.buttonConfigVariants;exports.buttonIconPositions=e.buttonIconPositions;exports.buttonSizes=e.buttonSizes;exports.buttonSpinnerPlacements=e.buttonSpinnerPlacements;exports.buttonVariants=e.buttonVariants;exports.ButtonGroup=C.ButtonGroup;exports.Calendar=P.Calendar;exports.Card=D.Card;exports.cardSizes=M.cardSizes;exports.CharacterCounter=z.CharacterCounter;exports.Checkbox=x.WrappedCheckbox;exports.CheckboxGroup=B.WrappedCheckboxGroup;exports.ConversationCard=V.ConversationCard;exports.DatePicker=f.DatePicker;exports.DateFormats=I.DateFormats;exports.DateTimePicker=n.DateTimePicker;exports.DateTimePickerDefaultOptionValue=n.DateTimePickerDefaultOptionValue;exports.calendarViews=n.calendarViews;exports.Divider=w.Divider;exports.dividerOrientations=r.dividerOrientations;exports.dividerSizes=r.dividerSizes;exports.dividerVariants=r.dividerVariants;exports.Heading=A.WrappedHeading;exports.Icon=W.Icon;exports.iconSizes=G.iconSizes;exports.Link=R.Link;exports.Logo=u.Logo;exports.logoTypes=u.logoTypes;exports.MaintenanceBanner=d.MaintenanceBanner;exports.maintenanceBannerEnvKeys=d.maintenanceBannerEnvKeys;exports.Menu=L.Menu;exports.Modal=t.Modal;exports.modalMotionPresets=t.modalMotionPresets;exports.modalPlacements=t.modalPlacements;exports.modalScrollBehaviors=t.modalScrollBehaviors;exports.modalSizes=t.modalSizes;exports.NotificationCounter=K.NotificationCounter;exports.notificationCounterSizes=m.notificationCounterSizes;exports.notificationCounterVariants=m.notificationCounterVariants;exports.Picture=O.Picture;exports.PinInput=l.WrappedPinInput;exports.pinInputTypes=l.pinInputTypes;exports.Popover=N.Popover;exports.popoverSizes=i.popoverSizes;exports.popoverTriggerTypes=i.popoverTriggerTypes;exports.popoverVariants=i.popoverVariants;exports.RadioGroup=a.WrappedRadioGroup;exports.radioAlignments=a.radioAlignments;exports.radioTypes=a.radioTypes;exports.Radiomark=E.Radiomark;exports.Rating=F.WrappedRating;exports.RatingDots=H.WrappedRatingDots;exports.Select=j.WrappedSelect;exports.SortableList=J.SortableList;exports.Spinner=Q.Spinner;exports.spinnerSizes=U.spinnerSizes;exports.StyledAvatar=_.StyledAvatar;exports.styledAvatarTypes=_.styledAvatarTypes;exports.Swatch=q.Swatch;exports.swatchSizes=q.swatchSizes;exports.Switch=X.WrappedSwitch;exports.Tabs=s.Tabs;exports.tabIconPositions=s.tabIconPositions;exports.tabSizes=s.tabSizes;exports.Tag=Y.Tag;exports.closeButtonDisplays=T.closeButtonDisplays;exports.tagSizes=T.tagSizes;exports.TagBlock=v.TagBlock;exports.TagDisabledState=v.TagDisabledState;exports.Text=Z.WrappedText;exports.TextInput=$.WrappedTextInput;exports.Textarea=ee.WrappedTextarea;exports.Meridiem=y.Meridiem;exports.TimePicker=y.TimePicker;exports.TimeRange=te.TimeRange;exports.Timestamp=oe.Timestamp;exports.useToast=ne.useToast;exports.Tooltip=re.Tooltip;exports.NumberInput=ie.WrappedNumberInput;exports.withDarkMode=ae.withDarkMode;exports.withLightMode=se.withLightMode;exports.useBreakpoint=ce.useBreakpoint;exports.useColorMode=pe.useColorMode;exports.useColorModeValue=ue.useColorModeValue;exports.useDeviceType=de.useDeviceType;exports.alignments=o.alignments;exports.flexDirections=o.flexDirections;exports.placements=o.placements;exports.statuses=o.statuses;exports.typographyVariants=o.typographyVariants;exports.colorModeThemeKey=me.colorModeThemeKey;exports.KibbleThemeProvider=c.KibbleThemeProvider;exports.kibbleThemeConfig=c.kibbleThemeConfig;exports.system=c.system;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -15,7 +15,7 @@ import { W as h } from "../../chunks/checkboxGroup.component-DW9qUlSm.js";
|
|
|
15
15
|
import { C as L } from "../../chunks/conversationCard.component-DByFo4jj.js";
|
|
16
16
|
import { D as G } from "../../chunks/datePicker.component-CLTjEX7i.js";
|
|
17
17
|
import { D as O } from "../../chunks/datePicker.provider-CttuPiiS.js";
|
|
18
|
-
import { D as F, a as H, c as K } from "../../chunks/dateTimePicker.component-
|
|
18
|
+
import { D as F, a as H, c as K } from "../../chunks/dateTimePicker.component-e_FSHVo4.js";
|
|
19
19
|
import { D as q } from "../../chunks/divider.component-CFOh4Nw3.js";
|
|
20
20
|
import { d as Q, a as U, b as X } from "../../chunks/divider.types-6MEkMNbx.js";
|
|
21
21
|
import { W as Z } from "../../chunks/heading.component-CpSAN3cv.js";
|
|
@@ -50,8 +50,8 @@ import { T as Sa, a as ba } from "../../chunks/tagBlock.component-CT7_RyJ-.js";
|
|
|
50
50
|
import { W as Ca } from "../../chunks/text.component-DhuUgP3j.js";
|
|
51
51
|
import { W as ga } from "../../chunks/textInput.component-BeiTxTkS.js";
|
|
52
52
|
import { W as Wa } from "../../chunks/textarea.component-C6Wt1Pk8.js";
|
|
53
|
-
import { M as Ba, T as ka } from "../../chunks/timePicker.component-
|
|
54
|
-
import { T as Aa } from "../../chunks/timeRange.component-
|
|
53
|
+
import { M as Ba, T as ka } from "../../chunks/timePicker.component-BjA0Ax6p.js";
|
|
54
|
+
import { T as Aa } from "../../chunks/timeRange.component-BE5hGSQM.js";
|
|
55
55
|
import { T as Ia } from "../../chunks/timestamp.component-DkLjxUsy.js";
|
|
56
56
|
import { useToast as ha } from "./Toast/index.js";
|
|
57
57
|
import { T as La } from "../../chunks/tooltip.component-CHohp2qn.js";
|
package/dist/esm/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { W as w } from "../chunks/checkboxGroup.component-DW9qUlSm.js";
|
|
|
15
15
|
import { C as L } from "../chunks/conversationCard.component-DByFo4jj.js";
|
|
16
16
|
import { D as G } from "../chunks/datePicker.component-CLTjEX7i.js";
|
|
17
17
|
import { D as N } from "../chunks/datePicker.provider-CttuPiiS.js";
|
|
18
|
-
import { D as E, a as F, c as H } from "../chunks/dateTimePicker.component-
|
|
18
|
+
import { D as E, a as F, c as H } from "../chunks/dateTimePicker.component-e_FSHVo4.js";
|
|
19
19
|
import { D as q } from "../chunks/divider.component-CFOh4Nw3.js";
|
|
20
20
|
import { d as Q, a as U, b as X } from "../chunks/divider.types-6MEkMNbx.js";
|
|
21
21
|
import { W as Z } from "../chunks/heading.component-CpSAN3cv.js";
|
|
@@ -50,8 +50,8 @@ import { T as Sr, a as br } from "../chunks/tagBlock.component-CT7_RyJ-.js";
|
|
|
50
50
|
import { W as Cr } from "../chunks/text.component-DhuUgP3j.js";
|
|
51
51
|
import { W as Dr } from "../chunks/textInput.component-BeiTxTkS.js";
|
|
52
52
|
import { W as hr } from "../chunks/textarea.component-C6Wt1Pk8.js";
|
|
53
|
-
import { M as Mr, T as kr } from "../chunks/timePicker.component-
|
|
54
|
-
import { T as zr } from "../chunks/timeRange.component-
|
|
53
|
+
import { M as Mr, T as kr } from "../chunks/timePicker.component-BjA0Ax6p.js";
|
|
54
|
+
import { T as zr } from "../chunks/timeRange.component-BE5hGSQM.js";
|
|
55
55
|
import { T as Vr } from "../chunks/timestamp.component-DkLjxUsy.js";
|
|
56
56
|
import { useToast as wr } from "./components/Toast/index.js";
|
|
57
57
|
import { T as Lr } from "../chunks/tooltip.component-CHohp2qn.js";
|
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
interface DateTimePickerCustomViewProps {
|
|
3
3
|
/** Determines if the calendar view is single. */
|
|
4
4
|
isSingleView: boolean;
|
|
5
|
+
timezoneOverride?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare const DateTimePickerCustomView: ({ isSingleView }: DateTimePickerCustomViewProps) => React.JSX.Element;
|
|
7
|
+
export declare const DateTimePickerCustomView: ({ isSingleView, timezoneOverride, }: DateTimePickerCustomViewProps) => React.JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -5,6 +5,7 @@ interface DateTimePickerRangeSelectorProps {
|
|
|
5
5
|
label: string;
|
|
6
6
|
/** Type of range selector. */
|
|
7
7
|
rangeType: FocusedInput;
|
|
8
|
+
timezoneOverride?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare const DateTimePickerRangeSelector: ({ label, rangeType, }: DateTimePickerRangeSelectorProps) => React.JSX.Element;
|
|
10
|
+
export declare const DateTimePickerRangeSelector: ({ label, rangeType, timezoneOverride, }: DateTimePickerRangeSelectorProps) => React.JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -25,9 +25,14 @@ export interface DateTimePickerProps extends DateProps {
|
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
showQuickOptions?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether a specific timezone should override the default timezone we detect from the browser,
|
|
30
|
+
* typically used for impersonations
|
|
31
|
+
*/
|
|
32
|
+
timezoneOverride?: string;
|
|
28
33
|
/** Data test id for the date time picker.
|
|
29
34
|
* @default kibble-datetime-picker
|
|
30
35
|
*/
|
|
31
36
|
'data-testid'?: string;
|
|
32
37
|
}
|
|
33
|
-
export declare const DateTimePicker: ({ trigger, calendarView, portalled, showQuickOptions, ["data-testid"]: dataTestId, ...rest }: DateTimePickerProps) => React.JSX.Element;
|
|
38
|
+
export declare const DateTimePicker: ({ trigger, calendarView, portalled, showQuickOptions, ["data-testid"]: dataTestId, timezoneOverride, ...rest }: DateTimePickerProps) => React.JSX.Element;
|
|
@@ -20,10 +20,18 @@ export interface TimePickerProps {
|
|
|
20
20
|
* @default bottom
|
|
21
21
|
*/
|
|
22
22
|
placement?: Placement;
|
|
23
|
+
/**
|
|
24
|
+
* If set, displays and processes the time in a specific timezone (typically for impersonation)
|
|
25
|
+
*/
|
|
26
|
+
timezoneOverride?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Show the timezone abbreviation (if available) beside the component
|
|
29
|
+
*/
|
|
30
|
+
showTimezoneAbr?: boolean;
|
|
23
31
|
/**
|
|
24
32
|
* Data test id for the time picker.
|
|
25
33
|
* @default kibble-timepicker
|
|
26
34
|
*/
|
|
27
35
|
'data-testid'?: string;
|
|
28
36
|
}
|
|
29
|
-
export declare const TimePicker: ({ initialTime, inputProps, minuteInterval, onTimeChange, onClose, placement, ["data-testid"]: dataTestId, }: TimePickerProps) => React.JSX.Element;
|
|
37
|
+
export declare const TimePicker: ({ initialTime, inputProps, minuteInterval, onTimeChange, onClose, placement, timezoneOverride, showTimezoneAbr, ["data-testid"]: dataTestId, }: TimePickerProps) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"packages/*"
|
|
5
5
|
],
|
|
6
6
|
"description": "Kibble Design System by Otto",
|
|
7
|
-
"version": "5.0.
|
|
7
|
+
"version": "5.0.23-alpha.2",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist/cjs/index.cjs",
|
|
10
10
|
"module": "./dist/esm/index.js",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"publishBeta": "npm run build && npm publish --tag beta",
|
|
37
37
|
"start": "WATCHPACK_POLLING=1 npm run generate:icons & WATCHPACK_POLLING=1 npm run generate:logos & WATCHPACK_POLLING=1 npm run theme:watch & WATCHPACK_POLLING=1 storybook dev -p 6006",
|
|
38
38
|
"test-storybook": "npm run build:preparation && vitest --project=storybook",
|
|
39
|
-
"theme:watch": "chakra typegen ./src/theme/theme.config.ts --watch"
|
|
39
|
+
"theme:watch": "chakra typegen ./src/theme/theme.config.ts --watch",
|
|
40
|
+
"makeLocalPackage": "npm run build && npm pack"
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": ">=20.0.0",
|
|
@@ -175,16 +176,18 @@
|
|
|
175
176
|
"peerDependencies": {
|
|
176
177
|
"@emotion/react": "^11.14.0",
|
|
177
178
|
"date-fns": "^4.1.0",
|
|
179
|
+
"date-fns-tz": "^3.2.0",
|
|
178
180
|
"lodash-es": "^4.17.21",
|
|
181
|
+
"@date-fns/tz": "^1.4.1",
|
|
179
182
|
"react": "^19.0.0"
|
|
180
183
|
},
|
|
181
184
|
"dependencies": {
|
|
182
|
-
"@televet/kibble-primitives": "*",
|
|
183
185
|
"@chakra-ui/react": "^3.24.0",
|
|
184
186
|
"@datepicker-react/hooks": "^2.8.4",
|
|
185
187
|
"@dnd-kit/core": "^6.3.1",
|
|
186
188
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
187
189
|
"@dnd-kit/sortable": "^10.0.0",
|
|
190
|
+
"@televet/kibble-primitives": "*",
|
|
188
191
|
"next-themes": "^0.4.6"
|
|
189
192
|
}
|
|
190
193
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./jsx-runtime-BjDatQAs.js"),d=require("react"),O=require("./button.component-DjdgBXDC.js"),u=require("./datePicker.provider-i35-VNAb.js"),N=require("./usePortalContentRef-CTrvBQ7I.js"),I=require("./popover.recipe-CtptsJg6.js"),l=require("./format-CK7Imh-5.js"),v=require("./isToday-BgNkHh5t.js"),Y=require("./popover-root-provider-CZDbUJ2K.js"),E=require("./flex-BOU6tYUd.js"),L=require("../cjs/hooks/useBreakpoint/index.cjs"),j=require("./index-BQRnVsAg.js"),B=require("./text.component-BDDz5KQP.js"),H=require("./textInput.component-CwTc0h_F.js"),$=require("./timePicker.component-D5hw80VV.js"),f=require("./grid-item-CH3dbZHL.js"),G=require("./divider.component-BX3zyB7O.js"),z=require("./create-slot-recipe-context-HXE1VazG.js"),A=require("./index-Ts8g8jZd.js"),R=require("./popover-C7aj8Iwj.js");var o=(t=>(t.Today="Today",t.Yesterday="Yesterday",t.ThisWeek="ThisWeek",t.LastWeek="LastWeek",t.ThisMonth="ThisMonth",t.LastMonth="LastMonth",t.Custom="Custom",t))(o||{});const Q=["single","double"],V=[{label:"Today",value:o.Today},{label:"Yesterday",value:o.Yesterday},{label:"This Week",value:o.ThisWeek},{label:"Last Week",value:o.LastWeek},{label:"This Month",value:o.ThisMonth},{label:"Last Month",value:o.LastMonth},{label:"Custom",value:o.Custom,iconName:"calendarPen"}],J={single:1,double:2};function K(t){return l.startOfDay(Date.now(),t)}function U(t){return u.endOfDay(Date.now(),t)}function X(t){const e=v.constructNow(t?.in),n=e.getFullYear(),r=e.getMonth(),a=e.getDate(),i=v.constructNow(t?.in);return i.setFullYear(n,r,a-1),i.setHours(0,0,0,0),i}function Z(t){const e=v.constructNow(t?.in),n=l.constructFrom(t?.in,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()-1),n.setHours(23,59,59,999),n}function M(t,e){const n=l.getDefaultOptions(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=l.toDate(t,e?.in),i=a.getDay(),m=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+m),a.setHours(23,59,59,999),a}function P(t,e){const n=l.toDate(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function _(t,e){const n=l.toDate(t,e?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function ee(t,e,n){return u.addDays(t,e*7,n)}function te(t,e,n){return ee(t,-1,n)}function ne(t,e,n){return u.addMonths(t,-1,n)}function w(t,e){return+l.toDate(t)==+l.toDate(e)}const W=t=>{const e=new Date;switch(t){case o.Today:return{startDate:K(),endDate:U()};case o.Yesterday:return{startDate:X(),endDate:Z()};case o.ThisWeek:return{startDate:l.startOfWeek(e,{weekStartsOn:1}),endDate:M(e,{weekStartsOn:1})};case o.LastWeek:{const n=te(e);return{startDate:l.startOfWeek(n,{weekStartsOn:1}),endDate:M(n,{weekStartsOn:1})}}case o.ThisMonth:return{startDate:P(e),endDate:_(e)};case o.LastMonth:{const n=ne(e);return{startDate:P(n),endDate:_(n)}}default:return null}},se=(t,e)=>{if(!t||!e)return o.Today;const n=[o.Today,o.Yesterday,o.ThisWeek,o.LastWeek,o.ThisMonth,o.LastMonth];for(const r of n){const a=W(r);if(a&&w(t,a.startDate)&&w(e,a.endDate))return r}return o.Custom},oe=({selectedQuickOption:t,setSelectedQuickOption:e,["data-testid"]:n="kibble-datetime-picker-quick-options"})=>{const{setFocusedInput:r,onQuickOptionSelect:a}=u.useDatePickerContext(),{setOpen:i}=Y.usePopoverContext(),m=c=>{if(e(c),c===o.Custom){r(u.FocusedInput.StartDate);return}const p=W(c);p&&(a(p),i(!1))};return s.jsxRuntimeExports.jsx(E.Flex,{className:"DateTimePicker__QuickFilters",flexDirection:"column",gap:2,w:"100%",maxW:"120px",children:V.map(c=>s.jsxRuntimeExports.jsx(O.Button,{className:"DateTimePicker__Option","data-testid":`${n}-option-${c.value}`,variant:"secondarySubtle",...c.iconName&&{iconName:c.iconName,iconPosition:"right"},...t===c.value&&{active:!0},onClick:()=>m(c.value),children:c.label},c.value))})},S=({label:t,rangeType:e})=>{const{startDate:n,endDate:r,dateFormat:a,focusedInput:i,setFocusedInput:m,onTimeChange:c}=u.useDatePickerContext(),p=d.useMemo(()=>(e===u.FocusedInput.StartDate?n:r)||new Date,[n,r,e]),g=d.useMemo(()=>l.format(p,a),[p,a]),D=x=>{x&&c(x,e)};return s.jsxRuntimeExports.jsxs(f.Grid,{alignItems:"center",templateColumns:"repeat(5, 1fr)",gap:1,bgColor:"background.secondaryAlpha",borderRadius:"md",p:1,flex:"0 0 50%",children:[s.jsxRuntimeExports.jsx(f.GridItem,{colSpan:1,children:s.jsxRuntimeExports.jsx(B.WrappedText,{size:"sm",fontWeight:"semibold",textAlign:"center",children:t})}),s.jsxRuntimeExports.jsx(f.GridItem,{colSpan:2,children:s.jsxRuntimeExports.jsx(H.WrappedTextInput,{readOnly:!0,value:g,onClick:()=>m(e),...i===e&&{"data-focus":!0}})}),s.jsxRuntimeExports.jsx(f.GridItem,{colSpan:2,children:s.jsxRuntimeExports.jsx($.TimePicker,{minuteInterval:1,initialTime:p,onClose:x=>D(x),inputProps:{rightElement:void 0,onClick:()=>m(e)}})})]})},re=({isSingleView:t})=>{const{focusedInput:e,setFocusedInput:n}=u.useDatePickerContext();return d.useEffect(()=>{e||n(u.FocusedInput.StartDate)},[e,n]),s.jsxRuntimeExports.jsxs(j.Box,{className:"DateTimePicker__CustomFilters",mt:-1,children:[s.jsxRuntimeExports.jsxs(E.Flex,{className:"DateTimePicker__CustomFilters__RangeSelectors",flexDirection:t?"column":"row",alignItems:"center",gap:2,justifyContent:"space-between",children:[s.jsxRuntimeExports.jsx(S,{label:"Start",rangeType:u.FocusedInput.StartDate}),s.jsxRuntimeExports.jsx(S,{label:"End",rangeType:u.FocusedInput.EndDate})]}),s.jsxRuntimeExports.jsxs(j.Box,{className:"CalendarView",bgColor:"background.secondaryAlpha",borderRadius:"md",p:1,mt:5,children:[s.jsxRuntimeExports.jsx(j.Box,{className:"CalendarView__Header",bgColor:"background.accent.subtle",borderRadius:"md",children:s.jsxRuntimeExports.jsx(u.DatePickerHeader,{triggerProps:{variant:"ghostNeutral"}})}),s.jsxRuntimeExports.jsx(j.Box,{className:"CalendarView__Body",children:s.jsxRuntimeExports.jsx(u.DatePickerCalendar,{showMonthLabels:!0})})]})]})},ae=({trigger:t,calendarView:e="double",portalled:n=!0,showQuickOptions:r=!0,["data-testid"]:a="kibble-datetime-picker",...i})=>{const m=d.useMemo(()=>{const T=new Date;return{startDate:l.startOfDay(T),endDate:u.endOfDay(T)}},[]),{contentRef:c}=N.usePortalContentRef(),g=z.useSlotRecipe({recipe:I.popoverRecipe})(),D=L.useBreakpoint(),x=d.useMemo(()=>r?se(i.startDate||null,i.endDate||null):o.Custom,[r,i.startDate,i.endDate]),[h,y]=d.useState(x);d.useEffect(()=>{y(x)},[x]);const k=d.useMemo(()=>["base","sm"].includes(D)?"single":e,[e,D]),F=d.useMemo(()=>J[k],[k]),C=d.useMemo(()=>k==="single",[k]),b=d.useMemo(()=>h===o.Custom,[h]),q=d.useMemo(()=>b?"max-content":"160px",[b]);return s.jsxRuntimeExports.jsxs(u.DatePickerProvider,{...i,startDate:i.startDate||m.startDate,endDate:i.endDate||m.endDate,withDateRange:!0,numberOfMonths:F,sameWidth:!0,children:[s.jsxRuntimeExports.jsx(R.PopoverTrigger,{asChild:!0,w:"max-content",children:t||s.jsxRuntimeExports.jsx(O.Button,{variant:"secondarySubtle",iconName:"calendarInfo","data-testid":`${a}-default-trigger`,children:"Date/Time Range"})}),s.jsxRuntimeExports.jsx(A.Portal,{container:c||void 0,disabled:!n,children:s.jsxRuntimeExports.jsx(R.PopoverPositioner,{className:"DateTimePicker","data-testid":a,children:s.jsxRuntimeExports.jsx(R.PopoverContent,{className:"DateTimePicker__Content","data-testid":`${a}-content`,css:{...g.content,"--popover-size":q,maxW:r?C?"550px":"890px":C?"390px":"730px",...b&&{minW:r?"550px":"390px"}},children:s.jsxRuntimeExports.jsx(R.PopoverBody,{css:{"--popover-padding":0},children:s.jsxRuntimeExports.jsxs(E.Flex,{className:"DateTimePicker__Container","data-testid":`${a}-container`,p:5,children:[r&&s.jsxRuntimeExports.jsx(oe,{selectedQuickOption:h,setSelectedQuickOption:y}),h===o.Custom&&s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[r&&s.jsxRuntimeExports.jsx(G.Divider,{orientation:"vertical",my:-5,mx:5}),s.jsxRuntimeExports.jsx(re,{isSingleView:C})]})]})})})})})]})};exports.DateTimePicker=ae;exports.DateTimePickerDefaultOptionValue=o;exports.calendarViews=Q;
|
|
2
|
-
//# sourceMappingURL=dateTimePicker.component-BlWhC5aT.js.map
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
import { j as s } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { useMemo as d, useEffect as N, useState as E } from "react";
|
|
3
|
-
import { B as R } from "./button.component-BO6oee_V.js";
|
|
4
|
-
import { e as Y, d as $, f as z, u as T, F as p, b as A, c as G, a as Q } from "./datePicker.provider-CttuPiiS.js";
|
|
5
|
-
import { u as q } from "./usePortalContentRef-DO_jc4W9.js";
|
|
6
|
-
import { p as V } from "./popover.recipe-DPwwsWLb.js";
|
|
7
|
-
import { s as L, c as J, g as K, t as f, a as P, f as U } from "./format-CqTHHSak.js";
|
|
8
|
-
import { c as y } from "./isToday-iCYsPDMT.js";
|
|
9
|
-
import { u as X } from "./popover-root-provider-CFn2dthZ.js";
|
|
10
|
-
import { F as v } from "./flex-CX-8gE9T.js";
|
|
11
|
-
import { useBreakpoint as Z } from "../esm/hooks/useBreakpoint/index.js";
|
|
12
|
-
import { B as k } from "./index-9BerxEcw.js";
|
|
13
|
-
import { W as ee } from "./text.component-DhuUgP3j.js";
|
|
14
|
-
import { W as te } from "./textInput.component-BeiTxTkS.js";
|
|
15
|
-
import { T as ae } from "./timePicker.component-BCMX6aqb.js";
|
|
16
|
-
import { G as se, a as j } from "./grid-item-BmCSQ38y.js";
|
|
17
|
-
import { D as ne } from "./divider.component-CFOh4Nw3.js";
|
|
18
|
-
import { u as re } from "./create-slot-recipe-context-D_FXDJGp.js";
|
|
19
|
-
import { P as oe } from "./index-DcmJgLUo.js";
|
|
20
|
-
import { P as ie, a as ce, b as le, c as de } from "./popover-Gb1fXSR7.js";
|
|
21
|
-
var n = /* @__PURE__ */ ((t) => (t.Today = "Today", t.Yesterday = "Yesterday", t.ThisWeek = "ThisWeek", t.LastWeek = "LastWeek", t.ThisMonth = "ThisMonth", t.LastMonth = "LastMonth", t.Custom = "Custom", t))(n || {});
|
|
22
|
-
const ze = ["single", "double"], ue = [
|
|
23
|
-
{
|
|
24
|
-
label: "Today",
|
|
25
|
-
value: n.Today
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: "Yesterday",
|
|
29
|
-
value: n.Yesterday
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: "This Week",
|
|
33
|
-
value: n.ThisWeek
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: "Last Week",
|
|
37
|
-
value: n.LastWeek
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "This Month",
|
|
41
|
-
value: n.ThisMonth
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Last Month",
|
|
45
|
-
value: n.LastMonth
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "Custom",
|
|
49
|
-
value: n.Custom,
|
|
50
|
-
iconName: "calendarPen"
|
|
51
|
-
}
|
|
52
|
-
], me = {
|
|
53
|
-
single: 1,
|
|
54
|
-
double: 2
|
|
55
|
-
};
|
|
56
|
-
function pe(t) {
|
|
57
|
-
return L(Date.now(), t);
|
|
58
|
-
}
|
|
59
|
-
function fe(t) {
|
|
60
|
-
return Y(Date.now(), t);
|
|
61
|
-
}
|
|
62
|
-
function he(t) {
|
|
63
|
-
const e = y(t?.in), a = e.getFullYear(), r = e.getMonth(), o = e.getDate(), i = y(t?.in);
|
|
64
|
-
return i.setFullYear(a, r, o - 1), i.setHours(0, 0, 0, 0), i;
|
|
65
|
-
}
|
|
66
|
-
function De(t) {
|
|
67
|
-
const e = y(t?.in), a = J(t?.in, 0);
|
|
68
|
-
return a.setFullYear(e.getFullYear(), e.getMonth(), e.getDate() - 1), a.setHours(23, 59, 59, 999), a;
|
|
69
|
-
}
|
|
70
|
-
function W(t, e) {
|
|
71
|
-
const a = K(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, o = f(t, e?.in), i = o.getDay(), l = (i < r ? -7 : 0) + 6 - (i - r);
|
|
72
|
-
return o.setDate(o.getDate() + l), o.setHours(23, 59, 59, 999), o;
|
|
73
|
-
}
|
|
74
|
-
function M(t, e) {
|
|
75
|
-
const a = f(t, e?.in);
|
|
76
|
-
return a.setDate(1), a.setHours(0, 0, 0, 0), a;
|
|
77
|
-
}
|
|
78
|
-
function O(t, e) {
|
|
79
|
-
const a = f(t, e?.in), r = a.getMonth();
|
|
80
|
-
return a.setFullYear(a.getFullYear(), r + 1, 0), a.setHours(23, 59, 59, 999), a;
|
|
81
|
-
}
|
|
82
|
-
function xe(t, e, a) {
|
|
83
|
-
return $(t, e * 7, a);
|
|
84
|
-
}
|
|
85
|
-
function ke(t, e, a) {
|
|
86
|
-
return xe(t, -1, a);
|
|
87
|
-
}
|
|
88
|
-
function ge(t, e, a) {
|
|
89
|
-
return z(t, -1, a);
|
|
90
|
-
}
|
|
91
|
-
function _(t, e) {
|
|
92
|
-
return +f(t) == +f(e);
|
|
93
|
-
}
|
|
94
|
-
const I = (t) => {
|
|
95
|
-
const e = /* @__PURE__ */ new Date();
|
|
96
|
-
switch (t) {
|
|
97
|
-
case n.Today:
|
|
98
|
-
return {
|
|
99
|
-
startDate: pe(),
|
|
100
|
-
endDate: fe()
|
|
101
|
-
};
|
|
102
|
-
case n.Yesterday:
|
|
103
|
-
return {
|
|
104
|
-
startDate: he(),
|
|
105
|
-
endDate: De()
|
|
106
|
-
};
|
|
107
|
-
case n.ThisWeek:
|
|
108
|
-
return {
|
|
109
|
-
startDate: P(e, { weekStartsOn: 1 }),
|
|
110
|
-
endDate: W(e, { weekStartsOn: 1 })
|
|
111
|
-
};
|
|
112
|
-
case n.LastWeek: {
|
|
113
|
-
const a = ke(e);
|
|
114
|
-
return {
|
|
115
|
-
startDate: P(a, { weekStartsOn: 1 }),
|
|
116
|
-
endDate: W(a, { weekStartsOn: 1 })
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
case n.ThisMonth:
|
|
120
|
-
return {
|
|
121
|
-
startDate: M(e),
|
|
122
|
-
endDate: O(e)
|
|
123
|
-
};
|
|
124
|
-
case n.LastMonth: {
|
|
125
|
-
const a = ge(e);
|
|
126
|
-
return {
|
|
127
|
-
startDate: M(a),
|
|
128
|
-
endDate: O(a)
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
default:
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
}, be = (t, e) => {
|
|
135
|
-
if (!t || !e)
|
|
136
|
-
return n.Today;
|
|
137
|
-
const a = [
|
|
138
|
-
n.Today,
|
|
139
|
-
n.Yesterday,
|
|
140
|
-
n.ThisWeek,
|
|
141
|
-
n.LastWeek,
|
|
142
|
-
n.ThisMonth,
|
|
143
|
-
n.LastMonth
|
|
144
|
-
];
|
|
145
|
-
for (const r of a) {
|
|
146
|
-
const o = I(r);
|
|
147
|
-
if (o && _(t, o.startDate) && _(e, o.endDate))
|
|
148
|
-
return r;
|
|
149
|
-
}
|
|
150
|
-
return n.Custom;
|
|
151
|
-
}, Ce = ({
|
|
152
|
-
selectedQuickOption: t,
|
|
153
|
-
setSelectedQuickOption: e,
|
|
154
|
-
["data-testid"]: a = "kibble-datetime-picker-quick-options"
|
|
155
|
-
}) => {
|
|
156
|
-
const { setFocusedInput: r, onQuickOptionSelect: o } = T(), { setOpen: i } = X(), l = (c) => {
|
|
157
|
-
if (e(c), c === n.Custom) {
|
|
158
|
-
r(p.StartDate);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
const m = I(c);
|
|
162
|
-
m && (o(m), i(!1));
|
|
163
|
-
};
|
|
164
|
-
return /* @__PURE__ */ s.jsx(v, { className: "DateTimePicker__QuickFilters", flexDirection: "column", gap: 2, w: "100%", maxW: "120px", children: ue.map((c) => /* @__PURE__ */ s.jsx(
|
|
165
|
-
R,
|
|
166
|
-
{
|
|
167
|
-
className: "DateTimePicker__Option",
|
|
168
|
-
"data-testid": `${a}-option-${c.value}`,
|
|
169
|
-
variant: "secondarySubtle",
|
|
170
|
-
...c.iconName && { iconName: c.iconName, iconPosition: "right" },
|
|
171
|
-
...t === c.value && { active: !0 },
|
|
172
|
-
onClick: () => l(c.value),
|
|
173
|
-
children: c.label
|
|
174
|
-
},
|
|
175
|
-
c.value
|
|
176
|
-
)) });
|
|
177
|
-
}, F = ({
|
|
178
|
-
label: t,
|
|
179
|
-
rangeType: e
|
|
180
|
-
}) => {
|
|
181
|
-
const { startDate: a, endDate: r, dateFormat: o, focusedInput: i, setFocusedInput: l, onTimeChange: c } = T(), m = d(
|
|
182
|
-
() => (e === p.StartDate ? a : r) || /* @__PURE__ */ new Date(),
|
|
183
|
-
[a, r, e]
|
|
184
|
-
), g = d(() => U(m, o), [m, o]), h = (u) => {
|
|
185
|
-
u && c(u, e);
|
|
186
|
-
};
|
|
187
|
-
return /* @__PURE__ */ s.jsxs(
|
|
188
|
-
se,
|
|
189
|
-
{
|
|
190
|
-
alignItems: "center",
|
|
191
|
-
templateColumns: "repeat(5, 1fr)",
|
|
192
|
-
gap: 1,
|
|
193
|
-
bgColor: "background.secondaryAlpha",
|
|
194
|
-
borderRadius: "md",
|
|
195
|
-
p: 1,
|
|
196
|
-
flex: "0 0 50%",
|
|
197
|
-
children: [
|
|
198
|
-
/* @__PURE__ */ s.jsx(j, { colSpan: 1, children: /* @__PURE__ */ s.jsx(ee, { size: "sm", fontWeight: "semibold", textAlign: "center", children: t }) }),
|
|
199
|
-
/* @__PURE__ */ s.jsx(j, { colSpan: 2, children: /* @__PURE__ */ s.jsx(
|
|
200
|
-
te,
|
|
201
|
-
{
|
|
202
|
-
readOnly: !0,
|
|
203
|
-
value: g,
|
|
204
|
-
onClick: () => l(e),
|
|
205
|
-
...i === e && {
|
|
206
|
-
"data-focus": !0
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
) }),
|
|
210
|
-
/* @__PURE__ */ s.jsx(j, { colSpan: 2, children: /* @__PURE__ */ s.jsx(
|
|
211
|
-
ae,
|
|
212
|
-
{
|
|
213
|
-
minuteInterval: 1,
|
|
214
|
-
initialTime: m,
|
|
215
|
-
onClose: (u) => h(u),
|
|
216
|
-
inputProps: { rightElement: void 0, onClick: () => l(e) }
|
|
217
|
-
}
|
|
218
|
-
) })
|
|
219
|
-
]
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
}, je = ({ isSingleView: t }) => {
|
|
223
|
-
const { focusedInput: e, setFocusedInput: a } = T();
|
|
224
|
-
return N(() => {
|
|
225
|
-
e || a(p.StartDate);
|
|
226
|
-
}, [e, a]), /* @__PURE__ */ s.jsxs(k, { className: "DateTimePicker__CustomFilters", mt: -1, children: [
|
|
227
|
-
/* @__PURE__ */ s.jsxs(
|
|
228
|
-
v,
|
|
229
|
-
{
|
|
230
|
-
className: "DateTimePicker__CustomFilters__RangeSelectors",
|
|
231
|
-
flexDirection: t ? "column" : "row",
|
|
232
|
-
alignItems: "center",
|
|
233
|
-
gap: 2,
|
|
234
|
-
justifyContent: "space-between",
|
|
235
|
-
children: [
|
|
236
|
-
/* @__PURE__ */ s.jsx(F, { label: "Start", rangeType: p.StartDate }),
|
|
237
|
-
/* @__PURE__ */ s.jsx(F, { label: "End", rangeType: p.EndDate })
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
),
|
|
241
|
-
/* @__PURE__ */ s.jsxs(k, { className: "CalendarView", bgColor: "background.secondaryAlpha", borderRadius: "md", p: 1, mt: 5, children: [
|
|
242
|
-
/* @__PURE__ */ s.jsx(k, { className: "CalendarView__Header", bgColor: "background.accent.subtle", borderRadius: "md", children: /* @__PURE__ */ s.jsx(A, { triggerProps: { variant: "ghostNeutral" } }) }),
|
|
243
|
-
/* @__PURE__ */ s.jsx(k, { className: "CalendarView__Body", children: /* @__PURE__ */ s.jsx(G, { showMonthLabels: !0 }) })
|
|
244
|
-
] })
|
|
245
|
-
] });
|
|
246
|
-
}, Ae = ({
|
|
247
|
-
trigger: t,
|
|
248
|
-
calendarView: e = "double",
|
|
249
|
-
portalled: a = !0,
|
|
250
|
-
showQuickOptions: r = !0,
|
|
251
|
-
["data-testid"]: o = "kibble-datetime-picker",
|
|
252
|
-
...i
|
|
253
|
-
}) => {
|
|
254
|
-
const l = d(() => {
|
|
255
|
-
const w = /* @__PURE__ */ new Date();
|
|
256
|
-
return {
|
|
257
|
-
startDate: L(w),
|
|
258
|
-
endDate: Y(w)
|
|
259
|
-
};
|
|
260
|
-
}, []), { contentRef: c } = q(), g = re({ recipe: V })(), h = Z(), u = d(() => r ? be(i.startDate || null, i.endDate || null) : n.Custom, [r, i.startDate, i.endDate]), [D, S] = E(u);
|
|
261
|
-
N(() => {
|
|
262
|
-
S(u);
|
|
263
|
-
}, [u]);
|
|
264
|
-
const x = d(
|
|
265
|
-
() => ["base", "sm"].includes(h) ? "single" : e,
|
|
266
|
-
[e, h]
|
|
267
|
-
), B = d(() => me[x], [x]), b = d(() => x === "single", [x]), C = d(
|
|
268
|
-
() => D === n.Custom,
|
|
269
|
-
[D]
|
|
270
|
-
), H = d(() => C ? "max-content" : "160px", [C]);
|
|
271
|
-
return /* @__PURE__ */ s.jsxs(
|
|
272
|
-
Q,
|
|
273
|
-
{
|
|
274
|
-
...i,
|
|
275
|
-
startDate: i.startDate || l.startDate,
|
|
276
|
-
endDate: i.endDate || l.endDate,
|
|
277
|
-
withDateRange: !0,
|
|
278
|
-
numberOfMonths: B,
|
|
279
|
-
sameWidth: !0,
|
|
280
|
-
children: [
|
|
281
|
-
/* @__PURE__ */ s.jsx(ie, { asChild: !0, w: "max-content", children: t || /* @__PURE__ */ s.jsx(R, { variant: "secondarySubtle", iconName: "calendarInfo", "data-testid": `${o}-default-trigger`, children: "Date/Time Range" }) }),
|
|
282
|
-
/* @__PURE__ */ s.jsx(oe, { container: c || void 0, disabled: !a, children: /* @__PURE__ */ s.jsx(ce, { className: "DateTimePicker", "data-testid": o, children: /* @__PURE__ */ s.jsx(
|
|
283
|
-
le,
|
|
284
|
-
{
|
|
285
|
-
className: "DateTimePicker__Content",
|
|
286
|
-
"data-testid": `${o}-content`,
|
|
287
|
-
css: {
|
|
288
|
-
...g.content,
|
|
289
|
-
"--popover-size": H,
|
|
290
|
-
maxW: r ? b ? "550px" : "890px" : b ? "390px" : "730px",
|
|
291
|
-
...C && { minW: r ? "550px" : "390px" }
|
|
292
|
-
},
|
|
293
|
-
children: /* @__PURE__ */ s.jsx(de, { css: { "--popover-padding": 0 }, children: /* @__PURE__ */ s.jsxs(v, { className: "DateTimePicker__Container", "data-testid": `${o}-container`, p: 5, children: [
|
|
294
|
-
r && /* @__PURE__ */ s.jsx(
|
|
295
|
-
Ce,
|
|
296
|
-
{
|
|
297
|
-
selectedQuickOption: D,
|
|
298
|
-
setSelectedQuickOption: S
|
|
299
|
-
}
|
|
300
|
-
),
|
|
301
|
-
D === n.Custom && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
302
|
-
r && /* @__PURE__ */ s.jsx(ne, { orientation: "vertical", my: -5, mx: 5 }),
|
|
303
|
-
/* @__PURE__ */ s.jsx(je, { isSingleView: b })
|
|
304
|
-
] })
|
|
305
|
-
] }) })
|
|
306
|
-
}
|
|
307
|
-
) }) })
|
|
308
|
-
]
|
|
309
|
-
}
|
|
310
|
-
);
|
|
311
|
-
};
|
|
312
|
-
export {
|
|
313
|
-
Ae as D,
|
|
314
|
-
n as a,
|
|
315
|
-
ze as c
|
|
316
|
-
};
|
|
317
|
-
//# sourceMappingURL=dateTimePicker.component-CLAI_Q6e.js.map
|