@driveflux/beam 3.0.19 → 3.0.20

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 (219) hide show
  1. package/dist/accordion/Accordion.js +203 -7
  2. package/dist/accordion/Accordion.stories.js +31 -11
  3. package/dist/alert/Alert.js +193 -19
  4. package/dist/alert/Alert.stories.js +50 -15
  5. package/dist/animations/LoadingAnimation.js +34 -21
  6. package/dist/badge/Badge.js +105 -7
  7. package/dist/badge/Badge.stories.js +28 -7
  8. package/dist/box/Box.js +151 -3
  9. package/dist/box/Box.stories.js +8 -7
  10. package/dist/breadcrumbs/Breadcrumbs.js +351 -26
  11. package/dist/breadcrumbs/Breadcrumbs.stories.js +51 -27
  12. package/dist/button/Button.js +190 -12
  13. package/dist/button/Button.stories.js +35 -7
  14. package/dist/button/TextButton.js +168 -9
  15. package/dist/card/Card.js +188 -7
  16. package/dist/card/Card.stories.js +10 -7
  17. package/dist/carousel/Carousel.js +308 -58
  18. package/dist/carousel/Carousel.stories.js +39 -7
  19. package/dist/carousel/CarouselButton.js +132 -7
  20. package/dist/center/Center.js +127 -3
  21. package/dist/center/Center.stories.js +19 -7
  22. package/dist/checkbox/Checkbox.js +188 -4
  23. package/dist/checkbox/Checkbox.stories.js +10 -8
  24. package/dist/chip/Chip.js +168 -3
  25. package/dist/chip/Chip.stories.js +19 -7
  26. package/dist/circular-progress/CircularProgress.js +159 -11
  27. package/dist/circular-progress/CircularProgress.stories.js +54 -14
  28. package/dist/command/command.js +249 -13
  29. package/dist/datepicker/DatePicker.js +245 -90
  30. package/dist/datepicker/DatePicker.stories.js +162 -58
  31. package/dist/datepicker/DatePickerDrawer.js +115 -17
  32. package/dist/datepicker/DatePickerPopover.js +208 -35
  33. package/dist/datepicker/constants.js +3 -4
  34. package/dist/datepicker/utils.js +4 -11
  35. package/dist/dialog/index.js +253 -12
  36. package/dist/divider/Divider.js +127 -3
  37. package/dist/divider/Divider.stories.js +13 -7
  38. package/dist/drawer/index.js +230 -12
  39. package/dist/dropdown/Dropdown.js +297 -26
  40. package/dist/dropdown/Dropdown.stories.js +109 -22
  41. package/dist/field-wrapper/FieldWrapper.js +203 -3
  42. package/dist/field-wrapper/FieldWrapper.stories.js +124 -28
  43. package/dist/flex/Flex.js +127 -3
  44. package/dist/flex/Flex.stories.js +19 -7
  45. package/dist/grid/Grid.js +127 -3
  46. package/dist/grid/Grid.stories.js +28 -7
  47. package/dist/hooks/use-breakpoint-value.js +77 -14
  48. package/dist/hooks/use-media-query.js +61 -12
  49. package/dist/hstack/HStack.js +127 -3
  50. package/dist/hstack/HStack.stories.js +19 -7
  51. package/dist/icons/FluxLogo.js +222 -9
  52. package/dist/icons/FluxLogoTable.js +118 -5
  53. package/dist/icons/Icon.js +117 -7
  54. package/dist/icons/Icon.stories.js +12 -7
  55. package/dist/icons/Icon24Hours.js +92 -5
  56. package/dist/icons/IconAcceleration.js +81 -4
  57. package/dist/icons/IconAccount.js +81 -4
  58. package/dist/icons/IconApplicant.js +87 -5
  59. package/dist/icons/IconArrow.js +87 -6
  60. package/dist/icons/IconArrowBack.js +81 -4
  61. package/dist/icons/IconArrowForward.js +81 -4
  62. package/dist/icons/IconArrowTopLeft.js +79 -4
  63. package/dist/icons/IconBluesharkProductGuide.js +89 -5
  64. package/dist/icons/IconBolt.js +81 -4
  65. package/dist/icons/IconBriefcase.js +81 -4
  66. package/dist/icons/IconBulb.js +81 -4
  67. package/dist/icons/IconCalendar.js +81 -4
  68. package/dist/icons/IconCalendarArrowBack.js +81 -4
  69. package/dist/icons/IconCalendarArrowForward.js +81 -4
  70. package/dist/icons/IconCalendarDoubleArrowBack.js +81 -4
  71. package/dist/icons/IconCalendarDoubleArrowForward.js +81 -4
  72. package/dist/icons/IconCancel.js +86 -5
  73. package/dist/icons/IconCancelMark.js +81 -4
  74. package/dist/icons/IconCarSUV.js +81 -4
  75. package/dist/icons/IconCarSedan.js +156 -7
  76. package/dist/icons/IconChain.js +88 -5
  77. package/dist/icons/IconCheckmark.js +81 -4
  78. package/dist/icons/IconChevronRight.js +81 -4
  79. package/dist/icons/IconCircle.js +123 -11
  80. package/dist/icons/IconCircleCheckmark.js +86 -5
  81. package/dist/icons/IconCircleError.js +81 -4
  82. package/dist/icons/IconCircleExclamation.js +113 -6
  83. package/dist/icons/IconCircleMark.js +87 -5
  84. package/dist/icons/IconCircleOutline.js +148 -5
  85. package/dist/icons/IconClock.js +89 -5
  86. package/dist/icons/IconClose.js +81 -4
  87. package/dist/icons/IconCollapseAll.js +103 -5
  88. package/dist/icons/IconConcierge.js +88 -5
  89. package/dist/icons/IconConciergeService.js +96 -5
  90. package/dist/icons/IconCreditCard.js +87 -5
  91. package/dist/icons/IconDash.js +81 -4
  92. package/dist/icons/IconDeliver.js +81 -4
  93. package/dist/icons/IconDelivery.js +96 -5
  94. package/dist/icons/IconDetails.js +81 -4
  95. package/dist/icons/IconDot.js +96 -6
  96. package/dist/icons/IconDownload.js +88 -5
  97. package/dist/icons/IconEVCharging.js +88 -5
  98. package/dist/icons/IconElectricCarFuel.js +89 -5
  99. package/dist/icons/IconEllipsis.js +87 -5
  100. package/dist/icons/IconEnvelope.js +81 -4
  101. package/dist/icons/IconExpandAll.js +103 -5
  102. package/dist/icons/IconEye.js +88 -5
  103. package/dist/icons/IconFacebook.js +103 -6
  104. package/dist/icons/IconFilter.js +92 -5
  105. package/dist/icons/IconFlagMalaysia.js +150 -5
  106. package/dist/icons/IconGiveKey.js +88 -5
  107. package/dist/icons/IconGlobe.js +79 -4
  108. package/dist/icons/IconGoogle.js +96 -5
  109. package/dist/icons/IconHome.js +87 -5
  110. package/dist/icons/IconHostAdvertise.js +81 -4
  111. package/dist/icons/IconHostCar.js +84 -4
  112. package/dist/icons/IconHostCash.js +100 -5
  113. package/dist/icons/IconHostHandle.js +79 -4
  114. package/dist/icons/IconHostLocation.js +79 -4
  115. package/dist/icons/IconHostPayment.js +100 -5
  116. package/dist/icons/IconHostService.js +88 -5
  117. package/dist/icons/IconHotDeals.js +81 -4
  118. package/dist/icons/IconInfo.js +86 -5
  119. package/dist/icons/IconInstagram.js +81 -4
  120. package/dist/icons/IconInsurance.js +108 -5
  121. package/dist/icons/IconInternet.js +82 -4
  122. package/dist/icons/IconInventory.js +87 -5
  123. package/dist/icons/IconLaurel.js +110 -5
  124. package/dist/icons/IconLinkedIn.js +81 -4
  125. package/dist/icons/IconLoading.js +87 -4
  126. package/dist/icons/IconLocation.js +89 -5
  127. package/dist/icons/IconLock.js +82 -4
  128. package/dist/icons/IconLogistics.js +81 -4
  129. package/dist/icons/IconMail.js +103 -5
  130. package/dist/icons/IconMember.js +87 -5
  131. package/dist/icons/IconMobilePen.js +92 -5
  132. package/dist/icons/IconMotorcycleMoped.js +87 -5
  133. package/dist/icons/IconNoCost.js +101 -5
  134. package/dist/icons/IconPDF.js +89 -5
  135. package/dist/icons/IconPencil.js +79 -4
  136. package/dist/icons/IconPhone.js +79 -4
  137. package/dist/icons/IconPlus.js +81 -4
  138. package/dist/icons/IconPricing.js +81 -4
  139. package/dist/icons/IconProtected.js +80 -4
  140. package/dist/icons/IconPsychology.js +81 -4
  141. package/dist/icons/IconQuestionTooltip.js +137 -4
  142. package/dist/icons/IconQuote.js +81 -4
  143. package/dist/icons/IconRate.js +80 -4
  144. package/dist/icons/IconRegister.js +108 -5
  145. package/dist/icons/IconReport.js +98 -6
  146. package/dist/icons/IconReturn.js +81 -4
  147. package/dist/icons/IconSearch.js +79 -4
  148. package/dist/icons/IconSecure.js +80 -4
  149. package/dist/icons/IconSecurity.js +82 -4
  150. package/dist/icons/IconSedanOutline.js +168 -5
  151. package/dist/icons/IconSelectArrow.js +87 -6
  152. package/dist/icons/IconSort.js +88 -5
  153. package/dist/icons/IconSortListed.js +104 -5
  154. package/dist/icons/IconSortPriceAscending.js +92 -5
  155. package/dist/icons/IconSortPriceDescending.js +92 -5
  156. package/dist/icons/IconSortYear.js +88 -5
  157. package/dist/icons/IconSpan.js +80 -4
  158. package/dist/icons/IconSpeaker.js +88 -4
  159. package/dist/icons/IconSpecialCar.js +104 -5
  160. package/dist/icons/IconStar.js +101 -7
  161. package/dist/icons/IconStockPhoto.js +104 -5
  162. package/dist/icons/IconSubscription.js +122 -6
  163. package/dist/icons/IconSubscriptions.js +122 -6
  164. package/dist/icons/IconSwap.js +88 -5
  165. package/dist/icons/IconTax.js +81 -4
  166. package/dist/icons/IconThinArrow.js +87 -6
  167. package/dist/icons/IconThumbsdown.js +87 -5
  168. package/dist/icons/IconThumbsup.js +87 -5
  169. package/dist/icons/IconTool.js +81 -4
  170. package/dist/icons/IconTooltip.js +137 -4
  171. package/dist/icons/IconTrash.js +81 -4
  172. package/dist/icons/IconTriangleExclamation.js +81 -4
  173. package/dist/icons/IconTyersBrakes.js +92 -5
  174. package/dist/icons/IconTyre.js +92 -5
  175. package/dist/icons/IconVacancy.js +87 -5
  176. package/dist/icons/IconVolunteer.js +81 -4
  177. package/dist/icons/IconWhatsapp.js +82 -4
  178. package/dist/icons/IconXPlatform.js +81 -4
  179. package/dist/icons/IconZeroEffort.js +86 -5
  180. package/dist/icons/Logo.js +108 -3
  181. package/dist/input/Input.js +134 -11
  182. package/dist/input/Input.stories.js +17 -18
  183. package/dist/input-mask/InputMask.js +158 -11
  184. package/dist/input-mask/InputMask.stories.js +5 -6
  185. package/dist/input-mask/mask-trackers.js +4 -5
  186. package/dist/input-select/InputSelect.js +390 -68
  187. package/dist/input-select/InputSelect.stories.js +98 -25
  188. package/dist/popover/popover.js +136 -4
  189. package/dist/progress/Progress.js +160 -2
  190. package/dist/progress/Progress.stories.js +13 -14
  191. package/dist/radio/Radio.js +227 -4
  192. package/dist/scroll-area/scroll-area.js +180 -5
  193. package/dist/search-input-select/SearchInputSelect.js +379 -69
  194. package/dist/select/Select.js +354 -29
  195. package/dist/select/Select.stories.js +55 -19
  196. package/dist/skeleton/Skeleton.js +71 -3
  197. package/dist/skeleton/Skeleton.stories.js +8 -7
  198. package/dist/slider/Slider.js +170 -5
  199. package/dist/slider/Slider.stories.js +12 -11
  200. package/dist/stack/Stack.js +127 -3
  201. package/dist/stack/Stack.stories.js +19 -7
  202. package/dist/table/Table.js +216 -10
  203. package/dist/table/Table.stories.js +84 -8
  204. package/dist/tabs/Tabs.js +198 -9
  205. package/dist/tabs/Tabs.stories.js +46 -13
  206. package/dist/text/Text.js +152 -6
  207. package/dist/text/Text.stories.js +44 -7
  208. package/dist/toast/Toast.stories.js +66 -14
  209. package/dist/toast/ToastBox.js +77 -29
  210. package/dist/toast/index.js +0 -1
  211. package/dist/toast/sonner.js +66 -6
  212. package/dist/toggle/Toggle.js +180 -7
  213. package/dist/toggle/Toggle.stories.js +10 -8
  214. package/dist/tooltip/Tooltip.js +169 -12
  215. package/dist/tooltip/Tooltip.stories.js +71 -13
  216. package/dist/utils.js +4 -2
  217. package/dist/vstack/VStack.js +127 -3
  218. package/dist/vstack/VStack.stories.js +19 -7
  219. package/package.json +11 -11
