@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.
- package/dist/accordion/Accordion.js +7 -203
- package/dist/accordion/Accordion.stories.js +11 -31
- package/dist/alert/Alert.js +19 -193
- package/dist/alert/Alert.stories.js +15 -50
- package/dist/animations/LoadingAnimation.js +21 -34
- package/dist/badge/Badge.js +7 -105
- package/dist/badge/Badge.stories.js +7 -28
- package/dist/box/Box.js +3 -151
- package/dist/box/Box.stories.js +7 -8
- package/dist/breadcrumbs/Breadcrumbs.js +26 -351
- package/dist/breadcrumbs/Breadcrumbs.stories.js +27 -51
- package/dist/button/Button.js +12 -190
- package/dist/button/Button.stories.js +7 -35
- package/dist/button/TextButton.js +9 -168
- package/dist/card/Card.js +7 -188
- package/dist/card/Card.stories.js +7 -10
- package/dist/carousel/Carousel.js +58 -308
- package/dist/carousel/Carousel.stories.js +7 -39
- package/dist/carousel/CarouselButton.js +7 -132
- package/dist/center/Center.js +3 -127
- package/dist/center/Center.stories.js +7 -19
- package/dist/checkbox/Checkbox.js +4 -188
- package/dist/checkbox/Checkbox.stories.js +8 -10
- package/dist/chip/Chip.js +3 -168
- package/dist/chip/Chip.stories.js +7 -19
- package/dist/circular-progress/CircularProgress.js +11 -159
- package/dist/circular-progress/CircularProgress.stories.js +14 -54
- package/dist/command/command.js +13 -249
- package/dist/datepicker/DatePicker.js +90 -245
- package/dist/datepicker/DatePicker.stories.js +58 -162
- package/dist/datepicker/DatePickerDrawer.js +17 -115
- package/dist/datepicker/DatePickerPopover.js +35 -208
- package/dist/datepicker/constants.js +4 -3
- package/dist/datepicker/utils.js +11 -4
- package/dist/dialog/index.js +12 -253
- package/dist/divider/Divider.js +3 -127
- package/dist/divider/Divider.stories.js +7 -13
- package/dist/drawer/index.js +12 -230
- package/dist/dropdown/Dropdown.js +26 -297
- package/dist/dropdown/Dropdown.stories.js +22 -109
- package/dist/field-wrapper/FieldWrapper.js +3 -203
- package/dist/field-wrapper/FieldWrapper.stories.js +28 -124
- package/dist/flex/Flex.js +3 -127
- package/dist/flex/Flex.stories.js +7 -19
- package/dist/grid/Grid.js +3 -127
- package/dist/grid/Grid.stories.js +7 -28
- package/dist/hooks/use-breakpoint-value.js +14 -77
- package/dist/hooks/use-media-query.js +12 -61
- package/dist/hstack/HStack.js +3 -127
- package/dist/hstack/HStack.stories.js +7 -19
- package/dist/icons/FluxLogo.js +9 -222
- package/dist/icons/FluxLogoTable.js +5 -118
- package/dist/icons/Icon.js +7 -117
- package/dist/icons/Icon.stories.js +7 -12
- package/dist/icons/Icon24Hours.js +5 -92
- package/dist/icons/IconAcceleration.js +4 -81
- package/dist/icons/IconAccount.js +4 -81
- package/dist/icons/IconApplicant.js +5 -87
- package/dist/icons/IconArrow.js +6 -87
- package/dist/icons/IconArrowBack.js +4 -81
- package/dist/icons/IconArrowForward.js +4 -81
- package/dist/icons/IconArrowTopLeft.js +4 -79
- package/dist/icons/IconBluesharkProductGuide.js +5 -89
- package/dist/icons/IconBolt.js +4 -81
- package/dist/icons/IconBriefcase.js +4 -81
- package/dist/icons/IconBulb.js +4 -81
- package/dist/icons/IconCalendar.js +4 -81
- package/dist/icons/IconCalendarArrowBack.js +4 -81
- package/dist/icons/IconCalendarArrowForward.js +4 -81
- package/dist/icons/IconCalendarDoubleArrowBack.js +4 -81
- package/dist/icons/IconCalendarDoubleArrowForward.js +4 -81
- package/dist/icons/IconCancel.js +5 -86
- package/dist/icons/IconCancelMark.js +4 -81
- package/dist/icons/IconCarSUV.js +4 -81
- package/dist/icons/IconCarSedan.js +7 -156
- package/dist/icons/IconChain.js +5 -88
- package/dist/icons/IconCheckmark.js +4 -81
- package/dist/icons/IconChevronRight.js +4 -81
- package/dist/icons/IconCircle.js +11 -123
- package/dist/icons/IconCircleCheckmark.js +5 -86
- package/dist/icons/IconCircleError.js +4 -81
- package/dist/icons/IconCircleExclamation.js +6 -113
- package/dist/icons/IconCircleMark.js +5 -87
- package/dist/icons/IconCircleOutline.js +5 -148
- package/dist/icons/IconClock.js +5 -89
- package/dist/icons/IconClose.js +4 -81
- package/dist/icons/IconCollapseAll.js +5 -103
- package/dist/icons/IconConcierge.js +5 -88
- package/dist/icons/IconConciergeService.js +5 -96
- package/dist/icons/IconCreditCard.js +5 -87
- package/dist/icons/IconDash.js +4 -81
- package/dist/icons/IconDeliver.js +4 -81
- package/dist/icons/IconDelivery.js +5 -96
- package/dist/icons/IconDetails.js +4 -81
- package/dist/icons/IconDot.js +6 -96
- package/dist/icons/IconDownload.js +5 -88
- package/dist/icons/IconEVCharging.js +5 -88
- package/dist/icons/IconElectricCarFuel.js +5 -89
- package/dist/icons/IconEllipsis.js +5 -87
- package/dist/icons/IconEnvelope.js +4 -81
- package/dist/icons/IconExpandAll.js +5 -103
- package/dist/icons/IconEye.js +5 -88
- package/dist/icons/IconFacebook.js +6 -103
- package/dist/icons/IconFilter.js +5 -92
- package/dist/icons/IconFlagMalaysia.js +5 -150
- package/dist/icons/IconGiveKey.js +5 -88
- package/dist/icons/IconGlobe.js +4 -79
- package/dist/icons/IconGoogle.js +5 -96
- package/dist/icons/IconHome.js +5 -87
- package/dist/icons/IconHostAdvertise.js +4 -81
- package/dist/icons/IconHostCar.js +4 -84
- package/dist/icons/IconHostCash.js +5 -100
- package/dist/icons/IconHostHandle.js +4 -79
- package/dist/icons/IconHostLocation.js +4 -79
- package/dist/icons/IconHostPayment.js +5 -100
- package/dist/icons/IconHostService.js +5 -88
- package/dist/icons/IconHotDeals.js +4 -81
- package/dist/icons/IconInfo.js +5 -86
- package/dist/icons/IconInstagram.js +4 -81
- package/dist/icons/IconInsurance.js +5 -108
- package/dist/icons/IconInternet.js +4 -82
- package/dist/icons/IconInventory.js +5 -87
- package/dist/icons/IconLaurel.js +5 -110
- package/dist/icons/IconLinkedIn.js +4 -81
- package/dist/icons/IconLoading.js +4 -87
- package/dist/icons/IconLocation.js +5 -89
- package/dist/icons/IconLock.js +4 -82
- package/dist/icons/IconLogistics.js +4 -81
- package/dist/icons/IconMail.js +5 -103
- package/dist/icons/IconMember.js +5 -87
- package/dist/icons/IconMobilePen.js +5 -92
- package/dist/icons/IconMotorcycleMoped.js +5 -87
- package/dist/icons/IconNoCost.js +5 -101
- package/dist/icons/IconPDF.js +5 -89
- package/dist/icons/IconPencil.js +4 -79
- package/dist/icons/IconPhone.js +4 -79
- package/dist/icons/IconPlus.js +4 -81
- package/dist/icons/IconPricing.js +4 -81
- package/dist/icons/IconProtected.js +4 -80
- package/dist/icons/IconPsychology.js +4 -81
- package/dist/icons/IconQuestionTooltip.js +4 -137
- package/dist/icons/IconQuote.js +4 -81
- package/dist/icons/IconRate.js +4 -80
- package/dist/icons/IconRegister.js +5 -108
- package/dist/icons/IconReport.js +6 -98
- package/dist/icons/IconReturn.js +4 -81
- package/dist/icons/IconSearch.js +4 -79
- package/dist/icons/IconSecure.js +4 -80
- package/dist/icons/IconSecurity.js +4 -82
- package/dist/icons/IconSedanOutline.js +5 -168
- package/dist/icons/IconSelectArrow.js +6 -87
- package/dist/icons/IconSort.js +5 -88
- package/dist/icons/IconSortListed.js +5 -104
- package/dist/icons/IconSortPriceAscending.js +5 -92
- package/dist/icons/IconSortPriceDescending.js +5 -92
- package/dist/icons/IconSortYear.js +5 -88
- package/dist/icons/IconSpan.js +4 -80
- package/dist/icons/IconSpeaker.js +4 -88
- package/dist/icons/IconSpecialCar.js +5 -104
- package/dist/icons/IconStar.js +7 -101
- package/dist/icons/IconStockPhoto.js +5 -104
- package/dist/icons/IconSubscription.js +6 -122
- package/dist/icons/IconSubscriptions.js +6 -122
- package/dist/icons/IconSwap.js +5 -88
- package/dist/icons/IconTax.js +4 -81
- package/dist/icons/IconThinArrow.js +6 -87
- package/dist/icons/IconThumbsdown.js +5 -87
- package/dist/icons/IconThumbsup.js +5 -87
- package/dist/icons/IconTool.js +4 -81
- package/dist/icons/IconTooltip.js +4 -137
- package/dist/icons/IconTrash.js +4 -81
- package/dist/icons/IconTriangleExclamation.js +4 -81
- package/dist/icons/IconTyersBrakes.js +5 -92
- package/dist/icons/IconTyre.js +5 -92
- package/dist/icons/IconVacancy.js +5 -87
- package/dist/icons/IconVolunteer.js +4 -81
- package/dist/icons/IconWhatsapp.js +4 -82
- package/dist/icons/IconXPlatform.js +4 -81
- package/dist/icons/IconZeroEffort.js +5 -86
- package/dist/icons/Logo.js +3 -108
- package/dist/input/Input.js +11 -134
- package/dist/input/Input.stories.js +18 -17
- package/dist/input-mask/InputMask.js +11 -158
- package/dist/input-mask/InputMask.stories.js +6 -5
- package/dist/input-mask/mask-trackers.js +5 -4
- package/dist/input-select/InputSelect.js +68 -390
- package/dist/input-select/InputSelect.stories.js +25 -98
- package/dist/popover/popover.js +4 -136
- package/dist/progress/Progress.js +2 -160
- package/dist/progress/Progress.stories.js +14 -13
- package/dist/radio/Radio.js +4 -227
- package/dist/scroll-area/scroll-area.js +5 -180
- package/dist/search-input-select/SearchInputSelect.js +69 -379
- package/dist/select/Select.js +29 -354
- package/dist/select/Select.stories.js +19 -55
- package/dist/skeleton/Skeleton.js +3 -71
- package/dist/skeleton/Skeleton.stories.js +7 -8
- package/dist/slider/Slider.js +5 -170
- package/dist/slider/Slider.stories.js +11 -12
- package/dist/stack/Stack.js +3 -127
- package/dist/stack/Stack.stories.js +7 -19
- package/dist/table/Table.js +10 -216
- package/dist/table/Table.stories.js +8 -84
- package/dist/tabs/Tabs.js +9 -198
- package/dist/tabs/Tabs.stories.js +13 -46
- package/dist/text/Text.js +6 -152
- package/dist/text/Text.stories.js +7 -44
- package/dist/toast/Toast.stories.js +14 -66
- package/dist/toast/ToastBox.js +29 -77
- package/dist/toast/index.js +1 -0
- package/dist/toast/sonner.js +6 -66
- package/dist/toggle/Toggle.js +7 -180
- package/dist/toggle/Toggle.stories.js +8 -10
- package/dist/tooltip/Tooltip.js +12 -169
- package/dist/tooltip/Tooltip.stories.js +13 -71
- package/dist/utils.js +2 -4
- package/dist/vstack/VStack.js +3 -127
- package/dist/vstack/VStack.stories.js +7 -19
- package/package.json +16 -16
|
@@ -1,367 +1,42 @@
|
|
|
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
|
-
}
|
|
168
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
169
2
|
import { Slot } from '@radix-ui/react-slot';
|
|
170
3
|
import * as React from 'react';
|
|
171
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../dropdown/Dropdown';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '../dropdown/Dropdown';
|
|
172
5
|
import IconEllipsis from '../icons/IconEllipsis';
|
|
173
6
|
import IconThinArrow from '../icons/IconThinArrow';
|
|
174
7
|
import { cn } from '../utils';
|
|
175
|
-
|
|
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
|
-
});
|
|
8
|
+
const BreadcrumbRoot = React.forwardRef(({ ...props }, ref) => _jsx("nav", { ref: ref, "aria-label": "breadcrumb", ...props }));
|
|
185
9
|
BreadcrumbRoot.displayName = 'BreadcrumbRoot';
|
|
186
|
-
|
|
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
|
-
});
|
|
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 })));
|
|
198
11
|
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
});
|
|
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 })));
|
|
212
15
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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));
|
|
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 }));
|
|
226
19
|
});
|
|
227
20
|
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
228
|
-
|
|
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
|
-
});
|
|
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 })));
|
|
244
22
|
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
};
|
|
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" }) }));
|
|
262
26
|
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
263
|
-
|
|
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
|
-
};
|
|
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" })] }));
|
|
284
28
|
BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis';
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
}));
|
|
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()))) }) }));
|
|
365
39
|
});
|
|
366
40
|
export default Breadcrumbs;
|
|
367
|
-
export { BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator,
|
|
41
|
+
export { BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, };
|
|
42
|
+
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -1,65 +1,41 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Breadcrumbs from './Breadcrumbs.js';
|
|
3
|
-
|
|
3
|
+
const meta = {
|
|
4
4
|
component: Breadcrumbs,
|
|
5
5
|
args: {
|
|
6
|
-
crumbs: []
|
|
7
|
-
}
|
|
6
|
+
crumbs: [],
|
|
7
|
+
},
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
10
|
-
export
|
|
11
|
-
render:
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
href: '/account',
|
|
20
|
-
label: 'Account'
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: 'Settings'
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var longCrumbs = [
|
|
30
|
-
{
|
|
31
|
-
href: '/',
|
|
32
|
-
label: 'Home'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
href: '/cars/malaysia',
|
|
36
|
-
label: 'Browse Car Page'
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
href: '/cars/malaysia/proton-saga',
|
|
40
|
-
label: 'Proton Saga'
|
|
10
|
+
export const FirstStory = {
|
|
11
|
+
render: () => {
|
|
12
|
+
return (_jsx(Breadcrumbs, { crumbs: [
|
|
13
|
+
{ href: '/', label: 'Home' },
|
|
14
|
+
{ href: '/account', label: 'Account' },
|
|
15
|
+
{ label: 'Settings' },
|
|
16
|
+
] }));
|
|
41
17
|
},
|
|
18
|
+
};
|
|
19
|
+
const longCrumbs = [
|
|
20
|
+
{ href: '/', label: 'Home' },
|
|
21
|
+
{ href: '/cars/malaysia', label: 'Browse Car Page' },
|
|
22
|
+
{ href: '/cars/malaysia/proton-saga', label: 'Proton Saga' },
|
|
42
23
|
{
|
|
43
24
|
href: '/cars/malaysia/proton-saga/checkout',
|
|
44
|
-
label: 'Checkout Proton Saga'
|
|
25
|
+
label: 'Checkout Proton Saga',
|
|
45
26
|
},
|
|
46
27
|
{
|
|
47
|
-
label: 'Checkout Proton Saga Supplementary Documents'
|
|
48
|
-
}
|
|
28
|
+
label: 'Checkout Proton Saga Supplementary Documents',
|
|
29
|
+
},
|
|
49
30
|
];
|
|
50
|
-
export
|
|
51
|
-
render:
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
defaultCrumbsLength: 4
|
|
55
|
-
});
|
|
56
|
-
}
|
|
31
|
+
export const LongStory = {
|
|
32
|
+
render: () => {
|
|
33
|
+
return _jsx(Breadcrumbs, { crumbs: longCrumbs, defaultCrumbsLength: 4 });
|
|
34
|
+
},
|
|
57
35
|
};
|
|
58
|
-
export
|
|
59
|
-
render:
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
defaultCrumbsLength: -20
|
|
63
|
-
});
|
|
64
|
-
}
|
|
36
|
+
export const MischievousStory = {
|
|
37
|
+
render: () => {
|
|
38
|
+
return _jsx(Breadcrumbs, { crumbs: longCrumbs, defaultCrumbsLength: -20 });
|
|
39
|
+
},
|
|
65
40
|
};
|
|
41
|
+
//# sourceMappingURL=Breadcrumbs.stories.js.map
|