@driveflux/beam 2.0.10 → 2.0.12

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.
Files changed (217) hide show
  1. package/dist/accordion/Accordion.js +133 -7
  2. package/dist/accordion/Accordion.stories.js +31 -11
  3. package/dist/alert/Alert.js +110 -14
  4. package/dist/alert/Alert.stories.js +50 -15
  5. package/dist/animations/LoadingAnimation.js +34 -21
  6. package/dist/badge/Badge.js +96 -7
  7. package/dist/badge/Badge.stories.js +28 -7
  8. package/dist/base-styles.css +7 -21
  9. package/dist/box/Box.js +87 -3
  10. package/dist/box/Box.stories.js +8 -7
  11. package/dist/breadcrumbs/Breadcrumbs.js +288 -28
  12. package/dist/breadcrumbs/Breadcrumbs.stories.js +51 -27
  13. package/dist/button/Button.js +124 -12
  14. package/dist/button/Button.stories.js +35 -7
  15. package/dist/card/Card.js +109 -7
  16. package/dist/card/Card.stories.js +10 -7
  17. package/dist/carousel/Carousel.js +281 -58
  18. package/dist/carousel/Carousel.stories.js +39 -7
  19. package/dist/carousel/CarouselButton.js +68 -7
  20. package/dist/center/Center.js +63 -3
  21. package/dist/center/Center.stories.js +19 -7
  22. package/dist/checkbox/Checkbox.js +124 -4
  23. package/dist/checkbox/Checkbox.stories.js +10 -8
  24. package/dist/chip/Chip.js +104 -3
  25. package/dist/chip/Chip.stories.js +19 -7
  26. package/dist/circular-progress/CircularProgress.js +150 -11
  27. package/dist/circular-progress/CircularProgress.stories.js +54 -14
  28. package/dist/command/command.js +170 -13
  29. package/dist/datepicker/DatePicker.js +127 -27
  30. package/dist/datepicker/DatePicker.stories.js +163 -58
  31. package/dist/datepicker/DatePickerDrawer.js +110 -14
  32. package/dist/datepicker/DatePickerPopover.js +207 -35
  33. package/dist/datepicker/constants.js +3 -4
  34. package/dist/datepicker/root-calendar.css +58 -58
  35. package/dist/datepicker/utils.js +4 -11
  36. package/dist/dialog/index.js +144 -12
  37. package/dist/divider/Divider.js +63 -3
  38. package/dist/divider/Divider.stories.js +13 -7
  39. package/dist/drawer/index.js +157 -12
  40. package/dist/dropdown/Dropdown.js +212 -26
  41. package/dist/dropdown/Dropdown.stories.js +109 -22
  42. package/dist/field-wrapper/FieldWrapper.js +139 -3
  43. package/dist/field-wrapper/FieldWrapper.stories.js +124 -28
  44. package/dist/flex/Flex.js +63 -3
  45. package/dist/flex/Flex.stories.js +19 -7
  46. package/dist/grid/Grid.js +63 -3
  47. package/dist/grid/Grid.stories.js +28 -7
  48. package/dist/hooks/use-breakpoint-value.js +77 -14
  49. package/dist/hooks/use-media-query.js +61 -12
  50. package/dist/hstack/HStack.js +63 -3
  51. package/dist/hstack/HStack.stories.js +19 -7
  52. package/dist/icons/FluxLogo.js +213 -9
  53. package/dist/icons/FluxLogoTable.js +109 -5
  54. package/dist/icons/Icon.js +108 -7
  55. package/dist/icons/Icon.stories.js +12 -7
  56. package/dist/icons/Icon24Hours.js +83 -5
  57. package/dist/icons/IconAcceleration.js +72 -4
  58. package/dist/icons/IconAccount.js +72 -4
  59. package/dist/icons/IconApplicant.js +78 -5
  60. package/dist/icons/IconArrow.js +78 -6
  61. package/dist/icons/IconArrowBack.js +72 -4
  62. package/dist/icons/IconArrowForward.js +72 -4
  63. package/dist/icons/IconArrowTopLeft.js +70 -4
  64. package/dist/icons/IconBluesharkProductGuide.js +80 -5
  65. package/dist/icons/IconBolt.js +72 -4
  66. package/dist/icons/IconBriefcase.js +72 -4
  67. package/dist/icons/IconBulb.js +72 -4
  68. package/dist/icons/IconCalendar.js +72 -4
  69. package/dist/icons/IconCalendarArrowBack.js +72 -4
  70. package/dist/icons/IconCalendarArrowForward.js +72 -4
  71. package/dist/icons/IconCalendarDoubleArrowBack.js +72 -4
  72. package/dist/icons/IconCalendarDoubleArrowForward.js +72 -4
  73. package/dist/icons/IconCancel.js +85 -6
  74. package/dist/icons/IconCancelMark.js +72 -4
  75. package/dist/icons/IconCarSUV.js +72 -4
  76. package/dist/icons/IconCarSedan.js +147 -7
  77. package/dist/icons/IconChain.js +79 -5
  78. package/dist/icons/IconCheckmark.js +72 -4
  79. package/dist/icons/IconChevronRight.js +72 -4
  80. package/dist/icons/IconCircle.js +114 -11
  81. package/dist/icons/IconCircleCheckmark.js +77 -5
  82. package/dist/icons/IconCircleError.js +72 -4
  83. package/dist/icons/IconCircleExclamation.js +104 -6
  84. package/dist/icons/IconCircleMark.js +78 -5
  85. package/dist/icons/IconCircleOutline.js +140 -5
  86. package/dist/icons/IconClock.js +80 -5
  87. package/dist/icons/IconClose.js +72 -4
  88. package/dist/icons/IconConcierge.js +79 -5
  89. package/dist/icons/IconConciergeService.js +87 -5
  90. package/dist/icons/IconCreditCard.js +78 -5
  91. package/dist/icons/IconDash.js +72 -4
  92. package/dist/icons/IconDeliver.js +72 -4
  93. package/dist/icons/IconDelivery.js +87 -5
  94. package/dist/icons/IconDetails.js +72 -4
  95. package/dist/icons/IconDot.js +87 -6
  96. package/dist/icons/IconEVCharging.js +79 -5
  97. package/dist/icons/IconElectricCarFuel.js +80 -5
  98. package/dist/icons/IconEllipsis.js +78 -5
  99. package/dist/icons/IconEnvelope.js +72 -4
  100. package/dist/icons/IconEye.js +79 -5
  101. package/dist/icons/IconFacebook.js +94 -6
  102. package/dist/icons/IconFilter.js +83 -5
  103. package/dist/icons/IconFlagMalaysia.js +141 -5
  104. package/dist/icons/IconGiveKey.js +79 -5
  105. package/dist/icons/IconGlobe.js +70 -4
  106. package/dist/icons/IconGoogle.js +87 -5
  107. package/dist/icons/IconHome.js +78 -5
  108. package/dist/icons/IconHostAdvertise.js +72 -4
  109. package/dist/icons/IconHostCar.js +75 -4
  110. package/dist/icons/IconHostCash.js +91 -5
  111. package/dist/icons/IconHostHandle.js +70 -4
  112. package/dist/icons/IconHostLocation.js +70 -4
  113. package/dist/icons/IconHostPayment.js +91 -5
  114. package/dist/icons/IconHostService.js +79 -5
  115. package/dist/icons/IconHotDeals.js +72 -4
  116. package/dist/icons/IconInfo.js +77 -5
  117. package/dist/icons/IconInstagram.js +72 -4
  118. package/dist/icons/IconInsurance.js +99 -5
  119. package/dist/icons/IconInternet.js +73 -4
  120. package/dist/icons/IconInventory.js +78 -5
  121. package/dist/icons/IconLaurel.js +101 -5
  122. package/dist/icons/IconLinkedIn.js +72 -4
  123. package/dist/icons/IconLoading.js +78 -4
  124. package/dist/icons/IconLocation.js +80 -5
  125. package/dist/icons/IconLock.js +73 -4
  126. package/dist/icons/IconLogistics.js +72 -4
  127. package/dist/icons/IconMail.js +94 -5
  128. package/dist/icons/IconMember.js +78 -5
  129. package/dist/icons/IconMobilePen.js +83 -5
  130. package/dist/icons/IconMotorcycleMoped.js +78 -5
  131. package/dist/icons/IconNoCost.js +92 -5
  132. package/dist/icons/IconPDF.js +80 -5
  133. package/dist/icons/IconPencil.js +70 -4
  134. package/dist/icons/IconPhone.js +70 -4
  135. package/dist/icons/IconPlus.js +72 -4
  136. package/dist/icons/IconPricing.js +72 -4
  137. package/dist/icons/IconProtected.js +71 -4
  138. package/dist/icons/IconPsychology.js +72 -4
  139. package/dist/icons/IconQuestionTooltip.js +73 -4
  140. package/dist/icons/IconQuote.js +72 -4
  141. package/dist/icons/IconRate.js +71 -4
  142. package/dist/icons/IconRegister.js +99 -5
  143. package/dist/icons/IconReturn.js +72 -4
  144. package/dist/icons/IconSearch.js +70 -4
  145. package/dist/icons/IconSecure.js +71 -4
  146. package/dist/icons/IconSecurity.js +73 -4
  147. package/dist/icons/IconSedanOutline.js +159 -5
  148. package/dist/icons/IconSelectArrow.js +78 -6
  149. package/dist/icons/IconSort.js +79 -5
  150. package/dist/icons/IconSortListed.js +95 -5
  151. package/dist/icons/IconSortPriceAscending.js +83 -5
  152. package/dist/icons/IconSortPriceDescending.js +83 -5
  153. package/dist/icons/IconSortYear.js +79 -5
  154. package/dist/icons/IconSpan.js +71 -4
  155. package/dist/icons/IconSpeaker.js +79 -4
  156. package/dist/icons/IconSpecialCar.js +95 -5
  157. package/dist/icons/IconStar.js +92 -7
  158. package/dist/icons/IconStockPhoto.js +95 -5
  159. package/dist/icons/IconSubscription.js +113 -6
  160. package/dist/icons/IconSubscriptions.js +113 -6
  161. package/dist/icons/IconSwap.js +79 -5
  162. package/dist/icons/IconTax.js +72 -4
  163. package/dist/icons/IconThinArrow.js +78 -6
  164. package/dist/icons/IconThumbsdown.js +78 -5
  165. package/dist/icons/IconThumbsup.js +78 -5
  166. package/dist/icons/IconTool.js +72 -4
  167. package/dist/icons/IconTooltip.js +73 -4
  168. package/dist/icons/IconTrash.js +72 -4
  169. package/dist/icons/IconTriangleExclamation.js +72 -4
  170. package/dist/icons/IconTyersBrakes.js +83 -5
  171. package/dist/icons/IconTyre.js +83 -5
  172. package/dist/icons/IconVacancy.js +78 -5
  173. package/dist/icons/IconVolunteer.js +72 -4
  174. package/dist/icons/IconWhatsapp.js +73 -4
  175. package/dist/icons/IconXPlatform.js +72 -4
  176. package/dist/icons/IconZeroEffort.js +77 -5
  177. package/dist/icons/Logo.js +99 -3
  178. package/dist/input/Input.js +125 -11
  179. package/dist/input/Input.stories.js +17 -18
  180. package/dist/input-mask/InputMask.js +149 -11
  181. package/dist/input-mask/InputMask.stories.js +5 -6
  182. package/dist/input-mask/mask-trackers.js +4 -5
  183. package/dist/input-select/InputSelect.js +357 -68
  184. package/dist/input-select/InputSelect.stories.js +98 -25
  185. package/dist/popover/popover.js +72 -4
  186. package/dist/progress/Progress.js +96 -2
  187. package/dist/progress/Progress.stories.js +13 -14
  188. package/dist/radio/Radio.js +163 -4
  189. package/dist/scroll-area/scroll-area.js +113 -5
  190. package/dist/search-input-select/SearchInputSelect.js +346 -69
  191. package/dist/select/Select.js +315 -29
  192. package/dist/select/Select.stories.js +55 -19
  193. package/dist/skeleton/Skeleton.js +62 -3
  194. package/dist/skeleton/Skeleton.stories.js +8 -7
  195. package/dist/slider/Slider.js +106 -5
  196. package/dist/slider/Slider.stories.js +12 -11
  197. package/dist/stack/Stack.js +63 -3
  198. package/dist/stack/Stack.stories.js +19 -7
  199. package/dist/styles.css +7 -131
  200. package/dist/table/Table.js +131 -10
  201. package/dist/table/Table.stories.js +84 -8
  202. package/dist/tabs/Tabs.js +128 -9
  203. package/dist/tabs/Tabs.stories.js +46 -13
  204. package/dist/text/Text.js +88 -6
  205. package/dist/text/Text.stories.js +44 -7
  206. package/dist/toast/Toast.stories.js +66 -14
  207. package/dist/toast/ToastBox.js +71 -24
  208. package/dist/toast/index.js +0 -1
  209. package/dist/toast/sonner.js +70 -11
  210. package/dist/toggle/Toggle.js +116 -7
  211. package/dist/toggle/Toggle.stories.js +10 -8
  212. package/dist/tooltip/Tooltip.js +151 -12
  213. package/dist/tooltip/Tooltip.stories.js +71 -13
  214. package/dist/utils.js +4 -2
  215. package/dist/vstack/VStack.js +63 -3
  216. package/dist/vstack/VStack.stories.js +19 -7
  217. package/package.json +4 -4
