@driveflux/beam 3.0.18 → 3.0.19

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 +7 -203
  2. package/dist/accordion/Accordion.stories.js +11 -31
  3. package/dist/alert/Alert.js +19 -193
  4. package/dist/alert/Alert.stories.js +15 -50
  5. package/dist/animations/LoadingAnimation.js +21 -34
  6. package/dist/badge/Badge.js +7 -105
  7. package/dist/badge/Badge.stories.js +7 -28
  8. package/dist/box/Box.js +3 -151
  9. package/dist/box/Box.stories.js +7 -8
  10. package/dist/breadcrumbs/Breadcrumbs.js +26 -351
  11. package/dist/breadcrumbs/Breadcrumbs.stories.js +27 -51
  12. package/dist/button/Button.js +12 -190
  13. package/dist/button/Button.stories.js +7 -35
  14. package/dist/button/TextButton.js +9 -168
  15. package/dist/card/Card.js +7 -188
  16. package/dist/card/Card.stories.js +7 -10
  17. package/dist/carousel/Carousel.js +58 -308
  18. package/dist/carousel/Carousel.stories.js +7 -39
  19. package/dist/carousel/CarouselButton.js +7 -132
  20. package/dist/center/Center.js +3 -127
  21. package/dist/center/Center.stories.js +7 -19
  22. package/dist/checkbox/Checkbox.js +4 -188
  23. package/dist/checkbox/Checkbox.stories.js +8 -10
  24. package/dist/chip/Chip.js +3 -168
  25. package/dist/chip/Chip.stories.js +7 -19
  26. package/dist/circular-progress/CircularProgress.js +11 -159
  27. package/dist/circular-progress/CircularProgress.stories.js +14 -54
  28. package/dist/command/command.js +13 -249
  29. package/dist/datepicker/DatePicker.js +90 -245
  30. package/dist/datepicker/DatePicker.stories.js +58 -162
  31. package/dist/datepicker/DatePickerDrawer.js +17 -115
  32. package/dist/datepicker/DatePickerPopover.js +35 -208
  33. package/dist/datepicker/constants.js +4 -3
  34. package/dist/datepicker/utils.js +11 -4
  35. package/dist/dialog/index.js +12 -253
  36. package/dist/divider/Divider.js +3 -127
  37. package/dist/divider/Divider.stories.js +7 -13
  38. package/dist/drawer/index.js +12 -230
  39. package/dist/dropdown/Dropdown.js +26 -297
  40. package/dist/dropdown/Dropdown.stories.js +22 -109
  41. package/dist/field-wrapper/FieldWrapper.js +3 -203
  42. package/dist/field-wrapper/FieldWrapper.stories.js +28 -124
  43. package/dist/flex/Flex.js +3 -127
  44. package/dist/flex/Flex.stories.js +7 -19
  45. package/dist/grid/Grid.js +3 -127
  46. package/dist/grid/Grid.stories.js +7 -28
  47. package/dist/hooks/use-breakpoint-value.js +14 -77
  48. package/dist/hooks/use-media-query.js +12 -61
  49. package/dist/hstack/HStack.js +3 -127
  50. package/dist/hstack/HStack.stories.js +7 -19
  51. package/dist/icons/FluxLogo.js +9 -222
  52. package/dist/icons/FluxLogoTable.js +5 -118
  53. package/dist/icons/Icon.js +7 -117
  54. package/dist/icons/Icon.stories.js +7 -12
  55. package/dist/icons/Icon24Hours.js +5 -92
  56. package/dist/icons/IconAcceleration.js +4 -81
  57. package/dist/icons/IconAccount.js +4 -81
  58. package/dist/icons/IconApplicant.js +5 -87
  59. package/dist/icons/IconArrow.js +6 -87
  60. package/dist/icons/IconArrowBack.js +4 -81
  61. package/dist/icons/IconArrowForward.js +4 -81
  62. package/dist/icons/IconArrowTopLeft.js +4 -79
  63. package/dist/icons/IconBluesharkProductGuide.js +5 -89
  64. package/dist/icons/IconBolt.js +4 -81
  65. package/dist/icons/IconBriefcase.js +4 -81
  66. package/dist/icons/IconBulb.js +4 -81
  67. package/dist/icons/IconCalendar.js +4 -81
  68. package/dist/icons/IconCalendarArrowBack.js +4 -81
  69. package/dist/icons/IconCalendarArrowForward.js +4 -81
  70. package/dist/icons/IconCalendarDoubleArrowBack.js +4 -81
  71. package/dist/icons/IconCalendarDoubleArrowForward.js +4 -81
  72. package/dist/icons/IconCancel.js +5 -86
  73. package/dist/icons/IconCancelMark.js +4 -81
  74. package/dist/icons/IconCarSUV.js +4 -81
  75. package/dist/icons/IconCarSedan.js +7 -156
  76. package/dist/icons/IconChain.js +5 -88
  77. package/dist/icons/IconCheckmark.js +4 -81
  78. package/dist/icons/IconChevronRight.js +4 -81
  79. package/dist/icons/IconCircle.js +11 -123
  80. package/dist/icons/IconCircleCheckmark.js +5 -86
  81. package/dist/icons/IconCircleError.js +4 -81
  82. package/dist/icons/IconCircleExclamation.js +6 -113
  83. package/dist/icons/IconCircleMark.js +5 -87
  84. package/dist/icons/IconCircleOutline.js +5 -148
  85. package/dist/icons/IconClock.js +5 -89
  86. package/dist/icons/IconClose.js +4 -81
  87. package/dist/icons/IconCollapseAll.js +5 -103
  88. package/dist/icons/IconConcierge.js +5 -88
  89. package/dist/icons/IconConciergeService.js +5 -96
  90. package/dist/icons/IconCreditCard.js +5 -87
  91. package/dist/icons/IconDash.js +4 -81
  92. package/dist/icons/IconDeliver.js +4 -81
  93. package/dist/icons/IconDelivery.js +5 -96
  94. package/dist/icons/IconDetails.js +4 -81
  95. package/dist/icons/IconDot.js +6 -96
  96. package/dist/icons/IconDownload.js +5 -88
  97. package/dist/icons/IconEVCharging.js +5 -88
  98. package/dist/icons/IconElectricCarFuel.js +5 -89
  99. package/dist/icons/IconEllipsis.js +5 -87
  100. package/dist/icons/IconEnvelope.js +4 -81
  101. package/dist/icons/IconExpandAll.js +5 -103
  102. package/dist/icons/IconEye.js +5 -88
  103. package/dist/icons/IconFacebook.js +6 -103
  104. package/dist/icons/IconFilter.js +5 -92
  105. package/dist/icons/IconFlagMalaysia.js +5 -150
  106. package/dist/icons/IconGiveKey.js +5 -88
  107. package/dist/icons/IconGlobe.js +4 -79
  108. package/dist/icons/IconGoogle.js +5 -96
  109. package/dist/icons/IconHome.js +5 -87
  110. package/dist/icons/IconHostAdvertise.js +4 -81
  111. package/dist/icons/IconHostCar.js +4 -84
  112. package/dist/icons/IconHostCash.js +5 -100
  113. package/dist/icons/IconHostHandle.js +4 -79
  114. package/dist/icons/IconHostLocation.js +4 -79
  115. package/dist/icons/IconHostPayment.js +5 -100
  116. package/dist/icons/IconHostService.js +5 -88
  117. package/dist/icons/IconHotDeals.js +4 -81
  118. package/dist/icons/IconInfo.js +5 -86
  119. package/dist/icons/IconInstagram.js +4 -81
  120. package/dist/icons/IconInsurance.js +5 -108
  121. package/dist/icons/IconInternet.js +4 -82
  122. package/dist/icons/IconInventory.js +5 -87
  123. package/dist/icons/IconLaurel.js +5 -110
  124. package/dist/icons/IconLinkedIn.js +4 -81
  125. package/dist/icons/IconLoading.js +4 -87
  126. package/dist/icons/IconLocation.js +5 -89
  127. package/dist/icons/IconLock.js +4 -82
  128. package/dist/icons/IconLogistics.js +4 -81
  129. package/dist/icons/IconMail.js +5 -103
  130. package/dist/icons/IconMember.js +5 -87
  131. package/dist/icons/IconMobilePen.js +5 -92
  132. package/dist/icons/IconMotorcycleMoped.js +5 -87
  133. package/dist/icons/IconNoCost.js +5 -101
  134. package/dist/icons/IconPDF.js +5 -89
  135. package/dist/icons/IconPencil.js +4 -79
  136. package/dist/icons/IconPhone.js +4 -79
  137. package/dist/icons/IconPlus.js +4 -81
  138. package/dist/icons/IconPricing.js +4 -81
  139. package/dist/icons/IconProtected.js +4 -80
  140. package/dist/icons/IconPsychology.js +4 -81
  141. package/dist/icons/IconQuestionTooltip.js +4 -137
  142. package/dist/icons/IconQuote.js +4 -81
  143. package/dist/icons/IconRate.js +4 -80
  144. package/dist/icons/IconRegister.js +5 -108
  145. package/dist/icons/IconReport.js +6 -98
  146. package/dist/icons/IconReturn.js +4 -81
  147. package/dist/icons/IconSearch.js +4 -79
  148. package/dist/icons/IconSecure.js +4 -80
  149. package/dist/icons/IconSecurity.js +4 -82
  150. package/dist/icons/IconSedanOutline.js +5 -168
  151. package/dist/icons/IconSelectArrow.js +6 -87
  152. package/dist/icons/IconSort.js +5 -88
  153. package/dist/icons/IconSortListed.js +5 -104
  154. package/dist/icons/IconSortPriceAscending.js +5 -92
  155. package/dist/icons/IconSortPriceDescending.js +5 -92
  156. package/dist/icons/IconSortYear.js +5 -88
  157. package/dist/icons/IconSpan.js +4 -80
  158. package/dist/icons/IconSpeaker.js +4 -88
  159. package/dist/icons/IconSpecialCar.js +5 -104
  160. package/dist/icons/IconStar.js +7 -101
  161. package/dist/icons/IconStockPhoto.js +5 -104
  162. package/dist/icons/IconSubscription.js +6 -122
  163. package/dist/icons/IconSubscriptions.js +6 -122
  164. package/dist/icons/IconSwap.js +5 -88
  165. package/dist/icons/IconTax.js +4 -81
  166. package/dist/icons/IconThinArrow.js +6 -87
  167. package/dist/icons/IconThumbsdown.js +5 -87
  168. package/dist/icons/IconThumbsup.js +5 -87
  169. package/dist/icons/IconTool.js +4 -81
  170. package/dist/icons/IconTooltip.js +4 -137
  171. package/dist/icons/IconTrash.js +4 -81
  172. package/dist/icons/IconTriangleExclamation.js +4 -81
  173. package/dist/icons/IconTyersBrakes.js +5 -92
  174. package/dist/icons/IconTyre.js +5 -92
  175. package/dist/icons/IconVacancy.js +5 -87
  176. package/dist/icons/IconVolunteer.js +4 -81
  177. package/dist/icons/IconWhatsapp.js +4 -82
  178. package/dist/icons/IconXPlatform.js +4 -81
  179. package/dist/icons/IconZeroEffort.js +5 -86
  180. package/dist/icons/Logo.js +3 -108
  181. package/dist/input/Input.js +11 -134
  182. package/dist/input/Input.stories.js +18 -17
  183. package/dist/input-mask/InputMask.js +11 -158
  184. package/dist/input-mask/InputMask.stories.js +6 -5
  185. package/dist/input-mask/mask-trackers.js +5 -4
  186. package/dist/input-select/InputSelect.js +68 -390
  187. package/dist/input-select/InputSelect.stories.js +25 -98
  188. package/dist/popover/popover.js +4 -136
  189. package/dist/progress/Progress.js +2 -160
  190. package/dist/progress/Progress.stories.js +14 -13
  191. package/dist/radio/Radio.js +4 -227
  192. package/dist/scroll-area/scroll-area.js +5 -180
  193. package/dist/search-input-select/SearchInputSelect.js +69 -379
  194. package/dist/select/Select.js +29 -354
  195. package/dist/select/Select.stories.js +19 -55
  196. package/dist/skeleton/Skeleton.js +3 -71
  197. package/dist/skeleton/Skeleton.stories.js +7 -8
  198. package/dist/slider/Slider.js +5 -170
  199. package/dist/slider/Slider.stories.js +11 -12
  200. package/dist/stack/Stack.js +3 -127
  201. package/dist/stack/Stack.stories.js +7 -19
  202. package/dist/table/Table.js +10 -216
  203. package/dist/table/Table.stories.js +8 -84
  204. package/dist/tabs/Tabs.js +9 -198
  205. package/dist/tabs/Tabs.stories.js +13 -46
  206. package/dist/text/Text.js +6 -152
  207. package/dist/text/Text.stories.js +7 -44
  208. package/dist/toast/Toast.stories.js +14 -66
  209. package/dist/toast/ToastBox.js +29 -77
  210. package/dist/toast/index.js +1 -0
  211. package/dist/toast/sonner.js +6 -66
  212. package/dist/toggle/Toggle.js +7 -180
  213. package/dist/toggle/Toggle.stories.js +8 -10
  214. package/dist/tooltip/Tooltip.js +12 -169
  215. package/dist/tooltip/Tooltip.stories.js +13 -71
  216. package/dist/utils.js +2 -4
  217. package/dist/vstack/VStack.js +3 -127
  218. package/dist/vstack/VStack.stories.js +7 -19
  219. package/package.json +16 -16
