@zonos/amino 5.1.95 → 5.1.97
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/components/cover-sheet/CoverSheet.d.ts +5 -9
- package/components/cover-sheet/CoverSheet.js +1 -1
- package/components/cover-sheet/CoverSheetActions.d.ts +1 -1
- package/components/dialog/BaseDialog.js +1 -1
- package/components/simple-table/SimpleTable.js +1 -1
- package/components/tooltip/Tooltip.js +1 -1
- package/package.json +1 -1
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { type BaseDialogProps } from "../dialog/BaseDialog";
|
|
3
|
+
export type CoverSheetProps = BaseDialogProps & {
|
|
4
|
+
/**
|
|
5
|
+
* used for setting id of the wrapper of where the action will be located */
|
|
6
6
|
actionWrapperId?: string;
|
|
7
7
|
actions?: ReactNode;
|
|
8
|
-
children: ReactNode;
|
|
9
8
|
headerComponent?: ReactNode;
|
|
10
9
|
label: string;
|
|
11
|
-
open: boolean;
|
|
12
|
-
themeOverride?: Theme;
|
|
13
|
-
onClose: () => void;
|
|
14
10
|
};
|
|
15
|
-
export declare const CoverSheet: ({ actions, actionWrapperId, children, className, headerComponent, label, onClose, open,
|
|
11
|
+
export declare const CoverSheet: ({ actions, actionWrapperId, children, className, headerComponent, label, onClose, open, ...props }: CoverSheetProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),r=require("react"),t=require("clsx"),n=require("../button/Button.js"),i=require("./CoverSheetActions.js"),a=require("../dialog/BaseDialog.js"),s=require("../text/Text.js"),c=require("../../icons/RemoveIcon.js"),d=require("../../style-inject.es-d4ddeae4.js");function l(e){return e&&e.__esModule?e:{default:e}}require("../button/RippleGroup.js"),require("framer-motion"),require("uuid"),require("../button/_Ripple.js"),require("../../utils/getAminoColor.js"),require("../../styles/constants/theme.js"),require("../button/useRipple.js"),require("../spinner/Spinner.js"),require("react-dom"),require("../stack/HStack.js"),require("../stack/Stack.js"),require("../../icons/icon-base/_IconBase.js");var u=l(t),m="Amino_CoverSheet-module__coverSheet--nZP66",h="Amino_CoverSheet-module__headerContainer--SCAgD",p="Amino_CoverSheet-module__header--praFM",v="Amino_CoverSheet-module__headerComponent--fgFRV",_="Amino_CoverSheet-module__content--Zht4F";d.styleInject(".Amino_CoverSheet-module__coverSheet--nZP66{background:var(--amino-page-background);border:var(--amino-border);border-radius:0;box-sizing:border-box;color:var(--amino-text-color);height:100vh;left:0;max-height:100vh;outline:none;overscroll-behavior:contain;position:fixed;top:0;width:100vw}@media print{.Amino_CoverSheet-module__coverSheet--nZP66{height:auto;min-height:100vh;position:absolute}}.Amino_CoverSheet-module__headerContainer--SCAgD{align-items:center;background-color:var(--amino-page-background);border-bottom:var(--amino-border);display:flex;height:64px;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-32);position:-webkit-sticky;position:sticky;top:0;z-index:99}@media print{.Amino_CoverSheet-module__headerContainer--SCAgD{display:none}}.Amino_CoverSheet-module__header--praFM{align-items:center;display:flex;gap:var(--amino-space-16)}.Amino_CoverSheet-module__headerComponent--fgFRV{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.Amino_CoverSheet-module__content--Zht4F{overflow:auto;padding:var(--amino-space-56)}");exports.CoverSheet=function(t){var d=t.actions,l=t.actionWrapperId,C=void 0===l?"__cover-sheet-actions":l,j=t.children,b=t.className,g=t.headerComponent,S=t.label,x=t.onClose,f=t.open,q=e.__rest(t,["actions","actionWrapperId","children","className","headerComponent","label","onClose","open"]);return r.useEffect((function(){"undefined"!=typeof document&&document.querySelectorAll("[id='".concat(C,"']")).length>1&&console.error('Duplicate id "'.concat(C,'" detected in "CoverSheet" component. Please set "actionWrapperId" to a unique id.'))}),[C]),r.useEffect((function(){(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=f?"hidden":"auto")}),[f]),o.jsxs(a.BaseDialog,e.__assign({className:u.default(m,b),onClose:x,open:f,popupMotionProps:{animate:{translateY:0},exit:{translateY:"100vh"},initial:{translateY:"100vh"},transition:{duration:.5,ease:[0,0,0,1]}}},q,{children:[o.jsxs("header",{className:h,children:[o.jsxs("div",{className:p,children:[o.jsx(n.Button,{icon:o.jsx(c.RemoveIcon,{size:20}),onClick:x}),o.jsx(s.Text,{type:"subheader",children:S})]}),o.jsx("div",{className:v,children:g}),o.jsx("div",{id:C,children:d&&o.jsx(i.CoverSheetActions,{coverSheetActionId:C,children:d})})]}),o.jsx("div",{className:_,children:j})]}))};
|
|
@@ -3,7 +3,7 @@ import type { BaseProps } from "../../types/BaseProps";
|
|
|
3
3
|
export type CoverSheetProps = BaseProps & {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
/**
|
|
6
|
-
* Determine where to put
|
|
6
|
+
* Determine where to put these actions in the coversheet
|
|
7
7
|
* @default id for coversheet component is `__cover-sheet-actions`
|
|
8
8
|
* */
|
|
9
9
|
coverSheetActionId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),i=require("react"),n=require("react-dom"),t=require("clsx"),a=require("framer-motion"),r=require("../../style-inject.es-d4ddeae4.js");function l(e){return e&&e.__esModule?e:{default:e}}var c=l(t),d="Amino_BaseDialog-module__backdrop--Tykyp",s="Amino_BaseDialog-module__popup--1AFN-";r.styleInject(".Amino_BaseDialog-module__backdrop--Tykyp{align-items:center;color:var(--amino-text-color);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100vw;z-index:1000}.Amino_BaseDialog-module__popup--1AFN-{background:var(--amino-surface-color);border-radius:var(--amino-radius-12);box-shadow:var(--amino-v3-shadow-xxl);display:flex;flex-direction:column;max-height:90vh;outline:none;overflow:hidden;width:var(--amino-base-dialog-width);z-index:1001}");exports.BaseDialog=function(t){var r=t.children,l=t.className,u=t.closeOnBlur,m=void 0===u||u,p=t.closeOnEsc,v=void 0===p||p,f=t.onClose,g=t.open,_=t.popupMotionProps,y=t.style,h=t.themeOverride,b=t.width,x=void 0===b?444:b,k=t.withBackdrop,w=void 0===k||k,q=i.useRef(null),j=i.useRef(null);i.useEffect((function(){var e,o;(null===(e=j.current)||void 0===e?void 0:e.contains(document.activeElement))||null===(o=j.current)||void 0===o||o.focus(),(null===document||void 0===document?void 0:document.body)&&(document.body.style.overflow=g?"hidden":"auto")}),[g]);var A=w?{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]}},_);if("undefined"!=typeof document){var D=document.querySelector("body");if(D)return n.createPortal(o.jsx(a.AnimatePresence,{children:g&&i.createElement(a.motion.div,e.__assign({className:d},A,{key:"dialog-backdrop",ref:j,"data-theme":h,onKeyDown:function(e){"Escape"===e.key&&(e.stopPropagation(),f&&v&&f())},onMouseDown:function(e){q.current=e.target},onMouseUp:function(e){var o=e.target===q.current,i=f&&m&&e.target===j.current;o&&i&&f(),q.current=null},style:e.__assign(e.__assign({},y),{"--amino-base-dialog-width":"".concat(x,"px")}),tabIndex:-1,transition:{duration:.3}}),i.createElement(a.motion.div,e.__assign({},B,{key:"dialog",className:c.default(l,s,"elevated"),onClick:function(e){e.stopPropagation()}}),r))}),D)}return null};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),i=require("clsx"),t=require("../checkbox/Checkbox.js"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),l=require("react/jsx-runtime"),o=require("react"),i=require("clsx"),t=require("../checkbox/Checkbox.js"),a=require("../skeleton/Skeleton.js"),n=require("../text/Text.js"),d=require("../../style-inject.es-d4ddeae4.js");function r(e){return e&&e.__esModule?e:{default:e}}require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../styles/constants/theme.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableStyled--Q3YSy",c="Amino_SimpleTable-module__noPadding--b5Y-c",b="Amino_SimpleTable-module__withHover--eL3XX",_="Amino_SimpleTable-module__clickable--XnaaE",u="Amino_SimpleTable-module__loading--bvjof",h="Amino_SimpleTable-module__cellLink--jySVK",y="Amino_SimpleTable-module__styledCheckbox---753a";d.styleInject(".Amino_SimpleTable-module__tableStyled--Q3YSy{width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:uppercase}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border);height:56px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{padding:16px;white-space:nowrap}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr{border-bottom:var(--amino-border);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-gray-50)}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__clickable--XnaaE{cursor:pointer}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr:not(:hover) .row-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td{padding:12px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__loading--bvjof{text-align:center}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td:not(:hover) .cell-hover-show{visibility:collapse}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK{padding:0}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a{display:block;height:100%;padding:12px;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr>td.Amino_SimpleTable-module__cellLink--jySVK>a.Amino_SimpleTable-module__noPadding--b5Y-c{padding:0}.Amino_SimpleTable-module__styledCheckbox---753a{display:inline-flex;padding:12px}");exports.SimpleTable=function(i){var d=i.className,r=i.getRowLink,S=i.headers,p=i.items,x=i.keyExtractor,g=i.loading,k=void 0!==g&&g,j=i.loadingItems,v=void 0===j?10:j,A=i.noHoverBackground,T=void 0!==A&&A,C=i.onRowClick,f=i.onRowHover,w=i.renderFooter,Y=i.selectable,Q=void 0===Y?{enabled:!1}:Y,q=i.style,N=function(e,o){var i=o[e.key],t=function(i){return r&&!Q.anySelected?l.jsx("td",{className:h,children:l.jsx("a",{className:m.default(e.noPadding&&c),href:r(o),style:{textAlign:e.align||"start"},children:i})}):l.jsx("td",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},children:i})};return e.renderCustom?l.jsx(l.Fragment,{children:t(e.renderCustom(i,o))}):l.jsx(l.Fragment,{children:t(String(i))})};return l.jsxs("table",{className:m.default(d,s),style:q,children:[l.jsxs("colgroup",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("col",{width:0}),S.map((function(e){return l.jsx("col",{width:void 0!==e.width?"".concat(e.width,"%"):void 0},e.key)}))]}),l.jsx("thead",{children:l.jsxs("tr",{children:[!!Q.onHeaderCheckboxChange&&l.jsx("th",{className:c,children:Q.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!k&&Q.headerCheckboxValue||!1,className:y,disabled:k,onChange:Q.onHeaderCheckboxChange})}),S.map((function(e){return l.jsx("th",{className:m.default(e.noPadding&&c),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(n.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)}))]})}),l.jsx("tbody",{children:k?e.__spreadArray([],e.__read(Array(v).keys()),!1).map((function(e){return l.jsxs("tr",{children:[Q.enabled&&l.jsx("td",{children:l.jsx(a.Skeleton,{height:30},e)}),S.map((function(o){return l.jsx("td",{className:m.default(u,o.noPadding&&c),children:l.jsx(a.Skeleton,{height:30},e)},o.key)}))]},e)})):p.map((function(e,i){var a,n,d,r=!!C||!!Q.anySelected&&!!Q.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&_,!T&&b),onClick:function(){var l,o,t;Q.anySelected?(null===(l=Q.isRowCheckboxDisabled)||void 0===l?void 0:l.call(Q,e,i))||null===(o=Q.onRowCheckboxChange)||void 0===o||o.call(Q,!(null===(t=Q.isRowChecked)||void 0===t?void 0:t.call(Q,e,i)),e,i):null==C||C(e)},onMouseEnter:function(){return null==f?void 0:f(e)},children:[Q.enabled&&l.jsx("td",{className:c,children:(null===(a=Q.renderCustomRowCheckbox)||void 0===a?void 0:a.call(Q,e,i))||l.jsx(t.Checkbox,{checked:(null===(n=Q.isRowChecked)||void 0===n?void 0:n.call(Q,e,i))||!1,className:y,disabled:(null===(d=Q.isRowCheckboxDisabled)||void 0===d?void 0:d.call(Q,e,i))||!1,onChange:function(l){var o;return null===(o=Q.onRowCheckboxChange)||void 0===o?void 0:o.call(Q,l,e,i)}})}),S.map((function(i){return l.jsx(o.Fragment,{children:N(i,e)},i.key)}))]},x(e))}))}),w]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-bd4862e8.js"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),o=require("react/jsx-runtime"),t=require("@mui/material/styles"),s=require("@mui/material/Tooltip"),i=require("clsx"),r=require("../stack/VStack.js"),a=require("../text/Text.js"),l=require("../../styles/constants/theme.js"),n=require("../../utils/hooks/useAminoTheme.js"),p=require("../../style-inject.es-d4ddeae4.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../stack/Stack.js"),require("react"),require("../../Theme-61f4342c.js"),require("zod"),require("../../utils/hooks/useStorage.js"),require("../../utils/storage.js"),require("swr");var m=d(s),u=d(i),c="Amino_Tooltip-module__tooltip--W10n3",_="Amino_Tooltip-module__styledVStack--oMl2F",h="Amino_Tooltip-module__hiddenSpan--jqQ9w",j="Amino_Tooltip-module__childWrapper--srD4p";p.styleInject(".Amino_Tooltip-module__tooltip--W10n3 .Amino_Tooltip-module__styledVStack--oMl2F{padding:0}.Amino_Tooltip-module__tooltip--W10n3 .Amino_Tooltip-module__hiddenSpan--jqQ9w{display:none}.Amino_Tooltip-module__tooltip--W10n3 .Amino_Tooltip-module__childWrapper--srD4p{position:relative}.Amino_Tooltip-module__tooltip--W10n3 .Amino_Tooltip-module__childWrapper--srD4p [disabled]+.Amino_Tooltip-module__hiddenSpan--jqQ9w{bottom:0;cursor:not-allowed;display:block;left:0;position:absolute;right:0;top:0;z-index:10}");var T=t.styled((function(t){var s=t.className,i=t.dataTheme,r=e.__rest(t,["className","dataTheme"]);return o.jsx(m.default,e.__assign({},r,{classes:{popper:s},PopperProps:e.__assign(e.__assign({},r.PopperProps),{"data-theme":i})}))}))((function(e){var o,t,i,r=e.background;return(o={})["& .".concat(s.tooltipClasses.tooltip)]=((t={})["*"]={color:l.theme.gray0},t.backgroundColor=r?l.theme[r]:l.theme.gray1200,t.borderRadius=l.theme.radius10,t.boxShadow=l.theme.v3ShadowLarge,t.padding=l.theme.space12,t),o["&[data-theme='night']"]=((i={})[".".concat(s.tooltipClasses.tooltip)]={backgroundColor:r?l.theme[r]:l.theme.gray50},i["*"]={color:l.theme.gray1200},i),o}));exports.Tooltip=function(t){var s=t.background,i=t.children,l=t.className,p=t.open,d=t.showTooltip,m=t.subtitle,g=t.tag,q=t.themeOverride,x=t.title,k=e.__rest(t,["background","children","className","open","showTooltip","subtitle","tag","themeOverride","title"]),y=n.useAminoTheme().aminoTheme;return d?o.jsx(T,e.__assign({},k,{background:s,className:u.default(l,c),dataTheme:q||y,open:p,title:o.jsxs(r.VStack,{className:_,spacing:8,children:[x&&o.jsx(a.Text,{isUppercase:!1,type:"small-header",children:x}),"string"==typeof m?o.jsx(a.Text,{type:"caption",children:m}):m]}),children:"span"===g?o.jsxs("span",{className:j,children:[i,o.jsx("span",{className:h})]}):o.jsxs("div",{className:j,children:[i,o.jsx("span",{className:h})]})})):"span"===g?o.jsx("span",{children:i}):o.jsx("div",{children:i})};
|