@zonos/amino 5.1.1 → 5.1.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.
package/all.d.ts CHANGED
@@ -71,8 +71,6 @@ import './components/split-panel/SplitPanel';
71
71
  import './components/stack/HStack';
72
72
  import './components/stack/Stack';
73
73
  import './components/stack/VStack';
74
- import './components/styles/ColorPalette';
75
- import './components/styles/Shadow';
76
74
  import './components/surface/Surface';
77
75
  import './components/switch/Switch';
78
76
  import './components/table/Table';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/amino",
3
- "version": "5.1.1",
3
+ "version": "5.1.2",
4
4
  "description": "Core UI components for Amino",
5
5
  "repository": "git@github.com:Zonos/amino.git",
6
6
  "license": "MIT",
package/theme.css CHANGED
@@ -1,5 +1,6 @@
1
1
  :root,
2
2
  [data-theme='day'] {
3
+ color-scheme: light;
3
4
  --amino-transition: all 0.2s ease-in-out 0s;
4
5
  --amino-type-scale-base: 16px;
5
6
  --amino-glass-0: #10111600;
@@ -265,6 +266,7 @@
265
266
 
266
267
  /* Night theme */
267
268
  [data-theme='night'] {
269
+ color-scheme: dark;
268
270
  --amino-glass-0: #ffffff00;
269
271
  --amino-glass-50: #ffffff0a;
270
272
  --amino-glass-100: #ffffff21;
@@ -1,8 +1,11 @@
1
+ import type { Theme } from "../../types";
1
2
  type Params = {
2
- /** Whether to modify the HTML body */
3
- root: boolean;
3
+ /** Use with root to override a theme in localStorage */
4
+ override?: Theme;
5
+ /** Whether to modify the root HTML element */
6
+ root?: boolean;
4
7
  };
5
- export declare const useAminoTheme: (props?: Params) => {
8
+ export declare const useAminoTheme: (params?: Params) => {
6
9
  aminoTheme: "day" | "night" | "midnight";
7
10
  setAminoTheme: (value: "day" | "night" | "midnight") => Promise<void>;
8
11
  };
@@ -1 +1 @@
1
- "use strict";var e=require("react"),r=require("../../Theme-61f4342c.js"),t=require("./useStorage.js"),u=require("../storage.js");require("zod"),require("../../_tslib-ccfac372.js"),require("./useSwr.js"),require("swr");exports.useAminoTheme=function(a){var o=!!(null==a?void 0:a.root),i=t.useStorage({defaultValue:function(){if("undefined"==typeof window)return"day";var e=u.getStorageItem({key:"amino:theme",schema:r.themeSchema,type:"local"});return null!=e?e:"day"}(),key:"amino:theme",type:"local"}),n=i.setValue,s=i.value;return e.useEffect((function(){o&&(document.documentElement.dataset.theme=s)}),[s,o]),{aminoTheme:s,setAminoTheme:n}};
1
+ "use strict";var e=require("react"),r=require("../../Theme-61f4342c.js"),t=require("./useStorage.js"),u=require("../storage.js");require("zod"),require("../../_tslib-ccfac372.js"),require("./useSwr.js"),require("swr");exports.useAminoTheme=function(a){var o=null!=a?a:{},i=o.override,n=o.root,s=t.useStorage({defaultValue:function(){if("undefined"==typeof window)return"day";var e=u.getStorageItem({key:"amino:theme",schema:r.themeSchema,type:"local"});return null!=e?e:"day"}(),key:"amino:theme",type:"local"}),m=s.setValue,l=s.value;return e.useEffect((function(){n&&(document.documentElement.dataset.theme=i||l)}),[l,i,n]),{aminoTheme:i||l,setAminoTheme:m}};
@@ -1 +0,0 @@
1
- export declare const ColorPalette: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- "use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),t=require("styled-components"),r=require("../stack/VStack.js"),a=require("../text/Text.js"),c=require("../../styles/constants/theme.js");function i(e){return e&&e.__esModule?e:{default:e}}require("../stack/Stack.js");var l,s,o,d=i(t),u=["blue","cyan","green","orange","purple","red","gray","glass"],p=["100","200","300","400","500","600","700","800","900","1000"],m=d.default.div(l||(l=e.__makeTemplateObject(["\n display: grid;\n grid-template-columns: repeat(auto-fit, calc(33% - ","));\n gap: ",";\n align-items: center;\n"],["\n display: grid;\n grid-template-columns: repeat(auto-fit, calc(33% - ","));\n gap: ",";\n align-items: center;\n"])),c.theme.space24,c.theme.space24),g=d.default.div(s||(s=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n margin-bottom: ",";\n text-align: center;\n"],["\n display: flex;\n flex-direction: column;\n margin-bottom: ",";\n text-align: center;\n"])),c.theme.space24),f=d.default.div(o||(o=e.__makeTemplateObject(["\n color: ",";\n font-size: ",";\n padding: ",";\n background: ",";\n"],["\n color: ",";\n font-size: ",";\n padding: ",";\n background: ",";\n"])),(function(e){return e.color}),c.theme.fontSizeS,c.theme.space24,(function(e){return c.theme[e.background]}));exports.ColorPalette=function(){return n.jsx(m,{children:u.map((function(t){return n.jsxs(g,{children:[n.jsx(a.Text,{type:"title",children:t.toUpperCase()}),n.jsx(r.VStack,{spacing:0,children:("gray"!==t&&"glass"!==t?p:e.__spreadArray(e.__spreadArray(["0","50"],e.__read(p),!1),["1100","1200"],!1)).map((function(e){var r="".concat(t).concat(e);return n.jsx("div",{children:n.jsx(f,{background:r,color:Number(e)<500?"black":"white",children:n.jsx(a.Text,{children:e})})},r)}))})]},t)}))})};
@@ -1 +0,0 @@
1
- export declare const Shadow: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- "use strict";var e=require("../../_tslib-ccfac372.js"),a=require("react/jsx-runtime"),n=require("react"),r=require("styled-components"),t=require("../../styles/constants/theme.js");function l(e){return e&&e.__esModule?e:{default:e}}var s,d,u=l(r),i=[{label:"Inset",value:"inset"},{label:"Base",value:"small"},{label:"Medium",value:"base"},{label:"Large",value:"medium"},{label:"XL",value:"large"},{label:"2XL",value:"larger"}],o=u.default.div(s||(s=e.__makeTemplateObject(["\n margin-bottom: ",";\n box-shadow: var(",");\n background: ",";\n padding: "," ",";\n"],["\n margin-bottom: ",";\n box-shadow: var(",");\n background: ",";\n padding: "," ",";\n"])),t.theme.space40,(function(e){return e.shadow}),t.theme.gray100,t.theme.space16,t.theme.space24),c=u.default.div(d||(d=e.__makeTemplateObject(["\n background: ",";\n padding: "," ",";\n"],["\n background: ",";\n padding: "," ",";\n"])),t.theme.gray0,t.theme.space8,t.theme.space24);exports.Shadow=function(){return a.jsx(c,{children:i.map((function(e){var r=e.label,t=e.value,l="--amino-shadow-".concat(t);return a.jsxs(n.Fragment,{children:[a.jsxs("p",{children:["Shadow intensity: ",r]}),a.jsx(o,{shadow:l,children:a.jsxs("p",{children:["var(",l,")"]})})]},l)}))})};