@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
package/dist/select/Select.js
CHANGED
|
@@ -1,4 +1,129 @@
|
|
|
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
|
+
}
|
|
2
127
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
128
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
129
|
import * as React from 'react';
|
|
@@ -8,46 +133,207 @@ import FieldWrapper from '../field-wrapper/FieldWrapper';
|
|
|
8
133
|
import HStack from '../hstack/HStack';
|
|
9
134
|
import IconSelectArrow from '../icons/IconSelectArrow';
|
|
10
135
|
import { cn } from '../utils';
|
|
11
|
-
|
|
12
|
-
|
|
136
|
+
var SelectRoot = SelectPrimitive.Root;
|
|
137
|
+
var SelectValue = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
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
|
+
});
|
|
13
151
|
SelectValue.displayName = SelectPrimitive.Value.displayName;
|
|
14
|
-
|
|
152
|
+
var SelectTrigger = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
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
|
+
});
|
|
15
173
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
16
|
-
|
|
174
|
+
var SelectScrollUpButton = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
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
|
+
});
|
|
17
187
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
188
|
+
var SelectScrollDownButton = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
189
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
190
|
+
"className"
|
|
191
|
+
]);
|
|
192
|
+
return /*#__PURE__*/ _jsx(SelectPrimitive.ScrollDownButton, _object_spread_props(_object_spread({
|
|
193
|
+
ref: ref,
|
|
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
|
+
});
|
|
24
225
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
25
|
-
|
|
226
|
+
var SelectLabel = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
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
|
+
});
|
|
26
235
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
27
|
-
|
|
236
|
+
var SelectItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
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
|
+
});
|
|
28
250
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
29
|
-
|
|
251
|
+
var SelectSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
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
|
+
});
|
|
30
260
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// for
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
261
|
+
var Select = /*#__PURE__*/ React.forwardRef(function(props, _ref) {
|
|
262
|
+
var // for wrapper
|
|
263
|
+
wrapperProps = props.wrapperProps, htmlFor = props.htmlFor, label = props.label, showRequired = props.showRequired, showOptional = props.showOptional, outerPrefix = props.outerPrefix, outerSuffix = props.outerSuffix, error = props.error, // for Select
|
|
264
|
+
providedValue = props.value, placeholder = props.placeholder, prefix = props.prefix, options = props.options, noOptionsText = props.noOptionsText, className = props.className, onChange = props.onChange, onTriggerClick = props.onTriggerClick, selectProps = _object_without_properties(props, [
|
|
265
|
+
"wrapperProps",
|
|
266
|
+
"htmlFor",
|
|
267
|
+
"label",
|
|
268
|
+
"showRequired",
|
|
269
|
+
"showOptional",
|
|
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;
|
|
40
285
|
setValue(parsedValue);
|
|
41
|
-
onChange
|
|
286
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(parsedValue);
|
|
42
287
|
};
|
|
43
|
-
React.useEffect(()
|
|
288
|
+
React.useEffect(function() {
|
|
44
289
|
setValue(providedValue);
|
|
45
|
-
}, [
|
|
46
|
-
|
|
290
|
+
}, [
|
|
291
|
+
providedValue
|
|
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) {
|
|
47
306
|
if (open) {
|
|
48
|
-
onTriggerClick
|
|
307
|
+
onTriggerClick === null || onTriggerClick === void 0 ? void 0 : onTriggerClick();
|
|
49
308
|
}
|
|
50
|
-
},
|
|
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
|
+
}));
|
|
51
338
|
});
|
|
52
339
|
export default Select;
|
|
53
|
-
//# sourceMappingURL=Select.js.map
|
|
@@ -1,40 +1,76 @@
|
|
|
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
|
+
}
|
|
1
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
27
|
import IconAccount from '../icons/IconAccount.js';
|
|
3
28
|
import Select from './Select.js';
|
|
4
|
-
|
|
5
|
-
component: Select
|
|
29
|
+
var meta = {
|
|
30
|
+
component: Select
|
|
6
31
|
};
|
|
7
32
|
export default meta;
|
|
8
|
-
export
|
|
33
|
+
export var Demo = {
|
|
9
34
|
args: {
|
|
10
35
|
htmlFor: 'fruits',
|
|
11
36
|
label: 'fruits',
|
|
12
37
|
placeholder: 'Select Fruits',
|
|
13
38
|
options: [
|
|
14
|
-
{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
39
|
+
{
|
|
40
|
+
label: 'Apple',
|
|
41
|
+
value: 'apple'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Banana',
|
|
45
|
+
value: 'banana'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Citrus',
|
|
49
|
+
value: 'citrus',
|
|
50
|
+
isDisabled: true
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
19
54
|
};
|
|
20
|
-
export
|
|
55
|
+
export var Long = {
|
|
21
56
|
args: {
|
|
22
57
|
htmlFor: 'year',
|
|
23
58
|
label: 'favourite year',
|
|
24
59
|
placeholder: 'Select Your Favourite Year',
|
|
25
|
-
prefix: _jsx(IconAccount, {}),
|
|
26
|
-
options:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
60
|
+
prefix: /*#__PURE__*/ _jsx(IconAccount, {}),
|
|
61
|
+
options: _to_consumable_array(Array(20)).map(function(_, i) {
|
|
62
|
+
return {
|
|
63
|
+
label: "".concat(2000 + i),
|
|
64
|
+
value: 2000 + i
|
|
65
|
+
};
|
|
66
|
+
})
|
|
67
|
+
}
|
|
31
68
|
};
|
|
32
|
-
export
|
|
69
|
+
export var Empty = {
|
|
33
70
|
args: {
|
|
34
71
|
htmlFor: 'fruits',
|
|
35
72
|
label: 'fruits',
|
|
36
73
|
placeholder: 'Select Fruits',
|
|
37
|
-
options: []
|
|
38
|
-
}
|
|
74
|
+
options: []
|
|
75
|
+
}
|
|
39
76
|
};
|
|
40
|
-
//# sourceMappingURL=Select.stories.js.map
|
|
@@ -1,7 +1,66 @@
|
|
|
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
|
+
}
|
|
1
56
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
57
|
import { cn } from '../utils';
|
|
3
|
-
function Skeleton(
|
|
4
|
-
|
|
58
|
+
function Skeleton(_param) {
|
|
59
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
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));
|
|
5
65
|
}
|
|
6
66
|
export default Skeleton;
|
|
7
|
-
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Skeleton from './Skeleton.js';
|
|
3
|
-
|
|
4
|
-
component: Skeleton
|
|
3
|
+
var meta = {
|
|
4
|
+
component: Skeleton
|
|
5
5
|
};
|
|
6
6
|
export default meta;
|
|
7
|
-
export
|
|
8
|
-
render: ()
|
|
9
|
-
return _jsx(Skeleton, {
|
|
10
|
-
|
|
7
|
+
export var FirstStory = {
|
|
8
|
+
render: function() {
|
|
9
|
+
return /*#__PURE__*/ _jsx(Skeleton, {
|
|
10
|
+
className: "h-64 w-64"
|
|
11
|
+
});
|
|
12
|
+
}
|
|
11
13
|
};
|
|
12
|
-
//# sourceMappingURL=Skeleton.stories.js.map
|