@driveflux/beam 2.0.12 → 2.0.14

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 (236) hide show
  1. package/dist/accordion/Accordion.js +7 -133
  2. package/dist/accordion/Accordion.stories.js +11 -31
  3. package/dist/alert/Alert.js +14 -110
  4. package/dist/alert/Alert.stories.js +15 -50
  5. package/dist/animations/LoadingAnimation.js +21 -34
  6. package/dist/badge/Badge.js +7 -96
  7. package/dist/badge/Badge.stories.js +7 -28
  8. package/dist/base-styles.css +25 -12
  9. package/dist/box/Box.js +3 -87
  10. package/dist/box/Box.stories.js +7 -8
  11. package/dist/breadcrumbs/Breadcrumbs.js +28 -288
  12. package/dist/breadcrumbs/Breadcrumbs.stories.js +27 -51
  13. package/dist/button/Button.js +12 -124
  14. package/dist/button/Button.stories.js +7 -35
  15. package/dist/card/Card.js +7 -109
  16. package/dist/card/Card.stories.js +7 -10
  17. package/dist/carousel/Carousel.js +58 -281
  18. package/dist/carousel/Carousel.stories.js +7 -39
  19. package/dist/carousel/CarouselButton.js +7 -68
  20. package/dist/center/Center.js +3 -63
  21. package/dist/center/Center.stories.js +7 -19
  22. package/dist/checkbox/Checkbox.js +4 -124
  23. package/dist/checkbox/Checkbox.stories.js +8 -10
  24. package/dist/chip/Chip.js +3 -104
  25. package/dist/chip/Chip.stories.js +7 -19
  26. package/dist/circular-progress/CircularProgress.js +11 -150
  27. package/dist/circular-progress/CircularProgress.stories.js +14 -54
  28. package/dist/command/command.d.ts +7 -7
  29. package/dist/command/command.js +13 -170
  30. package/dist/datepicker/DatePicker.js +27 -127
  31. package/dist/datepicker/DatePicker.stories.js +58 -163
  32. package/dist/datepicker/DatePickerDrawer.js +14 -110
  33. package/dist/datepicker/DatePickerPopover.js +35 -207
  34. package/dist/dialog/index.d.ts +3 -1
  35. package/dist/dialog/index.d.ts.map +1 -1
  36. package/dist/dialog/index.js +34 -144
  37. package/dist/dialog/index.js.map +1 -1
  38. package/dist/divider/Divider.js +3 -63
  39. package/dist/divider/Divider.stories.js +7 -13
  40. package/dist/drawer/index.js +12 -157
  41. package/dist/dropdown/Dropdown.js +26 -212
  42. package/dist/dropdown/Dropdown.stories.js +22 -109
  43. package/dist/field-wrapper/FieldWrapper.js +3 -139
  44. package/dist/field-wrapper/FieldWrapper.stories.js +28 -124
  45. package/dist/flex/Flex.js +3 -63
  46. package/dist/flex/Flex.stories.js +7 -19
  47. package/dist/grid/Grid.js +3 -63
  48. package/dist/grid/Grid.stories.js +7 -28
  49. package/dist/hooks/use-media-query.js +12 -61
  50. package/dist/hstack/HStack.js +3 -63
  51. package/dist/hstack/HStack.stories.js +7 -19
  52. package/dist/icons/FluxLogo.js +9 -213
  53. package/dist/icons/FluxLogoTable.js +5 -109
  54. package/dist/icons/Icon.js +7 -108
  55. package/dist/icons/Icon.stories.js +7 -12
  56. package/dist/icons/Icon24Hours.js +5 -83
  57. package/dist/icons/IconAcceleration.js +4 -72
  58. package/dist/icons/IconAccount.js +4 -72
  59. package/dist/icons/IconApplicant.js +5 -78
  60. package/dist/icons/IconArrow.js +6 -78
  61. package/dist/icons/IconArrowBack.js +4 -72
  62. package/dist/icons/IconArrowForward.js +4 -72
  63. package/dist/icons/IconArrowTopLeft.js +4 -70
  64. package/dist/icons/IconBluesharkProductGuide.js +5 -80
  65. package/dist/icons/IconBolt.js +4 -72
  66. package/dist/icons/IconBriefcase.js +4 -72
  67. package/dist/icons/IconBulb.js +4 -72
  68. package/dist/icons/IconCalendar.js +4 -72
  69. package/dist/icons/IconCalendarArrowBack.js +4 -72
  70. package/dist/icons/IconCalendarArrowForward.js +4 -72
  71. package/dist/icons/IconCalendarDoubleArrowBack.js +4 -72
  72. package/dist/icons/IconCalendarDoubleArrowForward.js +4 -72
  73. package/dist/icons/IconCancel.js +6 -85
  74. package/dist/icons/IconCancelMark.js +4 -72
  75. package/dist/icons/IconCarSUV.js +4 -72
  76. package/dist/icons/IconCarSedan.js +7 -147
  77. package/dist/icons/IconChain.js +5 -79
  78. package/dist/icons/IconCheckmark.js +4 -72
  79. package/dist/icons/IconChevronRight.js +4 -72
  80. package/dist/icons/IconCircle.js +11 -114
  81. package/dist/icons/IconCircleCheckmark.js +5 -77
  82. package/dist/icons/IconCircleError.js +4 -72
  83. package/dist/icons/IconCircleExclamation.js +6 -104
  84. package/dist/icons/IconCircleMark.js +5 -78
  85. package/dist/icons/IconCircleOutline.d.ts.map +1 -1
  86. package/dist/icons/IconCircleOutline.js +5 -140
  87. package/dist/icons/IconCircleOutline.js.map +1 -1
  88. package/dist/icons/IconClock.js +5 -80
  89. package/dist/icons/IconClose.js +4 -72
  90. package/dist/icons/IconCollapseAll.d.ts +8 -0
  91. package/dist/icons/IconCollapseAll.d.ts.map +1 -0
  92. package/dist/icons/IconCollapseAll.js +8 -0
  93. package/dist/icons/IconCollapseAll.js.map +1 -0
  94. package/dist/icons/IconConcierge.js +5 -79
  95. package/dist/icons/IconConciergeService.js +5 -87
  96. package/dist/icons/IconCreditCard.js +5 -78
  97. package/dist/icons/IconDash.js +4 -72
  98. package/dist/icons/IconDeliver.js +4 -72
  99. package/dist/icons/IconDelivery.js +5 -87
  100. package/dist/icons/IconDetails.js +4 -72
  101. package/dist/icons/IconDot.js +6 -87
  102. package/dist/icons/IconDownload.d.ts +8 -0
  103. package/dist/icons/IconDownload.d.ts.map +1 -0
  104. package/dist/icons/IconDownload.js +8 -0
  105. package/dist/icons/IconDownload.js.map +1 -0
  106. package/dist/icons/IconEVCharging.js +5 -79
  107. package/dist/icons/IconElectricCarFuel.js +5 -80
  108. package/dist/icons/IconEllipsis.js +5 -78
  109. package/dist/icons/IconEnvelope.js +4 -72
  110. package/dist/icons/IconExpandAll.d.ts +8 -0
  111. package/dist/icons/IconExpandAll.d.ts.map +1 -0
  112. package/dist/icons/IconExpandAll.js +8 -0
  113. package/dist/icons/IconExpandAll.js.map +1 -0
  114. package/dist/icons/IconEye.js +5 -79
  115. package/dist/icons/IconFacebook.js +6 -94
  116. package/dist/icons/IconFilter.js +5 -83
  117. package/dist/icons/IconFlagMalaysia.js +5 -141
  118. package/dist/icons/IconGiveKey.js +5 -79
  119. package/dist/icons/IconGlobe.js +4 -70
  120. package/dist/icons/IconGoogle.js +5 -87
  121. package/dist/icons/IconHome.js +5 -78
  122. package/dist/icons/IconHostAdvertise.js +4 -72
  123. package/dist/icons/IconHostCar.js +4 -75
  124. package/dist/icons/IconHostCash.js +5 -91
  125. package/dist/icons/IconHostHandle.js +4 -70
  126. package/dist/icons/IconHostLocation.js +4 -70
  127. package/dist/icons/IconHostPayment.js +5 -91
  128. package/dist/icons/IconHostService.js +5 -79
  129. package/dist/icons/IconHotDeals.js +4 -72
  130. package/dist/icons/IconInfo.js +5 -77
  131. package/dist/icons/IconInstagram.js +4 -72
  132. package/dist/icons/IconInsurance.js +5 -99
  133. package/dist/icons/IconInternet.js +4 -73
  134. package/dist/icons/IconInventory.js +5 -78
  135. package/dist/icons/IconLaurel.js +5 -101
  136. package/dist/icons/IconLinkedIn.js +4 -72
  137. package/dist/icons/IconLoading.js +4 -78
  138. package/dist/icons/IconLocation.js +5 -80
  139. package/dist/icons/IconLock.js +4 -73
  140. package/dist/icons/IconLogistics.js +4 -72
  141. package/dist/icons/IconMail.js +5 -94
  142. package/dist/icons/IconMember.js +5 -78
  143. package/dist/icons/IconMobilePen.js +5 -83
  144. package/dist/icons/IconMotorcycleMoped.js +5 -78
  145. package/dist/icons/IconNoCost.js +5 -92
  146. package/dist/icons/IconPDF.js +5 -80
  147. package/dist/icons/IconPencil.js +4 -70
  148. package/dist/icons/IconPhone.js +4 -70
  149. package/dist/icons/IconPlus.js +4 -72
  150. package/dist/icons/IconPricing.js +4 -72
  151. package/dist/icons/IconProtected.js +4 -71
  152. package/dist/icons/IconPsychology.js +4 -72
  153. package/dist/icons/IconQuestionTooltip.js +4 -73
  154. package/dist/icons/IconQuote.js +4 -72
  155. package/dist/icons/IconRate.js +4 -71
  156. package/dist/icons/IconRegister.js +5 -99
  157. package/dist/icons/IconReport.d.ts +9 -0
  158. package/dist/icons/IconReport.d.ts.map +1 -0
  159. package/dist/icons/IconReport.js +9 -0
  160. package/dist/icons/IconReport.js.map +1 -0
  161. package/dist/icons/IconReturn.js +4 -72
  162. package/dist/icons/IconSearch.js +4 -70
  163. package/dist/icons/IconSecure.js +4 -71
  164. package/dist/icons/IconSecurity.js +4 -73
  165. package/dist/icons/IconSedanOutline.js +5 -159
  166. package/dist/icons/IconSelectArrow.js +6 -78
  167. package/dist/icons/IconSort.js +5 -79
  168. package/dist/icons/IconSortListed.js +5 -95
  169. package/dist/icons/IconSortPriceAscending.js +5 -83
  170. package/dist/icons/IconSortPriceDescending.js +5 -83
  171. package/dist/icons/IconSortYear.js +5 -79
  172. package/dist/icons/IconSpan.js +4 -71
  173. package/dist/icons/IconSpeaker.js +4 -79
  174. package/dist/icons/IconSpecialCar.js +5 -95
  175. package/dist/icons/IconStar.js +7 -92
  176. package/dist/icons/IconStockPhoto.js +5 -95
  177. package/dist/icons/IconSubscription.js +6 -113
  178. package/dist/icons/IconSubscriptions.js +6 -113
  179. package/dist/icons/IconSwap.js +5 -79
  180. package/dist/icons/IconTax.js +4 -72
  181. package/dist/icons/IconThinArrow.js +6 -78
  182. package/dist/icons/IconThumbsdown.js +5 -78
  183. package/dist/icons/IconThumbsup.js +5 -78
  184. package/dist/icons/IconTool.js +4 -72
  185. package/dist/icons/IconTooltip.js +4 -73
  186. package/dist/icons/IconTrash.js +4 -72
  187. package/dist/icons/IconTriangleExclamation.js +4 -72
  188. package/dist/icons/IconTyersBrakes.js +5 -83
  189. package/dist/icons/IconTyre.js +5 -83
  190. package/dist/icons/IconVacancy.js +5 -78
  191. package/dist/icons/IconVolunteer.js +4 -72
  192. package/dist/icons/IconWhatsapp.js +4 -73
  193. package/dist/icons/IconXPlatform.js +4 -72
  194. package/dist/icons/IconZeroEffort.js +5 -77
  195. package/dist/icons/Logo.js +3 -99
  196. package/dist/input/Input.js +11 -125
  197. package/dist/input/Input.stories.js +18 -17
  198. package/dist/input-mask/InputMask.js +11 -149
  199. package/dist/input-mask/InputMask.stories.js +6 -5
  200. package/dist/input-mask/mask-trackers.js +5 -4
  201. package/dist/input-select/InputSelect.js +68 -357
  202. package/dist/input-select/InputSelect.stories.js +25 -98
  203. package/dist/popover/popover.js +4 -72
  204. package/dist/progress/Progress.js +2 -96
  205. package/dist/progress/Progress.stories.js +14 -13
  206. package/dist/radio/Radio.js +4 -163
  207. package/dist/scroll-area/scroll-area.js +5 -113
  208. package/dist/search-input-select/SearchInputSelect.js +69 -346
  209. package/dist/select/Select.js +29 -315
  210. package/dist/select/Select.stories.js +19 -55
  211. package/dist/skeleton/Skeleton.js +3 -62
  212. package/dist/skeleton/Skeleton.stories.js +7 -8
  213. package/dist/slider/Slider.js +5 -106
  214. package/dist/slider/Slider.stories.js +11 -12
  215. package/dist/stack/Stack.js +3 -63
  216. package/dist/stack/Stack.stories.js +7 -19
  217. package/dist/styles.css +183 -12
  218. package/dist/table/Table.js +10 -131
  219. package/dist/table/Table.stories.js +8 -84
  220. package/dist/tabs/Tabs.js +9 -128
  221. package/dist/tabs/Tabs.stories.js +13 -46
  222. package/dist/text/Text.js +6 -88
  223. package/dist/text/Text.stories.js +7 -44
  224. package/dist/toast/Toast.stories.js +14 -66
  225. package/dist/toast/ToastBox.js +24 -71
  226. package/dist/toast/index.js +1 -0
  227. package/dist/toast/sonner.d.ts.map +1 -1
  228. package/dist/toast/sonner.js +6 -73
  229. package/dist/toast/sonner.js.map +1 -1
  230. package/dist/toggle/Toggle.js +7 -116
  231. package/dist/toggle/Toggle.stories.js +8 -10
  232. package/dist/tooltip/Tooltip.js +12 -151
  233. package/dist/tooltip/Tooltip.stories.js +13 -71
  234. package/dist/vstack/VStack.js +3 -63
  235. package/dist/vstack/VStack.stories.js +7 -19
  236. package/package.json +1 -1
