mautourco-components 0.2.5 → 0.2.7
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/README.md +190 -190
- package/dist/components/atoms/Avatar/Avatar.d.ts +14 -14
- package/dist/components/atoms/Avatar/Avatar.js +31 -31
- package/dist/components/atoms/Button/Button.css +320 -320
- package/dist/components/atoms/Button/Button.d.ts +27 -27
- package/dist/components/atoms/Button/Button.js +35 -35
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +13 -13
- package/dist/components/atoms/Checkbox/Checkbox.js +39 -39
- package/dist/components/atoms/Icon/Icon.d.ts +10 -10
- package/dist/components/atoms/Icon/Icon.js +123 -123
- package/dist/components/atoms/Icon/icons/ArrivalIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/ArrivalIcon.js +31 -31
- package/dist/components/atoms/Icon/icons/BuildingIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/BuildingIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/CalendarIcon.d.ts +12 -12
- package/dist/components/atoms/Icon/icons/CalendarIcon.js +41 -41
- package/dist/components/atoms/Icon/icons/CalendarOutlineIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/CalendarOutlineIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/CarIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/CarIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/Check.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/Check.js +30 -30
- package/dist/components/atoms/Icon/icons/CheckCircleIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/CheckCircleIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/Chevron.d.ts +9 -9
- package/dist/components/atoms/Icon/icons/Chevron.js +54 -54
- package/dist/components/atoms/Icon/icons/ChevronDownIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/ChevronDownIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/Close.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/Close.js +30 -30
- package/dist/components/atoms/Icon/icons/DeleteIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/DeleteIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/DepartureIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/DepartureIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/EyeIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/EyeIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/FacebookIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/FacebookIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/HomeIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/HomeIcon.js +25 -25
- package/dist/components/atoms/Icon/icons/InfoIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/InfoIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/LinkedInIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/LinkedInIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/MapPinIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/MapPinIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/MautoucoLogo.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/MautoucoLogo.js +37 -37
- package/dist/components/atoms/Icon/icons/MenuIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/MenuIcon.js +37 -37
- package/dist/components/atoms/Icon/icons/MinusIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/MinusIcon.js +25 -25
- package/dist/components/atoms/Icon/icons/MoreIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/MoreIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/PlaneIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/PlaneIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/PlusIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/PlusIcon.js +25 -25
- package/dist/components/atoms/Icon/icons/Search.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/Search.js +30 -30
- package/dist/components/atoms/Icon/icons/Settings.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/Settings.js +30 -30
- package/dist/components/atoms/Icon/icons/ShipIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/ShipIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/StrollerIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/StrollerIcon.js +30 -30
- package/dist/components/atoms/Icon/icons/TwitterIcon.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/TwitterIcon.js +36 -36
- package/dist/components/atoms/Icon/icons/User.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/User.js +30 -30
- package/dist/components/atoms/Icon/icons/UserIcon.d.ts +12 -12
- package/dist/components/atoms/Icon/icons/UserIcon.js +41 -41
- package/dist/components/atoms/Icon/icons/Youtube.d.ts +8 -8
- package/dist/components/atoms/Icon/icons/Youtube.js +36 -36
- package/dist/components/atoms/Illustration/Illustration.d.ts +14 -14
- package/dist/components/atoms/Illustration/Illustration.js +33 -33
- package/dist/components/atoms/Illustration/illustrations.d.ts +51 -51
- package/dist/components/atoms/Illustration/illustrations.js +97 -97
- package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.d.ts +12 -12
- package/dist/components/atoms/Inputs/DropdownInput/DropdownInput.js +53 -53
- package/dist/components/atoms/Inputs/Input/Input.d.ts +15 -15
- package/dist/components/atoms/Inputs/Input/Input.js +27 -27
- package/dist/components/atoms/Inputs/Textarea/Textarea.d.ts +14 -14
- package/dist/components/atoms/Inputs/Textarea/Textarea.js +15 -15
- package/dist/components/atoms/Link/Link.d.ts +44 -44
- package/dist/components/atoms/Link/Link.js +76 -76
- package/dist/components/atoms/RatingStar/RatingStar.d.ts +40 -40
- package/dist/components/atoms/RatingStar/RatingStar.js +54 -54
- package/dist/components/atoms/SegmentedButton/SegmentedButton.d.ts +27 -27
- package/dist/components/atoms/SegmentedButton/SegmentedButton.js +49 -49
- package/dist/components/atoms/SelectedValue/SelectedValue.d.ts +11 -11
- package/dist/components/atoms/SelectedValue/SelectedValue.js +29 -29
- package/dist/components/atoms/Slider/Slider.d.ts +52 -52
- package/dist/components/atoms/Slider/Slider.js +30 -30
- package/dist/components/atoms/Spinner/Spinner.d.ts +9 -9
- package/dist/components/atoms/Spinner/Spinner.js +38 -38
- package/dist/components/atoms/Spinner/variants/ButtonSpinner.d.ts +8 -8
- package/dist/components/atoms/Spinner/variants/ButtonSpinner.js +19 -19
- package/dist/components/atoms/Spinner/variants/LoadingSpinner.d.ts +7 -7
- package/dist/components/atoms/Spinner/variants/LoadingSpinner.js +7 -7
- package/dist/components/atoms/Tab/Tab.css +266 -266
- package/dist/components/atoms/Tab/Tab.d.ts +22 -22
- package/dist/components/atoms/Tab/Tab.js +54 -54
- package/dist/components/atoms/Typography/Typography.d.ts +24 -24
- package/dist/components/atoms/Typography/Typography.js +100 -100
- package/dist/components/molecules/Calendar/CalendarInput.d.ts +34 -34
- package/dist/components/molecules/Calendar/CalendarInput.js +49 -49
- package/dist/components/molecules/Calendar/DateTime.d.ts +25 -25
- package/dist/components/molecules/Calendar/DateTime.js +106 -106
- package/dist/components/molecules/Calendar/TimePicker.d.ts +16 -16
- package/dist/components/molecules/Calendar/TimePicker.js +91 -91
- package/dist/components/molecules/LocationDropdown/LocationDropdown.d.ts +34 -34
- package/dist/components/molecules/LocationDropdown/LocationDropdown.js +120 -120
- package/dist/components/molecules/LocationDropdown/index.d.ts +2 -2
- package/dist/components/molecules/LocationDropdown/index.js +1 -1
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +29 -29
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +106 -106
- package/dist/components/molecules/RatingTab/RatingTab.d.ts +39 -39
- package/dist/components/molecules/RatingTab/RatingTab.js +41 -41
- package/dist/components/molecules/TabGroup/TabGroup.d.ts +17 -17
- package/dist/components/molecules/TabGroup/TabGroup.js +30 -30
- package/dist/components/molecules/UserCard/UserCard.d.ts +20 -20
- package/dist/components/molecules/UserCard/UserCard.js +57 -57
- package/dist/components/organisms/CardContainer/CardContainer.d.ts +37 -37
- package/dist/components/organisms/CardContainer/CardContainer.js +27 -27
- package/dist/components/organisms/DateTimePicker/DateTimePicker.d.ts +15 -15
- package/dist/components/organisms/DateTimePicker/DateTimePicker.js +66 -66
- package/dist/components/organisms/Dialog/Dialog.d.ts +103 -103
- package/dist/components/organisms/Dialog/Dialog.js +162 -162
- package/dist/components/organisms/Footer/Footer.d.ts +38 -38
- package/dist/components/organisms/Footer/Footer.js +74 -74
- package/dist/components/organisms/PaxSelector/PaxSelector.d.ts +63 -63
- package/dist/components/organisms/PaxSelector/PaxSelector.js +402 -402
- package/dist/components/organisms/RoundTrip/RoundTrip.d.ts +54 -54
- package/dist/components/organisms/RoundTrip/RoundTrip.js +179 -179
- package/dist/components/organisms/RoundTrip/index.d.ts +2 -2
- package/dist/components/organisms/RoundTrip/index.js +1 -1
- package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.d.ts +35 -35
- package/dist/components/organisms/SearchBarTransfer/SearchBarTransfer.js +192 -192
- package/dist/components/organisms/SearchBarTransfer/index.d.ts +2 -2
- package/dist/components/organisms/SearchBarTransfer/index.js +1 -1
- package/dist/components/organisms/TopNavigation/DesktopNav.d.ts +33 -33
- package/dist/components/organisms/TopNavigation/DesktopNav.js +32 -32
- package/dist/components/organisms/TopNavigation/MobileNav.d.ts +32 -32
- package/dist/components/organisms/TopNavigation/MobileNav.js +45 -45
- package/dist/components/organisms/TopNavigation/TopNavigation.d.ts +33 -33
- package/dist/components/organisms/TopNavigation/TopNavigation.js +20 -20
- package/dist/components/organisms/TransferLine/TransferLine.d.ts +53 -53
- package/dist/components/organisms/TransferLine/TransferLine.js +179 -179
- package/dist/components/ui/button.d.ts +10 -10
- package/dist/components/ui/button.js +56 -56
- package/dist/components/ui/calendar.d.ts +8 -8
- package/dist/components/ui/calendar.js +87 -87
- package/dist/components/ui/popover.d.ts +7 -7
- package/dist/components/ui/popover.js +42 -42
- package/dist/hooks/useMobile.d.ts +5 -5
- package/dist/hooks/useMobile.js +26 -26
- package/dist/index.d.ts +49 -49
- package/dist/index.js +46 -46
- package/dist/lib/utils.d.ts +7 -7
- package/dist/lib/utils.js +13 -13
- package/dist/styles/components/avatar.css +122 -122
- package/dist/styles/components/calendar.css +140 -140
- package/dist/styles/components/checkbox.css +206 -206
- package/dist/styles/components/dropdown.css +269 -269
- package/dist/styles/components/forms.css +209 -209
- package/dist/styles/components/illustration.css +123 -123
- package/dist/styles/components/molecule/calendarInput.css +133 -133
- package/dist/styles/components/molecule/dateTime.css +126 -126
- package/dist/styles/components/molecule/location-dropdown.css +132 -132
- package/dist/styles/components/molecule/timePicker.css +122 -122
- package/dist/styles/components/multiselect-dropdown.css +286 -286
- package/dist/styles/components/organism/card-container.css +148 -148
- package/dist/styles/components/organism/dialog.css +168 -168
- package/dist/styles/components/organism/footer.css +119 -119
- package/dist/styles/components/organism/pax-selector.css +617 -617
- package/dist/styles/components/organism/round-trip.css +139 -139
- package/dist/styles/components/organism/search-bar-transfer.css +158 -161
- package/dist/styles/components/organism/topnavigation.css +142 -142
- package/dist/styles/components/organism/transfer-line.css +138 -138
- package/dist/styles/components/rating-star.css +145 -145
- package/dist/styles/components/rating-tab.css +179 -179
- package/dist/styles/components/scrollbar.css +155 -155
- package/dist/styles/components/segmented-button.css +214 -214
- package/dist/styles/components/selected-value.css +175 -175
- package/dist/styles/components/slider.css +182 -182
- package/dist/styles/components/typography.css +245 -245
- package/dist/styles/tokens/tokens.css +119 -119
- package/dist/styles/tokens/tokens.d.ts +3108 -3108
- package/dist/styles/tokens/tokens.js +2652 -2652
- package/package.json +103 -103
- package/src/components/atoms/Avatar/Avatar.tsx +60 -60
- package/src/components/atoms/Button/Button.css +200 -200
- package/src/components/atoms/Button/Button.tsx +82 -82
- package/src/components/atoms/Checkbox/Checkbox.tsx +83 -83
- package/src/components/atoms/Icon/Icon.tsx +163 -163
- package/src/components/atoms/Icon/icons/ArrivalIcon.tsx +52 -52
- package/src/components/atoms/Icon/icons/BuildingIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/CalendarIcon.tsx +63 -63
- package/src/components/atoms/Icon/icons/CalendarOutlineIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/CarIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/Check.tsx +36 -36
- package/src/components/atoms/Icon/icons/CheckCircleIcon.tsx +48 -48
- package/src/components/atoms/Icon/icons/Chevron.tsx +73 -73
- package/src/components/atoms/Icon/icons/ChevronDownIcon.tsx +46 -46
- package/src/components/atoms/Icon/icons/Close.tsx +39 -39
- package/src/components/atoms/Icon/icons/DeleteIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/DepartureIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/EyeIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/FacebookIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/HomeIcon.tsx +52 -52
- package/src/components/atoms/Icon/icons/InfoIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/LinkedInIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/MapPinIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/MautoucoLogo.tsx +93 -93
- package/src/components/atoms/Icon/icons/MenuIcon.tsx +49 -49
- package/src/components/atoms/Icon/icons/MinusIcon.tsx +45 -45
- package/src/components/atoms/Icon/icons/MoreIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/PlaneIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/PlusIcon.tsx +45 -45
- package/src/components/atoms/Icon/icons/Search.tsx +37 -37
- package/src/components/atoms/Icon/icons/Settings.tsx +38 -38
- package/src/components/atoms/Icon/icons/ShipIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/StrollerIcon.tsx +44 -44
- package/src/components/atoms/Icon/icons/TwitterIcon.tsx +50 -50
- package/src/components/atoms/Icon/icons/User.tsx +37 -37
- package/src/components/atoms/Icon/icons/UserIcon.tsx +63 -63
- package/src/components/atoms/Icon/icons/Youtube.tsx +50 -50
- package/src/components/atoms/Illustration/Illustration.tsx +28 -28
- package/src/components/atoms/Illustration/illustrations.ts +116 -116
- package/src/components/atoms/Inputs/DropdownInput/DropdownInput.tsx +96 -96
- package/src/components/atoms/Inputs/Textarea/Textarea.tsx +51 -51
- package/src/components/atoms/Link/Link.tsx +168 -168
- package/src/components/atoms/RatingStar/RatingStar.tsx +114 -114
- package/src/components/atoms/SegmentedButton/SegmentedButton.tsx +94 -94
- package/src/components/atoms/SelectedValue/SelectedValue.tsx +59 -59
- package/src/components/atoms/Slider/Slider.tsx +95 -95
- package/src/components/atoms/Spinner/Spinner.tsx +56 -56
- package/src/components/atoms/Spinner/variants/ButtonSpinner.tsx +37 -37
- package/src/components/atoms/Spinner/variants/LoadingSpinner.tsx +22 -22
- package/src/components/atoms/Tab/Tab.css +147 -147
- package/src/components/atoms/Tab/Tab.tsx +96 -96
- package/src/components/atoms/Typography/Typography.tsx +153 -153
- package/src/components/molecules/Calendar/CalendarInput.tsx +135 -135
- package/src/components/molecules/Calendar/DateTime.tsx +172 -172
- package/src/components/molecules/Calendar/TimePicker.tsx +174 -174
- package/src/components/molecules/LocationDropdown/LocationDropdown.tsx +234 -234
- package/src/components/molecules/LocationDropdown/index.ts +2 -2
- package/src/components/molecules/RatingTab/RatingTab.tsx +96 -96
- package/src/components/molecules/TabGroup/TabGroup.tsx +60 -60
- package/src/components/molecules/UserCard/UserCard.stories.tsx +36 -36
- package/src/components/molecules/UserCard/UserCard.tsx +173 -173
- package/src/components/organisms/CardContainer/CardContainer.tsx +66 -66
- package/src/components/organisms/DateTimePicker/DateTimePicker.tsx +110 -110
- package/src/components/organisms/Dialog/Dialog.tsx +352 -352
- package/src/components/organisms/Footer/Footer.tsx +290 -290
- package/src/components/organisms/PaxSelector/PaxSelector.tsx +979 -979
- package/src/components/organisms/RoundTrip/RoundTrip.tsx +335 -335
- package/src/components/organisms/RoundTrip/index.ts +2 -2
- package/src/components/organisms/SearchBarTransfer/SearchBarTransfer.tsx +388 -388
- package/src/components/organisms/SearchBarTransfer/index.ts +2 -2
- package/src/components/organisms/TopNavigation/DesktopNav.tsx +133 -133
- package/src/components/organisms/TopNavigation/MobileNav.tsx +212 -212
- package/src/components/organisms/TopNavigation/TopNavigation.tsx +45 -45
- package/src/components/organisms/TransferLine/TransferLine.tsx +369 -369
- package/src/components/ui/button.tsx +60 -60
- package/src/components/ui/calendar.tsx +246 -246
- package/src/components/ui/popover.tsx +46 -46
- package/src/styles/components/avatar.css +58 -58
- package/src/styles/components/calendar.css +85 -85
- package/src/styles/components/checkbox.css +130 -130
- package/src/styles/components/dropdown.css +214 -214
- package/src/styles/components/forms.css +147 -147
- package/src/styles/components/illustration.css +7 -7
- package/src/styles/components/molecule/calendarInput.css +156 -156
- package/src/styles/components/molecule/dateTime.css +14 -14
- package/src/styles/components/molecule/location-dropdown.css +204 -204
- package/src/styles/components/molecule/timePicker.css +78 -78
- package/src/styles/components/multiselect-dropdown.css +230 -230
- package/src/styles/components/organism/card-container.css +49 -49
- package/src/styles/components/organism/dialog.css +241 -241
- package/src/styles/components/organism/footer.css +113 -113
- package/src/styles/components/organism/pax-selector.css +702 -702
- package/src/styles/components/organism/round-trip.css +55 -55
- package/src/styles/components/organism/search-bar-transfer.css +128 -127
- package/src/styles/components/organism/topnavigation.css +161 -161
- package/src/styles/components/organism/transfer-line.css +86 -86
- package/src/styles/components/rating-star.css +39 -39
- package/src/styles/components/rating-tab.css +83 -83
- package/src/styles/components/scrollbar.css +63 -63
- package/src/styles/components/segmented-button.css +134 -134
- package/src/styles/components/selected-value.css +80 -80
- package/src/styles/components/slider.css +86 -86
- package/src/styles/components/typography.css +251 -251
- package/src/styles/fonts.css +50 -0
- package/src/styles/tokens/tokens.css +119 -119
- package/src/styles/tokens/tokens.js +12 -6
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import Check from '../../atoms/Icon/icons/Check';
|
|
14
|
-
import { Text } from '../../atoms/Typography/Typography';
|
|
15
|
-
import RatingStar from '../../atoms/RatingStar/RatingStar';
|
|
16
|
-
/**
|
|
17
|
-
* RatingTab molecule
|
|
18
|
-
*
|
|
19
|
-
* Combines a checkbox-like selector, a label and the RatingStar atom.
|
|
20
|
-
* Used for filters like "5 stars", "4 stars", etc.
|
|
21
|
-
*/
|
|
22
|
-
var RatingTab = function (_a) {
|
|
23
|
-
var label = _a.label, ratingValue = _a.ratingValue, _b = _a.maxStars, maxStars = _b === void 0 ? 5 : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? '' : _e;
|
|
24
|
-
var handleToggle = function () {
|
|
25
|
-
if (disabled || !onChange)
|
|
26
|
-
return;
|
|
27
|
-
onChange(!checked);
|
|
28
|
-
};
|
|
29
|
-
var handleKeyDown = function (event) {
|
|
30
|
-
if (disabled || !onChange)
|
|
31
|
-
return;
|
|
32
|
-
if (event.key === ' ' || event.key === 'Enter') {
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
onChange(!checked);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var stateClass = disabled ? 'rating-tab--disabled' : checked ? 'rating-tab--active' : 'rating-tab--default';
|
|
38
|
-
var containerClasses = ['rating-tab', stateClass, className].filter(Boolean).join(' ');
|
|
39
|
-
return (_jsxs("div", __assign({ className: containerClasses, role: "checkbox", "aria-checked": checked, "aria-disabled": disabled, tabIndex: disabled ? -1 : 0, onClick: handleToggle, onKeyDown: handleKeyDown }, { children: [_jsxs("div", __assign({ className: "rating-tab__left" }, { children: [_jsx("div", __assign({ className: "rating-tab__checkbox" }, { children: checked && _jsx(Check, { size: "sm", className: "rating-tab__checkbox-icon" }) })), _jsx(Text, __assign({ size: "sm", className: "rating-tab__label" }, { children: label }))] })), _jsx(RatingStar, { value: ratingValue, max: maxStars })] })));
|
|
40
|
-
};
|
|
41
|
-
export default RatingTab;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import Check from '../../atoms/Icon/icons/Check';
|
|
14
|
+
import { Text } from '../../atoms/Typography/Typography';
|
|
15
|
+
import RatingStar from '../../atoms/RatingStar/RatingStar';
|
|
16
|
+
/**
|
|
17
|
+
* RatingTab molecule
|
|
18
|
+
*
|
|
19
|
+
* Combines a checkbox-like selector, a label and the RatingStar atom.
|
|
20
|
+
* Used for filters like "5 stars", "4 stars", etc.
|
|
21
|
+
*/
|
|
22
|
+
var RatingTab = function (_a) {
|
|
23
|
+
var label = _a.label, ratingValue = _a.ratingValue, _b = _a.maxStars, maxStars = _b === void 0 ? 5 : _b, _c = _a.checked, checked = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? '' : _e;
|
|
24
|
+
var handleToggle = function () {
|
|
25
|
+
if (disabled || !onChange)
|
|
26
|
+
return;
|
|
27
|
+
onChange(!checked);
|
|
28
|
+
};
|
|
29
|
+
var handleKeyDown = function (event) {
|
|
30
|
+
if (disabled || !onChange)
|
|
31
|
+
return;
|
|
32
|
+
if (event.key === ' ' || event.key === 'Enter') {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
onChange(!checked);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var stateClass = disabled ? 'rating-tab--disabled' : checked ? 'rating-tab--active' : 'rating-tab--default';
|
|
38
|
+
var containerClasses = ['rating-tab', stateClass, className].filter(Boolean).join(' ');
|
|
39
|
+
return (_jsxs("div", __assign({ className: containerClasses, role: "checkbox", "aria-checked": checked, "aria-disabled": disabled, tabIndex: disabled ? -1 : 0, onClick: handleToggle, onKeyDown: handleKeyDown }, { children: [_jsxs("div", __assign({ className: "rating-tab__left" }, { children: [_jsx("div", __assign({ className: "rating-tab__checkbox" }, { children: checked && _jsx(Check, { size: "sm", className: "rating-tab__checkbox-icon" }) })), _jsx(Text, __assign({ size: "sm", className: "rating-tab__label" }, { children: label }))] })), _jsx(RatingStar, { value: ratingValue, max: maxStars })] })));
|
|
40
|
+
};
|
|
41
|
+
export default RatingTab;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { TabProps } from '../../atoms/Tab/Tab';
|
|
2
|
-
export type TabItem<T = string> = {
|
|
3
|
-
label: string;
|
|
4
|
-
value: T;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export interface TabGroupProps<T = string> {
|
|
8
|
-
items: TabItem<T>[];
|
|
9
|
-
size?: TabProps['size'];
|
|
10
|
-
variant?: TabProps['variant'];
|
|
11
|
-
active?: T;
|
|
12
|
-
defaultActive?: T;
|
|
13
|
-
onChange?: (value: T) => void;
|
|
14
|
-
className?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function TabGroup<T = string>({ items, size, variant, active, defaultActive, onChange, className, }: TabGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default TabGroup;
|
|
1
|
+
import { TabProps } from '../../atoms/Tab/Tab';
|
|
2
|
+
export type TabItem<T = string> = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: T;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface TabGroupProps<T = string> {
|
|
8
|
+
items: TabItem<T>[];
|
|
9
|
+
size?: TabProps['size'];
|
|
10
|
+
variant?: TabProps['variant'];
|
|
11
|
+
active?: T;
|
|
12
|
+
defaultActive?: T;
|
|
13
|
+
onChange?: (value: T) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function TabGroup<T = string>({ items, size, variant, active, defaultActive, onChange, className, }: TabGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export default TabGroup;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import React from 'react';
|
|
14
|
-
import Tab from '../../atoms/Tab/Tab';
|
|
15
|
-
export function TabGroup(_a) {
|
|
16
|
-
var _b;
|
|
17
|
-
var items = _a.items, _c = _a.size, size = _c === void 0 ? 'lg' : _c, _d = _a.variant, variant = _d === void 0 ? 'inline' : _d, active = _a.active, defaultActive = _a.defaultActive, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? '' : _e;
|
|
18
|
-
var _f = React.useState(defaultActive !== null && defaultActive !== void 0 ? defaultActive : (_b = items[0]) === null || _b === void 0 ? void 0 : _b.value), internalActive = _f[0], setInternalActive = _f[1];
|
|
19
|
-
var isControlled = active !== undefined;
|
|
20
|
-
var current = (isControlled ? active : internalActive);
|
|
21
|
-
var handleClick = function (item) {
|
|
22
|
-
if (item.disabled)
|
|
23
|
-
return;
|
|
24
|
-
if (!isControlled)
|
|
25
|
-
setInternalActive(item.value);
|
|
26
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(item.value);
|
|
27
|
-
};
|
|
28
|
-
return (_jsx("div", __assign({ className: "tab-group flex ".concat(className), role: "tablist" }, { children: items.map(function (it) { return (_jsx(Tab, __assign({ isActive: current === it.value, size: size, variant: variant, disabled: it.disabled, onClick: function () { return handleClick(it); } }, { children: it.label }), String(it.value))); }) })));
|
|
29
|
-
}
|
|
30
|
-
export default TabGroup;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import Tab from '../../atoms/Tab/Tab';
|
|
15
|
+
export function TabGroup(_a) {
|
|
16
|
+
var _b;
|
|
17
|
+
var items = _a.items, _c = _a.size, size = _c === void 0 ? 'lg' : _c, _d = _a.variant, variant = _d === void 0 ? 'inline' : _d, active = _a.active, defaultActive = _a.defaultActive, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? '' : _e;
|
|
18
|
+
var _f = React.useState(defaultActive !== null && defaultActive !== void 0 ? defaultActive : (_b = items[0]) === null || _b === void 0 ? void 0 : _b.value), internalActive = _f[0], setInternalActive = _f[1];
|
|
19
|
+
var isControlled = active !== undefined;
|
|
20
|
+
var current = (isControlled ? active : internalActive);
|
|
21
|
+
var handleClick = function (item) {
|
|
22
|
+
if (item.disabled)
|
|
23
|
+
return;
|
|
24
|
+
if (!isControlled)
|
|
25
|
+
setInternalActive(item.value);
|
|
26
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(item.value);
|
|
27
|
+
};
|
|
28
|
+
return (_jsx("div", __assign({ className: "tab-group flex ".concat(className), role: "tablist" }, { children: items.map(function (it) { return (_jsx(Tab, __assign({ isActive: current === it.value, size: size, variant: variant, disabled: it.disabled, onClick: function () { return handleClick(it); } }, { children: it.label }), String(it.value))); }) })));
|
|
29
|
+
}
|
|
30
|
+
export default TabGroup;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
type User = {
|
|
3
|
-
name: string;
|
|
4
|
-
agency: string;
|
|
5
|
-
isAdmin: boolean;
|
|
6
|
-
};
|
|
7
|
-
type Agency = {
|
|
8
|
-
id: number;
|
|
9
|
-
name: string;
|
|
10
|
-
localisation: string;
|
|
11
|
-
};
|
|
12
|
-
export interface UserCardProps {
|
|
13
|
-
user: User;
|
|
14
|
-
agencies: Agency[];
|
|
15
|
-
onSelectAgency?: (agency: Agency) => void;
|
|
16
|
-
selectedAgency?: Agency;
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const UserCard: React.FC<UserCardProps>;
|
|
20
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
type User = {
|
|
3
|
+
name: string;
|
|
4
|
+
agency: string;
|
|
5
|
+
isAdmin: boolean;
|
|
6
|
+
};
|
|
7
|
+
type Agency = {
|
|
8
|
+
id: number;
|
|
9
|
+
name: string;
|
|
10
|
+
localisation: string;
|
|
11
|
+
};
|
|
12
|
+
export interface UserCardProps {
|
|
13
|
+
user: User;
|
|
14
|
+
agencies: Agency[];
|
|
15
|
+
onSelectAgency?: (agency: Agency) => void;
|
|
16
|
+
selectedAgency?: Agency;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const UserCard: React.FC<UserCardProps>;
|
|
20
|
+
export {};
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
14
|
-
import { Avatar } from "../../atoms/Avatar/Avatar";
|
|
15
|
-
export var UserCard = function (_a) {
|
|
16
|
-
var user = _a.user, agencies = _a.agencies, onSelectAgency = _a.onSelectAgency, selectedAgency = _a.selectedAgency, _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
17
|
-
var _c = useState(false), open = _c[0], setOpen = _c[1];
|
|
18
|
-
var _d = useState(""), query = _d[0], setQuery = _d[1];
|
|
19
|
-
var rootRef = useRef(null);
|
|
20
|
-
var searchRef = useRef(null);
|
|
21
|
-
// Close dropdown on outside click
|
|
22
|
-
useEffect(function () {
|
|
23
|
-
if (!user.isAdmin || !open)
|
|
24
|
-
return;
|
|
25
|
-
var handleClickOutside = function (e) {
|
|
26
|
-
var _a;
|
|
27
|
-
if (!((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)))
|
|
28
|
-
setOpen(false);
|
|
29
|
-
};
|
|
30
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
31
|
-
return function () { return document.removeEventListener("mousedown", handleClickOutside); };
|
|
32
|
-
}, [open, user.isAdmin]);
|
|
33
|
-
// Auto-focus search input when dropdown opens
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
if (user.isAdmin && open)
|
|
36
|
-
setTimeout(function () { var _a; return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 0);
|
|
37
|
-
}, [open, user.isAdmin]);
|
|
38
|
-
// Filter agencies based on query
|
|
39
|
-
var filteredAgencies = useMemo(function () {
|
|
40
|
-
var q = query.trim().toLowerCase();
|
|
41
|
-
if (!q)
|
|
42
|
-
return agencies;
|
|
43
|
-
return agencies.filter(function (a) {
|
|
44
|
-
return a.name.toLowerCase().includes(q) ||
|
|
45
|
-
a.localisation.toLowerCase().includes(q);
|
|
46
|
-
});
|
|
47
|
-
}, [agencies, query]);
|
|
48
|
-
var handleSelect = function (a) {
|
|
49
|
-
onSelectAgency === null || onSelectAgency === void 0 ? void 0 : onSelectAgency(a);
|
|
50
|
-
setOpen(false);
|
|
51
|
-
setQuery("");
|
|
52
|
-
};
|
|
53
|
-
return (_jsxs("div", __assign({ ref: rootRef, className: "relative inline-flex items-center gap-3 ".concat(className, " ").concat(user.isAdmin ? "cursor-pointer rounded-[11px] border border-[#D9D9D9] bg-white px-[13px] py-2" : "") }, { children: [_jsxs("div", __assign({ className: "flex items-center gap-3" }, { children: [_jsx(Avatar, { name: user.name, size: "md", shape: "circle" }), _jsxs("div", __assign({ className: "flex flex-col leading-tight" }, { children: [_jsxs("div", __assign({ className: "text-[13px] text-muted-foreground" }, { children: ["Welcome back,", " ", _jsx("span", __assign({ className: "font-medium text-foreground" }, { children: user.name })), " ", _jsx("span", __assign({ "aria-hidden": true }, { children: "\uD83D\uDC4B" }))] })), _jsx("div", __assign({ className: "text-[13px] font-semibold text-foreground" }, { children: selectedAgency ? selectedAgency.name : user.agency }))] }))] })), user.isAdmin && (_jsxs(_Fragment, { children: [_jsx("button", __assign({ type: "button", "aria-expanded": open, "aria-haspopup": "listbox", onClick: function () { return setOpen(function (v) { return !v; }); }, className: "inline-flex h-8 w-8 items-center justify-center rounded-lg bg-teal-600 text-white shadow-[0_2px_6px_rgba(0,0,0,0.15)] outline-none focus-visible:ring-2 focus-visible:ring-teal-300", title: "Open agency selector" }, { children: _jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": "true", className: "transition-transform ".concat(open ? "rotate-180" : "") }, { children: _jsx("path", { d: "M6 9l6 6 6-6", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) })), open && (_jsxs("div", __assign({ className: "absolute right-0 top-12 z-50 w-[340px] rounded-2xl border border-black/5 bg-white p-3 shadow-[0_12px_30px_rgba(0,0,0,0.15)]" }, { children: [_jsxs("div", __assign({ className: "relative mb-3" }, { children: [_jsx("input", { ref: searchRef, value: query, onChange: function (e) { return setQuery(e.target.value); }, placeholder: "Search", className: "w-full rounded-xl border border-black/10 bg-white px-10 py-2 text-sm outline-none focus:border-black/20 shadow-[inset_0_1px_2px_rgba(0,0,0,0.06)]" }), _jsx("div", __assign({ className: "absolute -translate-y-1/2 pointer-events-none left-3 top-1/2" }, { children: _jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 24 24" }, { children: _jsx("path", { d: "M21 21l-4.3-4.3M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15z", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) })) }))] })), _jsxs("ul", __assign({ role: "listbox", className: "pr-1 overflow-auto max-h-64" }, { children: [filteredAgencies.map(function (a) {
|
|
54
|
-
var isActive = (selectedAgency === null || selectedAgency === void 0 ? void 0 : selectedAgency.id) === a.id;
|
|
55
|
-
return (_jsx("li", { children: _jsxs("button", __assign({ type: "button", onClick: function () { return handleSelect(a); }, className: "flex w-full items-center justify-between gap-3 rounded-lg px-2 py-2 text-left hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-teal-300 ".concat(isActive ? "bg-black/[0.04]" : ""), "aria-selected": isActive, role: "option" }, { children: [_jsx("span", __assign({ className: "text-[14px]" }, { children: a.name })), _jsx("span", __assign({ className: "text-[13px] font-semibold" }, { children: a.localisation }))] })) }, a.id));
|
|
56
|
-
}), filteredAgencies.length === 0 && (_jsx("li", __assign({ className: "px-2 py-6 text-sm text-center text-muted-foreground" }, { children: "No results" })))] }))] })))] }))] })));
|
|
57
|
-
};
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
14
|
+
import { Avatar } from "../../atoms/Avatar/Avatar";
|
|
15
|
+
export var UserCard = function (_a) {
|
|
16
|
+
var user = _a.user, agencies = _a.agencies, onSelectAgency = _a.onSelectAgency, selectedAgency = _a.selectedAgency, _b = _a.className, className = _b === void 0 ? "" : _b;
|
|
17
|
+
var _c = useState(false), open = _c[0], setOpen = _c[1];
|
|
18
|
+
var _d = useState(""), query = _d[0], setQuery = _d[1];
|
|
19
|
+
var rootRef = useRef(null);
|
|
20
|
+
var searchRef = useRef(null);
|
|
21
|
+
// Close dropdown on outside click
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
if (!user.isAdmin || !open)
|
|
24
|
+
return;
|
|
25
|
+
var handleClickOutside = function (e) {
|
|
26
|
+
var _a;
|
|
27
|
+
if (!((_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)))
|
|
28
|
+
setOpen(false);
|
|
29
|
+
};
|
|
30
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
31
|
+
return function () { return document.removeEventListener("mousedown", handleClickOutside); };
|
|
32
|
+
}, [open, user.isAdmin]);
|
|
33
|
+
// Auto-focus search input when dropdown opens
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
if (user.isAdmin && open)
|
|
36
|
+
setTimeout(function () { var _a; return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 0);
|
|
37
|
+
}, [open, user.isAdmin]);
|
|
38
|
+
// Filter agencies based on query
|
|
39
|
+
var filteredAgencies = useMemo(function () {
|
|
40
|
+
var q = query.trim().toLowerCase();
|
|
41
|
+
if (!q)
|
|
42
|
+
return agencies;
|
|
43
|
+
return agencies.filter(function (a) {
|
|
44
|
+
return a.name.toLowerCase().includes(q) ||
|
|
45
|
+
a.localisation.toLowerCase().includes(q);
|
|
46
|
+
});
|
|
47
|
+
}, [agencies, query]);
|
|
48
|
+
var handleSelect = function (a) {
|
|
49
|
+
onSelectAgency === null || onSelectAgency === void 0 ? void 0 : onSelectAgency(a);
|
|
50
|
+
setOpen(false);
|
|
51
|
+
setQuery("");
|
|
52
|
+
};
|
|
53
|
+
return (_jsxs("div", __assign({ ref: rootRef, className: "relative inline-flex items-center gap-3 ".concat(className, " ").concat(user.isAdmin ? "cursor-pointer rounded-[11px] border border-[#D9D9D9] bg-white px-[13px] py-2" : "") }, { children: [_jsxs("div", __assign({ className: "flex items-center gap-3" }, { children: [_jsx(Avatar, { name: user.name, size: "md", shape: "circle" }), _jsxs("div", __assign({ className: "flex flex-col leading-tight" }, { children: [_jsxs("div", __assign({ className: "text-[13px] text-muted-foreground" }, { children: ["Welcome back,", " ", _jsx("span", __assign({ className: "font-medium text-foreground" }, { children: user.name })), " ", _jsx("span", __assign({ "aria-hidden": true }, { children: "\uD83D\uDC4B" }))] })), _jsx("div", __assign({ className: "text-[13px] font-semibold text-foreground" }, { children: selectedAgency ? selectedAgency.name : user.agency }))] }))] })), user.isAdmin && (_jsxs(_Fragment, { children: [_jsx("button", __assign({ type: "button", "aria-expanded": open, "aria-haspopup": "listbox", onClick: function () { return setOpen(function (v) { return !v; }); }, className: "inline-flex h-8 w-8 items-center justify-center rounded-lg bg-teal-600 text-white shadow-[0_2px_6px_rgba(0,0,0,0.15)] outline-none focus-visible:ring-2 focus-visible:ring-teal-300", title: "Open agency selector" }, { children: _jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 24 24", "aria-hidden": "true", className: "transition-transform ".concat(open ? "rotate-180" : "") }, { children: _jsx("path", { d: "M6 9l6 6 6-6", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })) })), open && (_jsxs("div", __assign({ className: "absolute right-0 top-12 z-50 w-[340px] rounded-2xl border border-black/5 bg-white p-3 shadow-[0_12px_30px_rgba(0,0,0,0.15)]" }, { children: [_jsxs("div", __assign({ className: "relative mb-3" }, { children: [_jsx("input", { ref: searchRef, value: query, onChange: function (e) { return setQuery(e.target.value); }, placeholder: "Search", className: "w-full rounded-xl border border-black/10 bg-white px-10 py-2 text-sm outline-none focus:border-black/20 shadow-[inset_0_1px_2px_rgba(0,0,0,0.06)]" }), _jsx("div", __assign({ className: "absolute -translate-y-1/2 pointer-events-none left-3 top-1/2" }, { children: _jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 24 24" }, { children: _jsx("path", { d: "M21 21l-4.3-4.3M10.5 18a7.5 7.5 0 1 1 0-15 7.5 7.5 0 0 1 0 15z", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) })) }))] })), _jsxs("ul", __assign({ role: "listbox", className: "pr-1 overflow-auto max-h-64" }, { children: [filteredAgencies.map(function (a) {
|
|
54
|
+
var isActive = (selectedAgency === null || selectedAgency === void 0 ? void 0 : selectedAgency.id) === a.id;
|
|
55
|
+
return (_jsx("li", { children: _jsxs("button", __assign({ type: "button", onClick: function () { return handleSelect(a); }, className: "flex w-full items-center justify-between gap-3 rounded-lg px-2 py-2 text-left hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-teal-300 ".concat(isActive ? "bg-black/[0.04]" : ""), "aria-selected": isActive, role: "option" }, { children: [_jsx("span", __assign({ className: "text-[14px]" }, { children: a.name })), _jsx("span", __assign({ className: "text-[13px] font-semibold" }, { children: a.localisation }))] })) }, a.id));
|
|
56
|
+
}), filteredAgencies.length === 0 && (_jsx("li", __assign({ className: "px-2 py-6 text-sm text-center text-muted-foreground" }, { children: "No results" })))] }))] })))] }))] })));
|
|
57
|
+
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type CardContainerSpacing = 'compact' | 'normal' | 'relaxed' | 'chill';
|
|
3
|
-
export interface CardContainerProps {
|
|
4
|
-
/**
|
|
5
|
-
* The content to be displayed inside the card container
|
|
6
|
-
*/
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Spacing variant for the card container padding
|
|
10
|
-
* - compact: 8px padding
|
|
11
|
-
* - normal: 12px padding
|
|
12
|
-
* - relaxed: 16px padding
|
|
13
|
-
* - chill: 24px padding
|
|
14
|
-
*/
|
|
15
|
-
spacing?: CardContainerSpacing;
|
|
16
|
-
/**
|
|
17
|
-
* Additional CSS classes to apply to the card container
|
|
18
|
-
*/
|
|
19
|
-
className?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Optional click handler
|
|
22
|
-
*/
|
|
23
|
-
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Optional data attributes for testing or tracking
|
|
26
|
-
*/
|
|
27
|
-
'data-testid'?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* CardContainer is a versatile UI element that groups related content,
|
|
31
|
-
* such as text, images, buttons, or interactive elements.
|
|
32
|
-
*
|
|
33
|
-
* It supports different spacing variants to control the visual density
|
|
34
|
-
* and padding of the container.
|
|
35
|
-
*/
|
|
36
|
-
export declare const CardContainer: React.FC<CardContainerProps>;
|
|
37
|
-
export default CardContainer;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type CardContainerSpacing = 'compact' | 'normal' | 'relaxed' | 'chill';
|
|
3
|
+
export interface CardContainerProps {
|
|
4
|
+
/**
|
|
5
|
+
* The content to be displayed inside the card container
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Spacing variant for the card container padding
|
|
10
|
+
* - compact: 8px padding
|
|
11
|
+
* - normal: 12px padding
|
|
12
|
+
* - relaxed: 16px padding
|
|
13
|
+
* - chill: 24px padding
|
|
14
|
+
*/
|
|
15
|
+
spacing?: CardContainerSpacing;
|
|
16
|
+
/**
|
|
17
|
+
* Additional CSS classes to apply to the card container
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional click handler
|
|
22
|
+
*/
|
|
23
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Optional data attributes for testing or tracking
|
|
26
|
+
*/
|
|
27
|
+
'data-testid'?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* CardContainer is a versatile UI element that groups related content,
|
|
31
|
+
* such as text, images, buttons, or interactive elements.
|
|
32
|
+
*
|
|
33
|
+
* It supports different spacing variants to control the visual density
|
|
34
|
+
* and padding of the container.
|
|
35
|
+
*/
|
|
36
|
+
export declare const CardContainer: React.FC<CardContainerProps>;
|
|
37
|
+
export default CardContainer;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
/**
|
|
14
|
-
* CardContainer is a versatile UI element that groups related content,
|
|
15
|
-
* such as text, images, buttons, or interactive elements.
|
|
16
|
-
*
|
|
17
|
-
* It supports different spacing variants to control the visual density
|
|
18
|
-
* and padding of the container.
|
|
19
|
-
*/
|
|
20
|
-
export var CardContainer = function (_a) {
|
|
21
|
-
var children = _a.children, _b = _a.spacing, spacing = _b === void 0 ? 'normal' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, onClick = _a.onClick, testId = _a["data-testid"];
|
|
22
|
-
var baseClass = 'card-container';
|
|
23
|
-
var spacingClass = "card-container--spacing-".concat(spacing);
|
|
24
|
-
var classes = [baseClass, spacingClass, className].filter(Boolean).join(' ');
|
|
25
|
-
return (_jsx("div", __assign({ className: classes, onClick: onClick, "data-testid": testId }, { children: children })));
|
|
26
|
-
};
|
|
27
|
-
export default CardContainer;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* CardContainer is a versatile UI element that groups related content,
|
|
15
|
+
* such as text, images, buttons, or interactive elements.
|
|
16
|
+
*
|
|
17
|
+
* It supports different spacing variants to control the visual density
|
|
18
|
+
* and padding of the container.
|
|
19
|
+
*/
|
|
20
|
+
export var CardContainer = function (_a) {
|
|
21
|
+
var children = _a.children, _b = _a.spacing, spacing = _b === void 0 ? 'normal' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, onClick = _a.onClick, testId = _a["data-testid"];
|
|
22
|
+
var baseClass = 'card-container';
|
|
23
|
+
var spacingClass = "card-container--spacing-".concat(spacing);
|
|
24
|
+
var classes = [baseClass, spacingClass, className].filter(Boolean).join(' ');
|
|
25
|
+
return (_jsx("div", __assign({ className: classes, onClick: onClick, "data-testid": testId }, { children: children })));
|
|
26
|
+
};
|
|
27
|
+
export default CardContainer;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { DateTimeProps } from "../../molecules/Calendar/DateTime";
|
|
3
|
-
export interface DateTimePickerProps extends Partial<DateTimeProps> {
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
onValueChange?: (value: string | string[]) => void;
|
|
7
|
-
/** Whether the calendar icon has full bg*/
|
|
8
|
-
iconBGFull?: boolean;
|
|
9
|
-
/** Position of the calendar icon: left or right */
|
|
10
|
-
iconPosition?: "left" | "right";
|
|
11
|
-
/** Show chevron on the right when icon is on the left */
|
|
12
|
-
showChevron?: boolean;
|
|
13
|
-
}
|
|
14
|
-
declare const DateTimePicker: React.FC<DateTimePickerProps>;
|
|
15
|
-
export default DateTimePicker;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { DateTimeProps } from "../../molecules/Calendar/DateTime";
|
|
3
|
+
export interface DateTimePickerProps extends Partial<DateTimeProps> {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onValueChange?: (value: string | string[]) => void;
|
|
7
|
+
/** Whether the calendar icon has full bg*/
|
|
8
|
+
iconBGFull?: boolean;
|
|
9
|
+
/** Position of the calendar icon: left or right */
|
|
10
|
+
iconPosition?: "left" | "right";
|
|
11
|
+
/** Show chevron on the right when icon is on the left */
|
|
12
|
+
showChevron?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const DateTimePicker: React.FC<DateTimePickerProps>;
|
|
15
|
+
export default DateTimePicker;
|