@avenue-ticketing/ui 0.10.0 → 0.12.0-beta.1
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 +112 -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 +17 -0
- package/dist/react/combobox.js +322 -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 +319 -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 +773 -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 +549 -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 +527 -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 +507 -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 +790 -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 +799 -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 +501 -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 +754 -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 +543 -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 +505 -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 +1325 -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 +998 -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 +960 -0
- package/dist/react/dropdown-search-simple.js.map +1 -0
- package/dist/react/dropdown.d.ts +32 -133
- package/dist/react/dropdown.js +404 -1351
- 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 +89 -0
- package/dist/react/multi-select.js +1036 -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 +7 -73
- package/dist/react/popover.js +23 -569
- 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 +116 -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 +13 -0
- package/dist/react/select-item.js +336 -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 +18 -61
- package/dist/react/select.js +625 -923
- 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 +44 -0
- package/dist/react/tag-select.js +1062 -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-shared-B3Y5SMXU.d.ts +62 -0
- package/package.json +28 -21
- package/source.css +2 -12
- 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,960 @@
|
|
|
1
|
+
import { createContext, useState, isValidElement, useContext, useCallback, useRef, 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, MenuTrigger, Autocomplete, SearchField, Link, Button as Button$1, Popover, Group, Input, Menu, MenuItem, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, OverlayArrow } from 'react-aria-components';
|
|
5
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
6
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
+
import { CheckIcon } from '@phosphor-icons/react/dist/csr/Check';
|
|
8
|
+
import { CaretRightIcon } from '@phosphor-icons/react/dist/csr/CaretRight';
|
|
9
|
+
import '@phosphor-icons/react/dist/csr/DotsThreeVertical';
|
|
10
|
+
import { UserIcon } from '@phosphor-icons/react/dist/csr/User';
|
|
11
|
+
import '@phosphor-icons/react/dist/csr/Plus';
|
|
12
|
+
import { EyeIcon } from '@phosphor-icons/react/dist/csr/Eye';
|
|
13
|
+
import { EyeSlashIcon } from '@phosphor-icons/react/dist/csr/EyeSlash';
|
|
14
|
+
import { QuestionIcon } from '@phosphor-icons/react/dist/csr/Question';
|
|
15
|
+
import { InfoIcon } from '@phosphor-icons/react/dist/csr/Info';
|
|
16
|
+
|
|
17
|
+
var twMerge = extendTailwindMerge({
|
|
18
|
+
extend: {
|
|
19
|
+
theme: {
|
|
20
|
+
text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var cx = twMerge;
|
|
25
|
+
function sortCx(classes) {
|
|
26
|
+
return classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ../../utils/is-react-component.ts
|
|
30
|
+
var isFunctionComponent = (component) => {
|
|
31
|
+
return typeof component === "function";
|
|
32
|
+
};
|
|
33
|
+
var isClassComponent = (component) => {
|
|
34
|
+
return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
|
|
35
|
+
};
|
|
36
|
+
var isForwardRefComponent = (component) => {
|
|
37
|
+
return typeof component === "object" && component !== null && component.$$typeof.toString() === "Symbol(react.forward_ref)";
|
|
38
|
+
};
|
|
39
|
+
var isReactComponent = (component) => {
|
|
40
|
+
return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
|
|
41
|
+
};
|
|
42
|
+
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)]";
|
|
43
|
+
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)]";
|
|
44
|
+
var skeuomorphicGradientBorderClass = [
|
|
45
|
+
"ring-1 ring-inset ring-transparent",
|
|
46
|
+
"before:pointer-events-none before:absolute before:inset-px before:rounded-[inherit] before:border before:border-[#ffffff1f] before:content-['']",
|
|
47
|
+
"before:[mask-image:linear-gradient(to_bottom,#000,transparent)]"
|
|
48
|
+
].join(" ");
|
|
49
|
+
var skeuomorphicShadowClass = ["shadow-xs-skeuomorphic", focusShadowSkeuomorphic, "overflow-hidden"].join(" ");
|
|
50
|
+
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)]";
|
|
51
|
+
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)]";
|
|
52
|
+
var secondaryShadowClass = ["relative overflow-hidden shadow-xs", secondaryInnerShadow, focusShadowSecondary].join(" ");
|
|
53
|
+
var inputNumberButtonClass = [
|
|
54
|
+
"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",
|
|
55
|
+
"in-data-number-input:before:hidden in-data-number-input:after:hidden",
|
|
56
|
+
"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]"
|
|
57
|
+
].join(" ");
|
|
58
|
+
var inputAddonButtonClass = [
|
|
59
|
+
"in-data-input-wrapper:border-0 in-data-input-wrapper:shadow-none in-data-input-wrapper:!rounded-none in-data-input-wrapper:overflow-hidden",
|
|
60
|
+
"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",
|
|
61
|
+
"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",
|
|
62
|
+
"in-data-input-wrapper:group-invalid:in-data-trailing:border-error_subtle in-data-input-wrapper:group-invalid:in-data-leading:border-error_subtle",
|
|
63
|
+
"in-data-input-wrapper:before:hidden in-data-input-wrapper:after:hidden",
|
|
64
|
+
"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]"
|
|
65
|
+
].join(" ");
|
|
66
|
+
var styles = sortCx({
|
|
67
|
+
common: {
|
|
68
|
+
root: [
|
|
69
|
+
"group relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-full font-body outline-none before:absolute",
|
|
70
|
+
"font-semibold transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out",
|
|
71
|
+
"pressed:scale-[0.985] pressed:duration-100 pressed:ease-linear motion-reduce:pressed:scale-100",
|
|
72
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed in-data-input-wrapper:disabled:opacity-100",
|
|
73
|
+
inputAddonButtonClass,
|
|
74
|
+
inputNumberButtonClass,
|
|
75
|
+
// Stretch to InputGroup row height; padding/typography follow `data-input-size` on the field (Figma 85:1269).
|
|
76
|
+
"in-data-input-wrapper:!h-full in-data-input-wrapper:!min-h-0 in-data-input-wrapper:self-stretch",
|
|
77
|
+
"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",
|
|
78
|
+
"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",
|
|
79
|
+
"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",
|
|
80
|
+
"*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:transition-inherit-all"
|
|
81
|
+
].join(" "),
|
|
82
|
+
icon: "pointer-events-none shrink-0 transition-inherit-all"
|
|
83
|
+
},
|
|
84
|
+
sizes: {
|
|
85
|
+
xs: {
|
|
86
|
+
root: [
|
|
87
|
+
"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",
|
|
88
|
+
"in-data-input-wrapper:data-icon-only:p-2.5",
|
|
89
|
+
"*:data-icon:size-4"
|
|
90
|
+
].join(" "),
|
|
91
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
|
|
92
|
+
},
|
|
93
|
+
sm: {
|
|
94
|
+
root: [
|
|
95
|
+
"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",
|
|
96
|
+
"in-data-input-wrapper:data-icon-only:p-2.5",
|
|
97
|
+
"*:data-icon:size-5"
|
|
98
|
+
].join(" "),
|
|
99
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
|
|
100
|
+
},
|
|
101
|
+
md: {
|
|
102
|
+
root: [
|
|
103
|
+
"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",
|
|
104
|
+
"in-data-input-wrapper:data-icon-only:p-3",
|
|
105
|
+
"*:data-icon:size-5"
|
|
106
|
+
].join(" "),
|
|
107
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-4"
|
|
108
|
+
},
|
|
109
|
+
lg: {
|
|
110
|
+
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",
|
|
111
|
+
linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
|
|
112
|
+
},
|
|
113
|
+
xl: {
|
|
114
|
+
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",
|
|
115
|
+
linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
colors: {
|
|
119
|
+
/** Figma Hierarchy=Primary — dark neutral solid; hover lightens to fg-tertiary_hover (#404040). */
|
|
120
|
+
primary: {
|
|
121
|
+
root: [
|
|
122
|
+
"bg-primary-solid text-white",
|
|
123
|
+
skeuomorphicShadowClass,
|
|
124
|
+
skeuomorphicGradientBorderClass,
|
|
125
|
+
"hover:bg-fg-tertiary_hover dark:hover:bg-quaternary",
|
|
126
|
+
"disabled:opacity-30",
|
|
127
|
+
"data-loading:bg-fg-tertiary_hover dark:data-loading:bg-quaternary",
|
|
128
|
+
"*:data-icon:not([data-icon=loading]):text-white/70"
|
|
129
|
+
].join(" ")
|
|
130
|
+
},
|
|
131
|
+
/** Figma Hierarchy=Brand — purple solid; hover darkens to bg-brand-solid_hover (#6d28d9). */
|
|
132
|
+
brand: {
|
|
133
|
+
root: [
|
|
134
|
+
"bg-brand-solid text-primary_on-brand",
|
|
135
|
+
skeuomorphicShadowClass,
|
|
136
|
+
skeuomorphicGradientBorderClass,
|
|
137
|
+
"hover:bg-brand-solid_hover",
|
|
138
|
+
"disabled:opacity-50",
|
|
139
|
+
"data-loading:bg-brand-solid_hover",
|
|
140
|
+
"*:data-icon:not([data-icon=loading]):text-primary_on-brand"
|
|
141
|
+
].join(" ")
|
|
142
|
+
},
|
|
143
|
+
/** Figma Hierarchy=Secondary — border-primary + shadow-xs + skeuomorphic inner rim overlay. */
|
|
144
|
+
secondary: {
|
|
145
|
+
root: [
|
|
146
|
+
"border border-solid border-primary bg-primary text-secondary",
|
|
147
|
+
secondaryShadowClass,
|
|
148
|
+
"hover:bg-primary_hover hover:text-secondary_hover",
|
|
149
|
+
"disabled:opacity-50",
|
|
150
|
+
"data-loading:bg-primary_hover",
|
|
151
|
+
"*:data-icon:text-fg-secondary hover:*:data-icon:text-fg-quaternary_hover"
|
|
152
|
+
].join(" ")
|
|
153
|
+
},
|
|
154
|
+
/** Figma Hierarchy=Tertiary */
|
|
155
|
+
tertiary: {
|
|
156
|
+
root: [
|
|
157
|
+
"border border-transparent bg-transparent text-tertiary",
|
|
158
|
+
focusShadowPlain,
|
|
159
|
+
"hover:bg-primary_hover hover:text-tertiary_hover",
|
|
160
|
+
"disabled:opacity-50",
|
|
161
|
+
"*:data-icon:text-fg-tertiary hover:*:data-icon:text-fg-quaternary_hover"
|
|
162
|
+
].join(" ")
|
|
163
|
+
},
|
|
164
|
+
/** Figma Hierarchy=Link color — text + icons share brand-secondary; hover underlines with fg-brand-secondary. */
|
|
165
|
+
"link-color": {
|
|
166
|
+
root: [
|
|
167
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-brand-secondary shadow-none",
|
|
168
|
+
focusShadowPlain,
|
|
169
|
+
"hover:text-brand-secondary_hover",
|
|
170
|
+
"disabled:opacity-50",
|
|
171
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-brand-secondary"
|
|
172
|
+
].join(" ")
|
|
173
|
+
},
|
|
174
|
+
/** Figma Hierarchy=Link gray — text + icons share tertiary; hover underlines with fg-quaternary. */
|
|
175
|
+
"link-gray": {
|
|
176
|
+
root: [
|
|
177
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-tertiary shadow-none",
|
|
178
|
+
focusShadowPlain,
|
|
179
|
+
"hover:text-tertiary_hover",
|
|
180
|
+
"disabled:opacity-50",
|
|
181
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-quaternary"
|
|
182
|
+
].join(" ")
|
|
183
|
+
},
|
|
184
|
+
"primary-destructive": {
|
|
185
|
+
root: [
|
|
186
|
+
"bg-error-solid text-white",
|
|
187
|
+
skeuomorphicShadowClass,
|
|
188
|
+
skeuomorphicGradientBorderClass,
|
|
189
|
+
"hover:bg-error-solid_hover",
|
|
190
|
+
"disabled:opacity-50",
|
|
191
|
+
"data-loading:bg-error-solid_hover",
|
|
192
|
+
"*:data-icon:not([data-icon=loading]):text-white/70"
|
|
193
|
+
].join(" ")
|
|
194
|
+
},
|
|
195
|
+
"secondary-destructive": {
|
|
196
|
+
root: [
|
|
197
|
+
"border border-solid border-primary bg-primary text-error-primary",
|
|
198
|
+
secondaryShadowClass,
|
|
199
|
+
"hover:bg-error-primary hover:text-error-primary_hover",
|
|
200
|
+
"disabled:opacity-50",
|
|
201
|
+
"data-loading:bg-error-primary",
|
|
202
|
+
"*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
|
|
203
|
+
].join(" ")
|
|
204
|
+
},
|
|
205
|
+
"tertiary-destructive": {
|
|
206
|
+
root: [
|
|
207
|
+
"border border-transparent bg-transparent text-error-primary",
|
|
208
|
+
focusShadowPlain,
|
|
209
|
+
"hover:bg-error-primary hover:text-error-primary_hover",
|
|
210
|
+
"disabled:opacity-50",
|
|
211
|
+
"*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
|
|
212
|
+
].join(" ")
|
|
213
|
+
},
|
|
214
|
+
/** Figma Hierarchy=Link (destructive) — text + icons share error-primary; hover underlines. */
|
|
215
|
+
"link-destructive": {
|
|
216
|
+
root: [
|
|
217
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-error-primary shadow-none",
|
|
218
|
+
focusShadowPlain,
|
|
219
|
+
"hover:text-error-primary_hover",
|
|
220
|
+
"disabled:opacity-50",
|
|
221
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-current"
|
|
222
|
+
].join(" ")
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
var Button = ({
|
|
227
|
+
size = "md",
|
|
228
|
+
color = "primary",
|
|
229
|
+
children,
|
|
230
|
+
className,
|
|
231
|
+
noTextPadding,
|
|
232
|
+
iconLeading: IconLeading,
|
|
233
|
+
iconTrailing: IconTrailing,
|
|
234
|
+
isDisabled: disabled,
|
|
235
|
+
isLoading: loading,
|
|
236
|
+
showTextWhileLoading,
|
|
237
|
+
...props
|
|
238
|
+
}) => {
|
|
239
|
+
const href = "href" in props ? props.href : void 0;
|
|
240
|
+
const isIcon = (IconLeading || IconTrailing) && !children;
|
|
241
|
+
const isLinkType = ["link-gray", "link-color", "link-destructive"].includes(color);
|
|
242
|
+
noTextPadding = isLinkType || noTextPadding;
|
|
243
|
+
const commonChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
244
|
+
isValidElement(IconLeading) && IconLeading,
|
|
245
|
+
isReactComponent(IconLeading) && /* @__PURE__ */ jsx(IconLeading, { "data-icon": "leading", className: styles.common.icon }),
|
|
246
|
+
loading && /* @__PURE__ */ jsx(
|
|
247
|
+
"svg",
|
|
248
|
+
{
|
|
249
|
+
fill: "none",
|
|
250
|
+
"data-icon": "loading",
|
|
251
|
+
viewBox: "0 0 256 256",
|
|
252
|
+
"aria-hidden": true,
|
|
253
|
+
className: cx(
|
|
254
|
+
styles.common.icon,
|
|
255
|
+
"size-5 animate-spin",
|
|
256
|
+
!showTextWhileLoading && "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
257
|
+
),
|
|
258
|
+
children: /* @__PURE__ */ jsx(
|
|
259
|
+
"path",
|
|
260
|
+
{
|
|
261
|
+
fill: "currentColor",
|
|
262
|
+
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"
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
children && /* @__PURE__ */ jsx("span", { "data-text": true, className: cx("transition-inherit-all", !noTextPadding && !isLinkType && "px-0.5"), children }),
|
|
268
|
+
isValidElement(IconTrailing) && IconTrailing,
|
|
269
|
+
isReactComponent(IconTrailing) && /* @__PURE__ */ jsx(IconTrailing, { "data-icon": "trailing", className: styles.common.icon })
|
|
270
|
+
] });
|
|
271
|
+
const commonProps = {
|
|
272
|
+
"data-icon-only": isIcon ? true : void 0,
|
|
273
|
+
"data-loading": loading ? true : void 0,
|
|
274
|
+
...props,
|
|
275
|
+
isDisabled: disabled || loading,
|
|
276
|
+
className: cx(
|
|
277
|
+
styles.common.root,
|
|
278
|
+
styles.sizes[size].root,
|
|
279
|
+
styles.colors[color].root,
|
|
280
|
+
isLinkType && styles.sizes[size].linkRoot,
|
|
281
|
+
(loading || href && (disabled || loading)) && "pointer-events-none",
|
|
282
|
+
loading && (showTextWhileLoading ? "[&>*:not([data-icon=loading]):not([data-text])]:hidden" : "[&>*:not([data-icon=loading])]:invisible"),
|
|
283
|
+
className
|
|
284
|
+
),
|
|
285
|
+
children: commonChildren
|
|
286
|
+
};
|
|
287
|
+
if ("href" in commonProps) {
|
|
288
|
+
return /* @__PURE__ */ jsx(Link, { ...commonProps, href: disabled || loading ? void 0 : href });
|
|
289
|
+
}
|
|
290
|
+
return /* @__PURE__ */ jsx(Button$1, { ...commonProps, type: commonProps.type || "button", isPending: loading });
|
|
291
|
+
};
|
|
292
|
+
var Tooltip = ({
|
|
293
|
+
title,
|
|
294
|
+
description,
|
|
295
|
+
children,
|
|
296
|
+
arrow = false,
|
|
297
|
+
delay = 100,
|
|
298
|
+
closeDelay = 0,
|
|
299
|
+
trigger,
|
|
300
|
+
isDisabled,
|
|
301
|
+
isOpen,
|
|
302
|
+
defaultOpen,
|
|
303
|
+
offset = 6,
|
|
304
|
+
crossOffset,
|
|
305
|
+
placement = "top",
|
|
306
|
+
onOpenChange,
|
|
307
|
+
...tooltipProps
|
|
308
|
+
}) => {
|
|
309
|
+
const isTopOrBottomLeft = ["top left", "top end", "bottom left", "bottom end"].includes(placement);
|
|
310
|
+
const isTopOrBottomRight = ["top right", "top start", "bottom right", "bottom start"].includes(placement);
|
|
311
|
+
const calculatedCrossOffset = isTopOrBottomLeft ? -12 : isTopOrBottomRight ? 12 : 0;
|
|
312
|
+
return /* @__PURE__ */ jsxs(TooltipTrigger$1, { ...{ trigger, delay, closeDelay, isDisabled, isOpen, defaultOpen, onOpenChange }, children: [
|
|
313
|
+
children,
|
|
314
|
+
/* @__PURE__ */ jsx(
|
|
315
|
+
Tooltip$1,
|
|
316
|
+
{
|
|
317
|
+
...tooltipProps,
|
|
318
|
+
offset,
|
|
319
|
+
placement,
|
|
320
|
+
crossOffset: crossOffset ?? calculatedCrossOffset,
|
|
321
|
+
className: ({ isEntering, isExiting }) => cx(isEntering && "ease-out animate-in", isExiting && "ease-in animate-out"),
|
|
322
|
+
children: ({ isEntering, isExiting }) => /* @__PURE__ */ jsxs(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
className: cx(
|
|
326
|
+
"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",
|
|
327
|
+
description ? "py-3" : "py-2",
|
|
328
|
+
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",
|
|
329
|
+
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"
|
|
330
|
+
),
|
|
331
|
+
children: [
|
|
332
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-white", children: title }),
|
|
333
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: description }),
|
|
334
|
+
arrow && /* @__PURE__ */ jsx(OverlayArrow, { children: /* @__PURE__ */ jsx(
|
|
335
|
+
"svg",
|
|
336
|
+
{
|
|
337
|
+
viewBox: "0 0 100 100",
|
|
338
|
+
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",
|
|
339
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L35.858,35.858 Q50,50 64.142,35.858 L100,0 Z" })
|
|
340
|
+
}
|
|
341
|
+
) })
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
] });
|
|
348
|
+
};
|
|
349
|
+
var TooltipTrigger = ({ children, className, ...buttonProps }) => {
|
|
350
|
+
return /* @__PURE__ */ jsx(Button$1, { ...buttonProps, className: (values) => cx("h-max w-max outline-hidden", typeof className === "function" ? className(values) : className), children });
|
|
351
|
+
};
|
|
352
|
+
var sizes = {
|
|
353
|
+
xs: "size-1.5",
|
|
354
|
+
sm: "size-2",
|
|
355
|
+
md: "size-2.5",
|
|
356
|
+
lg: "size-3",
|
|
357
|
+
xl: "size-3.5",
|
|
358
|
+
"2xl": "size-4",
|
|
359
|
+
"3xl": "size-4.5",
|
|
360
|
+
"4xl": "size-5"
|
|
361
|
+
};
|
|
362
|
+
var AvatarOnlineIndicator = ({ size, status, className }) => /* @__PURE__ */ jsx(
|
|
363
|
+
"span",
|
|
364
|
+
{
|
|
365
|
+
className: cx(
|
|
366
|
+
"absolute right-0 bottom-0 flex justify-center rounded-full ring-[1.5px] ring-bg-primary",
|
|
367
|
+
status === "online" ? "bg-fg-success-secondary" : "bg-utility-neutral-300",
|
|
368
|
+
sizes[size],
|
|
369
|
+
className
|
|
370
|
+
),
|
|
371
|
+
style: {
|
|
372
|
+
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%)"
|
|
373
|
+
},
|
|
374
|
+
children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 7.2 2.85", fill: "none", className: "mt-[10%] h-[20%] w-[60%]", children: [
|
|
375
|
+
/* @__PURE__ */ jsx(
|
|
376
|
+
"path",
|
|
377
|
+
{
|
|
378
|
+
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",
|
|
379
|
+
fill: "url(#reflection-gradient)",
|
|
380
|
+
fillOpacity: "0.4"
|
|
381
|
+
}
|
|
382
|
+
),
|
|
383
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("linearGradient", { id: "reflection-gradient", x1: "3.6", y1: "0", x2: "3.6", y2: "2.4", gradientUnits: "userSpaceOnUse", children: [
|
|
384
|
+
/* @__PURE__ */ jsx("stop", { stopColor: "white" }),
|
|
385
|
+
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "white", stopOpacity: "0.1" })
|
|
386
|
+
] }) })
|
|
387
|
+
] })
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
var sizes2 = {
|
|
391
|
+
xs: "size-2.5",
|
|
392
|
+
sm: "size-3",
|
|
393
|
+
md: "size-3.5",
|
|
394
|
+
lg: "size-4",
|
|
395
|
+
xl: "size-4.5",
|
|
396
|
+
"2xl": "size-5",
|
|
397
|
+
"3xl": "size-6",
|
|
398
|
+
"4xl": "size-8"
|
|
399
|
+
};
|
|
400
|
+
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: [
|
|
401
|
+
/* @__PURE__ */ jsx(
|
|
402
|
+
"path",
|
|
403
|
+
{
|
|
404
|
+
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",
|
|
405
|
+
className: "fill-current"
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ jsx(
|
|
409
|
+
"path",
|
|
410
|
+
{
|
|
411
|
+
fillRule: "evenodd",
|
|
412
|
+
clipRule: "evenodd",
|
|
413
|
+
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",
|
|
414
|
+
fill: "white"
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
] });
|
|
418
|
+
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 }) });
|
|
419
|
+
var styles2 = {
|
|
420
|
+
xs: { root: "size-6", rootWithBorder: "p-px", initials: "text-xs font-semibold", icon: "size-4" },
|
|
421
|
+
sm: { root: "size-8", rootWithBorder: "p-px", initials: "text-sm font-semibold", icon: "size-5" },
|
|
422
|
+
md: { root: "size-10", rootWithBorder: "p-px", initials: "text-md font-semibold", icon: "size-6" },
|
|
423
|
+
lg: { root: "size-12", rootWithBorder: "p-[1.5px]", initials: "text-lg font-semibold", icon: "size-7" },
|
|
424
|
+
xl: { root: "size-14", rootWithBorder: "p-0.5", initials: "text-xl font-semibold", icon: "size-8" },
|
|
425
|
+
"2xl": { root: "size-16", rootWithBorder: "p-0.5", initials: "text-display-xs font-semibold", icon: "size-8" }
|
|
426
|
+
};
|
|
427
|
+
var Avatar = ({
|
|
428
|
+
size = "md",
|
|
429
|
+
src,
|
|
430
|
+
alt,
|
|
431
|
+
initials,
|
|
432
|
+
placeholder,
|
|
433
|
+
placeholderIcon: PlaceholderIcon,
|
|
434
|
+
border,
|
|
435
|
+
badge,
|
|
436
|
+
status,
|
|
437
|
+
verified,
|
|
438
|
+
count,
|
|
439
|
+
focusable = false,
|
|
440
|
+
rounded = true,
|
|
441
|
+
className,
|
|
442
|
+
contentClassName
|
|
443
|
+
}) => {
|
|
444
|
+
const [isFailed, setIsFailed] = useState(false);
|
|
445
|
+
const canShowImage = src && !isFailed;
|
|
446
|
+
const renderMainContent = () => {
|
|
447
|
+
if (canShowImage) {
|
|
448
|
+
return /* @__PURE__ */ jsx("img", { "data-avatar-img": true, className: "size-full object-cover", src, alt, onError: () => setIsFailed(true) });
|
|
449
|
+
}
|
|
450
|
+
if (initials) {
|
|
451
|
+
return /* @__PURE__ */ jsx("span", { className: cx("text-quaternary", styles2[size].initials), children: initials });
|
|
452
|
+
}
|
|
453
|
+
if (PlaceholderIcon) {
|
|
454
|
+
return /* @__PURE__ */ jsx(PlaceholderIcon, { className: cx("text-fg-quaternary", styles2[size].icon) });
|
|
455
|
+
}
|
|
456
|
+
return placeholder || /* @__PURE__ */ jsx(UserIcon, { className: cx("text-fg-quaternary", styles2[size].icon) });
|
|
457
|
+
};
|
|
458
|
+
const renderBadgeContent = () => {
|
|
459
|
+
if (status) {
|
|
460
|
+
return /* @__PURE__ */ jsx(AvatarOnlineIndicator, { status, size });
|
|
461
|
+
}
|
|
462
|
+
if (verified) {
|
|
463
|
+
return /* @__PURE__ */ jsx(VerifiedTick, { size, className: cx("absolute right-0 bottom-0", size === "xs" && "-right-px -bottom-px") });
|
|
464
|
+
}
|
|
465
|
+
if (count) {
|
|
466
|
+
return /* @__PURE__ */ jsx(AvatarCount, { count });
|
|
467
|
+
}
|
|
468
|
+
return badge;
|
|
469
|
+
};
|
|
470
|
+
return /* @__PURE__ */ jsxs(
|
|
471
|
+
"div",
|
|
472
|
+
{
|
|
473
|
+
"data-avatar": true,
|
|
474
|
+
className: cx(
|
|
475
|
+
"relative inline-flex shrink-0 rounded-[7px]",
|
|
476
|
+
rounded && "rounded-full",
|
|
477
|
+
// Focus styles
|
|
478
|
+
focusable && "outline-none group-focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]",
|
|
479
|
+
border && "ring-1 ring-secondary_alt",
|
|
480
|
+
border && styles2[size].rootWithBorder,
|
|
481
|
+
styles2[size].root,
|
|
482
|
+
className
|
|
483
|
+
),
|
|
484
|
+
children: [
|
|
485
|
+
/* @__PURE__ */ jsx(
|
|
486
|
+
"div",
|
|
487
|
+
{
|
|
488
|
+
className: cx(
|
|
489
|
+
"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]",
|
|
490
|
+
rounded && "rounded-full",
|
|
491
|
+
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%)]",
|
|
492
|
+
contentClassName
|
|
493
|
+
),
|
|
494
|
+
children: renderMainContent()
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
renderBadgeContent()
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
};
|
|
502
|
+
var CHECKBOX_TICK_DELAY_MS = 60;
|
|
503
|
+
var CHECKBOX_TICK_DRAW_MS = 100;
|
|
504
|
+
function CheckboxAnimatedCheckMark({ className }) {
|
|
505
|
+
const pathRef = useRef(null);
|
|
506
|
+
useLayoutEffect(() => {
|
|
507
|
+
const path = pathRef.current;
|
|
508
|
+
if (!path || typeof path.getTotalLength !== "function") return;
|
|
509
|
+
const len = path.getTotalLength();
|
|
510
|
+
if (len <= 0) return;
|
|
511
|
+
path.style.strokeDasharray = `${len}`;
|
|
512
|
+
path.style.strokeDashoffset = `${len}`;
|
|
513
|
+
if (typeof path.animate !== "function") {
|
|
514
|
+
path.style.strokeDashoffset = "0";
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
const anim = path.animate([{ strokeDashoffset: len }, { strokeDashoffset: 0 }], {
|
|
518
|
+
duration: CHECKBOX_TICK_DRAW_MS,
|
|
519
|
+
delay: CHECKBOX_TICK_DELAY_MS,
|
|
520
|
+
easing: "cubic-bezier(0.45, 0, 0.2, 1)",
|
|
521
|
+
fill: "forwards"
|
|
522
|
+
});
|
|
523
|
+
return () => anim.cancel();
|
|
524
|
+
}, []);
|
|
525
|
+
return /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 14 14", fill: "none", className: cx("block shrink-0", className), children: /* @__PURE__ */ jsx(
|
|
526
|
+
"path",
|
|
527
|
+
{
|
|
528
|
+
ref: pathRef,
|
|
529
|
+
d: "M2.33325 7L5.24992 9.91667L11.6666 3.5",
|
|
530
|
+
stroke: "currentColor",
|
|
531
|
+
strokeWidth: "2",
|
|
532
|
+
strokeLinecap: "round",
|
|
533
|
+
strokeLinejoin: "round"
|
|
534
|
+
}
|
|
535
|
+
) });
|
|
536
|
+
}
|
|
537
|
+
var focusRingShadow = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
538
|
+
var CheckboxBase = ({ className, isSelected, isDisabled, isIndeterminate, size = "sm", isFocusVisible = false }) => {
|
|
539
|
+
const isChecked = isSelected || isIndeterminate;
|
|
540
|
+
const iconClassName = size === "sm" ? "size-2.5" : "size-3.5";
|
|
541
|
+
return /* @__PURE__ */ jsxs(
|
|
542
|
+
"div",
|
|
543
|
+
{
|
|
544
|
+
className: cx(
|
|
545
|
+
"relative flex shrink-0 cursor-pointer appearance-none items-center justify-center border border-solid border-primary",
|
|
546
|
+
size === "sm" ? "size-4 rounded-xs" : "size-5 rounded-sm",
|
|
547
|
+
isChecked ? "border-transparent bg-brand-solid" : "bg-primary",
|
|
548
|
+
isDisabled && "cursor-not-allowed opacity-50",
|
|
549
|
+
isDisabled && !isChecked && "bg-tertiary",
|
|
550
|
+
isFocusVisible && !isDisabled && focusRingShadow,
|
|
551
|
+
className
|
|
552
|
+
),
|
|
553
|
+
children: [
|
|
554
|
+
isIndeterminate && /* @__PURE__ */ jsx(
|
|
555
|
+
"svg",
|
|
556
|
+
{
|
|
557
|
+
"aria-hidden": "true",
|
|
558
|
+
viewBox: "0 0 14 14",
|
|
559
|
+
fill: "none",
|
|
560
|
+
className: cx("pointer-events-none block shrink-0 text-fg-white", iconClassName),
|
|
561
|
+
children: /* @__PURE__ */ jsx("path", { d: "M2.91675 7H11.0834", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
562
|
+
}
|
|
563
|
+
),
|
|
564
|
+
isSelected && !isIndeterminate && /* @__PURE__ */ jsx(CheckboxAnimatedCheckMark, { className: cx("pointer-events-none text-fg-white", iconClassName) })
|
|
565
|
+
]
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
};
|
|
569
|
+
CheckboxBase.displayName = "CheckboxBase";
|
|
570
|
+
var RADIO_DOT_DELAY_MS = 60;
|
|
571
|
+
var RADIO_DOT_POP_MS = 100;
|
|
572
|
+
function RadioAnimatedDot({ className }) {
|
|
573
|
+
const dotRef = useRef(null);
|
|
574
|
+
useLayoutEffect(() => {
|
|
575
|
+
const dot = dotRef.current;
|
|
576
|
+
if (!dot) return;
|
|
577
|
+
if (typeof dot.animate !== "function") {
|
|
578
|
+
dot.style.opacity = "1";
|
|
579
|
+
dot.style.transform = "scale(1)";
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const anim = dot.animate(
|
|
583
|
+
[
|
|
584
|
+
{ opacity: 0, transform: "scale(0)" },
|
|
585
|
+
{ opacity: 1, transform: "scale(1)" }
|
|
586
|
+
],
|
|
587
|
+
{
|
|
588
|
+
duration: RADIO_DOT_POP_MS,
|
|
589
|
+
delay: RADIO_DOT_DELAY_MS,
|
|
590
|
+
easing: "cubic-bezier(0.45, 0, 0.2, 1)",
|
|
591
|
+
fill: "forwards"
|
|
592
|
+
}
|
|
593
|
+
);
|
|
594
|
+
return () => anim.cancel();
|
|
595
|
+
}, []);
|
|
596
|
+
return /* @__PURE__ */ jsx("div", { ref: dotRef, "aria-hidden": "true", className: cx("rounded-full bg-fg-white", className), style: { opacity: 0, transform: "scale(0)" } });
|
|
597
|
+
}
|
|
598
|
+
var focusRingShadow2 = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
599
|
+
createContext(null);
|
|
600
|
+
var RadioButtonBase = ({ className, isFocusVisible, isSelected, isDisabled, size = "sm" }) => {
|
|
601
|
+
const dotClassName = size === "sm" ? "size-1.5" : "size-2";
|
|
602
|
+
return /* @__PURE__ */ jsx(
|
|
603
|
+
"div",
|
|
604
|
+
{
|
|
605
|
+
className: cx(
|
|
606
|
+
"relative flex shrink-0 cursor-pointer appearance-none items-center justify-center overflow-clip rounded-full border border-solid border-primary bg-primary",
|
|
607
|
+
size === "sm" ? "size-4" : "size-5",
|
|
608
|
+
isSelected && "border-transparent bg-brand-solid",
|
|
609
|
+
isDisabled && "cursor-not-allowed opacity-50",
|
|
610
|
+
isDisabled && !isSelected && "bg-tertiary",
|
|
611
|
+
isFocusVisible && !isDisabled && focusRingShadow2,
|
|
612
|
+
className
|
|
613
|
+
),
|
|
614
|
+
children: isSelected && /* @__PURE__ */ jsx(RadioAnimatedDot, { className: cx("pointer-events-none", dotClassName) })
|
|
615
|
+
}
|
|
616
|
+
);
|
|
617
|
+
};
|
|
618
|
+
RadioButtonBase.displayName = "RadioButtonBase";
|
|
619
|
+
var focusRingShadow3 = "outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
620
|
+
var ToggleBase = ({ className, isHovered, isDisabled, isFocusVisible, isSelected, slim, size = "sm" }) => {
|
|
621
|
+
const styles3 = {
|
|
622
|
+
default: {
|
|
623
|
+
sm: {
|
|
624
|
+
track: "h-5 w-9 p-0.5",
|
|
625
|
+
thumb: "size-4",
|
|
626
|
+
thumbPosition: isSelected ? "left-[calc(100%-1rem-0.125rem)]" : "left-0.5"
|
|
627
|
+
},
|
|
628
|
+
md: {
|
|
629
|
+
track: "h-6 w-11 p-0.5",
|
|
630
|
+
thumb: "size-5",
|
|
631
|
+
thumbPosition: isSelected ? "left-[calc(100%-1.25rem-0.125rem)]" : "left-0.5"
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
slim: {
|
|
635
|
+
sm: {
|
|
636
|
+
track: "h-4 w-8",
|
|
637
|
+
thumb: "size-4",
|
|
638
|
+
thumbPosition: isSelected ? "left-4" : "left-0"
|
|
639
|
+
},
|
|
640
|
+
md: {
|
|
641
|
+
track: "h-5 w-10",
|
|
642
|
+
thumb: "size-5",
|
|
643
|
+
thumbPosition: isSelected ? "left-5" : "left-0"
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
const classes = slim ? styles3.slim[size] : styles3.default[size];
|
|
648
|
+
const offTrackBackground = (() => {
|
|
649
|
+
if (isDisabled) return "bg-tertiary";
|
|
650
|
+
if (isHovered) return slim ? "bg-tertiary" : "bg-brand-primary";
|
|
651
|
+
return "bg-quaternary";
|
|
652
|
+
})();
|
|
653
|
+
return /* @__PURE__ */ jsx(
|
|
654
|
+
"div",
|
|
655
|
+
{
|
|
656
|
+
className: cx(
|
|
657
|
+
"relative inline-flex shrink-0 cursor-pointer overflow-clip rounded-full outline-none transition duration-150 ease-linear",
|
|
658
|
+
!isSelected && offTrackBackground,
|
|
659
|
+
!slim && "ring-[0.5px] ring-secondary ring-inset",
|
|
660
|
+
slim && "ring-1 ring-secondary ring-inset",
|
|
661
|
+
isSelected && "bg-brand-solid",
|
|
662
|
+
isSelected && isHovered && "bg-brand-solid_hover",
|
|
663
|
+
isSelected && "ring-transparent",
|
|
664
|
+
isDisabled && "cursor-not-allowed opacity-50",
|
|
665
|
+
isFocusVisible && !isDisabled && focusRingShadow3,
|
|
666
|
+
classes.track,
|
|
667
|
+
className
|
|
668
|
+
),
|
|
669
|
+
children: /* @__PURE__ */ jsx(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
className: cx(
|
|
673
|
+
"absolute rounded-full bg-fg-white shadow-sm transition-[left] duration-150 ease-in-out",
|
|
674
|
+
slim ? "top-0 shadow-xs" : "top-0.5",
|
|
675
|
+
slim && "border border-toggle-border",
|
|
676
|
+
slim && isSelected && "border-toggle-slim-border_pressed",
|
|
677
|
+
slim && isSelected && isHovered && "border-toggle-slim-border_pressed-hover",
|
|
678
|
+
classes.thumb,
|
|
679
|
+
classes.thumbPosition
|
|
680
|
+
)
|
|
681
|
+
}
|
|
682
|
+
)
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
};
|
|
686
|
+
var focusShadowInset = "[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]";
|
|
687
|
+
var DropdownItem = ({ label, children, addon, icon: Icon, avatarUrl, unstyled, selectionIndicator = "checkmark", ...props }) => {
|
|
688
|
+
const SelectionIndicator = useCallback(
|
|
689
|
+
(state) => {
|
|
690
|
+
if (selectionIndicator === "checkmark") {
|
|
691
|
+
return /* @__PURE__ */ jsx(
|
|
692
|
+
CheckIcon,
|
|
693
|
+
{
|
|
694
|
+
"aria-hidden": "true",
|
|
695
|
+
className: cx("size-4 shrink-0 stroke-[2.25px] text-fg-brand-primary", !state.isSelected && "invisible", state.className)
|
|
696
|
+
}
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
if (selectionIndicator === "checkbox") {
|
|
700
|
+
return /* @__PURE__ */ jsx(
|
|
701
|
+
CheckboxBase,
|
|
702
|
+
{
|
|
703
|
+
isSelected: state.isSelected && !state.hasSubmenu,
|
|
704
|
+
isIndeterminate: state.isSelected && state.hasSubmenu,
|
|
705
|
+
size: "sm",
|
|
706
|
+
className: cx("shrink-0", state.className)
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
if (selectionIndicator === "radio") {
|
|
711
|
+
return /* @__PURE__ */ jsx(RadioButtonBase, { isSelected: state.isSelected, className: cx("shrink-0", state.className) });
|
|
712
|
+
}
|
|
713
|
+
if (selectionIndicator === "toggle") {
|
|
714
|
+
return /* @__PURE__ */ jsx(ToggleBase, { slim: true, size: "sm", isSelected: state.isSelected, className: cx("shrink-0", state.className) });
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
},
|
|
718
|
+
[selectionIndicator]
|
|
719
|
+
);
|
|
720
|
+
if (unstyled) {
|
|
721
|
+
return /* @__PURE__ */ jsx(MenuItem, { id: label, textValue: label, ...props });
|
|
722
|
+
}
|
|
723
|
+
return /* @__PURE__ */ jsx(
|
|
724
|
+
MenuItem,
|
|
725
|
+
{
|
|
726
|
+
...props,
|
|
727
|
+
className: (state) => cx(
|
|
728
|
+
"group block cursor-pointer px-1.5 py-px outline-hidden",
|
|
729
|
+
state.isDisabled && "cursor-not-allowed opacity-50",
|
|
730
|
+
typeof props.className === "function" ? props.className(state) : props.className
|
|
731
|
+
),
|
|
732
|
+
children: (state) => /* @__PURE__ */ jsxs(
|
|
733
|
+
"div",
|
|
734
|
+
{
|
|
735
|
+
className: cx(
|
|
736
|
+
"relative flex items-center rounded-md px-2.5 py-2 transition duration-100 ease-linear",
|
|
737
|
+
!state.isDisabled && "group-hover:bg-primary_hover",
|
|
738
|
+
state.isFocused && "bg-primary_hover",
|
|
739
|
+
state.isFocusVisible && focusShadowInset,
|
|
740
|
+
state.hasSubmenu && "pr-1.5"
|
|
741
|
+
),
|
|
742
|
+
children: [
|
|
743
|
+
state.selectionMode !== "none" && !avatarUrl && !Icon && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "mr-2" }),
|
|
744
|
+
avatarUrl && /* @__PURE__ */ jsx("div", { className: "mr-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ jsx(Avatar, { "aria-hidden": "true", size: "xs", src: avatarUrl, alt: label, className: "size-5" }) }),
|
|
745
|
+
Icon && /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", className: "mr-2 size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" }),
|
|
746
|
+
/* @__PURE__ */ jsx("span", { className: cx("grow truncate text-sm font-semibold text-secondary", state.isFocused && "text-secondary_hover"), children: label || (typeof children === "function" ? children(state) : children) }),
|
|
747
|
+
addon && /* @__PURE__ */ jsx("span", { className: "ml-1 shrink-0 pr-1 text-xs font-medium text-quaternary", children: addon }),
|
|
748
|
+
state.selectionMode !== "none" && (avatarUrl || Icon) && /* @__PURE__ */ jsx(SelectionIndicator, { ...state, className: "ml-1" }),
|
|
749
|
+
state.hasSubmenu && /* @__PURE__ */ jsx(CaretRightIcon, { "aria-hidden": "true", className: "ml-auto size-4 shrink-0 stroke-[2.25px] text-fg-quaternary" })
|
|
750
|
+
]
|
|
751
|
+
}
|
|
752
|
+
)
|
|
753
|
+
}
|
|
754
|
+
);
|
|
755
|
+
};
|
|
756
|
+
var DropdownMenu = (props) => {
|
|
757
|
+
return /* @__PURE__ */ jsx(
|
|
758
|
+
Menu,
|
|
759
|
+
{
|
|
760
|
+
...props,
|
|
761
|
+
className: (state) => cx("h-min overflow-y-auto py-1 outline-hidden select-none", typeof props.className === "function" ? props.className(state) : props.className)
|
|
762
|
+
}
|
|
763
|
+
);
|
|
764
|
+
};
|
|
765
|
+
var DropdownPopover = (props) => {
|
|
766
|
+
return /* @__PURE__ */ jsx(
|
|
767
|
+
Popover,
|
|
768
|
+
{
|
|
769
|
+
placement: "bottom right",
|
|
770
|
+
...props,
|
|
771
|
+
className: (state) => cx(
|
|
772
|
+
"w-62 origin-(--trigger-anchor-point) overflow-auto rounded-lg bg-primary shadow-lg ring-1 ring-secondary_alt will-change-transform",
|
|
773
|
+
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",
|
|
774
|
+
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",
|
|
775
|
+
typeof props.className === "function" ? props.className(state) : props.className
|
|
776
|
+
),
|
|
777
|
+
children: props.children
|
|
778
|
+
}
|
|
779
|
+
);
|
|
780
|
+
};
|
|
781
|
+
var Dropdown = {
|
|
782
|
+
Root: MenuTrigger,
|
|
783
|
+
Popover: DropdownPopover,
|
|
784
|
+
Menu: DropdownMenu,
|
|
785
|
+
Item: DropdownItem};
|
|
786
|
+
var inputFocusRingShadow = "border-brand ring-1 ring-inset ring-brand";
|
|
787
|
+
var inputErrorFocusRingShadow = "border-error ring-1 ring-inset ring-error";
|
|
788
|
+
var InputBase = ({
|
|
789
|
+
ref,
|
|
790
|
+
tooltip,
|
|
791
|
+
shortcut,
|
|
792
|
+
groupRef,
|
|
793
|
+
size = "md",
|
|
794
|
+
isInvalid,
|
|
795
|
+
isDisabled,
|
|
796
|
+
isRequired,
|
|
797
|
+
icon: Icon,
|
|
798
|
+
placeholder,
|
|
799
|
+
wrapperClassName,
|
|
800
|
+
tooltipClassName,
|
|
801
|
+
inputClassName,
|
|
802
|
+
iconClassName,
|
|
803
|
+
type = "text",
|
|
804
|
+
...inputProps
|
|
805
|
+
}) => {
|
|
806
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
807
|
+
const hasTrailingIcon = tooltip || isInvalid;
|
|
808
|
+
const hasLeadingIcon = Icon;
|
|
809
|
+
const context = useContext(TextFieldContext);
|
|
810
|
+
const inputSize = context?.size || size;
|
|
811
|
+
const sizes3 = sortCx({
|
|
812
|
+
sm: {
|
|
813
|
+
root: cx("px-3 py-2 text-sm", hasLeadingIcon && "pl-9", hasTrailingIcon && "pr-9"),
|
|
814
|
+
iconLeading: "left-3 size-4 stroke-[2.25px]",
|
|
815
|
+
iconTrailing: "right-3",
|
|
816
|
+
shortcut: "pr-1.5"
|
|
817
|
+
},
|
|
818
|
+
md: {
|
|
819
|
+
root: cx("px-3 py-2 text-md", hasLeadingIcon && "pl-10", hasTrailingIcon && "pr-9"),
|
|
820
|
+
iconLeading: "left-3 size-5",
|
|
821
|
+
iconTrailing: "right-3",
|
|
822
|
+
shortcut: "pr-2"
|
|
823
|
+
},
|
|
824
|
+
lg: {
|
|
825
|
+
root: cx("px-3.5 py-2.5 text-md", hasLeadingIcon && "pl-10.5", hasTrailingIcon && "pr-9.5"),
|
|
826
|
+
iconLeading: "left-3.5 size-5",
|
|
827
|
+
iconTrailing: "right-3.5",
|
|
828
|
+
shortcut: "pr-2.5"
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
return /* @__PURE__ */ jsxs(
|
|
832
|
+
Group,
|
|
833
|
+
{
|
|
834
|
+
...{ isDisabled, isInvalid },
|
|
835
|
+
ref: groupRef,
|
|
836
|
+
className: ({ isFocusWithin, isDisabled: isDisabled2, isInvalid: isInvalid2 }) => cx(
|
|
837
|
+
"group/input relative flex w-full flex-row place-content-center place-items-center rounded-lg border border-solid border-primary bg-primary shadow-xs transition-[border-color,box-shadow] duration-100 ease-linear",
|
|
838
|
+
isFocusWithin && !isDisabled2 && !isInvalid2 && inputFocusRingShadow,
|
|
839
|
+
// Disabled state styles
|
|
840
|
+
isDisabled2 && "cursor-not-allowed opacity-50",
|
|
841
|
+
"group-disabled:cursor-not-allowed group-disabled:opacity-50",
|
|
842
|
+
// Invalid state styles
|
|
843
|
+
isInvalid2 && !isFocusWithin && "border-error_subtle",
|
|
844
|
+
"group-invalid:border-error_subtle",
|
|
845
|
+
"group-invalid:focus-within:border-error group-invalid:focus-within:ring-1 group-invalid:focus-within:ring-inset group-invalid:focus-within:ring-error",
|
|
846
|
+
// Invalid + focus — darker error stroke (not brand)
|
|
847
|
+
isInvalid2 && isFocusWithin && inputErrorFocusRingShadow,
|
|
848
|
+
context?.wrapperClassName,
|
|
849
|
+
wrapperClassName
|
|
850
|
+
),
|
|
851
|
+
children: [
|
|
852
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: cx("pointer-events-none absolute text-fg-quaternary", sizes3[inputSize].iconLeading, context?.iconClassName, iconClassName) }),
|
|
853
|
+
/* @__PURE__ */ jsx(
|
|
854
|
+
Input,
|
|
855
|
+
{
|
|
856
|
+
...inputProps,
|
|
857
|
+
ref,
|
|
858
|
+
required: isRequired,
|
|
859
|
+
type: type === "password" && isPasswordVisible ? "text" : type,
|
|
860
|
+
placeholder,
|
|
861
|
+
className: cx(
|
|
862
|
+
"m-0 w-full bg-transparent text-primary ring-0 outline-hidden placeholder:text-placeholder autofill:rounded-lg autofill:text-primary disabled:cursor-not-allowed",
|
|
863
|
+
sizes3[inputSize].root,
|
|
864
|
+
context?.inputClassName,
|
|
865
|
+
inputClassName
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
tooltip && type !== "password" && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, placement: "top", children: /* @__PURE__ */ jsx(
|
|
870
|
+
TooltipTrigger,
|
|
871
|
+
{
|
|
872
|
+
className: cx(
|
|
873
|
+
"absolute cursor-pointer text-fg-quaternary transition duration-100 ease-linear group-invalid/input:hidden hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover",
|
|
874
|
+
sizes3[inputSize].iconTrailing,
|
|
875
|
+
context?.tooltipClassName,
|
|
876
|
+
tooltipClassName
|
|
877
|
+
),
|
|
878
|
+
children: /* @__PURE__ */ jsx(QuestionIcon, { className: "size-4 stroke-[2.25px]" })
|
|
879
|
+
}
|
|
880
|
+
) }),
|
|
881
|
+
type !== "password" && /* @__PURE__ */ jsx(
|
|
882
|
+
InfoIcon,
|
|
883
|
+
{
|
|
884
|
+
className: cx(
|
|
885
|
+
"pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block",
|
|
886
|
+
sizes3[inputSize].iconTrailing,
|
|
887
|
+
context?.tooltipClassName,
|
|
888
|
+
tooltipClassName
|
|
889
|
+
)
|
|
890
|
+
}
|
|
891
|
+
),
|
|
892
|
+
type === "password" && /* @__PURE__ */ jsx(
|
|
893
|
+
Button$1,
|
|
894
|
+
{
|
|
895
|
+
"aria-label": "Toggle password visibility",
|
|
896
|
+
onClick: () => setIsPasswordVisible(!isPasswordVisible),
|
|
897
|
+
className: cx(
|
|
898
|
+
"absolute flex cursor-pointer items-center justify-center text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover focus:outline-hidden",
|
|
899
|
+
sizes3[inputSize].iconTrailing
|
|
900
|
+
),
|
|
901
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsx(EyeSlashIcon, { className: "size-4 stroke-[2.25px]" }) : /* @__PURE__ */ jsx(EyeIcon, { className: "size-4 stroke-[2.25px]" })
|
|
902
|
+
}
|
|
903
|
+
),
|
|
904
|
+
shortcut && /* @__PURE__ */ jsx(
|
|
905
|
+
"div",
|
|
906
|
+
{
|
|
907
|
+
className: cx(
|
|
908
|
+
"pointer-events-none absolute inset-y-0.5 right-0.5 z-10 hidden items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8 md:flex",
|
|
909
|
+
sizes3[inputSize].shortcut
|
|
910
|
+
),
|
|
911
|
+
children: /* @__PURE__ */ jsx(
|
|
912
|
+
"span",
|
|
913
|
+
{
|
|
914
|
+
"aria-hidden": "true",
|
|
915
|
+
className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
|
|
916
|
+
children: typeof shortcut === "string" ? shortcut : "\u2318K"
|
|
917
|
+
}
|
|
918
|
+
)
|
|
919
|
+
}
|
|
920
|
+
)
|
|
921
|
+
]
|
|
922
|
+
}
|
|
923
|
+
);
|
|
924
|
+
};
|
|
925
|
+
InputBase.displayName = "InputBase";
|
|
926
|
+
var TextFieldContext = createContext({});
|
|
927
|
+
var DropdownSearchSimple = () => {
|
|
928
|
+
const [selectedUsers, setSelectedUsers] = useState(/* @__PURE__ */ new Set(["olivia", "phoenix"]));
|
|
929
|
+
let { contains } = useFilter({ sensitivity: "base" });
|
|
930
|
+
return /* @__PURE__ */ jsxs(Dropdown.Root, { children: [
|
|
931
|
+
/* @__PURE__ */ jsx(
|
|
932
|
+
Button,
|
|
933
|
+
{
|
|
934
|
+
size: "sm",
|
|
935
|
+
className: "group",
|
|
936
|
+
color: "secondary",
|
|
937
|
+
iconTrailing: (props) => /* @__PURE__ */ jsx(CaretDownIcon, { "data-icon": "trailing", ...props, className: "size-4! stroke-[2.25px]!" }),
|
|
938
|
+
children: "Manage access"
|
|
939
|
+
}
|
|
940
|
+
),
|
|
941
|
+
/* @__PURE__ */ jsx(Dropdown.Popover, { className: "w-60", children: /* @__PURE__ */ jsxs(Autocomplete, { filter: contains, children: [
|
|
942
|
+
/* @__PURE__ */ jsx(SearchField, { className: "flex gap-3 border-b border-secondary p-3", children: /* @__PURE__ */ jsx(InputBase, { size: "md", placeholder: "Search", icon: MagnifyingGlassIcon }) }),
|
|
943
|
+
/* @__PURE__ */ jsxs(Dropdown.Menu, { selectionMode: "multiple", selectedKeys: selectedUsers, onSelectionChange: setSelectedUsers, children: [
|
|
944
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "olivia", textValue: "Olivia Rhye", selectionIndicator: "checkbox", children: "Olivia Rhye" }),
|
|
945
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "phoenix", textValue: "Phoenix Baker", selectionIndicator: "checkbox", children: "Phoenix Baker" }),
|
|
946
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "lana", textValue: "Lana Steiner", selectionIndicator: "checkbox", children: "Lana Steiner" }),
|
|
947
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "demi", textValue: "Demi Wilkinson", selectionIndicator: "checkbox", children: "Demi Wilkinson" }),
|
|
948
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "candice", textValue: "Candice Wu", selectionIndicator: "checkbox", children: "Candice Wu" }),
|
|
949
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "natali", textValue: "Natali Craig", selectionIndicator: "checkbox", children: "Natali Craig" }),
|
|
950
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "drew", textValue: "Drew Cano", selectionIndicator: "checkbox", children: "Drew Cano" }),
|
|
951
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "orlando", textValue: "Orlando Diggs", selectionIndicator: "checkbox", children: "Orlando Diggs" }),
|
|
952
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { id: "andi", textValue: "Andi Lane", selectionIndicator: "checkbox", children: "Andi Lane" })
|
|
953
|
+
] })
|
|
954
|
+
] }) })
|
|
955
|
+
] });
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
export { DropdownSearchSimple };
|
|
959
|
+
//# sourceMappingURL=dropdown-search-simple.js.map
|
|
960
|
+
//# sourceMappingURL=dropdown-search-simple.js.map
|