@@ -1,187 +1,30 @@
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
- }
81
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
82
3
  import { Command as CommandPrimitive } from 'cmdk';
83
4
  import * as React from 'react';
84
5
  import { Dialog, DialogContent } from '../dialog/index';
85
6
  import IconSearch from '../icons/IconSearch';
86
7
  import { cn } from '../utils';
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
- });
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 })));
96
9
  Command.displayName = CommandPrimitive.displayName;
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
- }));
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 }) }) }));
110
12
  };
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
- });
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 })] })));
130
14
  CommandInput.displayName = CommandPrimitive.Input.displayName;
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
- });
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 })));
140
16
  CommandList.displayName = CommandPrimitive.List.displayName;
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
- });
17
+ const CommandEmpty = React.forwardRef((props, ref) => (_jsx(CommandPrimitive.Empty, { ref: ref, className: "py-6 text-center text-sm", ...props })));
147
18
  CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
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
- });
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 })));
157
20
  CommandGroup.displayName = CommandPrimitive.Group.displayName;
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
- });
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 })));
167
22
  CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
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
- });
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 })));
177
24
  CommandItem.displayName = CommandPrimitive.Item.displayName;
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));
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 }));
185
27
  };
186
28
  CommandShortcut.displayName = 'CommandShortcut';
