@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,42 +1,367 @@
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 _array_without_holes(arr) {
10
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
11
+ }
12
+ function _define_property(obj, key, value) {
13
+ if (key in obj) {
14
+ Object.defineProperty(obj, key, {
15
+ value: value,
16
+ enumerable: true,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ } else {
21
+ obj[key] = value;
22
+ }
23
+ return obj;
24
+ }
25
+ function _extends() {
26
+ _extends = Object.assign || function(target) {
27
+ for(var i = 1; i < arguments.length; i++){
28
+ var source = arguments[i];
29
+ for(var key in source){
30
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
31
+ target[key] = source[key];
32
+ }
33
+ }
34
+ }
35
+ return target;
36
+ };
37
+ return _extends.apply(this, arguments);
38
+ }
39
+ function _iterable_to_array(iter) {
40
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
41
+ }
42
+ function _iterable_to_array_limit(arr, i) {
43
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
44
+ if (_i == null) return;
45
+ var _arr = [];
46
+ var _n = true;
47
+ var _d = false;
48
+ var _s, _e;
49
+ try {
50
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
51
+ _arr.push(_s.value);
52
+ if (i && _arr.length === i) break;
53
+ }
54
+ } catch (err) {
55
+ _d = true;
56
+ _e = err;
57
+ } finally{
58
+ try {
59
+ if (!_n && _i["return"] != null) _i["return"]();
60
+ } finally{
61
+ if (_d) throw _e;
62
+ }
63
+ }
64
+ return _arr;
65
+ }
66
+ function _non_iterable_rest() {
67
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
68
+ }
69
+ function _non_iterable_spread() {
70
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
71
+ }
72
+ function _object_destructuring_empty(o) {
73
+ if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
74
+ return o;
75
+ }
76
+ function _object_spread(target) {
77
+ for(var i = 1; i < arguments.length; i++){
78
+ var source = arguments[i] != null ? arguments[i] : {};
79
+ var ownKeys = Object.keys(source);
80
+ if (typeof Object.getOwnPropertySymbols === "function") {
81
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
82
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
83
+ }));
84
+ }
85
+ ownKeys.forEach(function(key) {
86
+ _define_property(target, key, source[key]);
87
+ });
88
+ }
89
+ return target;
90
+ }
91
+ function ownKeys(object, enumerableOnly) {
92
+ var keys = Object.keys(object);
93
+ if (Object.getOwnPropertySymbols) {
94
+ var symbols = Object.getOwnPropertySymbols(object);
95
+ if (enumerableOnly) {
96
+ symbols = symbols.filter(function(sym) {
97
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
98
+ });
99
+ }
100
+ keys.push.apply(keys, symbols);
101
+ }
102
+ return keys;
103
+ }
104
+ function _object_spread_props(target, source) {
105
+ source = source != null ? source : {};
106
+ if (Object.getOwnPropertyDescriptors) {
107
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
108
+ } else {
109
+ ownKeys(Object(source)).forEach(function(key) {
110
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
111
+ });
112
+ }
113
+ return target;
114
+ }
115
+ function _object_without_properties(source, excluded) {
116
+ if (source == null) return {};
117
+ var target = {}, sourceKeys, key, i;
118
+ if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
119
+ sourceKeys = Reflect.ownKeys(Object(source));
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
+ target = _object_without_properties_loose(source, excluded);
129
+ if (Object.getOwnPropertySymbols) {
130
+ sourceKeys = Object.getOwnPropertySymbols(source);
131
+ for(i = 0; i < sourceKeys.length; i++){
132
+ key = sourceKeys[i];
133
+ if (excluded.indexOf(key) >= 0) continue;
134
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
135
+ target[key] = source[key];
136
+ }
137
+ }
138
+ return target;
139
+ }
140
+ function _object_without_properties_loose(source, excluded) {
141
+ if (source == null) return {};
142
+ var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
143
+ for(i = 0; i < sourceKeys.length; i++){
144
+ key = sourceKeys[i];
145
+ if (excluded.indexOf(key) >= 0) continue;
146
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
147
+ target[key] = source[key];
148
+ }
149
+ return target;
150
+ }
151
+ function _sliced_to_array(arr, i) {
152
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
153
+ }
154
+ function _to_array(arr) {
155
+ return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
156
+ }
157
+ function _to_consumable_array(arr) {
158
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
159
+ }
160
+ function _unsupported_iterable_to_array(o, minLen) {
161
+ if (!o) return;
162
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
163
+ var n = Object.prototype.toString.call(o).slice(8, -1);
164
+ if (n === "Object" && o.constructor) n = o.constructor.name;
165
+ if (n === "Map" || n === "Set") return Array.from(n);
166
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
167
+ }
1
168
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
169
  import { Slot } from '@radix-ui/react-slot';
