@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,748 @@
|
|
|
1
|
+
import { createContext, useRef, useState, useContext, isValidElement } from 'react';
|
|
2
|
+
import { Group, Input, Button as Button$1, Link, TextField as TextField$1, Label as Label$1, Text, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, OverlayArrow } from 'react-aria-components';
|
|
3
|
+
import { extendTailwindMerge } from 'tailwind-merge';
|
|
4
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
|
+
import { EyeIcon } from '@phosphor-icons/react/dist/csr/Eye';
|
|
6
|
+
import { EyeSlashIcon } from '@phosphor-icons/react/dist/csr/EyeSlash';
|
|
7
|
+
import { QuestionIcon } from '@phosphor-icons/react/dist/csr/Question';
|
|
8
|
+
import { InfoIcon } from '@phosphor-icons/react/dist/csr/Info';
|
|
9
|
+
|
|
10
|
+
var twMerge = extendTailwindMerge({
|
|
11
|
+
extend: {
|
|
12
|
+
theme: {
|
|
13
|
+
text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var cx = twMerge;
|
|
18
|
+
function sortCx(classes) {
|
|
19
|
+
return classes;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ../../utils/is-react-component.ts
|
|
23
|
+
var isFunctionComponent = (component) => {
|
|
24
|
+
return typeof component === "function";
|
|
25
|
+
};
|
|
26
|
+
var isClassComponent = (component) => {
|
|
27
|
+
return typeof component === "function" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);
|
|
28
|
+
};
|
|
29
|
+
var isForwardRefComponent = (component) => {
|
|
30
|
+
return typeof component === "object" && component !== null && component.$$typeof.toString() === "Symbol(react.forward_ref)";
|
|
31
|
+
};
|
|
32
|
+
var isReactComponent = (component) => {
|
|
33
|
+
return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);
|
|
34
|
+
};
|
|
35
|
+
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)]";
|
|
36
|
+
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)]";
|
|
37
|
+
var skeuomorphicGradientBorderClass = [
|
|
38
|
+
"ring-1 ring-inset ring-transparent",
|
|
39
|
+
"before:pointer-events-none before:absolute before:inset-px before:rounded-[inherit] before:border before:border-[#ffffff1f] before:content-['']",
|
|
40
|
+
"before:[mask-image:linear-gradient(to_bottom,#000,transparent)]"
|
|
41
|
+
].join(" ");
|
|
42
|
+
var skeuomorphicShadowClass = ["shadow-xs-skeuomorphic", focusShadowSkeuomorphic, "overflow-hidden"].join(" ");
|
|
43
|
+
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)]";
|
|
44
|
+
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)]";
|
|
45
|
+
var secondaryShadowClass = ["relative overflow-hidden shadow-xs", secondaryInnerShadow, focusShadowSecondary].join(" ");
|
|
46
|
+
var inputNumberButtonClass = [
|
|
47
|
+
"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",
|
|
48
|
+
"in-data-number-input:before:hidden in-data-number-input:after:hidden",
|
|
49
|
+
"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]"
|
|
50
|
+
].join(" ");
|
|
51
|
+
var inputAddonButtonClass = [
|
|
52
|
+
"in-data-input-wrapper:border-0 in-data-input-wrapper:shadow-none in-data-input-wrapper:!rounded-none in-data-input-wrapper:overflow-hidden",
|
|
53
|
+
"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",
|
|
54
|
+
"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",
|
|
55
|
+
"in-data-input-wrapper:group-invalid:in-data-trailing:border-error_subtle in-data-input-wrapper:group-invalid:in-data-leading:border-error_subtle",
|
|
56
|
+
"in-data-input-wrapper:before:hidden in-data-input-wrapper:after:hidden",
|
|
57
|
+
"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]"
|
|
58
|
+
].join(" ");
|
|
59
|
+
var styles = sortCx({
|
|
60
|
+
common: {
|
|
61
|
+
root: [
|
|
62
|
+
"group relative inline-flex shrink-0 cursor-pointer items-center justify-center whitespace-nowrap rounded-full font-body outline-none before:absolute",
|
|
63
|
+
"font-semibold transition-[color,background-color,border-color,box-shadow,opacity,transform] duration-150 ease-out",
|
|
64
|
+
"pressed:scale-[0.985] pressed:duration-100 pressed:ease-linear motion-reduce:pressed:scale-100",
|
|
65
|
+
"disabled:pointer-events-none disabled:cursor-not-allowed in-data-input-wrapper:disabled:opacity-100",
|
|
66
|
+
inputAddonButtonClass,
|
|
67
|
+
inputNumberButtonClass,
|
|
68
|
+
// Stretch to InputGroup row height; padding/typography follow `data-input-size` on the field (Figma 85:1269).
|
|
69
|
+
"in-data-input-wrapper:!h-full in-data-input-wrapper:!min-h-0 in-data-input-wrapper:self-stretch",
|
|
70
|
+
"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",
|
|
71
|
+
"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",
|
|
72
|
+
"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",
|
|
73
|
+
"*:data-icon:pointer-events-none *:data-icon:shrink-0 *:data-icon:transition-inherit-all"
|
|
74
|
+
].join(" "),
|
|
75
|
+
icon: "pointer-events-none shrink-0 transition-inherit-all"
|
|
76
|
+
},
|
|
77
|
+
sizes: {
|
|
78
|
+
xs: {
|
|
79
|
+
root: [
|
|
80
|
+
"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",
|
|
81
|
+
"in-data-input-wrapper:data-icon-only:p-2.5",
|
|
82
|
+
"*:data-icon:size-4"
|
|
83
|
+
].join(" "),
|
|
84
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
|
|
85
|
+
},
|
|
86
|
+
sm: {
|
|
87
|
+
root: [
|
|
88
|
+
"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",
|
|
89
|
+
"in-data-input-wrapper:data-icon-only:p-2.5",
|
|
90
|
+
"*:data-icon:size-5"
|
|
91
|
+
].join(" "),
|
|
92
|
+
linkRoot: "h-auto min-h-0 gap-1 px-0! py-0! text-sm *:data-text:underline-offset-3"
|
|
93
|
+
},
|
|
94
|
+
md: {
|
|
95
|
+
root: [
|
|
96
|
+
"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",
|
|
97
|
+
"in-data-input-wrapper:data-icon-only:p-3",
|
|
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-4"
|
|
101
|
+
},
|
|
102
|
+
lg: {
|
|
103
|
+
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",
|
|
104
|
+
linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
|
|
105
|
+
},
|
|
106
|
+
xl: {
|
|
107
|
+
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",
|
|
108
|
+
linkRoot: "h-auto min-h-0 gap-1.5 px-0! py-0! text-md *:data-text:underline-offset-4"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
colors: {
|
|
112
|
+
/** Figma Hierarchy=Primary — dark neutral solid; hover lightens to fg-tertiary_hover (#404040). */
|
|
113
|
+
primary: {
|
|
114
|
+
root: [
|
|
115
|
+
"bg-primary-solid text-white",
|
|
116
|
+
skeuomorphicShadowClass,
|
|
117
|
+
skeuomorphicGradientBorderClass,
|
|
118
|
+
"hover:bg-fg-tertiary_hover dark:hover:bg-quaternary",
|
|
119
|
+
"disabled:opacity-30",
|
|
120
|
+
"data-loading:bg-fg-tertiary_hover dark:data-loading:bg-quaternary",
|
|
121
|
+
"*:data-icon:not([data-icon=loading]):text-white/70"
|
|
122
|
+
].join(" ")
|
|
123
|
+
},
|
|
124
|
+
/** Figma Hierarchy=Brand — purple solid; hover darkens to bg-brand-solid_hover (#6d28d9). */
|
|
125
|
+
brand: {
|
|
126
|
+
root: [
|
|
127
|
+
"bg-brand-solid text-primary_on-brand",
|
|
128
|
+
skeuomorphicShadowClass,
|
|
129
|
+
skeuomorphicGradientBorderClass,
|
|
130
|
+
"hover:bg-brand-solid_hover",
|
|
131
|
+
"disabled:opacity-50",
|
|
132
|
+
"data-loading:bg-brand-solid_hover",
|
|
133
|
+
"*:data-icon:not([data-icon=loading]):text-primary_on-brand"
|
|
134
|
+
].join(" ")
|
|
135
|
+
},
|
|
136
|
+
/** Figma Hierarchy=Secondary — border-primary + shadow-xs + skeuomorphic inner rim overlay. */
|
|
137
|
+
secondary: {
|
|
138
|
+
root: [
|
|
139
|
+
"border border-solid border-primary bg-primary text-secondary",
|
|
140
|
+
secondaryShadowClass,
|
|
141
|
+
"hover:bg-primary_hover hover:text-secondary_hover",
|
|
142
|
+
"disabled:opacity-50",
|
|
143
|
+
"data-loading:bg-primary_hover",
|
|
144
|
+
"*:data-icon:text-fg-secondary hover:*:data-icon:text-fg-quaternary_hover"
|
|
145
|
+
].join(" ")
|
|
146
|
+
},
|
|
147
|
+
/** Figma Hierarchy=Tertiary */
|
|
148
|
+
tertiary: {
|
|
149
|
+
root: [
|
|
150
|
+
"border border-transparent bg-transparent text-tertiary",
|
|
151
|
+
focusShadowPlain,
|
|
152
|
+
"hover:bg-primary_hover hover:text-tertiary_hover",
|
|
153
|
+
"disabled:opacity-50",
|
|
154
|
+
"*:data-icon:text-fg-tertiary hover:*:data-icon:text-fg-quaternary_hover"
|
|
155
|
+
].join(" ")
|
|
156
|
+
},
|
|
157
|
+
/** Figma Hierarchy=Link color — text + icons share brand-secondary; hover underlines with fg-brand-secondary. */
|
|
158
|
+
"link-color": {
|
|
159
|
+
root: [
|
|
160
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-brand-secondary shadow-none",
|
|
161
|
+
focusShadowPlain,
|
|
162
|
+
"hover:text-brand-secondary_hover",
|
|
163
|
+
"disabled:opacity-50",
|
|
164
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-brand-secondary"
|
|
165
|
+
].join(" ")
|
|
166
|
+
},
|
|
167
|
+
/** Figma Hierarchy=Link gray — text + icons share tertiary; hover underlines with fg-quaternary. */
|
|
168
|
+
"link-gray": {
|
|
169
|
+
root: [
|
|
170
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-tertiary shadow-none",
|
|
171
|
+
focusShadowPlain,
|
|
172
|
+
"hover:text-tertiary_hover",
|
|
173
|
+
"disabled:opacity-50",
|
|
174
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-fg-quaternary"
|
|
175
|
+
].join(" ")
|
|
176
|
+
},
|
|
177
|
+
"primary-destructive": {
|
|
178
|
+
root: [
|
|
179
|
+
"bg-error-solid text-white",
|
|
180
|
+
skeuomorphicShadowClass,
|
|
181
|
+
skeuomorphicGradientBorderClass,
|
|
182
|
+
"hover:bg-error-solid_hover",
|
|
183
|
+
"disabled:opacity-50",
|
|
184
|
+
"data-loading:bg-error-solid_hover",
|
|
185
|
+
"*:data-icon:not([data-icon=loading]):text-white/70"
|
|
186
|
+
].join(" ")
|
|
187
|
+
},
|
|
188
|
+
"secondary-destructive": {
|
|
189
|
+
root: [
|
|
190
|
+
"border border-solid border-primary bg-primary text-error-primary",
|
|
191
|
+
secondaryShadowClass,
|
|
192
|
+
"hover:bg-error-primary hover:text-error-primary_hover",
|
|
193
|
+
"disabled:opacity-50",
|
|
194
|
+
"data-loading:bg-error-primary",
|
|
195
|
+
"*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
|
|
196
|
+
].join(" ")
|
|
197
|
+
},
|
|
198
|
+
"tertiary-destructive": {
|
|
199
|
+
root: [
|
|
200
|
+
"border border-transparent bg-transparent text-error-primary",
|
|
201
|
+
focusShadowPlain,
|
|
202
|
+
"hover:bg-error-primary hover:text-error-primary_hover",
|
|
203
|
+
"disabled:opacity-50",
|
|
204
|
+
"*:data-icon:text-fg-error-secondary hover:*:data-icon:text-fg-error-primary"
|
|
205
|
+
].join(" ")
|
|
206
|
+
},
|
|
207
|
+
/** Figma Hierarchy=Link (destructive) — text + icons share error-primary; hover underlines. */
|
|
208
|
+
"link-destructive": {
|
|
209
|
+
root: [
|
|
210
|
+
"h-auto min-h-0 border-0 bg-transparent px-0! py-0! text-error-primary shadow-none",
|
|
211
|
+
focusShadowPlain,
|
|
212
|
+
"hover:text-error-primary_hover",
|
|
213
|
+
"disabled:opacity-50",
|
|
214
|
+
"*:data-text:underline *:data-text:decoration-transparent *:data-text:decoration-solid hover:*:data-text:decoration-current"
|
|
215
|
+
].join(" ")
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
var Button = ({
|
|
220
|
+
size = "md",
|
|
221
|
+
color = "primary",
|
|
222
|
+
children,
|
|
223
|
+
className,
|
|
224
|
+
noTextPadding,
|
|
225
|
+
iconLeading: IconLeading,
|
|
226
|
+
iconTrailing: IconTrailing,
|
|
227
|
+
isDisabled: disabled,
|
|
228
|
+
isLoading: loading,
|
|
229
|
+
showTextWhileLoading,
|
|
230
|
+
...props
|
|
231
|
+
}) => {
|
|
232
|
+
const href = "href" in props ? props.href : void 0;
|
|
233
|
+
const isIcon = (IconLeading || IconTrailing) && !children;
|
|
234
|
+
const isLinkType = ["link-gray", "link-color", "link-destructive"].includes(color);
|
|
235
|
+
noTextPadding = isLinkType || noTextPadding;
|
|
236
|
+
const commonChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
237
|
+
isValidElement(IconLeading) && IconLeading,
|
|
238
|
+
isReactComponent(IconLeading) && /* @__PURE__ */ jsx(IconLeading, { "data-icon": "leading", className: styles.common.icon }),
|
|
239
|
+
loading && /* @__PURE__ */ jsx(
|
|
240
|
+
"svg",
|
|
241
|
+
{
|
|
242
|
+
fill: "none",
|
|
243
|
+
"data-icon": "loading",
|
|
244
|
+
viewBox: "0 0 256 256",
|
|
245
|
+
"aria-hidden": true,
|
|
246
|
+
className: cx(
|
|
247
|
+
styles.common.icon,
|
|
248
|
+
"size-5 animate-spin",
|
|
249
|
+
!showTextWhileLoading && "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
250
|
+
),
|
|
251
|
+
children: /* @__PURE__ */ jsx(
|
|
252
|
+
"path",
|
|
253
|
+
{
|
|
254
|
+
fill: "currentColor",
|
|
255
|
+
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"
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
children && /* @__PURE__ */ jsx("span", { "data-text": true, className: cx("transition-inherit-all", !noTextPadding && !isLinkType && "px-0.5"), children }),
|
|
261
|
+
isValidElement(IconTrailing) && IconTrailing,
|
|
262
|
+
isReactComponent(IconTrailing) && /* @__PURE__ */ jsx(IconTrailing, { "data-icon": "trailing", className: styles.common.icon })
|
|
263
|
+
] });
|
|
264
|
+
const commonProps = {
|
|
265
|
+
"data-icon-only": isIcon ? true : void 0,
|
|
266
|
+
"data-loading": loading ? true : void 0,
|
|
267
|
+
...props,
|
|
268
|
+
isDisabled: disabled || loading,
|
|
269
|
+
className: cx(
|
|
270
|
+
styles.common.root,
|
|
271
|
+
styles.sizes[size].root,
|
|
272
|
+
styles.colors[color].root,
|
|
273
|
+
isLinkType && styles.sizes[size].linkRoot,
|
|
274
|
+
(loading || href && (disabled || loading)) && "pointer-events-none",
|
|
275
|
+
loading && (showTextWhileLoading ? "[&>*:not([data-icon=loading]):not([data-text])]:hidden" : "[&>*:not([data-icon=loading])]:invisible"),
|
|
276
|
+
className
|
|
277
|
+
),
|
|
278
|
+
children: commonChildren
|
|
279
|
+
};
|
|
280
|
+
if ("href" in commonProps) {
|
|
281
|
+
return /* @__PURE__ */ jsx(Link, { ...commonProps, href: disabled || loading ? void 0 : href });
|
|
282
|
+
}
|
|
283
|
+
return /* @__PURE__ */ jsx(Button$1, { ...commonProps, type: commonProps.type || "button", isPending: loading });
|
|
284
|
+
};
|
|
285
|
+
var HintText = ({ isInvalid, className, size = "md", ...props }) => {
|
|
286
|
+
return /* @__PURE__ */ jsx(
|
|
287
|
+
Text,
|
|
288
|
+
{
|
|
289
|
+
...props,
|
|
290
|
+
slot: isInvalid ? "errorMessage" : "description",
|
|
291
|
+
className: cx(
|
|
292
|
+
"text-sm text-tertiary",
|
|
293
|
+
// Size
|
|
294
|
+
size === "sm" && "text-xs",
|
|
295
|
+
"in-data-[input-size=sm]:text-xs",
|
|
296
|
+
// Invalid state
|
|
297
|
+
isInvalid && "text-error-primary",
|
|
298
|
+
"group-invalid:text-error-primary",
|
|
299
|
+
className
|
|
300
|
+
)
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
};
|
|
304
|
+
HintText.displayName = "HintText";
|
|
305
|
+
var Tooltip = ({
|
|
306
|
+
title,
|
|
307
|
+
description,
|
|
308
|
+
children,
|
|
309
|
+
arrow = false,
|
|
310
|
+
delay = 100,
|
|
311
|
+
closeDelay = 0,
|
|
312
|
+
trigger,
|
|
313
|
+
isDisabled,
|
|
314
|
+
isOpen,
|
|
315
|
+
defaultOpen,
|
|
316
|
+
offset = 6,
|
|
317
|
+
crossOffset,
|
|
318
|
+
placement = "top",
|
|
319
|
+
onOpenChange,
|
|
320
|
+
...tooltipProps
|
|
321
|
+
}) => {
|
|
322
|
+
const isTopOrBottomLeft = ["top left", "top end", "bottom left", "bottom end"].includes(placement);
|
|
323
|
+
const isTopOrBottomRight = ["top right", "top start", "bottom right", "bottom start"].includes(placement);
|
|
324
|
+
const calculatedCrossOffset = isTopOrBottomLeft ? -12 : isTopOrBottomRight ? 12 : 0;
|
|
325
|
+
return /* @__PURE__ */ jsxs(TooltipTrigger$1, { ...{ trigger, delay, closeDelay, isDisabled, isOpen, defaultOpen, onOpenChange }, children: [
|
|
326
|
+
children,
|
|
327
|
+
/* @__PURE__ */ jsx(
|
|
328
|
+
Tooltip$1,
|
|
329
|
+
{
|
|
330
|
+
...tooltipProps,
|
|
331
|
+
offset,
|
|
332
|
+
placement,
|
|
333
|
+
crossOffset: crossOffset ?? calculatedCrossOffset,
|
|
334
|
+
className: ({ isEntering, isExiting }) => cx(isEntering && "ease-out animate-in", isExiting && "ease-in animate-out"),
|
|
335
|
+
children: ({ isEntering, isExiting }) => /* @__PURE__ */ jsxs(
|
|
336
|
+
"div",
|
|
337
|
+
{
|
|
338
|
+
className: cx(
|
|
339
|
+
"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",
|
|
340
|
+
description ? "py-3" : "py-2",
|
|
341
|
+
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",
|
|
342
|
+
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"
|
|
343
|
+
),
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-white", children: title }),
|
|
346
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-tooltip-supporting-text", children: description }),
|
|
347
|
+
arrow && /* @__PURE__ */ jsx(OverlayArrow, { children: /* @__PURE__ */ jsx(
|
|
348
|
+
"svg",
|
|
349
|
+
{
|
|
350
|
+
viewBox: "0 0 100 100",
|
|
351
|
+
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",
|
|
352
|
+
children: /* @__PURE__ */ jsx("path", { d: "M0,0 L35.858,35.858 Q50,50 64.142,35.858 L100,0 Z" })
|
|
353
|
+
}
|
|
354
|
+
) })
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
)
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
] });
|
|
361
|
+
};
|
|
362
|
+
var TooltipTrigger = ({ children, className, ...buttonProps }) => {
|
|
363
|
+
return /* @__PURE__ */ jsx(Button$1, { ...buttonProps, className: (values) => cx("h-max w-max outline-hidden", typeof className === "function" ? className(values) : className), children });
|
|
364
|
+
};
|
|
365
|
+
var Label = ({ isInvalid, isRequired, tooltip, tooltipDescription, className, ...props }) => {
|
|
366
|
+
return /* @__PURE__ */ jsxs(
|
|
367
|
+
Label$1,
|
|
368
|
+
{
|
|
369
|
+
"data-label": "true",
|
|
370
|
+
...props,
|
|
371
|
+
className: cx("flex cursor-default items-center gap-0.5 text-sm font-medium text-secondary", className),
|
|
372
|
+
children: [
|
|
373
|
+
props.children,
|
|
374
|
+
/* @__PURE__ */ jsx(
|
|
375
|
+
"span",
|
|
376
|
+
{
|
|
377
|
+
className: cx(
|
|
378
|
+
"hidden text-brand-tertiary",
|
|
379
|
+
isRequired && "block",
|
|
380
|
+
typeof isRequired === "undefined" && "group-required:block",
|
|
381
|
+
isInvalid && "text-error-primary",
|
|
382
|
+
typeof isInvalid === "undefined" && "group-invalid:text-error-primary"
|
|
383
|
+
),
|
|
384
|
+
children: "*"
|
|
385
|
+
}
|
|
386
|
+
),
|
|
387
|
+
tooltip && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, description: tooltipDescription, placement: "top", children: /* @__PURE__ */ jsx(
|
|
388
|
+
TooltipTrigger,
|
|
389
|
+
{
|
|
390
|
+
isDisabled: false,
|
|
391
|
+
className: "cursor-pointer text-fg-quaternary transition duration-200 hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover",
|
|
392
|
+
children: /* @__PURE__ */ jsx(QuestionIcon, { className: "size-4" })
|
|
393
|
+
}
|
|
394
|
+
) })
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
};
|
|
399
|
+
Label.displayName = "Label";
|
|
400
|
+
var inputFocusRingShadow = "border-brand ring-1 ring-inset ring-brand";
|
|
401
|
+
var inputErrorFocusRingShadow = "border-error ring-1 ring-inset ring-error";
|
|
402
|
+
var InputBase = ({
|
|
403
|
+
ref,
|
|
404
|
+
tooltip,
|
|
405
|
+
shortcut,
|
|
406
|
+
groupRef,
|
|
407
|
+
size = "md",
|
|
408
|
+
isInvalid,
|
|
409
|
+
isDisabled,
|
|
410
|
+
isRequired,
|
|
411
|
+
icon: Icon,
|
|
412
|
+
placeholder,
|
|
413
|
+
wrapperClassName,
|
|
414
|
+
tooltipClassName,
|
|
415
|
+
inputClassName,
|
|
416
|
+
iconClassName,
|
|
417
|
+
type = "text",
|
|
418
|
+
...inputProps
|
|
419
|
+
}) => {
|
|
420
|
+
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
|
421
|
+
const hasTrailingIcon = tooltip || isInvalid;
|
|
422
|
+
const hasLeadingIcon = Icon;
|
|
423
|
+
const context = useContext(TextFieldContext);
|
|
424
|
+
const inputSize = context?.size || size;
|
|
425
|
+
const sizes = sortCx({
|
|
426
|
+
sm: {
|
|
427
|
+
root: cx("px-3 py-2 text-sm", hasLeadingIcon && "pl-9", hasTrailingIcon && "pr-9"),
|
|
428
|
+
iconLeading: "left-3 size-4 stroke-[2.25px]",
|
|
429
|
+
iconTrailing: "right-3",
|
|
430
|
+
shortcut: "pr-1.5"
|
|
431
|
+
},
|
|
432
|
+
md: {
|
|
433
|
+
root: cx("px-3 py-2 text-md", hasLeadingIcon && "pl-10", hasTrailingIcon && "pr-9"),
|
|
434
|
+
iconLeading: "left-3 size-5",
|
|
435
|
+
iconTrailing: "right-3",
|
|
436
|
+
shortcut: "pr-2"
|
|
437
|
+
},
|
|
438
|
+
lg: {
|
|
439
|
+
root: cx("px-3.5 py-2.5 text-md", hasLeadingIcon && "pl-10.5", hasTrailingIcon && "pr-9.5"),
|
|
440
|
+
iconLeading: "left-3.5 size-5",
|
|
441
|
+
iconTrailing: "right-3.5",
|
|
442
|
+
shortcut: "pr-2.5"
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
return /* @__PURE__ */ jsxs(
|
|
446
|
+
Group,
|
|
447
|
+
{
|
|
448
|
+
...{ isDisabled, isInvalid },
|
|
449
|
+
ref: groupRef,
|
|
450
|
+
className: ({ isFocusWithin, isDisabled: isDisabled2, isInvalid: isInvalid2 }) => cx(
|
|
451
|
+
"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",
|
|
452
|
+
isFocusWithin && !isDisabled2 && !isInvalid2 && inputFocusRingShadow,
|
|
453
|
+
// Disabled state styles
|
|
454
|
+
isDisabled2 && "cursor-not-allowed opacity-50",
|
|
455
|
+
"group-disabled:cursor-not-allowed group-disabled:opacity-50",
|
|
456
|
+
// Invalid state styles
|
|
457
|
+
isInvalid2 && !isFocusWithin && "border-error_subtle",
|
|
458
|
+
"group-invalid:border-error_subtle",
|
|
459
|
+
"group-invalid:focus-within:border-error group-invalid:focus-within:ring-1 group-invalid:focus-within:ring-inset group-invalid:focus-within:ring-error",
|
|
460
|
+
// Invalid + focus — darker error stroke (not brand)
|
|
461
|
+
isInvalid2 && isFocusWithin && inputErrorFocusRingShadow,
|
|
462
|
+
context?.wrapperClassName,
|
|
463
|
+
wrapperClassName
|
|
464
|
+
),
|
|
465
|
+
children: [
|
|
466
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: cx("pointer-events-none absolute text-fg-quaternary", sizes[inputSize].iconLeading, context?.iconClassName, iconClassName) }),
|
|
467
|
+
/* @__PURE__ */ jsx(
|
|
468
|
+
Input,
|
|
469
|
+
{
|
|
470
|
+
...inputProps,
|
|
471
|
+
ref,
|
|
472
|
+
required: isRequired,
|
|
473
|
+
type: type === "password" && isPasswordVisible ? "text" : type,
|
|
474
|
+
placeholder,
|
|
475
|
+
className: cx(
|
|
476
|
+
"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",
|
|
477
|
+
sizes[inputSize].root,
|
|
478
|
+
context?.inputClassName,
|
|
479
|
+
inputClassName
|
|
480
|
+
)
|
|
481
|
+
}
|
|
482
|
+
),
|
|
483
|
+
tooltip && type !== "password" && /* @__PURE__ */ jsx(Tooltip, { title: tooltip, placement: "top", children: /* @__PURE__ */ jsx(
|
|
484
|
+
TooltipTrigger,
|
|
485
|
+
{
|
|
486
|
+
className: cx(
|
|
487
|
+
"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",
|
|
488
|
+
sizes[inputSize].iconTrailing,
|
|
489
|
+
context?.tooltipClassName,
|
|
490
|
+
tooltipClassName
|
|
491
|
+
),
|
|
492
|
+
children: /* @__PURE__ */ jsx(QuestionIcon, { className: "size-4 stroke-[2.25px]" })
|
|
493
|
+
}
|
|
494
|
+
) }),
|
|
495
|
+
type !== "password" && /* @__PURE__ */ jsx(
|
|
496
|
+
InfoIcon,
|
|
497
|
+
{
|
|
498
|
+
className: cx(
|
|
499
|
+
"pointer-events-none absolute hidden size-4 stroke-[2.25px] text-fg-error-secondary group-invalid/input:block",
|
|
500
|
+
sizes[inputSize].iconTrailing,
|
|
501
|
+
context?.tooltipClassName,
|
|
502
|
+
tooltipClassName
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
type === "password" && /* @__PURE__ */ jsx(
|
|
507
|
+
Button$1,
|
|
508
|
+
{
|
|
509
|
+
"aria-label": "Toggle password visibility",
|
|
510
|
+
onClick: () => setIsPasswordVisible(!isPasswordVisible),
|
|
511
|
+
className: cx(
|
|
512
|
+
"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",
|
|
513
|
+
sizes[inputSize].iconTrailing
|
|
514
|
+
),
|
|
515
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsx(EyeSlashIcon, { className: "size-4 stroke-[2.25px]" }) : /* @__PURE__ */ jsx(EyeIcon, { className: "size-4 stroke-[2.25px]" })
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
shortcut && /* @__PURE__ */ jsx(
|
|
519
|
+
"div",
|
|
520
|
+
{
|
|
521
|
+
className: cx(
|
|
522
|
+
"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",
|
|
523
|
+
sizes[inputSize].shortcut
|
|
524
|
+
),
|
|
525
|
+
children: /* @__PURE__ */ jsx(
|
|
526
|
+
"span",
|
|
527
|
+
{
|
|
528
|
+
"aria-hidden": "true",
|
|
529
|
+
className: "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
|
|
530
|
+
children: typeof shortcut === "string" ? shortcut : "\u2318K"
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
}
|
|
534
|
+
)
|
|
535
|
+
]
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
};
|
|
539
|
+
InputBase.displayName = "InputBase";
|
|
540
|
+
var TextFieldContext = createContext({});
|
|
541
|
+
var TextField = ({ className, size = "md", inputClassName, wrapperClassName, iconClassName, tooltipClassName, ...props }) => {
|
|
542
|
+
return /* @__PURE__ */ jsx(TextFieldContext.Provider, { value: { inputClassName, wrapperClassName, iconClassName, tooltipClassName, size }, children: /* @__PURE__ */ jsx(
|
|
543
|
+
TextField$1,
|
|
544
|
+
{
|
|
545
|
+
...props,
|
|
546
|
+
"data-input-wrapper": true,
|
|
547
|
+
"data-input-size": size,
|
|
548
|
+
className: (state) => cx("group flex h-max w-full flex-col items-start justify-start gap-1.5", typeof className === "function" ? className(state) : className)
|
|
549
|
+
}
|
|
550
|
+
) });
|
|
551
|
+
};
|
|
552
|
+
TextField.displayName = "TextField";
|
|
553
|
+
var inputGroupAddonInnerFieldClass = "group-has-[select]:border-0 group-has-[select]:bg-transparent group-has-[select]:shadow-none group-has-[select]:ring-0 group-has-[select]:group-invalid:border-0 group-has-[select]:group-invalid:ring-0 group-has-[select]:group-invalid:shadow-none group-has-[select]:focus-within:border-0 group-has-[select]:focus-within:shadow-none group-has-[select]:focus-within:ring-0 group-has-[select]:group-invalid:focus-within:border-0 group-has-[select]:group-invalid:focus-within:ring-0 group-has-[section[data-trailing]_button]:border-0 group-has-[section[data-trailing]_button]:bg-transparent group-has-[section[data-trailing]_button]:shadow-none group-has-[section[data-trailing]_button]:ring-0 group-has-[section[data-trailing]_button]:group-invalid:border-0 group-has-[section[data-trailing]_button]:group-invalid:ring-0 group-has-[section[data-trailing]_button]:group-invalid:shadow-none group-has-[section[data-trailing]_button]:focus-within:border-0 group-has-[section[data-trailing]_button]:focus-within:shadow-none group-has-[section[data-trailing]_button]:focus-within:ring-0 group-has-[section[data-trailing]_button]:group-invalid:focus-within:border-0 group-has-[section[data-trailing]_button]:group-invalid:focus-within:ring-0 group-has-[section[data-leading]_button]:border-0 group-has-[section[data-leading]_button]:bg-transparent group-has-[section[data-leading]_button]:shadow-none group-has-[section[data-leading]_button]:ring-0 group-has-[section[data-leading]_button]:group-invalid:border-0 group-has-[section[data-leading]_button]:group-invalid:ring-0 group-has-[section[data-leading]_button]:group-invalid:shadow-none group-has-[section[data-leading]_button]:focus-within:border-0 group-has-[section[data-leading]_button]:focus-within:shadow-none group-has-[section[data-leading]_button]:focus-within:ring-0 group-has-[section[data-leading]_button]:group-invalid:focus-within:border-0 group-has-[section[data-leading]_button]:group-invalid:focus-within:ring-0";
|
|
554
|
+
var inputGroupShellBorderClass = "has-[select]:border has-[select]:border-solid has-[select]:border-primary has-[select]:shadow-xs has-[section[data-trailing]_button]:border has-[section[data-trailing]_button]:border-solid has-[section[data-trailing]_button]:border-primary has-[section[data-trailing]_button]:shadow-xs has-[section[data-leading]_button]:border has-[section[data-leading]_button]:border-solid has-[section[data-leading]_button]:border-primary has-[section[data-leading]_button]:shadow-xs";
|
|
555
|
+
var inputGroupShellFocusClass = "has-[select]:focus-within:after:pointer-events-none has-[select]:focus-within:after:absolute has-[select]:focus-within:after:-inset-px has-[select]:focus-within:after:z-10 has-[select]:focus-within:after:rounded-lg has-[select]:focus-within:after:border has-[select]:focus-within:after:border-solid has-[select]:focus-within:after:border-brand has-[select]:focus-within:after:ring-1 has-[select]:focus-within:after:ring-inset has-[select]:focus-within:after:ring-brand has-[select]:focus-within:after:content-[''] has-[section[data-trailing]_button]:focus-within:after:pointer-events-none has-[section[data-trailing]_button]:focus-within:after:absolute has-[section[data-trailing]_button]:focus-within:after:-inset-px has-[section[data-trailing]_button]:focus-within:after:z-10 has-[section[data-trailing]_button]:focus-within:after:rounded-lg has-[section[data-trailing]_button]:focus-within:after:border has-[section[data-trailing]_button]:focus-within:after:border-solid has-[section[data-trailing]_button]:focus-within:after:border-brand has-[section[data-trailing]_button]:focus-within:after:ring-1 has-[section[data-trailing]_button]:focus-within:after:ring-inset has-[section[data-trailing]_button]:focus-within:after:ring-brand has-[section[data-trailing]_button]:focus-within:after:content-[''] has-[section[data-leading]_button]:focus-within:after:pointer-events-none has-[section[data-leading]_button]:focus-within:after:absolute has-[section[data-leading]_button]:focus-within:after:-inset-px has-[section[data-leading]_button]:focus-within:after:z-10 has-[section[data-leading]_button]:focus-within:after:rounded-lg has-[section[data-leading]_button]:focus-within:after:border has-[section[data-leading]_button]:focus-within:after:border-solid has-[section[data-leading]_button]:focus-within:after:border-brand has-[section[data-leading]_button]:focus-within:after:ring-1 has-[section[data-leading]_button]:focus-within:after:ring-inset has-[section[data-leading]_button]:focus-within:after:ring-brand has-[section[data-leading]_button]:focus-within:after:content-['']";
|
|
556
|
+
var inputGroupShellInvalidClass = "has-[select]:border-error_subtle has-[select]:focus-within:after:pointer-events-none has-[select]:focus-within:after:absolute has-[select]:focus-within:after:-inset-px has-[select]:focus-within:after:z-10 has-[select]:focus-within:after:rounded-lg has-[select]:focus-within:after:border has-[select]:focus-within:after:border-solid has-[select]:focus-within:after:border-error has-[select]:focus-within:after:ring-1 has-[select]:focus-within:after:ring-inset has-[select]:focus-within:after:ring-error has-[select]:focus-within:after:content-[''] has-[section[data-trailing]_button]:border-error_subtle has-[section[data-trailing]_button]:focus-within:after:pointer-events-none has-[section[data-trailing]_button]:focus-within:after:absolute has-[section[data-trailing]_button]:focus-within:after:-inset-px has-[section[data-trailing]_button]:focus-within:after:z-10 has-[section[data-trailing]_button]:focus-within:after:rounded-lg has-[section[data-trailing]_button]:focus-within:after:border has-[section[data-trailing]_button]:focus-within:after:border-solid has-[section[data-trailing]_button]:focus-within:after:border-error has-[section[data-trailing]_button]:focus-within:after:ring-1 has-[section[data-trailing]_button]:focus-within:after:ring-inset has-[section[data-trailing]_button]:focus-within:after:ring-error has-[section[data-trailing]_button]:focus-within:after:content-[''] has-[section[data-leading]_button]:border-error_subtle has-[section[data-leading]_button]:focus-within:after:pointer-events-none has-[section[data-leading]_button]:focus-within:after:absolute has-[section[data-leading]_button]:focus-within:after:-inset-px has-[section[data-leading]_button]:focus-within:after:z-10 has-[section[data-leading]_button]:focus-within:after:rounded-lg has-[section[data-leading]_button]:focus-within:after:border has-[section[data-leading]_button]:focus-within:after:border-solid has-[section[data-leading]_button]:focus-within:after:border-error has-[section[data-leading]_button]:focus-within:after:ring-1 has-[section[data-leading]_button]:focus-within:after:ring-inset has-[section[data-leading]_button]:focus-within:after:ring-error has-[section[data-leading]_button]:focus-within:after:content-['']";
|
|
557
|
+
var InputPrefix = ({ children, ...props }) => /* @__PURE__ */ jsx(
|
|
558
|
+
"span",
|
|
559
|
+
{
|
|
560
|
+
...props,
|
|
561
|
+
className: cx(
|
|
562
|
+
"flex h-full shrink-0 items-center self-stretch border border-solid border-primary bg-primary text-tertiary shadow-xs transition-[border-color,box-shadow] duration-100 ease-linear",
|
|
563
|
+
// Match InputBase invalid stroke when inside InputGroup
|
|
564
|
+
"in-data-input-wrapper:group-invalid:border-error_subtle in-data-input-wrapper:group-invalid:group-focus-within:border-error",
|
|
565
|
+
// Styles when the prefix is within an `InputGroup`
|
|
566
|
+
"in-data-input-wrapper:in-data-leading:-mr-px in-data-input-wrapper:in-data-leading:rounded-l-lg in-data-input-wrapper:in-data-leading:rounded-r-none in-data-input-wrapper:in-data-leading:border-r-0",
|
|
567
|
+
"in-data-input-wrapper:in-data-trailing:-ml-px in-data-input-wrapper:in-data-trailing:rounded-r-lg in-data-input-wrapper:in-data-trailing:rounded-l-none in-data-input-wrapper:in-data-trailing:border-l-0",
|
|
568
|
+
// Default size styles — mirror InputBase input padding / typography
|
|
569
|
+
"px-3 py-2 text-md",
|
|
570
|
+
// Small size styles
|
|
571
|
+
"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",
|
|
572
|
+
// Large size styles
|
|
573
|
+
"in-data-input-wrapper:in-data-[input-size=lg]:px-3.5 in-data-input-wrapper:in-data-[input-size=lg]:py-2.5 in-data-input-wrapper:in-data-[input-size=lg]:text-md",
|
|
574
|
+
props.className
|
|
575
|
+
),
|
|
576
|
+
children
|
|
577
|
+
}
|
|
578
|
+
);
|
|
579
|
+
var InputGroup = ({ size = "md", prefix, leadingAddon, trailingAddon, label, hint, hideRequiredIndicator, children, ...props }) => {
|
|
580
|
+
const hasLeading = !!leadingAddon;
|
|
581
|
+
const hasTrailing = !!trailingAddon;
|
|
582
|
+
const paddings = sortCx({
|
|
583
|
+
sm: {
|
|
584
|
+
input: cx(
|
|
585
|
+
// Apply padding styles when select element is passed as a child
|
|
586
|
+
hasLeading && "group-has-[select]:pr-9 group-has-[select]:pl-2",
|
|
587
|
+
hasTrailing && (prefix ? "group-has-[select]:pr-6 group-has-[select]:pl-0" : "group-has-[select]:pr-6 group-has-[select]:pl-3")
|
|
588
|
+
),
|
|
589
|
+
leadingText: "pr-1.5 pl-3"
|
|
590
|
+
},
|
|
591
|
+
md: {
|
|
592
|
+
input: cx(
|
|
593
|
+
// Apply padding styles when select element is passed as a child
|
|
594
|
+
hasLeading && "group-has-[select]:pr-9 group-has-[select]:pl-2.5",
|
|
595
|
+
hasTrailing && (prefix ? "group-has-[select]:pr-6 group-has-[select]:pl-0" : "group-has-[select]:pr-6 group-has-[select]:pl-3")
|
|
596
|
+
),
|
|
597
|
+
leadingText: "pr-2 pl-3"
|
|
598
|
+
},
|
|
599
|
+
lg: {
|
|
600
|
+
input: cx(
|
|
601
|
+
// Apply padding styles when select element is passed as a child
|
|
602
|
+
hasLeading && "group-has-[select]:pr-9.5 group-has-[select]:pl-3",
|
|
603
|
+
hasTrailing && (prefix ? "group-has-[select]:pr-6 group-has-[select]:pl-0" : "group-has-[select]:pr-6 group-has-[select]:pl-3")
|
|
604
|
+
),
|
|
605
|
+
leadingText: "pr-2 pl-3.5"
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
return /* @__PURE__ */ jsx(
|
|
609
|
+
TextField,
|
|
610
|
+
{
|
|
611
|
+
size,
|
|
612
|
+
"aria-label": label || void 0,
|
|
613
|
+
inputClassName: cx(paddings[size].input),
|
|
614
|
+
tooltipClassName: cx(hasTrailing && !hasLeading && "group-has-[select]:right-0"),
|
|
615
|
+
wrapperClassName: cx(
|
|
616
|
+
"z-10",
|
|
617
|
+
// Apply styles based on the presence of leading or trailing elements
|
|
618
|
+
hasLeading && "rounded-l-none",
|
|
619
|
+
hasTrailing && "rounded-r-none",
|
|
620
|
+
inputGroupAddonInnerFieldClass
|
|
621
|
+
),
|
|
622
|
+
...props,
|
|
623
|
+
children: ({ isDisabled, isInvalid, isRequired }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
624
|
+
label && /* @__PURE__ */ jsx(Label, { isRequired: hideRequiredIndicator ? false : isRequired, children: label }),
|
|
625
|
+
/* @__PURE__ */ jsxs(
|
|
626
|
+
"div",
|
|
627
|
+
{
|
|
628
|
+
"data-input-size": size,
|
|
629
|
+
className: cx(
|
|
630
|
+
"group relative flex h-max w-full flex-row items-stretch overflow-clip rounded-lg bg-primary transition-[border-color,box-shadow] duration-100 ease-linear",
|
|
631
|
+
// Single outer shell for select / button addons (Figma 85:1269)
|
|
632
|
+
inputGroupShellBorderClass,
|
|
633
|
+
!isInvalid && inputGroupShellFocusClass,
|
|
634
|
+
isInvalid && inputGroupShellInvalidClass,
|
|
635
|
+
isDisabled && "cursor-not-allowed"
|
|
636
|
+
),
|
|
637
|
+
children: [
|
|
638
|
+
leadingAddon && /* @__PURE__ */ jsx("section", { "data-leading": hasLeading || void 0, className: "flex shrink-0 self-stretch group-disabled:opacity-50 *:h-full", children: leadingAddon }),
|
|
639
|
+
prefix && /* @__PURE__ */ jsx("span", { className: cx("my-auto grow group-disabled:opacity-50", paddings[size].leadingText), children: /* @__PURE__ */ jsx("p", { className: cx("text-md text-tertiary", size === "sm" && "text-sm"), children: prefix }) }),
|
|
640
|
+
children,
|
|
641
|
+
trailingAddon && /* @__PURE__ */ jsx("section", { "data-trailing": hasTrailing || void 0, className: "flex shrink-0 self-stretch group-disabled:opacity-50 *:h-full", children: trailingAddon })
|
|
642
|
+
]
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
hint && /* @__PURE__ */ jsx(HintText, { isInvalid, className: cx(size === "sm" && "text-xs"), children: hint })
|
|
646
|
+
] })
|
|
647
|
+
}
|
|
648
|
+
);
|
|
649
|
+
};
|
|
650
|
+
InputGroup.Prefix = InputPrefix;
|
|
651
|
+
InputGroup.displayName = "InputGroup";
|
|
652
|
+
var InputFile = ({
|
|
653
|
+
size = "sm",
|
|
654
|
+
label,
|
|
655
|
+
hint,
|
|
656
|
+
placeholder = "Choose a file",
|
|
657
|
+
isDisabled,
|
|
658
|
+
isInvalid,
|
|
659
|
+
isRequired,
|
|
660
|
+
hideRequiredIndicator,
|
|
661
|
+
isLoading,
|
|
662
|
+
acceptedFileTypes,
|
|
663
|
+
allowsMultiple,
|
|
664
|
+
onChange,
|
|
665
|
+
className,
|
|
666
|
+
buttonText = "Upload"
|
|
667
|
+
}) => {
|
|
668
|
+
const inputRef = useRef(null);
|
|
669
|
+
const [fileNames, setFileNames] = useState("");
|
|
670
|
+
const handleClick = () => {
|
|
671
|
+
if (inputRef.current?.value) {
|
|
672
|
+
inputRef.current.value = "";
|
|
673
|
+
}
|
|
674
|
+
inputRef.current?.click();
|
|
675
|
+
};
|
|
676
|
+
const handleChange = () => {
|
|
677
|
+
const files = inputRef.current?.files ?? null;
|
|
678
|
+
if (files && files.length > 0) {
|
|
679
|
+
setFileNames(
|
|
680
|
+
Array.from(files).map((f) => f.name).join(", ")
|
|
681
|
+
);
|
|
682
|
+
} else {
|
|
683
|
+
setFileNames("");
|
|
684
|
+
}
|
|
685
|
+
onChange?.(files);
|
|
686
|
+
};
|
|
687
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
688
|
+
/* @__PURE__ */ jsx(
|
|
689
|
+
InputGroup,
|
|
690
|
+
{
|
|
691
|
+
size,
|
|
692
|
+
label,
|
|
693
|
+
hint,
|
|
694
|
+
isDisabled,
|
|
695
|
+
isInvalid,
|
|
696
|
+
isRequired,
|
|
697
|
+
hideRequiredIndicator,
|
|
698
|
+
className,
|
|
699
|
+
trailingAddon: /* @__PURE__ */ jsx(Button, { size, color: "secondary", onClick: handleClick, isDisabled, children: buttonText }),
|
|
700
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative flex min-w-0 flex-1", children: [
|
|
701
|
+
/* @__PURE__ */ jsx(
|
|
702
|
+
InputBase,
|
|
703
|
+
{
|
|
704
|
+
placeholder,
|
|
705
|
+
value: fileNames,
|
|
706
|
+
readOnly: true,
|
|
707
|
+
inputClassName: cx("cursor-pointer", isLoading && "pr-9"),
|
|
708
|
+
wrapperClassName: "cursor-pointer",
|
|
709
|
+
onClick: handleClick
|
|
710
|
+
}
|
|
711
|
+
),
|
|
712
|
+
isLoading && /* @__PURE__ */ jsxs("svg", { fill: "none", viewBox: "0 0 16 16", className: "pointer-events-none absolute top-1/2 right-3 z-20 size-4 -translate-y-1/2 text-fg-quaternary", children: [
|
|
713
|
+
/* @__PURE__ */ jsx("circle", { className: "stroke-current opacity-30", cx: "8", cy: "8", r: "6.5", strokeWidth: "1.5" }),
|
|
714
|
+
/* @__PURE__ */ jsx(
|
|
715
|
+
"circle",
|
|
716
|
+
{
|
|
717
|
+
className: "origin-center animate-spin stroke-current",
|
|
718
|
+
cx: "8",
|
|
719
|
+
cy: "8",
|
|
720
|
+
r: "6.5",
|
|
721
|
+
strokeWidth: "1.5",
|
|
722
|
+
strokeDasharray: "10 40",
|
|
723
|
+
strokeLinecap: "round"
|
|
724
|
+
}
|
|
725
|
+
)
|
|
726
|
+
] })
|
|
727
|
+
] })
|
|
728
|
+
}
|
|
729
|
+
),
|
|
730
|
+
/* @__PURE__ */ jsx(
|
|
731
|
+
"input",
|
|
732
|
+
{
|
|
733
|
+
ref: inputRef,
|
|
734
|
+
type: "file",
|
|
735
|
+
className: "hidden",
|
|
736
|
+
disabled: isDisabled,
|
|
737
|
+
accept: acceptedFileTypes?.toString(),
|
|
738
|
+
multiple: allowsMultiple,
|
|
739
|
+
onChange: handleChange
|
|
740
|
+
}
|
|
741
|
+
)
|
|
742
|
+
] });
|
|
743
|
+
};
|
|
744
|
+
InputFile.displayName = "InputFile";
|
|
745
|
+
|
|
746
|
+
export { InputFile };
|
|
747
|
+
//# sourceMappingURL=input-file.js.map
|
|
748
|
+
//# sourceMappingURL=input-file.js.map
|