@@ -1,144 +1,4 @@
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
- }
142
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
143
3
  import * as SelectPrimitive from '@radix-ui/react-select';
144
4
  import * as React from 'react';
@@ -148,231 +8,46 @@ import FieldWrapper from '../field-wrapper/FieldWrapper';
148
8
  import HStack from '../hstack/HStack';
149
9
  import IconSelectArrow from '../icons/IconSelectArrow';
150
10
  import { cn } from '../utils';
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
- });
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 })));
169
13
  SelectValue.displayName = SelectPrimitive.Value.displayName;
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
- });
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, {}) })] })));
194
15
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
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
- });
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' }) })));
211
17
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
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
- });
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, {})] }) })));
255
24
  SelectContent.displayName = SelectPrimitive.Content.displayName;
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
- });
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 })));
268
26
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
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
- });
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 }) })));
286
28
  SelectItem.displayName = SelectPrimitive.Item.displayName;
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
- });
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 })));
299
30
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
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;
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;
324
40
  setValue(parsedValue);
325
- onChange === null || onChange === void 0 ? void 0 : onChange(parsedValue);
41
+ onChange?.(parsedValue);
326
42
  };
327
- React.useEffect(function() {
43
+ React.useEffect(() => {
328
44
  setValue(providedValue);
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) {
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) => {
345
47
  if (open) {
346
- onTriggerClick === null || onTriggerClick === void 0 ? void 0 : onTriggerClick();
48
+ onTriggerClick?.();
347
49
  }
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
- }));
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' })) })] }) }));
377
51
  });
