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