@zonos/amino 5.4.0 → 5.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-bd4862e8.js"),n=require("react/jsx-runtime"),o=require("clsx"),t=require("../../utils/hooks/useDropdown.js"),i=require("../../style-inject.es-d4ddeae4.js");function
|
|
1
|
+
"use strict";var e=require("../../_tslib-bd4862e8.js"),n=require("react/jsx-runtime"),o=require("clsx"),t=require("../../utils/hooks/useDropdown.js"),i=require("../../style-inject.es-d4ddeae4.js");function a(e){return e&&e.__esModule?e:{default:e}}require("react"),require("@floating-ui/react");var r=a(o),s="Amino_MenuButton-module__wrapper--8bJ9E",u="Amino_MenuButton-module__dropdownWrapper--PvG4F",l="Amino_MenuButton-module__animatedSurface--rmPwS";i.styleInject("@keyframes Amino_MenuButton-module__DropdownAnimation--lHvDn{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@keyframes Amino_MenuButton-module__DropdownAnimationInverse--INu3m{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}.Amino_MenuButton-module__wrapper--8bJ9E{display:inline-flex;position:relative}.Amino_MenuButton-module__dropdownWrapper--PvG4F{min-width:100%;z-index:10}.Amino_MenuButton-module__animatedSurface--rmPwS{animation:Amino_MenuButton-module__DropdownAnimation--lHvDn .25s ease-in-out;animation-fill-mode:both;background:var(--amino-surface-color);border-radius:var(--amino-radius-12);box-shadow:var(--amino-v3-shadow-large);margin-top:var(--amino-space-4);min-width:100%;padding:var(--amino-space-8);right:0;width:-webkit-max-content;width:max-content}");exports.MenuButton=function(o){var i=o.action,a=o.children,d=o.className,m=o.dropdownOptions,c=o.noCloseOnMouseLeave,p=void 0!==c&&c,_=o.noCloseOnSelect,f=void 0!==_&&_,v=o.style,w=t.useDropdown(e.__assign({offsetCrossAxis:0,offsetMainAxis:0},m)),y=w.floatingStyles,x=w.refs,b=w.setVisible,h=w.visibility,A=w.visible,M=w.wrapperRef,g=function(e){e.stopPropagation(),f||b(!1)};return n.jsxs("div",{ref:M,className:r.default(s,d),onMouseLeave:function(){p||b(!1)},style:v,children:[n.jsx("div",{ref:x.setReference,className:"menu-button-action",onClick:function(e){e.stopPropagation(),b(!0)},onKeyDown:function(e){"Enter"===e.key&&b(!0)},role:"button",tabIndex:0,children:i}),n.jsx("div",{ref:x.setFloating,className:u,style:e.__assign(e.__assign({},y),{visibility:h}),children:A&&n.jsx("div",{className:l,onClick:g,onKeyDown:function(e){"Enter"===e.key&&g(e)},role:"button",tabIndex:-1,children:a})})]})};
|
|
@@ -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"),n=require("react"),i=require("clsx"),a=require("framer-motion"),c=require("../help-text/HelpText.js"),l=require("../text/Text.js"),r=require("../../icons/CheckmarkIcon.js"),t=require("../../styles/constants/theme.js"),s=require("../../global.module-569e4fd5.js"),d=require("../../utils/getTestId.js"),m=require("../../style-inject.es-d4ddeae4.js");function b(e){return e&&e.__esModule?e:{default:e}}require("../../icons/icon-base/_IconBase.js");var h=b(i),_="Amino_Checkbox-module__wrapper--PnUGD",x="Amino_Checkbox-module__checkboxContainer--T3dHf",u="Amino_Checkbox-module__disabled--5BFJi",k="Amino_Checkbox-module__aminoCheckbox--s-hZQ",p="Amino_Checkbox-module__styledLabel--nNdgS",C="Amino_Checkbox-module__styledSubtitle--F4Zg5",g="Amino_Checkbox-module__labelWrapper--opXpk",y="Amino_Checkbox-module__infoWrapper--0j0cc",A="Amino_Checkbox-module__styledLabelDescription--m4mFs";m.styleInject(".Amino_Checkbox-module__wrapper--PnUGD{cursor:pointer}.Amino_Checkbox-module__checkboxContainer--T3dHf{display:flex;flex-direction:row}.Amino_Checkbox-module__checkboxContainer--T3dHf,.Amino_Checkbox-module__checkboxContainer--T3dHf *{pointer-events:none;-webkit-user-select:none;user-select:none}.Amino_Checkbox-module__checkboxContainer--T3dHf.Amino_Checkbox-module__disabled--5BFJi{cursor:not-allowed}.Amino_Checkbox-module__checkboxContainer--T3dHf.Amino_Checkbox-module__disabled--5BFJi .Amino_Checkbox-module__aminoCheckbox--s-hZQ{background:var(--amino-checkbox-disabled-background);border:var(--amino-checkbox-disabled-border);box-shadow:none}.Amino_Checkbox-module__checkboxContainer--T3dHf.Amino_Checkbox-module__disabled--5BFJi .Amino_Checkbox-module__styledLabel--nNdgS{color:var(--amino-gray-600)}.Amino_Checkbox-module__checkboxContainer--T3dHf.Amino_Checkbox-module__disabled--5BFJi .Amino_Checkbox-module__styledSubtitle--F4Zg5{color:var(--amino-gray-400)}.Amino_Checkbox-module__checkboxContainer--T3dHf.Amino_Checkbox-module__disabled--5BFJi .Amino_Checkbox-module__labelWrapper--opXpk svg{opacity:var(--amino-opacity-disabled)}.Amino_Checkbox-module__aminoCheckbox--s-hZQ{align-items:center;background:var(--amino-checkbox-background);border:var(--amino-checkbox-border);border-radius:var(--amino-radius-4);box-shadow:var(--amino-checkbox-box-shadow);display:flex;height:16px;justify-content:center;line-height:16px;min-height:16px;min-width:16px;transition:all .15s ease-in-out;-webkit-user-select:none;user-select:none;width:16px}.Amino_Checkbox-module__aminoCheckbox--s-hZQ svg{box-shadow:0 2px 4px #0000000f,0 1px 2px #0000000a;color:var(--amino-gray-0);height:16px;width:16px}[data-theme=night] .Amino_Checkbox-module__aminoCheckbox--s-hZQ svg{color:var(--amino-gray-1000)}.Amino_Checkbox-module__infoWrapper--0j0cc{margin-left:8px}.Amino_Checkbox-module__styledLabelDescription--m4mFs{color:var(--amino-gray-600);margin-left:4px}.Amino_Checkbox-module__styledLabel--nNdgS.Amino_Checkbox-module__styledLabel--nNdgS{margin-bottom:0}.Amino_Checkbox-module__labelWrapper--opXpk{align-items:center;display:flex;line-height:16px}.Amino_Checkbox-module__labelWrapper--opXpk svg{margin-right:4px}");var f=a.motion(r.CheckmarkIcon),v=function(e,o){return e?o?t.theme.danger:t.theme.primary:t.theme.inputBackground},j=function(e,o){return e?"none":"1.5px solid ".concat(o?t.theme.danger:t.theme.gray400)};exports.Checkbox=function(i){var r=i.allowPropagation,m=void 0!==r&&r,b=i.checked,w=void 0!==b&&b,T=i.className,N=i.disabled,q=i.error,H=void 0!==q&&q,F=i.helpText,B=i.icon,S=i.label,I=i.labelComponent,P=i.labelDescription,D=i.onChange,L=i.style,Z=i.subtitle,J=e.__rest(i,["allowPropagation","checked","className","disabled","error","helpText","icon","label","labelComponent","labelDescription","onChange","style","subtitle"]),W=n.useId(),Q=n.useMemo((function(){return d.getTestId({componentName:"checkbox",name:S})}),[S]),X=function(e){m||e.stopPropagation(),N||D(!w,e)};return o.jsxs("label",e.__assign({className:h.default(s.globalStyles.focusableLabel,_,T),htmlFor:W,onClick:function(e){return!m&&e.stopPropagation()},style:e.__assign(e.__assign({},L),{"--amino-checkbox-background":v(w,H),"--amino-checkbox-border":j(w,H),"--amino-checkbox-box-shadow":w?t.theme.shadowButtonPrimary:"none","--amino-checkbox-disabled-background":w?t.theme.blue200:"","--amino-checkbox-disabled-border":w?"none":"1.5px solid ".concat(t.theme.gray300)})},J,{children:[o.jsx("input",{checked:w,className:h.default(s.globalStyles.inputHidden,N&&"disabled"),"data-testid":Q,id:W,onChange:X,onKeyDown:function(e){"Enter"!==e.key&&"Space"!==e.key||X(e)},tabIndex:0,type:"checkbox"}),o.jsxs("div",{className:h.default(x,"amino-input-wrapper",N&&u,N&&"disabled"),children:[o.jsx("div",{className:k,children:o.jsx(a.AnimatePresence,{children:w&&o.jsx(f,{animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},initial:{opacity:0,scale:.5},transition:{duration:.35,ease:[.4,0,.2,1]}},"checkbox")})}),I||S&&o.jsxs("div",{className:y,children:[o.jsxs("div",{className:g,children:[B,o.jsxs(l.Text,{className:p,type:"input-label",children:[S,P&&o.jsx("span",{className:A,children:P})]})]}),Z&&o.jsx(l.Text,{className:C,type:"subtitle",children:Z})]})]}),o.jsx(c.HelpText,{error:H,helpText:F})]}))};
|
|
@@ -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"),n=require("../skeleton/Skeleton.js"),a=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("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableContainer--UsGFZ",c="Amino_SimpleTable-module__tableStyled--Q3YSy",b="Amino_SimpleTable-module__noPadding--b5Y-c",u="Amino_SimpleTable-module__withHover--eL3XX",_="Amino_SimpleTable-module__clickable--XnaaE",h="Amino_SimpleTable-module__loading--bvjof",y="Amino_SimpleTable-module__cellLink--jySVK",
|
|
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"),n=require("../skeleton/Skeleton.js"),a=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("../help-text/HelpText.js"),require("../../styles/constants/theme.js"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../global.module-569e4fd5.js"),require("../../utils/getTestId.js");var m=r(i),s="Amino_SimpleTable-module__tableContainer--UsGFZ",c="Amino_SimpleTable-module__tableStyled--Q3YSy",b="Amino_SimpleTable-module__noPadding--b5Y-c",u="Amino_SimpleTable-module__withHover--eL3XX",_="Amino_SimpleTable-module__clickable--XnaaE",h="Amino_SimpleTable-module__loading--bvjof",y="Amino_SimpleTable-module__cellLink--jySVK",p="Amino_SimpleTable-module__styledCheckbox---753a",S="Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7";d.styleInject(".Amino_SimpleTable-module__tableContainer--UsGFZ{overflow:auto;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy{border-collapse:initial;border-spacing:0;width:100%}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead{text-transform:none}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr{border-bottom:var(--amino-border-subtle);height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>thead>tr>th{background-color:var(--amino-gray-0);border-bottom:var(--amino-border-subtle);padding:12px;position:-webkit-sticky;position:sticky;top:0;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{height:48px}.Amino_SimpleTable-module__tableStyled--Q3YSy>tbody>tr.Amino_SimpleTable-module__withHover--eL3XX:hover{background-color:var(--amino-hover-color)}.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{border-bottom:var(--amino-border-subtle);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}.Amino_SimpleTable-module__skeletonCellWrapper--I8vJ7{display:flex}");var x=function(e){switch(e){case"center":return"center";case"end":return"flex-end";default:return"flex-start"}};exports.SimpleTable=function(i){var d=i.className,r=i.CustomLinkComponent,g=i.getRowLink,v=i.headers,k=i.items,j=i.keyExtractor,A=i.loading,T=void 0!==A&&A,C=i.loadingItems,f=void 0===C?10:C,w=i.loadingSkeletonHeight,Y=void 0===w?13:w,Q=i.maxHeight,q=void 0===Q?"100%":Q,H=i.noHoverBackground,N=void 0!==H&&H,R=i.onRowClick,L=i.onRowHover,P=i.renderFooter,I=i.selectable,F=void 0===I?{enabled:!1}:I,X=i.style,V=function(e,o){var i=o[e.key],t=function(i){if(g&&!F.anySelected&&!e.disabledLink){var t=r||"a";return l.jsx("td",{className:y,children:l.jsx(t,{className:m.default(e.noPadding&&b),href:g(o),style:{textAlign:e.align||"start"},children:i})})}return l.jsx("td",{className:m.default(e.noPadding&&b),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.jsx("div",{className:m.default(s,d),style:e.__assign({maxHeight:q},X),children:l.jsxs("table",{className:c,children:[l.jsxs("colgroup",{children:[!!F.onHeaderCheckboxChange&&l.jsx("col",{width:0}),v.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:[!!F.onHeaderCheckboxChange&&l.jsx("th",{className:b,children:F.renderCustomHeaderCheckbox||l.jsx(t.Checkbox,{checked:!T&&F.headerCheckboxValue||!1,className:p,disabled:T,onChange:F.onHeaderCheckboxChange})}),v.map((function(e){return l.jsx("th",{className:m.default(e.noPadding&&b),style:{textAlign:e.align||"start"},children:"string"==typeof e.name?l.jsx(a.Text,{color:"gray800",type:"small-header",children:e.name}):e.name},e.key)}))]})}),l.jsx("tbody",{children:T?e.__spreadArray([],e.__read(Array(f).keys()),!1).map((function(e){return l.jsxs("tr",{children:[F.enabled&&l.jsx("td",{children:l.jsx(n.Skeleton,{height:Y},e)}),v.map((function(o){return l.jsx("td",{className:m.default(h,o.noPadding&&b),children:l.jsx("div",{className:S,style:{justifyContent:x(o.align)},children:l.jsx(n.Skeleton,{height:Y,style:{width:"50%"}},e)})},o.key)}))]},e)})):k.map((function(e,i){var n,a,d,r=!!R||!!F.anySelected&&!!F.onRowCheckboxChange;return l.jsxs("tr",{className:m.default(r&&_,!N&&u),onClick:function(l){var o,t,n;F.anySelected?(null===(o=F.isRowCheckboxDisabled)||void 0===o?void 0:o.call(F,e,i))||(l.preventDefault(),null===(t=F.onRowCheckboxChange)||void 0===t||t.call(F,!(null===(n=F.isRowChecked)||void 0===n?void 0:n.call(F,e,i)),e,i)):null==R||R(e)},onMouseEnter:function(){return null==L?void 0:L(e)},children:[F.enabled&&l.jsx("td",{children:(null===(n=F.renderCustomRowCheckbox)||void 0===n?void 0:n.call(F,e,i))||l.jsx(t.Checkbox,{checked:(null===(a=F.isRowChecked)||void 0===a?void 0:a.call(F,e,i))||!1,disabled:(null===(d=F.isRowCheckboxDisabled)||void 0===d?void 0:d.call(F,e,i))||!1,onChange:function(l){var o;return null===(o=F.onRowCheckboxChange)||void 0===o?void 0:o.call(F,l,e,i)}})}),v.map((function(i){return l.jsx(o.Fragment,{children:V(i,e)},i.key)}))]},j(e))}))}),P]})})};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("../storage.js");require("dayjs"),require("zod");var r=function(e){return function(t){return"local"===e&&window.addEventListener("storage",t),window.addEventListener("amino:storage-".concat(e),t),function(){"local"===e&&window.removeEventListener("storage",t),window.removeEventListener("amino:storage-".concat(e),t)}}};exports.useStorage=function(n){var a=n.defaultValue,
|
|
1
|
+
"use strict";var e=require("react"),t=require("../storage.js");require("dayjs"),require("zod");var r=function(e){return function(t){return"local"===e&&window.addEventListener("storage",t),window.addEventListener("amino:storage-".concat(e),t),function(){"local"===e&&window.removeEventListener("storage",t),window.removeEventListener("amino:storage-".concat(e),t)}}};exports.useStorage=function(n){var a,o=n.defaultValue,u=n.key,i=n.schema,l=n.type,s=e.useMemo((function(){return r(l)}),[l]);e.useSyncExternalStore(s,(function(){return"local"===l?localStorage.getItem(u):sessionStorage.getItem(u)}),(function(){return JSON.stringify(o)}));var c=null!==(a=t.getStorageItem({key:u,schema:i,type:l}))&&void 0!==a?a:null;return{setValue:e.useCallback((function(e){return t.setStorageItem({key:u,type:l,value:e})}),[u,l]),value:null!=c?c:o}},exports.useStorageWithLifetime=function(n){var a,o=n.defaultValue,u=n.key,i=n.lifetime,l=n.schema,s=n.type,c=e.useMemo((function(){return r(s)}),[s]);e.useSyncExternalStore(c,(function(){return"local"===s?localStorage.getItem(u):sessionStorage.getItem(u)}),(function(){return JSON.stringify(o)}));var g=t.getShouldUpdateStorageItem({key:u,schema:l,type:s})?null:null!==(a=t.getStorageItem({key:u,schema:l,type:s}))&&void 0!==a?a:null;return{setValue:e.useCallback((function(e){return t.setStorageItemWithLifetime({key:u,lifetime:i,type:s,value:e})}),[u,s,i]),value:null!=g?g:o}};
|