187
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
29
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
30
+ //# sourceMappingURL=command.js.map
@@ -1,100 +1,20 @@
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
- }
76
2
  import { jsx as _jsx } from "react/jsx-runtime";
77
3
  import { useState } from 'react';
78
4
  import { useIsMobile } from '../hooks/use-media-query';
79
5
  import DatePickerDrawer from './DatePickerDrawer';
80
6
  import DatePickerPopover from './DatePickerPopover';
81
7
  import { formatInputBy } from './utils';
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) {
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) => {
89
15
  if (isRange && Array.isArray(value) && value && value[0] && value[1]) {
90
- setInnerValue([
91
- value[0],
92
- value[1]
93
- ]);
94
- setInputValue(formatInputBy([
95
- value[0],
96
- value[1]
97
- ], isRange));
16
+ setInnerValue([value[0], value[1]]);
17
+ setInputValue(formatInputBy([value[0], value[1]], isRange));
98
18
  return;
99
19
  }
100
20
  if (!isRange && !Array.isArray(value) && value) {
@@ -103,62 +23,42 @@ var DatePicker = function(props) {
103
23
  return;
104
24
  }
105
25
  };
106
- var handleCancel = function() {
26
+ const handleCancel = () => {
107
27
  setFocused(false);
108
28
  setInnerValue(value);
109
29
  setInputValue(formatInputBy(value, isRange));
110
30
  };
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
- ]);
31
+ const handleApply = () => {
32
+ if (isRange &&
33
+ Array.isArray(innerValue) &&
34
+ innerValue &&
35
+ innerValue[0] &&
36
+ innerValue[1]) {
37
+ onChange?.([innerValue[0], innerValue[1]]);
117
38
  setFocused(false);
118
39
  return;
119
40
  }
120
41
  if (!isRange && !Array.isArray(innerValue) && innerValue) {
121
- onChange === null || onChange === void 0 ? void 0 : onChange(innerValue);
42
+ onChange?.(innerValue);
122
43
  setFocused(false);
123
44
  return;
124
45
  }
125
46
  };
