@avenue-ticketing/ui 0.11.0 → 0.12.0-beta.2
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 +47 -0
- package/dist/badge-types-B67wcd4m.d.ts +22 -0
- package/dist/react/app-store-buttons-outline.d.ts +17 -0
- package/dist/react/app-store-buttons-outline.js +582 -0
- package/dist/react/app-store-buttons-outline.js.map +1 -0
- package/dist/react/app-store-buttons.d.ts +20 -0
- package/dist/react/app-store-buttons.js +817 -0
- package/dist/react/app-store-buttons.js.map +1 -0
- package/dist/react/avatar-label-group.d.ts +14 -0
- package/dist/react/avatar-label-group.js +183 -0
- package/dist/react/avatar-label-group.js.map +1 -0
- package/dist/react/avatar-profile-photo.d.ts +9 -0
- package/dist/react/avatar-profile-photo.js +202 -0
- package/dist/react/avatar-profile-photo.js.map +1 -0
- package/dist/react/avatar.d.ts +66 -40
- package/dist/react/avatar.js +159 -149
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/badge-groups.d.ts +25 -0
- package/dist/react/badge-groups.js +162 -0
- package/dist/react/badge-groups.js.map +1 -0
- package/dist/react/badge.d.ts +123 -59
- package/dist/react/badge.js +314 -86
- package/dist/react/badge.js.map +1 -1
- package/dist/react/button-group.d.ts +43 -0
- package/dist/react/button-group.js +108 -0
- package/dist/react/button-group.js.map +1 -0
- package/dist/react/button-utility.d.ts +47 -0
- package/dist/react/button-utility.js +158 -0
- package/dist/react/button-utility.js.map +1 -0
- package/dist/react/button.d.ts +112 -37
- package/dist/react/button.js +270 -55
- package/dist/react/button.js.map +1 -1
- package/dist/react/checkbox.d.ts +25 -8
- package/dist/react/checkbox.js +115 -110
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/close-button.d.ts +25 -0
- package/dist/react/close-button.js +54 -0
- package/dist/react/close-button.js.map +1 -0
- package/dist/react/combobox.d.ts +18 -0
- package/dist/react/combobox.js +574 -0
- package/dist/react/combobox.js.map +1 -0
- package/dist/react/dialog.d.ts +15 -15
- package/dist/react/dialog.js +43 -108
- package/dist/react/dialog.js.map +1 -1
- package/dist/react/dropdown-account-breadcrumb.d.ts +5 -0
- package/dist/react/dropdown-account-breadcrumb.js +481 -0
- package/dist/react/dropdown-account-breadcrumb.js.map +1 -0
- package/dist/react/dropdown-account-button.d.ts +5 -0
- package/dist/react/dropdown-account-button.js +938 -0
- package/dist/react/dropdown-account-button.js.map +1 -0
- package/dist/react/dropdown-account-card-md.d.ts +5 -0
- package/dist/react/dropdown-account-card-md.js +714 -0
- package/dist/react/dropdown-account-card-md.js.map +1 -0
- package/dist/react/dropdown-account-card-sm.d.ts +5 -0
- package/dist/react/dropdown-account-card-sm.js +692 -0
- package/dist/react/dropdown-account-card-sm.js.map +1 -0
- package/dist/react/dropdown-account-card-xs.d.ts +5 -0
- package/dist/react/dropdown-account-card-xs.js +672 -0
- package/dist/react/dropdown-account-card-xs.js.map +1 -0
- package/dist/react/dropdown-avatar.d.ts +5 -0
- package/dist/react/dropdown-avatar.js +955 -0
- package/dist/react/dropdown-avatar.js.map +1 -0
- package/dist/react/dropdown-button-advanced.d.ts +5 -0
- package/dist/react/dropdown-button-advanced.js +964 -0
- package/dist/react/dropdown-button-advanced.js.map +1 -0
- package/dist/react/dropdown-button-link.d.ts +5 -0
- package/dist/react/dropdown-button-link.js +666 -0
- package/dist/react/dropdown-button-link.js.map +1 -0
- package/dist/react/dropdown-button-simple.d.ts +5 -0
- package/dist/react/dropdown-button-simple.js +919 -0
- package/dist/react/dropdown-button-simple.js.map +1 -0
- package/dist/react/dropdown-icon-advanced.d.ts +5 -0
- package/dist/react/dropdown-icon-advanced.js +708 -0
- package/dist/react/dropdown-icon-advanced.js.map +1 -0
- package/dist/react/dropdown-icon-simple.d.ts +5 -0
- package/dist/react/dropdown-icon-simple.js +670 -0
- package/dist/react/dropdown-icon-simple.js.map +1 -0
- package/dist/react/dropdown-integration.d.ts +5 -0
- package/dist/react/dropdown-integration.js +1490 -0
- package/dist/react/dropdown-integration.js.map +1 -0
- package/dist/react/dropdown-search-advanced.d.ts +5 -0
- package/dist/react/dropdown-search-advanced.js +1163 -0
- package/dist/react/dropdown-search-advanced.js.map +1 -0
- package/dist/react/dropdown-search-simple.d.ts +5 -0
- package/dist/react/dropdown-search-simple.js +1125 -0
- package/dist/react/dropdown-search-simple.js.map +1 -0
- package/dist/react/dropdown.d.ts +35 -133
- package/dist/react/dropdown.js +536 -1318
- package/dist/react/dropdown.js.map +1 -1
- package/dist/react/file-upload-trigger.d.ts +34 -0
- package/dist/react/file-upload-trigger.js +39 -0
- package/dist/react/file-upload-trigger.js.map +1 -0
- package/dist/react/form.d.ts +10 -0
- package/dist/react/form.js +11 -0
- package/dist/react/form.js.map +1 -0
- package/dist/react/hint-text.d.ts +17 -0
- package/dist/react/hint-text.js +36 -0
- package/dist/react/hint-text.js.map +1 -0
- package/dist/react/hook-form.d.ts +35 -0
- package/dist/react/hook-form.js +50 -0
- package/dist/react/hook-form.js.map +1 -0
- package/dist/react/input-date.d.ts +43 -0
- package/dist/react/input-date.js +306 -0
- package/dist/react/input-date.js.map +1 -0
- package/dist/react/input-file.d.ts +45 -0
- package/dist/react/input-file.js +748 -0
- package/dist/react/input-file.js.map +1 -0
- package/dist/react/input-group.d.ts +37 -0
- package/dist/react/input-group.js +251 -0
- package/dist/react/input-group.js.map +1 -0
- package/dist/react/input-number.d.ts +32 -0
- package/dist/react/input-number.js +553 -0
- package/dist/react/input-number.js.map +1 -0
- package/dist/react/input-payment.d.ts +16 -0
- package/dist/react/input-payment.js +593 -0
- package/dist/react/input-payment.js.map +1 -0
- package/dist/react/input-tags-outer.d.ts +53 -0
- package/dist/react/input-tags-outer.js +607 -0
- package/dist/react/input-tags-outer.js.map +1 -0
- package/dist/react/input-tags.d.ts +53 -0
- package/dist/react/input-tags.js +565 -0
- package/dist/react/input-tags.js.map +1 -0
- package/dist/react/input.d.ts +71 -22
- package/dist/react/input.js +332 -45
- package/dist/react/input.js.map +1 -1
- package/dist/react/label.d.ts +18 -0
- package/dist/react/label.js +112 -0
- package/dist/react/label.js.map +1 -0
- package/dist/react/multi-select.d.ts +90 -0
- package/dist/react/multi-select.js +1237 -0
- package/dist/react/multi-select.js.map +1 -0
- package/dist/react/pin-input.d.ts +59 -0
- package/dist/react/pin-input.js +229 -0
- package/dist/react/pin-input.js.map +1 -0
- package/dist/react/popover.d.ts +14 -71
- package/dist/react/popover.js +171 -540
- package/dist/react/popover.js.map +1 -1
- package/dist/react/progress-circle.d.ts +9 -0
- package/dist/react/progress-circle.js +36 -0
- package/dist/react/progress-circle.js.map +1 -0
- package/dist/react/progress-circles.d.ts +14 -0
- package/dist/react/progress-circles.js +160 -0
- package/dist/react/progress-circles.js.map +1 -0
- package/dist/react/progress-indicators.d.ts +52 -0
- package/dist/react/progress-indicators.js +78 -0
- package/dist/react/progress-indicators.js.map +1 -0
- package/dist/react/radio-buttons.d.ts +35 -0
- package/dist/react/radio-buttons.js +117 -0
- package/dist/react/radio-buttons.js.map +1 -0
- package/dist/react/scroll-header.d.ts +6 -0
- package/dist/react/scroll-header.js +42 -61
- package/dist/react/scroll-header.js.map +1 -1
- package/dist/react/scroll-wheel.d.ts +4 -5
- package/dist/react/scroll-wheel.js +19 -15
- package/dist/react/scroll-wheel.js.map +1 -1
- package/dist/react/select-item.d.ts +14 -0
- package/dist/react/select-item.js +340 -0
- package/dist/react/select-item.js.map +1 -0
- package/dist/react/select-native.d.ts +17 -0
- package/dist/react/select-native.js +203 -0
- package/dist/react/select-native.js.map +1 -0
- package/dist/react/select.d.ts +19 -61
- package/dist/react/select.js +866 -908
- package/dist/react/select.js.map +1 -1
- package/dist/react/sheet.d.ts +19 -19
- package/dist/react/sheet.js +97 -219
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/slider.d.ts +15 -0
- package/dist/react/slider.js +66 -0
- package/dist/react/slider.js.map +1 -0
- package/dist/react/social-button.d.ts +55 -0
- package/dist/react/social-button.js +263 -0
- package/dist/react/social-button.js.map +1 -0
- package/dist/react/social-logos.d.ts +20 -0
- package/dist/react/social-logos.js +131 -0
- package/dist/react/social-logos.js.map +1 -0
- package/dist/react/switch.d.ts +21 -36
- package/dist/react/switch.js +121 -109
- package/dist/react/switch.js.map +1 -1
- package/dist/react/tag-select.d.ts +47 -0
- package/dist/react/tag-select.js +1252 -0
- package/dist/react/tag-select.js.map +1 -0
- package/dist/react/tags.d.ts +30 -0
- package/dist/react/tags.js +228 -0
- package/dist/react/tags.js.map +1 -0
- package/dist/react/textarea.d.ts +40 -4
- package/dist/react/textarea.js +193 -27
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/tooltip.d.ts +30 -43
- package/dist/react/tooltip.js +65 -521
- package/dist/react/tooltip.js.map +1 -1
- package/dist/select-mobile-sheet-CB2ptDTJ.d.ts +12 -0
- package/dist/select-shared-oJEeJxeB.d.ts +68 -0
- package/package.json +28 -21
- package/source.css +2 -13
- package/theme.css +883 -79
- package/dist/react/calendar.d.ts +0 -13
- package/dist/react/calendar.js +0 -4639
- package/dist/react/calendar.js.map +0 -1
- package/dist/react/card.d.ts +0 -11
- package/dist/react/card.js +0 -113
- package/dist/react/card.js.map +0 -1
- package/dist/react/datetime-picker.d.ts +0 -21
- package/dist/react/datetime-picker.js +0 -6142
- package/dist/react/datetime-picker.js.map +0 -1
- package/dist/react/pagination.d.ts +0 -28
- package/dist/react/pagination.js +0 -262
- package/dist/react/pagination.js.map +0 -1
- package/dist/react/table-pagination.d.ts +0 -15
- package/dist/react/table-pagination.js +0 -1247
- package/dist/react/table-pagination.js.map +0 -1
- package/dist/react/table-view/column-menu.d.ts +0 -15
- package/dist/react/table-view/column-menu.js +0 -1049
- package/dist/react/table-view/column-menu.js.map +0 -1
- package/dist/react/table-view/index.d.ts +0 -70
- package/dist/react/table-view/index.js +0 -2284
- package/dist/react/table-view/index.js.map +0 -1
- package/dist/react/table.d.ts +0 -86
- package/dist/react/table.js +0 -414
- package/dist/react/table.js.map +0 -1
- package/dist/react/tabs.d.ts +0 -34
- package/dist/react/tabs.js +0 -423
- package/dist/react/tabs.js.map +0 -1
- package/dist/react/time-picker.d.ts +0 -22
- package/dist/react/time-picker.js +0 -856
- package/dist/react/time-picker.js.map +0 -1
|
@@ -0,0 +1,1237 @@
|
|
|
1
|
+
import { createContext, useState, useRef, useCallback, useEffect, useMemo, useContext, isValidElement, useLayoutEffect } from 'react';
|
|
2
|
+
import { CaretDownIcon } from '@phosphor-icons/react/dist/csr/CaretDown';
|
|
3
|
+
import { MagnifyingGlassIcon } from '@phosphor-icons/react/dist/csr/MagnifyingGlass';
|
|
4
|
+
import { useFilter } from 'react-aria';
|
|
5
|
+
import { DialogTrigger, Button as Button$1, Dialog, Autocomplete, SearchField, Input, ListBox, Label as Label$1, OverlayTriggerStateContext, Popover as Popover$1, Text, ListBoxItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, OverlayArrow, Link } from 'react-aria-components';
|
|
6
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
import { QuestionIcon } from '@phosphor-icons/react/dist/csr/Question';
|
|
9
|
+
import '@phosphor-icons/react/dist/csr/Eye';
|
|
10
|
+
import '@phosphor-icons/react/dist/csr/EyeSlash';
|
|
11
|
+
import '@phosphor-icons/react/dist/csr/Info';
|
|
12
|
+
import { createPortal } from 'react-dom';
|
|
13
|
+
import { XIcon } from '@phosphor-icons/react/dist/csr/X';
|
|
14
|
+
import { CheckIcon } from '@phosphor-icons/react/dist/csr/Check';
|
|
15
|
+
import { UserIcon } from '@phosphor-icons/react/dist/csr/User';
|
|
16
|
+
import '@phosphor-icons/react/dist/csr/Plus';
|
|
17
|
+
|
|
18
|
+
var twMerge = extendTailwindMerge({
|
|
19
|
+
extend: {
|
|
20
|
+
theme: {
|
|
21
|
+
text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var cx = twMerge;
|
|
26
|
+
function sortCx(classes) {
|
|
27
|
+
return classes;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ../../utils/is-react-component.ts
|
|
31
|
+
var isFunctionComponent = (component) => {
|
|
32
|
+
return typeof component === "function";
|
|
33
|
+
};
|
|
34
|
+
var isClassComponent = (component) => {
|
|
35
|
+
return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
|
|
36
|
+
};
|
|
37
|
+
var isForwardRefComponent = (component) => {
|
|
38
|
+
return typeof component === "object" && component !== null && component.$$typeof.toString() === "Symbol(react.forward_ref)";
|
|
39
|
+
};
|
|
40
|
+
var isReactComponent = (component) => {
|
|
41
|
+
return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
|
|
42
|
+
};
|
|
43
|
+
var focusShadowPlain = "focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
44
|
+
var focusShadowSkeuomorphic = "focus-visible:outline-none focus-visible:[box-shadow:var(--shadow-xs-skeuomorphic),0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
45
|
+
var skeuomorphicGradientBorderClass = [
|
|
46
|
+
"ring-1 ring-inset ring-transparent",
|
|
47
|
+
"before:pointer-events-none before:absolute before:inset-px before:rounded-[inherit] before:border before:border-[#ffffff1f] before:content-['']",
|
|
48
|
+
"before:[mask-image:linear-gradient(to_bottom,#000,transparent)]"
|
|
49
|
+
].join(" ");
|
|
50
|
+
var skeuomorphicShadowClass = ["shadow-xs-skeuomorphic", focusShadowSkeuomorphic, "overflow-hidden"].join(" ");
|
|
51
|
+
var focusShadowSecondary = "focus-visible:outline-none focus-visible:[box-shadow:0px_1px_2px_0px_rgba(0,0,0,0.05),0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
52
|
+
var secondaryInnerShadow = "after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:content-[''] after:[box-shadow:inset_0px_-1px_0px_0px_rgba(0,0,0,0.05)]";
|
|
53
|
+
var secondaryShadowClass = ["relative overflow-hidden shadow-xs", secondaryInnerShadow, focusShadowSecondary].join(" ");
|
|
54
|
+
var inputNumberButtonClass = [
|
|
55
|
+
"in-data-number-input:border-0 in-data-number-input:shadow-none in-data-number-input:!rounded-none in-data-number-input:!h-full in-data-number-input:!min-h-0 in-data-number-input:self-stretch in-data-number-input:overflow-hidden",
|
|
56
|
+
"in-data-number-input:before:hidden in-data-number-input:after:hidden",
|
|
57
|
+
"in-data-number-input:focus-visible:outline-none in-data-number-input:focus-visible:shadow-none in-data-number-input:focus-visible:ring-0 in-data-number-input:focus-visible:![box-shadow:none]"
|
|
58
|
+
].join(" ");
|
|
59
|
+
var inputAddonButtonClass = [
|
|
60
|
+
"in-data-input-wrapper:border-0 in-data-input-wrapper:shadow-none in-data-input-wrapper:!rounded-none in-data-input-wrapper:overflow-hidden",
|
|
61
|
+
"in-data-input-wrapper:in-data-trailing:border-l in-data-input-wrapper:in-data-trailing:border-solid in-data-input-wrapper:in-data-trailing:border-primary",
|
|
62
|
+
"in-data-input-wrapper:in-data-leading:border-r in-data-input-wrapper:in-data-leading:border-solid in-data-input-wrapper:in-data-leading:border-primary",
|
|
63
|
+
"in-data-input-wrapper:group-invalid:in-data-trailing:border-error_subtle in-data-input-wrapper:group-invalid:in-data-leading:border-error_subtle",
|
|
64
|
+
"in-data-input-wrapper:before:hidden in-data-input-wrapper:after:hidden",
|
|
65
|
+
"in-data-input-wrapper:focus-visible:outline-none in-data-input-wrapper:focus-visible:shadow-none in-data-input-wrapper:focus-visible:ring-0 in-data-input-wrapper:focus-visible:![box-shadow:none]"
|
|
66
|
+
].join(" ");
|
|
67
|
+
var styles = sortCx({
|
|
68
|
+
common: {
|
|
69
|
+
root: [
|
|
70
|
+
"group relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-full font-body outline-none before:absolute",
|
|
71
|
+
"font-semibold transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out",
|
|
72
|
+
"pressed:scale-[0.985] pressed:duration-100 pressed:ease-linear motion-reduce:pressed:scale-100",
|
|
73
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed in-data-input-wrapper:disabled:opacity-100",
|
|
74
|
+
inputAddonButtonClass,
|
|
75
|
+
inputNumberButtonClass,
|
|
76
|
+
// Stretch to InputGroup row height; padding/typography follow `data-input-size` on the field (Figma 85:1269).
|
|
77
|
+
"in-data-input-wrapper:!h-full in-data-input-wrapper:!min-h-0 in-data-input-wrapper:self-stretch",
|
|
78
|
+
"in-data-input-wrapper:in-data-[input-size=sm]:gap-1 in-data-input-wrapper:in-data-[input-size=sm]:px-3 in-data-input-wrapper:in-data-[input-size=sm]:py-2 in-data-input-wrapper:in-data-[input-size=sm]:text-sm",
|
|
79
|
+
"in-data-input-wrapper:in-data-[input-size=md]:gap-1 in-data-input-wrapper:in-data-[input-size=md]:px-3.5 in-data-input-wrapper:in-data-[input-size=md]:py-2.5 in-data-input-wrapper:in-data-[input-size=md]:text-sm",
|
|
80
|
+
"in-data-input-wrapper:in-data-[input-size=lg]:gap-1.5 in-data-input-wrapper:in-data-[input-size=lg]:px-4 in-data-input-wrapper:in-data-[input-size=lg]:py-2.5 in-data-input-wrapper:in-data-[input-size=lg]:text-md",
|
|
81
|
+
"*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:transition-inherit-all"
|
|
82
|
+
].join(" "),
|
|
83
|
+
icon: "pointer-events-none shrink-0 transition-inherit-all"
|
|
84
|
+
},
|
|
85
|
+
sizes: {
|
|
86
|
+
xs: {
|
|
87
|
+
root: [
|
|
88
|
+
"h-8 min-h-8 gap-1 px-[0.625rem] py-1.5 text-sm data-icon-only:size-8 data-icon-only:min-h-8 data-icon-only:min-w-8 data-icon-only:p-2",
|
|
89
|
+
"in-data-input-wrapper:data-icon-only:p-2.5",
|
|
90
|
+
"*:data-icon:size-4"
|
|
91
|
+
].join(" "),
|
|
92
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
|
|
93
|
+
},
|
|
94
|
+
sm: {
|
|
95
|
+
root: [
|
|
96
|
+
"h-9 min-h-9 gap-1 px-3 py-2 text-sm data-icon-only:size-9 data-icon-only:min-h-9 data-icon-only:min-w-9 data-icon-only:p-2",
|
|
97
|
+
"in-data-input-wrapper:data-icon-only:p-2.5",
|
|
98
|
+
"*:data-icon:size-5"
|
|
99
|
+
].join(" "),
|
|
100
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
|
|
101
|
+
},
|
|
102
|
+
md: {
|
|
103
|
+
root: [
|
|
104
|
+
"h-10 min-h-10 gap-1 px-3.5 py-2.5 text-sm data-icon-only:size-10 data-icon-only:min-h-10 data-icon-only:min-w-10 data-icon-only:p-2.5",
|
|
105
|
+
"in-data-input-wrapper:data-icon-only:p-3",
|
|
106
|
+
"*:data-icon:size-5"
|
|
107
|
+
].join(" "),
|
|
108
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-4"
|
|
109
|
+
},
|
|
110
|
+
lg: {
|
|
111
|
+
root: "h-11 min-h-11 gap-1.5 px-4 py-2.5 text-md data-icon-only:size-11 data-icon-only:min-h-11 data-icon-only:min-w-11 data-icon-only:p-3 *:data-icon:size-5",
|
|
112
|
+
linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
|
|
113
|
+
},
|
|
114
|
+
xl: {
|
|
115
|
+
root: "h-12 min-h-12 gap-1.5 px-[1.125rem] py-3 text-md data-icon-only:size-12 data-icon-only:min-h-12 data-icon-only:min-w-12 data-icon-only:p-3 data-icon-only:*:data-icon:size-6 *:data-icon:size-5",
|
|
116
|
+
linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
colors: {
|
|
120
|
+
/** Figma Hierarchy=Primary — dark neutral solid; hover lightens to fg-tertiary_hover (#404040). */
|
|
121
|
+
primary: {
|
|
122
|
+
root: [
|
|
123
|
+
"bg-primary-solid text-white",
|
|
124
|
+
skeuomorphicShadowClass,
|
|
125
|
+
skeuomorphicGradientBorderClass,
|
|
126
|
+
"hover:bg-fg-tertiary_hover dark:hover:bg-quaternary",
|
|
127
|
+
"disabled:opacity-30",
|
|
128
|
+
"data-loading:bg-fg-tertiary_hover dark:data-loading:bg-quaternary",
|
|
129
|
+
"*:data-icon:not([data-icon=loading]):text-white/70"
|
|
130
|
+
].join(" ")
|
|
131
|
+
},
|
|
132
|
+
/** Figma Hierarchy=Brand — purple solid; hover darkens to bg-brand-solid_hover (#6d28d9). */
|
|
133
|
+
brand: {
|
|
134
|
+
root: [
|
|
135
|
+
"bg-brand-solid text-primary_on-brand",
|
|
136
|
+
skeuomorphicShadowClass,
|
|
137
|
+
skeuomorphicGradientBorderClass,
|
|
138
|
+
"hover:bg-brand-solid_hover",
|
|
139
|
+
"disabled:opacity-50",
|
|
140
|
+
"data-loading:bg-brand-solid_hover",
|
|
141
|
+
"*:data-icon:not([data-icon=loading]):text-primary_on-brand"
|
|
142
|
+
].join(" ")
|
|
143
|
+
},
|
|
144
|
+
/** Figma Hierarchy=Secondary — border-primary + shadow-xs + skeuomorphic inner rim overlay. */
|
|
145
|
+
secondary: {
|
|
146
|
+
root: [
|
|
147
|
+
"border border-solid border-primary bg-primary text-secondary",
|
|
148
|
+
secondaryShadowClass,
|
|
149
|
+
"hover:bg-primary_hover hover:text-secondary_hover",
|
|
150
|
+
"disabled:opacity-50",
|
|
151
|
+
"data-loading:bg-primary_hover",
|
|
152
|
+
"*:data-icon:text-fg-secondary hover:*:data-icon:text-fg-quaternary_hover"
|
|
153
|
+
].join(" ")
|
|
154
|
+
},
|
|
155
|
+
/** Figma Hierarchy=Tertiary */
|
|
156
|
+
tertiary: {
|
|
157
|
+
root: [
|
|
158
|
+
"border border-transparent bg-transparent text-tertiary",
|
|
159
|
+
focusShadowPlain,
|
|
160
|
+
"hover:bg-primary_hover hover:text-tertiary_hover",
|
|
161
|
+
"disabled:opacity-50",
|
|
162
|
+
"*:data-icon:text-fg-tertiary hover:*:data-icon:text-fg-quaternary_hover"
|
|
163
|
+
].join(" ")
|
|
164
|
+
},
|
|
165
|
+
/** Figma Hierarchy=Link color — text + icons share brand-secondary; hover underlines with fg-brand-secondary. */
|
|
166
|
+
"link-color": {
|
|
167
|
+
root: [
|
|
168
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-brand-secondary shadow-none",
|
|
169
|
+
focusShadowPlain,
|
|
170
|
+
"hover:text-brand-secondary_hover",
|
|
171
|
+
"disabled:opacity-50",
|
|
172
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-brand-secondary"
|
|
173
|
+
].join(" ")
|
|
174
|
+
},
|
|
175
|
+
/** Figma Hierarchy=Link gray — text + icons share tertiary; hover underlines with fg-quaternary. */
|
|
176
|
+
"link-gray": {
|
|
177
|
+
root: [
|
|
178
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-tertiary shadow-none",
|
|
179
|
+
focusShadowPlain,
|
|
180
|
+
"hover:text-tertiary_hover",
|
|
181
|
+
"disabled:opacity-50",
|
|
182
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-quaternary"
|
|
183
|
+
].join(" ")
|
|
184
|
+
},
|
|
185
|
+
"primary-destructive": {
|
|
186
|
+
root: [
|
|
187
|
+
"bg-error-solid text-white",
|
|
188
|
+
skeuomorphicShadowClass,
|
|
189
|
+
skeuomorphicGradientBorderClass,
|
|
190
|
+
"hover:bg-error-solid_hover",
|
|
191
|
+
"disabled:opacity-50",
|
|
192
|
+
"data-loading:bg-error-solid_hover",
|
|
193
|
+
"*:data-icon:not([data-icon=loading]):text-white/70"
|
|
194
|
+
].join(" ")
|
|
195
|
+
},
|
|
196
|
+
"secondary-destructive": {
|
|
197
|
+
root: [
|
|
198
|
+
"border border-solid border-primary bg-primary text-error-primary",
|
|
199
|
+
secondaryShadowClass,
|
|
200
|
+
"hover:bg-error-primary hover:text-error-primary_hover",
|
|
201
|
+
"disabled:opacity-50",
|
|
202
|
+
"data-loading:bg-error-primary",
|
|
203
|
+
"*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
|
|
204
|
+
].join(" ")
|
|
205
|
+
},
|
|
206
|
+
"tertiary-destructive": {
|
|
207
|
+
root: [
|
|
208
|
+
"border border-transparent bg-transparent text-error-primary",
|
|
209
|
+
focusShadowPlain,
|
|
210
|
+
"hover:bg-error-primary hover:text-error-primary_hover",
|
|
211
|
+
"disabled:opacity-50",
|
|
212
|
+
"*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
|
|
213
|
+
].join(" ")
|
|
214
|
+
},
|
|
215
|
+
/** Figma Hierarchy=Link (destructive) — text + icons share error-primary; hover underlines. */
|
|
216
|
+
"link-destructive": {
|
|
217
|
+
root: [
|
|
218
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-error-primary shadow-none",
|
|
219
|
+
focusShadowPlain,
|
|
220
|
+
"hover:text-error-primary_hover",
|
|
221
|
+
"disabled:opacity-50",
|
|
222
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-current"
|
|
223
|
+
].join(" ")
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
var Button = ({
|
|
228
|
+
size = "md",
|
|
229
|
+
color = "primary",
|
|
230
|
+
children,
|
|
231
|
+
className,
|
|
232
|
+
noTextPadding,
|
|
233
|
+
iconLeading: IconLeading,
|
|
234
|
+
iconTrailing: IconTrailing,
|
|
235
|
+
isDisabled: disabled,
|
|
236
|
+
isLoading: loading,
|
|
237
|
+
showTextWhileLoading,
|
|
238
|
+
...props
|
|
239
|
+
}) => {
|
|
240
|
+
const href = "href" in props ? props.href : void 0;
|
|
241
|
+
const isIcon = (IconLeading || IconTrailing) && !children;
|
|
242
|
+
const isLinkType = ["link-gray", "link-color", "link-destructive"].includes(color);
|
|
243
|
+
noTextPadding = isLinkType || noTextPadding;
|
|
244
|
+
const commonChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
245
|
+
isValidElement(IconLeading) && IconLeading,
|
|
246
|
+
isReactComponent(IconLeading) && /* @__PURE__ */ jsx(IconLeading, { "data-icon": "leading", className: styles.common.icon }),
|
|
247
|
+
loading && /* @__PURE__ */ jsx(
|
|
248
|
+
"svg",
|
|
249
|
+
{
|
|
250
|
+
fill: "none",
|
|
251
|
+
"data-icon": "loading",
|
|
252
|
+
viewBox: "0 0 256 256",
|
|
253
|
+
"aria-hidden": true,
|
|
254
|
+
className: cx(
|
|
255
|
+
styles.common.icon,
|
|
256
|
+
"size-5 animate-spin",
|
|
257
|
+
!showTextWhileLoading && "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
258
|
+
),
|
|
259
|
+
children: /* @__PURE__ */ jsx(
|
|
260
|
+
"path",
|
|
261
|
+
{
|
|
262
|
+
fill: "currentColor",
|
|
263
|
+
d: "M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60,61.46,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20-66.54-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
children && /* @__PURE__ */ jsx("span", { "data-text": true, className: cx("transition-inherit-all", !noTextPadding && !isLinkType && "px-0.5"), children }),
|
|
269
|
+
isValidElement(IconTrailing) && IconTrailing,
|
|
270
|
+
isReactComponent(IconTrailing) && /* @__PURE__ */ jsx(IconTrailing, { "data-icon": "trailing", className: styles.common.icon })
|
|
271
|
+
] });
|
|
272
|
+
const commonProps = {
|
|
273
|
+
"data-icon-only": isIcon ? true : void 0,
|
|
274
|
+
"data-loading": loading ? true : void 0,
|
|
275
|
+
...props,
|
|
276
|
+
isDisabled: disabled || loading,
|
|
277
|
+
className: cx(
|
|
278
|
+
styles.common.root,
|
|
279
|
+
styles.sizes[size].root,
|
|
280
|
+
styles.colors[color].root,
|
|
281
|
+
isLinkType && styles.sizes[size].linkRoot,
|
|
282
|
+
(loading || href && (disabled || loading)) && "pointer-events-none",
|
|
283
|
+
loading && (showTextWhileLoading ? "[&>*:not([data-icon=loading]):not([data-text])]:hidden" : "[&>*:not([data-icon=loading])]:invisible"),
|
|
284
|
+
className
|
|
285
|
+
),
|
|
286
|
+
children: commonChildren
|
|
287
|
+
};
|
|
288
|
+
if ("href" in commonProps) {
|
|
289
|
+
return /* @__PURE__ */ jsx(Link, { ...commonProps, href: disabled || loading ? void 0 : href });
|
|
290
|
+
}
|
|
291
|
+
return /* @__PURE__ */ jsx(Button$1, { ...commonProps, type: commonProps.type || "button", isPending: loading });
|
|
292
|
+
};
|
|
293
|
+
var HintText = ({ isInvalid, className, size = "md", ...props }) => {
|
|
294
|
+
return /* @__PURE__ */ jsx(
|
|
295
|
+
Text,
|
|
296
|
+
{
|
|
297
|
+
...props,
|
|
298
|
+
slot: isInvalid ? "errorMessage" : "description",
|
|
299
|
+
className: cx(
|
|
300
|
+
"text-sm text-tertiary",
|
|
301
|
+
// Size
|
|
302
|
+
size === "sm" && "text-xs",
|
|
303
|
+
"in-data-[input-size=sm]:text-xs",
|
|
304
|
+
// Invalid state
|
|
305
|
+
isInvalid && "text-error-primary",
|
|
306
|
+
"group-invalid:text-error-primary",
|
|
307
|
+
className
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
);
|
|
311
|
+
};
|
|
312
|
+
HintText.displayName = "HintText";
|
|
313
|
+
var Tooltip = ({
|
|
314
|
+
title,
|
|
315
|
+
description,
|
|
316
|
+
children,
|
|
317
|
+
arrow = false,
|
|
318
|
+
delay = 100,
|
|
319
|
+
closeDelay = 0,
|
|
320
|
+
trigger,
|
|
321
|
+
isDisabled,
|
|
322
|
+
isOpen,
|
|
323
|
+
defaultOpen,
|
|
324
|
+
offset = 6,
|
|
325
|
+
crossOffset,
|
|
326
|
+
placement = "top",
|
|
327
|
+
onOpenChange,
|
|
328
|
+
...tooltipProps
|
|
329
|
+
}) => {
|
|
330
|
+
const isTopOrBottomLeft = ["top left", "top end", "bottom left", "bottom end"].includes(placement);
|
|
331
|
+
const isTopOrBottomRight = ["top right", "top start", "bottom right", "bottom start"].includes(placement);
|
|
332
|
+
const calculatedCrossOffset = isTopOrBottomLeft ? -12 : isTopOrBottomRight ? 12 : 0;
|
|
333
|
+
return /* @__PURE__ */ jsxs(TooltipTrigger$1, { ...{ trigger, delay, closeDelay, isDisabled, isOpen, defaultOpen, onOpenChange }, children: [
|
|
334
|
+
children,
|
|
335
|
+
/* @__PURE__ */ jsx(
|
|
336
|
+
Tooltip$1,
|
|
337
|
+
{
|
|
338
|
+
...tooltipProps,
|
|
339
|
+
offset,
|
|
340
|
+
placement,
|
|
341
|
+
crossOffset: crossOffset ?? calculatedCrossOffset,
|
|
342
|
+
className: ({ isEntering, isExiting }) => cx(isEntering && "ease-out animate-in", isExiting && "ease-in animate-out"),
|
|
343
|
+
children: ({ isEntering, isExiting }) => /* @__PURE__ */ jsxs(
|
|
344
|
+
"div",
|
|
345
|
+
{
|
|
346
|
+
className: cx(
|
|
347
|
+
"z-50 flex max-w-xs origin-(--trigger-anchor-point) flex-col items-start gap-1 rounded-lg bg-primary-solid px-3 shadow-lg will-change-transform",
|
|
348
|
+
description ? "py-3" : "py-2",
|
|
349
|
+
isEntering && "ease-out animate-in fade-in zoom-in-95 in-placement-left:slide-in-from-right-0.5 in-placement-right:slide-in-from-left-0.5 in-placement-top:slide-in-from-bottom-0.5 in-placement-bottom:slide-in-from-top-0.5",
|
|
350
|
+
isExiting && "ease-in animate-out fade-out zoom-out-95 in-placement-left:slide-out-to-right-0.5 in-placement-right:slide-out-to-left-0.5 in-placement-top:slide-out-to-bottom-0.5 in-placement-bottom:slide-out-to-top-0.5"
|
|
351
|
+
),
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-white", children: title }),
|
|
354
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: description }),
|
|
355
|
+
arrow && /* @__PURE__ */ jsx(OverlayArrow, { children: /* @__PURE__ */ jsx(
|
|
356
|
+
"svg",
|
|
357
|
+
{
|
|
358
|
+
viewBox: "0 0 100 100",
|
|
359
|
+
className: "size-2.5 fill-bg-primary-solid in-placement-left:-rotate-90 in-placement-right:rotate-90 in-placement-top:rotate-0 in-placement-bottom:rotate-180",
|
|
360
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L35.858,35.858 Q50,50 64.142,35.858 L100,0 Z" })
|
|
361
|
+
}
|
|
362
|
+
) })
|
|
363
|
+
]
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
}
|
|
367
|
+
)
|
|
368
|
+
] });
|
|
369
|
+
};
|
|
370
|
+
var TooltipTrigger = ({ children, className, ...buttonProps }) => {
|
|
371
|
+
return /* @__PURE__ */ jsx(Button$1, { ...buttonProps, className: (values) => cx("h-max w-max outline-hidden", typeof className === "function" ? className(values) : className), children });
|
|
372
|
+
};
|
|
373
|
+
var Label = ({ isInvalid, isRequired, tooltip, tooltipDescription, className, ...props }) => {
|
|
374
|
+
return /* @__PURE__ */ jsxs(
|
|
375
|
+
Label$1,
|
|
376
|
+
{
|
|
377
|
+
"data-label": "true",
|
|
378
|
+
...props,
|
|
379
|
+
className: cx("flex cursor-default items-center gap-0.5 text-sm font-medium text-secondary", className),
|
|
380
|
+
children: [
|
|
381
|
+
props.children,
|
|
382
|
+
/* @__PURE__ */ jsx(
|
|
383
|
+
"span",
|
|
384
|
+
{
|
|
385
|
+
className: cx(
|
|
386
|
+
"hidden text-brand-tertiary",
|
|
387
|
+
isRequired && "block",
|
|
388
|
+
typeof isRequired === "undefined" && "group-required:block",
|
|
389
|
+
isInvalid && "text-error-primary",
|
|
390
|
+
typeof isInvalid === "undefined" && "group-invalid:text-error-primary"
|
|
391
|
+
),
|
|
392
|
+
children: "*"
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
tooltip && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, description: tooltipDescription, placement: "top", children: /* @__PURE__ */ jsx(
|
|
396
|
+
TooltipTrigger,
|
|
397
|
+
{
|
|
398
|
+
isDisabled: false,
|
|
399
|
+
className: "cursor-pointer text-fg-quaternary transition duration-200 hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover",
|
|
400
|
+
children: /* @__PURE__ */ jsx(QuestionIcon, { className: "size-4" })
|
|
401
|
+
}
|
|
402
|
+
) })
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
};
|
|
407
|
+
Label.displayName = "Label";
|
|
408
|
+
var iconsSizes = {
|
|
409
|
+
sm: "*:data-icon:size-4 *:data-icon:stroke-[2.25px]",
|
|
410
|
+
md: "*:data-icon:size-5",
|
|
411
|
+
lg: "*:data-icon:size-6",
|
|
412
|
+
xl: "*:data-icon:size-7"
|
|
413
|
+
};
|
|
414
|
+
var styles2 = sortCx({
|
|
415
|
+
light: {
|
|
416
|
+
base: "rounded-full",
|
|
417
|
+
sizes: {
|
|
418
|
+
sm: "size-8",
|
|
419
|
+
md: "size-10",
|
|
420
|
+
lg: "size-12",
|
|
421
|
+
xl: "size-14"
|
|
422
|
+
},
|
|
423
|
+
colors: {
|
|
424
|
+
brand: "bg-brand-secondary text-featured-icon-light-fg-brand",
|
|
425
|
+
gray: "bg-tertiary text-featured-icon-light-fg-gray",
|
|
426
|
+
error: "bg-error-secondary text-featured-icon-light-fg-error",
|
|
427
|
+
warning: "bg-warning-secondary text-featured-icon-light-fg-warning",
|
|
428
|
+
success: "bg-success-secondary text-featured-icon-light-fg-success"
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
gradient: {
|
|
432
|
+
base: "rounded-full text-fg-white before:absolute before:inset-0 before:size-full before:rounded-full before:border before:mask-b-from-0% after:absolute after:block after:rounded-full",
|
|
433
|
+
sizes: {
|
|
434
|
+
sm: "size-8 after:size-6 *:data-icon:size-4",
|
|
435
|
+
md: "size-10 after:size-7 *:data-icon:size-4",
|
|
436
|
+
lg: "size-12 after:size-8 *:data-icon:size-5",
|
|
437
|
+
xl: "size-14 after:size-10 *:data-icon:size-5"
|
|
438
|
+
},
|
|
439
|
+
colors: {
|
|
440
|
+
brand: "before:border-utility-brand-200 before:bg-utility-brand-50 after:bg-brand-solid",
|
|
441
|
+
gray: "before:border-utility-neutral-200 before:bg-utility-neutral-50 after:bg-secondary-solid",
|
|
442
|
+
error: "before:border-utility-red-200 before:bg-utility-red-50 after:bg-error-solid",
|
|
443
|
+
warning: "before:border-utility-yellow-200 before:bg-utility-yellow-50 after:bg-warning-solid",
|
|
444
|
+
success: "before:border-utility-green-200 before:bg-utility-green-50 after:bg-success-solid"
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
dark: {
|
|
448
|
+
base: "text-fg-white shadow-xs-skeuomorphic before:absolute before:inset-px before:border before:border-white/12 before:mask-b-from-0%",
|
|
449
|
+
sizes: {
|
|
450
|
+
sm: "size-8 rounded-md before:rounded-[5px]",
|
|
451
|
+
md: "size-10 rounded-lg before:rounded-[7px]",
|
|
452
|
+
lg: "size-12 rounded-[10px] before:rounded-[9px]",
|
|
453
|
+
xl: "size-14 rounded-xl before:rounded-[11px]"
|
|
454
|
+
},
|
|
455
|
+
colors: {
|
|
456
|
+
brand: "bg-brand-solid before:border-utility-brand-200/12",
|
|
457
|
+
gray: "bg-secondary-solid before:border-utility-neutral-200/12",
|
|
458
|
+
error: "bg-error-solid before:border-utility-red-200/12",
|
|
459
|
+
warning: "bg-warning-solid before:border-utility-yellow-200/12",
|
|
460
|
+
success: "bg-success-solid before:border-utility-green-200/12"
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
modern: {
|
|
464
|
+
base: "bg-primary shadow-xs-skeuomorphic ring-1 ring-primary ring-inset",
|
|
465
|
+
sizes: {
|
|
466
|
+
sm: "size-8 rounded-md",
|
|
467
|
+
md: "size-10 rounded-lg",
|
|
468
|
+
lg: "size-12 rounded-[10px]",
|
|
469
|
+
xl: "size-14 rounded-xl"
|
|
470
|
+
},
|
|
471
|
+
colors: {
|
|
472
|
+
brand: "text-fg-brand-primary",
|
|
473
|
+
gray: "text-fg-secondary",
|
|
474
|
+
error: "text-fg-error-primary",
|
|
475
|
+
warning: "text-fg-warning-primary",
|
|
476
|
+
success: "text-fg-success-primary"
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
"modern-neue": {
|
|
480
|
+
base: [
|
|
481
|
+
"bg-primary_alt ring-1 ring-inset before:absolute before:inset-1",
|
|
482
|
+
// Shadow
|
|
483
|
+
"before:shadow-[0px_1px_2px_0px_rgba(0,0,0,0.1),0px_3px_3px_0px_rgba(0,0,0,0.09),1px_8px_5px_0px_rgba(0,0,0,0.05),2px_21px_6px_0px_rgba(0,0,0,0),0px_0px_0px_1px_rgba(0,0,0,0.08),1px_13px_5px_0px_rgba(0,0,0,0.01),0px_-2px_2px_0px_rgba(0,0,0,0.13)_inset] before:ring-1 before:ring-secondary_alt"
|
|
484
|
+
].join(" "),
|
|
485
|
+
sizes: {
|
|
486
|
+
sm: "size-8 rounded-[8px] before:rounded-[4px]",
|
|
487
|
+
md: "size-10 rounded-[10px] before:rounded-[6px]",
|
|
488
|
+
lg: "size-12 rounded-[12px] before:rounded-[8px]",
|
|
489
|
+
xl: "size-14 rounded-[14px] before:rounded-[10px]"
|
|
490
|
+
},
|
|
491
|
+
colors: {
|
|
492
|
+
brand: "",
|
|
493
|
+
gray: "text-fg-secondary ring-primary",
|
|
494
|
+
error: "",
|
|
495
|
+
warning: "",
|
|
496
|
+
success: ""
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
outline: {
|
|
500
|
+
base: "before:absolute before:rounded-full before:border-2 after:absolute after:rounded-full after:border-2",
|
|
501
|
+
sizes: {
|
|
502
|
+
sm: "size-4 before:size-6 after:size-8.5",
|
|
503
|
+
md: "size-5 before:size-7 after:size-9.5",
|
|
504
|
+
lg: "size-6 before:size-8 after:size-10.5",
|
|
505
|
+
xl: "size-7 before:size-9 after:size-11.5"
|
|
506
|
+
},
|
|
507
|
+
colors: {
|
|
508
|
+
brand: "text-fg-brand-primary before:border-fg-brand-primary/30 after:border-fg-brand-primary/10",
|
|
509
|
+
gray: "text-fg-tertiary before:border-fg-tertiary/30 after:border-fg-tertiary/10",
|
|
510
|
+
error: "text-fg-error-primary before:border-fg-error-primary/30 after:border-fg-error-primary/10",
|
|
511
|
+
warning: "text-fg-warning-primary before:border-fg-warning-primary/30 after:border-fg-warning-primary/10",
|
|
512
|
+
success: "text-fg-success-primary before:border-fg-success-primary/30 after:border-fg-success-primary/10"
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
var FeaturedIcon = (props) => {
|
|
517
|
+
const { size = "sm", theme: variant = "light", color = "brand", icon: Icon, ...otherProps } = props;
|
|
518
|
+
return /* @__PURE__ */ jsxs(
|
|
519
|
+
"div",
|
|
520
|
+
{
|
|
521
|
+
...otherProps,
|
|
522
|
+
"data-featured-icon": true,
|
|
523
|
+
className: cx(
|
|
524
|
+
"relative flex shrink-0 items-center justify-center",
|
|
525
|
+
iconsSizes[size],
|
|
526
|
+
styles2[variant].base,
|
|
527
|
+
styles2[variant].sizes[size],
|
|
528
|
+
styles2[variant].colors[color],
|
|
529
|
+
props.className
|
|
530
|
+
),
|
|
531
|
+
children: [
|
|
532
|
+
isReactComponent(Icon) && /* @__PURE__ */ jsx(Icon, { "data-icon": true, className: "z-1" }),
|
|
533
|
+
isValidElement(Icon) && /* @__PURE__ */ jsx("div", { className: "z-1", children: Icon }),
|
|
534
|
+
props.children
|
|
535
|
+
]
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
};
|
|
539
|
+
var MOBILE_SHEET_MAX_PX = 1024;
|
|
540
|
+
function useIsMobile(breakpoint = MOBILE_SHEET_MAX_PX + 1) {
|
|
541
|
+
const [isMobile, setIsMobile] = useState(() => {
|
|
542
|
+
if (typeof window === "undefined") return false;
|
|
543
|
+
return window.matchMedia(`(max-width: ${breakpoint - 1}px)`).matches;
|
|
544
|
+
});
|
|
545
|
+
useEffect(() => {
|
|
546
|
+
const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
547
|
+
const handler = (e) => setIsMobile(e.matches);
|
|
548
|
+
mq.addEventListener("change", handler);
|
|
549
|
+
return () => mq.removeEventListener("change", handler);
|
|
550
|
+
}, [breakpoint]);
|
|
551
|
+
return isMobile;
|
|
552
|
+
}
|
|
553
|
+
var inputFocusRingShadow = "border-brand ring-1 ring-inset ring-brand";
|
|
554
|
+
var inputErrorFocusRingShadow = "border-error ring-1 ring-inset ring-error";
|
|
555
|
+
createContext({});
|
|
556
|
+
var MOBILE_SHEET_MOTION_MS = 175;
|
|
557
|
+
var MOBILE_SHEET_ENTRY_EASING = "cubic-bezier(0.85, 0, 0.15, 1)";
|
|
558
|
+
var MOBILE_SHEET_EXIT_EASING = "cubic-bezier(0.85, 0, 1, 0.15)";
|
|
559
|
+
var MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX = 120;
|
|
560
|
+
function resolveSelectMobileOptions(mobileOptions) {
|
|
561
|
+
return {
|
|
562
|
+
sheet: mobileOptions?.sheet ?? true,
|
|
563
|
+
title: mobileOptions?.title,
|
|
564
|
+
sheetClassName: mobileOptions?.className,
|
|
565
|
+
contentClassName: mobileOptions?.contentClassName
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
function useMobileSheetAnimation(open, enabled, slideEntrance = true, slideOffsetPx = MOBILE_SHEET_SLIDE_ENTRANCE_OFFSET_PX) {
|
|
569
|
+
const [shouldRender, setShouldRender] = useState(open);
|
|
570
|
+
const [isAnimating, setIsAnimating] = useState(false);
|
|
571
|
+
useLayoutEffect(() => {
|
|
572
|
+
if (!enabled) {
|
|
573
|
+
setShouldRender(open);
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
if (open) {
|
|
577
|
+
setShouldRender(true);
|
|
578
|
+
}
|
|
579
|
+
}, [open, enabled]);
|
|
580
|
+
useEffect(() => {
|
|
581
|
+
if (!enabled || open) return;
|
|
582
|
+
const timer = setTimeout(() => setShouldRender(false), MOBILE_SHEET_MOTION_MS);
|
|
583
|
+
return () => clearTimeout(timer);
|
|
584
|
+
}, [open, enabled]);
|
|
585
|
+
useLayoutEffect(() => {
|
|
586
|
+
if (!enabled || open || !shouldRender) return;
|
|
587
|
+
setIsAnimating(false);
|
|
588
|
+
}, [enabled, open, shouldRender]);
|
|
589
|
+
useEffect(() => {
|
|
590
|
+
if (!enabled || !shouldRender || !open) return;
|
|
591
|
+
let raf2 = 0;
|
|
592
|
+
const raf1 = requestAnimationFrame(() => {
|
|
593
|
+
raf2 = requestAnimationFrame(() => setIsAnimating(true));
|
|
594
|
+
});
|
|
595
|
+
return () => {
|
|
596
|
+
cancelAnimationFrame(raf1);
|
|
597
|
+
if (raf2) cancelAnimationFrame(raf2);
|
|
598
|
+
};
|
|
599
|
+
}, [shouldRender, open, enabled]);
|
|
600
|
+
const motionEasing = open ? MOBILE_SHEET_ENTRY_EASING : MOBILE_SHEET_EXIT_EASING;
|
|
601
|
+
const hiddenTransform = slideEntrance ? `translateY(${slideOffsetPx}px)` : "translateY(100%)";
|
|
602
|
+
const panelStyle = enabled ? {
|
|
603
|
+
transform: isAnimating ? "translateY(0)" : hiddenTransform,
|
|
604
|
+
opacity: isAnimating ? 1 : 0,
|
|
605
|
+
transitionProperty: "transform, opacity",
|
|
606
|
+
transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
|
|
607
|
+
transitionTimingFunction: motionEasing
|
|
608
|
+
} : void 0;
|
|
609
|
+
const backdropStyle = enabled ? {
|
|
610
|
+
opacity: isAnimating ? 1 : 0,
|
|
611
|
+
transitionProperty: "opacity",
|
|
612
|
+
transitionDuration: `${MOBILE_SHEET_MOTION_MS}ms`,
|
|
613
|
+
transitionTimingFunction: motionEasing
|
|
614
|
+
} : void 0;
|
|
615
|
+
return { shouldRender, isAnimating, panelStyle, backdropStyle };
|
|
616
|
+
}
|
|
617
|
+
function MobileSheetCloseButton({ onClose }) {
|
|
618
|
+
return /* @__PURE__ */ jsxs(
|
|
619
|
+
"button",
|
|
620
|
+
{
|
|
621
|
+
type: "button",
|
|
622
|
+
onClick: (e) => {
|
|
623
|
+
e.stopPropagation();
|
|
624
|
+
onClose();
|
|
625
|
+
},
|
|
626
|
+
className: "flex size-12 shrink-0 cursor-pointer items-center justify-center rounded-full text-fg-primary transition duration-100 ease-linear hover:bg-primary_hover active:scale-[0.96] focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
|
|
627
|
+
children: [
|
|
628
|
+
/* @__PURE__ */ jsx(XIcon, { className: "size-5", "aria-hidden": "true" }),
|
|
629
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
function MobileSheetChrome({
|
|
635
|
+
title,
|
|
636
|
+
contentClassName,
|
|
637
|
+
onClose,
|
|
638
|
+
children
|
|
639
|
+
}) {
|
|
640
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
641
|
+
/* @__PURE__ */ jsxs("div", { className: cx("flex w-full shrink-0 items-center py-2 pl-4 pr-2", title ? "justify-between gap-3" : "justify-end"), children: [
|
|
642
|
+
title ? /* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 truncate text-base font-semibold text-primary", children: title }) : null,
|
|
643
|
+
/* @__PURE__ */ jsx(MobileSheetCloseButton, { onClose })
|
|
644
|
+
] }),
|
|
645
|
+
/* @__PURE__ */ jsx(
|
|
646
|
+
"div",
|
|
647
|
+
{
|
|
648
|
+
className: cx(
|
|
649
|
+
"min-h-0 flex-1 overflow-y-auto pb-[calc(5rem+env(safe-area-inset-bottom,0px))]",
|
|
650
|
+
contentClassName
|
|
651
|
+
),
|
|
652
|
+
children
|
|
653
|
+
}
|
|
654
|
+
)
|
|
655
|
+
] });
|
|
656
|
+
}
|
|
657
|
+
var Popover = ({ mobileOptions, children, size, className, style, compoundContent = false, ...props }) => {
|
|
658
|
+
const isMobile = useIsMobile();
|
|
659
|
+
const resolvedMobile = useMemo(() => resolveSelectMobileOptions(mobileOptions), [mobileOptions]);
|
|
660
|
+
const useMobileSheet = isMobile && resolvedMobile.sheet;
|
|
661
|
+
const overlayState = useContext(OverlayTriggerStateContext);
|
|
662
|
+
const open = overlayState?.isOpen ?? false;
|
|
663
|
+
const { shouldRender, panelStyle, backdropStyle } = useMobileSheetAnimation(open, useMobileSheet);
|
|
664
|
+
useEffect(() => {
|
|
665
|
+
if (!useMobileSheet || !open) return;
|
|
666
|
+
const prev = document.body.style.overflow;
|
|
667
|
+
document.body.style.overflow = "hidden";
|
|
668
|
+
return () => {
|
|
669
|
+
document.body.style.overflow = prev;
|
|
670
|
+
};
|
|
671
|
+
}, [useMobileSheet, open]);
|
|
672
|
+
const close = () => overlayState?.close();
|
|
673
|
+
const showMobileSheet = useMobileSheet && shouldRender;
|
|
674
|
+
const isMobileSheetExiting = showMobileSheet && !open;
|
|
675
|
+
const mobileScrim = useMobileSheet && shouldRender && typeof document !== "undefined" ? createPortal(
|
|
676
|
+
/* @__PURE__ */ jsx(
|
|
677
|
+
"div",
|
|
678
|
+
{
|
|
679
|
+
className: "fixed inset-0 z-50 bg-overlay/70",
|
|
680
|
+
style: backdropStyle,
|
|
681
|
+
onClick: close,
|
|
682
|
+
"aria-hidden": "true"
|
|
683
|
+
}
|
|
684
|
+
),
|
|
685
|
+
document.body
|
|
686
|
+
) : null;
|
|
687
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
688
|
+
mobileScrim,
|
|
689
|
+
/* @__PURE__ */ jsx(
|
|
690
|
+
Popover$1,
|
|
691
|
+
{
|
|
692
|
+
placement: "bottom",
|
|
693
|
+
containerPadding: 0,
|
|
694
|
+
offset: 4,
|
|
695
|
+
...props,
|
|
696
|
+
isExiting: isMobileSheetExiting,
|
|
697
|
+
...useMobileSheet ? { "data-select-mobile-sheet": true } : {},
|
|
698
|
+
style: useMobileSheet ? { ...panelStyle, ...style } : style,
|
|
699
|
+
className: (state) => cx(
|
|
700
|
+
"outline-hidden",
|
|
701
|
+
!useMobileSheet && [
|
|
702
|
+
"w-(--trigger-width) origin-(--trigger-anchor-point) rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
|
|
703
|
+
compoundContent ? "overflow-hidden outline-hidden" : "overflow-x-hidden overflow-y-auto py-1 outline-hidden",
|
|
704
|
+
state.isEntering && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
|
|
705
|
+
state.isExiting && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5",
|
|
706
|
+
!compoundContent && size === "sm" && "max-h-56!",
|
|
707
|
+
!compoundContent && size === "md" && "max-h-64!",
|
|
708
|
+
!compoundContent && size === "lg" && "max-h-80!"
|
|
709
|
+
],
|
|
710
|
+
useMobileSheet && [
|
|
711
|
+
"fixed! inset-x-0! bottom-0! top-auto! left-0! right-0! z-[51] flex w-full! max-w-none! flex-col overflow-hidden rounded-t-2xl rounded-b-none border-x-0 border-t border-secondary bg-primary shadow-xl",
|
|
712
|
+
"max-h-[min(90dvh,calc(100dvh-env(safe-area-inset-bottom,0px)))]",
|
|
713
|
+
resolvedMobile.sheetClassName
|
|
714
|
+
],
|
|
715
|
+
typeof className === "function" ? className(state) : className
|
|
716
|
+
),
|
|
717
|
+
children: (state) => {
|
|
718
|
+
const content = typeof children === "function" ? children(state) : children;
|
|
719
|
+
if (useMobileSheet) {
|
|
720
|
+
return /* @__PURE__ */ jsx(
|
|
721
|
+
MobileSheetChrome,
|
|
722
|
+
{
|
|
723
|
+
title: resolvedMobile.title,
|
|
724
|
+
contentClassName: resolvedMobile.contentClassName,
|
|
725
|
+
onClose: close,
|
|
726
|
+
children: content
|
|
727
|
+
}
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
return content;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
)
|
|
734
|
+
] });
|
|
735
|
+
};
|
|
736
|
+
var sizes = {
|
|
737
|
+
xs: "size-1.5",
|
|
738
|
+
sm: "size-2",
|
|
739
|
+
md: "size-2.5",
|
|
740
|
+
lg: "size-3",
|
|
741
|
+
xl: "size-3.5",
|
|
742
|
+
"2xl": "size-4",
|
|
743
|
+
"3xl": "size-4.5",
|
|
744
|
+
"4xl": "size-5"
|
|
745
|
+
};
|
|
746
|
+
var AvatarOnlineIndicator = ({ size, status, className }) => /* @__PURE__ */ jsx(
|
|
747
|
+
"span",
|
|
748
|
+
{
|
|
749
|
+
className: cx(
|
|
750
|
+
"absolute right-0 bottom-0 flex justify-center rounded-full ring-[1.5px] ring-bg-primary",
|
|
751
|
+
status === "online" ? "bg-fg-success-secondary" : "bg-utility-neutral-300",
|
|
752
|
+
sizes[size],
|
|
753
|
+
className
|
|
754
|
+
),
|
|
755
|
+
style: {
|
|
756
|
+
backgroundImage: "radial-gradient(43.75% 43.75% at 50% 28.75%, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.00) 100%), radial-gradient(50% 50% at 50% 50%, rgba(255, 255, 255, 0.00) 74.66%, rgba(255, 255, 255, 0.18) 100%), radial-gradient(75% 75% at 50% 0%, rgba(255, 255, 255, 0.00) 0%, rgba(255, 255, 255, 0.00) 50%, rgba(255, 255, 255, 0.08) 99%, rgba(255, 255, 255, 0.00) 100%)"
|
|
757
|
+
},
|
|
758
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 7.2 2.85", fill: "none", className: "mt-[10%] h-[20%] w-[60%]", children: [
|
|
759
|
+
/* @__PURE__ */ jsx(
|
|
760
|
+
"path",
|
|
761
|
+
{
|
|
762
|
+
d: "M7.2 1.83107C7.2 2.84235 5.58823 2.19729 3.6 2.19729C1.61177 2.19729 0 2.84235 0 1.83107C0 0.8198 1.61177 0 3.6 0C5.58823 0 7.2 0.8198 7.2 1.83107Z",
|
|
763
|
+
fill: "url(#reflection-gradient)",
|
|
764
|
+
fillOpacity: "0.4"
|
|
765
|
+
}
|
|
766
|
+
),
|
|
767
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "reflection-gradient", x1: "3.6", y1: "0", x2: "3.6", y2: "2.4", gradientUnits: "userSpaceOnUse", children: [
|
|
768
|
+
/* @__PURE__ */ jsx("stop", { stopColor: "white" }),
|
|
769
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.1" })
|
|
770
|
+
] }) })
|
|
771
|
+
] })
|
|
772
|
+
}
|
|
773
|
+
);
|
|
774
|
+
var sizes2 = {
|
|
775
|
+
xs: "size-2.5",
|
|
776
|
+
sm: "size-3",
|
|
777
|
+
md: "size-3.5",
|
|
778
|
+
lg: "size-4",
|
|
779
|
+
xl: "size-4.5",
|
|
780
|
+
"2xl": "size-5",
|
|
781
|
+
"3xl": "size-6",
|
|
782
|
+
"4xl": "size-8"
|
|
783
|
+
};
|
|
784
|
+
var VerifiedTick = ({ size, className }) => /* @__PURE__ */ jsxs("svg", { className: cx("z-10 text-utility-blue-500", sizes2[size], className), viewBox: "0 0 10 10", fill: "none", children: [
|
|
785
|
+
/* @__PURE__ */ jsx(
|
|
786
|
+
"path",
|
|
787
|
+
{
|
|
788
|
+
d: "M7.72237 1.77098C7.81734 2.00068 7.99965 2.18326 8.2292 2.27858L9.03413 2.61199C9.26384 2.70714 9.44635 2.88965 9.5415 3.11936C9.63665 3.34908 9.63665 3.60718 9.5415 3.83689L9.20833 4.64125C9.11313 4.87106 9.113 5.12943 9.20863 5.35913L9.54122 6.16325C9.58839 6.27702 9.61268 6.39897 9.6127 6.52214C9.61272 6.6453 9.58847 6.76726 9.54134 6.88105C9.4942 6.99484 9.42511 7.09823 9.33801 7.18531C9.2509 7.27238 9.14749 7.34144 9.03369 7.38854L8.22934 7.72171C7.99964 7.81669 7.81706 7.99899 7.72174 8.22855L7.38833 9.03348C7.29318 9.26319 7.11067 9.4457 6.88096 9.54085C6.65124 9.636 6.39314 9.636 6.16343 9.54085L5.35907 9.20767C5.12935 9.11276 4.87134 9.11295 4.64177 9.20821L3.83684 9.54115C3.60725 9.63608 3.34937 9.636 3.11984 9.54092C2.89032 9.44585 2.70791 9.26356 2.6127 9.03409L2.27918 8.22892C2.18421 7.99923 2.0019 7.81665 1.77235 7.72133L0.967421 7.38792C0.737807 7.29281 0.555355 7.11041 0.460169 6.88083C0.364983 6.65125 0.364854 6.39327 0.45981 6.16359L0.792984 5.35924C0.8879 5.12952 0.887707 4.87151 0.792445 4.64193L0.459749 3.83642C0.41258 3.72265 0.388291 3.60069 0.388272 3.47753C0.388252 3.35436 0.412501 3.2324 0.459634 3.11861C0.506767 3.00482 0.57586 2.90144 0.662965 2.81436C0.75007 2.72728 0.853479 2.65822 0.967283 2.61113L1.77164 2.27795C2.00113 2.18306 2.1836 2.00099 2.27899 1.7717L2.6124 0.966768C2.70755 0.737054 2.89006 0.554547 3.11978 0.459397C3.34949 0.364246 3.60759 0.364246 3.83731 0.459397L4.64166 0.792571C4.87138 0.887487 5.12939 0.887293 5.35897 0.792031L6.16424 0.459913C6.39392 0.364816 6.65197 0.364836 6.88164 0.459968C7.11131 0.555099 7.29379 0.737554 7.38895 0.967208L7.72247 1.77238L7.72237 1.77098Z",
|
|
789
|
+
className: "fill-current"
|
|
790
|
+
}
|
|
791
|
+
),
|
|
792
|
+
/* @__PURE__ */ jsx(
|
|
793
|
+
"path",
|
|
794
|
+
{
|
|
795
|
+
fillRule: "evenodd",
|
|
796
|
+
clipRule: "evenodd",
|
|
797
|
+
d: "M6.95829 3.68932C7.02509 3.58439 7.04747 3.45723 7.02051 3.3358C6.99356 3.21437 6.91946 3.10862 6.81454 3.04182C6.70961 2.97502 6.58245 2.95264 6.46102 2.97959C6.33959 3.00655 6.23384 3.08064 6.16704 3.18557L4.33141 6.06995L3.49141 5.01995C3.41375 4.92281 3.30069 4.8605 3.17709 4.84673C3.05349 4.83296 2.92949 4.86885 2.83235 4.94651C2.73522 5.02417 2.67291 5.13723 2.65914 5.26083C2.64536 5.38443 2.68125 5.50843 2.75891 5.60557L4.00891 7.16807C4.0555 7.22638 4.11533 7.27271 4.18344 7.30323C4.25154 7.33375 4.32595 7.34757 4.40047 7.34353C4.47499 7.3395 4.54747 7.31773 4.61188 7.28004C4.67629 7.24234 4.73077 7.18981 4.77079 7.12682L6.95829 3.68932Z",
|
|
798
|
+
fill: "white"
|
|
799
|
+
}
|
|
800
|
+
)
|
|
801
|
+
] });
|
|
802
|
+
var AvatarCount = ({ count, className }) => /* @__PURE__ */ jsx("div", { className: cx("absolute right-0 bottom-0 p-px", className), children: /* @__PURE__ */ jsx("div", { className: "flex size-3.5 items-center justify-center rounded-full bg-fg-error-primary text-center text-[10px] leading-[13px] font-bold text-white", children: count }) });
|
|
803
|
+
var styles3 = {
|
|
804
|
+
xs: { root: "size-6", rootWithBorder: "p-px", initials: "text-xs font-semibold", icon: "size-4" },
|
|
805
|
+
sm: { root: "size-8", rootWithBorder: "p-px", initials: "text-sm font-semibold", icon: "size-5" },
|
|
806
|
+
md: { root: "size-10", rootWithBorder: "p-px", initials: "text-md font-semibold", icon: "size-6" },
|
|
807
|
+
lg: { root: "size-12", rootWithBorder: "p-[1.5px]", initials: "text-lg font-semibold", icon: "size-7" },
|
|
808
|
+
xl: { root: "size-14", rootWithBorder: "p-0.5", initials: "text-xl font-semibold", icon: "size-8" },
|
|
809
|
+
"2xl": { root: "size-16", rootWithBorder: "p-0.5", initials: "text-display-xs font-semibold", icon: "size-8" }
|
|
810
|
+
};
|
|
811
|
+
var Avatar = ({
|
|
812
|
+
size = "md",
|
|
813
|
+
src,
|
|
814
|
+
alt,
|
|
815
|
+
initials,
|
|
816
|
+
placeholder,
|
|
817
|
+
placeholderIcon: PlaceholderIcon,
|
|
818
|
+
border,
|
|
819
|
+
badge,
|
|
820
|
+
status,
|
|
821
|
+
verified,
|
|
822
|
+
count,
|
|
823
|
+
focusable = false,
|
|
824
|
+
rounded = true,
|
|
825
|
+
className,
|
|
826
|
+
contentClassName
|
|
827
|
+
}) => {
|
|
828
|
+
const [isFailed, setIsFailed] = useState(false);
|
|
829
|
+
const canShowImage = src && !isFailed;
|
|
830
|
+
const renderMainContent = () => {
|
|
831
|
+
if (canShowImage) {
|
|
832
|
+
return /* @__PURE__ */ jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src, alt, onError: () => setIsFailed(true) });
|
|
833
|
+
}
|
|
834
|
+
if (initials) {
|
|
835
|
+
return /* @__PURE__ */ jsx("span", { className: cx("text-quaternary", styles3[size].initials), children: initials });
|
|
836
|
+
}
|
|
837
|
+
if (PlaceholderIcon) {
|
|
838
|
+
return /* @__PURE__ */ jsx(PlaceholderIcon, { className: cx("text-fg-quaternary", styles3[size].icon) });
|
|
839
|
+
}
|
|
840
|
+
return placeholder || /* @__PURE__ */ jsx(UserIcon, { className: cx("text-fg-quaternary", styles3[size].icon) });
|
|
841
|
+
};
|
|
842
|
+
const renderBadgeContent = () => {
|
|
843
|
+
if (status) {
|
|
844
|
+
return /* @__PURE__ */ jsx(AvatarOnlineIndicator, { status, size });
|
|
845
|
+
}
|
|
846
|
+
if (verified) {
|
|
847
|
+
return /* @__PURE__ */ jsx(VerifiedTick, { size, className: cx("absolute right-0 bottom-0", size === "xs" && "-right-px -bottom-px") });
|
|
848
|
+
}
|
|
849
|
+
if (count) {
|
|
850
|
+
return /* @__PURE__ */ jsx(AvatarCount, { count });
|
|
851
|
+
}
|
|
852
|
+
return badge;
|
|
853
|
+
};
|
|
854
|
+
return /* @__PURE__ */ jsxs(
|
|
855
|
+
"div",
|
|
856
|
+
{
|
|
857
|
+
"data-avatar": true,
|
|
858
|
+
className: cx(
|
|
859
|
+
"relative inline-flex shrink-0 rounded-[7px]",
|
|
860
|
+
rounded && "rounded-full",
|
|
861
|
+
// Focus styles
|
|
862
|
+
focusable && "outline-none group-focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
|
|
863
|
+
border && "ring-1 ring-secondary_alt",
|
|
864
|
+
border && styles3[size].rootWithBorder,
|
|
865
|
+
styles3[size].root,
|
|
866
|
+
className
|
|
867
|
+
),
|
|
868
|
+
children: [
|
|
869
|
+
/* @__PURE__ */ jsx(
|
|
870
|
+
"div",
|
|
871
|
+
{
|
|
872
|
+
className: cx(
|
|
873
|
+
"relative inline-flex size-full shrink-0 items-center justify-center overflow-hidden rounded-md bg-tertiary outline-[0.5px] -outline-offset-[0.5px] outline-black/16 before:inset-[0.5px]",
|
|
874
|
+
rounded && "rounded-full",
|
|
875
|
+
canShowImage && size !== "xs" && "before:absolute before:inset-0 before:rounded-[inherit] before:border before:border-white/32 before:mask-[linear-gradient(to_bottom,black_0%,transparent_25%,transparent_75%,black_100%)]",
|
|
876
|
+
contentClassName
|
|
877
|
+
),
|
|
878
|
+
children: renderMainContent()
|
|
879
|
+
}
|
|
880
|
+
),
|
|
881
|
+
renderBadgeContent()
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
);
|
|
885
|
+
};
|
|
886
|
+
var CHECKBOX_TICK_DELAY_MS = 60;
|
|
887
|
+
var CHECKBOX_TICK_DRAW_MS = 100;
|
|
888
|
+
function CheckboxAnimatedCheckMark({ pixelSize, className }) {
|
|
889
|
+
const pathRef = useRef(null);
|
|
890
|
+
useLayoutEffect(() => {
|
|
891
|
+
const path = pathRef.current;
|
|
892
|
+
if (!path || typeof path.getTotalLength !== "function") return;
|
|
893
|
+
const len = path.getTotalLength();
|
|
894
|
+
if (len <= 0) return;
|
|
895
|
+
path.style.strokeDasharray = `${len}`;
|
|
896
|
+
path.style.strokeDashoffset = `${len}`;
|
|
897
|
+
if (typeof path.animate !== "function") {
|
|
898
|
+
path.style.strokeDashoffset = "0";
|
|
899
|
+
return;
|
|
900
|
+
}
|
|
901
|
+
const anim = path.animate([{ strokeDashoffset: len }, { strokeDashoffset: 0 }], {
|
|
902
|
+
duration: CHECKBOX_TICK_DRAW_MS,
|
|
903
|
+
delay: CHECKBOX_TICK_DELAY_MS,
|
|
904
|
+
easing: "cubic-bezier(0.45, 0, 0.2, 1)",
|
|
905
|
+
fill: "forwards"
|
|
906
|
+
});
|
|
907
|
+
return () => anim.cancel();
|
|
908
|
+
}, []);
|
|
909
|
+
return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", width: pixelSize, height: pixelSize, viewBox: "0 0 14 14", fill: "none", className: cx("block", className), children: /* @__PURE__ */ jsx(
|
|
910
|
+
"path",
|
|
911
|
+
{
|
|
912
|
+
ref: pathRef,
|
|
913
|
+
d: "M2.33325 7L5.24992 9.91667L11.6666 3.5",
|
|
914
|
+
stroke: "currentColor",
|
|
915
|
+
strokeWidth: "2",
|
|
916
|
+
strokeLinecap: "round",
|
|
917
|
+
strokeLinejoin: "round"
|
|
918
|
+
}
|
|
919
|
+
) });
|
|
920
|
+
}
|
|
921
|
+
var focusRingShadow = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
922
|
+
var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = "sm", isFocusVisible = false }) => {
|
|
923
|
+
const isChecked = isSelected || isIndeterminate;
|
|
924
|
+
const iconPixelSize = size === "sm" ? 10 : 14;
|
|
925
|
+
return /* @__PURE__ */ jsxs(
|
|
926
|
+
"div",
|
|
927
|
+
{
|
|
928
|
+
className: cx(
|
|
929
|
+
"relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip border border-solid border-primary",
|
|
930
|
+
size === "sm" ? "size-4 rounded-xs" : "size-5 rounded-sm",
|
|
931
|
+
isChecked ? "border-transparent bg-brand-solid" : "bg-primary",
|
|
932
|
+
!isChecked && !isDisabled && "group-hover:bg-primary_hover",
|
|
933
|
+
isDisabled && "cursor-not-allowed opacity-50",
|
|
934
|
+
isDisabled && !isChecked && "bg-tertiary",
|
|
935
|
+
isFocusVisible && !isDisabled && focusRingShadow,
|
|
936
|
+
className
|
|
937
|
+
),
|
|
938
|
+
children: [
|
|
939
|
+
isIndeterminate && /* @__PURE__ */ jsx(
|
|
940
|
+
"svg",
|
|
941
|
+
{
|
|
942
|
+
"aria-hidden": "true",
|
|
943
|
+
width: iconPixelSize,
|
|
944
|
+
height: iconPixelSize,
|
|
945
|
+
viewBox: "0 0 14 14",
|
|
946
|
+
fill: "none",
|
|
947
|
+
className: "pointer-events-none block text-fg-white",
|
|
948
|
+
children: /* @__PURE__ */ jsx("path", { d: "M2.91675 7H11.0834", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
949
|
+
}
|
|
950
|
+
),
|
|
951
|
+
isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { pixelSize: iconPixelSize, className: "pointer-events-none text-fg-white" })
|
|
952
|
+
]
|
|
953
|
+
}
|
|
954
|
+
);
|
|
955
|
+
};
|
|
956
|
+
CheckboxBase.displayName = "CheckboxBase";
|
|
957
|
+
var sizes3 = {
|
|
958
|
+
sm: {
|
|
959
|
+
root: "py-2 pl-3 pr-2.5 gap-2 *:data-icon:size-4 *:data-icon:stroke-[2.25px]",
|
|
960
|
+
withIcon: "",
|
|
961
|
+
text: "text-sm",
|
|
962
|
+
textContainer: "gap-x-1.5",
|
|
963
|
+
shortcut: "pr-2.5"
|
|
964
|
+
},
|
|
965
|
+
md: { root: "py-2 px-3 gap-2 *:data-icon:size-5", withIcon: "", text: "text-md", textContainer: "gap-x-1.5", shortcut: "pr-2.5" },
|
|
966
|
+
lg: { root: "py-2.5 px-3.5 gap-2 *:data-icon:size-5", withIcon: "", text: "text-md", textContainer: "gap-x-1.5", shortcut: "pr-3" }
|
|
967
|
+
};
|
|
968
|
+
var searchSizes = {
|
|
969
|
+
sm: { wrapper: "py-1", root: "px-3 py-2 gap-2 *:data-icon:size-4 *:data-icon:stroke-[2.25px]", text: "text-sm" },
|
|
970
|
+
md: { wrapper: "py-0.5", root: "px-3 py-2 gap-2 *:data-icon:size-5", text: "text-md" },
|
|
971
|
+
lg: { wrapper: "py-0.5", root: "px-3.5 py-2.5 gap-2 *:data-icon:size-5", text: "text-md" }
|
|
972
|
+
};
|
|
973
|
+
var SelectContext = createContext({ size: "md" });
|
|
974
|
+
var sizes4 = {
|
|
975
|
+
sm: {
|
|
976
|
+
root: "p-2 pr-2.5 gap-2 *:data-icon:size-4 *:data-icon:stroke-[2.25px]",
|
|
977
|
+
text: "text-sm",
|
|
978
|
+
textContainer: "gap-x-1.5",
|
|
979
|
+
check: "size-4 stroke-[2.25px]",
|
|
980
|
+
checkbox: "sm"
|
|
981
|
+
},
|
|
982
|
+
md: {
|
|
983
|
+
root: "p-2 pr-2.5 gap-2 *:data-icon:size-5",
|
|
984
|
+
text: "text-md",
|
|
985
|
+
textContainer: "gap-x-2",
|
|
986
|
+
check: "size-5",
|
|
987
|
+
checkbox: "sm"
|
|
988
|
+
},
|
|
989
|
+
lg: {
|
|
990
|
+
root: "p-2.5 pl-2 gap-2 *:data-icon:size-5",
|
|
991
|
+
text: "text-md",
|
|
992
|
+
textContainer: "gap-x-2",
|
|
993
|
+
check: "size-5",
|
|
994
|
+
checkbox: "md"
|
|
995
|
+
}
|
|
996
|
+
};
|
|
997
|
+
var SelectItem = ({
|
|
998
|
+
label,
|
|
999
|
+
id,
|
|
1000
|
+
value,
|
|
1001
|
+
avatarUrl,
|
|
1002
|
+
supportingText,
|
|
1003
|
+
isDisabled,
|
|
1004
|
+
icon: Icon,
|
|
1005
|
+
className,
|
|
1006
|
+
children,
|
|
1007
|
+
selectionIndicator = "checkmark",
|
|
1008
|
+
selectionIndicatorAlign = "right",
|
|
1009
|
+
...props
|
|
1010
|
+
}) => {
|
|
1011
|
+
const { size } = useContext(SelectContext);
|
|
1012
|
+
const labelOrChildren = label || (typeof children === "string" ? children : "");
|
|
1013
|
+
const textValue = supportingText ? labelOrChildren + " " + supportingText : labelOrChildren;
|
|
1014
|
+
const isLeft = selectionIndicatorAlign === "left";
|
|
1015
|
+
return /* @__PURE__ */ jsx(
|
|
1016
|
+
ListBoxItem,
|
|
1017
|
+
{
|
|
1018
|
+
id,
|
|
1019
|
+
value: value ?? {
|
|
1020
|
+
id,
|
|
1021
|
+
label: labelOrChildren,
|
|
1022
|
+
avatarUrl,
|
|
1023
|
+
supportingText,
|
|
1024
|
+
isDisabled,
|
|
1025
|
+
icon: Icon
|
|
1026
|
+
},
|
|
1027
|
+
textValue,
|
|
1028
|
+
isDisabled,
|
|
1029
|
+
...props,
|
|
1030
|
+
className: (state) => cx("w-full py-px outline-hidden", size === "sm" ? "px-1" : "px-1.5", typeof className === "function" ? className(state) : className),
|
|
1031
|
+
children: (state) => /* @__PURE__ */ jsxs(
|
|
1032
|
+
"div",
|
|
1033
|
+
{
|
|
1034
|
+
className: cx(
|
|
1035
|
+
"flex cursor-pointer items-center rounded-md outline-hidden select-none",
|
|
1036
|
+
(state.isFocused || state.isHovered) && !(state.isSelected && selectionIndicator !== "checkbox") && "bg-primary_hover",
|
|
1037
|
+
state.isSelected && selectionIndicator !== "checkbox" && "bg-brand-primary_alt",
|
|
1038
|
+
state.isDisabled && "cursor-not-allowed opacity-50",
|
|
1039
|
+
// Icon styles
|
|
1040
|
+
"*:data-icon:shrink-0 *:data-icon:text-fg-quaternary",
|
|
1041
|
+
sizes4[size].root
|
|
1042
|
+
),
|
|
1043
|
+
children: [
|
|
1044
|
+
isLeft && selectionIndicator === "checkbox" && /* @__PURE__ */ jsx(CheckboxBase, { size: sizes4[size].checkbox, isSelected: state.isSelected, isDisabled: state.isDisabled }),
|
|
1045
|
+
avatarUrl ? /* @__PURE__ */ jsx(Avatar, { "aria-hidden": "true", size: "xs", src: avatarUrl, alt: label, className: cx(size === "sm" && "size-5") }) : isReactComponent(Icon) ? /* @__PURE__ */ jsx(Icon, { "data-icon": true, "aria-hidden": "true" }) : isValidElement(Icon) ? Icon : null,
|
|
1046
|
+
/* @__PURE__ */ jsxs("div", { className: cx("flex w-full min-w-0 flex-1 flex-wrap", sizes4[size].textContainer), children: [
|
|
1047
|
+
/* @__PURE__ */ jsx(Text, { slot: "label", className: cx("truncate font-medium whitespace-nowrap text-primary", sizes4[size].text), children: label || (typeof children === "function" ? children(state) : children) }),
|
|
1048
|
+
supportingText && /* @__PURE__ */ jsx(Text, { slot: "description", className: cx("whitespace-nowrap text-tertiary", sizes4[size].text), children: supportingText })
|
|
1049
|
+
] }),
|
|
1050
|
+
state.isSelected && selectionIndicator === "checkmark" && /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true", className: cx("ml-auto text-fg-brand-primary", sizes4[size].check) }),
|
|
1051
|
+
!isLeft && selectionIndicator === "checkbox" && /* @__PURE__ */ jsx(CheckboxBase, { size: sizes4[size].checkbox, isSelected: state.isSelected, isDisabled: state.isDisabled, className: "ml-auto" })
|
|
1052
|
+
]
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
}
|
|
1056
|
+
);
|
|
1057
|
+
};
|
|
1058
|
+
var footerButtonSize = {
|
|
1059
|
+
sm: "xs",
|
|
1060
|
+
md: "sm",
|
|
1061
|
+
lg: "sm"
|
|
1062
|
+
};
|
|
1063
|
+
var popoverMaxHeights = {
|
|
1064
|
+
sm: "max-h-68",
|
|
1065
|
+
md: "max-h-76",
|
|
1066
|
+
lg: "max-h-92"
|
|
1067
|
+
};
|
|
1068
|
+
var MultiSelectFooter = ({ size = "sm", onReset, onSelectAll, className }) => {
|
|
1069
|
+
const btnSize = footerButtonSize[size];
|
|
1070
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex items-center justify-between border-t border-secondary p-3", className), children: [
|
|
1071
|
+
/* @__PURE__ */ jsx(Button, { size: btnSize, color: "secondary", onClick: onReset, children: "Reset" }),
|
|
1072
|
+
/* @__PURE__ */ jsx(Button, { size: btnSize, color: "secondary", onClick: onSelectAll, children: "Select all" })
|
|
1073
|
+
] });
|
|
1074
|
+
};
|
|
1075
|
+
var MultiSelectEmptyState = ({
|
|
1076
|
+
title = "No results found",
|
|
1077
|
+
description = "Please try a different search term.",
|
|
1078
|
+
onClearSearch,
|
|
1079
|
+
className
|
|
1080
|
+
}) => /* @__PURE__ */ jsxs("div", { className: cx("flex flex-col items-center gap-3 px-4 py-4", className), children: [
|
|
1081
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-3", children: [
|
|
1082
|
+
/* @__PURE__ */ jsx(FeaturedIcon, { icon: MagnifyingGlassIcon, size: "sm", color: "gray", theme: "modern" }),
|
|
1083
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5 text-center text-sm", children: [
|
|
1084
|
+
/* @__PURE__ */ jsx("p", { className: "font-semibold text-primary", children: title }),
|
|
1085
|
+
/* @__PURE__ */ jsx("p", { className: "text-tertiary", children: description })
|
|
1086
|
+
] })
|
|
1087
|
+
] }),
|
|
1088
|
+
onClearSearch && /* @__PURE__ */ jsx(Button, { size: "sm", color: "link-color", onClick: onClearSearch, children: "Clear search" })
|
|
1089
|
+
] });
|
|
1090
|
+
var MultiSelectRoot = ({
|
|
1091
|
+
items,
|
|
1092
|
+
children,
|
|
1093
|
+
size = "md",
|
|
1094
|
+
selectedKeys,
|
|
1095
|
+
defaultSelectedKeys,
|
|
1096
|
+
onSelectionChange,
|
|
1097
|
+
isDisabled,
|
|
1098
|
+
isRequired,
|
|
1099
|
+
isInvalid,
|
|
1100
|
+
placeholder = "Select",
|
|
1101
|
+
label,
|
|
1102
|
+
hint,
|
|
1103
|
+
tooltip,
|
|
1104
|
+
hideRequiredIndicator,
|
|
1105
|
+
popoverClassName,
|
|
1106
|
+
mobileOptions,
|
|
1107
|
+
className,
|
|
1108
|
+
onReset,
|
|
1109
|
+
onSelectAll,
|
|
1110
|
+
showFooter = true,
|
|
1111
|
+
showSearch = true,
|
|
1112
|
+
emptyStateTitle,
|
|
1113
|
+
emptyStateDescription,
|
|
1114
|
+
selectedCountFormatter,
|
|
1115
|
+
supportingText
|
|
1116
|
+
}) => {
|
|
1117
|
+
const isMobile = useIsMobile();
|
|
1118
|
+
const { contains } = useFilter({ sensitivity: "base" });
|
|
1119
|
+
const [searchValue, setSearchValue] = useState("");
|
|
1120
|
+
const triggerRef = useRef(null);
|
|
1121
|
+
const [popoverWidth, setPopoverWidth] = useState("");
|
|
1122
|
+
const onResize = useCallback(() => {
|
|
1123
|
+
if (!triggerRef.current) return;
|
|
1124
|
+
const rect = triggerRef.current.getBoundingClientRect();
|
|
1125
|
+
setPopoverWidth(rect.width + "px");
|
|
1126
|
+
}, []);
|
|
1127
|
+
const selectedCount = selectedKeys instanceof Set ? selectedKeys.size : selectedKeys === "all" ? items?.length ?? 0 : 0;
|
|
1128
|
+
const hasSelection = selectedCount > 0;
|
|
1129
|
+
const handleClearSearch = useCallback(() => {
|
|
1130
|
+
setSearchValue("");
|
|
1131
|
+
}, []);
|
|
1132
|
+
return /* @__PURE__ */ jsx(SelectContext.Provider, { value: { size }, children: /* @__PURE__ */ jsxs("div", { className: cx("flex flex-col gap-1.5", className), children: [
|
|
1133
|
+
label && /* @__PURE__ */ jsx(Label, { isRequired: hideRequiredIndicator ? false : isRequired, isInvalid, tooltip, children: label }),
|
|
1134
|
+
/* @__PURE__ */ jsxs(DialogTrigger, { children: [
|
|
1135
|
+
/* @__PURE__ */ jsx(
|
|
1136
|
+
Button$1,
|
|
1137
|
+
{
|
|
1138
|
+
ref: triggerRef,
|
|
1139
|
+
isDisabled,
|
|
1140
|
+
onClick: onResize,
|
|
1141
|
+
className: (state) => cx(
|
|
1142
|
+
"relative flex w-full cursor-pointer items-center rounded-lg border border-solid border-primary bg-primary shadow-xs outline-hidden transition-[border-color,box-shadow] duration-100 ease-linear",
|
|
1143
|
+
!isInvalid && (state.isFocusVisible || state.isPressed) && inputFocusRingShadow,
|
|
1144
|
+
isInvalid && !state.isFocusVisible && !state.isPressed && "border-error_subtle",
|
|
1145
|
+
isInvalid && (state.isFocusVisible || state.isPressed) && inputErrorFocusRingShadow,
|
|
1146
|
+
state.isDisabled && "cursor-not-allowed opacity-50"
|
|
1147
|
+
),
|
|
1148
|
+
children: /* @__PURE__ */ jsxs(
|
|
1149
|
+
"span",
|
|
1150
|
+
{
|
|
1151
|
+
className: cx(
|
|
1152
|
+
"flex w-full items-center truncate text-left",
|
|
1153
|
+
sizes3[size].root,
|
|
1154
|
+
"*:data-icon:shrink-0 *:data-icon:text-fg-quaternary"
|
|
1155
|
+
),
|
|
1156
|
+
children: [
|
|
1157
|
+
hasSelection ? /* @__PURE__ */ jsxs("span", { className: cx("flex items-center", sizes3[size].textContainer), children: [
|
|
1158
|
+
/* @__PURE__ */ jsx("span", { className: cx("font-medium text-primary", sizes3[size].text), children: selectedCountFormatter ? selectedCountFormatter(selectedCount) : `${selectedCount} selected` }),
|
|
1159
|
+
supportingText && /* @__PURE__ */ jsx("span", { className: cx("text-tertiary", sizes3[size].text), children: supportingText })
|
|
1160
|
+
] }) : /* @__PURE__ */ jsx("span", { className: cx("text-placeholder", sizes3[size].text), children: placeholder }),
|
|
1161
|
+
/* @__PURE__ */ jsx(
|
|
1162
|
+
CaretDownIcon,
|
|
1163
|
+
{
|
|
1164
|
+
"aria-hidden": "true",
|
|
1165
|
+
className: cx("ml-auto shrink-0 text-fg-quaternary", size === "lg" ? "size-5" : "size-4 stroke-[2.25px]")
|
|
1166
|
+
}
|
|
1167
|
+
)
|
|
1168
|
+
]
|
|
1169
|
+
}
|
|
1170
|
+
)
|
|
1171
|
+
}
|
|
1172
|
+
),
|
|
1173
|
+
/* @__PURE__ */ jsx(
|
|
1174
|
+
Popover,
|
|
1175
|
+
{
|
|
1176
|
+
size,
|
|
1177
|
+
triggerRef,
|
|
1178
|
+
compoundContent: true,
|
|
1179
|
+
style: { width: popoverWidth || void 0 },
|
|
1180
|
+
className: popoverClassName,
|
|
1181
|
+
mobileOptions: { title: label, ...mobileOptions },
|
|
1182
|
+
children: /* @__PURE__ */ jsxs(Dialog, { className: "flex flex-col overflow-hidden outline-hidden", children: [
|
|
1183
|
+
/* @__PURE__ */ jsxs(Autocomplete, { filter: contains, inputValue: searchValue, onInputChange: setSearchValue, children: [
|
|
1184
|
+
showSearch && /* @__PURE__ */ jsx("div", { className: cx("shrink-0 border-b border-secondary", searchSizes[size].wrapper), children: /* @__PURE__ */ jsx(SearchField, { "aria-label": "Search", value: searchValue, onChange: setSearchValue, autoFocus: !isMobile, children: /* @__PURE__ */ jsxs("div", { className: cx("flex items-center", searchSizes[size].root), children: [
|
|
1185
|
+
/* @__PURE__ */ jsx(MagnifyingGlassIcon, { "data-icon": true, "aria-hidden": "true", className: "shrink-0 text-fg-quaternary" }),
|
|
1186
|
+
/* @__PURE__ */ jsx(
|
|
1187
|
+
Input,
|
|
1188
|
+
{
|
|
1189
|
+
placeholder: "Search",
|
|
1190
|
+
className: cx(
|
|
1191
|
+
"w-full appearance-none bg-transparent text-primary caret-alpha-black/90 outline-hidden placeholder:text-placeholder",
|
|
1192
|
+
searchSizes[size].text
|
|
1193
|
+
)
|
|
1194
|
+
}
|
|
1195
|
+
)
|
|
1196
|
+
] }) }) }),
|
|
1197
|
+
/* @__PURE__ */ jsx(
|
|
1198
|
+
ListBox,
|
|
1199
|
+
{
|
|
1200
|
+
"aria-label": label || "Options",
|
|
1201
|
+
items,
|
|
1202
|
+
selectionMode: "multiple",
|
|
1203
|
+
selectedKeys,
|
|
1204
|
+
defaultSelectedKeys,
|
|
1205
|
+
onSelectionChange,
|
|
1206
|
+
renderEmptyState: () => /* @__PURE__ */ jsx(
|
|
1207
|
+
MultiSelectEmptyState,
|
|
1208
|
+
{
|
|
1209
|
+
title: emptyStateTitle,
|
|
1210
|
+
description: emptyStateDescription,
|
|
1211
|
+
onClearSearch: searchValue ? handleClearSearch : void 0
|
|
1212
|
+
}
|
|
1213
|
+
),
|
|
1214
|
+
className: cx(
|
|
1215
|
+
"min-h-0 overflow-y-auto py-1 outline-hidden",
|
|
1216
|
+
!isMobile && popoverMaxHeights[size]
|
|
1217
|
+
),
|
|
1218
|
+
children
|
|
1219
|
+
}
|
|
1220
|
+
)
|
|
1221
|
+
] }),
|
|
1222
|
+
showFooter && /* @__PURE__ */ jsx(MultiSelectFooter, { size, onReset, onSelectAll, className: "shrink-0" })
|
|
1223
|
+
] })
|
|
1224
|
+
}
|
|
1225
|
+
)
|
|
1226
|
+
] }),
|
|
1227
|
+
hint && /* @__PURE__ */ jsx(HintText, { isInvalid, className: cx(size === "sm" && "text-xs"), children: hint })
|
|
1228
|
+
] }) });
|
|
1229
|
+
};
|
|
1230
|
+
var MultiSelect = MultiSelectRoot;
|
|
1231
|
+
MultiSelect.Item = SelectItem;
|
|
1232
|
+
MultiSelect.Footer = MultiSelectFooter;
|
|
1233
|
+
MultiSelect.EmptyState = MultiSelectEmptyState;
|
|
1234
|
+
|
|
1235
|
+
export { MultiSelect };
|
|
1236
|
+
//# sourceMappingURL=multi-select.js.map
|
|
1237
|
+
//# sourceMappingURL=multi-select.js.map
|