3
170
  import * as React from 'react';
4
- import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '../dropdown/Dropdown';
171
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../dropdown/Dropdown';
5
172
  import IconEllipsis from '../icons/IconEllipsis';
6
173
  import IconThinArrow from '../icons/IconThinArrow';
7
174
  import { cn } from '../utils';
8
- const BreadcrumbRoot = React.forwardRef(({ ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", ...props }));
175
+ var BreadcrumbRoot = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
176
+ var _ref = [
177
+ _0,
178
+ _1
179
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), ref = _object_destructuring_empty(_ref2), props = _extends({}, _ref2), _rest1 = _sliced_to_array(_rest, 1), ref1 = _rest1[0];
180
+ return /*#__PURE__*/ _jsx("nav", _object_spread({
181
+ ref: ref1,
182
+ "aria-label": "breadcrumb"
183
+ }, props));
184
+ });
9
185
  BreadcrumbRoot.displayName = 'BreadcrumbRoot';
10
- const BreadcrumbList = React.forwardRef(({ className, ...props }, ref) => (_jsx("ol", { ref: ref, className: cn('flex flex-wrap items-center gap-2 break-words text-sm tracking-wide uppercase text-primary3 sm:gap-2.5 dark:text-zinc-400', className), ...props })));
186
+ var BreadcrumbList = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
187
+ var _ref = [
188
+ _0,
189
+ _1
190
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
191
+ "className"
192
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
193
+ return /*#__PURE__*/ _jsx("ol", _object_spread({
194
+ ref: ref,
195
+ className: cn('flex flex-wrap items-center gap-2 break-words text-sm tracking-wide uppercase text-primary3 sm:gap-2.5 dark:text-zinc-400', className)
196
+ }, props));
197
+ });
11
198
  BreadcrumbList.displayName = 'BreadcrumbList';
12
- const BreadcrumbItem = React.forwardRef(({ className, ...props }, ref) => (_jsx("li", { ref: ref,
13
- //* ml-0 is to avoid padding left getting amended by global
14
- className: cn('inline-flex items-center gap-2 ml-0', className), ...props })));
199
+ var BreadcrumbItem = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
200
+ var _ref = [
201
+ _0,
202
+ _1
203
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
204
+ "className"
205
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
206
+ return /*#__PURE__*/ _jsx("li", _object_spread({
207
+ ref: ref,
208
+ //* ml-0 is to avoid padding left getting amended by global
209
+ className: cn('inline-flex items-center gap-2 ml-0', className)
210
+ }, props));
211
+ });
15
212
  BreadcrumbItem.displayName = 'BreadcrumbItem';
