@zonos/amino 4.4.10 → 4.4.12

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-fe391a2e.js"),t=require("react/jsx-runtime"),s=require("@mui/material/styles"),o=require("@mui/material/Tooltip"),n=require("../stack/VStack.js"),a=require("../text/Text.js"),i=require("../../styles/constants/theme.js"),r=require("../../utils/hooks/useAminoTheme.js"),l=require("styled-components");function d(e){return e&&e.__esModule?e:{default:e}}require("../stack/Stack.js"),require("../../utils/hooks/useStorage.js"),require("../../utils/storage.js"),require("swr"),require("../../utils/hooks/useSwr.js");var p,u,c,m,h=d(o),g=d(l),_=g.default(n.VStack)(p||(p=e.__makeTemplateObject(["\n padding-top: 3px;\n"],["\n padding-top: 3px;\n"]))),j=g.default.div(u||(u=e.__makeTemplateObject([""],[""]))),b=g.default.span(c||(c=e.__makeTemplateObject(["\n display: none;\n"],["\n display: none;\n"]))),k=g.default.div(m||(m=e.__makeTemplateObject(["\n position: relative;\n [disabled] + "," {\n display: block;\n cursor: not-allowed;\n /** @desc avoid showing tooltip on top of dialog or coversheet */\n z-index: 10;\n\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n"],["\n position: relative;\n [disabled] + "," {\n display: block;\n cursor: not-allowed;\n /** @desc avoid showing tooltip on top of dialog or coversheet */\n z-index: 10;\n\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n"])),b),x=s.styled((function(s){var o=s.className,n=s.dataTheme,a=e.__rest(s,["className","dataTheme"]);return t.jsx(h.default,e.__assign({},a,{classes:{popper:o},PopperProps:e.__assign(e.__assign({},a.PopperProps),{"data-theme":n})}))}))((function(e){var t,s,n=e.background;return(t={})["& .".concat(o.tooltipClasses.tooltip)]={backgroundColor:n?i.theme[n]:i.theme.gray1200,boxShadow:i.theme.v3ShadowLarge},t["&[data-theme='night']"]=((s={})[".".concat(o.tooltipClasses.tooltip)]={backgroundColor:n?i.theme[n]:i.theme.gray50},s),t}));exports.Tooltip=function(s){var o=s.background,n=s.className,i=s.children,l=s.showTooltip,d=s.subtitle,p=s.tag,u=s.title,c=s.open,m=s.themeOverride,h=r.useAminoTheme().aminoTheme;return l?t.jsx(x,e.__assign({dataTheme:m||h,background:o,className:n,open:c,title:t.jsxs(_,e.__assign({spacing:8},{children:[u&&t.jsx(a.Text,e.__assign({type:"small-header",isUppercase:!1},{children:u})),"string"==typeof d?t.jsx(a.Text,e.__assign({type:"caption"},{children:d})):d]}))},{children:t.jsxs(k,e.__assign({as:p},{children:[i,t.jsx(b,{})]}))})):t.jsx(j,e.__assign({as:p},{children:i}))};
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),t=require("react/jsx-runtime"),s=require("@mui/material/styles"),o=require("@mui/material/Tooltip"),n=require("../stack/VStack.js"),a=require("../text/Text.js"),i=require("../../styles/constants/theme.js"),r=require("../../utils/hooks/useAminoTheme.js"),l=require("styled-components");function d(e){return e&&e.__esModule?e:{default:e}}require("../stack/Stack.js"),require("react"),require("../../utils/hooks/useStorage.js"),require("../../utils/storage.js"),require("swr"),require("../../utils/hooks/useSwr.js");var p,u,c,m,h=d(o),g=d(l),_=g.default(n.VStack)(p||(p=e.__makeTemplateObject(["\n padding-top: 3px;\n"],["\n padding-top: 3px;\n"]))),j=g.default.div(u||(u=e.__makeTemplateObject([""],[""]))),b=g.default.span(c||(c=e.__makeTemplateObject(["\n display: none;\n"],["\n display: none;\n"]))),k=g.default.div(m||(m=e.__makeTemplateObject(["\n position: relative;\n [disabled] + "," {\n display: block;\n cursor: not-allowed;\n /** @desc avoid showing tooltip on top of dialog or coversheet */\n z-index: 10;\n\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n"],["\n position: relative;\n [disabled] + "," {\n display: block;\n cursor: not-allowed;\n /** @desc avoid showing tooltip on top of dialog or coversheet */\n z-index: 10;\n\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n"])),b),x=s.styled((function(s){var o=s.className,n=s.dataTheme,a=e.__rest(s,["className","dataTheme"]);return t.jsx(h.default,e.__assign({},a,{classes:{popper:o},PopperProps:e.__assign(e.__assign({},a.PopperProps),{"data-theme":n})}))}))((function(e){var t,s,n=e.background;return(t={})["& .".concat(o.tooltipClasses.tooltip)]={backgroundColor:n?i.theme[n]:i.theme.gray1200,boxShadow:i.theme.v3ShadowLarge},t["&[data-theme='night']"]=((s={})[".".concat(o.tooltipClasses.tooltip)]={backgroundColor:n?i.theme[n]:i.theme.gray50},s),t}));exports.Tooltip=function(s){var o=s.background,n=s.className,i=s.children,l=s.showTooltip,d=s.subtitle,p=s.tag,u=s.title,c=s.open,m=s.themeOverride,h=r.useAminoTheme().aminoTheme;return l?t.jsx(x,e.__assign({dataTheme:m||h,background:o,className:n,open:c,title:t.jsxs(_,e.__assign({spacing:8},{children:[u&&t.jsx(a.Text,e.__assign({type:"small-header",isUppercase:!1},{children:u})),"string"==typeof d?t.jsx(a.Text,e.__assign({type:"caption"},{children:d})):d]}))},{children:t.jsxs(k,e.__assign({as:p},{children:[i,t.jsx(b,{})]}))})):t.jsx(j,e.__assign({as:p},{children:i}))};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "4.4.10",
3
+ "version": "4.4.12",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",
@@ -43,7 +43,7 @@
43
43
  "@graphiql/react": "0.x",
44
44
  "@graphiql/toolkit": "0.8.x",
45
45
  "framer-motion": "^4.x",
46
- "graphiql": "^2.x",
46
+ "graphiql": "^2.4.7",
47
47
  "graphql": "^16.x",
48
48
  "graphql-request": "~5.1.0",
49
49
  "lodash": "^4.17.21",
@@ -1,5 +1,10 @@
1
1
  import type { Theme } from "../../types";
2
- export declare const useAminoTheme: () => {
2
+ type Params = {
3
+ /** Whether to modify the HTML body */
4
+ root: boolean;
5
+ };
6
+ export declare const useAminoTheme: (props?: Params) => {
3
7
  aminoTheme: Theme;
4
8
  setAminoTheme: (value: Theme) => void;
5
9
  };
10
+ export {};
@@ -1 +1 @@
1
- "use strict";var e=require("../../_tslib-fe391a2e.js"),r=require("./useStorage.js");require("../storage.js"),require("swr"),require("./useSwr.js");exports.useAminoTheme=function(){var s=e.__read(r.useStorage({defaultValue:"day",key:"amino:theme",type:"local"}),2);return{aminoTheme:s[0],setAminoTheme:s[1]}};
1
+ "use strict";var e=require("../../_tslib-fe391a2e.js"),r=require("react"),t=require("./useStorage.js");require("../storage.js"),require("swr"),require("./useSwr.js");exports.useAminoTheme=function(u){var s=!!(null==u?void 0:u.root),o=e.__read(t.useStorage({defaultValue:"day",key:"amino:theme",type:"local"}),2),a=o[0],i=o[1];return r.useEffect((function(){s&&(document.body.dataset.theme=a)}),[a,s]),{aminoTheme:a,setAminoTheme:i}};