@@ -1,4 +1,144 @@
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(iter) {
24
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
25
+ }
26
+ function _iterable_to_array_limit(arr, i) {
27
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
28
+ if (_i == null) return;
29
+ var _arr = [];
30
+ var _n = true;
31
+ var _d = false;
32
+ var _s, _e;
33
+ try {
34
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
35
+ _arr.push(_s.value);
36
+ if (i && _arr.length === i) break;
37
+ }
38
+ } catch (err) {
39
+ _d = true;
40
+ _e = err;
41
+ } finally{
42
+ try {
43
+ if (!_n && _i["return"] != null) _i["return"]();
44
+ } finally{
45
+ if (_d) throw _e;
46
+ }
47
+ }
48
+ return _arr;
49
+ }
50
+ function _non_iterable_rest() {
51
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
52
+ }
53
+ function _object_spread(target) {
54
+ for(var i = 1; i < arguments.length; i++){
55
+ var source = arguments[i] != null ? arguments[i] : {};
56
+ var ownKeys = Object.keys(source);
57
+ if (typeof Object.getOwnPropertySymbols === "function") {
58
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
59
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
60
+ }));
61
+ }
62
+ ownKeys.forEach(function(key) {
63
+ _define_property(target, key, source[key]);
64
+ });
65
+ }
66
+ return target;
67
+ }
68
+ function ownKeys(object, enumerableOnly) {
69
+ var keys = Object.keys(object);
70
+ if (Object.getOwnPropertySymbols) {
71
+ var symbols = Object.getOwnPropertySymbols(object);
72
+ if (enumerableOnly) {
73
+ symbols = symbols.filter(function(sym) {
74
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
75
+ });
76
+ }
77
+ keys.push.apply(keys, symbols);
78
+ }
79
+ return keys;
80
+ }
81
+ function _object_spread_props(target, source) {
82
+ source = source != null ? source : {};
83
+ if (Object.getOwnPropertyDescriptors) {
84
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
85
+ } else {
86
+ ownKeys(Object(source)).forEach(function(key) {
87
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
88
+ });
89
+ }
90
+ return target;
91
+ }
92
+ function _object_without_properties(source, excluded) {
93
+ if (source == null) return {};
94
+ var target = {}, sourceKeys, key, i;
95
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
96
+ sourceKeys = Reflect.ownKeys(Object(source));
97
+ for(i = 0; i < sourceKeys.length; i++){
98
+ key = sourceKeys[i];
99
+ if (excluded.indexOf(key) >= 0) continue;
100
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
101
+ target[key] = source[key];
102
+ }
103
+ return target;
104
+ }
105
+ target = _object_without_properties_loose(source, excluded);
106
+ if (Object.getOwnPropertySymbols) {
107
+ sourceKeys = Object.getOwnPropertySymbols(source);
108
+ for(i = 0; i < sourceKeys.length; i++){
109
+ key = sourceKeys[i];
110
+ if (excluded.indexOf(key) >= 0) continue;
111
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
112
+ target[key] = source[key];
113
+ }
114
+ }
115
+ return target;
116
+ }
117
+ function _object_without_properties_loose(source, excluded) {
118
+ if (source == null) return {};
119
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
120
+ for(i = 0; i < sourceKeys.length; i++){
121
+ key = sourceKeys[i];
122
+ if (excluded.indexOf(key) >= 0) continue;
123
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
124
+ target[key] = source[key];
125
+ }
126
+ return target;
127
+ }
128
+ function _sliced_to_array(arr, i) {
129
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
130
+ }
131
+ function _to_array(arr) {
132
+ return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
133
+ }
134
+ function _unsupported_iterable_to_array(o, minLen) {
135
+ if (!o) return;
136
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
137
+ var n = Object.prototype.toString.call(o).slice(8, -1);
138
+ if (n === "Object" && o.constructor) n = o.constructor.name;
139
+ if (n === "Map" || n === "Set") return Array.from(n);
140
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
141
+ }
2
142
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
143
  import * as SelectPrimitive from '@radix-ui/react-select';