@@ -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
- const Command = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive, { ref: ref, 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), ...props })));
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
- const CommandDialog = ({ children, ...props }) => {
11
- return (_jsx(Dialog, { ...props, children: _jsx(DialogContent, { className: "overflow-hidden p-0 shadow-lg", children: _jsx(Command, { 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", children: children }) }) }));
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
- const CommandInput = React.forwardRef(({ className, containerClassName, ...props }, ref) => (_jsxs("div", { className: cn('flex h-10 items-center border-b px-3', containerClassName), "cmdk-input-wrapper": "", children: [_jsx(IconSearch, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { ref: ref, 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), ...props })] })));
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
- const CommandList = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.List, { ref: ref, className: cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className), ...props })));
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
- const CommandEmpty = React.forwardRef((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
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
- const CommandGroup = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Group, { ref: ref, 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), ...props })));
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
- const CommandSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Separator, { ref: ref, className: cn('-mx-1 h-px bg-zinc-200 dark:bg-zinc-800', className), ...props })));
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
- const CommandItem = React.forwardRef(({ className, ...props }, ref) => (_jsx(CommandPrimitive.Item, { ref: ref, 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), ...props })));
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
- const CommandShortcut = ({ className, ...props }) => {
26
- return (_jsx("span", { className: cn('ml-auto text-xs tracking-widest text-zinc-500 dark:text-zinc-400', className), ...props }));
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
- const DatePicker = (props) => {
9
- const { value, isRange, minDate, onChange, tileDisabled, disableWeekends, error, } = props;
10
- const isMobile = useIsMobile();
11
- const [innerValue, setInnerValue] = useState(value);
12
- const [inputValue, setInputValue] = useState(formatInputBy(value, isRange));
13
- const [focused, setFocused] = useState(false);
14
- const handleSelect = (value) => {
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([value[0], value[1]]);
17
- setInputValue(formatInputBy([value[0], value[1]], isRange));
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
- const handleCancel = () => {
106
+ var handleCancel = function() {
27
107
  setFocused(false);
28
108
  setInnerValue(value);
29
109
  setInputValue(formatInputBy(value, isRange));
30
110
  };
31
- const handleApply = () => {
32
- if (isRange &&
33
- Array.isArray(innerValue) &&
34
- innerValue &&
35
- innerValue[0] &&
36
- innerValue[1]) {
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?.(innerValue);
121
+ onChange === null || onChange === void 0 ? void 0 : onChange(innerValue);
43
122
  setFocused(false);
44
123
  return;
45
124
  }
46
125
  };
47
- const weekendTiles = (args) => {
126
+ var weekendTiles = function(args) {
48
127
  if (args.view === 'month') {
49
- const day = args.date.getDay();
128
+ var day = args.date.getDay();
50
129
  return day === 0 || day === 6;
51
130
  }
52
131
  return false;
53
132
  };
54
- const combinedTileDisabled = (args) => {
55
- if (disableWeekends && weekendTiles(args))
56
- return true;
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 ? (_jsx(DatePickerDrawer, { innerValue: innerValue, setInnerValue: setInnerValue, inputValue: inputValue, setInputValue: setInputValue, focused: focused, setFocused: setFocused, handleSelect: handleSelect, handleCancel: handleCancel, handleApply: handleApply, tileDisabled: combinedTileDisabled, error: error, ...props })) : (_jsx(DatePickerPopover, { innerValue: innerValue, setInnerValue: setInnerValue, inputValue: inputValue, setInputValue: setInputValue, focused: focused, setFocused: setFocused, handleSelect: handleSelect, handleCancel: handleCancel, handleApply: handleApply, tileDisabled: combinedTileDisabled, error: error, ...props }));
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
@@ -1,79 +1,184 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_with_holes(arr) {
7
+ if (Array.isArray(arr)) return arr;
8
+ }
9
+ function _iterable_to_array_limit(arr, i) {
10
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
11
+ if (_i == null) return;
12
+ var _arr = [];
13
+ var _n = true;
14
+ var _d = false;
15
+ var _s, _e;
16
+ try {
17
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
18
+ _arr.push(_s.value);
19
+ if (i && _arr.length === i) break;
20
+ }
21
+ } catch (err) {
22
+ _d = true;
23
+ _e = err;
24
+ } finally{
25
+ try {
26
+ if (!_n && _i["return"] != null) _i["return"]();
27
+ } finally{
28
+ if (_d) throw _e;
29
+ }
30
+ }
31
+ return _arr;
32
+ }
33
+ function _non_iterable_rest() {
34
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
35
+ }
36
+ function _sliced_to_array(arr, i) {
37
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
38
+ }
39
+ function _unsupported_iterable_to_array(o, minLen) {
40
+ if (!o) return;
41
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
42
+ var n = Object.prototype.toString.call(o).slice(8, -1);
43
+ if (n === "Object" && o.constructor) n = o.constructor.name;
44
+ if (n === "Map" || n === "Set") return Array.from(n);
45
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
46
+ }
1
47
  import { jsx as _jsx } from "react/jsx-runtime";
2
48
  import { useState } from 'react';
3
49
  import DatePicker from './DatePicker.js';
4
- const meta = {
50
+ var meta = {
5
51
  component: DatePicker,
6
52
  argTypes: {
7
53
  locale: {
8
- options: ['en', 'ms', 'zh', 'ar'],
9
- control: { type: 'select' },
54
+ options: [
55
+ 'en',
56
+ 'ms',
57
+ 'zh',
58
+ 'ar'
59
+ ],
60
+ control: {
61
+ type: 'select'
62
+ }
10
63
  },
11
64
  calendarType: {
12
- options: ['iso8601', 'gregory', 'islamic', 'hebrew'],
13
- control: { type: 'select' },
14
- },
15
- },
65
+ options: [
66
+ 'iso8601',
67
+ 'gregory',
68
+ 'islamic',
69
+ 'hebrew'
70
+ ],
71
+ control: {
72
+ type: 'select'
73
+ }
74
+ }
75
+ }
16
76
  };
17
77
  export default meta;
18
- export const Standard = {
19
- render: () => {
20
- const [date, setDate] = useState(new Date());
21
- return (_jsx(DatePicker, { htmlFor: "standard-calendar", value: date, onChange: setDate }));
22
- },
78
+ export var Standard = {
79
+ render: function() {
80
+ var _useState = _sliced_to_array(useState(new Date()), 2), date = _useState[0], setDate = _useState[1];
81
+ return /*#__PURE__*/ _jsx(DatePicker, {
82
+ htmlFor: "standard-calendar",
83
+ value: date,
84
+ onChange: setDate
85
+ });
86
+ }
23
87
  };
24
- export const Locale = {
25
- render: () => {
26
- const [date, setDate] = useState();
27
- return (_jsx(DatePicker, { htmlFor: "standard-calendar", locale: "ms", value: date, onChange: setDate }));
28
- },
88
+ export var Locale = {
89
+ render: function() {
90
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
91
+ return /*#__PURE__*/ _jsx(DatePicker, {
92
+ htmlFor: "standard-calendar",
93
+ locale: "ms",
94
+ value: date,
95
+ onChange: setDate
96
+ });
97
+ }
29
98
  };
30
- export const Ranged = {
31
- render: (args) => {
32
- const [dates, setDates] = useState();
33
- const [error, setError] = useState('');
34
- return (_jsx(DatePicker, { htmlFor: "ranged-calendar", isRange: true, value: dates, onChange: (dates) => {
99
+ export var Ranged = {
100
+ render: function(args) {
101
+ var _useState = _sliced_to_array(useState(), 2), dates = _useState[0], setDates = _useState[1];
102
+ var _useState1 = _sliced_to_array(useState(''), 2), error = _useState1[0], setError = _useState1[1];
103
+ return /*#__PURE__*/ _jsx(DatePicker, {
104
+ htmlFor: "ranged-calendar",
105
+ isRange: true,
106
+ value: dates,
107
+ onChange: function(dates) {
35
108
  setDates(dates);
36
109
  setError('');
37
- }, onError: (type) => type === 'start-gte-end' &&
38
- setError('Start Date must be earlier than End Date'), inputProps: {
39
- error: error,
40
- } }));
41
- },
110
+ },
111
+ onError: function(type) {
112
+ return type === 'start-gte-end' && setError('Start Date must be earlier than End Date');
113
+ },
114
+ inputProps: {
115
+ error: error
116
+ }
117
+ });
118
+ }
42
119
  };
43
- export const MinDate = {
44
- render: () => {
45
- const [date, setDate] = useState();
46
- return (_jsx(DatePicker, { htmlFor: "mindate-calendar", minDate: new Date(), value: date, onChange: setDate }));
47
- },
120
+ export var MinDate = {
121
+ render: function() {
122
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
123
+ return /*#__PURE__*/ _jsx(DatePicker, {
124
+ htmlFor: "mindate-calendar",
125
+ minDate: new Date(),
126
+ value: date,
127
+ onChange: setDate
128
+ });
129
+ }
48
130
  };
49
- export const MaxDate = {
50
- render: () => {
51
- const [date, setDate] = useState();
52
- return (_jsx(DatePicker, { htmlFor: "maxdate-calendar", maxDate: new Date(), value: date, onChange: setDate }));
53
- },
131
+ export var MaxDate = {
132
+ render: function() {
133
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
134
+ return /*#__PURE__*/ _jsx(DatePicker, {
135
+ htmlFor: "maxdate-calendar",
136
+ maxDate: new Date(),
137
+ value: date,
138
+ onChange: setDate
139
+ });
140
+ }
54
141
  };
55
- export const CalendarType = {
56
- render: () => {
57
- const [date, setDate] = useState();
58
- return (_jsx(DatePicker, { htmlFor: "islamic-calendar", calendarType: "islamic", value: date, onChange: setDate }));
59
- },
142
+ export var CalendarType = {
143
+ render: function() {
144
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
145
+ return /*#__PURE__*/ _jsx(DatePicker, {
146
+ htmlFor: "islamic-calendar",
147
+ calendarType: "islamic",
148
+ value: date,
149
+ onChange: setDate
150
+ });
151
+ }
60
152
  };
61
- export const Disabled = {
62
- render: () => {
63
- const [date, setDate] = useState();
64
- return (_jsx(DatePicker, { htmlFor: "disabled-calendar", isDisabled: true, value: date, onChange: setDate }));
65
- },
153
+ export var Disabled = {
154
+ render: function() {
155
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
156
+ return /*#__PURE__*/ _jsx(DatePicker, {
157
+ htmlFor: "disabled-calendar",
158
+ isDisabled: true,
159
+ value: date,
160
+ onChange: setDate
161
+ });
162
+ }
66
163
  };
67
- export const DisableWeekends = {
68
- render: () => {
69
- const [date, setDate] = useState();
70
- return (_jsx(DatePicker, { htmlFor: "no-date-calendar", value: date, onChange: setDate, disableWeekends: true }));
71
- },
164
+ export var DisableWeekends = {
165
+ render: function() {
166
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
167
+ return /*#__PURE__*/ _jsx(DatePicker, {
168
+ htmlFor: "no-date-calendar",
169
+ value: date,
170
+ onChange: setDate,
171
+ disableWeekends: true
172
+ });
173
+ }
72
174
  };
73
- export const NoDate = {
74
- render: () => {
75
- const [date, setDate] = useState();
76
- return (_jsx(DatePicker, { htmlFor: "no-date-calendar", value: date, onChange: setDate }));
77
- },
175
+ export var NoDate = {
176
+ render: function() {
177
+ var _useState = _sliced_to_array(useState(), 2), date = _useState[0], setDate = _useState[1];
178
+ return /*#__PURE__*/ _jsx(DatePicker, {
179
+ htmlFor: "no-date-calendar",
180
+ value: date,
181
+ onChange: setDate
182
+ });
183
+ }
78
184
  };
79
- //# sourceMappingURL=DatePicker.stories.js.map