16
- const BreadcrumbLink = React.forwardRef(({ className, asChild, ...props }, ref) => {
17
- const Comp = asChild ? Slot : 'a';
18
- return (_jsx(Comp, { ref: ref, className: cn('text-primary3 hover:text-black dark:hover:text-zinc-50', className), ...props }));
213
+ var BreadcrumbLink = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
214
+ var _ref = [
215
+ _0,
216
+ _1
217
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, asChild = _ref2.asChild, props = _object_without_properties(_ref2, [
218
+ "className",
219
+ "asChild"
220
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
221
+ var Comp = asChild ? Slot : 'a';
222
+ return /*#__PURE__*/ _jsx(Comp, _object_spread({
223
+ ref: ref,
224
+ className: cn('text-primary3 hover:text-black dark:hover:text-zinc-50', className)
225
+ }, props));
19
226
  });
20
227
  BreadcrumbLink.displayName = 'BreadcrumbLink';
21
- const BreadcrumbPage = React.forwardRef(({ className, ...props }, ref) => (_jsx("span", { ref: ref, role: "link", "aria-disabled": "true", "aria-current": "page", className: cn('font-bold dark:text-zinc-50', className), ...props })));
228
+ var BreadcrumbPage = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
229
+ var _ref = [
230
+ _0,
231
+ _1
232
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), className = _ref2.className, props = _object_without_properties(_ref2, [
233
+ "className"
234
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
235
+ return(// biome-ignore lint/a11y/useFocusableInteractive: Element is intentionally not focusable
236
+ /*#__PURE__*/ _jsx("span", _object_spread({
237
+ ref: ref,
238
+ role: "link",
239
+ "aria-disabled": "true",
240
+ "aria-current": "page",
241
+ className: cn('font-bold dark:text-zinc-50', className)
242
+ }, props)));
243
+ });
22
244
  BreadcrumbPage.displayName = 'BreadcrumbPage';
23
- const BreadcrumbSeparator = ({ children, className, ...props }) => (_jsx("li", { role: "presentation", "aria-hidden": "true",
24
- //* ml-0 is to avoid padding left getting amended by global
25
- className: cn('[&>svg]:w-3.5 [&>svg]:h-3.5 ml-0 text-black', className), ...props, children: children ?? _jsx(IconThinArrow, { variant: "right", size: "16px" }) }));
245
+ var BreadcrumbSeparator = function BreadcrumbSeparator(_0) {
246
+ var children = _0.children, className = _0.className, props = _object_without_properties(_0, [
247
+ "children",
248
+ "className"
249
+ ]);
250
+ return /*#__PURE__*/ _jsx("li", _object_spread_props(_object_spread({
251
+ role: "presentation",
252
+ "aria-hidden": "true",
253
+ //* ml-0 is to avoid padding left getting amended by global
254
+ className: cn('[&>svg]:w-3.5 [&>svg]:h-3.5 ml-0 text-black', className)
255
+ }, props), {
256
+ children: children !== null && children !== void 0 ? children : /*#__PURE__*/ _jsx(IconThinArrow, {
257
+ variant: "right",
258
+ size: "16px"
259
+ })
260
+ }));
261
+ };
26
262
  BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
27
- const BreadcrumbEllipsis = ({ className, ...props }) => (_jsxs("span", { role: "presentation", "aria-hidden": "true", className: cn('flex h-9 w-9 items-center justify-center', className), ...props, children: [_jsx(IconEllipsis, { size: "16px", className: "rotate-90" }), _jsx("span", { className: "sr-only", children: "More" })] }));
263
+ var BreadcrumbEllipsis = function BreadcrumbEllipsis(_0) {
264
+ var className = _0.className, props = _object_without_properties(_0, [
265
+ "className"
266
+ ]);
267
+ return /*#__PURE__*/ _jsxs("span", _object_spread_props(_object_spread({
268
+ role: "presentation",
269
+ "aria-hidden": "true",
270
+ className: cn('flex h-9 w-9 items-center justify-center', className)
271
+ }, props), {
272
+ children: [
273
+ /*#__PURE__*/ _jsx(IconEllipsis, {
274
+ size: "16px",
275
+ className: "rotate-90"
276
+ }),
277
+ /*#__PURE__*/ _jsx("span", {
278
+ className: "sr-only",
279
+ children: "More"
280
+ })
281
+ ]
282
+ }));
283
+ };
28
284
  BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis';
29
- const Breadcrumbs = React.forwardRef(({ crumbs, LinkComponent, defaultCrumbsLength: providedCrumbsLength = 3, ...props }, ref) => {
30
- const defaultCrumbsLength = Math.max(2, providedCrumbsLength);
31
- const tooManyCrumbs = crumbs.length > defaultCrumbsLength;
32
- const trimmedCrumbs = tooManyCrumbs
33
- ? [crumbs[0], ...crumbs.slice(-(defaultCrumbsLength - 1))]
34
- : crumbs;
35
- const FinalLinkComponent = LinkComponent ?? 'a';
36
- return (_jsx(BreadcrumbRoot, { ref: ref, ...props, children: _jsx(BreadcrumbList, { children: trimmedCrumbs.map((crumb, i, trimmedCrumbs) => (_jsxs(React.Fragment, { children: [_jsx(BreadcrumbItem, { children: crumb.href ? (_jsx(BreadcrumbLink, { href: crumb.href, className: cn(i === trimmedCrumbs.length - 1 && 'text-black font-bold'), asChild: !!LinkComponent, children: LinkComponent ? (_jsx(LinkComponent, { href: crumb.href, children: crumb.label })) : (crumb.label) })) : (_jsx(BreadcrumbPage, { className: cn(i === trimmedCrumbs.length - 1 && 'text-black font-bold'), children: crumb.label })) }), i < trimmedCrumbs.length - 1 && _jsx(BreadcrumbSeparator, {}), tooManyCrumbs && i === 0 && (_jsxs(React.Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { className: "flex items-center gap-1 rounded-full hover:bg-primary1", children: [_jsx(BreadcrumbEllipsis, { className: "hover:text-black cursor-pointer" }), _jsx("span", { className: "sr-only", children: "Toggle menu" })] }), _jsx(DropdownMenuContent, { align: "start", className: "tracking-wide uppercase text-sm text-primary3", children: crumbs
37
- .slice(1, -(defaultCrumbsLength - 1))
38
- .map((leftoverCrumb) => leftoverCrumb.href ? (_jsx(FinalLinkComponent, { href: leftoverCrumb.href, children: _jsx(DropdownMenuItem, { className: "text-primary3 cursor-pointer", children: leftoverCrumb.label }) }, leftoverCrumb.label?.toString())) : (_jsx(DropdownMenuItem, { children: leftoverCrumb.label }, leftoverCrumb.label?.toString()))) })] }), _jsx(BreadcrumbSeparator, {})] }))] }, crumb.label?.toString()))) }) }));
285
+ var Breadcrumbs = /*#__PURE__*/ React.forwardRef(function(_0, _1) {
286
+ var _ref = [
287
+ _0,
288
+ _1
289
+ ], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), crumbs = _ref2.crumbs, LinkComponent = _ref2.LinkComponent, tmp = _ref2.defaultCrumbsLength, providedCrumbsLength = tmp === void 0 ? 3 : tmp, props = _object_without_properties(_ref2, [
290
+ "crumbs",
291
+ "LinkComponent",
292
+ "defaultCrumbsLength"
293
+ ]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
294
+ var defaultCrumbsLength = Math.max(2, providedCrumbsLength);
295
+ var tooManyCrumbs = crumbs.length > defaultCrumbsLength;
296
+ var trimmedCrumbs = tooManyCrumbs ? [
297
+ crumbs[0]
298
+ ].concat(_to_consumable_array(crumbs.slice(-(defaultCrumbsLength - 1)))) : crumbs;
299
+ var FinalLinkComponent = LinkComponent !== null && LinkComponent !== void 0 ? LinkComponent : 'a';
300
+ return /*#__PURE__*/ _jsx(BreadcrumbRoot, _object_spread_props(_object_spread({
301
+ ref: ref
302
+ }, props), {
303
+ children: /*#__PURE__*/ _jsx(BreadcrumbList, {
304
+ children: trimmedCrumbs.map(function(crumb, i, trimmedCrumbs) {
305
+ var _crumb_label;
306
+ return /*#__PURE__*/ _jsxs(React.Fragment, {
307
+ children: [
308
+ /*#__PURE__*/ _jsx(BreadcrumbItem, {
309
+ children: crumb.href ? /*#__PURE__*/ _jsx(BreadcrumbLink, {
310
+ href: crumb.href,
311
+ className: cn(i === trimmedCrumbs.length - 1 && 'text-black font-bold'),
312
+ asChild: !!LinkComponent,
313
+ children: LinkComponent ? /*#__PURE__*/ _jsx(LinkComponent, {
314
+ href: crumb.href,
315
+ children: crumb.label
316
+ }) : crumb.label
317
+ }) : /*#__PURE__*/ _jsx(BreadcrumbPage, {
318
+ className: cn(i === trimmedCrumbs.length - 1 && 'text-black font-bold'),
319
+ children: crumb.label
320
+ })
321
+ }),
322
+ i < trimmedCrumbs.length - 1 && /*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
323
+ tooManyCrumbs && i === 0 && /*#__PURE__*/ _jsxs(React.Fragment, {
324
+ children: [
325
+ /*#__PURE__*/ _jsxs(DropdownMenu, {
326
+ children: [
327
+ /*#__PURE__*/ _jsxs(DropdownMenuTrigger, {
328
+ className: "flex items-center gap-1 rounded-full hover:bg-primary1",
329
+ children: [
330
+ /*#__PURE__*/ _jsx(BreadcrumbEllipsis, {
331
+ className: "hover:text-black cursor-pointer"
332
+ }),
333
+ /*#__PURE__*/ _jsx("span", {
334
+ className: "sr-only",
335
+ children: "Toggle menu"
336
+ })
337
+ ]
338
+ }),
339
+ /*#__PURE__*/ _jsx(DropdownMenuContent, {
340
+ align: "start",
341
+ className: "tracking-wide uppercase text-sm text-primary3",
342
+ children: crumbs.slice(1, -(defaultCrumbsLength - 1)).map(function(leftoverCrumb) {
343
+ var _leftoverCrumb_label, _leftoverCrumb_label1;
344
+ return leftoverCrumb.href ? /*#__PURE__*/ _jsx(FinalLinkComponent, {
345
+ href: leftoverCrumb.href,
346
+ children: /*#__PURE__*/ _jsx(DropdownMenuItem, {
347
+ className: "text-primary3 cursor-pointer",
348
+ children: leftoverCrumb.label
349
+ })
350
+ }, (_leftoverCrumb_label = leftoverCrumb.label) === null || _leftoverCrumb_label === void 0 ? void 0 : _leftoverCrumb_label.toString()) : /*#__PURE__*/ _jsx(DropdownMenuItem, {
351
+ children: leftoverCrumb.label
352
+ }, (_leftoverCrumb_label1 = leftoverCrumb.label) === null || _leftoverCrumb_label1 === void 0 ? void 0 : _leftoverCrumb_label1.toString());
353
+ })
354
+ })
355
+ ]
356
+ }),
357
+ /*#__PURE__*/ _jsx(BreadcrumbSeparator, {})
358
+ ]
359
+ })
360
+ ]
361
+ }, (_crumb_label = crumb.label) === null || _crumb_label === void 0 ? void 0 : _crumb_label.toString());
362
+ })
363
+ })
364
+ }));
39
365
  });