4
144
  import * as React from 'react';
@@ -8,46 +148,231 @@ import FieldWrapper from '../field-wrapper/FieldWrapper';
8
148
  import HStack from '../hstack/HStack';
9
149
  import IconSelectArrow from '../icons/IconSelectArrow';
10
150
  import { cn } from '../utils';
11
- const SelectRoot = SelectPrimitive.Root;
12
- const SelectValue = React.forwardRef(({ placeholder, className, ...props }, ref) => (_jsx(SelectPrimitive.Value, { ref: ref, placeholder: placeholder ? (_jsx("span", { className: "text-primary2", children: placeholder })) : undefined, className: cn('text-primary3', className), ...props })));
151
+ var SelectRoot = SelectPrimitive.Root;
152
+ var SelectValue = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
153
+ var _ref = [
154
+ _0,
155
+ _1
156
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), placeholder = _ref2.placeholder, className = _ref2.className, props = _object_without_properties(_ref2, [
157
+ "placeholder",
158
+ "className"
159
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
160
+ return /*#__PURE__*/ _jsx(SelectPrimitive.Value, _object_spread({
161
+ ref: ref,
162
+ placeholder: placeholder ? /*#__PURE__*/ _jsx("span", {
163
+ className: "text-primary2",
164
+ children: placeholder
165
+ }) : undefined,
166
+ className: cn('text-primary3', className)
167
+ }, props));
168
+ });
13
169
  SelectValue.displayName = SelectPrimitive.Value.displayName;
