@zonos/amino 5.0.11 → 5.1.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/all.d.ts +2 -2
- package/components/alert-dialog/AlertContext.js +1 -1
- package/components/alert-dialog/AlertDialog.js +1 -1
- package/components/alert-dialog/useAlert.js +1 -1
- package/components/announcement-dialog/AnnouncementDialog.d.ts +9 -18
- package/components/announcement-dialog/AnnouncementDialog.js +1 -1
- package/components/banner/Banner.js +1 -1
- package/components/button/Button.d.ts +5 -5
- package/components/button/Button.js +1 -1
- package/components/button/LegacyButton.d.ts +43 -0
- package/components/button/LegacyButton.js +1 -0
- package/components/confirm-dialog/ConfirmContext.js +1 -1
- package/components/confirm-dialog/ConfirmDialog.js +1 -1
- package/components/confirm-dialog/useConfirm.js +1 -1
- package/components/cover-sheet/CoverSheet.js +1 -1
- package/components/dialog/BaseDialog.d.ts +47 -0
- package/components/dialog/BaseDialog.js +1 -0
- package/components/dialog/Dialog.d.ts +9 -17
- package/components/dialog/Dialog.js +1 -1
- package/components/drop-zone/DropZone.js +1 -1
- package/components/file-upload/FileUpload.js +1 -1
- package/components/graph-matrix/GraphMatrix.js +1 -1
- package/components/lightbox/LightBox.d.ts +3 -21
- package/components/lightbox/LightBox.js +1 -1
- package/components/nested-data-table/NestedDataTable.js +1 -1
- package/components/nested-data-table/NestedDataTableHasura.js +1 -1
- package/components/nested-data-table/_TableData.js +1 -1
- package/components/section/HSection.js +1 -1
- package/components/slide-over/SlideOver.d.ts +3 -8
- package/components/slide-over/SlideOver.js +1 -1
- package/components/spinner/Spinner.js +1 -1
- package/components/table/TableRowCollapse.js +1 -1
- package/package.json +1 -1
- package/styles/constants/theme.d.ts +33 -3
- package/styles/constants/theme.js +1 -1
- package/theme.css +84 -6
- package/types/Variant.d.ts +1 -0
- package/components/backdrop/Backdrop.d.ts +0 -1
- package/components/backdrop/Backdrop.js +0 -1
- package/components/dialog/_BaseDialog.d.ts +0 -14
- package/components/dialog/_BaseDialog.js +0 -1
- package/components/ownership-block/OwnershipBlock.d.ts +0 -15
- package/components/ownership-block/OwnershipBlock.js +0 -1
package/all.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import './components/announcement-dialog/AnnouncementDialog';
|
|
|
6
6
|
import './components/avatar/AvatarBase';
|
|
7
7
|
import './components/avatar/ImageAvatar';
|
|
8
8
|
import './components/avatar/UserAvatar';
|
|
9
|
-
import './components/backdrop/Backdrop';
|
|
10
9
|
import './components/badge/Badge';
|
|
11
10
|
import './components/banner/Banner';
|
|
12
11
|
import './components/button/Button';
|
|
12
|
+
import './components/button/LegacyButton';
|
|
13
13
|
import './components/button/MenuButton';
|
|
14
14
|
import './components/button/RippleGroup';
|
|
15
15
|
import './components/button/useRipple';
|
|
@@ -25,6 +25,7 @@ import './components/cover-sheet/CoverSheetActions';
|
|
|
25
25
|
import './components/currency/Currency';
|
|
26
26
|
import './components/currency/DualCurrency';
|
|
27
27
|
import './components/danger-zone/DangerZone';
|
|
28
|
+
import './components/dialog/BaseDialog';
|
|
28
29
|
import './components/dialog/Dialog';
|
|
29
30
|
import './components/divider/Divider';
|
|
30
31
|
import './components/drop-zone/DropZone';
|
|
@@ -43,7 +44,6 @@ import './components/menu/Menu';
|
|
|
43
44
|
import './components/menu/MenuItem';
|
|
44
45
|
import './components/nested-data-table/NestedDataTable';
|
|
45
46
|
import './components/nested-data-table/NestedDataTableHasura';
|
|
46
|
-
import './components/ownership-block/OwnershipBlock';
|
|
47
47
|
import './components/pivot-table/PivotTable';
|
|
48
48
|
import './components/profile-icon/ProfileIcon';
|
|
49
49
|
import './components/radio/Radio';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./AlertDialog.js");require("styled-components"),require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),i=require("react"),t=require("./AlertDialog.js");require("styled-components"),require("../button/LegacyButton.js"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../dialog/BaseDialog.js"),require("react-dom"),require("../rounded-icon/RoundedIcon.js"),require("../stack/VStack.js"),require("../stack/Stack.js"),require("../text/Text.js"),require("../../icons/ExclamationMarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../icons/HelpIcon.js"),require("../../icons/WarningIcon.js"),require("../../Theme-61f4342c.js"),require("zod");var s=i.createContext((function(e){}));exports.AlertContext=s,exports.AlertContextProvider=function(n){var u=n.children,o=e.__read(i.useState(),2),a=o[0],c=o[1],l=e.__read(i.useState(!1),2),q=l[0],j=l[1],d=i.useCallback((function(e){c(e),j(!0)}),[]);return r.jsxs(s.Provider,{value:d,children:[u,a&&r.jsx(t.AlertDialog,{dismissAction:function(){j(!1),a.onDismiss()},dismissText:a.dismissText,intent:a.intent,label:a.label,open:q,subtitle:a.subtitle})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("styled-components"),i=require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("styled-components"),i=require("../button/LegacyButton.js"),r=require("../dialog/BaseDialog.js"),s=require("../rounded-icon/RoundedIcon.js"),a=require("../stack/VStack.js"),c=require("../text/Text.js"),o=require("../../icons/ExclamationMarkIcon.js"),u=require("../../icons/HelpIcon.js"),l=require("../../icons/WarningIcon.js"),d=require("../../styles/constants/theme.js");function j(e){return e&&e.__esModule?e:{default:e}}require("../../Theme-61f4342c.js"),require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../stack/Stack.js"),require("../../icons/icon-base/_IconBase.js"),require("zod");var p,m,x,q=j(t),g=q.default.div(p||(p=e.__makeTemplateObject(["\n padding: ",";\n\n & > div {\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n"],["\n padding: ",";\n\n & > div {\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n"])),d.theme.space24),f=q.default.div(m||(m=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ",";\n\n & > button + button {\n margin-left: ",";\n }\n\n button {\n flex: 1;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ",";\n\n & > button + button {\n margin-left: ",";\n }\n\n button {\n flex: 1;\n }\n"])),d.theme.space24,d.theme.space8),h=q.default.span(x||(x=e.__makeTemplateObject(["\n opacity: 0.5;\n"],["\n opacity: 0.5;\n"]))),b=function(e){switch(e){case"danger":return n.jsx(o.ExclamationMarkIcon,{});case"warning":return n.jsx(l.WarningIcon,{});default:return n.jsx(u.HelpIcon,{})}};exports.AlertDialog=function(e){var t=e.dismissAction,o=e.dismissText,u=e.intent,l=e.label,d=e.open,j=e.subtitle,p=e.themeOverride;return n.jsx(r.BaseDialog,{"data-theme":p,onClose:t,open:d,width:350,children:n.jsx(g,{children:n.jsxs(a.VStack,{spacing:16,children:[n.jsx(s.RoundedIcon,{intent:u,children:b(u)}),n.jsxs("div",{children:[n.jsx(c.Text,{type:"title",children:l}),n.jsx(h,{children:j})]}),n.jsx(f,{children:n.jsx(i.Button,{intent:u,onClick:t,children:o})})]})})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),r=require("./AlertContext.js");require("../../_tslib-ccfac372.js"),require("react/jsx-runtime"),require("./AlertDialog.js"),require("styled-components"),require("../button/
|
|
1
|
+
"use strict";var e=require("react"),r=require("./AlertContext.js");require("../../_tslib-ccfac372.js"),require("react/jsx-runtime"),require("./AlertDialog.js"),require("styled-components"),require("../button/LegacyButton.js"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../dialog/BaseDialog.js"),require("react-dom"),require("../rounded-icon/RoundedIcon.js"),require("../stack/VStack.js"),require("../stack/Stack.js"),require("../text/Text.js"),require("../../icons/ExclamationMarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../icons/HelpIcon.js"),require("../../icons/WarningIcon.js"),require("../../Theme-61f4342c.js"),require("zod");exports.useAlert=function(){return e.useContext(r.AlertContext)};
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
export type AnnouncementDialogProps = {
|
|
2
|
+
import { type BaseDialogProps } from "../dialog/BaseDialog";
|
|
3
|
+
export type AnnouncementDialogProps = BaseDialogProps & {
|
|
4
4
|
announcementId: string;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
/** Close when clicking outside dialog (on the backdrop)
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
closeOnBlur?: boolean;
|
|
11
|
-
/** Close on pressing 'escape' key
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
closeOnEsc?: boolean;
|
|
15
5
|
image?: ReactNode;
|
|
16
6
|
imageWidth?: number;
|
|
17
7
|
label?: string;
|
|
18
|
-
noBorder?: boolean;
|
|
19
|
-
open?: boolean;
|
|
20
|
-
themeOverride?: Theme;
|
|
21
8
|
title?: ReactNode;
|
|
22
|
-
width?: number;
|
|
23
|
-
onClose?: () => void;
|
|
24
9
|
};
|
|
25
|
-
export declare const AnnouncementDialog: import("react").ForwardRefExoticComponent<
|
|
10
|
+
export declare const AnnouncementDialog: import("react").ForwardRefExoticComponent<BaseDialogProps & {
|
|
11
|
+
announcementId: string;
|
|
12
|
+
image?: ReactNode;
|
|
13
|
+
imageWidth?: number | undefined;
|
|
14
|
+
label?: string | undefined;
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("styled-components"),a=require("../dialog/BaseDialog.js"),i=require("../stack/VStack.js"),o=require("../text/Text.js"),s=require("../../styles/constants/theme.js"),l=require("../../utils/hooks/useStorage.js");function u(e){return e&&e.__esModule?e:{default:e}}require("react-dom"),require("framer-motion"),require("../stack/Stack.js"),require("../../utils/hooks/useSwr.js"),require("swr"),require("../../utils/storage.js");var c,d,m=u(r),g=m.default(i.VStack)(c||(c=e.__makeTemplateObject(["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"],["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n"])),s.theme.space16,s.theme.space24),h=m.default.div(d||(d=e.__makeTemplateObject(["\n width: ",";\n height: auto;\n margin: ",";\n margin-bottom: ",";\n"],["\n width: ",";\n height: auto;\n margin: ",";\n margin-bottom: ",";\n"])),(function(e){return"".concat(e.imageWidth,"px")||"100%"}),(function(e){return e.imageWidth?"0 auto":"unset"}),s.theme.space16),j=n.forwardRef((function(n,r){var i=n.announcementId,s=n.children,u=n.className,c=n.image,d=n.imageWidth,m=n.label,j=n.onClose,f=n.open,p=n.title,x=e.__rest(n,["announcementId","children","className","image","imageWidth","label","onClose","open","title"]),q=l.useStorage({defaultValue:"",key:"announcement:".concat(i),type:"local"}),_=q.setValue,k=q.value;return t.jsxs(a.BaseDialog,e.__assign({},x,{className:[u||"","announcement-dialog"].join(" "),onClose:function(){j&&j(),_("seen")},open:f||!k,children:[t.jsx(h,{imageWidth:d,children:c}),t.jsxs(g,{spacing:8,children:[t.jsx(o.Text,{color:"blue600",type:"label",children:m}),t.jsx(o.Text,{type:"title",children:p}),t.jsx("div",{ref:r,children:t.jsx(o.Text,{color:"gray800",children:s})})]})]}))}));exports.AnnouncementDialog=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),r=require("styled-components"),o=require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),r=require("styled-components"),o=require("../button/LegacyButton.js"),t=require("../stack/HStack.js"),a=require("../text/Text.js"),c=require("../../icons/CheckCircleDuotoneIcon.js"),i=require("../../icons/InfoDuotoneIcon.js"),l=require("../../icons/RemoveCircleDuotoneIcon.js"),s=require("../../icons/RemoveIcon.js"),u=require("../../icons/WarningDuotoneIcon.js"),d=require("../../styles/constants/theme.js");function m(e){return e&&e.__esModule?e:{default:e}}require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../stack/Stack.js"),require("../../icons/icon-base/_IconBase.js");var j,p,g,f,x,h,b,_,k,y,I,C,q,v,T=m(r),O=T.default.div(j||(j=e.__makeTemplateObject(["\n border-radius: ",";\n padding: ",";\n"],["\n border-radius: ",";\n padding: ",";\n"])),d.theme.radius6,d.theme.space16),D=T.default.div(p||(p=e.__makeTemplateObject(["\n display: grid;\n align-items: ",";\n grid-template-areas:\n 'icon header close'\n '. content .';\n grid-template-columns: 32px auto ",";\n"],["\n display: grid;\n align-items: ",";\n grid-template-areas:\n 'icon header close'\n '. content .';\n grid-template-columns: 32px auto ",";\n"])),(function(e){return e.onlyContent?"start":"center"}),(function(e){return e.withoutCloseButton?"0px":"32px"})),w=T.default.div(g||(g=e.__makeTemplateObject(["\n grid-area: icon;\n justify-self: start;\n"],["\n grid-area: icon;\n justify-self: start;\n"]))),B=T.default.div(f||(f=e.__makeTemplateObject(["\n grid-area: close;\n justify-self: end;\n"],["\n grid-area: close;\n justify-self: end;\n"]))),R=T.default(o.Button)(x||(x=e.__makeTemplateObject(["\n && {\n width: 20px;\n }\n"],["\n && {\n width: 20px;\n }\n"]))),z=T.default.div(h||(h=e.__makeTemplateObject(["\n grid-area: header;\n color: ",";\n"],["\n grid-area: header;\n color: ",";\n"])),(function(e){return d.theme[e.color]})),N=T.default.div(b||(b=e.__makeTemplateObject(["\n grid-area: content;\n margin-top: 8px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n"],["\n grid-area: content;\n margin-top: 8px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n"]))),S=T.default.header(_||(_=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"],["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"]))),H=T.default.footer(k||(k=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n"],["\n display: flex;\n align-items: center;\n"]))),A=T.default(O)(y||(y=e.__makeTemplateObject(["\n background: ",";\n color: ",";\n"],["\n background: ",";\n color: ",";\n"])),d.theme.gray100,d.theme.gray700),W=T.default(O)(I||(I=e.__makeTemplateObject(["\n background: ",";\n color: ",";\n"],["\n background: ",";\n color: ",";\n"])),d.theme.blue100,d.theme.blue700),G=T.default(O)(C||(C=e.__makeTemplateObject(["\n background: ",";\n color: ",";\n"],["\n background: ",";\n color: ",";\n"])),d.theme.green100,d.theme.green700),L=T.default(O)(q||(q=e.__makeTemplateObject(["\n background: ",";\n color: ",";\n"],["\n background: ",";\n color: ",";\n"])),d.theme.orange100,d.theme.orange700),M=T.default(O)(v||(v=e.__makeTemplateObject(["\n background: ",";\n color: ",";\n"],["\n background: ",";\n color: ",";\n"])),d.theme.red100,d.theme.red700);exports.Banner=function(r){var o=r.children,d=r.className,m=void 0===d?"":d,j=r.footerActions,p=r.headerActions,g=r.intent,f=r.onClose,x=r.title,h=function(r){var c=r.intentIcon,i=r.removeIconColor,l=!!o&&!x&&!j,u=e.__read([x&&n.jsxs(S,{children:[n.jsx(a.Text,{color:i,type:"label",children:x}),p&&n.jsx(t.HStack,{spacing:8,children:p})]}),o,j&&n.jsx(H,{children:n.jsx(t.HStack,{spacing:8,children:j})})].filter(Boolean),3),d=u[0],m=u[1],g=u[2];return n.jsxs(D,{onlyContent:l,withoutCloseButton:!f,children:[n.jsx(w,{children:c}),f&&n.jsx(B,{children:n.jsx(R,{icon:n.jsx(s.RemoveIcon,{color:i,size:20}),intent:"text",onClick:f})}),n.jsx(z,{color:i,children:d}),m&&n.jsxs(N,{children:[m,g]})]})};switch(g){case"info":return n.jsx(W,{className:m,children:h({intentIcon:n.jsx(c.CheckCircleDuotoneIcon,{color:"blue800",secondaryColor:"blue300",size:20}),removeIconColor:"blue800"})});case"success":return n.jsx(G,{className:m,children:h({intentIcon:n.jsx(c.CheckCircleDuotoneIcon,{color:"green800",secondaryColor:"green300",size:20}),removeIconColor:"green800"})});case"warning":return n.jsx(L,{className:m,children:h({intentIcon:n.jsx(u.WarningDuotoneIcon,{color:"orange800",secondaryColor:"orange300",size:20}),removeIconColor:"orange800"})});case"error":return n.jsx(M,{className:m,children:h({intentIcon:n.jsx(l.RemoveCircleDuotoneIcon,{color:"red800",secondaryColor:"red300",size:20}),removeIconColor:"red800"})});default:return n.jsx(A,{className:m,children:h({intentIcon:n.jsx(i.InfoDuotoneIcon,{color:"gray800",secondaryColor:"gray300",size:20}),removeIconColor:"gray800"})})}};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type MouseEventHandler, type ReactNode } from 'react';
|
|
2
2
|
import { type SpinnerProps } from "../spinner/Spinner";
|
|
3
3
|
import type { Color } from "../../types";
|
|
4
|
-
import type { Intent } from "../../types/Intent";
|
|
5
4
|
import type { Size } from "../../types/Size";
|
|
6
5
|
import type { Theme } from "../../types/Theme";
|
|
7
|
-
type
|
|
6
|
+
import type { Variant } from "../../types/Variant";
|
|
8
7
|
type ButtonBase = {
|
|
9
8
|
background?: Color | 'inherit';
|
|
10
9
|
/** @param borderColor only available for intent 'outline' */
|
|
@@ -16,8 +15,6 @@ type ButtonBase = {
|
|
|
16
15
|
hoverBackground?: Color | 'inherit';
|
|
17
16
|
icon?: ReactNode;
|
|
18
17
|
iconRight?: boolean;
|
|
19
|
-
/** @default 'secondary' */
|
|
20
|
-
intent?: IntentProps;
|
|
21
18
|
/** @default false */
|
|
22
19
|
loading?: boolean;
|
|
23
20
|
loadingText?: string;
|
|
@@ -26,12 +23,15 @@ type ButtonBase = {
|
|
|
26
23
|
* @default false
|
|
27
24
|
*/
|
|
28
25
|
noRipple?: boolean;
|
|
26
|
+
outline?: boolean;
|
|
29
27
|
size?: Size;
|
|
30
28
|
/** Color for the spinner when in a loading state */
|
|
31
29
|
spinnerColor?: SpinnerProps['color'];
|
|
32
30
|
tabIndex?: number;
|
|
33
31
|
themeOverride?: Theme;
|
|
34
32
|
type?: 'button' | 'reset' | 'submit';
|
|
33
|
+
/** @default 'standard' */
|
|
34
|
+
variant?: Variant;
|
|
35
35
|
};
|
|
36
36
|
export type GroupTag = 'div' | 'a' | 'button';
|
|
37
37
|
type MyHtmlElement<T extends GroupTag> = T extends 'a' ? HTMLAnchorElement : T extends 'div' ? HTMLDivElement : HTMLButtonElement;
|
|
@@ -39,5 +39,5 @@ export type ButtonProps<T extends GroupTag = 'button'> = ButtonBase & Omit<Compo
|
|
|
39
39
|
onClick?: MouseEventHandler<MyHtmlElement<T>>;
|
|
40
40
|
tag?: T;
|
|
41
41
|
};
|
|
42
|
-
export declare function Button<T extends GroupTag = 'button'>({ children, className, disabled, icon, iconRight,
|
|
42
|
+
export declare function Button<T extends GroupTag = 'button'>({ children, className, disabled, icon, iconRight, loading, loadingText, noRipple, size, spinnerColor, tag: _tag, themeOverride, type, variant, ...props }: ButtonProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
43
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),r=require("react"),o=require("styled-components"),t=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function l(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var s,d,u,g,h,b,p,m,f,k,v=l(o),y=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},x=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},_=v.default.span(s||(s=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),c.theme.radius4,c.theme.space8),j=v.default.button(d||(d=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition: ",";\n font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition: ",";\n font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space16,c.theme.radius6,c.theme.transition,c.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.space4," ").concat(c.theme.space8);case"lg":case"xl":return"".concat(c.theme.space12," ").concat(c.theme.space24);default:return"".concat(c.theme.space8," ").concat(c.theme.space16)}}(n.size)}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space8,c.theme.space8),w=v.default(j)(u||(u=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.primary}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.blue400}),c.theme.blue700,c.theme.gray0,_,c.theme.primary),R=v.default(j)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"],["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.background)||c.theme.gray100}),(function(n){return y(n.hoverBackground)||c.theme.gray200}),c.theme.blue100,c.theme.blue600,_,c.theme.gray100,c.theme.gray0,c.theme.gray1000,(function(n){return y(n.hoverBackground)||c.theme.gray900}),c.theme.blue1000,c.theme.blue300,_,c.theme.gray1000),z=v.default(j)(h||(h=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.red600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.red400}),c.theme.red700,_,c.theme.red600),C=v.default(j)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.orange600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.orange400}),c.theme.orange700,_,c.theme.orange600),O=v.default(j)(p||(p=n.__makeTemplateObject(["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.borderColor)||c.theme.gray200}),c.theme.gray0,c.theme.gray100,(function(n){return n.hoverBackground&&y(n.hoverBackground)}),c.theme.gray200,c.theme.blue100,c.theme.blue600,c.theme.blue300,_,c.theme.gray0),T=v.default(j)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.background)||"none"}),(function(n){return y(n.color)||c.theme.gray800}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue600),q=v.default(j)(f||(f=n.__makeTemplateObject(["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.color)||c.theme.gray800}),c.theme.gray400,c.theme.gray700,c.theme.gray1200),B=j,G=v.default(j)(k||(k=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.blue600}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue800,_,c.theme.gray0);exports.Button=function(o){var c=o.children,l=o.className,s=o.disabled,d=void 0!==s&&s,u=o.icon,g=o.iconRight,h=o.intent,b=void 0===h?"secondary":h,p=o.loading,m=void 0!==p&&p,f=o.loadingText,k=o.noRipple,v=void 0!==k&&k,y=o.size,j=void 0===y?"sm":y,N=o.spinnerColor,S=o.tag,E=o.themeOverride,F=o.type,H=void 0===F?"button":F,M=n.__rest(o,["children","className","disabled","icon","iconRight","intent","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type"]),A=S||"button",D=function(n){return e.jsxs(e.Fragment,{children:[!g&&u,c,g&&u,"plain"!==b&&m&&e.jsxs(_,{children:[e.jsx(i.Spinner,{color:n,size:x(j)}),f]})]})},I=[l||"",u&&!c?"only-icon":"",g?"icon-right":"",u?"has-icon":"",m?"loading":"",E].filter(Boolean).join(" "),J=r.useRef(null),K=a.useRipple({disabled:d||m,rippleEnabled:!v&&!["plain","text"].includes(b),rippleRef:J}),L=K.getRippleHandlers,P=K.rippleEnabled,Q={className:I,disabled:d||m,size:j},U=n.__assign(n.__assign(n.__assign({type:H},Q),M),L(M));switch(b){case"primary":return e.jsxs(w,n.__assign({as:A},U,{children:[D(N||"white"),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"subtle":return e.jsxs(T,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"outline":return e.jsxs(O,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"warning":return e.jsxs(C,n.__assign({as:A},U,{children:[D(N||"white"),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"danger":return e.jsxs(z,n.__assign({as:A},U,{children:[D(N||"white"),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"text":return e.jsx(q,n.__assign({as:A},U,{children:D(N)}));case"link":return e.jsxs(G,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}));case"plain":return e.jsx(B,n.__assign({as:A},U,{children:D(N)}));default:return e.jsxs(R,n.__assign({as:A},U,{children:[D(N),P&&e.jsx(t.RippleGroup,{ref:J})]}))}};
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),o=require("react"),t=require("styled-components"),r=require("./RippleGroup.js"),i=require("./useRipple.js"),a=require("../spinner/Spinner.js"),u=require("../../styles/constants/theme.js");function c(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var l,s,d,g,h,b,m,p,f,k=c(t),v=function(n){return"inherit"===n?"inherit":n?u.theme[n]:void 0},x=function(n){switch(n){case"sm":return 16;case"lg":case"xl":return 24;default:return 20}},y=k.default.span(l||(l=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),u.theme.radius6,u.theme.space8),_=k.default.button(s||(s=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n outline: 1px solid transparent;\n transition: ",";\n font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n box-shadow: ",";\n outline: 1px solid ",";\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n .content {\n opacity: ",";\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n outline: 1px solid transparent;\n transition: ",";\n font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:focus {\n box-shadow: ",";\n outline: 1px solid ",";\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg:not(.amino-spinner) {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg:not(.amino-spinner) {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n cursor: not-allowed;\n .content {\n opacity: ",";\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),u.theme.space16,u.theme.radius6,u.theme.transition,u.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(u.theme.space4," ").concat(u.theme.space8);case"lg":case"xl":return"".concat(u.theme.space12," ").concat(u.theme.space24);default:return"".concat(u.theme.space8," ").concat(u.theme.space16)}}(n.size)}),(function(n){return"var(--amino-size-".concat(n.size,")")}),u.theme.buttonFocusRing,(function(n){return n.outline?"":u.theme.gray0}),u.theme.space8,u.theme.space8,(function(n){return n.outline?.6:1})),w=k.default(_)(d||(d=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n background: ",";\n outline-color: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n outline-color: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n background: ",";\n outline-color: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n outline-color: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.color)||n.outline?u.theme.primary:u.theme.gray0}),(function(n){return n.outline?"none":u.theme.shadowButtonPrimary}),(function(n){return v(n.background)||n.outline?u.theme.gray0:u.theme.primary}),(function(n){return v(n.background)||n.outline?u.theme.primary:"transparent"}),(function(n){return v(n.hoverBackground)||n.outline?u.theme.blue100:""}),(function(n){return n.outline?"":u.theme.buttonPrimaryHover}),(function(n){return n.outline?u.theme.blue200:u.theme.blue700}),(function(n){return n.outline?u.theme.gray0:u.theme.blue400}),u.theme.blue400,y,(function(n){return n.outline?u.theme.gray0:u.theme.primary})),j=k.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n box-shadow: ",";\n outline-color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n }\n &[disabled] {\n background: ",";\n outline-color: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n box-shadow: ",";\n outline-color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n &:active {\n background: ",";\n }\n }\n }\n &[disabled] {\n background: ",";\n outline-color: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.color)||n.outline?u.theme.success:u.theme.gray0}),(function(n){return n.outline?"none":u.theme.shadowButtonSuccess}),(function(n){return v(n.background)||n.outline?u.theme.success:"transparent"}),(function(n){return v(n.background)||n.outline?u.theme.gray0:u.theme.success}),(function(n){return v(n.hoverBackground)||n.outline?u.theme.green100:""}),(function(n){return n.outline?"":u.theme.buttonSuccessHover}),(function(n){return n.outline?u.theme.green200:u.theme.green700}),(function(n){return n.outline?u.theme.gray0:u.theme.green400}),u.theme.green400,y,(function(n){return n.outline?u.theme.gray0:u.theme.success})),R=k.default(_)(h||(h=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n outline: 1px solid\n ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n outline-color: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n background: ",";\n outline: 1px solid\n ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n outline-color: ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.color)||u.theme.textColor}),(function(n){return v(n.background)||u.theme.surfaceColor}),(function(n){return n.outline?u.theme.gray300:"rgba(106, 109, 119, 0.12)"}),(function(n){return n.outline?"none":u.theme.shadowButtonStandard}),(function(n){return v(n.hoverBackground)||n.outline?u.theme.gray100:""}),(function(n){return n.outline?"":u.theme.buttonStandardHover}),(function(n){return n.outline?u.theme.gray200:u.theme.gray100}),(function(n){return n.outline?u.theme.gray300:u.theme.gray100}),y,u.theme.surfaceColor),z=k.default(_)(b||(b=n.__makeTemplateObject(["\n outline-color: ",";\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n &[disabled] {\n background: ",";\n outline-color: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n outline-color: ",";\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n &[disabled] {\n background: ",";\n outline-color: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.background)||n.outline?u.theme.danger:"transparent"}),(function(n){return v(n.background)||n.outline?u.theme.gray0:u.theme.danger}),(function(n){return v(n.color)||n.outline?u.theme.danger:u.theme.gray0}),(function(n){return n.outline?"none":u.theme.shadowButtonDanger}),(function(n){return v(n.hoverBackground)||n.outline?u.theme.red100:""}),(function(n){return n.outline?"":u.theme.buttonDangerHover}),(function(n){return n.outline?u.theme.red200:u.theme.red700}),(function(n){return n.outline?u.theme.gray0:u.theme.red400}),u.theme.red400,y,(function(n){return n.outline?u.theme.gray0:u.theme.red600})),B=k.default(_)(m||(m=n.__makeTemplateObject(["\n outline-color: ",";\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n border-color: ",";\n }\n\n "," {\n background: ",";\n }\n"],["\n outline-color: ",";\n background: ",";\n color: ",";\n box-shadow: ",";\n\n &:not([disabled]) {\n &:hover {\n background-color: ",";\n background-image: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &[disabled] {\n background: ",";\n border-color: ",";\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return v(n.background)||n.outline?u.theme.warning:"transparent"}),(function(n){return v(n.background)||n.outline?u.theme.gray0:u.theme.warning}),(function(n){return v(n.color)||n.outline?u.theme.warning:u.theme.gray0}),(function(n){return n.outline?"none":u.theme.shadowButtonWarning}),(function(n){return v(n.hoverBackground)||n.outline?u.theme.orange100:""}),(function(n){return n.outline?"":u.theme.buttonWarningHover}),(function(n){return n.outline?u.theme.orange200:u.theme.orange700}),(function(n){return n.outline?u.theme.gray0:u.theme.orange400}),u.theme.orange400,y,(function(n){return n.outline?u.theme.gray0:u.theme.orange600})),q=k.default(_)(p||(p=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n outline-color: transparent;\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n background: ",";\n color: ",";\n outline-color: transparent;\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ",";\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return v(n.background)||"none"}),(function(n){return v(n.color)||u.theme.textColorSecondary}),(function(n){return v(n.hoverBackground)||u.theme.gray100}),u.theme.gray200,u.theme.blue600),O=k.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ",";\n }\n\n &.loading {\n color: transparent;\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ",";\n }\n\n &.loading {\n color: transparent;\n }\n\n &[disabled] {\n .content {\n opacity: 0.6;\n }\n }\n"])),(function(n){return v(n.color)||u.theme.primary}),(function(n){return v(n.hoverBackground)||u.theme.blue100}),u.theme.blue200,u.theme.blue600),T=_;exports.Button=function(t){var u=t.children,c=t.className,l=t.disabled,s=void 0!==l&&l,d=t.icon,g=t.iconRight,h=t.loading,b=void 0!==h&&h,m=t.loadingText,p=t.noRipple,f=void 0!==p&&p,k=t.size,v=void 0===k?"sm":k,_=t.spinnerColor,C=t.tag,G=t.themeOverride,I=t.type,S=void 0===I?"button":I,H=t.variant,N=void 0===H?"standard":H,D=n.__rest(t,["children","className","disabled","icon","iconRight","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type","variant"]),E=C||"button",F=function(n){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"content",children:!g&&d}),e.jsx("div",{className:"content",children:u}),e.jsx("span",{className:"content",children:g&&d}),"plain"!==N&&b&&e.jsxs(y,{children:[e.jsx(a.Spinner,{color:n,size:x(v)}),m]})]})},P=[c||"",d&&!u?"only-icon":"",g?"icon-right":"",d?"has-icon":"",b?"loading":"",G].filter(Boolean).join(" "),W=o.useRef(null),M=i.useRipple({disabled:s||b,rippleEnabled:!f&&!["plain","text"].includes(N),rippleRef:W}),A=M.getRippleHandlers,J=M.rippleEnabled,K={className:P,disabled:s||b,size:v},L=n.__assign(n.__assign(n.__assign({type:S},K),D),A(D));switch(N){case"primary":return e.jsxs(w,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||L.outline?"info":"white"),J&&e.jsx(r.RippleGroup,{ref:W})]}));case"success":return e.jsxs(j,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||L.outline?"success":"white"),J&&e.jsx(r.RippleGroup,{ref:W})]}));case"warning":return e.jsxs(B,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||L.outline?"warning":"white"),J&&e.jsx(r.RippleGroup,{ref:W})]}));case"danger":return e.jsxs(z,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||L.outline?"danger":"white"),J&&e.jsx(r.RippleGroup,{ref:W})]}));case"subtle":return e.jsxs(q,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||"black"),J&&e.jsx(r.RippleGroup,{ref:W})]}));case"link":return e.jsxs(O,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||"info"),J&&e.jsx(r.RippleGroup,{ref:W})]}));case"plain":return e.jsx(T,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:F(_)}));default:return e.jsxs(R,n.__assign({as:E,tabIndex:"div"===E?0:void 0},L,{children:[F(_||"black"),J&&e.jsx(r.RippleGroup,{ref:W})]}))}};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type MouseEventHandler, type ReactNode } from 'react';
|
|
2
|
+
import { type SpinnerProps } from "../spinner/Spinner";
|
|
3
|
+
import type { Color } from "../../types";
|
|
4
|
+
import type { Intent } from "../../types/Intent";
|
|
5
|
+
import type { Size } from "../../types/Size";
|
|
6
|
+
import type { Theme } from "../../types/Theme";
|
|
7
|
+
type IntentProps = 'outline' | 'subtle' | 'text' | 'link' | 'plain' | Intent;
|
|
8
|
+
type ButtonBase = {
|
|
9
|
+
background?: Color | 'inherit';
|
|
10
|
+
/** @param borderColor only available for intent 'outline' */
|
|
11
|
+
borderColor?: Color | 'inherit';
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
color?: Color | 'inherit';
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
hoverBackground?: Color | 'inherit';
|
|
17
|
+
icon?: ReactNode;
|
|
18
|
+
iconRight?: boolean;
|
|
19
|
+
/** @default 'secondary' */
|
|
20
|
+
intent?: IntentProps;
|
|
21
|
+
/** @default false */
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
loadingText?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Disable ripple effect
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
noRipple?: boolean;
|
|
29
|
+
size?: Size;
|
|
30
|
+
/** Color for the spinner when in a loading state */
|
|
31
|
+
spinnerColor?: SpinnerProps['color'];
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
themeOverride?: Theme;
|
|
34
|
+
type?: 'button' | 'reset' | 'submit';
|
|
35
|
+
};
|
|
36
|
+
export type GroupTag = 'div' | 'a' | 'button';
|
|
37
|
+
type MyHtmlElement<T extends GroupTag> = T extends 'a' ? HTMLAnchorElement : T extends 'div' ? HTMLDivElement : HTMLButtonElement;
|
|
38
|
+
export type ButtonProps<T extends GroupTag = 'button'> = ButtonBase & Omit<ComponentPropsWithoutRef<T>, keyof ButtonBase | 'onClick'> & {
|
|
39
|
+
onClick?: MouseEventHandler<MyHtmlElement<T>>;
|
|
40
|
+
tag?: T;
|
|
41
|
+
};
|
|
42
|
+
export declare function Button<T extends GroupTag = 'button'>({ children, className, disabled, icon, iconRight, intent, loading, loadingText, noRipple, size, spinnerColor, tag: _tag, themeOverride, type, ...props }: ButtonProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),r=require("react"),o=require("styled-components"),t=require("./RippleGroup.js"),a=require("./useRipple.js"),i=require("../spinner/Spinner.js"),c=require("../../styles/constants/theme.js");function l(n){return n&&n.__esModule?n:{default:n}}require("framer-motion"),require("uuid"),require("./_Ripple.js");var d,s,u,g,h,b,p,m,f,k,v=l(o),y=function(n){return"inherit"===n?"inherit":n?c.theme[n]:void 0},x=v.default.span(d||(d=n.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"],["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ",";\n gap: ",";\n"])),c.theme.radius4,c.theme.space8),_=v.default.button(s||(s=n.__makeTemplateObject(["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition: ",";\n font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"],["\n position: relative;\n outline: none;\n height: ",";\n line-height: ",";\n font-size: 14px;\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0 ",";\n border-radius: ",";\n transition: ",";\n font-weight: 500;\n user-select: none;\n font-family: ",";\n letter-spacing: normal;\n cursor: pointer;\n white-space: nowrap;\n padding: ",";\n\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n\n &.only-icon {\n width: ",";\n padding: 0;\n }\n\n &:active,\n &:focus {\n outline: none;\n svg path:not([data-is-secondary-color]) {\n fill: currentColor;\n }\n }\n\n &:active {\n transform: scale(0.99);\n }\n\n &:not(.only-icon).has-icon {\n &.icon-right {\n svg {\n margin-left: ",";\n margin-right: 0;\n }\n }\n svg {\n margin-right: ",";\n margin-left: 0;\n }\n }\n\n &[disabled] {\n box-shadow: none;\n &:not(.loading) {\n opacity: 0.5;\n }\n }\n"])),(function(n){return"var(--amino-size-".concat(n.size,")")}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space16,c.theme.radius6,c.theme.transition,c.theme.fontSans,(function(n){return function(n){switch(n){case"sm":return"".concat(c.theme.space4," ").concat(c.theme.space8);case"lg":case"xl":return"".concat(c.theme.space12," ").concat(c.theme.space24);default:return"".concat(c.theme.space8," ").concat(c.theme.space16)}}(n.size)}),(function(n){return"var(--amino-size-".concat(n.size,")")}),c.theme.space8,c.theme.space8),j=v.default(_)(u||(u=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.primary}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.blue400}),c.theme.blue700,c.theme.gray0,x,c.theme.primary),w=v.default(_)(g||(g=n.__makeTemplateObject(["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"],["\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n\n /** Night mode */\n &.night {\n color: ",";\n background: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active,\n &:focus {\n background: ",";\n color: ",";\n svg path {\n fill: currentColor;\n }\n }\n }\n\n "," {\n background: ",";\n }\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.background)||c.theme.gray100}),(function(n){return y(n.hoverBackground)||c.theme.gray200}),c.theme.blue100,c.theme.blue600,x,c.theme.gray100,c.theme.gray0,c.theme.gray1000,(function(n){return y(n.hoverBackground)||c.theme.gray900}),c.theme.blue1000,c.theme.blue300,x,c.theme.gray1000),R=v.default(_)(h||(h=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.red600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.red400}),c.theme.red700,x,c.theme.red600),z=v.default(_)(b||(b=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.background)||c.theme.orange600}),(function(n){return y(n.color)||c.theme.gray0}),(function(n){return y(n.hoverBackground)||c.theme.orange400}),c.theme.orange700,x,c.theme.orange600),C=v.default(_)(p||(p=n.__makeTemplateObject(["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n border: 1px solid ",";\n\n &:not([disabled]) {\n &:hover {\n background: linear-gradient(\n 180deg,\n "," 12.5%,\n "," 87.5%\n );\n background: ",";\n border: 1px solid ",";\n }\n &:active {\n background: ",";\n color: ",";\n border: 1px solid ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.textColor}),(function(n){return y(n.borderColor)||c.theme.gray200}),c.theme.gray0,c.theme.gray100,(function(n){return n.hoverBackground&&y(n.hoverBackground)}),c.theme.gray200,c.theme.blue100,c.theme.blue600,c.theme.blue300,x,c.theme.gray0),O=v.default(_)(m||(m=n.__makeTemplateObject(["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n background: ",";\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.background)||"none"}),(function(n){return y(n.color)||c.theme.gray800}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue600),T=v.default(_)(f||(f=n.__makeTemplateObject(["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"],["\n color: ",";\n height: 20px;\n line-height: 20px;\n\n &[disabled] {\n color: ",";\n &:not(.loading) {\n opacity: inherit;\n }\n }\n\n &:not([disabled]) {\n &:hover {\n color: ",";\n }\n &:active {\n color: ",";\n }\n }\n\n &.loading {\n color: transparent;\n }\n"])),(function(n){return y(n.color)||c.theme.gray800}),c.theme.gray400,c.theme.gray700,c.theme.gray1200),q=_,B=v.default(_)(k||(k=n.__makeTemplateObject(["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"],["\n color: ",";\n\n &:not([disabled]) {\n &:hover {\n background: ",";\n }\n &:active {\n background: ",";\n color: ",";\n }\n }\n\n "," {\n background: ",";\n }\n"])),(function(n){return y(n.color)||c.theme.blue600}),(function(n){return y(n.hoverBackground)||c.theme.gray100}),c.theme.blue100,c.theme.blue800,x,c.theme.gray0);exports.Button=function(o){var c=o.children,l=o.className,d=o.disabled,s=void 0!==d&&d,u=o.icon,g=o.iconRight,h=o.intent,b=void 0===h?"secondary":h,p=o.loading,m=void 0!==p&&p,f=o.loadingText,k=o.noRipple,v=void 0!==k&&k,y=o.size,_=void 0===y?"sm":y,G=o.spinnerColor,N=o.tag,S=o.themeOverride,E=o.type,F=void 0===E?"button":E,H=n.__rest(o,["children","className","disabled","icon","iconRight","intent","loading","loadingText","noRipple","size","spinnerColor","tag","themeOverride","type"]),M=N||"button",A=function(n){return e.jsxs(e.Fragment,{children:[!g&&u,c,g&&u,"plain"!==b&&m&&e.jsxs(x,{children:[e.jsx(i.Spinner,{color:n,size:16}),f]})]})},D=[l||"",u&&!c?"only-icon":"",g?"icon-right":"",u?"has-icon":"",m?"loading":"",S].filter(Boolean).join(" "),I=r.useRef(null),J=a.useRipple({disabled:s||m,rippleEnabled:!v&&!["plain","text"].includes(b),rippleRef:I}),K=J.getRippleHandlers,L=J.rippleEnabled,P={className:D,disabled:s||m,size:_},Q=n.__assign(n.__assign(n.__assign({type:F},P),H),K(H));switch(b){case"primary":return e.jsxs(j,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"subtle":return e.jsxs(O,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"outline":return e.jsxs(C,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"warning":return e.jsxs(z,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"danger":return e.jsxs(R,n.__assign({as:M},Q,{children:[A(G||"white"),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"text":return e.jsx(T,n.__assign({as:M},Q,{children:A(G)}));case"link":return e.jsxs(B,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}));case"plain":return e.jsx(q,n.__assign({as:M},Q,{children:A(G)}));default:return e.jsxs(w,n.__assign({as:M},Q,{children:[A(G),L&&e.jsx(t.RippleGroup,{ref:I})]}))}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),i=require("react"),n=require("./ConfirmDialog.js");require("styled-components"),require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),i=require("react"),n=require("./ConfirmDialog.js");require("styled-components"),require("../button/LegacyButton.js"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../dialog/BaseDialog.js"),require("react-dom"),require("../rounded-icon/RoundedIcon.js"),require("../stack/VStack.js"),require("../stack/Stack.js"),require("../text/Text.js"),require("../../icons/ExclamationMarkDuotoneIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../icons/HelpDuotoneIcon.js"),require("../../icons/WarningDuotoneIcon.js");var t=i.createContext((function(e){}));exports.ConfirmContext=t,exports.ConfirmContextProvider=function(o){var s=o.children,u=e.__read(i.useState(),2),c=u[0],a=u[1],l=e.__read(i.useState(!1),2),q=l[0],j=l[1],m=i.useCallback((function(e){a(e),j(!0)}),[]);return r.jsxs(t.Provider,{value:m,children:[s,c&&r.jsx(n.ConfirmDialog,{confirmAction:function(){j(!1),c.onConfirm(!0)},confirmText:c.confirmText,dismissAction:function(){j(!1),c.onConfirm(!1)},dismissText:c.dismissText,intent:c.intent,label:c.label,open:q,subtitle:c.subtitle})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("styled-components"),r=require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("styled-components"),r=require("../button/LegacyButton.js"),i=require("../dialog/BaseDialog.js"),o=require("../rounded-icon/RoundedIcon.js"),s=require("../stack/VStack.js"),c=require("../text/Text.js"),a=require("../../icons/ExclamationMarkDuotoneIcon.js"),u=require("../../icons/HelpDuotoneIcon.js"),l=require("../../icons/WarningDuotoneIcon.js"),d=require("../../styles/constants/theme.js");function j(e){return e&&e.__esModule?e:{default:e}}require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../stack/Stack.js"),require("../../icons/icon-base/_IconBase.js");var m,x,p=j(t),g=p.default.div(m||(m=e.__makeTemplateObject(["\n padding: ",";\n\n & > div {\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n"],["\n padding: ",";\n\n & > div {\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n"])),d.theme.space24),f=p.default.div(x||(x=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ",";\n\n & > button + button {\n margin-left: ",";\n }\n\n button {\n flex: 1;\n }\n"],["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin-top: ",";\n\n & > button + button {\n margin-left: ",";\n }\n\n button {\n flex: 1;\n }\n"])),d.theme.space24,d.theme.space8),q=function(e){switch(e){case"danger":return n.jsx(a.ExclamationMarkDuotoneIcon,{color:"red800",secondaryColor:"red400"});case"warning":return n.jsx(l.WarningDuotoneIcon,{color:"orange800",secondaryColor:"orange400"});default:return n.jsx(u.HelpDuotoneIcon,{color:"blue800",secondaryColor:"blue400"})}};exports.ConfirmDialog=function(e){var t=e.confirmAction,a=e.confirmText,u=e.dismissAction,l=e.dismissText,d=e.intent,j=e.label,m=e.open,x=e.subtitle,p=e.themeOverride;return n.jsx(i.BaseDialog,{"data-theme":p,open:m,width:350,children:n.jsx(g,{children:n.jsxs(s.VStack,{spacing:16,children:[n.jsx(o.RoundedIcon,{intent:d,children:q(d)}),n.jsxs(s.VStack,{spacing:8,children:[n.jsx(c.Text,{type:"subheader",children:j}),x&&n.jsx(c.Text,{color:"gray800",type:"body",children:x})]}),n.jsxs(f,{children:[n.jsx(r.Button,{intent:"outline",onClick:u,size:"md",children:l}),n.jsx(r.Button,{intent:d,onClick:t,size:"md",children:a})]})]})})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),r=require("./ConfirmContext.js");require("../../_tslib-ccfac372.js"),require("react/jsx-runtime"),require("./ConfirmDialog.js"),require("styled-components"),require("../button/
|
|
1
|
+
"use strict";var e=require("react"),r=require("./ConfirmContext.js");require("../../_tslib-ccfac372.js"),require("react/jsx-runtime"),require("./ConfirmDialog.js"),require("styled-components"),require("../button/LegacyButton.js"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../dialog/BaseDialog.js"),require("react-dom"),require("../rounded-icon/RoundedIcon.js"),require("../stack/VStack.js"),require("../stack/Stack.js"),require("../text/Text.js"),require("../../icons/ExclamationMarkDuotoneIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../icons/HelpDuotoneIcon.js"),require("../../icons/WarningDuotoneIcon.js");exports.useConfirm=function(){return e.useContext(r.ConfirmContext)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),i=require("react-dom"),o=require("framer-motion"),r=require("styled-components"),s=require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),i=require("react-dom"),o=require("framer-motion"),r=require("styled-components"),s=require("../button/LegacyButton.js"),a=require("./CoverSheetActions.js"),u=require("../text/Text.js"),c=require("../../icons/RemoveIcon.js"),d=require("../../styles/constants/theme.js"),l=require("../../utils/hooks/useAminoTheme.js");function h(e){return e&&e.__esModule?e:{default:e}}require("../button/RippleGroup.js"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("../stack/HStack.js"),require("../stack/Stack.js"),require("../../icons/icon-base/_IconBase.js"),require("../../Theme-61f4342c.js"),require("zod"),require("../../utils/hooks/useStorage.js"),require("../../utils/hooks/useSwr.js"),require("swr"),require("../../utils/storage.js");var m,p,b,g,j,f=h(r),v=f.default(o.motion.div)(m||(m=e.__makeTemplateObject(["\n z-index: 990;\n outline: none;\n overflow-y: auto;\n box-sizing: border-box;\n overscroll-behavior: contain;\n background: ",";\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n color: ",";\n\n @media print {\n height: unset;\n min-height: 100vh;\n position: absolute;\n }\n"],["\n z-index: 990;\n outline: none;\n overflow-y: auto;\n box-sizing: border-box;\n overscroll-behavior: contain;\n background: ",";\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n color: ",";\n\n @media print {\n height: unset;\n min-height: 100vh;\n position: absolute;\n }\n"])),d.theme.pageBackground,d.theme.textColor),x=f.default(s.Button)(p||(p=e.__makeTemplateObject(["\n margin-right: ",";\n"],["\n margin-right: ",";\n"])),d.theme.space24),q=f.default(u.Text)(b||(b=e.__makeTemplateObject(["\n flex-grow: 1;\n"],["\n flex-grow: 1;\n"]))),y=f.default.header(g||(g=e.__makeTemplateObject(["\n border-bottom: ",";\n padding: "," ",";\n display: flex;\n align-items: center;\n height: 64px;\n position: sticky;\n top: 0;\n z-index: 99;\n background-color: ",";\n\n @media print {\n display: none;\n }\n"],["\n border-bottom: ",";\n padding: "," ",";\n display: flex;\n align-items: center;\n height: 64px;\n position: sticky;\n top: 0;\n z-index: 99;\n background-color: ",";\n\n @media print {\n display: none;\n }\n"])),d.theme.border,d.theme.space16,d.theme.space24,d.theme.pageBackground),k=f.default.div(j||(j=e.__makeTemplateObject(["\n padding: ",";\n"],["\n padding: ",";\n"])),d.theme.space24);exports.CoverSheet=function(e){var r=e.actions,s=e.actionWrapperId,u=void 0===s?"__cover-sheet-actions":s,d=e.children,h=e.className,m=e.label,p=e.onClose,b=e.open,g=e.themeOverride,j=l.useAminoTheme().aminoTheme;if(t.useEffect((function(){"undefined"!=typeof document&&document.querySelectorAll("[id='".concat(u,"']")).length>1&&console.error('Duplicate id "'.concat(u,'" detected in "CoverSheet" component. Please set "actionWrapperId" to a unique id.'))}),[u]),t.useEffect((function(){(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=b?"hidden":"auto")}),[b]),"undefined"!=typeof document){var f=document.querySelector("body");if(f)return i.createPortal(n.jsx(o.AnimatePresence,{children:b&&n.jsxs(v,{animate:{opacity:1,translateY:0},className:h,"data-theme":g||j,exit:{opacity:0,translateY:5},initial:{opacity:0,translateY:10},transition:{duration:.35,ease:[.4,0,.2,1]},children:[n.jsxs(y,{children:[n.jsx(x,{icon:n.jsx(c.RemoveIcon,{size:20}),onClick:p}),n.jsx(q,{type:"header",children:m}),n.jsx("div",{id:u,children:r&&n.jsx(a.CoverSheetActions,{coverSheetActionId:u,children:r})})]}),n.jsx(k,{children:d})]})}),f)}return null};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type MotionProps } from 'framer-motion';
|
|
3
|
+
import type { Theme } from "../../types/Theme";
|
|
4
|
+
export type BaseDialogProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Close when clicking outside dialog (on the backdrop)
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
closeOnBlur?: boolean;
|
|
11
|
+
/** Close on pressing 'escape' key
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
closeOnEsc?: boolean;
|
|
15
|
+
open: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* framer-motion props for the popup container.
|
|
18
|
+
*
|
|
19
|
+
* Gets shallowly combined with defaults.
|
|
20
|
+
*
|
|
21
|
+
* @default
|
|
22
|
+
*
|
|
23
|
+
* {
|
|
24
|
+
* animate: { opacity: 1, scale: 1 },
|
|
25
|
+
* exit: { opacity: 0, scale: 0.95 },
|
|
26
|
+
* initial: { opacity: 0, scale: 0.95 },
|
|
27
|
+
* transition: { duration: 0.3, ease: [0.4, 0, 0.2, 1] },
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
popupMotionProps?: MotionProps;
|
|
31
|
+
themeOverride?: Theme;
|
|
32
|
+
/**
|
|
33
|
+
* @default 444
|
|
34
|
+
*/
|
|
35
|
+
width?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Disable the backdrop color
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
withBackdrop?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
withBorder?: boolean;
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
};
|
|
47
|
+
export declare const BaseDialog: ({ children, className, closeOnBlur, closeOnEsc, onClose, open, popupMotionProps, themeOverride, width, withBackdrop, withBorder, }: BaseDialogProps) => React.ReactPortal | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),o=require("react-dom"),i=require("framer-motion"),r=require("styled-components"),a=require("../../styles/constants/theme.js");function d(e){return e&&e.__esModule?e:{default:e}}var l,c,u=d(r),s=u.default(i.motion.div)(l||(l=e.__makeTemplateObject(["\n width: 100vw;\n height: 100vh;\n left: 0;\n top: 0;\n z-index: 1000;\n position: fixed;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ",";\n"],["\n width: 100vw;\n height: 100vh;\n left: 0;\n top: 0;\n z-index: 1000;\n position: fixed;\n display: flex;\n justify-content: center;\n align-items: center;\n color: ",";\n"])),a.theme.textColor),m=u.default(i.motion.div)(c||(c=e.__makeTemplateObject(["\n position: relative;\n z-index: 1001;\n background: ",";\n width: ","px;\n max-height: 90vh;\n border-radius: ",";\n outline: none;\n box-shadow: ",";\n border: ",";\n overflow: hidden;\n display: flex;\n flex-direction: column;\n"],["\n position: relative;\n z-index: 1001;\n background: ",";\n width: ","px;\n max-height: 90vh;\n border-radius: ",";\n outline: none;\n box-shadow: ",";\n border: ",";\n overflow: hidden;\n display: flex;\n flex-direction: column;\n"])),a.theme.surfaceColor,(function(e){return e.width}),a.theme.radius12,a.theme.v3ShadowXxl,(function(e){return e.withBorder&&a.theme.border}));exports.BaseDialog=function(r){var a=r.children,d=r.className,l=r.closeOnBlur,c=void 0===l||l,u=r.closeOnEsc,h=void 0===u||u,f=r.onClose,v=r.open,p=r.popupMotionProps,x=r.themeOverride,g=r.width,b=void 0===g?444:g,w=r.withBackdrop,y=void 0===w||w,k=r.withBorder,_=void 0===k||k,j=t.useRef(null),q=t.useRef(null);t.useEffect((function(){var e,n;(null===(e=q.current)||void 0===e?void 0:e.contains(document.activeElement))||null===(n=q.current)||void 0===n||n.focus(),(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=v?"hidden":"auto")}),[v]);var C=y?{animate:{backgroundColor:"rgba(16, 17, 22, 0.65)"},exit:{backgroundColor:"rgba(16, 17, 22, 0)"},initial:{backgroundColor:"rgba(16, 17, 22, 0)"}}:{},B=e.__assign({animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},initial:{opacity:0,scale:.95},transition:{duration:.3,ease:[.4,0,.2,1]}},p);return"undefined"!=typeof document?o.createPortal(n.jsx(i.AnimatePresence,{children:v&&t.createElement(s,e.__assign({},C,{key:"dialog-backdrop",ref:q,"data-theme":x,onKeyDown:function(e){f&&h&&"Escape"===e.key&&f()},onMouseDown:function(e){j.current=e.target},onMouseUp:function(e){var n=e.target===j.current,t=f&&c&&e.target===q.current;n&&t&&f(),j.current=null},tabIndex:-1,transition:{duration:.3}}),t.createElement(m,e.__assign({},B,{key:"dialog",className:[d||"","elevated"].join(" "),onClick:function(e){e.stopPropagation()},width:b,withBorder:_}),a))}),document.querySelector("body")):null};
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
export type DialogProps = {
|
|
2
|
+
import { type BaseDialogProps } from "./BaseDialog";
|
|
3
|
+
export type DialogProps = BaseDialogProps & {
|
|
4
4
|
actions?: ReactNode;
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
/** Close when clicking outside dialog (on the backdrop)
|
|
8
|
-
* @default true
|
|
9
|
-
*/
|
|
10
|
-
closeOnBlur?: boolean;
|
|
11
|
-
/** Close on pressing 'escape' key
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
closeOnEsc?: boolean;
|
|
15
5
|
label?: ReactNode;
|
|
16
6
|
leftActions?: ReactNode;
|
|
17
|
-
noBorder?: boolean;
|
|
18
|
-
open: boolean;
|
|
19
7
|
subtitle?: string;
|
|
20
|
-
themeOverride?: Theme;
|
|
21
|
-
width?: number;
|
|
22
8
|
onClose: () => void;
|
|
23
9
|
};
|
|
24
|
-
export declare const Dialog: import("react").ForwardRefExoticComponent<
|
|
10
|
+
export declare const Dialog: import("react").ForwardRefExoticComponent<BaseDialogProps & {
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
label?: ReactNode;
|
|
13
|
+
leftActions?: ReactNode;
|
|
14
|
+
subtitle?: string | undefined;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),r=require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),r=require("../button/LegacyButton.js"),i=require("./BaseDialog.js"),o=require("../text/Text.js"),s=require("../../icons/RemoveCircleDuotoneIcon.js"),l=require("../../styles/constants/theme.js");function c(e){return e&&e.__esModule?e:{default:e}}require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../../icons/icon-base/_IconBase.js");var d=c(a),h=d.default.div(k||(k=e.__makeTemplateObject(["\n padding: ",";\n padding-bottom: ",";\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n display: flex;\n flex-direction: column;\n gap: ",";\n"],["\n padding: ",";\n padding-bottom: ",";\n border-top-left-radius: ",";\n border-top-right-radius: ",";\n display: flex;\n flex-direction: column;\n gap: ",";\n"])),l.theme.space24,l.theme.space16,l.theme.radius12,l.theme.radius12,l.theme.space12),m=d.default.div(v||(v=e.__makeTemplateObject(["\n width: 100%;\n display: flex;\n align-items: center;\n\n > :not(button) {\n margin: 0;\n flex-grow: 1;\n font-weight: 700;\n }\n"],["\n width: 100%;\n display: flex;\n align-items: center;\n\n > :not(button) {\n margin: 0;\n flex-grow: 1;\n font-weight: 700;\n }\n"]))),p=d.default(r.Button)(x||(x=e.__makeTemplateObject(["\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n"],["\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n"])),l.theme.gray200,l.theme.gray800,l.theme.gray300,l.theme.gray400),g=d.default.div(w||(w=e.__makeTemplateObject(["\n flex-grow: 1;\n display: flex;\n"],["\n flex-grow: 1;\n display: flex;\n"]))),u=d.default(g)(y||(y=e.__makeTemplateObject(["\n justify-content: flex-start;\n display: flex;\n gap: ",";\n"],["\n justify-content: flex-start;\n display: flex;\n gap: ",";\n"])),l.theme.space8),f=d.default(g)(j||(j=e.__makeTemplateObject(["\n justify-content: flex-end;\n display: flex;\n gap: ",";\n"],["\n justify-content: flex-end;\n display: flex;\n gap: ",";\n"])),l.theme.space8),b=d.default.div(_||(_=e.__makeTemplateObject(["\n padding: ",";\n display: flex;\n align-items: center;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n\n & > div + div {\n margin-left: ",";\n }\n"],["\n padding: ",";\n display: flex;\n align-items: center;\n border-bottom-left-radius: ",";\n border-bottom-right-radius: ",";\n\n & > div + div {\n margin-left: ",";\n }\n"])),l.theme.space24,l.theme.radius12,l.theme.radius12,l.theme.space8);a.css(T||(T=e.__makeTemplateObject(["\n overscroll-behavior: contain;\n /* scroll bar width, for use in mask calculations */\n --scrollbar-width: 8px;\n\n /* mask fade distance, for use in mask calculations */\n --mask-height: 32px;\n\n /* If content exceeds height of container, overflow! */\n overflow-y: auto;\n\n padding-bottom: var(--mask-height);\n /* The CSS mask */\n\n /* The content mask is a linear gradient from top to bottom */\n --mask-image-content: linear-gradient(\n to bottom,\n transparent,\n black var(--mask-height),\n black calc(100% - var(--mask-height)),\n transparent\n );\n /* Here we scale the content gradient to the width of the container\nminus the scrollbar width. The height is the full container height */\n --mask-size-content: calc(100% - var(--scrollbar-width)) 100%;\n\n /* The scrollbar mask is a black pixel */\n --mask-image-scrollbar: linear-gradient(black, black);\n\n /* The width of our black pixel is the width of the scrollbar.\nThe height is the full container height */\n --mask-size-scrollbar: var(--scrollbar-width) 100%;\n\n /* Apply the mask image and mask size variables */\n mask-image: var(--mask-image-content), var(--mask-image-scrollbar);\n mask-size: var(--mask-size-content), var(--mask-size-scrollbar);\n\n /* Position the content gradient in the top left, and the\nscroll gradient in the top right */\n mask-position:\n 0 0,\n 100% 0;\n\n /* We don't repeat our mask images */\n mask-repeat: no-repeat, no-repeat;\n"],["\n overscroll-behavior: contain;\n /* scroll bar width, for use in mask calculations */\n --scrollbar-width: 8px;\n\n /* mask fade distance, for use in mask calculations */\n --mask-height: 32px;\n\n /* If content exceeds height of container, overflow! */\n overflow-y: auto;\n\n padding-bottom: var(--mask-height);\n /* The CSS mask */\n\n /* The content mask is a linear gradient from top to bottom */\n --mask-image-content: linear-gradient(\n to bottom,\n transparent,\n black var(--mask-height),\n black calc(100% - var(--mask-height)),\n transparent\n );\n /* Here we scale the content gradient to the width of the container\nminus the scrollbar width. The height is the full container height */\n --mask-size-content: calc(100% - var(--scrollbar-width)) 100%;\n\n /* The scrollbar mask is a black pixel */\n --mask-image-scrollbar: linear-gradient(black, black);\n\n /* The width of our black pixel is the width of the scrollbar.\nThe height is the full container height */\n --mask-size-scrollbar: var(--scrollbar-width) 100%;\n\n /* Apply the mask image and mask size variables */\n mask-image: var(--mask-image-content), var(--mask-image-scrollbar);\n mask-size: var(--mask-size-content), var(--mask-size-scrollbar);\n\n /* Position the content gradient in the top left, and the\nscroll gradient in the top right */\n mask-position:\n 0 0,\n 100% 0;\n\n /* We don't repeat our mask images */\n mask-repeat: no-repeat, no-repeat;\n"])));var k,v,x,w,y,j,_,T,q,z=d.default.div(q||(q=e.__makeTemplateObject(["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n /**\n * Current overflow is not working well with react-tooltip.\n * Temporary remove gradient overflow until having new tooltip library to use\n */\n // gradientOverflow\n"],["\n padding: "," ",";\n overflow-y: auto;\n flex-grow: 1;\n /**\n * Current overflow is not working well with react-tooltip.\n * Temporary remove gradient overflow until having new tooltip library to use\n */\n // gradientOverflow\n"])),l.theme.space8,l.theme.space24),O=t.forwardRef((function(t,a){var r=t.actions,l=t.children,c=t.label,d=t.leftActions,g=t.onClose,k=t.subtitle,v=e.__rest(t,["actions","children","label","leftActions","onClose","subtitle"]);return n.jsxs(i.BaseDialog,e.__assign({},v,{onClose:g,children:[n.jsxs(h,{children:[n.jsxs(m,{children:[n.jsx(o.Text,{type:"title",children:c}),n.jsx(p,{icon:n.jsx(s.RemoveCircleDuotoneIcon,{size:24}),noRipple:!0,onClick:g})]}),k&&n.jsx(o.Text,{type:"subtitle",children:k})]}),n.jsx(z,{ref:a,children:l}),(r||d)&&n.jsxs(b,{children:[d&&n.jsx(u,{children:d}),r&&n.jsx(f,{children:r})]})]}))}));exports.Dialog=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),i=require("react-dropzone"),r=require("styled-components"),t=require("../avatar/ImageAvatar.js"),o=require("../button/
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),i=require("react-dropzone"),r=require("styled-components"),t=require("../avatar/ImageAvatar.js"),o=require("../button/LegacyButton.js"),a=require("../spinner/Spinner.js"),l=require("../text/Text.js"),s=require("../thumbnail/Thumbnail.js"),d=require("../../icons/FileDuotoneIcon.js"),c=require("../../icons/FileUploadDuotoneIcon.js"),u=require("../../icons/RemoveCircleDuotoneIcon.js"),p=require("../../styles/constants/theme.js");function m(e){return e&&e.__esModule?e:{default:e}}require("../avatar/AvatarBase.js"),require("react"),require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../button/useRipple.js"),require("../../icons/icon-base/_IconBase.js");var x,f,h,g,j,b,y,v,_,q=m(r),T=q.default.div(x||(x=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n opacity: ",";\n cursor: ",";\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n opacity: ",";\n cursor: ",";\n"])),p.theme.space16,(function(e){return e.disabled?.5:1}),(function(e){return e.disabled?"not-allowed":"auto"})),k=q.default.div(f||(f=e.__makeTemplateObject(["\n border: 2px dashed;\n border-color: ",";\n border-radius: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n"],["\n border: 2px dashed;\n border-color: ",";\n border-radius: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n"])),(function(e){return e.error?p.theme.danger:p.theme.borderColor}),p.theme.radius12),I=q.default.div(h||(h=e.__makeTemplateObject(["\n padding: ",";\n outline: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: ",";\n width: 100%;\n height: 100%;\n"],["\n padding: ",";\n outline: none;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n gap: ",";\n width: 100%;\n height: 100%;\n"])),p.theme.space16,p.theme.space12),O=q.default.div(g||(g=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n align-items: center;\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n align-items: center;\n"])),p.theme.space4),D=q.default.button(j||(j=e.__makeTemplateObject(["\n display: inline;\n"],["\n display: inline;\n"]))),F=q.default(o.Button)(b||(b=e.__makeTemplateObject(["\n margin-left: auto;\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n\n :active,\n :focus {\n outline: none;\n box-shadow: unset;\n }\n"],["\n margin-left: auto;\n padding: 0;\n path[data-is-secondary-color] {\n fill: ",";\n }\n\n && {\n &,\n &:focus,\n &:hover,\n &:active {\n color: ",";\n background: transparent;\n }\n &:hover {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n &:active,\n &:focus {\n path[data-is-secondary-color] {\n fill: ",";\n }\n }\n }\n\n :active,\n :focus {\n outline: none;\n box-shadow: unset;\n }\n"])),p.theme.gray200,p.theme.gray800,p.theme.gray300,p.theme.gray400),z=q.default.div(y||(y=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: ",";\n"],["\n display: flex;\n flex-direction: column;\n gap: ",";\n"])),p.theme.space4),R=q.default.div(v||(v=e.__makeTemplateObject(["\n border: ",";\n border-radius: ",";\n padding: ",";\n display: flex;\n justify-content: flex-start;\n gap: ",";\n"],["\n border: ",";\n border-radius: ",";\n padding: ",";\n display: flex;\n justify-content: flex-start;\n gap: ",";\n"])),p.theme.border,p.theme.space12,p.theme.space16,p.theme.space12),w=q.default.div(_||(_=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"])));exports.DropZone=function(r){var o=r.className,p=r.disabled,m=void 0!==p&&p,x=r.dropzoneOptions,f=r.error,h=void 0!==f&&f,g=r.helpText,j=r.instructionText,b=void 0===j?"Drop your file(s) here":j,y=r.loading,v=r.loadingText,_=void 0===v?"Uploading file(s)...":v,q=r.noIcon,C=void 0!==q&&q,U=r.onRemoveFile,B=r.uploadedFiles,A=x.maxFiles||0,N=i.useDropzone(e.__assign(e.__assign({},x),{disabled:m,noClick:!0,noKeyboard:!0})),P=N.getInputProps,S=N.getRootProps,G=N.open,K=0!==A&&B.length>=A;return n.jsx(T,{className:o,disabled:m,children:y?n.jsx(k,{children:n.jsxs(I,{children:[n.jsx(a.Spinner,{}),n.jsx(l.Text,{color:"gray800",type:"label",children:_})]})}):n.jsxs(n.Fragment,{children:[!K&&n.jsx(k,{error:h,children:n.jsxs(I,e.__assign({},S(),{role:void 0,children:[n.jsx("input",e.__assign({},P())),!C&&n.jsx(s.Thumbnail,{icon:n.jsx(c.FileUploadDuotoneIcon,{}),size:40}),n.jsxs(O,{children:[n.jsxs(l.Text,{type:"label",children:[b," or"," ",n.jsx(D,{disabled:m,onClick:G,type:"button",children:n.jsx(l.Text,{color:"blue600",type:"label",children:"browse"})})]}),g&&n.jsx(l.Text,{type:"caption",children:g})]})]}))}),!!B.length&&n.jsx(z,{children:B.map((function(e,i){return n.jsxs(R,{children:[e.imageUrl?n.jsx(t.ImageAvatar,{imageUrl:e.imageUrl,shape:"rounded"}):n.jsx(d.FileDuotoneIcon,{}),n.jsxs(w,{children:[n.jsx(l.Text,{color:"gray1200",type:"label",children:e.name}),e.size&&n.jsx(l.Text,{color:"gray700",type:"caption",children:e.size})]}),U&&n.jsx(F,{onClick:function(){return U(i)},children:n.jsx(u.RemoveCircleDuotoneIcon,{size:20})})]},e.name)}))})]})})};
|