@zonos/amino 5.1.15 → 5.1.16
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,11 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export type SwitchProps = {
|
|
3
3
|
checked: boolean;
|
|
4
|
+
className?: string;
|
|
4
5
|
disabled?: boolean;
|
|
5
|
-
icon?: ReactNode;
|
|
6
6
|
label?: string;
|
|
7
7
|
labelDescription?: string;
|
|
8
|
+
labelIcon?: ReactNode;
|
|
8
9
|
subtitle?: string;
|
|
10
|
+
switchIconLeft?: ReactNode;
|
|
11
|
+
switchIconRight?: ReactNode;
|
|
9
12
|
onChange: (checked: boolean) => void;
|
|
10
13
|
};
|
|
11
|
-
export declare const Switch: ({ checked,
|
|
14
|
+
export declare const Switch: ({ checked, className, disabled, label, labelDescription, labelIcon, onChange, subtitle, switchIconLeft, switchIconRight, }: SwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("styled-components"),
|
|
1
|
+
"use strict";var n=require("../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("clsx"),i=require("styled-components"),a=require("../text/Text.js"),r=require("../../styles/constants/theme.js");function p(n){return n&&n.__esModule?n:{default:n}}var o,l,x,h,c,d,s,u,g,m,b=p(t),f=p(i),k=f.default.div(o||(o=n.__makeTemplateObject(["\n background: ",";\n box-shadow: ",";\n height: 14px;\n width: 14px;\n border-radius: 50%;\n transition: ",";\n position: absolute;\n top: 1px;\n left: ",";\n [data-theme='night'] & {\n background: ",";\n }\n"],["\n background: ",";\n box-shadow: ",";\n height: 14px;\n width: 14px;\n border-radius: 50%;\n transition: ",";\n position: absolute;\n top: 1px;\n left: ",";\n [data-theme='night'] & {\n background: ",";\n }\n"])),r.theme.gray0,(function(n){return n.checked?"0px -1px 1px 0px rgba(68, 94, 238, 0.08) inset, 0px 1px 3px 0px rgba(0, 0, 0, 0.20)":"0px -1px 1px 0px rgba(0, 0, 0, 0.08) inset, 0px 1px 3px 0px rgba(0, 0, 0, 0.20)"}),r.theme.transition,(function(n){return n.checked?"calc(100% - 15px)":"1px"}),r.theme.gray200),w=f.default(k)(l||(l=n.__makeTemplateObject(["\n height: 28px;\n width: 28px;\n top: 2px;\n left: ",";\n box-shadow:\n 0px -1px 1px 0px rgba(0, 0, 0, 0.2) inset,\n 0px 1px 3px 0px rgba(0, 0, 0, 0.4);\n"],["\n height: 28px;\n width: 28px;\n top: 2px;\n left: ",";\n box-shadow:\n 0px -1px 1px 0px rgba(0, 0, 0, 0.2) inset,\n 0px 1px 3px 0px rgba(0, 0, 0, 0.4);\n"])),(function(n){return n.checked?"calc(100% - 30px)":"2px"})),j=f.default.div(x||(x=n.__makeTemplateObject(["\n margin-right: ",";\n width: 32px;\n height: 16px;\n min-width: 32px;\n min-height: 16px;\n line-height: 16px;\n border-radius: 20px;\n background: ",";\n box-shadow: ",";\n display: block;\n user-select: none;\n position: relative;\n"],["\n margin-right: ",";\n width: 32px;\n height: 16px;\n min-width: 32px;\n min-height: 16px;\n line-height: 16px;\n border-radius: 20px;\n background: ",";\n box-shadow: ",";\n display: block;\n user-select: none;\n position: relative;\n"])),r.theme.space16,(function(n){return n.checked?r.theme.gray0:r.theme.gray100}),r.theme.v3ShadowInset),_=f.default(j)(h||(h=n.__makeTemplateObject(["\n width: 62px;\n height: 32px;\n min-width: 24px;\n background: ",";\n"],["\n width: 62px;\n height: 32px;\n min-width: 24px;\n background: ",";\n"])),r.theme.gray50),y=f.default(a.Text)(c||(c=n.__makeTemplateObject(["\n margin-bottom: 0;\n"],["\n margin-bottom: 0;\n"]))),v=f.default(a.Text)(d||(d=n.__makeTemplateObject([""],[""]))),T=f.default.span(s||(s=n.__makeTemplateObject(["\n margin-left: 4px;\n color: ",";\n"],["\n margin-left: 4px;\n color: ",";\n"])),r.theme.gray600),O=f.default.div(u||(u=n.__makeTemplateObject(["\n display: flex;\n align-items: center;\n line-height: 16px;\n\n svg {\n margin-right: 4px;\n }\n"],["\n display: flex;\n align-items: center;\n line-height: 16px;\n\n svg {\n margin-right: 4px;\n }\n"]))),q=f.default.label(g||(g=n.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n cursor: pointer;\n\n &.disabled {\n "," {\n opacity: 0.6;\n }\n "," {\n opacity: 0.95;\n }\n "," {\n color: ",";\n }\n "," {\n color: ",";\n }\n\n cursor: not-allowed;\n }\n"],["\n display: flex;\n flex-direction: row;\n cursor: pointer;\n\n &.disabled {\n "," {\n opacity: 0.6;\n }\n "," {\n opacity: 0.95;\n }\n "," {\n color: ",";\n }\n "," {\n color: ",";\n }\n\n cursor: not-allowed;\n }\n"])),j,k,y,r.theme.gray600,v,r.theme.gray400),I=f.default.div(m||(m=n.__makeTemplateObject(["\n position: absolute;\n top: 6px;\n left: ",";\n right: ",";\n svg {\n height: 20px;\n width: 20px;\n }\n"],["\n position: absolute;\n top: 6px;\n left: ",";\n right: ",";\n svg {\n height: 20px;\n width: 20px;\n }\n"])),(function(n){return n.left?"5.8px":"auto"}),(function(n){return n.left?"auto":"5.6px"}));exports.Switch=function(n){var t=n.checked,i=n.className,a=n.disabled,r=n.label,p=n.labelDescription,o=n.labelIcon,l=n.onChange,x=n.subtitle,h=n.switchIconLeft,c=n.switchIconRight,d=null==r?void 0:r.replace(/\s/g,"-").toLowerCase(),s=Boolean(h||c);return e.jsxs(q,{checked:t,className:b.default(i,{disabled:a}),htmlFor:d,onClick:function(){return!a&&l(!t)},children:[s?e.jsxs(_,{checked:t,children:[e.jsx(w,{checked:t,id:d}),e.jsx(I,{left:!0,children:h}),e.jsx(I,{children:c})]}):e.jsx(j,{checked:t,children:e.jsx(k,{checked:t,id:d})}),e.jsxs("div",{children:[e.jsxs(O,{children:[o,e.jsxs(y,{type:"input-label",children:[r,p&&e.jsx(T,{children:p})]})]}),x&&e.jsx(v,{type:"subtitle",children:x})]})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),n=require("react/jsx-runtime"),r=require("styled-components"),t=require("../card/Card.js"),i=require("../select/Select.js"),s=require("../stack/HStack.js"),c=require("../switch/Switch.js"),o=require("../text/Text.js"),a=require("../../icons/custom/theme/ThemeDarkIcon.js"),u=require("../../icons/custom/theme/ThemeLightIcon.js"),l=require("../../icons/NightIcon.js"),d=require("../../icons/SunnyIcon.js"),h=require("../../styles/constants/theme.js"),m=require("../../utils/hooks/useAminoTheme.js");function j(e){return e&&e.__esModule?e:{default:e}}require("../help-text/HelpText.js"),require("../select/_StyledReactSelect.js"),require("react"),require("react-select"),require("../checkbox/Checkbox.js"),require("framer-motion"),require("../../icons/CheckmarkIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js"),require("../../icons/CheckCircleIcon.js"),require("../../icons/DoubleChevronIcon.js"),require("../../icons/RemoveCircleIcon.js"),require("../../icons/RemoveIcon.js"),require("../stack/Stack.js"),require("clsx"),require("../../icons/flag-icon/useStableUniqueId.js"),require("uuid"),require("../../icons/icon-base/_ThemeIconBase.js"),require("../../Theme-61f4342c.js"),require("zod"),require("../../utils/hooks/useStorage.js"),require("../../utils/storage.js"),require("swr");var x,q,g=j(r),b=g.default.button(x||(x=e.__makeTemplateObject(["\n border: ",";\n color: ",";\n border-radius: ",";\n\n &:not([disabled]) {\n &:active,\n &:focus {\n outline: none;\n }\n }\n"],["\n border: ",";\n color: ",";\n border-radius: ",";\n\n &:not([disabled]) {\n &:active,\n &:focus {\n outline: none;\n }\n }\n"])),(function(e){return"2px solid ".concat(e.isActive?h.theme.blue400:"transparent")}),(function(e){return e.isActive?h.theme.primary:h.theme.textColor}),h.theme.radius8),p=g.default(t.Card)(q||(q=e.__makeTemplateObject(["\n background: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: ",";\n\n svg {\n height: 64px;\n width: 110px;\n box-shadow: ",";\n margin-bottom: ",";\n }\n"],["\n background: ",";\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: ",";\n\n svg {\n height: 64px;\n width: 110px;\n box-shadow: ",";\n margin-bottom: ",";\n }\n"])),h.theme.gray0,h.theme.space16,h.theme.v3ShadowLarge,h.theme.space16),f=[{label:"Light",value:"day"},{label:"Dark",value:"night"}];exports.ThemeSelect=function(e){var r=e.className,t=e.disabled,h=void 0!==t&&t,j=e.type,x=void 0===j?"select":j,q=m.useAminoTheme(),g=q.aminoTheme,y=q.setAminoTheme,k="day"===g;return n.jsxs(n.Fragment,{children:["cards"===x&&n.jsxs(s.HStack,{className:r,children:[n.jsx(b,{"data-theme":"day",isActive:"day"===g,onClick:function(){return y("day")},type:"button",children:n.jsxs(p,{children:[n.jsx(u.ThemeLightIcon,{}),n.jsx(o.Text,{type:"bold-label",children:"Light"})]})}),n.jsx(b,{"data-theme":"night",isActive:"night"===g,onClick:function(){return y("night")},type:"button",children:n.jsxs(p,{children:[n.jsx(a.ThemeDarkIcon,{}),n.jsx(o.Text,{type:"bold-label",children:"Dark"})]})})]}),"select"===x&&n.jsx(i.Select,{className:r,icon:function(){switch(g){case"day":default:return n.jsx(d.SunnyIcon,{});case"night":return n.jsx(l.NightIcon,{})}}(),isClearable:!1,isDisabled:h,onChange:function(e){return y((null==e?void 0:e.value)||"day")},options:f,value:f.filter((function(e){return e.value===g}))}),"toggle"===x&&n.jsx(c.Switch,{checked:k,className:r,disabled:h,onChange:function(){return!h&&y("day"===g?"night":"day")},switchIconLeft:n.jsx(l.NightIcon,{}),switchIconRight:n.jsx(d.SunnyIcon,{})})]})};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zonos/amino",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.16",
|
|
4
4
|
"description": "Core UI components for Amino",
|
|
5
5
|
"repository": "git@github.com:Zonos/amino.git",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"@mui/material": "^5.14.0",
|
|
22
22
|
"@radix-ui/react-slider": "^1.1.2",
|
|
23
23
|
"@types/topojson-client": "^3.1.1",
|
|
24
|
+
"clsx": "^2.0.0",
|
|
24
25
|
"d3-geo": "^2.0.2",
|
|
25
26
|
"fuse.js": "^6.6.2",
|
|
26
27
|
"highlight.js": "^11.8.0",
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"@emotion/styled": "^11.x",
|
|
42
43
|
"@graphiql/plugin-explorer": "^0.3",
|
|
43
44
|
"@graphiql/react": "^0.19",
|
|
45
|
+
"dayjs": "*",
|
|
44
46
|
"framer-motion": "^10.x",
|
|
45
47
|
"graphiql": "^3.0.1",
|
|
46
48
|
"graphql": "^16.x",
|
|
@@ -50,8 +52,7 @@
|
|
|
50
52
|
"react-dom": "^17.x || ^18.x",
|
|
51
53
|
"react-tooltip": "^4.x",
|
|
52
54
|
"styled-components": "^5.x",
|
|
53
|
-
"swr": "2.x"
|
|
54
|
-
"dayjs": "*"
|
|
55
|
+
"swr": "2.x"
|
|
55
56
|
},
|
|
56
57
|
"types": "all.d.ts"
|
|
57
58
|
}
|