378
52
  export default Select;
53
+ //# sourceMappingURL=Select.js.map
@@ -1,76 +1,40 @@
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
- }
26
1
  import { jsx as _jsx } from "react/jsx-runtime";
27
2
  import IconAccount from '../icons/IconAccount.js';
28
3
  import Select from './Select.js';
29
- var meta = {
30
- component: Select
4
+ const meta = {
5
+ component: Select,
31
6
  };
32
7
  export default meta;
33
- export var Demo = {
8
+ export const Demo = {
34
9
  args: {
35
10
  htmlFor: 'fruits',
36
11
  label: 'fruits',
37
12
  placeholder: 'Select Fruits',
38
13
  options: [
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
- }
14
+ { label: 'Apple', value: 'apple' },
15
+ { label: 'Banana', value: 'banana' },
16
+ { label: 'Citrus', value: 'citrus', isDisabled: true },
17
+ ],
18
+ },
54
19
  };
55
- export var Long = {
20
+ export const Long = {
56
21
  args: {
57
22
  htmlFor: 'year',
58
23
  label: 'favourite year',
59
24
  placeholder: 'Select Your Favourite Year',
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
- }
25
+ prefix: _jsx(IconAccount, {}),
26
+ options: [...Array(20)].map((_, i) => ({
27
+ label: `${2000 + i}`,
28
+ value: 2000 + i,
29
+ })),
30
+ },
68
31
  };
69
- export var Empty = {
32
+ export const Empty = {
70
33
  args: {
71
34
  htmlFor: 'fruits',
72
35
  label: 'fruits',
73
36
  placeholder: 'Select Fruits',
74
- options: []
75
- }
37
+ options: [],
38
+ },
76
39
  };
40
+ //# sourceMappingURL=Select.stories.js.map
@@ -1,75 +1,7 @@
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
- }
65
1
  import { jsx as _jsx } from "react/jsx-runtime";
66
2
  import { cn } from '../utils';
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));
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 }));
74
5
  }
75
6
  export default Skeleton;
7
+ //# sourceMappingURL=Skeleton.js.map
@@ -1,13 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Skeleton from './Skeleton.js';
3
- var meta = {
4
- component: Skeleton
3
+ const meta = {
4
+ component: Skeleton,
5
5
  };
6
6
  export default meta;
7
- export var FirstStory = {
8
- render: function render() {
9
- return /*#__PURE__*/ _jsx(Skeleton, {
10
- className: "h-64 w-64"
11
- });
12
- }
7
+ export const FirstStory = {
8
+ render: () => {
9
+ return _jsx(Skeleton, { className: "h-64 w-64" });
10
+ },
13
11
  };
12
+ //# sourceMappingURL=Skeleton.stories.js.map