40
366
  export default Breadcrumbs;
41
- export { BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, };
42
- //# sourceMappingURL=Breadcrumbs.js.map
367
+ export { BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, };
@@ -1,41 +1,65 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Breadcrumbs from './Breadcrumbs.js';
3
- const meta = {
3
+ var meta = {
4
4
  component: Breadcrumbs,
5
5
  args: {
6
- crumbs: [],
7
- },
6
+ crumbs: []
7
+ }
8
8
  };
9
9
  export default meta;
10
- export const FirstStory = {
11
- render: () => {
12
- return (_jsx(Breadcrumbs, { crumbs: [
13
- { href: '/', label: 'Home' },
14
- { href: '/account', label: 'Account' },
15
- { label: 'Settings' },
16
- ] }));
17
- },
10
+ export var FirstStory = {
11
+ render: function render() {
12
+ return /*#__PURE__*/ _jsx(Breadcrumbs, {
13
+ crumbs: [
14
+ {
15
+ href: '/',
16
+ label: 'Home'
17
+ },
18
+ {
19
+ href: '/account',
20
+ label: 'Account'
21
+ },
22
+ {
23
+ label: 'Settings'
24
+ }
25
+ ]
26
+ });
27
+ }
18
28
  };
19
- const longCrumbs = [
20
- { href: '/', label: 'Home' },
21
- { href: '/cars/malaysia', label: 'Browse Car Page' },
22
- { href: '/cars/malaysia/proton-saga', label: 'Proton Saga' },
29
+ var longCrumbs = [
23
30
  {
24
- href: '/cars/malaysia/proton-saga/checkout',
25
- label: 'Checkout Proton Saga',
31
+ href: '/',
32
+ label: 'Home'
26
33
  },
27
34
  {
28
- label: 'Checkout Proton Saga Supplementary Documents',
35
+ href: '/cars/malaysia',
36
+ label: 'Browse Car Page'
29
37
  },
30
- ];
31
- export const LongStory = {
32
- render: () => {
33
- return _jsx(Breadcrumbs, { crumbs: longCrumbs, defaultCrumbsLength: 4 });
38
+ {
39
+ href: '/cars/malaysia/proton-saga',
40
+ label: 'Proton Saga'
34
41
  },
35
- };
36
- export const MischievousStory = {
37
- render: () => {
38
- return _jsx(Breadcrumbs, { crumbs: longCrumbs, defaultCrumbsLength: -20 });
42
+ {
43
+ href: '/cars/malaysia/proton-saga/checkout',
44
+ label: 'Checkout Proton Saga'
39
45
  },
46
+ {
47
+ label: 'Checkout Proton Saga Supplementary Documents'
48
+ }
49
+ ];
50
+ export var LongStory = {
51
+ render: function render() {
52
+ return /*#__PURE__*/ _jsx(Breadcrumbs, {
53
+ crumbs: longCrumbs,
54
+ defaultCrumbsLength: 4
55
+ });
56
+ }
57
+ };
58
+ export var MischievousStory = {
59
+ render: function render() {
60
+ return /*#__PURE__*/ _jsx(Breadcrumbs, {
61
+ crumbs: longCrumbs,
62
+ defaultCrumbsLength: -20
63
+ });
64
+ }
40
65
  };
41
- //# sourceMappingURL=Breadcrumbs.stories.js.map