@driveflux/beam 3.0.3 → 3.0.4
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 +133 -7
- package/dist/accordion/Accordion.stories.js +31 -11
- package/dist/alert/Alert.js +120 -19
- package/dist/alert/Alert.stories.js +50 -15
- package/dist/animations/LoadingAnimation.js +34 -21
- package/dist/badge/Badge.js +96 -7
- package/dist/badge/Badge.stories.js +28 -7
- package/dist/box/Box.js +87 -3
- package/dist/box/Box.stories.js +8 -7
- package/dist/breadcrumbs/Breadcrumbs.js +288 -28
- package/dist/breadcrumbs/Breadcrumbs.stories.js +51 -27
- package/dist/button/Button.js +124 -12
- package/dist/button/Button.stories.js +35 -7
- package/dist/card/Card.js +109 -7
- package/dist/card/Card.stories.js +10 -7
- package/dist/carousel/Carousel.js +281 -58
- package/dist/carousel/Carousel.stories.js +39 -7
- package/dist/carousel/CarouselButton.js +68 -7
- package/dist/center/Center.js +63 -3
- package/dist/center/Center.stories.js +19 -7
- package/dist/checkbox/Checkbox.js +124 -4
- package/dist/checkbox/Checkbox.stories.js +10 -8
- package/dist/chip/Chip.js +104 -3
- package/dist/chip/Chip.stories.js +19 -7
- package/dist/circular-progress/CircularProgress.js +150 -11
- package/dist/circular-progress/CircularProgress.stories.js +54 -14
- package/dist/command/command.js +170 -13
- package/dist/datepicker/DatePicker.js +234 -90
- package/dist/datepicker/DatePicker.stories.js +163 -58
- package/dist/datepicker/DatePickerDrawer.js +116 -17
- package/dist/datepicker/DatePickerPopover.js +208 -35
- package/dist/datepicker/constants.js +3 -4
- package/dist/datepicker/utils.js +4 -11
- package/dist/dialog/index.js +180 -33
- package/dist/divider/Divider.js +63 -3
- package/dist/divider/Divider.stories.js +13 -7
- package/dist/drawer/index.js +157 -12
- package/dist/dropdown/Dropdown.js +212 -26
- package/dist/dropdown/Dropdown.stories.js +109 -22
- package/dist/field-wrapper/FieldWrapper.js +139 -3
- package/dist/field-wrapper/FieldWrapper.stories.js +124 -28
- package/dist/flex/Flex.js +63 -3
- package/dist/flex/Flex.stories.js +19 -7
- package/dist/grid/Grid.js +63 -3
- package/dist/grid/Grid.stories.js +28 -7
- package/dist/hooks/use-breakpoint-value.js +77 -14
- package/dist/hooks/use-media-query.js +61 -12
- package/dist/hstack/HStack.js +63 -3
- package/dist/hstack/HStack.stories.js +19 -7
- package/dist/icons/FluxLogo.js +213 -9
- package/dist/icons/FluxLogoTable.js +109 -5
- package/dist/icons/Icon.js +108 -7
- package/dist/icons/Icon.stories.js +12 -7
- package/dist/icons/Icon24Hours.js +83 -5
- package/dist/icons/IconAcceleration.js +72 -4
- package/dist/icons/IconAccount.js +72 -4
- package/dist/icons/IconApplicant.js +78 -5
- package/dist/icons/IconArrow.js +78 -6
- package/dist/icons/IconArrowBack.js +72 -4
- package/dist/icons/IconArrowForward.js +72 -4
- package/dist/icons/IconArrowTopLeft.js +70 -4
- package/dist/icons/IconBluesharkProductGuide.js +80 -5
- package/dist/icons/IconBolt.js +72 -4
- package/dist/icons/IconBriefcase.js +72 -4
- package/dist/icons/IconBulb.js +72 -4
- package/dist/icons/IconCalendar.js +72 -4
- package/dist/icons/IconCalendarArrowBack.js +72 -4
- package/dist/icons/IconCalendarArrowForward.js +72 -4
- package/dist/icons/IconCalendarDoubleArrowBack.js +72 -4
- package/dist/icons/IconCalendarDoubleArrowForward.js +72 -4
- package/dist/icons/IconCancel.js +77 -5
- package/dist/icons/IconCancelMark.js +72 -4
- package/dist/icons/IconCarSUV.js +72 -4
- package/dist/icons/IconCarSedan.js +147 -7
- package/dist/icons/IconChain.js +79 -5
- package/dist/icons/IconCheckmark.js +72 -4
- package/dist/icons/IconChevronRight.js +72 -4
- package/dist/icons/IconCircle.js +114 -11
- package/dist/icons/IconCircleCheckmark.js +77 -5
- package/dist/icons/IconCircleError.js +72 -4
- package/dist/icons/IconCircleExclamation.js +104 -6
- package/dist/icons/IconCircleMark.js +78 -5
- package/dist/icons/IconCircleOutline.js +139 -5
- package/dist/icons/IconClock.js +80 -5
- package/dist/icons/IconClose.js +72 -4
- package/dist/icons/IconCollapseAll.js +94 -5
- package/dist/icons/IconConcierge.js +79 -5
- package/dist/icons/IconConciergeService.js +87 -5
- package/dist/icons/IconCreditCard.js +78 -5
- package/dist/icons/IconDash.js +72 -4
- package/dist/icons/IconDeliver.js +72 -4
- package/dist/icons/IconDelivery.js +87 -5
- package/dist/icons/IconDetails.js +72 -4
- package/dist/icons/IconDot.js +87 -6
- package/dist/icons/IconDownload.js +79 -5
- package/dist/icons/IconEVCharging.js +79 -5
- package/dist/icons/IconElectricCarFuel.js +80 -5
- package/dist/icons/IconEllipsis.js +78 -5
- package/dist/icons/IconEnvelope.js +72 -4
- package/dist/icons/IconExpandAll.js +94 -5
- package/dist/icons/IconEye.js +79 -5
- package/dist/icons/IconFacebook.js +94 -6
- package/dist/icons/IconFilter.js +83 -5
- package/dist/icons/IconFlagMalaysia.js +141 -5
- package/dist/icons/IconGiveKey.js +79 -5
- package/dist/icons/IconGlobe.js +70 -4
- package/dist/icons/IconGoogle.js +87 -5
- package/dist/icons/IconHome.js +78 -5
- package/dist/icons/IconHostAdvertise.js +72 -4
- package/dist/icons/IconHostCar.js +75 -4
- package/dist/icons/IconHostCash.js +91 -5
- package/dist/icons/IconHostHandle.js +70 -4
- package/dist/icons/IconHostLocation.js +70 -4
- package/dist/icons/IconHostPayment.js +91 -5
- package/dist/icons/IconHostService.js +79 -5
- package/dist/icons/IconHotDeals.js +72 -4
- package/dist/icons/IconInfo.js +77 -5
- package/dist/icons/IconInstagram.js +72 -4
- package/dist/icons/IconInsurance.js +99 -5
- package/dist/icons/IconInternet.js +73 -4
- package/dist/icons/IconInventory.js +78 -5
- package/dist/icons/IconLaurel.js +101 -5
- package/dist/icons/IconLinkedIn.js +72 -4
- package/dist/icons/IconLoading.js +78 -4
- package/dist/icons/IconLocation.js +80 -5
- package/dist/icons/IconLock.js +73 -4
- package/dist/icons/IconLogistics.js +72 -4
- package/dist/icons/IconMail.js +94 -5
- package/dist/icons/IconMember.js +78 -5
- package/dist/icons/IconMobilePen.js +83 -5
- package/dist/icons/IconMotorcycleMoped.js +78 -5
- package/dist/icons/IconNoCost.js +92 -5
- package/dist/icons/IconPDF.js +80 -5
- package/dist/icons/IconPencil.js +70 -4
- package/dist/icons/IconPhone.js +70 -4
- package/dist/icons/IconPlus.js +72 -4
- package/dist/icons/IconPricing.js +72 -4
- package/dist/icons/IconProtected.js +71 -4
- package/dist/icons/IconPsychology.js +72 -4
- package/dist/icons/IconQuestionTooltip.js +73 -4
- package/dist/icons/IconQuote.js +72 -4
- package/dist/icons/IconRate.js +71 -4
- package/dist/icons/IconRegister.js +99 -5
- package/dist/icons/IconReport.js +89 -6
- package/dist/icons/IconReturn.js +72 -4
- package/dist/icons/IconSearch.js +70 -4
- package/dist/icons/IconSecure.js +71 -4
- package/dist/icons/IconSecurity.js +73 -4
- package/dist/icons/IconSedanOutline.js +159 -5
- package/dist/icons/IconSelectArrow.js +78 -6
- package/dist/icons/IconSort.js +79 -5
- package/dist/icons/IconSortListed.js +95 -5
- package/dist/icons/IconSortPriceAscending.js +83 -5
- package/dist/icons/IconSortPriceDescending.js +83 -5
- package/dist/icons/IconSortYear.js +79 -5
- package/dist/icons/IconSpan.js +71 -4
- package/dist/icons/IconSpeaker.js +79 -4
- package/dist/icons/IconSpecialCar.js +95 -5
- package/dist/icons/IconStar.js +92 -7
- package/dist/icons/IconStockPhoto.js +95 -5
- package/dist/icons/IconSubscription.js +113 -6
- package/dist/icons/IconSubscriptions.js +113 -6
- package/dist/icons/IconSwap.js +79 -5
- package/dist/icons/IconTax.js +72 -4
- package/dist/icons/IconThinArrow.js +78 -6
- package/dist/icons/IconThumbsdown.js +78 -5
- package/dist/icons/IconThumbsup.js +78 -5
- package/dist/icons/IconTool.js +72 -4
- package/dist/icons/IconTooltip.js +73 -4
- package/dist/icons/IconTrash.js +72 -4
- package/dist/icons/IconTriangleExclamation.js +72 -4
- package/dist/icons/IconTyersBrakes.js +83 -5
- package/dist/icons/IconTyre.js +83 -5
- package/dist/icons/IconVacancy.js +78 -5
- package/dist/icons/IconVolunteer.js +72 -4
- package/dist/icons/IconWhatsapp.js +73 -4
- package/dist/icons/IconXPlatform.js +72 -4
- package/dist/icons/IconZeroEffort.js +77 -5
- package/dist/icons/Logo.js +99 -3
- package/dist/input/Input.js +125 -11
- package/dist/input/Input.stories.js +17 -18
- package/dist/input-mask/InputMask.js +149 -11
- package/dist/input-mask/InputMask.stories.js +5 -6
- package/dist/input-mask/mask-trackers.js +4 -5
- package/dist/input-select/InputSelect.js +357 -68
- package/dist/input-select/InputSelect.stories.js +98 -25
- package/dist/popover/popover.js +72 -4
- package/dist/progress/Progress.js +96 -2
- package/dist/progress/Progress.stories.js +13 -14
- package/dist/radio/Radio.js +163 -4
- package/dist/scroll-area/scroll-area.js +113 -5
- package/dist/search-input-select/SearchInputSelect.js +346 -69
- package/dist/select/Select.js +315 -29
- package/dist/select/Select.stories.js +55 -19
- package/dist/skeleton/Skeleton.js +62 -3
- package/dist/skeleton/Skeleton.stories.js +8 -7
- package/dist/slider/Slider.js +106 -5
- package/dist/slider/Slider.stories.js +12 -11
- package/dist/stack/Stack.js +63 -3
- package/dist/stack/Stack.stories.js +19 -7
- package/dist/table/Table.js +131 -10
- package/dist/table/Table.stories.js +84 -8
- package/dist/tabs/Tabs.js +128 -9
- package/dist/tabs/Tabs.stories.js +46 -13
- package/dist/text/Text.js +88 -6
- package/dist/text/Text.stories.js +44 -7
- package/dist/toast/Toast.stories.js +66 -14
- package/dist/toast/ToastBox.js +77 -29
- package/dist/toast/index.js +0 -1
- package/dist/toast/sonner.js +66 -6
- package/dist/toggle/Toggle.js +116 -7
- package/dist/toggle/Toggle.stories.js +10 -8
- package/dist/tooltip/Tooltip.js +151 -12
- package/dist/tooltip/Tooltip.stories.js +71 -13
- package/dist/utils.js +4 -2
- package/dist/vstack/VStack.js +63 -3
- package/dist/vstack/VStack.stories.js +19 -7
- package/package.json +3 -3
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import VStack from '../vstack/VStack.js';
|
|
3
3
|
import Badge from './Badge.js';
|
|
4
|
-
|
|
5
|
-
component: Badge
|
|
4
|
+
var meta = {
|
|
5
|
+
component: Badge
|
|
6
6
|
};
|
|
7
7
|
export default meta;
|
|
8
|
-
export
|
|
9
|
-
render: ()
|
|
10
|
-
return
|
|
11
|
-
|
|
8
|
+
export var FirstStory = {
|
|
9
|
+
render: function() {
|
|
10
|
+
return /*#__PURE__*/ _jsxs(VStack, {
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
13
|
+
colorScheme: 'accent',
|
|
14
|
+
children: "accent"
|
|
15
|
+
}),
|
|
16
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
17
|
+
colorScheme: 'success',
|
|
18
|
+
children: "success"
|
|
19
|
+
}),
|
|
20
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
21
|
+
colorScheme: 'warning',
|
|
22
|
+
children: "warning"
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
25
|
+
colorScheme: 'info',
|
|
26
|
+
children: "info"
|
|
27
|
+
}),
|
|
28
|
+
/*#__PURE__*/ _jsx(Badge, {
|
|
29
|
+
children: "60 months"
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
12
34
|
};
|
|
13
|
-
//# sourceMappingURL=Badge.stories.js.map
|
package/dist/box/Box.js
CHANGED
|
@@ -1,7 +1,91 @@
|
|
|
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 ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
56
|
+
var key, i;
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
59
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
60
|
+
key = sourceSymbolKeys[i];
|
|
61
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
62
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
|
+
target[key] = source[key];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return target;
|
|
67
|
+
}
|
|
68
|
+
function _object_without_properties_loose(source, excluded) {
|
|
69
|
+
if (source == null) return {};
|
|
70
|
+
var target = {};
|
|
71
|
+
var sourceKeys = Object.keys(source);
|
|
72
|
+
var key, i;
|
|
73
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
74
|
+
key = sourceKeys[i];
|
|
75
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
1
80
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
81
|
+
var Box = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
82
|
+
var _param_as = _param.as, as = _param_as === void 0 ? 'div' : _param_as, children = _param.children, props = _object_without_properties(_param, [
|
|
83
|
+
"as",
|
|
84
|
+
"children"
|
|
85
|
+
]);
|
|
86
|
+
return /*#__PURE__*/ React.createElement(as, _object_spread_props(_object_spread({}, props), {
|
|
87
|
+
ref: ref
|
|
88
|
+
}), children);
|
|
4
89
|
});
|
|
5
90
|
Box.displayName = 'Box';
|
|
6
91
|
export default Box;
|
|
7
|
-
//# sourceMappingURL=Box.js.map
|
package/dist/box/Box.stories.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Box from './Box.js';
|
|
3
|
-
|
|
4
|
-
component: Box
|
|
3
|
+
var meta = {
|
|
4
|
+
component: Box
|
|
5
5
|
};
|
|
6
6
|
export default meta;
|
|
7
|
-
export
|
|
8
|
-
render: ()
|
|
9
|
-
return _jsx(Box, {
|
|
10
|
-
|
|
7
|
+
export var FirstStory = {
|
|
8
|
+
render: function() {
|
|
9
|
+
return /*#__PURE__*/ _jsx(Box, {
|
|
10
|
+
className: "h-16 w-16 min-w-16 border border-primary2"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
11
13
|
};
|
|
12
|
-
//# sourceMappingURL=Box.stories.js.map
|
|
@@ -1,44 +1,304 @@
|
|
|
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 _define_property(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
function _extends() {
|
|
23
|
+
_extends = Object.assign || function(target) {
|
|
24
|
+
for(var i = 1; i < arguments.length; i++){
|
|
25
|
+
var source = arguments[i];
|
|
26
|
+
for(var key in source){
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
28
|
+
target[key] = source[key];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
return _extends.apply(this, arguments);
|
|
35
|
+
}
|
|
36
|
+
function _iterable_to_array(iter) {
|
|
37
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
38
|
+
}
|
|
39
|
+
function _non_iterable_spread() {
|
|
40
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
41
|
+
}
|
|
42
|
+
function _object_destructuring_empty(o) {
|
|
43
|
+
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
44
|
+
return o;
|
|
45
|
+
}
|
|
46
|
+
function _object_spread(target) {
|
|
47
|
+
for(var i = 1; i < arguments.length; i++){
|
|
48
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
49
|
+
var ownKeys = Object.keys(source);
|
|
50
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
51
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
52
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
ownKeys.forEach(function(key) {
|
|
56
|
+
_define_property(target, key, source[key]);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return target;
|
|
60
|
+
}
|
|
61
|
+
function ownKeys(object, enumerableOnly) {
|
|
62
|
+
var keys = Object.keys(object);
|
|
63
|
+
if (Object.getOwnPropertySymbols) {
|
|
64
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
65
|
+
if (enumerableOnly) {
|
|
66
|
+
symbols = symbols.filter(function(sym) {
|
|
67
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
keys.push.apply(keys, symbols);
|
|
71
|
+
}
|
|
72
|
+
return keys;
|
|
73
|
+
}
|
|
74
|
+
function _object_spread_props(target, source) {
|
|
75
|
+
source = source != null ? source : {};
|
|
76
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
77
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
78
|
+
} else {
|
|
79
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
80
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return target;
|
|
84
|
+
}
|
|
85
|
+
function _object_without_properties(source, excluded) {
|
|
86
|
+
if (source == null) return {};
|
|
87
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
88
|
+
var key, i;
|
|
89
|
+
if (Object.getOwnPropertySymbols) {
|
|
90
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
91
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
92
|
+
key = sourceSymbolKeys[i];
|
|
93
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
94
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
95
|
+
target[key] = source[key];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return target;
|
|
99
|
+
}
|
|
100
|
+
function _object_without_properties_loose(source, excluded) {
|
|
101
|
+
if (source == null) return {};
|
|
102
|
+
var target = {};
|
|
103
|
+
var sourceKeys = Object.keys(source);
|
|
104
|
+
var key, i;
|
|
105
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
106
|
+
key = sourceKeys[i];
|
|
107
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
108
|
+
target[key] = source[key];
|
|
109
|
+
}
|
|
110
|
+
return target;
|
|
111
|
+
}
|
|
112
|
+
function _to_consumable_array(arr) {
|
|
113
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
114
|
+
}
|
|
115
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
116
|
+
if (!o) return;
|
|
117
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
118
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
119
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
120
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
121
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
122
|
+
}
|
|
1
123
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
124
|
import { Slot } from '@radix-ui/react-slot';
|
|
3
125
|
import * as React from 'react';
|
|
4
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger
|
|
126
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../dropdown/Dropdown';
|
|
5
127
|
import IconEllipsis from '../icons/IconEllipsis';
|
|
6
128
|
import IconThinArrow from '../icons/IconThinArrow';
|
|
7
129
|
import { cn } from '../utils';
|
|
8
|
-
|
|
130
|
+
var BreadcrumbRoot = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
131
|
+
var props = _extends({}, _object_destructuring_empty(_param));
|
|
132
|
+
return /*#__PURE__*/ _jsx("nav", _object_spread({
|
|
133
|
+
ref: ref,
|
|
134
|
+
"aria-label": "breadcrumb"
|
|
135
|
+
}, props));
|
|
136
|
+
});
|
|
9
137
|
BreadcrumbRoot.displayName = 'BreadcrumbRoot';
|
|
10
|
-
|
|
138
|
+
var BreadcrumbList = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
139
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
140
|
+
"className"
|
|
141
|
+
]);
|
|
142
|
+
return /*#__PURE__*/ _jsx("ol", _object_spread({
|
|
143
|
+
ref: ref,
|
|
144
|
+
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)
|
|
145
|
+
}, props));
|
|
146
|
+
});
|
|
11
147
|
BreadcrumbList.displayName = 'BreadcrumbList';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
148
|
+
var BreadcrumbItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
149
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
150
|
+
"className"
|
|
151
|
+
]);
|
|
152
|
+
return /*#__PURE__*/ _jsx("li", _object_spread({
|
|
153
|
+
ref: ref,
|
|
154
|
+
//* ml-0 is to avoid padding left getting amended by global
|
|
155
|
+
className: cn('inline-flex items-center gap-2 ml-0', className)
|
|
156
|
+
}, props));
|
|
157
|
+
});
|
|
15
158
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
159
|
+
var BreadcrumbLink = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
160
|
+
var className = _param.className, asChild = _param.asChild, props = _object_without_properties(_param, [
|
|
161
|
+
"className",
|
|
162
|
+
"asChild"
|
|
163
|
+
]);
|
|
164
|
+
var Comp = asChild ? Slot : 'a';
|
|
165
|
+
return /*#__PURE__*/ _jsx(Comp, _object_spread({
|
|
166
|
+
ref: ref,
|
|
167
|
+
className: cn('text-primary3 hover:text-black dark:hover:text-zinc-50', className)
|
|
168
|
+
}, props));
|
|
19
169
|
});
|
|
20
170
|
BreadcrumbLink.displayName = 'BreadcrumbLink';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
171
|
+
var BreadcrumbPage = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
172
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
173
|
+
"className"
|
|
174
|
+
]);
|
|
175
|
+
return(// biome-ignore lint/a11y/useFocusableInteractive: Element is intentionally not focusable
|
|
176
|
+
/*#__PURE__*/ _jsx("span", _object_spread({
|
|
177
|
+
ref: ref,
|
|
178
|
+
role: "link",
|
|
179
|
+
"aria-disabled": "true",
|
|
180
|
+
"aria-current": "page",
|
|
181
|
+
className: cn('font-bold dark:text-zinc-50', className)
|
|
182
|
+
}, props)));
|
|
183
|
+
});
|
|
24
184
|
BreadcrumbPage.displayName = 'BreadcrumbPage';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
185
|
+
var BreadcrumbSeparator = function(_param) {
|
|
186
|
+
var children = _param.children, className = _param.className, props = _object_without_properties(_param, [
|
|
187
|
+
"children",
|
|
188
|
+
"className"
|
|
189
|
+
]);
|
|
190
|
+
return /*#__PURE__*/ _jsx("li", _object_spread_props(_object_spread({
|
|
191
|
+
role: "presentation",
|
|
192
|
+
"aria-hidden": "true",
|
|
193
|
+
//* ml-0 is to avoid padding left getting amended by global
|
|
194
|
+
className: cn('[&>svg]:w-3.5 [&>svg]:h-3.5 ml-0 text-black', className)
|
|
195
|
+
}, props), {
|
|
196
|
+
children: children !== null && children !== void 0 ? children : /*#__PURE__*/ _jsx(IconThinArrow, {
|
|
197
|
+
variant: "right",
|
|
198
|
+
size: "16px"
|
|
199
|
+
})
|
|
200
|
+
}));
|
|
201
|
+
};
|
|
28
202
|
BreadcrumbSeparator.displayName = 'BreadcrumbSeparator';
|
|
29
|
-
|
|
203
|
+
var BreadcrumbEllipsis = function(_param) {
|
|
204
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
205
|
+
"className"
|
|
206
|
+
]);
|
|
207
|
+
return /*#__PURE__*/ _jsxs("span", _object_spread_props(_object_spread({
|
|
208
|
+
role: "presentation",
|
|
209
|
+
"aria-hidden": "true",
|
|
210
|
+
className: cn('flex h-9 w-9 items-center justify-center', className)
|
|
211
|
+
}, props), {
|
|
212
|
+
children: [
|
|
213
|
+
/*#__PURE__*/ _jsx(IconEllipsis, {
|
|
214
|
+
size: "16px",
|
|
215
|
+
className: "rotate-90"
|
|
216
|
+
}),
|
|
217
|
+
/*#__PURE__*/ _jsx("span", {
|
|
218
|
+
className: "sr-only",
|
|
219
|
+
children: "More"
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
}));
|
|
223
|
+
};
|
|
30
224
|
BreadcrumbEllipsis.displayName = 'BreadcrumbElipssis';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
225
|
+
var Breadcrumbs = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
226
|
+
var crumbs = _param.crumbs, LinkComponent = _param.LinkComponent, tmp = _param.defaultCrumbsLength, providedCrumbsLength = tmp === void 0 ? 3 : tmp, props = _object_without_properties(_param, [
|
|
227
|
+
"crumbs",
|
|
228
|
+
"LinkComponent",
|
|
229
|
+
"defaultCrumbsLength"
|
|
230
|
+
]);
|
|
231
|
+
var defaultCrumbsLength = Math.max(2, providedCrumbsLength);
|
|
232
|
+
var tooManyCrumbs = crumbs.length > defaultCrumbsLength;
|
|
233
|
+
var trimmedCrumbs = tooManyCrumbs ? [
|
|
234
|
+
crumbs[0]
|
|
235
|
+
].concat(_to_consumable_array(crumbs.slice(-(defaultCrumbsLength - 1)))) : crumbs;
|
|
236
|
+
var FinalLinkComponent = LinkComponent !== null && LinkComponent !== void 0 ? LinkComponent : 'a';
|
|
237
|
+
return /*#__PURE__*/ _jsx(BreadcrumbRoot, _object_spread_props(_object_spread({
|
|
238
|
+
ref: ref
|
|
239
|
+
}, props), {
|
|
240
|
+
children: /*#__PURE__*/ _jsx(BreadcrumbList, {
|
|
241
|
+
children: trimmedCrumbs.map(function(crumb, i, trimmedCrumbs) {
|
|
242
|
+
var _crumb_label;
|
|
243
|
+
return /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
244
|
+
children: [
|
|
245
|
+
/*#__PURE__*/ _jsx(BreadcrumbItem, {
|
|
246
|
+
children: crumb.href ? /*#__PURE__*/ _jsx(BreadcrumbLink, {
|
|
247
|
+
href: crumb.href,
|
|
248
|
+
className: cn(i === trimmedCrumbs.length - 1 && 'text-black font-bold'),
|
|
249
|
+
asChild: !!LinkComponent,
|
|
250
|
+
children: LinkComponent ? /*#__PURE__*/ _jsx(LinkComponent, {
|
|
251
|
+
href: crumb.href,
|
|
252
|
+
children: crumb.label
|
|
253
|
+
}) : crumb.label
|
|
254
|
+
}) : /*#__PURE__*/ _jsx(BreadcrumbPage, {
|
|
255
|
+
className: cn(i === trimmedCrumbs.length - 1 && 'text-black font-bold'),
|
|
256
|
+
children: crumb.label
|
|
257
|
+
})
|
|
258
|
+
}),
|
|
259
|
+
i < trimmedCrumbs.length - 1 && /*#__PURE__*/ _jsx(BreadcrumbSeparator, {}),
|
|
260
|
+
tooManyCrumbs && i === 0 && /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
261
|
+
children: [
|
|
262
|
+
/*#__PURE__*/ _jsxs(DropdownMenu, {
|
|
263
|
+
children: [
|
|
264
|
+
/*#__PURE__*/ _jsxs(DropdownMenuTrigger, {
|
|
265
|
+
className: "flex items-center gap-1 rounded-full hover:bg-primary1",
|
|
266
|
+
children: [
|
|
267
|
+
/*#__PURE__*/ _jsx(BreadcrumbEllipsis, {
|
|
268
|
+
className: "hover:text-black cursor-pointer"
|
|
269
|
+
}),
|
|
270
|
+
/*#__PURE__*/ _jsx("span", {
|
|
271
|
+
className: "sr-only",
|
|
272
|
+
children: "Toggle menu"
|
|
273
|
+
})
|
|
274
|
+
]
|
|
275
|
+
}),
|
|
276
|
+
/*#__PURE__*/ _jsx(DropdownMenuContent, {
|
|
277
|
+
align: "start",
|
|
278
|
+
className: "tracking-wide uppercase text-sm text-primary3",
|
|
279
|
+
children: crumbs.slice(1, -(defaultCrumbsLength - 1)).map(function(leftoverCrumb) {
|
|
280
|
+
var _leftoverCrumb_label, _leftoverCrumb_label1;
|
|
281
|
+
return leftoverCrumb.href ? /*#__PURE__*/ _jsx(FinalLinkComponent, {
|
|
282
|
+
href: leftoverCrumb.href,
|
|
283
|
+
children: /*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
284
|
+
className: "text-primary3 cursor-pointer",
|
|
285
|
+
children: leftoverCrumb.label
|
|
286
|
+
})
|
|
287
|
+
}, (_leftoverCrumb_label = leftoverCrumb.label) === null || _leftoverCrumb_label === void 0 ? void 0 : _leftoverCrumb_label.toString()) : /*#__PURE__*/ _jsx(DropdownMenuItem, {
|
|
288
|
+
children: leftoverCrumb.label
|
|
289
|
+
}, (_leftoverCrumb_label1 = leftoverCrumb.label) === null || _leftoverCrumb_label1 === void 0 ? void 0 : _leftoverCrumb_label1.toString());
|
|
290
|
+
})
|
|
291
|
+
})
|
|
292
|
+
]
|
|
293
|
+
}),
|
|
294
|
+
/*#__PURE__*/ _jsx(BreadcrumbSeparator, {})
|
|
295
|
+
]
|
|
296
|
+
})
|
|
297
|
+
]
|
|
298
|
+
}, (_crumb_label = crumb.label) === null || _crumb_label === void 0 ? void 0 : _crumb_label.toString());
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
}));
|
|
41
302
|
});
|
|
42
303
|
export default Breadcrumbs;
|
|
43
|
-
export { BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis,
|
|
44
|
-
//# sourceMappingURL=Breadcrumbs.js.map
|
|
304
|
+
export { BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -1,41 +1,65 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Breadcrumbs from './Breadcrumbs.js';
|
|
3
|
-
|
|
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
|
|
11
|
-
render: ()
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export var FirstStory = {
|
|
11
|
+
render: function() {
|
|
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
|
-
|
|
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: '/
|
|
25
|
-
label: '
|
|
31
|
+
href: '/',
|
|
32
|
+
label: 'Home'
|
|
26
33
|
},
|
|
27
34
|
{
|
|
28
|
-
|
|
35
|
+
href: '/cars/malaysia',
|
|
36
|
+
label: 'Browse Car Page'
|
|
29
37
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return _jsx(Breadcrumbs, { crumbs: longCrumbs, defaultCrumbsLength: 4 });
|
|
38
|
+
{
|
|
39
|
+
href: '/cars/malaysia/proton-saga',
|
|
40
|
+
label: 'Proton Saga'
|
|
34
41
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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() {
|
|
52
|
+
return /*#__PURE__*/ _jsx(Breadcrumbs, {
|
|
53
|
+
crumbs: longCrumbs,
|
|
54
|
+
defaultCrumbsLength: 4
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export var MischievousStory = {
|
|
59
|
+
render: function() {
|
|
60
|
+
return /*#__PURE__*/ _jsx(Breadcrumbs, {
|
|
61
|
+
crumbs: longCrumbs,
|
|
62
|
+
defaultCrumbsLength: -20
|
|
63
|
+
});
|
|
64
|
+
}
|
|
40
65
|
};
|
|
41
|
-
//# sourceMappingURL=Breadcrumbs.stories.js.map
|