126
- var weekendTiles = function(args) {
47
+ const weekendTiles = (args) => {
127
48
  if (args.view === 'month') {
128
- var day = args.date.getDay();
49
+ const day = args.date.getDay();
129
50
  return day === 0 || day === 6;
130
51
  }
131
52
  return false;
132
53
  };
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;
54
+ const combinedTileDisabled = (args) => {
55
+ if (disableWeekends && weekendTiles(args))
56
+ return true;
57
+ if (tileDisabled?.(args))
58
+ return true;
136
59
  return false;
137
60
  };
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));
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 }));
163
62
  };
164
63
  export default DatePicker;
64
+ //# sourceMappingURL=DatePicker.js.map
@@ -1,184 +1,79 @@
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
- }
47
1
  import { jsx as _jsx } from "react/jsx-runtime";
48
2
  import { useState } from 'react';
49
3
  import DatePicker from './DatePicker.js';
50
- var meta = {
4
+ const meta = {
51
5
  component: DatePicker,
52
6
  argTypes: {
53
7
  locale: {
54
- options: [
55
- 'en',
56
- 'ms',
57
- 'zh',
58
- 'ar'
59
- ],
60
- control: {
61
- type: 'select'
62
- }
8
+ options: ['en', 'ms', 'zh', 'ar'],
9
+ control: { type: 'select' },
63
10
  },
64
11
  calendarType: {
65
- options: [
66
- 'iso8601',
67
- 'gregory',
68
- 'islamic',
69
- 'hebrew'
70
- ],
71
- control: {
72
- type: 'select'
73
- }
74
- }
75
- }
12
+ options: ['iso8601', 'gregory', 'islamic', 'hebrew'],
13
+ control: { type: 'select' },
14
+ },
15
+ },
76
16
  };
77
17
  export default meta;
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
- }
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
+ },
87
23
  };
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
- }
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
+ },
98
29
  };
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) {
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) => {
108
35
  setDates(dates);
109
36
  setError('');
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
- }
37
+ }, onError: (type) => type === 'start-gte-end' &&
38
+ setError('Start Date must be earlier than End Date'), inputProps: {
39
+ error: error,
40
+ } }));
41
+ },
119
42
  };
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
- }
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
+ },
130
48
  };
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
- }
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
+ },
141
54
  };
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
- }
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
+ },
152
60
  };
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
- }
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
+ },
163
66
  };
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
- }
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
+ },
174
72
  };
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
- }
73
+ export const NoDate = {
74
+ render: () => {
75
+ const [date, setDate] = useState();
76
+ return (_jsx(DatePicker, { htmlFor: "no-date-calendar", value: date, onChange: setDate }));
77
+ },
184
78
  };
79
+ //# sourceMappingURL=DatePicker.stories.js.map