@driveflux/beam 2.0.15 → 2.0.16
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/accordion/Accordion.js +133 -7
- package/dist/accordion/Accordion.stories.js +31 -11
- package/dist/alert/Alert.js +110 -14
- package/dist/alert/Alert.stories.js +50 -15
- package/dist/animations/LoadingAnimation.js +34 -21
- package/dist/badge/Badge.js +1 -1
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/Badge.stories.js +28 -7
- package/dist/box/Box.js +87 -3
- package/dist/box/Box.stories.js +8 -7
- package/dist/breadcrumbs/Breadcrumbs.js +288 -28
- package/dist/breadcrumbs/Breadcrumbs.stories.js +51 -27
- package/dist/button/Button.js +124 -12
- package/dist/button/Button.stories.js +35 -7
- package/dist/card/Card.js +109 -7
- package/dist/card/Card.stories.js +10 -7
- package/dist/carousel/Carousel.js +281 -58
- package/dist/carousel/Carousel.stories.js +39 -7
- package/dist/carousel/CarouselButton.js +68 -7
- package/dist/center/Center.js +63 -3
- package/dist/center/Center.stories.js +19 -7
- package/dist/checkbox/Checkbox.js +124 -4
- package/dist/checkbox/Checkbox.stories.js +10 -8
- package/dist/chip/Chip.js +104 -3
- package/dist/chip/Chip.stories.js +19 -7
- package/dist/circular-progress/CircularProgress.js +150 -11
- package/dist/circular-progress/CircularProgress.stories.js +54 -14
- package/dist/command/command.js +170 -13
- package/dist/datepicker/DatePicker.js +127 -27
- package/dist/datepicker/DatePicker.stories.js +163 -58
- package/dist/datepicker/DatePickerDrawer.js +110 -14
- package/dist/datepicker/DatePickerPopover.js +207 -35
- package/dist/datepicker/constants.js +3 -4
- package/dist/datepicker/utils.js +4 -11
- package/dist/dialog/index.js +180 -33
- package/dist/divider/Divider.js +63 -3
- package/dist/divider/Divider.stories.js +13 -7
- package/dist/drawer/index.js +157 -12
- package/dist/dropdown/Dropdown.js +212 -26
- package/dist/dropdown/Dropdown.stories.js +109 -22
- package/dist/field-wrapper/FieldWrapper.js +139 -3
- package/dist/field-wrapper/FieldWrapper.stories.js +124 -28
- package/dist/flex/Flex.js +63 -3
- package/dist/flex/Flex.stories.js +19 -7
- package/dist/grid/Grid.js +63 -3
- package/dist/grid/Grid.stories.js +28 -7
- package/dist/hooks/use-breakpoint-value.js +77 -14
- package/dist/hooks/use-media-query.js +61 -12
- package/dist/hstack/HStack.js +63 -3
- package/dist/hstack/HStack.stories.js +19 -7
- package/dist/icons/FluxLogo.js +213 -9
- package/dist/icons/FluxLogoTable.js +109 -5
- package/dist/icons/Icon.js +108 -7
- package/dist/icons/Icon.stories.js +12 -7
- package/dist/icons/Icon24Hours.js +83 -5
- package/dist/icons/IconAcceleration.js +72 -4
- package/dist/icons/IconAccount.js +72 -4
- package/dist/icons/IconApplicant.js +78 -5
- package/dist/icons/IconArrow.js +78 -6
- package/dist/icons/IconArrowBack.js +72 -4
- package/dist/icons/IconArrowForward.js +72 -4
- package/dist/icons/IconArrowTopLeft.js +70 -4
- package/dist/icons/IconBluesharkProductGuide.js +80 -5
- package/dist/icons/IconBolt.js +72 -4
- package/dist/icons/IconBriefcase.js +72 -4
- package/dist/icons/IconBulb.js +72 -4
- package/dist/icons/IconCalendar.js +72 -4
- package/dist/icons/IconCalendarArrowBack.js +72 -4
- package/dist/icons/IconCalendarArrowForward.js +72 -4
- package/dist/icons/IconCalendarDoubleArrowBack.js +72 -4
- package/dist/icons/IconCalendarDoubleArrowForward.js +72 -4
- package/dist/icons/IconCancel.d.ts.map +1 -1
- package/dist/icons/IconCancel.js +4 -4
- package/dist/icons/IconCancel.js.map +1 -1
- package/dist/icons/IconCancelMark.js +72 -4
- package/dist/icons/IconCarSUV.js +72 -4
- package/dist/icons/IconCarSedan.js +147 -7
- package/dist/icons/IconChain.js +79 -5
- package/dist/icons/IconCheckmark.js +72 -4
- package/dist/icons/IconChevronRight.js +72 -4
- package/dist/icons/IconCircle.js +114 -11
- package/dist/icons/IconCircleCheckmark.js +77 -5
- package/dist/icons/IconCircleError.js +72 -4
- package/dist/icons/IconCircleExclamation.js +104 -6
- package/dist/icons/IconCircleMark.js +78 -5
- package/dist/icons/IconCircleOutline.js +139 -5
- package/dist/icons/IconClock.js +80 -5
- package/dist/icons/IconClose.js +72 -4
- package/dist/icons/IconCollapseAll.js +5 -94
- package/dist/icons/IconCollapseAll.js.map +1 -0
- package/dist/icons/IconConcierge.js +79 -5
- package/dist/icons/IconConciergeService.js +87 -5
- package/dist/icons/IconCreditCard.js +78 -5
- package/dist/icons/IconDash.js +72 -4
- package/dist/icons/IconDeliver.js +72 -4
- package/dist/icons/IconDelivery.js +87 -5
- package/dist/icons/IconDetails.js +72 -4
- package/dist/icons/IconDot.js +87 -6
- package/dist/icons/IconDownload.js +5 -79
- package/dist/icons/IconDownload.js.map +1 -0
- package/dist/icons/IconEVCharging.js +79 -5
- package/dist/icons/IconElectricCarFuel.js +80 -5
- package/dist/icons/IconEllipsis.js +78 -5
- package/dist/icons/IconEnvelope.js +72 -4
- package/dist/icons/IconExpandAll.js +5 -94
- package/dist/icons/IconExpandAll.js.map +1 -0
- package/dist/icons/IconEye.js +79 -5
- package/dist/icons/IconFacebook.js +94 -6
- package/dist/icons/IconFilter.js +83 -5
- package/dist/icons/IconFlagMalaysia.js +141 -5
- package/dist/icons/IconGiveKey.js +79 -5
- package/dist/icons/IconGlobe.js +70 -4
- package/dist/icons/IconGoogle.js +87 -5
- package/dist/icons/IconHome.js +78 -5
- package/dist/icons/IconHostAdvertise.js +72 -4
- package/dist/icons/IconHostCar.js +75 -4
- package/dist/icons/IconHostCash.js +91 -5
- package/dist/icons/IconHostHandle.js +70 -4
- package/dist/icons/IconHostLocation.js +70 -4
- package/dist/icons/IconHostPayment.js +91 -5
- package/dist/icons/IconHostService.js +79 -5
- package/dist/icons/IconHotDeals.js +72 -4
- package/dist/icons/IconInfo.js +77 -5
- package/dist/icons/IconInstagram.js +72 -4
- package/dist/icons/IconInsurance.js +99 -5
- package/dist/icons/IconInternet.js +73 -4
- package/dist/icons/IconInventory.js +78 -5
- package/dist/icons/IconLaurel.js +101 -5
- package/dist/icons/IconLinkedIn.js +72 -4
- package/dist/icons/IconLoading.js +78 -4
- package/dist/icons/IconLocation.js +80 -5
- package/dist/icons/IconLock.js +73 -4
- package/dist/icons/IconLogistics.js +72 -4
- package/dist/icons/IconMail.js +94 -5
- package/dist/icons/IconMember.js +78 -5
- package/dist/icons/IconMobilePen.js +83 -5
- package/dist/icons/IconMotorcycleMoped.js +78 -5
- package/dist/icons/IconNoCost.js +92 -5
- package/dist/icons/IconPDF.js +80 -5
- package/dist/icons/IconPencil.js +70 -4
- package/dist/icons/IconPhone.js +70 -4
- package/dist/icons/IconPlus.js +72 -4
- package/dist/icons/IconPricing.js +72 -4
- package/dist/icons/IconProtected.js +71 -4
- package/dist/icons/IconPsychology.js +72 -4
- package/dist/icons/IconQuestionTooltip.js +73 -4
- package/dist/icons/IconQuote.js +72 -4
- package/dist/icons/IconRate.js +71 -4
- package/dist/icons/IconRegister.js +99 -5
- package/dist/icons/IconReport.js +6 -89
- package/dist/icons/IconReport.js.map +1 -0
- package/dist/icons/IconReturn.js +72 -4
- package/dist/icons/IconSearch.js +70 -4
- package/dist/icons/IconSecure.js +71 -4
- package/dist/icons/IconSecurity.js +73 -4
- package/dist/icons/IconSedanOutline.js +159 -5
- package/dist/icons/IconSelectArrow.js +78 -6
- package/dist/icons/IconSort.js +79 -5
- package/dist/icons/IconSortListed.js +95 -5
- package/dist/icons/IconSortPriceAscending.js +83 -5
- package/dist/icons/IconSortPriceDescending.js +83 -5
- package/dist/icons/IconSortYear.js +79 -5
- package/dist/icons/IconSpan.js +71 -4
- package/dist/icons/IconSpeaker.js +79 -4
- package/dist/icons/IconSpecialCar.js +95 -5
- package/dist/icons/IconStar.js +92 -7
- package/dist/icons/IconStockPhoto.js +95 -5
- package/dist/icons/IconSubscription.js +113 -6
- package/dist/icons/IconSubscriptions.js +113 -6
- package/dist/icons/IconSwap.js +79 -5
- package/dist/icons/IconTax.js +72 -4
- package/dist/icons/IconThinArrow.js +78 -6
- package/dist/icons/IconThumbsdown.js +78 -5
- package/dist/icons/IconThumbsup.js +78 -5
- package/dist/icons/IconTool.js +72 -4
- package/dist/icons/IconTooltip.js +73 -4
- package/dist/icons/IconTrash.js +72 -4
- package/dist/icons/IconTriangleExclamation.js +72 -4
- package/dist/icons/IconTyersBrakes.js +83 -5
- package/dist/icons/IconTyre.js +83 -5
- package/dist/icons/IconVacancy.js +78 -5
- package/dist/icons/IconVolunteer.js +72 -4
- package/dist/icons/IconWhatsapp.js +73 -4
- package/dist/icons/IconXPlatform.js +72 -4
- package/dist/icons/IconZeroEffort.js +77 -5
- package/dist/icons/Logo.js +99 -3
- package/dist/input/Input.js +125 -11
- package/dist/input/Input.stories.js +17 -18
- package/dist/input-mask/InputMask.js +149 -11
- package/dist/input-mask/InputMask.stories.js +5 -6
- package/dist/input-mask/mask-trackers.js +4 -5
- package/dist/input-select/InputSelect.js +357 -68
- package/dist/input-select/InputSelect.stories.js +98 -25
- package/dist/popover/popover.js +72 -4
- package/dist/progress/Progress.js +96 -2
- package/dist/progress/Progress.stories.js +13 -14
- package/dist/radio/Radio.js +163 -4
- package/dist/scroll-area/scroll-area.js +113 -5
- package/dist/search-input-select/SearchInputSelect.js +346 -69
- package/dist/select/Select.js +1 -1
- package/dist/select/Select.js.map +1 -1
- package/dist/select/Select.stories.js +55 -19
- package/dist/skeleton/Skeleton.js +62 -3
- package/dist/skeleton/Skeleton.stories.js +8 -7
- package/dist/slider/Slider.js +106 -5
- package/dist/slider/Slider.stories.js +12 -11
- package/dist/stack/Stack.js +63 -3
- package/dist/stack/Stack.stories.js +19 -7
- package/dist/table/Table.js +131 -10
- package/dist/table/Table.stories.js +84 -8
- package/dist/tabs/Tabs.js +128 -9
- package/dist/tabs/Tabs.stories.js +46 -13
- package/dist/text/Text.js +88 -6
- package/dist/text/Text.stories.js +44 -7
- package/dist/toast/Toast.stories.js +66 -14
- package/dist/toast/ToastBox.js +71 -24
- package/dist/toast/index.js +0 -1
- package/dist/toast/sonner.js +66 -6
- package/dist/toggle/Toggle.js +116 -7
- package/dist/toggle/Toggle.stories.js +10 -8
- package/dist/tooltip/Tooltip.js +151 -12
- package/dist/tooltip/Tooltip.stories.js +71 -13
- package/dist/utils.js +4 -2
- package/dist/vstack/VStack.js +63 -3
- package/dist/vstack/VStack.stories.js +19 -7
- package/package.json +1 -1
|
@@ -1,24 +1,64 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import CircularProgress, { CircularProgressLabel } from './CircularProgress.js';
|
|
3
|
-
|
|
3
|
+
var meta = {
|
|
4
4
|
title: 'Circular Progress',
|
|
5
5
|
component: CircularProgress,
|
|
6
6
|
args: {
|
|
7
|
-
value: 50
|
|
8
|
-
}
|
|
7
|
+
value: 50
|
|
8
|
+
}
|
|
9
9
|
};
|
|
10
10
|
export default meta;
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
render: ()
|
|
11
|
+
export var Basic = {};
|
|
12
|
+
export var Standard = {
|
|
13
|
+
render: function() {
|
|
14
|
+
return /*#__PURE__*/ _jsx(CircularProgress, {
|
|
15
|
+
value: 80,
|
|
16
|
+
fillCircleClassName: "stroke-warning4",
|
|
17
|
+
children: /*#__PURE__*/ _jsxs(CircularProgressLabel, {
|
|
18
|
+
children: [
|
|
19
|
+
80,
|
|
20
|
+
"%"
|
|
21
|
+
]
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
14
25
|
};
|
|
15
|
-
export
|
|
16
|
-
render: ()
|
|
26
|
+
export var Zero = {
|
|
27
|
+
render: function() {
|
|
28
|
+
return /*#__PURE__*/ _jsx(CircularProgress, {
|
|
29
|
+
value: 0,
|
|
30
|
+
children: /*#__PURE__*/ _jsxs(CircularProgressLabel, {
|
|
31
|
+
children: [
|
|
32
|
+
0,
|
|
33
|
+
"%"
|
|
34
|
+
]
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
}
|
|
17
38
|
};
|
|
18
|
-
export
|
|
19
|
-
render: ()
|
|
39
|
+
export var Hundred = {
|
|
40
|
+
render: function() {
|
|
41
|
+
return /*#__PURE__*/ _jsx(CircularProgress, {
|
|
42
|
+
value: 100,
|
|
43
|
+
children: /*#__PURE__*/ _jsxs(CircularProgressLabel, {
|
|
44
|
+
children: [
|
|
45
|
+
100,
|
|
46
|
+
"%"
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
20
51
|
};
|
|
21
|
-
export
|
|
22
|
-
render: ()
|
|
52
|
+
export var Creative = {
|
|
53
|
+
render: function() {
|
|
54
|
+
return /*#__PURE__*/ _jsx(CircularProgress, {
|
|
55
|
+
value: 100,
|
|
56
|
+
size: 200,
|
|
57
|
+
fillCircleClassName: "fill-alert-700 stroke-alert4",
|
|
58
|
+
children: /*#__PURE__*/ _jsx(CircularProgressLabel, {
|
|
59
|
+
className: "text-9xl fill-white",
|
|
60
|
+
children: "☪"
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
23
64
|
};
|
|
24
|
-
//# sourceMappingURL=CircularProgress.stories.js.map
|
package/dist/command/command.js
CHANGED
|
@@ -1,30 +1,187 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) {
|
|
4
|
+
Object.defineProperty(obj, key, {
|
|
5
|
+
value: value,
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true
|
|
9
|
+
});
|
|
10
|
+
} else {
|
|
11
|
+
obj[key] = value;
|
|
12
|
+
}
|
|
13
|
+
return obj;
|
|
14
|
+
}
|
|
15
|
+
function _object_spread(target) {
|
|
16
|
+
for(var i = 1; i < arguments.length; i++){
|
|
17
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
18
|
+
var ownKeys = Object.keys(source);
|
|
19
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
20
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
21
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
ownKeys.forEach(function(key) {
|
|
25
|
+
_define_property(target, key, source[key]);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return target;
|
|
29
|
+
}
|
|
30
|
+
function ownKeys(object, enumerableOnly) {
|
|
31
|
+
var keys = Object.keys(object);
|
|
32
|
+
if (Object.getOwnPropertySymbols) {
|
|
33
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
34
|
+
if (enumerableOnly) {
|
|
35
|
+
symbols = symbols.filter(function(sym) {
|
|
36
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
keys.push.apply(keys, symbols);
|
|
40
|
+
}
|
|
41
|
+
return keys;
|
|
42
|
+
}
|
|
43
|
+
function _object_spread_props(target, source) {
|
|
44
|
+
source = source != null ? source : {};
|
|
45
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
46
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
47
|
+
} else {
|
|
48
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
49
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
function _object_without_properties(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
57
|
+
var key, i;
|
|
58
|
+
if (Object.getOwnPropertySymbols) {
|
|
59
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
60
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
61
|
+
key = sourceSymbolKeys[i];
|
|
62
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
63
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
64
|
+
target[key] = source[key];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return target;
|
|
68
|
+
}
|
|
69
|
+
function _object_without_properties_loose(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
var target = {};
|
|
72
|
+
var sourceKeys = Object.keys(source);
|
|
73
|
+
var key, i;
|
|
74
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
75
|
+
key = sourceKeys[i];
|
|
76
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
2
81
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
82
|
import { Command as CommandPrimitive } from 'cmdk';
|
|
4
83
|
import * as React from 'react';
|
|
5
84
|
import { Dialog, DialogContent } from '../dialog/index';
|
|
6
85
|
import IconSearch from '../icons/IconSearch';
|
|
7
86
|
import { cn } from '../utils';
|
|
8
|
-
|
|
87
|
+
var Command = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
88
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
89
|
+
"className"
|
|
90
|
+
]);
|
|
91
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive, _object_spread({
|
|
92
|
+
ref: ref,
|
|
93
|
+
className: cn('flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-zinc-950 dark:bg-zinc-950 dark:text-zinc-50', className)
|
|
94
|
+
}, props));
|
|
95
|
+
});
|
|
9
96
|
Command.displayName = CommandPrimitive.displayName;
|
|
10
|
-
|
|
11
|
-
|
|
97
|
+
var CommandDialog = function(_param) {
|
|
98
|
+
var children = _param.children, props = _object_without_properties(_param, [
|
|
99
|
+
"children"
|
|
100
|
+
]);
|
|
101
|
+
return /*#__PURE__*/ _jsx(Dialog, _object_spread_props(_object_spread({}, props), {
|
|
102
|
+
children: /*#__PURE__*/ _jsx(DialogContent, {
|
|
103
|
+
className: "overflow-hidden p-0 shadow-lg",
|
|
104
|
+
children: /*#__PURE__*/ _jsx(Command, {
|
|
105
|
+
className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-zinc-500 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 dark:[&_[cmdk-group-heading]]:text-zinc-400",
|
|
106
|
+
children: children
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
}));
|
|
12
110
|
};
|
|
13
|
-
|
|
111
|
+
var CommandInput = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
112
|
+
var className = _param.className, containerClassName = _param.containerClassName, props = _object_without_properties(_param, [
|
|
113
|
+
"className",
|
|
114
|
+
"containerClassName"
|
|
115
|
+
]);
|
|
116
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
117
|
+
className: cn('flex h-10 items-center border-b px-3', containerClassName),
|
|
118
|
+
"cmdk-input-wrapper": "",
|
|
119
|
+
children: [
|
|
120
|
+
/*#__PURE__*/ _jsx(IconSearch, {
|
|
121
|
+
className: "mr-2 h-4 w-4 shrink-0 opacity-50"
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ _jsx(CommandPrimitive.Input, _object_spread({
|
|
124
|
+
ref: ref,
|
|
125
|
+
className: cn('flex w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-zinc-400', className)
|
|
126
|
+
}, props))
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
});
|
|
14
130
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
15
|
-
|
|
131
|
+
var CommandList = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
132
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
133
|
+
"className"
|
|
134
|
+
]);
|
|
135
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.List, _object_spread({
|
|
136
|
+
ref: ref,
|
|
137
|
+
className: cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)
|
|
138
|
+
}, props));
|
|
139
|
+
});
|
|
16
140
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
17
|
-
|
|
141
|
+
var CommandEmpty = /*#__PURE__*/ React.forwardRef(function(props, ref) {
|
|
142
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Empty, _object_spread({
|
|
143
|
+
ref: ref,
|
|
144
|
+
className: "py-6 text-center text-sm"
|
|
145
|
+
}, props));
|
|
146
|
+
});
|
|
18
147
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
19
|
-
|
|
148
|
+
var CommandGroup = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
149
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
150
|
+
"className"
|
|
151
|
+
]);
|
|
152
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Group, _object_spread({
|
|
153
|
+
ref: ref,
|
|
154
|
+
className: cn('overflow-hidden p-1 text-zinc-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-zinc-500 dark:text-zinc-50 dark:[&_[cmdk-group-heading]]:text-zinc-400', className)
|
|
155
|
+
}, props));
|
|
156
|
+
});
|
|
20
157
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
21
|
-
|
|
158
|
+
var CommandSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
159
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
160
|
+
"className"
|
|
161
|
+
]);
|
|
162
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Separator, _object_spread({
|
|
163
|
+
ref: ref,
|
|
164
|
+
className: cn('-mx-1 h-px bg-zinc-200 dark:bg-zinc-800', className)
|
|
165
|
+
}, props));
|
|
166
|
+
});
|
|
22
167
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
23
|
-
|
|
168
|
+
var CommandItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
169
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
170
|
+
"className"
|
|
171
|
+
]);
|
|
172
|
+
return /*#__PURE__*/ _jsx(CommandPrimitive.Item, _object_spread({
|
|
173
|
+
ref: ref,
|
|
174
|
+
className: cn("relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected='true']:bg-zinc-100 data-[selected=true]:text-zinc-900 data-[disabled=true]:opacity-50 dark:data-[selected='true']:bg-zinc-800 dark:data-[selected=true]:text-zinc-50", className)
|
|
175
|
+
}, props));
|
|
176
|
+
});
|
|
24
177
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
25
|
-
|
|
26
|
-
|
|
178
|
+
var CommandShortcut = function(_param) {
|
|
179
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
180
|
+
"className"
|
|
181
|
+
]);
|
|
182
|
+
return /*#__PURE__*/ _jsx("span", _object_spread({
|
|
183
|
+
className: cn('ml-auto text-xs tracking-widest text-zinc-500 dark:text-zinc-400', className)
|
|
184
|
+
}, props));
|
|
27
185
|
};
|
|
28
186
|
CommandShortcut.displayName = 'CommandShortcut';
|
|
29
|
-
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator,
|
|
30
|
-
//# sourceMappingURL=command.js.map
|
|
187
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -1,20 +1,100 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
function _array_like_to_array(arr, len) {
|
|
3
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
4
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
5
|
+
return arr2;
|
|
6
|
+
}
|
|
7
|
+
function _array_with_holes(arr) {
|
|
8
|
+
if (Array.isArray(arr)) return arr;
|
|
9
|
+
}
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) {
|
|
12
|
+
Object.defineProperty(obj, key, {
|
|
13
|
+
value: value,
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
obj[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return obj;
|
|
22
|
+
}
|
|
23
|
+
function _iterable_to_array_limit(arr, i) {
|
|
24
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
25
|
+
if (_i == null) return;
|
|
26
|
+
var _arr = [];
|
|
27
|
+
var _n = true;
|
|
28
|
+
var _d = false;
|
|
29
|
+
var _s, _e;
|
|
30
|
+
try {
|
|
31
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
32
|
+
_arr.push(_s.value);
|
|
33
|
+
if (i && _arr.length === i) break;
|
|
34
|
+
}
|
|
35
|
+
} catch (err) {
|
|
36
|
+
_d = true;
|
|
37
|
+
_e = err;
|
|
38
|
+
} finally{
|
|
39
|
+
try {
|
|
40
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
41
|
+
} finally{
|
|
42
|
+
if (_d) throw _e;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return _arr;
|
|
46
|
+
}
|
|
47
|
+
function _non_iterable_rest() {
|
|
48
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
49
|
+
}
|
|
50
|
+
function _object_spread(target) {
|
|
51
|
+
for(var i = 1; i < arguments.length; i++){
|
|
52
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
53
|
+
var ownKeys = Object.keys(source);
|
|
54
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
55
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
56
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
ownKeys.forEach(function(key) {
|
|
60
|
+
_define_property(target, key, source[key]);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
function _sliced_to_array(arr, i) {
|
|
66
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
67
|
+
}
|
|
68
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
69
|
+
if (!o) return;
|
|
70
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
71
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
72
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
73
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
74
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
75
|
+
}
|
|
2
76
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
77
|
import { useState } from 'react';
|
|
4
78
|
import { useIsMobile } from '../hooks/use-media-query';
|
|
5
79
|
import DatePickerDrawer from './DatePickerDrawer';
|
|
6
80
|
import DatePickerPopover from './DatePickerPopover';
|
|
7
81
|
import { formatInputBy } from './utils';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
82
|
+
var DatePicker = function(props) {
|
|
83
|
+
var value = props.value, isRange = props.isRange, minDate = props.minDate, onChange = props.onChange, tileDisabled = props.tileDisabled, disableWeekends = props.disableWeekends, error = props.error;
|
|
84
|
+
var isMobile = useIsMobile();
|
|
85
|
+
var _useState = _sliced_to_array(useState(value), 2), innerValue = _useState[0], setInnerValue = _useState[1];
|
|
86
|
+
var _useState1 = _sliced_to_array(useState(formatInputBy(value, isRange)), 2), inputValue = _useState1[0], setInputValue = _useState1[1];
|
|
87
|
+
var _useState2 = _sliced_to_array(useState(false), 2), focused = _useState2[0], setFocused = _useState2[1];
|
|
88
|
+
var handleSelect = function(value) {
|
|
15
89
|
if (isRange && Array.isArray(value) && value && value[0] && value[1]) {
|
|
16
|
-
setInnerValue([
|
|
17
|
-
|
|
90
|
+
setInnerValue([
|
|
91
|
+
value[0],
|
|
92
|
+
value[1]
|
|
93
|
+
]);
|
|
94
|
+
setInputValue(formatInputBy([
|
|
95
|
+
value[0],
|
|
96
|
+
value[1]
|
|
97
|
+
], isRange));
|
|
18
98
|
return;
|
|
19
99
|
}
|
|
20
100
|
if (!isRange && !Array.isArray(value) && value) {
|
|
@@ -23,42 +103,62 @@ const DatePicker = (props) => {
|
|
|
23
103
|
return;
|
|
24
104
|
}
|
|
25
105
|
};
|
|
26
|
-
|
|
106
|
+
var handleCancel = function() {
|
|
27
107
|
setFocused(false);
|
|
28
108
|
setInnerValue(value);
|
|
29
109
|
setInputValue(formatInputBy(value, isRange));
|
|
30
110
|
};
|
|
31
|
-
|
|
32
|
-
if (isRange &&
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
onChange?.([innerValue[0], innerValue[1]]);
|
|
111
|
+
var handleApply = function() {
|
|
112
|
+
if (isRange && Array.isArray(innerValue) && innerValue && innerValue[0] && innerValue[1]) {
|
|
113
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([
|
|
114
|
+
innerValue[0],
|
|
115
|
+
innerValue[1]
|
|
116
|
+
]);
|
|
38
117
|
setFocused(false);
|
|
39
118
|
return;
|
|
40
119
|
}
|
|
41
120
|
if (!isRange && !Array.isArray(innerValue) && innerValue) {
|
|
42
|
-
onChange
|
|
121
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(innerValue);
|
|
43
122
|
setFocused(false);
|
|
44
123
|
return;
|
|
45
124
|
}
|
|
46
125
|
};
|
|
47
|
-
|
|
126
|
+
var weekendTiles = function(args) {
|
|
48
127
|
if (args.view === 'month') {
|
|
49
|
-
|
|
128
|
+
var day = args.date.getDay();
|
|
50
129
|
return day === 0 || day === 6;
|
|
51
130
|
}
|
|
52
131
|
return false;
|
|
53
132
|
};
|
|
54
|
-
|
|
55
|
-
if (disableWeekends && weekendTiles(args))
|
|
56
|
-
|
|
57
|
-
if (tileDisabled?.(args))
|
|
58
|
-
return true;
|
|
133
|
+
var combinedTileDisabled = function(args) {
|
|
134
|
+
if (disableWeekends && weekendTiles(args)) return true;
|
|
135
|
+
if (tileDisabled === null || tileDisabled === void 0 ? void 0 : tileDisabled(args)) return true;
|
|
59
136
|
return false;
|
|
60
137
|
};
|
|
61
|
-
return isMobile ?
|
|
138
|
+
return isMobile ? /*#__PURE__*/ _jsx(DatePickerDrawer, _object_spread({
|
|
139
|
+
innerValue: innerValue,
|
|
140
|
+
setInnerValue: setInnerValue,
|
|
141
|
+
inputValue: inputValue,
|
|
142
|
+
setInputValue: setInputValue,
|
|
143
|
+
focused: focused,
|
|
144
|
+
setFocused: setFocused,
|
|
145
|
+
handleSelect: handleSelect,
|
|
146
|
+
handleCancel: handleCancel,
|
|
147
|
+
handleApply: handleApply,
|
|
148
|
+
tileDisabled: combinedTileDisabled,
|
|
149
|
+
error: error
|
|
150
|
+
}, props)) : /*#__PURE__*/ _jsx(DatePickerPopover, _object_spread({
|
|
151
|
+
innerValue: innerValue,
|
|
152
|
+
setInnerValue: setInnerValue,
|
|
153
|
+
inputValue: inputValue,
|
|
154
|
+
setInputValue: setInputValue,
|
|
155
|
+
focused: focused,
|
|
156
|
+
setFocused: setFocused,
|
|
157
|
+
handleSelect: handleSelect,
|
|
158
|
+
handleCancel: handleCancel,
|
|
159
|
+
handleApply: handleApply,
|
|
160
|
+
tileDisabled: combinedTileDisabled,
|
|
161
|
+
error: error
|
|
162
|
+
}, props));
|
|
62
163
|
};
|
|
63
164
|
export default DatePicker;
|
|
64
|
-
//# sourceMappingURL=DatePicker.js.map
|