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