14
- const SelectTrigger = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: cn('group flex h-10 w-full items-center gap-2 bg-black text-white px-3 py-2 text-sm ring-offset-white hover:border-black focus-within:border-black placeholder-primary2 focus:outline-hidden disabled:cursor-not-allowed [&>span]:line-clamp-1 dark:border-zinc-800 dark:bg-zinc-950 dark:ring-offset-zinc-950 dark:placeholder:text-zinc-400 dark:focus:ring-zinc-300 rounded-lg', className), ...props, children: [_jsx(Box, { className: "w-full", children: children }), _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(IconSelectArrow, {}) })] })));
170
+ var SelectTrigger = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
171
+ var _ref = [
172
+ _0,
173
+ _1
174
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, children = _ref2.children, props = _object_without_properties(_ref2, [
175
+ "className",
176
+ "children"
177
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
178
+ return /*#__PURE__*/ _jsxs(SelectPrimitive.Trigger, _object_spread_props(_object_spread({
179
+ ref: ref,
180
+ className: cn('group flex h-10 w-full items-center gap-2 bg-black text-white px-3 py-2 text-sm ring-offset-white hover:border-black focus-within:border-black placeholder-primary2 focus:outline-hidden disabled:cursor-not-allowed [&>span]:line-clamp-1 dark:border-zinc-800 dark:bg-zinc-950 dark:ring-offset-zinc-950 dark:placeholder:text-zinc-400 dark:focus:ring-zinc-300 rounded-lg', className)
181
+ }, props), {
182
+ children: [
183
+ /*#__PURE__*/ _jsx(Box, {
184
+ className: "w-full",
185
+ children: children
186
+ }),
187
+ /*#__PURE__*/ _jsx(SelectPrimitive.Icon, {
188
+ asChild: true,
189
+ children: /*#__PURE__*/ _jsx(IconSelectArrow, {})
190
+ })
191
+ ]
192
+ }));
193
+ });
15
194
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
16
- const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(IconSelectArrow, { variant: 'up' }) })));
195
+ var SelectScrollUpButton = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
196
+ var _ref = [
197
+ _0,
198
+ _1
199
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
200
+ "className"
201
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
202
+ return /*#__PURE__*/ _jsx(SelectPrimitive.ScrollUpButton, _object_spread_props(_object_spread({
203
+ ref: ref,
204
+ className: cn('flex cursor-default items-center justify-center py-1', className)
205
+ }, props), {
206
+ children: /*#__PURE__*/ _jsx(IconSelectArrow, {
207
+ variant: 'up'
208
+ })
209
+ }));
210
+ });
17
211
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
18
- const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(IconSelectArrow, { variant: 'down' }) })));
19
- SelectScrollDownButton.displayName =
20
- SelectPrimitive.ScrollDownButton.displayName;
21
- const SelectContent = React.forwardRef(({ className, children, position = 'popper', ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn('relative z-50 min-w-48 max-h-80 overflow-hidden border-zinc-200 bg-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50 rounded-lg', position === 'popper' &&
22
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn(position === 'popper' &&
23
- 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
212
+ var SelectScrollDownButton = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
213
+ var _ref = [
214
+ _0,
215
+ _1
216
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
217
+ "className"
218
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
219
+ return /*#__PURE__*/ _jsx(SelectPrimitive.ScrollDownButton, _object_spread_props(_object_spread({
220
+ ref: ref,
221
+ className: cn('flex cursor-default items-center justify-center py-1', className)
222
+ }, props), {
223
+ children: /*#__PURE__*/ _jsx(IconSelectArrow, {
224
+ variant: 'down'
225
+ })
226
+ }));
227
+ });
228
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
229
+ var SelectContent = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
230
+ var _ref = [
231
+ _0,
232
+ _1
233
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, children = _ref2.children, _ref_position = _ref2.position, position = _ref_position === void 0 ? 'popper' : _ref_position, props = _object_without_properties(_ref2, [
234
+ "className",
235
+ "children",
236
+ "position"
237
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
238
+ return /*#__PURE__*/ _jsx(SelectPrimitive.Portal, {
239
+ children: /*#__PURE__*/ _jsxs(SelectPrimitive.Content, _object_spread_props(_object_spread({
240
+ ref: ref,
241
+ className: cn('relative z-50 min-w-48 max-h-80 overflow-hidden border-zinc-200 bg-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50 rounded-lg', position === 'popper' && 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className),
242
+ position: position
243
+ }, props), {
244
+ children: [
245
+ /*#__PURE__*/ _jsx(SelectScrollUpButton, {}),
246
+ /*#__PURE__*/ _jsx(SelectPrimitive.Viewport, {
247
+ className: cn(position === 'popper' && 'h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)'),
248
+ children: children
249
+ }),
250
+ /*#__PURE__*/ _jsx(SelectScrollDownButton, {})
251
+ ]
252
+ }))
253
+ });
254
+ });
24
255
  SelectContent.displayName = SelectPrimitive.Content.displayName;
25
- const SelectLabel = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Label, { ref: ref, className: cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className), ...props })));
256
+ var SelectLabel = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
257
+ var _ref = [
258
+ _0,
259
+ _1
260
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
261
+ "className"
262
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
263
+ return /*#__PURE__*/ _jsx(SelectPrimitive.Label, _object_spread({
264
+ ref: ref,
265
+ className: cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)
266
+ }, props));
267
+ });
26
268
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
27
- const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(SelectPrimitive.Item, { ref: ref, className: cn('relative flex w-full cursor-pointer select-none items-center rounded-xs px-4 h-10 text-sm outline-hidden data-disabled:pointer-events-none focus:bg-primary1 data-disabled:bg-primary1 data-disabled:text-primary2 dark:focus:bg-zinc-800 dark:focus:text-zinc-50', className), ...props, children: _jsx(SelectPrimitive.ItemText, { children: children }) })));
269
+ var SelectItem = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
270
+ var _ref = [
271
+ _0,
272
+ _1
273
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, children = _ref2.children, props = _object_without_properties(_ref2, [
274
+ "className",
275
+ "children"
276
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
277
+ return /*#__PURE__*/ _jsx(SelectPrimitive.Item, _object_spread_props(_object_spread({
278
+ ref: ref,
279
+ className: cn('relative flex w-full cursor-pointer select-none items-center rounded-xs px-4 h-10 text-sm outline-hidden data-disabled:pointer-events-none focus:bg-primary1 data-disabled:bg-primary1 data-disabled:text-primary2 dark:focus:bg-zinc-800 dark:focus:text-zinc-50', className)
280
+ }, props), {
281
+ children: /*#__PURE__*/ _jsx(SelectPrimitive.ItemText, {
282
+ children: children
283
+ })
284
+ }));
285
+ });
28
286
  SelectItem.displayName = SelectPrimitive.Item.displayName;
29
- const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn('-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800', className), ...props })));
287
+ var SelectSeparator = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
288
+ var _ref = [
289
+ _0,
290
+ _1
291
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
292
+ "className"
293
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
294
+ return /*#__PURE__*/ _jsx(SelectPrimitive.Separator, _object_spread({
295
+ ref: ref,
296
+ className: cn('-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800', className)
297
+ }, props));
298
+ });
30
299
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
31
- const Select = React.forwardRef((props, _ref) => {
32
- const {
33
- // for wrapper
34
- wrapperProps, htmlFor, label, showRequired, showOptional, outerPrefix, outerSuffix, error,
35
- // for Select
36
- value: providedValue, placeholder, prefix, options, noOptionsText, className, onChange, onTriggerClick, ...selectProps } = props;
37
- const [value, setValue] = React.useState(providedValue);
38
- const handleValueChange = (value) => {
39
- const parsedValue = value ? JSON.parse(value) : undefined;
300
+ var Select = /*#__PURE__*/ React.forwardRef(function(props, _ref) {
301
+ var // for wrapper
302
+ wrapperProps = props.wrapperProps, htmlFor = props.htmlFor, label = props.label, showRequired = props.showRequired, showOptional = props.showOptional, outerPrefix = props.outerPrefix, outerSuffix = props.outerSuffix, error = props.error, // for Select
303
+ providedValue = props.value, placeholder = props.placeholder, prefix = props.prefix, options = props.options, noOptionsText = props.noOptionsText, className = props.className, onChange = props.onChange, onTriggerClick = props.onTriggerClick, selectProps = _object_without_properties(props, [
304
+ "wrapperProps",
305
+ "htmlFor",
306
+ "label",
307
+ "showRequired",
308
+ "showOptional",
309
+ "outerPrefix",
310
+ "outerSuffix",
311
+ "error",
312
+ "value",
313
+ "placeholder",
314
+ "prefix",
315
+ "options",
316
+ "noOptionsText",
317
+ "className",
318
+ "onChange",
319
+ "onTriggerClick"
320
+ ]);
321
+ var _React_useState = _sliced_to_array(React.useState(providedValue), 2), value = _React_useState[0], setValue = _React_useState[1];
322
+ var handleValueChange = function handleValueChange(value) {
323
+ var parsedValue = value ? JSON.parse(value) : undefined;
40
324
  setValue(parsedValue);
41
- onChange?.(parsedValue);
325
+ onChange === null || onChange === void 0 ? void 0 : onChange(parsedValue);
42
326
  };
43
- React.useEffect(() => {
327
+ React.useEffect(function() {
44
328
  setValue(providedValue);
45
- }, [providedValue]);
46
- return (_jsx(FieldWrapper, { htmlFor: htmlFor, label: label, showOptional: showOptional, showRequired: showRequired, outerPrefix: outerPrefix, outerSuffix: outerSuffix, error: error, ...wrapperProps, children: _jsxs(SelectRoot, { ...selectProps, value: JSON.stringify(value), onValueChange: handleValueChange, onOpenChange: (open) => {
329
+ }, [
330
+ providedValue
331
+ ]);
332
+ return /*#__PURE__*/ _jsx(FieldWrapper, _object_spread_props(_object_spread({
333
+ htmlFor: htmlFor,
334
+ label: label,
335
+ showOptional: showOptional,
336
+ showRequired: showRequired,
337
+ outerPrefix: outerPrefix,
338
+ outerSuffix: outerSuffix,
339
+ error: error
340
+ }, wrapperProps), {
341
+ children: /*#__PURE__*/ _jsxs(SelectRoot, _object_spread_props(_object_spread({}, selectProps), {
342
+ value: JSON.stringify(value),
343
+ onValueChange: handleValueChange,
344
+ onOpenChange: function onOpenChange(open) {
47
345
  if (open) {
48
- onTriggerClick?.();
346
+ onTriggerClick === null || onTriggerClick === void 0 ? void 0 : onTriggerClick();
49
347
  }
50
- }, children: [_jsx(SelectTrigger, { className: className, children: _jsxs(HStack, { className: "gap-2 w-full", children: [prefix, _jsx(SelectValue, { placeholder: placeholder })] }) }), _jsx(SelectContent, { children: options.length ? (options.map((option) => (_jsx(SelectItem, { value: JSON.stringify(option.value), disabled: option.isDisabled, children: option.label }, JSON.stringify(option.value))))) : (_jsx(Center, { className: "p-4 text-center text-sm text-primary3", children: noOptionsText || 'No Options' })) })] }) }));
348
+ },
349
+ children: [
350
+ /*#__PURE__*/ _jsx(SelectTrigger, {
351
+ className: className,
352
+ children: /*#__PURE__*/ _jsxs(HStack, {
353
+ className: "gap-2 w-full",
354
+ children: [
355
+ prefix,
356
+ /*#__PURE__*/ _jsx(SelectValue, {
357
+ placeholder: placeholder
358
+ })
359
+ ]
360
+ })
361
+ }),
362
+ /*#__PURE__*/ _jsx(SelectContent, {
363
+ children: options.length ? options.map(function(option) {
364
+ return /*#__PURE__*/ _jsx(SelectItem, {
365
+ value: JSON.stringify(option.value),
366
+ disabled: option.isDisabled,
367
+ children: option.label
368
+ }, JSON.stringify(option.value));
369
+ }) : /*#__PURE__*/ _jsx(Center, {
370
+ className: "p-4 text-center text-sm text-primary3",
371
+ children: noOptionsText || 'No Options'
372
+ })
373
+ })
374
+ ]
375
+ }))
376
+ }));
51
377
  });
52
378
  export default Select;
53
- //# sourceMappingURL=Select.js.map
@@ -1,40 +1,76 @@
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_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
+ }
9
+ function _iterable_to_array(iter) {
10
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
+ }
12
+ function _non_iterable_spread() {
13
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
+ }
15
+ function _to_consumable_array(arr) {
16
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
+ }
18
+ function _unsupported_iterable_to_array(o, minLen) {
19
+ if (!o) return;
20
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
21
+ var n = Object.prototype.toString.call(o).slice(8, -1);
22
+ if (n === "Object" && o.constructor) n = o.constructor.name;
23
+ if (n === "Map" || n === "Set") return Array.from(n);
24
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
+ }
1
26
  import { jsx as _jsx } from "react/jsx-runtime";
2
27
  import IconAccount from '../icons/IconAccount.js';
3
28
  import Select from './Select.js';
4
- const meta = {
5
- component: Select,
29
+ var meta = {
30
+ component: Select
6
31
  };
7
32
  export default meta;
8
- export const Demo = {
33
+ export var Demo = {
9
34
  args: {
10
35
  htmlFor: 'fruits',
11
36
  label: 'fruits',
12
37
  placeholder: 'Select Fruits',
13
38
  options: [
14
- { label: 'Apple', value: 'apple' },
15
- { label: 'Banana', value: 'banana' },
16
- { label: 'Citrus', value: 'citrus', isDisabled: true },
17
- ],
18
- },
39
+ {
40
+ label: 'Apple',
41
+ value: 'apple'
42
+ },
43
+ {
44
+ label: 'Banana',
45
+ value: 'banana'
46
+ },
47
+ {
48
+ label: 'Citrus',
49
+ value: 'citrus',
50
+ isDisabled: true
51
+ }
52
+ ]
53
+ }
19
54
  };
20
- export const Long = {
55
+ export var Long = {
21
56
  args: {
22
57
  htmlFor: 'year',
23
58
  label: 'favourite year',
24
59
  placeholder: 'Select Your Favourite Year',
25
- prefix: _jsx(IconAccount, {}),
26
- options: [...Array(20)].map((_, i) => ({
27
- label: `${2000 + i}`,
28
- value: 2000 + i,
29
- })),
30
- },
60
+ prefix: /*#__PURE__*/ _jsx(IconAccount, {}),
61
+ options: _to_consumable_array(Array(20)).map(function(_, i) {
62
+ return {
63
+ label: "".concat(2000 + i),
64
+ value: 2000 + i
65
+ };
66
+ })
67
+ }
31
68
  };
32
- export const Empty = {
69
+ export var Empty = {
33
70
  args: {
34
71
  htmlFor: 'fruits',
35
72
  label: 'fruits',
36
73
  placeholder: 'Select Fruits',
37
- options: [],
38
- },
74
+ options: []
75
+ }
39
76
  };
40
- //# sourceMappingURL=Select.stories.js.map
@@ -1,7 +1,75 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _object_spread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _define_property(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function _object_without_properties(source, excluded) {
30
+ if (source == null) return {};
31
+ var target = {}, sourceKeys, key, i;
32
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
33
+ sourceKeys = Reflect.ownKeys(Object(source));
34
+ for(i = 0; i < sourceKeys.length; i++){
35
+ key = sourceKeys[i];
36
+ if (excluded.indexOf(key) >= 0) continue;
37
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
38
+ target[key] = source[key];
39
+ }
40
+ return target;
41
+ }
42
+ target = _object_without_properties_loose(source, excluded);
43
+ if (Object.getOwnPropertySymbols) {
44
+ sourceKeys = Object.getOwnPropertySymbols(source);
45
+ for(i = 0; i < sourceKeys.length; i++){
46
+ key = sourceKeys[i];
47
+ if (excluded.indexOf(key) >= 0) continue;
48
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
49
+ target[key] = source[key];
50
+ }
51
+ }
52
+ return target;
53
+ }
54
+ function _object_without_properties_loose(source, excluded) {
55
+ if (source == null) return {};
56
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
57
+ for(i = 0; i < sourceKeys.length; i++){
58
+ key = sourceKeys[i];
59
+ if (excluded.indexOf(key) >= 0) continue;
60
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
61
+ target[key] = source[key];
62
+ }
63
+ return target;
64
+ }
1
65
  import { jsx as _jsx } from "react/jsx-runtime";
2
66
  import { cn } from '../utils';
3
- function Skeleton({ className, ...props }) {
4
- return (_jsx("div", { className: cn('animate-pulse bg-primary1 rounded-lg md:rounded-xl dark:bg-zinc-800', className), ...props }));
67
+ function Skeleton(_0) {
68
+ var className = _0.className, props = _object_without_properties(_0, [
69
+ "className"
70
+ ]);
71
+ return /*#__PURE__*/ _jsx("div", _object_spread({
72
+ className: cn('animate-pulse bg-primary1 rounded-lg md:rounded-xl dark:bg-zinc-800', className)
73
+ }, props));
5
74
  }
6
75
  export default Skeleton;
7
- //# sourceMappingURL=Skeleton.js.map
@@ -1,12 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Skeleton from './Skeleton.js';
3
- const meta = {
4
- component: Skeleton,
3
+ var meta = {
4
+ component: Skeleton
5
5
  };
6
6
  export default meta;
7
- export const FirstStory = {
8
- render: () => {
9
- return _jsx(Skeleton, { className: "h-64 w-64" });
10
- },
7
+ export var FirstStory = {
8
+ render: function render() {
9
+ return /*#__PURE__*/ _jsx(Skeleton, {
10
+ className: "h-64 w-64"
11
+ });
12
+ }
11
13
  };
12
- //# sourceMappingURL=Skeleton.stories.js.map